memory reading doesnt work?

10/25/2013 23:09 fear-x#1
i am trying to do some memory reading in autoit but i always get an empty result ?

anyone has an example of working memory read with pointer + offsets?

data goes like this :
Code:
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
  <CheatEntries>
    <CheatEntry>
      <ID>293</ID>
      <Description>"mob HP read"</Description>
      <Color>00FF00</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>"client.exe"+010768E8</Address>
      <Offsets>
        <Offset>480</Offset>
        <Offset>344</Offset>
        <Offset>10</Offset>
        <Offset>2C</Offset>
        <Offset>98</Offset>
      </Offsets>
    </CheatEntry>
  </CheatEntries>
</CheatTable>
is it posible to read memory in 32/64 bits? with same code?
10/25/2013 23:19 alpines#2
64 Bit not supported by NomadMemory.au3 or Pointer.au3, 32 Bit works fine. Try this
Code:
#RequireAdmin
#include <Pointer.au3>

Local $sModule = "ProcessName.exe", $pBase = 0x010768E8, $aOffsets[5] = [0x480, 0x344, 0x10, 0x2C, 0x98]

$hMemory = _MemoryOpen($sModule)
$aRead = _MemoryPointerRead($pBase, $hMemory, $aOffsets)
_MemoryClose($hMemory)

MsgBox(64, "Value", $aRead[UBound($aRead) - 1])
You replace the address at $pBase with the base pointer in cheat engine, it has always the same value and you can get it from CE if you double click it in the table, it maybe is 0x010768E8. If it doesn't work you can try to switch the offsets in the array. It may happen that I read these offsets wrong so you have to count from 0x98 to 0x480 I don't know.

[Only registered and activated users can see links. Click Here To Register...]
10/25/2013 23:23 fear-x#3
i tryed similar style alrdi and i tryed your script again ofc i changed the values but still got 0
10/25/2013 23:25 alpines#4
If the game is compiled as 64 Bit then you can't do anything with Pointer.au3.
10/25/2013 23:28 fear-x#5
the game is 32bit compiled. running pid is "client.exe*32" :)

i have something that does work...
Code:
SetPrivilege("SetDebugPrivilege", 1)
Global $smodule = "client.exe"

Func _game($function, $readoffout)
If $function == "CharName" Then
$openmem = _memoryopen($readoffout)
		$staticoffset = Dec("103C888")
		$baseaddr = _memorymodulegetbaseaddress($readoffout, $smodule)
		$finaladdr = "0x" & Hex($baseaddr + $staticoffset)
		Return _memoryread(_memoryread($finaladdr, $openmem) + 188, $openmem, "char[200]")
endif
EndFunc
but i have this piece from a year ago and i do not remember or understand how to get it to work with the table from first post... :( because i keep getting empty or 0
10/25/2013 23:28 alpines#6
Oh wait, I forgot to add the zero to the array, this may work:
Code:
#RequireAdmin
#include <Pointer.au3>

Local $sModule = "ProcessName.exe", $pBase = 0x010768E8, $aOffsets[5] = [0, 0x480, 0x344, 0x10, 0x2C, 0x98]

$hMemory = _MemoryOpen($sModule)
$aRead = _MemoryPointerRead($pBase, $hMemory, $aOffsets)
_MemoryClose($hMemory)

If IsArray($aRead) Then MsgBox(64, "Value", $aRead[UBound($aRead) - 1])
If it's still not working try to rearrange the array like [0, 0x98, 0x2C, 0x10, 0x344, 0x480].
10/25/2013 23:33 fear-x#7
tryed both to add the 0 and rearrange arrays.. no help.. read my post up though?

NEWS BREAKER :D !
Code:
#AutoIt3Wrapper_UseX64=n
#include <nomadmemory.au3>
$PID = ProcessExists("client.exe")
$sModule = "client.exe"
$openmem = _MemoryOpen($PID)

	If @error Then
		Exit
	EndIf

	Local $Offset[1]
        $Offset[0] = 0 ; Is ALWAYS 0.

	$StaticOffset = Dec("10768E8")

	$baseADDR = _MemoryModuleGetBaseAddress($PID, $sModule)
	$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)

	$r = _MemoryRead($finaladdr,$openmem)
	$r = _MemoryRead($r + 0x98,$openmem)
	$r = _MemoryRead($r + 0x2c,$openmem)
	$r = _MemoryRead($r + 0x10,$openmem)
	$r = _MemoryRead($r + 0x344,$openmem)
	$r = _MemoryRead($r + 0x480,$openmem)

	MsgBox(0, "", $r)
that WORKED FINE ! :) just need to test on 32bit system somehow.. hopefully works on 32bit too :)
10/26/2013 00:15 KDeluxe#8
Don't use the Pointer.au3. There are a few reasons why you should use my [Only registered and activated users can see links. Click Here To Register...] UDF.
alpines example is pretty bad. There's something called 'error handling'. The script itself can't work though. There are two simple errors
  1. The base isn't '0x010768E8', it's '"client.exe"+0x010768E8'. You have to get the module address and add 0x010768E8 to the result.
  2. The right offset array isn't '$aOffsets[5] = [0, 0x480, 0x344, 0x10, 0x2C, 0x98]', it's '$offsets[6] = [0, 0x98, 0x2C, 0x10, 0x344, 0x480]' ('$offsets[5] = [0x98, 0x2C, 0x10, 0x344, 0x480]' if you use my UDF).

The script you are using is bad, too. I won't tell you all the bad. Why? Because you should use my UDF.

10/26/2013 00:19 fear-x#9
thanks ! :) but the last script i posted works perfectly fine and i am very happy with it . :) but thanks for "advertising" yourself :D haha
10/26/2013 00:27 KDeluxe#10
Your script may work, but it's not good at all.
10/26/2013 00:28 fear-x#11
and why isnt it good ? :D
10/26/2013 00:51 KDeluxe#12
For what reason? Do you believe that your script is good? Or do you actually want to know why it is bad? Believe me and have a look at my script.
10/26/2013 01:05 fear-x#13
tell me why its bad? :D im not saying its good.. could be better .. but it works :D thats all that matters dude ;)
10/26/2013 11:21 berkay2578#14
Stop it KDeluxe, no one wants to use your base :D
10/27/2013 23:05 KDeluxe#15
People who doesn't care about if something works 'right'. And of course there are more scripts using the NomadMemory.au3/Pointer.au3. Perfect for C&P.