<TABLE width=500>
; H6 f/ M4 ?) j. m# J. A, G<TBODY>/ r: m6 D4 P/ |) c+ B3 z. A) f3 A
<TR>! {/ p8 u5 s6 @9 }; y1 g
<TD><PRE>Method 01
' I2 U8 a& `& r |' \8 a=========& X( ?' N' y6 x& A- y2 I
; i2 n; V% V5 [3 |
This method of detection of SoftICE (as well as the following one) is6 X* ?2 g8 M$ S0 e& A+ n
used by the majority of packers/encryptors found on Internet.
6 b" [- K7 ~! G+ E; v4 UIt seeks the signature of BoundsChecker in SoftICE/ J* Z1 V' q% i) K
, f) }; c ?: L+ W6 N
mov ebp, 04243484Bh ; 'BCHK'
4 J; J+ k& E [0 I3 b0 X6 I mov ax, 04h
0 g% f9 g4 H& Z' F2 ] ` int 3 h4 D4 T! H, x( d
cmp al,4
$ k2 O6 M2 e3 Z4 i' k jnz SoftICE_Detected& p! l! l0 y: h) G5 T& Y& S
& T6 r/ Y9 |/ c) r. l" ]0 ]
___________________________________________________________________________- u/ _* m0 b( a3 ~; H/ v* V9 v( k7 Y
0 J" V! q' [8 R% N* {Method 02
9 V% N8 e4 k: T=========
* ~& j) E0 |" ^0 x: }
$ t% y% J' Y7 ~7 N3 x# KStill a method very much used (perhaps the most frequent one). It is used8 K5 C$ C9 D% Q- x
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 @6 y: |) |" M% C. y
or execute SoftICE commands...6 x9 Z" u$ e9 h/ l! c" e, }
It is also used to crash SoftICE and to force it to execute any commands
# A! y( A/ |! @(HBOOT...) :-(( 2 r1 }) C+ y, L0 _
7 W* y3 t. r; \* \4 F% ^+ c
Here is a quick description:6 K: B w; w/ r1 t
-AX = 0910h (Display string in SIce windows)
7 N" I" ^+ Z n* C-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' ]# d" `& b8 `1 |8 P9 [-AX = 0912h (Get breakpoint infos)
3 k% S6 A* O$ D-AX = 0913h (Set Sice breakpoints)% H ^/ ^) x4 ]$ l: z! M2 x. n' g
-AX = 0914h (Remove SIce breakoints)
2 \- Y/ I! n2 o8 U% i5 O& X H$ g7 @1 \/ k
Each time you'll meet this trick, you'll see:
( ]: i! x7 w. K-SI = 4647h1 @. o5 h, ^0 Y2 T( W7 B6 C
-DI = 4A4Dh
9 o, J' z$ c! J# Z7 `4 YWhich are the 'magic values' used by SoftIce.9 z3 G# ~" I+ K6 R3 o, v& _
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 K4 ?2 p2 x8 e& [' B2 O
0 Y& [5 ]) c' t6 X4 A) b/ _, wHere is one example from the file "Haspinst.exe" which is the dongle HASP: Y! e, H0 A7 K% I
Envelope utility use to protect DOS applications:
8 `( o/ c+ O7 B* [* \6 J
7 Z$ M: \9 e/ Q0 c2 a" [3 h/ P; ]0 K& w3 A& w' P' j
4C19:0095 MOV AX,0911 ; execute command.' u3 v. n9 E( }" C9 X9 i2 {
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 H6 b4 t9 Y( m. s; h+ e
4C19:009A MOV SI,4647 ; 1st magic value.
* k t2 \& W7 s( ?" j$ b$ \4C19:009D MOV DI,4A4D ; 2nd magic value.
; g7 {: [- q. Z8 U3 ~4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) C: ~1 ~+ F- e. N1 x
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
% m* Y# V- A' A# n4C19:00A4 INC CX" x: i% ^- {1 y& m; ^2 V; |! O
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
) Q5 t% Y/ F" W, t. T: f+ w4C19:00A8 JB 0095 ; 6 different commands.1 [) s# u7 K5 q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) v/ L7 e \; [8 \* n4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 E9 b& n i) u7 B4 U
# i/ `5 z( b) jThe program will execute 6 different SIce commands located at ds:dx, which
$ o# S8 _' i8 C e, s" |. b5 [& dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.- _' v! d3 K+ `8 _) C6 _0 \
* w r" F* E2 d6 A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! T% \ K$ o( y [; q___________________________________________________________________________
% n$ ]7 `7 }! T: l+ ?8 W8 e
9 j% C; `) P( s' t' w B/ d. u/ C& {- D+ v) `( I
Method 03
6 J/ z0 z' o# I8 n=========
8 b' R) t8 O6 h) j
8 A8 L" o$ ]! B! `: bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 }4 l7 H* G( L7 _0 U% U(API Get entry point)- ~2 d6 v; d+ t/ j' S5 {- |
1 v2 Z% ~6 \& p8 T
/ w# B( e! r. k. N2 I9 q# e8 m
xor di,di) ]: O8 b: k* j0 _& i9 g
mov es,di
/ R3 B$ r5 O+ @0 J mov ax, 1684h
7 Z: @* E& R$ z; Z mov bx, 0202h ; VxD ID of winice. J2 ]4 D' @3 \1 g* U
int 2Fh K7 `2 c" `8 C+ w% @
mov ax, es ; ES:DI -> VxD API entry point8 L% J4 E4 @, t4 q
add ax, di
; d9 U4 _; O5 v. b) B% | test ax,ax
6 S6 J/ V+ V( s. E& I6 W+ Q. v. K jnz SoftICE_Detected+ b; C' T+ b: L q: c
6 v9 G/ h' \. Z" b) Y
___________________________________________________________________________
8 `. G+ t3 R; I" I$ Q- D5 s, Y! w5 k* c: |7 Y
Method 04) |5 ~& a, _2 [
=========
* m6 [+ S, ^2 |+ x* g! e* F. l
/ X8 o" Z3 q7 X. y: n3 i+ KMethod identical to the preceding one except that it seeks the ID of SoftICE; E. [ S2 ]' ?& c7 O& U& I1 g
GFX VxD.
I" A' w: D& O2 s+ q6 i/ ]6 @* T( Z5 {( |4 u3 C9 r
xor di,di! @% a" t) B( E
mov es,di
6 X) z* `" i" H1 G5 A mov ax, 1684h
# K5 L% Z% ?+ u: Q$ k% c/ r) m: x mov bx, 7a5Fh ; VxD ID of SIWVID
i9 M2 P8 m& b# J+ Z0 B, I int 2fh& Y8 a7 e M6 S" f* e
mov ax, es ; ES:DI -> VxD API entry point. }* w% G2 \6 O0 w7 E
add ax, di
: A1 q6 |* d3 F+ P4 o9 i test ax,ax* n* G/ D: p/ O9 ~/ @& ], f% w
jnz SoftICE_Detected6 T! U- x8 x4 Z2 Y5 r
+ ~ p0 I# x* G& e) y- L
__________________________________________________________________________
7 z5 L9 u: ~/ m/ [1 {: p4 G7 a2 l/ k' g2 J9 b
4 p4 z) |/ c. R
Method 055 R0 ]6 X) V6 l, P3 X) U9 `, v2 \; A
=========
2 T, {- j3 e9 N2 l: p
3 X1 c2 K% U" m8 AMethod seeking the 'magic number' 0F386h returned (in ax) by all system: D7 T0 R8 U; ~4 }& R4 o' p
debugger. It calls the int 41h, function 4Fh.
, j: ~6 Y& y9 R6 iThere are several alternatives.
# N) I* N! C. O1 K# B/ W
; T' X$ w, l) ] m0 G- _1 |The following one is the simplest:, \( ]2 p. U" h v+ |; G2 V+ M
1 n! d9 _5 T$ L mov ax,4fh
( S2 R8 V- U0 P' C. P3 g$ } g. Q int 41h+ l7 u' F/ ^# s' Q4 N
cmp ax, 0F386
/ T( m, w9 l, K: F+ k8 s jz SoftICE_detected" W( n) C( o4 X$ M2 ~) ^
p" w. v& ` {
- z$ E, ~+ C" H+ r' H( `4 A5 W
Next method as well as the following one are 2 examples from Stone's 9 @9 Z5 Z. y% O" Y6 [3 Y8 l
"stn-wid.zip" (www.cracking.net):/ d" z; U: X. b2 I; U
, u6 z% ~# G1 @7 {
mov bx, cs% K/ E' K% F9 W+ X& f
lea dx, int41handler2) G2 }) j- |7 ?3 [8 t. q
xchg dx, es:[41h*4]
& P& D4 C; E8 N! @0 K xchg bx, es:[41h*4+2]! k* V; {) j" X" t/ d% K
mov ax,4fh
" t! Z ^: D3 R6 v int 41h
9 P/ n1 E B1 i" W' U+ \ xchg dx, es:[41h*4]5 q2 ?- r, D7 y- Z3 z Y1 Q
xchg bx, es:[41h*4+2]: y9 t4 ^/ h/ s1 q) c5 |, }) b- r3 V+ N
cmp ax, 0f386h0 E1 |: ~, k/ y6 v2 X
jz SoftICE_detected& P9 ?1 M- t- z+ v) K
0 h6 p& o, N" E6 i
int41handler2 PROC
5 i4 y0 m5 W0 n u4 F* p iret
2 U. r9 c& l# eint41handler2 ENDP9 F6 }: L6 }- A+ J
3 D7 f2 `7 d- {4 ^2 |4 g7 v3 D
/ W& h' p& o7 A7 F$ \4 p_________________________________________________________________________
! b) f0 @/ u# A ^5 j* V
; R* r' T& L6 ^4 f U1 C
; t$ B( c. u( b- Z OMethod 06, g# `' W+ S3 `8 E2 j
=========
, H( b- q2 p# J4 {, @# Q
1 T; c2 w) ^$ N d4 g g6 j( U
/ t& Y- ~6 t3 ]. T# M- L2nd method similar to the preceding one but more difficult to detect:% T' h( F8 D K& e
' |6 [/ I* W' \/ j* U5 ~4 C2 a5 `' G2 d# p
int41handler PROC
% V7 G' k# }' I4 z5 J: \! f1 [ mov cl,al
# E2 x ?" O' e/ Z$ g3 z. ? iret. K2 }# e& J- K7 e% g
int41handler ENDP: o$ G' }( I U6 V3 I) E8 I6 r5 e
6 W% O4 K4 r5 r9 V& t3 d* \8 n
" v* n& q- u5 p
xor ax,ax) a# g8 v; S2 k% c* K
mov es,ax
7 F1 U7 ] [6 n4 V! X9 g y mov bx, cs
8 ]1 n! K) E) N G3 ]( i& B lea dx, int41handler
4 n% k& Q8 ^: P xchg dx, es:[41h*4]
. C, z3 V0 x1 d! |/ j# `. }( {# z xchg bx, es:[41h*4+2]
. t0 r, _. j0 o" e in al, 40h# J8 C1 W8 J& z% `* Z- [+ B8 t
xor cx,cx2 O: C2 h& ^1 z# O
int 41h* W+ |9 J. k+ \0 }2 `" e4 P
xchg dx, es:[41h*4]( @# i; N) q( N! w
xchg bx, es:[41h*4+2]
- K- f% r8 ]% n cmp cl,al( j' o: \- `* l$ P
jnz SoftICE_detected
$ F$ ^0 n* E% u, \. |+ A* l
- k$ q" t6 {3 F' `_________________________________________________________________________- _2 U9 S0 R2 D. w) J/ O; d5 y
+ s% k1 m: u6 O* S" i9 ]
Method 073 p3 L: b* s5 ?& _: W! W
=========0 t) i" Z% \+ ? o2 C& L
. ]" R- w, W! I1 W: g7 l) \
Method of detection of the WinICE handler in the int68h (V86)+ Y1 k* S) t6 [6 e" s0 _
9 x3 @2 q9 b; \5 L) i2 ^ mov ah,43h5 W1 H$ J( |8 j; t2 u* S, t I [
int 68h
4 p5 M; \( E! o P cmp ax,0F386h
) C y" t/ B( i$ ^$ o) V0 z( |6 d jz SoftICE_Detected$ j! ~0 z7 a2 D, M6 F2 u7 W6 H
7 m+ l2 \6 U1 @6 \8 c
/ V: Z. C/ h% u9 J: I=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 Y) k. {+ z, C# }, q
app like this:
4 D: _- ]3 t$ E' A7 A z$ T
5 E$ I, }1 o d8 H BPX exec_int if ax==688 |5 P6 S2 E% u+ i
(function called is located at byte ptr [ebp+1Dh] and client eip is/ g3 R4 i4 c [' H h4 m
located at [ebp+48h] for 32Bit apps)! t/ z3 H2 j9 {
__________________________________________________________________________ M* O% n, g5 ^
" a5 }/ F G1 B; b+ f
, w; Y7 c$ h- z r3 F c$ J
Method 08
' e/ U! T) t' j1 s1 i" f=========
. z! y8 s5 R0 a) T+ l+ s
/ F4 Y+ P* G5 { UIt is not a method of detection of SoftICE but a possibility to crash the( i$ U* ~. F g) B2 ^
system by intercepting int 01h and int 03h and redirecting them to another! Y# `8 t* s' _7 W' I5 L; L$ W) ~
routine.
) r! z7 U/ a6 @3 f8 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' m! `2 L/ H) ]$ _; O- qto the new routine to execute (hangs computer...)
* q( w0 [# A0 l: k' `$ }* b; O& A1 C8 H9 H9 j! J0 ^/ S
mov ah, 25h7 t7 N7 C3 T6 j% \4 G8 t. S
mov al, Int_Number (01h or 03h)
9 ^. W- g; J( Z a, b' z9 ^ mov dx, offset New_Int_Routine
2 t# k C) I$ ?7 c* ? int 21h9 V j$ g- X( [( x
( |! x$ Z. F1 G& u# @__________________________________________________________________________
" H* e9 C+ j3 S# p' m. h5 x* T' z0 u" G
Method 09+ O8 h: K6 O1 q) C9 ] e
=========: r9 _# @& J0 m$ u! k3 W
8 Z6 w' o) E6 BThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 @# M) H4 d# d- w3 {1 K) t6 j
performed in ring0 (VxD or a ring3 app using the VxdCall).4 h( ^8 R0 E" A7 X- c, M' ^& g1 ~) H
The Get_DDB service is used to determine whether or not a VxD is installed
. u% V* {0 Q' U) t. T7 y. P: Qfor the specified device and returns a Device Description Block (in ecx) for
/ Y3 |0 e4 ?: s& b% x: f, K4 j+ ]that device if it is installed.
, T6 o9 y: [: g+ z7 z( |8 ?
* s( Y; ?! P6 j1 d. ]" P1 ~* I, p mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID d! ~" q9 S# C/ t& }
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 V# G7 X* M% {: C( Q x! ?
VMMCall Get_DDB* G% i" h" U( v7 m
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ f) c/ b7 t1 c7 z# \! b; ?
- |+ U( t( a- H/ p; C5 f( iNote as well that you can easily detect this method with SoftICE:
: ]9 \, B3 U& |* _3 ^4 U bpx Get_DDB if ax==0202 || ax==7a5fh0 O$ \: h* n% N# d4 a
( q# w. k9 D% R. _) O% l" ~__________________________________________________________________________% }- q+ ^& ]. i8 L
9 G2 u# ~5 s; T- \3 v$ H; B" A
Method 10
( N1 s: O( u: f* j: n" Q0 [8 u=========
4 w8 e3 X' m9 X8 g2 v1 l# k4 _5 v
4 B( o7 m' r* [# W% q$ M* S=>Disable or clear breakpoints before using this feature. DO NOT trace with
! g; Q- d' b1 ~# Z3 w0 j0 Z SoftICE while the option is enable!!: s) i j' n! ?+ n [( i
I6 o) k5 l9 T% X" hThis trick is very efficient:8 ]7 ~* y O: U W c( ]+ f- H
by checking the Debug Registers, you can detect if SoftICE is loaded
2 Q' @; p9 c- T A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 A' P3 _; h- D8 Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
& t1 A$ n* ~% R! F! tvalue (in ring0 only). Values can be manipulated and or changed as well
# J1 ], E, c+ @(clearing BPMs for instance)" I2 j% n3 M# z) t- d
& i3 e; R2 F9 b s8 y L__________________________________________________________________________
. `$ {' c- e9 P K/ G) t9 f
# Q' T* u" A( S$ wMethod 11% f* T% ~5 w8 i. t4 E
=========
0 q8 j6 o6 w7 O8 `4 ^: Q' V
# g" b) I7 ~! O- o6 I& T) n" {This method is most known as 'MeltICE' because it has been freely distributed
0 m% b; k; P+ t8 l) [% S; Dvia www.winfiles.com. However it was first used by NuMega people to allow9 V4 |3 q# M9 K: ~( r* ^0 X
Symbol Loader to check if SoftICE was active or not (the code is located- `- `5 u, d2 ^5 |& g
inside nmtrans.dll).# J+ A. h' m2 X( N+ V" O
" B& S/ c) W5 ^; ?4 E6 Z& e" ^1 BThe way it works is very simple:4 G+ p) K h# t3 s: b4 \" n
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ S- e, l. |6 G- }WinNT) with the CreateFileA API.
# c$ s4 Z+ d0 x/ b% O v1 m% y5 C; }& i! Q$ ?/ u% `' ~: i5 N
Here is a sample (checking for 'SICE'):
5 o+ C! E1 x* E0 E0 U
! n$ b( ^# {, p- s# O7 u# RBOOL IsSoftIce95Loaded()
; e$ V5 m! C$ ?$ @{2 r: w) `6 _0 e8 Y$ G S
HANDLE hFile;
# G* @! g/ q* \/ p( g hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* S) a: f" A7 O FILE_SHARE_READ | FILE_SHARE_WRITE,
( O( c( n! l4 D# _ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( j0 O/ `; p* V! ^% y if( hFile != INVALID_HANDLE_VALUE )& |1 \/ e4 |+ J* p; A1 O$ w
{
- R% w: r2 \; l7 `7 V4 L( p CloseHandle(hFile);5 p, }4 K6 z& W4 |
return TRUE;
9 `( p" H& c. o. B! r! \ }
% H$ Z' E5 n1 x( K return FALSE;' f0 ?/ v! N) @2 c" f; V) s- Z5 K
}
& T' Y' i) n6 Z% s" V0 ^: g- C$ E+ G
. H5 A7 t3 x4 A2 M) o9 J& Y7 |0 aAlthough this trick calls the CreateFileA function, don't even expect to be
: G4 x& Z) v6 v7 V, R- D, uable to intercept it by installing a IFS hook: it will not work, no way!2 R+ \ S9 T o' E- R+ _- b& k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& s4 e: h, e( y8 U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ \% V+ f& o/ v+ p/ ^0 w$ I2 d2 U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
( I1 F) O4 r% l2 ?5 q7 q: _* Ffield.
# G2 G, u+ Z! B% Y& t1 L1 ]In fact, its purpose is not to load/unload VxDs but only to send a
# x) W' y" `7 A8 {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; |/ p3 k+ J4 ato the VxD Control_Dispatch proc (how the hell a shareware soft could try
, i+ Y, q0 Y2 a5 L, [to load/unload a non-dynamically loadable driver such as SoftICE ;-).
' d* Z) P; C5 @0 A: z# r5 PIf the VxD is loaded, it will always clear eax and the Carry flag to allow( ~+ ^/ Y9 ~$ ^9 \; _
its handle to be opened and then, will be detected.$ e7 ?. N$ t0 H" f$ I
You can check that simply by hooking Winice.exe control proc entry point
6 ~9 Q2 {1 K0 f2 Q; {while running MeltICE.) g. ?% t5 z" s$ Y4 u
4 ~5 |" i& I) u4 Z
* J4 F& l" E( y' C& y! Z 00401067: push 00402025 ; \\.\SICE
0 c. D0 P& J% |3 z: } 0040106C: call CreateFileA
; q5 a: [; ~2 V8 X2 ? 00401071: cmp eax,-0017 T) ?( i) T; k, F
00401074: je 00401091" ]2 F, |% ]( x2 N
$ ~; B( y* T+ ]2 [( W# d# P$ m- g5 N$ Q6 D+ I. V9 s. ~
There could be hundreds of BPX you could use to detect this trick.4 }; n* E7 L- E
-The most classical one is:
" I# q0 i2 h" v: U% { BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 _& U X N4 H4 N8 b1 y7 G1 }
*(esp->4+4)=='NTIC'
- o1 ?, F3 E! m2 p* {: z
% B. S. \4 M, c/ I0 R6 u' G2 @7 | k-The most exotic ones (could be very slooooow :-(4 q7 ]1 C2 z7 ]6 k0 Y
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
/ s* y ^3 V2 T9 {% V ;will break 3 times :-(/ h6 m7 G3 H$ f
6 r1 j1 i+ u. p$ Q
-or (a bit) faster:
) [) F r( g* n5 X BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 g$ w) j- T7 w# a5 T2 P5 c
- P( |6 H: N0 y( E BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
6 \. E t+ |/ @; i8 T2 Q2 H5 C0 B4 d ;will break 3 times :-(
]; }( Q( ^* U& S! f- Y0 W" u$ U
-Much faster:' ?; b2 y8 }& @0 Q& \
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
6 \0 P0 Z6 T: Q- V. U/ p8 f
" D; l$ A1 X* S4 J6 yNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
- g% q4 |, t: Y4 Tfunction to do the same job:
6 p& _) H( Y6 b$ D2 X4 U
2 Y& L# e. q Q. x F push 00 ; OF_READ ~7 C0 m: S# P5 v4 Z4 F5 {
mov eax,[00656634] ; '\\.\SICE',0+ x+ @2 E5 B- a) k" ` T) [
push eax
3 @: t+ W3 X$ j0 q2 { call KERNEL32!_lopen: P) J% M' m' h$ V7 Y6 m P6 }* ?
inc eax
! [9 j( a, L6 w3 L jnz 00650589 ; detected% B' _& I3 w7 ^0 z# S
push 00 ; OF_READ7 S! X/ V/ y+ [% I0 ^" C6 T; O
mov eax,[00656638] ; '\\.\SICE') T7 _8 ~* C+ i3 x- r, G
push eax. L; ?+ w+ z- t/ _* v' s' `2 ?
call KERNEL32!_lopen
4 n; D- O5 O* J, V9 X8 o3 W7 W inc eax
" N, v R r; ] jz 006505ae ; not detected
: e& \; P+ ^( N Y8 S( ?/ E+ E2 c& u: V
- p$ r7 E! K: \__________________________________________________________________________0 v2 |# z+ p A9 q: Q# f
+ V0 n9 F+ C3 `) `# w
Method 12
. M4 `5 \4 ]% q; V' H F! Q# Z=========
8 @: Y: ^; D. ?1 s. r8 @" T% k
, V2 ? f+ \: g% t* K* F# MThis trick is similar to int41h/4fh Debugger installation check (code 05: D: i" \ m5 J9 u
& 06) but very limited because it's only available for Win95/98 (not NT)8 x7 D# h! }8 ^/ e- T) I
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: c. T# P" U4 `
2 [. n0 b4 {( s push 0000004fh ; function 4fh
5 P9 Z3 ?+ M7 c) P push 002a002ah ; high word specifies which VxD (VWIN32)
, V5 |! ]- d' f9 d: l ; low word specifies which service' `( _% Q0 F( S ~! V
(VWIN32_Int41Dispatch)
4 z& `6 P2 \) [3 Q call Kernel32!ORD_001 ; VxdCall
, c0 A# @; w3 I4 e$ u cmp ax, 0f386h ; magic number returned by system debuggers& _ F: f' @9 C3 Q* A+ W
jz SoftICE_detected
% `% k4 B J" a# z6 s/ P0 Z2 J
! C# m$ C! j0 f0 K. DHere again, several ways to detect it:, c& ^# W& j: e+ J+ w
& N( k+ [0 X. j. L
BPINT 41 if ax==4f8 x8 I' ~$ y" e) D. ?
5 u( |6 W/ ?3 f" M4 z, L
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& f! v; x0 W3 f2 C3 ]
6 L: J% i9 [. O) w b BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 ]1 U1 x% n5 j! \- @& K1 Z, H& x/ C& r* n' L4 u4 ?( _, D
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! K" K" y d1 Q4 m6 e& [. J, u: K
1 J. i# l) O1 Q' q- q__________________________________________________________________________, z* e* G9 X. c. p" p
9 _1 X) O0 q; o# L9 E, [ ~
Method 136 I) W* b0 |7 A1 A
=========7 x9 R3 ]( m/ l1 q
) u, V$ `* a2 K. e: X0 |! b' ?
Not a real method of detection, but a good way to know if SoftICE is
+ M' l8 {- W' m7 ]% T- x4 Jinstalled on a computer and to locate its installation directory.
5 [1 b4 l# V5 X0 \- `2 b2 NIt is used by few softs which access the following registry keys (usually #2) :
0 V; a+ H0 u5 q% @
4 V; a9 p2 d% [7 [-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' E) E6 l/ @$ u1 D) l& d
\Uninstall\SoftICE8 E6 E' t1 T" c# p G2 k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 Z! a9 @7 F$ d, L+ M- j# a
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 Z0 j0 x. }" ?- h8 z3 k\App Paths\Loader32.Exe; d$ t( [3 n- T+ g0 [8 d
8 M% c% x9 q+ [+ I7 M
' W% K7 z, b1 m+ u( y1 k( g, g
Note that some nasty apps could then erase all files from SoftICE directory& T" q2 @$ I" T5 E. h
(I faced that once :-(
+ D) M+ Q6 B+ C% N% {1 i
8 R x* P4 V. U5 l2 H/ H! B6 }Useful breakpoint to detect it:
* E. i$ l# ?" q$ s6 M2 @/ }4 I+ q- f0 d. E/ r
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# z1 J$ `2 ~3 a, G- c( I) B( j+ g
__________________________________________________________________________4 ^. L/ S" n/ ~% G: O8 V+ `
& }5 Z5 r$ r1 Y6 v7 I; \5 x
8 M( y: Y8 y7 N6 f% b) FMethod 14
! v7 S o2 C' @. p5 l4 M=========4 B1 ^ A8 Z, I! X+ ]- T
! r' Q/ M4 @# f
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% p+ u$ C* W, l) [, t
is to determines whether a debugger is running on your system (ring0 only).
# ?% h1 e% k6 z4 U4 X/ Y
3 ^- y5 E, X7 X* e3 R VMMCall Test_Debug_Installed. n$ _: y( i5 o5 e" m a
je not_installed3 H# I$ r4 v+ |. v* a
' U: Y3 i4 q: r. v9 E0 e- V5 gThis service just checks a flag.
7 P1 j. T0 n3 ^0 [! i</PRE></TD></TR></TBODY></TABLE> |