 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 6:37 pm Post subject: Reading a Pointer Value? [C++] |
|
|
I want to be able to read a pointer value.
So in asm it would be like
DWORD dReturn;
_asm {
mov esi,[PointerAddy]
mov esi,[esi]
mov edx,[PointerOffset]
mov ebx,[esi+edx]
mov [dReturn],ebx
}
but im sure thats wrong, cuz the game crash's...
i also wanna try using ReadProcessMemory for it
ReadProcessMemory( hMaple, (LPVOID)&PointerAddy, (LPVOID)&dReturn, sizeof(PointerAddy), NULL );
DWORD AddOffset = dReturn + PointerOffset;
ReadProcessMemory( hMaple, (LPVOID)&AddOffset, (LPVOID)&Value, sizeof(AddOffset), NULL );
but this definintly doesnt give me the value.. or maybe i just got the wrong pointers
help is appreciated.
-Lurc
_________________
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Feb 28, 2008 6:49 pm Post subject: |
|
|
From what I can see, you are using the addresses incorrectly, you are trying to pass the address of the storage variable and not its value. Instead, write:
Code: | ReadProcessMemory( hMaple, (BYTE*)PointerAddy, &dReturn, sizeof(DWORD), NULL );
DWORD AddOffset = dReturn + PointerOffset;
ReadProcessMemory( hMaple, (BYTE*)AddOffset, &Value, sizeof(AddOffset), NULL ); |
I also suggest not dumping the end result into something you are using already. Instead make a new variable to hold that value.
_________________
- Retired. |
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 6:51 pm Post subject: Re: Reading a Pointer Value? [C++] |
|
|
Code: | #define ReadPtrVal(x,y,z) *((z *) (x + y))
int val = ReadPtrVal(pointer, offset, int); |
Or do you mean multi-level pointers?
Note: Injected dll.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Feb 28, 2008 6:54 pm Post subject: Re: Reading a Pointer Value? [C++] |
|
|
Flyte wrote: | Code: | #define ReadPtrVal(x,y,z) *((z *) (x + y))
int val = ReadPtrVal(pointer, offset, int); |
Or do you mean multi-level pointers?
Note: Injected dll. |
Based on what he asked, (using RPM) I figured it was from a stand alone trainer type thing.
_________________
- Retired. |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 6:57 pm Post subject: |
|
|
Here's my code.
Trying to read the Channel Pointer
Code: | void ReadChannel()
{
DWORD Address, Read, Value;
TCHAR Writeto[MAX_PATH];
HANDLE hMaple = GetCurrentProcess();
if ( !hMaple ) { MessageBox( hWnd, L"Unable to get handle", szError, MB_OK | MB_ICONERROR ); return; }
ReadProcessMemory( hMaple, (BYTE*)0x00850468, &Address, sizeof(DWORD), NULL );
Read = Address + 0x20C4;
ReadProcessMemory( hMaple, (BYTE*)Read, &Value, sizeof(Read), NULL );
_itot_s( Value, Writeto, 15, 10 );
SetDlgItemText( hWnd, ID_STATIC1, Writeto );
} |
I get a value of 13009xxxx <-- something like that.
So im guessing my pointers wrong, or im going about doing this wrong...
Edit: wo, missed 2 posts... lmao
its an injected dll
thats why i tried inline asm first... but since using RPM works fine in ms i just decided to try it too
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 7:04 pm Post subject: |
|
|
Ok, ReadProcessMemory isn't needed in an injected dll, you can do manual reads.
(I can notice it is injected because of: HANDLE hMaple = GetCurrentProcess(); )
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 7:09 pm Post subject: |
|
|
Alright i tried your method
Code: | void ReadChannel()
{
DWORD Value = ReadPtrVal( 0x00850468, 0x20C4, DWORD );
TCHAR Writeto[MAX_PATH];
_itot_s( Value, Writeto, 15, 10 );
SetDlgItemText( hWnd, ID_STATIC1, Writeto );
} |
i got a number like 9779784
so its my pointer.... thats definintly wrong... anyone got the correct channel pointer?
the one i got: Pointer: 0x00850468, Offset: 0x20C4
using these
Channel Pointer - A1 ? ? ? ? 8B 80 ? ? ? ? 89 85 ? ? ? ? 33 C0
Channel Offset - 8B 80 ? ? ? ? 89 85 ? ? ? ? 33 C0 89 45 ?
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 7:14 pm Post subject: |
|
|
Is this a multi-level pointer? I don't play maple, so I don't know much about this "channel pointer".
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 7:17 pm Post subject: |
|
|
lmao, i dont play it either, but i dont think its a mutlilevel pointer.
heres a pic of the pointer and offset?
Description: |
|
Filesize: |
55.02 KB |
Viewed: |
7544 Time(s) |

|
_________________
Last edited by lurc on Fri Feb 29, 2008 9:36 am; edited 1 time in total |
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 7:24 pm Post subject: |
|
|
Code: | value = *((int *) (*((unsigned long *) 0x00850468) + 0x204C)) |
That's assuming the channel is actually stored in int form.
Edit: Small error with the offset value.
Last edited by Flyte on Thu Feb 28, 2008 8:18 pm; edited 2 times in total |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 7:29 pm Post subject: |
|
|
Now im getting randomly generated numbers..
every couple seconds it changes value.
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 8:20 pm Post subject: |
|
|
lurc wrote: | Now im getting randomly generated numbers..
every couple seconds it changes value. |
I accidentally used a messed up offset value, fixed now.
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Feb 28, 2008 8:29 pm Post subject: |
|
|
Woot! it works! thanks Flyte
_________________
|
|
Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Feb 28, 2008 8:40 pm Post subject: |
|
|
I'm thinking the asm in the first post was wrong, but then again, your pointer might also be wrong.
Code: |
_asm {
mov esi,[PointerAddy]
mov esi,[esi]
mov edx,[PointerOffset]
mov ebx,[esi+edx]
mov [dReturn],ebx
}
|
Shouldn't it be
Code: |
mov esi,[Pointer]
mov edx,[Offset]
lea ebx, [esi+edx]
mov [dReturn],ebx
|
I might be wrong about this, but I also might not.
_________________
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 28, 2008 9:15 pm Post subject: |
|
|
samuri25404 wrote: | I'm thinking the asm in the first post was wrong, but then again, your pointer might also be wrong.
Code: |
_asm {
mov esi,[PointerAddy]
mov esi,[esi]
mov edx,[PointerOffset]
mov ebx,[esi+edx]
mov [dReturn],ebx
}
|
Shouldn't it be
Code: |
mov esi,[Pointer]
mov edx,[Offset]
lea ebx, [esi+edx]
mov [dReturn],ebx
|
I might be wrong about this, but I also might not. |
He said he got it to work, so the pointer was fine, it was just the way he was implementing it.
Also:
Code: | mov eax, dword [0x00850468]
mov ax, word [eax+0x204C]
mov word [channel], ax
channel dw ? |
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|