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 


WPM float delphi?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Fri Oct 03, 2008 2:48 am    Post subject: WPM float delphi? Reply with quote

im working on a bot/trainer for a game right now and i got a problem..

when i try to write a float value to the game the value on the address wont change
but if i try to read the address i get the value

i can write to other addresses with the exactly the same code except i dont use float

i can change the address with cheatengine

i have been trying to use
real, single, double, extended, comp, currency
but none worked

so why dosent it work .. ?

Code:

var
Val: single;
begin
---------------

Val:=strtofloat(edit1.text);
writeprocessmemory(HandleWindow,pointer(Address),@Val,4,NoNeedThisTime);
end;


Code:

var
Val: single;
begin
---------------

readprocessmemory(HandleWindow,pointer(Address),@Val,4,NoNeedThisTime);
Label3.caption:=floattostr(val);
end;

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Oct 03, 2008 8:38 am    Post subject: Reply with quote

Note that a handle to a window is not the same as a handle to a process. I say this because of the name of your hProcess (HandleWindow).
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Fri Oct 03, 2008 8:42 am    Post subject: Reply with quote

Slugsnack wrote:
Note that a handle to a window is not the same as a handle to a process. I say this because of the name of your hProcess (HandleWindow).


i always use the same code when i edit memory and this is the only time it dosent work

it has to be something with the float.
notice i edit the memory by windowtitle also tried the class name

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Oct 03, 2008 8:49 am    Post subject: Reply with quote

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

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

PostPosted: Fri Oct 03, 2008 8:51 am    Post subject: Reply with quote

that it is float isn't a problem. It's still a 32-bit value , only the interpretation is different.

Add some checks to see that the write succeeds. (check if the result=true and that NoNeedThisTime becomes 4)

Also try instead of val the name value. I doubt it it the cause of this (since local tends to override global) but val is the name of an internal function

and make sure that address is in both cases the same. Reading from a different address than you wrote to can have different results...


If you find out the write fails, try making the memory writable with virtualprotectex

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Fri Oct 03, 2008 10:21 am    Post subject: Reply with quote

i already tested everything so i will try use virtualprotectex thanks Smile

EDIT
it worked thanks Very Happy

_________________
dont complain about my english...
1*1 = 2?
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