<TABLE width=500>: G, f5 I$ Z N
<TBODY>
1 M( G w6 |( Z; s<TR>5 S; g4 m9 [: A- v
<TD><PRE>Method 01
+ l4 T, Z% G9 l7 j% x* [# Q$ Q' |=========9 l! g9 ?) ^ B ]* Z& Q% H! r
2 j9 {6 _! ]! D
This method of detection of SoftICE (as well as the following one) is
& e; d/ _4 b, ~, y/ eused by the majority of packers/encryptors found on Internet.
$ j$ n8 v$ X9 zIt seeks the signature of BoundsChecker in SoftICE2 h3 w6 S, I) @- y$ p% r
2 j6 N. D( X0 Y4 K5 W& W5 D mov ebp, 04243484Bh ; 'BCHK', D- g3 I/ ?) r$ N! M3 V* E
mov ax, 04h
2 B* N5 C2 Z3 I& _0 i1 x0 x int 3 , J) ~5 E7 k0 R' N; }% v5 W
cmp al,4
3 r8 o6 i7 h2 T; Z5 N) B; A# \ jnz SoftICE_Detected
, n. p# |& a9 G0 n; G; A/ I& ]* _/ g
___________________________________________________________________________$ E, W a: t/ W1 ]( Z
. n9 Q, T$ A4 i9 A2 a1 x3 l; ?1 zMethod 02
3 K N7 a5 H4 A1 n$ \: i+ z* K=========
2 y' n. k$ l4 Q2 c+ H& q4 i) o9 y q8 {
Still a method very much used (perhaps the most frequent one). It is used) H. K! A4 {, C; H5 [6 Q- K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) M4 P) N9 Y0 Uor execute SoftICE commands...
, r* t' U: W' Z3 N6 C4 u' W& [It is also used to crash SoftICE and to force it to execute any commands
1 u2 C$ [5 H" O1 a" Y. B( c. v(HBOOT...) :-(( 1 y7 g8 r' |; v! j% c, I
/ P0 X7 }) F- `2 RHere is a quick description:
5 x9 K% f9 e/ y9 Q$ v& B; u7 V) N-AX = 0910h (Display string in SIce windows)
- B6 S, n9 k" q! L& x-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ J6 H; q* n" }1 a-AX = 0912h (Get breakpoint infos)( j- j, b; N$ h" r
-AX = 0913h (Set Sice breakpoints)
- _+ }4 u8 m: D" I# H-AX = 0914h (Remove SIce breakoints)
8 ~5 i; K, |. H. j- S8 Z4 k; n+ {( }) t p* b; Q2 b
Each time you'll meet this trick, you'll see:
5 e4 F0 E. J4 [, E w$ n( L5 L-SI = 4647h; u: V! I' k/ m- @! J" g
-DI = 4A4Dh
0 w2 X2 p' d* j& n& F0 PWhich are the 'magic values' used by SoftIce.
( t0 R* q. e9 y1 O4 ]' X. @For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' t* T, F- s( _4 M7 ?5 B ]* B4 Y( L2 q: s( g/ }2 E
Here is one example from the file "Haspinst.exe" which is the dongle HASP
& T0 o1 x+ l" p) o' B- |Envelope utility use to protect DOS applications:
3 W h8 L; V O8 \+ ]/ D
# E. H% l' d# p5 E1 f- e, u% c6 O$ q0 b
4C19:0095 MOV AX,0911 ; execute command., u$ T! e: f/ J- s5 c" x
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
& S# b( ^! ~' b' I% |: c9 N4 B7 g8 ~4C19:009A MOV SI,4647 ; 1st magic value.
0 d9 z$ l( s* h) D$ ?% Y4C19:009D MOV DI,4A4D ; 2nd magic value.. v& P$ L" g. a+ y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 f: G, E) i, Q. x6 I x4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ @' x: ]1 R, M, P# |. m5 v" m. }6 u4C19:00A4 INC CX8 \- _! H1 e# v. n/ l+ A: Z( ]
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 d% H3 k6 P5 w" I* U5 X# y
4C19:00A8 JB 0095 ; 6 different commands. R- Z$ Q S; K& Q5 d
4C19:00AA JMP 0002 ; Bad_Guy jmp back. K/ N9 [! K* H8 c/ J0 [
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# N& F2 x9 b K9 k. n; x1 V8 w
, g& ? Z6 f2 g! b3 F$ `4 W
The program will execute 6 different SIce commands located at ds:dx, which- k/ E8 X% W$ o! L# Q" @$ ?8 ]* ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) E) X1 y/ R, J3 n# s- p: i S/ f5 T7 A- ?( `' ^, F* s( }4 x- }, n) U. R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 g4 J. f# x/ Q___________________________________________________________________________! t+ ~9 s$ z; h" c
8 A% k" v4 @3 Z6 m- Q2 n6 [) |) Y' G$ N( q& O8 d
Method 03) E6 d, w5 |% S& d" p7 h* R
=========
9 `1 q5 W% {6 ^, G3 M) y3 s" T) X0 D1 X6 A$ G# V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
; \" [- Z* r5 P% i. Q(API Get entry point)
) q3 U, d1 [3 e) z# o
* b" Q. U; V' i9 S7 j7 Q( a# D- s/ A
xor di,di
, @7 ]( |) a8 h5 F; C, @2 W mov es,di6 n9 S& v/ l7 p4 H
mov ax, 1684h 1 O1 `0 [. n) p, r, b7 k+ }
mov bx, 0202h ; VxD ID of winice
( w# |! q7 n+ F! r int 2Fh# C5 |, R' |7 p1 P" F$ O
mov ax, es ; ES:DI -> VxD API entry point
8 C6 v0 \, j8 l( a add ax, di+ h. T Z n6 c1 ?
test ax,ax
$ B4 _6 X1 M# P! C- Y. Z jnz SoftICE_Detected
1 q8 e, u* S. j8 ]& x7 K. U, f+ ]
7 L! R6 ]& m4 ^3 c& w4 ^ e9 S# y___________________________________________________________________________
y! Q, _+ Q% O* O. V0 Y2 {& S/ J) j$ b& ~" H* f; N3 \
Method 04! f7 ^' I# [8 s ^
=========# G9 ?* W6 Z. @5 ?( c p
0 l$ N6 _% r- c I% _; o' T7 i
Method identical to the preceding one except that it seeks the ID of SoftICE
) m; s0 v* S7 IGFX VxD.
: K+ m" ?; r! _* {, q% t( K; Q! v
xor di,di# j0 c1 E( r3 V7 G( }1 S
mov es,di! ?# `) O0 t' U9 I
mov ax, 1684h 5 |2 h& J1 |# Z& s' r% e
mov bx, 7a5Fh ; VxD ID of SIWVID
9 o+ q0 S' w- G: w4 z# ` int 2fh( g" l* p, _' x8 q
mov ax, es ; ES:DI -> VxD API entry point
. W6 c% }& m4 l% ?' @1 ^ add ax, di! M' d& b+ Y- F% l* P
test ax,ax
0 d1 @. C! T- K' B# F( Y6 R! X jnz SoftICE_Detected
8 L. Y: O' |- x+ I8 K- p) Y0 t# }# k% p1 b4 f! L
__________________________________________________________________________2 r& @' K( m% N- ?$ ]6 H* ?
# B2 j5 }1 R2 G
. o" y4 e8 ~9 i2 G8 y+ I% a$ ?Method 052 ]" W4 D$ Z" C8 T- p4 p
=========: E) I( [ }" M" [, R$ B, m5 [% m
/ U* W. u/ \' J, s* }/ _/ P: C! `- j
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) [* ?' h! W9 ^% I adebugger. It calls the int 41h, function 4Fh.
# U; O. P- u5 c0 b, EThere are several alternatives. / a" F' G4 U! p% r/ ]; q3 h
8 y& a5 v3 \! w( F" v7 G
The following one is the simplest:
. U% t9 D( d% j
, q" e$ Q) s6 E mov ax,4fh
5 J5 P& e5 }) ^ int 41h
0 ~: ]2 u5 h" o: Q cmp ax, 0F386
3 O$ |; R, r' A& C# H jz SoftICE_detected
; {$ E/ o3 g! V: R m2 f" L% g' b% z% q# v" q0 `! v5 Y" f5 S
# `) `4 ^- D2 m8 m
Next method as well as the following one are 2 examples from Stone's
& [- ~ U, E' s7 x$ u& r"stn-wid.zip" (www.cracking.net):, R) j, |* u1 r( D
: q% B2 v4 s$ @9 B1 {' D mov bx, cs
3 ~$ g6 e( D& p N3 k lea dx, int41handler2
- Y* p$ y- w+ T/ m7 ` xchg dx, es:[41h*4]
% y% G; j& ]4 \( U+ Z7 c xchg bx, es:[41h*4+2]
9 I" d8 N* L: E$ a& E# F mov ax,4fh
7 R: I6 t& a, D' B4 p. H) L4 L int 41h# @$ s; ]* J2 s7 L. T. H
xchg dx, es:[41h*4]; l0 f: U) x9 j; } X# n( K
xchg bx, es:[41h*4+2]
" E) I: U2 ]: @! C2 m cmp ax, 0f386h
) F: T9 v* {) k' k9 \ jz SoftICE_detected& C. b& H& P( o4 v$ K+ k% n
+ ?- e- w6 o* _9 w2 F( p
int41handler2 PROC
M2 t! I& A2 X% x: g8 q iret2 Q6 _. ^0 ?- K+ C
int41handler2 ENDP
: L' l2 f# j, c. m( ^2 w
7 k+ e. [3 P& Z& d& f8 k3 l- \, {+ `. _9 J- k5 G* R
_________________________________________________________________________6 P$ w1 d" g+ G6 I
1 S2 o) u7 q8 q ^. `
2 L9 u3 R& u8 `Method 06
6 z) y0 e* m/ V# x4 l+ T=========
0 a4 b P2 _: c1 ?( L% Q& _3 N
# g8 n' f' n# U* g' y$ J8 w
: d; W/ T3 O7 G# n2nd method similar to the preceding one but more difficult to detect:
3 u* i; r0 E3 G& S( `: J: {& ^# E8 J, l0 p
# `5 ~: w ~1 a) X/ u) z$ V6 ~int41handler PROC
! x6 \, k' Y6 {2 ? mov cl,al5 i s, t9 D# z2 e1 `$ o
iret
0 f7 Y4 |- w, A: G( Wint41handler ENDP: v" w! d2 C1 y5 F
# O, n0 `( k" C# n
1 C' n" y4 o1 u, T xor ax,ax; o; d* H1 g5 w
mov es,ax
# p4 B% [/ F9 z/ D" s mov bx, cs- y- F- d+ g& ?! |4 W
lea dx, int41handler
3 j2 `+ E( I* g1 c3 U xchg dx, es:[41h*4]
2 a6 e2 X0 v b6 ~! G xchg bx, es:[41h*4+2]: S- e5 `: W# L: y1 p- a
in al, 40h
9 C7 z9 E6 z# \( Q8 {! P xor cx,cx
: w+ K0 ^' W0 l) P7 s int 41h9 U2 o3 B1 i. H0 W+ a; |
xchg dx, es:[41h*4]
; K' B6 \' Q! S# @+ B) k xchg bx, es:[41h*4+2]0 M& N' m: U: R) s
cmp cl,al
6 {& t5 H4 }; Q- G jnz SoftICE_detected
+ O) W A! S! P- [ H1 W: u4 H; a+ b+ A
_________________________________________________________________________
/ m" [' a& M( G' d/ m& t
0 W5 D3 l4 o( |% u3 z2 zMethod 07
# O9 {5 m* Q$ |7 F) e=========
- L v: W8 v( o+ r) J6 U
0 ~' T7 i1 T7 t% m% j) x' VMethod of detection of the WinICE handler in the int68h (V86)
, _7 o3 P/ O' v& M# ~
9 ~9 r/ c& _3 P( @6 v- l mov ah,43h
5 @9 D- ?8 t9 w int 68h
. A3 @" Z7 H! B. n/ r cmp ax,0F386h
5 f* Z8 Y1 M3 h, v4 |" e/ ^+ r jz SoftICE_Detected
0 w$ Z8 b4 s) A3 J- u U7 h5 A9 e3 k0 M+ b! c2 k; q
" @/ x6 M7 @4 o! u& a) r=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 E) x3 _0 C$ F6 A3 l& z app like this:6 K' t) a" S* a* D
2 `, |+ s4 y4 a% z BPX exec_int if ax==687 U4 g8 F. C: d. A
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ J, w7 s& B6 _ located at [ebp+48h] for 32Bit apps)
% R2 c6 D+ y1 J3 G K__________________________________________________________________________# T2 u. w, k6 {
. g. H. I7 V; T9 W6 h2 w: f
" o) z( j( z" O A1 q/ Y) Y) P" l8 [Method 08
* @* B2 X. a( I1 w" @2 a# ? @' Z G=========9 ~( X4 R h! ?4 G2 y, `- j9 H: `, W
; v0 _" T! m, C6 S% \3 R5 QIt is not a method of detection of SoftICE but a possibility to crash the
9 A# b5 s0 g+ _$ |+ w" f& H7 |% Fsystem by intercepting int 01h and int 03h and redirecting them to another6 t$ _6 H3 F0 y/ ^6 D4 {
routine.. l6 q1 N# g/ f8 @6 w4 [+ n5 Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* U( ^* }6 G. f
to the new routine to execute (hangs computer...)1 M) [6 H1 d/ a0 r
7 D3 D) y- ~7 @) j9 {3 q
mov ah, 25h3 ^; c8 S& e, f
mov al, Int_Number (01h or 03h)
9 ]6 f+ {# b6 [ mov dx, offset New_Int_Routine D+ U) C2 H9 E$ w. C
int 21h
) Y$ \/ u+ w3 x3 ^0 i! m H# m* b# H; N! |0 C5 m
__________________________________________________________________________; t6 C/ U. u/ u$ c z* @
2 f: W5 a& N4 p8 A, T( j# CMethod 09
. a) o( e5 Q$ h; C3 A=========
q" }0 C! r6 z) I& D* B3 G) n' f3 T' b$ q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 Y9 |4 t# E# K" v# m
performed in ring0 (VxD or a ring3 app using the VxdCall).
" v1 m" m9 L8 ^- l0 UThe Get_DDB service is used to determine whether or not a VxD is installed( {8 d- c- p2 r4 Z. @( S% `9 I7 _2 O
for the specified device and returns a Device Description Block (in ecx) for
6 \" h( J( g& \, {2 q0 ythat device if it is installed.
( O2 x/ E" s- J- U2 c5 [( \$ D
; z; a# p2 Z5 M3 m9 u, Z; K mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' _$ `4 M- |. f( ~! Y6 z) N mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; w9 n, v% o7 _. n( G* L. a VMMCall Get_DDB
( \: S8 E+ s9 q1 K mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed/ `8 L* J# y8 r9 [) S( F
9 z% m1 C3 I$ W7 l/ DNote as well that you can easily detect this method with SoftICE:7 Y8 ]4 j5 o% Z3 G) s- j! w2 g5 S% W/ I4 `
bpx Get_DDB if ax==0202 || ax==7a5fh! \& v& V+ e" c
; a: [- Z* v2 N& \2 q
__________________________________________________________________________
4 A& [1 N3 i. ~ q: s2 c! s8 P8 h. X
Method 103 h3 d5 p$ {7 H3 n
========= ~" M$ g: w* s1 d- Q4 l# }/ V0 m4 q
- L% Q" q" `2 s6 M' W+ U% d
=>Disable or clear breakpoints before using this feature. DO NOT trace with
' G9 B1 ~) {1 Z, d" j SoftICE while the option is enable!!1 a9 f9 S9 h/ ^& ?9 @: i. r. p0 d
' z- `. j# L, K
This trick is very efficient:8 j1 I$ G9 W/ N$ Z0 ^7 ]7 G8 h
by checking the Debug Registers, you can detect if SoftICE is loaded
: D: s1 o) p q9 T$ L( V5 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 {6 r0 u* U/ L9 e1 S) E/ jthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, m. B- g( |5 V! W1 [! Jvalue (in ring0 only). Values can be manipulated and or changed as well
6 ^0 h9 K5 r P$ q$ \" U( G8 J(clearing BPMs for instance)& Z. w% \1 t& k9 W, E# L2 f
; a- F9 ?, I1 e$ F& ` ]; Z
__________________________________________________________________________* A" h% U" ?# \: N4 j, O% e
9 M2 d7 u) H$ |+ R7 M8 f- JMethod 111 p I. ?7 J' H9 I' t
=========! \ ~) o8 k; Q! l( f/ R* W
: T/ J4 O; c7 t, a2 ]$ SThis method is most known as 'MeltICE' because it has been freely distributed8 t" u) F- i: N% v- j3 C( X x) z
via www.winfiles.com. However it was first used by NuMega people to allow' L5 A& ?& w2 s1 V$ ~
Symbol Loader to check if SoftICE was active or not (the code is located
+ s" ^+ f* N) F* j$ uinside nmtrans.dll).
" X. q! W, Y+ N; i8 Q
# A/ b; K# Z* pThe way it works is very simple:
6 O( X( f- m/ [: u6 qIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& T! v" C0 n i/ e. w7 ^9 h: V
WinNT) with the CreateFileA API.
7 O" @0 W' h3 h- J) X1 g9 Z y. p% [
' k' J! v: @9 jHere is a sample (checking for 'SICE'):
$ ?. L" w* D1 |# T6 Y) `! d
+ c: E# x. n: P+ l- F2 EBOOL IsSoftIce95Loaded()& d) V; z! b2 Q0 }! _) M5 n
{
7 _% W/ S7 F0 [& b0 B/ J HANDLE hFile; + q7 @% }# @: E! X9 \) L
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 Q, B& }0 _( v# ^ FILE_SHARE_READ | FILE_SHARE_WRITE,$ `( U. H. K/ S* o* m
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ Q- C' o* {8 Q2 j$ A if( hFile != INVALID_HANDLE_VALUE )) B7 I7 e9 O/ b, P! p. h
{4 W) |6 J! ?( m( \
CloseHandle(hFile);
( v; ^4 C6 d. y/ \% I1 @ return TRUE;
# c; o7 d# @1 _5 G; Y6 e4 E1 `. Q } q a4 e" U% }& m6 X8 Z# `
return FALSE;
' O" ^$ x0 e5 D& n& R}
( z" t1 ^( M, n$ K7 `3 C1 d0 N+ U7 R( W2 z4 P" u& P9 C/ S
Although this trick calls the CreateFileA function, don't even expect to be
) T, [1 ?! ?# t% j9 f7 eable to intercept it by installing a IFS hook: it will not work, no way!
* \& g$ T+ q& n) A" LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
# d: `- @! |: G1 K, Uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( c: W, H$ S& \
and then browse the DDB list until it find the VxD and its DDB_Control_Proc" e0 A* r4 K1 o6 k# e( k
field.
8 r8 g# ~1 h1 x: M% g; cIn fact, its purpose is not to load/unload VxDs but only to send a 7 j/ i* _0 A; X( X( E+ T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)% F% V1 w; Q; T9 A5 Y
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 t$ n9 e, G1 Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 ]5 Z+ p9 d+ f) i
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 ~7 h9 D. d# S
its handle to be opened and then, will be detected.! o u' Y4 A( y7 }
You can check that simply by hooking Winice.exe control proc entry point. P% x; N. o! _! f& x5 M7 p# e
while running MeltICE.
$ B0 L% l0 j0 N( U1 ~) K* k0 \/ \% g) ~$ g5 F
# x$ F4 l- x6 [1 S! V: _: E: x8 H 00401067: push 00402025 ; \\.\SICE
; U' q8 J- P7 U1 ?8 m! \ T, ] 0040106C: call CreateFileA7 C. W0 l0 _+ g/ k; l: @0 M
00401071: cmp eax,-001) K0 f3 @) S/ o
00401074: je 004010918 f$ M* M) b* v( P
# s8 s: u6 c/ t1 b
% G6 O: Q9 x/ I5 PThere could be hundreds of BPX you could use to detect this trick.
- v7 X5 G; h9 i-The most classical one is:
5 C! X k% }: ~2 `5 Z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 z/ W5 U( n3 _/ G/ j* g8 M+ V *(esp->4+4)=='NTIC'" b$ \3 {% X2 J" X. x/ [6 `
: e2 h* f) |+ l0 h-The most exotic ones (could be very slooooow :-(& U& w3 t4 @$ ~, \. x0 q% I ^
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 @$ g; {/ J$ M, J ;will break 3 times :-(, |7 U2 r" Q& G9 ^) I" U( \
" [- Q1 b3 d( R, k-or (a bit) faster:
& W6 R9 A3 k* ^4 @7 _* t BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 d* U' t: E7 Y) D7 N
" R, ^* v5 c' i/ s9 T3 ~ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. b/ {, l- ?5 G; z ;will break 3 times :-(
2 _+ p- d4 A0 b( B& u9 |) n- u$ |3 ?, W
-Much faster:/ R" K4 { }/ }# N/ T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'1 L9 [% V' w0 q2 U/ E0 ]" I
. s6 I' @) x; m4 t& s9 k% gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen: Q# D# O1 n0 h4 z7 t
function to do the same job:+ a* z% J5 a9 L. q
& u( S# k7 {* [4 ]
push 00 ; OF_READ
( d, Z, @) @/ h& S5 K: l& a W7 ` mov eax,[00656634] ; '\\.\SICE',0+ y7 a: d+ U' M4 @
push eax. D- y4 a4 {4 N& F# `
call KERNEL32!_lopen. |6 ^) m8 a6 T! t9 a' Y
inc eax
|* |: m, ?* {) D1 n2 D' | jnz 00650589 ; detected
0 y* _( h9 E+ ~$ c, E8 f& x push 00 ; OF_READ
. D, v; D/ @% L- a2 B1 Q mov eax,[00656638] ; '\\.\SICE'
]! _4 f8 ~) e push eax
' _; x( h/ `% D3 @8 U9 Q& ^! h call KERNEL32!_lopen
' ?7 F/ g6 N* o) K- ^4 q inc eax7 x/ `6 w" y0 f& I* J/ \1 S. x
jz 006505ae ; not detected Y1 M2 s5 w3 W* |! w3 c4 v
& h2 b0 e2 A- k$ a
4 A; X x- }1 e/ i" G' O__________________________________________________________________________
. ^- y, g0 g9 R1 r+ M- D
$ i) m0 F0 C" y: S$ i. u7 O9 C/ dMethod 12) @" \( O, E' a, O( e0 D# j
=========
4 `' y9 W0 Y/ B. g& y: Z" M! n( x: x; o5 V+ ?& d
This trick is similar to int41h/4fh Debugger installation check (code 054 G5 p/ ~$ ^8 j& a
& 06) but very limited because it's only available for Win95/98 (not NT)
+ k. F% p; E A. F+ Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.* P# k u! {# z \% s' L# ~
0 o; |; i( R; [0 i t9 `' ]
push 0000004fh ; function 4fh
: w `" E7 Z6 B1 R$ k# f/ ^& @ push 002a002ah ; high word specifies which VxD (VWIN32)
4 r: J5 z' e& X' G5 P ; low word specifies which service
. y& V4 u8 w. I' h2 N0 ` (VWIN32_Int41Dispatch)
6 J+ J* D1 `' A call Kernel32!ORD_001 ; VxdCall
' n' i( @# \" H8 q" q9 x9 H3 F7 S cmp ax, 0f386h ; magic number returned by system debuggers
7 O' T- G: L, W3 I jz SoftICE_detected
6 [% h: [ K% `4 o4 u- T
" \% H& N9 u% F' a% g' XHere again, several ways to detect it:, s8 m U* J7 P% U6 \
4 L; L- G7 g; y. g! i, W BPINT 41 if ax==4f4 h, v6 P3 N- W* z0 c
D0 L3 A5 `% o7 B" N BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) w( b5 m; r- F4 {4 E; g' \, O+ O( g$ B; m- x( J* k: s
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ ^6 ^% t0 @: G/ V9 K. L* |; X6 X
2 R/ H. C& p9 l) ]$ m: \& n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 c* B# F! F: u# N* P& b/ F j. L: c& S# U
__________________________________________________________________________4 D3 Q6 q2 Y: h' e z" a
/ Q' E! `' `% x5 x( X, a7 H
Method 13: a+ a. g: J% X
=========
/ P/ G- X2 A) x2 Q1 e4 U" o4 ~+ H6 R% N7 Y$ c8 A, q0 `/ y5 t0 U
Not a real method of detection, but a good way to know if SoftICE is$ i. p" x6 @3 W" e! H1 S( k
installed on a computer and to locate its installation directory.& M! e! Y. s/ q* M+ G6 z
It is used by few softs which access the following registry keys (usually #2) : Y) o' F' g" C9 V; \
! h' i& x9 R' _# |) [% s-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& o7 [" R' J- K: x3 r& K* p8 o\Uninstall\SoftICE3 p; k' d* I/ Z9 m$ d( T) B8 G
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# b4 [" ?3 j$ h2 P V$ D! z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" k1 l; w8 ]5 b\App Paths\Loader32.Exe9 q& F& c, U+ X5 E) w+ V' H' v
' u7 t4 v4 N+ e8 N4 L6 K+ a+ I
Q% z; l8 i# \$ m
Note that some nasty apps could then erase all files from SoftICE directory
4 q) Y( T1 ^) k(I faced that once :-(9 `/ F, I5 o" [
( ^& Z% Z, \& g9 A9 G7 Y9 S, w* ^# {/ WUseful breakpoint to detect it:- x- `# a2 D3 O0 ]
8 r }+ n- B' O5 t BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# N2 ~- l* B0 }4 q1 g- D
) Y" C! K& k! Q0 U" ~. h! f- t; X& |__________________________________________________________________________
: J* n' P7 q5 M
, h9 H* `( H# C( [: R
) I( }% F" Z! N* ?: f4 _Method 14
5 y( F# q3 x' w, Z1 f=========
! M; x l) Z6 R* v; V
2 |( ~1 U( q; ~9 h, K9 d4 d7 @- RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; c: X5 J; z6 G; @, V
is to determines whether a debugger is running on your system (ring0 only).0 w4 D ?9 r3 l& \% C
- T1 B. n9 z# ]+ ?6 w0 r0 ~3 J
VMMCall Test_Debug_Installed) h; L0 C+ C0 P
je not_installed3 G- \$ v7 k7 S
( W8 v5 R; ^ J- cThis service just checks a flag.' d" _* W2 L$ t) g! h
</PRE></TD></TR></TBODY></TABLE> |