//test. The asm
EXTERN g_iValue: DQ; Refer to external variable
.data
Val1 DQ? ; Define your own variable
The CODE
PebIsDebuggedApproach PROC
Mov eax, fs: [h] 30
Mov al, BYTE PTR [eax + 2]
Ret.
PebIsDebuggedApproach ENDP
END
//test. The CPP
Extern "C" bool __stdcall PebIsDebuggedApproach ();
Extern "C"//prevent function by name mangling
{
Char g_iValue=https://bbs.csdn.net/topics/0;
}
Int main ()
{
Int t=PebIsDebuggedApproach ();
getchar();
}
After the above execution is collapsed program
CodePudding user response:
Requests each great god help me thank you