View previous topic :: View next topic |
Author |
Message |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Sun Nov 18, 2007 6:01 am Post subject: WriteProcessMemory - using pointers - value changing ? |
|
|
I've started making a simple trainer. But i don't know why exactly when i use pointer (i am not sure if it is) but it does not work.
I don't get compiling errors but whenever i press the button to inject the value it just does not change to 1000 (in step two CE tutorial) it does nothing
But if i don't use pointer method and directly change the addres it just works fine...
So how to use pointers with writeprocessmemory in "the right way" ?
_________________
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Sun Nov 18, 2007 6:05 am Post subject: |
|
|
first do a readprocessmemory on 459138
and add the value 320 to it
then write the address you get as result with the value you like
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Sun Nov 18, 2007 6:11 am Post subject: |
|
|
Can you give me an example if I use this code:
Code: | Function GetAddyfrmpointer(baseaddress:dword;offset:dword):dword;
var a: dword;
x: dword;
i: integer;
offsetcount: integer;
offsets:array of dword;
b:integer;
maxid:integer;
begin
offsetcount:=1;
b:=0;
setlength(offsets,1);
offsets[b]:=offset;
a:=baseaddress;
i:=0;
while (i<offsetcount) do
begin
if not readprocessmemory(processhandle,pointer(a),@a,4,x) then exit;
inc(a,offsets[i]);
inc(i);
result:=a
end;
end; |
I mean where to use "a" in writeprocessmemory (i think i need "a" which will be $xxxxxx+320)
Or i am wrong ?
_________________
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Nov 18, 2007 9:53 am Post subject: |
|
|
Read the value of 00459138 into a buffer then + the offset to it. Then write your value to the address stored in the buffer.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Sun Nov 18, 2007 1:57 pm Post subject: |
|
|
if you use GetAddyfrmpointer then you call it like:
writeprocessmemory(processhandle,pointer(GetAddyfrmpointer($459138,$320)),@value,4,write);
of course, GetAddyfrmpointer only supports level1 pointers, so level2 you have to do manually
also, look at the add address window, it explains how it works:
459138 contains the value d62450
d62450+320=d62770
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
Uzeil Moderator
Reputation: 6
Joined: 21 Oct 2006 Posts: 2411
|
Posted: Mon Nov 19, 2007 12:56 am Post subject: |
|
|
Technically, GetAddyfrmpointer can support as many level pointers as it likes, by simply being called again.
Code: | for i:=0 to length(offsets)-1 do
address:=GetAddyfrmpointer(address,offsets[i]); |
EDIT:
I guess I should add that GetAddyfrmpointer can be trimmed down to:
Code: | Function GetAddyfrmpointer(baseaddress:dword;offset:dword):dword;
var a: dword;
begin
result:=0;
if readprocessmemory(processhandle,pointer(baseaddress),@a,4,nil) then
result:=a
end; | And if you can pass @result as a param instead of making a variable(not sure if Delphi will allow it), then there's another two lines down and some memory. I'd suggest using an if statement for the return of 0.
_________________
|
|
Back to top |
|
 |
|