AndSoW Posted March 25, 2023 Posted March 25, 2023 (edited) hi! Hello, everyone! Would like to ask, this is aarido source code, with AU3 how to express? thank you aarido source code: import process; import console; prcs = process.find("WeChat.exe") Datapointer = 0x0737CF54//The address of the structure of the two-dimensional code, since the offset has been found, the address will be changed to offset the corresponding address on the line Addres = prcs.readNumber(Datapointer) long = prcs.readNumber(Datapointer + 0x4) data = prcs.readString(Addres, long) string.save("D:\aardio\temp\1.png", data) string.save("D:\aardio\temp\1.txt", long) At present, I have used AU3 to calculate the address and length using the cardinality, and can not use the address and length to obtain the data returned by dll again! autoit source code: #NoTrayIcon #RequireAdmin $CurProcID = ProcessExists("WeChat.exe") If Not $CurProcID Then MsgBox(4096, "", "not process.") Exit EndIf $Handle = _MemoryOpen($CurProcID) $Addres=0x0737CF54 $Address = _MemoryRead("0x" & Hex($Addres), $Handle) $long = _MemoryRead("0x" & Hex($Addres+0x4), $Handle) ;---------------------------------------------------------------------------- ;So here is this code and I don't know how to express it in AU3, okay: ;data = prcs.readString(Addres, long) ;----------------------------------------------------------------------------- $data = DllCall("kernel32.dll", "int", "GetCurrentCw", 'int', $Handle,"dword", DllStructGetPtr($Address),"ptr",DllStructGetPtr($long),"wstr","");I can't get the data here ConsoleWrite($data);I can't get the data here MsgBox(0,"",$long) ;Local $hFile = FileOpen('D:\aardio\temp\1.png',2+8+16) ;FileWrite($hFile, $data) ;FileClose($hFile) ;================================================================================================= Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword') If Not IsArray($ah_Handle) Then SetError(1) Return 0 EndIf Local $v_Buffer = DllStructCreate($sv_Type) If @Error Then SetError(@Error + 1) Return 0 EndIf DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') If Not @Error Then Local $v_Value = DllStructGetData($v_Buffer, 1) Return $v_Value Else SetError(6) Return 0 EndIf EndFunc Edited March 26, 2023 by AndSoW
Developers Jos Posted March 25, 2023 Developers Posted March 25, 2023 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Zedna Posted March 26, 2023 Posted March 26, 2023 I think maybe something like this (only concept) ... $type = 'byte[' & $long & ']' $data = _MemoryRead("0x" & Hex($Addres+0x8), $Handle, $type) ; ... Resources UDF ResourcesEx UDF AutoIt Forum Search
Solution AndSoW Posted March 26, 2023 Author Solution Posted March 26, 2023 (edited) 2 hours ago, Zedna said: I think maybe something like this (only concept) ... $type = 'byte[' & $long & ']' $data = _MemoryRead("0x" & Hex($Addres+0x8), $Handle, $type) ; ... thank! Edited March 26, 2023 by AndSoW
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now