Я занимаюсь автоматизацией запасов в магазине, в котором работаю.
Мне нужно прочитать адрес и узнать количество товаров, проданных за неделю.
Мне удалось найти BaseAddress и Offset:
0x0ac22c78 0x380
Я использую код autoit для чтения.
Но он только читает сгенерированный адрес, а не читает с использованием BaseAddress.
Как найти сгенерированный адрес?
Код:
Может быть в C # или C ++
Я просто хочу найти сгенерированный адрес.
Local $iPid = WinGetProcess("Store")
Local $iAddress = 0x0AFDE298
If $iPid = -1 Then
ConsoleWrite("+++ Failed to get process PID. Open good process or change parameter in WinGetProcess func." & @CRLF)
Exit
EndIf
Local $hHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $iPid)
If @error Then
ConsoleWrite("+++ Failed to open process memory for FULL_ACCESS. Error is " & @error & @CRLF)
Exit
EndIf
Local $tagStruct = "struct;double var1;endstruct"
Local $sStruct = DllStructCreate($tagStruct)
If @error Then
ConsoleWrite("+++ Failed to create $sStruct. Error is " & @error & @CRLF)
Exit
EndIf
DllCall("kernel32.dll", 'int', 'ReadProcessMemory', 'int', $hHandle[0], 'int', $iAddress, 'ptr', DllStructGetPtr($sStruct), 'int', DllStructGetSize($sStruct), 'int', '')
If @error Then
ConsoleWrite("+++ Failed to Read Process Memory. Error is " & @error & @CRLF)
Exit
EndIf
Local $vRet = DllStructGetData($sStruct, "var1")
If @error Then
ConsoleWrite("+++ Failed to Get data from $sStruct. Error is " & @error & @CRLF)
Exit
EndIf
ConsoleWrite("++ Successfully read memory at addr 0x" & Hex($iAddress) & " value is " & $vRet & @CRLF)