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 


[Delphi] An address holding double (modifying it)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Sun Mar 29, 2009 8:34 am    Post subject: [Delphi] An address holding double (modifying it) Reply with quote

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?

_________________

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