<TABLE width=500>7 ?7 M; c" k: R6 T- \- {# ~7 P
<TBODY>% i5 h; y$ z- Y/ r$ b2 k
<TR>6 k9 Z. J" H& @" F; i
<TD><PRE>Method 01 4 i3 X& O/ i0 [4 b' M" y- k
=========% f# H$ N4 e8 g, l* ~
+ [' o1 L# Y( v4 x
This method of detection of SoftICE (as well as the following one) is0 U& o& B& h" Q8 y* L9 B; \
used by the majority of packers/encryptors found on Internet.
9 _& S. @% ?5 b+ e* L- lIt seeks the signature of BoundsChecker in SoftICE
, w; t9 k& N0 X; c1 D: M) \6 n& ]: O
mov ebp, 04243484Bh ; 'BCHK'
4 r4 a6 w H7 m: {4 W/ b+ D& b! Y mov ax, 04h
: p/ V/ C" n, i" I& \- d int 3 9 O9 f& b) c( F1 I( l$ {
cmp al,4) X w' `7 c2 J; B( B1 v# d) b
jnz SoftICE_Detected* ~+ Y7 W6 E) y6 o5 `) I
5 C3 `: h9 s7 |2 s___________________________________________________________________________& e- v" P2 ]1 \# ^
. i! V: J! X3 y( ]
Method 02. z4 ~; s9 Y; [) N5 n
=========2 v {# l0 U1 f
+ e+ L2 \; k8 ^8 x. XStill a method very much used (perhaps the most frequent one). It is used
Q( Y: w+ B. h( A: ]- z! Dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- {! f3 y( p* V' M* m+ d' n9 @or execute SoftICE commands...
; P3 ?6 K& o4 G% AIt is also used to crash SoftICE and to force it to execute any commands3 q7 O1 y) x* ~# n+ z& ^7 p2 `! F
(HBOOT...) :-(( # q# A# E- T b8 h. I
) h- i2 C/ G5 M8 |8 u( o
Here is a quick description:0 a1 x3 ^' z6 F+ f
-AX = 0910h (Display string in SIce windows)
7 q0 o% N; P+ c-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 B& q0 s3 [* C% L8 W-AX = 0912h (Get breakpoint infos)7 q/ _0 O! Q' B6 n. }
-AX = 0913h (Set Sice breakpoints)5 u2 S, i# K3 O: q
-AX = 0914h (Remove SIce breakoints)0 q( {: [- m0 O K* X$ @
5 \& k, d+ L' {3 H! S" W
Each time you'll meet this trick, you'll see:" i1 t; G. u/ m/ d& A
-SI = 4647h5 j& D" D: q9 E
-DI = 4A4Dh
+ @- x) x. X5 {# q, x7 X( nWhich are the 'magic values' used by SoftIce.6 n, ]! Y# o* T* l4 B7 y
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ Q! f. F, C$ r
8 Y3 A6 v* X+ PHere is one example from the file "Haspinst.exe" which is the dongle HASP
3 m f; x: t" o: p X8 X2 OEnvelope utility use to protect DOS applications:% b( y* z: n: `( n
8 V3 Y* j. J9 G% k
. m$ o8 t, N0 {
4C19:0095 MOV AX,0911 ; execute command.
* C/ b0 A. b* d) g! C/ J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' b) V/ r4 g3 A. D
4C19:009A MOV SI,4647 ; 1st magic value.
( y; w$ P) E/ s9 J$ U4 ?- P' u# M9 \4C19:009D MOV DI,4A4D ; 2nd magic value.# [4 |; m" L' ~# |8 h
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- e0 T y: R; p8 `) x+ U3 Y0 p! A' A4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. b8 r$ n2 x- j+ A! C5 X7 u
4C19:00A4 INC CX) a& V5 p1 I$ b" N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ V& z/ s- I3 d. J6 R4C19:00A8 JB 0095 ; 6 different commands., h, t$ l: b9 {' e. G2 a Q- b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% R3 R7 N+ f! L% n: {4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 @# {( Z& l" F3 _1 j, D
5 e$ f+ X4 R- a: n0 cThe program will execute 6 different SIce commands located at ds:dx, which
6 c, Q0 t% ~5 K; r: yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" @# k9 i, r4 G- ?, B, q
; F& r9 H$ l; U m4 C2 c% K* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! S# \; o) r; d/ d___________________________________________________________________________% v6 e2 ]; d6 f7 n, v9 K
( H, [7 ]$ g4 ^6 H( o/ N5 k' A" h. T6 X- e9 _2 C. N! K, M
Method 03
9 I. i* P) E: b9 w=========
& s, a& k$ ?. W- x( F
$ V8 N( h; _4 N/ QLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ u- B+ D+ ^. w# L% \# f# M9 q
(API Get entry point)
6 @2 o3 _$ ^/ w J# u J/ i
- l, U9 X8 M1 G3 k1 C7 i
7 V. A8 J c) P4 A# |8 B xor di,di+ j! I1 ?6 f/ `( k, O2 X6 ]0 n0 C
mov es,di
" k0 M) N$ g8 @# Z: `2 z mov ax, 1684h
4 V+ y' ?! r6 [; T; j+ c mov bx, 0202h ; VxD ID of winice: \* k8 I8 B% I# _3 r2 V
int 2Fh
: n6 p+ h! [3 c mov ax, es ; ES:DI -> VxD API entry point4 A; S. c1 M( |, O
add ax, di# G- f- y! O p5 D
test ax,ax6 h. u( w; s/ x( w& X, `
jnz SoftICE_Detected
3 s/ K- w( P% ?
+ w- E k/ \; c: H0 r' N9 S___________________________________________________________________________; N- m6 r0 g0 C) F" j7 E1 A* x4 W
) ?9 ?$ g! H, }* W5 D# D
Method 04
) s( ^0 [# w% P8 J=========
' s% P% U3 X4 |( V8 x5 ^5 H/ o% W! e! B
Method identical to the preceding one except that it seeks the ID of SoftICE: l, U. l* Z9 |7 K6 y( c8 a
GFX VxD.
; g1 t0 r' W7 t9 ~* z) l* b& j
3 a; N3 x4 D7 @- u xor di,di
6 v& L7 q r9 A F$ d0 b: }5 Z mov es,di0 ]! m/ a! J2 f; N
mov ax, 1684h 3 S" B' F! J2 D& V1 Z
mov bx, 7a5Fh ; VxD ID of SIWVID
* n# Q7 |, j& ~ int 2fh
4 T) ^ p/ [& Y5 I mov ax, es ; ES:DI -> VxD API entry point
6 a$ F9 f8 V( Q) {9 ]4 k, q$ ^" u add ax, di3 [+ M0 M5 k6 k( T8 ?# Z
test ax,ax9 V' t2 w6 U! K! g* T% g9 h3 b" m
jnz SoftICE_Detected
) ~! X9 d; ^! n# o
: a# X! w+ t1 |4 Y; H__________________________________________________________________________8 `; [+ d" D3 ~1 I
, F+ Q5 E& R# x Q
- G4 k: F$ s1 I G$ V
Method 05
1 q9 T5 P" } E=========$ W2 c' B& O9 C* _. F; c5 M" l
) U6 n3 E h7 JMethod seeking the 'magic number' 0F386h returned (in ax) by all system
. C6 E* Z$ F. s2 i4 |5 l' Sdebugger. It calls the int 41h, function 4Fh.
7 V a* S1 T' U* N+ K+ CThere are several alternatives. 7 y* C7 M' M% z
7 J7 ^2 y0 H) u8 m' U
The following one is the simplest:$ A: y6 y7 q# h( D6 T+ @0 \
" g' H$ U$ }& u$ s# \& d! o
mov ax,4fh& B' W1 j c/ E2 A) w; i7 j
int 41h) {6 G" z% d. I3 Q* c# _+ `
cmp ax, 0F3864 ?1 J* g& _; O" D1 u+ I
jz SoftICE_detected# p' i, z% Z6 I$ p8 z
1 A+ X# L3 k' E. p% S
r( G4 p1 C9 f
Next method as well as the following one are 2 examples from Stone's
- a8 t! u6 E' _8 _& @% z4 a"stn-wid.zip" (www.cracking.net):3 D' N4 n1 o6 k1 ~' t _$ _
" x/ @4 ]6 O4 \: k( {" _$ x
mov bx, cs( Z; v' P Y; b x
lea dx, int41handler2
8 z. C, [ k( q; H7 e xchg dx, es:[41h*4]: W2 L! x+ g2 H/ C( K
xchg bx, es:[41h*4+2]) X2 C& b7 P8 G e
mov ax,4fh1 Y+ i4 U4 Z: E% e2 S. r! z* i) n
int 41h
3 B7 O. w; t1 I xchg dx, es:[41h*4]
7 e- y& U* ^( u9 U5 H4 }; [ xchg bx, es:[41h*4+2]1 P" w0 ?8 C* E7 S0 w
cmp ax, 0f386h! b& n$ [- k/ G9 n+ f0 [
jz SoftICE_detected
/ x7 \6 r- w/ }! D7 x
$ n$ p5 i$ |1 Gint41handler2 PROC, [9 y( [7 p$ C0 I8 s& y- C) v
iret. }8 d+ C8 u5 G- i6 V
int41handler2 ENDP: u2 K% R. Y& p) w! j2 s; t) `
# h& C, K' v' Y. y8 N% Z9 m3 ^5 O) M
0 c* p) E% [8 L8 I- W_________________________________________________________________________
2 p9 u* G2 @: i- \- F' \# [; |- u, M* U5 g. `% T; s3 w
$ w; g- p- G0 c; A$ j
Method 06& a" I3 w& {* l' p
=========
# z4 U: P9 `( Z4 s' d7 a* d. L
9 U( D( A( d9 \+ L+ ?& f* b' C% V& S4 E, t9 q: ~
2nd method similar to the preceding one but more difficult to detect:. T/ G/ n- Y, `5 T, a/ O2 _
$ _ h0 p5 k6 @4 e" g0 d, z
% y q% [6 q5 m/ [int41handler PROC
. | _+ ^8 a# b0 F$ l6 e mov cl,al: A6 s& }0 F4 d7 n0 x+ p& J. x; z
iret9 j% x/ y9 }8 e
int41handler ENDP
* ^& |- d7 i- j' u/ W8 n- n+ j% }' M6 p
3 S2 Y; \4 g" T$ S1 Z/ u xor ax,ax
3 ~$ b6 n7 {5 G1 V# n' k mov es,ax: s. `1 Y+ _+ X3 m
mov bx, cs5 W8 T6 ^6 w4 M1 g
lea dx, int41handler! [6 w. R8 n: t
xchg dx, es:[41h*4]$ q w; l, r2 d* g8 Y, k- A
xchg bx, es:[41h*4+2]
5 I2 {& O7 P% t+ z9 S5 | in al, 40h: t8 Z* V R d, i! r* l+ }
xor cx,cx
( P- I6 N" |6 r- W6 g- }3 C) u9 E int 41h- ?8 _( m* T& O8 w0 P
xchg dx, es:[41h*4]- C [! k# Z5 R3 E2 u" q5 v
xchg bx, es:[41h*4+2]1 s$ _! |1 W2 I8 \1 Y
cmp cl,al
7 I# m! L* t: p+ \ G' w jnz SoftICE_detected
# P( F6 [. T$ Q- h) q6 C( Y
7 z$ c# G( i7 K! P) n_________________________________________________________________________
. A2 Q9 l5 p+ ?- ]% h- u8 v& _% h' j6 q! l- U
Method 07! `2 n1 `$ Q8 Q6 L
=========1 G4 N; R) ?; ^8 k5 z
9 K6 F( V% I0 K1 Y8 J
Method of detection of the WinICE handler in the int68h (V86)
) p% w4 S! u/ M# O+ _+ D z$ y `) D% @: F& a( ?
mov ah,43h
{7 D1 j% B% P% j$ u3 ]/ |' `5 R int 68h
: U/ q* Z8 x1 q0 G cmp ax,0F386h% v ^8 _. O: x# g' g
jz SoftICE_Detected" f1 V1 Q- O ^. m, l$ V3 \
7 v& h: U- f. b v- P
8 ~* o; N: F6 J. o% S& l7 l& q, o9 U=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# N, _! g" Z3 {0 C3 ^6 E9 E4 j7 C
app like this:
, o9 g) p5 _% J2 c: G B
( R: j: f9 o6 g! r BPX exec_int if ax==682 u8 ~6 D3 @1 Q
(function called is located at byte ptr [ebp+1Dh] and client eip is+ V9 C7 P+ x8 V3 e2 J8 m
located at [ebp+48h] for 32Bit apps); \3 d1 |$ ^& ^' ^
__________________________________________________________________________
# X0 W0 y* U& |# C& j% \% C
2 q: C4 B. d+ d; ~
7 G: Z9 ^$ h% w' G4 [0 ZMethod 08
9 l5 W: X' s( E) V- q=========
) X) |* `( _* b
9 z9 ~4 [; i9 ^0 E3 j$ I tIt is not a method of detection of SoftICE but a possibility to crash the
; d2 \. ~4 Q5 e! f7 [ F) ^/ zsystem by intercepting int 01h and int 03h and redirecting them to another: \" K2 W. i0 x2 o2 O' r
routine.
" Z9 I- J+ o2 ~" u) a$ u9 a6 Q' `It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. T, n0 ~# H$ X% Cto the new routine to execute (hangs computer...)
7 q) [+ }/ U% d8 f3 q8 r' `: \7 \9 n
mov ah, 25h, {% u. c2 J7 g+ S. t
mov al, Int_Number (01h or 03h)
3 i; ^5 a9 n6 o& q1 j mov dx, offset New_Int_Routine% ~1 t# T7 w! R# {
int 21h2 J3 |. t2 a/ M; D) i- j0 N& m. a
+ R6 B" w, }$ `& h1 Q8 ]
__________________________________________________________________________
( N7 Y/ [5 f/ F$ b) N$ d9 _9 A7 @
% c, _/ T& y6 P2 Z3 e. O/ v- F6 uMethod 09( f1 L" y4 h; V" G8 ^+ B
=========9 |' I8 S9 D% C; p! z5 C( ^! H
6 y& m$ \; L4 F. r' B
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 B( B; i& G% S" `" e# t
performed in ring0 (VxD or a ring3 app using the VxdCall).
5 J) u1 h! O4 L) yThe Get_DDB service is used to determine whether or not a VxD is installed6 {$ y9 I3 f1 S5 e- |5 E6 w
for the specified device and returns a Device Description Block (in ecx) for8 |; h# M8 Q) B& i1 |& Z3 z* [
that device if it is installed.7 D; J: \4 R. j; |
4 ?$ K0 I) B* P$ A6 m4 M' X9 D$ A
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! o' O5 k# h& ` _1 ] mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 }0 \3 b" q; I% F' i VMMCall Get_DDB
2 t% l, d; F2 O6 T( p/ Z8 U- c# t1 o mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 _0 R+ v. x" V6 {, x
. O! ]9 _6 f% l0 c/ T MNote as well that you can easily detect this method with SoftICE:
$ P0 t4 s, I) v bpx Get_DDB if ax==0202 || ax==7a5fh
9 Z: h$ W6 u; a& I3 ?; p" F: v
0 u" c! H; u' H0 F2 R" v__________________________________________________________________________
' a4 _" B2 _3 K7 a
) ] o$ q# Y9 M. U1 R; v" n7 cMethod 10
' m" b8 y: f* T; x) y; I=========1 H9 y* _3 P! c# b8 `
0 }6 _, S, B4 |9 }5 H4 D2 g2 N
=>Disable or clear breakpoints before using this feature. DO NOT trace with& N2 B9 r- l, ~1 |( M
SoftICE while the option is enable!! }& V# X s3 _: L4 |/ N8 {
, [. D! r) J! W' M: J, L
This trick is very efficient:
6 ]6 H3 A, m- I7 _+ Y0 `% S! I5 `! Zby checking the Debug Registers, you can detect if SoftICE is loaded/ A3 Y8 v+ C' J. o# [7 C! J9 S- x4 p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. L+ P* b0 i f$ e7 V$ f# hthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 Z1 S- b: e% _
value (in ring0 only). Values can be manipulated and or changed as well2 S. b2 k; U3 m4 d" R
(clearing BPMs for instance): M' ]0 }4 M9 | |( D, N
- N# h! A, q1 E3 l3 t__________________________________________________________________________
4 f S2 }6 W( O& Y8 k- V( X) [' q& ]- J, c) o/ s/ y7 [2 d# A
Method 11
: a& k9 z9 f- R% B( W=========; @- \ T/ x" W& j3 d4 x5 H
8 H$ |% R$ O. J& `6 Q& o7 LThis method is most known as 'MeltICE' because it has been freely distributed) r5 r) J* F6 c7 l# ]; K! Q
via www.winfiles.com. However it was first used by NuMega people to allow. T& N1 T- ]* \6 u3 N/ E+ _
Symbol Loader to check if SoftICE was active or not (the code is located2 y' i& w& W' P: o3 T2 c: c+ q
inside nmtrans.dll).
( }& D% s: W/ D5 @- B
( \0 d- b# J4 I" B3 ]& [2 {4 |The way it works is very simple:. O- a: _7 `# u/ Z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" ]9 G' {: \( }) G9 g( `. oWinNT) with the CreateFileA API.0 x3 m) x% P, v5 I. P7 z
1 d' i# f( g7 V1 \2 A
Here is a sample (checking for 'SICE'):% A$ O6 }; w- v% f3 g/ M4 Q1 o
- ?" x" w/ R) N @& r6 ~& c' Y9 h
BOOL IsSoftIce95Loaded()
0 k4 C! h7 D# t1 X8 t{3 H5 h9 S) D8 A/ E; A. y
HANDLE hFile; " `4 ^* C. Z' P" x' N, z3 {
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 m* U# ]; \/ N- K# Y! s9 g( }2 t FILE_SHARE_READ | FILE_SHARE_WRITE,
9 z5 P- m+ x( e/ u) q; D8 I NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
7 H D" o4 t; D1 e6 Y if( hFile != INVALID_HANDLE_VALUE )
/ @7 m4 ]' h* x6 B {( ~2 r5 Z0 h8 I: v/ y
CloseHandle(hFile);
& {9 g1 {7 l0 K E: h0 E* Q% e8 d R2 a return TRUE;
) q2 Q9 D7 O4 K ^5 J }
; y) k7 J8 J* J; r( ~& M3 |# I! C return FALSE;+ e+ I& M2 x5 x4 C R; w
}
+ W+ r$ [* X8 E% u9 @
1 r) E+ F1 c, }# B8 R' bAlthough this trick calls the CreateFileA function, don't even expect to be
' w8 S6 Q* j, C6 Z) S6 @able to intercept it by installing a IFS hook: it will not work, no way! d4 N. d+ R4 ]# V1 u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 Q" _& A Y3 z/ mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
d3 i, R; x. ]* [7 l5 jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: I8 H; q- j1 j" A' Xfield.
/ X0 ~' L9 N& BIn fact, its purpose is not to load/unload VxDs but only to send a * l; i0 J e7 k, S1 ` e# {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 _: j) E7 N1 k0 c- b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 t! h& G1 Y0 ^" q* e7 sto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 l0 _% e# Y: ]8 E$ G
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% h# I0 k0 [7 b: gits handle to be opened and then, will be detected.* v4 S* p6 g" O( D7 `
You can check that simply by hooking Winice.exe control proc entry point
# X4 ^: }8 [+ }! G) M7 {, h( p6 Bwhile running MeltICE.) C$ S/ U$ z: |7 n/ @
1 c; x6 V2 G6 L5 Y9 }2 Q) K
: t9 A8 e% a# ~: Z, ]2 X4 r 00401067: push 00402025 ; \\.\SICE
: B( h0 m; Q, g+ o$ j. G8 {. ^ 0040106C: call CreateFileA8 c* h4 A- v: `% j6 w% l7 O
00401071: cmp eax,-001+ K V& i2 H# j; l) j' h. I
00401074: je 004010919 y# ~3 W, t5 |( m
; q8 P$ p3 X O$ l# T% ?8 V2 c( E! |1 Z8 G. _" c
There could be hundreds of BPX you could use to detect this trick.
! X7 u. n3 S/ A* `-The most classical one is:0 ?* e8 u) ]4 }0 o( T% ^) }
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 Z$ n, n6 \$ T) Q* z. a/ G# Q
*(esp->4+4)=='NTIC'
7 b2 I1 X1 r1 w5 l" ?4 q/ Z* Q& |& Y6 ]
-The most exotic ones (could be very slooooow :-(
5 c3 g: a! p* X6 {- X, N( U/ \ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- b% a) B- V) q8 R4 d; z$ O ;will break 3 times :-(; I) O9 u1 M }; k# T% {6 b& D' u
- v! y$ ~+ o7 Y Q7 d" G-or (a bit) faster:
8 b4 w! n z- n, l' H6 ^3 H4 n BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% c2 R$ v; J) S, E
4 }& w' e, L4 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 M8 B, c1 s. v9 @* K- x' y ;will break 3 times :-(
# a& f2 S# S" }( j5 J% e$ r0 f) ?& S6 L7 a, v& ^ Y& P+ f
-Much faster:
" ?+ _" j2 R, l& X6 |. {# b: O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 R8 ~, r- U8 z
* n6 n+ S8 n3 n
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! a6 Q4 V: Z: C0 O; b( r7 U
function to do the same job:
( T4 m5 e4 M3 a4 ? H8 p6 k( m. i. e# v( X6 ~% @" e
push 00 ; OF_READ
9 h0 Y& G( K& N/ w# z- V mov eax,[00656634] ; '\\.\SICE',0
$ i; L# O, p8 B+ ^( ^) u4 e ] push eax
/ T! ]3 T# t Z3 n" @ call KERNEL32!_lopen
$ ~" v, \' k6 J, r# g+ O$ O inc eax8 r$ ^/ q7 a. v5 n/ p9 g" [
jnz 00650589 ; detected
4 v% K$ T% X6 G push 00 ; OF_READ
0 V& E8 v' k7 x7 i8 P mov eax,[00656638] ; '\\.\SICE'
7 I& \7 A: }6 q1 g% L( | push eax$ M1 u4 K- P5 {
call KERNEL32!_lopen1 n% j$ q0 c. j$ C
inc eax2 A, F- [9 p4 r( R( b
jz 006505ae ; not detected) b9 |. z7 T0 R/ p$ Y2 ^
9 k- L7 C& G/ {8 R% h+ _" q' h6 b$ b% n4 X x1 d
__________________________________________________________________________
; t- i7 v! G) G% S" z9 ], V9 F& B1 F5 m9 d2 M% j3 Z$ b
Method 12
; X; a9 ^; q/ R3 D=========
* j; g9 T) F+ O8 p# X+ u$ f: z+ m1 z: J
This trick is similar to int41h/4fh Debugger installation check (code 058 d0 h9 G D7 d3 ?" Q" I2 i* p
& 06) but very limited because it's only available for Win95/98 (not NT); p t+ G+ y% R y. \# f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: O3 W1 H0 z- u, e8 |' K4 ^* C. t3 Y/ {5 u9 }: c2 P: B; m
push 0000004fh ; function 4fh, @* ~& v8 L0 ~3 @" u3 o, k: I
push 002a002ah ; high word specifies which VxD (VWIN32)8 _5 Q6 J) h+ k; E/ m
; low word specifies which service3 T4 l9 q: v* ]
(VWIN32_Int41Dispatch)2 H2 G" F/ U% a
call Kernel32!ORD_001 ; VxdCall
4 k+ H$ R# ?9 o% l: g5 d cmp ax, 0f386h ; magic number returned by system debuggers7 c7 h6 V/ q& t1 O' C3 D3 M, h
jz SoftICE_detected- q) u8 t8 `% b5 |
) }4 J: ?: \" Q" ]1 V. T# Z( ^) h
Here again, several ways to detect it:) K# [9 O- Q" S5 L; ~
2 e$ O/ i8 ~* Q/ B BPINT 41 if ax==4f h8 F3 N4 e5 }( O. l0 e
5 U( a: @# k) F! ?3 k BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# F8 f& s% I V( e6 c
3 U+ \3 A/ Q" v: T) X! D BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A+ V# d3 G0 U: a4 u- w
) [! G1 q" U+ W |, V
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 N& V1 q- q5 Z- l3 X( e) n% e
! y5 W) P4 O; R0 p& u" g' p6 q
__________________________________________________________________________ O; u9 D& W3 n) y/ v8 P; R
( e" f$ ~7 x, B
Method 133 m" w3 I4 s/ s1 C4 J4 d3 y
=========) }# H O& z" c4 ~' ^% I+ d
9 B0 p% n# j0 w9 }* ]: BNot a real method of detection, but a good way to know if SoftICE is
/ c0 s& y- `6 I% `+ f. i; e- q+ winstalled on a computer and to locate its installation directory./ j$ q& r/ x& ~) ~8 T B1 h
It is used by few softs which access the following registry keys (usually #2) :
! Q% h9 f4 q0 t z& r7 Z9 U# f% q- g) n2 p
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, f; c& J. u) e, l
\Uninstall\SoftICE- {9 d) f" v/ m" X
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 Z: N: b* i; `3 Q% p+ W-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ C8 r6 l& F, N9 k# d
\App Paths\Loader32.Exe# M, X7 R, v$ ~4 k8 Q' F, a
G( e: @6 Z+ n# g8 Z0 t
; ^5 N- n; U* o6 f) V
Note that some nasty apps could then erase all files from SoftICE directory
8 G7 ~9 p+ G5 \6 e `3 l(I faced that once :-(5 C& V5 m0 r9 L5 T# Z) d& P7 H
7 C( x& p& l6 ^7 r B- z
Useful breakpoint to detect it:; D3 x, v& }3 } o- I
+ F0 q, N+ Y/ C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 T: I9 `( p; H9 y2 h! J' R6 s* w& P0 _7 [
__________________________________________________________________________7 A" f9 z6 \, [$ _$ g4 Q3 @/ _6 r: S
9 E* D$ C7 R0 U6 C! \1 |
7 B0 D+ ~/ P: E! w8 ?0 @Method 14
( g/ @9 L2 E Y) T8 C$ i========= D" I7 m Z( ?# U3 x9 B! ~$ R
2 z% u* p6 M1 P9 P3 e
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 L @: B n5 p) p: q! _7 @( }
is to determines whether a debugger is running on your system (ring0 only).3 r Y9 A4 E$ V
% Q3 o' |3 i) Y% l6 N* P! c$ {
VMMCall Test_Debug_Installed# R, H% x# }1 t. G" B+ m
je not_installed4 M% n+ }) G; `) q: q' ~* {
: M9 o J1 ~/ @" K2 C- K) GThis service just checks a flag.# O s( @; E# m; E9 @! [
</PRE></TD></TR></TBODY></TABLE> |