<TABLE width=500>8 R' V3 @+ ~. X! K1 k2 t2 _
<TBODY>
- P, _' x; ]/ F* k<TR>8 w. P: D% C) Y7 }% f
<TD><PRE>Method 01
- y1 ^! e$ k) m1 z, ~, Y( ]/ c=========
$ s) f4 Y' C5 w& u0 M* `! y% q( b' ], g1 r# Z$ p. }$ n a
This method of detection of SoftICE (as well as the following one) is
3 `& Y) K# C3 c7 q3 D- q0 P6 hused by the majority of packers/encryptors found on Internet.
, W, [5 j' D) H" a5 T- GIt seeks the signature of BoundsChecker in SoftICE
/ `, T" P' r, `) p* T, C. u# ?# _1 T* L, [" K8 {
mov ebp, 04243484Bh ; 'BCHK'1 ]; j: Q. I6 E
mov ax, 04h
4 Z5 V( }' L3 I int 3 , @( G% n: `8 S
cmp al,4
- V. m/ j/ x6 i% Q) W" s: }8 \ jnz SoftICE_Detected t. v0 P+ k& `' n
" I* m; M* o! [1 e c8 T
___________________________________________________________________________4 M8 }" v+ t8 t0 `* P( d& u' E
$ |( L4 d$ C u' k5 S
Method 02
* R! ]3 |, I1 n3 P. k) W=========$ a( F& C& t5 W6 q/ [) }
( ~9 [- R0 B" |% K- h4 eStill a method very much used (perhaps the most frequent one). It is used0 W7 S+ X2 z/ T% o) \
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ b7 ?5 U) j; p6 j
or execute SoftICE commands...
4 @/ K4 @) o: D9 q# W' B8 ^It is also used to crash SoftICE and to force it to execute any commands
7 ?- F; H. `( U" w* [1 x(HBOOT...) :-(( ( K$ [" N1 x/ \
& Z6 k* Y: a- k7 _ T4 {* C' a
Here is a quick description:# Z/ T. O7 l* w
-AX = 0910h (Display string in SIce windows): j8 @& E3 o7 \9 A) V, ~# O
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 s" ^ U) z' @/ g% o/ w' G' m-AX = 0912h (Get breakpoint infos)% Y- B( k, b. S* @
-AX = 0913h (Set Sice breakpoints); P0 q0 J$ d! E+ O' |6 C
-AX = 0914h (Remove SIce breakoints)( q; \- I: y2 I. t- t$ l9 C2 Z
2 J- a; B7 D0 ~/ \2 b
Each time you'll meet this trick, you'll see:8 T" c9 E2 V) f; a( |0 P" y5 j
-SI = 4647h5 s. F; c& d% g6 f) x
-DI = 4A4Dh
3 b# y* ~2 I0 z2 Y; ?1 `# oWhich are the 'magic values' used by SoftIce.
H* B/ y* n4 \, @3 TFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ K( }# `. ^! G0 c$ C# r
0 Z) q) ?6 b0 H% C( g# S
Here is one example from the file "Haspinst.exe" which is the dongle HASP
6 E6 f# t0 B5 N: S+ L4 W8 ?- ~Envelope utility use to protect DOS applications:' _$ M, \2 [7 e$ I
. D T1 e3 b( s; ~
; y" T6 H8 d1 z4 v0 E( b8 r4C19:0095 MOV AX,0911 ; execute command.+ M) r s2 D; ?6 r- U1 B
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ |7 F! @0 l+ w8 M/ c* r
4C19:009A MOV SI,4647 ; 1st magic value., Z7 e; W/ Q, ]2 Y" o9 p0 n
4C19:009D MOV DI,4A4D ; 2nd magic value.5 y( q& F0 A- Y$ Z0 }# y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 m+ w' s( p- u3 k
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
9 ?3 v* T2 {! B# J4C19:00A4 INC CX
( D6 j3 K' ] p. a! {( x0 E. z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- H9 z( a/ O8 o# u# e& B4C19:00A8 JB 0095 ; 6 different commands.: E6 c3 @5 a3 N- i; i2 A
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 y1 ^6 C8 s# a
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! F$ K/ Y) v) W% I, b
* E2 R/ |% `' M2 b9 W- U- [
The program will execute 6 different SIce commands located at ds:dx, which3 X1 z7 G/ C. x" ~
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% ^3 ^; S) h/ n: P4 k2 G3 Y( n3 c$ Z
5 W! e! w! E3 N5 Q$ p; Y8 F+ P* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.3 j5 p, n1 m0 u% k' P5 z9 t' Y" ?
___________________________________________________________________________
. V! Q$ A n4 {" K1 C# ?2 | w ~' [0 n g) Y
9 w& E+ M; m5 z, K, oMethod 034 `4 x* u( ~4 Y; L3 C0 ?! C( e V8 o
=========
& T% q, {: f/ l7 w
^& o, ~. q' o- z% iLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. |7 l" J, [- |/ l3 Z(API Get entry point)' M3 ?, Y- x# B/ `
! m" t7 f, [& E* c. A7 ~& q; ~2 }+ M4 C" o$ k: ^
xor di,di
9 n, e7 z4 a$ D) R' T mov es,di
, r; f6 t! u0 l3 Q2 k9 n mov ax, 1684h 9 [- \& `- n6 p/ ]. S: ~3 A
mov bx, 0202h ; VxD ID of winice) ]6 W& {+ x9 n D% C
int 2Fh& {- W* n/ v8 e5 H* |& U( g
mov ax, es ; ES:DI -> VxD API entry point
( `) M/ W9 C$ v+ d$ M3 A) m& H, _ add ax, di4 A. U3 W/ p6 S$ {$ D, O; h; I
test ax,ax
4 v- m' B2 t* ]$ h6 |2 p6 W jnz SoftICE_Detected+ |$ M* ?. {$ U& |
2 C; d0 B- X4 z; `( `5 Q0 S: z
___________________________________________________________________________! n) C, }% j4 L* H7 b
' e: G$ ~% D9 X' ^) ?$ g9 f0 l3 eMethod 04
3 R1 ~5 P$ L4 T' f6 w=========
# G; [2 x) q$ `9 a7 \/ h; c" H9 O* x$ T
Method identical to the preceding one except that it seeks the ID of SoftICE0 D$ A; m* u5 K1 y, F6 H1 D
GFX VxD.
, K# i, Z, k1 `
4 r$ x" }% l Z0 A xor di,di+ x/ M/ L3 c) V0 Y0 f# g
mov es,di
) @- z# F& r& }( w4 s* d! k0 } mov ax, 1684h
! H# X) O! v' ^2 A mov bx, 7a5Fh ; VxD ID of SIWVID
0 l6 S6 \8 t, S) ]0 v, I, s int 2fh+ L% H8 i8 T' I' y$ w/ H
mov ax, es ; ES:DI -> VxD API entry point' ]& z, d# t ` u
add ax, di- E2 K D) J8 C8 B8 a
test ax,ax1 a: p' R/ o$ ~( Z) t; H
jnz SoftICE_Detected
/ L! z% e% Q5 _( Y: A7 X$ w2 B/ T2 t0 Q# [1 V* R5 y. z* L
__________________________________________________________________________. @0 `: I) W, d# r' J3 }# w9 m5 }
4 l+ C: W3 L8 \& u/ _
* N3 [) O3 G6 O# v8 q3 W7 s& u, QMethod 05; p) i. u* ]0 q( ~- o Z' w+ U! I
=========
: i: F1 i' `$ g2 ?4 C2 i# Y$ U& {' B/ `8 V; D3 U) n
Method seeking the 'magic number' 0F386h returned (in ax) by all system& O' X" l' ?" H1 _
debugger. It calls the int 41h, function 4Fh.
, t' j) _9 r; K7 z7 D; GThere are several alternatives. ! G" \' H1 E: E2 P3 v
+ ^# L- O- }' H1 p" HThe following one is the simplest:
7 G: d- J& s( ?; n; g& U+ \ s6 N' x4 ~. h4 I* C6 N: I# \
mov ax,4fh' l1 o( ]( O. P
int 41h) u7 X) [! t8 o# c
cmp ax, 0F386
# @: l7 D% T! e jz SoftICE_detected
2 ?& y+ R X/ I1 M+ s# D
1 Q2 `" ]0 F6 K7 a, k! Y0 S X i0 O$ a3 _3 z: y, U
Next method as well as the following one are 2 examples from Stone's 9 j8 \! C, H, k& q( D, X
"stn-wid.zip" (www.cracking.net):* e3 K C- A/ ]* C6 b& R2 ?; i$ N
! p* _* }9 T6 X$ L9 | mov bx, cs/ z" B! Q" I7 X
lea dx, int41handler2. C3 f3 d9 a" f% {; A Y
xchg dx, es:[41h*4]
$ X- J1 c' f$ F, g- p8 l xchg bx, es:[41h*4+2]2 n1 t) V+ p C& Y" {4 R9 y/ l6 m/ H
mov ax,4fh
6 I( i$ y, ~( a. x5 } int 41h; Z* V" }2 X ]) ^1 O8 a& A
xchg dx, es:[41h*4]
5 V# R' S4 X/ v3 s" q- [* j xchg bx, es:[41h*4+2]" f- ]$ I7 t. y! E
cmp ax, 0f386h
5 ?- r" O6 x+ A7 u3 g; p jz SoftICE_detected
, x6 o: t" y& u7 M4 _6 @" r' L- \% N; \1 Y! y# |, f
int41handler2 PROC: T( K# _2 L* M/ E
iret+ E' R" Z/ ^# s* C
int41handler2 ENDP
7 g( i+ s5 F" P& `& w/ @& D6 }5 O5 {/ Z: a( d$ A1 a1 N' O& @
. C) |' ?! M% b1 W! Q_________________________________________________________________________
. Y& k$ E$ }& C2 p/ w7 B+ I) v. p* X% z0 r5 C* I4 u1 e, R
* S7 `2 K! ~( g1 o$ j+ q0 @Method 06- k) p0 G. f# N* g* L
=========
3 `( F1 n& |3 t$ y/ g3 S; @# k: v4 c' s' E3 Z1 y' I1 G1 }
7 ?* e4 [1 o2 _' C7 i% g3 T" Y
2nd method similar to the preceding one but more difficult to detect:
T. o/ z2 q5 s& P1 X. B5 P( c$ }+ M+ h
" z1 L# [6 |5 d; [int41handler PROC/ j) B' B: K) @) k
mov cl,al; G" |5 j- b2 U1 W
iret! x- h, i$ O/ l" W
int41handler ENDP9 F& I7 e) q8 A8 o1 o; Y( C4 U( P0 n
( x( g0 Z( F9 B3 ]3 u" ], m
/ c, `. v3 w+ x' M xor ax,ax
8 `" r; m9 v. m) ~3 L* ^" N mov es,ax
3 B. N x/ D5 p mov bx, cs
6 |8 e0 A5 _8 H) [1 T& U! h+ ^& Y lea dx, int41handler; |$ p8 Q9 K# ^7 e6 H0 d2 u; f- X
xchg dx, es:[41h*4]1 J2 a n3 |' x# k" X) g
xchg bx, es:[41h*4+2]
: H+ d' Q8 l9 s in al, 40h
* ?) W+ Z& ]8 h+ N1 d* |1 P xor cx,cx: ?) |: a( N+ v8 t
int 41h7 [ m- H# Z; s' K3 O/ u# _
xchg dx, es:[41h*4]
+ r% v, q9 C$ h* k! X) d2 Q xchg bx, es:[41h*4+2]* g Q( E. F- y2 Q4 D! E9 V
cmp cl,al! s9 S5 u3 J! ^4 D! s- M" ^* E/ f
jnz SoftICE_detected! L; g# C. ~! ~( e" W
: `% w4 n n/ l
_________________________________________________________________________
- K8 W$ G# r* {5 k- J! I
" k( Z* n, J. p( U3 [: D+ jMethod 077 t: m6 a, u8 V3 d& n
=========$ O* X6 x- d5 ?+ I
* _- q6 G, e9 L* V& q4 BMethod of detection of the WinICE handler in the int68h (V86)3 A8 z$ P" F1 }! I# h# g: t0 a
- F; E H5 Z3 n7 |$ T
mov ah,43h
. |6 g: D3 ~: D' e int 68h
, Q l3 V2 c: X8 _& s cmp ax,0F386h
* l5 s9 K% ^" g jz SoftICE_Detected/ J2 e: S& B0 U! ^4 k
% T: }+ N4 J: I5 F2 a4 L! m
1 _* m6 `. m2 p' P8 u=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 p6 ~! f1 j, o5 Y- l" j# P5 ], M app like this:8 I; T2 e k9 `' z
# r, f, Q& V: u7 e BPX exec_int if ax==68" D9 Z" o S+ x ^+ B- Q9 _
(function called is located at byte ptr [ebp+1Dh] and client eip is
5 [3 c; i c! b q7 S( | located at [ebp+48h] for 32Bit apps), N# m5 N; U3 O2 \2 c% R0 O/ i
__________________________________________________________________________
- _$ }( k. I1 i3 \: x5 X$ L8 R2 d# u( l
' g" I5 J2 |4 \' B
Method 08
, V8 f/ d/ k: j# l( s& w=========4 c9 @: D4 Y! B/ I9 e
# k1 ^- ]6 W) C- ?% ~! b& LIt is not a method of detection of SoftICE but a possibility to crash the; B, c4 u+ ^6 B! Q8 B
system by intercepting int 01h and int 03h and redirecting them to another
9 d6 g' {0 G# w4 r/ {routine.1 F9 H# Y& |# M( n4 Z6 x
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 ?& w: R1 T6 ?' _to the new routine to execute (hangs computer...)
- d% @+ x' a+ Y4 ], h7 l+ {/ L
7 E, N- D6 a( p mov ah, 25h
9 f0 Y( C! G" c mov al, Int_Number (01h or 03h)/ D1 |, _. m6 M6 d I& N. L! ]7 W
mov dx, offset New_Int_Routine
' {4 G* E$ j) s int 21h
# \: X. V/ X# [1 @# G8 O- U# K% P8 @7 F, b
__________________________________________________________________________! W& v, o2 \# l4 o; A2 _
3 d, _ a' O% N7 p; n8 t
Method 09 U' w8 }/ z$ t+ p% C i1 R4 E* `) s
=========* A; Z: `% e8 a D, {% E
1 A4 I k3 p6 ?+ y" pThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" f; b8 v" p( i" A, Mperformed in ring0 (VxD or a ring3 app using the VxdCall). V3 U! C% z! S/ j
The Get_DDB service is used to determine whether or not a VxD is installed
# z, j0 j) e. M* S& D( O) {# Nfor the specified device and returns a Device Description Block (in ecx) for- [' w% _' m3 \8 E2 H- `7 v
that device if it is installed.1 ?) R! q3 h" S8 J: O) H
" Y3 U; u2 e6 S) l3 T( |* W9 l, j) r mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 H; N" O6 @/ j# m
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ I! Z' u; I# X) f( V8 e) U VMMCall Get_DDB
2 M2 i5 _# H7 B+ t mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ t& o0 k1 E% ?* H7 p2 F* ^8 k
8 B. p3 v) \8 O8 ~; ~5 b5 ^Note as well that you can easily detect this method with SoftICE:
, E5 j$ f6 I( ^* C8 y" \ bpx Get_DDB if ax==0202 || ax==7a5fh7 I9 _! I0 E0 a5 |; Y8 g7 N
0 O7 W1 w" m, L
__________________________________________________________________________$ T# G+ F: \- y
# P d. J9 u& o) N% u7 G7 {/ `
Method 109 t. t+ |: e* k9 |4 W
=========6 f& G* j0 `. K9 G6 g( u3 b
# P6 v. Y9 ^7 M& J=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 B" {+ N' A1 y! m6 | SoftICE while the option is enable!!4 u( z2 y7 q' W- u- P0 }
9 m8 Y* e% L6 G* m3 k9 G3 r3 ], XThis trick is very efficient:5 Q6 p) }% k. \4 m
by checking the Debug Registers, you can detect if SoftICE is loaded
5 R8 t" ]' ` R {9 J+ l, }+ _(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; y0 n/ u+ a0 u
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# X( ^# P) K$ \) Q6 D7 ]value (in ring0 only). Values can be manipulated and or changed as well
' Y% t9 }& r0 Z% O' ` |(clearing BPMs for instance)
. X W8 m$ h, `8 v( X2 H+ A3 x
/ z/ f0 x# Q3 Y9 ^; z+ o; r__________________________________________________________________________8 w' V: X! V9 ~
( d1 Q/ l9 a( `+ }5 y8 z8 X
Method 11
7 V+ L; f6 ?7 `4 E=========" \& A1 ^1 ^0 C, O; u; O
Q4 ?, T9 c2 y
This method is most known as 'MeltICE' because it has been freely distributed( `- O& k& I. G" L4 m- T3 B4 ^
via www.winfiles.com. However it was first used by NuMega people to allow8 H6 X9 E! b$ a: `
Symbol Loader to check if SoftICE was active or not (the code is located; l# Y9 i+ J4 C
inside nmtrans.dll).& O- e, N; V! U: B' y9 _7 e
. x7 _$ r* r( j% u8 Q9 j
The way it works is very simple:
- o1 U( h6 R: w! e* J) j' tIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) e2 F) Y' q; j% JWinNT) with the CreateFileA API." J3 G& H2 O) f! y8 q1 s9 H4 O
& P% v& W/ _+ h2 [6 G8 o: `
Here is a sample (checking for 'SICE'):) l$ O N) k# P! }3 t
' J; s! y2 K; a I) Z
BOOL IsSoftIce95Loaded()6 |1 H$ j p% e. m' P" b; a
{3 n4 n1 x& J* j
HANDLE hFile; 0 C7 _ _ N' g) w
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ S* b+ p8 [$ A/ c9 } FILE_SHARE_READ | FILE_SHARE_WRITE,
9 r3 X" y6 ?) S$ l% }( ^6 @( o NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' H0 ~3 A, [* w, Z. T1 v
if( hFile != INVALID_HANDLE_VALUE ) J5 D4 u6 m: W% `
{
2 e( r% i8 k: w4 X3 p6 H4 N+ ?4 M8 p2 T CloseHandle(hFile);( J r. g3 n4 ], T* l% ~3 K
return TRUE;' U0 M' x3 x% m/ E* i, i0 ~$ G3 R
}
9 c5 F0 u/ ?3 c return FALSE;. w4 ]# f, X" V; z
}! D/ Z" t( i; O, M7 k
9 q. Z/ `& |/ ?1 }' J7 D; S# D/ ~Although this trick calls the CreateFileA function, don't even expect to be' P9 V) h& r, Q% i+ N7 R4 W
able to intercept it by installing a IFS hook: it will not work, no way!
6 |4 I0 U6 v0 yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 U7 q$ d: K6 {1 c! Z/ O) wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
9 G+ W8 h5 R6 ]0 k+ l9 tand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ N, v0 U& ?5 j% S' n" B& z
field.
! N% n8 ]' t; M" x' z+ K- pIn fact, its purpose is not to load/unload VxDs but only to send a
. U+ f' A' H5 V+ L" JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 Y3 C9 N7 b7 `6 M! X; h+ z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 K9 I% U9 T1 `# @6 S
to load/unload a non-dynamically loadable driver such as SoftICE ;-).- t/ ?* ~3 r3 }
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; C9 F; j4 j- X) z5 ?' Iits handle to be opened and then, will be detected.
% T5 t5 s6 L- gYou can check that simply by hooking Winice.exe control proc entry point
5 W1 M7 E7 ~; |2 r" S) rwhile running MeltICE.0 n- [; x5 S2 ]" |" U
3 X% r2 D" W+ e
" }$ r% R1 o0 G5 S9 k4 _
00401067: push 00402025 ; \\.\SICE
: ]4 d7 v+ `7 c! }8 i- r4 S 0040106C: call CreateFileA
. v, O- [ a' G" p3 r, u. } 00401071: cmp eax,-001& @/ R, v% O1 x: |% N& d. {7 Z
00401074: je 00401091
2 {# A1 K( f4 p6 L& m2 ^ U7 \5 D" a; y) J# `- V
, ^! b( E' h4 D) Z7 _8 ]2 q3 H
There could be hundreds of BPX you could use to detect this trick.3 P2 y% W3 s1 K
-The most classical one is:
( k b- c- O _+ A- W' n& E BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* q3 m- ^3 D9 o7 o! j *(esp->4+4)=='NTIC'
3 O0 Y1 E/ j! \, _9 M
5 e/ \7 a( Q8 j5 T2 b-The most exotic ones (could be very slooooow :-(3 r% e# N! u% U% Z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ w6 R6 W, B; @5 M7 r ;will break 3 times :-(7 ^4 k- X9 M* k" ^
% x* l7 c2 d0 M% Q# ^) K: _-or (a bit) faster: 1 _+ ?. \5 `3 D/ I' l P
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 d9 E& C, w0 V3 Q, b
8 C, c C# n7 z. S) t% R' e
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % l0 ^* g( T1 T. H' |+ t- [& x) B Y
;will break 3 times :-(
* e2 i; h) O2 D5 H; z" W8 a
$ U. n$ O9 a( e3 \( S- A9 m-Much faster:
& Y! {! C+ g8 r, K1 E7 } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( q0 d* T) U3 m* a8 Y
$ G3 m8 w! M, W( SNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
# k: n R, o3 I0 kfunction to do the same job:
- M! s( E y# r, o
' H, ]# ] X- Z5 R2 A3 o push 00 ; OF_READ
0 t/ @7 s% @) {. s% n0 l mov eax,[00656634] ; '\\.\SICE',0
( t+ y+ P+ K, i push eax
' c0 [7 Z- i& O; M9 P call KERNEL32!_lopen4 G, ~' z; _! I" ?% a
inc eax" q* ^1 _* ?9 R& ]
jnz 00650589 ; detected5 s( ^! E5 z2 ^6 F; A
push 00 ; OF_READ
0 q; t: V$ h8 J! F7 J' z- ^7 W mov eax,[00656638] ; '\\.\SICE'1 o5 Y# J/ h. H; |
push eax* j9 v8 S3 {- o ] p
call KERNEL32!_lopen
% l. y$ P6 L, {4 u inc eax$ V! {/ n# D& G6 Q) Z x
jz 006505ae ; not detected4 p- j( F" [7 _8 }* D
; ?! I; p) F% S& q! b1 `, U# u# h
, r0 m7 G# g0 x% L X3 q+ C$ H* u__________________________________________________________________________3 B( o7 w1 s& v- M" M; l
% D5 c% y! t, ?, ~* wMethod 127 p; J7 F+ ]) _7 n
=========
5 M' Y4 {' B! T8 |" Y4 E: p& g0 g, |7 Y S# F( J. T
This trick is similar to int41h/4fh Debugger installation check (code 05
$ x5 F8 ` e* G! j& 06) but very limited because it's only available for Win95/98 (not NT)
J/ @. h9 D) q- t/ {7 \4 L1 C" Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 j, A; `. [, H( X
) V. b( s2 A! ]6 _" I' ?
push 0000004fh ; function 4fh
9 D3 |( m7 M8 \# y- }0 B push 002a002ah ; high word specifies which VxD (VWIN32)4 p9 p3 R1 I R: t* d' m8 X
; low word specifies which service
; \9 D+ v! a) t1 d (VWIN32_Int41Dispatch)# @0 |# Z( O$ j0 @0 F' p0 W- u& P
call Kernel32!ORD_001 ; VxdCall
L. ?& M& e/ S7 {. `4 J6 B cmp ax, 0f386h ; magic number returned by system debuggers
$ H5 b3 u" A+ k jz SoftICE_detected& X0 |/ [3 m) o) U
" k8 `$ V! M0 ~0 K1 v% j8 y( z
Here again, several ways to detect it:* U R. U6 G& n; ~9 F/ q0 h* z
- s5 o, n, M5 G4 b1 Q. L4 ~* ]% } BPINT 41 if ax==4f2 ~* ^; h1 N9 Q7 z2 u( h
, Y; l( {4 W8 ~6 R7 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one$ A8 }9 I* S& ^: ^5 ]
" b7 @% C' n* ?2 _( {
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. B7 J% j# B( U
( u* s4 F! `! [+ \7 H! t* I: ^ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ s$ k) t# a1 W- i+ N& t
5 f8 w" ]7 ~. I__________________________________________________________________________
* ]0 W! {# Q$ {) r/ F0 X/ l. L! N1 F% q" q: R+ o
Method 13
2 |$ q% H$ Z( S T1 N6 U. K/ H=========8 B* x6 f. [7 `+ s3 z
% n; _7 i6 O+ E6 u* h( `
Not a real method of detection, but a good way to know if SoftICE is
, P3 h' d1 ^, w3 f- hinstalled on a computer and to locate its installation directory. q9 _" K `% p/ x& U
It is used by few softs which access the following registry keys (usually #2) :' S& d, R# Z) d) x, |8 B
- S% m3 T. I1 p% c% k8 [# W+ k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( H9 B- C# N$ i: X( C8 l! B1 C
\Uninstall\SoftICE
2 B' A/ A0 K) \ E8 A- C6 B/ \% R# U-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ O3 G* Q; F0 P" k- b$ {0 E9 w-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 P& C) d) _9 j8 c! i1 w- ~, p
\App Paths\Loader32.Exe
* ^/ c9 Y! [# @" I, y2 [& d; [( K) P. h# A1 L4 }& {0 L/ E
0 N+ B1 D- s) X+ u7 t' y
Note that some nasty apps could then erase all files from SoftICE directory
" |8 c( z( t& L g(I faced that once :-(
. ^! I7 `+ d( C% J# n3 J& Q3 ~; M: |9 ], F! F' q4 O* |' s
Useful breakpoint to detect it:
5 [3 v# t# g0 n! p( b* C0 d6 ]3 p1 \: ?3 |3 ~# o( h( a: v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# S5 i& S% `- ]5 F$ {7 [
7 d" ?. l/ D& M; W8 I4 S5 X
__________________________________________________________________________9 e! ` ~3 z; [9 {: `; Q
2 J2 R1 s! U( y/ ^' i9 z Y8 J m( H! p
Method 14
6 G- U) g0 b2 |" R. @1 _$ X=========) {9 R: O6 b# {$ G# n8 L
3 _( T9 m' [1 P& s$ D7 eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 }3 c+ f/ K% P3 X8 A$ u3 o
is to determines whether a debugger is running on your system (ring0 only).; H# w7 j$ F$ M
8 l+ u8 _7 u& J
VMMCall Test_Debug_Installed
, B, \' c/ z L$ A je not_installed+ e! ~% r N$ S0 ^1 P Y$ ]
$ B! y+ F; V. C2 O2 w6 Q3 |
This service just checks a flag.( O* d7 |2 D- w3 K. v @
</PRE></TD></TR></TBODY></TABLE> |