Help with reading memory with offsets from game

11/20/2013 19:57 mlukac89#16
ok now works :)

but if i start script first and then game it throw me error

Can't get ModuleGetBaseAdress! @error:21, @extended:299

but when i press OK on msgbox then it work normal, shows me adress and score in tooltip

and if i start game first then script, no errors

And tell me pls if i want use multiple pointers do i need to change only this

Code:
Dim $offsets[1] = [0x30] ; to 
Dim $offsets[3] = [0x30, 0xc4, 0x280]
and this

Code:
("Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[1], 0, 0) ; to
("Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[3], 0, 0)



and have next problem with this

Code:
; write new score to game memory
Func _setScrore()
	Local $unicode
	$read = GUICtrlRead($Input2) ; read data from input box
	;_KDMemory_WriteProcessMemory($handles, $baseAddress, $type, $value, $offsets = 0)
	;_KDMemory_WriteProcessMemory($handles, $address, "dword", $read, $offsets[1])
	_KDMemory_WriteProcessString($handles, $address, $read, $offsets, $unicode = 0)
EndFunc
when i write number 1 in input and press button to add score it gives 49 not 1, why is that ?






and 1 more problem i have
when i start script first it show me game is not runnning and score is set to 0,
and when i start game it say game is running but not reading score from game

but if i start game first and then script it works normal

So my question is what i need to make to program automatic hook on game when i open game = read data / close / open game again read data
because if game crash i need to turn off script and first start game then open script but i want to open script first then game

here is all code for script

11/21/2013 00:50 KDeluxe#17
If you want to use a pointer with more than one offset, you have to add the offsets to the array.
Code:
Dim $offsets[5] = [0, 1, 2, 3, 4]
_KDMemory_ReadProcessMemory() will still return an array with two elements. The first element is the address and the second element is the value of the address.

Quote:
and if i start game first then script, no errors
[...]
and 1 more problem i have
when i start script first it show me game is not runnning and score is set to 0,
and when i start game it say game is running but not reading score from game

but if i start game first and then script it works normal

So my question is what i need to make to program automatic hook on game when i open game = read data / close / open game again read data
There are a few errors in your script. My example works fine. But that's easy to explain. The process ID identifies a running process and is unique. If the process isn't running, there won't be a process ID (= 0). You have to get the process ID constantly. Just put the line in the While loop.

Quote:
when i write number 1 in input and press button to add score it gives 49 not 1, why is that ?
The address 'holds' an integer. 49 is the character code for '1'. You have to use the _KDMemory_WriteProcessMemory() function.

I updated my UDF. Download the new version. [Only registered and activated users can see links. Click Here To Register...]
11/21/2013 16:25 mlukac89#18
OK thx for help now is all work fine :)