{"id":387,"date":"2009-05-10T14:03:00","date_gmt":"2009-05-10T06:03:00","guid":{"rendered":""},"modified":"2013-11-17T19:22:15","modified_gmt":"2013-11-17T11:22:15","slug":"%e9%98%b2%e8%b0%83%e8%af%95%e5%8d%95%e5%85%83isdebbuged-pas","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/387.html","title":{"rendered":"\u9632\u8c03\u8bd5\u5355\u5143IsDebbuged.pas"},"content":{"rendered":"<pre class=\"brush: delphi; title: ; notranslate\" title=\"\">\r\nunit IsDebbuged;\r\n\r\ninterface\r\nuses\r\nWindows;\r\n\r\nfunction PD_PEB_BeingDebuggedFlag(): Boolean;\r\nfunction FD_PEB_NtGlobalFlags(): Boolean;\r\nfunction FD_Heap_HeapFlags(): Boolean;\r\nfunction FD_Heap_ForceFlags(): Boolean;\r\nfunction FD_CheckRemoteDebuggerPresent(): Boolean;         \/\/\u80fd\u641e\u5b9aOD\r\nfunction FD_NtQueryInfoProc_DbgPort(): Boolean;\r\nfunction FD_NtQueryInfoProc_DbgObjHandle(): Boolean;\r\nfunction FD_NtQueryInfoProc_DbgFlags(): Boolean;          \/\/\u80fd\u641e\u5b9aOD\r\nfunction FD_SeDebugPrivilege(csrssPid: THandle): Boolean;\r\nfunction FD_Find_Debugger_Window(): Boolean;\r\nfunction FD_Exception_Closehandle(): Boolean;             \/\/\u80fd\u641e\u5b9aOD\r\nfunction FD_Exception_Int3(): Boolean;\r\nfunction FD_OutputDebugString(): boolean;\r\nfunction FD_Check_StartupInfo(): Boolean;\r\nfunction FD_INT_2d(): Boolean;                           \/\/\u80fd\u641e\u5b9aOD\r\nfunction FS_OD_Int3_Pushfd(): Boolean;\r\nfunction FS_SI_Exception_Int1(): Boolean;\r\nfunction FB_HWBP_Exception(): Boolean;\r\n\/\/\u7efc\u5408\u67e5\u770b\u662f\u5426\u88ab\u8c03\u8bd5\r\nfunction IsDebugged:boolean;\r\n{ \u6d4b\u8bd5\r\nprocedure TForm1.FormCreate(Sender: TObject);\r\nbegin\r\nif IsDebugged then\r\napplication.Terminate;\r\nend;\r\n}\r\nimplementation\r\n\r\nfunction IsDebugged:boolean;\r\nbegin\r\nresult := false;\r\n      if FB_HWBP_Exception then\r\nResult := true;\r\n      if FS_SI_Exception_Int1 then\r\nResult := true;\r\n      if FD_Find_Debugger_Window then\r\nResult := true;\r\n      if PD_PEB_BeingDebuggedFlag then\r\nResult := true;\r\n      if FD_PEB_NtGlobalFlags then\r\nResult := true;\r\n      if FD_Heap_HeapFlags then\r\nResult := true;\r\n      if FD_CheckRemoteDebuggerPresent then\r\nResult := true;\r\n      if FD_NtQueryInfoProc_DbgPort then\r\nResult := true;\r\n      if FD_NtQueryInfoProc_DbgObjHandle then\r\nResult := true;\r\n      if FD_NtQueryInfoProc_DbgFlags then\r\nResult := true;\r\n      if FD_SeDebugPrivilege(916) then\r\nResult := true;\r\n      if FD_Exception_Closehandle then\r\nResult := true;\r\n      if FD_Exception_Int3 then\r\nResult := true;\r\n      if FD_OutputDebugString then\r\nResult := true;\r\n      if FD_Check_StartupInfo then\r\nResult := true;\r\n      if FD_INT_2d then\r\nResult := true;\r\n      if FS_OD_Int3_Pushfd then\r\nResult := true;\r\nend;\r\n\r\n\/\/\u4f7f\u7528\u67e5\u770bPEB\u7ed3\u6784\u4e2d\u6807\u5fd7\u4f4dbeingDegug\u6765\u68c0\u6d4b\u662f\u5426\u88ab\u8c03\u8bd5\r\nfunction PD_PEB_BeingDebuggedFlag(): Boolean;\r\nbegin\r\nasm\r\n      mov @result, 0\r\n      mov eax, fs:&#x5B;30h] \/\/EAX = TEB.ProcessEnvironmentBlock\r\n      add eax, 2\r\n      mov eax, &#x5B;eax]\r\n      and eax, $000000ff \/\/AL = PEB.BeingDebugged\r\n      test eax, eax\r\n      jne @IsDebug\r\n      jmp @exit\r\n@IsDebug:\r\n      mov @result, 1\r\n@exit:\r\nend;\r\nend;\r\n\r\n\/\/\u67e5\u770bPEB\u7ed3\u6784\u4e2d\u7684NtGlobalFlags\u6807\u5fd7\u4f4d\u6765\u68c0\u6d4b\u662f\u5426\u88ab\u8c03\u8bd5\r\nfunction FD_PEB_NtGlobalFlags(): Boolean;\r\nbegin\r\nasm\r\n      mov @result, 0\r\n      mov eax, fs:&#x5B;30h]\r\n      mov eax, &#x5B;eax+68h]\r\n      and eax, $70      \/\/NtGlobalFlags\r\n      test eax, eax\r\n      jne @IsDebug\r\n      jmp @exit\r\n@IsDebug:\r\n      mov @result, 1\r\n@exit:\r\nend;\r\nend;\r\n\r\n\/\/\u5728PEB\u7ed3\u6784\u4e2d\uff0c\u4f7f\u7528HeapFlags\u6765\r\n\/\/\u68c0\u6d4b\u8c03\u8bd5\u5668\u4e5f\u4e0d\u662f\u975e\u5e38\u53ef\u9760\uff0c\u4f46\u5374\u5f88\u5e38\u7528\u3002\r\n\/\/\u8fd9\u4e2a\u57df\u7531\u4e00\u7ec4\u6807\u5fd7\u7ec4\u6210\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u8be5\u503c\u5e94\u4e3a2\r\nfunction FD_Heap_HeapFlags(): Boolean;\r\nbegin\r\nasm\r\n      mov @result, 0\r\n      mov eax, fs:&#x5B;30h]\r\n      mov eax, &#x5B;eax+18h] \/\/PEB.ProcessHeap\r\n      mov eax, &#x5B;eax+0ch] \/\/PEB.ProcessHeap.Flags\r\n      cmp eax, 2\r\n      jne @IsDebug\r\n      jmp @exit\r\n@IsDebug:\r\n      mov @result, 1\r\n@exit:\r\nend;\r\nend;\r\n\r\n\/\/\u68c0\u6d4bPEB\u7ed3\u6784\u4e2d\u7684\u6807\u5fd7\u4f4dForceFlags\uff0c\u5b83\u4e5f\u7531\u4e00\r\n\/\/\u7ec4\u6807\u5fd7\u7ec4\u6210\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u8be5\u503c\u5e94\u4e3a0\r\nfunction FD_Heap_ForceFlags(): Boolean;\r\nbegin\r\nasm\r\n      mov @result, 0\r\n      mov eax, fs:&#x5B;30h]\r\n      mov eax, &#x5B;eax+18h]       mov eax, &#x5B;eax+10h]\r\n      test eax, eax\r\n      jne @IsDebug\r\n      jmp @exit\r\n@IsDebug:\r\n      mov @result, 1\r\n@exit:\r\nend;\r\nend;\r\n\r\n\/\/\u4f7f\u7528API\uff1aCheckRemoteDebuggerPresent\r\nfunction FD_CheckRemoteDebuggerPresent(): Boolean;\r\nvar\r\nFunc_Addr: Pointer;\r\nhModule: Cardinal;\r\npDebugBool: PBool;\r\nbegin\r\nresult := false;\r\nhModule := GetModuleHandle('kernel32.dll');\r\nif hModule = INVALID_HANDLE_VALUE then exit;\r\nFunc_addr := GetProcAddress(hModule, 'CheckRemoteDebuggerPresent');\r\nif (Func_addr &lt;&gt; nil) then begin\r\n      asm\r\n        lea eax, pDebugBool\r\n        push eax\r\n        push $ffffffff\r\n        call Func_addr\r\n        cmp dword ptr&#x5B;pDebugBool], 0\r\n        jne @IsDebug\r\n        jmp @exit\r\n      @IsDebug:\r\n        mov @result, 1\r\n      @exit:\r\n      end;\r\nend;\r\nend;\r\n\r\n\/\/\u4f7f\u7528ntdll_NtQueryInformationProcess()\u6765\u67e5\u8be2\r\n\/\/ProcessDebugPort\u53ef\u4ee5\u7528\u6765\u68c0\u6d4b\u53cd\u8c03\u8bd5\r\nfunction FD_NtQueryInfoProc_DbgPort(): Boolean;\r\nvar\r\nFunc_Addr: Pointer;\r\nhModule: Cardinal;\r\nReturnLength: PULONG;\r\ndwDebugPort: PDWORD;\r\nbegin\r\nresult := false;\r\nhModule := GetModuleHandle('ntdll.dll');\r\nif hModule = INVALID_HANDLE_VALUE then exit;\r\nFunc_addr := GetProcAddress(hModule, 'ZwQueryInformationProcess');\r\nif (Func_addr &lt;&gt; nil) then begin\r\n      asm\r\n        lea eax, ReturnLength\r\n        push eax                    \/\/ReturnLength\r\n        push 4                      \/\/ProcessInformationLength\r\n        lea eax, dwDebugPort\r\n        push eax                    \/\/ProcessInformation\r\n        push 7                      \/\/ProcessInformationClass\r\n        push $FFFFFFFF              \/\/ProcessHandle\r\n        call Func_addr              \/\/NtQueryInformationProcess\r\n        cmp &#x5B;dwDebugPort], 0\r\n        jne @IsDebug\r\n        jmp @exit\r\n      @IsDebug:\r\n        mov @result, 1\r\n      @exit:\r\n      end;\r\nend;\r\nend;\r\n\r\n\/\/\u67e5\u8be2winXp\u81ea\u52a8\u521b\u5efa\u7684&quot;debug object&quot;\u7684\u53e5\u67c4\r\nfunction FD_NtQueryInfoProc_DbgObjHandle(): Boolean;\r\nvar\r\nFunc_Addr: Pointer;\r\nhModule: Cardinal;\r\nReturnLength: PULONG;\r\ndwDebugPort: PDWORD;\r\nbegin\r\nresult := false;\r\nhModule := GetModuleHandle('ntdll.dll');\r\nif hModule = INVALID_HANDLE_VALUE then exit;\r\nFunc_addr := GetProcAddress(hModule, 'ZwQueryInformationProcess');\r\nif (Func_addr &lt;&gt; nil) then begin\r\n      asm\r\n        lea eax, ReturnLength\r\n        push eax\r\n        push 4\r\n        lea eax, dwDebugPort\r\n        push eax\r\n        push $1E\r\n        push $FFFFFFFF\r\n        call Func_addr\r\n        mov eax, &#x5B;dwDebugPort]\r\n        test eax, eax\r\n        jnz @IsDebug\r\n        jmp @exit\r\n      @IsDebug:\r\n        mov @result, 1\r\n      @exit:\r\n      end;\r\nend;\r\nend;\r\n\r\n\/\/\u67e5\u8be2winXp\u81ea\u52a8\u521b\u5efa\u7684&quot;debug object&quot;\uff0c\r\n\/\/\u672a\u516c\u5f00\u7684ProcessDebugFlags\u7c7b\uff0c\u5f53\u8c03\u8bd5\u5668\u5b58\u5728\u65f6\uff0c\u5b83\u4f1a\u8fd4\u56defalse\r\nfunction FD_NtQueryInfoProc_DbgFlags(): Boolean;\r\nvar\r\nFunc_Addr: Pointer;\r\nhModule: Cardinal;\r\nReturnLength: PULONG;\r\ndwDebugPort: PDWORD;\r\nbegin\r\nresult := false;\r\nhModule := GetModuleHandle('ntdll.dll');\r\nif hModule = INVALID_HANDLE_VALUE then exit;\r\nFunc_addr := GetProcAddress(hModule, 'ZwQueryInformationProcess');\r\nif (Func_addr &lt;&gt; nil) then begin\r\n      asm\r\n        lea eax, ReturnLength\r\n        push eax\r\n        push 4\r\n        lea eax, dwDebugPort\r\n        push eax\r\n        push $1F\r\n        push $FFFFFFFF\r\n        call Func_addr\r\n        mov eax, &#x5B;dwDebugPort]\r\n        test eax, eax\r\n        jz @IsDebug\r\n        jmp @exit\r\n      @IsDebug:\r\n        mov @result, 1\r\n      @exit:\r\n      end;\r\nend;\r\nend;\r\n\r\n\/\/\u662f\u5426\u83b7\u5f97SeDebugPrivilege\r\n\/\/\u662f\u5426\u53ef\u4ee5\u4f7f\u7528openprocess\u64cd\u4f5cCSRSS.EXE\r\nfunction FD_SeDebugPrivilege(csrssPid: THandle): Boolean;\r\nvar\r\nhTmp: Cardinal;\r\nbegin\r\nresult := False;\r\nhTmp := OpenProcess(PROCESS_ALL_ACCESS,false,csrssPid);\r\nif hTmp &lt;&gt; 0 then begin\r\n      CloseHandle (hTmp);\r\n      result := true;\r\nend;\r\nend;\r\n\r\n\/\/\u67e5\u627e\u5df2\u77e5\u7684\u8c03\u8bd5\u5668\u7684\u7a97\u53e3\u6765\u68c0\u6d4b\u662f\u5426\u88ab\u8c03\u8bd5\r\nfunction FD_Find_Debugger_Window(): Boolean;\r\nvar\r\nwhWnd: DWORD;\r\nbegin\r\nresult := True;\r\n\/\/ollydbg v1.1\r\nwhWnd := FindWindow('icu_dbg', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\n\/\/ollyice pe--diy\r\nwhWnd := FindWindow('pe--diy', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\n\/\/ollydbg ?-\r\nwhWnd := FindWindow('ollydbg', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\n\/\/windbg\r\nwhWnd := FindWindow('WinDbgFrameClass', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\n\/\/dede3.50\r\nwhWnd := FindWindow('TDeDeMainForm', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\n\/\/IDA5.20\r\nwhWnd := FindWindow('TIdaWindow', nil);\r\nif whWnd &lt;&gt; 0 then Exit;\r\nresult := False;\r\nend;\r\n\r\n\/\/\u7ed9CloseHandle()\u51fd\u6570\u4e00\u4e2a\u65e0\u6548\u53e5\u67c4\u4f5c\u4e3a\u8f93\u5165\u53c2\u6570\r\n\/\/\u662f\u5426\u89e6\u53d1\u4e00\u4e2aEXCEPTION_INVALID_HANDLE (0xc0000008)\u7684\u5f02\u5e38\r\nfunction FD_Exception_Closehandle(): Boolean;\r\nbegin\r\ntry\r\n      CloseHandle($00001234);\r\n      result := False;\r\nexcept\r\n      Result := True;\r\nend;\r\nend;\r\n\r\n\/\/int3 \u68c0\u6d4b\r\nfunction FD_Exception_Int3(): Boolean;\r\nbegin\r\n      asm\r\n        mov @result, 0\r\n        push offset @exception_handler \/\/set exception handler\r\n        push dword ptr fs:&#x5B;0h]\r\n        mov dword ptr fs:&#x5B;0h],esp\r\n        xor eax,eax       \/\/reset EAX invoke int3\r\n        int 3h\r\n        pop dword ptr fs:&#x5B;0h] \/\/restore exception handler\r\n        add esp,4\r\n        test eax,eax \/\/ check the flag\r\n        je @IsDebug\r\n        jmp @exit\r\n      @exception_handler:\r\n        mov eax,dword ptr &#x5B;esp+$c]\/\/EAX = ContextRecord\r\n        mov dword ptr &#x5B;eax+$b0],$ffffffff\/\/set flag (ContextRecord.EAX)\r\n        inc dword ptr &#x5B;eax+$b8]\/\/set ContextRecord.EIP\r\n        xor eax,eax\r\n        ret\r\n      @IsDebug:\r\n        xor eax,eax\r\n        inc eax\r\n        mov esp,ebp\r\n        pop ebp\r\n        ret\r\n      @exit:\r\n        xor eax,eax\r\n        mov esp,ebp\r\n        pop ebp\r\n        ret\r\n      end;\r\nend;\r\n\r\n\/\/\u4f7f\u7528OutputDebugString\u51fd\u6570\u6765\u68c0\u6d4b\r\nfunction FD_OutputDebugString(): boolean;\r\nvar\r\ntmpD: DWORD;\r\nbegin\r\nOutputDebugString('');\r\ntmpD := GetLastError;\r\nif(tmpD = 0) then\r\n      result := true\r\nelse\r\n      Result := false;\r\nend;\r\n\r\n\/\/\u68c0\u6d4bSTARTUPINFO\u7ed3\u6784\u4e2d\u7684\u503c\u662f\u5426\u4e3a0\r\nfunction FD_Check_StartupInfo(): Boolean;\r\nvar\r\nsi: STARTUPINFO;\r\nbegin\r\nZeroMemory(@si, sizeof(si));\r\nsi.cb := sizeof(si);\r\nGetStartupInfo(si);\r\nif (si.dwX &lt;&gt; 0) and (si.dwY &lt;&gt; 0)\r\n      and (si.dwXCountChars &lt;&gt; 0)\r\n      and (si.dwYCountChars &lt;&gt; 0)\r\n      and (si.dwFillAttribute &lt;&gt; 0)\r\n      and (si.dwXSize &lt;&gt; 0)\r\n      and (si.dwYSize &lt;&gt; 0) then begin\r\n      result := true\r\nend else\r\n      result := false;\r\nend;\r\n\r\n\/\/\u4f7f\u7528int 2dh\u4e2d\u65ad\u7684\u5f02\u5e38\u68c0\u6d4b\r\nfunction FD_INT_2d(): Boolean;\r\nbegin\r\ntry\r\n      asm\r\n        int 2dh\r\n        inc eax \/\/any opcode of singlebyte.\r\n                \/\/;or u can put some junkcode,\r\n                \/\/&quot;0xc8&quot;...&quot;0xc2&quot;...&quot;0xe8&quot;...&quot;0xe9&quot;\r\n        mov @result, 1\r\n      end;\r\nexcept\r\n      Result := false;\r\nend;\r\nend;\r\n\r\n\/\/\u6700\u8fd1\u6bd4\u8f83\u725b\u7684\u53cd\u8c03\u8bd5\r\nfunction FS_OD_Int3_Pushfd(): Boolean;\r\nbegin\r\nasm\r\n      push offset @e_handler \/\/set exception handler\r\n      push dword ptr fs:&#x5B;0h]\r\n      mov dword ptr fs:&#x5B;0h],esp\r\n      xor eax,eax \/\/reset EAX invoke int3\r\n      int 3h\r\n      pushfd\r\n      nop\r\n      nop\r\n      nop\r\n      nop\r\n      pop dword ptr fs:&#x5B;0h] \/\/restore exception handler\r\n      add esp,4\r\n\r\n      test eax,eax \/\/check the flag\r\n      je @IsDebug\r\n      jmp @Exit\r\n\r\n@e_handler:\r\n      push offset @e_handler1 \/\/set exception handler\r\n      push dword ptr fs:&#x5B;0h]\r\n      mov dword ptr fs:&#x5B;0h],esp\r\n      xor eax,eax \/\/reset EAX invoke int3\r\n      int 3h\r\n      nop\r\n      pop dword ptr fs:&#x5B;0h] \/\/restore exception handler\r\n      add esp,4      \/\/EAX = ContextRecord\r\n      mov ebx,eax \/\/dr0=&gt;ebx\r\n      mov eax,dword ptr &#x5B;esp+$c]     \/\/set ContextRecord.EIP\r\n      inc dword ptr &#x5B;eax+$b8]\r\n      mov dword ptr &#x5B;eax+$b0],ebx \/\/dr0=&gt;eax\r\n      xor eax,eax\r\n      ret\r\n\r\n@e_handler1:        \/\/EAX = ContextRecord\r\n      mov eax,dword ptr &#x5B;esp+$c]     \/\/set ContextRecord.EIP\r\n      inc dword ptr &#x5B;eax+$b8]\r\n      mov ebx,dword ptr&#x5B;eax+$04]\r\n      mov dword ptr &#x5B;eax+$b0],ebx \/\/dr0=&gt;eax\r\n      xor eax,eax\r\n      ret\r\n\r\n@IsDebug:\r\n      mov @result, 1\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\n@Exit:\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\nend;\r\nend;\r\n\r\n\/\/\u4f7f\u7528int1\u7684\u5f02\u5e38\u68c0\u6d4b\u6765\u53cd\u8c03\u8bd5\r\nfunction FS_SI_Exception_Int1(): Boolean;\r\nbegin\r\nasm\r\n      mov @result, 0\r\n      push offset @eh_int1 \/\/set exception handler\r\n      push dword ptr fs:&#x5B;0h]\r\n      mov dword ptr fs:&#x5B;0h],esp\r\n      xor eax,eax \/\/reset flag(EAX) invoke int3\r\n      int 1h\r\n      pop dword ptr fs:&#x5B;0h] \/\/restore exception handler\r\n      add esp,4\r\n      test eax, eax \/\/ check the flag\r\n      je @IsDebug\r\n      jmp @Exit\r\n\r\n@eh_int1:\r\n      mov eax,&#x5B;esp+$4]\r\n      mov ebx,dword ptr &#x5B;eax]\r\n      mov eax,dword ptr &#x5B;esp+$c] \/\/EAX = ContextRecord\r\n      mov dword ptr &#x5B;eax+$b0],1 \/\/set flag (ContextRecord.EAX)\r\n      inc dword ptr &#x5B;eax+$b8] \/\/set ContextRecord.EIP\r\n      inc dword ptr &#x5B;eax+$b8] \/\/set ContextRecord.EIP\r\n      xor eax, eax\r\n      ret\r\n@IsDebug:\r\n      mov @result, 1\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\n@Exit:\r\n      xor eax, eax\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\nend;\r\nend;\r\n\r\n\/\/\u5728\u5f02\u5e38\u5904\u7406\u8fc7\u7a0b\u4e2d\u68c0\u6d4b\u786c\u4ef6\u65ad\u70b9\r\nfunction FB_HWBP_Exception(): Boolean;\r\nbegin\r\nasm\r\n      push offset @exeception_handler \/\/set exception handler\r\n      push dword ptr fs:&#x5B;0h]\r\n      mov dword ptr fs:&#x5B;0h],esp\r\n      xor eax,eax \/\/reset EAX invoke int3\r\n      int 1h\r\n      pop dword ptr fs:&#x5B;0h] \/\/restore exception handler\r\n      add esp,4 \/\/test if EAX was updated (breakpoint identified)\r\n      test eax,eax\r\n      jnz @IsDebug\r\n      jmp @Exit\r\n\r\n@exeception_handler:       \/\/EAX = CONTEXT record\r\n      mov eax,dword ptr &#x5B;esp+$c] \/\/check if Debug Registers Context.Dr0-Dr3 is not zero\r\n      cmp dword ptr &#x5B;eax+$04],0\r\n      jne @hardware_bp_found\r\n      cmp dword ptr &#x5B;eax+$08],0\r\n      jne @hardware_bp_found\r\n      cmp dword ptr &#x5B;eax+$0c],0\r\n      jne @hardware_bp_found\r\n      cmp dword ptr &#x5B;eax+$10],0\r\n      jne @hardware_bp_found\r\n      jmp @exception_ret\r\n@hardware_bp_found: \/\/set Context.EAX to signal breakpoint found\r\n      mov dword ptr &#x5B;eax+$b0],$FFFFFFFF\r\n@exception_ret:       \/\/set Context.EIP upon return\r\n      inc dword ptr &#x5B;eax+$b8] \/\/set ContextRecord.EIP\r\n      inc dword ptr &#x5B;eax+$b8] \/\/set ContextRecord.EIP\r\n      xor eax,eax\r\n      ret\r\n@IsDebug:\r\n      mov @result, 1\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\n@Exit:\r\n      xor eax, eax\r\n      mov esp,ebp\r\n      pop ebp\r\n      ret\r\nend;\r\nend;\r\n\r\nend.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>unit IsDebbuged; interface uses Windows; function PD_PE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":4761,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/387\/revisions\/4761"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}