<TABLE width=500>
* V- |; `3 H) g/ _# O<TBODY>( l+ I; D1 B+ }) a8 B1 T2 C* O
<TR>; e! v+ X- B! L
<TD><PRE>Method 01 : c+ b5 @! h0 w: L& {
=========
, f( C, v+ R$ t$ i' V; _/ v/ n+ W- D% X S& r/ u$ d6 h5 _
This method of detection of SoftICE (as well as the following one) is; J1 s- D! W) J, c Y3 Z' g; ]
used by the majority of packers/encryptors found on Internet.
" \8 Y4 v& m6 h( |. Q1 [* HIt seeks the signature of BoundsChecker in SoftICE
2 V# N% f% Q4 k( y' K, W. q1 \. F/ W
mov ebp, 04243484Bh ; 'BCHK'8 o$ x, a& H6 H$ N6 z" z
mov ax, 04h
/ d5 ~) g5 M7 }8 m int 3 8 n+ Y* H) \/ M) ~: g4 d. Q
cmp al,4
1 A, v+ l( f# T. B jnz SoftICE_Detected; }3 A7 B0 ^& ?' u: L3 T
* e1 x i3 `6 o ^___________________________________________________________________________& q/ |! M- [* D' |2 l
& A: c9 H7 N6 W9 l7 T0 @+ F( YMethod 02. n! Q: x0 \ o9 U
=========
8 Y6 H' Y1 I; X# f6 o
1 i" K* Y8 Y7 X L9 PStill a method very much used (perhaps the most frequent one). It is used
, k( M& A+ T5 X- x' o% P9 Mto get SoftICE 'Back Door commands' which gives infos on Breakpoints,( [9 K- J. }+ O; J) E
or execute SoftICE commands...
z( q% C* x, LIt is also used to crash SoftICE and to force it to execute any commands
7 |5 y7 E) u$ K4 x1 H s* C(HBOOT...) :-(( 5 K, r, ]' i. g! J# N: R$ V% h
4 R5 G9 a1 m; h# U/ XHere is a quick description:9 R+ f ^: ]4 A( `2 L
-AX = 0910h (Display string in SIce windows)+ b% g" z: C) n4 f" p
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 L/ ]* \; N8 W) [' q-AX = 0912h (Get breakpoint infos)# ]: [& e5 m0 c$ ]' L) p4 V
-AX = 0913h (Set Sice breakpoints)
4 N+ }, H C" |6 b& ]9 [& p3 J-AX = 0914h (Remove SIce breakoints)) r( g6 |( ^# c) H! z
1 ]+ }6 o1 l; S4 ~2 G
Each time you'll meet this trick, you'll see:
7 @3 z) r# G6 P3 F5 D1 \-SI = 4647h
3 y( j9 E: }8 E2 u; L. r-DI = 4A4Dh
& q+ D9 {8 v' R+ v. o# y$ q& C( L9 NWhich are the 'magic values' used by SoftIce.0 i- J( G' G: H1 ~1 I5 K6 i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.% v( e4 b: @2 @& J7 C# C9 z' \, R
9 Z8 M# M5 W: m; r
Here is one example from the file "Haspinst.exe" which is the dongle HASP+ N3 K' v. Q/ e( _5 e% J0 x5 d
Envelope utility use to protect DOS applications:. c/ [( C: t0 k
3 i8 f- o/ S' g9 u) y+ v$ S0 S6 A' s$ v( n4 X. e
4C19:0095 MOV AX,0911 ; execute command.
2 [0 A3 X6 D! @5 B1 }6 s4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. p- ]; J" A3 T2 R I. ]5 @
4C19:009A MOV SI,4647 ; 1st magic value.
5 r1 k9 H/ X2 d/ i4C19:009D MOV DI,4A4D ; 2nd magic value.' z3 E* [: N; Z8 n: I" d
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( S6 ^- R6 U6 g4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
: y4 S7 m: [* m7 D4C19:00A4 INC CX$ P! m& r6 P' ?- X- @6 X* e4 h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ n# D2 L$ o3 m$ v; ~3 G
4C19:00A8 JB 0095 ; 6 different commands.
g# }0 @. A7 b3 X, T- O# S4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 n5 b; x6 j- X X: p" N
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# Y5 Z+ e" |# q# m0 j; y
. \6 R, \# u- z/ l7 z1 `The program will execute 6 different SIce commands located at ds:dx, which2 w0 W/ U( s" f7 y# f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 ^7 O+ n/ C( | C. V8 } V
- g& ]6 F1 _. G% z1 Z/ f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( A g1 H, _9 {$ j/ w___________________________________________________________________________5 {2 N" g! O5 f1 ?- i% h) R
/ h9 T; V: t$ R# Y; s/ R" p
6 x% k2 d4 L7 T( k0 O& zMethod 033 P+ ~. t. ?& U
=========7 r( l5 k! U' n }& ~
- [) r: j, [ s" WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
6 L* W/ z8 g( F- l6 q(API Get entry point)5 t, K, \; X/ D1 d& }! j
1 b6 e( ~4 G" `; X+ B/ m+ I1 O0 Z
xor di,di
9 d& x) M( b* K- E- V2 ? mov es,di
# J4 S0 V% a4 @+ i' Y8 h+ N mov ax, 1684h
3 E6 `- c/ x r: p mov bx, 0202h ; VxD ID of winice
6 a8 b1 q u$ ~ int 2Fh6 \! e* ]1 b; O9 t$ d& G
mov ax, es ; ES:DI -> VxD API entry point/ j5 d# o7 A% N8 q. z! e
add ax, di
" ]' d s9 D0 R5 L6 @3 }/ H( t: X test ax,ax, B+ x2 c. _( T: D2 ?
jnz SoftICE_Detected1 H2 h o; l7 T- C
+ ^% q( z5 e; V4 k5 ~9 C; W2 J___________________________________________________________________________! f& V! ^; K5 ? \3 i' d; m
& R4 E Q0 Q" `Method 04% Q, {% X( I" D! p
=========
( }2 _$ a5 d! N5 X; R7 U" v9 A7 H% G: _+ {4 x* r5 V9 T
Method identical to the preceding one except that it seeks the ID of SoftICE
( Z% A; V j8 a tGFX VxD.
. `4 _+ P5 d1 M! b& L- A9 Z8 M1 |6 q( N+ E" I
xor di,di
& s/ W, \- e4 D# T% ~ mov es,di- H0 i0 E% | P. U0 c7 q9 d: c1 n
mov ax, 1684h G( Q4 D8 S m I! U5 h8 b
mov bx, 7a5Fh ; VxD ID of SIWVID
7 [7 z; W. ?8 D! Z- @ int 2fh5 d( H0 z) B/ E8 t& i7 d9 s# y5 v
mov ax, es ; ES:DI -> VxD API entry point8 V& Y, I$ j, n4 }
add ax, di
6 D, L6 W3 `) ]5 q! k! K) A test ax,ax# ?' C/ m5 V1 R- e4 g9 b- A! ]
jnz SoftICE_Detected/ {* r' H/ l. ]$ O4 e# R8 K
8 o. j( n. u5 `1 k( L% @
__________________________________________________________________________3 J6 m$ O* M* O5 J( y
- k7 x1 e% F% H, q9 n& Q
' i/ X% v$ ^% KMethod 05
* b; Z' K+ n9 L( V+ @5 E" w=========
3 ?2 Q; w. a7 f3 w" m# ^% A4 U) A( s X' g) M- L d
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& L8 b! P/ q+ ?" E9 G3 t6 u- m ?debugger. It calls the int 41h, function 4Fh.! Z" r. j7 f4 j
There are several alternatives. . ~5 b5 l2 R q3 I/ F
U, l- D5 f& ^" ~ n: G: J1 e9 A5 zThe following one is the simplest:. Y ?4 @8 a% `# B
0 b' c( X; Z5 ?1 D* E5 G7 ^
mov ax,4fh
' ?% |1 F0 v$ t. H/ v$ L int 41h/ p( s7 ~9 i% B: e1 y' \8 z
cmp ax, 0F386+ _$ L& n% y& c; R
jz SoftICE_detected1 r1 z: O1 m8 x8 F7 z r
8 Q8 l6 A% N- M, D* U9 {, V$ U: |7 p' N, x- @. z
Next method as well as the following one are 2 examples from Stone's
: q+ S( L+ h) r8 j- A"stn-wid.zip" (www.cracking.net):
: S4 I4 u0 ~. i$ M0 }
8 j7 o3 B4 n; x$ }* \( E mov bx, cs9 j+ N# ~4 ~% M( U
lea dx, int41handler2% f8 @! G7 v' \/ W* Z. O
xchg dx, es:[41h*4]8 u$ a s% |7 P; {4 ^5 b" ?
xchg bx, es:[41h*4+2]* s1 d7 e5 W& j# f/ R% B
mov ax,4fh, |4 j/ Q7 F& V
int 41h* S1 s" W# f& }7 v
xchg dx, es:[41h*4]4 n$ k8 g8 n6 q" t4 E/ n
xchg bx, es:[41h*4+2]( U/ l# M' [# k" T8 l
cmp ax, 0f386h
; y) J5 g" e6 w1 a jz SoftICE_detected. p, k1 J6 ?5 E' |( @: S
/ N5 z S0 i9 `: D5 ?* a
int41handler2 PROC
0 k; Q1 y% W' U+ x( O iret0 p: I/ Y! |8 k- O7 Y- S7 g
int41handler2 ENDP
" q& D; g7 v1 K/ M% M' h* g. @
8 V% `, l, P* k* C3 K+ V8 Y7 ~6 ~7 i2 h
_________________________________________________________________________
! Y( _ z4 t, x- A! j! z$ t7 q8 R
9 C4 h$ L" U0 o' b+ @4 O
3 S7 `/ |- L# {9 J( z0 |- WMethod 06$ s" Q( q) b( _
=========
7 t2 P4 K0 n2 K; c5 h3 ~+ l2 A) h/ R/ [+ X
$ H' j8 y1 W9 U b2nd method similar to the preceding one but more difficult to detect:
% f; w$ B* B n) a& _! N8 ~: ~7 X( ^+ l% h" l( T1 X
0 j2 d. P9 D' \5 K5 ] l y
int41handler PROC Z# P# z5 B; j3 T
mov cl,al
9 u* R% |0 r% { iret2 {4 a" f' E# g: k
int41handler ENDP
0 n5 R! U$ [: n2 z: T8 E
! q" t$ D# ^0 W+ g0 b: ~- s1 ^: B. p. u5 x/ ?! @' A
xor ax,ax- n4 n4 O; U& C% Q/ x! F: L
mov es,ax
& f0 C( F5 M+ u mov bx, cs/ K1 c' I' B2 Q, v) `" g
lea dx, int41handler
: W, k5 [, i6 P3 |- ]9 F/ O: [ xchg dx, es:[41h*4]
* \+ N8 y6 G5 z# \ xchg bx, es:[41h*4+2]$ N# F3 c% p; A! P$ ~
in al, 40h
8 U# b- X1 z. {& I0 z$ {' M1 Z: T xor cx,cx t: y2 s+ N/ o
int 41h: b) P% |/ Q9 S8 q% ^+ v) R& D3 R
xchg dx, es:[41h*4]
4 Y! R1 g! h. l xchg bx, es:[41h*4+2]! C3 W# q4 H6 _ `
cmp cl,al8 j5 O/ y* [+ X
jnz SoftICE_detected' S* U8 g# S* o4 J' Q* n- \4 U
7 X! @' H9 Z8 D2 Q% o
_________________________________________________________________________0 K6 i9 G- j2 q% v5 b
- _1 y* U7 B1 L0 N6 d
Method 07/ t/ t' L5 F1 O0 @
=========
! P1 f6 Q' _3 h
3 J. G( p7 a) g$ r ?4 ]Method of detection of the WinICE handler in the int68h (V86)
; ]! j: \! X5 W7 L
. N" k2 ~$ I3 F/ x4 d% b mov ah,43h
- O! {3 w: A4 X* H4 L int 68h
, V5 o. Q+ y- ~- R cmp ax,0F386h
& v s/ N* a0 A; E jz SoftICE_Detected
0 B9 y% _. X( u" Y( [$ N
) i' _' t( k6 \
& `3 Z. o/ c1 w3 o& d4 r) w=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 I$ w7 M1 k! { app like this:/ B# W( _7 f) p6 b5 l, e8 C
U5 s8 [2 k* p: i BPX exec_int if ax==68
8 g3 ^6 ^% F7 I J, [2 @ (function called is located at byte ptr [ebp+1Dh] and client eip is
1 O$ t* d. h1 y* L+ l1 l: T. a. s located at [ebp+48h] for 32Bit apps)2 Z8 D( S4 ~# g5 [- `# k4 Z9 R
__________________________________________________________________________
. _% i6 j% X9 t& a# L
: _) I* J) l" e5 P* y
# ~: M5 U; E1 `' Z. j' I; R2 _' SMethod 08/ S3 p/ @! u' G* T- {4 ?
=========
: W9 r9 S% ~; F9 V7 [0 V8 H, p
( ]8 S1 o9 d( }- F% N. AIt is not a method of detection of SoftICE but a possibility to crash the) R' s' ~% |+ N/ k3 n; p
system by intercepting int 01h and int 03h and redirecting them to another! h* B7 s& L% z( _7 h
routine./ e4 Q- q. {* X6 ~- n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 |, |1 d# f- n8 i) Ato the new routine to execute (hangs computer...)
/ j9 p3 T, Y# i" `. r
& Y# `3 \) d& T; d3 @& D, r mov ah, 25h; r2 h: H7 J! v
mov al, Int_Number (01h or 03h)
5 w- s% S# O; B0 X mov dx, offset New_Int_Routine
7 V+ p7 ~! J, M# x/ j4 K" v int 21h
1 v+ m# Y: K. o: M/ {& d0 q
4 b% u" f5 ^' R! n__________________________________________________________________________7 G) s9 d" F& _2 e& O+ n2 a
2 a9 K3 \4 C% b& }+ n
Method 09
2 ]& v" ]4 ?6 _& q* n$ r=========
- T" ?% Y. M) s, j9 A i" Z+ _" `" O
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( @+ `0 i# i6 h2 o
performed in ring0 (VxD or a ring3 app using the VxdCall).
) g7 ~4 R% e8 X& V& pThe Get_DDB service is used to determine whether or not a VxD is installed
* O8 {$ p4 |: g& n( }for the specified device and returns a Device Description Block (in ecx) for! U) p t, b4 _: h, S
that device if it is installed.4 l- Z+ h$ d! t, X
* t% G6 T( s6 W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
# f: I5 h7 z# t. R mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ ~7 T, `4 R& ?7 `' { VMMCall Get_DDB! z2 U5 s$ g! f7 e. g9 \; d# F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 |& _- _8 ^& a B( H5 `% |8 F9 y7 A
1 |4 S6 z3 f. t- b' Q* v
Note as well that you can easily detect this method with SoftICE:
& c9 U: T* Y+ V' G7 q. p" n3 d+ ? bpx Get_DDB if ax==0202 || ax==7a5fh
2 o4 ]4 T" g: Q' y; @7 F$ V
: m: a* }. Y7 ], }* v' G__________________________________________________________________________
; |8 W Z# C% T
7 C0 H+ ]; {% {/ Z' @Method 10
E7 ?' ?1 Q" X3 J( \, a8 R=========
7 h( W5 z; d- w( v
7 T4 u$ q7 J: F=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 D5 X) t* j0 |8 S; h SoftICE while the option is enable!!. J& L# u! ?8 C J: e
: Q# X, {3 s1 E! e9 f# BThis trick is very efficient:# M; A3 r' i; _ k
by checking the Debug Registers, you can detect if SoftICE is loaded
2 U9 |, I0 a7 {: p0 ?9 Z) s6 t(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 B0 f4 Y% G8 K0 C8 Q+ {8 t$ J2 Vthere are some memory breakpoints set (dr0 to dr3) simply by reading their
3 {0 h* @/ a; bvalue (in ring0 only). Values can be manipulated and or changed as well) ?! K. B7 F6 ^$ F, d
(clearing BPMs for instance): b9 ^8 K P5 o, b
# n5 z& i+ L5 \7 Q0 ^__________________________________________________________________________
{. l9 |1 M2 w+ V* ^
2 x' J+ S; u2 [3 R9 @Method 11
& R# v8 [1 ~" L* A: `2 O=========
. J- @6 J1 c* n3 g, M: _, J: I
, b* |1 O: s( m2 r8 ?6 kThis method is most known as 'MeltICE' because it has been freely distributed
" v/ A" z# x9 O! h2 }via www.winfiles.com. However it was first used by NuMega people to allow
. d$ X7 x( K3 g+ A4 W0 W: WSymbol Loader to check if SoftICE was active or not (the code is located* f0 O9 r% Y6 W$ j! v: k
inside nmtrans.dll).
5 L9 P4 i( B- B% |. I' S! r# z/ V( t! R5 h' e6 E9 D( R' J
The way it works is very simple:
/ m o4 F4 G3 k/ K0 `5 pIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ v9 S( E- F( w" S7 {) s. iWinNT) with the CreateFileA API.
" E: @/ m% r0 o4 a& |9 `) I% x( b$ {6 \4 a1 E: a4 ?
Here is a sample (checking for 'SICE'):3 t1 ^$ w2 ]: }4 d% N. e! j. c4 z
+ d/ P0 C9 _# m x( n
BOOL IsSoftIce95Loaded()
1 n/ [7 t1 I' R$ t/ i) \& }) P{
% ^; L6 Z- p+ Q6 |8 S HANDLE hFile; r9 b: Y6 K9 e6 ` K" ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 I; x3 Y# X2 [) K T FILE_SHARE_READ | FILE_SHARE_WRITE,0 \( X, g b9 A# S
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; |# \0 D, { H: w( C+ ?- m; D
if( hFile != INVALID_HANDLE_VALUE )! |8 T- h. ~' K, D
{. y( z, N& y5 d
CloseHandle(hFile);
0 L) N9 A( ]! ^, b3 C return TRUE;& o3 ]7 K- B* p$ x
}
! ]8 D) K. c, I9 X" b1 G return FALSE;
- ^1 u5 G5 K( ]/ ^) u}
2 z: ^2 {. i2 Y7 C% x) ]5 d3 s; K
8 E$ Y k. t# lAlthough this trick calls the CreateFileA function, don't even expect to be
; S- T+ t6 i3 r) D: vable to intercept it by installing a IFS hook: it will not work, no way!* X4 D! K% m3 h) @# D& @
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ M/ I. G) O& k2 o; X9 g* |& lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ |; B& b0 A* I" q4 g% P
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 |6 s4 J9 _/ p; Cfield.
/ \# X% c$ H) L: P0 yIn fact, its purpose is not to load/unload VxDs but only to send a
1 O: e7 l* g( i) Q% K: wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 l# J0 M$ s! B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
/ E( X5 z7 o/ B8 g$ t* s( \9 Dto load/unload a non-dynamically loadable driver such as SoftICE ;-).
9 k$ N! D( Y ~7 q5 HIf the VxD is loaded, it will always clear eax and the Carry flag to allow9 {: k1 I3 w! S; ?
its handle to be opened and then, will be detected.
7 I4 u/ y' k* OYou can check that simply by hooking Winice.exe control proc entry point: {6 l% {* c3 m! o" B, @" G2 n4 @
while running MeltICE.( x; b" [! O5 {' N! S
* K0 i& l/ y0 z/ T6 R, }; H8 @2 @+ H6 S
00401067: push 00402025 ; \\.\SICE" W) v; Y, m7 r, [( h* J
0040106C: call CreateFileA
' b5 _, w7 Q5 }1 l* C8 K 00401071: cmp eax,-001/ S/ r L' { s0 X1 m! j) S. }
00401074: je 004010914 H4 \; w' ^$ s( j" W( |* [) X
' J4 f( b) r4 ]7 Q* L: G6 i8 V4 z! v' p1 A) n) b
There could be hundreds of BPX you could use to detect this trick.
* Q) W) D, V( n0 m$ X-The most classical one is:
1 q4 L" g+ k3 l7 f: k1 U BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% N2 L$ d' ?$ b8 K* b/ ]: N
*(esp->4+4)=='NTIC'
$ K' Z% ?& @9 }
2 t! r! ~! i, h4 t-The most exotic ones (could be very slooooow :-(7 `6 A6 \! v: J
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - X7 T% Q5 v9 a" _/ O* p% d
;will break 3 times :-(! L7 Q6 s$ F7 O( n8 _! ?1 N/ s- N
* b+ ]' @6 {8 t+ ~3 t/ m' t-or (a bit) faster: , s" d& g2 s) K) c$ a/ W
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 e3 K; l! n- G! R" [0 X( u3 L" m6 O8 n6 d+ I0 T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* S( z% k; v' K1 ?4 C0 a, \ ;will break 3 times :-(+ F! I \4 l1 v7 ]& C8 m, T
$ j; H$ I8 n6 p0 k-Much faster:
/ ?( S; H3 H8 Y: P+ ^# o BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* i" c- c ]* E. r8 \" P
2 z1 w: p1 y' _# ~4 e' R2 n2 [" o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% P6 S4 P% c1 O; k
function to do the same job:6 w6 f7 u/ ]! h1 I
. @& {% ]. B, k+ w) I push 00 ; OF_READ
, ^) r. s( U6 k! g: o) l7 L+ I9 l mov eax,[00656634] ; '\\.\SICE',0
7 ~" q6 e) ^8 I/ D2 u, F push eax( x9 ~: N6 X. J" @
call KERNEL32!_lopen
6 [; d9 @/ y! D inc eax. g) k& h' v, e, h- ?' v
jnz 00650589 ; detected' Z" s9 w+ g/ G% n/ |- _0 J
push 00 ; OF_READ* |2 V- p3 u0 v2 F3 I5 a
mov eax,[00656638] ; '\\.\SICE'
$ {, [# W, J2 f push eax! S T* e) s2 a
call KERNEL32!_lopen6 E! d( Q7 n3 ^
inc eax* g$ L9 v; y+ t
jz 006505ae ; not detected
+ z+ n& p% f0 T4 _3 m$ @
! N' s( R+ z, Z+ t; A
5 g' n3 }# t+ M( {__________________________________________________________________________
# l) n6 q! k |$ ^) \
8 A- S/ n! ^9 ^+ o, ]" U* l7 IMethod 129 y+ @- Z6 W U9 ` s& w
=========
$ V8 c H) `3 a0 C
7 n5 N, m5 p, ~- m' l7 u! kThis trick is similar to int41h/4fh Debugger installation check (code 05
q+ x' v5 ?; h& 06) but very limited because it's only available for Win95/98 (not NT)# Z2 M7 O/ x1 `/ p" k! l3 b
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ V3 o& o' v: f6 f* o) x
" I9 N0 ~* n9 `& n8 i9 s push 0000004fh ; function 4fh
: ^$ ]% }0 W; t, Z4 Y push 002a002ah ; high word specifies which VxD (VWIN32)
- c, i9 [4 _1 Y8 A ; low word specifies which service
0 F) }- X/ j$ v; N9 B7 j' T& | (VWIN32_Int41Dispatch)
. t# H% g2 H7 u* _ call Kernel32!ORD_001 ; VxdCall
. Y3 ]- Z' k: x5 \ l6 C V8 n cmp ax, 0f386h ; magic number returned by system debuggers h9 E/ J4 M6 [5 _% h$ R
jz SoftICE_detected. u$ ?; _+ U# _( S( i9 z
" E0 p3 P6 }* S+ k2 D% THere again, several ways to detect it:/ ?4 D ^5 t. c; @
9 k( s {$ E! d1 I+ m
BPINT 41 if ax==4f
1 Y% {8 E* r1 e! P
5 P% a4 B1 P: o. f0 ^" O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one5 j4 ~5 O: _8 E5 J
1 f, [* g6 a+ p$ t0 d6 S BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% T: z) {( M- t/ I0 ]
+ y# a0 N9 f$ m0 j2 B
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 c. M* X- |# v2 Z6 ?
2 z4 z( n) r+ U& f7 K- ___________________________________________________________________________9 W+ ?. s& j7 M7 n' \5 o% J9 P' {3 c
) [% C% E( C" A" Z( j- r7 RMethod 13$ I* E c% F% n6 X) T O6 b: @
=========$ Q" W' C3 Y% O: |, t1 L) \
, `4 _" j0 k2 W" c( a3 H7 G% pNot a real method of detection, but a good way to know if SoftICE is- j+ X0 [' B9 f1 D
installed on a computer and to locate its installation directory.
# f% S7 I9 g7 W. }( HIt is used by few softs which access the following registry keys (usually #2) :
; y n9 z( _. x6 |/ }
* q7 a5 [2 p. E4 U$ H. Y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ Z d0 s' h& ^7 _, f; r
\Uninstall\SoftICE
; a6 K5 c2 p4 [9 L-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# x5 K0 s0 d- x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' t4 ^( a, ^8 d p* t
\App Paths\Loader32.Exe
- b4 N, {; E- r; [8 T ^
3 N; f- ^3 s" m5 B( G; z% k% }, X( t; H: c
Note that some nasty apps could then erase all files from SoftICE directory
+ a9 R+ i5 c7 W7 H1 D4 a(I faced that once :-(
2 D' V2 x# D* u5 r+ \1 U. O- W
- v3 b$ k9 e+ i/ XUseful breakpoint to detect it:
( V8 Z, @. e, s/ s5 z' x0 e! F% v( ^, r0 @* v; N( k2 V
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 {+ @) [3 ]. w
8 C3 O' |) V$ H4 G. b [( Z__________________________________________________________________________
0 i! z$ L5 \) D" W; y: }4 c- ?" F8 Y4 b, Z. i
9 G% o7 Q! l' r+ L8 X
Method 14
2 ?1 [3 L: z3 X* F=========6 K7 M% _; B6 {1 n3 ]* M
% ~) x$ H! s/ s0 ]A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, s+ @5 {3 o' u# ]7 `is to determines whether a debugger is running on your system (ring0 only).+ ]9 t4 I$ y( M' S) m2 ?" B5 O
4 i- N" f z: x& L: k$ b$ F VMMCall Test_Debug_Installed
, |- {% H n! y. ^' C: R+ e' ` je not_installed
* U1 Q% h( }, j! ` G" p# e# e' H- ]/ b* [8 a: Q
This service just checks a flag.
! p& s+ F" s7 B7 ~5 m H9 J0 j</PRE></TD></TR></TBODY></TABLE> |