<TABLE width=500>
) A' ]) U2 g7 o/ M/ x9 k5 R2 K9 y<TBODY>
8 c8 P0 l! A$ l* o. {4 _<TR>! o3 r, u8 b+ v1 {8 q& X
<TD><PRE>Method 01 ( \/ k }- n! Q/ q3 V
=========5 O5 r# h+ b& `( `
5 j# f3 s ^# l2 _" b
This method of detection of SoftICE (as well as the following one) is
8 P4 _% l8 Y" m! L" u% W; A( Yused by the majority of packers/encryptors found on Internet." {* p, j' A! x8 g. M
It seeks the signature of BoundsChecker in SoftICE
5 H- P% x! I6 l% W+ [% s
1 l# b" m& d. T( J7 w mov ebp, 04243484Bh ; 'BCHK', f+ l8 G" g) T, G
mov ax, 04h
+ `: L" g" C6 n7 u) Z4 ` int 3
7 ?) i* G, ~3 P cmp al,4
$ b9 e* Z9 i" ?9 G: Q# M+ D jnz SoftICE_Detected5 @8 Z, D- o4 T: e4 u
3 V3 u) u/ I4 u, Q: e/ K$ G___________________________________________________________________________( U/ V3 U8 i' t' i* U, A# s
# a' @3 @+ F: b9 iMethod 02+ G; H" g M ^/ ~
=========
/ U/ |; f, y9 Z# e& R' v9 U; Z/ e) H
Still a method very much used (perhaps the most frequent one). It is used
9 m' Y. X+ P4 B' Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 N. `! v! g7 S& r: f3 {% H
or execute SoftICE commands...+ ~) D0 w8 p4 k
It is also used to crash SoftICE and to force it to execute any commands
6 M2 N: y, Q4 W! m/ @(HBOOT...) :-((
6 H& ?: E0 d0 ~6 l2 R7 e, b$ s6 D" t1 \" d: j
Here is a quick description:
1 n2 ?& z3 V8 X5 @' j# @-AX = 0910h (Display string in SIce windows)
- o# G3 j3 @6 o1 d" {- M4 D1 [- d8 k-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)5 {$ l5 e* b8 `- p) N/ c
-AX = 0912h (Get breakpoint infos)
L, w& t s3 p! B. \( ?# S$ @-AX = 0913h (Set Sice breakpoints), y" a" f% Q @' w. |6 h
-AX = 0914h (Remove SIce breakoints)
1 j* P \# a+ w1 v5 G! ^
! N+ P/ y0 M! M9 EEach time you'll meet this trick, you'll see:1 o5 ~3 @# p. ~8 n; v6 E h
-SI = 4647h5 o( ]3 i0 g2 c% A* V5 A
-DI = 4A4Dh+ L0 _! A; V/ B9 I
Which are the 'magic values' used by SoftIce.
* [, z: t6 }( X( \; t+ F9 cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 k' E! j" t1 p- y" y5 f# S
! X# `3 `, A$ F! {* O# m5 S2 G/ ?Here is one example from the file "Haspinst.exe" which is the dongle HASP
# d+ q# A* q% v; y; {Envelope utility use to protect DOS applications:
+ }, g- r" K4 E; p0 Q7 h$ ]6 D5 A4 j5 C& n( M1 h
8 c7 z+ a( a* n% L% Z4C19:0095 MOV AX,0911 ; execute command.
: y& |- Z& P8 j' B) l4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).$ \9 N( K$ u P; r
4C19:009A MOV SI,4647 ; 1st magic value.
8 X/ ]7 E$ u/ z& P4C19:009D MOV DI,4A4D ; 2nd magic value., t( C1 {+ S2 Q: t' E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ Q2 q; x0 [5 t
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. V- g( s' d9 O) j$ E0 ]3 `! _" o
4C19:00A4 INC CX) a3 n/ I5 }3 h& s4 G
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' |7 w- D. ?3 d# W0 @
4C19:00A8 JB 0095 ; 6 different commands.
2 i+ B1 X" U7 O' I4C19:00AA JMP 0002 ; Bad_Guy jmp back. D% s1 ^+ B2 {) S
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)& F( J# Z: G$ o" Y! y: K! J
; l1 ]$ i6 Y8 F. t/ ~ HThe program will execute 6 different SIce commands located at ds:dx, which
% \( B" p4 _5 Aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ `) L, G1 v9 X' y, _; P( Y" ^
) C. R2 s7 Q: u0 N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 O; ^3 B, r# a# c; Z$ D2 M
___________________________________________________________________________5 c8 _6 u- m/ I9 i* O
( p" c- a; w, L. e* O v0 B
4 P+ b7 f. @, S! c- h
Method 03
9 c: u b# g% i; p6 t" v N. i' b$ }=========) p {3 W2 U3 W1 b$ z5 w+ ?
o4 G$ [, K: X- O$ \, x4 M/ Y7 }
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ c& Z# G9 \- r" u% P(API Get entry point)
& f6 v/ A M2 d q, v; g7 I( u6 ]9 h3 V, r
! k4 ^9 X& I4 g. D- b" P# @ xor di,di# F* C0 G3 a, ~# i
mov es,di l6 F! l; [4 k+ {) A( {
mov ax, 1684h & \% a* Y! B1 K6 T- c
mov bx, 0202h ; VxD ID of winice" J, {) e* `) _$ }
int 2Fh" x8 ]4 c& a# z5 _
mov ax, es ; ES:DI -> VxD API entry point# l' P8 i+ _0 C. \
add ax, di
- Z8 j' \3 c( V0 O4 w6 b2 e test ax,ax
, I" W7 ?- `6 L! C2 ]% Q5 b3 g jnz SoftICE_Detected
' r( Q4 R" I* q$ Y* u; l- d' `5 W0 T4 p/ @
___________________________________________________________________________4 |8 ^" ]' I& b5 k2 Z
6 o9 Z+ H8 w# L6 U9 K/ N7 O `' s4 l
Method 04
" Z7 l$ H |. z D: d; p1 P# v) B, f=========
4 ^ }- v( n0 O- F5 M T1 o0 e. _' k: S
Method identical to the preceding one except that it seeks the ID of SoftICE
7 D" W. x ^1 i4 x. b/ g( UGFX VxD.
4 P$ }+ d9 s0 E4 Y# N- l
. O. }3 G0 W, l8 o' v: C xor di,di
$ R N2 o" M; g, S8 D2 e# R6 J) T. r mov es,di% Y! C9 ?% h6 z3 l J( q3 s) C
mov ax, 1684h
0 f, F- F$ o$ \0 J mov bx, 7a5Fh ; VxD ID of SIWVID% ~" z% i$ k9 a: |" N; o, @
int 2fh
4 I0 p1 {8 q) W5 H mov ax, es ; ES:DI -> VxD API entry point
7 m" k, d q4 _ add ax, di! A: Q1 o! m3 _8 c5 M! I W( L: n
test ax,ax9 t* d8 V% `$ Z0 B2 g
jnz SoftICE_Detected
7 Y% T* Q3 ~0 H M/ z) a$ N; Z; `+ ?7 I8 p. {9 v8 g( G' o
__________________________________________________________________________
( o( F1 r( F7 \ g4 W; M/ e! v, \; [$ I- a1 `
( D- C- j- T; X: N5 h5 T# p7 tMethod 05
' Z, z; y. N7 @" h8 i7 Q2 J5 v=========
$ W/ B+ L- D% n; J- S/ S/ I& o1 Z: R
8 k: W9 T- [( R& m' f" LMethod seeking the 'magic number' 0F386h returned (in ax) by all system0 S7 h6 ^9 w) e* N2 F% q
debugger. It calls the int 41h, function 4Fh.
9 ]3 l' B5 Q* R2 H! OThere are several alternatives. 4 |7 V0 ~- b2 ^7 d, U
( Q& V' n) _6 q8 n: L* g3 j- |The following one is the simplest:
$ e0 v4 R! g$ F; k. G) l, c2 G" K" Q+ `) t( @) c5 a7 ~$ x
mov ax,4fh( h+ T# w9 @ I5 r6 F1 Y
int 41h
. L: q. x- \7 `/ C7 p. }! e0 G cmp ax, 0F386
3 H: F/ ?& H- @: D. J- k1 O* s jz SoftICE_detected
2 ~3 U" d/ t: A1 p0 Q3 ?5 Z `: b
$ d* K; ~% f5 p( {5 eNext method as well as the following one are 2 examples from Stone's
( Y4 k. ^" V2 L2 @6 m1 Q"stn-wid.zip" (www.cracking.net): @" y, o" N* L: P* ]$ B% k
$ H& [( V( P8 i7 V! {0 G mov bx, cs
% B, w2 k2 V8 P( K5 s. K lea dx, int41handler2
! y1 p* q8 |6 x ? xchg dx, es:[41h*4]- {2 }' c! r1 Y1 k7 u# B' D/ j5 }
xchg bx, es:[41h*4+2]
D% C3 r$ M& `: _8 h8 ` mov ax,4fh
5 ?3 W9 Z( s( p9 P+ D- } int 41h: E$ ?+ h1 H B$ ~ Q. V: e4 s
xchg dx, es:[41h*4]% M M g' a8 I+ {. ^3 l
xchg bx, es:[41h*4+2]9 y* k# D6 v q, @2 f
cmp ax, 0f386h4 d# ?, B j+ w T
jz SoftICE_detected4 q: o' }5 F* A: {9 Y
0 I5 s4 ] B3 F1 Z6 B4 w! C- B
int41handler2 PROC
, \) f2 G! |+ e iret
8 X5 F! \! Y( R' L/ Kint41handler2 ENDP- b% q5 b; p. O/ F) \# ~
! ?+ B0 J! |' W! V& d8 V- f3 j0 X4 @# l5 \, K8 m
_________________________________________________________________________
- S: y' G, Y- {
" |5 o- T, I5 q5 q
2 U4 L6 s" U, ]& F2 mMethod 060 [% E# H: S& W1 D- i( \1 U C
=========
" |1 I, ?2 Y1 N) ]: I
' P! f, t. i0 O* B. | s/ j" O$ z- O2 E- X# P: W
2nd method similar to the preceding one but more difficult to detect:
6 g. g" Y1 N5 V7 N8 F
9 l% I: P' M2 T+ @4 K* ~- w ~6 G2 y7 K
int41handler PROC9 _& K: v% T" m; u' k' q1 I
mov cl,al/ d; l) L5 K& u; U2 Z( L. {# Q$ h
iret5 P7 N& B6 Q) e' `0 q0 r5 k
int41handler ENDP
; W. f$ d4 A; L4 I0 Z$ k4 g+ q
! D2 j# d) b3 e# X; I
( W2 O1 \/ d; s6 |/ b xor ax,ax( J( k* I4 G4 e* j
mov es,ax; D/ I# Y S T# r- f4 Y: b
mov bx, cs& o2 p, Z* a) S; B/ f" b) O' w
lea dx, int41handler
: H- B8 K: H, ~$ J( v xchg dx, es:[41h*4]# M5 K" C, s' I( w- t; o
xchg bx, es:[41h*4+2]
' U8 g) X- p$ f' p in al, 40h
7 C9 x* W0 ?2 J- M e/ W xor cx,cx
& V% ?9 N3 g8 @0 e$ b int 41h+ X* A$ \% t2 V8 l/ K. J
xchg dx, es:[41h*4]+ F* ~8 I( j6 d2 C f v$ p
xchg bx, es:[41h*4+2]
' ?8 f" m" c" s! [/ {- P cmp cl,al" x1 D* i2 _( H0 L
jnz SoftICE_detected& q$ w- R' C) u) C6 r8 O* J
- a# J/ u" [9 a: U) l& t/ V
_________________________________________________________________________
: O/ [7 h7 E; Y. n4 o( A x3 h1 |7 d$ f0 ~
Method 07/ T$ }6 z- `/ w: R3 I
=========
) Y) Y( U, b2 q4 A
3 a6 d- g% \7 O. |& mMethod of detection of the WinICE handler in the int68h (V86)/ c- {5 ^; C; R5 W3 M
' F3 F& T- E/ @& A6 \
mov ah,43h s9 P: l0 y0 l5 Q) P) R2 E
int 68h0 ]% ^% }2 ?) w% V7 e# W
cmp ax,0F386h( E+ e7 P2 I9 V7 B% X
jz SoftICE_Detected# y' D& q K- H# N
( E8 P9 y# P* A2 W' s: U1 m
8 T# M0 @4 [1 y, }=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ f- r8 t: B! j+ y6 f0 J& S
app like this:
9 p/ c6 b. c) i# t* L
- W) d7 Q I" z- x2 g: j. t/ i2 Z BPX exec_int if ax==68
3 }; c) C% Q( m6 A0 z (function called is located at byte ptr [ebp+1Dh] and client eip is
/ ?. @) t& G5 `3 | located at [ebp+48h] for 32Bit apps)! W5 t, B4 x) Y9 f2 ^+ b! M' U
__________________________________________________________________________
' L7 ]% }% q2 h: F1 j9 k% t$ F( y5 c; K2 \% }
2 B% O! p( W; W% t: T! F# Q- ?- HMethod 08
* O9 @# ?$ w8 @# I5 [=========9 R; B) R# g, v, h
! ?& E, U& S8 L9 IIt is not a method of detection of SoftICE but a possibility to crash the
0 x6 u. j3 H2 n" `1 e9 vsystem by intercepting int 01h and int 03h and redirecting them to another
7 i" Y+ Y0 ^4 g, Y% croutine.* e5 | Q! `$ x+ ]; Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
]5 P G+ ^- H% y8 {8 gto the new routine to execute (hangs computer...)
$ _. t6 P, g6 b" M$ M: a7 w0 |0 ^+ I9 l% m' {1 P F
mov ah, 25h
0 R. p: C; j# R4 \$ u! G7 \+ y mov al, Int_Number (01h or 03h)
% |8 u) f9 X0 P+ q5 s. z' B mov dx, offset New_Int_Routine4 G% d8 M4 {! B, J3 t+ H% t
int 21h
9 P5 F3 V1 o {7 n9 T! ]
% J! X, c4 I7 h7 v7 ?__________________________________________________________________________' V) l& N W# ]1 D k& r
4 R, Q. U9 h3 {' X& ^7 z% yMethod 09
; f/ s' o. b, A4 _4 e=========
& D4 `7 ?% M8 a$ j; j1 n0 K8 N3 }4 l7 b) |5 w( `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 r2 h1 W9 N* f7 w; Q8 d
performed in ring0 (VxD or a ring3 app using the VxdCall).0 O8 }4 W% v+ y$ h; N
The Get_DDB service is used to determine whether or not a VxD is installed" Q! X0 ?$ [( |0 L8 l: @+ @6 F
for the specified device and returns a Device Description Block (in ecx) for! r* k) e. a5 m) P ?- F- |7 x
that device if it is installed.+ A, ^, q& N5 V2 U2 N
- `) d6 `% a8 G
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, _, }: a4 @( H5 B) n
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 U9 x" L |* C# X8 d, n5 b* V" P VMMCall Get_DDB- }4 [; R9 k5 H; D- [
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ E2 J* ~- H# u5 ~7 p6 t; Y$ S' O, B1 `; J/ | j5 r5 L3 l
Note as well that you can easily detect this method with SoftICE:
8 s: I7 H# k+ r/ _ bpx Get_DDB if ax==0202 || ax==7a5fh. t( z2 y2 |% H- v$ r
: n, W/ N* R* X ^3 ?1 A6 R) s W3 A__________________________________________________________________________
' i- a3 Q1 s9 K4 L: w, C$ B# l% k9 | p9 c: N" r
Method 10
/ C! E. m) g/ P+ z' s- e9 ]=========( H! b8 W+ t- A, M; X
, R( g/ x0 C1 j7 |2 r" b$ j8 I=>Disable or clear breakpoints before using this feature. DO NOT trace with8 A' V4 }2 K7 y& z# y. t
SoftICE while the option is enable!!7 P( J) S% G& |+ B
# a+ m! U3 f/ R% i& K( ^- xThis trick is very efficient:' U6 g; B1 k# ? {6 i, @4 _
by checking the Debug Registers, you can detect if SoftICE is loaded7 m- g0 W+ F% \8 ?" x0 l
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& N7 R' U" Y: H- Othere are some memory breakpoints set (dr0 to dr3) simply by reading their( l. Q& k. D7 P7 F$ J5 ~8 H! c
value (in ring0 only). Values can be manipulated and or changed as well
- W! A+ D g0 R1 W! G% i(clearing BPMs for instance)
) J* m" f# q/ o& J" _1 }) i+ W$ I1 G3 {7 \
__________________________________________________________________________' ^3 I7 w/ ]( W& `4 }% k! X7 @5 x; f
3 i' b) a) J0 o. B% K9 \: }& sMethod 11, c$ h, u( t( P/ R& a* w- f! u2 h
=========: p( W2 E4 X/ [9 e) o1 e9 H* D
; Q) T/ D2 H; C* oThis method is most known as 'MeltICE' because it has been freely distributed
$ e( D6 w" a$ T7 }4 evia www.winfiles.com. However it was first used by NuMega people to allow
2 i" v9 O' Z# |8 @8 t hSymbol Loader to check if SoftICE was active or not (the code is located8 g* H2 T9 b* ?: O
inside nmtrans.dll).7 O+ ?- F" z9 P( C! A7 @
! H2 F+ I; A( s2 rThe way it works is very simple:
3 U3 Y @/ |6 F. Q/ D8 H! ZIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 b6 R, F! v" Q7 hWinNT) with the CreateFileA API.6 \5 ?3 {+ ~: _
7 B6 N, D# t& Q0 N8 W& D; ]; XHere is a sample (checking for 'SICE'):0 \: l/ \( P+ `+ p- J0 ~9 h
, I5 I2 o: S1 p6 ]! n7 ]" bBOOL IsSoftIce95Loaded()( { m! L5 }- U' N& Q
{
3 H7 x7 o) m/ y' d HANDLE hFile;
' t1 W# Q! B: ]7 T1 b hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 ` i/ V! S, i. U# w' M6 N1 V
FILE_SHARE_READ | FILE_SHARE_WRITE,
+ ?0 S8 p: _* j9 f! T NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
5 F$ s1 ?, q3 q; G2 j# A% t if( hFile != INVALID_HANDLE_VALUE )8 x6 }8 y/ Z% d2 |- x
{, k- j# H; w! j
CloseHandle(hFile);
5 P+ H+ P$ J' A- s+ P/ ^) t" T. N" _ return TRUE;
2 T* y8 ?' r: R& _1 f6 h }7 x s* R, ?7 A& U9 \, E: b+ i
return FALSE;/ F! k, { M: E) k+ g
}# _" ]1 h1 X. i% m* R# y! x! ]
|1 p& w7 ]! E
Although this trick calls the CreateFileA function, don't even expect to be- H+ w% d0 z3 p! F: X
able to intercept it by installing a IFS hook: it will not work, no way!
, p& [: ]* q1 v, O/ }* g5 HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ p' K. i$ A! |" U$ J% Cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" [3 U2 `$ T6 M9 J. Fand then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 U' \; Y1 ~( u% rfield.
$ @ ^+ c b' V6 \5 F$ q) M) lIn fact, its purpose is not to load/unload VxDs but only to send a
! z( R4 Z; ]: bW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 e+ W: Y! g9 b! ^
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 w4 N$ S" s) v, {! X
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 [/ z" g% v5 B0 g& {+ Q0 {If the VxD is loaded, it will always clear eax and the Carry flag to allow
: I: f+ Q+ T6 M% V) A- Oits handle to be opened and then, will be detected.
: [! O+ K0 C J; C5 wYou can check that simply by hooking Winice.exe control proc entry point
* b* }" m1 a7 Jwhile running MeltICE.
# V' g ~* n! D0 E R, j- X9 c7 O3 ]% Z5 y# W
* I! q* z* ~$ y2 d# z- l
00401067: push 00402025 ; \\.\SICE" X8 [# s6 }. L2 L/ Z, p+ M. ^! u
0040106C: call CreateFileA( s7 x5 f# ?* X! b2 S8 H% o
00401071: cmp eax,-0019 ~4 m9 N3 Z$ F4 H
00401074: je 00401091
! e7 w3 _: ^: K; Y+ k; j& H. F& Q+ O
% }& w! ]8 Q: h1 T
5 s% _7 m5 l* l+ O1 l& c2 ?" q) C* GThere could be hundreds of BPX you could use to detect this trick.
, V! D9 X2 U% x6 R, l3 l3 n; J7 l-The most classical one is:" C# J% |/ h3 [7 B. U$ M3 l2 c
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 }% e" y; [, c0 K; ~7 l/ q1 X *(esp->4+4)=='NTIC'
- J2 U8 c# {9 g3 J4 E
. w! a4 g/ E0 v+ s1 N" G" J7 ]-The most exotic ones (could be very slooooow :-(
" T8 a# j# F3 m. u2 {8 ^8 I BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " O, g1 J# d9 I3 I7 E7 I
;will break 3 times :-(' X' |. @. u m) c
8 F, q# ]* ?7 g% }-or (a bit) faster: ! I# M0 f9 E/ }- }0 s
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- n- f& W2 w; z7 ^6 M& N6 C* m
; u* `8 I: V6 ? BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 H8 h6 r. r6 Y ;will break 3 times :-(& W3 j1 G- z4 l$ A4 ~4 h
: W" U8 v4 ?4 f5 ^-Much faster:
6 T* c6 P3 h4 Z( b) f BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') N4 L. \- t( l) r
8 F: k" h% I' Q( N }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 |9 V' F$ K+ q2 p! mfunction to do the same job:9 n2 ^8 y) O1 e9 C; g2 t2 D
8 t% q* ~! W- c; Y7 n) L' y) U3 ]
push 00 ; OF_READ
5 `6 z6 v0 x7 H* V" i" X5 G' _ mov eax,[00656634] ; '\\.\SICE',0
$ S5 ?) S, K) Q! O( H: J0 p* g push eax0 Q; p0 r. C/ j5 x& T+ d5 t
call KERNEL32!_lopen
9 }+ R* I4 G; G2 d! F inc eax
k+ o: B- {. i# P jnz 00650589 ; detected
, H/ r: G* }: Y# j( O0 u( b push 00 ; OF_READ6 [8 E/ |- S) J# c, X
mov eax,[00656638] ; '\\.\SICE'
$ |& [. a- w9 k$ v9 k push eax
& m4 K- j1 I1 W6 e6 f4 i0 v1 U4 |$ e call KERNEL32!_lopen
: n" C. d: i& o) q" [5 y inc eax
* s' l! W+ _& L4 B. z: q# K$ ^& g jz 006505ae ; not detected
% s3 I, M5 h/ u9 [0 Z+ ?$ l2 _
9 }1 x# \ j# B/ E0 [! K, |9 V- L- T& a5 j2 j9 a/ S/ w
__________________________________________________________________________
: b+ ]1 p7 ~' i- e' m5 I' v Q) `- K$ m
Method 12 c$ j4 |% ?; l2 r) \- x H
=========2 t q; `7 X A- F% \
$ F! R6 p. t: y3 LThis trick is similar to int41h/4fh Debugger installation check (code 059 f% E5 L# D9 m' l+ M
& 06) but very limited because it's only available for Win95/98 (not NT)+ x- A" i& q' O8 J2 V8 Q# b, m: q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 b' d' p* ]7 M; F7 G/ ~. Q: c) G8 M9 A# `: C% v: w
push 0000004fh ; function 4fh# `+ s5 r' Y3 U @- i; z; }
push 002a002ah ; high word specifies which VxD (VWIN32)5 E' i7 ^+ V- ~
; low word specifies which service9 I+ V- n5 g9 r( x1 B, S" ~
(VWIN32_Int41Dispatch); k2 f! v. O5 Q6 O
call Kernel32!ORD_001 ; VxdCall
% a" \. Z" d. w cmp ax, 0f386h ; magic number returned by system debuggers2 u6 H6 r0 H% r
jz SoftICE_detected
7 e8 M7 F9 l( P2 t
% \. ?2 @0 x U( u" ?& aHere again, several ways to detect it:
: `3 D D) I; X3 S1 B5 R3 }7 d n% j. W9 h3 v* v' L% f8 }0 a
BPINT 41 if ax==4f9 x! l/ _' Y& E3 C+ \" \
( }3 m) s% T4 Z/ R A& }( u BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* V" V! ]1 _8 T- f. S9 P
y9 _* I; _& X5 U k# z BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, |! S5 A5 U9 U- g |/ s. ^- _
" V6 X% F0 B2 R4 K
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!9 |$ U7 q* v$ v. I n$ S# r" I
5 D& u7 I) [/ H; M__________________________________________________________________________6 t' i( O5 j; j
8 |& N6 t( m" ?- n
Method 13
4 p( h, g/ C1 X' e" F=========1 e) D1 M) d o" { ^
! K$ B% ]+ t/ Y; G* @
Not a real method of detection, but a good way to know if SoftICE is
" }) A2 M4 l; b6 finstalled on a computer and to locate its installation directory.. q) C ^ E0 o! D$ ]
It is used by few softs which access the following registry keys (usually #2) :# E; N6 l5 Q0 G% D
8 }: {$ d6 t2 q3 N( @4 m& Y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 V5 o8 G9 Y, A) L2 q5 \\Uninstall\SoftICE
/ v1 h8 }, o5 p+ G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) u5 Z$ Z+ N5 h3 C2 p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 s3 \% p6 s- F+ D
\App Paths\Loader32.Exe
/ T- ^1 b+ Q0 w; o1 Q
4 x \) ?: b. Z, c% p: o
& @8 d# l7 Q( JNote that some nasty apps could then erase all files from SoftICE directory
' r8 J# a7 G) F# Q3 u(I faced that once :-(- b4 A E! x, l" i9 E# ^& }
: g. b$ T7 o( t1 vUseful breakpoint to detect it:5 Z! o" ~3 e+ p! |
+ D) a' B( i `* V+ C, A }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# R, X. v) _) ~1 h9 J6 q
! ~' s- S# Q6 m1 D
__________________________________________________________________________
. p: z, l7 s5 L& z/ l% |* S3 }4 l q7 U7 X
. T1 m8 j' c j8 ~( f1 |Method 14
- d1 q, Z c' b( |! D1 M2 N=========
8 I9 i1 R4 n3 _7 V
+ o# k" w3 ~$ s2 T( i$ D L1 v- BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 |" x: x' K: R2 {2 p6 tis to determines whether a debugger is running on your system (ring0 only).# w9 W( f! {. K3 F. `: \; y
1 [2 Q( L0 @# y8 c, S4 y9 ~. }2 F VMMCall Test_Debug_Installed+ @6 h ~3 C1 d5 c$ V$ P' O
je not_installed
$ z2 h, z* w m8 k2 M& v, [1 W! C0 @% A- @, W
This service just checks a flag.
6 f- Q& Y+ b2 I0 Z# w/ c</PRE></TD></TR></TBODY></TABLE> |