<TABLE width=500>, @& W" S$ l5 g" B& l* L P
<TBODY>$ e8 W+ y j8 [" {) ?7 J, e: o& o) @
<TR>/ w) t! s P- U% c {
<TD><PRE>Method 01
6 S, m/ b a3 Z2 V=========' w. a6 q& H) W7 ~
5 B6 Z A* h; iThis method of detection of SoftICE (as well as the following one) is
2 v- \: [4 q D$ Q. T- K" P! O. Zused by the majority of packers/encryptors found on Internet.4 O- Q6 H. f& X) R) ^
It seeks the signature of BoundsChecker in SoftICE
D% B2 E% W& e
0 ?" W( i) n* N E5 r mov ebp, 04243484Bh ; 'BCHK'
) G$ s s& ^/ V$ E3 }( x mov ax, 04h
" B$ ?/ A7 }: m( e# ^. |" J int 3 , y) {' b9 Q6 {- |. Z( p
cmp al,4
. Y* d& X0 L# `, v V jnz SoftICE_Detected4 X* k- E) M1 T* F
' N1 z+ }* d' k P4 a4 P# F___________________________________________________________________________4 y) N- a# @4 p1 K: v, s
- T, U, _, k |0 S
Method 021 y! o* l& L- N. k7 {
=========, X+ P5 A- {% X4 s5 I
( @, }- ]4 q" ^& K; L/ W u# ? y! ]
Still a method very much used (perhaps the most frequent one). It is used
0 Y/ o7 R% K6 Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" @2 t4 I! s9 j3 U$ dor execute SoftICE commands...
+ n( n! d$ m- Z7 f8 uIt is also used to crash SoftICE and to force it to execute any commands
; ?# S- Z. |3 K) o+ ]- }3 u(HBOOT...) :-((
/ z9 ~. L1 C' E7 n
: h0 a# i* ~: S" o2 XHere is a quick description:1 _3 i0 {, i B7 f+ \
-AX = 0910h (Display string in SIce windows)& W' ^( m0 U* z ]/ v( I' F, N8 [
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& d3 F7 D" K9 `0 W- K3 g% A
-AX = 0912h (Get breakpoint infos)
! A; B4 c) Q0 e( C9 D-AX = 0913h (Set Sice breakpoints)7 k; q: d7 P- C, m B; H
-AX = 0914h (Remove SIce breakoints)
* G6 i' J* ~- I5 p/ Q: l4 n" l* O" u' @/ m, ^* y& A$ ^
Each time you'll meet this trick, you'll see:
2 T0 ?9 K- D' o/ H( S% a7 V-SI = 4647h
/ R8 v4 S1 F- T$ R8 e! _& m# \-DI = 4A4Dh
" _" v# W0 _2 d1 |& m* F; q% LWhich are the 'magic values' used by SoftIce.$ r5 k( F5 j5 ` w
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 g) P- x3 t- A9 a' ~! X6 ?
/ M0 b e6 s' r$ |
Here is one example from the file "Haspinst.exe" which is the dongle HASP* J+ y+ q/ n; J/ w4 x
Envelope utility use to protect DOS applications:
4 I! U% m- a4 N0 e1 {
$ a' k; o7 u) R w1 b/ f' I; @
; w& }; K, J% w4C19:0095 MOV AX,0911 ; execute command.
$ U# x. t: W7 n& s& B: k4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* n i" `. ~$ G- l. q
4C19:009A MOV SI,4647 ; 1st magic value.
4 o# o( C& ~& g; f4C19:009D MOV DI,4A4D ; 2nd magic value.
" R( `# A" o. h; ]9 y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ x, T7 V6 A+ w* g
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. @( M! ?2 y( t& R
4C19:00A4 INC CX. {3 g! f' j: w A5 ?5 s
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ c/ o9 R0 @; o8 s. x% e0 `) [* F; U
4C19:00A8 JB 0095 ; 6 different commands.6 ?4 e2 S, \" w. O, o$ h# j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.* `- V3 S9 v: P6 Q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 Y5 J s. }7 ?/ o0 Z6 e- {# u
$ u' f+ e0 K6 \- F: j0 n! KThe program will execute 6 different SIce commands located at ds:dx, which- L" R( e8 n/ ~: @4 v2 ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 }, c9 I, m/ ]1 s# ?+ c8 D* |$ e. q- v& `$ Q; o
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# R% B. A* P5 @/ E
___________________________________________________________________________
% ]$ L1 w2 C. d/ L; x ]7 o; f6 a3 x9 v
5 W8 H$ C3 ?; W! @9 `) v
Method 03
# H4 n/ _& k/ e) ^. e4 p=========6 _" G1 r! m8 q: ^
4 I! y ]- L- mLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h; l$ L" X$ b# C4 S, g& \
(API Get entry point)
4 B$ u% ~2 Q' f1 a6 _
' `0 P; P1 S* S% P4 d% V+ _6 h: _( Y7 p: l( y2 | g3 E. a
xor di,di
- d5 ~3 I0 \0 G mov es,di- u H/ h! z. a7 N6 }
mov ax, 1684h & O! R$ k5 C' F2 O U
mov bx, 0202h ; VxD ID of winice
& {/ b3 O* S/ L; ~1 X int 2Fh `! T/ n) N2 ]2 n: S4 v6 u6 e
mov ax, es ; ES:DI -> VxD API entry point! j( N8 G0 n( d p& u! x, p
add ax, di3 l% a. N" D8 W- g2 V; H
test ax,ax9 O; } ~4 m$ a. N
jnz SoftICE_Detected# `+ j; i2 j. ], d# Z
7 y! l8 x! `/ c) A2 ~
___________________________________________________________________________
: P, G8 X* N0 W) n& M" N
3 ?4 z" r# n8 _: { xMethod 04
4 X5 I: {( X5 K; D/ x=========5 j6 W- C) ]4 i
6 C8 Q- c$ k$ d+ X5 @& FMethod identical to the preceding one except that it seeks the ID of SoftICE
' A4 I) I) Q: LGFX VxD.
q# I7 V( }8 _ ~) |
) k4 I# o1 S7 e6 H xor di,di. a: p5 c s, m* j" C' i& k
mov es,di, H( H- I- a( f: O( I( J( A: s
mov ax, 1684h 4 B( }* P, H+ \7 m$ I* s& J3 r: Y+ L
mov bx, 7a5Fh ; VxD ID of SIWVID
9 l2 i t- M5 @ int 2fh2 {0 p$ z+ k9 B# D1 S8 I
mov ax, es ; ES:DI -> VxD API entry point
# l, w8 w" [; C) x add ax, di
8 [2 G; K% `+ {8 c( M: \ test ax,ax* |+ d% Y: [+ |1 E9 I
jnz SoftICE_Detected
% `3 y. j' p% }# d3 V5 U$ |) B% n2 B) T7 \2 x) O
__________________________________________________________________________
# m; w5 k. b7 j+ I+ t2 Z; z: w( ] W6 X6 A5 K
; R& y [" |0 Z7 X7 `6 }Method 058 B, a: S* {: {
=========
1 k8 v% T8 F) D, k. f
, x6 Y& @! K/ R3 ], f7 Z+ V( JMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ @9 A& Y" U: C l8 |+ M4 B6 P
debugger. It calls the int 41h, function 4Fh.) Z" y V: B6 d! g: _
There are several alternatives.
2 u6 s( ~- n Q
7 _3 X( k, y9 u# N/ b$ |% yThe following one is the simplest:% Q5 M ~* a, u
$ |3 F" m+ C/ z: y9 i mov ax,4fh
9 _6 j# M) E# @8 @8 K int 41h# { ]2 E% v1 q, z
cmp ax, 0F3866 M4 v# }) a% M
jz SoftICE_detected" Q Y( T3 V: X7 |2 F: [( W3 e) \& n0 c
" S; |" _6 i i1 }! G% Z
( z4 z+ R& a+ N2 Y- C- T3 V
Next method as well as the following one are 2 examples from Stone's
+ m- ?8 z" m1 [8 ]( w; s3 `"stn-wid.zip" (www.cracking.net):
4 X* p# y* ~7 T. N' ~5 o7 o+ T0 G4 @8 f( |) }
mov bx, cs; Q5 G4 S4 }* G# o" T9 h2 }8 q
lea dx, int41handler2
- {2 r4 L0 H: \" N xchg dx, es:[41h*4]
/ |$ Q" i4 g1 c8 t8 w4 _2 n& z xchg bx, es:[41h*4+2]
; E! l3 Y: i3 }# E6 O mov ax,4fh# X( E7 L k& o+ a% U" T2 E
int 41h
" B7 T/ A! Q9 ]; V xchg dx, es:[41h*4], U) Q/ v; F; A1 m2 B
xchg bx, es:[41h*4+2]$ o9 S" l1 f6 i* F( _+ ]. x
cmp ax, 0f386h. U! i" T+ h& ^: ?0 D. ?/ r
jz SoftICE_detected8 P' n5 }9 N3 G% f2 @: b" H2 V+ ]+ [
* i6 y* F8 _8 z0 @! d% wint41handler2 PROC$ y8 \8 }4 d5 P
iret0 q) v, U* b# H) X6 ~
int41handler2 ENDP: ~6 N. q8 W0 ] v; A7 ?! J6 b
2 }: o3 u3 Y7 F4 Z/ N" [$ l
0 B) W% F1 T A7 G) n' N_________________________________________________________________________4 v$ d0 l6 ~5 Y* a% [- Q
: Q9 m& {9 b" J2 m- k4 D q0 i8 W2 c$ [4 ?2 E: N# T }$ G
Method 06, d; e( a% K( k" h8 F
=========
2 L0 n( J, X( u; m" X9 i' ?* d- _2 l
$ X8 m1 P s/ v: g2nd method similar to the preceding one but more difficult to detect:$ c1 E. u; z2 u: D& ?) R- G
; o2 P" C+ W7 y9 u9 F
* S. q7 l1 s; Q6 Oint41handler PROC
, R* t# F) r% @5 [; B* e' E mov cl,al
Q% k- W8 Y, L4 w9 G4 g- R iret
" e. q n) l3 N. F/ sint41handler ENDP; {9 k( B) i1 x' a9 {6 I, r' F$ P7 c
/ ~& ]5 K0 c- } u! [( f
5 e0 C# |2 Y: ]7 ~+ D3 P; V
xor ax,ax$ i! b7 W* x9 V7 d/ R+ l
mov es,ax" _/ ?( `8 C% @7 n( j
mov bx, cs! X* q- e! M$ O$ g. \
lea dx, int41handler1 w: k* r* S- X# ~; @% @
xchg dx, es:[41h*4]2 p0 M: H3 m5 m7 R
xchg bx, es:[41h*4+2]
7 ]( y; H+ |# `& b0 Y- | in al, 40h
& b' d: \" w0 T' D: m, a6 [ xor cx,cx9 |& k0 C% p. M; i: K( ?: g
int 41h
' \8 t4 x5 I, c. O$ K% k! @4 k3 b# c xchg dx, es:[41h*4]
3 x0 b/ j( n+ W xchg bx, es:[41h*4+2]
' u3 {- {) t# ?7 W6 R" g cmp cl,al
5 @; V! D7 f# R* L, o jnz SoftICE_detected; w( Q8 o: m0 |! E, H) J
# v* ]( k) a! h3 z* @1 c
_________________________________________________________________________ p$ `& L5 a3 A4 ]9 M
: T$ |; A4 h6 w H H
Method 07) l( G7 q7 z7 k7 L) z$ p
=========
4 @: h5 h# h6 \: f
$ I% r5 @7 b' rMethod of detection of the WinICE handler in the int68h (V86)
* Q8 _, L9 O! k. p1 L
9 N! u4 s) ^ J; s4 } mov ah,43h# f# F0 f& U! G4 G
int 68h
+ @$ j0 h! V$ i cmp ax,0F386h
' z% |; Z# c2 t# D: v5 Z8 Z3 ?! r jz SoftICE_Detected! o* Y1 ^! ?* f: o, d( [- v
& d. U/ _* B4 B8 n/ L% _- `8 J; e% r2 c( P! t0 h7 f6 G
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 b O' |2 A' _8 E$ P8 U app like this:0 J5 A8 n6 ~( }/ ~
8 R9 N" W V y9 S1 Y6 O. D; S; Z; I. I
BPX exec_int if ax==68
$ j+ C. S: D6 j (function called is located at byte ptr [ebp+1Dh] and client eip is7 | y0 ^, G: g4 l
located at [ebp+48h] for 32Bit apps)0 Z" f% E0 m, D8 V% p) I, y
__________________________________________________________________________
5 ?: O: v: G' S& _8 \6 n$ W5 k0 ?" |0 B6 t+ a
6 N+ t9 W8 Y u% r3 Z& E
Method 085 x+ O7 m8 w6 q/ z# O8 N/ z
=========
% r, k$ d5 ?5 m( w' o) U# }
' d1 C0 n5 R# R' O% {! }It is not a method of detection of SoftICE but a possibility to crash the
4 t5 B% _1 O- M8 M7 r- @; d9 bsystem by intercepting int 01h and int 03h and redirecting them to another' I% G& E# @9 n0 F8 C
routine.
. |9 V/ T) v, x& o% {' e QIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points; N# Z/ \: \- ]- P$ c0 O3 r, \
to the new routine to execute (hangs computer...) M1 @/ A0 b# i; B* q
$ t( x! _( A9 t% L. m
mov ah, 25h
) O. `2 Y& x# _4 Y1 A' W* \ mov al, Int_Number (01h or 03h)
% G9 g1 c/ b% _5 m: q mov dx, offset New_Int_Routine
- z, D& y( |1 O) D int 21h* R& [/ {0 d8 @* o& [5 H
; k8 _ |" L9 n: @* r__________________________________________________________________________* n, b. H. e$ X4 v, u8 j
: B3 b0 B, V+ o1 }Method 09
2 b; t0 ~8 J' g* W) ]=========+ R3 N- e; |$ y5 U3 o# ^
8 w& S& W1 C1 d ~This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) w* e- y$ D g
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ K# y- k* I$ [5 AThe Get_DDB service is used to determine whether or not a VxD is installed. j) ?% p1 j- N, F. ?" o
for the specified device and returns a Device Description Block (in ecx) for
6 Z/ ?4 r a1 e% d {- K4 xthat device if it is installed. W% f5 ?5 y2 O9 _: s6 j, s
3 R5 D4 z* q; n+ m& V y+ p/ F
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 _4 Z, _; V; i K4 {0 N
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ r* u: p- f; F: q
VMMCall Get_DDB) \/ R4 F/ t! }2 e6 q7 Y
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed" B( O) m" B" I8 i0 {$ c% [- x
6 F0 [: E& O# M& i7 aNote as well that you can easily detect this method with SoftICE:2 {" H3 W- B* j W* \
bpx Get_DDB if ax==0202 || ax==7a5fh; J' |4 e" \1 e- c4 D K$ U$ V
1 N4 B" J9 J& \0 N3 u; i( l
__________________________________________________________________________
" G; ]1 o) I' X3 h8 O7 A! K2 z# ~0 i- E$ M
Method 10
/ T1 s+ v$ Z1 d=========3 T% L, v3 x/ p6 ]0 ^( v: i* K+ O
( e0 n, e! @! o! C' O2 Z) h
=>Disable or clear breakpoints before using this feature. DO NOT trace with* A3 ?# }) Z5 {; j
SoftICE while the option is enable!!
/ O9 H/ Q P) q: h9 K# r4 t. j9 g
6 F( e& H) h8 p" A( gThis trick is very efficient:$ _( {9 F1 |2 ~: n9 ?% D- O$ _
by checking the Debug Registers, you can detect if SoftICE is loaded
; ]4 m5 e& S* w/ O0 K4 a0 N/ m(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 j/ C8 r- ~( w6 ythere are some memory breakpoints set (dr0 to dr3) simply by reading their
$ H& l4 y* M3 q' S y$ q! nvalue (in ring0 only). Values can be manipulated and or changed as well
# I5 r3 E `' x$ N2 N& h(clearing BPMs for instance)# X, ?7 E8 `/ X$ ^& P, @6 g+ N( B
1 @+ y) u5 g; q2 x__________________________________________________________________________
" H0 h% z! C0 ] C' ?" |
; V$ e9 h, }# @2 N/ {Method 11: f# U( ~. C1 B" {; U
=========
$ u0 K8 @) c% F) I6 \) L3 y! B& O6 l7 b9 i6 b7 U& `
This method is most known as 'MeltICE' because it has been freely distributed6 E/ W3 p3 s' E2 I5 E
via www.winfiles.com. However it was first used by NuMega people to allow
, C4 w# V0 a7 |Symbol Loader to check if SoftICE was active or not (the code is located7 G' U6 D0 a: p' a% ^, r0 _
inside nmtrans.dll).2 t0 l. w4 {$ T* A
e# f0 I' H' a* R
The way it works is very simple:
- o$ {: \/ y1 H0 I. h& DIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ A6 `: H% o, c& v8 n. E- ^0 Q
WinNT) with the CreateFileA API.2 M# S* k/ B: O0 a G
9 f2 G# F T0 F& O, z$ ?
Here is a sample (checking for 'SICE'):* y: u7 ^/ O! Y1 H) ]
$ n* B; L1 _( A/ i& Y; j8 l3 R
BOOL IsSoftIce95Loaded()! n" C6 r- X$ e! {# [0 X, A
{
$ H( `4 D) Q7 ` HANDLE hFile;
% H3 b- a; D# x6 ~ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 J2 g' c; \" N FILE_SHARE_READ | FILE_SHARE_WRITE,
6 P$ q- ?2 l9 d1 u5 P7 Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 i, \% q2 ~0 U$ n# X7 }" n
if( hFile != INVALID_HANDLE_VALUE )# h4 b* J! }0 l; B
{
7 l2 p+ S1 Q8 v) q0 Z! S4 X8 E CloseHandle(hFile);1 @9 ]5 R6 F% c# w; K' V
return TRUE;7 h. `* P* C0 T
}
1 }) H! G4 @; _ return FALSE;% {2 \! ~- z" G
}# @3 r- ~/ ^' e4 e, s& p
- Y* _/ S5 A6 WAlthough this trick calls the CreateFileA function, don't even expect to be( H* J7 K; y' I
able to intercept it by installing a IFS hook: it will not work, no way!1 ] M$ q) X( a# k) A* R8 W
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
( t$ p6 L; G6 ` jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 I; X5 l8 `% Y1 D9 M- @
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ R( h$ B6 X/ afield. }0 W! s. Q& d
In fact, its purpose is not to load/unload VxDs but only to send a ( |' @/ ~. I, h- @0 g& w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
# U5 u9 K) _$ m8 x- j4 g) ?8 _to the VxD Control_Dispatch proc (how the hell a shareware soft could try! J& ~# J2 d3 E& R& X" r
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
" f* x2 [: @- U4 `7 E- mIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 @/ j/ i1 ?) H. j8 ~
its handle to be opened and then, will be detected.- M# G; h% P1 w
You can check that simply by hooking Winice.exe control proc entry point
5 L+ p8 }# v. H% vwhile running MeltICE.
1 S( T5 H5 _( f, g
( N: B5 q% N9 i5 X. g) a+ \$ }' ]
00401067: push 00402025 ; \\.\SICE
9 p# U0 a. E: \3 w7 i 0040106C: call CreateFileA( \0 d# D2 ?9 E* J( t+ Q+ {8 k( K
00401071: cmp eax,-0014 r! l* z/ A# b$ @- F' R) Q
00401074: je 00401091+ K4 u8 _0 C0 g; W8 J( x# u1 l1 F
& B1 X" [% S- ^
' P& v. j+ e1 _) ?% m$ ZThere could be hundreds of BPX you could use to detect this trick.2 B+ T6 B! }* z0 V1 c4 s" c5 Y* s
-The most classical one is:9 z+ Q3 r. R# s E% E8 |$ e2 r* y& B
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ z8 S4 ~# u, P$ \' Y *(esp->4+4)=='NTIC'
9 @# j f2 Y, b5 p' S0 V9 R8 f/ m% [2 b) O' j
-The most exotic ones (could be very slooooow :-(
" M' b& z' k0 g* M0 F3 T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; [6 y5 K5 c( m# c6 F- K
;will break 3 times :-(
; {9 a6 }1 c3 x4 p0 D8 r; |, G; k
' w; @# w) |4 a+ G d-or (a bit) faster:
7 K$ p7 a9 G% I, A) X) N% a6 V+ y0 s l BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ Y% j: Q' W' \! n
% f. _3 V6 D2 W' F$ H- b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ( r) [* T% K) V5 J
;will break 3 times :-(1 f4 `& x3 w+ ~; @9 W- Z
% ?) w. m" j" Q& ~/ _/ N' f-Much faster:, N- }4 k% g: \& R' \* l( q$ {
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
; @, G: }( b. j" `, P( J1 n, c# n1 E1 }5 j+ \
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen; N* O0 `4 a5 k% j; `7 I7 v- j
function to do the same job:0 }: \+ [9 z4 v4 G. u2 y4 ~
8 Y5 p4 b! {$ `* H push 00 ; OF_READ
3 D$ ~" D, m4 W5 a mov eax,[00656634] ; '\\.\SICE',0- ]6 j3 r6 O5 Z4 U+ f
push eax
( Y; Q1 L! V& {- @$ `* S1 s' V0 o! s' B call KERNEL32!_lopen1 ~+ O. U& c8 P; X
inc eax A; G& P: u/ p/ b/ X
jnz 00650589 ; detected3 y% H: {1 |; d3 _7 T2 V5 D
push 00 ; OF_READ
" h# ^* b- Y. Z* b2 a& G! R mov eax,[00656638] ; '\\.\SICE'$ a- |7 w* K, |9 j% P: _% a4 y
push eax5 H. N2 U& d9 a* B- C$ \2 X
call KERNEL32!_lopen
5 C$ L' t* g/ M* G# r7 @ inc eax0 G9 s6 E3 U4 Q, L1 j
jz 006505ae ; not detected
( D; r2 Q# w% u8 V6 F- G4 U5 z8 d( c8 w. a" M3 @9 W7 a
1 W" x) }8 P' c, {; P% Q
__________________________________________________________________________7 s" t! u! X1 w$ T4 s; D8 R; Y- L
h [0 z* d- d/ w+ G" ~Method 12 X H$ M! |. Y7 t7 n& h0 U
=========# C" W( r5 @8 q) W, J9 _4 [8 m
& x( m$ x/ ~% w% H4 pThis trick is similar to int41h/4fh Debugger installation check (code 05( \0 u" @4 t% I% v" Q
& 06) but very limited because it's only available for Win95/98 (not NT), B# b( {# b+ r: c4 T0 T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ |" l \! T% G, q+ H/ E
6 N: n. h5 Q7 a. u% v% @: N
push 0000004fh ; function 4fh
S5 b( U4 J( h# N0 Z push 002a002ah ; high word specifies which VxD (VWIN32)6 n0 I* ?" S/ C) Q, s6 l( `) n4 o
; low word specifies which service! M9 e* d4 x; o/ Y+ w1 W
(VWIN32_Int41Dispatch)
6 C' h# Q% @8 S, g- X/ g! T* Q call Kernel32!ORD_001 ; VxdCall( x# c- R3 o2 Z: i; F
cmp ax, 0f386h ; magic number returned by system debuggers/ N, w6 l9 G3 T) g- G7 O. _
jz SoftICE_detected# Q7 d$ {) y1 S6 O0 D! H B7 A
- y; i- _2 I6 j( PHere again, several ways to detect it:/ k& l8 v9 {- o+ r. o) d9 i
* D% C2 n2 |0 g5 e9 Q
BPINT 41 if ax==4f
! M; H9 ~5 g4 o( R" t/ Y. _' n+ [& i- Z t
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ k8 d+ T$ ~6 j# t2 M) _# `
& N# ]6 N0 [' P% g* j( {( Z BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 F( P5 [" }3 H/ @; T2 K
! h2 R6 S' r0 x% t! L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# A% `0 d5 l2 f) P0 L l
( B2 o! Y$ }0 f* ~5 B__________________________________________________________________________4 p6 |2 ?# X; }9 r9 _6 }" S& R+ ]& \
# q) S9 b3 q- a. p2 a" |: m$ nMethod 13
: K: P( X4 o9 D/ u' r=========7 D z+ x1 C) G8 k h
: h$ w' D* n0 I z6 c
Not a real method of detection, but a good way to know if SoftICE is7 C2 Q7 ^5 M% d* \
installed on a computer and to locate its installation directory.
$ ^: z) @# I; B3 l$ ?, lIt is used by few softs which access the following registry keys (usually #2) :
0 O1 r. v; w, x# E- }2 l3 ^2 H1 }2 a; @* l3 `
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, G1 M4 }2 S6 n+ ~/ _+ ^\Uninstall\SoftICE' [6 d8 I3 a' Z! F" P+ y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# b$ @* ` c$ o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, \7 a p: N: E4 v3 X, `' K+ |\App Paths\Loader32.Exe
9 A4 S3 \. U) T& B- }7 J7 W/ i7 J# V; a# n1 Z5 ~$ S3 y: Z
; w9 H1 g; d! CNote that some nasty apps could then erase all files from SoftICE directory
0 q4 K, w7 a- n5 K: {(I faced that once :-(
. E# {9 ^5 H( L" K% H+ s" B k: ~, u& t* v* q( o- |
Useful breakpoint to detect it:& W u2 a1 R7 h! s, M
/ l4 o% Q/ m, q( A5 A, {7 m BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 ?3 W% ^% V- D$ u2 k8 \4 `
. U/ E& a: r, D7 I0 {
__________________________________________________________________________5 D* I4 S- ~- R0 f1 @
/ I4 A# o+ o. N
' l5 M6 L, o$ H' x8 j N- gMethod 14
" m$ C# U, E$ r @( ^=========
5 [# @" r$ I" d8 E( N# N6 k, ~5 s+ v- F$ E$ |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 _9 {7 V G7 K* X$ v% cis to determines whether a debugger is running on your system (ring0 only).
' B- F5 S; U+ C6 R6 T' g/ ]% T
VMMCall Test_Debug_Installed
- {" v6 L* ^' o' j$ K+ j" x je not_installed2 W0 O9 x* J% c0 Q/ g- l y. p
; b* J4 f# a) e. Z
This service just checks a flag.0 x& L s5 ?0 E* w* g! ~
</PRE></TD></TR></TBODY></TABLE> |