LoginSignup
1
3

More than 5 years have passed since last update.

powershell binary viewer

Posted at
binViewer.ps1
$enc = [System.Text.Encoding]::UTF8
#$enc = [System.Text.Encoding]::default

$list = Get-ChildItem "C:\Program Files\7-Zip" -Filter "*.txt"

$list | %{
   $file = $_
   $file.FullName
   $content = ( Get-Content $file.FullName -Encoding Byte -ReadCount 30)
   $content | %{
        $bytes = $_
        $tempx ="" 
        $bytes|%{
            $byte = $_
            $tempx += ( $byte.ToString("X").PadLeft(2,'0')+" ")
        }
        $temps = $enc.GetString($bytes).Replace("`r","").Replace("`n","").Replace("`f","").Replace("`v","")
        $tempx.PadRight(90,' ') +"`t"+ $temps
        #+"`r`n"
   } 
   #| Out-GridView
}
#pause

image.png

1
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3