peewpw / Invoke-PSImage

Encodes a PowerShell script in the pixels of a PNG file and generates a oneliner to execute
MIT License
2.16k stars 397 forks source link

One liner doesn't generate #3

Closed MrPayne closed 6 years ago

MrPayne commented 6 years ago

I've got the conversion portion working, but when the second file is generated, there is no one-line string generated off of the IEX([System.Text.Encoding]::ASCII.GetString variable.

davidgerrard commented 6 years ago

For me, I got the one-liner to execute, but the GetString call was:

IEX([System.Text.Encoding]::ASCII.GetString($o[0..30])) and should have been:

IEX([System.Text.Encoding]::ASCII.GetString($o[0..33]))

peewpw commented 6 years ago

GetString definitely needed another byte in its array, but unless you had a one character script, that shouldn't have been the root cause here.