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 


[Help] Converting C++ Functions To Delphi

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

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 22, 2009 8:55 am    Post subject: [Help] Converting C++ Functions To Delphi Reply with quote

How do you convert special calls with __thiscall or __fastcall from C++ into delphi? as far as I know, there arn't any declares like this in delphi.

And knowing I fail at asm, I tried manually calling it and it fails. >.>
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Mar 22, 2009 12:25 pm    Post subject: Re: [Help] Converting C++ Functions To Delphi Reply with quote

dnsi0 wrote:
How do you convert special calls with __thiscall or __fastcall from C++ into delphi? as far as I know, there arn't any declares like this in delphi.

And knowing I fail at asm, I tried manually calling it and it fails. >.>


I'm no Delphi expert, but __thiscall is actually used in classes, so you could just shove your hook in a class. No idea about __fastcall though.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 22, 2009 12:29 pm    Post subject: Re: [Help] Converting C++ Functions To Delphi Reply with quote

Flyte wrote:
dnsi0 wrote:
How do you convert special calls with __thiscall or __fastcall from C++ into delphi? as far as I know, there arn't any declares like this in delphi.

And knowing I fail at asm, I tried manually calling it and it fails. >.>


I'm no Delphi expert, but __thiscall is actually used in classes, so you could just shove your hook in a class. No idea about __fastcall though.


I know that __thiscall is used in classes. So I decided that I should emulate the call with asm...

So mov ecx,[variable containing class ptr]
(pushes all the parameters onto the stack)
call function.

And besides delphi classes don't use __thiscall either. They just push the pointer as the first parameter on the stack
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