<TABLE width=500>7 P# A; u% Y2 W5 i, z
<TBODY>
6 [% A- E# s& e<TR>9 K. m5 O8 o9 h7 x
<TD><PRE>Method 01
6 l. G( M+ I. K# d) ]=========
" M0 S. f7 q% ]9 ]4 w
8 D2 T& {0 x1 z' {This method of detection of SoftICE (as well as the following one) is# u* ?7 m1 P7 W# g- x
used by the majority of packers/encryptors found on Internet.
$ \) F5 g% y- f W( y: ^It seeks the signature of BoundsChecker in SoftICE
" g8 x+ ?* n0 Q6 L: G
0 P$ ]- P5 U9 e mov ebp, 04243484Bh ; 'BCHK'+ G" D# v4 K3 q2 W3 v9 Z# z
mov ax, 04h$ o" Q, M7 K5 u1 U7 {. S
int 3
- e0 Z5 b) M+ F1 s7 W cmp al,4
, v: V9 C2 ?: G% v2 M6 {" p1 Q2 R jnz SoftICE_Detected
2 K$ a6 b' ^: V# Y
) }. m" Q. x2 K___________________________________________________________________________
( `5 | T, k1 B% w9 G$ s" m$ f$ @2 G' B% f* x/ |" e- B
Method 02+ |; k3 H+ ?3 ^2 n: t
=========
* I3 }) V, r* k) J) }8 R9 ]6 K2 o) t& N! x
Still a method very much used (perhaps the most frequent one). It is used
1 _5 m& ?3 B7 f8 M5 z& D5 i; eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, Z, C, X$ N0 ]9 J
or execute SoftICE commands...4 v( \# k5 p7 X E& O1 W
It is also used to crash SoftICE and to force it to execute any commands$ h: g# W* G9 F) s2 m" q7 _
(HBOOT...) :-(( ' m9 I. m% a4 x% T2 X6 ]+ A' f
4 H$ B, \: _' G5 F$ vHere is a quick description:
0 H' m% y* L$ B/ R! P! z4 \-AX = 0910h (Display string in SIce windows)2 D# k1 P" E3 h, M% [
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
0 c* I) v" Y6 e" B2 b/ N-AX = 0912h (Get breakpoint infos)
# l2 N; U0 \% h-AX = 0913h (Set Sice breakpoints)
; w/ g! t! z. J& j-AX = 0914h (Remove SIce breakoints)
0 K! p! q G# W( x0 _; I' M" U2 m+ ?3 x8 j+ A
Each time you'll meet this trick, you'll see:
6 a' b$ F+ X% C8 ]8 f-SI = 4647h. Q5 t% g0 [/ @9 t% q; L
-DI = 4A4Dh4 W+ |( z( S3 |7 d% [0 f" O( l
Which are the 'magic values' used by SoftIce.
; `; b$ q: ]" t$ d! m' \/ d) @For more informations, see "Ralf Brown Interrupt list" chapter int 03h., B/ u* o& K1 @5 }* a! B' ?
$ }6 g) R! D# q2 g$ T. T" _% vHere is one example from the file "Haspinst.exe" which is the dongle HASP& j4 x6 G" h& f( Z# v. }
Envelope utility use to protect DOS applications:
* J7 ]) I! P+ n
8 v( v! F p, \( {
/ G* B& }. v4 Q9 R$ z7 \, A4C19:0095 MOV AX,0911 ; execute command.4 a7 i( [6 ?3 Z" g) x3 n1 a
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' |5 h4 l1 J# P" |7 k# W' M
4C19:009A MOV SI,4647 ; 1st magic value.
~( `- m; r8 L" l4C19:009D MOV DI,4A4D ; 2nd magic value.) b8 g2 p z: K+ S/ U9 m: _* L6 \ p
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' \# e w, ?% [" ^: [3 \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! g3 I# U- M4 N# x8 ]
4C19:00A4 INC CX9 ]9 i6 T: w# I. u6 M" m) h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! K \! X$ k0 x; N8 x4C19:00A8 JB 0095 ; 6 different commands.5 \2 F, }& n$ H
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
p$ E+ L' g( M+ I4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 P: V* V- M& |( u+ U& x6 p
% W& K9 Z. e# W7 L) q5 v% R0 eThe program will execute 6 different SIce commands located at ds:dx, which
! E$ o- h- v9 _9 @4 v5 |' Yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% S! i" L" P$ A
2 A6 _8 _' A* ^* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 N* Q4 u; N, T5 q1 T( m6 v4 V8 L. |___________________________________________________________________________# g6 y8 T' a+ V) M' d2 U4 A1 p
) Z" I) n3 R* V) C" V i( \* q" p$ l) c- l
Method 03
! p" O( g& s y0 e. u5 t4 `9 U=========
% G; W) {+ C' e0 O {" G% A3 w) }- A7 c# }0 F1 c- \
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 R$ e" c# H# ^: D
(API Get entry point). g* q* l, G0 h R% T+ ^& l
4 e/ S4 U* Z& ?, I4 y
$ {6 r) r D! j/ T7 T xor di,di
2 Z6 T" |0 K! B- o/ A mov es,di9 f. o9 A4 w) d' P5 o- U
mov ax, 1684h
# o$ B( M1 c5 R' v. W mov bx, 0202h ; VxD ID of winice
0 j) m9 c+ b9 }8 c/ f' s int 2Fh) H v. `: l$ ?: L( K
mov ax, es ; ES:DI -> VxD API entry point
# R, x+ F& ] h% _% Q add ax, di
8 [* D u3 \. F9 f; a5 } test ax,ax
7 D( ~' d$ j- |& n jnz SoftICE_Detected
5 Z- ]' n% {2 Z, H* g/ x$ w( w& i
! L( Y9 D' ^* P$ d___________________________________________________________________________ M! O. J- w# s! X* }- d
4 |. w: p- H, B' D) T% aMethod 04
/ }5 G: Y+ G% Z) @2 ^# e6 H=========
, \9 l( y) ^ @9 D0 F/ [
4 b7 f, f" z8 K$ D- i2 o* sMethod identical to the preceding one except that it seeks the ID of SoftICE
# ]4 y, _/ J0 J5 @GFX VxD.1 K' [* I t) l; u9 Z
) i! L$ J8 j* w7 a
xor di,di
/ H4 y, S6 x0 T+ u# f2 c4 ]: S- @ mov es,di
6 K" j3 [0 _6 y' Z mov ax, 1684h # j* v7 ~7 K% t F6 ]$ ?
mov bx, 7a5Fh ; VxD ID of SIWVID
6 J. S3 z0 A. c; _# }5 F3 e int 2fh
( j, T$ e) {3 v9 P& V mov ax, es ; ES:DI -> VxD API entry point
, v% x2 Y) ^. I9 m1 E; Q add ax, di
) I# f6 Z+ G: ?; {# K7 [+ v test ax,ax
g4 m B; @8 |2 x- l1 K& E- Q) ? jnz SoftICE_Detected/ S' [- J5 ^: \: q# K
$ h. i# f& O' }1 u' w2 i' Q" r__________________________________________________________________________
' _9 t1 r4 \; e( K
7 S$ R9 M. k3 j
6 M: s: ?3 O8 r2 H5 H/ tMethod 05' x4 U1 |. c$ k; H% m- i. H) E
========= X1 w& N5 C, a x# n+ M; H/ l5 {
3 N8 E! r( D( h2 n7 x @& K# [: |5 tMethod seeking the 'magic number' 0F386h returned (in ax) by all system
n: X' V6 U% D3 J% s" q' O0 I$ rdebugger. It calls the int 41h, function 4Fh.
! D; h( Y4 B: l6 C# s$ K% H& o0 h! xThere are several alternatives.
2 b2 U5 ?) C1 f4 S: k) U' h
6 P) H7 v- \2 D; c3 C- F3 \The following one is the simplest:
1 T* d$ a" r+ J8 b! T7 k# K; [8 D4 R4 k5 v) ?
mov ax,4fh$ ]2 }) Q# m3 f% }$ c$ Z, n
int 41h+ v6 V# t2 c" p
cmp ax, 0F386+ o6 j$ h- g5 _. y6 x
jz SoftICE_detected8 ?* C) K. n$ G, i& v( m# Z
/ \) t& l! Z2 d" {( B6 Y5 H% C
* l7 R, Z% a I6 fNext method as well as the following one are 2 examples from Stone's , s8 Y: Y# n' Z/ N9 }
"stn-wid.zip" (www.cracking.net):4 w! z, v5 l! r4 x
/ C2 c- Q6 a7 k) J( }) c mov bx, cs
! h% T: b6 G: @8 C. x lea dx, int41handler2
( _1 e) p. h/ P0 b1 k1 R% Q xchg dx, es:[41h*4]
7 h4 f) d0 }% b. L; q xchg bx, es:[41h*4+2]5 o- f% t |! W
mov ax,4fh" z6 ]$ `* @* b1 _6 v; S. K
int 41h
) P. m% }1 c8 C2 i0 X xchg dx, es:[41h*4]
7 x0 ~* {0 }$ _% ?' [2 z& c xchg bx, es:[41h*4+2]. W4 h' U+ A( \0 L/ ~- a
cmp ax, 0f386h1 \: Z" [: x4 Y8 y1 I- |8 T4 C
jz SoftICE_detected
& f5 u+ ]0 V$ M1 R
3 A( m# O' `, y, S' q# _9 kint41handler2 PROC0 g" P: ]: J* E
iret x7 J! M& c. t' z. ?$ N8 N8 y
int41handler2 ENDP. |2 L, d7 q# Z- A
7 d: l, [: `( J! H# W0 Y4 ~
! R( u8 p ^% S) \; U_________________________________________________________________________
' e( q, v5 q. }8 |4 S$ t
, [! S. G2 {) R% [2 t5 g2 U9 y' V' w
4 A, y, y0 J+ h0 ^; D, N' FMethod 06( m( s& ]0 ?4 Q/ q& i7 }
=========
8 j! O" F1 B/ S& q4 ?/ ^
H% W; w, A+ o, _3 K. X3 z) j$ v6 z. |) Y/ u. q" ]. p5 p
2nd method similar to the preceding one but more difficult to detect:
: ]/ `) D4 R1 Z% G; I! \8 V* [5 l7 P" ?' B
7 A0 j( J& o: T- P0 z
int41handler PROC
- L/ i0 c2 H9 w1 }; ^8 I mov cl,al
3 S9 a7 \6 B2 ?* G8 R iret
- H8 p5 z3 K9 u' c5 x7 Z! t# v+ b, _int41handler ENDP( \- Z; \7 l' r9 L0 Y
/ i" B/ _+ P6 k+ H2 m* z1 l) E* m; o9 ]0 J F6 E0 p z1 d& I3 T8 w
xor ax,ax. b3 @: R, C/ M- |# O: u
mov es,ax: M' q" o& `& \3 z1 k6 q6 e" } A
mov bx, cs- ]! ?% h5 b7 m A8 y
lea dx, int41handler
; [( X) t- T- U, @% X* G1 u' U5 n4 W7 B xchg dx, es:[41h*4]
2 u! I1 j2 W& {% i xchg bx, es:[41h*4+2]. ^ X% a# H4 e' _: k. E# |& N0 i
in al, 40h
% Z. M3 |+ L% T4 l& b; f' _: c, A xor cx,cx
) V( v; `0 ~ }) v' X int 41h. y7 ^1 \1 Y3 a
xchg dx, es:[41h*4]
4 d( o0 _7 l' Z2 ]. S1 R" _ xchg bx, es:[41h*4+2]
5 F, a# G9 a0 S2 i" | cmp cl,al7 j S$ r) A3 j3 p5 Z! U' p
jnz SoftICE_detected' u' @0 W' z1 o6 K( ^7 t
K- g) R/ R4 _/ z/ v
_________________________________________________________________________! i, |4 ~1 Z" b5 [6 H
8 o) s. X& W# ?0 K. |1 p
Method 07/ H9 w: u/ U. T
=========- Q- @+ B( @6 ]8 Y+ h4 U0 o0 N3 q
- Z2 i* F$ @" Z: K( FMethod of detection of the WinICE handler in the int68h (V86)
; m8 h C9 x, J4 A. |/ f* N5 S* H2 B. L/ a C+ t$ n( V+ u7 b" i: U
mov ah,43h, w. ?/ C! _0 |: j' E
int 68h) H- C+ ], i' q9 u
cmp ax,0F386h1 [( j' Z: d) b* [' h: K% {3 ]. | A
jz SoftICE_Detected
0 h8 Q% K x. N$ S, s9 s) O3 f
) u1 g/ W% C$ [2 B6 q
! ]; Q2 h& g I! q7 x7 U8 s=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' C9 A& X9 y% \) E: O$ x
app like this:0 @. Y$ b- I& e- c$ \
5 N1 j e" a/ W+ _: k! F* M
BPX exec_int if ax==68: ], f8 j/ M: T& X% B# z
(function called is located at byte ptr [ebp+1Dh] and client eip is( L. s! X* F f+ X! }* w5 t" y
located at [ebp+48h] for 32Bit apps); v% |# E8 l! t0 M
__________________________________________________________________________
9 V3 P" m5 t( P2 X9 a3 w( R/ v, V
# ]; {+ i5 X1 p- D1 Y6 x/ Z/ H3 Q
Method 08
- N [2 l# G- w& U d=========0 W" {( `! U4 O5 q6 A3 H
7 A$ a% V9 B2 B7 |( w$ o
It is not a method of detection of SoftICE but a possibility to crash the
3 ?% `; U8 v6 ?" @2 E! ~4 o! _system by intercepting int 01h and int 03h and redirecting them to another. s- W2 F7 C! _/ d- h% ^- h% V
routine.
' z" D [( \& ~8 MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 S" I6 N9 f' p* B8 p# C: Bto the new routine to execute (hangs computer...)8 S* F! y- v1 u- i4 H, v
! J+ R" w9 B3 g) j2 s5 M9 A mov ah, 25h
) H* X# I3 d# U% e7 {5 S* G0 T mov al, Int_Number (01h or 03h)
1 l4 K# X, F- x% H! y mov dx, offset New_Int_Routine; p! s: ^4 W7 j4 u) W8 {3 w4 r
int 21h. r4 g' k- \4 f3 y0 ?: @4 |
2 M- S+ M* m# Q
__________________________________________________________________________ V3 i8 [* U) _( S
& g4 O- w* B' ]( [# n
Method 09( P$ e1 {/ h$ j6 ], P2 N3 Z/ G
=========" w) L: V& y4 g' l2 a' L
3 Q2 \# ^- L/ O9 Q E; Q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" @7 i, z1 d6 a1 E4 g! k2 |performed in ring0 (VxD or a ring3 app using the VxdCall).4 M% P, n: h. ~: _: z6 T
The Get_DDB service is used to determine whether or not a VxD is installed
r( ]6 k! p6 vfor the specified device and returns a Device Description Block (in ecx) for' A Q- W* z% ]: E; `+ J' Q
that device if it is installed.5 O b" h( O$ g& M3 I
: I ], o9 r3 L2 p
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) w' h P C, M1 y2 A1 y mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 p2 b+ @9 Y1 [$ d' n% e VMMCall Get_DDB
2 o0 h# b4 C) T- G) \% }- z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) w( l9 J9 b6 f
( G! ?. ~5 y1 a: X d( Z- Y1 `
Note as well that you can easily detect this method with SoftICE:
# o% u8 z% I% }# B* I+ v O bpx Get_DDB if ax==0202 || ax==7a5fh& f* ^0 @8 J& L5 S% m# n3 t
5 d; T$ Z Y4 R__________________________________________________________________________
1 e- ?# r7 Q! S! g
8 N8 Y0 {& c1 R9 J: TMethod 10% n) M1 ~1 _- [! g5 t9 V
=========* N( c2 o% e9 ~9 f& @7 J' k: T7 j
$ ^# U* \6 a. u, n9 Z2 W
=>Disable or clear breakpoints before using this feature. DO NOT trace with( C$ E3 f# T& q# s8 E9 T- t
SoftICE while the option is enable!!
7 U0 Q9 H/ n2 y# @$ w: h7 M( h! S! H2 r' e) O
This trick is very efficient:
) x3 k( k: @- Y7 e' s# qby checking the Debug Registers, you can detect if SoftICE is loaded4 a) W) e7 u2 {! \" o1 L8 c
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# O. m. e! c8 C. g# _- R, Mthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, e3 E9 e8 c6 Q R8 h0 tvalue (in ring0 only). Values can be manipulated and or changed as well
/ k8 T' B/ e9 P% U/ c(clearing BPMs for instance)
/ e2 ]' C, Z! o/ I! _- L/ \# G- _+ a
# [' G( f8 X" W% U. {! y- {__________________________________________________________________________
6 W. u$ z, P/ N! w$ r! _
7 I7 Z% j+ D8 |* j3 V; KMethod 11
" ?* w3 j- U/ J. ~1 o% X( i( K, {$ ?========= i- d& {2 p' J. M( o3 D+ G" R$ Z
; L; }" Y# f9 A# ^! B
This method is most known as 'MeltICE' because it has been freely distributed
" a! v7 t5 E- p) |- h. {% {; M7 Evia www.winfiles.com. However it was first used by NuMega people to allow0 a& q0 G' K4 S3 u9 E( @
Symbol Loader to check if SoftICE was active or not (the code is located
8 K6 @' ]2 t1 G) l7 _6 l6 yinside nmtrans.dll).$ a$ F, |$ O9 t$ V, x1 q S& S
- \/ |: ?2 X9 ~
The way it works is very simple:
/ N6 B& ^: D* @4 \) xIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( S* O/ a; P7 w6 J/ N
WinNT) with the CreateFileA API.
6 F B( \5 _) d; a2 j$ j: \7 r7 r* v1 y/ l7 y
Here is a sample (checking for 'SICE'):
4 R! M# }+ T6 B& X9 P
7 y# k$ J8 z, h2 O+ t& tBOOL IsSoftIce95Loaded()
9 V+ Q9 }. S9 }4 E2 d{4 H- v$ n+ V$ J- |. b" D; h# W' P/ @" ~
HANDLE hFile;
! K; o! l' Q1 T( j. Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 j/ e# M* v1 X
FILE_SHARE_READ | FILE_SHARE_WRITE,
: l1 P2 [3 A1 c0 n5 r3 k1 a9 [ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% ?$ j( [, [" W) R9 n
if( hFile != INVALID_HANDLE_VALUE )% q: V# S, D+ f" D9 d5 \
{6 @' ~: h% }, U' y( O2 h5 I
CloseHandle(hFile);0 a# y* t6 }% f
return TRUE;' T. I- J% G; p9 ?: ?
}
0 Y# p$ e% V: q, p return FALSE;
+ f" |2 I; v& f# @) R}% G: D2 M7 \: l; H6 f
4 d1 l4 T5 Y) r( {. ~) @Although this trick calls the CreateFileA function, don't even expect to be
8 _2 k' T$ s( r6 X" J8 J- `able to intercept it by installing a IFS hook: it will not work, no way!8 C Q" A5 S8 O, ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F1 u# V! x' J8 C/ ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function) O' O7 C3 R2 z' ^3 Y' m
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! b0 A; T$ ^8 Cfield.
& t3 l9 x. A% S7 HIn fact, its purpose is not to load/unload VxDs but only to send a ' [0 T# d% P* `, k1 Q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# g+ W+ W+ j( y+ d, d) U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try P9 e. \! Y# j$ w4 o) _+ n
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- y$ }. ^4 h1 m4 @2 n R6 _& qIf the VxD is loaded, it will always clear eax and the Carry flag to allow
! L' n6 h" g3 L4 r+ w4 dits handle to be opened and then, will be detected.6 o U0 b* ?% _$ v
You can check that simply by hooking Winice.exe control proc entry point
$ I+ Z- f6 }( W. V6 [9 wwhile running MeltICE.
( E9 @0 U4 w2 O: s. k: p. |% J; _( H6 N8 l7 N1 x9 W& W
! ]$ m* r0 l5 | 00401067: push 00402025 ; \\.\SICE
+ M) ^& t6 r# z" L* i( Q0 p 0040106C: call CreateFileA
; Y# w! o2 j1 A& X" t; y 00401071: cmp eax,-001
- R( S; h% C4 o( \ 00401074: je 00401091& G/ _) i2 _8 F7 B3 G D& V
4 u" v3 ~% b- A% _3 [" h$ H @4 M* M2 }: U
There could be hundreds of BPX you could use to detect this trick.
6 W/ s% h9 C% I! O, I-The most classical one is:
6 ^* f' i l; i; V- X BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||2 t: a: h6 n5 W% H9 N; I% ^
*(esp->4+4)=='NTIC'
5 Y) y s. }6 n: c( U& l$ m1 t0 b9 ^! t- _
-The most exotic ones (could be very slooooow :-(
# {1 |3 M* Q x' ?1 d BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') , Q! y( v0 M; j4 P3 `" _! d5 \
;will break 3 times :-() q5 N* Z4 b5 j: K; F6 K2 |
0 W; u: m( ~3 [$ G0 l8 Y% |
-or (a bit) faster: & G9 i- w7 I& R0 ^/ q+ R, v( K
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). y" A; t) ]) D# w6 g4 O- b, ?
: V7 u* k1 `: X8 U3 l1 K
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 _1 ?) F( H; {8 W0 Q/ b
;will break 3 times :-(( S$ k& i: }7 c; f' S1 v6 R& j
2 t$ U4 e$ d" Y5 \6 M. l-Much faster:
, L; k( F; e- q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( y& ~- l, B* w3 E/ q! {: x b
' a6 h% Y/ \3 A$ TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ a2 ~! |9 k- ~! V# s# N: ~function to do the same job:% G, c4 j0 e: T f
& [( f9 Z, U1 @2 H' @0 u push 00 ; OF_READ* N5 W H/ J @% U
mov eax,[00656634] ; '\\.\SICE',0$ E8 Z* S7 m* g1 @& G
push eax
# s: y3 k" T+ _% n/ q call KERNEL32!_lopen
. y& h5 n {9 p/ }: G6 J inc eax. N0 w; q) L# ~. Y+ Y. [1 P3 Z
jnz 00650589 ; detected: t$ C5 K; M, W; i2 m7 ]
push 00 ; OF_READ
7 K2 Q* Y' E+ u: ^1 }+ ^! E" b6 Z mov eax,[00656638] ; '\\.\SICE'
: Y4 s. r0 `$ y# T push eax
( ?8 H7 w( x+ o) b5 \ call KERNEL32!_lopen1 ]9 X1 s4 T* x
inc eax
0 G' b- L' q5 q" K jz 006505ae ; not detected
2 e& r/ Z: `% o5 f% Z# b- M4 ?. \5 ]1 C" E4 z5 L i$ s j
- g, n. p. D+ n n1 q3 n__________________________________________________________________________$ l8 Y y V" Y
. J) P6 V" u# v
Method 12# @$ E1 I! r: j
=========
9 x( P1 z9 I) S: Y Q, }
- ~. n0 P7 C, z; G$ ^) I# K) j9 rThis trick is similar to int41h/4fh Debugger installation check (code 054 M' m6 O# s! N$ d1 Z. _
& 06) but very limited because it's only available for Win95/98 (not NT)
' w1 t9 ~6 f% E! nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.: L0 C& Z% b4 j: N; u1 ]- n D3 b
/ l8 O# `. [- r4 _& ~9 E& A) |
push 0000004fh ; function 4fh
. `& p1 }8 H8 ~- ^ ` push 002a002ah ; high word specifies which VxD (VWIN32)
5 `6 ?3 b: [- ?8 [7 o& }3 w' X2 H/ p ; low word specifies which service9 i7 |. `( ^! [1 T5 R& Q
(VWIN32_Int41Dispatch)4 z0 n9 D* _9 R* n% C$ S
call Kernel32!ORD_001 ; VxdCall7 o E/ k6 i1 y; p. ?/ `1 s4 v/ P
cmp ax, 0f386h ; magic number returned by system debuggers
2 L- r4 L% \2 U+ d. Q jz SoftICE_detected" r) z1 L: m g! E- P* T5 R
+ l( i D1 p( UHere again, several ways to detect it:
5 b7 f( I7 a7 p% O; A" ^: W. }, M
$ z3 E1 |3 e7 H- Y6 [4 R7 I2 `4 a BPINT 41 if ax==4f0 c4 _4 R( }# L$ R r4 n% ]% p8 z. s
6 I' m+ K( d- t. w BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 C9 t, q: S( \- ?; B( a, C" |! b! D1 v- K/ w1 Q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" J9 b3 x* l) K+ |/ Q
5 x1 k& y0 k2 O. i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% S# c1 F* Z3 `! M! @! S
( C- M7 f! |+ N6 b__________________________________________________________________________) I& E, W$ b% p8 I
; H5 p* i) j4 XMethod 13
) ]$ W& y6 c- u8 L=========
; n7 Q* }, T* N2 O1 {. X5 O
* j, U3 q9 t3 mNot a real method of detection, but a good way to know if SoftICE is/ n& K: ~* G1 E# d2 j' E# d3 f3 R
installed on a computer and to locate its installation directory.
}$ e" B! T& @7 P4 k$ B1 v) mIt is used by few softs which access the following registry keys (usually #2) : V. m# n: h8 h" ~ O1 H M
7 j/ Y- _! p; a; F-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. {# G4 U( M" O9 L' |3 b9 [ y\Uninstall\SoftICE
" d# |* M' W4 O& |, O- C# ^-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- S" [5 `0 |) y$ c* E! Y-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# E! w( r; u% ~: f1 g& z4 R\App Paths\Loader32.Exe9 M& j& J, D8 ]& W+ P, z* u
" v+ g3 W6 y/ W
+ a" K4 g: r+ W, B
Note that some nasty apps could then erase all files from SoftICE directory
$ l5 a2 v) l4 H$ A# H(I faced that once :-(
) V8 v+ U( k* [) M
% c. [) y* N$ W! ^2 fUseful breakpoint to detect it:
" l( T/ D, Z" N/ ~" d$ j+ [# w/ ?
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ c8 [, v* y% Z3 _
9 Q$ l. _1 }+ u% }5 h% ~4 ]( d' S__________________________________________________________________________
7 _1 H6 e6 Z5 n6 \$ d, J1 l# V+ N) u% ?% \8 u# I0 k7 g
, e4 m# L+ }, s9 V$ G8 Q! CMethod 14 * }- \& }% Y9 l. x, [$ P9 o
=========
% x; s* B4 G( D8 G
# K( n" M3 r* ?* L* o$ ~7 \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& L3 O/ [1 G7 f2 l$ i( ^$ Dis to determines whether a debugger is running on your system (ring0 only).! B" T) r7 s: A
/ i3 T& [" u- d* t, B7 ` VMMCall Test_Debug_Installed
6 q" R/ T& u" Z+ C% P je not_installed
# ^6 b0 X( z9 A( C3 L. B4 A% i
' }$ M0 Y* l% l+ B/ c4 a& _7 WThis service just checks a flag.3 P' A5 t- y& M7 d5 A5 P5 @% C( Y
</PRE></TD></TR></TBODY></TABLE> |