| View previous topic :: View next topic |
| Author |
Message |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Fri Oct 03, 2008 2:48 am Post subject: WPM float delphi? |
|
|
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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Oct 03, 2008 8:38 am Post subject: |
|
|
| 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 |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Fri Oct 03, 2008 8:42 am Post subject: |
|
|
| 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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Oct 03, 2008 8:49 am Post subject: |
|
|
| GetLastError |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25989 Location: The netherlands
|
Posted: Fri Oct 03, 2008 8:51 am Post subject: |
|
|
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 |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
|
| Back to top |
|
 |
|