<TABLE width=500>
2 P8 P, C! L2 V, d/ j+ ?, l<TBODY>2 V5 C, H& D; d
<TR>1 e: O9 z8 A, Y# ^; t$ X7 p
<TD><PRE>Method 01
" \2 N( y0 m- L ^1 k# z: T4 h5 j=========! E E; M8 O1 F D
( c9 H* q4 M \& `0 MThis method of detection of SoftICE (as well as the following one) is6 D. `7 Z3 F% T) l" N9 v$ C
used by the majority of packers/encryptors found on Internet.8 [9 ]) p: G$ X- f! L) z, u- x
It seeks the signature of BoundsChecker in SoftICE; t/ ^* C3 f6 q% v9 I1 y
; x$ l! \/ D3 y( v& K
mov ebp, 04243484Bh ; 'BCHK'
4 J* Q( n& O4 X- }( @5 C( d mov ax, 04h
/ v+ f( q; T! _) k, b7 n int 3
4 n1 o! A0 l5 p4 c cmp al,4
( Y/ y6 v$ D5 z jnz SoftICE_Detected
8 D* P8 b' D1 O
i# f1 j: v) ~7 E! m2 a- m1 u8 D+ Y___________________________________________________________________________, e U3 R1 N1 V% o5 K6 X
3 u( E% T/ w i* a
Method 02( L8 l0 ~$ l, I; s2 w. v
=========
+ X+ ^ q3 c6 ?4 P0 ?: O$ E. K8 P
Still a method very much used (perhaps the most frequent one). It is used
5 W: Y7 ^ G& t1 v$ p, D1 Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; z N* R' Z" `& I7 r$ nor execute SoftICE commands...
7 I3 Q2 U8 K% i! ~4 [0 i7 y& R8 aIt is also used to crash SoftICE and to force it to execute any commands" n* I% h7 o k
(HBOOT...) :-(( % c& D$ Q1 x# q+ ~
/ c# F/ E& Y9 i. v
Here is a quick description:5 J4 x/ K) y* g1 q# Y' n
-AX = 0910h (Display string in SIce windows)
3 N1 K8 \4 c. s0 k9 [0 h$ o, Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)$ i0 I/ s- R8 v' w* g. G
-AX = 0912h (Get breakpoint infos)1 e0 @6 s! J) B+ V9 | p
-AX = 0913h (Set Sice breakpoints)9 J$ X5 [" [& v# x% [. I5 a. e
-AX = 0914h (Remove SIce breakoints)
' h2 D; @6 I' n2 b% j# ]" o9 V3 u" X& r( C- Z& P5 L
Each time you'll meet this trick, you'll see:/ }$ B* M1 }; V
-SI = 4647h
$ j7 \2 i9 ?% C6 [-DI = 4A4Dh
" h6 u" a/ n( R. P: V" ?Which are the 'magic values' used by SoftIce.
3 a7 R+ z5 Y+ R/ M7 N& qFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ d. B6 B8 {, w7 G, ]
3 I6 ?! O% ~! o9 Z) fHere is one example from the file "Haspinst.exe" which is the dongle HASP
6 S# S- L- \% y# {. H" s: x. ZEnvelope utility use to protect DOS applications:
' }; z$ n# {( o8 U# \( n8 u
, o2 V( g' b9 l* s1 m3 P
) `* I+ ~ e0 d$ r4C19:0095 MOV AX,0911 ; execute command.6 e, q' }: E4 x ~
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 D `0 Q; w9 t/ P! t2 C' a
4C19:009A MOV SI,4647 ; 1st magic value.
+ N% L# S7 T2 Z; H1 M1 D4C19:009D MOV DI,4A4D ; 2nd magic value.0 }: V4 y6 n% f1 J) {" {5 S
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' u6 N, R* D8 i+ k* x
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! s1 u6 S4 o2 B' |
4C19:00A4 INC CX
, \ R: o v Z: ^# k; K4 k4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 u; R3 P3 a( i7 F9 S% V! C, ~4C19:00A8 JB 0095 ; 6 different commands.
( {; L0 f3 S; A/ e4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 z& q; J$ _6 ?. F. k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 _+ B$ o8 h A$ `" A c! Y9 ]" J
+ a5 \; Q! i. B: K7 ?; I& LThe program will execute 6 different SIce commands located at ds:dx, which$ E! `. ?6 p1 ?- E) i" C4 t
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 E& b& \% X. A# h6 }) E; V* O/ c) S! n3 t
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* P0 q9 F7 d) n+ L5 q2 M, b___________________________________________________________________________
4 X7 U) w5 @' _$ c- U; d2 G% y c6 \! n! Y% J/ ?; D: W
4 b. i$ `- F& c. o$ O4 h0 _
Method 032 ~- A6 L+ m- G
=========
% N' h- T1 Z! [! [9 Y* n$ g! t9 l6 M$ [4 T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ l. u1 x5 `1 W4 Y s( V
(API Get entry point)
, {% O: Y" m' ^, M
3 A7 _8 L, ?% B5 |0 y
' n1 Q5 E& O* I1 H xor di,di
, j- z9 G# ?% y- T: e mov es,di
) A% r1 h& M1 c* W' S0 k( v* o mov ax, 1684h 0 r1 y+ y* V- F! W& d& c
mov bx, 0202h ; VxD ID of winice
4 {& U' Z+ G/ o6 Y( H int 2Fh, k* `; k9 J/ C5 j6 c1 m A8 j
mov ax, es ; ES:DI -> VxD API entry point: t$ i6 U7 Y1 B6 i! g2 G& t( [
add ax, di
* D# l, H' X( j; F5 i test ax,ax
( O( f$ a, J! z1 k: F% [! n. p jnz SoftICE_Detected
7 }# {: [) o3 C4 C) C8 o8 m
1 f+ t% }6 q& o% a7 y4 ]5 f! g___________________________________________________________________________
; ? n" l4 z9 _5 ]- H2 U4 {, Q( v# [/ N2 X" z# @
Method 04
) z" E" F2 d- W7 E=========
* Z. C5 h! g9 E$ B4 b# L9 y0 q$ d2 G& \! d
Method identical to the preceding one except that it seeks the ID of SoftICE$ B$ N6 Y$ ~ R ^. e) u( h
GFX VxD.3 \2 S3 X, e0 U1 Y
3 p; M) K- W( n" A! y( R( \
xor di,di
9 ^' ]* C! Y0 X: J9 ~0 k$ O. d1 o mov es,di. I! c0 Z8 r2 u/ c( N
mov ax, 1684h
9 @; O- l) @( X/ N& E+ d mov bx, 7a5Fh ; VxD ID of SIWVID0 B% G: u6 F" O0 \" Y
int 2fh* c; Q* y1 \3 @5 C8 c5 ]2 {" E+ b
mov ax, es ; ES:DI -> VxD API entry point) [! T+ I$ q' H9 T# k
add ax, di, M. p" m% x6 ?$ a
test ax,ax
& A% i' t: \ o3 `6 F/ d0 z: D jnz SoftICE_Detected. s5 k B& d; M# J" K
0 Z: I3 j$ k3 o/ L
__________________________________________________________________________
& C# ?7 \4 h9 ]) j8 |1 W
: }7 l& R. B5 g' s
% |& O4 I- c2 @( EMethod 05* p P$ U7 e" [& q/ u
=========
9 }; y% g/ G% r6 R) B4 o; Z0 I* X& t/ j; k
Method seeking the 'magic number' 0F386h returned (in ax) by all system; z. K6 C1 l9 C3 s, D' ]2 n5 q
debugger. It calls the int 41h, function 4Fh.
: [+ J+ Z$ V$ e$ y7 L" CThere are several alternatives.
: D& p9 r8 p) q6 C
% h! {2 e, C* G# C6 hThe following one is the simplest:0 V1 X0 q1 t( h6 |1 R9 f5 V
. B: C5 R5 B3 O% I: a8 W- q
mov ax,4fh
& h+ M3 f8 X* e0 R int 41h6 h4 m9 } n# k( V: U
cmp ax, 0F386' }# N% z: b% Z, l7 h% e% ^: y9 S
jz SoftICE_detected
: l% k# _9 }1 a5 h7 }8 Z2 R% a6 I% B; |
6 Y+ G3 H+ c# B/ ]8 j1 d
Next method as well as the following one are 2 examples from Stone's
; S5 R0 w+ A# j5 t9 J"stn-wid.zip" (www.cracking.net):
# R+ b& y, o& c% C8 J2 ]4 [$ c+ ^8 \
mov bx, cs
( q& V8 V1 t9 Q4 F lea dx, int41handler2
0 u" M$ n: W; ^' y+ X xchg dx, es:[41h*4]4 Q' z# }) _4 n: r% D, J; V
xchg bx, es:[41h*4+2]
) r9 U! W# z: f# c( o! A! r* ~7 v mov ax,4fh
+ J9 g, b3 m8 d1 p: |0 l2 v int 41h
4 _( B4 N3 _. h xchg dx, es:[41h*4]
' [. G7 s0 ~5 j: P7 r4 i xchg bx, es:[41h*4+2]
: m" H# ~6 [- o7 w- q/ i4 {1 {4 U4 O3 K cmp ax, 0f386h
8 C" g2 _& O3 ^1 F- A8 E) V: @& o @ jz SoftICE_detected
# s+ t: k$ Y8 m5 c1 L! [: e1 k5 f. F6 P7 t, b" v
int41handler2 PROC
6 S2 ^/ |7 V- s: w5 T5 o- O* a iret
3 n, d! W2 K3 f& pint41handler2 ENDP
5 L2 F5 O$ j8 ^
, [3 e" N' c$ U; H1 p4 [
+ Z9 f* u0 s7 O8 c_________________________________________________________________________. y; T7 v M2 c y
# D6 O) j. {* m% ^, ~% ~% P) _- S, ?' e' m2 S& e$ ~6 \1 b4 b
Method 066 _8 B6 w1 i; d- ^
=========0 m* T" u( \, N
u1 Y7 s; A2 c, h
# ~2 I7 e5 ]. g* [5 ^7 N) ~2nd method similar to the preceding one but more difficult to detect:
3 c/ o( F" O# y9 H1 a+ G3 x, h+ J
( G0 D2 A' V- s4 w. A6 L) }; P5 @" ?- p$ q% [5 I0 F% h
int41handler PROC# B3 w( l: a- H: N6 o+ k6 V
mov cl,al
g7 T; L) ?! M0 _6 \9 W iret4 N8 U& O& T# U, N3 ~& H
int41handler ENDP
! x' }7 n1 U4 B) @; @
9 h1 ~! I D3 ]8 `. {) n" X. g' y# T7 U& [7 [
xor ax,ax
) W; X" W' D# J4 ]- E* t mov es,ax9 G8 |/ x) [+ Z* H! D+ L
mov bx, cs c" F/ H- i, Z
lea dx, int41handler! c9 [5 e0 E' E- }( H! n, @
xchg dx, es:[41h*4]6 Y( H+ S9 z) W- p
xchg bx, es:[41h*4+2]
: ]9 y4 }9 u1 g8 S in al, 40h3 j7 X, [ a* C* W6 @4 F
xor cx,cx1 Z" O: F: d6 E; p
int 41h% p! D/ x2 w1 o$ K
xchg dx, es:[41h*4]0 l( U0 J& }( G7 c
xchg bx, es:[41h*4+2]
& g! l H* q' i* K cmp cl,al% S H6 Y2 P: F X
jnz SoftICE_detected' E8 S! ], `' I* C2 P) V8 a
# d2 c* Y* E& P+ D- ~2 O2 D1 {
_________________________________________________________________________
. E' A# b- E/ H. }& Z9 G' h t
% g5 B4 G+ ?+ }6 a; cMethod 079 d4 h* K" \- L5 j( @: r M: e
=========7 E% n g5 y* M3 d! B' i7 i
/ v9 _( V9 H( D9 y; [5 Y
Method of detection of the WinICE handler in the int68h (V86)) ?8 R' r; l4 x8 m* d7 ]) n6 K" R
2 I$ i7 L0 F3 x7 O. A& ^
mov ah,43h7 v# D) } _ h X
int 68h/ O, a9 L3 F ]' Z. S$ ~
cmp ax,0F386h
' O) E7 ?, }: O- g c# m7 M* H0 R jz SoftICE_Detected
6 V& G1 C$ L( ?
1 m/ ^/ n* P4 r8 Q2 q! S2 s7 m# w( F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: x& P* Q) j) V+ L5 u app like this:
# }2 m! y% l! |! v% C
" I% W: U) X8 m0 |3 l6 G% o- H BPX exec_int if ax==68
! w0 J E5 U5 D; c (function called is located at byte ptr [ebp+1Dh] and client eip is
! R9 p2 W9 p% ^. o7 y- U located at [ebp+48h] for 32Bit apps)( l" i2 g; y( K! S3 ]8 x6 _8 P
__________________________________________________________________________
1 r2 m5 G! b. K) A; T0 Y6 e2 {: |. @
) b5 ]$ s$ @0 t. U
1 e% `9 ~5 N# ?& o: P2 ]Method 081 p: v( ~/ A" u) ?7 H7 J _- E& \4 ?
=========
# z) C! b8 n; p, q# W0 ^
, f' d0 E T* A, s' pIt is not a method of detection of SoftICE but a possibility to crash the
4 w0 u' S* c! M0 A4 M( V# Usystem by intercepting int 01h and int 03h and redirecting them to another7 g( ?6 [& }( v1 t
routine.
5 U3 e8 q# ?( m* E+ H$ DIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 h g% L, ^; V5 L. Q2 u6 gto the new routine to execute (hangs computer...)7 }3 m' m0 ^( E
Y1 W8 i, n8 R
mov ah, 25h
6 U" Z/ r3 `: N9 `2 P8 @+ z# E mov al, Int_Number (01h or 03h)' R4 @5 T J, ~6 f6 l- O% j% ?
mov dx, offset New_Int_Routine
y! Z% G9 S3 S, U int 21h
4 c* Y! s1 R9 N% G9 V* N# v7 F# N/ P, J W h8 {$ N x" Q+ S, A
__________________________________________________________________________! r. g4 \6 X8 ]" z. g: H
) R" A8 u3 \- a! b' @2 C& d
Method 09# _- g( B# X6 ?, P1 \7 F8 H
=========2 |/ l \* y( m% M
5 X* A: |% L+ {2 T
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
2 K) p2 d' }- s9 L* U8 k! a xperformed in ring0 (VxD or a ring3 app using the VxdCall).7 g; N7 q, ?& n; }, |- h- h0 }
The Get_DDB service is used to determine whether or not a VxD is installed
+ j- i: M; z& E- v6 ^- a: G7 Xfor the specified device and returns a Device Description Block (in ecx) for& l' r5 y- A% W
that device if it is installed.& c( ~6 U+ J+ t/ S! ^8 E* v& s. w0 i
. z$ d% [2 s% w# K( ^, N
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
p. n6 E% C8 i( `- O% c0 S8 j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ ~7 Q" q# w; y
VMMCall Get_DDB2 X& F p8 |8 ?
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
% Y% e" x& l- a$ r, _
1 B Y% C r. nNote as well that you can easily detect this method with SoftICE:
, d6 C& J3 T* v6 K0 I @ bpx Get_DDB if ax==0202 || ax==7a5fh
# e$ R) u# H6 U S' l& i- c8 @- \( A9 ]2 G
__________________________________________________________________________6 E% H! f+ K9 K% `- o, R7 K
0 k. W, P! z' ]Method 10. l- G) s! d$ D1 T7 F1 c6 W' s; N
=========9 E# H- Q" V3 ^
' v) T/ \* k6 P& \" s$ |=>Disable or clear breakpoints before using this feature. DO NOT trace with& Q% C" R* A$ a Q( {# J8 P; L
SoftICE while the option is enable!!
8 C l/ F! F( b8 E* I' E2 w5 o! V$ s' `5 t
This trick is very efficient:4 i2 N8 D* d5 D$ i; J
by checking the Debug Registers, you can detect if SoftICE is loaded C3 m7 m' X+ b+ K! \6 }: n- x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' n$ q$ B g9 v2 h& F& t
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, K1 d# q9 a, X3 `6 T$ mvalue (in ring0 only). Values can be manipulated and or changed as well+ J5 |. f5 W3 b: p! U) q
(clearing BPMs for instance)
. w7 q* o+ p+ ] ]$ |0 {8 [4 L
$ E% U2 c: j- c, d0 k8 D__________________________________________________________________________
7 O7 C+ j1 }! m! N$ t6 a) d, O1 B8 [6 [$ p! H# M. r$ n
Method 11
9 n8 ~6 U- z: u( Z' R=========% C% ?4 l' W8 e$ v
. _% t! o3 o0 ^" B* c. a' R% ] P0 W
This method is most known as 'MeltICE' because it has been freely distributed- S% c" o" h( S) J1 r4 q
via www.winfiles.com. However it was first used by NuMega people to allow
8 c# S- k( K4 B! ?2 [: xSymbol Loader to check if SoftICE was active or not (the code is located5 K% ^* J4 o$ [( w9 u& e5 i7 I
inside nmtrans.dll).+ c/ x$ m' T; f- |+ Q) B
$ m2 U) h" x( ?8 aThe way it works is very simple:
2 x1 q. w! t1 `1 D5 x1 A7 C) VIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 s$ y( a- H* ~' {* C0 T `WinNT) with the CreateFileA API.
% O/ _! o, l; E) m7 Z5 `. D$ {/ ]- m9 T5 e8 c
Here is a sample (checking for 'SICE'):/ i; O" ^& w. l# n9 K' P
% |7 F* s; C* m5 }2 p& I1 l. P; v
BOOL IsSoftIce95Loaded()
4 m+ s" E) k. v+ }{
1 q& {) O; d; f. T1 `; w HANDLE hFile; W' D$ [, A5 c9 y, L+ t" K- T
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. U9 x9 b" A7 v" G3 x a, `0 r
FILE_SHARE_READ | FILE_SHARE_WRITE,
( S) a7 m; t( O- { NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 t8 w% J! C$ m$ J+ h1 h if( hFile != INVALID_HANDLE_VALUE )
/ u2 b. R9 u* e* a( p {: R4 z8 a3 z8 y, x6 O
CloseHandle(hFile);
; t6 @2 J: S* H! m, W return TRUE;# B+ ^- ~, N; U# ]2 l+ G) m- e4 P7 V
}2 k3 S7 Z! F9 w/ l& i, X/ ~6 h* [
return FALSE;
! [6 k, p ] `$ N: n" e2 k}2 ?- U% o' [. B) O
- A5 i% @) g+ d% ^$ r% qAlthough this trick calls the CreateFileA function, don't even expect to be
, s! D( q5 C0 aable to intercept it by installing a IFS hook: it will not work, no way!. M* I# m& s8 D' v* R
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 b& r1 v" b4 _+ ]+ Z5 Bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 }; { u7 w- o9 ~/ Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
" C( F; r% i) @+ l; ?field.4 K1 M7 L" q4 p5 @3 t& T/ K0 t# K
In fact, its purpose is not to load/unload VxDs but only to send a
/ z. K7 i6 h$ k2 d7 y& {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 S0 @" D3 J; t8 I% j$ r0 S
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: E* p- W! C3 ?$ M P" h/ eto load/unload a non-dynamically loadable driver such as SoftICE ;-).
; y1 v3 L3 Y! ^& _( dIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% E3 B! o8 I; G( O* Z: Z8 F0 Uits handle to be opened and then, will be detected.
/ I- A/ I% x; E2 \+ aYou can check that simply by hooking Winice.exe control proc entry point
: r) `- u8 ~" h' }3 R/ swhile running MeltICE.
! H& z6 w" o2 Q/ C4 J; y
7 j1 `+ l& W) p( C" W) n5 D/ D$ S7 @* z2 F
00401067: push 00402025 ; \\.\SICE
/ P2 K+ O$ v% q# A) C! k u 0040106C: call CreateFileA' [/ d( ]6 V$ h, y% U% ^5 h+ s
00401071: cmp eax,-001! K4 Q8 {) o8 k) H, _9 ~5 P
00401074: je 00401091
& u5 u, }& L5 T8 m7 n5 m7 c
3 P# Q" O; _; {3 C7 r0 s1 M* L6 P8 |5 h8 }9 @7 ?- w( y
There could be hundreds of BPX you could use to detect this trick.
1 r# D4 F: m5 W! ~8 E T-The most classical one is:: Q0 c; L3 l* q7 a; O# V; |
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 r# e& r/ p& z *(esp->4+4)=='NTIC'
. C/ Y- B8 ?2 l- R8 t
5 W( A. `. t# Z% y# s) |3 l D- g-The most exotic ones (could be very slooooow :-(
/ i# d+ _. Q; ~; c4 b& z* P BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
& r1 `* P9 v+ I( ]5 T$ p# u. P ;will break 3 times :-(
& f9 `) s% b: J) r, }
: ^$ }* K! N% x0 P# i: f8 y-or (a bit) faster: ) a9 d: Y7 z8 @$ h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 Z9 W, o2 w, `6 |3 v, X
3 Y4 e, @. H: E$ r& @ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) ]" M, J" m d5 p
;will break 3 times :-(, K. F+ i1 }( [$ o$ @' ]+ w# r
0 g' m( y2 m# ]7 r" P$ W-Much faster:
( m5 h8 `4 ], Y; L( Z5 z( |0 n BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 B7 _. I. Z% M
; @5 _1 r* f8 e' W/ B
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen+ f9 M% }/ N9 r: w
function to do the same job:# S, [) W# X; l( Y3 O5 d
: g: r: O4 Y' z% H6 O
push 00 ; OF_READ2 a. {8 g$ r$ W" f( K, g# q2 d7 f
mov eax,[00656634] ; '\\.\SICE',0
& ^" [6 z0 L: w" C6 w push eax
0 Q" E/ z2 I; [7 S6 Y* p call KERNEL32!_lopen
8 o$ k( a8 w: a0 a2 G O, {" ] inc eax# S9 v3 ~" g$ [/ A
jnz 00650589 ; detected
; I, R! F! ?9 f! n& j push 00 ; OF_READ
$ ~0 s: q! n( ?# i& Q; ?7 T mov eax,[00656638] ; '\\.\SICE'" Y6 I2 |+ T' d8 G
push eax( r W ?! [/ ~& M9 R5 e; t
call KERNEL32!_lopen
X' r M6 ^! T) o5 V, W inc eax
! D# F4 H* ?$ h+ e, v! S. ] jz 006505ae ; not detected2 P/ z7 U. n( o5 D8 }1 v
5 D/ X9 I8 w- L) l0 v3 j0 X( g: k. R1 C- J- c3 k! ]
__________________________________________________________________________2 h y! d$ z3 P H# d6 \0 c6 b
# m. D" S9 ?5 @6 h
Method 12
' A2 I7 H! E* P8 T5 `. L=========
8 ]. R) r; E, w1 G7 G; z" `, P4 ~ @2 p) W8 C
This trick is similar to int41h/4fh Debugger installation check (code 05( A" C# Y9 {. I# H, p4 h* \
& 06) but very limited because it's only available for Win95/98 (not NT)
6 V5 ^8 o3 f' F3 x1 Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! }% ^' U- X# v0 V
1 W4 B6 T% K9 V. n- E$ o) Q push 0000004fh ; function 4fh
# Z) V; D) [5 a push 002a002ah ; high word specifies which VxD (VWIN32)
% ]( P) y U7 F% ? ; low word specifies which service
' t! ?2 d1 h2 j2 \/ R/ M (VWIN32_Int41Dispatch)* |+ }8 q" o6 m& d3 V0 L
call Kernel32!ORD_001 ; VxdCall
& k0 `7 c) `1 f* B- e P cmp ax, 0f386h ; magic number returned by system debuggers3 z: r( p. @6 L- P9 s! L
jz SoftICE_detected
3 L! r1 E6 @8 o# T0 O8 b% b v! [+ J* i& C; C6 t0 x7 l0 v4 J
Here again, several ways to detect it:+ W5 k/ j0 S1 f1 W9 q( V
* m. _1 [% U, j! L BPINT 41 if ax==4f
$ X$ Y% F) ~1 k8 K8 l) h5 ]6 A& \4 c7 F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" B+ {. \# ~0 N- C3 b
$ c0 N X; P, f, u! {/ r* n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) ~, p3 [2 n! m+ V- m
4 w5 _* T) W; o BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 n. h4 W% m* p6 ~1 s4 @& \3 K9 t' s$ t2 u" B
__________________________________________________________________________1 t7 K; W5 a. \7 h# m
' j! ?1 Q. X6 |Method 13( w+ b* l: W, C
=========. ~2 S n2 l4 ]9 L8 }8 y1 |
" B* Z4 P: q& q( A1 u* V2 z# GNot a real method of detection, but a good way to know if SoftICE is
. G- |1 R! @2 M; P6 \% w. [installed on a computer and to locate its installation directory.( A: K# _# `- f1 n1 \
It is used by few softs which access the following registry keys (usually #2) :
1 F3 l& @7 R7 H2 \* |
( k. c, V/ U. g" m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( U3 z6 S) M% }# |* g# w
\Uninstall\SoftICE
4 N: w% q+ l' d w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) G: k# v6 k$ c/ ]' h. e-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! V, e" h1 _3 [' ^7 _* p: J M\App Paths\Loader32.Exe: A/ Y. ~$ V7 j5 _; ^
+ U1 U. ~+ Q/ E1 I* ~5 x$ W! C
. m& ]2 S& U: e+ YNote that some nasty apps could then erase all files from SoftICE directory* U5 J! G9 E0 f/ x" c
(I faced that once :-(7 a& ?$ S0 h( ~( [ U( _
7 t' Y7 V: }5 z, u% m$ ]# @( PUseful breakpoint to detect it:
1 O8 ^* I. t7 r1 P. h4 b1 R
# u& q# x4 |) {3 ^( S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 i1 L3 j/ J( V7 J0 J% S
" k J! C* x5 b8 `) ]7 p__________________________________________________________________________/ Y6 A) L+ x: d
G. e! z0 K- ?) h4 a" N) g
/ }; F) F( [ e1 y, Y* XMethod 14
' `% V' x: u4 _2 F. d- X4 v=========
6 `$ c. @9 Y" c% ~4 ^& V( P K/ V8 S. N9 u! k4 T% O
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, G" ?' U: A9 S/ B% a2 O( ?8 q
is to determines whether a debugger is running on your system (ring0 only).9 r3 S# p: g6 k3 D6 C. \
- M$ p0 f# f2 ]+ M5 m$ L" F
VMMCall Test_Debug_Installed7 N2 a, y5 F, I3 F4 o3 _: l0 L- _$ P
je not_installed
; i# `/ q& J. [1 p9 P
/ ]% \# R8 P9 R) Y; E# iThis service just checks a flag.
, `% \: q. f! X+ f</PRE></TD></TR></TBODY></TABLE> |