<TABLE width=500>2 Q; Z% d, W! x9 S. C2 F6 G
<TBODY>
2 \$ \4 G, e! A3 w; E8 F<TR>8 R* i. j0 t+ {6 U% ?7 a, b
<TD><PRE>Method 01
% m* a$ ~' g8 }! l, z$ H# g! \=========# q+ K. O) Y* M: c
3 }, ? B2 W1 m% J4 O' m; VThis method of detection of SoftICE (as well as the following one) is- `$ S. s; c. Q" V
used by the majority of packers/encryptors found on Internet.
. {2 s" z# q8 i1 ]: J' |2 jIt seeks the signature of BoundsChecker in SoftICE
& F" z2 x4 w2 Y- V
3 _% @ f( t6 V/ C0 X mov ebp, 04243484Bh ; 'BCHK'' l6 b2 N2 s3 w! e3 T+ [3 |3 u
mov ax, 04h
$ R; B, L) f- \% _. d) |+ i int 3
7 T) [0 m; r0 A% P1 C2 q cmp al,4
1 |0 o: i0 l6 l& Z8 v3 H3 [8 U) y$ ] jnz SoftICE_Detected, U. a$ \4 f6 \9 w
* _) s# o- M2 Q& U8 X) j, |* L5 P
___________________________________________________________________________ g w" S/ Y Y
& u) q4 Z0 Q# _- R& n8 L5 MMethod 02
( s$ x5 E f' B& U" r$ U=========
* C( T2 P5 c5 j
/ O! m. ?5 O% BStill a method very much used (perhaps the most frequent one). It is used
0 E8 i* [3 n# ~) Q- ]% vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. _( j* O: N. u% R uor execute SoftICE commands...$ l* \: ^6 d {. W$ R* E
It is also used to crash SoftICE and to force it to execute any commands8 T2 T' F- s6 {# v) J
(HBOOT...) :-(( 0 r0 j" {; v( a- l5 r
3 w0 A" i# d. g7 t& ?& xHere is a quick description:
/ V, _. ^* i6 _0 i, J& m-AX = 0910h (Display string in SIce windows)% S& n9 G: k/ o4 c- c8 u# V3 L
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- U+ A- L o! V" e" B' s$ r# K2 l-AX = 0912h (Get breakpoint infos)
v7 s4 R1 C+ U, B; O3 F" P4 l-AX = 0913h (Set Sice breakpoints)
' X6 z2 [! G% l- ]" j-AX = 0914h (Remove SIce breakoints)
, R1 L4 I& p0 T% y3 e0 D5 A9 H4 k% D$ j0 c+ F# `9 P" a
Each time you'll meet this trick, you'll see:+ x1 P# g, H- g* ~
-SI = 4647h5 w7 w2 v) j8 X9 W' |0 ?; _
-DI = 4A4Dh
4 C% U' V, S6 I3 E6 AWhich are the 'magic values' used by SoftIce.
3 r( s0 M0 P' b( d1 M: GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" B- R5 I8 ~* p& F6 F# S, n4 o
9 [7 O$ x2 @ }- L+ G/ RHere is one example from the file "Haspinst.exe" which is the dongle HASP) |6 j' p' L% g2 m
Envelope utility use to protect DOS applications:
% u: P: y5 {& l& H5 M0 [
8 G% y; H8 ] _" W9 {# k. i1 y+ W
; j1 }9 j D- c+ j4C19:0095 MOV AX,0911 ; execute command.
: R6 B+ H# O2 b4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 ~3 a4 N/ Y( p7 z0 g! b4C19:009A MOV SI,4647 ; 1st magic value.; |8 p# e% L k, }$ C) o' X
4C19:009D MOV DI,4A4D ; 2nd magic value.2 j: w; B& ]/ w8 u1 g) C3 D
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
) F, F; e; U* I$ ?5 ?3 y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, Q) L' U4 q0 e+ k Y
4C19:00A4 INC CX
" z2 N: I) ~ r* F- @7 w7 N4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 z- q N" F$ ?$ e+ ~
4C19:00A8 JB 0095 ; 6 different commands.+ [. u! R0 m% H5 n9 u
4C19:00AA JMP 0002 ; Bad_Guy jmp back.' ~* s- f# m$ W9 L( ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# @+ S6 Z8 }1 q4 z) m
* g7 p, X1 S: t' n$ j( |7 J* c! }
The program will execute 6 different SIce commands located at ds:dx, which
' C( g2 D4 |3 b. }0 E; R0 dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ z0 K0 m5 |% T" x- G3 O
- E7 |% a5 n: v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; ^' F* W1 K+ `___________________________________________________________________________) `" T& x; m' m
3 x3 e# B8 L. S9 u2 @5 }6 O6 A
4 Z5 a# } i% J$ ^. i
Method 03' q; r8 ?0 a- D8 k
=========! ]" q5 P" q3 }
( F# Q( {8 h6 g) R4 ?2 A
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 Z7 [. W( J6 X* c' T2 [' C(API Get entry point)5 y' ?& `" j1 o! e0 ~+ o6 c5 h( i; S
1 [6 `: ^6 M5 h8 H4 i) u* j
# G" z* c* Z7 B* a
xor di,di
1 Q7 k- m' O2 {9 }- t, C* c mov es,di8 b2 h; ^. t+ @
mov ax, 1684h ( K2 C7 n0 F+ Q- [7 ?! A; P. d
mov bx, 0202h ; VxD ID of winice! Y- e: t" x4 A4 n U4 L7 N
int 2Fh
/ D+ G+ H+ `: s& W$ b; @0 } mov ax, es ; ES:DI -> VxD API entry point8 `7 B7 \5 R X' v' R1 B1 h
add ax, di
h& q$ M2 N9 {: m( ^9 ?; d test ax,ax% f0 H/ }$ b/ k3 u* m
jnz SoftICE_Detected
H$ W. c; }: a2 N) A: ?. O8 x: Y, r3 g3 E. ~
___________________________________________________________________________1 ~( _) ?/ _# x# c7 i; q# V
3 q( ^4 @% I) s# Q) D4 ]8 {
Method 04
& ]7 D9 t! i/ v4 ^- W; s=========
/ ^9 f. E7 B. R# U! y$ O4 }2 p! f7 T# u! s# [0 F
Method identical to the preceding one except that it seeks the ID of SoftICE* i; R' u% S- S3 d
GFX VxD.9 l) E$ w" M+ _* J; j
$ f" u& H# m: K; D" ~2 Y
xor di,di
$ I2 g) C- @ [3 D# z& F mov es,di
$ r6 e8 ^9 f% `0 s: u+ t6 d mov ax, 1684h
5 J% ]- J- R' p) m. s$ T mov bx, 7a5Fh ; VxD ID of SIWVID
( `; R. y2 t2 M: G/ u8 G, ^) u/ p int 2fh
+ [: `8 u6 \7 s: G mov ax, es ; ES:DI -> VxD API entry point
* X$ o5 ^1 c3 t3 ]3 K3 ] add ax, di4 V- _- r7 `9 ?! o6 G
test ax,ax
; s, e+ D& G& a% Z' p jnz SoftICE_Detected
- w; r3 ^: D& ^9 r8 p: T8 ?* f( C3 Q7 K& t) U9 p# |
__________________________________________________________________________
5 ^0 C, v( B* |) Y0 P4 o; b) |8 e" r5 ]( H" G3 o; A
0 s9 o/ z" ^# C5 C! x
Method 05, T* w& ~7 S3 n* o9 b* r* V
=========
1 r: z- q( m" X: k, x- p$ Z9 k- A" K9 G% T+ T, c" \ {4 T
Method seeking the 'magic number' 0F386h returned (in ax) by all system6 |( |5 ^! G+ f0 F P' ]
debugger. It calls the int 41h, function 4Fh.7 n- { F/ e& q& `1 B, O* P( m: A X
There are several alternatives.
; f) N$ t' W4 Z6 F6 ~: ^
; F8 _8 `" q( w; e- m: wThe following one is the simplest:
G3 \# l4 T; v8 ~% o& Y. | Y1 g0 `( x. H# g' C
mov ax,4fh
8 C' x6 N3 d' |% _% G1 b6 _ int 41h
+ c. O+ C4 D: S4 y, B8 G* L cmp ax, 0F386
/ U# a2 I- i. s& _6 o7 i0 t- o6 C9 R! b jz SoftICE_detected( _+ X: l: f% \2 A
8 P5 a3 @( q2 Q
$ G# ^6 k0 v) F6 e( RNext method as well as the following one are 2 examples from Stone's
7 T. F) } P; u9 `* L- A"stn-wid.zip" (www.cracking.net):
! T' u W3 r; N
: X M( x4 r% p- Y- [1 F mov bx, cs0 \! J1 ~) R2 r( h( K
lea dx, int41handler2
1 j- w1 P8 y% z! M7 y U- I xchg dx, es:[41h*4], I1 Q% f' W* C: [
xchg bx, es:[41h*4+2]) C8 g, o/ Z) x6 o
mov ax,4fh, c0 W) {% u& ]$ d- s
int 41h
5 |2 u' j, x6 {+ i. B7 F7 P r xchg dx, es:[41h*4]
L' W5 Y5 B o; N% D% Z xchg bx, es:[41h*4+2]
4 ~, p5 A5 q; ?5 N$ p) ]! L cmp ax, 0f386h9 c6 {0 v$ ?# o5 A5 f& _0 u. `
jz SoftICE_detected) H5 F9 a7 A8 `3 y) i( ^
2 h; a$ y, s+ J; }! M
int41handler2 PROC) h) c: O4 W, b( s+ }( o
iret/ h' X8 q8 J' w3 e( c
int41handler2 ENDP
9 w6 m3 J, h# |4 K- z% @4 C5 u L' l* Y" p: f$ e2 Q2 x
! J6 S# n, U; F1 _0 g. i& E) G
_________________________________________________________________________. z* C5 q! y$ l6 V! }
* ?2 }9 k- y5 m: s1 `, V0 b) q- o! K9 q [0 u5 d6 A! o( `! p. \
Method 06
5 A% f5 Y0 Q" x9 W# Z=========
/ S, E+ W; I2 N" U1 k, G5 q( B9 b7 @# B& s7 x
) P" p9 Y7 E4 A% m- |# e$ d
2nd method similar to the preceding one but more difficult to detect:
[6 N) d* t6 [3 T# r/ d" U, p1 d
$ I! y7 F# t7 q) z- c6 A! n
& j, ~. q3 @" i8 }8 sint41handler PROC
/ K* s2 Y+ e) t/ y/ s" ` mov cl,al [# L% E9 n# C8 m0 O
iret2 _8 L. Z( S% x$ m( c
int41handler ENDP
! d$ z$ Y+ h" {) o6 p z0 H6 M, ^3 i6 K
" G/ o/ L. {! a# a! x
xor ax,ax; \6 \' e7 S/ G3 u/ ^8 Z3 [1 d; T
mov es,ax
( y! D( F4 E1 e1 W$ S mov bx, cs [: `7 b s8 c. w/ U1 T5 g( V$ Z! B$ o, c
lea dx, int41handler
* n3 U8 p7 ?# q! Q2 E xchg dx, es:[41h*4]
9 l: h& K% Y9 ^' S! | xchg bx, es:[41h*4+2]
2 P& j7 `- k$ P# m$ C6 { in al, 40h) u) t$ |5 y6 k: x6 }9 p% A- c
xor cx,cx
1 I9 Q/ s- B& `" ~% u3 J int 41h
7 H9 z+ Z, _+ Z6 P- o2 p8 [ _( ` xchg dx, es:[41h*4]) v- O, e4 |" h% P" I9 P0 {
xchg bx, es:[41h*4+2]
0 F. ~* D6 n+ k5 w7 N$ R5 y4 M cmp cl,al: `. L% O% q+ V6 h& V* z- m
jnz SoftICE_detected
* {3 `* e6 h! L$ H3 \+ R. j n" x( ^/ o* `' w& G
_________________________________________________________________________
; ^0 p0 D% M5 l; V% e- f6 D% g- E* V: P* [: Z6 `
Method 072 _, n4 T, s8 O8 t c3 o
=========
8 ?4 x- }; I$ A9 j% k8 s' t; w
3 k, z& ~# z2 K7 G+ \& I+ [Method of detection of the WinICE handler in the int68h (V86)
$ D7 p2 Z2 c8 L0 d2 U7 o; ?
; m/ _6 S- ]1 g- F5 o& X mov ah,43h
* S' |9 h1 Z/ E$ W6 s; m int 68h
' U2 L3 T, D' p& i$ V6 O! _- A cmp ax,0F386h
4 O$ n# d) g+ O7 v jz SoftICE_Detected
5 M) w$ }- F5 S7 M( i, O
: X; a; u+ z* y: f' n- X
3 d& \8 V" Z' G( L- R, `, }=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit! h, u! ~/ _4 N% u% }/ o
app like this:* S! g6 l Y+ S. C
3 O7 ]; g7 X" [+ U" p4 @
BPX exec_int if ax==68$ T3 [5 q! Z; s; H
(function called is located at byte ptr [ebp+1Dh] and client eip is& U5 A5 ^ Q4 q0 z" U t
located at [ebp+48h] for 32Bit apps); u3 _, h5 U5 K0 m w: W, S
__________________________________________________________________________
, i7 C( Q; t( h$ Q5 I: L& }3 G8 g. O( H% d
' `2 S: i( B/ C: `" U
Method 087 e0 P+ U. o( i& e
=========
- a! u; y. n1 {. ~
- Q) R B5 c4 HIt is not a method of detection of SoftICE but a possibility to crash the6 W$ H; B8 f9 u$ q6 p6 M
system by intercepting int 01h and int 03h and redirecting them to another, p( _( }) Q( O/ Y z! D6 T
routine.
9 h q8 `, N2 a9 q- y4 WIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; J# H7 J) y0 d1 a, c# f3 q) M5 oto the new routine to execute (hangs computer...)+ E9 ]3 |. ?( K( f x: b6 G9 Y
& X6 w3 Q! a8 k$ Q/ n4 U! Q mov ah, 25h3 n% \) t3 L. q, T9 c2 T( ~# n
mov al, Int_Number (01h or 03h)
" s* E: r0 H6 w. i* T mov dx, offset New_Int_Routine
2 F- N5 |0 w+ v( w. \ int 21h- x5 q/ B* R- c% q
$ z. l3 C2 w7 K6 ^; i& ]# F; T
__________________________________________________________________________
$ t3 ?2 ]+ |; m. p: f* h
9 S& O1 d* g/ N$ y( P( \Method 09* ]0 W# M3 c* x# B$ V2 K
=========
+ ^+ q: C4 C. `% u: u3 Q9 _5 d S( j
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( C A+ G* }! u% zperformed in ring0 (VxD or a ring3 app using the VxdCall).
5 ^3 @+ L# U1 @. J. r6 m5 v K; t' ^' [The Get_DDB service is used to determine whether or not a VxD is installed
" W0 }7 `$ ]: E" Pfor the specified device and returns a Device Description Block (in ecx) for. w& S# u: ~" `8 R' v
that device if it is installed.* o+ r! j |1 M) i' N
1 R0 H/ z4 H2 D2 h- s
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% X0 R0 v3 p2 Y$ X
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% s2 u# g- g: ]3 S2 [
VMMCall Get_DDB$ C- k$ B& C p
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, c# w/ m8 \# V2 `3 a
^6 {: h* C' T2 l4 C3 M7 ~, S$ B$ t
Note as well that you can easily detect this method with SoftICE:
0 l5 P4 r3 g# ^ bpx Get_DDB if ax==0202 || ax==7a5fh; x3 n b" N& B9 r, R! B" v! y5 P
V. |3 _/ F9 t, B# D3 V N0 \
__________________________________________________________________________: |) W3 V7 y6 O& L
7 `- L l) x) K# C: U& |! }
Method 10
/ c: J2 r/ |2 z* v z5 S2 a=========
' u8 i; @$ r. }/ o& r3 K9 h) ]) Q4 c& ^
=>Disable or clear breakpoints before using this feature. DO NOT trace with' s+ z$ M& Q. C
SoftICE while the option is enable!!
2 [& z: s: h) O! S' ?% ]& u
: c! a* F! l& aThis trick is very efficient:
3 c7 A$ i& e2 o. x3 Eby checking the Debug Registers, you can detect if SoftICE is loaded. t5 M4 M& S3 @* C- r
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ M& m+ P7 n+ w7 x7 L1 fthere are some memory breakpoints set (dr0 to dr3) simply by reading their! V9 v* J; @0 i, q
value (in ring0 only). Values can be manipulated and or changed as well6 m& g8 @3 \6 m: n* o4 Y% j2 ^
(clearing BPMs for instance)
4 U5 \. l8 |/ }0 ^4 n& G( D- V- J9 H9 D3 ]% w* r' b5 W- [
__________________________________________________________________________
. ~3 |) U' S6 F7 k6 z2 {
1 b# p; Z/ C0 x) f9 wMethod 11
+ ~" c6 K! n: A9 }=========
: n8 G! ]* o+ x) {. B: `' Z4 x* K7 ^! j, w
This method is most known as 'MeltICE' because it has been freely distributed# d ]: H% ~! H: @/ B/ b" s
via www.winfiles.com. However it was first used by NuMega people to allow* Q9 |( v8 q5 C# G J5 w
Symbol Loader to check if SoftICE was active or not (the code is located3 y; j) o4 s5 K( H* x
inside nmtrans.dll).: |4 p$ s3 ]1 ~ z# K
7 d3 }$ U: t' I+ l0 R+ b$ ^The way it works is very simple:8 T4 B4 Z9 w) U- _
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ Y+ _8 i! c/ ?- F/ C& qWinNT) with the CreateFileA API.
1 m- b0 S5 D& t0 a9 v6 R' P( E& B8 z' k" B7 w- d0 ]+ d
Here is a sample (checking for 'SICE'):
$ _# d1 `+ A9 j' P9 ]9 a [/ t0 ?
* @3 o" U" g |$ Z! b: `2 Q$ zBOOL IsSoftIce95Loaded()
$ t! U: l5 S8 t4 m6 Q{, W" p7 D7 q+ O; O
HANDLE hFile; 4 g1 o( \& x+ d
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. S& {1 l" Y7 S FILE_SHARE_READ | FILE_SHARE_WRITE,3 T7 l$ o+ Q: p/ W$ e7 n
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- e' }) J+ L: e# W+ n7 O: o/ ]
if( hFile != INVALID_HANDLE_VALUE )
8 @7 E0 o0 l9 C# `) e% k {& ]9 W" U( `/ E7 J% o, W
CloseHandle(hFile);
8 @. \% o! \# a# j } return TRUE;" a, r- F6 H8 |: i
}
8 G1 ?4 O8 h9 W( Y return FALSE;
3 t# a R8 m) A ^! P1 ?- G}
6 \! N, o+ Y: D8 z) ]/ h, A% w
) s; P; E! U8 [$ E. `5 A* L, f: x0 W9 eAlthough this trick calls the CreateFileA function, don't even expect to be
( ?: I- }$ k: f( ]& G1 Pable to intercept it by installing a IFS hook: it will not work, no way!$ y/ `1 Q) U( o: J& j" u N0 |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& h, ^" U5 x/ ~ z; _service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# a6 s" Y3 h1 X# }, P' |! rand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 U" t D# l, c+ l3 W, e H
field.
0 z; I) n" j: q; n: P3 J, g. VIn fact, its purpose is not to load/unload VxDs but only to send a , {8 l2 ^( _7 K- E9 L. O
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 {1 U5 d/ }5 H. Z# p! e' Pto the VxD Control_Dispatch proc (how the hell a shareware soft could try0 P$ h7 M2 K1 M# @) d [" c
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 T7 c$ i2 W7 |; uIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 {4 }: h3 ?; z* j( j! xits handle to be opened and then, will be detected.7 z! r ^3 r8 Y7 R2 z
You can check that simply by hooking Winice.exe control proc entry point
$ O7 P4 [1 i' ~while running MeltICE.
: m* F4 u, n# B5 e5 y- X6 y8 a5 l) @) i( }- J. C! M. O$ ~8 |4 \
( z* z! O$ z% U; m$ D1 w; v 00401067: push 00402025 ; \\.\SICE" ?" ]4 a, ]* E2 P# v( Y
0040106C: call CreateFileA' t1 C! o( D$ G2 u* C9 q* ?$ v4 c
00401071: cmp eax,-001/ ]- I, T3 H7 J% I
00401074: je 00401091- T. I/ l( F. E+ ]- X, [
7 A7 B. t6 u1 R9 F! v7 h
4 o% a. v2 [* D5 \) pThere could be hundreds of BPX you could use to detect this trick.
H$ O# T, y( ^: ~- F-The most classical one is:) X$ }6 c& `# _8 v/ S( f: k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! ]3 K3 f l2 U5 F* o' O *(esp->4+4)=='NTIC'
$ f+ q, e V$ _9 \
: { M; ?2 b' t" U* A% g8 H! t! [-The most exotic ones (could be very slooooow :-(% N( [4 h7 ?3 }% m& W& C) P+ b
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') + u/ G2 J) I5 W7 C4 [
;will break 3 times :-(! A* L! q. @8 \2 [$ r
/ L6 U1 }5 L! M' w-or (a bit) faster: " v- Z+ j2 n% C8 }8 B
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 K4 i, a! g/ v. b9 v7 B( V
+ x4 K; i! e& e i+ I BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ( u% y& Y) h" X2 u% N6 [
;will break 3 times :-(4 a1 [+ L- O% u0 g, e
/ M5 l' A7 [0 y. z3 r& T: w+ Y
-Much faster:
; Y& ]3 B% Q L BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 r2 I8 b9 K. {8 r% k9 l: f* i$ Q2 p" t+ [3 R
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 k: |/ L2 q* b2 {8 T" f+ D' efunction to do the same job:( _% S$ ~' r7 t# t2 Y) J
' {/ a& v' L! L: [3 a* I push 00 ; OF_READ
0 u3 _5 w1 k4 ]/ ~0 L; R3 W( L( T1 ] mov eax,[00656634] ; '\\.\SICE',01 H0 a5 f/ ?! n, `0 }7 W' l
push eax
1 n* R9 e7 i ^) A: U& h4 S call KERNEL32!_lopen
7 B+ N- r/ o$ s" T% c% y6 w inc eax. C# P0 v% Y; c" Q+ A
jnz 00650589 ; detected
( b9 j U! e1 w! R0 m6 F push 00 ; OF_READ
1 j! S( J, u' h& B6 B/ f mov eax,[00656638] ; '\\.\SICE'
! Y2 W; H' a3 R5 a push eax/ Y0 F8 d& O9 z5 K; e7 r* K
call KERNEL32!_lopen
3 D2 ?- y0 _9 T. g! K inc eax
3 f% T0 {# S" }" c" ]5 B jz 006505ae ; not detected# f- z8 D) B' R0 H$ C1 Y$ {
- T3 [! Q3 E, \, R" C8 M+ x- ], H
3 K: i6 G) s; E) p1 d. I0 M5 ]__________________________________________________________________________
0 s* U1 O5 G5 Q( ?0 X" \8 Z5 F, H6 ?. l4 @' P
Method 12
( V, u$ g% \/ V( `' W# y( u=========
4 @4 }; b4 l6 P- S
7 ]. j1 z1 A0 [+ AThis trick is similar to int41h/4fh Debugger installation check (code 05
/ f6 _5 l# ^. D8 Z0 c+ t& 06) but very limited because it's only available for Win95/98 (not NT)7 J% J" z6 u% X# @( I5 D! a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; g8 Q9 v: P, j/ E8 a2 N
5 p g" X5 O \1 d4 J; J M) J push 0000004fh ; function 4fh
: Z' A2 S1 T+ Y8 a- t9 w# b push 002a002ah ; high word specifies which VxD (VWIN32)
5 Q5 Y" R% e0 W' K' p# Q, E ; low word specifies which service/ r0 \# f, U1 G: j# W+ ?
(VWIN32_Int41Dispatch)/ E! y8 Q: {; d o0 y" S8 I" R
call Kernel32!ORD_001 ; VxdCall, m) P6 u W7 ]
cmp ax, 0f386h ; magic number returned by system debuggers5 B5 J. i5 |# Z7 H/ U7 K
jz SoftICE_detected9 Q! Q- J; w. @# H0 O2 q
0 X/ w5 B x& H/ |/ f8 \4 ~9 iHere again, several ways to detect it:
( k4 Y; ~2 ?7 R- d$ ^7 L1 L( Q1 t, j* g% r; D K( u
BPINT 41 if ax==4f( P" D0 i7 D+ z( h Z
: q$ ]2 P, g- z% b
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ C+ y- E7 c. z- Q$ o2 Z2 I# T1 J
3 H4 P% ~& ?) K& G9 r: g& _
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
& k2 D/ b- v' |2 {0 ^" \: ]
, C& z5 _- Q+ W! ]* A BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
E" A5 F2 H/ W
& W6 g% x( ~5 V$ f__________________________________________________________________________) r$ r$ N% n) T7 i
* @( e" C) x7 l' d7 k! J2 H$ Y
Method 131 |9 x( K8 I+ ^6 q- n
=========
* D2 s5 d" _& g$ H" S
6 f% @, y* t( ]$ X( L# `* gNot a real method of detection, but a good way to know if SoftICE is
! O3 a6 s2 r& h) @, {installed on a computer and to locate its installation directory.$ I! _; i' ^( i- i
It is used by few softs which access the following registry keys (usually #2) :- t+ Q/ n" P; Q& @( q
0 A) k% F/ n2 X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; R3 o% ?4 f3 y) b3 f
\Uninstall\SoftICE
) T& n& \9 a! L: I, q4 w% G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 q) C, E3 {# p J
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) w1 R+ t8 g/ K% b7 s2 Y\App Paths\Loader32.Exe. H1 ~) G S/ r; S# \- e0 f) V, H( G
L" Y" [' n* A2 L. d
' |( z+ Q9 l; J& S9 h. k, S1 ]/ [2 nNote that some nasty apps could then erase all files from SoftICE directory
7 \* ^ [& a6 E8 B* Y6 a(I faced that once :-(+ A$ {. a, K7 _
" i O' T. A6 c" ^" \Useful breakpoint to detect it:
3 W% v* S5 H* x+ i2 c5 Q8 U% L' Q% i* H: I4 y/ F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# {$ G9 ^1 A# u# D3 ^$ C L& _
) V( D4 m1 z. q% p$ C: @* _
__________________________________________________________________________
( G0 d; e2 V Y; x7 x+ D
. i" _, y/ f/ U5 n3 b4 N. }0 f9 K3 E4 N4 i4 S6 S
Method 14
6 R- K- D _; |, |, U5 j" O=========5 L+ f. p+ t" Z
' n t$ z6 [ i) Q( ^A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, S- \ Y' `% _% Lis to determines whether a debugger is running on your system (ring0 only).* Y0 H* _! ~1 ]& J% u& |; _: h
( J% H+ n2 s2 t! L* y) Z8 x/ @
VMMCall Test_Debug_Installed
. C; T( a Q& ]8 A ?8 F je not_installed
6 s8 G; s) k8 p v2 S. o
$ q+ @$ }1 Z2 o1 E$ AThis service just checks a flag.8 ]* a8 n- x, y1 C. t# H( ?
</PRE></TD></TR></TBODY></TABLE> |