<TABLE width=500>
( j1 m6 Q2 T+ _ R; }9 s<TBODY>, h$ Y/ p3 O/ E; n2 I/ \ b
<TR>6 l9 E5 V" o \- H5 h b) ?
<TD><PRE>Method 01
! r' }6 M6 e! R4 u8 i `5 h. n=========1 g9 X. f" {. l
- r0 d1 n) f) G+ o7 {This method of detection of SoftICE (as well as the following one) is6 ^" L. T' f* F+ N2 O
used by the majority of packers/encryptors found on Internet.1 n/ m2 c1 V$ I0 g
It seeks the signature of BoundsChecker in SoftICE9 r4 S9 S/ j( l5 x( _" q
) d7 Y! Z" W' `: M' Y, I mov ebp, 04243484Bh ; 'BCHK'2 D# k8 }0 F3 p' n6 U8 ^
mov ax, 04h, U% r( w! [2 A3 v, {& Z. t
int 3 9 X9 O- l* [" H1 F! c2 C. W- c5 B7 ?8 a
cmp al,4$ \: t" g8 j* ~( a
jnz SoftICE_Detected
- I% p1 g% _5 n- r% Z/ ^( y5 U
; w0 h, u, D9 L2 x% D___________________________________________________________________________
' s6 u' W* {5 c& i: t, p
6 V$ g* ?# O, yMethod 02* J; ~( \, M. x
=========
- j) b* U. ~% G$ H
6 E1 o7 w4 F# A l3 nStill a method very much used (perhaps the most frequent one). It is used/ }! o3 t9 m9 {
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 K ]7 r5 b+ a" \, a
or execute SoftICE commands...# ^) X; v0 n$ n G
It is also used to crash SoftICE and to force it to execute any commands; g, `* @7 S& Q9 ~
(HBOOT...) :-((
# l( E0 U' S( t$ _" V8 N
8 S' q7 f: ~0 D3 @' w H; J# cHere is a quick description:
6 I; `+ h/ X( [' g; O-AX = 0910h (Display string in SIce windows) S- ~8 C' B7 C
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 R' f9 G/ a- |0 K* x. Y) {
-AX = 0912h (Get breakpoint infos) r' A$ k8 M1 y! M) A7 B& ?
-AX = 0913h (Set Sice breakpoints)
( K$ K4 w% u% `! h5 R9 M" e-AX = 0914h (Remove SIce breakoints)1 X0 n8 h6 i- |" }* l# E# _+ E
: L5 t( ?. n& ^- T6 sEach time you'll meet this trick, you'll see:
/ x! V# Z- {" z2 D; z+ b-SI = 4647h ]- _5 R' O" u- \7 v# U# e
-DI = 4A4Dh
9 H6 K! k. q; P. H. X" RWhich are the 'magic values' used by SoftIce.
" Z4 ~/ S9 n( Z+ jFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- _6 X0 W. A6 |( H
$ F, Y( T, g" v0 Y N4 |! ZHere is one example from the file "Haspinst.exe" which is the dongle HASP
# a% ^* |9 y ?" m; [3 {1 T& xEnvelope utility use to protect DOS applications:( H3 ^! a& O* `4 q ]& b7 ~
' j, `6 m% G: E# U% Z7 w ]/ F" S8 r
' `" k8 {, K( o; e
4C19:0095 MOV AX,0911 ; execute command.2 F1 f+ z5 B: T5 G2 N
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., {1 q' s- T0 U' `
4C19:009A MOV SI,4647 ; 1st magic value.. r2 w# `5 e+ P: c' [. R" D
4C19:009D MOV DI,4A4D ; 2nd magic value.
, G0 B6 c4 v; ~' q m7 ^6 T4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 C6 u2 t& U9 i: O
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 Z! ?$ X/ S( c' @- D
4C19:00A4 INC CX; f8 J5 `8 T+ E
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute u5 g- g! D8 h' e' g* g: F
4C19:00A8 JB 0095 ; 6 different commands.
. T0 z! Z {" J( H% {4C19:00AA JMP 0002 ; Bad_Guy jmp back./ I- R2 _& T% `9 a
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( R) E, I L! k: T6 e$ ^( u$ E1 T0 M2 r. h/ g
The program will execute 6 different SIce commands located at ds:dx, which
" w& ?9 Q1 Z! I4 R; Y; Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ Q3 w4 ~& Z! t' {. y' {. f
# s- J) M6 V6 I! m* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ Q9 |; a3 [1 D$ J
___________________________________________________________________________+ E, _- o" z }
2 z7 m+ l' G; M: c- n. m
, x l& P" ]# g" R& i6 E; f2 {
Method 03( f/ W L( B6 d3 G
=========
) e6 ]0 q5 V0 p0 r; `% @0 V
' Y2 a9 d6 G" d( t! z$ o4 N: d8 ALess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 p9 a/ U+ H$ ^, G9 j
(API Get entry point)
: ?( S4 F1 u/ S$ ~# n4 Q) z
/ u0 o& I% D& g6 J8 g( }1 A. ?2 f' T; w7 G) f
xor di,di
3 k5 W, E. v' M! Z0 A8 M! k, l mov es,di, a& a5 G5 G6 l1 z( D
mov ax, 1684h
; @" F7 J, O5 |0 W0 w, k mov bx, 0202h ; VxD ID of winice* v) c" F% [7 ]. b% F
int 2Fh
7 e! E6 @1 K/ a7 A3 G# k mov ax, es ; ES:DI -> VxD API entry point
' ?# J' C4 x) \. n W' X5 @0 w- p add ax, di0 E. M0 e, O2 P/ y6 i1 m- {
test ax,ax
0 L& o" L5 @) @0 S1 C jnz SoftICE_Detected" _1 F: F2 W+ d5 J) [3 Q0 K
6 j2 A/ Y) Z0 \2 H [. S
___________________________________________________________________________' {' [- |: Y$ v
, ~3 I7 p R9 w. `* x3 R+ w8 RMethod 04
1 i% Q9 P1 J4 H& {- d6 K5 M=========
4 J* h1 H% c. Z5 l7 X+ f9 t
5 o/ t8 M) F& F( j& @: C: ^+ kMethod identical to the preceding one except that it seeks the ID of SoftICE: q/ x0 y# q" c( c5 Q, }
GFX VxD.' X7 C7 G, y; V! ~
0 ~ R `# Z7 ] B! E! k
xor di,di
, J k3 M2 s" l6 [8 K! c$ _ mov es,di) ^0 B& V- ^3 Y9 ?: f% q( [
mov ax, 1684h
% G2 ?0 z- k1 ?. W8 o7 U) p mov bx, 7a5Fh ; VxD ID of SIWVID
6 _5 f" P3 k# G int 2fh
^. J. o2 {9 Q" `" O mov ax, es ; ES:DI -> VxD API entry point
: B# {: h( O0 ^8 q0 b add ax, di
. i* @8 E& F( R test ax,ax
; v: F e9 U' @6 Y jnz SoftICE_Detected6 a5 j8 Y* C; c+ `& D
5 Q* @+ u( _" x7 T2 |3 j) O
__________________________________________________________________________2 ?: v9 _1 h# p+ K8 q
# O( @' u3 z7 c! A
5 N) M, u) e: h. T0 PMethod 05- D4 e# M6 Z7 y& h# W
=========! h" N, Q9 U- Z) V* p; _$ z
' h1 q! @1 ]) d8 V4 a* {7 R% g
Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 z) I0 y3 {0 H0 X- c! Jdebugger. It calls the int 41h, function 4Fh.
/ k X/ h$ f4 j* ? k f4 p% k7 hThere are several alternatives. 0 H! ^8 Y) _0 [
* X% S9 A- j* Z3 C
The following one is the simplest:
/ a. @% n+ ?! ^/ ~& y$ _% s+ e( j& ]' K( ]2 U" {
mov ax,4fh/ W. a f- \: W0 R* o# v) b4 a
int 41h# _: m) g& B# _- R+ ^
cmp ax, 0F386: U& j3 e9 ]1 q/ S' Q
jz SoftICE_detected" F* [- J1 G* O& n
3 Y: Q/ r4 Z$ Y' f$ S- a* l, ^+ L0 Y
M9 Z& p6 `' V% tNext method as well as the following one are 2 examples from Stone's
' O# E7 I0 `% {* v. x* W: ], {6 Y"stn-wid.zip" (www.cracking.net):
/ @% r5 I1 U; a. D( A8 t, R
( w1 i- @. N# K X, e" L mov bx, cs G2 }! `, @' F, X4 a
lea dx, int41handler2( i! c9 e$ B. h
xchg dx, es:[41h*4]+ B. w# H+ Y; A8 x
xchg bx, es:[41h*4+2]
. l( p, `% _6 J# f mov ax,4fh0 l% n4 x, q+ L( L, Y6 `: ]
int 41h
9 y, H F# I8 s/ y; J" Y0 ~: v xchg dx, es:[41h*4]% t; A* X5 a- _% z$ i$ F u
xchg bx, es:[41h*4+2]
; d6 z1 U/ u' |/ t' j3 S cmp ax, 0f386h4 b2 V6 [2 J* U5 \9 L
jz SoftICE_detected; P, @, g9 C/ o6 E- N
' \. P2 d* A) _4 j! S P" t$ Y. T
int41handler2 PROC
; C d, J+ J: u: s# u iret/ \# G0 z* l) G
int41handler2 ENDP
& ]/ ]8 f; [2 r( {. n6 f8 T6 J. x1 ^
5 m/ v4 v" F9 V) p: S1 W_________________________________________________________________________( y/ {+ n6 f# c& p5 b/ f: d
% E0 d$ y: }6 U7 I
# o0 z. J1 B5 K$ @Method 066 f& j$ ^$ H+ N D
=========
. H7 j- _8 S5 K2 o( @# b, f2 k9 t/ {: c" A6 P
9 R9 y! ^% U5 M( A3 G$ o7 @- E
2nd method similar to the preceding one but more difficult to detect:
, _9 k" C. \% m8 U, R- K5 n5 o# I. F
% [! L, W5 \3 Y/ h' R& \8 w7 Fint41handler PROC0 \ A# q% U6 H2 a
mov cl,al
1 C4 k! d& \# |% @9 M1 I3 L0 u" j" P iret
+ k4 {' L' D2 [% Y( P- Dint41handler ENDP2 u: ^+ m) }7 O% S7 j3 Q' S3 P2 S
% A! l; `! `% _* ^, q( V
& l# j7 ~; U' L* u! h+ {* L# P
xor ax,ax
6 e9 a8 _& ?4 p mov es,ax
* l4 S. X) s( X/ ^/ p mov bx, cs
: V6 G; K0 m; h K9 m% \' ?6 ?& s lea dx, int41handler5 f! |5 m2 c A9 V `
xchg dx, es:[41h*4]
/ R; d; H3 Z4 b/ W3 R$ j! x xchg bx, es:[41h*4+2] C5 ]3 E7 F# P( H/ s3 _
in al, 40h+ l2 W: e3 w: ^# _: v
xor cx,cx! z0 E5 l' Y% k n
int 41h
' ]+ [. T, s9 o& C* K+ Q1 _ xchg dx, es:[41h*4]5 |: b- A) J" n- b( P5 ^3 M! N! a ]
xchg bx, es:[41h*4+2]( x7 N4 K8 Y% f" o6 P1 N" S
cmp cl,al* c4 `8 W; |! ~" O! a
jnz SoftICE_detected( C) l2 c" N3 W- T8 A w) ^
3 _/ i, B% f+ e# Z" d' Z
_________________________________________________________________________
1 U2 V. r( @/ f/ j* p6 ^# w8 h; h2 h# \, B% d2 s" ]2 N
Method 07
# C& \) C9 B) |6 K=========- w" S* s" U( s/ C4 X
+ A6 x1 k+ X' J7 f9 nMethod of detection of the WinICE handler in the int68h (V86)8 _$ A$ c& M9 x
2 U/ s" w: J8 c) g3 g mov ah,43h
$ Y; o6 [! K9 Q: Q! r, ~# t int 68h j& ^. E1 u- h: {- t" e2 g j
cmp ax,0F386h0 v4 K9 \) h D' v( r
jz SoftICE_Detected" L! h' n5 \3 F# ]: n4 b1 j
5 Y5 Z5 v6 n) Y2 M
4 X" M2 l; G' K) Q- J
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. m2 D- P: l2 h7 t; D) B( |
app like this:
n/ R1 ?+ M& f V1 {$ N& `- x# X
BPX exec_int if ax==687 i* \( i3 Y; f$ a! k6 T7 h
(function called is located at byte ptr [ebp+1Dh] and client eip is
: D& f$ \6 D% I) [0 z, r' @. {, O located at [ebp+48h] for 32Bit apps)
2 o5 G( V1 q H0 o. B* q$ |__________________________________________________________________________& r. Q' I! C/ w
1 P6 S, b' K0 y
5 _; H8 ^6 T' U6 l
Method 084 }+ ?) k, \& A, B* z( p7 l
=========
( \1 Q8 N2 L! ^: }- D# b
% w O9 G, |3 S3 j0 UIt is not a method of detection of SoftICE but a possibility to crash the
5 h% \* Z: v( J [, ]& }% Z9 Hsystem by intercepting int 01h and int 03h and redirecting them to another
X# U: S: ]1 d p8 e/ { Nroutine.# K- k# a/ i# l6 q# Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# V3 i# W2 B: t! D! s4 b1 Lto the new routine to execute (hangs computer...)$ \1 U, S) e3 W
K9 ^5 J5 |( U$ f" Z& G mov ah, 25h
% x3 j: s; ~, W. p. J7 [) f mov al, Int_Number (01h or 03h)
3 Q$ z' B& d" e* t mov dx, offset New_Int_Routine
$ S: |0 V7 I, k) x5 b$ r1 E- n' f int 21h
F" i1 m- B. ~9 E. H& ~0 Y, L9 b, q: [
__________________________________________________________________________
( k) |) H' g) Q: k( I' i5 x* }$ X1 n6 g% `9 D k+ k
Method 09( Z# x. R) F X! B2 o
=========
) n1 `! n/ n2 v3 k* }+ f7 T) o
4 T" F' B6 K2 L# O; G, }" A5 _This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* f* s7 g4 W! p6 R4 d5 ]/ cperformed in ring0 (VxD or a ring3 app using the VxdCall)." j5 S) |: h$ z; i* j
The Get_DDB service is used to determine whether or not a VxD is installed( w9 h9 E/ J q
for the specified device and returns a Device Description Block (in ecx) for6 r4 d0 x7 H: Q- D' g
that device if it is installed.
- L1 U; s( l7 w2 e8 n! J
- f! H& y& t' d3 a# w) }2 J# N mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, o, ^+ d0 t! |+ I/ ~ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! x: N4 T) K' L& b; O6 K' Z
VMMCall Get_DDB2 r3 x& {3 z j$ I! V; ]9 Z4 o
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& W* U' @1 M8 y" ]+ {$ Z
: j! f. |2 ~4 ~( fNote as well that you can easily detect this method with SoftICE:# L! c8 {0 \7 Q" r3 @, k
bpx Get_DDB if ax==0202 || ax==7a5fh
7 j9 @( Q" V4 }0 n( @ ~
|9 L& t* L" u4 M4 g8 i% i0 r__________________________________________________________________________
N R. E4 f# ^# V6 P
. |# a0 f: ]1 l$ qMethod 105 I. l, F+ u9 j' D7 @
=========
5 x" `5 w6 B5 G. v# I- J# ` n
0 T' K4 p1 E- m V=>Disable or clear breakpoints before using this feature. DO NOT trace with
( \% X; }% q4 q* g4 Y% T5 ]# T, ^ SoftICE while the option is enable!!/ r% c0 g& @: X' h
( F9 {1 {& M4 i- fThis trick is very efficient:$ c- R: a( [& p7 } j
by checking the Debug Registers, you can detect if SoftICE is loaded
) {8 K: [5 m! p9 n G! \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" u' v4 E; j/ b% V4 R+ ?1 W: O2 k d, pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
4 c4 U7 G/ L2 e: J+ _value (in ring0 only). Values can be manipulated and or changed as well
& q2 z0 b2 F' Z& i(clearing BPMs for instance)! X8 i/ u4 \* {' R
4 `' D U. W' m__________________________________________________________________________8 @1 ?0 D! `5 ^9 w' I! @
/ X7 K, w5 g R# R4 ]/ z
Method 119 E+ }6 J2 q) |
=========
* a @0 U! i; o, }1 e4 B3 C
- c+ v$ | ?1 }7 \3 M2 x) s) e' m) RThis method is most known as 'MeltICE' because it has been freely distributed
' a* Q- h+ t5 u! u! q( s6 yvia www.winfiles.com. However it was first used by NuMega people to allow
6 i( z" C8 V7 f7 fSymbol Loader to check if SoftICE was active or not (the code is located( Z( l8 Y! M. l" J( _. i
inside nmtrans.dll). l. m R2 T( _( L3 R
6 V2 W' g2 ?$ ~
The way it works is very simple:3 I2 c. _8 g# @! d6 t& d9 q% n. J6 G
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ T! ?2 i! \/ O i5 Z
WinNT) with the CreateFileA API.9 K7 {% n5 \1 s7 Q/ v+ G
& I& ]1 t4 a' U) Z7 aHere is a sample (checking for 'SICE'):
& u/ g8 G! m) z
- X0 G7 F4 z! T4 Y( tBOOL IsSoftIce95Loaded()
0 ?, K: c3 k- c{: h6 B0 Z S( Z+ u$ {9 ]
HANDLE hFile; 5 h6 {' g( e7 _5 J
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* F' } u' K9 k0 Z. F
FILE_SHARE_READ | FILE_SHARE_WRITE,! d5 p n$ z) L, S8 l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" F: l# ^& C" x2 [
if( hFile != INVALID_HANDLE_VALUE )
# P: n* |8 s" E, A) x" U5 W. ^3 d/ z {0 @4 p4 q/ {2 R4 \9 z; t4 {
CloseHandle(hFile);1 j4 J' x1 T: T3 j8 f3 U
return TRUE;
% W5 k2 D( j( u }7 c9 w. S3 c S9 q3 R, s+ X
return FALSE;, W: |) k9 E" e
}
2 n" F! M# `+ R1 i$ `7 W# n% s) O( p5 j+ T& r: [) g
Although this trick calls the CreateFileA function, don't even expect to be
5 v2 ?3 m1 W4 a, U0 ~able to intercept it by installing a IFS hook: it will not work, no way!' s. L% l8 l4 B( _3 {9 S: f
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 Q$ m2 n$ S. [: A' Kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) V5 h* u0 B0 @' ^& h) i: jand then browse the DDB list until it find the VxD and its DDB_Control_Proc2 }+ Q( Y0 z r/ N. s# A c
field.0 m% g; {0 N( v G$ B
In fact, its purpose is not to load/unload VxDs but only to send a 4 L! Q% j/ i6 m, l: K* d/ }
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; M7 h3 ? ?4 @9 D; gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 D' x' j7 ?6 q% A4 ~& Cto load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 s; Z: C! E6 n) @; A9 r; FIf the VxD is loaded, it will always clear eax and the Carry flag to allow
, \6 K3 N( D# p& t# G, x' [) q zits handle to be opened and then, will be detected.
3 H. W% Z: A. T# OYou can check that simply by hooking Winice.exe control proc entry point
) k0 L0 `+ A; p2 Nwhile running MeltICE.! L$ G; C' n0 z* \ P2 n) v
& C1 `6 G- d& F- N( {8 @9 M' D. R( q/ i
00401067: push 00402025 ; \\.\SICE
# `- y3 G3 K! g 0040106C: call CreateFileA8 p8 t# I. q2 O) K7 f
00401071: cmp eax,-001( Y1 ~0 n/ u- h+ w8 z
00401074: je 00401091# p/ H% q$ }) q' l0 s# v
; F/ y9 s' g E/ X: Q: f. L! Y6 p! A/ g+ \- m; r
There could be hundreds of BPX you could use to detect this trick.8 k# K" ~# c3 K/ K
-The most classical one is:
& M0 l3 k! ~" k BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||2 a" z/ J, }9 @( R3 A9 H6 `# I7 F
*(esp->4+4)=='NTIC'
8 P Y4 t0 j) } {5 \( p2 Z, m" o5 a3 q4 u9 L8 L) I3 i
-The most exotic ones (could be very slooooow :-(/ V5 d: K8 Y" O$ _* m7 P o$ q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 V: `" d6 N' \3 J( q
;will break 3 times :-(0 u& G0 s6 P" e9 q+ O
! A" I2 m. ~& a
-or (a bit) faster:
) K- l5 Y# B7 I, _" Y' ? G BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). O4 A2 m, G/ j% a
3 j+ W. p% v \% U$ J BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* a9 ~ ?4 Z! O ;will break 3 times :-(% [3 Q2 ^6 @3 W) ]
+ g+ Q4 ^/ _- i. w' F
-Much faster:
: N8 \5 r$ m% S% y! e3 P, S BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 e% ?1 V' g. K# a4 B0 J3 T
' Q* [8 w; L4 ], j" A+ G1 NNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 _9 `; t! u m! Vfunction to do the same job:
6 Z6 Q- V+ U! q
9 m7 P/ f' _8 ^6 H& y+ P" V push 00 ; OF_READ
0 }! s& K+ q5 b. C mov eax,[00656634] ; '\\.\SICE',0# d, V1 U- i3 w
push eax
4 R6 v# y5 `8 |- t7 w7 e( y# W call KERNEL32!_lopen9 _0 ] j5 ] t; M2 g
inc eax$ R8 S5 m& ?$ S0 [; J2 p r
jnz 00650589 ; detected
6 g, a: W% v# I6 [ push 00 ; OF_READ+ \# A' G: |/ @" b6 _- k
mov eax,[00656638] ; '\\.\SICE'4 C) Z& H5 z5 |) c `2 q. p0 v3 ^
push eax9 s$ A5 q9 y. r# j1 b7 [* J) m
call KERNEL32!_lopen
) x. o8 B7 m& u p" } n inc eax2 w$ M$ V. W. A* Y' S
jz 006505ae ; not detected1 C* {/ c2 b% ?/ B/ W
' W& ?. j) j! t. A" h" u
" M8 m( z; M. u9 k4 Z__________________________________________________________________________8 P6 z& ] J/ H# J* J4 O& x& ?
- c1 w$ S9 `# T/ `. s. i s, e& s
Method 12
7 D9 J& W$ ~, \" f* ~$ g=========
& T9 _; H) Q+ I( ]) r. y0 q1 \2 d" F
This trick is similar to int41h/4fh Debugger installation check (code 05$ V4 }, L" J- c) D0 {
& 06) but very limited because it's only available for Win95/98 (not NT)- i. U( ~& C4 @% R& z& a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# Z. |5 r) g# }8 d6 _) v1 y4 u3 T: ?, t+ N3 D8 O
push 0000004fh ; function 4fh% Y/ S5 Y5 [2 o3 f+ h6 R( D
push 002a002ah ; high word specifies which VxD (VWIN32)5 j: J. g9 W3 _$ z5 t& ^0 Q0 S
; low word specifies which service& d9 O6 h7 k, B( a0 W
(VWIN32_Int41Dispatch) \$ z3 h- `, U' u
call Kernel32!ORD_001 ; VxdCall
* s7 o$ d" |& a n- L7 [( A' `5 |; T cmp ax, 0f386h ; magic number returned by system debuggers
/ o# K& ?' f t4 @ jz SoftICE_detected7 l3 O4 x. d( @. T/ z/ G. N
* j0 p: Y1 ]! v+ T5 R% e
Here again, several ways to detect it:
. w7 _, H0 h: ~) u# e; Y, q4 [7 @/ I0 l8 V0 q$ @8 o
BPINT 41 if ax==4f
6 o! F+ r! c# x
( j3 x* m* E# c) ]/ C+ _" C BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- B; E5 a4 G4 Z1 U( q
& p& h" k( w! Y" w, p$ U: h# p BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 v- E( B1 _+ e6 y2 X
( I1 G9 O% u/ Z6 Y. l BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 I) I- p! `5 o: t
* s9 I/ g0 D( m+ |- ]( W) M0 n__________________________________________________________________________
6 L& P! U, L' b
* H5 H& U% L; O, b# U2 sMethod 13
2 ~- Z) d! i$ S) P5 a9 _9 `=========7 [6 O+ \ \: ]. t+ i% V
, y; ?3 n \$ M1 p0 d5 X! h6 o& VNot a real method of detection, but a good way to know if SoftICE is- {) K- A: t& f3 M* a# e
installed on a computer and to locate its installation directory.# I5 S* Y( z# s4 X
It is used by few softs which access the following registry keys (usually #2) :- O& u' j# X( R9 R3 `, q
+ b/ c& H+ T7 l! E-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 B/ _7 o* Z, d
\Uninstall\SoftICE
! S3 d! B' W, J- J9 t t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE6 c2 k) g2 d3 Q4 I; C) I
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( P' v( C1 Y* z0 |/ q' V\App Paths\Loader32.Exe; l6 ^6 T$ |. T; _+ ]) \
6 j2 s9 a' _* _% @4 M6 d
3 O0 k( T' R( uNote that some nasty apps could then erase all files from SoftICE directory3 d; ^! F5 T5 _; W0 l
(I faced that once :-(
$ M9 l( ?) R9 \( B2 |$ n* h B% O6 M6 u' V1 w- ?, K
Useful breakpoint to detect it:) o; ]+ a' C+ |8 R
) [" |' p, i4 O) s B2 Z) z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 T8 h- } Z# y0 e1 c. R5 W) S
# j/ J2 P7 N6 r6 d- L d2 S0 u__________________________________________________________________________
& C+ x4 @2 g& y2 y
3 i1 F# x. D0 q% M0 D
) N, A; o9 ?6 S5 k5 u4 FMethod 14
' p6 Z5 [) Q0 u1 C' l4 h=========
. j. E5 h. b, p" O3 y0 p+ W% f1 T7 M! B; i' Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
1 n9 ~5 a: Q) J, R, d5 c0 k- vis to determines whether a debugger is running on your system (ring0 only).
i' `) d9 ]) M/ w* h" j, Q7 F0 K1 W: r5 b, l- J# s0 g' _
VMMCall Test_Debug_Installed
; R# T% t ^. W: }1 Z6 K" o% z je not_installed: N4 ~& h' p' k4 {: I# i
4 h7 x) }1 ?' ?" i' V0 B5 p# nThis service just checks a flag.
& t6 {: w/ ]5 ^( U/ t7 m5 j9 B</PRE></TD></TR></TBODY></TABLE> |