Code: Select all
#include classmemory.ahk
StringToHex(String)
{
local Old_A_FormatInteger, CharHex, HexString
If !String
Return 0
;Save the current Integer format
Old_A_FormatInteger := A_FormatInteger
SetFormat, INTEGER, H
Loop, Parse, String
{
CharHex := Asc(A_LoopField)
StringTrimLeft, CharHex, CharHex, 2
HexString .= CharHex . " "
}
SetFormat, INTEGER, %Old_A_FormatInteger%
Return HexString
}
handle := new _ClassMemory("ahk_exe target.exe", "", hProcessCopy)
msgbox % stringtohex(handle.readstring(0x772b0610,5,utf-8))
Is there a good way to solve this?