<TABLE width=500>4 d' c' b5 R/ L( t a7 U" S
<TBODY>
$ Z: a$ `, ~ e! P! B<TR>$ Y7 J& P" h* u1 r. L4 a0 y6 }, J
<TD><PRE>Method 01
$ {+ [) i( S3 h- G$ ]6 m5 y* ~=========
4 T5 ^0 X, r- m5 \! g8 t
% d, }- J5 W/ dThis method of detection of SoftICE (as well as the following one) is$ S3 T6 [. p; N2 N
used by the majority of packers/encryptors found on Internet.
$ s1 v7 l% |5 R$ V1 oIt seeks the signature of BoundsChecker in SoftICE" @0 M% X9 G. W
8 X. }* W, e' B" b' R
mov ebp, 04243484Bh ; 'BCHK'
$ ?9 }. d) c: u9 i E x1 ] mov ax, 04h
5 x& C/ ^* s8 w, e int 3
5 t) r" J1 W* F% b, h) X cmp al,47 u* J! v w$ V5 ~: }
jnz SoftICE_Detected
; d4 l+ t7 X- E0 q$ _; D* l, Q' @, T1 r( k
___________________________________________________________________________
$ Z# n8 p4 z6 U) T0 o9 N" G+ [( ^& {8 _9 S+ p
Method 02
9 m4 Y" N8 i& b' ]=========
& \: G2 n- t( r) ~
- l' F1 r, {! ~3 W, wStill a method very much used (perhaps the most frequent one). It is used+ }3 F& C/ V8 X6 A; U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ a4 E/ w* f$ } F/ xor execute SoftICE commands...) e/ A# M& [6 U1 O
It is also used to crash SoftICE and to force it to execute any commands7 D% j% x7 K/ I+ y9 s
(HBOOT...) :-((
7 e: ~- E: t8 f3 n0 y/ e9 s
3 j( V) A8 ^. g/ R+ iHere is a quick description:
; X) P0 O- C5 X+ _ k2 s-AX = 0910h (Display string in SIce windows)
! P3 e0 Y2 o2 x8 r-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( s) z. s( ~5 [7 F, D; f3 [: V! q w
-AX = 0912h (Get breakpoint infos)
) w" C K: N" e& l3 I-AX = 0913h (Set Sice breakpoints)) k: x& s# s N( O4 f
-AX = 0914h (Remove SIce breakoints)+ j3 j; }3 W# l! L5 S
* P3 y! B4 `& U3 E+ l
Each time you'll meet this trick, you'll see:
. m3 I% U# I0 t Z1 A9 g. c: r' I-SI = 4647h
) L2 J1 E, D' i9 i-DI = 4A4Dh8 E* j9 e; n. n, Q
Which are the 'magic values' used by SoftIce.
O- G: _, X- @& ? x* g$ EFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 d5 K) a$ |1 m# ?4 Y% _2 W" d$ q
3 f3 f9 ?4 h- B% V
Here is one example from the file "Haspinst.exe" which is the dongle HASP% q& }5 ]6 I# p+ b F) ^& E
Envelope utility use to protect DOS applications:7 x# g7 e0 d/ R4 g" H, E
$ G! h& m3 F/ L9 V3 C( |' a3 U
4 k4 M6 ^2 l) u+ v0 o1 t' E, `3 t
4C19:0095 MOV AX,0911 ; execute command.$ Y1 _8 f2 t3 G3 ^ H
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; q Z; I/ u( J/ G) C1 l8 e4C19:009A MOV SI,4647 ; 1st magic value.4 Q0 ]5 W- g2 p5 Z+ e, M
4C19:009D MOV DI,4A4D ; 2nd magic value.$ c# g4 a; t+ U! m; Z# g" c
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- w3 P$ n6 w7 X6 k4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 |5 ?, I) `9 y( ]8 ~4 j
4C19:00A4 INC CX2 f' U9 _6 n4 K$ R7 k' l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ G: ^4 Z7 s/ `* v3 j5 O
4C19:00A8 JB 0095 ; 6 different commands.
7 _1 P9 \" p @" G( \ P7 y5 Q4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 x: q/ N1 _" f; m/ e! c; ?
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 w* J6 \3 |! h/ q: k/ d$ z* u& I1 }$ ^
The program will execute 6 different SIce commands located at ds:dx, which Q- g; y4 O$ w. h
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. l3 F; P+ C9 S3 R# J
2 i- U; G# `2 U5 G* n9 w+ G; R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' j4 D- w6 v2 G7 e y___________________________________________________________________________+ e- N3 M5 u: w% D
4 u6 r2 |- S0 M/ `1 s, P- B+ M2 p* y9 I+ {
Method 03
' g' C0 e" `5 @=========( q) C! f# N2 \0 u# M$ L9 ]' `$ R; F
! W8 B% h) e J% s/ ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! u3 m; ~) L' O$ b% S(API Get entry point)# B9 m( L' W7 P
, m6 F( Q* s( c, M: O' E3 l' z& ]8 U5 l
6 C! z3 V& p+ ~8 m, B7 E) n D xor di,di
0 J/ O o6 J# @$ O' w1 p- O2 | mov es,di0 }' J9 f8 a( }; D
mov ax, 1684h
- i' y" P) I3 {- [3 M; @% z$ i" _ mov bx, 0202h ; VxD ID of winice
$ f7 n/ W+ [1 f v; a int 2Fh- `* e5 |4 r. O8 C
mov ax, es ; ES:DI -> VxD API entry point
" D# z4 s6 A) F/ R& I# @ add ax, di
6 a, ?( p4 W% n test ax,ax
2 A8 G; B+ L/ a( ]. S jnz SoftICE_Detected
2 ~' W, i% U& w. K$ ?
7 ^7 i. m5 ?- T L+ c" r G0 q___________________________________________________________________________# h+ `: M4 L+ N
8 W% v* `3 B# j: ] W
Method 04
: o" E: G/ ~" B2 t8 d=========
, r6 {; _+ k; p% g1 e( S0 O: p, u+ m" |& v. [
Method identical to the preceding one except that it seeks the ID of SoftICE
' ^2 X' H( u, |' v" I Q) E# ?; {GFX VxD.* K# p5 _+ K7 e& P* g1 u c- }
% N1 b5 H3 L: g5 i4 `' C xor di,di
. v3 c/ l5 i6 {' i9 z0 o: @ mov es,di
( ?- B/ T/ n( Y mov ax, 1684h
! n1 L: F' p# j1 _3 _0 X | mov bx, 7a5Fh ; VxD ID of SIWVID
- V# r& t- [% G3 j9 g, s/ ` int 2fh1 i& q4 Y+ L2 N0 r$ `
mov ax, es ; ES:DI -> VxD API entry point6 L5 I# X% Q* g
add ax, di
+ C: @$ y8 W2 j1 f6 s/ Z/ }$ ?3 Q test ax,ax; Q- T6 V0 Q* U* d* W
jnz SoftICE_Detected7 v: e0 t; y, C
# x2 e2 O9 S- h
__________________________________________________________________________
# [, M Y5 A: Z! W. g" J' z
; w& h! N% E6 E9 G/ O
2 }, U$ t. X- U$ M0 \9 D! J9 e4 JMethod 05
4 S* x& F' v6 Q4 O=========/ o; p* |1 W8 N7 M% h
* X% z E$ n2 x; N4 O1 nMethod seeking the 'magic number' 0F386h returned (in ax) by all system* T: `% H( r- q$ m0 Y1 l6 a
debugger. It calls the int 41h, function 4Fh.
# s. v. O$ }# J- ZThere are several alternatives.
# o8 i) _$ `# o" S2 k/ J3 ]8 d7 X6 }- k7 `
The following one is the simplest:
4 k2 D( A' G8 b4 `! H0 Y: Z$ s
! i" J7 ]) B. ?2 e7 d8 v mov ax,4fh, |) ?$ \4 R) v6 |' q- w @3 P
int 41h
! |- M5 K# s* _3 `4 g cmp ax, 0F386
0 }) O2 R( t. W4 `* J jz SoftICE_detected
# d4 R: {1 q% [' Z2 X' K% T1 D) F7 M- _. o; m
f/ U4 t- p8 Q, `! bNext method as well as the following one are 2 examples from Stone's 7 n! D$ e. h6 _
"stn-wid.zip" (www.cracking.net):
8 P0 P* y8 s8 t
1 ?* b) Y% ~$ N& {8 A, k4 m( R4 H mov bx, cs, h" a. d% r; [% G
lea dx, int41handler2
3 E& U {" T, {. S xchg dx, es:[41h*4]. l5 p5 |. v5 O' P3 b
xchg bx, es:[41h*4+2]
. A# n4 ~" H7 W, k# k* o mov ax,4fh" J/ W8 k# y) J) U+ I0 M) o
int 41h' _& l: v/ B" F; V) ?; t) M# ~
xchg dx, es:[41h*4]) ?$ i& e3 U7 W& k: c
xchg bx, es:[41h*4+2]2 _9 ?2 D2 q" j Z
cmp ax, 0f386h
/ h9 x3 C& q- _# ?; C jz SoftICE_detected2 K: A6 j& M& \0 H
( }) C& e6 s+ N% d" [: [int41handler2 PROC
0 ]6 {9 v% @2 o8 A: p4 Y7 i iret
. c' E) s0 u. ^# R! ~int41handler2 ENDP+ U8 o5 }2 z- x" z
% X+ R1 H% t5 I# ?2 r9 x" W
- Q7 j1 I" T0 __________________________________________________________________________3 p/ z6 ]2 w, l! {8 H- i! h1 c5 y
$ g9 r8 w1 N- D. O- q( m. b" h4 R
$ a# W0 ^9 t# e* j! ^Method 06
$ e) b; J7 M; X7 R, \=========0 a2 x4 R2 M! A
/ D. C6 n5 V+ m: S( ]" Y
/ l) W8 {6 W5 d, V9 T( A: M8 z
2nd method similar to the preceding one but more difficult to detect:
$ `. I0 @& a2 ^6 g6 w$ c, C+ ~: e# x+ b; U: R% [
D2 J* h6 O& |! d/ F8 Y$ `int41handler PROC
0 t- Z( x' o% E, E! z+ _/ z, x mov cl,al/ f1 S# X3 w' j7 I7 f8 Y( z
iret% c& {5 O" U1 h+ q+ j
int41handler ENDP
/ a- N) e. r2 b% P* p
! K- ]8 x. y+ B0 Y6 I
8 r) i6 N0 V9 }* ~ b% Z& M6 i# ^: e/ Y xor ax,ax, e: Z# {9 n- Z
mov es,ax2 D1 o# v1 W# ]. r% M# W* r; e
mov bx, cs6 W) w" j4 Q* r" z) L# h1 G
lea dx, int41handler
& h" E3 X9 j1 e" u) h xchg dx, es:[41h*4]
2 ]8 @0 }. w# n8 n5 f xchg bx, es:[41h*4+2]
% @* {/ ^7 M5 f in al, 40h
8 H4 \5 n9 A/ g4 \& b xor cx,cx3 x5 I) p% m7 ^+ @& H* w# W
int 41h2 y' h# W/ t: D$ G6 ~$ S& s4 `
xchg dx, es:[41h*4]6 R) i# y' m. O/ g+ H& V( z
xchg bx, es:[41h*4+2]6 m% t6 W/ U/ t5 ?( p3 x# _) v
cmp cl,al
9 [, r/ T- Z- o7 j7 _ jnz SoftICE_detected* X0 I9 c8 v& E3 ]/ h
( B( L* W0 t0 L% d
_________________________________________________________________________
; S7 l0 Z8 o: E3 `2 \& ?/ i6 ]! ]. K' ^& Y+ c
Method 070 O; ]; \$ ?0 g, Q+ ]- W: z" |* a
=========2 D3 n `+ C' j c }7 D
" h0 b, J" u% \: KMethod of detection of the WinICE handler in the int68h (V86)
9 N W0 M$ {. }! y: h8 s3 Z- G& ^8 [0 e
mov ah,43h
9 _$ p2 y4 G6 | ^- W( w5 Z int 68h
) P2 ]( {+ C ` cmp ax,0F386h
/ \% I' n6 g0 l( ~5 g. y& g9 V jz SoftICE_Detected
0 {- V+ R3 H, T
) U Y, }5 F9 K( j+ p, C( G- D- f$ v8 K
! d+ `8 S' r6 Q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 l5 }' d7 K. t* o3 g* A* V; Y
app like this:8 s+ V& v: q9 ^6 x
7 e$ R7 J( L b* r5 [ BPX exec_int if ax==680 q/ o+ V) B) J! z( x* x) f0 E
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 M2 v1 g& N2 r+ L8 ]. b1 }; z% B located at [ebp+48h] for 32Bit apps)3 d: w) P9 Y5 a6 z( }; w
__________________________________________________________________________
7 |% }2 h" `% D- p
3 {3 P ?( d; b6 R1 F( R
5 U1 J1 s6 j; [0 uMethod 08% L6 T: U4 X4 F' [+ U
=========
* L' S* K" w( p: e, J7 c7 m- |" I
& Z% S# I/ I6 P0 R( @0 @It is not a method of detection of SoftICE but a possibility to crash the
. Q6 W1 G, ^. E+ |0 Usystem by intercepting int 01h and int 03h and redirecting them to another( I; t. l3 V' O- m# |
routine.
" u( M" n3 R# }7 R2 J, tIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 s$ E6 O4 H @1 c* e) zto the new routine to execute (hangs computer...)
8 j3 ^& F; H4 g, C( s: M: _7 }# v$ [% s, j
mov ah, 25h
- H% H& T' s# R& M* A8 y) i mov al, Int_Number (01h or 03h)
0 ]( J& @3 I( \' \" d- m. a mov dx, offset New_Int_Routine
1 I5 u, r5 H1 T! A' w. V% { int 21h
9 Y4 J9 m3 i5 b Z# y) ]+ S N; O5 E: w1 [) s
__________________________________________________________________________5 ?1 Y, o/ V1 b% V1 N; c3 M
% W" ?: o2 v% K$ E0 r
Method 090 F c% j& e* Y: S8 |8 s4 Q
=========5 G. O+ }! ~4 x! N+ R& o \& A3 r
/ g: b% O7 `3 ?This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- K: e& p8 L4 M' f8 rperformed in ring0 (VxD or a ring3 app using the VxdCall).( c. Y# l: Q' y' y+ z6 L
The Get_DDB service is used to determine whether or not a VxD is installed7 [$ k1 S) L7 E; r5 h
for the specified device and returns a Device Description Block (in ecx) for+ K4 U! K" ~! Y6 c& q; m
that device if it is installed.( m4 s! e$ m5 t- S, x L' L
; o, w* [2 I" p2 O* e* [) p0 l: n
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 K' h+ z0 }* @- k! T1 d5 i9 h mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 E$ t$ _* [( g) h/ ^: ~' i
VMMCall Get_DDB
2 R! J. V: [0 k! Z2 s mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 l0 Q# D( @) k" d
- |6 [) N: ]2 xNote as well that you can easily detect this method with SoftICE:
7 V! U, B6 h: E7 n bpx Get_DDB if ax==0202 || ax==7a5fh7 B* H R6 `/ j3 U# }, o+ H( O
3 V. n& O: I' m/ e h
__________________________________________________________________________: @$ S$ x# a# r$ q
7 A3 `+ P6 v! |/ d6 R7 v M r( \
Method 10$ v1 K8 P( u% r; A: V8 p
=========
, h& R. g- v) e5 T
5 }' P( ]' f0 [- S: h=>Disable or clear breakpoints before using this feature. DO NOT trace with7 x1 l) L% C8 S# Z) N' k
SoftICE while the option is enable!!
- u/ J( }5 ~! t( a2 }* \) R. I7 a! G% m: n1 K" V" L
This trick is very efficient:# F- S2 O+ V0 U4 e" d
by checking the Debug Registers, you can detect if SoftICE is loaded0 d: m W# F" k) i1 \! C5 w* d/ q
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. l t' A# u: b4 ~& w; l& O- Y+ [# W
there are some memory breakpoints set (dr0 to dr3) simply by reading their: g; j6 n% o& w- g: f% b; e
value (in ring0 only). Values can be manipulated and or changed as well6 U( L3 A) [' P6 c8 T9 |
(clearing BPMs for instance)
5 X0 |4 h( y4 A8 F- h3 X2 D& V- P0 n0 _
__________________________________________________________________________" K! J# o" l, J* S( I
, ~2 i; `. G. ~2 G
Method 117 `+ h- H, n! H0 ~, M7 }
=========
, A" I' s8 k' D
7 L% E2 s$ }5 a$ O6 d& @( KThis method is most known as 'MeltICE' because it has been freely distributed0 P. \/ C$ O+ Z$ s
via www.winfiles.com. However it was first used by NuMega people to allow8 U9 A; P. C" Z E/ ^- A+ ~
Symbol Loader to check if SoftICE was active or not (the code is located% u4 }" A1 R k0 ], c
inside nmtrans.dll).
& \( R3 O \& L) Q: e3 t2 z9 @0 P* v+ Y1 O0 p* v
The way it works is very simple:9 ?' j5 Q! f' @( X
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% I6 c7 S# V6 X/ W9 O
WinNT) with the CreateFileA API.
% p- {7 p0 b/ l8 }7 {7 R5 B
$ U4 F) l' e- R# I) R& h* fHere is a sample (checking for 'SICE'):) X+ \+ Z+ D" M
1 V7 q5 d+ `; E) gBOOL IsSoftIce95Loaded()( G/ W' w+ J( R& k! \, ]# C
{
' j- {& E- j& b4 ]4 M. K" x4 O) E( | HANDLE hFile; 5 g* D! }9 Z0 R$ p! u' j4 r
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; w. H- G* F0 `. {( `9 a
FILE_SHARE_READ | FILE_SHARE_WRITE,
' R* g! j+ L" `' V NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% l( s6 i: v3 \; @4 ^. n8 I$ H2 @ if( hFile != INVALID_HANDLE_VALUE )8 K6 e, P8 ?' C% Y0 U
{
- N, Y8 u$ B. P8 @0 T CloseHandle(hFile);# w# @. M' i+ i! T5 S- x
return TRUE;( X; N' c9 y- p$ C( b% f# F
} b9 W& v# u# o, u8 u2 e: ^
return FALSE;' g+ C. ~$ j+ O
}
2 {6 o0 K C/ h' _
( }/ v% M; [0 `: | ]* [, p9 \4 }* VAlthough this trick calls the CreateFileA function, don't even expect to be
- g. P8 U Q3 Z. y. N0 W8 rable to intercept it by installing a IFS hook: it will not work, no way!3 U" z8 [5 }7 \4 p4 c$ t
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* q. E3 |9 C, s9 N) m9 c, b$ _service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 x1 t. R. `" _1 e0 b
and then browse the DDB list until it find the VxD and its DDB_Control_Proc' j5 |# K8 B) ?. F
field.9 P& G, d) y3 l( |6 y; r) V
In fact, its purpose is not to load/unload VxDs but only to send a 2 h' n3 Q* O# @: O0 S* h" K* Z
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
H5 ~% d( v9 ^5 x1 Eto the VxD Control_Dispatch proc (how the hell a shareware soft could try
& X# V6 Z5 X1 Q! L. ?0 H: uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* J1 S7 I% }2 Y9 n/ D( wIf the VxD is loaded, it will always clear eax and the Carry flag to allow% f! X2 j; U4 M R! M; ^$ l
its handle to be opened and then, will be detected.
& I) }* o1 M/ K) N7 RYou can check that simply by hooking Winice.exe control proc entry point
0 A$ ~ K& ^ j3 K, owhile running MeltICE.
# c T& [- o; `( L4 R8 H4 @# t1 @' a# v3 D! Y- b: r
* ~% W" H1 e- C$ y5 O
00401067: push 00402025 ; \\.\SICE
, P3 X7 Y9 B+ _ G 0040106C: call CreateFileA# x% H8 o, ~" |
00401071: cmp eax,-001) u) D# @% Y! ?! |# \
00401074: je 00401091
6 w7 r3 r% _5 \# C B8 e1 N. b( m- F6 [
" P7 B; ]. ~ ^% p9 T% R
There could be hundreds of BPX you could use to detect this trick.
. K, m6 A/ H5 Z. _6 d" q' |-The most classical one is:9 h: Y$ o7 `8 o4 @; O% C# D$ H% k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) t5 l$ z! c% R T" k% N
*(esp->4+4)=='NTIC'
+ |4 {6 B9 |8 V) D% t
$ x' G; t& p1 b- J-The most exotic ones (could be very slooooow :-(" J3 N+ `# Z& Q* X/ _
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " R/ L" ]" [5 `( T9 y: q- j: p
;will break 3 times :-( Z1 A0 s! q3 B# x" L
2 G! O) C, O* E: G
-or (a bit) faster:
, f. a# U3 q/ w/ L: z BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ p/ v; h0 K) @& `6 u+ N# `
% @3 \ L1 L' e ]2 y+ A! c! q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
6 \8 y; @$ e; Z/ j- Q& P' b* A. A2 a ;will break 3 times :-(# d5 H' w9 W/ o4 d
# h! M! o" A# J3 R0 a
-Much faster:& O4 b' @. F0 H! p3 C9 l
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 n+ b# w$ j3 B* N% S
' P, f" q2 s9 Z2 p! Y+ n. Q+ G- G
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, i Q6 I* d* O6 J1 V( hfunction to do the same job:
% q) n* y- R( ]
2 o; x3 h ^/ P% g7 c0 }' K push 00 ; OF_READ0 J$ Y6 u5 a& ?. n
mov eax,[00656634] ; '\\.\SICE',0
2 Y2 o* ?+ O" J x2 i$ { push eax
6 k9 N, R3 x; v, U2 t9 h call KERNEL32!_lopen
4 h. ~ r; `: s9 F6 ~' x: j/ ? inc eax
; e3 s9 `, z8 e2 J- Y jnz 00650589 ; detected
9 f. Q+ r5 G5 m6 ]1 ^+ G9 y push 00 ; OF_READ
2 ^! Y: i' P) l! K3 o7 j z X2 ^ mov eax,[00656638] ; '\\.\SICE'8 V9 Z; |8 Y* r5 T. W. }
push eax
* X% k0 s, E) B8 V call KERNEL32!_lopen
' I0 @7 k! O9 s. i inc eax8 ~. ?# f3 c+ [- L" v
jz 006505ae ; not detected8 n; \- d V9 \1 f4 t6 U
3 Q3 f& F N& q- u' f$ N3 G
1 A/ h- N/ y1 k" x+ e__________________________________________________________________________ s ?9 r8 b3 u! e
) ^! X1 P: C$ u
Method 128 @* L& e% @5 k
=========
. q4 ]3 ]$ A4 N& }! s% Z7 G9 d" D, a) R# T" E8 L
This trick is similar to int41h/4fh Debugger installation check (code 05
# j" [: c' m3 K( q. l& 06) but very limited because it's only available for Win95/98 (not NT)
2 b, O' A; M1 ~7 jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 b# r8 D0 S! n+ U9 U) @( f- L; q9 r% b9 }9 Y
push 0000004fh ; function 4fh9 k& E7 m. @9 c3 Q+ S) o1 J
push 002a002ah ; high word specifies which VxD (VWIN32)8 y& F, m4 G3 c( s" v; C7 q
; low word specifies which service
! d* ~: N H# ?! D9 w' r (VWIN32_Int41Dispatch)) U% f/ C% _7 U! H
call Kernel32!ORD_001 ; VxdCall
. m1 l! }0 \/ v! J9 z$ c: r/ I cmp ax, 0f386h ; magic number returned by system debuggers8 m( ?* E- _: z l
jz SoftICE_detected/ I( A+ H6 P; t2 M2 w" a+ {7 M& A5 A
7 B9 z# l! C: F$ d/ @' k9 F* b: W
Here again, several ways to detect it:
3 N3 P- f4 L2 \7 {. _( F
4 x" v m8 `3 k( u% c; u BPINT 41 if ax==4f
& y1 K) ^) i! S$ T" L
$ }' E- x' D: o/ b* Z( b BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' k }' u( ~) x. j
- s4 n$ p3 G1 {1 C& m2 L$ |4 N% f BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
# W; p1 L/ T s+ e b
/ {' ]( m& q: w8 Y. q6 o! J, h' I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ R6 e, b. L* W2 ~5 ]
4 l# E) T$ p% y__________________________________________________________________________
( {- P0 P- }% R& U8 T; i9 i! y4 `
7 ^0 |2 G) g+ {+ \6 t& w& NMethod 13
+ A5 g# S6 t% f& ]& F, R1 R$ _0 f=========' J/ W5 h3 b; A( o6 S, F
1 e3 G9 U3 C2 _- {$ e, y+ W; s. C
Not a real method of detection, but a good way to know if SoftICE is
0 y$ r+ ^$ t {: S& X- Q2 Ninstalled on a computer and to locate its installation directory.
y5 O0 ^" H* EIt is used by few softs which access the following registry keys (usually #2) :0 ]: l! {/ i9 z* @" B- O) h
- x1 ~/ T8 [% E9 I0 K U1 r6 o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; y) W/ g2 u) Q6 H& o5 ?
\Uninstall\SoftICE/ B9 \" m& I- g. g b2 ^
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 b. R9 c5 [ L: ^5 E& J" [) k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- N2 }0 Q7 q0 \% r8 N f& U5 }% l\App Paths\Loader32.Exe7 m; H# K7 v" N: d/ u
2 x% P; y; q' r) {3 H1 N4 r% h* X5 Z0 @! i& b* |
Note that some nasty apps could then erase all files from SoftICE directory
. ^, T7 M T) m0 t(I faced that once :-(8 Q4 l5 V6 Q4 B
" h, b M. V0 t, b- o. ?
Useful breakpoint to detect it:+ c, D$ ^1 l8 o8 k/ C D
5 S7 k0 y3 E0 C5 C/ ~4 s8 H
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; ~8 R# V/ R. }: I9 N! Q% I% h
$ t, A3 y+ ~5 ~+ A* ~" S
__________________________________________________________________________# \. F6 G, F8 `. ~8 W# v$ o
7 I3 g5 E- N. o5 B) ?- x: A
3 _: \- h5 Z6 d; O
Method 14
% q5 D0 x5 M( O1 F: d=========
z# l$ B) X. L4 L0 l, u: c0 D7 i2 B) N! Z" t' {. ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" b" V9 j' |4 N& O: Pis to determines whether a debugger is running on your system (ring0 only).
/ a- k! y, h n
# \, x- Y7 t& N. q4 ?9 a VMMCall Test_Debug_Installed
/ Y$ K" j+ A1 j* ] je not_installed
3 n& e' |/ O7 l3 S: h! d3 G- w+ [. C( _+ s/ I' O
This service just checks a flag.
" C, G/ F: D3 P, K5 u- h</PRE></TD></TR></TBODY></TABLE> |