How can I detect a debugger or other tool that might be analysing my software?

前端 未结 4 793
粉色の甜心
粉色の甜心 2021-02-05 23:42

A very simple situation. I\'m working on an application in Delphi 2007 which is often compiled as \'Release\' but still runs under a debugger. And occasionally it will run under

相关标签:
4条回答
  • 2021-02-06 00:17

    You can also do

    if DebugHook <> 0 then ...
    
    0 讨论(0)
  • 2021-02-06 00:23

    To detect SilkTest, you could try to attach to a DLL which is used only by SilkTest in order to detect its presence. For example, if the Open Agent is attached to a process, Win32HookDll_x86.dll or Win32HookDll_amd64.dll will be present (the names can be easily found out with a tool like Process Explorer.

    0 讨论(0)
  • 2021-02-06 00:33

    You can check the parent process that started your application. With CreateToolhelp32Snapshot/Process32First/Process32Next get the parent PID (PROCESSENTRY32.th32ParentProcessID or TProcessEntry32.th32ParentProcessID) for your application PID. Then get the filename for the parent PID to compare with the applications you want to check for, like SilkTest.

    Check this article for code usage.

    In addition to IsDebuggerPresent and CheckRemoteDebuggerPresent, you can also query PEB.BeingDebugged (PEB is Process Environment Block, to get PEB you must query TEB, which is the Thread Enviroment Block).

    0 讨论(0)
  • 2021-02-06 00:33

    You're probably looking for the IsDebuggerPresent function.

    0 讨论(0)
提交回复
热议问题