 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Dracons Newbie cheater
Reputation: 0
Joined: 08 Nov 2016 Posts: 16
|
Posted: Tue Nov 08, 2016 6:19 pm Post subject: [Delphi 7] Reading double pointers. |
|
|
Hello,
As I am trying to have some fun from programming and I am reading a lot, but I didn't find solution from my problems I am writing here.
Maybe from the beginning:
I am trying to make a something called "bot" to one of the privates server of Tibia. I did a quite nice job on normal client. By reading addresses and sending packets I am able to do things like auto heal, auto target, alarms etc.
After few weeks of working with normal Tibia Client I decided to learn little bit more about programming (delphi, cheat engine etc), so I am going to create a very similar bot, but on hmm.. converted client.
It is much bigger challenge, because in this client there are not a stable addresses. It means that addresses are getting change after every each time when I open client again.
The strange thing for me is that even integers in game (like health points) are not written in 4bytes value, but they are doubles.
On normal client it is very easy to read addresses by this method:
| Code: | function MemReadInteger(Address: Cardinal): Cardinal; //Read adress:value
var
ProcId: Cardinal;
tProc: THandle;
NBR: Cardinal;
value:integer;
begin
GetWindowThreadProcessId(FindWindow('TibiaClient',Nil), @ProcId);
tProc:= OpenProcess(PROCESS_ALL_ACCESS, False, ProcId);
ReadProcessMemory(tProc, Ptr(Address), @value, 4, NBR);
CloseHandle(tProc);
Result:=value;
end; |
So lets say... when address of health points was:
| Code: | | Player_HP = $5C6858; |
Whenever I wanted to read the value from this addres I made something like that (for example):
| Code: | procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(memreadinteger(player_Hp));
end; |
or just simply use timer and made things like that:
| Code: | | if memreadinteger(player_hp) <= then something |
Now as I said all values are written in "double" and I just don't know how to handle with them.
Can anyone help me?
Thanks.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Nov 08, 2016 6:34 pm Post subject: |
|
|
Change value to a double?and read 8 bytes instead? | Code: | | ReadProcessMemory(tProc, Ptr(Address), @value, 8, NBR); |
|
|
| Back to top |
|
 |
Dracons Newbie cheater
Reputation: 0
Joined: 08 Nov 2016 Posts: 16
|
Posted: Wed Nov 09, 2016 3:39 am Post subject: |
|
|
Okay, I tried how you said.
| Code: | function MemReadDouble(Address: Integer): Double; //Read adress:value
var
ProcId: Cardinal;
tProc: THandle;
NBR: Cardinal;
value:double;
begin
GetWindowThreadProcessId(FindWindow('TibiaClient',Nil), @ProcId);
tProc:= OpenProcess(PROCESS_ALL_ACCESS, False, ProcId);
ReadProcessMemory(tProc, Ptr(Address), @value, 8, NBR);
CloseHandle(tProc);
Result:=value;
end; |
Still not working ;<
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25808 Location: The netherlands
|
Posted: Wed Nov 09, 2016 4:36 am Post subject: |
|
|
stupid question, but you should be amazed by the things we see here:
do you call MemReadDouble instead of MemReadInteger?
also, change
| Code: |
ReadProcessMemory(tProc, Ptr(Address), @value, 8, NBR);
|
to
| Code: |
value:=87654321;
ReadProcessMemory(tProc, Ptr(Address), @value, 8, NBR);
|
if value is 87654321 then readprocessmemory has failed
_________________
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 |
|
 |
Dracons Newbie cheater
Reputation: 0
Joined: 08 Nov 2016 Posts: 16
|
Posted: Wed Nov 09, 2016 4:56 am Post subject: |
|
|
Lets say it works...
How can I then write value of that byte in for example spinedit1?
Spinedit1.value := (memreaddouble(playerhp)) doesn't work for obvious reason - it's not an integer.
I heard about this:
| Code: | var
i:integer;
d:Double;
begin
d:= memreaddouble(playerhp);
i:=round(d);
spinedit1.value := i;
end;
end. |
But it reads value of that "double" as 0.
@Edit.
Fixed. It works now. But the problem is that the address is getting change everytime I restart TibiaClient. I heard about pointers, but I don't know exactly how to use them.
This is what writes on that address of "double" [img]s21.postimg.org/56yw64ktj/112.jpg[/img]
|
|
| 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
|
|