//create a stub which emulates the first instruction then jumps passed it so we can avoid //the breakpoint byte __cdecl *CreateBreakpointStub( byte *address, uint instruction_size ) { byte *pstub = VirtualAlloc( 0, instruction_size+5, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); //copy the original instruction memcpy( pstub, address, instruction_size ); *(byte *)( pstub+instruction_size ) = 0xE9; *(dword *)( pstub+instruction_size+1 ) = ( ( address-pstub )-5 ); return pstub; } //---