Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how to read type float delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mikey_
How do I cheat?
Reputation: 0

Joined: 17 Nov 2014
Posts: 8

PostPosted: Sat Dec 13, 2014 9:06 am    Post subject: how to read type float delphi Reply with quote

how to read type float delphi from address 011AC958?
Code:

function readfloat(WindowTitle:Pansichar;address:integer):single;
var
    p : pointer;
    puffer : single;
    BytesRead: SIZE_T;
    WindowName,ProcessId,ThreadId,HandleWindow : integer;
   begin
        p := ptr(address);
        WindowName := FindWindow(nil,PWideChar(WindowTitle));
        ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
        HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
        ReadProcessMemory( HandleWindow, p , @puffer,sizeof(single), BytesRead); //READ
        closehandle(HandleWindow);
       readfloat := Puffer;
   end;

help please Embarassed



Screenshot_1.png
 Description:
 Filesize:  385 Bytes
 Viewed:  6919 Time(s)

Screenshot_1.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25805
Location: The netherlands

PostPosted: Sat Dec 13, 2014 9:11 am    Post subject: Reply with quote

just like that. But make sure you are running it as administrator and have SE_DEBUG_PRIVILEGE
(or try less access rights to OpenProcess )

_________________
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
View user's profile Send private message MSN Messenger
mikey_
How do I cheat?
Reputation: 0

Joined: 17 Nov 2014
Posts: 8

PostPosted: Sat Dec 13, 2014 9:13 am    Post subject: Reply with quote

Dark Byte wrote:
just like that. But make sure you are running it as administrator and have SE_DEBUG_PRIVILEGE
(or try less access rights to OpenProcess )

it reads but not true



Screenshot_2.png
 Description:
 Filesize:  803 Bytes
 Viewed:  6910 Time(s)

Screenshot_2.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25805
Location: The netherlands

PostPosted: Sat Dec 13, 2014 9:18 am    Post subject: Reply with quote

I think the read fails, and what you're seeing is the uninitialized variable
add puffer:=0; before ReadProcessMemory

And add some error checking to see what goes wrong
OpenProcess returns 0 on failure, and ReadProcessMemory returns false on failure

instead of PROCESS_ALL_ACCESS try PROCESS_VM_READ

_________________
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
View user's profile Send private message MSN Messenger
mikey_
How do I cheat?
Reputation: 0

Joined: 17 Nov 2014
Posts: 8

PostPosted: Sat Dec 13, 2014 9:59 am    Post subject: Reply with quote

Dark Byte wrote:
I think the read fails, and what you're seeing is the uninitialized variable
add puffer:=0; before ReadProcessMemory

And add some error checking to see what goes wrong
OpenProcess returns 0 on failure, and ReadProcessMemory returns false on failure

instead of PROCESS_ALL_ACCESS try PROCESS_VM_READ

Thanks this was apparently the problem Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites