<TABLE width=500>
1 p+ d5 U& w z0 k, O* m1 |<TBODY>
' X* J0 _: z4 w C0 n2 o. G<TR>
, E9 F' J; v0 {, F. i, N<TD><PRE>Method 01
6 e+ e8 n }2 }, w3 K# j `) O=========
$ U. i. @/ j- H% S7 S! I( @
8 q; ?: ?8 Q- E* CThis method of detection of SoftICE (as well as the following one) is
5 @- w- L$ r- [* i, T. E1 i, Lused by the majority of packers/encryptors found on Internet.
9 X4 {$ |4 x3 O% WIt seeks the signature of BoundsChecker in SoftICE. D, [* H$ U8 a
" \3 F& q6 d; @0 T
mov ebp, 04243484Bh ; 'BCHK'2 e7 w1 l. ~) U
mov ax, 04h
3 D5 E, @1 \; Z8 S int 3
+ j. A+ ]# I* H cmp al,4
2 { V7 F/ C) e& I jnz SoftICE_Detected
) j: M1 k. S, w4 ]$ _* @' X+ ^) j. U/ p8 }( o# ^- ^0 ~
___________________________________________________________________________
8 K/ Y) Y) y1 j; ]% _/ {0 R2 ]7 J) \
Method 02, J, }7 E; O( X1 K
=========
$ |) e, K1 _$ Y
# y2 N, }) B) t8 @: mStill a method very much used (perhaps the most frequent one). It is used
: A4 l9 K$ H% \; S" Hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,& R9 @% z9 L0 t% Y# |
or execute SoftICE commands...
9 s' ?# a3 u6 o; O% Y. Z6 jIt is also used to crash SoftICE and to force it to execute any commands
+ S- g* {* O1 ?! D(HBOOT...) :-(( + p1 N& I! a; |; ?) J0 Z8 R1 Y( ~
( r/ H8 r! G; x' ]% oHere is a quick description:
" q4 B) q" Z0 f. T- u3 K7 H-AX = 0910h (Display string in SIce windows)# R. ]; g% `/ s6 } D
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), T( K8 |1 O: `1 x: W2 M
-AX = 0912h (Get breakpoint infos)* S) Z: d3 l; c0 r" F
-AX = 0913h (Set Sice breakpoints)8 g8 e$ b i) T! [6 }- G
-AX = 0914h (Remove SIce breakoints): G" o* r; W. s: g- @
0 U C+ r. M" V
Each time you'll meet this trick, you'll see:
0 }* N. o. p7 N$ {1 ]. `9 ?-SI = 4647h9 ^* Z, ?5 k# X; Y- \, U* J0 q) A
-DI = 4A4Dh# d4 t" V0 B5 S) Q
Which are the 'magic values' used by SoftIce.
$ W0 p o# E" y) @* ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 z1 P) D, t2 o4 i/ E# a7 u
2 O6 z1 k+ N% G7 I [3 Z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* v: a: G) a" ]5 @Envelope utility use to protect DOS applications:
0 ]3 {/ _1 D9 s
& w* T' X- c0 p6 U" O* E' S/ V+ t2 U
4C19:0095 MOV AX,0911 ; execute command.
6 @" \& _; P/ E, f7 i$ [9 r4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; {+ _8 C7 o: e/ O; _
4C19:009A MOV SI,4647 ; 1st magic value.& W, q( d0 j7 r& a) n! t% U6 Z
4C19:009D MOV DI,4A4D ; 2nd magic value.
* c9 k/ ]. t9 d4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% A* x' ~: T& e1 ?; f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 J/ B3 i3 r. ~* ~6 `3 k3 G) {9 g3 S4C19:00A4 INC CX/ D5 O2 [; R6 ^) T8 Q3 l+ p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, c: ^3 @9 R3 E! y% d
4C19:00A8 JB 0095 ; 6 different commands.* j! Z& k: \) N8 K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) s- m) y* N1 F: O1 q9 P% c4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' u$ u0 ~+ d. F' H3 }1 ]6 {$ S: @
4 d7 |) N+ T; W- V3 R! L0 L
The program will execute 6 different SIce commands located at ds:dx, which, l3 q* F) w/ D
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 P3 K8 D( p i8 H0 j$ T
2 [" r: {- c7 ?' H* z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& c7 u) Q" i; ?___________________________________________________________________________
) v5 w7 n/ r ?) H" K4 `& e: I- O! k+ W) [' f
, P* l8 h7 j( B) b3 e, OMethod 03
H V; j* b- X" k* b========= R* y- W- j. i' n; `
7 r$ Q- b" z7 X. M$ A; LLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ F; {: i, P( n% x3 n# t
(API Get entry point) ~0 R& ]2 |4 @$ B
1 W. R5 I* |1 S, W" X1 }: R5 X8 T: l9 ~
) J- Z% L9 V! n! ~( F6 _
xor di,di
7 c; ^2 c i8 c' ^$ \ mov es,di) R0 z: c6 W) c
mov ax, 1684h 1 q" |4 |1 O5 h5 z" J
mov bx, 0202h ; VxD ID of winice8 @" K4 E4 D& o8 X. _
int 2Fh
& r; E' f5 k0 h" B mov ax, es ; ES:DI -> VxD API entry point5 v+ O$ s4 v+ i6 z
add ax, di* E- b# ^/ K7 L6 J0 M6 a
test ax,ax+ p! H0 D. y, V0 E4 i' _
jnz SoftICE_Detected
! A+ ^/ b' x+ X: U+ M/ M2 b4 J4 Z9 @0 O' {- W5 m
___________________________________________________________________________4 S% ?( d) z# V; ` H
6 s' [6 b& j9 d$ k& s! FMethod 04, U0 g: h# B7 W) j7 {- l
=========0 |. a( u* g) e! s B
, N" Y2 u% j3 r
Method identical to the preceding one except that it seeks the ID of SoftICE) T4 j* S$ S8 k) H/ @
GFX VxD.. I& p/ a+ h% `( t/ B
/ D' A- Y, D6 @& F! m, @! o xor di,di! j/ c8 x4 `3 V+ |* }( d, S2 F
mov es,di
) X( R# B' y) L. G mov ax, 1684h $ _3 `6 m! x. A( U
mov bx, 7a5Fh ; VxD ID of SIWVID
8 l/ `2 i v, S1 q+ ]4 S( B* i# } int 2fh4 h+ b* {0 }3 W* e
mov ax, es ; ES:DI -> VxD API entry point& |& d; L- f. `$ J
add ax, di
' |4 i, i3 ^. `- D4 U% Q P test ax,ax
$ b6 B. l! i2 g6 i jnz SoftICE_Detected
) w& [ m' I1 [2 t' y- h, L, I
8 R7 }9 p l9 F8 q8 w7 Y! y* I__________________________________________________________________________2 ], D8 x$ Q v( d& a* u
$ i2 C9 _. W: D. p+ n$ Q
2 s8 ^+ X& s" p2 ]' zMethod 053 I9 g: u: a2 d# Q+ z
=========& C* z' v2 W7 W; F. M
- i9 w6 p4 A" _8 w( d
Method seeking the 'magic number' 0F386h returned (in ax) by all system7 X. g+ [8 b& g3 S" {6 t
debugger. It calls the int 41h, function 4Fh.! J u5 \; s% ?+ `
There are several alternatives. * N; P1 y8 Z: D' l/ T& b
" c* |' p* z3 ^6 X4 g% ]The following one is the simplest:$ K4 w' D4 j6 |9 t
* M6 b1 T6 R# M1 Q9 ^
mov ax,4fh! H! n K k! S" _6 Y9 h/ m
int 41h
- v; V6 b: q8 _# F( T cmp ax, 0F386
3 X' X$ ?2 |7 Z7 D jz SoftICE_detected
8 J( p6 B8 I5 J4 m* A
# N P, e- i( _( J+ H; Q
" n) N, V" [4 M9 U( bNext method as well as the following one are 2 examples from Stone's - G' ~: `9 g6 i3 X' O9 I
"stn-wid.zip" (www.cracking.net):
( a6 m6 }: o1 \) J1 u/ f H: e# V) o+ E7 u" F
mov bx, cs0 `# r2 r |& Y& V
lea dx, int41handler2
# P) {- |, t; ^5 Y# \" e xchg dx, es:[41h*4]
3 l4 P6 P' P; U% {8 V D5 y xchg bx, es:[41h*4+2]
- C; a4 z, p% J. h mov ax,4fh
# E* z: m) W4 \* A int 41h
, Q9 ~+ K! @; R: S$ X xchg dx, es:[41h*4]7 q( ]4 p" [* @# c* g
xchg bx, es:[41h*4+2]6 W/ g# n: D0 {- V( u
cmp ax, 0f386h
! |+ |, d% \: H) q# [2 `) ] jz SoftICE_detected3 Y" M" t7 B% v6 \4 u
0 l- z( S- c' z4 Mint41handler2 PROC1 n2 C! ^# o# ~, s) o" `! K
iret+ a$ k( W) _; z2 c/ J* [3 s" ~
int41handler2 ENDP
3 `" y! }4 r+ h. f. I/ m- e" _! E% K+ N
7 ^4 }/ h* E8 y3 m% k- ]3 x
_________________________________________________________________________
8 G F& B; B$ b7 U4 b3 A& }- p8 F# M' g" E1 M3 A u$ _% Q4 N
7 O9 |/ `5 ~2 T4 y
Method 066 T, s+ V2 e# `6 k. e
=========9 N9 m- G9 K( u) Q. r3 l
3 ^1 y+ M2 }* i6 ^. A0 [2 H/ c
; V. \$ A! S0 S. P2nd method similar to the preceding one but more difficult to detect:& c+ e5 k6 s" ~1 y, K
; }! }; e- l" H; s6 \* ]6 N+ e' W' [2 |$ `5 F
int41handler PROC9 M# A1 c9 P5 ? A
mov cl,al
/ W+ J8 ?' U3 t% ~ iret
& w: p, E8 l, M5 D6 xint41handler ENDP$ i. n1 F8 g2 e
. A! o* N" x6 c# v2 A. J2 `
% s; M: y+ X, x; A$ X
xor ax,ax* U* t5 z) r: G+ g
mov es,ax4 @0 n0 r. p( G( H6 V* ~& S. k/ [
mov bx, cs1 {/ ]* g/ o; f& Z& F6 a
lea dx, int41handler" O- m/ w8 R3 g; _
xchg dx, es:[41h*4]9 b; I, u& d; o* I
xchg bx, es:[41h*4+2]
; {. a3 e" @0 u" ~/ f2 i# B in al, 40h c5 W! T6 ^- D/ ^ k& Y
xor cx,cx
. K/ t; j0 H/ j& ^5 V- r( `: W int 41h$ \8 T4 Z: m, c: D
xchg dx, es:[41h*4]
8 q& E4 ?# y) h4 A `8 J xchg bx, es:[41h*4+2], A3 |5 m) Q+ e5 r
cmp cl,al
( o, J3 ]& [( s jnz SoftICE_detected T0 I# s9 B3 u9 t" x$ T' ?+ H1 U
. N' P& s! U, w: z3 L_________________________________________________________________________
: n% K" ~- }7 k$ l6 @* t- i$ H8 d- L: m
Method 07( H, |1 y3 O' @$ Q( I. D- P4 ~
=========
/ m. p$ ~- S) A4 H% O) U4 r I5 V% x& B
Method of detection of the WinICE handler in the int68h (V86): y" a+ g1 \& ]2 m4 H4 F
+ W6 D! s% _! c; Q mov ah,43h, k4 I, ?/ H, o6 t" `
int 68h5 l4 \. N, \1 l8 c/ W8 Q* X
cmp ax,0F386h1 Z! t/ H( t M" ~8 q& O
jz SoftICE_Detected
4 D3 Q( n3 T* M& u" ?& c7 f6 w9 F& k% U6 I
! y! d6 I4 o8 q9 K' F, Z# _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. W5 k0 ?8 a. n& S6 v: R
app like this:: ]' I! D+ a; h+ I9 Z H
( B2 V$ l2 T3 q+ N
BPX exec_int if ax==68: F( p. ?) e4 Q+ [ G
(function called is located at byte ptr [ebp+1Dh] and client eip is1 j) M4 ]0 [8 ^( ~6 V8 F! d
located at [ebp+48h] for 32Bit apps)+ Y4 D2 p' q ?% v P# x
__________________________________________________________________________+ Z& t9 h2 e) `8 a! ?; {3 e
& d# D, G4 O4 m( m/ W
) c. k. u3 b# S5 @- c0 D# \
Method 083 w/ Q- U( |9 P6 J. v' C% l
=========
. w6 n/ W0 }# F! R4 F# a8 b, o8 B' c: {
It is not a method of detection of SoftICE but a possibility to crash the
& S& q9 E4 d. I9 Tsystem by intercepting int 01h and int 03h and redirecting them to another" E: o2 C. l- N7 A* c; l. I
routine.
/ A2 p2 }% l* _, a, x2 UIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 W3 J% x8 b8 k2 n
to the new routine to execute (hangs computer...)
$ P C4 S; T$ T( B0 X) D- V( `% O0 b
mov ah, 25h
, q% Y- d% A, a1 u1 o mov al, Int_Number (01h or 03h)! z9 H4 Z4 m$ I" K! Y8 Q9 ], ^
mov dx, offset New_Int_Routine% K$ I. ?6 f! l1 B8 P
int 21h
. n/ i& v8 ^; b2 _7 W, k' w' @+ }. R& G/ i
__________________________________________________________________________1 ]' o* o7 l+ D# x h$ Y [
- d W4 w& V& h$ m5 N$ s
Method 09
7 P* ~8 b. f3 M=========# b' L {/ D% `0 q" N9 u; M
9 ^, y* C3 k- m6 l$ D3 z) h& `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ O. {. b1 i# D+ |5 X. c
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 {0 V% `3 s' O2 y) hThe Get_DDB service is used to determine whether or not a VxD is installed
" a: r9 S, v- s# c4 t lfor the specified device and returns a Device Description Block (in ecx) for
, g N* `$ Q- O* u, Sthat device if it is installed.
: n# u( [9 c& P! A* Z: [( F+ D. ]; x& a1 O5 U2 M% V- _% j1 k7 e
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 o6 w- o7 f1 q) f) i
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). G3 R1 W: T8 H( v2 T0 M
VMMCall Get_DDB+ z; F& R$ \7 Z' {9 S! p
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& G& N. a! Z2 c6 y' C8 Q
. e, U" Z& G9 S- o1 r
Note as well that you can easily detect this method with SoftICE:
% Z7 t, c' ^5 T4 Q bpx Get_DDB if ax==0202 || ax==7a5fh
$ b" Y- f. Z! L9 i
( O8 b, Z4 ^* q' K* x# ~__________________________________________________________________________: ^* o0 W) y4 ]6 l1 T! o, x# n
2 V8 B/ W4 q& GMethod 10
) u* I) H6 }, W& L M% y=========
6 K, f2 B3 \4 u( B' a5 P$ m
1 R9 h$ `! q' M: h=>Disable or clear breakpoints before using this feature. DO NOT trace with: E% ?) j+ V- ]+ p# I
SoftICE while the option is enable!!
% y. s* S: D' r+ e8 ~* _3 }5 p7 r( P T7 P$ ]4 [& @$ @. j1 y: ]
This trick is very efficient:# u" p ?1 A. T2 M' I; k
by checking the Debug Registers, you can detect if SoftICE is loaded4 k0 f1 T! D( D9 n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& y1 X; c! e4 |/ y
there are some memory breakpoints set (dr0 to dr3) simply by reading their
4 | a% ?& j2 Z) W. D: _- Mvalue (in ring0 only). Values can be manipulated and or changed as well
8 ^) M) C! E4 t6 q) l6 `! M(clearing BPMs for instance)1 ^6 L& J/ w: d
, R. O0 p% R! f9 s2 K+ h6 G
__________________________________________________________________________, P6 k8 k3 _/ a; ?. J6 Z0 R
2 Q6 j9 G% _; EMethod 112 R6 e" D" ^8 L7 m3 d
=========
& f" \9 w4 S5 `; t- s% P' }* e7 I; a9 p# D9 g
This method is most known as 'MeltICE' because it has been freely distributed
% \0 x5 z- G$ Y" qvia www.winfiles.com. However it was first used by NuMega people to allow! D `" n8 y! t, l, e ]) ]2 x
Symbol Loader to check if SoftICE was active or not (the code is located
. K0 p) t, U( tinside nmtrans.dll).
% x9 {# y$ B! k- F4 b+ l- i
$ a& [, G" L' u' zThe way it works is very simple:! L. ]' n1 h2 p2 r( `$ B' c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 Q. u9 b1 Q9 g
WinNT) with the CreateFileA API.
& ~: {, j5 u$ f: a' |: F
% n0 a( L' a- ]( MHere is a sample (checking for 'SICE'):
% |# V! n# v- B
# F" t- H7 D3 VBOOL IsSoftIce95Loaded()
; x. r- T/ L9 S4 }{
1 G7 |8 K1 F# B6 h HANDLE hFile;
% |# K( a2 K6 k: H4 j m* r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: W4 }9 o b) D$ X& o1 x
FILE_SHARE_READ | FILE_SHARE_WRITE,2 a+ y9 m# x S) v8 f1 c/ q3 w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 f- q& Q$ d4 R" X# f
if( hFile != INVALID_HANDLE_VALUE )* g L! M# I5 G" i
{
: I# m' l# o: D# F: x4 ^5 G CloseHandle(hFile);
+ h. e0 K0 X) F$ p2 X6 u* Y. y' D$ b return TRUE;
, \: d# @0 F7 a9 F2 \$ C: C. G' h; } }
: a3 W- h z# F* [" Q4 K5 K T return FALSE;
6 a7 ^" X" B- Q, a/ f2 f" \}
, ?+ _% p8 O9 q7 W1 j
0 e- |6 U# q, y# tAlthough this trick calls the CreateFileA function, don't even expect to be% g9 K& u# ^9 R o8 X) u0 [
able to intercept it by installing a IFS hook: it will not work, no way!
6 {& U" ?8 C R s% M1 e8 EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
* Z. C* C4 c" sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)# g4 C; ^" T4 |/ ~; ~+ o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 O( B4 _# S: M% s# lfield.
! q" \/ G: L' f2 J0 g4 KIn fact, its purpose is not to load/unload VxDs but only to send a
# q( U6 @2 |) V. i. j: kW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 r, \) F: G$ p% Eto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 K1 j8 Q% _( b/ ~# nto load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 D6 v7 l, {- E$ q) ^! vIf the VxD is loaded, it will always clear eax and the Carry flag to allow% f5 O9 t' b3 W: W
its handle to be opened and then, will be detected.$ ]; {( v9 ^6 U" ?
You can check that simply by hooking Winice.exe control proc entry point
8 }( T3 Z" _8 Bwhile running MeltICE.1 `; X. n! ]& ?9 d1 }
6 t# v1 h" j9 F" e* S8 H2 w, c6 |' A/ u
00401067: push 00402025 ; \\.\SICE
$ A$ _$ I3 X6 ^9 T) W% T8 ?( x 0040106C: call CreateFileA
, m/ H3 Z2 x) @+ y8 ` 00401071: cmp eax,-001. A2 D( }8 R5 R8 p( O& e* k9 {& f
00401074: je 00401091! ^' ~( |" j# I& }' a3 ~0 t
4 F4 C( {* h9 c9 W- @! b' Z
5 ~0 j3 \3 j' y
There could be hundreds of BPX you could use to detect this trick.
3 v* F4 q9 \! y! g y-The most classical one is:- D5 [" K1 a( m5 v( u7 P$ Q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 _/ S6 Q( S0 P7 v* e
*(esp->4+4)=='NTIC', J2 N& j; c ?6 x! `: }2 `
) I2 s' H4 {6 B2 K! i-The most exotic ones (could be very slooooow :-(" {( X' C S) p7 A T* J
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 H( F* @/ x- G) I9 g/ ~: Y4 m ;will break 3 times :-(
: e* f& y7 w( h3 A7 ~0 @0 R
6 d8 [0 }& U9 A7 _; q-or (a bit) faster:
# \ b- b+ X$ I) C& l' g/ t- [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ R) z& \1 c( }7 U1 G
6 y% }+ d0 C$ Y8 L1 G; m BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
8 m! N3 E+ x. @+ q. l! j ;will break 3 times :-(- G7 d- M0 V% I" r2 c) s
1 ^/ ]0 _/ s3 j8 h2 I-Much faster:- T% T3 {0 w/ T% k. }
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'# c& y3 J# M4 J; A& O
! ^2 R% q5 O6 C3 {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ e: O% j) e3 F" {( A9 n7 \function to do the same job:& r+ o* F) y* ~1 i
+ I& \; U- [6 l3 o7 e5 F8 W) I* T
push 00 ; OF_READ
" y0 P) H P4 J1 w1 H& y# Y% _ mov eax,[00656634] ; '\\.\SICE',0
# S, ^5 X2 Z9 ^7 _! w; D push eax( q$ `1 ^/ x7 n2 L; N T
call KERNEL32!_lopen, P) Z& Q* J3 D
inc eax
! Y1 p& v* Z w& g" g jnz 00650589 ; detected3 L4 ?; O2 I1 g+ ~2 p4 o1 s
push 00 ; OF_READ! w! V! E( S% h$ z$ x2 U
mov eax,[00656638] ; '\\.\SICE'
' |! C/ ~# ?- ~: \8 v4 i% { push eax
, K" K7 j8 \: P4 r- v call KERNEL32!_lopen( p! X3 n0 B, R* ]# a1 y5 ?; L
inc eax
# N" |1 v: Z. x. H3 X jz 006505ae ; not detected. h- p6 F6 N, Y# E
! E, T z% ]$ I+ h2 z2 D
( H' T3 | T! e+ W) z__________________________________________________________________________2 @" M+ y4 M2 r* o2 F" j1 W
: O ~6 e% {3 i& A; ]7 M
Method 12
& a' F8 h( w) K/ u( ~4 w. N8 |=========
, a/ G0 f$ \+ E$ o3 F5 a/ y) I9 F0 C
This trick is similar to int41h/4fh Debugger installation check (code 05
3 @$ p7 c% y% {0 I9 h1 ~& 06) but very limited because it's only available for Win95/98 (not NT)3 C0 _+ f: X. D5 V: X# J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 U% z; }- y) S& U
: p# q/ W4 U O* F
push 0000004fh ; function 4fh
# i8 g6 d+ s; F push 002a002ah ; high word specifies which VxD (VWIN32). q' L9 g+ i# h& X! H$ a8 p% s
; low word specifies which service7 W( l& N9 o- ~3 C' V
(VWIN32_Int41Dispatch)
, |9 ~4 i! [3 d1 o9 ^; j call Kernel32!ORD_001 ; VxdCall
: j3 |3 K' j9 P cmp ax, 0f386h ; magic number returned by system debuggers
; p$ E) t& @8 |0 K/ N$ \ jz SoftICE_detected1 R4 e" y8 Q5 E; r1 t
( U. X6 E8 e7 p
Here again, several ways to detect it:; \( F1 b, `; \9 b) O# `
, {" ^7 w2 j) b/ G) K3 e
BPINT 41 if ax==4f
. [2 d/ G' B$ u. z) Q, H
: U& S2 h' a5 [3 o. a BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 i7 y( s& p/ a! u/ L. B
) H0 U q1 J; s9 X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ D( L9 M( i( p( }/ M
( _0 e8 N3 H) N+ p5 I+ ?
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- b, g# n0 D2 R: A) ~' F( X% ? M1 o; n9 E
__________________________________________________________________________6 w: T. a3 V+ T% ]/ ~5 g6 m
: A N4 _8 Q5 O5 ~5 P) d; @
Method 13 z+ J T- R/ M
=========
2 O! a- q) z" v6 Q6 ~2 }/ j q% M" U4 \, O+ a
Not a real method of detection, but a good way to know if SoftICE is% w# r7 n% N$ L) B# |9 b. s
installed on a computer and to locate its installation directory.
$ s2 p" J5 h \) l8 J/ T5 Y7 ?It is used by few softs which access the following registry keys (usually #2) :
, h, X) S1 c- Y ~' H2 m
( v! _4 p. W& q# b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. e- r: `. o$ @% a8 X' @. l\Uninstall\SoftICE% I! }, P3 X+ I, |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) r0 F4 P+ ]) ]- U% P9 z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ B& J0 I$ n8 |3 Z' m\App Paths\Loader32.Exe% D3 x- S5 s% i- b3 L/ A
; E3 o X; e' N" ~
: Y- j8 j" j) {) T6 \Note that some nasty apps could then erase all files from SoftICE directory
& h9 i# C/ a3 w! H8 U- I(I faced that once :-(% ~: I X# b/ Y$ `7 s- Y
2 z7 ]7 Z1 u1 q( f4 e- dUseful breakpoint to detect it:0 P1 j: Q) A" ], M2 A; V4 ^/ L, d
# v- B: l4 o1 Z. l1 ^ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: }% [+ K4 |3 v6 V9 L" F @+ Z: Q
+ P" w; V% A6 D* F__________________________________________________________________________+ X7 v2 {9 A# I
6 J) h* Y5 x, e" o% D3 ~' {% ^
3 m5 I/ X! C4 ~# E1 W
Method 14 5 U I$ V. ]* Q9 V" s) }8 I
=========- y. V- }( Y4 t1 E; u( U$ a6 h
, a6 t0 d( }8 J) jA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" T" o0 P1 f; d E; p6 v6 U: |8 @ Tis to determines whether a debugger is running on your system (ring0 only).
1 [4 h% b( w& Q' ?) `8 s( @+ B. X1 `6 [( \- C7 q$ o* _
VMMCall Test_Debug_Installed
" T, h& u/ ]7 D( I/ `' D8 M9 [! W, G je not_installed
: u4 g" A1 D" k( u
: O* j7 X4 {4 z9 h9 a5 ?This service just checks a flag.
- N. @8 h& N0 s% c& ]1 g4 j6 \</PRE></TD></TR></TBODY></TABLE> |