Assembly Calling Convention: __fastcall (Patreon)
Published:
2022-02-17 07:10:12
Imported:
2023-09
Downloads
Content
Calling Convention: __fastcall
- Calling convention may be specified by the developer or added by the compiler as an optimization
- The Borland compiler (Delphi) uses a different version of __fastcall as the default calling convention
- Microsoft: first two DWORD arguments are passed in
ECX and EDX (left-to-right) - Borland: first three DWORD arguments are passed in
EAX, EDX and ECX (left-to-right) - Callee is responsible for stack cleanup
Practice Examples
Attached to this post is a copy of the HelloWorld PE file from our tutorial. You are encouraged to open this sample in IDA and identify the function calling conventions, pay close attention to how the variadic function is handled.