Parsi Coders
Anti-Debbuger - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Cracking / Anti Crack (http://parsicoders.com/forumdisplay.php?fid=75)
+--- انجمن: Anti Debug (http://parsicoders.com/forumdisplay.php?fid=76)
+--- موضوع: Anti-Debbuger (/showthread.php?tid=1483)



Anti-Debbuger - Amin_Mansouri - 01-12-2012

here is an asm code integrated in C based on an Api
کد:
void main(){
__asm {
MOV ECX,23;
MOV EAX,0;
INC ECX;
MOV ECX,DWORD PTR FS:[ECX];
ADD ECX,48;
MOV EAX,DWORD PTR DS:[ECX];
ADD EAX,2;
MOVZX EAX,BYTE PTR DS:[EAX];
CMP EAX,0;
JE continue1;
MOV ESP,0x12FFC4;
RET;
continue1:
}
//your code here
}

کد:
mov ecx, dword ptr fs:[0x30]        // get PEB
add ecx, 2                // add address for BeingDebugged
movzx eax, byte ptr [ecx]        // get BeingDebugged flag
cmp eax, 0                // compare it with 0
je continue1                // if its zero goto continue1
mov esp, 0xdeadc0de            // oh noes, fuck up esp
ret                                    
continue1: