Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function & addy:
- #define ADR_PROXY offsethere
- template <typename T> __declspec(naked) T _cdecl ProxyCall(void* Target, UINT NumberOfParams, void* ProxyFFD5, ...)
- {
- __asm mov edx, esp; // stackframe on edx - edx points now to the return adress - Target, NumberOfParams, ProxyFFD5, Params after.
- __asm push esp; // save esp
- __asm push ebp; // save ebp
- __asm push esi; // save esi
- __asm lea esi, [edx + 8]; // Points to NumberOfParams
- __asm mov ecx, [esi]; // Get Number Of Params
- __asm inc ecx; // Also push ProxyFFD5
- PushParams:
- __asm mov eax, [esi + ecx * 4]; // Get Parameter from right to left
- __asm push eax; // and push them on the stack
- __asm loop PushParams; // Repeat until all params pushed (ecx != 0) - Stack is done after this
- __asm mov ebp, ReturnHere; // Mov Returnadress into ebp to be called by proxy
- __asm mov eax, [edx + 4]; // Get Target
- __asm jmp eax; // jump to target
- ReturnHere:
- __asm add esp, 4; // remove return address from Proxy
- __asm pop esi; // restore esi
- __asm pop ebp; // restore ebp
- __asm pop esp; // restore stack
- __asm retn; // return
- }
- CALL:
- if (ProxyCall<SHORT>(&GetAsyncKeyState, 1, (void*)ADR_PROXY, VK_INSERT) & 1)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement