Взятый из примера, который я видел недавно:
# Description: set your.exe resolution 0 to any x/y specified # By knowning the offset for these values hard coded in your # executable # - None of this is real world... example only Set-Location(Split-Path $MyInvocation.MyCommand.Path) # Prompt resolution $resolutionX = Read-Host -Prompt "Width" $resolutionY = Read-Host -Prompt "Height" # Resolution Z is just hard coded as 32 # Patch bytes $bytes = [System.IO.File]::ReadAllBytes("your.exe") # Arbitrary locations and values for example $offsetX = 0x0039CA70 $offsetY = $offsetX + 4 $offsetZ = $offsetY + 4 $resolutionX = [BitConverter]::GetBytes([Int16]$resolutionX) $resolutionY = [BitConverter]::GetBytes([Int16]$resolutionY) $resolutionZ = [BitConverter]::GetBytes([Int16]32) # SMASH your new values into the exe $bytes[$offsetX] = $resolutionX[0] $bytes[$offsetX+1] = $resolutionX[1] $bytes[$offsetY] = $resolutionY[0] $bytes[$offsetY+1] = $resolutionY[1] $bytes[$offsetZ] = $resolutionZ[0] # And save the result [System.IO.File]::WriteAllBytes("your.exe", $bytes) Read-Host -Prompt "Press Enter to exit"