<TABLE width=500>
8 O8 N7 R$ v; z4 @, W1 f<TBODY>
! g3 x& H6 h# Q, m% l9 ^<TR>5 i; ], b" f1 u* u5 J
<TD><PRE>Method 01 ; l) o! W3 S' S* ^, P1 G% p
=========4 f- E3 Z' {3 z6 h' Y7 G0 }4 c
- ]+ }5 J1 b. v' c& j! B
This method of detection of SoftICE (as well as the following one) is. j- R5 p3 G- e. E h
used by the majority of packers/encryptors found on Internet.1 m8 a: ?, E- E' G. x2 @3 \+ R/ X
It seeks the signature of BoundsChecker in SoftICE: O: ^; H& T1 k9 t" t0 K; Y
* R- R& x# }# A% |: g2 n
mov ebp, 04243484Bh ; 'BCHK'
; _* [+ f; C+ [9 Y" p! @* R" `7 { mov ax, 04h) n4 p3 `3 c' m3 L9 n
int 3
5 p" f) z& t. P) e+ | cmp al,4# p% n% j& }& q+ |- m( s% R
jnz SoftICE_Detected
( R7 g7 y$ S3 v5 U& D1 b) g
# O1 y8 |4 H8 a___________________________________________________________________________
9 W. t5 Q, |0 b$ R- R
# b, E( w8 \* qMethod 028 M- Y% }* C$ q v
=========
: W9 o8 R' w c& i1 c, u H( X, J, u6 G5 z
Still a method very much used (perhaps the most frequent one). It is used' W' t1 ?+ I5 X% a) k, t( k2 t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, _8 c9 \: H: yor execute SoftICE commands...
- t+ S0 d* N5 o. ~/ z1 KIt is also used to crash SoftICE and to force it to execute any commands
% T5 Q( X6 j l(HBOOT...) :-(( a6 M. \% \6 o! [. F& n! ]. ]
4 b) Q" \8 Z: B+ H8 @$ J, B
Here is a quick description:
* u# J! ?; `+ a; }-AX = 0910h (Display string in SIce windows)
' Y! X4 G6 T; M1 K7 v-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
7 {7 ~1 }0 r9 d a3 P3 o-AX = 0912h (Get breakpoint infos)
6 r, F1 ^2 W$ p# D4 x-AX = 0913h (Set Sice breakpoints)6 P' U8 S2 ^& `8 Z0 z. S+ O0 c9 m, ~
-AX = 0914h (Remove SIce breakoints)
" a. E1 c- P* }- ^9 o% N" `
1 Y" c: a+ p8 x. k: _ l( ?1 |Each time you'll meet this trick, you'll see:
, o ?5 }+ {, j" a: b6 t-SI = 4647h
$ Y' _6 k8 m/ \' J `. k( L-DI = 4A4Dh
. p+ s3 ]) h! }' lWhich are the 'magic values' used by SoftIce.5 ]1 ]. t# q6 M, m$ R/ F/ }
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.( Y- C$ h, k# u( M0 J! {
- \, h' B' P5 @0 h b8 H9 e
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! {0 _; {" k$ ^Envelope utility use to protect DOS applications:
/ f& J5 x! A) {
2 q' D7 z/ s/ |) j ^ P" ~' n7 _
4C19:0095 MOV AX,0911 ; execute command.
1 v$ \; d! m# s& ?* w4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 j! i% x# `" X/ t
4C19:009A MOV SI,4647 ; 1st magic value.* a( s5 R# C! N$ E9 s8 P* p
4C19:009D MOV DI,4A4D ; 2nd magic value.3 x8 Z( Q+ b8 e1 Z0 f2 ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ c. z- U y9 K0 a- V6 b3 |! H* o! O( l- O8 f
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. ]% f0 W& H0 C7 Y+ ?
4C19:00A4 INC CX
- A2 G2 Q e) L4 D& B( Z& w$ m5 D4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; _& q, B4 {% l1 C4C19:00A8 JB 0095 ; 6 different commands.7 n+ G: V/ @1 |) `9 H- }% C
4C19:00AA JMP 0002 ; Bad_Guy jmp back.3 T: U5 a! A# ~$ \
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)$ h& f4 e+ p7 {; V& q, Q
, q) u2 a: ~+ D" D r; uThe program will execute 6 different SIce commands located at ds:dx, which/ s# u& \0 p8 ]
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* S6 V( r, |8 {& k
( v( E! o t7 e6 `9 I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 ?0 ]6 l7 T4 H. {6 h* H2 E5 O# Y___________________________________________________________________________
) i; Q& y5 U/ a$ J# X% v# R: c& d4 s% W: h' E4 G9 j1 J& `
, M5 o4 B. ^0 R( b' ?* ?* b% t' `Method 03/ l7 e* y j' x5 K
=========
- D% k/ A8 F9 j' K" H* ?) {: n6 H. E) _- T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' x3 R$ @! o' t( [! Q3 w) h
(API Get entry point)
: U$ i9 j7 h$ s- {9 I1 d : F3 t8 o2 r0 V% T& w2 r
& V7 A3 p1 D; N2 G xor di,di( ?' b! Y; s+ }. \( _
mov es,di
( l" W* Z: z Z" j9 d P mov ax, 1684h
) P2 G; X3 G0 F1 R mov bx, 0202h ; VxD ID of winice
& J4 l, ^, K/ w int 2Fh
+ m6 N3 ~; b2 x: E mov ax, es ; ES:DI -> VxD API entry point! H! E$ t* S5 y0 T! L, V( a |; c
add ax, di
' f% K6 s$ q# B2 A7 x: g9 V6 e test ax,ax
" O3 x6 m( O/ @$ { jnz SoftICE_Detected% j ^. p+ i6 r# R( R* S
, g5 |; j, `& {# e# [9 N# j# d" }; t8 K: X
___________________________________________________________________________; J9 s8 s$ o% V( ?# E [
4 n* s. l, |/ N4 FMethod 049 S' Z& V v) o
=========' M5 T8 |8 F* S1 N1 @
# q# v0 a& t" ?; SMethod identical to the preceding one except that it seeks the ID of SoftICE
& Z4 `7 [" _8 X) I, F' GGFX VxD.
9 o' w1 O. p% C& t% y" j& H" O0 b8 s' B- ~8 l o7 o
xor di,di: J X# N/ \' d2 {
mov es,di
( S( `- }/ w# a9 x2 a8 q0 n mov ax, 1684h ; {* F+ w+ G8 u
mov bx, 7a5Fh ; VxD ID of SIWVID
- b: \' v* u2 m6 @" q s int 2fh
5 W5 i' U/ k5 B0 [5 O* O; m mov ax, es ; ES:DI -> VxD API entry point
$ o( L7 g/ o* O" a2 i: z add ax, di( C S) p8 B$ l( m- Q+ {( L1 v7 q, C
test ax,ax
9 D3 M5 {, L- V jnz SoftICE_Detected2 R+ j9 N( J) Y H/ n
& k# Q2 O# H @" X, _6 ]; h__________________________________________________________________________ @$ j9 r1 ?% N s0 T
3 }' v4 g# G; B6 |, f& S3 P4 @' s' X1 a
Method 05$ T- c3 G% y/ H: c
=========
; n8 n# v0 {# x7 t3 x& ?! k
% _" R( |# ?# H N3 g! qMethod seeking the 'magic number' 0F386h returned (in ax) by all system! `" K% E# ]% |' ?
debugger. It calls the int 41h, function 4Fh.
& W! M& s$ V9 n) [+ Q7 N2 cThere are several alternatives. " K1 Q2 [0 m! G8 S" h# D
3 Z; R+ \. T; I) j
The following one is the simplest:9 y6 _# @# d- U+ e3 d) Z% r: q
5 c- n$ ^' D2 t$ V7 z
mov ax,4fh
& X% V3 G; D# |$ F3 R( I int 41h; ^8 j* t3 U/ I( _
cmp ax, 0F386
8 V* p# G- Z: {7 l* | jz SoftICE_detected
% t: J8 C6 K1 [& C; p& _& n6 b" m8 G5 C" K; L' d2 [! ^
# i' l6 w" A K8 b
Next method as well as the following one are 2 examples from Stone's
2 ~0 ]3 A, V* Q+ h" m3 N' M"stn-wid.zip" (www.cracking.net):% I+ P D/ y/ p. w
! G% D5 v/ S; ?4 I7 _& E( Z
mov bx, cs
5 i, _; V! t9 p( `6 m" s; O lea dx, int41handler26 L1 d7 L2 F. E, D6 |- D5 [
xchg dx, es:[41h*4]8 Y+ D5 f2 f3 e
xchg bx, es:[41h*4+2]4 ~6 m) A9 B+ ^# }
mov ax,4fh- y& w: W% m' }$ v
int 41h p. c+ g; A2 i) v* f6 s" b
xchg dx, es:[41h*4]% y* k! X, j) x
xchg bx, es:[41h*4+2]( V: I! e1 u( E C$ ^
cmp ax, 0f386h, r, G+ s/ S- b: \% I! W7 m( J/ r
jz SoftICE_detected
0 {6 l* F/ Q+ |$ e, {" b$ g( R; j- s" \; @/ M
int41handler2 PROC6 W/ b3 V8 D: l" w2 s
iret2 D$ u0 d! q& ]/ m; {# M$ w% B! K7 P
int41handler2 ENDP# e- @4 b) _0 I$ {8 F: N& z
" D+ O1 U. X" ^( n
7 q x( `) N# ^2 H5 s4 i_________________________________________________________________________
3 I k1 t; ?3 K1 U+ Z. G
7 ~6 E' C% e% l6 D/ }8 K, P8 ~- r6 f" F7 D+ n. D% ?$ E
Method 06
4 R- G5 [! l' U=========% g* D# J6 | \# t1 V- _
- ^( Y z6 j+ c! t$ _9 E7 C
0 T% j$ j$ R% G/ p# j2nd method similar to the preceding one but more difficult to detect:6 Y# k' N7 v, v7 v% w
7 N1 O. w! Y0 s* [4 O+ W% X
: J S0 G' r1 `# C) }2 D
int41handler PROC
9 F: r9 ?1 I, G) r( H& M" N# R mov cl,al
3 r7 ?/ U J* X* \1 | iret
K. f. F3 K+ H8 A- s! }2 J* Aint41handler ENDP
5 t. `" ^5 U0 H- r+ O( E) ^: c( C8 B9 I+ k, {2 J7 l" l$ b2 c J
/ Z3 }( X7 B7 H' O
xor ax,ax5 o* U' D- e3 P1 Q
mov es,ax5 q$ ]! T+ C+ G5 H- d) c
mov bx, cs
: k5 T5 m: @% Z3 \$ z5 ] lea dx, int41handler9 q. A: y) ?' w
xchg dx, es:[41h*4]2 p! v' \8 E$ U
xchg bx, es:[41h*4+2]- t9 G+ x# y- \/ }, w
in al, 40h
0 r$ Y- T* Q& m0 ` xor cx,cx4 ^/ m4 X! }- Q9 M8 V
int 41h B- F8 m9 M3 P4 |: c2 Y
xchg dx, es:[41h*4]( r1 j" n3 q' X. h9 m
xchg bx, es:[41h*4+2]2 I2 e6 c% C# w
cmp cl,al
5 N) L% L2 g* c6 U, L1 k# ]# M jnz SoftICE_detected
' k- K, U) G- y- s6 {9 T# h! x2 O8 e0 |+ ^; p
_________________________________________________________________________1 [4 z* U+ g8 C2 [6 s( _1 G% v) }6 q
. B! J$ y1 y+ E# vMethod 07& a! ] d4 o4 @5 }( ~
=========: x1 u5 M6 a4 [' R7 n8 _$ H
/ p% M: H7 d9 I; T& K7 U& ^( W( s
Method of detection of the WinICE handler in the int68h (V86)- ^6 t; a" y9 l4 t
, {5 U S/ C9 X4 `( K6 u0 ?
mov ah,43h
! Q1 v: u6 M; X$ a& F int 68h
! D$ X- {5 |7 ^. ~+ A R# Q cmp ax,0F386h& a7 Z, N1 O3 o# X
jz SoftICE_Detected
7 W1 `9 K! `& y* y+ Q5 M' G% m5 Z( f% D
" ?8 ?- Q$ s* b" C S- k=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 X# d8 O" q! \. @8 h app like this:
! H, g2 ~ e, \! F" @. X! e! ?5 v! j: ?; E
BPX exec_int if ax==68( V' O+ r; x3 B. v5 T* y f
(function called is located at byte ptr [ebp+1Dh] and client eip is
( Z+ e0 W! n+ H7 C. @( R3 G located at [ebp+48h] for 32Bit apps)
8 \0 g2 {) J6 t__________________________________________________________________________
. f. T# N+ R, M; x- j( M% }" v: u1 R; T w
- e+ E7 u8 p# f% u( i$ c$ V- h% D% |Method 088 R2 q- |' Z1 }. ^
=========
1 t \3 M/ w1 t
) t2 z6 S( ] H: \5 CIt is not a method of detection of SoftICE but a possibility to crash the
! G- m' c; W7 j9 a, Dsystem by intercepting int 01h and int 03h and redirecting them to another1 K+ [4 h! H+ j/ M' k' [
routine.
7 P9 o$ v* a- e! _( U* w) K5 Y1 wIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' C3 S: e4 W. d d1 W) U
to the new routine to execute (hangs computer...)$ ?8 t, i% |6 }2 S/ x. a) s% k2 B
0 K2 \; Q- u8 d2 a* y) \ Z
mov ah, 25h
2 M+ A) d2 F2 W B mov al, Int_Number (01h or 03h)
3 C/ C+ m4 \ R9 n& x mov dx, offset New_Int_Routine
) v, e: _) {" ] int 21h
4 e# b6 H/ P2 ]( v6 m
% n! X/ Q) b A2 P# A0 D1 x__________________________________________________________________________$ X/ I& m' Z% K0 @
4 U( z* j. N: ^2 v; kMethod 09
9 u9 O8 o( v0 Z. g1 ?- n# Z=========* P0 O% B# [3 L6 _3 {* S& v- Q
5 z, F8 ?' Y" R. m' oThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 A+ z* F& D8 r. O0 Q4 l( D' Uperformed in ring0 (VxD or a ring3 app using the VxdCall).
% Q }+ a( q, f& VThe Get_DDB service is used to determine whether or not a VxD is installed; k2 o2 p8 C. _
for the specified device and returns a Device Description Block (in ecx) for0 N0 m5 f& s' g* O$ d3 S8 w
that device if it is installed.
2 w. G: J Q* H; b0 I
: Z) {$ @# M. `2 y! p5 J0 a; X) I6 @ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 B8 W1 V: w' s7 H mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); r8 C- j6 x: ^' N* F$ \
VMMCall Get_DDB% s5 v, |" a0 _
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) p) P/ J' P1 `% v0 K
0 i8 |% F% L% A, Y+ W9 h- F" PNote as well that you can easily detect this method with SoftICE:" Q& `& i- Q( g1 g' z: S
bpx Get_DDB if ax==0202 || ax==7a5fh
# N9 F( W- f" O+ T- C2 @; y2 L
+ m" S7 u* I6 ^% p5 c1 W$ [' G__________________________________________________________________________" F4 q2 A' p9 p4 a' [
& i/ d' n1 ?1 ?" I
Method 104 E# D) v! s& G
=========
9 e2 a0 e2 ~ {2 [* t1 j& Q/ [3 ? D& N1 p$ W- J6 j
=>Disable or clear breakpoints before using this feature. DO NOT trace with- e1 C- z1 W4 N5 o
SoftICE while the option is enable!!
- R. ^) b9 @ J
& @6 r8 Y$ u$ L; kThis trick is very efficient:9 H4 K0 a4 l! \8 Q
by checking the Debug Registers, you can detect if SoftICE is loaded/ y2 U# p2 S- k1 ^
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' b9 ], h' Q h# h; j5 X) B& z
there are some memory breakpoints set (dr0 to dr3) simply by reading their
% h4 }0 Q1 c9 w, m# ?' z$ x# T2 Lvalue (in ring0 only). Values can be manipulated and or changed as well( G" F- j) [7 o" L& u4 m8 I& V/ y
(clearing BPMs for instance)
/ B; L7 |0 p! Y5 G$ B4 J3 B. i) j3 Q3 P- F: X0 k
__________________________________________________________________________
& B0 m6 O* b3 Q4 M
' ]: c$ f4 U/ u4 ^3 Y a, s" E) oMethod 11
$ B( P) Y$ e+ [3 A=========
; {1 T: Q# G# f5 X/ K7 W% d6 b
) R* Z0 I9 J4 \0 NThis method is most known as 'MeltICE' because it has been freely distributed
) D/ e: _. d1 \- dvia www.winfiles.com. However it was first used by NuMega people to allow( ^7 v2 G3 d1 j0 P# h$ M! J
Symbol Loader to check if SoftICE was active or not (the code is located
! d8 d1 f9 |' W* Z# u1 A- dinside nmtrans.dll).
. c y3 f D3 [6 H0 {! G7 F. y
) }4 w6 d5 i+ F2 Q/ o0 P; X) yThe way it works is very simple:
/ m Q, m5 \, t! x# H7 pIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# a; O; W% x( T4 Q, pWinNT) with the CreateFileA API.
1 p. ~. o k$ ~4 B |/ F) n" [: l7 V+ ?$ o4 b; Q/ a
Here is a sample (checking for 'SICE'):
) u( `% n" B1 X6 o1 E
) R _$ H- ] QBOOL IsSoftIce95Loaded()1 B1 P) V0 w6 C: ~% }. w6 `
{( d& s, k# l2 ?
HANDLE hFile; 4 Q) U" T0 e W/ K8 M5 y6 K( t5 k
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 @& N6 t6 m6 P) O2 ?
FILE_SHARE_READ | FILE_SHARE_WRITE,1 @8 a2 s3 V- [( `8 R, K
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 G9 t# d; _2 s7 n0 X. ~ if( hFile != INVALID_HANDLE_VALUE )
% y7 T! S6 Q; `+ n6 _3 K {
# [/ K& V5 z7 f+ U' C8 ` CloseHandle(hFile);2 V* _+ q8 @! @3 T
return TRUE;
( R) ]+ O# Q/ [- C( |8 ] }$ |% C& O# ^( {3 y& g
return FALSE;5 u4 \4 s& B+ m$ ~5 Y7 @
}2 B- _) [* E8 Z; S3 |, F
( w/ G+ k& K' P/ G! n
Although this trick calls the CreateFileA function, don't even expect to be+ ?: D4 M: `3 I/ |4 y+ g2 b
able to intercept it by installing a IFS hook: it will not work, no way!: Q& B. m( m- l6 Q. b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F* Y0 Q! G7 W9 C, I+ ^3 Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): r3 r) D. M; N' y2 O! _' V- S" f
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( l( n7 L2 {9 \; y
field.6 o9 I" {9 @( p5 r+ s
In fact, its purpose is not to load/unload VxDs but only to send a
% L% E# k) I. E2 i: P& pW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 k. D8 O- H$ Q1 H+ Kto the VxD Control_Dispatch proc (how the hell a shareware soft could try4 v, s1 A; O1 p9 U3 p/ B6 g& B
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 T+ N5 ?. z5 G6 h0 M: L( s
If the VxD is loaded, it will always clear eax and the Carry flag to allow) a$ B' T) d) O# E4 C
its handle to be opened and then, will be detected.0 n. ]3 u/ T! i/ V
You can check that simply by hooking Winice.exe control proc entry point/ `' ?* `$ U- B, @# q: q0 x
while running MeltICE.
6 ^3 n% A, u) E* V5 X8 V, |
1 l5 g" G. s. K0 n+ n8 ~ J5 i- f; j0 w; k5 }, \. W
00401067: push 00402025 ; \\.\SICE
* ]" W1 r8 z9 t- L& ` 0040106C: call CreateFileA
( X8 s6 t9 U, v. L) D' g$ B 00401071: cmp eax,-001$ D+ y4 Z* M* R) L9 U
00401074: je 00401091, L$ `6 |7 N0 t7 |) N
' C9 M2 o6 h/ f% ^
! R- R; s2 w4 ^There could be hundreds of BPX you could use to detect this trick.
3 i+ ]% f- w5 M) O4 |+ y7 c$ X: z-The most classical one is:
* E( C0 A" ]7 L5 H V3 c/ ?4 r) r BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- ^" @& `) L2 Q( N. A+ o *(esp->4+4)=='NTIC'
2 N* b' K8 N/ }! M! _$ S7 J+ M6 o9 z6 t o/ c% t
-The most exotic ones (could be very slooooow :-(
0 i7 v8 U& m+ H* {1 o% ^3 S4 l BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 G2 Z- p, I; Q. i4 }- E ;will break 3 times :-(
8 P) z) D0 \( l4 u9 T
' r1 e* F) i1 J r-or (a bit) faster: / r8 N+ F% b1 d2 c: T
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 H( h/ Y0 P3 s- [9 p2 `7 g7 u
3 i7 z8 ~* b. k0 O: Z& [: M9 P
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ( {0 g0 l1 h- G+ U2 a1 o) V
;will break 3 times :-(1 [$ |5 b# j; t" {. u8 J. ?7 u
# ~& ^7 B. f+ I' p+ H-Much faster:
' N- G P7 Y3 U) }8 y; b( p BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ z7 V6 }8 q5 O! i& k1 u
/ O% v1 f. j+ p+ V2 j, w! m2 O& gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen, V9 v1 Z3 X6 } U
function to do the same job:
/ i/ C8 T, w. e5 V) |& s5 [: I2 Y+ k( }
push 00 ; OF_READ
3 b4 h" M& A1 V7 s5 \ mov eax,[00656634] ; '\\.\SICE',0
% H% H7 \6 F+ a. V1 { push eax z+ H7 I* A3 G% \
call KERNEL32!_lopen
) o6 N) b" \6 i- c) |( u- R: d inc eax( C' [2 W3 `% y- ~& ]
jnz 00650589 ; detected! g/ q+ W: `1 f& U, k2 f* H
push 00 ; OF_READ0 H9 H# v4 i) ]* {
mov eax,[00656638] ; '\\.\SICE'! ]9 m, N0 Y: u% L0 @) \ C, t* l
push eax6 [$ e+ Y0 _% a r; m& R2 F
call KERNEL32!_lopen! V4 K( `" J7 m* s
inc eax
" T( A7 f, i8 D; d6 G) }# T$ d jz 006505ae ; not detected
8 E6 @) s8 y# ?' Q* U/ R) ~5 U) t( q* q7 g( Q' M
) Q7 J9 c6 M, }" O9 x
__________________________________________________________________________
0 k& j# \( F( y& _) Q7 r! O
8 D( t$ T2 A: lMethod 12
' _ L! P) [- b# u+ x3 O# H2 I=========
! V. ?% Q) G) b0 y8 i: {# n5 u+ z' W2 X, J% }
This trick is similar to int41h/4fh Debugger installation check (code 05$ x' t; v3 W: s* X
& 06) but very limited because it's only available for Win95/98 (not NT)
5 k# D1 g7 C6 t+ e: Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 p, t% M, t D) ]9 v* x
x- c2 \: y1 A* U push 0000004fh ; function 4fh
. B+ q6 |5 F# S3 B push 002a002ah ; high word specifies which VxD (VWIN32)
. P0 g' e; |0 `1 x" c ; low word specifies which service
3 y$ `+ p) q2 Z* h (VWIN32_Int41Dispatch)
I+ ~2 g# B3 Q call Kernel32!ORD_001 ; VxdCall7 x( ] _1 Y. M. d2 p: k
cmp ax, 0f386h ; magic number returned by system debuggers* p" x: W- ] J1 v2 k
jz SoftICE_detected
' ], j) x+ |* w t1 h( d/ r5 s9 J7 Y* W
Here again, several ways to detect it:; b; q. D8 K9 F7 B m2 p+ S( x H
) u* I# d! ~% l+ c
BPINT 41 if ax==4f& I. v1 \" N4 m8 ~
* B7 }1 a) p+ w; `
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) e2 S, H; b8 r
m4 k. f2 }0 C2 _3 B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 w& u/ b e& ~3 E+ n3 J2 B$ v9 y) ?
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" b" Y7 E5 l3 s8 ~4 W7 j" \8 S' ?4 q: |; n
__________________________________________________________________________( e0 J0 ^# ]1 P! U: t1 E
: M, g3 d; V; XMethod 13
$ |9 |% t" \& R9 K=========
6 B2 m7 m8 M0 I! z5 C; x3 V( B: o5 ^5 ]3 k
Not a real method of detection, but a good way to know if SoftICE is
5 p% y' } Y3 A$ k+ binstalled on a computer and to locate its installation directory.
A, R& h+ c+ |0 O! @It is used by few softs which access the following registry keys (usually #2) :' P, P$ N, d0 y/ {/ U8 _
% M0 m! }# M7 O+ f# _/ ?-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 M. s, a( c5 x1 M4 V3 ^1 E
\Uninstall\SoftICE
" d4 z* X! R/ y& q I9 U# o6 P' J4 [ D-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; P5 M( w! a. u- H' f
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. G7 g1 N- Y2 r: N: }" A5 r
\App Paths\Loader32.Exe5 h1 Y" r" b5 b" \/ o3 }* S# [6 A
( d0 Q3 Q5 V. H
6 C# U7 A- A: N" ~9 \Note that some nasty apps could then erase all files from SoftICE directory
! q( J/ k L% x. I h8 V s. [(I faced that once :-(
; f% S' e* m5 `9 g- P6 e
/ r2 w4 [6 s k- {Useful breakpoint to detect it:: h2 ?7 l1 z0 r! V4 R5 y
+ m; i1 l" Z& ^% L2 ^+ K
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, h1 {# I; j& H9 C
! p, H7 M( U; a& }( l__________________________________________________________________________$ I/ F; x+ y. ^5 s: z
- M& l: W2 a5 P X+ p9 N9 x
6 O; u) F. M0 S, C% {, p. |Method 14
3 j7 a( I5 @# V=========+ _7 ]" @3 X5 F! C) k* j+ H
1 Y5 j( h$ i, ~" l; z* f* c& i* _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. j8 _& c$ K: n' l. ~is to determines whether a debugger is running on your system (ring0 only).
3 F5 Y- b/ k/ B2 U6 M. [: ?# J3 \9 O3 M" I* F( S% I
VMMCall Test_Debug_Installed6 P4 Q5 o1 J1 ]: Q1 y/ u1 l4 u
je not_installed0 |: [( Z: i1 ] a
2 X8 g. [0 v" U7 q* cThis service just checks a flag.
3 F7 w" a) N6 U. n( G9 Q% @</PRE></TD></TR></TBODY></TABLE> |