Log in

View Full Version : An Anti-Reverse Engineering Guide


NeOXOeN
November 20th, 2008, 07:47
not a lof new stuff but someone will still find it interesting to read...

An Anti-Reverse Engineering Guide
By Josh_Jackson

In my previous article, I gave a short introduction into some Anti-Debugging/Debugger Detection techniques that primarily involved the use of Win32 API functions. In this article, I plan to travel a bit deeper into the interesting world of reverse engineering and explore some more intermediate level techniques for annoying reverse engineers. Some comments in my previous article noted that the techniques I presented could, and are most of the time, easily bypassed by intermediate level reversers; one statement I would like to make is that there is an ongoing battle between the coders who develop programs that protect against cracking and reverse engineering and the engineers themselves. Every time the protectors release a new technique, the engineers find a way around that specific method. This is the driving force behind the cracking "scene" and anti-reverse engineering fields. Most of the techniques here can easily be bypassed, and some of the others aren't as easily taken out of the picture; however, all of them can in one way, shape, or form be bypassed. I'm presenting these methods here to share the knowledge, and perhaps inspire others to find ways to apply these methods and utilize them in new and creative ways that challenge contemporary methodology.

http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx



and also this one :Introduction Into Windows Anti-Debugging
By Josh_Jackson

In recent times, tools for use in reverse engineering have flourished. There are plenty of resource sites for those who are interested in the field, and the field is very much worth the time invested in it. I found that learning C++ while introducing myself to reverse engineering and assembly language really helped me to understand how code works, and improved my C/C++ coding and my ASM coding at the same time. However, reverse engineering also has a darker side. Crackers are individuals who use their knowledge of reverse engineering to reverse another programmer's code, often to decode how a serial is processed or to remove a protection from a trial. Naturally, a pioneer will want to protect their investment; this can be done with tools such as Themida, Execryptor, Armadillo, and even a protection system coded by a CodeProject resident Jim Charles named Eagle Protector. This article is meant to inform individuals of some anti-debugging techniques, and is not meant to be all-inclusive, nor does it explore some of the more complex routines that commercial protectors use.

Background


http://www.codeproject.com/KB/security/Intro_To_Win_Anti_Debug.aspx

Kayaker
November 20th, 2008, 13:11
Nice. Thanks for the find NeO

evaluator
November 22nd, 2008, 14:34
don't know about thanks..
but interesting was there for me not-explaned:
>>There is a lot more to anti-debugging in Windows, several methods such as using CloseHandle or

what a antidbg-method CloseHandle you know??

evaluator
November 22nd, 2008, 14:40
btw:
>>int CheckHardwareBreakpoints()

that method is not much correct, bcoz in NON_INITIALISED seh.DRx can be junk!
descovered few years ago here at RCE_MB (by me

PS: at RCE_mb - anti_RCE talks!? :0

deroko
November 22nd, 2008, 14:58
Quote:
[Originally Posted by evaluator;77836]don't know about thanks..
but interesting was there for me not-explaned:
>>There is a lot more to anti-debugging in Windows, several methods such as using CloseHandle or

what a antidbg-method CloseHandle you know??


STATUS_INVALID_HANDLE when process is debugged and dummy handle value is passed...
simply hook NtClose in kernel to return if invalid handle is passed -> ObRefferenceObjectByHandle to chekc if handle is valid...

discovered and described in ARTeam eZine #2

Kayaker
November 22nd, 2008, 15:12
Quote:
[Originally Posted by evaluator;77836]what a antidbg-method CloseHandle you know??


Straight from the PSDK description of the CloseHandle API:
"Closing an invalid handle raises an exception when the application is running
under a debugger. This includes closing a handle twice, and using CloseHandle
on a handle returned by the FindFirstFile function."

http://www.woodmann.com/forum/showthread.php?p=39672#post39672