/*
* Wrapper from
* int func(int a, int b, int c, unsigned int d, signed int e);
* to
* int __usercall func<eax>(int a<eax>, int b<ecx>, int c, unsigned int d, signed int e);
*/
int func(int a, int b, int c, unsigned int d, signed int e)
{
__asm
{
push e
push d
push c
mov ecx, b
mov eax, a
call __usercall_func // access violation somewhere inside here
add esp, 12
}
}