<TABLE width=500>
7 P, t: V: m2 \) ~( z<TBODY>
0 O! j5 r; d& p; e<TR>" y8 I4 o% u5 [8 W& ?6 n% y5 X
<TD><PRE>Method 01
! @! | m3 s' m* D5 n. t* R5 Y) i=========
2 p1 ~- W2 K1 t9 [. p; \6 q
9 H1 C, u3 n l% A/ o) R; L. DThis method of detection of SoftICE (as well as the following one) is6 g0 z4 R4 m" M+ w1 m
used by the majority of packers/encryptors found on Internet.7 `" J0 }, e% c' f% P
It seeks the signature of BoundsChecker in SoftICE% Y# {, K4 p/ V) G
& W" U" F" I+ ?5 j, H mov ebp, 04243484Bh ; 'BCHK'
( c$ ?4 S9 ]' i( ~/ [! w" l9 b2 R mov ax, 04h! Z7 v% |, I; f" z8 Y; m* O4 |2 s
int 3
6 z8 _6 b5 Q% P T6 E1 p cmp al,4
& K# A' _2 v9 C4 W5 P j4 ^! x" w jnz SoftICE_Detected0 N5 a$ o0 D5 ? F& u, }
- P. p4 q& ~, G; {% g___________________________________________________________________________
- q/ m- S% h9 J% t8 U2 G5 L, o/ Q6 j& u4 q. X- u
Method 022 c6 f/ C+ |! I! R- v6 w: K1 ^3 z
=========/ G9 G% H7 R* ?% d3 n
* X, I$ M3 x" {, YStill a method very much used (perhaps the most frequent one). It is used
1 T) K0 b( b9 j: y1 Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 M- {- @" B& d( C/ G4 |& F. G
or execute SoftICE commands...
- V6 ~8 ?* r$ L7 p5 UIt is also used to crash SoftICE and to force it to execute any commands8 i, h+ J+ R4 S5 V$ ^
(HBOOT...) :-(( * h+ c+ d( m- j% f# n9 Q6 k
/ R9 d% o! O$ O3 v4 MHere is a quick description:- E2 u- S6 j% R/ C: ?
-AX = 0910h (Display string in SIce windows)
! e/ y: v7 R; e" e-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 g6 N* d. f' k- [9 D' k& q-AX = 0912h (Get breakpoint infos)
" g7 U" V8 S1 q$ p-AX = 0913h (Set Sice breakpoints)
1 J" f" `3 H: s3 o" b# L1 @) J-AX = 0914h (Remove SIce breakoints)
0 r! B2 L( _7 O0 t9 y6 t# h* @4 Y& @
Each time you'll meet this trick, you'll see:6 F! ]; K2 A7 k1 Q# O" X
-SI = 4647h R" E+ F' x, V7 t/ i: f
-DI = 4A4Dh
9 e& |' d8 K* b) E$ RWhich are the 'magic values' used by SoftIce.
@' g1 @: `( m; VFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' ~8 j6 ]+ D, t
5 r& j5 E% y& w# {Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 I# D+ \# M# j& W3 iEnvelope utility use to protect DOS applications:
/ p& _+ N. X" u6 A$ q% j( {( r4 e/ t" Q' D
6 E, Z+ o0 P* O; b9 K# A
4C19:0095 MOV AX,0911 ; execute command.! k" n& m1 O% N
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 W8 x7 r4 C/ |0 }4 }4C19:009A MOV SI,4647 ; 1st magic value.
4 n7 X" _' f: U" `2 b- v4C19:009D MOV DI,4A4D ; 2nd magic value.
; ]2 J% Q, f; n- @4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ _. f; N) ]5 l4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute$ J2 c6 s- F o2 S& Z
4C19:00A4 INC CX' B2 W' X9 I* C' g
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ J- S: p! b1 Q, f0 }$ c3 P% I
4C19:00A8 JB 0095 ; 6 different commands.: `) \4 h/ g. y3 x- U# T# q
4C19:00AA JMP 0002 ; Bad_Guy jmp back. q3 f1 C9 R' A. J- J& C3 I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- A, E! K& I/ [. i2 x h2 R4 j& Y& M) P% l) N q
The program will execute 6 different SIce commands located at ds:dx, which9 C% d' w5 [7 {. r) V
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* d* g7 A: E# I( O) g% x
! s" }9 F, ~1 l& m' o& v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 j/ z; q! m5 m
___________________________________________________________________________
2 x& Q l4 c! p' Z# d1 ~8 z t. q8 z' J: M, X6 c
$ V `. E+ `- l! R7 c0 a8 S& U4 C9 G, `2 w
Method 03
; @: \/ ?; \0 [! l$ M+ y=========9 \4 e( ?3 j, n- O5 R4 |
7 h9 M. H" A! g: Z/ ^( TLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' |$ o" ?4 q" f/ h(API Get entry point)
8 e1 n5 t9 ?! x, J d
7 Q$ ~2 @8 b" j2 `# w! N# s- k. E# ^
xor di,di
7 Y/ A% C( C8 I mov es,di$ _" f/ {5 L0 {- R4 d
mov ax, 1684h : g' s: ]3 P8 ~3 ?
mov bx, 0202h ; VxD ID of winice
2 r5 f7 u J* E: U( J int 2Fh- o+ x2 E0 l j% \" B: d( G9 k
mov ax, es ; ES:DI -> VxD API entry point
% A. H5 z3 Z% E add ax, di9 Y+ [. e# L/ T$ Y) Y
test ax,ax
% z! J% K% a$ f' D2 l jnz SoftICE_Detected
. ?* }7 V3 R4 D8 r7 D) ?9 o6 B) }/ T% T2 s
___________________________________________________________________________, o( N/ f4 K! K, ~7 c7 J
8 t0 i8 w8 Q* c( q% g: u" }" S9 X
Method 049 a* d% c* w3 y. R+ N$ @3 E# {! d% T9 h
=========
h$ r; W9 s* t: w i6 a: I/ t A. r( ]
Method identical to the preceding one except that it seeks the ID of SoftICE
& z. g# L. O! q. aGFX VxD.& b2 J# w" }, u9 B& [0 e1 d/ V
) N. f x9 ~; o( F
xor di,di
; D( s% P7 @! F+ ?4 \6 W' j! l* h mov es,di. X6 n+ p! y9 y6 a
mov ax, 1684h ) H/ [, H. V2 C' m% d
mov bx, 7a5Fh ; VxD ID of SIWVID
L9 m# X& y3 f! J; P1 i! { int 2fh
7 W' @' f5 W3 w: J0 f& [, ] mov ax, es ; ES:DI -> VxD API entry point1 `9 }' r3 [" R: o4 B& h
add ax, di- X A! U$ \2 }( l& F
test ax,ax, d; d5 H7 I2 p# z( g; Y
jnz SoftICE_Detected
9 X2 c. l1 {! P) q+ z4 s
" x( ]5 ^& a8 z2 D$ ? E__________________________________________________________________________0 t3 q# b8 D8 I& G- H" U' X; B" [
+ v3 Z$ T) b" {& |! z5 Y6 g$ z
/ \2 \6 z9 ]" A' P* B' |, f0 Q7 u
Method 05: o3 W' {7 |( J3 m% V- J9 k$ a
=========7 q+ P4 _$ j" m4 h
: L4 t) Y6 ~9 ?% p3 g; E8 h8 cMethod seeking the 'magic number' 0F386h returned (in ax) by all system, M* X- k! h, @* L4 e* I, ]# |" X
debugger. It calls the int 41h, function 4Fh.
) _/ D1 {" b- S. LThere are several alternatives. 6 [8 O1 D' o+ z- V. ?* b
+ j0 e7 ?, w! V5 C
The following one is the simplest:4 z3 s& J1 v+ ?8 m' F5 [/ t
0 ^4 L3 ?# L/ z/ V mov ax,4fh
6 y, c' A* N# s8 d- P: E/ { int 41h
8 v; _! h0 [; I: v( x cmp ax, 0F3868 B2 z: H& @% }6 u. J5 ?# q
jz SoftICE_detected
$ X7 ]- {$ y8 B6 r: ^( W4 ^1 N- o, f9 p: R* }% d# g. b
7 k# m4 ]& x% K. m; x5 O [Next method as well as the following one are 2 examples from Stone's % j1 s/ l- F! d" |9 O
"stn-wid.zip" (www.cracking.net):
' S6 D" Y5 V9 Y: o# y3 p( n% A1 }2 d4 [9 Z4 \3 _7 L, j; }& }
mov bx, cs
4 ?8 i% j) u6 l1 u" C lea dx, int41handler2
2 P( b e$ M( C! C- s xchg dx, es:[41h*4]
; g3 q; `# p# A* ~" X xchg bx, es:[41h*4+2]9 |! ~# d6 t# Z$ b
mov ax,4fh
6 U l0 T3 {2 R6 c" c1 V int 41h
' }1 G4 D' u5 A- X xchg dx, es:[41h*4]# Z5 A% i: R d8 e
xchg bx, es:[41h*4+2]: e8 k+ d# v5 i% d4 g
cmp ax, 0f386h
6 k6 K/ T* i3 ]) G* S% v) |1 B jz SoftICE_detected
3 x1 s- q, V1 l% _( e9 W) M9 X" n
0 Y3 i. _3 G& j# G+ |, y) Nint41handler2 PROC# [5 d% h! w/ n: b& B8 m
iret* p, t" B' `+ ]$ l- E3 ]
int41handler2 ENDP
- D ]7 x5 x0 G5 L
2 f+ H4 p, B0 x! T! b5 y# ~
2 P( a6 v2 A) H ?" C_________________________________________________________________________# R, H3 v' k& R
1 z, y2 f1 w8 R) L0 R
9 U" n, W" `$ Z2 n( |0 oMethod 06
6 x! H7 T# L; u* j$ T; k=========5 N0 i) I+ e# f0 E3 N
" W2 X5 z0 {2 h
3 [* s: H+ h7 m" U) c5 V f, P2nd method similar to the preceding one but more difficult to detect:
9 P, r2 |3 v9 u# Q4 _4 d% s9 h9 ?( l, M& `' ?
) z- O0 B' t1 Z: {2 S2 G( v
int41handler PROC$ w" s) U- ~6 I+ d5 g
mov cl,al& J p% ?$ O6 n* H, M0 g% N
iret- S" m, V( B- k& w+ |
int41handler ENDP1 x) r! A" z- Z e
* k6 G& ^3 M& C
3 T- E: F7 c' o xor ax,ax
3 D% l) O7 ~( \; V" B$ S mov es,ax
3 C4 ?' D6 h, w- L mov bx, cs
5 @: ?9 a. R. A# J lea dx, int41handler
& o& d# m4 J- @) j% {7 k xchg dx, es:[41h*4]
9 h4 y! c2 L. Z- i xchg bx, es:[41h*4+2]& L5 j- n9 ^1 {, s1 }7 R
in al, 40h4 Z# z% b. [4 R
xor cx,cx" O+ g% b+ t Q. F& K/ L
int 41h
8 ~' E( t; Y# m7 a6 p L xchg dx, es:[41h*4]
- p" B7 F4 V& T4 U xchg bx, es:[41h*4+2]# x6 r! l5 P9 A
cmp cl,al
* e0 n$ N* c J" c jnz SoftICE_detected
6 Y3 h9 v% r; b6 j8 O3 D9 W/ Z. X, A. R% | z- J
_________________________________________________________________________
& t9 s& v9 ~; y: ^ M
$ ~+ W' z# U8 ^1 f0 [: WMethod 07
6 B# L- j5 @& e& E=========% M! a) F% ?4 f" S" j9 }
, H4 R! A: g0 j3 v& V- z" O
Method of detection of the WinICE handler in the int68h (V86)
7 P+ E- ], X4 X' v* b+ S- h& F. @* N/ e. I' i) ^. D$ t
mov ah,43h
4 v% P, p" Q9 z4 X/ R int 68h' }2 A7 @9 w4 N" r0 N
cmp ax,0F386h
- e4 V/ M3 E4 `5 R# S; y jz SoftICE_Detected) D) Y5 ]4 M- |
8 t9 {4 ^" S& n0 {- Z3 v
, F* ?6 U) P3 u; I/ g+ R=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, G2 d- [. ]6 S! j0 k" y8 X5 w$ o W
app like this:
, {: H7 r5 u1 Q6 J
7 D5 c/ I: D1 z, z BPX exec_int if ax==685 i% C8 ~2 U$ u# `" r
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 {" G0 U3 T: K9 x0 C located at [ebp+48h] for 32Bit apps)! O: ~2 B. L+ v4 y/ ?7 u
__________________________________________________________________________
, l: K# l1 y. T* E, j# X% ^6 G% M2 [3 B9 u9 `
2 P$ |# N" L" A
Method 08! }0 K" a2 j1 F6 O, `; Z# C6 U
=========5 S4 S0 i4 U' V: b& s
( ~4 L& B- w2 J! U! B
It is not a method of detection of SoftICE but a possibility to crash the
( H7 P' f l( l3 O0 ?: Qsystem by intercepting int 01h and int 03h and redirecting them to another0 h6 [& G& I- x5 B( Q
routine.( b. s( o$ e% p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- A- V0 ~$ F1 g. k5 F5 y8 kto the new routine to execute (hangs computer...)# ?6 X0 Z* B' Z: R2 x3 f% s% S
% o6 C: }% }8 `5 G1 l2 J5 s
mov ah, 25h4 A' i4 m+ ~# A9 l) I: s3 q: G
mov al, Int_Number (01h or 03h)
3 b4 D9 v4 l* ]8 S: W6 u mov dx, offset New_Int_Routine# I* x9 {: h9 U5 \9 j2 A: L
int 21h
v7 z3 q* h6 g' t
% L4 Z F" B4 `/ M: v3 b__________________________________________________________________________ d" `1 P! N+ N% q
- F( {4 f3 i5 y. ?, k% o
Method 092 M/ p, t6 _2 r7 H! H' i* n+ z+ o* Q
=========7 Q: T0 [% d# B8 R7 K1 n
+ c* }* [9 p* K6 M$ ]8 @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 c. s* w$ b- [performed in ring0 (VxD or a ring3 app using the VxdCall).
7 {. i: Q9 s" u3 I" SThe Get_DDB service is used to determine whether or not a VxD is installed
; G. ^4 f1 P( Y0 efor the specified device and returns a Device Description Block (in ecx) for
. X( `9 P1 I7 S6 ~4 }that device if it is installed.
9 I2 T& _( \: m7 W3 R' ?
0 U, f# k3 z3 f, }% l* q mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 J2 X( ?0 L$ H: t2 p
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% P- U4 ?4 U" h! | f. d
VMMCall Get_DDB
( c$ h9 ?+ ^: J( q9 @0 g mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed5 [( K" R& |! Y
9 j# H/ G2 t% r. G4 ?Note as well that you can easily detect this method with SoftICE:! R. a( T% Z% D% C4 K5 H
bpx Get_DDB if ax==0202 || ax==7a5fh
- b9 V* D( q3 @* R) E9 B' A- v# F+ ]
__________________________________________________________________________1 c8 |& L6 x |
+ x$ Q/ [" h, q8 W8 G% V( L
Method 107 U7 p1 [7 U9 d: C/ N
=========
2 x, K! h2 \" i6 Q+ z5 u |& w o# F* y7 F+ N
=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 w5 g2 @* e7 N0 W SoftICE while the option is enable!!. F- {3 R, }+ i* l+ j
8 Y$ v6 R/ ^; h: Y5 j0 N% r
This trick is very efficient:
- U" N! h! T) |; fby checking the Debug Registers, you can detect if SoftICE is loaded/ X" t+ d2 r( d: u
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) g9 w% A; z1 s2 e' J; athere are some memory breakpoints set (dr0 to dr3) simply by reading their
% g8 {/ Y& S/ C- }value (in ring0 only). Values can be manipulated and or changed as well; |! ]1 d' t/ b. e* ~& I
(clearing BPMs for instance)/ g" r ]# M! B* b
: a: E4 m/ Q- ^$ p. ^, U6 s. a__________________________________________________________________________
6 @" ~) d6 V, p4 e) h; s( I
' H3 S/ p e8 |" PMethod 11
+ y# D: E! W7 _& K9 \% o3 ?=========/ x' x( A& Z: I
% z% c' O: l1 ^, T2 A' ]8 UThis method is most known as 'MeltICE' because it has been freely distributed
/ o% y! Y s f3 Bvia www.winfiles.com. However it was first used by NuMega people to allow C) `0 m+ l$ l$ E+ n7 i# H
Symbol Loader to check if SoftICE was active or not (the code is located
# {) Q0 g, q' l7 [" ~inside nmtrans.dll).
1 E m: ?' C2 }. z* h# } g1 \9 k* \/ O" a+ }5 f5 t, Z
The way it works is very simple:
3 U$ g( q/ F" Y& _0 `. E0 CIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 h+ m. E+ _' W0 [WinNT) with the CreateFileA API., p$ g U2 N. l9 P) y
" S3 I, x/ B% U
Here is a sample (checking for 'SICE'):' ]7 f- ^) v7 C
" T; ^% }1 V! [3 ]BOOL IsSoftIce95Loaded()
" ^1 T( R9 u0 n6 |# z7 v3 k7 } H{4 A$ e5 m5 @/ X! C' `7 |. f
HANDLE hFile; - I4 C: n+ Z! j/ L0 k/ ^" l
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- D: K! w: P; N( t
FILE_SHARE_READ | FILE_SHARE_WRITE,+ D2 M1 R, n. _* U8 C$ S
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) C; u& V/ I5 B: v/ l
if( hFile != INVALID_HANDLE_VALUE )
* z6 b D' O6 c$ G: u- { {
$ V2 Q. U! W2 {2 u CloseHandle(hFile);
6 p0 k+ b' m9 _, n- ` return TRUE;
$ z5 L0 }) Q6 t( b; T& \6 d }
/ O7 q8 g% J; ] return FALSE;
/ X- i, [, L8 d}
$ d* w3 @' f. G, p! A% \
$ i0 }% O: [* ^Although this trick calls the CreateFileA function, don't even expect to be% h* [: w+ W5 R) J
able to intercept it by installing a IFS hook: it will not work, no way!$ d8 [" n" M: v9 ^/ ~5 l
In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 j4 ]+ q6 p8 I% s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). P9 ^1 X2 Q5 J( L* \& m% M9 ^
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
" u, ~- g7 U, K9 R1 L2 ufield.
& `0 _7 y: L0 H9 b' U/ ]In fact, its purpose is not to load/unload VxDs but only to send a 2 _* b. H. v# |' w" y' V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. B0 {9 O5 e( w7 } Dto the VxD Control_Dispatch proc (how the hell a shareware soft could try% v3 X; @4 O8 o( b& ~; ^. \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
' t5 m! ]6 o* n) V) r6 EIf the VxD is loaded, it will always clear eax and the Carry flag to allow( o' L- m) `9 W( Y* I4 N6 l+ {
its handle to be opened and then, will be detected.
. J7 w) I6 ?2 a1 ~You can check that simply by hooking Winice.exe control proc entry point
/ B- `: A# G* H: A% O' \4 S& k. y) lwhile running MeltICE.
) C+ q/ A6 l9 g' E- f' k4 T! ?! l/ q
; J3 n% O$ B& |* F, h4 Z 00401067: push 00402025 ; \\.\SICE
* o, y0 u' j* q 0040106C: call CreateFileA
: Y" R% O: c. { 00401071: cmp eax,-001
" S: R: h8 I. U) i/ D% x& v 00401074: je 00401091: ]* D0 z! G ^
' Y R5 o: ?! p) i0 B9 @1 W( T5 |) v$ l4 b# h2 X8 A
There could be hundreds of BPX you could use to detect this trick.9 S; {9 t( I- E" y9 m' h4 B: M- b
-The most classical one is:* K, i* B6 Y2 ?4 H& K9 K# b
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) \, L+ q. u6 u5 s
*(esp->4+4)=='NTIC'; T W+ c4 P1 g' Q/ ?4 |+ u9 Y3 s
8 C* q# e2 r% {/ u-The most exotic ones (could be very slooooow :-(
8 R6 |/ C4 \! P2 t9 A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 D6 L. _' o+ \8 X3 ^* i: T ;will break 3 times :-(+ u) H. w4 H1 N& b' F& p
" W! }5 W' o* p4 I, ?5 O
-or (a bit) faster: ) h# I+ q3 `6 V
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: ^) E. I. T2 w" A( m* Z" m( |5 F9 y9 y& p6 @/ M: a* L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: A3 z n* u% |+ b7 ] ;will break 3 times :-(! c5 [4 z" J* z5 D9 L& M
( V! m H& ^# p% x5 _) I j-Much faster:4 v" O+ I! Q) r2 ]' f+ T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ b5 v* N5 A+ U, n/ I, P4 X1 m
7 x% b% o9 ?% RNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 ~$ {' {8 B1 b! P8 J. Dfunction to do the same job:
" `) r8 q7 D, ^6 {$ J" @' x
# g3 w& N) D7 S; R% B) j* k/ T push 00 ; OF_READ
! s- E0 _& [1 X+ G0 C: ?; J4 O: y mov eax,[00656634] ; '\\.\SICE',0
s: `/ ]! D3 L) H0 s6 \ push eax; Z9 U5 ?4 N3 ]! F' k; D$ i: T
call KERNEL32!_lopen
6 h& Y- H" }3 \ inc eax) A9 T6 d8 p) o
jnz 00650589 ; detected) D, G' p( I0 {3 K4 S+ Z
push 00 ; OF_READ
: a: E! E# v. W$ S' U( w mov eax,[00656638] ; '\\.\SICE'$ c1 G4 L* t. k8 r) Q3 f; ~
push eax4 A6 a4 n# m% L' R9 f
call KERNEL32!_lopen
3 P. C% F: A3 G# m+ T inc eax
/ C! F% ]6 e& |8 o* I jz 006505ae ; not detected- `3 g% v9 Q: s1 C
9 x+ C( R; Z+ Y6 D9 ] e
" p# H1 r5 b9 e( r; N o__________________________________________________________________________
" d6 ^% L6 K4 c h# ^1 U/ e; u7 W O7 t |6 k7 @; H
Method 12
5 m# |. S0 K9 w/ |=========- D7 Q8 l1 d& m7 _
; X$ B3 x/ ?9 }
This trick is similar to int41h/4fh Debugger installation check (code 05
& K3 c$ A1 h" q4 c* b( n8 L+ v& 06) but very limited because it's only available for Win95/98 (not NT)- M( |' {# X, Z: {, u" {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 _2 T" H0 `* u3 L7 s' C( V) Z+ X! [+ r
push 0000004fh ; function 4fh o' U. Q+ b4 |$ D7 X
push 002a002ah ; high word specifies which VxD (VWIN32)
$ o# H: M/ @. J: Y: i$ F1 U ; low word specifies which service( o* D- g( D8 S- a: ~5 E9 {1 m
(VWIN32_Int41Dispatch). a$ n) ?. s! k7 ]* C K% J! a
call Kernel32!ORD_001 ; VxdCall8 k1 e+ t+ j! p- w5 _4 D
cmp ax, 0f386h ; magic number returned by system debuggers) p% o% L& T; ^. Y w: }- h
jz SoftICE_detected
/ P( t# P) R; D" ~' z
4 I4 B. v6 K! ^! @' ^: W: l! VHere again, several ways to detect it:
- [1 }$ ^( w- V5 | D* b) [ u
$ R7 r: `1 v S; `" T BPINT 41 if ax==4f
3 l6 E& ~3 x+ q) ~7 m
6 z- }% L1 \$ s# Z; ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ ~3 o8 v( f. ]5 A% ^1 b+ ~
8 c4 |# X9 {7 L# N BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. S) |! z: J( ]+ Q2 v4 o3 i
. Q- [) y) I! h7 T2 Q2 @
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 R& V8 a+ N" K) V* w% \6 j
# E D6 q7 A; J+ U' C( D Z
__________________________________________________________________________
* T; o) S+ }- M- n* Z( l- m5 Y2 c, j5 k+ [
Method 13
# C0 ?( z& q3 D6 t. R/ ]=========
# G3 h! I8 J* e; y
/ F. \9 c/ E% ~6 PNot a real method of detection, but a good way to know if SoftICE is9 m0 T2 f* l# b
installed on a computer and to locate its installation directory.6 j5 [& |7 F3 N% U# O, d K
It is used by few softs which access the following registry keys (usually #2) :
* T8 ^* ? B C c- r. c& Q
0 s2 S; m1 |: l! ^-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& R+ v' `$ q; Q" ^# p, J$ |
\Uninstall\SoftICE
' r7 |- B* X9 Y+ A4 Q$ u7 Q8 [7 f-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- v0 ]3 x$ S0 q5 o7 \
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 E; Q/ o/ g' s, d M/ h o
\App Paths\Loader32.Exe- k4 l, }9 `0 D( A. `
y$ ^: ]' D* Y6 r! m1 D$ D
: z. \* O: p2 b% W) B0 h
Note that some nasty apps could then erase all files from SoftICE directory! _/ C8 e O4 c( U, }2 Y
(I faced that once :-(- l# S) ?# N Z( c0 o* W6 F; ~* `8 F
, K/ R) J7 @( |& Z! k2 E
Useful breakpoint to detect it:1 p9 A9 `/ i1 r% e3 q0 c
3 |. g0 G; ^2 m' S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' L7 J/ w2 s" ?8 a. [
1 a* }/ D" |% C, d; P& N1 I: L__________________________________________________________________________" [( }( w, `& {
7 T+ v# H: P2 b& b+ a
1 o2 L* I6 `7 G" B8 Y( E3 n
Method 14 . v; x+ d8 E n' R
=========
$ x5 r$ ]3 u' z) C% I a& B
0 M0 g5 R" z. x, v. Q. s/ A5 @0 b) l0 tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 a8 W$ D' Q3 ~$ K4 P6 }; V
is to determines whether a debugger is running on your system (ring0 only).7 j. q l& ]0 G: r2 Y# S
# Z: W" L$ W' U
VMMCall Test_Debug_Installed x( b$ [; a4 W3 g1 I/ _! h
je not_installed/ X2 T9 t1 e3 M4 j2 _
3 k( \& J% t a; r$ K5 K+ [+ @This service just checks a flag.
! {. {0 f* i) C F</PRE></TD></TR></TBODY></TABLE> |