<TABLE width=500>( n: q7 |6 |4 k2 [7 N' e/ D: U1 b
<TBODY>
/ }+ H; x$ j: o$ e<TR>; b2 {& i4 Z% }; U# ?6 K, m
<TD><PRE>Method 01 4 H) x" w9 S+ L
=========0 I9 m/ Y( i, h7 b/ y
' B8 L7 B: n/ D- X Y
This method of detection of SoftICE (as well as the following one) is9 P* N3 I: H* z, V
used by the majority of packers/encryptors found on Internet.) t) l) v( J# i3 I
It seeks the signature of BoundsChecker in SoftICE6 u+ ~3 s1 `2 g2 j# V6 X
0 K, v4 `- r9 b( J9 {$ x
mov ebp, 04243484Bh ; 'BCHK'4 H4 [6 s4 W5 Z d9 \* G5 g( O
mov ax, 04h2 ~8 W% z( _6 d1 V. s4 X
int 3 8 T2 y* |9 J, U$ |! O( C8 z
cmp al,45 Y2 [" Q" `& S0 H+ z+ U' w7 A
jnz SoftICE_Detected% M: _4 @! \. q8 A1 a
0 E! H8 G) T5 L! m3 i' n- ], x3 Q$ J
___________________________________________________________________________# C) I# H, k% b; }, F
4 n7 V6 E, @ U* R4 W! u" BMethod 02
: `, j# p# a0 b# p* Z=========
2 R% l" b8 w) M+ @/ `( j0 B% R, c1 e3 d' i" N. H& H
Still a method very much used (perhaps the most frequent one). It is used
! T, g2 I- b# M! M! p: W d* oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 n& @+ ]+ L' k- {* U! R1 `: ]+ eor execute SoftICE commands...2 ?- C% `3 ~# @% f, j
It is also used to crash SoftICE and to force it to execute any commands
# k+ O+ y; i' s2 _: Q" X. O& @ E# N(HBOOT...) :-(( + p. U# v# P$ d& h1 R7 E9 ?
. W9 M s$ J. U3 h
Here is a quick description:
- B3 C+ o. w3 K$ K2 s-AX = 0910h (Display string in SIce windows)& [4 l6 h' l& x3 b* x3 k) v1 S5 p
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 d: t1 Y" H. R1 r1 C-AX = 0912h (Get breakpoint infos)5 N! J/ Q" ^6 [: i2 b" F. o" `
-AX = 0913h (Set Sice breakpoints)
9 |1 R! X7 J. S# @4 y) F: d-AX = 0914h (Remove SIce breakoints)
2 |6 D, o( C' t; g/ ~2 A: C$ l# q1 w. _
Each time you'll meet this trick, you'll see:
+ d, k% X- f5 j# L2 Y& F& j" \6 h+ p-SI = 4647h( m* |) V' a; y% W$ B$ Q6 x k
-DI = 4A4Dh9 ?* ^2 g" A- s4 i2 M" G' E2 r
Which are the 'magic values' used by SoftIce.3 b# Q* [! U1 Y6 F8 q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, L0 A! i" a0 V& j; i! X+ _' v( {. g8 \$ ^/ A! B
Here is one example from the file "Haspinst.exe" which is the dongle HASP, s0 e9 \* Q0 t* N# D* Q# X
Envelope utility use to protect DOS applications:
, W, K: Y* P' o8 @6 Y
) `5 S+ u ~8 q; `6 y: V: l" N0 Z, @% @! V$ V! o# J, y
4C19:0095 MOV AX,0911 ; execute command.
8 P* i& Y \2 v4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# V) D& b& Z# Y4C19:009A MOV SI,4647 ; 1st magic value.3 N2 B( x. B" @4 B
4C19:009D MOV DI,4A4D ; 2nd magic value.: Z& g6 z( b$ B" u; W( K
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' v4 N1 v( a7 z
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; o# q0 C- e$ A
4C19:00A4 INC CX
; X$ @2 m8 o2 J w0 m4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" ? w) \; K( L
4C19:00A8 JB 0095 ; 6 different commands.
% t" ^1 m: A9 Q4 a5 E0 ]4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ c- ?: y) f6 R$ |4 G, b
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 I% S/ C l$ i2 V. D8 h( I% n
5 X5 A) b$ k1 O. p5 n6 a; u
The program will execute 6 different SIce commands located at ds:dx, which. t- {$ N, {( l) d) O7 T
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; E& w, W8 A! j7 {0 E
5 P+ [1 W2 o* I4 V& L8 L# Y7 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 i9 \2 z m& O" c8 {1 t2 `___________________________________________________________________________
7 |0 u+ G2 C# u. G3 m ` [9 O2 m* y! z) b& h
- E! G# S g2 t
Method 03
4 h3 K* H) n! Z' h=========. B4 q. F7 i5 ~* ?+ w
' J9 u; O7 M" I+ O1 t' }+ j
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 k; [9 p# F4 L! d+ J
(API Get entry point)
5 S5 G( l2 V, U! O g8 K / L6 }1 b. V# ?
* V) h/ \: v" J' |# X: z2 u xor di,di
8 k/ l5 Y4 g9 z: [ J5 `: ?6 @ mov es,di
) [$ S; O% B0 p1 ^ mov ax, 1684h
9 }* u2 x" G& ^ e mov bx, 0202h ; VxD ID of winice6 b B, ]/ ^- N! g# l, u& I5 P8 e
int 2Fh
) \" {$ a, B. s8 _5 q/ D, Z mov ax, es ; ES:DI -> VxD API entry point3 y- C# ^/ _6 C$ \
add ax, di
8 `3 b( F- y4 J! |' q+ ^3 ?6 T test ax,ax- z% K) a3 b1 V1 V1 `& }
jnz SoftICE_Detected b9 Y+ E5 c8 r! f# H a. D
0 H" {) A- ~+ h7 I8 Q0 K. r
___________________________________________________________________________
. c- S# k% [$ _+ q( }/ }) |& {- b2 B* H# s5 B: P E0 \
Method 04" K$ ?! ~/ ~& L( X" U1 v
=========
3 Z- m. d4 u& @! h
( u% r0 j, X9 Y/ gMethod identical to the preceding one except that it seeks the ID of SoftICE4 m/ u$ B1 W8 h; l7 k/ _
GFX VxD.
2 \7 t: s! N5 E |0 H$ ]
% z% d6 J9 o3 W xor di,di% V9 g- W4 Y& F' s, H* v4 V
mov es,di
% K" @" i9 x1 }7 I/ B9 v' P( Z mov ax, 1684h
- P! c% m d1 @ n' i% M$ @ mov bx, 7a5Fh ; VxD ID of SIWVID
: G: d: Q) g+ [: l& s/ M int 2fh
( v+ [5 n( O$ V mov ax, es ; ES:DI -> VxD API entry point
! J. L! d) i0 v8 `0 n# X add ax, di
! C$ @; T/ l, r) |. y2 b4 O test ax,ax
2 w0 }5 v: I/ x4 ?7 V* F0 T9 N$ } jnz SoftICE_Detected
' p" X, C) h% @4 v2 P( W9 J
" ?8 p; E: I/ k0 X6 p( }3 d+ a__________________________________________________________________________
3 X! L- q. [! w2 d
$ @! \3 s. d8 P" v, g B- J
& m8 ~2 s1 e# Q$ C" e: q6 l! RMethod 05" y3 h* z9 M# Q% n8 P$ v) t. v& w
=========( _1 h! [0 _4 [
. Y! Q9 I7 s2 G
Method seeking the 'magic number' 0F386h returned (in ax) by all system& o( b+ |+ J0 x$ s1 b. w. U" {; R" C
debugger. It calls the int 41h, function 4Fh.
4 k& Z0 I2 U( w1 @8 h% o vThere are several alternatives.
' I4 _: u5 @+ U% w8 w: c; T
5 y4 P- I2 B! ~9 zThe following one is the simplest:
- h8 M: g; Y4 f' e% o% {. H1 W" X1 k _
mov ax,4fh) j5 k; z) H5 R/ e4 R0 a, D
int 41h
% B- ` y$ {' d* d* X cmp ax, 0F386
* l# T1 f$ ^4 J' k8 _' M jz SoftICE_detected* K$ ?& f7 E: P8 @, K* [. M9 S
% P' T: F! S/ N& l+ z8 T9 w$ `' C# t( \- Q* t# C( V( D" v* A6 n
Next method as well as the following one are 2 examples from Stone's 7 _5 E$ P# h8 v3 y$ j+ g" p
"stn-wid.zip" (www.cracking.net):
' _ H$ z: m+ {+ u1 c9 m# ~3 b2 t# n- i, M7 {5 C- C9 B
mov bx, cs
5 P) Y% L* v3 E1 m9 W( r8 N% U lea dx, int41handler2# m5 U; c6 s+ o' p1 D2 t% F7 u# _
xchg dx, es:[41h*4]; A# W" Q8 n8 f5 m) J/ a9 ~
xchg bx, es:[41h*4+2]' {4 S [0 l0 z$ M
mov ax,4fh
5 I! o. f" t1 `9 O' f int 41h
! S9 o: H8 B: }( X- c xchg dx, es:[41h*4]
# M% K0 f0 {7 K" \ xchg bx, es:[41h*4+2] r: p9 B* S$ ?
cmp ax, 0f386h
* @1 \3 ~+ N6 ?% ~( v9 U _$ V D jz SoftICE_detected
! \3 T" X; z9 ?$ C; h5 J+ F4 X4 J3 J1 j+ b
int41handler2 PROC9 B' H/ j6 q6 M9 F) D
iret# _/ \/ h5 P* I$ f
int41handler2 ENDP
1 E1 S* j, l8 M2 e# b+ l! E
. {; b5 u" U$ }' b& U3 b2 n9 e, b& u1 R, [! O6 B
_________________________________________________________________________& a4 g9 ~6 ?( }% }7 r4 [. [! {
9 G8 e. }$ w2 v* M
. {; x1 o& f; f# SMethod 06% \, z& N' F ?/ ~
=========8 J. ` z4 c* E; L
3 C$ y, O2 J0 O
5 w3 @* p$ l- D6 p6 G2nd method similar to the preceding one but more difficult to detect:7 Z) f+ a: h1 [1 J) F8 [5 k
3 b& d2 t9 |9 N$ I- E7 c, t" w. b
e: E3 P, q) x; W
int41handler PROC
( `' F9 `* |; F mov cl,al# `) k, z, n1 i8 T
iret
; p" [! }! r& r+ @( Bint41handler ENDP6 \$ ]( l5 I' U: D/ G$ Z. v2 k
5 j+ V6 b/ P; ~: V' u: m2 @
( z, A# f% L, ?- I* [
xor ax,ax+ S0 C. K! X9 A. Y' r
mov es,ax/ W. q# B. M, m$ N( b
mov bx, cs& ~3 L( [! D& v) f
lea dx, int41handler
& e; ~/ S# @+ L% d xchg dx, es:[41h*4]
* d6 r; R9 E k0 \+ ^3 ~8 z) [) @ xchg bx, es:[41h*4+2]
C( j5 H7 h. ] in al, 40h
" l1 g4 F, c2 ?9 N- r" i: m xor cx,cx
1 A: y/ ], z' @7 M- p int 41h9 x; L# A3 E2 M
xchg dx, es:[41h*4]; a5 V0 j6 ]7 B$ d# H/ _" o) A
xchg bx, es:[41h*4+2]3 S4 \& \# R9 p& J4 G, r& @
cmp cl,al
# o1 Z: t+ x' G# w jnz SoftICE_detected& j: ?' \1 Y5 r& A: B7 y5 W
@6 X) X* g d) a$ w0 L+ L
_________________________________________________________________________: t; W, k% ~, W, ?, P
! X; J/ v8 m7 C7 b& {& ~0 k
Method 077 t6 R- @0 c0 g% r6 h
=========; H2 J. X. u& I
6 l. z+ |8 w( L& e9 y- U- W% f
Method of detection of the WinICE handler in the int68h (V86)4 k5 v# H, g4 c0 H
, l2 c. D# P e3 e mov ah,43h
0 m# ]6 n' N! y! U% ~ int 68h
- ^7 `+ z# F" q: ~$ g cmp ax,0F386h6 W/ ] \. s& k& x/ }
jz SoftICE_Detected
- C, o9 _3 t H, m$ ~
{" Z5 o/ @. a1 S7 f3 I
8 K( S2 x* k3 K: ], w$ A=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, X0 p, o8 f' v0 ]. J: H8 q1 F# ] app like this:
6 [, {4 H# W4 e: \# ?
4 `# n" D# |+ z' Q" e) _% y+ F BPX exec_int if ax==682 L1 E7 y8 d5 h6 \; p2 N* _
(function called is located at byte ptr [ebp+1Dh] and client eip is' Y* |5 w: E3 `' v- {
located at [ebp+48h] for 32Bit apps)
: [* c" L V: M. x, }__________________________________________________________________________
* f( f5 r: N( z( L( z3 l% R- `( }2 G1 a
" w5 p3 ~ a& o3 Y# W2 oMethod 081 m% c$ u* q2 ^
=========
4 U& l5 ]3 t+ u: U; M$ t% _
# ?/ d) ~2 |4 gIt is not a method of detection of SoftICE but a possibility to crash the
3 h3 S0 `$ v" n- Msystem by intercepting int 01h and int 03h and redirecting them to another
( F2 N: S/ G% t* g7 v) troutine.
4 A/ l7 K4 S' V0 YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ I I6 f- D( i8 `5 Z+ w/ h+ o
to the new routine to execute (hangs computer...)
& K8 g+ r' j9 l1 Q/ c# V
; k# T# H0 n- U& l mov ah, 25h
2 Q( X0 b4 ?$ h6 y9 K; C2 O mov al, Int_Number (01h or 03h)1 s! I* t- c6 |
mov dx, offset New_Int_Routine& u# {: Z# P7 J9 R6 o o, c
int 21h J7 ~, m0 n( l* p- P4 h* z) g# K4 d
" J# C/ p* @5 S__________________________________________________________________________4 Y* p6 E' \. r6 d
' Q& W* \ k u$ r
Method 09" W+ E; O: y8 ~9 N2 t6 |
=========
1 j( h9 ^$ ^( F! q
3 f- q8 \6 e9 Z3 a: QThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 ?! i& r& E; h8 A: W1 fperformed in ring0 (VxD or a ring3 app using the VxdCall).# w8 w7 Z( m& S7 z8 @7 b# s1 A' Q
The Get_DDB service is used to determine whether or not a VxD is installed
' _+ u# e+ K/ k/ a% x; L) Cfor the specified device and returns a Device Description Block (in ecx) for' n, z- Q- ?! B* n7 t- Z, o
that device if it is installed.
/ @! X7 G6 Y- S" W Z# ^$ Z
3 {' {" m* g$ {1 ?: i mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 t6 K, F% Y) k0 {2 S/ T% z0 c mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 ~! o; h) C& B9 V2 d2 ^/ t VMMCall Get_DDB! y, @- K" d0 q6 ]/ n$ @2 i
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 U) j+ ?4 @0 ^ s- z
1 V0 Y( Q0 I* F/ s: u' W1 V, K# b
Note as well that you can easily detect this method with SoftICE:5 g7 z8 I+ V% F' h) @* q
bpx Get_DDB if ax==0202 || ax==7a5fh% Z( {% {8 J/ @: |6 g- J( b
1 }7 u% s3 L6 P- N @ e__________________________________________________________________________! P; O& o+ K y7 N
7 D/ W6 `5 T5 S2 ?: I) k8 t+ {
Method 10$ f) i4 \. e2 [: K, Q
=========8 D/ C/ `$ W8 _* L( U
" }, o3 @: L5 S# f @& Z=>Disable or clear breakpoints before using this feature. DO NOT trace with) l& U5 p7 h2 [0 V
SoftICE while the option is enable!!# m, G( C5 E2 m/ e2 t9 z9 z9 _
7 Z: ~) m; N9 d5 P$ M
This trick is very efficient:, Q( z% a0 W2 z, l, ~$ e
by checking the Debug Registers, you can detect if SoftICE is loaded* J% l6 c8 ^; X- b0 ~1 `8 [) b$ X" y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 D7 {* O9 x# o" ~- H) Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their
4 O! c, t. D' T2 G* |- m* Xvalue (in ring0 only). Values can be manipulated and or changed as well
: C' M: t$ D# |(clearing BPMs for instance)
1 m1 F/ _) S s" b# H9 H& O% J3 V4 B/ K' |5 Y' Q& V
__________________________________________________________________________
: o5 c$ Y. b0 Y7 A& K+ s* C6 K% m1 c. W. W- W1 e
Method 11
. |0 Y( Z- V- H m========= U* b9 H) B$ M/ w9 p; d* y( Q+ u
# [* _" ^6 v" {( iThis method is most known as 'MeltICE' because it has been freely distributed$ ?; F; J! N) z* ~
via www.winfiles.com. However it was first used by NuMega people to allow
) e' ^1 ?7 I8 h7 q$ |9 ~2 A' g h6 sSymbol Loader to check if SoftICE was active or not (the code is located" e0 b$ }+ [0 V% e1 \5 L3 [% \0 u
inside nmtrans.dll).: S- h5 i9 P- C
' V4 K% z# b% m4 m( t& ~The way it works is very simple:6 j4 t) B: {' G( I. A! q0 @7 ]1 M
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for [% K4 V$ i F7 f& z# ?
WinNT) with the CreateFileA API.
* Z- h% {& x) u: W3 e+ w# L$ l' }. h% e
Here is a sample (checking for 'SICE'):
' t& U9 W, w! y1 D( r/ C w' X2 B! J1 t$ p3 x) D0 `
BOOL IsSoftIce95Loaded()
* }5 |! J4 Q2 l. t{8 @5 i) G3 l& I# j3 {6 I
HANDLE hFile;
/ l U' z! U2 L! @1 n3 r3 b hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 C* x2 x) x" A2 v
FILE_SHARE_READ | FILE_SHARE_WRITE,
" x4 `* M0 ?6 |& ?0 H& E NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& b6 {, b; K" ]# L6 {3 x3 R
if( hFile != INVALID_HANDLE_VALUE )
' e: ~. G& Y/ Z z: m {. E0 R. U: o* g$ n
CloseHandle(hFile);
; {/ Z8 t) n1 @ return TRUE;
" B3 b7 w. Q: T( K) I* q }
" x& I: F- O% n% N6 I2 Y) U5 x return FALSE;
2 T0 Y9 z# Y5 K, R; O" E( {$ F" r* [}7 F' q0 ]- M7 e4 U
7 o$ n) |) x' C% rAlthough this trick calls the CreateFileA function, don't even expect to be3 Y9 t* d! }% |! b2 h
able to intercept it by installing a IFS hook: it will not work, no way!( e! N. i) q6 g( A" M" e
In fact, after the call to CreateFileA it will get through VWIN32 0x001F* [5 S. e6 B% o
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* L+ w- f1 z2 _9 C) J {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! W1 t/ `! u) i* J( b6 ^9 U4 Sfield.
3 |8 M4 l% b/ ^/ j6 j" i* VIn fact, its purpose is not to load/unload VxDs but only to send a
! j+ P: z5 i- kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' Y, l& p6 E2 \ B0 E; |1 k) Mto the VxD Control_Dispatch proc (how the hell a shareware soft could try, N7 n: ^8 r. P1 d! e: o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 w- `1 ^0 b& AIf the VxD is loaded, it will always clear eax and the Carry flag to allow H) J; w, Q+ R3 h
its handle to be opened and then, will be detected.
" G% X; B$ u: {& f" W1 EYou can check that simply by hooking Winice.exe control proc entry point3 m0 z" x7 c6 Y
while running MeltICE.
8 M) y- b( a6 B+ {0 p \2 Y2 J
7 E7 q/ X$ D- A8 {& {; ~; i
3 q l5 |: ]+ I' T- [" v7 z 00401067: push 00402025 ; \\.\SICE
+ {% ?1 n* @4 @, y 0040106C: call CreateFileA
% g) ]$ y1 z' T4 F 00401071: cmp eax,-0013 d6 `- {! ~$ ?8 d4 C
00401074: je 00401091/ ^1 c3 t( S/ Q4 {
4 t# z" u1 z6 D& o: E3 X. M3 R6 o( K1 r* @% k, k3 [" H* @) j
There could be hundreds of BPX you could use to detect this trick.
2 [1 g" l6 l- a9 R. c-The most classical one is:5 m" [$ {' ^. J
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
, @3 Q+ p: r) F& b *(esp->4+4)=='NTIC'5 I: m5 t; ]+ \9 s8 x8 g( X: A; I
7 P5 X4 ?: D1 z-The most exotic ones (could be very slooooow :-(
! B# E. P& n5 c3 B4 T: g BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') l: V% z) T5 \9 T, G
;will break 3 times :-(. H$ h1 J$ }) v6 j5 h
' i( w& M' P$ \$ w; Y+ ]. I
-or (a bit) faster: " C! \' k4 J% d4 j7 y# \
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- U, ]8 F% R! R
, R+ _6 | a# b6 j0 `9 q BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 z: s. r9 V( B
;will break 3 times :-(; M9 v1 l0 y) q4 K' n0 Y7 f
" u# g! M; Y8 p
-Much faster:0 f0 x/ @8 N0 E' j( y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& f4 B0 b3 v9 f0 j% j8 S
: e* c( u' g% n( P8 F, b' FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ ^0 O: m. x4 e* q1 Ffunction to do the same job:
2 L) U( l8 c3 G# |
" f, D, f; Z6 B: e) i# B push 00 ; OF_READ
" G( |% D9 F/ R A& l4 U! E& B& v mov eax,[00656634] ; '\\.\SICE',0
, Z9 C7 M2 H2 p push eax
- V+ a; z5 }% U9 O, I call KERNEL32!_lopen; N% S, D+ d7 U" W
inc eax
9 i3 d5 F" P+ u jnz 00650589 ; detected
0 }6 ?5 u) A) ?# q push 00 ; OF_READ/ @# a; W! l" r/ x
mov eax,[00656638] ; '\\.\SICE'
: p* a+ r _8 d5 c) t, Y push eax
; h6 ^% q; C: {. Y/ }7 F2 j5 W( ? call KERNEL32!_lopen
- R# C/ p) t( c) c% c& p7 f1 W inc eax
: C/ \7 p5 d/ p- M* N& E5 r jz 006505ae ; not detected" g V' _$ p( L: j. Q2 w
5 Y H1 u2 E3 l" ?9 x* Z; J! ^5 [' k) a
__________________________________________________________________________
5 Y/ q- B6 ^$ o5 H
! A" U, m8 Z, a: nMethod 12
+ C F1 H+ I. {' z% N, J=========% |% R7 u' k) e' q
1 t0 j3 D% C4 }6 J0 l! I9 l' Q! Z3 g" k
This trick is similar to int41h/4fh Debugger installation check (code 057 M9 V) H) ]3 B
& 06) but very limited because it's only available for Win95/98 (not NT)
" w9 ^3 M3 E9 t* y1 g7 C8 Mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% ]9 r/ v+ Q; C% |" r* q3 ~2 m+ y$ Z- t( V' o r( X& u
push 0000004fh ; function 4fh
2 q3 @# w7 x* O' M* a* N Y push 002a002ah ; high word specifies which VxD (VWIN32)
, c9 [# E) H _1 _9 b ; low word specifies which service
" t. c2 J. F; ]: }, B (VWIN32_Int41Dispatch)
# n9 k( H) t: {5 P1 I5 Q5 Q call Kernel32!ORD_001 ; VxdCall
$ {2 N8 j) L5 _7 b* X! a0 H/ C cmp ax, 0f386h ; magic number returned by system debuggers
6 B8 w& \, h# [. m' w jz SoftICE_detected2 X& q5 g% A3 O$ C% p; V) U' d
- Z8 L* W, {/ k, o7 R0 H! XHere again, several ways to detect it:
6 _8 b$ `- S/ t
. o9 g7 E- V: e) E BPINT 41 if ax==4f7 ^ f- C" S$ t
5 Z8 L$ y! ^& L% }9 B7 i BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; n/ v. d& y- b# f1 y1 D& j7 I& a1 E* E
. V3 Y$ \2 @% u8 j# q E BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* R. F6 M. o0 Z; i9 o$ Q9 [3 c# @ a* {( m$ v& [$ t
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% e1 P- P$ g5 ~: u, H
, K+ x9 b! R2 T5 J4 W
__________________________________________________________________________
! ~1 ?) _8 `2 b" n1 f" E. w0 v9 ~" |7 a8 s6 L8 G) z1 x0 j
Method 13
2 V/ D9 ^. N: t# X& v5 S& \% \=========
* p1 n* H4 w, g. p& v+ p1 l
5 j) f8 T! w( F- B$ rNot a real method of detection, but a good way to know if SoftICE is7 b, o8 V& C. O7 n
installed on a computer and to locate its installation directory.
! ]8 U% l0 \# p* J7 RIt is used by few softs which access the following registry keys (usually #2) :
" s/ \2 Y: `+ Y2 z/ ?) @) v% a G. H$ z, n% y# E5 v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; U$ L% k/ Y: h* v) u\Uninstall\SoftICE
$ n) z4 V; _. Z5 l# {& [/ I: d-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 P( H2 e) {) b; H( d4 y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* D$ W' o G7 r& m' s% l5 O\App Paths\Loader32.Exe6 t1 _7 O% b9 o
* j4 U# L+ O7 x2 H, M* Y# \4 u$ R
0 v, m p! \2 r( j+ O5 KNote that some nasty apps could then erase all files from SoftICE directory
% p: V+ a( Z" p(I faced that once :-(' ?, F2 O) d2 j
! j2 J* W; }, G9 Q2 X R* GUseful breakpoint to detect it:
. I( p: P4 z) m* D$ f& E8 i2 R0 k( o1 I' m7 D6 c# d! J2 v% W1 C
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 h( \ f2 o) V
7 d S n& a0 Y% z, Q* }1 [__________________________________________________________________________
' X0 l. G9 c; L' z) J! x+ H! [
" p. X/ Z* G, M1 |5 Y& I* w/ T* H& s1 w5 z" F7 a7 }, |
Method 14 ! v4 k0 ~: K) V% J1 e
=========" d5 m+ i7 A$ G( u& F2 P
5 N7 x& A8 }0 p, G. H: [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. H3 B) i6 @' ~2 t5 k+ qis to determines whether a debugger is running on your system (ring0 only).
_7 |" K1 {7 t
1 j- b& x3 a+ }9 _2 v6 N. `& x VMMCall Test_Debug_Installed
- @5 Z" M; Y a8 a# ^- @& f2 {9 z je not_installed( \! p% ?4 `* p# V! m& {
) ^% l! C9 l. T9 m
This service just checks a flag.5 j/ I f& }% M0 r$ v* a# h* q$ @
</PRE></TD></TR></TBODY></TABLE> |