 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
xXHoTNoSXx How do I cheat?
Reputation: 0
Joined: 25 Nov 2011 Posts: 2
|
Posted: Fri Jul 15, 2011 7:06 am Post subject: Readprocessmemory how use pointer? |
|
|
i use this code in delphi
Quote: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:Pchar;
begin
HandleWindow :=FindWindow(nil,'Tibia');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,35);
readprocessmemory(hProcess,ptr($008296C4),buf,35,temp);
memmensagem.lines.Text:=(memmensagem.text + 'hoho: ' +(string(buf))+#13+#10);
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess);
end; |
Address of pointer: Tibia.exe+000696A8
Offset (Hex): 14
How use to get correct address and no error?
Thanks!
Sorry bad english!
edit------ or maybe with pointer {what's wrong?}
Quote: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:Pchar;
lpNumberOfBytesRead: DWORD;
begin
HandleWindow :=FindWindow(nil,'Tibia');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,35);
readprocessmemory(hProcess,pointer($004696A8),@buf,35,lpNumberOfBytesRead);
ReadProcessMemory(hProcess, pointer(Buf + $14), @Buf, 35, lpNumberOfBytesRead);
memmensagem.lines.Text:=(memmensagem.text + 'Account: ' +(string(buf))+#13+#10);
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess);
end; |
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Fri Jul 15, 2011 9:04 am Post subject: |
|
|
1: Indent your code
2: try to understand what you want to do
anyhow, in 32-bit a pointer is the same as a dword (4 bytes)
so replace
Code: |
readprocessmemory(hProcess,pointer($004696A8),@buf,35,lpNumberOfBytesRead);
|
with a version that reads 4 bytes in a dword type
then instead of buf+$14 do "that dword value + $14"
_________________
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 |
|
 |
xXHoTNoSXx How do I cheat?
Reputation: 0
Joined: 25 Nov 2011 Posts: 2
|
Posted: Fri Jul 15, 2011 9:40 am Post subject: |
|
|
using
Quote: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:Pchar;
lpNumberOfBytesRead: DWORD;
begin
HandleWindow :=FindWindow(nil,'Tibia');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,35);
readprocessmemory(hProcess,pointer($004696A8),@buf,35,lpNumberOfBytesRead);
ReadProcessMemory(hProcess, pointer(lpNumberOfBytesRead + $14), @Buf, 35, lpNumberOfBytesRead);
memmensagem.lines.Text:=(memmensagem.text + 'Account: ' +(string(lpNumberOfBytesRead))+#13+#10);
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess); |
and now, address is correct, but why error?
Ignore "Pinball" dont change the caption
but
why this error?
address+offset now i think is okay, but why this error?
Description: |
|
Filesize: |
22.46 KB |
Viewed: |
10025 Time(s) |

|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Fri Jul 15, 2011 9:51 am Post subject: |
|
|
as said in step 2: Try to understand what you are doing
you are still reading the 35 bytes stored at 004696A8 into buf
But now you are using the number of bytes read (35) as the value to add $14 to
_________________
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 |
|
 |
xXHoTNoSXx How do I cheat?
Reputation: 0
Joined: 25 Nov 2011 Posts: 2
|
Posted: Fri Jul 15, 2011 10:39 am Post subject: |
|
|
please, could you modify my code to it works right? i'm not understanding what I need to do, sorry for this ;s
Quote: |
var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:Pchar;
lpNumberOfBytesRead: DWORD;
begin
HandleWindow :=FindWindow(nil,'Tibia');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,35);
readprocessmemory(hProcess,pointer($004696A8),@buf,35,lpNumberOfBytesRead);
ReadProcessMemory(hProcess, pointer(lpNumberOfBytesRead + $14), @Buf, 35, lpNumberOfBytesRead);
memmensagem.lines.Text:=(memmensagem.text + 'Account: ' +(string(lpNumberOfBytesRead))+#13+#10);
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess); |
|
|
Back to top |
|
 |
Krähne Expert Cheater
Reputation: 0
Joined: 06 Jun 2010 Posts: 108 Location: Inside of my Kernel
|
|
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
|
|