<TABLE width=500>
+ m7 n7 R+ n) j$ t8 |; x<TBODY>
$ Y# \( }5 C8 C5 \% F# `5 @<TR>
7 _2 |1 K( p0 ^7 o4 s<TD><PRE>Method 01 + w1 r3 ~0 J. |- V& B/ I
=========& B7 e7 r1 s( p+ Y9 D
* b0 B; `/ G. ~; p2 ^ C9 ZThis method of detection of SoftICE (as well as the following one) is
* `% E1 W/ D5 u% }+ _" Sused by the majority of packers/encryptors found on Internet.- E4 Q5 V$ j1 E: K
It seeks the signature of BoundsChecker in SoftICE
7 u0 x" A. [7 t- l2 S \# y L. o: c7 H( p: M
mov ebp, 04243484Bh ; 'BCHK'7 b# h {0 t' i# Z% |# Z! O( W
mov ax, 04h% ]1 k% N7 {7 h* \
int 3
! Q& P; _# V v5 l T# n4 z cmp al,4
+ V$ z- l$ C7 N3 Y% s jnz SoftICE_Detected0 s. I( E. U* [6 K G% m# p
1 A, u+ E+ v3 f) e) R- w4 y. P ?
___________________________________________________________________________2 g. @8 P/ m& c; H
6 ?" ]7 E2 n6 B% AMethod 02( R2 M6 g( h8 ^& Y7 d( f# g
=========' f6 `. ?# I4 \/ ^7 a1 W8 F# T
* S, r" C5 \4 `Still a method very much used (perhaps the most frequent one). It is used
2 \+ w. M# x) @8 e- e- {7 nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 \' ]; v9 c& Y" [5 L# o; q
or execute SoftICE commands...; F# s$ X5 _9 M2 H( q: o8 B9 k
It is also used to crash SoftICE and to force it to execute any commands
7 h! o5 I3 x* {# q(HBOOT...) :-((
9 g; ~. W* h, m9 `, V# J
9 r' K# }5 d3 s0 m8 T+ cHere is a quick description:4 W" n* } r+ {/ F6 L: j4 ]- z
-AX = 0910h (Display string in SIce windows)+ ]" k5 T5 i \7 n: C% k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" R% V! D$ D) w, D; O-AX = 0912h (Get breakpoint infos)9 ^# ]. G7 `! P( K- s( z# e ^
-AX = 0913h (Set Sice breakpoints)6 G& A- [- F4 \) D( F; [8 O/ T
-AX = 0914h (Remove SIce breakoints)
: g( A6 C% z3 e* d; Z. Y9 F0 G2 H
4 z# D( ]1 f& K1 A4 Y) qEach time you'll meet this trick, you'll see:
* a$ v8 T- i; F: f! @% v2 ]! g-SI = 4647h/ L4 R: |# c- e6 g0 _& Y
-DI = 4A4Dh
8 h6 F( |* Z2 m/ A# r; a. }* h: y4 xWhich are the 'magic values' used by SoftIce.
7 c; o d; e9 v, X$ r; FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.( P0 L' z" |5 T' y- `! u; k
/ z* [, U! o; qHere is one example from the file "Haspinst.exe" which is the dongle HASP/ `$ Y- ~5 x" E' s5 V& z* F; ]7 h
Envelope utility use to protect DOS applications:
6 S8 N; ^; }1 s) o0 ]9 g9 e7 A: v3 k
$ C$ b* [/ C0 x7 O: ]+ f7 ]
4C19:0095 MOV AX,0911 ; execute command.
5 e4 K: x1 D2 U5 `. p' K/ p& P4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 w+ P R( b$ c+ B
4C19:009A MOV SI,4647 ; 1st magic value.
8 M# ~% @7 N, x/ e" X, K4C19:009D MOV DI,4A4D ; 2nd magic value.: ?7 L E5 a& e' T
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' A: X" y6 }( A' f5 u, m7 G; C* G8 v4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- Q) m; A. K7 T6 ] _4C19:00A4 INC CX- {$ _7 h3 \- G7 a0 N0 ~* V/ z- N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' I K8 J: P4 |
4C19:00A8 JB 0095 ; 6 different commands.
6 ~- V! a& N4 N: ~4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 J; E1 ^! a5 Y) K' w$ i' J! F
4C19:00AD MOV BX,SP ; Good_Guy go ahead :); H9 ?/ R5 T& z8 l+ ~% C
# @- k4 H+ {! w: j& u) I; [
The program will execute 6 different SIce commands located at ds:dx, which6 j+ M# y3 z1 i( h! q. m8 C5 z) e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: b( G! i" L# V- m
( ]( v& Z8 n% r) R7 l* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& t4 u& D! `0 H6 s6 [' ~___________________________________________________________________________
+ q* s1 E2 _' y: \
& H& z* X: d' a* W' b: _/ w1 H) s4 n/ I
Method 03. e( Y: r ^9 c+ A. X8 u& S( X
=========
9 \0 y; o) N/ W" S* a+ S2 t; C) [" C
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, p+ }) K+ t1 }+ X3 d
(API Get entry point), U' u$ u7 m' _9 Y% p N
8 _, T! B! F+ o, [- X0 h) F2 o. |: V% d' w% ]9 O
xor di,di
3 s! T# ` G1 V/ j9 E. k8 u. W mov es,di
; C& }4 ?: J* `' `% @ mov ax, 1684h
$ i# ^, Q4 o" w1 Z mov bx, 0202h ; VxD ID of winice
/ U9 W" D2 U3 F int 2Fh
' `4 l' T, r" @. p) J mov ax, es ; ES:DI -> VxD API entry point
# I$ Z. o; N0 f& ~. R- h add ax, di
4 Y& h+ s. u, e# d2 y test ax,ax
! `! E: K8 @# y% H$ U jnz SoftICE_Detected1 w. V M+ J/ @: h
% w2 a3 N; t. D( u6 n
___________________________________________________________________________
' q- Q+ x8 {7 ^. C( s5 _# O
$ K7 U; x7 z, f* p$ O5 v- M6 w) KMethod 04. C5 s3 W( O) S9 U: d
=========
" T7 |8 }$ a+ W9 v3 w
' x# g+ u" S7 M4 PMethod identical to the preceding one except that it seeks the ID of SoftICE& ` v q& {& L3 C; q X4 D
GFX VxD.0 M* J9 M' @4 R' o% @5 b2 k
" y' J$ h, k/ n+ ~" I0 h xor di,di
+ Q, I$ ^# m4 ~; Z6 o# V0 @ mov es,di
0 I9 c" \ O1 ]5 z9 T mov ax, 1684h
& e' r7 g5 g+ E5 l* W$ {, \# Q mov bx, 7a5Fh ; VxD ID of SIWVID( O8 X3 c( C. N' o' H$ B& v
int 2fh
9 B( d' R% Q( |9 d0 s5 K0 T6 { mov ax, es ; ES:DI -> VxD API entry point
+ l+ ]/ F! k4 W, I6 D. ]2 S add ax, di& C6 j% h K5 N* h
test ax,ax
2 S+ k* d. l3 C% ^( Y6 h0 x' U jnz SoftICE_Detected
! z2 `- n; X; _& N9 \6 @1 K- G; R
__________________________________________________________________________
, b: ?" o8 t7 O" B& |% j! E3 {. b# V% H3 z3 ~/ `
L% k x* a+ i6 m
Method 05
" l# |) q8 A# Y6 h=========( c# V4 b+ L/ _: J3 V
" P! ]& F, r; ~$ J8 a) D* Q/ x SMethod seeking the 'magic number' 0F386h returned (in ax) by all system
' X4 S, \' E3 g e; Ydebugger. It calls the int 41h, function 4Fh.
- E( X7 u2 ~7 nThere are several alternatives. ( ~ L2 n) V' I
" M r' J5 ~0 C; t: Y& K
The following one is the simplest: j, j" \+ g. d) `4 @
2 e: X0 ^% y8 v( j mov ax,4fh% ^* f2 v2 i0 S- C+ }
int 41h
' K4 K/ T* x" U( [0 H# M cmp ax, 0F386; ~ e W. @6 \) }0 r7 y# w
jz SoftICE_detected
( M' p" }8 z4 p( _& O& \! g: T3 W6 O8 U, c/ v! }4 q% \
. P' n9 ]; e; a. z! u3 g
Next method as well as the following one are 2 examples from Stone's 7 [9 ?+ U2 \( B. o
"stn-wid.zip" (www.cracking.net):
; u2 S. n' e$ P4 f; g& K% ?! r' I+ r$ R9 ]7 _
mov bx, cs+ {# S, L# n/ u, n" F4 A3 B
lea dx, int41handler28 i7 O) X2 ]0 [7 l, H% ]
xchg dx, es:[41h*4]
" U: ]4 q$ S+ ]0 { ]' F2 e xchg bx, es:[41h*4+2]3 E8 {8 k, b' J/ {4 k4 u5 g* T
mov ax,4fh
- \ `8 V% j& [, y9 D1 M int 41h
; S( }' O: V5 J2 K' V xchg dx, es:[41h*4]$ n9 s6 ^4 _% k
xchg bx, es:[41h*4+2]0 i7 [- @4 B( {. n9 `3 M0 G$ T
cmp ax, 0f386h) P6 u1 V$ z0 k, S& [, A
jz SoftICE_detected, ^. K% s8 n( f4 W6 d9 F' V
7 e$ r; o( s/ M2 c& P. m1 y$ I
int41handler2 PROC
2 ?$ t! p1 L' s: r, n5 t* r iret3 ^7 h. b9 k4 K
int41handler2 ENDP
1 L# y/ e- ^& K( F' R+ ]; P6 A" e3 A$ @5 v. j: a0 w
7 d. `/ g o& G/ {7 P4 l% F
_________________________________________________________________________
3 A; L7 Y& E T! [ @' A3 p
# {& N" q: H' j3 E; {1 P7 u S( C" L, T \& A
Method 06
) p9 q Y/ |; S) k=========
2 }4 `7 G J( H" {8 C8 N5 T# P
) b* ^2 }6 x+ a9 C; s3 Q v$ w. d+ b$ r5 F- I7 P
2nd method similar to the preceding one but more difficult to detect:. O/ l: N! z j5 J8 Q
8 @/ Q z! h5 R' C) o. B
# e- h1 i, K% H# C6 j, x0 zint41handler PROC0 A. p2 x" c8 K0 ]2 F! Y
mov cl,al
; c/ L: T- @3 c iret
5 |) k0 c q H ^( @% e4 `6 E$ t& @int41handler ENDP# r+ n# M5 I T* G4 {1 S7 H. S9 B
5 l; _! z* J: W
4 x1 F" d0 h2 A/ U6 L xor ax,ax7 U& r6 {$ V/ m9 O9 K C: ?
mov es,ax
/ j. D. z7 d j3 G: K7 f mov bx, cs
( w2 U6 p. h% C& z lea dx, int41handler) J4 M; p8 u! A! m$ | o8 f
xchg dx, es:[41h*4]
) J. V. p0 F5 k, [8 {& Q& O3 X9 N4 p xchg bx, es:[41h*4+2]
- x, C! ]* G. q l in al, 40h
. g1 P* C. A$ H$ S. t1 O9 J xor cx,cx \" W# u- k) `/ l
int 41h
: ]( e/ H$ [9 U4 X7 x/ L; M xchg dx, es:[41h*4]+ i; R+ h. I% A. m6 O& s4 f
xchg bx, es:[41h*4+2]) h0 ^, A0 {$ }
cmp cl,al y) p% F n: o# l6 d4 J
jnz SoftICE_detected9 S* i1 e2 ?# r F/ i& E
, W: ~4 m) N8 A# X6 y6 Z. r
_________________________________________________________________________
) C" \6 o" X( G4 S: x' N
3 Y, { B" a2 k6 nMethod 07/ s& j, T! a" S' i' H( C S6 o6 `
=========
% e. i! f8 J/ I3 ~( Y
( H/ z- H; ]6 ~+ B+ t1 HMethod of detection of the WinICE handler in the int68h (V86); Z- E+ l( }! b/ @( \
) [# q1 K0 w0 y
mov ah,43h; U$ P, @/ T L1 A
int 68h4 S9 S* L2 f7 |! N* h
cmp ax,0F386h
$ b# O" e5 ~6 V jz SoftICE_Detected
; ^, ?% C* k% e. F" k0 K) n. ~$ ?* W' X8 a {$ y% @
4 e! d. O. H3 m5 _( }! I
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' N, c2 l% Y2 t! } q
app like this:# [/ b* Y6 o' n% \
( _$ Y$ u. I# P% f& @( h4 z$ k BPX exec_int if ax==68
) M7 h" c+ b8 ^" O9 ~' A& |) f (function called is located at byte ptr [ebp+1Dh] and client eip is
. J h0 \4 Z. D' n! v located at [ebp+48h] for 32Bit apps)2 t% W0 k* l7 G: f* a
__________________________________________________________________________
7 L* _/ r5 I# Z
, N0 U6 H, v. a1 t0 q4 i- Y0 h, e$ N; K5 t; ]# T
Method 085 P% j4 b- C: H
=========. W# S7 M6 `5 ?& B
" V9 s: I* E5 `
It is not a method of detection of SoftICE but a possibility to crash the/ P5 @" N# l( R2 L% r
system by intercepting int 01h and int 03h and redirecting them to another7 e" W+ N$ Q( R7 C2 V( A* E) O& G# h
routine.4 L2 q' S: t4 q# \7 H0 f
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" Q1 m5 j1 s8 ?9 {) G& E; U2 y5 lto the new routine to execute (hangs computer...)
, S' P! o% `* T( q, v
* Q8 l$ Y0 W/ Y1 m. G. J1 \! E% | mov ah, 25h! a) b$ |) c) I
mov al, Int_Number (01h or 03h)
$ x ^- V* ^% P( V8 T% C H mov dx, offset New_Int_Routine( _7 r' e- I# I" k* I
int 21h
& K/ [# L5 M- P$ |3 |; J6 G2 i7 C6 @
__________________________________________________________________________
7 i, N8 a# N: L8 v6 y# g+ [/ @0 n } C0 x
Method 09
7 j# R% `7 c9 {- O! t=========6 F1 `% `+ o" p$ |! E
6 w* z+ C3 d8 LThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only N% u! F" s& H6 A. U
performed in ring0 (VxD or a ring3 app using the VxdCall).& r6 ^# Z2 {* h/ U% p2 D/ y6 i
The Get_DDB service is used to determine whether or not a VxD is installed
, A+ y+ E6 X3 Q) ^ V1 Qfor the specified device and returns a Device Description Block (in ecx) for1 l/ f2 }! Z" f: @
that device if it is installed.$ F9 w6 `2 Y5 k- W4 |
" F$ H9 d, J& ^+ D* X0 a% i+ t1 u& C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 u: }/ [& F' W. k( k1 W8 I; D8 v mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; m& s% r! x8 g7 q7 [( P9 K8 f VMMCall Get_DDB! x( q3 y5 I; _! f9 N
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ Y$ }% ] i% D6 x4 n+ p
, Y6 @1 n# f! N3 u9 d6 J% E0 rNote as well that you can easily detect this method with SoftICE:
+ I L' W3 I3 | h bpx Get_DDB if ax==0202 || ax==7a5fh
8 ^" G3 a% N' F5 U9 g" q- k
$ o. b7 { f/ J2 e__________________________________________________________________________
% t, n) [6 N7 x$ R# B0 z1 n$ [& o# `7 Q# i
Method 10
* m' n" I+ ?5 B, w* R7 m# Q) I=========
5 o0 R; O! r8 I3 e5 X- Z' y: _7 y H6 B( w' A p% L' D7 f
=>Disable or clear breakpoints before using this feature. DO NOT trace with
/ k# T' {: ?8 M7 H SoftICE while the option is enable!!
6 }6 U. d5 ]& |- |& @: d: W
/ `" F8 a+ t4 s& v7 I4 w: WThis trick is very efficient:
: q }& g8 ]4 x: ]" m- Rby checking the Debug Registers, you can detect if SoftICE is loaded
) r/ o! V7 m: Z. C( y R(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" s3 V. S' `. q7 U5 N
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 K- j6 Q0 H8 C, z" Q! i1 ]$ V* _value (in ring0 only). Values can be manipulated and or changed as well" Z2 m P, d9 k$ q+ d c2 l [
(clearing BPMs for instance)
, z3 A q* W0 }0 p7 t- F b8 W) a |! N& E) [2 r
__________________________________________________________________________$ E/ R, o: O- W3 o# K" {8 R( e
& }# Y; g; A: j% D
Method 11
$ z C0 g0 P, M2 X7 H& x=========5 Q" c# e+ o& I* e
3 ?+ Z) E0 t3 oThis method is most known as 'MeltICE' because it has been freely distributed
9 Z2 U& H8 R9 }6 D+ u0 zvia www.winfiles.com. However it was first used by NuMega people to allow
1 l6 E! w3 }+ \( VSymbol Loader to check if SoftICE was active or not (the code is located
9 R" f% N$ x P. J7 Hinside nmtrans.dll).
0 L: W _3 o7 g0 `2 ~5 I" W u ^: O0 z- z
The way it works is very simple:
9 W. s" G# X q' ^It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& D) s: u7 k% }$ D% E' ^% U3 ]WinNT) with the CreateFileA API.& d/ x+ W- u( _$ K
0 q; }5 @0 R, E* w
Here is a sample (checking for 'SICE'):
0 q) Q3 [8 G4 E+ U9 r- v& w1 W# O w4 K0 Y( g* c/ m# f& T6 x8 a
BOOL IsSoftIce95Loaded()
* g' y0 T- Q2 N& s+ B" {{0 V7 N4 f$ N9 y% d! Y$ e
HANDLE hFile; " @! Q7 {) Z$ b! H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, _& p7 O: _( V7 L: X
FILE_SHARE_READ | FILE_SHARE_WRITE,0 r1 F3 ~! q5 B3 @: N
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 t/ T3 r9 i; h
if( hFile != INVALID_HANDLE_VALUE )+ [# l- ?( x! {: T, t& C
{, D" g u1 ^* _8 @' \
CloseHandle(hFile);4 @. b' m1 M' E- N( X& z
return TRUE;
& x. Y( ~, N N: m& \ }
2 d' H9 m; P( Y$ W b9 _ return FALSE;4 I9 J6 m& q: j5 v: C$ |8 Q8 v
}$ D% |: j6 q. U" w, v: g
! Q1 k) h3 g8 w" @) _
Although this trick calls the CreateFileA function, don't even expect to be6 @5 L# n$ d J- z5 o3 s6 ~. R5 }% u
able to intercept it by installing a IFS hook: it will not work, no way!9 ^( F M1 Z0 z+ g7 T9 D2 c7 l
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 h, h1 N; z+ ^
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 j, U0 r# ~5 b$ }* R& R' n0 C3 q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: M2 b* d3 u- H6 b" R* _5 Q: T* o
field.
# f5 p0 f, |6 X; C1 Q; i/ B1 {In fact, its purpose is not to load/unload VxDs but only to send a ) @- B! P& E1 X2 n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): p6 h& M/ ^- H9 o
to the VxD Control_Dispatch proc (how the hell a shareware soft could try n, B" H7 M$ k/ Z1 g
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ X' u+ j2 K3 y" qIf the VxD is loaded, it will always clear eax and the Carry flag to allow/ t1 B1 U4 N; @1 K
its handle to be opened and then, will be detected.
/ f+ X+ d. ~* G0 N* TYou can check that simply by hooking Winice.exe control proc entry point
2 O3 L( M6 f U: S9 vwhile running MeltICE.
* n; r9 [! T% B$ }1 i% Z0 r U' e" p1 M
6 n o' o9 c; D, [+ k8 m8 [+ m( U
* H$ [$ V$ H$ Q* ]) u 00401067: push 00402025 ; \\.\SICE' j5 @0 k6 @% }8 Y y) D
0040106C: call CreateFileA
, Q" J* V V# c4 G 00401071: cmp eax,-001) m9 H4 d* T! z# X
00401074: je 00401091# T4 M% r. c1 O: F
& _! O7 l& X! h/ X
$ T3 F% M; n& [* PThere could be hundreds of BPX you could use to detect this trick.2 Y. n( {0 _( [6 k, q
-The most classical one is:+ y+ y% H- _ V# U
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) f9 q; d' K# k *(esp->4+4)=='NTIC'
% D% Q4 y% B) o# d' N8 m5 L, k% v o) f4 f. u$ `
-The most exotic ones (could be very slooooow :-(" P: p+ [: `( Z: A- @- n
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' j6 R# |; h4 N6 x' A ] ;will break 3 times :-(* j1 q: L8 v* ^$ ^* ?
& v" w. s8 N* y+ F8 L& H& t9 `
-or (a bit) faster: U) r9 g a: ?/ S3 u
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): K K+ t" w, ^ T. F
) i$ N K6 T% Z1 e BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 P$ z& l ?3 M9 l# _5 q3 |) z ;will break 3 times :-(
3 B* h2 {+ P; Z) H5 E) t# h5 l6 p) a" F( u1 z. W' h* k* n. [7 x
-Much faster:' n+ {4 a |9 @2 r V9 N) Y* S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- I3 K- x7 O* }5 I' A- c5 M' ]5 E j \5 \
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ M' n: x1 B/ _- `& ]# i# j Nfunction to do the same job:
8 `% F/ v) ~ o, h! I$ L
3 r: R- F- ^( |1 Y9 u, s push 00 ; OF_READ& `6 [( b1 c) [* m, p" j3 Z) V
mov eax,[00656634] ; '\\.\SICE',0
- O% L' l; h' h4 m% M. ?( z5 q9 E push eax
- r, Q! k& g+ J; v call KERNEL32!_lopen
+ e! P6 M4 [, ^; c& [( P* H- Y! Q inc eax8 m( r$ y4 T7 l, [: t; O
jnz 00650589 ; detected
& l0 I. u6 M/ \2 T4 f9 H! V' P6 l2 k push 00 ; OF_READ3 P. T. p5 w1 k0 L1 j- E. V, n
mov eax,[00656638] ; '\\.\SICE'
4 w* K0 C* s W: h: W- _, Q- Q push eax1 ^) `" p3 v* I* _8 I
call KERNEL32!_lopen
, Y0 o+ ^, K' E+ l: [% U E" } inc eax
; k& C& S1 C2 c. p; Z/ G jz 006505ae ; not detected7 y1 W7 a9 B! m# E
z4 s7 O2 g6 x0 f/ C! L
7 o/ ?, p$ e v3 C+ _# |, g. x__________________________________________________________________________
) K9 ?1 D* X& k X; L5 o. y/ N# }7 ?( |) H. ?
Method 12
0 H( n. x: n) m( s( g=========
) R, Y! |% I) _1 m3 s! t% a7 c% n) N
* g! G0 M/ O% c* ZThis trick is similar to int41h/4fh Debugger installation check (code 05
* C' R& c. B% K5 z4 S& n& 06) but very limited because it's only available for Win95/98 (not NT)
. u: D5 W! a* n8 `9 k7 S2 t6 R; Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 r' `- ?5 i7 [5 D* a& r! {
k, C. ]" V% C; u+ h push 0000004fh ; function 4fh
3 p# N5 I: A8 h4 c/ t push 002a002ah ; high word specifies which VxD (VWIN32)' M, N- R! ?8 G& F; k! L& m
; low word specifies which service
% C# b, C3 ?3 C (VWIN32_Int41Dispatch)2 k' t% l2 Q$ G
call Kernel32!ORD_001 ; VxdCall
7 W6 }& c1 v5 b/ }+ c2 B, }* z cmp ax, 0f386h ; magic number returned by system debuggers9 ~6 I' }1 B( M! g* W" x' p/ E
jz SoftICE_detected
! w1 J" ^1 \! M# \/ `. a7 q
+ E& l& S& ` l+ o& H9 p7 M8 aHere again, several ways to detect it:
, g) ~# j8 S- S( Y' t( ]1 C0 F" X- s
j3 X* H, w0 E BPINT 41 if ax==4f# A. b$ e; j: E& g& U. D
. D' z& x2 D4 [5 ` BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; r% g: j* q( u: G6 b! n3 ~7 z8 w+ b" S/ \& }0 M
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* ]" h% Q, B% f1 g( c9 o* U- i/ _) r+ U1 o# I+ Z4 u5 j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, X- j" u. X' X/ Q7 A3 N
% I6 s) ^& S! e- L& ~ q' X__________________________________________________________________________
; k) S2 Z- y, ~- h9 E
: h$ T* x7 w- E' jMethod 13
9 J2 {" k7 n4 `$ e=========
$ T# v* o: z# P+ r V0 R" d2 a
' ~4 }1 M% C4 |$ yNot a real method of detection, but a good way to know if SoftICE is
# H' v2 v/ e6 N& X& x, h6 m& Ginstalled on a computer and to locate its installation directory.
- x2 v9 w- s0 T- N. l6 \ EIt is used by few softs which access the following registry keys (usually #2) :
& A/ G2 l1 x- ^* W7 }" `4 L# y4 T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 ^8 [% x( X- Q, l* ?. l\Uninstall\SoftICE
( J1 G* j# v. [7 F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% l$ j. M4 ~; H) h, g7 J& X5 x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: i4 I8 m0 K) b8 o! r\App Paths\Loader32.Exe
/ h9 h& _: W6 h+ e7 V! v9 t, c7 Q5 q: y1 t4 M
0 r5 U* k: ] `$ o. I: U
Note that some nasty apps could then erase all files from SoftICE directory
/ g; K! l0 A) n(I faced that once :-(
# ?( G% B$ a, x8 k& r
/ N$ }4 K- ^& mUseful breakpoint to detect it:; |' Z8 K, B, |
! a# D/ S7 t5 E/ y+ c7 F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" y2 K4 ^5 w5 G1 H r8 w; b9 N" i7 c8 G
__________________________________________________________________________
4 A6 ^" I' i* r/ s7 X0 k
! r; H9 ~, m- {2 U( |
1 C8 l) n, k; P0 |* pMethod 14 " e% r+ q9 _! w7 G, Y5 i3 K u
=========: H; k, ^# q4 g- T- ]
2 P- \: ]+ v I& ^* H
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 J+ H" S% ^+ w xis to determines whether a debugger is running on your system (ring0 only).) J; K* W2 A1 _
3 ?, x, K d3 u4 M3 r( P VMMCall Test_Debug_Installed
& `& G$ M' S! x. l# z je not_installed
! E. \! L. u# [ S0 t
# H9 J! j, I- q& \This service just checks a flag." Y* g4 w) A7 ^5 w; p; J
</PRE></TD></TR></TBODY></TABLE> |