Am trying to perform binary hex edit from the command line using only powershell. Have had partial success performing a hex replace with this snip. Problem springs up when
Probably the way most idiomatic to PowerShell would be:
$offset = 0x3C [byte[]]$bytes = Get-Content C:\OldFile.exe -Encoding Byte -Raw $bytes[$offset++] = 0xFF $bytes[$offset++] = 0xFF $bytes[$offset] = 0xFF ,$bytes |Set-Content C:\NewFile.exe -Encoding Byte