21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12.14 Detecting Windows Debuggers<br />

<strong>Problem</strong><br />

You need to prevent someone from debugging a Windows binary.<br />

Solution<br />

The Win32 API provides the IsDebuggerPresent( ) function for checking whether the<br />

current process is being debugged. It returns nonzero if a debugger is present.<br />

Discussion<br />

The simplest method of detecting the presence of a debugger on Windows is to use<br />

the IsDebuggerPresent( ) Win32 API function. It is exported by the system DLL<br />

kernel32.dll and is available on Windows 98, Windows ME, and Windows NT 4.0<br />

and later. Note that it is not available on Windows 95 or Windows NT 3.51 or earlier.<br />

This method only detects process debuggers that rely on the Win32 Debug API, and<br />

it can easily be circumvented by using a ring0 debugger such as SoftICE. This, and<br />

other methods of varying quality, have appeared in many tutorials on software protection,<br />

virus writing, and software cracking.<br />

See Also<br />

• “Anti-Debugging in Win32” by Lord Julus: http://vx.netlux.org/texts/html/lj_<br />

vx03.html<br />

• “Win32 Anti-Debugging Tricks” by Billy Belcebu: http://library.succurit.com/<br />

virus/ANTIDEBG.TXT<br />

12.15 Detecting SoftICE<br />

<strong>Problem</strong><br />

SoftICE is a ring0 debugger that cannot be detected using standard debugger detection<br />

techniques.<br />

Solution<br />

Numega’s SoftICE debugger is a kernel-mode debugger intended for debugging<br />

device drivers and Windows itself. It is favored by software protection crackers<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.<br />

Detecting SoftICE | 685

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!