<TABLE width=500>* n8 h0 }/ K9 G; w' q
<TBODY>
: c# O, y! F1 ]4 h$ N9 u8 S3 m<TR>
- O5 s! N/ z* k2 z! R; T1 R% p<TD><PRE>Method 01 , _7 m Q/ Y5 ]( |1 l Q
=========
( E. z2 j( A$ p, i, b8 d
% S/ @; t. h( ?( R2 P p( m( VThis method of detection of SoftICE (as well as the following one) is+ l9 S4 Q) G. a3 U; u9 F1 l0 ]
used by the majority of packers/encryptors found on Internet.3 d" k" ?& b1 j$ S$ [- w
It seeks the signature of BoundsChecker in SoftICE: [+ _8 E1 K5 y/ {( l$ t
) {$ u% X5 I) g! j& O' m mov ebp, 04243484Bh ; 'BCHK'' c! p/ j% R, m% ]4 t1 v* w/ ?
mov ax, 04h. r3 n% l1 C, ]. |4 R: k, {- R+ f
int 3
/ w8 W) a4 S: q* h1 V4 F) y9 l/ J cmp al,4* N7 k0 m$ q2 n# F5 e% Y3 u
jnz SoftICE_Detected- L* G+ ]1 Z' V" ]4 I
% V" r. l! L. K5 ~! I' c0 D- W___________________________________________________________________________1 Q) t! G# R0 X( e* t+ {+ c
* x8 M& Q+ s0 T" gMethod 02 k' y/ E' J V7 S7 x) I+ ]
=========
6 [. p9 l4 S* v5 T4 n: {) X# T0 V" t, S: n$ v6 Z \
Still a method very much used (perhaps the most frequent one). It is used
( G2 p p2 R: c1 K0 Nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, Z) |+ _5 k5 b* Tor execute SoftICE commands...0 H# K. u: q2 u: p6 v0 G0 `
It is also used to crash SoftICE and to force it to execute any commands
4 f! U% Q+ y' t$ p& u' p& n" V( @, A(HBOOT...) :-((
7 @% r9 p3 o* ~& s
3 E( M; E7 O& }( T4 iHere is a quick description:7 M' n! V( H/ [2 p
-AX = 0910h (Display string in SIce windows)" V) k4 f/ E+ o7 L' Z- O
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)1 Z1 ? q7 v$ D4 ^8 q# e8 n, J
-AX = 0912h (Get breakpoint infos)) [5 e# B% \1 D; i" d# q
-AX = 0913h (Set Sice breakpoints)
0 y2 M5 t6 ]+ |-AX = 0914h (Remove SIce breakoints)+ ^5 a) y3 E9 y# Z1 x: p" \* p
& ^' A8 g3 S4 s M/ `2 M9 REach time you'll meet this trick, you'll see:
* C. o6 Y$ D/ m# G1 t( ]( | X O, Y-SI = 4647h
4 s$ W* C; U7 @& c( a6 i1 p- l-DI = 4A4Dh* @( {% u# D6 b/ e1 ]' l! z
Which are the 'magic values' used by SoftIce.
3 X9 l3 ^8 A* n/ Q8 n$ fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( ~( y, g4 f% C( E5 H! e7 C; m1 f
: E( G1 o0 A/ u# bHere is one example from the file "Haspinst.exe" which is the dongle HASP! t m2 Q/ u7 x
Envelope utility use to protect DOS applications:
, V8 d, r: U/ |( ^
. b5 Z! a- W5 w5 U
0 w7 {3 j, P( w; o4C19:0095 MOV AX,0911 ; execute command.! x4 V( \( @# R6 H9 e/ W
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: B3 J: L) U. ?7 O. ^' K
4C19:009A MOV SI,4647 ; 1st magic value.
4 ^* h* {* g9 k3 g. M4C19:009D MOV DI,4A4D ; 2nd magic value.: b5 X" ~! m7 V5 J# I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( g& _2 g) n/ p* H' k4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 F/ C, O5 r8 Y4C19:00A4 INC CX { F0 B( @* I; q" F0 M( d2 n7 V
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute! u. ], x. P2 v
4C19:00A8 JB 0095 ; 6 different commands.
D% s6 ]% H! W E/ U4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 l, R3 \! @8 `0 C/ A) C
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% _( L' c$ N& W% X
% o& u1 g' @0 J* T# ?5 V/ F0 jThe program will execute 6 different SIce commands located at ds:dx, which
$ A: B& n$ O3 S8 `0 Hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ U& W, B z. m3 j) K/ {8 T1 s
$ M# Y: D4 @3 s, L5 y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 G. e f) C3 m
___________________________________________________________________________0 s N; {" Z% D3 K) P
1 R6 A+ s# | L# e. ?, V
3 J' ]% N9 y& M7 R9 [+ `
Method 03
& i# ]5 X3 X! P! g=========
0 f1 E6 E% u4 l( B; F7 w0 K! D3 G6 p/ ]% U( Y, p9 @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 ?7 u( H5 ?4 }' h4 Z$ V7 P9 I: V
(API Get entry point) y- {7 C* J' i5 ?1 m1 R
6 Z# z4 l* I6 }3 n0 }
+ g5 D3 e0 O1 R! u, q
xor di,di
2 i/ k" @6 h, n8 q mov es,di
* E. z. b" b s8 X mov ax, 1684h
5 x% Y. U: t7 H, F/ e) ^ mov bx, 0202h ; VxD ID of winice
- }, d9 s: ^% w2 h/ q: } int 2Fh) \! m2 h& `" }/ }; K0 I4 e2 L, j
mov ax, es ; ES:DI -> VxD API entry point
' J* g+ g3 Z+ G* G; W9 {* u add ax, di" K6 i) ]/ H) u, M# \: e9 K% s
test ax,ax/ v M& f2 K( r/ `+ P7 I
jnz SoftICE_Detected
4 U* Y: L, j- r- t5 b+ q2 m/ }+ L/ o: H/ W$ U5 G8 a T
___________________________________________________________________________
3 H9 C: s% q- G+ P* p
1 d% w* d! {' [; X$ U) KMethod 04
( w9 F# f1 }- \% s* @=========
" N' K2 R; m4 A5 @9 v! Y t( H* s- H7 _9 O% _
Method identical to the preceding one except that it seeks the ID of SoftICE
0 U- o) D' T! v ?& _/ lGFX VxD.
& @& p8 c v! z) V9 i1 e) x. }6 \2 B. a6 v1 y. g
xor di,di- V7 s) G2 r! f! X7 b8 Z
mov es,di8 y9 x9 H+ {/ X0 Y! _
mov ax, 1684h
1 h) F$ X7 _2 M- [- N& Z mov bx, 7a5Fh ; VxD ID of SIWVID* ~$ W' e8 c+ q3 s( S+ q
int 2fh
z! d# _4 H# K) w1 B mov ax, es ; ES:DI -> VxD API entry point3 m7 V4 H! L' A2 N/ Q4 s, n
add ax, di0 n: `6 @) X# }5 k& e- ~# k+ ]3 l
test ax,ax
( Z! F' h5 g1 g2 B U K( }9 S jnz SoftICE_Detected
/ H% q! s! A! F) r! ~) o5 ^/ g$ e- e" N2 ^
__________________________________________________________________________
4 \# R) m0 w4 u* D% O3 u/ \( v) }& n7 P8 m; Y. Q: u. g
F4 B, H- e; [0 K6 N( HMethod 05
0 |) L) z/ K, r9 b; _# \=========3 |- q0 T5 y. l
' P2 z" z/ s9 f0 h9 gMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; I6 G3 \. l- t( B3 Cdebugger. It calls the int 41h, function 4Fh., y8 g, t$ m: k- ?0 y+ C; Y
There are several alternatives. 4 h; Z! Z% W8 }4 V1 C
9 Z) T9 ^0 ~8 G( o: Y, O
The following one is the simplest:3 c) k \2 V7 {0 t8 [5 p6 f% D/ s
) [; e. g! @2 H: l6 M1 g mov ax,4fh
) q# @4 d2 `2 i% M* p int 41h6 N# L p7 I" M$ H% G8 a
cmp ax, 0F386
" P4 R E8 Q6 S8 ~0 t jz SoftICE_detected; S( l% o4 J4 Z( F
$ o J, E5 O! T' n0 t8 i- e) E- R
$ O- Y' e. R, B- A. ]% z3 u- `) Z
Next method as well as the following one are 2 examples from Stone's % W* ?* W' i2 |
"stn-wid.zip" (www.cracking.net):
+ [$ S# ` o6 }1 M e4 d5 i- @9 ]' A6 O! a' ]+ s+ g
mov bx, cs- `! W! F2 [, t) H- j& ~8 D0 ?
lea dx, int41handler2
4 T5 m0 R7 N( i7 D, v" s: | xchg dx, es:[41h*4]% l/ I( m5 d2 i+ B
xchg bx, es:[41h*4+2]
9 h7 r& t9 T. ?' l& l( _; H4 ? mov ax,4fh
4 ]5 L8 W" U; W2 v+ v int 41h9 v/ ~$ h+ v' A+ \" n0 y
xchg dx, es:[41h*4]
+ l3 L5 ?" A% C2 N7 `3 v5 g0 Z2 d! S xchg bx, es:[41h*4+2]
" X* Q5 Z" |2 J0 ]! M cmp ax, 0f386h2 a4 ^3 K" l( N
jz SoftICE_detected0 ~( ]: V( f' J$ w" Q
1 _8 Y5 i |/ D7 Z! p* T7 Q7 r- Gint41handler2 PROC
; m t9 ?5 q6 \! M8 f iret
7 f3 [9 h3 h; H. m% Q2 m8 X- i. K" Eint41handler2 ENDP
4 U) a' r/ i- A9 X- n& @- y; ?; J: C' x+ e2 _
# R: i7 o4 `6 g4 j( A. a; W
_________________________________________________________________________- b' p5 n- h; S1 I
+ B1 D$ M% k* m1 w& q" i
3 d l" W# n" { D6 L( _* Z+ \Method 06) o5 i2 Q' y9 Q/ V1 ~1 M
=========
! _3 v, a5 B& } [! v$ r
1 @4 [( s) e% R4 i
* V9 ~- u0 @$ a$ [" q2nd method similar to the preceding one but more difficult to detect:. t1 f; t2 A, W" |0 R( a
; z$ U4 t5 P; L* H0 [
4 ^" z# ~) u- z P0 q1 o
int41handler PROC
) m$ Q. y& y8 { s, H0 o mov cl,al
q4 q$ M3 m* n3 K iret5 ]0 M- p+ j+ C; @3 p8 j" l
int41handler ENDP
3 [# j3 H: q; N8 r/ K( I z) m9 Y% t: _: J! Z" @
! i0 R. l; ~! G- C5 V* R: n6 p xor ax,ax
8 G8 l9 ~7 Z. k mov es,ax S% d+ v: k; q& C! H4 K# t+ W
mov bx, cs, @) O7 y- E+ [) E
lea dx, int41handler' s4 I1 r) g* T( H) G1 h) G4 ~
xchg dx, es:[41h*4]
: R, v% F/ W8 P. c3 { xchg bx, es:[41h*4+2], F! p% I7 ~" \
in al, 40h
# t7 ?; D# e* k% F- |+ i xor cx,cx3 c& Y) W, @2 X3 b3 J, J. t. R
int 41h# p) I. H6 t( k8 b" t8 S8 ?
xchg dx, es:[41h*4]
8 a, S B4 W) ~ xchg bx, es:[41h*4+2]$ ]' y/ T& w9 Z! G
cmp cl,al" L/ n* u" ^" e9 m+ m4 p
jnz SoftICE_detected
, R; ]5 z! P6 Z# ^) r) {, s' l1 | Q" `- @
_________________________________________________________________________% n2 z9 Y6 x: I& j
0 o/ ^+ I& B( t7 H/ o8 z: B5 `
Method 07- F/ }% B* i# N0 y
=========9 F. p. ~$ n" {8 A8 |9 y# K
! N& B# S* O$ a8 |* O
Method of detection of the WinICE handler in the int68h (V86)
% r% ^' d9 x+ u" c% h1 h+ u. A! E5 X( R5 X) [
mov ah,43h( H, O& w. @ Z* K) ~
int 68h. h4 o, V$ _, ?, E) r0 K; J
cmp ax,0F386h
- M6 ?) n6 ]! Y9 m& J jz SoftICE_Detected
) O5 M" R V* N0 Q' y# i" e) O& j5 z/ d- s; h- G! w" b
6 `4 y1 V, k9 h2 j
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 I& M( A; r* E, p0 p
app like this:* \, }8 f- R1 ^2 ^4 f, R
& L+ `$ F6 u) W- {% e" T+ g) F BPX exec_int if ax==68; u2 A( b- q% v: j3 S7 S' ~. [
(function called is located at byte ptr [ebp+1Dh] and client eip is
# ~$ Y z4 @% R located at [ebp+48h] for 32Bit apps)
, E6 D9 ~3 U0 ]) _# G__________________________________________________________________________) X0 M7 @! l, \
: C; a- m" t, s7 g8 j
3 {) H, a0 a% A+ I% xMethod 086 {* N& s. u$ Z4 k, w/ I
=========
" `; [; ^8 M* W2 _) s G( t4 ], e; c; P
It is not a method of detection of SoftICE but a possibility to crash the6 V0 ]/ d1 n( ?9 G6 {& i; M) `
system by intercepting int 01h and int 03h and redirecting them to another8 f! v* ~( H `4 t
routine.9 x- s8 Z0 y$ o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ m, l/ h+ p: m* Q4 O4 ?
to the new routine to execute (hangs computer...)
& i; ` f6 q. D4 h' x1 W# i: ~, j1 V y7 x8 Y u+ b0 j
mov ah, 25h: B3 o$ F3 j$ g" w( K
mov al, Int_Number (01h or 03h)% \+ H W R" @7 W z
mov dx, offset New_Int_Routine
% E' I7 \! W4 \ S" s int 21h
! F6 f+ j) j$ J3 U C. m3 o% z L$ W. F8 L3 s1 t' _
__________________________________________________________________________6 v; H6 c- P/ B7 }0 A
4 s5 S; S$ C& M3 N2 P7 x6 X. BMethod 09
% b/ h( x" r: ^7 O; P========= T9 a4 L3 h: d+ U1 \
1 a6 K0 |* Y4 F, ? L9 |6 eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' f: h8 l# b+ j. c& Operformed in ring0 (VxD or a ring3 app using the VxdCall).
- K3 U! \1 Q% _% P; UThe Get_DDB service is used to determine whether or not a VxD is installed9 g: \/ L& |, k7 c
for the specified device and returns a Device Description Block (in ecx) for- T; R F9 k+ x @: [) W3 E6 q
that device if it is installed." a4 V/ E( H( s. \* X
. X3 Y% p) o. ^) C7 i! U: r) B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" u5 W0 [0 Z( I" E4 p/ X! r/ _: F mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( N1 K7 u$ v2 r7 |% b$ ?! U( ~
VMMCall Get_DDB
& L6 {1 `0 Z1 F! V mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! c) R$ U0 {" |; f! n5 a
% p# z5 v; ?5 z1 g8 p4 M
Note as well that you can easily detect this method with SoftICE:6 U) f/ z4 s- e) @1 b/ I0 k i
bpx Get_DDB if ax==0202 || ax==7a5fh( F+ N) |; E- j% D% h0 V
: D: Q2 D2 n1 u% Q5 j__________________________________________________________________________8 C6 _! \4 W5 A" T/ l
) T& z, K7 ], d' g1 s
Method 106 N# ?' M6 q. a
=========4 K8 @/ ?( a: C+ q4 S
- {$ v2 ]( [! R4 m' D- j: I# t( a) [5 A8 X
=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ M3 Q* |* p, _" M SoftICE while the option is enable!!1 G3 O; a! [. z6 y7 r# i
}$ Z' S# i+ M% w
This trick is very efficient:" v7 K: g3 S% G: d! G4 I4 f7 I
by checking the Debug Registers, you can detect if SoftICE is loaded5 z8 [$ E" @1 I' Z8 j7 ^
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! M% @# C) Q* m* Nthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ G3 v8 f: m* C# I) B+ T5 |+ Y3 x
value (in ring0 only). Values can be manipulated and or changed as well
5 z! c- C1 f/ Q* g) c. T" e' p: k# \(clearing BPMs for instance)4 a. I0 q8 v ^/ E1 P3 d5 Z
' K3 m" e1 C3 I& J__________________________________________________________________________; D5 I: D6 Y9 \8 I. u3 f
- Y9 [: f8 h0 E+ jMethod 11
7 Q$ l+ q( Y% e=========
; Z; o: r, i% |! Q. h
% G _( `# P/ H' @5 BThis method is most known as 'MeltICE' because it has been freely distributed
& H& C8 \% E( D: {8 p+ u$ T( Wvia www.winfiles.com. However it was first used by NuMega people to allow
2 W5 G* |0 g% P, x1 f7 V ?Symbol Loader to check if SoftICE was active or not (the code is located/ Y1 ]# `9 Z2 y; F; `4 [ G2 F/ S
inside nmtrans.dll).
# Q1 G; E. U2 y0 {" [- y. k1 W( t" u; m% G4 w" ?
The way it works is very simple:
! d' X$ u, n* U, v; \It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ e( l' d8 U* E+ l
WinNT) with the CreateFileA API.
( H. ]$ m8 M, v0 i* h) Z
7 g9 b9 A- }& D% \$ b3 zHere is a sample (checking for 'SICE'):
' u1 F& b' Z7 K# G9 t: r2 N% d! y1 v' }9 C* Z( F' M
BOOL IsSoftIce95Loaded()7 v$ ]6 e! ^; s7 S' B
{
: k, @8 v4 m5 a. i2 o$ m HANDLE hFile;
9 l1 T5 N* ]3 |6 F: u" ^ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 D; O+ ~5 G( R0 {# M
FILE_SHARE_READ | FILE_SHARE_WRITE,
. M* m$ \( N. w) g/ Z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) u3 k, q+ H+ V7 t if( hFile != INVALID_HANDLE_VALUE )
3 `+ {4 M0 E# J0 d9 e q2 t, E {* ?; m1 k* e3 c9 v
CloseHandle(hFile);
- J0 p& p) Z$ g$ E2 Q% w4 ` return TRUE;1 Q' B7 v G7 @: s# b- ~% U
}4 F! V4 X" E- h- Y+ o" K
return FALSE;) }. _( H9 }& w
}( F+ P; A/ d9 K$ W! ]
) L4 O: K: N& e' P( `8 ~Although this trick calls the CreateFileA function, don't even expect to be
, r7 C* |, D* ?+ c Rable to intercept it by installing a IFS hook: it will not work, no way!" M1 N7 v3 n( U" o6 Q- p* m
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) L8 |, Z1 x, v/ Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ B& Q1 {; J+ z" A- z3 z2 `and then browse the DDB list until it find the VxD and its DDB_Control_Proc
: Z6 T g \* F7 ]# d6 Gfield.& F: ]3 G8 I1 e2 j& S
In fact, its purpose is not to load/unload VxDs but only to send a
: ^9 V4 }: t/ ]6 C; V" ?W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). }0 a6 I& t% ^3 ]
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( }! A7 f+ D$ G4 v% U( Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& {0 t0 H( ]0 b% n6 H* s- wIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 v- m" h) M8 A, y! a6 vits handle to be opened and then, will be detected.6 u8 o) O* t5 A' O% c
You can check that simply by hooking Winice.exe control proc entry point$ f1 q- f! X5 F+ _/ Z6 s1 c
while running MeltICE.
8 ]3 R( y6 x( l7 e# j& N( J+ |4 x
6 f- i; ~- [& |# I M; z* i! f0 c+ r9 q
00401067: push 00402025 ; \\.\SICE
% n& K$ ?$ ?9 J4 Q 0040106C: call CreateFileA6 U! a5 R/ N4 }3 b n7 M1 c. H
00401071: cmp eax,-001
9 S! ]8 p7 X$ v) _ 00401074: je 00401091
" p7 ~5 s7 O; m+ p0 C) l. y# |2 `# B+ B7 `
/ `' F) \2 {* B7 |* ~8 L+ H* jThere could be hundreds of BPX you could use to detect this trick.
( V) N* h$ }4 p5 m! Z; y-The most classical one is:; J* F- W6 }2 \, {1 w5 J" [
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 @8 v/ i% y. H8 n! K( K *(esp->4+4)=='NTIC'6 r$ R5 t; A) ^! R r
, |# Z8 a9 r6 |. a M& q
-The most exotic ones (could be very slooooow :-() @+ i3 g3 W5 V2 o
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . E; N" w% E$ R' S! X) S
;will break 3 times :-(
& e& q4 a! [+ @& l
9 s# S) V: E' o8 Z-or (a bit) faster:
. @% O) N) W6 P& _3 O BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 ]- S( |6 K+ I. F" u+ w
4 @$ g7 I e& T: v1 r. r BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - i7 S# T9 s" |: O& Z9 q8 t# L
;will break 3 times :-(
# M- C( T& J. E7 V% Y; E8 `2 t
' @' v% s7 x! Y6 `) x-Much faster:! e3 B* ], L3 v
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'% x+ o( U+ q# u7 r& i& o! A6 ]* P
; _( E6 h% o8 }/ ^$ ^) b5 E
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* S4 m* U+ ~: B9 k s! C @
function to do the same job: h8 L' M( v* J: p2 x# m
- V$ g+ |. |3 G5 f+ s2 r3 X push 00 ; OF_READ" I g5 |* X3 R7 e- G
mov eax,[00656634] ; '\\.\SICE',0' p, d9 G' z9 v" R/ l9 A
push eax; r' N) ~0 y. T7 d7 ]$ n
call KERNEL32!_lopen* J8 r, k# r5 z$ g
inc eax3 @) P4 ]9 v7 x2 [. n
jnz 00650589 ; detected
. N, L; J( U h6 R( X- H push 00 ; OF_READ
8 x$ s4 Z5 j' s9 }3 F- r2 f mov eax,[00656638] ; '\\.\SICE'
/ }+ U$ b% ]* ?$ I4 m; p B push eax
+ W V j _6 W6 R call KERNEL32!_lopen i1 d0 U' o& u2 X% G6 m- g7 c; a% ~9 `
inc eax
5 ?) x- l+ y5 K" I! G$ n- M+ B jz 006505ae ; not detected5 l, b3 R" K. x7 F6 }
" \. a5 \! s' \' P; M+ o- R, {% Q6 j9 ^: P0 z+ I
__________________________________________________________________________" U3 B* {$ {3 _! G S) p; M' m
. S) S0 b6 ]& Z! `' U6 {. N$ l. ~
Method 12
" |. ^+ ^) P7 t) N4 U* \% C- H9 B=========9 U/ @6 d5 ^& r3 _% Y: ^
$ f, v& }. k6 O, O0 @/ hThis trick is similar to int41h/4fh Debugger installation check (code 05
/ r5 c4 G u" V3 N4 s9 \& 06) but very limited because it's only available for Win95/98 (not NT)' [* u* D { H3 x
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& B% Y) S) S; [5 {) o7 [/ r9 a W# o& C3 }7 Z
push 0000004fh ; function 4fh/ Q( n4 m. F0 O4 V# s% _! |6 O: M* W! {
push 002a002ah ; high word specifies which VxD (VWIN32)
# r: D* k& n' V* b7 E ; low word specifies which service
" r; O1 h1 M3 O$ Q6 H (VWIN32_Int41Dispatch)
! i9 P8 h; s; W. ]4 | call Kernel32!ORD_001 ; VxdCall
2 w* [6 y) M0 T! o6 Y' z! A t cmp ax, 0f386h ; magic number returned by system debuggers
* S2 ?. v7 W* ^0 D0 a, J0 @- o jz SoftICE_detected
) d u) C; V, Q ? O6 ?. S
4 \$ a# m; O2 @! D: R" IHere again, several ways to detect it:
" g0 ^' y6 ]2 z/ x7 g9 Z4 Q/ k+ T$ N2 ?, m" m2 U
BPINT 41 if ax==4f
, l" R1 C0 f1 a: E4 O& e( n$ M
$ R g8 O* ^+ Z1 U0 M* h H BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 v A9 c" ~6 z+ Y' P7 v6 D; \$ l; N/ m x! L! g
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 T) U( H- V0 X" G
, g5 L W5 F( ?" }# X, p BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 @# w! A/ }1 l- b# K& r% p
# _/ W2 k$ h' V, V S, @__________________________________________________________________________
: B) e- c2 q: E9 S2 Q' ^
# d, ^4 Q2 E2 X B2 t3 G6 xMethod 13( E! [4 W: p8 H2 ^8 v6 Y3 a' f# F& h
=========
7 m$ d0 _0 Y# Z4 Y* I/ {/ h( |) A9 g' d4 N! k1 H
Not a real method of detection, but a good way to know if SoftICE is
: \, p) K5 _7 x4 R+ ]' n/ ninstalled on a computer and to locate its installation directory.8 W' b' @5 Z3 B% Y2 d. @9 I# L2 m
It is used by few softs which access the following registry keys (usually #2) :/ j2 [* |# C3 h% r: u0 D5 [# G6 }
: |8 H# m$ U( M9 V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# K2 Y( m0 H1 Y W\Uninstall\SoftICE* M8 h6 I! g4 e: C O
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 Q1 A& j6 w" s3 w
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 ~1 f' b9 N# G, \# l9 ]4 M
\App Paths\Loader32.Exe; \: J- D z3 Y( A" A. H$ D% Z
V' B* ]' n: u3 X V5 }% d# K
& A/ D* P9 I3 v9 V/ z8 ~5 D8 m# INote that some nasty apps could then erase all files from SoftICE directory
8 L! ?9 n, g, q, L(I faced that once :-(+ f" `+ q! U5 m } Q' |
) r: A5 A, b9 o
Useful breakpoint to detect it:* }( h* y* \- g! l" U& m
6 P' {1 F% b3 h- F; _ P# [ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 S7 l9 B5 F! p- n3 \" ]9 k8 Y% ^' j h ~
__________________________________________________________________________
' O( _4 Z; K7 N% R3 B5 l+ P! b$ A4 q6 U7 ^) `. [5 b
|' W& e( j$ n+ cMethod 14
& |4 @5 ]7 x/ s4 P* U/ G5 P4 c3 @7 G=========
) v" P9 [- c* _( i
, [& |0 z' L, Y4 }9 m+ t% O' gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& [' d" f, Y5 o7 c3 f2 q7 Lis to determines whether a debugger is running on your system (ring0 only).& {1 n$ r1 e$ d2 t% v6 u
3 k3 X- x C2 V" a
VMMCall Test_Debug_Installed
( V) c6 ^: {- T& a1 ?* } je not_installed
# A3 h. Y* X" s9 n3 E P* _6 K" ]* z( _- z6 |- [
This service just checks a flag.4 g- H4 h9 n6 I3 h- \/ x9 {; |
</PRE></TD></TR></TBODY></TABLE> |