<TABLE width=500>0 T, B; D5 z7 K" d' i' z6 I
<TBODY>5 N" m: I/ ?7 ] A. \
<TR>" t4 K+ l. h- N7 f6 a0 m" i
<TD><PRE>Method 01
; _8 N; e8 u3 m7 z, O! o=========9 ^: A2 I" m: b9 D4 x
2 D$ h' A6 S3 N: o, b5 s2 PThis method of detection of SoftICE (as well as the following one) is
& L' p5 G* s8 Z y" K( }/ iused by the majority of packers/encryptors found on Internet.
9 y" j$ E, O4 X: z! DIt seeks the signature of BoundsChecker in SoftICE
( l4 D7 |# A4 n2 d, D! F9 k& R& M; c+ i3 L! t7 E
mov ebp, 04243484Bh ; 'BCHK'9 P0 X* I1 D H/ ^/ U
mov ax, 04h
( j7 J: ] h- Q& G2 w* y int 3
" Q% y. R& [* q: z* \2 |' y7 d cmp al,42 {4 i) I2 @: L3 W! b8 m
jnz SoftICE_Detected
6 ~, d% L* e! l5 l% Q% ^
9 w8 t* Y/ Z: D. G4 Z___________________________________________________________________________3 o1 K/ a9 S; E- M3 Z
a1 K8 m7 @' h! K1 r- iMethod 02
& g+ T+ C" S9 g5 h) a& y# w=========
9 N* Z8 S& t+ p& M1 |; \+ z! R3 U4 m- _ X C E; ?
Still a method very much used (perhaps the most frequent one). It is used* b. N* j. k# ^8 j' L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& c' l6 b4 x( b S9 G/ y" ?
or execute SoftICE commands...
3 K* v2 q7 z: E4 l; ]It is also used to crash SoftICE and to force it to execute any commands
8 e) @. x( j! O4 X3 o4 h! K(HBOOT...) :-((
6 Y# O& `) }& c7 Z3 i! z
! i$ ?' O+ K1 BHere is a quick description:
. K5 ?& Z. X2 \: b9 R7 D9 Q5 A-AX = 0910h (Display string in SIce windows); N4 Z: U" g2 F& E6 Q: u t! L9 C
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" M. @" l& p- J( S+ z/ R, K-AX = 0912h (Get breakpoint infos)( Y! k: K" w+ t
-AX = 0913h (Set Sice breakpoints)0 S! @4 I+ |; j! a0 B3 S
-AX = 0914h (Remove SIce breakoints)
6 D6 b' d' `- _5 H
3 D5 f+ @3 K' U" G% j( g. E* kEach time you'll meet this trick, you'll see:
( d$ Q: K* p/ Y7 i! Z-SI = 4647h
: N/ x3 n# T0 f0 l) w-DI = 4A4Dh0 L1 d9 R; b$ V# I* F
Which are the 'magic values' used by SoftIce.
( `9 w4 B+ n- \/ @ n! cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 R* n l! D+ C" j2 m* Z
2 |' U/ O9 f. c$ r6 jHere is one example from the file "Haspinst.exe" which is the dongle HASP" t4 F/ j: C) H6 ~$ b
Envelope utility use to protect DOS applications:
" m8 } ~0 W8 z9 }: t
( O& S- A7 }; b. J+ f. [; }8 d7 Z& a1 i- a# { V$ H. O0 j+ V
4C19:0095 MOV AX,0911 ; execute command.
& N# D5 _1 N* w3 t4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% I' D( W- j! Z: j4C19:009A MOV SI,4647 ; 1st magic value.8 P0 J7 a( S$ l* t/ L' N. j
4C19:009D MOV DI,4A4D ; 2nd magic value.4 {9 v6 f/ G( G+ Y# i7 P B5 r
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ j: I& L3 m) z! k% K/ y, @ C4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 D3 g% e. T* G5 m4 T Q7 P4C19:00A4 INC CX9 [ J2 m! S: V2 x* X8 A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! h0 P3 s" N; m4C19:00A8 JB 0095 ; 6 different commands.- ?. H$ n) F* M0 L Y2 \3 u/ h* p
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
/ x: k: h8 ], i" z/ L/ Q7 o# \8 D4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; F; F' ?8 v6 P: Z
% o" j; A- {+ E6 Z4 IThe program will execute 6 different SIce commands located at ds:dx, which# T* k# N" ^7 E l& N3 X3 M" N
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
D* ?2 q, q" i0 ?2 r) o" D6 Z ~7 C$ i! u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 b( z! d$ m8 z1 D5 ?4 H5 h. t1 M4 t___________________________________________________________________________
7 o2 l0 F# v- [
/ f# u5 A! n/ k$ q
" E+ P; e8 H! VMethod 03
) h3 q$ o* j( y3 W9 p" v7 d=========
$ p3 R4 V0 ?! X, D/ w+ M
; L7 x8 ?4 r4 Z: @5 qLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# n) m. A: {, h( K' J(API Get entry point)
3 u0 s8 r" X9 J; |+ M R ) T7 H& f& M6 o
5 b: Y$ i/ [1 p8 y
xor di,di
* \+ \) l$ R8 c+ i' O6 s mov es,di. a4 m3 Y2 j# C. k. T- E$ E" V$ h
mov ax, 1684h
% }" e6 r ~6 U mov bx, 0202h ; VxD ID of winice
# K5 o, I, ~- g, F int 2Fh K/ _4 M9 ^ K0 N% i9 Y
mov ax, es ; ES:DI -> VxD API entry point
* E6 j! a" R# ]0 p9 _) ?9 D6 l add ax, di
3 R2 L% g$ x) Y& U% \ test ax,ax1 a* {0 n/ b: g- k' o( S+ `9 O5 J
jnz SoftICE_Detected. G/ n" j3 \* t( ^* ?( P" N
# F a* U7 x/ S
___________________________________________________________________________, ]0 u$ L- w4 w
( ~* l2 ^) _3 u, VMethod 04
+ T; c1 b1 T9 j/ B- t" j9 P=========
$ |" I8 L# U9 k6 B6 C' ~! Y. N ?! P' c4 p& n7 s7 E
Method identical to the preceding one except that it seeks the ID of SoftICE
- J3 _/ ~$ E A; BGFX VxD.3 ~& h( K( F" G9 @0 F |
1 q! b7 r; G4 n9 ~% N
xor di,di2 s7 q F1 q+ B+ X5 J( \; A" N1 s
mov es,di
/ G( q* e9 w, s( |. p x mov ax, 1684h
. H+ I" _, A: n* P; v. { mov bx, 7a5Fh ; VxD ID of SIWVID
0 H* {! c; x) Q6 i. n. n o; } int 2fh
; S3 L: k" B# [, c mov ax, es ; ES:DI -> VxD API entry point
0 N e1 W2 t; v) q3 u0 ~% f add ax, di
2 C' i# S6 e4 T. L$ F Z test ax,ax3 H' o% ^0 c9 y2 |/ s# i
jnz SoftICE_Detected8 W+ S) C1 m. v9 W: i; C+ i6 J8 h4 ?
, ^6 u. H. l* a3 Q+ V% j__________________________________________________________________________
" C1 |; P) ]9 Q1 M$ {- M( D1 R1 U: K! i9 c; H
6 k& W. L* D/ v1 z6 J- A6 s/ GMethod 05: z" j' C- o9 }" N5 |
=========
% F3 c. c- \+ B x! Y7 w# `; o, g+ t9 B: q' b( H
Method seeking the 'magic number' 0F386h returned (in ax) by all system+ f8 Z+ I+ n f4 ?8 b
debugger. It calls the int 41h, function 4Fh.4 I: H1 A7 M# i9 v- ~
There are several alternatives. ! }, P, a* z a) o, M4 Y
J2 T+ m7 i1 Q5 \8 v7 o$ U6 UThe following one is the simplest:0 h f9 h+ b- B; Y
0 l; k7 |4 x: a mov ax,4fh6 Q. J; B9 n- g o0 ]+ Y7 t
int 41h
9 U+ O, \" ^" Y- m cmp ax, 0F3861 h; }8 t+ Q( I( S" Q( p- `
jz SoftICE_detected
# v* s% D j7 `- ~5 B9 ^* y% P% T: d; t; I" ~2 o
P" _9 e8 S, G* z' T) F& KNext method as well as the following one are 2 examples from Stone's % j2 Y0 z- X& X2 B0 \- J' I9 }% i
"stn-wid.zip" (www.cracking.net):1 z: F2 T3 h3 b5 @" E' w
+ `6 |/ Z8 [# h4 p t1 ?/ j mov bx, cs
" C/ P" s9 R. q0 k0 O; O lea dx, int41handler2
8 z$ Z& U% q: C$ N xchg dx, es:[41h*4]4 n) j9 W, p( Y/ m& J4 @3 j4 J1 n! b
xchg bx, es:[41h*4+2]/ W2 {$ M% f; y' Q' y
mov ax,4fh- O- V8 S8 e1 U6 [2 P
int 41h
! o; z+ k4 s7 t7 O% m xchg dx, es:[41h*4]
4 M* ?9 @; p5 F, [. V! }* h xchg bx, es:[41h*4+2]1 o% @+ \) y& W# \# I
cmp ax, 0f386h6 [( [4 V! m/ a! x/ O+ T1 u# y2 K
jz SoftICE_detected9 m! w0 x B! t
E" F1 i: Q7 `! k& [int41handler2 PROC
0 _, J+ ?; Q; g1 Y iret8 U: ]# q. z6 g9 U! Q
int41handler2 ENDP
: x+ N/ N$ [, Z7 W: Z) e% Z; `/ y* o3 m3 J1 s
1 T& ~" V B8 c, p_________________________________________________________________________) f) s. J. u( ~" F: \2 I
+ c7 h' ^' z4 e; c* s7 q" U
% e' ^ l) g! @' {/ dMethod 06
C3 d1 i8 q+ ]! f& I=========' \+ t2 d8 p0 U2 t7 s" P8 B
" U; s) b4 i; ]# H. J; G3 T3 ~0 _
. j: e* M b0 G1 M& E* G$ l* F( }
2nd method similar to the preceding one but more difficult to detect:, G, u e5 H8 p
7 @3 M- p! B2 v+ e+ N( c' [2 |! Q/ u4 k, M
int41handler PROC
0 o& V X3 I6 Z, t# ]. h1 l mov cl,al
: e2 f& V2 m* V5 k D& ?2 w iret
. G# J6 s" b2 V% w* }int41handler ENDP
- b3 W& S4 `; T' u9 Z/ V
; u- d# \! q: b( k; z$ z+ k9 c& J; z1 p$ R5 e. o& H
xor ax,ax$ j& `2 Q+ q4 V3 [. E( S
mov es,ax: S0 M4 o0 J" a7 F: T5 K
mov bx, cs8 V0 \; m- u/ t5 X; W
lea dx, int41handler' o9 ^ Z; [0 i% y, T8 L; w" H
xchg dx, es:[41h*4]
4 k' o& T# e9 Y9 c4 H xchg bx, es:[41h*4+2]: u7 m O0 d# T
in al, 40h
! C: j* O9 m: R4 \5 T xor cx,cx" N( w8 \! g" v: `+ j
int 41h
; q1 F( t8 X$ u xchg dx, es:[41h*4]
2 P {$ A" \/ F8 T# p6 y o8 B xchg bx, es:[41h*4+2]6 b* P! Q& U W3 Z0 Y* G: M
cmp cl,al: j+ o+ K, h* o4 T
jnz SoftICE_detected
" P2 p$ z+ [5 z) e" p
$ j$ N# t2 c7 I' q. S* b_________________________________________________________________________+ k$ \. ^+ N- z0 A1 V6 L6 i) k3 l! {
- Q, S% t5 K$ _1 g4 F8 y
Method 07
& N5 H }: [4 O& i=========
8 y5 x/ a5 X. d! C8 i1 b# ~. o U7 N" C$ C9 K" R
Method of detection of the WinICE handler in the int68h (V86): K7 ^- a( O" c7 p
* t# M/ m3 K8 G mov ah,43h
5 u7 Q; Q: M l- L) _ int 68h/ I% S' P. d, B; a5 z$ O
cmp ax,0F386h' m- K, ~* w1 c2 B u; C
jz SoftICE_Detected
1 ~: ^: G! {1 P2 j: G5 p( u2 F9 G: E" S: @ a- K
: ^& ?5 P0 R/ @
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ r0 @: a j& w, J
app like this:7 R, D( I% a% q! v* _' S
' W* ?7 ~; [/ b$ M4 E- x BPX exec_int if ax==68, |; Z) n1 b- n7 L
(function called is located at byte ptr [ebp+1Dh] and client eip is5 P( u# @$ a7 Q" h2 z( M X$ g
located at [ebp+48h] for 32Bit apps)
- S& `) k" j# E3 z7 o0 w8 j__________________________________________________________________________; t8 `# M- x$ h& ~# u* ` \) `
4 i/ m0 k( }% F) D2 _
$ T- `0 T1 V& I9 KMethod 085 P) }" w% k# C; d1 z
=========
' c j, s/ [6 T; d( f; ?1 } C5 W
- D* S. H1 e9 R, F( mIt is not a method of detection of SoftICE but a possibility to crash the
8 t8 f* `! W& o, b' csystem by intercepting int 01h and int 03h and redirecting them to another
0 U. u" k) P8 `, vroutine.
) e: U6 ~5 z# ?( a. UIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. U' k' t' ?5 }) _* z
to the new routine to execute (hangs computer...)
3 t; w) q0 ^/ ]! _5 m$ F! q# w* L- K$ K
mov ah, 25h
" C0 Q7 L) w5 O) ? mov al, Int_Number (01h or 03h)- l# c6 q) Q) |
mov dx, offset New_Int_Routine3 \, j/ k& f, q0 c
int 21h
5 f! K/ X9 l5 @0 P7 e. R
g; R' R' G2 X' q; R7 x# p__________________________________________________________________________
2 _3 f# r, U+ j8 {" A, j9 G( u+ I+ G) B5 c
Method 09
8 y W, F& R9 t=========+ B6 k, F! \9 N+ K% l0 [
& d5 u: _+ {' DThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ B2 v! E$ t* N& g9 F
performed in ring0 (VxD or a ring3 app using the VxdCall).9 z% Y% l5 `4 ^2 h3 l
The Get_DDB service is used to determine whether or not a VxD is installed
! q [: I/ h/ x4 o( N5 V, S! cfor the specified device and returns a Device Description Block (in ecx) for
) \& z/ e. @ o' H1 n6 V" Dthat device if it is installed. _8 F) g. _" L H7 S$ F7 d3 d5 g
$ d& ]: H6 ?5 h2 r. A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
. ^9 U# I! j& @# ?, y" O. B mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) x: r/ ?# q- x4 m ^0 M* U
VMMCall Get_DDB
$ }7 h3 g }8 i mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
) R: [4 @' }$ B w9 j9 D( C* x1 f% U
Note as well that you can easily detect this method with SoftICE:
0 C# D: t6 z% ^6 D1 U3 K bpx Get_DDB if ax==0202 || ax==7a5fh* j& ?7 F" P' X% p" U
/ \: C6 @. K6 m7 S__________________________________________________________________________7 y* Q0 r* o* G2 t! q+ E, d; ^4 }
5 l* @ O# P/ a' L2 J5 O, m8 yMethod 106 g, ?% r6 v: ^8 R( }0 W- @, N
=========
% R1 I ]' j ?* a1 L# O
. b6 Q5 d3 p) _0 q2 `$ v=>Disable or clear breakpoints before using this feature. DO NOT trace with
~! _, D! P! z0 p SoftICE while the option is enable!!$ s' K( l4 t$ A: o+ R: G! \3 k
( T8 v0 ^! l5 l4 w) N: H% V
This trick is very efficient: w9 l6 R* l) O; b3 ?1 x' j
by checking the Debug Registers, you can detect if SoftICE is loaded: m y; Q& O: V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 w" t+ f6 ]& d, Q1 N
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ `& v1 n" ~6 j
value (in ring0 only). Values can be manipulated and or changed as well
' m6 C5 t) T' L, c1 K* h(clearing BPMs for instance)
- n* h* z/ `& `* [0 R: a+ @) {, P2 q0 z
__________________________________________________________________________! z8 N' r9 g! v
' u1 w; s, o# L
Method 11
% E8 B1 F: D0 n. U( [( q=========# j. X+ [0 z6 [. O8 B. [& F
9 B1 [# Y8 j/ r9 [: a- \1 ?& w! t- VThis method is most known as 'MeltICE' because it has been freely distributed: d" ~5 B: B5 ^ M; Y+ I. r6 i
via www.winfiles.com. However it was first used by NuMega people to allow5 K3 s' M; F+ J2 S
Symbol Loader to check if SoftICE was active or not (the code is located
# F3 m/ j# @. dinside nmtrans.dll).2 y5 {! a$ Y- [# p
( q1 @, Q4 q3 V% U: m; H' s2 X
The way it works is very simple:
7 K- Q5 v' y" QIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ _5 q6 n7 [ r& j9 j# `WinNT) with the CreateFileA API.
! \% Q2 X, ?" E! H$ ^
1 l1 Q" P6 d* ]( a6 J+ H( pHere is a sample (checking for 'SICE'):0 ~; z: N) D" {1 j
! M; @5 y6 g. `1 W+ V
BOOL IsSoftIce95Loaded()
- A7 z4 d5 Z6 V8 U+ D{) n6 f5 z6 A4 v$ y0 Z! _
HANDLE hFile; . r, V# i# ~3 U* j8 T
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& _% L, T$ \% ?% p8 p
FILE_SHARE_READ | FILE_SHARE_WRITE,0 G# E2 v+ z- y3 s. T
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 t# {) _* l" N- _ @3 w if( hFile != INVALID_HANDLE_VALUE ): f" b B/ B8 s& Q
{2 w: ]2 S6 F) N; h
CloseHandle(hFile);
* o. m9 d+ p; Q! Z2 W3 B( A- M% E: @ return TRUE;; V$ n! [4 A0 [4 R
}
% O! R7 B6 ~% a# S return FALSE;
$ n" m$ s7 v) o7 k. S( q" D}
( z8 `( o9 v1 f. F7 `( M4 R
# J* v% w! i, N7 U, UAlthough this trick calls the CreateFileA function, don't even expect to be$ Y# o4 H+ S3 N* ~; o/ ?
able to intercept it by installing a IFS hook: it will not work, no way!+ v5 H# k+ i/ @& K" S7 j9 @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F, E A+ {% H0 M! t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 a% U7 M, s* l) @& N+ {* dand then browse the DDB list until it find the VxD and its DDB_Control_Proc3 l/ X3 J5 I P
field.
# U8 f% k G# m5 h1 lIn fact, its purpose is not to load/unload VxDs but only to send a
) r" z1 f8 q4 f% S. N1 AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). c$ I" M$ A! G: [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 S, O. G2 o3 ]: ]( C
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
1 f" G) N( Q( `) S- oIf the VxD is loaded, it will always clear eax and the Carry flag to allow
e7 f2 C: l9 Z9 Y, Wits handle to be opened and then, will be detected.
' j" R% Y% @. nYou can check that simply by hooking Winice.exe control proc entry point
5 d5 q: M- ~6 I, T& Hwhile running MeltICE.6 u7 Z, K- I% @1 F
( G- {; `# A8 V, ~
# d9 q# a6 L- N5 e4 H
00401067: push 00402025 ; \\.\SICE
- h5 Y& v( l7 {2 i/ i' K 0040106C: call CreateFileA3 w9 z, A) u$ z4 y
00401071: cmp eax,-001
3 t8 N9 f/ a) w% `, b 00401074: je 004010914 `$ {% I: |- a; `0 P( ]" K
( ], [1 a& X, F- q3 B8 g, @; c3 l7 K u
There could be hundreds of BPX you could use to detect this trick.+ ]/ S- } k+ D+ ?
-The most classical one is:/ n; X8 W5 {/ Z1 J' q& Y: \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 \- Z+ r- B3 |, } *(esp->4+4)=='NTIC'
4 J B: D2 S/ k5 x1 K( ^ \
8 A( K6 q) |6 I3 J' Z-The most exotic ones (could be very slooooow :-(
- V- g! ?4 Z. g/ |3 D j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
7 Z, E! a& V: M! A ]; R ;will break 3 times :-(8 Z" R, i7 a5 M9 t2 P( L4 D
* p+ G+ u8 N. e. ^3 T u: d-or (a bit) faster:
/ x7 W. m: |: e) X) M7 u% A4 H BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 d2 F3 s" U, X C4 b% S4 Z j+ F1 ?1 W9 f
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 o# t% O' H( l
;will break 3 times :-(
: h- {2 p) s& M3 \7 V( a4 @) V+ s# L' ~- p
-Much faster:& D1 }- d' l6 q* j
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'% S/ Z: V# ^) `& e, n, N6 ]4 Y: k2 Y
, U" Q2 e F: ]( YNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
g8 v$ X8 i. y( r. ^0 tfunction to do the same job:8 s2 Z2 c9 v8 J; c d% h/ O
) ?, W1 Y/ P0 p. ?! j" Q/ \ `( x push 00 ; OF_READ+ f* ?; n; s3 q6 i* r
mov eax,[00656634] ; '\\.\SICE',0
0 c6 o- N. X8 r4 u push eax: q/ k& F6 N1 l& x" F6 E
call KERNEL32!_lopen
& r( n i3 B1 u; M$ E& X inc eax
; o/ @4 F c7 S- Z jnz 00650589 ; detected
/ g2 w$ x! M5 Y( O- K l push 00 ; OF_READ
; G! [8 m3 V* U4 y% A+ A+ n mov eax,[00656638] ; '\\.\SICE'
* h j7 x( M6 f" I; a push eax
3 \( U2 `, G/ B) W8 Z& W call KERNEL32!_lopen4 F- Z( }. n6 V# _
inc eax. a. j- O6 H) k" l- v+ o
jz 006505ae ; not detected" Y: ~; C" w- d) p* ^
- Z' @7 _. s9 y6 P5 @& @
3 b( ?4 Q& v; s
__________________________________________________________________________3 y# v( V* b F6 E' i" L m
, x; K. G5 o; G: hMethod 120 K0 Z" C% d# V' L
=========
; m+ f: Q4 R8 C5 r. w4 @) S+ s1 L8 G' H1 B7 t
This trick is similar to int41h/4fh Debugger installation check (code 05
$ y& `6 o2 h4 k" k) G# N& 06) but very limited because it's only available for Win95/98 (not NT)
# T# i& o* U: [as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* n2 \9 R! M# S! Y( K1 @2 }/ z3 g
0 O* Z/ d2 z* G& q8 r5 N9 w push 0000004fh ; function 4fh3 K" [, r2 D; _5 W. D
push 002a002ah ; high word specifies which VxD (VWIN32), g, R) L0 q& u& k2 K( L; d6 L8 X$ @
; low word specifies which service
( P5 U c: H3 J6 |4 f/ ?$ ~# W (VWIN32_Int41Dispatch)
! _8 j, V! L; ^0 w call Kernel32!ORD_001 ; VxdCall
7 `3 I7 d8 s; T cmp ax, 0f386h ; magic number returned by system debuggers
! N2 }; T" |2 c$ P5 u; x jz SoftICE_detected. Q2 S) n) O" A
9 ?) `0 x' k0 {$ s3 RHere again, several ways to detect it:0 A. J0 h5 X9 D6 @2 r+ c
1 \: k8 _' ?' x6 p: w BPINT 41 if ax==4f
( s9 w. U% [' `# D! C- \, @7 _5 \) A
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& `! U* x1 t6 f. }# w. S! o
% l8 b, q! e ~! S% c1 x+ w BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 {; n- n( {3 W! m' s
( o. b! h" X! _+ Z0 Z+ H2 ~( ?2 ^
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. B7 g; R5 g7 g9 e( |* w, H# F2 A& f) z' a. {) |8 O* c$ a" _; E9 V# A
__________________________________________________________________________# p E% F% D/ }# A% U9 @" ?
8 h7 l% J. a$ |) `6 rMethod 137 i T+ N$ Z, \
=========
! j8 v, J" n$ J6 y# o6 d! O! G5 D5 P8 Q7 w" Z; D: X/ D
Not a real method of detection, but a good way to know if SoftICE is
+ a- a2 B7 F; q. P# _" n$ hinstalled on a computer and to locate its installation directory.5 ~, b5 a) d: P+ {, u+ T
It is used by few softs which access the following registry keys (usually #2) :
% `9 c- U$ Q" n6 j \- l$ l9 y' }. R9 b2 p
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) W# u9 F% H% T
\Uninstall\SoftICE
0 {4 t: c9 _- o: H" z4 S H. u. A' O-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: T8 K4 Q; h. H, b! l( j0 C# j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( X& \* Z* z- i/ k; `5 G* R\App Paths\Loader32.Exe
3 g) ^- l3 M) b+ i9 {+ }( M0 T7 z
1 B& ?! G( X, R/ c' f
$ n2 z( O' A2 `& Y$ k1 WNote that some nasty apps could then erase all files from SoftICE directory
, i3 y! b/ _4 m(I faced that once :-(" D" Q" d% t0 k
* i) }! p" V3 K# @ L5 i1 C, y" ?
Useful breakpoint to detect it:
% I3 {8 n% L" L( m0 M& \- q" c
$ s0 b: G L; F$ A' R BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( J9 ~% [$ f/ G! J
% z% G7 Q5 K( j- s ^7 B+ E9 T__________________________________________________________________________, M4 ?1 z. E" k
; L8 }* m( M3 D+ a2 |3 l
; v) f% K. ^ ~& _
Method 14 X0 O$ w3 F' I* P& S& o# K0 F5 h$ J
=========4 ~% J! n4 g0 }
" k+ x8 `+ u* @7 x8 aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ j! v3 ~5 u& v8 y. ais to determines whether a debugger is running on your system (ring0 only).1 q1 O( K, p* _8 q* q$ F) Y5 D
; a, B! W' T) |3 |, p
VMMCall Test_Debug_Installed$ y. Q8 m. r( i
je not_installed! |, p% }( M" \3 C' Z* R
, b* \# C# {9 z* g9 m( p! UThis service just checks a flag.
8 V* h, X6 c/ D( |. E$ Q! f</PRE></TD></TR></TBODY></TABLE> |