| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Mar 22, 2009 8:55 am Post subject: [Help] Converting C++ Functions To Delphi |
|
|
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 |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Mar 22, 2009 12:25 pm Post subject: Re: [Help] Converting C++ Functions To Delphi |
|
|
| 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 |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Mar 22, 2009 12:29 pm Post subject: Re: [Help] Converting C++ Functions To Delphi |
|
|
| 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 |
|
 |
|