 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Mon Nov 05, 2007 1:51 am Post subject: |
|
|
How do i get the value from a pointer?
_________________
dont complain about my english...
1*1 = 2? |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 05, 2007 7:08 am Post subject: |
|
|
| ups2000ups wrote: | | How do i get the value from a pointer? |
The same way you would read from any other address.
A pointer just points to another location of memory. Read the pointer first, and then use the returned value as part of your next read.
Pointer = NewAddressLoc
NewAddressLoc+Offset = Address to read for the value you want.
This is taken from my memory engine I wrote in C++
| Code: | BOOL cMemory::ReadPtr(BYTE *pBaseAddress, DWORD iPtrOffset, DWORD* pStorage)
{
BOOL bRead = FALSE;
DWORD dwPointer = NULL;
DWORD dwValue = NULL;
bRead = ReadProcessMemory( m_hProc, pBaseAddress, &dwPointer, sizeof(DWORD), NULL );
if( !bRead )
return FALSE;
if( IsBadReadPtr( &dwPointer, 4 ) )
return FALSE;
bRead = ReadProcessMemory( m_hProc, (LPCVOID)(DWORD_PTR)(dwPointer+iPtrOffset), &dwValue, sizeof(DWORD), NULL );
if( !bRead )
return FALSE;
*pStorage = dwValue;
return bRead;
} |
You should be able to get the jist of what it's doing and convert it to other languages if needed.
_________________
- Retired. |
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Mon Nov 05, 2007 8:52 am Post subject: |
|
|
well whats wrong with this script then?
| Code: |
procedure TForm1.Timer6Timer(Sender: TObject);
var address:dword;
value3: dword;
x:dword;
newvalue:string;
begin
readprocessmemory(processhandle,pointeR($ca337c+$3b8),@value3,4,x);
newvalue:=intTostr(Value3);
edit3.Text:=newvalue;
end; |
_________________
dont complain about my english...
1*1 = 2? |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Nov 05, 2007 9:29 am Post subject: |
|
|
read pointer method is:
-Getting 4 bytes of an address .
-Add the offset.
-Read the result.
| Code: |
procedure TForm1.Timer6Timer(Sender: TObject);
var address:dword;
value3: dword;
x:dword;
newvalue:string;
begin
readprocessmemory(processhandle,pointeR($ca337c),@value3,4,x);
readprocessmemory(processhandle,pointeR($value3+$3b8),@x,4,x);
newvalue:=intTostr(x);
edit3.Text:=newvalue;
end;
|
|
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Nov 05, 2007 1:06 pm Post subject: Re: Read 4byte address? |
|
|
| ups2000ups wrote: | well down here i trying to update the value for a 4byte address
some1 can tell me whats wrong?
when i trying to update the value it update into a "byte" value
im sorry for begging alot right now but i trying to learn (i learn best when i work with it)
| Code: |
procedure TForm1.Button12Click(Sender: TObject);
var address:dword;
value3: dword;
x:dword;
newvalue:string;
begin
address:=StrToInt('$'+edit2.text);
case combobox2.ItemIndex of
2: //4 byte
begin
readprocessmemory(processhandle,pointeR(Address),@value3,4,x);
newvalue:=intTostr(x);
edit3.Text:=newvalue;
end;
end;
end;
|
|
try to take the value from value3 or check if u get the right handle.
here is my code:
| Code: | procedure TForm1.Button1Click(Sender: TObject);
var address:dword;
value: integer;
NoNeedThisTime:dword;
begin
address:=StrToInt('$00400040');
if readprocessmemory(GetCurrentProcess,pointer(address),@value,4,NoNeedThisTime) then begin
caption:=format('%x',[value]);
end; |
|
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Mon Nov 05, 2007 1:29 pm Post subject: Re: Read 4byte address? |
|
|
| HolyBlah wrote: | | ups2000ups wrote: | well down here i trying to update the value for a 4byte address
some1 can tell me whats wrong?
when i trying to update the value it update into a "byte" value
im sorry for begging alot right now but i trying to learn (i learn best when i work with it)
| Code: |
procedure TForm1.Button12Click(Sender: TObject);
var address:dword;
value3: dword;
x:dword;
newvalue:string;
begin
address:=StrToInt('$'+edit2.text);
case combobox2.ItemIndex of
2: //4 byte
begin
readprocessmemory(processhandle,pointeR(Address),@value3,4,x);
newvalue:=intTostr(x);
edit3.Text:=newvalue;
end;
end;
end;
|
|
try to take the value from value3 or check if u get the right handle.
here is my code:
| Code: | procedure TForm1.Button1Click(Sender: TObject);
var address:dword;
value: integer;
NoNeedThisTime:dword;
begin
address:=StrToInt('$00400040');
if readprocessmemory(GetCurrentProcess,pointer(address),@value,4,NoNeedThisTime) then begin
caption:=format('%x',[value]);
end; |
|
aww man if you could tell me i used the wrong thing it could saved me 2h from searching at google lolz
Thanks again =) but this time i cant rep you
_________________
dont complain about my english...
1*1 = 2? |
|
| 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
|
|