Programming

x64 parameter passing

daehee87 2013. 6. 24. 16:23

Note these for reversing x64 binary.


1. Windows x64 parameter passing registers

RCX - RDX - R8 - R9


2. Linux x64 parameter passing registers

RDI - RSI - RDX - RCX - R8 - R9


86-64Microsoft x64 calling convention[9]Windows (Microsoft Visual C++GCC,Intel C++ Compiler, Embarcadero compiler), UEFIRCX/XMM0, RDX/XMM1, R8/XMM2, R9/XMM3RTL (C)CallerStack aligned on 16 bytes. 32 bytes shadow space on stack. The specified 8 registers can only be used for parameters 1 through 4.
System V AMD64 ABI[11]GNU/LinuxBSDMac OS X (GCCIntel C++ Compiler)RDI, RSI, RDX, RCX, R8, R9, XMM0–7RTL (C)CallerStack aligned on 16 bytes boundary. Red zone below stack.