<TABLE width=500>
6 q5 ?5 f/ `( v<TBODY>) @6 q& K- I/ |8 [, ]5 ^: l! R
<TR>- K- ~( S; Q7 i5 B. R' E: `6 K
<TD><PRE>Method 01
2 F# c3 p, H* ~$ X6 H( H! G=========6 `: B6 j3 K0 k+ x/ {; |+ P
% _2 X2 G( O' `3 w3 N
This method of detection of SoftICE (as well as the following one) is
% g: O4 W3 ?4 C4 l$ y. z& |used by the majority of packers/encryptors found on Internet.( z% a4 Z2 U8 f' d2 y+ Q, }
It seeks the signature of BoundsChecker in SoftICE
& {% t# N1 [% {% T' \6 L5 s1 @
0 h$ @! ~! E6 j" h& [" R, C9 U, e- x mov ebp, 04243484Bh ; 'BCHK'
( e: ]2 k' ^$ q mov ax, 04h
5 d2 I6 ?$ ~- n* x5 E int 3
$ k% ^7 O( D$ E) \- H cmp al,4
" ]0 ]4 L+ z+ n4 T4 t jnz SoftICE_Detected
3 `& V8 p" E6 X& O" ]; x/ Q! `/ G) ^1 Z" V' q. C [, ]
___________________________________________________________________________) \: g; `7 C* h2 B4 q! k
; e2 c; }! Y1 T3 iMethod 02$ s+ A4 P1 B" l- Y4 B3 I7 t t+ M
=========2 B! q6 C9 J' r! X* J
+ y5 T: ~- n) }8 d+ i) oStill a method very much used (perhaps the most frequent one). It is used1 m( o+ T$ }8 ]9 u& B8 y2 I D3 U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) k5 a" T+ n8 P8 } ^$ r6 Q) v
or execute SoftICE commands...5 c8 a, a9 c* t( F: {
It is also used to crash SoftICE and to force it to execute any commands
4 M$ r# v, ^/ V6 K+ H# Y- |(HBOOT...) :-(( . o; b3 z0 T: q, b' e
1 O: S# ^, k1 Y: B
Here is a quick description:
5 D. D2 C& u( H1 P4 ^+ j, s; T-AX = 0910h (Display string in SIce windows)
c3 Y- _) L: l-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! j$ p0 \5 _9 R8 m' D
-AX = 0912h (Get breakpoint infos) ?# ~7 a* |! t6 B6 T; G4 {
-AX = 0913h (Set Sice breakpoints)" ]/ Y: ~" w1 ^# [3 I$ _5 g0 p# ^
-AX = 0914h (Remove SIce breakoints)* \0 }/ `/ u- j9 K
1 m0 z3 N% }+ R4 N' H" c( ?
Each time you'll meet this trick, you'll see:# D' `+ {* r! ~) g# X2 c
-SI = 4647h
6 A0 X+ G- C+ w2 A-DI = 4A4Dh% k# ]8 I7 m+ ~
Which are the 'magic values' used by SoftIce.
?# r: {* g. H, m! c; Q/ d/ ^8 fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& _ F1 U* o1 c0 X* E
6 H" w! H2 k+ \/ v- kHere is one example from the file "Haspinst.exe" which is the dongle HASP
: M5 ?% b' Z1 R4 I9 x( ?1 E8 u6 X2 v. p% uEnvelope utility use to protect DOS applications:3 }( v F0 U2 K! A7 x
0 Z4 F4 n+ V9 Y$ T4 Y! u& \+ |2 S8 ?0 h! z9 n5 ^: O
4C19:0095 MOV AX,0911 ; execute command." ]8 V# L7 d4 c, U$ E# k
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! G% j" X( I5 h+ h4C19:009A MOV SI,4647 ; 1st magic value.! R7 W7 K) j. t) R) R1 ~
4C19:009D MOV DI,4A4D ; 2nd magic value.
1 I* ?% Z6 l. I4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 }7 k6 Z2 Z( ^9 j! f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, z+ w l: ~% ^ C @4C19:00A4 INC CX8 n* S: ^' P: ]- q8 L
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: q) {! n& o' ]. ^$ m4C19:00A8 JB 0095 ; 6 different commands.
5 Z& g- S" g( \+ n. L, y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 v) U4 T; A- b+ |1 b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' t# q+ ^/ j; ~+ O" b/ h
) l$ \2 Q# _+ C5 iThe program will execute 6 different SIce commands located at ds:dx, which- G& b7 l5 a) ]% E0 r2 i. ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! Q6 w+ @$ V& [ x7 I6 ~+ }9 E
1 l; r9 j* e5 r8 ~( e; z8 q$ P
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 R$ [3 L; j. T: v: l
___________________________________________________________________________
7 ^& N: ~ |% n, x
+ Y2 d0 e( R4 O% h3 D# J9 `- E# E7 D' M
Method 03
8 N* D1 J/ v+ Z4 N# u=========( M) \& c- O: u! b/ _; y
. Y# n* b- q0 |: V$ w0 ^; wLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. e C9 n( V& ^: l(API Get entry point)
9 i: M* I8 x: Q8 u( c; W- E& ^
~. @5 \, H' ?9 J) X' |1 H& L& ~' ~ A% I
xor di,di
4 d/ e6 F |$ M0 f& b* C6 E mov es,di
% x2 c, W" r1 U9 D mov ax, 1684h ' A: Q y0 m* C1 m
mov bx, 0202h ; VxD ID of winice
9 @( G* z- i1 ` i; A int 2Fh! H. ]1 e }' _5 `
mov ax, es ; ES:DI -> VxD API entry point( m5 C5 Z1 k+ ]8 b
add ax, di
' g- j: R& E' m test ax,ax" c" ?) T5 ~) [. d9 V7 f, A7 r
jnz SoftICE_Detected
' w% g$ t5 b& x/ v
& A5 g. E* o$ a2 V___________________________________________________________________________! ~, r. t* {! R7 X! K4 I$ O( K
. h5 \4 d( o+ v3 e8 k9 v. c; eMethod 044 l- A7 G. Y( c) S8 W5 _; ]5 Q
=========
* K: i# N5 ~4 g+ [- Y
4 c5 ^; R1 I' fMethod identical to the preceding one except that it seeks the ID of SoftICE
" Z9 Y) |# Z, z1 nGFX VxD.
( O. y0 z) o8 s" \1 U3 N8 I, \, i* a7 }
xor di,di0 u1 \) I1 o( M
mov es,di
& I! q) ~5 ^0 S" ~% H! f mov ax, 1684h ' C: I+ ?% v3 y1 A& o; u
mov bx, 7a5Fh ; VxD ID of SIWVID
! U. |& b( J7 s. G- A int 2fh0 E5 v: y/ L# I' m/ R% `; c
mov ax, es ; ES:DI -> VxD API entry point
4 N/ v$ s) E( g) D$ ^ add ax, di9 }0 Y9 Y3 [3 H/ ~3 P
test ax,ax
* r# Y2 K n+ H3 { jnz SoftICE_Detected
: V4 |( x: Z; \+ z/ v. G- r) e
" g% L) K3 T6 M- j7 D- p# }__________________________________________________________________________* R6 V8 F, s6 v
4 {. l( N3 t, J. G
( d$ m- S$ S1 | T4 zMethod 05" e o. Y; x% `2 u
=========
- m2 m1 b" z2 R, ^
7 g( J2 d2 C8 vMethod seeking the 'magic number' 0F386h returned (in ax) by all system& V0 j& S. ]; @( I# N1 f
debugger. It calls the int 41h, function 4Fh.
. \9 k6 J( s8 ?' QThere are several alternatives.
5 k# T4 m$ K2 s) s( u- w& p& X9 A1 h. V8 r
The following one is the simplest:
* t8 V, R6 [- M% e* `) [$ ~& C" r% O# n$ \, g% ?8 ]
mov ax,4fh7 ^! L% D. Z3 z: V% s( q
int 41h
* ~: Z- c1 J% }$ m! j. S) e" Q cmp ax, 0F386
5 I1 h/ n! N U/ J: Z jz SoftICE_detected3 Y# r J& Y3 ^( R
! p' E1 Q! h1 w6 a3 a
& n7 I2 ?3 c5 v. @, b9 N/ |Next method as well as the following one are 2 examples from Stone's
$ E# ]9 J+ \9 N0 I"stn-wid.zip" (www.cracking.net):
( b- Y/ [. F$ o
( x+ v& q: Z5 j* ~ mov bx, cs* D! e+ z6 t, R! C8 I* {
lea dx, int41handler2
* Z3 t) d$ j% b3 p- J# r$ M xchg dx, es:[41h*4]) P$ _7 I- t( U$ _
xchg bx, es:[41h*4+2]. I3 q3 h5 `" a, B* P! ]1 h
mov ax,4fh+ Q: M4 T2 }8 G! ^
int 41h C6 A- Q! z, c! X
xchg dx, es:[41h*4]/ h2 k5 N9 n6 z; E. R5 M0 [
xchg bx, es:[41h*4+2]
k$ O- i- C& ~8 d cmp ax, 0f386h
8 y5 [( D( h6 [% `3 d/ B) [ jz SoftICE_detected
& r @* D7 M1 D: T# ]" M* w7 E& n2 i# a7 Y( f: h9 ]- l. L4 B7 S( Q
int41handler2 PROC
3 a& [2 d( l/ ~1 D( g4 i$ s: n iret! S, d7 N0 x; Q/ ~# c
int41handler2 ENDP
4 c5 R0 y! Y. L4 _( m% j. X$ v" Z; r# D+ b
1 ` W4 c+ w6 k' F4 Z3 o, Y_________________________________________________________________________% F5 g& I& L* J' f
% E1 T$ H9 Y% x( c, z( k
/ q) i, g- Y/ {4 zMethod 066 r- {3 x+ ~6 U0 |; T( I- E( S
=========
I/ [. |' E1 O& E' i) ? G- r8 `5 Y/ }, R
! W( b. P y0 E8 ]5 g' p0 m% Q5 X6 D2nd method similar to the preceding one but more difficult to detect:0 g( t6 z/ l7 T/ e: Z% A" a
7 @ g8 X7 h# L! t( x2 A# i" S4 U
$ i. a; S% `6 P: ~, Tint41handler PROC8 Q8 a5 ^9 G1 q2 [1 n
mov cl,al2 \+ u+ {! c! S
iret
2 K$ G) B* W& x; fint41handler ENDP
; a9 k. _6 S1 X/ Z* g f) q" f; j, j2 v/ n
% b5 L3 z% z: k# e# H# S r! \
xor ax,ax( k, U$ y7 m' v& r, `9 U& v
mov es,ax
9 \1 H3 I# P2 N4 K6 f4 ] mov bx, cs
2 N1 A+ l% p4 W) v T5 [ lea dx, int41handler
J( y5 D: e9 T! Z( }, M0 v xchg dx, es:[41h*4]
8 F) p |5 p( J% t T- L9 |3 [" ^ xchg bx, es:[41h*4+2]3 ]' `$ ]5 ~9 F
in al, 40h1 o& m( Z* k/ [! C( \ M. S+ \
xor cx,cx4 n1 L9 o, V# A" ]
int 41h4 Q( H* @4 K( _0 H) h
xchg dx, es:[41h*4]
1 q- K- w1 ?" b xchg bx, es:[41h*4+2]+ ^& l$ x3 Y6 Q) m6 p
cmp cl,al
# y1 V2 n p0 O0 S$ y. r+ E jnz SoftICE_detected
5 I7 V" B& B3 c' y$ L0 H" G6 ~ y. o
_________________________________________________________________________
+ o: c& s/ L9 z. s" L; P
. ?8 J; v8 d2 _& b3 nMethod 07
& B, A, `6 x, @" Z3 v=========
) i1 ^- H5 ^' U& ]
! z* G. \3 W7 y, ^Method of detection of the WinICE handler in the int68h (V86)
; T5 [ A# K2 ]# ^4 ?- P) h' p W9 s, T) u1 {
mov ah,43h
* ], R6 A3 i: t% v4 @ int 68h
/ h' g+ y2 V: a2 E cmp ax,0F386h/ n& A: O$ Z+ q( ]
jz SoftICE_Detected2 g* |5 x6 V0 P& {, ~9 d$ S* |% A
7 m) m: d- [* `3 T5 Q3 B, n) c6 w# {* `3 Z! _7 s" d% a6 Q8 g' o. j! d
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& `; U8 S3 P+ C app like this:! N9 ^4 O4 h. [5 ^8 b$ t
9 Y( b7 Q& z/ x! |" G BPX exec_int if ax==68 Y2 `/ X) M; h6 B4 h. y1 b( @& n
(function called is located at byte ptr [ebp+1Dh] and client eip is6 Y1 |( x& M) ?% \. d* |
located at [ebp+48h] for 32Bit apps)5 a5 k9 E* n) E# A
__________________________________________________________________________* @# u/ t1 p1 W
; Q' [, {+ o( S8 ?4 a/ k
$ u5 d# H$ ~5 y3 W4 S! n! \5 \Method 08
- u6 {. X+ A1 m' b2 F+ [' \=========
" ~8 c$ X- W4 R2 i8 Q& a2 w, R, ] l( w( c# t2 F
It is not a method of detection of SoftICE but a possibility to crash the
8 ^) i/ M' X Y# q' w I* ^& D. isystem by intercepting int 01h and int 03h and redirecting them to another
: F# ?9 p4 P' Q7 Wroutine.
2 T& K7 v. _& l! D# Z0 mIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* A1 x% w6 Z9 L2 X; z
to the new routine to execute (hangs computer...)
* q Q: n% X8 S) V* w; e/ e' A6 C5 }
mov ah, 25h" V- M+ F2 T8 L% Z( l
mov al, Int_Number (01h or 03h)
2 P( j. |1 `1 R# k8 B mov dx, offset New_Int_Routine: k& T( k' Y1 r9 O5 L& [( f+ E
int 21h& X, i+ N, h2 m
" q" O- R3 }) g2 d( _ H% s5 l
__________________________________________________________________________
8 ~5 M- e! v G7 @
1 P. ]( x* [) HMethod 09) @7 B' c4 `- `# Y7 a' s) \
=========8 t k& p! N( F0 i; D+ t
# _3 X) }/ p+ R1 r; C' K4 |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 b- _- f; i. d* k
performed in ring0 (VxD or a ring3 app using the VxdCall).. Z* o: V! Y) s
The Get_DDB service is used to determine whether or not a VxD is installed
- ?$ @" ^: z7 v8 qfor the specified device and returns a Device Description Block (in ecx) for
5 V5 f0 c: g- K5 p5 m' }0 _" ^that device if it is installed.
( r |% m4 z# i, Z/ [( e
9 A/ M# p4 H+ d. a; K( X. | mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 c, h! [* a- g3 Y1 G mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 N0 |+ E0 R, ` v# K( C VMMCall Get_DDB
6 d' H) C, p. T5 w; c+ \: ?9 l mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed7 G7 J- N3 Z- I) P7 L
5 ?# M4 ` h5 j" G+ [: T {6 |" b
Note as well that you can easily detect this method with SoftICE:5 t5 f7 F+ W) B* V( |
bpx Get_DDB if ax==0202 || ax==7a5fh
8 E4 c/ |3 R8 L" k3 ^0 T" w! q# f3 { R
__________________________________________________________________________6 ?) r4 [/ T5 U( _3 U
% Z1 j1 v* ]' G; KMethod 10
% C" y; [7 i! m7 X* b z( p=========
# R: v* o( U8 x
: _5 c6 ]' X- v! G2 _1 l=>Disable or clear breakpoints before using this feature. DO NOT trace with! S2 u( I' Q0 g8 T$ X+ Z
SoftICE while the option is enable!!. T, ?- s& g# C9 ~ X
$ s# |2 s/ e9 D; j
This trick is very efficient:
9 o$ {) ~7 k# _by checking the Debug Registers, you can detect if SoftICE is loaded/ D* z# U8 N. x: @* j) _" m
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 z$ \, ?& j* w3 q: bthere are some memory breakpoints set (dr0 to dr3) simply by reading their& s A) v/ u8 g7 p: J
value (in ring0 only). Values can be manipulated and or changed as well
! u: x7 `, `3 N" l3 |9 T% q& A(clearing BPMs for instance)
9 J+ H' \' [4 {! d
! T) _2 Q$ j( q' S7 W__________________________________________________________________________
+ @0 j3 {' i! D
7 `% e/ o- `" K# ~/ z* Y0 pMethod 113 ^: ]" f# c& p' `. Y. P2 c* {
=========
9 h$ X. P9 a( n9 l- w6 w4 @) P' L* A
" {0 x/ n6 K1 r, k, A5 Z5 X/ yThis method is most known as 'MeltICE' because it has been freely distributed3 T- S# i5 a/ ? C; L
via www.winfiles.com. However it was first used by NuMega people to allow
8 f1 c* y5 b ?2 _7 s+ YSymbol Loader to check if SoftICE was active or not (the code is located6 \. s/ r$ P0 I6 a
inside nmtrans.dll).
( [) W$ R. u% a5 m1 R R" J, E+ x& ?+ w" R. m8 v& i1 i4 [! ?5 D
The way it works is very simple:9 M/ ~5 o1 U' t5 }0 p# M' L
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% C9 s8 M& S$ |! ~* ^WinNT) with the CreateFileA API.
/ {0 n& F8 Z( \9 @ e; L8 A5 v- M; W8 B. j R1 r* i$ u
Here is a sample (checking for 'SICE'):+ {' u% n$ |2 i1 O
* T$ u5 k( A. }+ y( q) P& E6 wBOOL IsSoftIce95Loaded()3 y- T5 [# g2 D* W' X
{
# Y$ o2 u1 E7 a HANDLE hFile;
# `2 j. \5 ]7 f& u hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ D) ~- p9 X" X f3 w FILE_SHARE_READ | FILE_SHARE_WRITE,
* u% f7 o. T1 R0 C# J NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& |( J; f p( n& A; q9 o& c8 \ if( hFile != INVALID_HANDLE_VALUE )! u9 M. i; e3 o4 I! A6 k
{
8 V' h) j5 p o: n6 m, f CloseHandle(hFile);4 N9 A* t `* B
return TRUE;
) U3 w( _) c( h- g7 g: C }
1 i4 E3 b1 J/ y+ M, q return FALSE;) N. ~+ e+ I1 |0 V3 ~/ ]
}
1 ~% ~6 K1 E" q( T3 `* G) q( F' G
Although this trick calls the CreateFileA function, don't even expect to be( q* v1 { f( X) X
able to intercept it by installing a IFS hook: it will not work, no way!2 o9 U0 \) G" A: t( d' J
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& p7 X; P3 l- Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 i0 I* ^- D! o* T0 Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc
; v8 e: n+ _' G; nfield.+ s" ^) h% |; S) V* f
In fact, its purpose is not to load/unload VxDs but only to send a % W- G& n* H$ J4 U
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE) ^' M+ |; B' a2 J6 b N& c A
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 r* R \9 }# E: n* _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
N& Y) M2 h* E! ~% @) e! Y) }If the VxD is loaded, it will always clear eax and the Carry flag to allow
! G$ h6 O- T( A, G5 |its handle to be opened and then, will be detected./ v8 @0 ~9 b( ~
You can check that simply by hooking Winice.exe control proc entry point( F: L9 M" W6 y( l$ P
while running MeltICE.
& d* G( C+ ~! T( P Y- e' O. v( j# ~& P7 u% C) }& [4 |
: f& y+ o3 H* d0 c$ \ 00401067: push 00402025 ; \\.\SICE
5 o" h6 C# `* I R 0040106C: call CreateFileA) `/ p0 c' Q. H& h7 H1 x0 d
00401071: cmp eax,-001- L( B6 o) U5 ]
00401074: je 00401091
7 H$ I, F* Q7 `7 p/ L$ t
5 f) k# x2 W- J" A) `' W p& |/ {$ C* M
There could be hundreds of BPX you could use to detect this trick.. l+ ^! J+ ]3 ~
-The most classical one is:
3 Q. |( a( q7 j7 W3 q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 Y7 l, L0 N, z7 F% ~5 c
*(esp->4+4)=='NTIC'
5 p9 m+ T7 x; A7 P9 w5 D7 B" Z, f; d3 t( j7 K: L
-The most exotic ones (could be very slooooow :-($ g2 w' c$ R8 U& h, e
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) a/ C% w( \8 ~8 h# @( x ;will break 3 times :-(6 r" p" K- } k& w
$ b! J' q" ~* [
-or (a bit) faster:
- ~; z& D% M/ w, Q# w k) q6 ` _ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( V: u4 a* @. A3 G
) E. |/ j" V3 m) Q/ M f BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # Y/ i. E1 h4 M4 E4 t9 O
;will break 3 times :-(
5 S5 t, [# ]9 \$ V& O- h
8 G' _7 X: q* _+ O6 ?9 o# M-Much faster:
) L2 p& I- x! ~& T BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( l( M5 i {$ i* L9 n" M3 d& q
: N4 g. h- c- f/ L( s- n+ z; x" M
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! D, m" F- m2 B( B4 X7 |
function to do the same job:: t2 }' f2 e# }( R
1 `2 a8 Q4 A8 v+ K push 00 ; OF_READ. B. K0 _ N* e7 C
mov eax,[00656634] ; '\\.\SICE',0
- p6 T6 u2 ^8 x5 @- ~ push eax2 U9 \+ i! D% Y
call KERNEL32!_lopen
! e8 m& x3 c- R/ U! \. p inc eax- R6 Y6 Y$ `; f$ f- B
jnz 00650589 ; detected y$ h0 F$ J* W% a. G$ }; }: `
push 00 ; OF_READ$ R. V) x- V o! n2 }+ m2 K( G
mov eax,[00656638] ; '\\.\SICE'7 J ~; k& x1 x) V. R# e8 ?% {
push eax
+ O6 b# F% P- K( l( k) O call KERNEL32!_lopen1 t$ g& V( `" P
inc eax
2 N) `* `+ y8 _4 B3 X& t# S7 F5 N' _ jz 006505ae ; not detected
# R3 E( I/ R# x# N% ?2 |/ n9 b) \3 M% v1 J, e* t
0 {5 x; X" l& z$ v: ^
__________________________________________________________________________, f& \; Q, J1 {; F
9 U( |5 y1 y0 P! r' U6 I6 |* a
Method 125 P+ r! w$ `, Y- Q, F, y1 t8 a
=========
9 Y- @8 m4 y/ C5 o9 P) ^
8 L: }; Y% y- ~2 HThis trick is similar to int41h/4fh Debugger installation check (code 05. ^+ k7 I8 e( F
& 06) but very limited because it's only available for Win95/98 (not NT): F G7 n% @7 Y( {9 i% A
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% q7 V5 Z$ ?4 h( j4 p' g; n+ ]( F1 n: f7 W+ g) T0 }9 ~
push 0000004fh ; function 4fh
; w3 y1 i* P# g& Y4 Z4 Q; ` push 002a002ah ; high word specifies which VxD (VWIN32)0 E6 U. K8 S3 T3 Z( v
; low word specifies which service
/ N; f/ `# W, B5 B* t: i (VWIN32_Int41Dispatch)8 A( {* R* N1 D6 ?, l: y+ X
call Kernel32!ORD_001 ; VxdCall+ n; V9 g! b& ~$ f2 e5 L0 @
cmp ax, 0f386h ; magic number returned by system debuggers! _! N# x' r5 r5 v6 d% E$ m1 T8 r
jz SoftICE_detected
% V& q5 _3 R: w) P ~+ e* `- Y: q2 M/ C0 P- ~$ C/ ?
Here again, several ways to detect it:
. |4 z- x5 H$ w2 I( L3 D2 Z- g1 p% S% T
BPINT 41 if ax==4f, G& ~1 n( c% x6 a0 J& M! |
/ ]* D \& M( J) p$ {. R; j7 L0 o
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* V$ U) n2 ~2 w$ n, n2 K
! C! w1 ?" ]0 o6 F4 e( t
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' t# F/ V0 E. ^5 W3 A+ T5 P7 v& L/ e1 R3 \9 j7 J2 {5 V+ q7 ]% R7 P
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% x) W& ? u! J: m( [
& ]; M2 N, [! n4 Z% \__________________________________________________________________________ W( c! q( q* z3 `/ S
7 f" ?; H3 i5 O( w8 ]+ [, d
Method 133 ^# `9 d& A. a2 \3 \
=========' Y" t5 B3 T2 ]# i/ M5 h
! s* {1 V7 D$ ?5 t1 L: z/ }6 g
Not a real method of detection, but a good way to know if SoftICE is; `! F3 d7 F( ]& F
installed on a computer and to locate its installation directory.' B F9 [+ L' h' ]6 m5 L
It is used by few softs which access the following registry keys (usually #2) :; z1 v* B) s9 R1 h! w* s
3 M: u4 r) P& r$ P5 y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 ]& g0 `% f! S, v. q\Uninstall\SoftICE
' O6 T* q. Z2 s! n-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ Z1 v% n( S! y6 c
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* I6 d' N p, M
\App Paths\Loader32.Exe
0 f3 O9 O# ` [; }6 V
) T7 g6 o' m; {% l9 [" f
4 q. _. c1 g& f( x3 ?, g, u- ^& f0 w$ ANote that some nasty apps could then erase all files from SoftICE directory
5 E0 K) v4 h* T(I faced that once :-(
1 ]6 N% ?3 P: m9 d0 x0 I' G6 Q; g" X$ K$ ^& r3 S! o+ j4 |
Useful breakpoint to detect it:5 X, T; d! _: d2 i: Z
+ L# U4 q3 M$ U BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! y6 ]1 `+ R2 M9 y0 \5 R
1 A: R, \1 |2 `7 I
__________________________________________________________________________
7 {$ ?( n. q1 a6 V1 ?
2 d) b, B) t$ C! g
+ r* S- k- S9 B+ n- k# x, iMethod 14 1 H4 k! D4 U( l1 M' ?
=========. ?( l' k! w6 O
$ y3 c9 X4 A4 F/ W
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
9 D3 j8 k7 \% O5 T7 d$ B' c$ \) yis to determines whether a debugger is running on your system (ring0 only).
2 B6 r2 [+ p0 p) Q
( L* t! E2 h3 Y) f5 D4 ^- u VMMCall Test_Debug_Installed
, r) i+ r' v6 X' X) n je not_installed1 B; t6 h- c) n( u0 z% a* ~' q) w( ?- L' i
( @2 S- v, {( h4 mThis service just checks a flag.
2 \ z' W1 d) Y( u: F' x</PRE></TD></TR></TBODY></TABLE> |