<TABLE width=500>, Q$ F0 z ~2 k+ ]% s) C
<TBODY>3 d( S' l& P0 |% l
<TR>* k( D1 T1 J( S
<TD><PRE>Method 01
1 G5 o0 y, s+ s4 ~) L, Q4 G=========
8 V) w' h2 M: a1 L
6 j; e3 N/ X! gThis method of detection of SoftICE (as well as the following one) is( L& H# [! z! k) L
used by the majority of packers/encryptors found on Internet.0 P) y' H4 l% G7 v( ^ a. i/ T
It seeks the signature of BoundsChecker in SoftICE
* K* i" f& @( C0 X' f! o" O8 A; {% J' }6 F
mov ebp, 04243484Bh ; 'BCHK'
9 l) g$ T* q' _6 P. q mov ax, 04h
7 ]1 P: d' q' f- ` int 3
0 J) ~, a/ k2 Y/ Z cmp al,4
+ U) K n+ W. _- a& x9 g' E jnz SoftICE_Detected
8 K* x# T* ]% A* d
8 k, f* S2 r1 l/ p& {' D___________________________________________________________________________* u* L. |3 n8 [% E7 q8 b4 y
9 d! e7 U; R# T% K1 O1 e/ mMethod 02
$ S# f, F1 L* e# W$ i8 R" b=========0 Y) x/ M, y: n; _7 A
" E# y. e! y( ?# ^* {* k1 \. j' @% V% z
Still a method very much used (perhaps the most frequent one). It is used3 v& h; r* F6 m7 h Y( V
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
# z; |/ V( {, I. Tor execute SoftICE commands... d7 ~: y c/ O0 _& H
It is also used to crash SoftICE and to force it to execute any commands
2 h' {# A) K2 K. o4 `(HBOOT...) :-(( : V) F2 B3 i1 A2 R6 z- h8 }; ?1 A4 {
: G+ K, U6 f$ D1 ?" T
Here is a quick description:
8 Q- G" K) b1 h, Q-AX = 0910h (Display string in SIce windows)
; B6 c3 x8 N& V% \+ l. H2 g-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)9 \3 e6 Z4 x8 ^ b/ e+ C- k
-AX = 0912h (Get breakpoint infos)5 z ~9 y3 ^" ^" r; y7 A! G
-AX = 0913h (Set Sice breakpoints)
' l& J# ?" {% W4 e5 E+ \, Z9 g! [ X-AX = 0914h (Remove SIce breakoints)3 j1 Q, _# D$ n. @1 l
4 p0 v' a: n$ I, z" h5 H! X5 J( m- pEach time you'll meet this trick, you'll see:
* A, [9 F8 L; M& U# E- s# @2 o-SI = 4647h
4 Z0 X9 m# h2 n) U. v4 y9 }/ j7 f# e! x-DI = 4A4Dh
& Y4 Z2 u, N4 k- _& r3 F6 I8 }Which are the 'magic values' used by SoftIce.& i5 q' o* d7 j# M7 n! d0 }
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& G; A. T5 y, [$ d
" s) i# k4 A" @ Z$ t8 n9 F0 e1 GHere is one example from the file "Haspinst.exe" which is the dongle HASP
& Y! v: T5 c% B% e. ?Envelope utility use to protect DOS applications:
Q. B1 V3 h2 {
0 g# o3 {8 |$ I+ L7 n+ A
! J8 h$ v+ _" x/ W+ T6 e7 l4C19:0095 MOV AX,0911 ; execute command.* z& f d8 M- N5 g: [
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 S( G( @# O/ Z0 y' T# G
4C19:009A MOV SI,4647 ; 1st magic value.* M ~" W: Z ?4 b9 v$ _6 x
4C19:009D MOV DI,4A4D ; 2nd magic value." v4 c4 v% T" _
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) }/ [! u, T# _* v3 `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) h" z$ ^- S9 ~1 d V5 `
4C19:00A4 INC CX
" S' D# ]# s* H& |7 M4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
% Y- S2 i- F3 h1 j& e9 O" {6 _: A4C19:00A8 JB 0095 ; 6 different commands. H5 d5 W$ Y: P6 |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.0 p: J9 W3 p, f5 Z0 |
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( i9 s6 g) j9 q1 x) |1 L: I, ^' w0 t5 y) v) q: Q
The program will execute 6 different SIce commands located at ds:dx, which: i1 @$ x! R9 G2 H7 ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." Z4 U1 v! o0 I2 a. U3 Q1 w! W
$ {3 K. `; ]$ d0 |- Y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) f: |4 v2 W/ }6 t* T: M8 t___________________________________________________________________________
9 W8 i6 e% d* r( y
+ N3 a1 a1 ^+ Q" k" y' ~5 H# G- _/ j8 v: V. L( X* d$ a; L5 j
Method 034 o- N' Z. G9 l3 L# m! q; `
=========3 H t0 v! ~- V9 ?: L. K: S/ u
, U1 h" `# Z8 ]1 f. q* x
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& d: v3 @! a6 _. d2 E, P7 [(API Get entry point)
9 L4 T9 H" B1 p7 q1 R) N6 f ; i3 \& ?2 O5 v3 {( T
6 I( S% F; ^2 s' i. t
xor di,di9 z( B' D" W% w" `
mov es,di. F3 I Y" Q8 L" h$ E
mov ax, 1684h & C. H+ a& Y6 n. |
mov bx, 0202h ; VxD ID of winice+ {- |0 b& T" J" Z |
int 2Fh% l9 T! e% \6 J$ S& Z; F- v
mov ax, es ; ES:DI -> VxD API entry point: W+ L' @. [, |( Z
add ax, di
; j2 l( ^& m0 \4 A+ R4 o test ax,ax, v+ y) Y8 E* C
jnz SoftICE_Detected" a' S: [5 Z' T; z3 t& V
; s+ l0 }; P1 ^
___________________________________________________________________________
; C1 u. u z2 W- M2 r: L! h
3 V x4 Y F& p0 z* ^6 {9 `1 cMethod 04
" `. J; ^9 F1 q6 H, R. _0 H=========7 k4 q3 i" F) ~/ B) j
1 s/ P2 }' |5 f+ ]6 \' [) \- yMethod identical to the preceding one except that it seeks the ID of SoftICE
; u. Q, M- q1 u T1 S1 r0 iGFX VxD.+ @: \2 \3 [9 g" O* j. F( V: \
) g9 E/ ~: _1 `8 `1 v6 k3 M
xor di,di: `# n# }3 m* |: b: J/ |
mov es,di
$ q9 ~; o" J$ L$ v8 U z! ^9 z mov ax, 1684h
- [1 h R( S# `' ` mov bx, 7a5Fh ; VxD ID of SIWVID
* `* L9 j1 _( d7 [& j! z! m- H int 2fh
$ {9 ^1 @3 A" @, K( e0 G mov ax, es ; ES:DI -> VxD API entry point5 j$ J: b8 ?' \' s) F! W' P! d
add ax, di/ l4 L. v2 ?5 K0 |9 R* ?
test ax,ax( D ~" O4 [9 v' n9 L
jnz SoftICE_Detected
1 @2 ^! R7 c( x
8 q3 w7 Q9 y3 D( c4 ~- [__________________________________________________________________________
' @! F( W) Q4 B, ^9 n& L$ p$ e, j* t! p+ |4 Z/ i6 s+ l3 |
5 z* x7 I/ S% d
Method 05% c/ e" [$ R6 Q/ ^" j6 }
=========
: F7 s% I, ]- \' t
6 i7 I# w/ A: y% C8 dMethod seeking the 'magic number' 0F386h returned (in ax) by all system; U" A+ x( t) d
debugger. It calls the int 41h, function 4Fh.% J2 S3 l2 B* C0 H0 k3 ~& K$ ]
There are several alternatives. 7 j5 k: J7 A- ^+ |4 A7 w- D0 u
+ S/ B' v7 ]. t \
The following one is the simplest:, e: Y; ~& U& O* i1 w1 c4 W s
; F/ n# K( R: R mov ax,4fh- T2 J! u& ^, s" z' e
int 41h
# ~5 A& y n6 \' \$ N cmp ax, 0F3864 ]( Q, j- t* e1 }
jz SoftICE_detected
0 \$ Z( d- ^2 D" Y' u9 W5 J! x
, `) L& e' F n$ v- k
/ C$ F& s/ i2 }& R ~: WNext method as well as the following one are 2 examples from Stone's
/ _1 X8 m5 ^' l: E" E7 t"stn-wid.zip" (www.cracking.net):7 j! Y2 \' L' ^) N% L- N
) G: D3 g4 U) s w5 R- E4 @ mov bx, cs# {7 g% H2 H4 p. _4 { f/ q W
lea dx, int41handler2' Z2 n8 Y; `. i& D0 P
xchg dx, es:[41h*4]1 g6 H2 }# z5 o$ F" A' D/ H# e+ X
xchg bx, es:[41h*4+2]7 j4 W+ O! x" A
mov ax,4fh
; k" h$ ] `1 U4 ^ int 41h* c, O: c: U3 U0 J( R8 F! k4 D
xchg dx, es:[41h*4]! R) r' J {4 Y J& [
xchg bx, es:[41h*4+2]
9 _: R* [& U$ r L# l cmp ax, 0f386h, }4 \( g2 B }5 _$ V8 A
jz SoftICE_detected, w5 b4 g- n) e) H; T H: ]3 i! f
- H; Y3 z: a4 J3 u8 j v
int41handler2 PROC
' z8 m) I. Y# O$ n iret" H K: m+ @2 p: ~, ^/ X
int41handler2 ENDP
- L* |( G0 i ]5 V; Y7 `3 |: p1 v; h# j) }( w z
4 n! f8 Q. V+ E/ L2 [$ Z3 ]
_________________________________________________________________________
3 D! f( e* R. _& z. X- m7 q" A, R8 K6 ^* B6 ^
3 I! N7 Q! S' `4 @$ K+ eMethod 064 K3 l# k: v3 R5 c
=========
/ _5 b' D6 e4 L4 P3 i9 }" h3 R
2 u; v( R; `1 `, z% k4 @
0 K# Z2 I9 }9 `2nd method similar to the preceding one but more difficult to detect:
/ U! f) A* U+ [% W' I. r2 Q" q1 p2 i/ k, Q+ m6 R# F- e8 F
0 {8 r, s* |* u' U* hint41handler PROC: p( ]4 z3 U3 X0 T
mov cl,al
k+ X8 U+ Q& G; O T' F4 _. W iret
* A- V! w p) lint41handler ENDP. G f. D" z: ?7 l
n, a' W. ~7 K p! i5 z
, _ z. T" K0 y5 k! b0 i9 A xor ax,ax
' E9 y3 ]$ k/ _7 } mov es,ax
+ l) q& f E* } S k mov bx, cs
( x L/ n+ X. F% G2 h lea dx, int41handler5 f6 _" w% i1 i( {- v( p. a8 c$ O
xchg dx, es:[41h*4]
~6 V% _, ~) w+ B1 X xchg bx, es:[41h*4+2]! O6 q& x: A' C8 C8 B
in al, 40h! e3 D h! b/ y4 o
xor cx,cx
, X( d Q W2 g: U9 I9 e int 41h g. M- B( V1 E( U$ x
xchg dx, es:[41h*4]
; q' x" V2 J" L- m9 V* \ xchg bx, es:[41h*4+2]
. u. C& \6 C- {" r) T4 d& u cmp cl,al
* ?3 [$ {# R6 [/ k( A2 g jnz SoftICE_detected3 o- j2 [1 y% A
8 p6 B1 ]" {7 ~( ?_________________________________________________________________________6 b# y5 Z# Z& y/ c
! O* E+ p. x2 B: _# f- K: N
Method 07: ]( d+ q. b, Q/ {/ R+ X
=========
! v8 e9 S- F4 C6 e% Y+ A% q
. T% f7 {# y: M0 Q* e: [Method of detection of the WinICE handler in the int68h (V86)
- c2 O' c8 B6 k& }9 y' u" U8 A
/ w$ j6 g Z- D; \8 m* B+ ] ~ mov ah,43h5 H6 c2 r/ @* `5 @; b
int 68h0 q G6 p( v5 E7 L' U/ q
cmp ax,0F386h# W; H( d' o8 ?5 O, T
jz SoftICE_Detected8 ]0 w x' z1 n" [+ r9 a- `5 v
7 V N: I( p' O
3 H' K @9 D7 J=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& @. P/ x: p6 ^* g% O' S app like this:% w5 z4 u% f' Z
- Z% |8 g6 N& {$ V5 o8 c0 E BPX exec_int if ax==68
& N) _, i* s1 W1 q5 V* I (function called is located at byte ptr [ebp+1Dh] and client eip is1 H7 m& | x' q, a
located at [ebp+48h] for 32Bit apps)
# M, s4 Q8 g* k__________________________________________________________________________
0 k1 J4 s1 \: a2 O; E' ] O1 |, j
* Z) O- U5 R+ g2 r. b8 ~- C0 k+ M; p+ J6 ]+ i+ O7 n g
Method 08
5 k6 N" S1 a& _0 s5 O6 _=========. H2 z& w2 a: S$ P0 ?; `) ] t
/ I4 V/ S5 u. w- h
It is not a method of detection of SoftICE but a possibility to crash the2 `3 E6 n- w. T! e) G9 m
system by intercepting int 01h and int 03h and redirecting them to another- t3 V' d p" r. J' W" @6 a
routine.
4 \* g- q6 V# i' KIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 J" W6 v3 d" I# M0 W# i
to the new routine to execute (hangs computer...)
9 b4 a7 w9 R/ U7 o# |) m+ I6 W: O. t# r( i5 a Z; |
mov ah, 25h7 d4 \+ a; a4 y/ Q6 |2 b
mov al, Int_Number (01h or 03h), E9 x6 _$ d- `7 R1 ~
mov dx, offset New_Int_Routine
4 j# a2 L: O7 d! k int 21h/ J( O7 ^9 Z* X8 ~
9 y- R8 S1 c/ j5 V__________________________________________________________________________2 Q) r! S$ n) F
0 g+ O) N' a. s$ yMethod 099 P2 d4 k Z' f1 t- c0 o
=========
, i, d, I7 ?8 u @" \5 m! q' m7 J
) c4 V( [- Z+ g: Z! Y/ E9 zThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 v5 T9 D; e& P! `7 O
performed in ring0 (VxD or a ring3 app using the VxdCall).
7 }( g) ]% j3 {4 p3 VThe Get_DDB service is used to determine whether or not a VxD is installed
) Y' e. t/ v Y9 Xfor the specified device and returns a Device Description Block (in ecx) for/ o2 L6 T* T& F% \5 p3 \
that device if it is installed.
0 ]4 b9 _) F# x' q
" A) m% k; K5 G7 c mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* E: d, v" n( o# n1 {! F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). l2 ^6 k9 Z& G$ R
VMMCall Get_DDB
3 Y* Q7 M* D/ f5 ^' Z9 _* \ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* s/ P; e& H2 s1 e7 d# }5 D, G' Z# {. m& M: f! i9 ]9 o* w
Note as well that you can easily detect this method with SoftICE:, V: q, j7 w* d: m) j6 f
bpx Get_DDB if ax==0202 || ax==7a5fh
( T' o& P( l) I& Y0 M- E( b0 N" M* q% Y
__________________________________________________________________________
. n0 }* ^- m, V) _0 q* B' |! a9 o7 {, f: z6 U' W
Method 10
9 Z) l2 F( b% r' s=========+ Y: \4 K5 v4 L* O) I0 V" G
6 s( A# _/ M# h/ w# ~
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ h# @+ ?5 U4 f4 l$ q0 P
SoftICE while the option is enable!!
d$ Q7 R# h" N0 U& r5 z5 q# _4 R% U0 N
This trick is very efficient:
; n) S; k3 b. S i6 O: k0 Lby checking the Debug Registers, you can detect if SoftICE is loaded6 c1 T" B$ X/ H6 B2 r& f1 F
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ s- j9 c+ D# Dthere are some memory breakpoints set (dr0 to dr3) simply by reading their, a. |' n+ ]' {
value (in ring0 only). Values can be manipulated and or changed as well
9 K2 }. a/ t4 M(clearing BPMs for instance)
. r4 ], @: ~2 _7 }/ T" i/ |) f' ?* }2 c" b5 G& ?6 |) B( b
__________________________________________________________________________% ~' [6 c1 f4 C; ?- q+ q
2 I6 K5 P8 U0 j0 C& _" h I
Method 11
6 j6 v1 N7 w" P: c! ~6 _. N=========
% Z- q9 ^& h; t! q; R( ^8 S, D: a
4 I4 }) k# t% w6 z6 G6 M2 vThis method is most known as 'MeltICE' because it has been freely distributed* o9 o9 v2 r, J' y0 T3 E
via www.winfiles.com. However it was first used by NuMega people to allow0 {% B' X2 P ^$ i
Symbol Loader to check if SoftICE was active or not (the code is located
2 x+ I ?$ ?$ D4 K, Qinside nmtrans.dll).
4 k/ ]$ F' M3 R5 P7 B/ h
$ G% T* Q, s' J ZThe way it works is very simple:; E0 N/ C6 I4 Z$ `
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 x% G, T7 o/ q% o, s: d4 ~WinNT) with the CreateFileA API.
5 }: Q- i/ C! T: w1 V3 W, Q/ w: S* R
Here is a sample (checking for 'SICE'):
0 k; I& `, `* F4 b. E) C6 v) |5 ~- U% n. r+ }1 g4 [
BOOL IsSoftIce95Loaded()
2 L6 I# e- ^& ]! u( m4 ^: k" N9 C{2 X$ t( P: r- E" [0 _7 a
HANDLE hFile;
! @% q9 j- D9 F( l z, s1 j F! \- h' { hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. V7 @0 c* F" x3 }1 k( M
FILE_SHARE_READ | FILE_SHARE_WRITE,/ s& H2 s4 e) K! K# s# w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- K4 ]5 H& G } y if( hFile != INVALID_HANDLE_VALUE ), `0 K" t5 |9 X' B' e
{
. R: t, n$ m& ~0 z; x CloseHandle(hFile);) {1 U+ J% ]" y- `4 ]# U4 q
return TRUE;0 E/ t" R, ? K& c
}
1 o1 j$ N" X& R1 |# _; _9 E return FALSE;
( |# O6 l/ V$ R7 f+ C, a}0 u1 m( S. _9 v% w C1 E( F
9 w, z9 [* s- n7 QAlthough this trick calls the CreateFileA function, don't even expect to be
s3 F) c2 p; S' Zable to intercept it by installing a IFS hook: it will not work, no way!
5 u1 w4 \ l7 [6 C9 w. t* I$ s4 cIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' z, l9 X! }6 @* t, n Y$ Cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 s x# a4 c7 _) p- C
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
A, X* G3 g6 S( B4 @* ofield.% m/ m2 J- P; ~2 ~! O( i: H g
In fact, its purpose is not to load/unload VxDs but only to send a * z$ r7 `" l+ W3 J
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): X" F$ N: W# h4 h( Z# {! G
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- }3 L/ p6 ?5 b% m7 \: Wto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ l; G+ e+ [; J0 fIf the VxD is loaded, it will always clear eax and the Carry flag to allow
D# @+ J- f C& F% k9 xits handle to be opened and then, will be detected.
) q7 V8 O2 L' _. fYou can check that simply by hooking Winice.exe control proc entry point
, z5 D5 b- c4 q/ xwhile running MeltICE.2 E9 b" Z( e$ T0 }* ~; ^2 F7 t
$ c. d0 [! R: Q' Q4 ^. }
1 J- t: W) U: a1 l ~( y 00401067: push 00402025 ; \\.\SICE
( W9 y: \5 o8 j. x1 K( E9 H: e5 M3 o: h 0040106C: call CreateFileA
! W" V1 o, q' w; w ?6 V 00401071: cmp eax,-001
3 W) t# ]1 c: k+ W) W2 K$ u. R8 P; K 00401074: je 00401091
4 j3 m1 a- f. m' d ?, H$ E* S: i$ @( z. }2 V6 q
' s' l' j6 T' n! @3 }: z1 S
There could be hundreds of BPX you could use to detect this trick.
7 s1 f6 H7 x/ \/ D-The most classical one is:
+ o, R* m% [: b9 O8 J( L BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 b5 u8 _, r) b2 H *(esp->4+4)=='NTIC'
1 A+ U; M" O: z4 v: t' O9 M& c1 d& {# J ?' _3 L
-The most exotic ones (could be very slooooow :-(/ X: h s) e! ]" w: \& a: w7 N3 i
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- c: c3 a0 r) n ;will break 3 times :-(5 h+ d" Y6 E! |9 `& C, D
6 G- p4 A; }- `
-or (a bit) faster:
0 r5 v; n$ R& S3 q. v% o1 v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 c9 q9 F1 X' K% K4 f8 N" {4 E- Z; r& V9 F
* B2 x, {" L4 a- g
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 K4 o8 G% e1 u
;will break 3 times :-(9 }; X {( @1 Y0 \; ]
6 C3 q+ \$ U$ N# T8 c
-Much faster:; ^4 N, y# \; j
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: Q% }: _8 j/ t h9 O
! C1 T$ ^! z: Q0 L1 ]3 m! MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 @& D3 A2 r( z# Q* W1 u7 @function to do the same job:
0 |4 S/ n4 X& V* p1 \3 I: q5 y9 `2 N. h$ }
push 00 ; OF_READ
- J3 I, ]( \5 e% z7 }2 a _+ }, q! j) w mov eax,[00656634] ; '\\.\SICE',0) x9 w0 r9 r( _0 t2 Y3 p
push eax8 k2 A0 `' \, n+ T
call KERNEL32!_lopen
+ P% E7 E+ g' m/ o7 h7 ? inc eax" R# C: Z3 c( `* p/ {
jnz 00650589 ; detected& x; r" D0 Z- c) L, h" K' q, ?$ ?
push 00 ; OF_READ
$ n: _. x* `! \9 M! a) ^0 S) y8 P mov eax,[00656638] ; '\\.\SICE'. p% X3 w; t: s
push eax0 x3 o/ p9 V) o% `2 x
call KERNEL32!_lopen
2 J6 X' q) {3 v; ?$ C! B+ c7 d inc eax
; X! A9 q! _) e7 ^1 |; G: X jz 006505ae ; not detected
8 ?% W# l* B; I9 c4 J* w4 f/ Q: S; I# |% z5 }, K0 r6 V3 K
# [3 ?7 l) d4 @9 i7 M4 O. ___________________________________________________________________________
6 j% v9 F* d3 k& l+ y+ g, [& [3 n+ k+ _
; G% d6 F1 Z* ^" F2 G: zMethod 12
1 M( Q$ P7 Z8 C3 i' J=========
3 r; N2 @/ {' Q( ] k6 C
; f5 r! v5 f7 x/ x9 X% i9 H- lThis trick is similar to int41h/4fh Debugger installation check (code 05
" e* b4 `. t6 d* D: X& 06) but very limited because it's only available for Win95/98 (not NT)" N* l2 o8 H( }. Z! E$ r6 ^9 Q! v4 k
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 }; G: D- ], R8 s2 I4 @
- o1 l& t6 u; {4 K) @8 c3 J
push 0000004fh ; function 4fh& w/ ~0 e- A, c7 S- w
push 002a002ah ; high word specifies which VxD (VWIN32)
9 o( p. n# o% K: P ; low word specifies which service3 V# s1 w9 l1 r
(VWIN32_Int41Dispatch)7 ~4 N4 P6 ?% E/ _8 d
call Kernel32!ORD_001 ; VxdCall' n0 u+ Q' M% l9 }$ ]. j* i
cmp ax, 0f386h ; magic number returned by system debuggers! u' a. f0 L V! H: z
jz SoftICE_detected' m: p- ]) I) z( w' L# }4 l
6 k, a1 q3 G0 S" C" v. @
Here again, several ways to detect it:
" k* t- H1 I" O2 L- |) S z$ Z) A% W; K1 N1 D0 y5 z7 R
BPINT 41 if ax==4f
: E3 \( B' o0 g( [( {& K1 u
* a0 U9 x: x9 y0 f0 `5 I4 d BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' B/ Y& d; @' H# ?' L* }; r
( p. T9 [9 @6 Y. u3 _0 H8 G* y) B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 _$ v9 H6 w0 r
_8 k) H8 L R7 {$ w, T2 e$ e
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! a/ l1 x$ `% `- _% L6 K9 c3 J* N
; I, \& b: w4 R4 u1 @! f
__________________________________________________________________________3 e. i7 H# `# l- s4 r& B
9 z" u4 b/ e |+ }# W
Method 13' \0 b' x4 u# i1 l
=========. E/ W. [0 D6 t
, E8 Q- W& n) lNot a real method of detection, but a good way to know if SoftICE is
. ^3 g- [2 X9 \installed on a computer and to locate its installation directory.
/ q. o* E# z5 `2 JIt is used by few softs which access the following registry keys (usually #2) :& ~, D* ?5 i/ @6 o+ @' Q
: r+ g; |! f5 {4 J% |3 u0 r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) x, \) |7 U5 p! o\Uninstall\SoftICE
8 a' c6 g; m$ I7 q1 N-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ W5 L& d* x/ P* N- w6 Y4 L3 V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 ~8 f5 n1 Z) O0 i% F' c7 N9 I; A\App Paths\Loader32.Exe
4 C7 E2 K0 E- [+ ~1 G! @) y- y* i: m4 a
8 ~+ r+ U# U5 XNote that some nasty apps could then erase all files from SoftICE directory9 j# C \3 Q- u, G
(I faced that once :-(
2 l1 K2 V8 s7 B7 z z. s! p. y$ |: Y' U, G2 V" D
Useful breakpoint to detect it:: ~5 s* X0 h/ ~4 v& z# j
. L, p1 h; x+ Y3 u& J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 U" s C+ Q6 `. t& g7 S) C
. b$ l7 V% H6 A0 E- A__________________________________________________________________________
( j/ I8 Y3 { p2 ^) l: C3 W7 w/ J: j9 x) B' i
. V, e( }+ D+ \* F- \Method 14 7 w% P, U* I; D) B8 w
=========
7 X# Q1 A! A2 ~
# Q5 o' u: i, B5 Z) aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- D, z; }" @; Bis to determines whether a debugger is running on your system (ring0 only).
5 W- n& p; t/ i. Y E0 e+ k& {$ n9 |* _" M& f+ L$ a6 G. y
VMMCall Test_Debug_Installed' ]. q/ B7 A8 m3 ]2 F! B
je not_installed
) v/ U" | J+ Z; q( h
4 `2 W# T- k1 i$ GThis service just checks a flag.5 m4 k: e$ F: Q/ s2 z6 C3 }
</PRE></TD></TR></TBODY></TABLE> |