I am trying to detour GetASyncKeyState, at first I thought I just need to djmp 5 bytes into the function which would be fine but I have tried this but unsuccessful;
mov eax, apiAddress // Store the API address in EAX..
add eax, 5 // Step 5 bytes ahead of the API start..
// push arguments here..
mov edi, edi // Restore the __stdcall calling convention..
push ebp // Restore the __stdcall calling convention..
mov ebp, esp // Restore the __stdcall calling convention..
jmp eax // Call the API..
Not really sure how I would implement this, any ideas?