<TABLE width=500>) J1 H& N' G% r! D( r
<TBODY>
$ F8 }$ l$ Y* b1 z<TR> T g# f- q% Z" {7 Z6 o
<TD><PRE>Method 01 / q. U! p% z$ L( r! {
=========
8 k6 n% k! y3 Z* i0 ]4 P
- o- T- E1 y$ D, H* F1 ~This method of detection of SoftICE (as well as the following one) is
$ t0 u4 q% R, p: qused by the majority of packers/encryptors found on Internet.
, B$ V) x% e" v3 S8 u- E9 wIt seeks the signature of BoundsChecker in SoftICE
* ~! ?: O c5 _0 @( h/ b N7 Q( u, J- W0 h1 v
mov ebp, 04243484Bh ; 'BCHK'
( e# N" X! R6 J mov ax, 04h* ~4 Y1 y- i" k' N9 {8 v
int 3 . Z. X ^) C+ ^6 K) Y, G* M
cmp al,4
2 L# j6 L+ c# ]2 c jnz SoftICE_Detected
3 ~7 A$ r6 q( J" k) ?8 j: b6 Z- y6 v$ @
___________________________________________________________________________$ y: l. `' G- R9 L5 ~) {$ t5 A" q: j
- a3 F: W1 n" I o+ H( b+ n
Method 02: N, T3 s. t" C# w5 J
=========
9 b3 M( \% e6 G
" A* @- M* `- ]7 X2 ?Still a method very much used (perhaps the most frequent one). It is used) _( ?& d- @7 L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 m3 X3 q) S! C
or execute SoftICE commands...
: z1 a; C/ b2 GIt is also used to crash SoftICE and to force it to execute any commands
; S" Q' k4 R3 u# R- U3 m(HBOOT...) :-(( & ]" f; A* W/ o6 Z
9 B1 f* \: k, A6 ~) ~$ }2 M4 QHere is a quick description:
: E' E Y% g: U-AX = 0910h (Display string in SIce windows)4 X, @- }& t1 Q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
4 S4 o9 g3 o: O! z6 n# D-AX = 0912h (Get breakpoint infos)
8 J3 t& F0 U5 `, v-AX = 0913h (Set Sice breakpoints)
) l& U1 u# _8 _& b1 y3 T) i-AX = 0914h (Remove SIce breakoints)
6 Z8 i6 b7 x4 B- ]$ |. c/ \
' _: R7 I' d! Q; E5 d+ ^: a6 q/ ]Each time you'll meet this trick, you'll see:# k3 e/ k' b8 b- ~$ C$ u
-SI = 4647h
' _. ?( W- t2 ?: F-DI = 4A4Dh
; W8 d/ e4 L% C: @9 ]! s' Q7 iWhich are the 'magic values' used by SoftIce.
/ P1 ?' `) L2 T* _, m5 SFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.* G4 {6 M4 u" \7 |) h1 J* D) i
- a2 m) @& x' k, l0 [& U' LHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 k3 v. M9 z& s6 [Envelope utility use to protect DOS applications:
- A" q; r% }+ V
% Q, Z6 |/ }1 }! B" K& \
; M) O C( H# r4C19:0095 MOV AX,0911 ; execute command.
2 B. u4 X2 Z7 t2 L5 d% `# c4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% M5 }. a" L$ x9 Q8 z+ d9 b
4C19:009A MOV SI,4647 ; 1st magic value.5 B7 L. G5 `# q. V
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 k) k0 ~: z* m) T$ i2 v/ }4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& g" T, z7 u, u8 K1 _, Y, V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 ^. T e5 X+ V+ C. J& K4C19:00A4 INC CX4 M$ [2 h7 _' }# o h! p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; ]; s/ [3 V) A X! m( T4C19:00A8 JB 0095 ; 6 different commands.
. {# g; ]" u! ^ T; ^- B3 S4C19:00AA JMP 0002 ; Bad_Guy jmp back.. J6 k8 C, Z& [1 c/ H
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' V: E1 _- D6 R, z7 V2 Q- z, j
0 T8 O! _: n- ^- B2 yThe program will execute 6 different SIce commands located at ds:dx, which( d+ ], M8 j2 g/ r0 w7 B2 S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
k/ [( R9 m9 f2 |2 g7 T/ r; s/ W7 I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.* x4 v; Z6 y6 l+ T5 e3 X. e
___________________________________________________________________________3 F/ f) D! v+ L( P
: J* X+ K. }7 r8 L3 ]: @4 |
6 f3 c+ R. H3 U. Q: x# o C! yMethod 03
) X x" ~" |3 ]. S9 C! a0 z8 C========= H( k1 s& _' }1 p% w4 @
2 d t9 S1 ?9 @6 b
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( r+ d/ u8 M6 L* M% h
(API Get entry point)
3 S( g5 }: z( a# t+ |$ W , a; O8 ]4 M9 ^
5 E" o3 M7 }1 _1 w
xor di,di8 u5 v# k, ^5 {& Q, w4 z6 c
mov es,di
: f2 B8 K- U$ u \6 h mov ax, 1684h * j) f# u9 S+ B3 X
mov bx, 0202h ; VxD ID of winice
0 T8 J6 z) }5 H( i, _0 w2 I int 2Fh: z4 x# U8 L8 e e' s
mov ax, es ; ES:DI -> VxD API entry point1 [8 w+ t; ] w; R; v7 n/ j7 A0 U
add ax, di
* d1 e* \2 ?( V' H) e: `4 H/ X" o6 @ test ax,ax$ H- I J* r9 ]& N* E
jnz SoftICE_Detected
' P7 F+ ^5 f |4 D1 Q8 x; d* ]) z8 F4 N! B. k
___________________________________________________________________________, {# B% b9 R7 Z6 h
0 E, C5 \% g+ O. y
Method 04
5 v8 _# b6 ?) g9 c& S=========' \4 o: F+ I5 c1 Q+ `2 i
) N! d) p5 ^" b) Z5 V( ?
Method identical to the preceding one except that it seeks the ID of SoftICE
, F8 J! r) |- Y* N, ~! X" ?7 GGFX VxD.
9 m) \$ A8 b8 L0 Q( x2 ^' t3 n/ @1 w" }( w; i% Y) s
xor di,di |8 f+ `0 C& r% r
mov es,di: j' l1 Y9 b* z
mov ax, 1684h ; j+ S# [3 f' `0 L
mov bx, 7a5Fh ; VxD ID of SIWVID6 l3 \* \) w0 ? u V6 V
int 2fh
3 c) O. a- Z8 K: d8 p mov ax, es ; ES:DI -> VxD API entry point
% Q+ a; ^8 x4 r add ax, di- p0 b; K# s4 k( u* y. H
test ax,ax( A8 R W# N$ {( h# K% v1 V# r
jnz SoftICE_Detected
9 P+ R- P. v# \
0 {/ c0 ]- D: O; k" m l, e0 W__________________________________________________________________________- W) k! ^, i; ?( j
/ i4 g* ]4 d9 v2 M
: m; N8 e9 c9 DMethod 05+ u; D& z' |# Y- g! _
=========
% n" q" [/ Y) C9 w
# ^8 h A1 K( T- g+ EMethod seeking the 'magic number' 0F386h returned (in ax) by all system" k- I2 [" V' M1 ?, x& P
debugger. It calls the int 41h, function 4Fh.
' I3 v+ g, [: H4 C& e4 g! d2 _There are several alternatives. . ]+ X. B/ o6 z) t
/ J, R0 ^0 n. AThe following one is the simplest:; _) {' \& i* |) k5 L
n, ~+ X3 N) @. \" H0 y
mov ax,4fh! e8 z6 g4 H2 d
int 41h
+ Z6 C( S) X7 q- {& ~4 p( _ cmp ax, 0F386
5 N9 `, j0 X8 E( R! t0 v6 L jz SoftICE_detected
- y5 K( P- y$ d1 ]5 f7 Z
0 u6 A* G8 u: ^% d! F' | J- N/ w4 r0 P
Next method as well as the following one are 2 examples from Stone's
+ `9 G' v U5 a! E6 Q9 E: u"stn-wid.zip" (www.cracking.net):" v- h/ D+ e6 g1 D# V) J, C' a3 |& `
. H- @( k F7 e& }0 C
mov bx, cs2 ?* `' E9 P) W
lea dx, int41handler21 A* l* Y$ w* ^( Q& W6 f
xchg dx, es:[41h*4]
" Q. b8 G$ D2 Y$ v; [ E* ~ xchg bx, es:[41h*4+2]: W2 S: ~2 t6 k. e8 I
mov ax,4fh
3 r/ B1 z/ O% C/ W int 41h& H7 \4 ~; S% F% }
xchg dx, es:[41h*4]; O* Z( p* r$ ~8 K+ Z) p* Q. O
xchg bx, es:[41h*4+2]
- c* m1 ?8 m6 _# q, |8 y: w6 ^ cmp ax, 0f386h3 s( J' Q: z: |2 v
jz SoftICE_detected* Y5 U- {/ }5 N S) q0 d. j( x
5 g3 z# G" v6 _int41handler2 PROC
* v, P& \4 {' q' a. i$ w iret
5 B4 l5 }/ ]. z& K8 N+ h: gint41handler2 ENDP, T" N; `4 e/ W ^+ I
; H- O9 P3 S' ^' p
' W& b, `# e# w_________________________________________________________________________
C7 v& }' p# y4 }$ }9 q7 `+ f: Y/ w
6 U ?$ U" | v
Method 06
7 |! r+ x% r+ X/ E& F% B I- D6 z% ?0 H=========
" z/ C+ s. m; a0 `% C. M" Z h; L5 p/ l
) h$ F$ T7 ? m8 w4 d$ n( o n/ L1 `$ m
2nd method similar to the preceding one but more difficult to detect:
( W( U. v; h Z6 S9 w3 Q5 ?& g h, l8 m+ y1 y: I J6 f9 F& l
9 Y* n$ x2 x: D v: ~( Z. [0 Q. M9 W" @
int41handler PROC- {. O/ g8 O6 }- K
mov cl,al! [# o! @6 F( b5 y" x: _
iret" _% q4 H' a! L
int41handler ENDP6 `! E, w! x! J5 O
! e" W: L4 k7 [" Y! u. q3 _0 O& E, M# |( C8 x2 v+ o) }: H) p* q
xor ax,ax1 m# v6 [% Y; v$ x: U
mov es,ax
& Q; j! y6 K% F mov bx, cs/ D" b, W# D- @; b% A* i: m
lea dx, int41handler
& P g. E8 x* {- Q xchg dx, es:[41h*4]1 U1 i& r1 S* @- a# J7 N! }
xchg bx, es:[41h*4+2]
# h* H J- N" ]4 V4 Z1 E. H in al, 40h$ ^! x6 T/ N% U) z0 ^
xor cx,cx/ C9 r }% ?8 i( z7 U% u. ~# R
int 41h- J' ]4 v' Y' V" z
xchg dx, es:[41h*4]
: t! w( e; D" D" I6 z xchg bx, es:[41h*4+2]. ^. d, k+ E3 Q5 S, N
cmp cl,al; j) q7 s g. D) [. s6 K
jnz SoftICE_detected6 C3 ]- I; @% O$ y4 W# T4 [) i, S
; ?: T6 W' C! W2 k" x4 \ b
_________________________________________________________________________. L( S0 h9 \" U! x! c, H
5 @5 ^" Y7 T- K8 T8 Z, cMethod 079 y1 v1 e# \ C2 ]! r: @
=========+ e* j2 b/ i* N N" \7 a4 B i
6 g# C2 A5 x% b; @1 F3 K0 V
Method of detection of the WinICE handler in the int68h (V86)6 T, w( s3 T6 `' D' Z1 b
* {2 k: }& t/ S9 B8 x
mov ah,43h0 m, Z5 ] ]$ K3 \- I( v
int 68h
, \5 {* O0 ^+ i2 @, B cmp ax,0F386h+ o+ H+ o$ } u; b
jz SoftICE_Detected& R" f" a: p+ p' f- {5 m6 Y
. \& j5 \( p P* R
0 z, F6 h a% E/ m" Q; {9 v a=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, F0 c# l6 b% h app like this:9 p1 _) k1 I" f7 k
0 r. T5 ^+ V. G- b- ^2 j BPX exec_int if ax==685 P' d6 H5 r7 n* {, @- J
(function called is located at byte ptr [ebp+1Dh] and client eip is; |4 C$ z4 i6 J6 U2 w7 V% C9 J
located at [ebp+48h] for 32Bit apps)
$ `9 V) h8 C/ l' v* W__________________________________________________________________________
1 _+ b c/ K: Z9 f/ _
1 O! v: W0 t# T! k3 y4 R+ j. k
( Q. t. m: H5 R" @; l# cMethod 08/ d7 U6 ~/ I5 I7 o8 w3 _* \
=========$ p8 b- ~: Q: h) x3 z9 K7 g
* Y9 {7 ^5 |. w# o- j( s
It is not a method of detection of SoftICE but a possibility to crash the
2 H d/ ]- |, s- K& q* |7 Wsystem by intercepting int 01h and int 03h and redirecting them to another
( I' ^ K& [2 E9 V' x2 Q3 z0 zroutine.' K) M c- j/ P) e Y% P' S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points W6 o- P) t- O9 {$ J2 k" [
to the new routine to execute (hangs computer...), W7 L* W- R* K9 o; k+ Y
+ o3 O& p& ^, ]( y
mov ah, 25h' c3 ?( G$ f8 \7 E
mov al, Int_Number (01h or 03h)
: B) ^& w% m9 s5 T1 K- c mov dx, offset New_Int_Routine
: E) z7 w% l8 A+ A E int 21h
) q0 b0 @: Z4 |/ ^: ]; X
+ m4 m- l- |% {# [( U1 I5 s__________________________________________________________________________
% Y3 S. X& h0 m+ t6 K- [3 a- W# Z5 _; V8 r2 e: x7 T1 x
Method 09* T+ a* o: U5 f5 P5 x+ u# x
=========
. F* G/ X: }) J1 S
3 G$ O( n: i- ?7 D qThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 _1 e4 c6 w! C8 t
performed in ring0 (VxD or a ring3 app using the VxdCall).
: y" V& {5 x% r c6 hThe Get_DDB service is used to determine whether or not a VxD is installed
* F: V( E: m" n/ Pfor the specified device and returns a Device Description Block (in ecx) for) i; D. O: z& V" @8 C
that device if it is installed.
. U% M0 b- S! j7 f1 B) b- Z% R2 O
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 \6 l& i' Y' w8 j6 ? mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) d, v# X4 Z H( ` VMMCall Get_DDB
8 j9 _/ V4 {& s/ ~ i# Z+ j9 n mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ S: W0 v$ U7 {/ ]% _
, s7 F" S8 O0 o! J i. P SNote as well that you can easily detect this method with SoftICE:" v. R, H& x3 E, C. M# Y
bpx Get_DDB if ax==0202 || ax==7a5fh
, J5 V9 I1 s6 q- W0 L
/ k# E; }% Y" S' E__________________________________________________________________________
. g8 h! z% n" S4 S1 [( } ]4 I- ^. U; Y8 P. M7 B0 [+ R
Method 10
' U) x: l0 e, q7 y=========
& D, P) I* R- v) B9 M6 a" f# f2 i
7 A* n) h* v$ ^! p5 c3 L1 B=>Disable or clear breakpoints before using this feature. DO NOT trace with; l( b r- p1 g# H5 q0 q( v4 e
SoftICE while the option is enable!!% Q$ [ i1 h8 L' I
! f5 q" q& _+ uThis trick is very efficient:* f& D2 R J& k: d/ V
by checking the Debug Registers, you can detect if SoftICE is loaded
; { l2 Q+ u$ |) @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" z# Y. E; h/ X+ E3 Z( l( B2 bthere are some memory breakpoints set (dr0 to dr3) simply by reading their; s! i0 x# d P6 m2 S* J! |
value (in ring0 only). Values can be manipulated and or changed as well
% _7 S) X5 x1 C+ ^) }! Y(clearing BPMs for instance): G7 X% Y' d) |- C
+ [7 C( E$ {3 | ___________________________________________________________________________
5 P# D" o' \& r! i
. J W* \5 J* dMethod 11
9 J) J" T5 q9 J5 F4 w3 N7 [=========, B0 x9 Z7 I9 b) b
! w* E: P6 b; A/ @7 JThis method is most known as 'MeltICE' because it has been freely distributed
; S! P5 v6 F) [/ M8 ]0 S' Gvia www.winfiles.com. However it was first used by NuMega people to allow7 f* N# U$ R' y2 `
Symbol Loader to check if SoftICE was active or not (the code is located6 @8 u% g; P5 G5 S9 U/ k1 y
inside nmtrans.dll).- R" q+ P) S# j
1 o; t7 Q9 S' i% v( B& d9 J% A, d9 g
The way it works is very simple:% [+ a' ~4 ~1 |3 } A; u
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, M8 [+ O6 J0 s2 e! Q6 s" J. R* b
WinNT) with the CreateFileA API.
! s/ r3 c' I4 B9 N& E& m8 q! P& n+ i n, Z7 k2 K9 Y+ N" {
Here is a sample (checking for 'SICE'):4 s. A; V/ p, `, c+ X. p
) l8 L, a/ j$ N# m0 ^$ L0 k
BOOL IsSoftIce95Loaded()2 x: S/ s9 S0 B0 K& Z
{9 i- E: z& n: v( m
HANDLE hFile;
( Q {: T0 r/ g2 N- n3 Z: { hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,' C% k5 @/ H+ @5 C
FILE_SHARE_READ | FILE_SHARE_WRITE,* `4 o* |, F! C- a& p( L' g
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) u$ ?/ `7 r- \) c9 |0 Q
if( hFile != INVALID_HANDLE_VALUE )2 i% M( O3 C* Q$ q3 r
{
& A) _- j# K: z" `2 ~5 V y CloseHandle(hFile);8 w7 r6 v- g& v; o T, q% ~
return TRUE;
) \6 y3 Q6 x) e% v u }# c& h0 c8 W% W. a i, B" U$ b! X
return FALSE;
, R+ d6 ]$ M: b. \+ s; Q}
. B+ D7 r( \+ J2 ]$ O0 z. j6 f, _9 V9 J' N
Although this trick calls the CreateFileA function, don't even expect to be
0 q# F2 t, S1 B; lable to intercept it by installing a IFS hook: it will not work, no way!9 R& c1 s& m7 n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F, z L, ~/ O1 F: A/ K) N# ^' B" y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ f5 p: X1 c& s8 J3 @" L$ d
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- W- k) m( q# ^+ d3 o
field.
/ `7 j" d0 k* m% jIn fact, its purpose is not to load/unload VxDs but only to send a
: ^5 e" l2 t1 aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ y' a+ O8 c: G* p. D& E
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 n+ d! l9 Z7 N5 h" r
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 j1 ?/ n/ X6 a4 {% f( u- ?
If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 z, [! x9 c" P, f1 p4 H+ [4 fits handle to be opened and then, will be detected.
9 Z& C0 i4 [2 H1 z, CYou can check that simply by hooking Winice.exe control proc entry point% |- u. Y9 I9 @- W) c& e, Z
while running MeltICE.
! l+ O Q2 R% u8 l
8 r- L& Z7 ~6 d
a/ C0 U0 W2 [ 00401067: push 00402025 ; \\.\SICE' n9 b& e7 O. s/ s( I1 o/ N
0040106C: call CreateFileA0 r+ w1 w7 ]' L4 q) G
00401071: cmp eax,-001
. h' s6 a' m% d 00401074: je 00401091
) _% c( |/ a/ h1 G" @. B* ~! T% Q2 I% X' d+ |' p
3 L9 i. x2 W4 I4 nThere could be hundreds of BPX you could use to detect this trick.
4 F/ p4 {, X1 X6 g+ L. _-The most classical one is:
- e8 r7 _8 U% k& c& h4 u BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 N P, p+ Z2 Z# L
*(esp->4+4)=='NTIC'
; `; T( j4 `; ]3 d) J: H8 x: y* C7 |" Q1 C+ \9 h
-The most exotic ones (could be very slooooow :-(
/ B3 S' |& V6 O6 b BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! U: \" ^' Z2 t: Y4 s ;will break 3 times :-(
3 H" G0 ~( l2 ^) \8 W1 P8 D0 e9 s; X' e
-or (a bit) faster:
1 V9 k/ z, I3 b. ?$ K( h) q( ]7 M BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
. |" R, v) j+ c' p0 ?4 i) ?8 @% k. C. S- {5 j: l) p% l
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) N1 O7 V. E$ o6 }
;will break 3 times :-(; @. W. {7 V" D7 }
: Y5 ` Y1 b3 q/ O) z3 |' l- ^4 s
-Much faster:7 _/ F0 \+ E( n) X s" ]) }
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 S' i( F5 W0 p$ m8 x% G& {* A2 w
$ \: K; F5 K0 v1 ]+ ~, [. a
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, G% `5 r: Y8 k. T: P+ o, j
function to do the same job:* f! W0 D% ]$ J+ P' P3 s8 e
' l1 C7 |/ U5 S: _" r1 \- ^& H push 00 ; OF_READ
+ B) t' _6 m9 V- ]5 a- E1 Q mov eax,[00656634] ; '\\.\SICE',0
* g$ x% e/ ^0 w4 P0 x! r; n push eax( V) w& d# F" _0 r1 H* x
call KERNEL32!_lopen, o7 `1 {- J/ g* v" g: j1 J% J
inc eax! y1 H- R" w$ _8 u+ F( N
jnz 00650589 ; detected( q. U$ r7 h% i+ o
push 00 ; OF_READ
2 J4 I' W" w; L/ s1 x/ ~ mov eax,[00656638] ; '\\.\SICE'3 b% U4 E( G% g( C6 y$ d
push eax
8 T0 G/ z+ \: N call KERNEL32!_lopen
7 o- E. ]" B# p5 v inc eax
1 B2 _$ d8 ~8 L X4 r jz 006505ae ; not detected9 _% W: q( B P- ^ ~& p* q( a
6 c. s1 ?6 t9 R; i
* @5 `4 i4 z6 d* Y: b( ?" k
__________________________________________________________________________! ?- O" e5 b* o" n5 }* P1 x( ~! ^
) `+ y Z" k- o3 @; t/ k
Method 12
9 v/ Y- Z6 p4 S: S4 [=========6 c" C, C* s/ p m) K# ?
2 l% | S5 A! h9 w6 D, U
This trick is similar to int41h/4fh Debugger installation check (code 05/ W x) v- m. N
& 06) but very limited because it's only available for Win95/98 (not NT)
3 E7 [9 u2 \# u$ x) t6 d qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.% q v: R' R/ n$ s3 q
) m0 T; t' T0 l" @: ~6 T6 R push 0000004fh ; function 4fh$ \- P9 H" z- f$ p9 n
push 002a002ah ; high word specifies which VxD (VWIN32)4 `$ ]8 M8 J# p, ?
; low word specifies which service) R1 Z% e7 D* S, J3 Z- B- M7 ]
(VWIN32_Int41Dispatch)+ n5 Y9 d: ]* P" i. d1 o1 W0 V' [
call Kernel32!ORD_001 ; VxdCall
5 y) f/ _. h/ l( m3 t7 K& Q cmp ax, 0f386h ; magic number returned by system debuggers: d' U/ a; G) V8 g- q
jz SoftICE_detected
1 F3 f1 g8 {, v! U8 B
; U C7 ?+ L7 u; [7 i' Q6 PHere again, several ways to detect it:
% |: y5 b F& n8 v Q* C8 r+ N! X% N
BPINT 41 if ax==4f w7 X9 d' O. f6 c+ H1 p
{0 W2 p0 e+ h8 K/ }
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 {% s8 B) ~3 O8 V8 r
5 x4 m' p4 L5 J* z' J2 q; C5 d BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. L/ F* L$ ^9 H( D7 {
: _ P* c- @$ r1 w6 _( c BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 o( ^, @1 |0 ]7 F8 G8 d0 J
- z1 X' G# J+ j6 d1 s; |/ `
__________________________________________________________________________
" v5 Z* W- O3 S( u8 e$ O$ {
7 b- m" d: x4 `3 O- `Method 13
, X9 S+ a) [2 I6 K$ y% W=========; K2 S; J% U: R6 a) E
) ~. ~ H- e9 i# V' ?$ ^% PNot a real method of detection, but a good way to know if SoftICE is
4 [2 o& X6 `3 o2 S, Einstalled on a computer and to locate its installation directory.9 @! i9 R/ C4 o4 O$ o& V
It is used by few softs which access the following registry keys (usually #2) :
) k7 N- |# F8 A3 r% ]: C W) U3 D# R0 q+ j
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ k7 K; x# K! E0 ]) O! i
\Uninstall\SoftICE
( ^2 {) K5 |! f' j9 [* N5 W. E-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 P1 v Y$ [; v; _; y/ u4 N0 Y; o
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 w: L n" Q0 P% \0 I/ U* x# H
\App Paths\Loader32.Exe" N( A4 l* V( T" Y7 X7 w. |
9 d; f8 a4 \/ p2 q
) F2 \6 B y! PNote that some nasty apps could then erase all files from SoftICE directory1 _3 u! X0 A$ v' w4 F. T3 z* w" C0 B
(I faced that once :-(
. `5 ]# h5 S6 ~3 |9 J$ k+ m5 @9 m$ q! P$ R$ w3 J$ w8 e
Useful breakpoint to detect it:9 r+ E: \; F, A J( c& M' O
3 l) m$ _6 Y& T. K" v1 N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
& n/ q. m+ p; P4 y7 Y
- D; f9 I) d1 S: ~5 o__________________________________________________________________________5 i% `0 l5 |8 Q; w- p, O
?2 a9 {) H1 m& i' V @, F
2 a0 x5 b+ o P) t" S
Method 14 ' A% c' W9 F( \; K5 X
=========9 B# k2 t p1 L- |' v l
% ^9 D& Y; J5 _* o |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% d9 X6 A1 t' W8 ]9 [* O
is to determines whether a debugger is running on your system (ring0 only).
; @4 t% F) z4 }, E& C+ d
+ ?4 X" v8 Z4 }4 U8 ~ h$ A# Z VMMCall Test_Debug_Installed; I( Y; j& H; ]5 w$ t
je not_installed
. q' L( w% z0 n' o5 \4 C/ y: H) \2 t& { ?
This service just checks a flag.
. i: X) h' Q# M0 e$ ]8 X% Z* P# I4 k</PRE></TD></TR></TBODY></TABLE> |