h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Sun Mar 29, 2009 8:34 am Post subject: [Delphi] An address holding double (modifying it) |
|
|
Okay i've got an example in C++ for that, seems quite simple but since i do not work in C++ at all i am experiencing problems while trying to translate it to delphi:
Here what we have:
| Quote: | {
double* double_func_addr = (double*)0x025080A5;
*double_func_addr += frametime * (500/5);
} |
This code is being put in a hook of another function.
Ok this is my try in Delphi:
| Quote: | var
oldfunctohook,newfunctohook : procedure (frametime:single; something:cool;something2:single);cdecl;
double_func_addr : procedure (cur_val:double);cdecl;
...
@double_func_addr:=pointer($025080A5);
...
procedure myfunchook (frametime:single; something:cool;something2:single);cdecl;
var
lol:double;
begin
if getasynckeystate(VK_CAPITAL) > 0 then
begin
//messagebox(0,'called when you press caps lock','',0);
lol := frametime*100;
GlobalTime(lol);
end;
Newfunctohook(frametime,cool,cool);
end; |
What i am doing wrong?
_________________
|
|