Home | History | Annotate | Download | only in win

Lines Matching full:pproc

214 static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE*& pProc, const void* pNewProc)
221 pProc = reinterpret_cast<BYTE*>(reinterpret_cast<ptrdiff_t>(GetProcAddress(hMod, proc)));
224 if (pProc[0] != 0xB8)
229 sysCallID = *reinterpret_cast<unsigned*>(pProc + 1);
232 if (!VirtualProtect(pProc, 5, PAGE_EXECUTE_READWRITE, &flOldProtect))
235 pProc[0] = 0xE9;
236 *reinterpret_cast<unsigned*>(pProc + 1) = reinterpret_cast<intptr_t>(pNewProc) - reinterpret_cast<intptr_t>(pProc + 5);
238 pProc += 5;
257 if (*reinterpret_cast<DWORD*>(pProc) != guard)
261 VirtualProtect(pProc, 12, PAGE_EXECUTE_READWRITE, & flOldProtect);
262 pProc[0] = 0x48; // mov rax, this
263 pProc[1] = 0xb8;
264 *(__int64*)(pProc+2) = (__int64)pNewProc;
265 pProc[10] = 0xff; // jmp rax
266 pProc[11] = 0xe0;