 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Wed Dec 23, 2009 2:17 am Post subject: C++ pointer |
|
|
so ive got this function
| Code: | __inline ULONG_PTR readpointer(ULONG_PTR* ulBase, INT nOffset){
if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) )
if ( !IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)) )
return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset);
return 0;
} |
and it works for a simple pointer, but i am trying to read a pointer with 2 seperate offsets
i tried this, hoping i could pull some random shit and make it work
| Code: | __inline ULONG_PTR readpointer(ULONG_PTR* ulBase, INT nOffset, INT nOffset2){
if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) )
if ( !IsBadReadPtr((VOID*)(((*(ULONG_PTR*)ulBase)+nOffset)+nOffset2), sizeof(ULONG_PTR)) )
return *(ULONG_PTR*)(((*(ULONG_PTR*)ulBase)+nOffset)+nOffset2);
return 0;
} |
anyone know how i could do this properly?
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Dec 23, 2009 3:41 am Post subject: |
|
|
ew
why don't you just use an array for the offsets?
also IsBadxx() calls are pretty iffy.
|
|
| Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Wed Dec 23, 2009 11:19 am Post subject: |
|
|
its fm kitterz source right ?
well, if u did it like thisi
DWORD base = 0x01
DWORD offset1 = 0x02
DWORD offset2 = 0x03
simple do base + offset 1 = DWORD baseoffset1
baseoffset1+offset2 = ur pointer
it will work like that, u can take a look at it, if kitterz source, at the mouse x position , in the set pointers value to the window
|
|
| 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
|
|