<TABLE width=500># i/ W. [; K# R9 A1 ^, i0 u, Z
<TBODY>0 I' g; i2 f7 b6 ?
<TR>
, \1 y5 E: o# F) ~<TD><PRE>Method 01
* Q6 G5 m- j# l2 `( u3 l6 S=========, m5 J9 J( y! f: ]: s
' {$ [6 ], F( X& u" Y% tThis method of detection of SoftICE (as well as the following one) is. L0 f k' D+ y' c4 B1 K9 T- t
used by the majority of packers/encryptors found on Internet.. [7 A. n; t+ K4 {- n7 j
It seeks the signature of BoundsChecker in SoftICE
0 m6 W7 {# a A$ g( C8 v0 v! ^: U M/ Q. K, O
mov ebp, 04243484Bh ; 'BCHK'6 R6 |# o1 h$ h; ^" E1 e9 M; y' e3 h
mov ax, 04h
6 d( j1 z4 r: _& r$ M int 3
# m( h/ {2 Q2 X: u* R/ K; C cmp al,4
+ i7 x) K3 D7 D% q6 t jnz SoftICE_Detected
- |8 z7 v& u, a) w' Z0 D1 i! u# B# _$ L" d# O. C
___________________________________________________________________________ T' g$ j! J2 ]# v+ N
" h; @) o) x: d( V/ A2 dMethod 02+ H( @. f4 n& `6 Z* t
=========
5 A# v' o V/ N) g t; n- b( k% b& ? _0 h# I4 c: h9 f" G
Still a method very much used (perhaps the most frequent one). It is used) R* \6 `1 d" F2 u: E; O5 ~0 H" Q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,# {8 d7 u' |7 \, }9 C
or execute SoftICE commands...
) t: m8 y0 h2 W/ eIt is also used to crash SoftICE and to force it to execute any commands8 E1 |( {2 t# ^1 U5 S2 w/ z8 k" @+ r
(HBOOT...) :-((
7 j: U5 V6 ^- m8 ^
+ G+ p6 c. F3 E4 M" eHere is a quick description:
7 w, S1 Y" d! `; G( s-AX = 0910h (Display string in SIce windows)* V4 O) \9 I/ t2 [& a
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; x1 B. U, [/ E0 h5 h, j-AX = 0912h (Get breakpoint infos)
- B8 W2 E# ?& t& ], C. v: G* }-AX = 0913h (Set Sice breakpoints)
; Q' N$ V z1 e0 i, G-AX = 0914h (Remove SIce breakoints)) D* L0 u, L B: M
9 D0 ^+ u- l/ T1 h
Each time you'll meet this trick, you'll see:
. i( ]& r% r- u# `8 h0 p-SI = 4647h% k; q, T& S$ w/ b) b: a9 W
-DI = 4A4Dh! ]7 \2 L6 Y, I5 |7 p( N
Which are the 'magic values' used by SoftIce.4 C) S0 o" w% H+ [( H6 g
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.% C! \, v0 |" J" s5 l/ x
9 y1 n4 h( S$ U; y _" b% OHere is one example from the file "Haspinst.exe" which is the dongle HASP
. s F8 }9 V% yEnvelope utility use to protect DOS applications:7 h) ]6 N* E6 U) c3 F4 d8 K9 E
6 g O& v# n& }$ V$ K- c, H% m* Z) |4 D2 S" \+ P( E& [
4C19:0095 MOV AX,0911 ; execute command.
2 O5 x# I6 B2 a. @5 c* r/ _4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# B0 ^. |! j) T+ C* e4C19:009A MOV SI,4647 ; 1st magic value.
. d e+ s/ e1 V$ a- k& ^4C19:009D MOV DI,4A4D ; 2nd magic value.
) r! s) T! k3 j* `4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) h! o2 L' x( U7 o; T
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" y: d- _! n7 P4C19:00A4 INC CX
7 [' p+ p+ |: `2 `' K5 d$ p5 G4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 P9 b' u1 G- E* o7 P4C19:00A8 JB 0095 ; 6 different commands.1 s; w+ v1 i2 ]4 a
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 c( D0 R }/ v9 D/ m2 O
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% T9 c- ]$ K8 u* d8 l' Q; N
* Y5 I' U7 {. u- N# w: B
The program will execute 6 different SIce commands located at ds:dx, which$ M' b( g3 z6 R$ Y0 x. ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' ^% |, u2 V4 [. J/ a
$ M0 K% | o2 w$ }+ x' l* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 f6 K4 ?! G7 c% u5 C' ~
___________________________________________________________________________3 u, H: ]- A+ _3 D: }1 q
: a7 W$ ?- z: R, a, x* V1 {9 r" ?+ x. N# h* s; E/ {2 u
Method 03
( P, c9 N1 T# N& O9 N========= _5 l0 K1 l, r6 y
$ @! m4 m0 C/ j& V( \9 \; rLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 T( ~% ^. E8 ^% ^3 g(API Get entry point)3 |. i0 a: K) g5 q p% X
/ X4 ^' @7 b4 h' k, y: k$ F* z. h6 r- @2 ?9 v5 A
xor di,di
9 a0 G; ~# q. G: E, e mov es,di/ Z2 e% }6 L9 v+ v# w7 ]! E
mov ax, 1684h / U" {6 L( p6 L4 i
mov bx, 0202h ; VxD ID of winice
# W3 X$ V" i/ E; C- A int 2Fh
P% f& O! Q" R6 z- X+ a mov ax, es ; ES:DI -> VxD API entry point, \4 k. h3 z/ F4 ^- g
add ax, di
1 @7 K% E1 R2 e; C, n# D test ax,ax
5 R) p0 T3 D/ ? jnz SoftICE_Detected! i! o& R( R {, v$ h% j
R6 u6 p# J) m: q" V& B w3 \' @
___________________________________________________________________________& [3 I* h7 o2 _) J) |) E- q- B# T
- S% ]& s" Q) X6 _# i
Method 04
1 u: J# Y1 h+ X/ Y! Y=========
* w# \ j$ C# G, I. D7 f" ~
% K$ n" B. o8 jMethod identical to the preceding one except that it seeks the ID of SoftICE
0 ?' M, F" e! _5 V* C* V9 w- H8 HGFX VxD.0 t. j$ H$ \/ }6 R& B/ V4 n
" h# J' o) `* z: l
xor di,di w7 d) @# ?) ?) G/ C+ h( Y
mov es,di/ d, v# W) I' [. J
mov ax, 1684h 2 b9 D/ @" v, J q
mov bx, 7a5Fh ; VxD ID of SIWVID
1 L: U$ U' }6 H7 N D* S1 o2 f int 2fh
5 C! r% W& \) Q d mov ax, es ; ES:DI -> VxD API entry point
: r3 Y/ G7 b. `* }4 X add ax, di o2 ]2 {( x3 {4 B
test ax,ax
' x6 a( e9 a+ ~1 j+ s0 E5 u# ~$ | jnz SoftICE_Detected
# }& G3 `. g* O: g
$ B/ c1 }2 C+ U3 D) d" E! }9 d8 s, z__________________________________________________________________________' J3 t( M" ?* R& u; f
* P# p( D' I: `( z3 B C8 E) ?* |) c* o1 i7 s2 ~7 Y
Method 05) f7 K5 P0 e5 [4 B0 v
=========
7 p& G* ]8 M+ R% B/ ?0 @8 K
4 b2 _6 C5 Y4 ?9 dMethod seeking the 'magic number' 0F386h returned (in ax) by all system- E7 h7 j$ [! o, c/ f! s8 F
debugger. It calls the int 41h, function 4Fh.
" [7 ^: A& E5 L$ m9 p: JThere are several alternatives.
! L' W; r& S! {' v2 x; M4 y# q
- v& \' H# c/ d$ _! }9 X: NThe following one is the simplest:9 D: |8 r2 F8 Y3 G- g" b' o
7 ~9 ~" x/ Z3 | mov ax,4fh$ {4 a; Q; w! u. A# o7 e* p
int 41h& x. F% |: y. v1 k/ f) C% y# A
cmp ax, 0F386# T v1 H8 {+ K1 K8 x7 ^
jz SoftICE_detected
; w( W! m/ R" h
) Y, H" [% h5 P# A D6 F- x, v/ F+ {
Next method as well as the following one are 2 examples from Stone's + |5 v X$ c7 g
"stn-wid.zip" (www.cracking.net):6 }. |! E" C* |& a7 g0 Y6 x5 l
; R8 `7 S/ H0 p! l/ X) d
mov bx, cs
* Y! ~. B9 w4 x" X s lea dx, int41handler2
+ B1 v1 j X& D xchg dx, es:[41h*4]$ u3 Y: b7 B9 M) W: [( k: s
xchg bx, es:[41h*4+2]
9 ^/ S0 l) N5 W$ a' m mov ax,4fh8 ]+ Y3 S X, S% Y/ M# M6 W
int 41h1 T9 Q ?: b) Q. ~
xchg dx, es:[41h*4]1 M/ q4 p0 e2 Y1 N/ \
xchg bx, es:[41h*4+2]
4 X! _& S2 J5 _, g* }; n+ f0 B! c cmp ax, 0f386h- d. a, S) [* }
jz SoftICE_detected
- q# A# o% Q& V# Q. ~
! K( o& o5 I4 b/ Qint41handler2 PROC j, q' P) m9 w! ^* t1 F
iret* v1 n: E( g7 `
int41handler2 ENDP
/ w; p: R' s: r" D. q" c- J0 m/ i- X- }/ ]* L& U8 t' g
& Z, f, O5 t' P& M4 o_________________________________________________________________________
# N" b( L4 F0 f
9 g2 r5 a! S% I- s1 S
6 t% x& z7 a' }# }# d5 w! pMethod 062 Y& V6 x% o* c% Y6 I+ b- H* D# }
=========7 z" d/ L& k! ]' ]
/ N# k5 s" O& i5 [9 \4 ]# u* ?# h( |9 X0 ]2 E, H7 I, G
2nd method similar to the preceding one but more difficult to detect:
& z& z8 v8 S5 y, J0 ^
: ?7 A: x5 I0 W* K& b- L* i# F5 {# E+ `, B; c$ k
int41handler PROC# |# ?- R1 y6 M4 L/ A
mov cl,al; d$ }3 x0 V, @) C. L1 I/ Y) C! b
iret
8 m A: ^) c/ Z! b+ Rint41handler ENDP/ C" |' v, G1 v7 F2 Z9 n, B
& p+ y- W5 I7 R. ?! E
1 \* [1 q! q: p4 {3 y& M1 t xor ax,ax
9 i8 B {, v+ C" | mov es,ax
. t% i8 n4 q6 p. D2 p) B8 C mov bx, cs6 ?/ ?( l) J% R) B
lea dx, int41handler
; \1 v) x: M" y5 H xchg dx, es:[41h*4]
1 h2 q2 s& O% ]$ Z; A+ i2 p7 p, u xchg bx, es:[41h*4+2]
, |' u5 v0 S" O: e in al, 40h4 E# r5 w* M1 [1 V) V
xor cx,cx/ t6 }; r" V5 k' y
int 41h9 D, a1 d+ Y8 m! }5 I' A& @, S
xchg dx, es:[41h*4]6 t2 B2 l' J% l6 C
xchg bx, es:[41h*4+2]
+ f" w. W# p) K8 u V cmp cl,al+ V5 m! P% B9 I9 ~+ M# O
jnz SoftICE_detected+ O* `( ?8 |" \" V) _" Y
$ x6 g% {; K2 T8 ]0 m/ t_________________________________________________________________________) N9 W: C2 a+ i5 I$ L- I; h" X
6 b9 W7 a! H( O3 I+ Z+ L' {
Method 074 z% w% Z% ]- U9 G
=========1 _8 r# j1 g; W8 E7 l# D
% ^+ v: I% s* d2 G( sMethod of detection of the WinICE handler in the int68h (V86): o1 b2 ~5 k3 ^& g: V8 F
! Z$ V& Q" T& }* \/ P/ n mov ah,43h
) ]+ \; p% w/ b* q8 h" Z( T int 68h" W: D) e1 C( L' k. }
cmp ax,0F386h. w5 B" Y6 L( G0 x4 _
jz SoftICE_Detected9 [: `/ a7 _/ n" u: p' v
. y" ?# _ X: q7 B
0 [- L/ R- a# E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ F& f& A: R, E" K2 y7 a2 B" \
app like this:
8 c/ w/ q3 U: A' |0 V$ s$ R+ p& A) R5 E& K
BPX exec_int if ax==684 i2 W8 p$ @6 Z6 q4 @5 l
(function called is located at byte ptr [ebp+1Dh] and client eip is1 V! ~9 k. P! P) g+ l# n
located at [ebp+48h] for 32Bit apps)+ h6 _% S Q( j( S5 h
__________________________________________________________________________2 Z# X2 E9 i1 L) l# f
; \5 U2 a8 b$ h; @
" n: B, Q Z9 c7 QMethod 08
- W) y- f8 O" n3 K6 `=========. z1 H( J2 C% L4 U2 u3 u
9 N `" y/ N0 I Y7 M$ n
It is not a method of detection of SoftICE but a possibility to crash the
! [3 t" ~+ i9 Z( `: u9 @1 q3 C$ Bsystem by intercepting int 01h and int 03h and redirecting them to another
0 w2 G) p5 {) Z( Qroutine.
$ U6 r, E S9 w6 \* v4 {- ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
/ i0 e4 Y V8 R( {7 J& w5 N% G# M+ zto the new routine to execute (hangs computer...)$ c$ E0 V3 R8 |7 M9 r$ a8 w' s2 j
: R5 e* T6 c3 X' T0 S: o
mov ah, 25h. a8 l4 u: p% K( F7 ~9 ~6 [
mov al, Int_Number (01h or 03h)3 d0 A+ d" V: C$ ~2 W0 ~
mov dx, offset New_Int_Routine
; z; k2 F, I: P: o0 Q5 U int 21h
" m1 x# @& \& v" d/ W, d
6 i0 P: ]! r. Y# H4 v% b' |- ___________________________________________________________________________
2 a. Q R. B+ z7 h* o1 ^0 J. k
5 _; w# X! J% K0 A5 W) }Method 09+ O J3 s5 s1 S2 y1 }2 s
=========
. `. g" ^3 c) g' N6 m3 ^* E' ~9 \/ q( _8 ^$ l+ ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 E( |/ w- ` [
performed in ring0 (VxD or a ring3 app using the VxdCall)., b, t& ~0 t$ z/ i+ \7 n' {; U
The Get_DDB service is used to determine whether or not a VxD is installed3 m1 A% a6 p# R
for the specified device and returns a Device Description Block (in ecx) for( p+ m( G w9 |) ?, f+ _9 Z. r' T
that device if it is installed.) {- o6 o5 y' V, B/ B( e
0 R- T, a9 k6 y3 H& ]% a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" c9 y0 w4 A* L& M3 c: L, r
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 ~2 C; k! s# M8 [+ |, j% L
VMMCall Get_DDB9 V% O# B! {5 F2 X
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 I, f& U* X; }- @' U6 u7 v# S8 {6 l0 _) R3 y
Note as well that you can easily detect this method with SoftICE:
6 X6 I, x1 k( e; @+ @7 M% p bpx Get_DDB if ax==0202 || ax==7a5fh7 o7 w* k$ C0 f! H
) T! ]2 G. D$ s' C7 d- ?__________________________________________________________________________
# K8 X" U, p5 @$ E: {. n4 u5 P) |3 u, Q9 f
Method 10
) q1 y# i4 G7 t( F! `% L=========5 `/ L4 A2 f' \: Z, A
) _% ^& o1 u Z' @2 O. V=>Disable or clear breakpoints before using this feature. DO NOT trace with
; Q- Y9 H* t1 x8 D1 f1 J SoftICE while the option is enable!!
+ x( E. K' H% h' ~9 I& q6 X& H- c9 Y! V: s6 b
This trick is very efficient:) s) W3 } D- S d
by checking the Debug Registers, you can detect if SoftICE is loaded3 N r, n$ Q3 n T/ \
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& y2 ~& M, X. e1 X) {: W: m* Sthere are some memory breakpoints set (dr0 to dr3) simply by reading their: s7 k" I- Z0 u) v
value (in ring0 only). Values can be manipulated and or changed as well
9 e9 o# i9 ]! Z7 X0 o(clearing BPMs for instance)' E6 E4 Y; |6 u$ A5 F% h- ~! w U
5 L. b3 |/ Y$ i- p__________________________________________________________________________+ q# v' P3 `0 k: R
* y( f4 ^6 j- G" \Method 11
' Z6 k8 Y0 I, X" X/ k=========4 a+ c9 y& ]- C4 w4 H
& A% g* F1 ~( _4 L! O( K: cThis method is most known as 'MeltICE' because it has been freely distributed, H: X6 v; {& \' k) a! _" ?
via www.winfiles.com. However it was first used by NuMega people to allow
- z2 Y' O# h8 L# P/ oSymbol Loader to check if SoftICE was active or not (the code is located/ s0 N1 ~ p% L, }5 t: w/ B
inside nmtrans.dll).
; D# }5 _- d$ P( w1 {8 B
# D' T8 j0 L) ~9 N- R/ o4 }The way it works is very simple:
$ W$ j% ]: h, h# D. iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 \8 Q+ m) A2 E3 `+ iWinNT) with the CreateFileA API.) T# l; ` x8 v! ?3 t& l) @
6 w4 K8 a" [% Q# ]8 r4 o3 Y
Here is a sample (checking for 'SICE'):
, @9 E+ h& j" a- ]2 W
' T& L2 V3 `/ y* M8 EBOOL IsSoftIce95Loaded()
0 H9 K, a$ o6 J{
- g: u' J3 ?$ j- { HANDLE hFile;
4 U+ h( Y/ h& o" Z hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 J+ l! D/ `7 b9 |( F9 g) ]
FILE_SHARE_READ | FILE_SHARE_WRITE,$ ]+ ~6 g I1 X8 N. g7 D
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ U7 e, d: u; B2 X# Y1 x if( hFile != INVALID_HANDLE_VALUE )
. g% F# M& a3 e! m5 \( S {
0 ~& A0 U" o D% H# B# A: W CloseHandle(hFile);2 p2 c+ r) e; W7 F8 r& C. E
return TRUE;+ e9 x/ |. J9 ~7 f7 V* Y6 H
}! O( X! N$ W+ |
return FALSE;( G1 J- Z4 L, |8 D
}
b% s% ]3 o8 q, m& v# d5 l9 [9 R$ C4 Z0 q7 S6 M! X/ y! S# L
Although this trick calls the CreateFileA function, don't even expect to be
7 w. @" S5 V6 V2 q6 Hable to intercept it by installing a IFS hook: it will not work, no way!) F+ L: |+ i8 w; z3 P
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
; D" }% s- F- O! ^; D& yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! ?1 P* B+ ~2 L3 J! ~( zand then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 c- w, h) W6 ?# Kfield.% n, T0 \; G' P* t0 h
In fact, its purpose is not to load/unload VxDs but only to send a
9 r/ O1 M5 x5 c( f% A0 pW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" [1 o) q+ L/ {; p0 \to the VxD Control_Dispatch proc (how the hell a shareware soft could try( B* o! h0 ?( i0 ?; A8 a7 B
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
" |/ L: E4 `, v, d5 o: F- KIf the VxD is loaded, it will always clear eax and the Carry flag to allow
8 c( L g. I' |" t3 i- }its handle to be opened and then, will be detected.
+ X" [- C' T4 E# H! A* `You can check that simply by hooking Winice.exe control proc entry point
% B2 ]& [; I% ?0 g' t# z! l3 Owhile running MeltICE.
6 c/ Z( D1 f, [/ C7 ~( b9 j \0 r$ H. v2 N- J" J
* y0 ^0 J: x7 m& d$ h! [. k- q( q
00401067: push 00402025 ; \\.\SICE/ l1 X" z: `/ }& v) @2 }
0040106C: call CreateFileA! f* c) ~( J/ ~3 X8 T* B4 E
00401071: cmp eax,-001
2 r2 y7 e3 Q" R9 l- @ 00401074: je 00401091
8 ~' U9 R. l- `* t8 K3 q. \* ]' E, H
7 N2 D1 r3 i( c$ S) tThere could be hundreds of BPX you could use to detect this trick.
. E, S4 F/ c" p) a0 u% \6 t. h- K-The most classical one is:
! _6 ?* T/ W# M4 Y BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||& J `- r W- ^2 u* A/ j5 q7 r
*(esp->4+4)=='NTIC'9 a' {- T; I6 u C
, ~ T7 M" W z# f* ?' D-The most exotic ones (could be very slooooow :-(2 ~, I9 V( T$ c- r
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( q. i, e2 o1 i# H ;will break 3 times :-(4 h$ ? I7 a8 h, c3 @7 p/ h
. ?1 T; `+ L& e/ F) n( d-or (a bit) faster:
- e3 ~4 J8 w) g" a BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- ]8 o9 e& m& E* H! y: h( A9 B Q8 A) ~8 T# `* w4 b+ W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 |; `! q! G0 i) v' L+ }8 y
;will break 3 times :-(! |2 U; K7 d3 E+ L# K* T% d8 P
2 g C, m" w$ z! L6 n-Much faster:
. X+ x* N' h8 \ J: A/ ` BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) c. C* \% S- _% M! _5 Z2 j
8 i" B5 @2 K$ T V- U+ SNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 e* x0 c* Y( cfunction to do the same job:8 ?5 I( ^+ [$ f4 s
7 W* l) a4 `/ X3 g: A8 r6 d" v$ J
push 00 ; OF_READ
/ B; q7 }0 j; [ mov eax,[00656634] ; '\\.\SICE',0; i$ B% R; S( W7 S2 r8 ?& i- Q
push eax
6 B; }: i2 a0 j3 U call KERNEL32!_lopen4 w" }; [4 O4 m( f6 z8 _
inc eax
' ]: d* H6 z' t* R) w jnz 00650589 ; detected
& @# \* E) \; C2 t( e( n( @9 r push 00 ; OF_READ
- o: x2 G# s, X mov eax,[00656638] ; '\\.\SICE'
7 e1 F7 d* p4 J( I1 z4 O0 L push eax0 l3 {0 G4 z# V* i. B9 k
call KERNEL32!_lopen9 ~( W& ^6 a' q" {4 A1 Q
inc eax
2 p; X3 C/ f4 D/ t! ?% r jz 006505ae ; not detected
: D+ v! ], H( p; I% O9 j6 d8 d$ z8 `4 K6 l0 j. v! Y
1 \- q; I& T3 b* }__________________________________________________________________________
! C. z* R( H$ @) F, B o7 p8 F
/ d, k2 w0 r; C$ U9 hMethod 127 i: p0 T: K6 d$ T, b' v
=========
$ [; @8 w# k* O( i! M& b* {
! S; S8 I6 {$ W: F7 oThis trick is similar to int41h/4fh Debugger installation check (code 05# y8 T6 |% D4 O4 t+ X2 L$ w% w
& 06) but very limited because it's only available for Win95/98 (not NT)6 N7 g6 ?7 S# a2 v
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ H# r5 c/ x' h* C0 Z- D, A) J _. R' d% w# k
push 0000004fh ; function 4fh
" b+ l: T- n, |$ S" g4 d! \ push 002a002ah ; high word specifies which VxD (VWIN32)# a; \5 @) c/ d4 K2 J8 y% B, X
; low word specifies which service! N$ L1 @( Y0 H- ^
(VWIN32_Int41Dispatch)9 N1 Y1 T+ a; {6 o' H
call Kernel32!ORD_001 ; VxdCall
7 e9 `2 x4 B; | cmp ax, 0f386h ; magic number returned by system debuggers$ A) S4 z! q/ @% }) C6 c$ h
jz SoftICE_detected* w% t4 L$ R7 ]' e
0 _+ p k' N; P0 b
Here again, several ways to detect it:5 Y: q1 {1 s( F# m2 Q( H. q
/ a" S+ T: F. F; j3 @1 H
BPINT 41 if ax==4f8 b; W: [- a7 Z5 B0 A1 A8 ~
/ L7 U" q5 u3 F' e: h+ n, {% E. n BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 b6 w7 l- t2 `2 p2 F
1 a2 H2 H: |, f( \ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' P c) A2 H5 M" E6 ~* _; l! l! ~, _) N! I% O, ~( _% V1 |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 y6 m: ]% }2 i4 f/ d7 o
0 p( d" @4 w$ B: [5 @% L: L4 l5 j__________________________________________________________________________
9 m2 x0 G" n( @1 x1 W( H
+ @% y9 t4 U4 \) g: f3 cMethod 13( p. |8 K2 y& O8 `5 s. W" k
=========
! O; ?$ o: ~% I. l) h
; y' |! V3 @3 ] p$ ONot a real method of detection, but a good way to know if SoftICE is
4 ~( r3 H2 X2 E+ I+ D* @installed on a computer and to locate its installation directory.4 ~! ]4 Q1 p7 h( w9 [3 J8 _
It is used by few softs which access the following registry keys (usually #2) :: R4 r! [" K+ H8 y
, _4 G: F2 y5 b8 ]3 d
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 K& r3 w, }$ k! E% F
\Uninstall\SoftICE
# z: U; M4 r% G' V: [4 D-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 F; {4 Z, Q" w# S6 z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" e% T- `8 R* z' `- R\App Paths\Loader32.Exe
) V5 s; A4 k0 d" U/ S% [
) j: U. d4 F, P# v$ _% V' A+ y, v5 Z: e) G, z$ p) V( Q
Note that some nasty apps could then erase all files from SoftICE directory4 v" y4 i7 e" H1 @
(I faced that once :-(
4 [1 {. E. @& Z5 |; s: z
2 H, {% R& K2 AUseful breakpoint to detect it:7 e" z4 u) b) v
3 u! e/ _: e" ~9 ?" x" S6 N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'* \9 \& W9 Y7 @! ?' s
% W0 q, [6 I" M/ D" `
__________________________________________________________________________5 y3 u; T% K2 N
- W- Y- b5 [2 K) e, a0 q' Z
8 a6 y4 d9 R, |$ yMethod 14 2 t# j0 v; b- v
=========! q( W4 o) \' W5 t
# ?( K3 `* x8 l) b2 w/ e- w( }
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% c, S6 a( K+ z3 b% m( T4 A. [2 wis to determines whether a debugger is running on your system (ring0 only).. W# V$ @+ ? J1 ?& [
7 x; S' [# ]* M9 Z0 l VMMCall Test_Debug_Installed
3 s/ {7 A; {* Y) g5 v5 u! p je not_installed
+ e2 Z- c8 Z# v0 ?% l b2 p- ^+ W! Y* [2 E
This service just checks a flag.
6 x6 n. ?9 }# A3 _3 j</PRE></TD></TR></TBODY></TABLE> |