Hi AutoIt-Community,
i found this nifty little scripting language some days ago and i love it
Anyway i've got a little problem while trying to get my script working.
I'm trying to read hexed data from an non-autoit .exe-File and replace this hex data with something else what is also in hex.
;So my first idea was reading the whole file..
$ahandle = FileOpen("C:\myexe.exe", 0)
$hex = Hex(BinaryString(FileRead($handle)))
FileClose($handle)
;... then using StringReplace to replace the hex searching for with another hexvalue ...
StringReplace($hex, "376869746530322E626E70", "0000000000000000000000")
; .. and then writing the new hex into a file called myexe_new.exe
$bhandle = FileOpen("C:\myexe_new.exe", 2)
FileWrite($bhandle, BinaryString($hex))
FileClose($bhandle)
Ok, this doesn't works as it was supposed to.
So, my question now is: is there some other - maybe better or at least working - way to do this or otherwise is there a way to fix my script? What did I wrong? Or is there even an existing script in these forums for this which i havn't found?
Thank you for reading and helping!