; INFO: Nefunguje pod OllyDbg, ale moze fungovat na inych debuggeroch. ; Pred instrukciou pushfd treba stlacit krokovanie "F7" ; Debugger moze implementovat debuggovanie prostrednictvom nastavenia TrapFlag-u. ; - Pri stlaceni "F7" Debugger nastavi programu "TrapFlag" ; - Aplikacia vykona instrukciou pushfd, ktora ulozi vsetky flagy na stack ; - vygeneruje sa vynimka ; - vynimku zachyti debugger a kedze vie, ze ju sposobil on, pokracuje sa dalej format PE GUI 4.0 at 0x400000 include 'win32a.inc' section '.text' code readable executable pushfd pop eax shr eax, 8 and eax, 1 jnz MSG_FOUND MSG_OK: invoke MessageBoxA, 0, message_ok ,message_caption, MB_OK+MB_ICONINFORMATION jmp EXIT MSG_FOUND: invoke MessageBoxA, 0, message_found,message_caption, MB_OK+MB_ICONINFORMATION EXIT: ret section '.bss' readable writeable old_protect dd ? section '.data' readable message_caption db 'MSG',0 message_ok db 'OK',0 message_found db 'Debugger found!',0 section '.idata' import data readable writeable library \ kernel32,'KERNEL32.DLL',\ user32 ,'USER32.DLL' import kernel32,\ VirtualProtect ,'VirtualProtect' import user32,\ MessageBoxA ,'MessageBoxA' ;section '.reloc' fixups data readable discardable