Posted October 2, 200816 yr Sometime last year I remember someone asking for an example of anti-odbg in Delphi. Though this is just a simple example code can be modified and updated. Original thread was on unpack.cn sometime ago and this evening while I was checking the board I came across this thread and figured it would be a good opportunity to post it on tuts4you. If you use the code or find it helpful be sure to email this guy and thank him. very simple AntiDebug Unit for Delphican detect most debuggers: OllyDBG,Immunity Debugger,WinDbg,W32DAsm,IDA,.... SoftICE,Syser,TRW,TWX Tested on Win9x-Me-2k-XP-2k3-Vista Coded by: Magic_h2001 magic_h2001_yahoo.com magic.shabgard.org just for fun Dont be a JP function IsDebuggerPresent():BOOL; stdcall;external 'kernel32.dll' name 'IsDebuggerPresent'; <-- !patch Kernel32.IsDebuggerPresent SimpleAntiDBG2.zip Edited October 2, 200816 yr by D1N
November 21, 200816 yr Detected without me running a debugger or anything... =/ I'm not running SoftIce or anything either. Vista Home Premium 32-bit.
November 21, 200816 yr Detected without me running a debugger or anything... =/ I'm not running SoftIce or anything either. Vista Home Premium 32-bit.It detects by file names as well, not just in memory applications.Checks process list for:OLLYDBG, DBG, DEBUG, IDAG, W32DSMChecks module list for:DBGHELP, OLLYDBG, W32DSMChecks For Files:%system%\drivers\sice.sys%system%\drivers\ntice.sys%system%\drivers\syser.sys%system%\drivers\winice.sys%system%\drivers\sice.vxd%system%\winice.vxd%system%\vmm32\winice.vxd%system%\sice.vxd%system%\vmm32\sice.vxdChecks API:IsDebuggerPresentChecks Ring 0 Files:\\.\SICE\\.\SIWVID\\.\NTICE\\.\TRW\\.\TWX\\.\ICEEXTI get detected by just running it as well with nothing going. My cause is due to having dbghelp running in various processes on my machine. Not really the best method to prevent debugging as some processes require some of the above. XP SP3 installs a search tool for Windows XP which includes the dbghelp.dll inside it by default, which would render anything that uses this method useless to the user as they couldn't run your software then.
December 17, 200816 yr this example is very basic, Make it detect any memory modification on your process, and if it does deny any memory modifications on your process, or just hook OpenProcess to avoid access to your process They could use CreateProcess with SUSPENDED_MODE, hook it too.
December 17, 200816 yr just hook OpenProcess to avoid access to your processNow that is a rootkit ;DAnd every developer that hooks APIs systemwide just to keep his process from being debugged deserves a good beating.
December 17, 200816 yr just hook OpenProcess to avoid access to your processNow that is a rootkit ;DAnd every developer that hooks APIs systemwide just to keep his process from being debugged deserves a good beating.if you want a replacement from hooking, unlink your process from EPROCESS structure via kernel mode. (device driver, use DDK)
December 17, 200816 yr checking for DBGHELP.dll or DBGENG.DLL is stupid, because these are system components and always loaded! Same for psapi.dll!
Create an account or sign in to comment