<TABLE width=500>
: J2 y( |7 q+ P @<TBODY>* {2 R. {' m) m0 {
<TR>
" K0 ]- V7 l9 ~1 z7 B( S, w<TD><PRE>Method 01 1 e% ^* p' {, Z$ M$ C
=========
# }0 O& Y; p. p( q( f0 u
: l0 ]! C7 b8 A6 pThis method of detection of SoftICE (as well as the following one) is& I Z. k0 w( x
used by the majority of packers/encryptors found on Internet.( Q" g) |: ^) V1 o/ S. P
It seeks the signature of BoundsChecker in SoftICE. I/ o( Y' V* e; E/ G
* j6 H' v& Q; I# Y$ @; g* C: g" G mov ebp, 04243484Bh ; 'BCHK'
# b) j9 ^- Z# x8 B! G I mov ax, 04h
: k5 n5 G) N2 A$ |& \ ~/ N# E1 t int 3
" t H+ j4 J+ i- ]* G0 _ cmp al,42 h. |; |3 n: v4 v" E3 o, k$ r) [3 A
jnz SoftICE_Detected' d2 Y; V/ R; Q
! L, C& o; o: q& N6 ]+ {$ v% G
___________________________________________________________________________
* L7 r+ `9 B: {; b) O8 }6 {, `* ^6 Z- r
: u' ^# U! d4 R/ z/ KMethod 02
# t0 Z8 D1 v8 H& G=========
% u2 X: c0 e- s7 F& x/ ]+ k V5 I$ E
Still a method very much used (perhaps the most frequent one). It is used
M `" }1 ] ?- Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) D5 r8 e: K7 C- X por execute SoftICE commands...# f# V7 L1 N+ d# j% H+ m# D9 N- N4 [. x+ P
It is also used to crash SoftICE and to force it to execute any commands
* P' D8 N9 ~3 F. E8 T(HBOOT...) :-(( ; ^3 j6 Z6 o. ?$ B
+ M9 |; f" g0 u/ v- M D
Here is a quick description:
3 Q5 E6 K1 p8 T+ D4 Y0 }# M5 B-AX = 0910h (Display string in SIce windows)
% O2 e# W% C0 L" T8 x% Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 X6 y% N! j& s% B-AX = 0912h (Get breakpoint infos); {' v& R6 ^) b# E+ @
-AX = 0913h (Set Sice breakpoints) C+ g$ ^7 P8 r2 {
-AX = 0914h (Remove SIce breakoints)
/ `+ _" d7 v; v/ x
& S2 i1 a# n$ v& @2 \9 [4 KEach time you'll meet this trick, you'll see:
v% |- |0 [, H' H* j) B2 g-SI = 4647h. T+ f( T6 ?+ M# ^' d- y( z9 Q' _
-DI = 4A4Dh
, z' C1 j1 S1 d o6 W1 s: eWhich are the 'magic values' used by SoftIce.
9 p' b3 \9 W+ `0 c% l+ f7 G& MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.( w$ A: |' P+ m) p
X" k: h7 }7 s3 J0 ?* |" d% zHere is one example from the file "Haspinst.exe" which is the dongle HASP) c5 ^: l, \6 _& X# F6 E3 X
Envelope utility use to protect DOS applications:
' S0 z" _ Y; N$ v8 N3 M0 n( V% @3 W$ p& |' ~! \/ P: ?
& k! B0 N! @1 m6 M1 {% l" u3 b) M4C19:0095 MOV AX,0911 ; execute command.
" H3 {5 i' R- q; A4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ Z$ O& P1 l* i9 V& Q3 ]4C19:009A MOV SI,4647 ; 1st magic value.$ R$ S$ g; z, F) I0 r$ I! k
4C19:009D MOV DI,4A4D ; 2nd magic value.% z4 I* ^8 h# W8 V
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! C; g0 q6 F0 Y7 {1 ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) S. v4 f1 C1 f0 E# ^) h5 ^
4C19:00A4 INC CX
0 n S( n( ^+ |1 A8 `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ {" z( j6 X" u$ |/ U
4C19:00A8 JB 0095 ; 6 different commands.; n' o2 Y4 d) d7 N. e$ y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 j( ?8 z- Y! h+ ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% V" F/ y% x; |2 `' L5 B: h: T
! |! ?% j4 t6 ?& P; E4 ^0 DThe program will execute 6 different SIce commands located at ds:dx, which
8 L# c* x" X1 a* V: b; L# kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& _% q9 O. S: Y# f1 u
# e9 {1 j! w" ~ R/ _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 {# o$ k& C; J3 a) K6 d
___________________________________________________________________________
4 f5 H# [5 b% m0 _" h0 N3 |" L9 J& F$ G
; o3 U4 ]/ l, p4 U v g$ j8 GMethod 03$ p G/ o; l( T) T: H- \) T( {
=========8 V. p% z0 D: ~) B( f
# E. h; `8 ]: u1 MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 Q) t, ^+ g& \( E0 _& B9 Z
(API Get entry point)2 `: d8 h6 F; y" n9 @* R- R
4 ?' K9 b U$ b. a6 l( y
4 K$ ^2 f: J4 U% p3 r
xor di,di
* M( M. l S& U0 J8 f mov es,di
4 s1 D8 g) m$ m# w mov ax, 1684h # g* S) q7 t! O1 D4 [
mov bx, 0202h ; VxD ID of winice
/ T. m+ i- G! E- o int 2Fh% h% ^/ T( ?# @0 ?. Y9 y f x% r
mov ax, es ; ES:DI -> VxD API entry point* D; p6 H8 S8 V. k
add ax, di) p! q8 W' o" e5 }* o7 j# R
test ax,ax4 s( [4 p. \* F/ k7 y$ H- c
jnz SoftICE_Detected
5 n! d) p! e5 M- ]5 V# h' J3 y5 q4 C/ w( W: i
___________________________________________________________________________
5 o" v9 P. o; Z e5 G6 ?8 f. q8 s: F1 F1 O) `& h
Method 04
: ~! M2 y1 Q/ Y& Z7 [! W, J=========; |% d- D+ c8 S' B# s
4 t' K* s4 _( z! k! ~Method identical to the preceding one except that it seeks the ID of SoftICE
8 {$ A2 y' @0 q. _( s3 {GFX VxD., m) t% A) J# b6 x$ c
! N! }* c4 X J7 X
xor di,di" {; n4 ?+ v% `0 r
mov es,di8 T, F- }; ?3 j% J/ } J! c3 O6 y
mov ax, 1684h 8 b7 ?* ^) I# H* |
mov bx, 7a5Fh ; VxD ID of SIWVID
- r' {5 f4 ^! x& o: _0 D int 2fh7 l7 o9 [( N( O
mov ax, es ; ES:DI -> VxD API entry point+ i; q% ]$ k/ o$ ^$ }8 Y" M' B8 v
add ax, di% Q6 n0 m- T5 ^0 x0 K
test ax,ax! D3 Q' g& f4 ?0 S5 V" u' f7 _$ M7 _
jnz SoftICE_Detected
) p! P' j, V4 i; A
3 c) q( u" U" b1 M, o0 V3 m__________________________________________________________________________
X, k% O6 B9 \& X7 v4 i% A8 L# C1 \8 A+ {* J; y
j% F; }. p; p2 ]2 q* j4 l+ i
Method 05& n4 u% q( `8 L/ S* W: ~/ v
=========
& O7 C, U" n3 f- ~) V
[; a% ]4 E' ]8 fMethod seeking the 'magic number' 0F386h returned (in ax) by all system
" @" j; G% T8 U& b5 E& ~debugger. It calls the int 41h, function 4Fh.
! S8 u" J$ a g. u6 \There are several alternatives. ' Z9 O& t- T! Y7 J9 ^+ B" B' K6 R
# f/ M7 y4 \0 t Z5 X) P! a
The following one is the simplest:. A8 [/ P0 Y: ~/ M9 @
7 j+ m: X. z7 P2 g
mov ax,4fh5 W) j/ @' R. e; A1 V
int 41h% M4 s& E' e0 q3 F/ W: T
cmp ax, 0F386
' K& ^% b. T& X9 E$ ~ jz SoftICE_detected; o8 X) [, N$ C4 C' L) {
3 }% a/ a0 v, s- a; C. J
4 M! ]4 c- _9 \" x3 ?
Next method as well as the following one are 2 examples from Stone's
5 i9 i @) U, ]0 o"stn-wid.zip" (www.cracking.net):
- e+ W% O5 i" S# L. p
4 g9 u+ M2 V7 K; o+ i, j mov bx, cs e( r4 r: g4 Q6 _
lea dx, int41handler2+ X) Q" G; S0 r
xchg dx, es:[41h*4]& _- L! S4 `( ?4 `: H
xchg bx, es:[41h*4+2]: _4 D. K7 b, ?8 O3 f
mov ax,4fh% j6 s% F/ {% t- C0 L' b
int 41h; [$ c f9 c1 P
xchg dx, es:[41h*4]: _) y9 M& E& u' \0 k
xchg bx, es:[41h*4+2]
' s; p' S' [2 e( \, X cmp ax, 0f386h
! s% v* N' k, T5 W4 D; V jz SoftICE_detected
5 r% A1 [7 K% ?& m
, G6 j# F) j0 m: t& d" Eint41handler2 PROC
4 H% L: R( q' f/ W. \ iret
" v7 K4 D9 L# mint41handler2 ENDP4 w' U; s# f' `' x2 X, ?* ~
" Z, f$ p+ D8 V9 }$ a
. Y; h. A( m+ k; g2 B
_________________________________________________________________________: e* ~1 {4 g, s* m
" G# z1 b, v4 k) z
6 l+ L% V# g0 y& a @1 ~% f5 }Method 06& q+ O, }: x% f4 F, U4 k! D' X
=========- S2 o0 J m; i2 }6 C$ ?. u
0 h) i$ o2 h0 X2 i$ H n q9 i
6 `. [3 W9 k% z2 v" J2nd method similar to the preceding one but more difficult to detect:6 H8 b u. M1 C
+ G1 j! i6 n4 ` q
0 W) e* n) K0 Y
int41handler PROC
4 S( r' i# w* C& c5 j" p mov cl,al% Z8 y6 i0 i! Q+ s- u5 h& S! R
iret
8 [ F! s& z+ {int41handler ENDP
. U' {+ ], g d" P! y- P
2 o/ z" `5 f+ P5 V
& t u8 E: e! i* | xor ax,ax
5 x" O* z' n* p! k mov es,ax
% \& E6 g, l- v( ^/ J mov bx, cs6 T: W( W5 T |7 P2 O- u
lea dx, int41handler9 d, y5 `' B( q% `6 d
xchg dx, es:[41h*4], m" N2 Z. G% M" S8 R2 H/ l
xchg bx, es:[41h*4+2]
' D; ]: N! I' K* d in al, 40h6 t: J# ^9 w* S3 r! F
xor cx,cx
; J' M; D% C! s! A int 41h
L+ j/ Z# S' H% r+ B, K. U" ~* C xchg dx, es:[41h*4]
* s4 t& E z- v2 U9 l xchg bx, es:[41h*4+2]5 k# X3 m" P$ A
cmp cl,al+ q! z# Z* a6 r( u0 ~+ ^9 q0 G
jnz SoftICE_detected) ^# x! T7 e `& b1 b( G" W0 W
6 p) o+ |- S1 W- z# |$ ~% u t
_________________________________________________________________________
. I+ V# [; [7 @6 R! X7 C( @3 }; T) P0 }& @9 }, v/ q5 ]$ Z
Method 07
/ g- J+ l1 y# ]/ C* G=========
5 K' H/ K* B1 K1 t! n9 h9 [4 G: l( _
Method of detection of the WinICE handler in the int68h (V86)
% y6 r5 C' O; p, M9 e5 ]; q& m* b& o- W6 B$ s
mov ah,43h
( R+ ^1 _# ?9 [) ?3 }1 S! T- R( [ int 68h% R- _7 C, D9 l J
cmp ax,0F386h
4 O" r2 i: ^1 c jz SoftICE_Detected
, f9 ~! C1 l/ [- z$ |' }" p1 P
, V: `9 e8 e: }2 v/ x# ]: R+ S! U: A% M& C8 Y1 T3 V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; C/ V) B5 A1 h8 w' T: t
app like this:
; O: n+ V* a1 q6 G' Y+ M3 |
" `3 g' B8 R/ {$ v+ Q2 t, y( E) n. p u BPX exec_int if ax==686 t( K" c+ m# _$ Q' d
(function called is located at byte ptr [ebp+1Dh] and client eip is
+ K4 B4 B( Q; k `- X1 \ located at [ebp+48h] for 32Bit apps)
( ]- g' P9 a a__________________________________________________________________________
4 I# I6 q6 ~/ a* T( T
; I0 u& A' C; ^7 p) ^2 D
4 a5 N* U4 d/ O$ tMethod 08: `8 v0 T' v* k0 [
=========
8 P6 N& } T- q* Y/ y- a) K( K. j& e) }% ]
It is not a method of detection of SoftICE but a possibility to crash the1 x8 p9 `; e. B& K
system by intercepting int 01h and int 03h and redirecting them to another
+ c) C ]+ H/ {5 W( j7 Y4 N2 iroutine.( g( o6 F. O {$ o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 ]/ j: k2 Q$ c$ l; @; ?- Y
to the new routine to execute (hangs computer...)+ S) y1 F3 ?3 ?& u$ L
$ l6 e# v( S. ^
mov ah, 25h
: E- t. @+ i2 C8 v( a1 j$ Q mov al, Int_Number (01h or 03h)
& L' M6 d7 W! v8 X2 w mov dx, offset New_Int_Routine4 ]; f- P- C) l1 E$ C8 ^
int 21h7 W6 b/ G i7 q# l" d6 g, ?: g
K! j+ M! ^/ _( c7 c9 K7 N
__________________________________________________________________________* M: B8 n t- ~
/ u4 i, P5 K( YMethod 09- n7 l/ Z7 q9 J8 q* Q! X- T/ c
=========
* ~1 s! ?1 U0 O/ S4 r, m% W: O4 j+ `. a* q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" R( N5 A& D/ e, c( e
performed in ring0 (VxD or a ring3 app using the VxdCall).
& S2 U, s4 G. s" q( e, g5 MThe Get_DDB service is used to determine whether or not a VxD is installed
. S) S' P* A" Ifor the specified device and returns a Device Description Block (in ecx) for
1 C8 Z3 u9 W. Q: \) vthat device if it is installed.8 ]4 F; ?% y) D1 d
6 D5 c5 {+ C) t1 C+ V
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! t! n8 D# t( A$ t' P% b# q
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)1 a. A) ^- J% Y/ p8 S/ y: A5 H
VMMCall Get_DDB
5 _7 b& `' j! J9 w; W Q2 T% A: n mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; o# J2 ?2 l$ s [" h1 {
' U2 ^0 H! k% G" s5 G
Note as well that you can easily detect this method with SoftICE:
9 B2 j6 _5 {% S' s( c6 Z+ w" ` bpx Get_DDB if ax==0202 || ax==7a5fh4 o( K" n6 ? H& \' e- A) m* W
8 V8 u0 T' B: w9 i$ S
__________________________________________________________________________1 d1 B v6 J, r6 h
4 J/ K* {) c% a: _; J5 J! w) o9 FMethod 102 e* S$ ]; w" [6 M$ K: c) Z+ k
=========- @# t0 r0 m) S* [! E2 R f
, J& f% M$ M1 P' o=>Disable or clear breakpoints before using this feature. DO NOT trace with
' ?* b/ C: w$ n; z' K SoftICE while the option is enable!!2 P1 W$ m' q% A# `
. [# z+ d: M5 v) ~2 `+ rThis trick is very efficient: M' ~7 n4 |2 _7 @( g
by checking the Debug Registers, you can detect if SoftICE is loaded
5 @% i& l6 S" f- \# }(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- ]! Q5 p3 d$ ~& B+ z) C% a& F3 [
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 b& p @; `. L) u F
value (in ring0 only). Values can be manipulated and or changed as well
2 x( c v; n7 p9 `, F* E- n(clearing BPMs for instance)' D+ ?" x; ?, i& O
2 E5 @* v3 v% e1 f
__________________________________________________________________________
; j! y3 x+ n" A+ m# U; ]5 I& E4 b" n/ l+ T' a' G" p
Method 119 }$ z/ \1 n) N; D: w
=========
& J7 U& }( Y0 h3 t: F
; G+ l ^5 H* MThis method is most known as 'MeltICE' because it has been freely distributed
2 D, ?' x! r( T- ?, x; dvia www.winfiles.com. However it was first used by NuMega people to allow% d5 Z% g/ L/ h0 h
Symbol Loader to check if SoftICE was active or not (the code is located
: X* _ j7 m3 m' h) }- Q" yinside nmtrans.dll).2 U6 i4 v$ P/ \# ] A
! p+ V. d7 @4 i- n5 C7 t/ b5 ~The way it works is very simple:
* F/ c4 T7 W/ ^It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" o- w6 M+ _( @! C
WinNT) with the CreateFileA API.
9 `( u, m, k/ e2 S, s$ W# z% G& [" ]2 p7 ]. P
Here is a sample (checking for 'SICE'):
?! J+ l7 C) X6 {* }- G ]3 v+ w2 K% y- W8 d# x: |$ f: V" O h1 j
BOOL IsSoftIce95Loaded()- j, U; Z$ b5 \
{
. l- ?( ?1 s1 P% ]8 J2 g0 T0 d HANDLE hFile;
) C( v6 O% [6 Q7 z hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; ?1 k/ Z4 v, a) s8 Y FILE_SHARE_READ | FILE_SHARE_WRITE,
0 `( G, W3 A% U) V: Q: d7 _1 Z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ [- y2 I% r# o- `( l# V
if( hFile != INVALID_HANDLE_VALUE )
( X+ M8 Q' h; n {
, E- U, o& S# v& ] CloseHandle(hFile);" P6 c8 T3 y- {- m# p9 Q
return TRUE;2 Q2 T# U* q: \6 N" c$ i
}
) M& k( k# ]! e. ^% B4 u" S return FALSE;* [& A8 j6 I. `0 d0 s9 e; P
}. k% O& G% |, k3 e- j3 N4 v
5 |# u2 I9 ]/ c1 T2 C& n1 a0 X
Although this trick calls the CreateFileA function, don't even expect to be
: d! E" Y+ G. {( @" ]5 x) kable to intercept it by installing a IFS hook: it will not work, no way!! U. ]4 q9 ` `5 H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 @$ I! {, e; ^# K. o8 T; ]6 V; Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* M$ f2 W& u9 F2 `and then browse the DDB list until it find the VxD and its DDB_Control_Proc
- ?; R# w7 u2 I0 H7 }3 kfield.4 S, A3 q/ F) F; `, I6 ~2 n/ I
In fact, its purpose is not to load/unload VxDs but only to send a
6 Q: r: ]7 v8 U. V+ n% IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 d1 X! Z7 z3 s2 f* q: D/ \$ F* W8 mto the VxD Control_Dispatch proc (how the hell a shareware soft could try+ c3 G* _' r' R1 F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) B$ D6 Y/ x2 [If the VxD is loaded, it will always clear eax and the Carry flag to allow
/ P5 a/ `: j: H; wits handle to be opened and then, will be detected.
8 O5 s: c _8 {, E6 ~, fYou can check that simply by hooking Winice.exe control proc entry point
; m ^8 ], w, J/ Wwhile running MeltICE.1 ^. S! R7 K. Q0 u1 O( _" H
/ Q# v8 F+ R: d3 S6 H9 y8 c: }7 k2 w' y8 S7 `. W
00401067: push 00402025 ; \\.\SICE' D3 {7 z9 |: ]
0040106C: call CreateFileA2 o) @- c' ~" D1 w
00401071: cmp eax,-001) \' L5 E5 z* X3 {7 |) G
00401074: je 00401091& z* _: B F P0 o# w4 G: b4 T3 u4 d3 c
' G# [1 V5 H0 Z" Q" U, M6 v1 K5 p: @# D- v# W$ F
There could be hundreds of BPX you could use to detect this trick.
2 J% _) [2 J3 y7 E0 Z1 R-The most classical one is:
( a3 L$ V9 t0 s BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# }; ]! h- h0 i
*(esp->4+4)=='NTIC') l; S. t- J E
. S! [& c% U- y: x+ D1 i1 C
-The most exotic ones (could be very slooooow :-(
1 \ v; P* \5 a8 B# ^5 y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
1 P; z! {6 q( n2 | ;will break 3 times :-(
9 g: M6 E6 ~ K; B+ \. p" n- q; K7 W
-or (a bit) faster:
) a/ W u/ f* |2 V5 a& C8 y5 o BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% X6 W/ F8 u, l5 R$ {: s2 F: v s7 L9 o0 g- w+ _- N& W' G4 Z
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 a/ j' r6 |2 T- A/ \1 H: `1 i+ w ;will break 3 times :-(# I. w1 f2 H: S
+ E/ v6 u3 H0 j D8 x( y2 m
-Much faster:& q6 ^% W4 T/ B7 D9 A6 x* \7 W
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ ] @3 ~* l1 s' k- _- ]1 D
2 l, |( `0 ~3 \7 C( s. ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
; G/ ~/ @$ y/ D4 f" O7 c# ]function to do the same job:
, c/ X7 U2 W: M Z
6 W& ~% O8 U5 m! i& M push 00 ; OF_READ, w% ~1 c8 s/ G5 o
mov eax,[00656634] ; '\\.\SICE',0
; D2 E0 {) p* W# P push eax2 J( _( j% C9 @0 Z( Y) z' J
call KERNEL32!_lopen
8 L2 i6 L) H& t inc eax
) ?/ | d( \' ?% S, O' j" [ jnz 00650589 ; detected
4 k) _: o/ c$ O push 00 ; OF_READ
# _+ w% e+ Y% G! p( Y1 { mov eax,[00656638] ; '\\.\SICE'
$ e( o6 W' [7 F; Q/ h8 R W) x! V push eax
4 u2 c! |8 ^! y( E call KERNEL32!_lopen
% C/ I# @* y8 j' ?. |$ A- F, W inc eax+ _: G4 x' m' l" ?4 T9 X4 u$ J
jz 006505ae ; not detected' @0 F; v) [9 K4 c% {8 ~# ^
6 u- @+ y; \4 _/ B7 P& W% j4 a8 Y& e4 z4 y5 ]8 W1 N( i' z
__________________________________________________________________________
1 c0 P" r* n2 |0 J* u0 O6 A0 e3 r3 \8 L0 F) `$ B( G0 f
Method 12
3 V1 C, W6 t, e: k$ }* W* d=========
0 p8 m3 U5 [5 Q1 X4 c9 X7 Y6 n2 S3 C1 ~' I& M& q7 v
This trick is similar to int41h/4fh Debugger installation check (code 05
+ e2 l$ D9 X4 i' A& 06) but very limited because it's only available for Win95/98 (not NT)) |( ?; j0 `+ O- C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 w2 l* c; r+ w- `$ o5 h, w8 B. j" n# ^+ b
push 0000004fh ; function 4fh; ^: f6 C R' U
push 002a002ah ; high word specifies which VxD (VWIN32)
% O9 v5 q& K; T2 Q& _+ C ; low word specifies which service
$ m4 a5 u @/ H5 O- o (VWIN32_Int41Dispatch)" w5 s7 P* i2 _8 j
call Kernel32!ORD_001 ; VxdCall0 V! S" }; c2 I2 B; B; g. [
cmp ax, 0f386h ; magic number returned by system debuggers9 K1 b( ]' A+ S! Q0 F
jz SoftICE_detected7 {8 [& P& L$ e) D; e5 n B
3 E3 K% Z3 U" [, o l# O+ Z
Here again, several ways to detect it:
$ D9 v5 \1 e! [ X' f7 n
- C: W' M! i" T' S- S BPINT 41 if ax==4f
2 a+ @, j |" B" x$ F7 P% Z2 N+ j& X. V0 I- V
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 [. a8 h. L6 z% H$ j
% ^' T) J" K" P$ @. U+ d
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ @ V7 {! v: d: h
2 L& ]7 H0 K9 t- s: K5 w( \
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!/ i2 t* t/ H' B9 N) l. i& P [, i
# M, v& d0 y! X2 ?
__________________________________________________________________________# Z1 F& |5 U p1 b
2 _( ]7 u2 _( w- @
Method 13
- \ K: b( A% L, d' `2 M/ b) F=========
! x1 n1 S5 t0 k
! u6 s; N$ |6 m% N+ ^& I; BNot a real method of detection, but a good way to know if SoftICE is6 n2 I! z# ] i2 J* W
installed on a computer and to locate its installation directory.
0 k& y c& I& y, y2 P7 IIt is used by few softs which access the following registry keys (usually #2) :
3 K2 H) s0 K/ l& [0 h5 ?, w% Q( i3 a( [- K
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: {/ q( _/ q" R, ?6 P) K
\Uninstall\SoftICE' f+ d- h3 }2 b4 q" I6 W0 ^- M
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 g, @5 ]6 ?" p4 Y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) a7 I% n& y7 Y% p5 G
\App Paths\Loader32.Exe
! d! J$ V8 @9 X) P( y q/ Z; M+ u' w/ y6 Q
' y$ j5 c) E- b" G- j4 j, PNote that some nasty apps could then erase all files from SoftICE directory2 o( d& Z/ B* U7 s
(I faced that once :-(1 ]' n9 C! B# L) Z
' D5 m; q1 I1 y7 NUseful breakpoint to detect it:( | T2 L# H8 ?7 D, i& D! h9 U
1 `3 f, b# j# s0 a' B
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ O& x7 E7 _6 _, z `& Q! w; Z
& |% q- M. h u3 J__________________________________________________________________________5 m5 p( S% h' b6 c9 W8 Q; j0 L
" C; y: a6 a4 C4 N' h
1 m. s Y) d! HMethod 14
o0 Z2 |/ C& [: `=========
$ g# z7 u8 l1 l$ a; Z% S; H% g% E* W" e$ f0 n) G
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( A+ m- ]8 O9 z3 o$ ]/ h/ ^1 e: L& f
is to determines whether a debugger is running on your system (ring0 only).
2 W& |* Z$ _- Q5 g( U+ p$ w
3 B9 s, b8 S* ?2 p7 T' c VMMCall Test_Debug_Installed4 s( }9 Q- W! O8 m/ w" U
je not_installed
6 W( n6 @5 d' c" X$ B
& l. b( E; t& M8 P! f7 BThis service just checks a flag.8 I8 o6 b5 Q3 C0 a4 L" S; T
</PRE></TD></TR></TBODY></TABLE> |