<TABLE width=500>4 \6 j, t/ J4 c. ]% j" ` I
<TBODY> r1 l0 z) M j% O" S5 D: r/ H; s3 G
<TR>
3 q/ _. E3 u7 C; Y0 [+ `! T, }<TD><PRE>Method 01 + v/ K/ J$ P5 r' ^
=========! }: f- U9 g7 X& t4 w, J
. d4 G! ?. x! i3 w' g( }5 oThis method of detection of SoftICE (as well as the following one) is* a# u% o0 b8 X% `
used by the majority of packers/encryptors found on Internet.
4 Z( K/ S: @" G) t8 b2 x% z- [It seeks the signature of BoundsChecker in SoftICE
0 G, w) Y, K; z, u3 G8 i& t, `2 X& j- L. X0 r5 o3 B
mov ebp, 04243484Bh ; 'BCHK'
6 O0 n# t$ [: I6 f" i mov ax, 04h- W2 w$ g1 j, H
int 3 . Y* k4 b h, `5 L1 @
cmp al,4# f- [* ^) u" s, f
jnz SoftICE_Detected2 t7 z/ m+ u: U1 c( f c2 P) ]% M
; n$ n" o6 B* ~% k
___________________________________________________________________________" b8 D$ E A: u* w4 S/ E3 ]
* O& c1 \/ j$ Q: ?% ]8 }( J! Y
Method 02- y( d& z K: Y# Q7 }/ N# o
=========* O8 w8 Z3 S- b; b" T. i3 t2 T
?. I5 U$ `1 J e: ]Still a method very much used (perhaps the most frequent one). It is used5 Q( X4 i0 J0 F! h4 j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ l: u+ u ~9 `, V" wor execute SoftICE commands...
5 {( H' N5 H3 R9 h; l* kIt is also used to crash SoftICE and to force it to execute any commands
+ D8 `1 m. S: k; N% K+ k(HBOOT...) :-((
+ Q7 I8 U: h E8 R5 B/ \- V% s* m! _! d% M/ K0 B
Here is a quick description:( Y+ D, \8 g" H) E3 d9 X
-AX = 0910h (Display string in SIce windows)$ T! [: h' k1 P* J
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)) k8 n) ]0 M( b5 ^; S3 O0 [7 w8 M
-AX = 0912h (Get breakpoint infos)
" B* r# N O4 h6 Y/ b5 I-AX = 0913h (Set Sice breakpoints)( ? [9 N9 m8 m' Q& h( u% V
-AX = 0914h (Remove SIce breakoints)8 ^8 Y4 S2 E+ u+ v: X8 J* _
2 D2 l7 o. v# H [2 v K
Each time you'll meet this trick, you'll see: X$ E4 e' e, f0 v) C" f, b
-SI = 4647h
$ V+ r4 Q1 [ }: F" G8 U/ M6 G3 m2 a-DI = 4A4Dh
% o9 n- n& G2 b. N% bWhich are the 'magic values' used by SoftIce.) `$ ~9 B, J5 b7 U8 ]
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( T5 L7 _9 ^ s1 Y/ U
/ l# S- w% W& q+ |Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 D$ W4 e/ V# d& j, r) R/ \Envelope utility use to protect DOS applications:
+ I. u/ w+ D: J' ]0 }; @& s! E5 h8 w7 X j0 z! o- ? o
5 f5 p) e$ b0 f2 m: v
4C19:0095 MOV AX,0911 ; execute command.
. r$ X) a2 \ ~9 V% @4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 j; Z* ` ?4 D' u1 z6 I* P/ o" i; G, q4C19:009A MOV SI,4647 ; 1st magic value.' Y& }8 t! x5 a8 f) q
4C19:009D MOV DI,4A4D ; 2nd magic value.5 w* k; C2 z# z0 t% P
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. x3 s8 t A( L2 X4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! @. B" W" ]6 b4 L8 e8 {
4C19:00A4 INC CX
- K+ N* [+ G8 C M4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! p5 k1 i5 F A1 O* S+ M7 p4C19:00A8 JB 0095 ; 6 different commands.1 a. j( ?2 u; q. Z. V% f A* [
4C19:00AA JMP 0002 ; Bad_Guy jmp back. w4 |+ I! T8 _; F" t! J
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( h8 o% a1 K5 l( n
1 b% O: K6 G$ R5 c# l) D' Q- XThe program will execute 6 different SIce commands located at ds:dx, which- k [* V; U2 ~9 P* T1 b
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 L. p; U! |( H! c" {+ t" }, b
, x! Q) ^" d: B; g* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 ]* V4 R' T; v# a
___________________________________________________________________________
) i& D, F: i& F* n$ J0 ?
1 d5 L- W9 B, b
4 M( V- y9 f* p5 j- V/ x3 G1 KMethod 03
$ {' S2 H; x0 q% w* _, M8 S7 [=========
9 X% a8 K$ L' c
! q: N5 [" N$ _& u' R: jLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 m2 c: k m _1 U* h* h
(API Get entry point)
. y4 o& O% H1 s- W: g 6 N: Q* ~% K5 V/ z/ t
1 H" `* Y, Q" n9 n* ]
xor di,di
# K! S( Y) P; Y1 J6 e& t9 o, x% Z. e mov es,di* b, h- w' J% Z7 t2 w$ B' N2 U% P
mov ax, 1684h " u' g* a0 | [) x$ P+ I
mov bx, 0202h ; VxD ID of winice, U( E- ?( ^, N9 Q- G/ w2 j2 d1 F
int 2Fh
) W- T9 l5 ^5 W$ X3 ` mov ax, es ; ES:DI -> VxD API entry point
& x: H; G6 y1 I+ q; V" ~6 { add ax, di; C% o2 i W1 e
test ax,ax
! W; i* i0 N# K jnz SoftICE_Detected
4 i' n8 Z% e# z6 C6 l) J) `! g$ v6 n8 F+ K3 m+ ?" o$ C% y
___________________________________________________________________________' I4 t* o9 Z0 q9 f1 W5 [- L1 M9 S- _
) X p8 f+ G4 ^) OMethod 04/ ~, W, v9 Y; p& S" y
=========
- G' \" N i! Y0 v# z5 Y9 l$ |4 x# t; t9 g9 [
Method identical to the preceding one except that it seeks the ID of SoftICE
6 Z- ~. R" I1 L( m7 KGFX VxD., t" O5 W/ v) N; O' y
; I5 W9 @# V: l# j& S9 } xor di,di
# d' s6 X% [3 h6 K# v9 Z U, c mov es,di
/ _2 J5 Y' [4 ~4 z7 v" i mov ax, 1684h # u N3 n' V" p3 d( F
mov bx, 7a5Fh ; VxD ID of SIWVID) [+ A& n2 C7 k8 x/ C
int 2fh7 |: p6 {' I# _8 ^
mov ax, es ; ES:DI -> VxD API entry point
& Q: X6 l3 d" v$ |" {2 X' i4 l! N add ax, di
, Q# j5 t; }+ _" K test ax,ax% C0 e4 d- o. N; F! B
jnz SoftICE_Detected
. @1 l% ]: w, r+ {* z5 D% r8 [
8 a* V( X0 F; u( l; A e__________________________________________________________________________/ M, h9 V8 Y9 c: B8 W4 @: u
8 H/ ]; C; y- x! _9 @+ B! d: w; O/ l. ?* _4 Y" W
Method 051 C0 W/ Z% F& U; D/ Y e/ ]) F
=========* a& s; a, W/ y
4 [5 n1 u7 ^' H s3 J1 ]' e' \
Method seeking the 'magic number' 0F386h returned (in ax) by all system( c% o' b/ X7 B5 v' s! \2 f5 E
debugger. It calls the int 41h, function 4Fh.
+ S% ^% c' t" V+ I% U5 M' {There are several alternatives. 8 o# \* B# E, K, \
' X; d% l' b8 e: J
The following one is the simplest:2 X- i4 Y! a- ]" ^
# E9 R* S5 ? O& j1 w6 z% f- p mov ax,4fh
' m/ h. m4 C x7 v- L int 41h
8 F+ Z1 G+ O6 C/ g2 r2 R cmp ax, 0F386
! t/ C4 ?. ~ E3 X' D jz SoftICE_detected
5 [! a+ R( c( V5 |# k- O1 L4 I
8 j) A4 h8 J1 t, y1 f( ^
/ x9 f2 R4 ]2 r5 pNext method as well as the following one are 2 examples from Stone's
& t1 }& m% W5 j. E"stn-wid.zip" (www.cracking.net):0 E/ K+ O5 C/ H m- s: K
2 Y# B, o1 C$ a7 V3 b mov bx, cs' t) n% D$ \- h
lea dx, int41handler2
0 h& W8 o4 r/ o) l) j; V: Z/ t xchg dx, es:[41h*4]
* C' D0 C! H; G2 _, H& E xchg bx, es:[41h*4+2]2 x$ h& F3 W3 X/ X5 K2 Z3 g9 I
mov ax,4fh$ T2 u) `# h2 @. l/ i# W: Y- v
int 41h
' w4 z+ Q8 u' _; w% g" q xchg dx, es:[41h*4]
% {7 t) W& p9 r4 I4 M( R xchg bx, es:[41h*4+2]3 u) Z6 M' D% Q7 H7 E' K4 V
cmp ax, 0f386h8 q" T) q. C O! R$ u
jz SoftICE_detected
$ y5 b; R; r" b# n/ b7 {# y6 O2 I
& |0 x8 R/ ]- X- C( J" @int41handler2 PROC. r0 c; b& P. o
iret
# Q# T! j' J2 R0 v3 g, m# V+ {0 Gint41handler2 ENDP
# V) Z. }6 V0 j# o" G/ d# O5 X
1 c2 e% q. a: I: ~; G
& R/ n$ @+ ]5 W8 G_________________________________________________________________________2 b, f. o$ g. W' a$ d
4 `! H, r2 x: Q: o) H* H+ k4 S$ x0 K
# ^" k S9 Y) l/ EMethod 06
1 Y" j* Q2 ^" o$ h$ f5 ~+ S% E=========; E( e/ \, k2 N6 Y
( z3 V9 s% M: m( f' v2 a; r
1 ^, |$ [( j4 l3 w9 L: q
2nd method similar to the preceding one but more difficult to detect:5 O! `: z4 [6 z- v' T4 }
8 D4 T$ \6 {6 b: j, F, p
) f {( S* e# G1 `3 b: I" O: Gint41handler PROC" g8 b( C4 N- }: t
mov cl,al
. z$ r' T/ ~* D* @- b8 @& W/ E iret2 v* [, @ ~5 y9 q
int41handler ENDP
5 r, H1 O9 o- _0 q* `: U# ~( T3 S9 s$ }$ _
' _5 x0 M# m* w
xor ax,ax# ^: P4 i5 C6 T
mov es,ax7 X5 h6 N% X2 J5 `' x# H1 k. H9 a
mov bx, cs. q: L7 o! ^7 u
lea dx, int41handler
w5 q- f& q: v3 D xchg dx, es:[41h*4]% s9 a* O* G! |/ T7 h! u
xchg bx, es:[41h*4+2]- b6 e0 ?, O$ `! Z- J8 `; y8 y% {* ~$ k
in al, 40h
; S4 Z* q/ c& ` xor cx,cx
- X/ M& R/ v: n# G3 Y int 41h8 }% b/ Y, l8 h4 N& r$ ?& {( |& X
xchg dx, es:[41h*4]& K, P( Z V \$ { l. X1 b
xchg bx, es:[41h*4+2]
. u4 f* }0 x1 }$ a8 n) R9 C cmp cl,al1 b0 I& L( R" F7 R7 O! N1 Q
jnz SoftICE_detected
) w9 i5 ~. O* G& z
( p% X- ^ h, d6 ?_________________________________________________________________________
& ]: c, U! ~) @0 t, r* F& j4 ~2 @' {3 d" v6 L8 y) b
Method 07/ w l& {: }" X9 |% }. a
=========$ b& L8 I) ^) w( E2 H3 r" D. E9 @
" q, X; M5 W( G1 l
Method of detection of the WinICE handler in the int68h (V86)
. q- @6 z( _. e: N2 p" g! |
; A7 `# E. b, V" _ mov ah,43h6 B. f& i. G) F. h2 j% b( Z. P9 C
int 68h
2 |' P. P& `' l cmp ax,0F386h8 P S; _7 [8 o
jz SoftICE_Detected
5 Y) r& f7 d: H5 L# ^) x5 n7 Q+ k, d) l3 N7 ]8 W. J
+ s. f- [7 T3 r
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 d& V- C( s7 @7 O+ {. u: H* z app like this:
( S) K; O- y7 j0 V# v) ~! N: k* f- r3 B: K5 p) h: I& [
BPX exec_int if ax==68- Z2 R& v0 [: A# v+ W( N: i% w
(function called is located at byte ptr [ebp+1Dh] and client eip is
# V( C6 p% d% y6 [& a located at [ebp+48h] for 32Bit apps)
! Q% x/ [% O* P( a5 _$ P__________________________________________________________________________
; k/ f& H9 \2 }1 r) i, g
' r3 s+ L7 L4 ]* G# A$ D& ?1 J( M2 w0 Q0 U" z
Method 08% x7 @7 Q: C8 v. j( G5 \7 \% m
=========
& \4 B1 V& I. W% G
4 Y* r% _1 E0 W' r8 g- h8 N, dIt is not a method of detection of SoftICE but a possibility to crash the
& Z$ ? V/ j& m1 f' U) r2 dsystem by intercepting int 01h and int 03h and redirecting them to another1 [, @! i, e0 v& E/ }: z
routine.5 `* |6 M6 k1 o/ F, x3 Q9 h7 ~
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 ^! Y- w" |' X9 ~5 N+ m3 H+ l0 \to the new routine to execute (hangs computer...) K4 X( V4 h4 ~# h
/ X5 _! K) z% [3 t/ I, |) O
mov ah, 25h5 t# { @8 H' W, f
mov al, Int_Number (01h or 03h)
! N+ q& q3 @: k0 a7 |( l; @ mov dx, offset New_Int_Routine1 o! p- s$ m; A+ W: j7 q$ `
int 21h
~2 v" s7 ^2 l) v9 I" j# d
: N& N4 I3 [3 l5 |+ W7 U9 P0 ?) j__________________________________________________________________________
# k6 q3 r l U5 t7 ?! m7 \5 d q9 D
Method 099 w" N" N* H1 @7 v
=========
2 L) X! s/ o* ^7 Y P7 |; f3 O# D# E4 Z, q& [0 r+ W7 r
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
2 T; W6 M+ x1 Y: e0 y" Uperformed in ring0 (VxD or a ring3 app using the VxdCall).
# u$ ]. @ t+ l9 r; h2 XThe Get_DDB service is used to determine whether or not a VxD is installed, c( F, Y$ O, C# d: K
for the specified device and returns a Device Description Block (in ecx) for( P( z5 [. Y8 u; X
that device if it is installed.5 k8 }9 p( U% o' G6 X$ ~& G( D
+ L6 D- h& g7 L. W; K. k- F mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 |& P9 `; Q& k9 a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 F: a2 a, F. B4 A/ l+ e. d VMMCall Get_DDB
4 r8 c2 Y: V+ e+ F' J mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. @" Z( g9 b5 o4 m3 `
& J/ [2 s( D% jNote as well that you can easily detect this method with SoftICE:
2 j# ]3 T8 K+ o% R bpx Get_DDB if ax==0202 || ax==7a5fh# b& v! k4 `, f) R! S
, `6 `0 x \; B% y__________________________________________________________________________# u5 x1 B' e, M! u% U- i& } C* u
4 [- { r/ h9 r
Method 10! E/ b: L3 p8 m$ a
=========
. f; U T- v: y; w) V' V& E$ k# k& W6 z( {# a, J* G2 H3 ~/ [3 }
=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 G& a: s" @2 H- {- C* ^1 A SoftICE while the option is enable!!
+ g. F3 b; `' L: R' ~- u* D. o* E* ?* `6 l7 n! b4 Q L
This trick is very efficient:
C; K+ w1 ~; t8 F) U5 ?by checking the Debug Registers, you can detect if SoftICE is loaded( N: h2 L6 d- {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 Y5 _) i1 a9 e/ @& O( Dthere are some memory breakpoints set (dr0 to dr3) simply by reading their& s X# E5 r2 `1 p: Y* }0 ~
value (in ring0 only). Values can be manipulated and or changed as well/ ]0 j9 v2 t% `" L1 x- X* L2 g6 @
(clearing BPMs for instance)
4 f/ C4 ? D; D$ h/ S5 O1 G: P+ J+ q Y+ {+ O# j
__________________________________________________________________________
8 n' _( z+ S$ z) A G( ~2 j+ Z
i1 ]8 D4 c- m' t7 A/ F, oMethod 11, g4 q1 s v$ {: x3 _1 K% I) o
=========
4 m3 V; r( t! b7 Y; C% s- X" w, \0 B" X; b+ }; b6 j. i& `
This method is most known as 'MeltICE' because it has been freely distributed
' D% \/ Q" f. j/ |9 Vvia www.winfiles.com. However it was first used by NuMega people to allow
/ x9 ~% a5 l0 n3 D G% x- Q6 r9 ?Symbol Loader to check if SoftICE was active or not (the code is located( M) d; e" z* f. K# W) Y
inside nmtrans.dll).* `! M/ D1 @8 l* L& n0 M
; u H) n" ]0 Y, s- H' h, p) N, n; C
The way it works is very simple:
" h: f6 J! I, w7 D! Q$ V" w6 h6 o" |6 hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 y, V# I' S8 D7 [# D/ l
WinNT) with the CreateFileA API.
6 e, ?: U, A: `; F/ \' Q% `$ D- y& v3 F; }9 S8 N
Here is a sample (checking for 'SICE'):
- ]( x3 a' c* a' k' {' z8 D8 I* N2 K# o
BOOL IsSoftIce95Loaded()* j" N5 Q0 p( k6 e- `
{2 B' j5 J8 l# y% f$ |
HANDLE hFile; 5 C1 d9 Y3 @; o; I, T+ ~2 Y
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& o4 j' P. ~" c+ S) o1 W9 f# D FILE_SHARE_READ | FILE_SHARE_WRITE,# s6 [0 d3 o- }8 h4 T7 `
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* \7 J: c& ?( S! F4 N' _% h4 K
if( hFile != INVALID_HANDLE_VALUE )
5 S" M% _; Q& @ {6 H' b1 u8 F9 S& }% O
CloseHandle(hFile);: |/ X8 E/ |6 ~! k" L
return TRUE;
, I+ ~) x: t: Y/ i2 N }
$ D0 q& E: k; p! B. w8 j2 ]* d return FALSE;
* M, J/ P5 s" @* Z5 T* g}
" I% n0 k) g* d' C2 z1 J
' q! u( a- h- `6 e! j! T- N/ bAlthough this trick calls the CreateFileA function, don't even expect to be1 G3 O0 G- Q: }8 r; S
able to intercept it by installing a IFS hook: it will not work, no way!
9 u$ `: `' c# ]: N$ e# s# UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F1 @9 n5 D; @9 |6 a+ i4 F8 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); g6 o# H3 N9 }5 K* M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ ~# z7 X- @! f1 J: `9 y
field.) W- ~. ~( d8 R8 v: q6 p* I! R
In fact, its purpose is not to load/unload VxDs but only to send a . s Q4 W8 u# x3 i
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 H# @9 s0 J! b3 x) V* W, jto the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 F8 Q6 C! d4 T" b" \to load/unload a non-dynamically loadable driver such as SoftICE ;-).. J# o# O6 h" M
If the VxD is loaded, it will always clear eax and the Carry flag to allow ~) R' C+ Q+ u* Q
its handle to be opened and then, will be detected.4 \+ H& ?2 t1 F6 T7 ~
You can check that simply by hooking Winice.exe control proc entry point
! S5 x I8 O1 g9 m9 P! x& d' H. d1 Mwhile running MeltICE. [% D) Q. S8 d+ G! ^7 S4 q9 B
8 m0 p/ l: l& L2 o
0 l" B5 L+ I- U! S' C4 z
00401067: push 00402025 ; \\.\SICE
0 h' w6 {9 W0 z; s) b0 c* m [ 0040106C: call CreateFileA
, s0 r6 W% i: `2 c3 L 00401071: cmp eax,-001
1 \& }' e. Y4 M$ n 00401074: je 00401091
2 }/ O8 x9 C6 }9 Z' L( o
6 ^: h& U7 l d) x. K0 d( {9 c7 i/ }+ j- A2 U
There could be hundreds of BPX you could use to detect this trick.0 o" N2 W; l2 v: W; X
-The most classical one is:
8 v7 l. U4 v, [ z3 y1 K BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* d1 a |" ]9 c e% r! C
*(esp->4+4)=='NTIC'
- n- k, f% {4 q: O: j; }; U h+ B% q9 a% r0 |6 u" g1 r$ o/ ~
-The most exotic ones (could be very slooooow :-(
. J% G. ^- u/ c1 H5 m BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) ~& z8 W1 \8 N
;will break 3 times :-(
/ E: Y& ^& ]% y$ O& R7 N3 G9 e2 `4 U
-or (a bit) faster: $ f0 r3 A" f5 q ~' y; B3 t
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% j( N, U0 X" j8 |0 ^! V
# `2 \2 \7 ~4 A- t5 ? BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 M, F4 {4 z' ] i3 F, L2 D/ W
;will break 3 times :-(3 j9 K: n X/ N0 I
7 g( [# X% q {* t3 @* S; Z- t
-Much faster:
# L/ X# i- v( O8 W" @! z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' t) }4 X# m( B: Y# o3 B# W) N8 e0 u w7 Z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 r, f! Q1 _- j( {7 h, w+ g1 U* r
function to do the same job:, R7 G! h7 Y+ F7 T. r
$ x) E1 X1 [% H9 ]: r9 }( l' j; {3 `3 c
push 00 ; OF_READ5 D) Y9 y- @. s% T. a& b. g8 @
mov eax,[00656634] ; '\\.\SICE',0* T: |% S" k8 s$ O) G2 c: ~3 t
push eax& }" l6 I3 u" S+ x% l/ d
call KERNEL32!_lopen; v/ g% [" V! `
inc eax3 t( i: i+ e8 T. ^" [; }5 Z- K3 O9 f
jnz 00650589 ; detected+ F7 R$ v. G0 W$ `) _; L) d1 |9 ]
push 00 ; OF_READ
' ~" i3 ~# A4 c% e N mov eax,[00656638] ; '\\.\SICE'! n4 A8 A; H5 x O0 o; ~; @
push eax2 ?; L! r; Q; k3 I- }
call KERNEL32!_lopen
* I/ I& \# P( K" C' W! | inc eax
q9 g5 i! U# ^2 U, k jz 006505ae ; not detected
, k" c; T4 b' r' B* V' x* |/ {8 H4 v$ ]0 ^ n, P( l6 J9 l. W
! _) ]; P2 W$ z3 C3 Z ~" b__________________________________________________________________________
; s" Z( B7 {9 R K6 l5 C3 o% v G% b |* e2 g k
Method 12% `% H( N7 F2 F
=========2 W0 |, T( B( g3 J) u; J! i& D
% G6 O$ f6 c6 w* ~' X, \! V. J+ V9 g
This trick is similar to int41h/4fh Debugger installation check (code 05
- |2 M1 }2 y3 v- c2 J; X0 y& 06) but very limited because it's only available for Win95/98 (not NT)
6 H& W. @: }" { T5 X/ has it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 d8 r: B& r6 N1 p, g% P) v
% B4 j3 r. [0 R) c3 T
push 0000004fh ; function 4fh( G0 A, Z- ~* S' R5 `
push 002a002ah ; high word specifies which VxD (VWIN32)2 b) M% m9 z& d
; low word specifies which service7 B$ ]2 q5 W+ j2 T
(VWIN32_Int41Dispatch)
! @; _; A; H$ \9 E) [5 a' U call Kernel32!ORD_001 ; VxdCall( z+ T8 g: p. P& \% g0 {1 c
cmp ax, 0f386h ; magic number returned by system debuggers
- Z: u W1 p0 C jz SoftICE_detected
: {2 F4 Z# N& s# o, [7 v7 O6 V3 _& u+ i8 M& k9 w5 I. W; W
Here again, several ways to detect it:( ?% d/ ^6 I. X1 j# `
5 y3 {' ^8 n* j R* r& p$ O3 n- v BPINT 41 if ax==4f
8 K. }+ `, r& W- G( i( I' T+ ^6 g& ]6 ~2 y, C0 s0 x
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ o4 i* P0 m1 Z( Y+ i5 E4 N9 P7 k( x) r$ ~- L3 _" G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ ^( R! \, ^; b7 I- ~+ `! w
/ r0 e2 ]* X% { BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 W2 `$ |4 Q) c; y- x: W
3 G& X9 j1 U/ {$ c. g$ Q) ^__________________________________________________________________________
6 b" i* T: x/ g7 z. o& @( J
. _( x! E( N& z3 S2 B; {$ P2 q7 k4 ?/ UMethod 13
$ E1 P. i1 W: [( `9 C. _# }=========: w8 i2 ^8 ^ M6 \* t
. X! q0 f' G- l# Y7 y
Not a real method of detection, but a good way to know if SoftICE is& f( J$ X2 w4 K$ S
installed on a computer and to locate its installation directory.
$ {* T a% g) x2 d7 h; p1 `) zIt is used by few softs which access the following registry keys (usually #2) :) n1 ?2 `* Z% Y# b/ ~
: p' d$ t& _2 _& `; l+ q8 c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. Z- y2 Q/ v+ G, Q& M; D, F. o
\Uninstall\SoftICE- c! m/ N; D- Z! Z. Y1 H
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
+ Q q. W# o5 `-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 c" W/ h% a/ Y: y Z' e1 \
\App Paths\Loader32.Exe9 E Y( x% r$ ` \
. `5 M& U# x" _8 \& N
( L7 a" O2 l9 n
Note that some nasty apps could then erase all files from SoftICE directory% ?/ k5 W- F8 f( [3 O
(I faced that once :-(3 m7 p7 A, W' a8 d: J% d9 Q/ t
: t. g m* R% J. o/ B; _$ yUseful breakpoint to detect it:
) ^& O7 ^: q, P B# o
3 b+ }2 d# `( F7 q0 e, u6 H4 S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( D( f1 O; w7 E1 N% P5 V u# [3 T* I, n% ?0 p4 R) ~- G4 Z6 t
__________________________________________________________________________
+ Z* T5 w8 h% l
# ]9 ]! F8 g3 `: i$ R2 F1 M: M! j+ j) E, C% G! V8 y
Method 14 + q, q/ w s* t
=========
' L, K6 U3 `0 H% ], V( ~' w9 |8 f$ u- E) a( }: _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 T, D' U! A* P/ S4 e
is to determines whether a debugger is running on your system (ring0 only).: u. W! `0 C @- G; {
( u! w! ]* g Q' |; e# e5 R) ^
VMMCall Test_Debug_Installed
; F; I3 d: e* y: F+ j je not_installed
# n9 b x; X& O2 e* k
3 W. H; v+ m; Z2 ?% t7 y: n/ [This service just checks a flag.! F- V- P/ c" m/ _7 g/ j+ D7 v
</PRE></TD></TR></TBODY></TABLE> |