<TABLE width=500>
* O! |% P( ]; X% L$ A<TBODY>6 w4 X* G Y3 n% G- }& G# B
<TR>1 g# \6 g/ `! C3 G
<TD><PRE>Method 01 ' q9 [7 E D' b& {$ T
=========
3 S( \( v2 D% \3 A; ?/ Q8 S, M' [
4 B' V. s, e6 P& K! }: }This method of detection of SoftICE (as well as the following one) is
# T$ }0 z) x6 V4 S( {used by the majority of packers/encryptors found on Internet.
+ l k5 C+ _, ^6 [6 q/ S8 g; V1 oIt seeks the signature of BoundsChecker in SoftICE
/ \6 f, B" m1 K8 x+ K
& I( g1 ~7 f3 p mov ebp, 04243484Bh ; 'BCHK'2 Q/ M$ }" x3 t c- @% w
mov ax, 04h
+ ~! K' o! A: }' A% p int 3 - m. ~ S9 a, w( Q' a( r+ T
cmp al,4
5 ?- N( z! q& `: A jnz SoftICE_Detected
) P/ T; X1 x& V8 i5 v+ Z: T
: ?6 _# M9 n$ o, B- s: n* s7 v2 |( l___________________________________________________________________________2 ]4 v V# S# S* F9 g$ n* j
* K" J$ K& r5 s: j1 _Method 02( x" ?% B7 s! \/ \
=========6 d# Q5 }4 ] t
! G, H, q8 {3 FStill a method very much used (perhaps the most frequent one). It is used9 u0 h. O1 ?+ L, J
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ ?$ m5 \& U, }4 \" H! Cor execute SoftICE commands...
5 e+ }% X3 L z# t. _It is also used to crash SoftICE and to force it to execute any commands
$ Q* X) ?8 s3 ?' Z7 C+ n(HBOOT...) :-((
( Q. h o8 Y( p& N# I* G
7 P7 m$ H2 Z( ZHere is a quick description:" ^( n% t. C% W9 _9 S4 T7 t, i
-AX = 0910h (Display string in SIce windows)8 J0 r% [0 g+ w% d$ R6 k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 @4 B; A' s; e; e0 q7 `
-AX = 0912h (Get breakpoint infos)
8 L1 ]3 H& g) X) F8 @# x-AX = 0913h (Set Sice breakpoints)
) {/ O3 w5 h* P& `-AX = 0914h (Remove SIce breakoints)* q( A( X: y: n* P% n% ]
& U0 V! v: ^4 i; t
Each time you'll meet this trick, you'll see:
4 p& m+ _; \" H8 V- @3 a-SI = 4647h0 y5 f4 ]7 I2 l4 J
-DI = 4A4Dh# J; ~; h7 i' C1 @
Which are the 'magic values' used by SoftIce.
; a" i" K4 x& `, G$ FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 ?: I0 n! c2 B6 C( K( {' z3 S) D' K" P
/ k2 z2 y) |) l* A& w1 F6 e6 R+ CHere is one example from the file "Haspinst.exe" which is the dongle HASP
% H5 }# q2 _4 J, b- Q5 n) ]# I2 O y; tEnvelope utility use to protect DOS applications:
0 Q. Z- h3 K5 {# y9 A. R
) B/ H% L Q1 N4 B6 t0 j4 h1 v# z; R; t. z1 n& p
4C19:0095 MOV AX,0911 ; execute command.) _& ?1 n- |; f! |1 Z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# E' c! s5 b8 q+ y
4C19:009A MOV SI,4647 ; 1st magic value.
) q3 ^7 V" O1 Z7 L* @4C19:009D MOV DI,4A4D ; 2nd magic value.
; X1 I: d8 a+ f: c- {. A! ]4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ ^" H* f7 n+ }5 f
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! X* ]( I. X( l) R3 c
4C19:00A4 INC CX
/ x# V4 K. w- D% B* s# P4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
d4 c3 `' u, Z, E' D; V2 ]. h4C19:00A8 JB 0095 ; 6 different commands.5 M, F( G3 z/ q) X
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
o3 T' n) Z# u: s' K4C19:00AD MOV BX,SP ; Good_Guy go ahead :) m9 E2 y7 m( h! u, t: j6 b9 r" v6 L
i( C. V7 ^" E( M2 }2 C: sThe program will execute 6 different SIce commands located at ds:dx, which; T" O7 z7 l5 \ Q3 ?& L: O x! t
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; u: ]/ u+ {0 C" S/ j. x
; E9 y- E/ J8 ^# ^" I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 O8 L# Q' {3 I0 g+ ^7 \
___________________________________________________________________________
6 o$ _ g4 X9 `+ k
* j: w8 L0 g- R. a) e4 H
7 f* ~2 X3 C) V4 lMethod 038 r- f9 D! _$ T
=========
4 _, x; w4 f! T, W/ D0 W. [0 J1 ]# L: C5 i9 V' R
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) g/ U6 T, s% v0 n
(API Get entry point)
, C/ M& }6 m$ ]+ [$ j4 L7 L- {/ M4 ~ 6 E2 \& ~" c5 _
% v" |% q/ _8 u; b/ h6 \
xor di,di( @& f! H: C" P* z1 {
mov es,di
+ R/ B+ o' E) m' Z. Z mov ax, 1684h
$ g* N2 {' r( y mov bx, 0202h ; VxD ID of winice5 z$ x# i# U) y( s5 n
int 2Fh
B+ _ S( K2 D$ Y mov ax, es ; ES:DI -> VxD API entry point
/ U4 v) R5 E2 J" |3 L add ax, di
4 |6 z P9 b) B f; B2 G test ax,ax/ A. x$ K0 v$ g3 l% r4 i# Z
jnz SoftICE_Detected/ q( n7 c, d4 j! v F
7 b, R8 J/ h/ D, z" L# u7 Y ~$ u
___________________________________________________________________________
* f" k0 a3 D/ n% k1 B X4 R9 N( F* N* f) T* A
Method 04: S0 o3 Z0 F4 u r; h
=========" O; E8 k c, A4 R
t6 z# z' r- m5 ]2 K9 N$ z. o( O jMethod identical to the preceding one except that it seeks the ID of SoftICE& w" K% p( e, a j% i* T
GFX VxD.8 v6 z% b: ]; J5 x& E- p
8 t8 E+ \& \- J$ j" ]% s3 N xor di,di& ^- ~8 M: a9 O3 S$ P) ?
mov es,di
( ]$ e5 E0 w7 s& {) P) e mov ax, 1684h : A* D. L% X" v$ z- G9 J
mov bx, 7a5Fh ; VxD ID of SIWVID
( C( f/ d+ d ]# G6 L" A, i' Y2 ` int 2fh. q* ?8 W0 V* d1 s8 d3 t/ j% A0 F
mov ax, es ; ES:DI -> VxD API entry point0 V4 V1 i5 {3 g0 h
add ax, di% [4 \5 m, V2 @- b1 p9 B
test ax,ax( o* a) H/ X8 i a- p
jnz SoftICE_Detected
S4 ?( D. s8 o- H) `6 X7 V
: g% r2 e: f3 n( ]+ y3 s__________________________________________________________________________
* u! S7 r, G# r' g6 d4 Y9 o2 k9 H! V# T! e" M8 A" g& ?- i7 V
5 M6 d! X3 T& ^3 p- Y% N5 x+ AMethod 05
# _* Y$ i0 ^/ L5 h1 k# K=========! I) Z0 d9 A; g
) }' z/ q! ?% g4 g
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& g3 I. H H& z: _debugger. It calls the int 41h, function 4Fh.
2 Z4 } x9 B. C V, V: T5 T$ VThere are several alternatives.
2 |6 e- x: h. T5 m/ b
/ m0 y4 L3 i1 S% M" H9 GThe following one is the simplest:, F0 T6 V3 v6 `$ h4 M) n7 f% f
8 c! _ Y, ?' ?% Q; h/ w
mov ax,4fh1 ~9 B' L3 ^' s7 K
int 41h$ f0 G% X: a3 _: ]% @
cmp ax, 0F386
# k0 {$ x9 {, S; G# k& W jz SoftICE_detected
0 G1 f8 U, ~' p4 t5 x
8 E1 Z8 L( Z I3 G+ `* m' U, q. f4 ?& B1 N! i/ k
Next method as well as the following one are 2 examples from Stone's
; s( Y4 R% ^& p; v6 k; J1 x"stn-wid.zip" (www.cracking.net):
1 k' @' b, e# F, c( t. |4 ~- P1 A2 I+ S
mov bx, cs4 ~* T+ _. H& a+ P4 b; S, b. p
lea dx, int41handler2
7 M( f2 g* [% O% l7 Z6 [: _ xchg dx, es:[41h*4]; ]4 u) g& R) c* y) S& J7 A, I5 I
xchg bx, es:[41h*4+2]2 a- c5 _) D. i b
mov ax,4fh! d) I$ s9 x9 f, v# y
int 41h
/ B8 E# g, Z6 z u9 } xchg dx, es:[41h*4]+ m7 |1 y8 D! G$ _$ m; g( J& c
xchg bx, es:[41h*4+2]
* e- x5 T" M# ^ h+ B4 f0 s. H cmp ax, 0f386h
9 i6 z* v9 ?+ B4 A" [ m+ @6 C, i$ d jz SoftICE_detected
6 L, W" o+ B; Q2 ]+ z
4 M) U9 O0 ~2 C# V1 Q7 mint41handler2 PROC z1 z7 N2 s ~
iret
: f% q5 c, |# t& d8 M# C5 g" @int41handler2 ENDP) N, u, V% c$ E/ T
4 i! e& v, z1 B$ t8 Q2 ?8 D
5 @8 G. b. e7 ?* |_________________________________________________________________________
, ^5 v- @. A4 X! Y5 Q$ H3 o* j* F) H, z1 `# R& z9 e% K
; d& H; Q* V7 ]% r6 b+ @3 ~+ iMethod 06+ E/ h& w! ~% n7 l: ?; g# U& @
=========
2 l+ t6 ?+ H' N$ c: }# o3 [1 Q, ^8 }7 X
4 ~5 F! L: S2 B! {: `6 K
2nd method similar to the preceding one but more difficult to detect:
% j3 M8 U: F0 c' z! g* X! f6 i2 \0 J/ I3 D. V: j2 D
! N6 V4 |" Y; u! K
int41handler PROC6 z, j( P/ [" Q" E$ V* U6 p& N; k
mov cl,al
& T5 `" ~. i7 q0 H) \, I iret0 D; G1 l D7 g+ z1 L
int41handler ENDP
! W) N8 j }+ @! \! b$ d0 N3 e- U8 {5 V
7 @6 j1 p* |/ q0 d! X0 K% c xor ax,ax
( |8 `/ @& a m0 v9 r% F( I5 L, Q mov es,ax
# s; k1 e5 w& H3 H }+ I9 c# Z mov bx, cs
2 T6 {) _* }1 {& F! @ lea dx, int41handler# y+ t3 | Z+ X5 z0 c" [* \5 G
xchg dx, es:[41h*4]* B$ O4 j4 q# ^
xchg bx, es:[41h*4+2]- n" T: s7 e9 H( I# o
in al, 40h' u% W7 Q( J1 P2 ^5 \
xor cx,cx; X8 q5 y/ ~' f7 u) ^
int 41h g4 c# M0 Z3 L2 _! G
xchg dx, es:[41h*4]9 m4 j# M0 @3 b6 b1 ?, e; Z
xchg bx, es:[41h*4+2]
4 q# F! j' P% u cmp cl,al( M) o( z6 y; v8 G) K( e9 m! e
jnz SoftICE_detected0 N5 _4 x' w" ?% _
7 H+ l, d l, ?* r- ]0 F
_________________________________________________________________________5 x4 V% a4 \' \/ ^2 m. S
# f2 m7 h- i, vMethod 07
8 e' G W9 |' `$ `# h=========2 I$ g3 x% S+ ~* `3 t
1 ?, j0 b4 B8 {* rMethod of detection of the WinICE handler in the int68h (V86)
+ k0 _9 ]% Q, O& u! J6 ] _% S8 o2 l- e0 M& R9 F
mov ah,43h/ n# l3 y- j F: K) W k: J2 K
int 68h
/ A3 t9 u! @9 n' L cmp ax,0F386h
1 H, l$ o6 ^% p2 w2 Z- R jz SoftICE_Detected. u1 ^- x9 O4 a
8 X5 }6 _- T) v, x6 g4 M# d+ O) O$ S! ^2 a
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 z) {/ x! W6 m app like this:% q. G3 x; A3 t
1 P; P( ?+ r6 j" d% G7 U) p( u" w BPX exec_int if ax==68
+ c; `( x1 Q1 j9 `/ u (function called is located at byte ptr [ebp+1Dh] and client eip is2 g6 \& i/ c: Y
located at [ebp+48h] for 32Bit apps): ?+ W& X' \7 j
__________________________________________________________________________
0 K( I& P: B& n" ]: P3 {6 r7 C y9 ~" u, S6 {' y
) X% G3 H) D/ {& |/ T
Method 08# p+ n3 }0 T0 \1 Z
=========
! J. V$ G4 F( Z& L& X6 B
2 G1 r! W" O7 OIt is not a method of detection of SoftICE but a possibility to crash the- O8 y, L1 y7 t
system by intercepting int 01h and int 03h and redirecting them to another
# G0 p" P5 @- L* Jroutine.
4 X% o- t/ O. G! C$ W& [It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ p1 `! L$ S3 ^+ w- gto the new routine to execute (hangs computer...)" B7 o D' q) Y, t8 H4 C' h. c! F
6 M1 \. C7 r+ I: b2 o mov ah, 25h3 A! n7 F% o) x9 D* x8 ^0 y$ k
mov al, Int_Number (01h or 03h)$ i& v* O _! ?) f' e8 w
mov dx, offset New_Int_Routine
- h# F) }: S6 ?9 L* G int 21h
0 I* d5 ~0 x/ }4 y6 p, M% ^9 A" o& f6 ?3 {5 K
__________________________________________________________________________
K: G7 O0 o, v1 t$ r0 n! c# a4 W! c4 z4 M, b3 S, {7 q
Method 09
4 ]$ @+ C; F: }6 `" T7 ]" o=========7 l& ~$ v- ^( D( s6 o, D$ `/ _+ o$ X
; U x/ M8 w5 S! [4 P5 R( v3 wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* S) y1 @) ~: k7 S& x; o% c- }
performed in ring0 (VxD or a ring3 app using the VxdCall).
" }8 T, @9 k5 ~% IThe Get_DDB service is used to determine whether or not a VxD is installed
* V- L- }+ U# Gfor the specified device and returns a Device Description Block (in ecx) for
9 ~8 B& c0 B+ {6 s3 s1 B4 wthat device if it is installed.3 }: ^2 H9 j+ e6 b2 X) L
# r; p1 j/ T6 w
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 {) I9 Q: V8 _ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( g H8 k2 h3 ?% d+ f VMMCall Get_DDB
; h2 } N% ^$ g7 V' \ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ }- _4 w7 g( S; j" F
1 @" |& A. H# x* k' L
Note as well that you can easily detect this method with SoftICE:
+ V( I9 `2 m9 {+ Q bpx Get_DDB if ax==0202 || ax==7a5fh. ^5 R1 i2 S3 F# O/ O( t* G
$ Y( ~$ x6 r# [( f4 {__________________________________________________________________________
8 e0 ~) X5 {! }$ u* m) c, y- y. ^- y$ l2 I# k" C
Method 10# Q6 f v- j; y3 V" c% s' }
=========
7 o6 B b0 g( U* V) _5 T9 R! G" J) K, @, M, _
=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 e! m7 c! k% ~0 D- D SoftICE while the option is enable!!6 M9 e1 f" P1 f8 f; V0 v6 z
9 T4 p- S9 [7 X7 n
This trick is very efficient:
3 k' O8 }0 t- [6 wby checking the Debug Registers, you can detect if SoftICE is loaded
- W# @0 O% R, y3 [4 g4 N# ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 K+ m4 w/ T, F o; }. J9 {8 [4 L
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( X! Z/ J B) p( L P- Ivalue (in ring0 only). Values can be manipulated and or changed as well
9 C- u! l- X4 M# o# W7 }4 m(clearing BPMs for instance)& ~& N. L7 N: I' e
4 h k* W4 F9 d0 Q__________________________________________________________________________
/ ~& V/ F# }' R6 ^4 q" Q) d% d! r
/ S9 r, l) ~) c' MMethod 11
4 N5 P# ^' F# E2 |- y9 [=========3 t; a; p& Y# @& O
3 W4 f8 i' C. t" I8 p& X- y8 }
This method is most known as 'MeltICE' because it has been freely distributed
6 ~: w6 F. K7 x" B0 _8 wvia www.winfiles.com. However it was first used by NuMega people to allow7 K4 ^4 j- B. O5 _9 h
Symbol Loader to check if SoftICE was active or not (the code is located
- D1 L7 _4 ]2 Q5 Finside nmtrans.dll). \- g: b+ }0 o
1 f- q/ P/ e# ^) y0 _
The way it works is very simple:
! { ?, K# h+ _% j c0 c$ m9 xIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ S: H4 s7 [* n: f; I0 P3 t
WinNT) with the CreateFileA API.
, L7 b v5 t1 T y& C9 d( D- s0 u8 Q6 x0 S
Here is a sample (checking for 'SICE'):% [" _! j0 z8 K1 o6 i8 _
: i! J, t9 W$ `BOOL IsSoftIce95Loaded()
0 C& r n/ Y) c; Y& j& Q{
% G- {& e! c7 }' z- z) A HANDLE hFile; . e5 p2 X% b+ J& Y! t% |
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ @9 X; e, f7 x
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 R: k& `1 I. n0 L- Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 {# W" g+ C0 ]2 d: @$ g0 L' l
if( hFile != INVALID_HANDLE_VALUE )! P% U+ Y+ J3 [3 l( {- v" c
{. b; K$ q) X; R. [5 ^6 M
CloseHandle(hFile);
; N7 N% i. h: H4 q( X return TRUE;
* {( d# ]' R1 b2 Z5 p! R4 N" j0 H }
3 @* S) e( m% \" Q return FALSE;2 I2 Q/ J6 ?% k# a5 f
}
/ K* Z4 d9 q: u3 X$ O0 w
% E m/ `' V/ J* _: x, {Although this trick calls the CreateFileA function, don't even expect to be
" a/ m; v/ W5 Y1 f0 Jable to intercept it by installing a IFS hook: it will not work, no way!
" b. \" b4 X1 E4 L5 Q7 ~In fact, after the call to CreateFileA it will get through VWIN32 0x001F* F: C* d6 V' m1 T X
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, I" |* a/ H) ?6 A( w% x" Zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
% e9 J2 d( z U }9 b d1 [field.
& P6 M6 ?) O* a. r1 ?$ k# lIn fact, its purpose is not to load/unload VxDs but only to send a 9 w" _, o/ W6 f
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ |# }! t2 c( i0 A$ ?
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 U h( p& j# l W: v7 I
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ ]9 _1 ?3 n, H5 ^8 `+ xIf the VxD is loaded, it will always clear eax and the Carry flag to allow
) I! \, V7 S8 W8 Uits handle to be opened and then, will be detected.9 p6 y6 n4 t8 O8 S P
You can check that simply by hooking Winice.exe control proc entry point( L% o3 }; @$ b/ \7 e' y9 f+ B9 c; ~
while running MeltICE.1 U4 L$ y, G: @
2 s9 p8 t2 p2 x. `: m1 l/ s7 ]
7 x2 E" l, z6 P! J# O 00401067: push 00402025 ; \\.\SICE' @1 o0 G" h' ]" t0 S* U: }
0040106C: call CreateFileA5 O$ x6 e% U2 y! W* r K
00401071: cmp eax,-001
2 }' Q4 P+ ~4 W' C' W 00401074: je 00401091
# \9 |9 P* [& o7 j3 X9 m9 f8 e2 L) y* x7 E9 i( m% a% ]
7 Y# d) n+ s; G2 M$ vThere could be hundreds of BPX you could use to detect this trick.
+ A% ?! F' C! E: v0 b-The most classical one is:# k3 z0 J! B* f0 e9 \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||7 D! @, k2 i+ J9 s/ j& m7 Z
*(esp->4+4)=='NTIC'3 [9 n1 g% J- h$ S- G' `
% k* c, E3 U% R4 k-The most exotic ones (could be very slooooow :-(
2 y3 @; a6 u! G+ H% _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ j8 g. }" j2 P! H ;will break 3 times :-(
: M+ B+ L2 `# _' r/ C. M$ g2 N. ~- B3 O2 I, D
-or (a bit) faster:
. c( e$ u) O+ h' Q+ q BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 [! V" f9 N6 t2 M T1 S
6 j# x0 N- B6 ^( T9 B# N BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ( k! p4 |+ i6 i* I$ a
;will break 3 times :-(
5 w; i0 I" Y4 k }, X+ |: D0 ^" t( S" N" h- Q& o N# F
-Much faster:4 A. Z# p4 f$ h0 V: ~' n) o
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', O8 P+ u2 W" Q$ E: z
4 z9 ]7 V0 K4 ?0 g+ dNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
# e2 r& D9 p5 w7 [' d; P2 j5 |- ?function to do the same job:
3 D9 b) s( v( A- n& D3 U6 q( p4 R
push 00 ; OF_READ
" g: d2 Z( M6 Z6 r& @4 Q mov eax,[00656634] ; '\\.\SICE',09 f: O1 b e9 o" y6 k
push eax- y* M5 f& Q( z: R: Q' `# K
call KERNEL32!_lopen$ Q* q0 f' G" o! D! l+ g* H
inc eax
$ g4 F1 x% F$ F jnz 00650589 ; detected0 _/ Q/ o) \1 I8 ^: l
push 00 ; OF_READ
0 _; N; w. V- k% |( [. @; o mov eax,[00656638] ; '\\.\SICE'7 S# G$ l: m! R3 E% q2 R
push eax, y L: `9 V1 t% }$ L9 O4 S5 ~7 `
call KERNEL32!_lopen
/ D& I0 s, `! j2 G4 [& r inc eax
/ \$ u8 f& Y g- e+ ^6 W jz 006505ae ; not detected8 K/ O! j; _# `8 ^9 ^9 v3 k
Y( D0 U* t* L+ Z2 o; C# j8 s/ s
/ e1 [$ d5 c6 F, M__________________________________________________________________________
1 X$ t$ B* i6 {3 b7 G9 k, X) t, m- l( {, G; @
Method 120 q- X& p' k' `3 G
=========0 |+ D$ X* {+ t$ j
1 P' ?& z0 r- w5 d! O7 OThis trick is similar to int41h/4fh Debugger installation check (code 05
5 i/ e) @/ n: p: N& 06) but very limited because it's only available for Win95/98 (not NT)1 s2 M' n, c$ L+ V) @# `- H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 x# t9 T6 @6 M) f
4 O) ~6 {- M' [3 \' F& e
push 0000004fh ; function 4fh, h5 g# G' ]/ Q5 F) c, {2 H
push 002a002ah ; high word specifies which VxD (VWIN32)4 F2 V+ W, D/ b& Q) _
; low word specifies which service
/ ?; w9 h8 R( f7 n: o( p h) F5 G (VWIN32_Int41Dispatch)! P! q O* G0 Z
call Kernel32!ORD_001 ; VxdCall
( k8 \' T8 _1 [( l cmp ax, 0f386h ; magic number returned by system debuggers
% f4 ^: r7 Z4 _7 M5 a" Z$ v8 b jz SoftICE_detected
Y+ k7 k$ ?' w- {0 I
7 j8 w3 g" e( a7 H) T" X4 vHere again, several ways to detect it:, ?/ f. A3 E7 g5 Z7 Y
* D1 ^4 E2 q0 ^/ q: N% b( |$ Y
BPINT 41 if ax==4f
/ K) J9 `5 M' g" J# ~8 X% J4 t) j+ E" F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 J# m7 @! c r5 ?0 `
# }& D' W, p! y$ X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 \' ^% r) G# z: l W7 T6 y
1 L+ U9 ~# H. Q) F" Z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 j( b' x* d+ t, X- N! ]9 \
- @" f: m4 P* e; M+ y5 B__________________________________________________________________________/ y6 C+ V z" ]0 M! G& Z& N
7 c1 H$ I" U1 Q0 S! b7 J: s# EMethod 13
, s0 H: i$ h8 H" J @5 M) D=========' h1 q* N+ f( E
7 Z) h! E9 {# C. |+ ZNot a real method of detection, but a good way to know if SoftICE is
2 \* k, A3 i3 Z# ^3 ~; finstalled on a computer and to locate its installation directory. r% r: B3 P& @0 r) z5 [
It is used by few softs which access the following registry keys (usually #2) :' u* p3 u5 ?. n: ~+ i
2 y/ E9 O% b2 B( l- d0 }0 f" [
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ l/ t' o: S' M! Z( E# Z, x3 f, G\Uninstall\SoftICE- g8 x: K% e% R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
J* k. J" i9 O5 _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 r& V7 D% R5 `8 e8 L ~
\App Paths\Loader32.Exe. G) G. J/ x' w+ [% R9 x9 e7 h
6 w) D: l/ C. R" R! Z. b9 A6 A
r' U3 v7 @& w" i) M8 t. DNote that some nasty apps could then erase all files from SoftICE directory
: N3 n/ T- ^: H8 d9 v9 e7 s(I faced that once :-(
+ ]+ d) f& f) M7 `$ a9 z M9 ?' d: f0 Z" I
Useful breakpoint to detect it:# W! l( S/ G$ y. o! F- ?
, f% t5 T, K4 n M BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' c! ]1 |3 C+ ?
5 d1 c- ]. F G N# [( d
__________________________________________________________________________6 l- n# e4 F5 E5 k! S
8 D. x8 M+ u$ P% @$ b/ M
& n+ e6 _# _) F4 L/ ^
Method 14 , Z% G- k. e6 F. {; ~: g) v/ O
=========
' B) S( h- z* S
n) f0 A' q( gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" D' T- ]2 S) P& K: F' O) u& fis to determines whether a debugger is running on your system (ring0 only).
3 a/ O2 _8 R, ]( {! ^* L- C1 _7 ~, J2 u) i
VMMCall Test_Debug_Installed
, j+ Z7 i- ]3 \' N* M. _& } je not_installed v6 p. k; v ^
% R. R9 X- w! B2 Y7 N# i3 @
This service just checks a flag." E( y* W" R' N6 F0 G; `
</PRE></TD></TR></TBODY></TABLE> |