|
// Debuggee.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<Windows.h>
#include<comdef.h>
int _tmain(int argc, _TCHAR* argv[])
{
MessageBoxA(0,"Debuggee started","placing break point",0);
//find IP (mov eax,eip :invalid opcode)
UINT EIP=0;
_asm
{
call f
jmp finish
f: pop eax
mov EIP,eax
push eax
ret
finish:
}
EIP+=50;
BYTE *b=(BYTE*)EIP;
for(int i=0;i<100;i++)
printf("%x : %x \n",EIP+i,b[i]);
::DebugBreak(); //notice that instruction 0xcc is placed here (which is Interrupt 3), the debug memory dump window will not show this
::OutputDebugString(_bstr_t::bstr_t("debug string"));
MessageBoxA(0,"Debuggee ending","",0);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.