<TABLE width=500>+ a$ b# i! ]: L' |# `0 z+ j
<TBODY>$ L9 K, n8 i+ L+ ^5 W7 j
<TR>7 l8 ~- J7 ]# U, g7 M
<TD><PRE>Method 01 2 c) r( e! B. t6 z
=========
2 V5 O- b+ Q; O
% y4 f9 w3 F/ V5 ^# rThis method of detection of SoftICE (as well as the following one) is- Z/ ^& ` \7 m/ E0 g4 z3 j
used by the majority of packers/encryptors found on Internet.
4 N$ X" j$ A% m$ A. s, ^! S3 y% uIt seeks the signature of BoundsChecker in SoftICE) [, u# p8 S% O
' O. L9 [0 o" f2 B2 U" k i7 y
mov ebp, 04243484Bh ; 'BCHK'% x2 s# F6 i+ s8 T' W- @* C
mov ax, 04h: T" g/ P& Z$ l. V
int 3 / Y# g4 P: n2 F2 k5 Q. b& @
cmp al,4
" T9 F9 \( ^9 ^6 z jnz SoftICE_Detected$ U5 L9 T4 Z( X$ w( D% \2 a: D
; t4 n' q& w0 b+ k' C* h___________________________________________________________________________
& y, d, K; E; p. \/ z- t. @
6 Z T: l. `! N4 RMethod 029 \$ N5 ^* |- M( u3 z1 M
=========
6 ? T: u5 y$ L/ h/ p. E, E b; n1 i8 o0 a* S+ \: O" G
Still a method very much used (perhaps the most frequent one). It is used- W6 u% v3 }9 a/ U5 Y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. X: f3 f i5 C) C; x3 \2 Y
or execute SoftICE commands...) E* x- O/ x$ y. p3 g4 e
It is also used to crash SoftICE and to force it to execute any commands
+ W& C% u& N- d# D; ~& C3 V(HBOOT...) :-(( # W. ]" G& I0 A5 D# r
0 U/ {) {7 b: v6 _. I- O7 I, J; w
Here is a quick description:4 B0 D+ V+ g& a6 `
-AX = 0910h (Display string in SIce windows)
, t. g8 M) \$ {5 z1 f# T, |-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' w! a6 c8 ^2 V, P: s-AX = 0912h (Get breakpoint infos). h% Z& q" \* A3 l
-AX = 0913h (Set Sice breakpoints)1 k% ^4 u k3 _- N* c
-AX = 0914h (Remove SIce breakoints)
. l; g3 P. h5 [, l5 P0 s2 c# V
" R+ `6 I! r/ Q, g/ i. sEach time you'll meet this trick, you'll see: `, y/ M9 k* J; C9 L. Z
-SI = 4647h5 Y! B- P' J2 i8 R
-DI = 4A4Dh
5 z1 i! ?' w; j4 k. p* Z6 Z2 U5 ?- i+ iWhich are the 'magic values' used by SoftIce.) J: A7 h% M+ t$ j% b
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 U# t% \# G' H* I: C3 S
4 N; k# A5 e( e) AHere is one example from the file "Haspinst.exe" which is the dongle HASP
+ ]) z3 B6 e: i/ d8 |, }+ ^8 y$ tEnvelope utility use to protect DOS applications:8 d' j" r6 d3 I* d4 p( u
g, N6 O; s! K, B1 F0 N& f
, ^9 n# T" K, t9 m/ c4C19:0095 MOV AX,0911 ; execute command.6 ~5 F7 d' Z2 D5 Q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 i. c* s, \9 E! R0 j3 c" B4C19:009A MOV SI,4647 ; 1st magic value.! _# _! e/ L1 a+ _. n
4C19:009D MOV DI,4A4D ; 2nd magic value.: e7 {" q. n/ Y& x2 R
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- i( h" n) N* _9 [2 @
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
% d( y, P% v5 ~+ S1 C4C19:00A4 INC CX6 ]$ w4 D! p4 n$ @
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- F. A. e* k8 ?+ O b" M& o% o
4C19:00A8 JB 0095 ; 6 different commands.
& V ]+ S1 v) h, m) c# w4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 q6 M& X3 [) l3 W4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! ~* h! J, A& h4 [
; Y* c. t2 s) Q7 v( L, D
The program will execute 6 different SIce commands located at ds:dx, which" K7 L; Q8 \' t- p# n1 j2 z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 \# P" h. f1 Z
6 o/ K! A% H+ L# y9 `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* W2 R8 ?' V9 I Q, M) p: U' y5 N___________________________________________________________________________
/ o3 F8 U: r% f+ @1 x4 ~- b
6 s( P9 h; r1 c4 A/ U3 U, _
) j& I( ~0 {' ^, HMethod 03
$ e" g; {* n; d" t$ C" E/ l=========# T; a; b" R# m- p4 X2 F
& A9 [# L& m: T& E: |Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h J" E! X: m! u" l& n
(API Get entry point)' c/ o- W; `$ ~# F
; ?) D! D! G; a& p: ? d, X# x# o
xor di,di
4 I3 z) T- ] ^2 j2 o% ? s% N$ C mov es,di5 x% a" s, n% B/ u% |2 T0 C
mov ax, 1684h N/ Z% z& k! m/ X# b m: H2 e
mov bx, 0202h ; VxD ID of winice
: G6 s& ~, l7 Q' i: h/ \* U4 A& p2 v int 2Fh
$ ^$ U; t# k2 x# [) Z5 E mov ax, es ; ES:DI -> VxD API entry point+ K. b c# H1 {0 o2 v
add ax, di( M8 J% l4 j9 B
test ax,ax% ~1 _1 j% C+ Y" V4 f) d& b! n
jnz SoftICE_Detected( y8 C, X* J; s% [0 Q6 C, Q/ f
' \ \* X6 |" J; U2 F0 i2 c' x___________________________________________________________________________. X. u. e3 w+ z" ~, Y: D U
; M' [$ I$ ~$ M$ o/ ~! v' d9 xMethod 047 p1 |- _9 b6 Q' V
=========0 F8 t( I" [- o+ u2 X
8 Y& V$ J: s1 q: yMethod identical to the preceding one except that it seeks the ID of SoftICE7 m; X' k, ^; Y1 m
GFX VxD.# X9 w# p4 p8 r, V; Z1 H
+ p/ Q( o3 `; y: e: n
xor di,di5 q! t- p6 M* R+ S, m
mov es,di
- q4 b+ ~( V2 F9 l( h, ? mov ax, 1684h 1 v3 V- t0 u9 W: o
mov bx, 7a5Fh ; VxD ID of SIWVID! R7 r' k6 F% H
int 2fh
5 t4 M: |% W; n4 }, f mov ax, es ; ES:DI -> VxD API entry point2 Y/ X, o3 C' w, P3 f- k
add ax, di
p4 M0 O" X3 i( c& E9 F! R* {8 A test ax,ax" I. e8 i, p1 K) N" R$ p/ u$ J
jnz SoftICE_Detected4 d: J) X( `- K
7 m2 H5 I' L& [( d+ a& S' g8 X9 m__________________________________________________________________________
8 g7 S3 y6 A1 O- a! C- P# t) X- Z- ~8 |2 O- E8 ~, `. E
# U+ C8 W; v" t5 Y1 G
Method 058 ~/ V# s2 ^3 x. H7 H
=========
' U; T |1 Q$ R0 r/ H T( S
: k3 A: e0 Y9 ]6 v% H. iMethod seeking the 'magic number' 0F386h returned (in ax) by all system0 S* Y: R% M4 _; |+ U5 N
debugger. It calls the int 41h, function 4Fh.
3 F+ B) f: A. b5 B3 QThere are several alternatives. $ z8 ^2 e+ ^: B
& d0 y5 D }8 X* O
The following one is the simplest:$ U' K& F! {9 S' t7 [7 c, }& ?
: b( u' Z0 f/ D( U6 X9 V9 w$ `- R mov ax,4fh+ N3 T; k. ~! b5 }9 x! p3 [
int 41h/ {& K9 r9 e. x. k/ [0 V5 S% ]: y0 f: `
cmp ax, 0F386/ C3 G8 I0 g; r. l* S. E
jz SoftICE_detected
' \8 M+ j* J5 K3 _4 k' t! S4 ~ }7 |& b* i% }3 }9 i2 P* ~
5 f7 E$ d. N8 A. \7 wNext method as well as the following one are 2 examples from Stone's
' I! z8 V* Z, o, \8 U; G"stn-wid.zip" (www.cracking.net):
& A7 x9 C2 ]( j( b8 f& O$ @) ]. e4 [8 Y9 G5 h1 @* J/ |
mov bx, cs9 p8 a* C& j, w2 z- o
lea dx, int41handler2$ T% e% H+ D. |" R2 @
xchg dx, es:[41h*4]4 k5 f; r, a3 A4 \( t/ m( G8 G: w7 a7 b
xchg bx, es:[41h*4+2]
! O7 h7 Q* A8 \ mov ax,4fh
- \8 W/ _9 B6 ~& `( v0 D1 p; z int 41h
+ s( ]; h2 z. [2 i5 p xchg dx, es:[41h*4]/ E. F! R+ m7 }2 T5 S
xchg bx, es:[41h*4+2]5 }0 A: S f$ Q) @$ N
cmp ax, 0f386h3 l) v( j+ K: e: ?: B: p
jz SoftICE_detected% ` E1 `/ m& T1 i
5 i( {: K) R% g5 w$ s: D, S6 i9 h
int41handler2 PROC
( G3 y8 ^ a3 J. D iret& ?( h; S7 ~3 [; r- N" U
int41handler2 ENDP
1 q5 y8 F" a. K! H4 K8 d
( X- s8 t$ f3 B4 M U8 y* u1 k
5 X0 h6 J) y3 M! R$ U- u_________________________________________________________________________: X, l" d" F0 \1 L% p3 F3 d
+ `9 \, Z G) ]
0 ^4 C. b2 @% P- IMethod 06
/ X. }5 v6 z4 `4 V=========
3 K( {7 |3 N: }3 L5 e/ t- [$ Z
* f) P+ W0 k4 r5 T- {* S. A) [7 S' H. D9 O! W3 K, }
2nd method similar to the preceding one but more difficult to detect:
& I. C5 C' h5 T, W" x* M/ {2 p( ?2 C, A; \& D. \# z5 s' v# X
9 k0 O6 t7 w; ^. ^) |' q2 Qint41handler PROC
' o7 C% m( i [% a+ }( g! [9 }2 A mov cl,al
0 ~/ F z$ S; U iret$ K" P* Q2 @, E* e# {: d
int41handler ENDP1 P! \" R1 V7 [9 _& j
9 S% w; r$ \% ]6 U. X# m" t# L. D' o5 W1 e. c G
xor ax,ax
( t( [) B2 O/ m5 }3 T mov es,ax
+ n2 f7 ~. H% N; _ mov bx, cs
1 F Y: \2 N/ q lea dx, int41handler
- C! G; a- P; x0 n# g xchg dx, es:[41h*4]3 a2 }$ e4 T0 c7 i V
xchg bx, es:[41h*4+2]. D0 @9 o3 O3 J
in al, 40h2 s& c. U. G- F, x0 j
xor cx,cx: g& Z0 R' G7 Q5 [4 T
int 41h
8 K% N5 h$ N1 f% ]' e P6 Y xchg dx, es:[41h*4]3 A1 O0 e# N' K: f. q
xchg bx, es:[41h*4+2]
) g" W4 E0 \4 @- P# t! {5 {9 |- B cmp cl,al
, u% F0 X; Y* T L- s% ? jnz SoftICE_detected
|( H8 C1 Y6 z( Q: R) n; k3 g
4 o+ y3 v/ }+ q7 U- j) r- x% y_________________________________________________________________________2 f$ |6 `% D/ F6 J/ c4 \7 b
, |# g/ {% j" X/ V' \
Method 07
3 @4 n9 t, u" r( H=========' p( j; g: a8 U- f& W
6 N" ?; P+ \# W6 T* T9 G
Method of detection of the WinICE handler in the int68h (V86)
) z! ?4 k1 u, S+ r0 _" j: s( f* V& Y
mov ah,43h
' b: v3 X, Y( s int 68h
Y) C( _/ N1 j7 J: a) N0 c cmp ax,0F386h# Q) w% G P2 `/ e) s# [) W
jz SoftICE_Detected$ A" |# `/ x3 ]; q1 Y; I
% O: d+ b* H1 X. C6 G5 v7 o" {# ?" P U @
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ |# t: _: A- h, Z
app like this:
9 P+ m7 A: C! l7 N! f3 u6 F* |5 Z/ L4 F
BPX exec_int if ax==68+ x+ y1 k0 ^1 \& j3 N9 `
(function called is located at byte ptr [ebp+1Dh] and client eip is
, p$ [( B) H0 v7 L2 w/ o located at [ebp+48h] for 32Bit apps)
' J3 H. D, v8 q( Q& p) {: O__________________________________________________________________________+ d4 l$ e! m' X' F3 V% e
2 w" s; F, J# ?# o
# g+ I7 w) |& M7 Z6 W. t
Method 086 y; S) Z+ Z# a# m9 y. q( E4 _, w
=========( z0 J; F5 T" M4 g- E
9 s3 h4 m3 y# O g4 R8 U4 HIt is not a method of detection of SoftICE but a possibility to crash the6 r9 _/ U& a) }( |4 o
system by intercepting int 01h and int 03h and redirecting them to another, k7 k g1 x4 t0 b0 M- I7 t
routine.
3 m# g; }3 V2 Q) oIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 T% Y9 r3 n. l; Qto the new routine to execute (hangs computer...)
9 Z; [/ e, I! F
z& E8 T1 u% Z& _ mov ah, 25h) b9 Z1 x8 H P' v
mov al, Int_Number (01h or 03h)( ?$ l# v9 W6 n' t" ^9 _* `
mov dx, offset New_Int_Routine
5 ]4 t# g: N6 Z, ? int 21h
( T$ L7 B* t. Q4 c# D9 Z
/ @5 c) Q" t" R" F2 T( b__________________________________________________________________________
- a3 B4 ]8 |* J* W0 y$ I) y) T! Q6 j' I, K" P* q
Method 09
6 K9 V- X+ s, |! e1 C$ K=========2 b9 R& x8 P4 \
7 w" J4 F% d3 Z$ X" eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% P) K, q5 j. F2 Hperformed in ring0 (VxD or a ring3 app using the VxdCall).
9 K1 n1 m; |) S2 `8 |% [. [The Get_DDB service is used to determine whether or not a VxD is installed
3 j# V: \! L9 S, x) j {for the specified device and returns a Device Description Block (in ecx) for( C/ H d9 F6 r5 t0 e' t
that device if it is installed.
6 J+ z3 j+ [7 }' a' _6 d5 N
! a! _' V( V: V$ E! ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; P: O D3 W) A! @, K$ d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- ], ]! t! W9 z
VMMCall Get_DDB. A/ ]1 t ]* N- F6 v6 z1 \
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, ?- O; W4 J3 e- b. U1 |% U8 ~/ F
% B3 f! t6 j1 h6 A/ MNote as well that you can easily detect this method with SoftICE:3 o" p' P2 I8 _, W# K3 v
bpx Get_DDB if ax==0202 || ax==7a5fh
4 P: Z4 M. C" ~0 x2 ]
5 b5 {3 w$ G$ s, e/ S__________________________________________________________________________
' u/ z2 p6 r9 z0 V
" K9 f- r# Z6 p. D1 TMethod 10
5 u T4 G' Q, P7 Z& h. V=========% W" ?1 u' \0 [' y" ?4 _
% Z0 E# S* ~8 s! H5 \! X=>Disable or clear breakpoints before using this feature. DO NOT trace with8 D" I- x Z3 c C/ y. f
SoftICE while the option is enable!!
( g' M+ Y/ \ ^+ n
; K# r3 T9 ^- ~, EThis trick is very efficient:: c, P$ `7 ?& W# S1 ^
by checking the Debug Registers, you can detect if SoftICE is loaded
" ~3 a, p) @# h+ s" `9 V(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) x0 z9 n# A4 `. r2 T- gthere are some memory breakpoints set (dr0 to dr3) simply by reading their
- F1 r( w. }* Wvalue (in ring0 only). Values can be manipulated and or changed as well
1 n( t+ p. c+ ?5 ^6 y/ L(clearing BPMs for instance). d+ q1 M1 m. X r4 K( L- r
S7 x7 |6 f, |0 s/ C. q__________________________________________________________________________2 O5 j$ S8 d& o9 |1 P2 |+ `* q/ g
+ ]/ h0 j2 j |
Method 11
, n' d. b1 J2 A8 v=========
: p) l8 F7 \- g7 t/ R) e
( U* N1 V/ q8 L" [. PThis method is most known as 'MeltICE' because it has been freely distributed
( V5 G- n A, C, \via www.winfiles.com. However it was first used by NuMega people to allow
* W3 V, |! v" lSymbol Loader to check if SoftICE was active or not (the code is located9 S# P; I: u% L4 O$ N" H2 e' Z" d& q
inside nmtrans.dll).2 ^4 }& O4 A6 V( v" g! `/ ~
) G& C8 y: z% F& H
The way it works is very simple:( p* N# z2 r# m$ S) [% o
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) R2 E& ?2 a) Y7 d& i% l# }WinNT) with the CreateFileA API.
! z: o. R& e5 E( n, B
9 E, K, u' H: f: J1 z1 G6 ~Here is a sample (checking for 'SICE'):
8 z, |" m8 u5 @0 H$ q2 n" G2 k- o, R d6 d! v" G' i
BOOL IsSoftIce95Loaded()
; D) a3 T; V6 B, ]5 ?! E& j) X{
9 a# A, v$ B% a; s. S/ l8 ] HANDLE hFile;
+ n5 Y% Q' O. e# _ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) O) }5 p3 j8 o7 q- V% t
FILE_SHARE_READ | FILE_SHARE_WRITE,# t5 e4 i/ |/ \% X; Z
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: e- J b4 y5 @
if( hFile != INVALID_HANDLE_VALUE )
: ^5 A( u, v P# J% q {2 `4 s$ ` `* Z5 x7 V2 I
CloseHandle(hFile);% S5 B; b# P: ]% D7 K
return TRUE;) n, z7 c- d4 c# T* q/ v
}, O* V3 I: n# M8 v2 I0 g6 K0 z
return FALSE;2 y7 {& k, Y- K+ \, v
}
3 F" W' b" i' Q$ R( X; ?0 B) S' y) M# ^/ I7 C$ c
Although this trick calls the CreateFileA function, don't even expect to be6 t9 {1 S' e2 D
able to intercept it by installing a IFS hook: it will not work, no way!+ s! v; q5 p: w, S2 v$ g7 _
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: x2 U- A2 G7 I* z# o: G1 y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 m! G* e8 D7 x% @. i8 \6 Tand then browse the DDB list until it find the VxD and its DDB_Control_Proc
. l( X0 `1 [: q$ _field.( T+ K! x/ p) @
In fact, its purpose is not to load/unload VxDs but only to send a , ?- p+ U$ A [7 |1 c5 q+ E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- J$ g) N, ~1 s* |9 N# r& c' Qto the VxD Control_Dispatch proc (how the hell a shareware soft could try
& E/ C/ y& W/ yto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ h- g7 k3 S6 D/ ?) I" |8 wIf the VxD is loaded, it will always clear eax and the Carry flag to allow
, k, [$ _: P+ B6 r# f0 Tits handle to be opened and then, will be detected.. d% w$ O# d! q$ A
You can check that simply by hooking Winice.exe control proc entry point
$ Y: j* L4 v. V) Qwhile running MeltICE.; g$ U7 k7 L# `; M
( c8 Q( l3 Q8 g* K8 ~. X+ |" @" k( y$ I/ X' C
00401067: push 00402025 ; \\.\SICE
5 i, L1 ^1 L; m. i# a- j 0040106C: call CreateFileA
) h/ i8 r5 C. N$ D0 P 00401071: cmp eax,-001) ~7 |2 X, c/ T3 V
00401074: je 00401091
' z0 R+ e, u( h3 F& j2 F S
. O9 C, F) A: U! y; C+ G$ v5 }! v+ T8 }$ F w; j
There could be hundreds of BPX you could use to detect this trick.1 O+ Z3 ?' d; Z3 G" d8 e, p
-The most classical one is:6 d; d- ~& Z' g$ P% b$ a
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" C0 G" ^* h) k1 N/ ?4 y
*(esp->4+4)=='NTIC'
- k+ ~9 y( v$ w5 G) W" Y( \( n4 }6 O y; M/ u$ u$ J" t
-The most exotic ones (could be very slooooow :-(, ~5 c9 u/ r0 a& O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. a; W; L# |* {- U- ? ;will break 3 times :-(
# }/ h5 i% h0 Q# s$ Z1 t- N9 @% ]
-or (a bit) faster:
9 l* h- I$ f* p+ A" @8 |' N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
8 [3 {6 |0 c& M8 J
) S8 ]/ @' q7 E6 }4 {1 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! t( s0 S6 t/ V& l4 C6 w) a
;will break 3 times :-(( x) L/ F9 \7 x! s9 k
: y/ u% ~5 P; _0 v* X: U3 S-Much faster:8 e- T# G; i( |. @$ B9 I/ O
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' S h9 d4 F+ q4 n) o' ~
% l& b4 R# m% s* _: wNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' y, y' y2 |& ~% N
function to do the same job:
8 J. t* b% A: A) |6 h
6 Y, M9 T1 a7 w% P push 00 ; OF_READ
% i ~5 k1 q, t7 T9 \" {. O mov eax,[00656634] ; '\\.\SICE',0
/ }' X$ t$ Q- D9 Q( V push eax
- O" u8 C9 n; P8 }$ S+ u# l( A call KERNEL32!_lopen
9 H0 k- w6 M+ w6 Z! v1 k inc eax: G8 V5 I J# U6 J
jnz 00650589 ; detected2 s) o( n3 z# E
push 00 ; OF_READ
# g4 X, {2 A1 P1 L9 Z mov eax,[00656638] ; '\\.\SICE'
5 D: [8 D( H1 G# t* r' P push eax
* Q1 P1 P& z4 Y- s. x call KERNEL32!_lopen
) C9 J- d6 x/ o/ i inc eax
9 P5 y( t4 x+ c8 P- d8 f5 D jz 006505ae ; not detected
: N& a: ~7 T# I- e" K
) Q! Q$ R6 E4 t3 X
8 G8 b; U6 O+ X/ L$ {__________________________________________________________________________
/ Q, Y/ W+ J( h2 ]3 A) E% L. j
1 ~- {- E- N' `Method 129 V# T" M% b& `+ q1 [/ ~: {
=========
+ {4 Q$ x* c% B% N5 C! ]7 ~. m o9 w ^+ A
This trick is similar to int41h/4fh Debugger installation check (code 05 @4 K5 W; _1 s" W
& 06) but very limited because it's only available for Win95/98 (not NT)
: y! u' k0 F) b4 Mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! o# F! d B1 M
; y; A1 ?1 _6 ~7 H: Y2 t push 0000004fh ; function 4fh
m% f% S9 i- R push 002a002ah ; high word specifies which VxD (VWIN32)
. a, E& u+ I" j, ~( F" o ; low word specifies which service
1 U! O& A! i* R' c- d2 u( G (VWIN32_Int41Dispatch)0 L; R4 Z, o1 z$ H
call Kernel32!ORD_001 ; VxdCall
; j U5 C. u9 t3 ] cmp ax, 0f386h ; magic number returned by system debuggers; M' ~$ H8 c) h; i
jz SoftICE_detected
' {/ S" ~6 w. L' O* m% K$ f7 ]' K1 C
Here again, several ways to detect it:' s' ?4 l1 V& J- K# ]
0 |2 v$ `) T- T6 z7 F
BPINT 41 if ax==4f, l; S! }+ [8 c
6 O! a0 E! ]. b
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 i, d# r: I& Z9 Y
! I& V$ O( I/ i* c BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 v0 _& ^6 C; i: x$ e$ ]
0 M( K. b$ v. E' R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 H3 T, \' y: }* I8 H3 ^+ n: y: r1 p% u+ _ K# k
__________________________________________________________________________
# C- N: k5 F4 l+ f7 K+ f
, `* B+ a- G" d& U6 GMethod 13
' E1 i% B( [: v% {0 X. a8 G. V8 {=========
: k: b) @' m. M. I* N$ I. u6 C0 H5 G! L" |9 c6 h
Not a real method of detection, but a good way to know if SoftICE is
. u4 w1 R8 v0 i3 C5 yinstalled on a computer and to locate its installation directory.5 t( Z0 g. s- x0 A, J
It is used by few softs which access the following registry keys (usually #2) :* c; \" I w, A9 _ w
s& r4 W# y' s9 X
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ T1 W3 V) l0 D1 d\Uninstall\SoftICE
1 v, m# b2 D" q5 E- Z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ X1 S0 ?( p @/ u6 m8 C+ O
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 V/ A* e, c* \8 v7 X7 I
\App Paths\Loader32.Exe% W/ B( V& L6 C
) f$ D7 [; S; u2 g& X8 \8 S. x- w7 O: A b5 _; n9 ~
Note that some nasty apps could then erase all files from SoftICE directory
. Z8 e, f! U* ]! b! f. s(I faced that once :-(
/ `9 C3 f9 z% a; i) R
# X3 Q: G+ V! T' r7 bUseful breakpoint to detect it:2 B( W) s* X: a; p& a
: N& z7 \8 R; t t. s% Q BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 M) I& n+ i6 d: J
; I! a4 d$ f' F0 f( Q
__________________________________________________________________________
5 _7 I3 D2 D2 q- P
% K& `4 J9 }8 J- Z
- ^( g6 H7 }! a2 WMethod 14 9 I" f* W4 n/ @% |1 `
=========; u# \( ?8 N. E- U% G4 `: j5 X$ `
, h! V- Q H# {& p: O0 r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# n9 K {1 T3 Z/ f# @# h
is to determines whether a debugger is running on your system (ring0 only).
4 a" D/ W$ K8 N+ R2 V! }. k- ^. a4 K7 {! @% T7 Y, M7 ]
VMMCall Test_Debug_Installed
7 z* S/ f" @# J" g je not_installed% q' G* m) V! i5 L0 S! u9 A
; {8 Y4 L- Y, L& d! V6 KThis service just checks a flag.
8 ~( T" w# |6 V- G</PRE></TD></TR></TBODY></TABLE> |