Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: implement Windows X86 thiscall #8

Open
gynt opened this issue May 31, 2024 · 0 comments
Open

Feature request: implement Windows X86 thiscall #8

gynt opened this issue May 31, 2024 · 0 comments

Comments

@gynt
Copy link

gynt commented May 31, 2024

Basically, the first argument to a function specified as a thiscall (calling convention, attributes(thiscall)) should be placed into ECX, all other arguments are pushed to the stack, the callee does stack cleanup. It is a windows stdcall with the first argument passed to ecx. This feature would allow calling into C++ libraries.

// Calling this function:
attributes(thiscall) void f(void* this, int a, int b, int c);

// e.g., using this line: f((void*) 0xBEEFBEEF, 1, 2, 3)
// Should produce this code:
push 3
push 2
push 1
mov ecx, 0xBEEFBEEF 
call f // the callee cleans up the stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant