Detecting SoftICE by Calling INT 68h

by Sam Petrone.

Share
|
Homepage | Submit your article | Contact | TOS
More articles on software  

You are here: Categories » Computers and technology » Software

Here's a way to detect the presence of SoftICE in memory by calling INT contain the value 43h before calling INT be in the AX register. 68h. The AH register must 68h. If SoftICE is active in memory, the return value 0F386h will

This is a well-known method of detecting SoftICE that is safe and commonly used, but only in Windows 9x. You can see it in action, for example, in SafeDisc:

.386 
.MODEL FLAT,STDCALL locals 
jumps 
UNICODE=0 
include w32.inc 
Extrn SetUnhandledExceptionFilter : PROC .data 
message3 message2 delayESP previous .code db "Detection by calling 
INT 68h",0 db "SoftICE found",0 db "SoftICE not found",0 dd 0
;the ESP register saves here dd 0 ;the ESP register will save 
the address of the ;previous SEH service here 
Start: 
;-------------------------------------------------------------------------------------------------
;Sets SEH in case of an error 
;-------------------------------------------------------------------------------------------------
mov	[delayESP],esp
 
push offset error 
call SetUnhandledExceptionFilter 
mov	[previous], eax
 
;-------------------------------------------------------------------------------------------------
 
;The new address for Structured Exception Handling (SEH) is set here to ensure that in case of an 
;error, the program will continue from an error label and will end correctly. This is important 
;if, for example, the program calls an interrupt that will be performed correctly only if SoftICE 
;is active, but which will cause an error and crash the program if SoftICE is not active. Finally, 
;the previous SEH service address is saved. 
;-------------------------------------------------------------------------------------------------
   ah,43h int 68h push eax ;service number ;calls the INT 68h interruption ;saves the return value
 
;-------------------------------------------------------------------------------------------------
;Sets previous SEH service
;-------------------------------------------------------------------------------------------------
   push dword ptr [previous] 
call SetUnhandledExceptionFilter 
;-------------------------------------------------------------------------------------------------
;Sets the original SEH service address 
;-------------------------------------------------------------------------------------------------
pop   eax	;restores the return value
   cmp   ax, 0f386h	;tests to see whether the return value is
 
;a "magic number" 
;-------------------------------------------------------------------------------------------------
;If SoftICE is active in memory, the return value will be F386h in the AX register. 
;-------------------------------------------------------------------------------------------------
jz     jump	;if yes, the program jumps because SoftICE is
 
;active in memory 
continue: 
call MessageBoxA,0, offset message2,\ offset message1,0 
;if the return value was other than F386h, 

;SoftICE was not found, and an error message ;will be displayed. 
call ExitProcess, -1
   ;ends the program
 
jump: 
call MessageBoxA,0, offset message3,\ offset message1,0 
;prints a message that SoftICE was found. Any ;code may follow from this point. 
call ExitProcess, -1 
;ends the program
   error:
   ;starts a new SEH service in case of an error.
   mov   esp, [delayESP]
 
push offset continue ret 
;if an error occurs in the program, SEH ;ensures that the program will continue from the 
;error label. 
ends 
end Start 
;end of program 
Leave a comment or ask a question
Total comments: 0

Software Disclaimer

  • The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
Fight for the Future, Digital Future: Google VS Apple - We can be proud as we watch one of the greatest virtual wars unleashing at the digital market. If 15 years ago it was Apple Vs Windows confrontation, today it has slightly changed its main parties (more...)
The Beginner's Guide to iPad Video Conversion on Mac - So, you've just taken in a shiny new iPad and impressed by its beautiful display. There are several possible sources of content that you will want to convert for viewi (more...)
Touch and View: iPad application - iPad application development has become an extremely popular topic at numerous conferences and workshops since the product introduction keynote. Mobile software companies went boldly into the une (more...)
Deciding on TIFF vs. JPEG Output for Scanned Images - It can be difficult to understand which file type is best for saving your scanned images. Here's a brief breakdown of the two most common options. Preserving beloved memories is on (more...)
Photoshop Clipping Path and Masking Techniques :: Wonderful Technique to Knock Out Image Background - Graphic design is being the promotional key in every spare of business and individual life. Business organizations seek graphic tools to have publicity by dint of bill board, catalogs, magazines, w (more...)
Tips on Getting MP3 from CD as iPhone Ringtone on Mac - Many people must have favorite CDs filled with their bookcase or CD case somewhere at home due to the songs they loved while they still need to pay $0.99 each to get the same songs as their iPhone (more...)
Know about Architectural CAD Drawing - Architectural CAD drawing, which literally mean architectural drawing on the computer. Getting your architectural drawing in digital format. This applies to residential, commercial, pho (more...)
Tips to Develop Mechanical CAD Drawings and Design - The standard mechanical engineering CAD expert photo, as you need to develop such that can easily be explained by mechanical engineers. Before starting work on a mechanical image, you should know h (more...)
Most popular free open source software - Open source software ( OSS) is license-free computer software which can be used, modified, or distributed freely. There is a misconception that OSS is "second rated" or "prototyped" ver (more...)
How to send SMS from Microsoft Dynamics CRM 4.0 - Ozeki offers a solution to send SMS from Microsoft Dynamics CRM 4.0. If you use MS Dynamics to improve customer relationship management in your company, now you can increase the efficienc (more...)

 
free content
    Copyright © 2006 - 2012 e-articles.info.
The texts, articles and tutorials in the directory are property of their respective owners and authors.