Unbekannt1 Posted May 10, 2009 Posted May 10, 2009 Since my topic got locked on the MASM forums because this might be a malicious attempt..I'll try it here: I hope the title says it all: I want to detour a function in another process after injecting my dll and then detour that function to a function inside my dll. The detours library do it for C++ but how do I it in MASM? I don't see anything logic at first sight when looking at the pcode bytes...I took this from the detours lib can this be used (after translating to MASM of course) to redirect the call? inline PBYTE DetourGenCall(PBYTE pbCode, PBYTE pbJmpDst, PBYTE pbJmpSrc = 0){ if (pbJmpSrc == 0) { pbJmpSrc = pbCode; } *pbCode++ = 0xE8; *((INT32*&)pbCode)++ = pbJmpDst - (pbJmpSrc + 5); return pbCode;} Thanks
Loveless Posted May 11, 2009 Posted May 11, 2009 That's assembling a call, not a JMP. Don't know if you want to be doing that...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now