|
You last visited: Today at 14:47
Advertisement
memory reading doesnt work?
Discussion on memory reading doesnt work? within the AutoIt forum part of the Coders Den category.
10/25/2013, 23:09
|
#1
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
memory reading doesnt work?
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
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
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.
|
|
|
10/25/2013, 23:23
|
#3
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
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
|
#4
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
If the game is compiled as 64 Bit then you can't do anything with Pointer.au3.
|
|
|
10/25/2013, 23:28
|
#5
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
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
|
#6
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
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
|
#7
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
tryed both to add the 0 and rearrange arrays.. no help.. read my post up though?
NEWS BREAKER  !
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
|
#8
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Don't use the Pointer.au3. There are a few reasons why you should use my  UDF.
alpines example is pretty bad. There's something called 'error handling'. The script itself can't work though. There are two simple errors - The base isn't '0x010768E8', it's '"client.exe"+0x010768E8'. You have to get the module address and add 0x010768E8 to the result.
- 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.
Code:
#AutoIt3Wrapper_UseX64=n ; 32 Bit application
;~ #AutoIt3Wrapper_UseX64=y ; 64 Bit application
#RequireAdmin
#include <KDMemory.au3>
$processName = "client.exe"
$processId = ProcessExists($processName)
If $processId == 0 Then
MsgBox(48, "Error", $processName & " doesn't exists!")
Else
$handles = _KDMemory_OpenProcess($processId)
If @error Then
MsgBox(48, "Error", "Can't open " & $processName & "! @error: " & @error)
Else
Dim $offsets[5] = [0x98, 0x2C, 0x10, 0x344, 0x480]
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $processName) + 0x010768E8 ; probably 0x014768E8
If @error Then
MsgBox(48, "Error", "Can't get ModuleBaseAddress! @error: " & @error & ", @extended: " & @extended)
Else
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, 'DWORD', $offsets)
If @error Then
MsgBox(48, "Error", "Can't read memory! @error: " & @error & ", @extended: " & @extended)
Else
MsgBox(64, "Info", "Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[1])
EndIf
EndIf
_KDMemory_CloseHandles($handles)
EndIf
EndIf
|
|
|
10/26/2013, 00:19
|
#9
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
thanks !  but the last script i posted works perfectly fine and i am very happy with it .  but thanks for "advertising" yourself  haha
|
|
|
10/26/2013, 00:27
|
#10
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Your script may work, but it's not good at all.
|
|
|
10/26/2013, 00:28
|
#11
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
and why isnt it good ?
|
|
|
10/26/2013, 00:51
|
#12
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
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
|
#13
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
|
tell me why its bad?  im not saying its good.. could be better .. but it works  thats all that matters dude
|
|
|
10/26/2013, 11:21
|
#14
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
|
Stop it KDeluxe, no one wants to use your base
|
|
|
10/27/2013, 23:05
|
#15
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
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.
|
|
|
 |
Similar Threads
|
Memory reading doesnt work
10/09/2012 - AutoIt - 3 Replies
<?xml version="1.0"?>
<CheatTable CheatEngineTableVersion="10">
<CheatEntries>
<CheatEntry>
<Description>"max HP"</Description>
|
[Vb.NET] WoW Memory Reading
11/20/2010 - World of Warcraft - 1 Replies
Hallo,
Ist es irgendwie möglich mit VB.NET die Memory von WoW auszulesen wie bei C# mit der BlackMagic.dll
Danke m vorraus
|
VB 08 Memory Reading
07/06/2010 - .NET Languages - 2 Replies
Hallo,
Ich wollte in einem Spiel die HP auslesen lasse, dabei bin ich aber auf ein Problem gestoßen.
Das Problem ist, das die Pointer Adresse so aussieht : "Hero.exe+"..
http://www.imagebanana.com/img/o0org9ha/Problem.p ng
Kann mir vllt. jmd sagen, wei ich das hinbekomme ?
|
Memory reading help...
02/10/2007 - Conquer Online 2 - 1 Replies
Hi,
I need to read the amount of arrows on an archer (0-500). I have the pointer and offset, and i can get the right number in cheat engine, however whenever i try to read it from autohotkey i always get 0. Don't know why. I've always read 4 byte data before so i don't really know if i have the right code for 2 byte data. Here's the autohotkey code
ExtInt(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4); From AutoHotKey Help
{
Loop %pSize%
result += *(&pSource +...
|
All times are GMT +1. The time now is 14:48.
|
|