<TABLE width=500> `* \+ G0 j9 L d, [& r. h: L
<TBODY>
) B y+ E% m# G. Q: U, }( ?/ A<TR>
# V; J$ W' N) A. B) r' T2 R, P6 G<TD><PRE>Method 01 ! ?9 z; S8 d' W2 W2 b" Z: l
=========
& M9 Z' D: y; Q* P: q: h3 a/ m9 y5 z
This method of detection of SoftICE (as well as the following one) is
, H0 [6 m; }' z5 z& Q2 N8 v# u& nused by the majority of packers/encryptors found on Internet." c! x1 |5 m) K f5 e
It seeks the signature of BoundsChecker in SoftICE
) y% h' W& p( L9 ^3 a- s) S8 Z# N
mov ebp, 04243484Bh ; 'BCHK'/ i- g# Y+ B& f k, j9 k' {5 D
mov ax, 04h
2 A0 G# q1 U- H+ ^" w, k H int 3 ( n3 }! U ^# f: E+ G' ?
cmp al,4! y: t& n! Q( Q! X9 d" ?1 s+ F
jnz SoftICE_Detected
; [( V- [& f7 H% n' E5 a* G
# ]6 n* A* ^5 u9 k___________________________________________________________________________
: Z8 _. z0 ~, x% H- C
N, b2 {7 n) a3 sMethod 02. A/ q+ U6 I' P; c
=========3 m' [" r. S$ z& `) D3 ~' e y
. Y8 F5 |% s A
Still a method very much used (perhaps the most frequent one). It is used- r2 h; i3 k$ {7 l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,/ Q' m0 i/ {0 _: H. h4 n
or execute SoftICE commands...( [) O, e/ e* e2 o0 T- ?7 ` o
It is also used to crash SoftICE and to force it to execute any commands3 a7 d8 S9 c9 G% o" m- O8 a
(HBOOT...) :-(( + x% E4 e( ^. n) k2 A
$ x3 M/ P$ w" `+ K6 R! e4 f7 ~' A
Here is a quick description:
; V' I$ ?- R5 a# k/ h-AX = 0910h (Display string in SIce windows)
/ W6 {( a* t) D-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)* W1 M% V2 R7 H( h
-AX = 0912h (Get breakpoint infos)
) L+ q( E/ F3 a6 ?* t-AX = 0913h (Set Sice breakpoints); U0 l0 O$ e# a/ }0 X/ z
-AX = 0914h (Remove SIce breakoints)) U3 E; Q9 E; c- ^
; U3 e% q* U- L0 REach time you'll meet this trick, you'll see:, ` _. R% t6 z
-SI = 4647h
! @8 f1 W6 y! B; C-DI = 4A4Dh
( T8 l* |! }- k7 tWhich are the 'magic values' used by SoftIce.$ ^( Z3 V' x1 e# |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 K+ L- W$ s7 U% h& x$ V
( t' a8 K# b% ~. B7 o* DHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 c1 J( a9 E7 r% z, yEnvelope utility use to protect DOS applications:8 T1 x1 T9 [0 t
$ N' H6 B) @2 h' E Y6 t% E# X/ y, K1 [7 s
4C19:0095 MOV AX,0911 ; execute command.
) ~5 Q. B: q. C- D- o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
& u7 ?* V5 X$ O% ?' F8 i7 p) x4C19:009A MOV SI,4647 ; 1st magic value.# c% ?2 a4 p5 \! H. Q9 M
4C19:009D MOV DI,4A4D ; 2nd magic value.* e5 _% K% K2 k( x
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' f4 @* X9 N9 c( D3 \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 h* _/ b! O9 f' a6 ^5 a
4C19:00A4 INC CX
; ?+ J: X) Y s0 W4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- q1 Z( F0 x8 K! Y6 `" n
4C19:00A8 JB 0095 ; 6 different commands.
; u( I& @' Z$ v( g; o# y6 R3 }4C19:00AA JMP 0002 ; Bad_Guy jmp back.& ~4 m+ B# v4 f6 G
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% A; k. T; e* K8 |) K
' o% q* N* y) [( K1 `The program will execute 6 different SIce commands located at ds:dx, which
9 ]( W# p- s9 A4 {4 d+ {) oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 U5 C' V7 _! P$ ^& `; h
8 z q& O7 m* l# c- ~2 k( T- e; u+ W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; s! w: r6 g6 K) B. I9 C___________________________________________________________________________
0 X9 B/ ?" ]/ g+ x& ^2 f" B
4 s( _$ c1 [5 F. a, R7 ]8 F$ S, x' u/ y8 m* _% h3 p
Method 03
. R& i$ l+ a G=========* c7 d& `" X# V
7 [5 i d& a& Q6 _2 D2 T( hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ r5 ^) d1 q3 Y! f, W/ L: U(API Get entry point)# Z: f4 L0 i5 p: p
?! M3 q' G* R3 g- d, i
* w# A4 k, ~$ Q9 }6 }5 s
xor di,di
. S% ?5 {- A: L9 @( C* W mov es,di# S, W" N9 O* ~2 Z) S" J
mov ax, 1684h - N7 P/ G0 C# f" F
mov bx, 0202h ; VxD ID of winice$ ~9 Q, b# q0 a( D8 X- h* ]
int 2Fh) X% j% Z, P0 P% `" D4 V4 z
mov ax, es ; ES:DI -> VxD API entry point3 O) |& P0 E! ]% b/ Q8 p. t4 [
add ax, di0 y2 W7 b; Y4 m2 ?' \! [
test ax,ax
j( e. I: J: `& O$ }) b jnz SoftICE_Detected
) m+ r! c" O) s9 |) J- A# B; z" \9 O) }: u; b2 Y( @ N; i
___________________________________________________________________________2 U, z y3 i# J6 Y1 ?
: C4 u/ a6 j" I3 N& e5 a7 n+ g' S8 `9 p
Method 042 R* h" ?& b9 ~- _0 d5 h6 b
=========1 C6 f) B, k8 a
2 G- D" A- p" f2 H5 w
Method identical to the preceding one except that it seeks the ID of SoftICE; x& y, p n& h, H5 h, D% N
GFX VxD.2 ]% I0 R6 d7 |
' o+ O" t; |1 G& k
xor di,di2 i4 V! X2 [5 K+ G' }
mov es,di3 P7 l) q" U, }: i9 I1 I
mov ax, 1684h
) F" k8 j' k8 W6 O R( R mov bx, 7a5Fh ; VxD ID of SIWVID5 g( V+ z3 w3 c' h
int 2fh0 R. ]2 w; [) a9 h! `
mov ax, es ; ES:DI -> VxD API entry point9 S3 i- f. N( Y" ]) \! ]8 |- U
add ax, di1 D- F2 f6 U7 u, c! Z
test ax,ax- m# |4 T9 S6 x% C
jnz SoftICE_Detected
) c: }2 ^" \$ x- X z0 j& U! T
" D) A- _/ M" x$ Q: N__________________________________________________________________________$ C4 l2 i( y( y4 l/ I2 x
. Q7 g" S( A3 {' |) U, I7 h8 o4 I+ {) M8 |% C/ I( |8 J( |6 r1 V
Method 05. D9 h( U7 h, `0 N" J& Y7 g# L0 [
=========6 k1 ]7 w' l' H: H! ?% R, i
9 k* E3 x- U% y7 L) T) t" I: OMethod seeking the 'magic number' 0F386h returned (in ax) by all system
8 m E" E7 f- o' t; Ydebugger. It calls the int 41h, function 4Fh.
& R9 w. @8 f: i3 z4 DThere are several alternatives. 1 H* U! W& c, D$ S
5 g: u: z# X& e0 q
The following one is the simplest:
0 ~8 {0 M/ g$ @+ y( g) K$ A5 i0 v; e# P5 r% [3 r4 ~
mov ax,4fh6 b9 y6 l2 S, @9 z. G
int 41h
* @/ p& y8 h, ?( `8 }% m. y i cmp ax, 0F3861 [8 k5 i2 c, I4 E4 C) J0 z
jz SoftICE_detected
+ f! K8 n* U( g _- `) k, u- D# O C3 V. [, p
7 k" a5 e1 `, E: n4 \1 z# p1 Y L
Next method as well as the following one are 2 examples from Stone's 4 P/ i( s- i1 E+ R/ A, X
"stn-wid.zip" (www.cracking.net):
( m1 G% S. T' g" d4 o, U4 E+ b$ a; _8 f& P: E
mov bx, cs
% R I% I) }% m1 x$ E4 h6 b+ ] lea dx, int41handler2
0 z, B4 P1 m3 j5 p, n, s& Z% {' w: [ xchg dx, es:[41h*4]! _% l. K2 d5 ]( {5 a( t! U4 W! n
xchg bx, es:[41h*4+2]
S* _1 W9 ~1 z5 D+ [! K& l mov ax,4fh3 T M% w# I2 q$ p$ y# ~3 X$ O
int 41h
, r' U& j1 e2 d& J, U, y xchg dx, es:[41h*4]
2 y* @+ U0 C, F0 @3 V7 x xchg bx, es:[41h*4+2]0 F. G$ j8 [7 M, W
cmp ax, 0f386h, u6 K) ?; F$ h! I- N
jz SoftICE_detected
' U* U' h' T) T' M1 S2 d9 G6 f# l7 t8 g6 u2 b" n
int41handler2 PROC
$ ~; k0 B" x. h. @9 x/ c q3 i0 Y iret, M/ ]1 ]' F7 G# U
int41handler2 ENDP* B% q( T' ~7 u5 C+ H& T. H. V5 D& u
- J, g) E7 |) w$ A* w" S1 g& W. k4 j F1 D
_________________________________________________________________________* L0 @' j' n8 D" E! j
1 u1 J$ h* n6 U9 F \+ L2 ?# d
/ A9 G( k' U2 C3 J3 {+ Q& A/ K
Method 06
$ S9 U* \- O% O4 J/ ?7 ]=========4 u/ p' x8 V: c1 b5 [ l" z
. y; b3 `7 f. D, Q& c c
) y# c6 V; y C* N' C7 s0 [2nd method similar to the preceding one but more difficult to detect:: @! \$ N' q' N$ {; m2 D% S
8 I$ D- R* j1 I: g( O4 S5 U" B8 u( f0 O& Q" D
int41handler PROC
$ j* y" i2 e9 ?9 U$ X mov cl,al
. Y) F- U% ?; R7 W1 X7 _ iret u/ T) ^4 n( N# s- V
int41handler ENDP4 _- S! {8 g% B
; `, }" {! s- A) o' q
# _ f7 d9 p* w# G) R8 e I
xor ax,ax
: n2 ^; `+ a+ h5 b+ z4 Q2 _% g, X4 z mov es,ax
4 P9 k; v! D6 B mov bx, cs
: V( {! n2 ] U- X( K+ t _ lea dx, int41handler \6 d% v; i. r6 W
xchg dx, es:[41h*4]
% {) E1 L4 ~" [- q! }- ]4 C xchg bx, es:[41h*4+2]
% c* P$ J W% ^! h3 C0 R in al, 40h0 J: K0 u8 n0 S1 t `5 I: |# Y
xor cx,cx" x$ l; d8 `4 B! x8 e
int 41h
1 L; Z6 }% s6 v9 L xchg dx, es:[41h*4]
$ S9 i& y% {! z: l# y xchg bx, es:[41h*4+2]
2 @; S4 H: u& ~+ ~4 K' c5 m( e cmp cl,al- I( t6 K7 `( w: S
jnz SoftICE_detected
& `1 r' U$ M5 H/ l. _" q% u! l/ l" |+ H o. |! B: ^
_________________________________________________________________________- l7 c! X! ?$ i0 c6 N. g! O
: N8 e s5 W0 s8 HMethod 07
% t0 U* Z) o3 n" O% A=========
% u1 a5 ?) A- h2 j* t4 ~* x3 B) l+ Z+ B+ q. B- [& P
Method of detection of the WinICE handler in the int68h (V86)# B, V" @- k: A
+ B8 D7 ^8 t, g3 n6 M
mov ah,43h1 Y$ n4 G2 @ e- t- \; i: U) z
int 68h. m" z. @" m) Q6 t; V. F0 K
cmp ax,0F386h% a. {: f5 y3 k% O. K
jz SoftICE_Detected; c8 {1 u! d7 a4 \9 F8 m
& P3 k, d0 t5 ^- e+ d8 ?
5 d- l- R2 e1 h5 H& K7 G. D=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 z3 G# w6 ^) Y app like this:% d% g7 y4 s% g: g' C
" B9 D# h4 w1 _+ V1 U; ` BPX exec_int if ax==68
5 W6 y& K1 N" K, z5 ^& t. q (function called is located at byte ptr [ebp+1Dh] and client eip is
$ p2 n& {5 o: ^+ `/ R located at [ebp+48h] for 32Bit apps)$ R J+ k# I1 `) W& u7 B, ^' S1 j
__________________________________________________________________________- L+ w0 G: }# f3 K$ H8 `: ~
% K: Q7 ]7 f3 d! p& `* T
2 U5 x4 F! j- K. j" YMethod 08
8 q# e Q; G' S; z6 F=========
' E. K; u3 e- [ O
m2 a+ y0 P/ V$ X" }% q9 H% vIt is not a method of detection of SoftICE but a possibility to crash the
& X8 u5 {* W% {% _" U* O2 w$ Vsystem by intercepting int 01h and int 03h and redirecting them to another
, [! O) O; d& r# Oroutine.! R2 _; _4 o6 A, g$ R) @8 l% p9 S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
]3 k0 u) M) V" e" A4 uto the new routine to execute (hangs computer...)4 E1 x& i+ h, |* y& V
0 b4 b. w+ ]# t' a6 P1 Z: y mov ah, 25h
% `& a9 Z# m9 Z K& `: | mov al, Int_Number (01h or 03h)9 |9 s: P( ?9 i, W
mov dx, offset New_Int_Routine" i. @5 K1 T0 V& ?- X5 ^' C
int 21h
+ b, ^ t# e, ^3 Q& c; {7 y s! J6 G4 }
__________________________________________________________________________4 H) V- T% ^5 w. p2 ]; j
0 e( p; |4 G4 i: h9 Q c
Method 09
; S4 n& g1 w# S6 m* X2 t# S=========" R9 r, Z3 k: {$ P
v- B6 p; j) L; |
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 \) X( N) K* ]4 a) v4 fperformed in ring0 (VxD or a ring3 app using the VxdCall).& L: D1 [- j# H" n, l3 z2 b
The Get_DDB service is used to determine whether or not a VxD is installed
3 c8 W! O3 r$ N" D, a! |9 kfor the specified device and returns a Device Description Block (in ecx) for
+ C% S/ V ]) q( B1 C- Jthat device if it is installed.
2 i8 j4 O- m) ^% U( M H! R5 n, N) R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) \& Q$ O: e. H1 A4 ^% l2 s
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# O# ?) F8 b1 U9 z VMMCall Get_DDB4 y2 U5 Y+ X) r" w
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed5 x$ f$ [5 |& `% }/ x
9 l: t* @! c" d& L& X! F* Q
Note as well that you can easily detect this method with SoftICE:
; B5 I8 v0 W9 T7 |- z& q bpx Get_DDB if ax==0202 || ax==7a5fh' }$ ~% ?/ l4 S; q" m9 |- H
% S. |+ D4 A2 r# T
__________________________________________________________________________
$ |% l/ h9 w2 Z+ J% I. w9 m# Z: k! N0 F* A5 `7 y
Method 10
+ \) u7 ]0 v1 d* @3 s% f) h=========% W2 }' i$ f$ z" Q& g- t" y
' ?( g6 m. B% o5 _/ x=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 q2 f) ?% J- | SoftICE while the option is enable!!1 M w5 x+ A; N' r& v( K
5 p( a! L( D! o0 JThis trick is very efficient:) n0 u4 Y' Q* O: W, ^( M M
by checking the Debug Registers, you can detect if SoftICE is loaded6 m* M% P% k$ v0 R) y- l% P3 V' t/ t9 c
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( P% A1 C# j- J4 e7 H( v
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# J0 q, |0 \) m# f& z5 `value (in ring0 only). Values can be manipulated and or changed as well" `" R, Y, z, s6 r' Y( H+ |5 i
(clearing BPMs for instance)! a* m! x2 e+ u% a. X U1 P
# ]4 ]2 M$ m* Q1 n. v0 ^
__________________________________________________________________________
% h8 Z3 Z$ m% X8 S/ T) v. X K5 o. ]7 y3 u1 W% l9 d j% b
Method 119 a/ a: O/ g* z) ^
=========
* h) e4 k7 j, ?1 p4 ]
: S( a, Q; C: ^& w! z. s$ QThis method is most known as 'MeltICE' because it has been freely distributed
) p* s# K, B% U: Rvia www.winfiles.com. However it was first used by NuMega people to allow
* K' F# a4 _* Z! XSymbol Loader to check if SoftICE was active or not (the code is located+ R! T4 W( ^8 H. G. f2 G6 g
inside nmtrans.dll).
0 ^' Q2 w& q. a
T: g; l' U T$ M7 H( m0 jThe way it works is very simple:
0 F2 T2 y3 ^; ~8 V& C9 _It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; _6 {. f) Z4 I8 cWinNT) with the CreateFileA API.
- B5 t" f3 y0 i5 |" E
3 \5 o3 }+ g7 h2 lHere is a sample (checking for 'SICE'):# V: @) n( w% r& [7 U1 j J
. z! G# O9 V4 c9 r/ K, }* p( `6 x4 mBOOL IsSoftIce95Loaded()3 V- R0 R* ~% e* a. d# x' u, `
{! B( F1 l; a4 o4 g6 ~7 K
HANDLE hFile;
4 ^6 J: g6 l7 `) a# _ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 h' j! ]) L6 U g* a% D
FILE_SHARE_READ | FILE_SHARE_WRITE,/ u4 y3 Q/ A4 k; S2 p1 ~; u5 [9 t6 p) q" V
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ I* e+ b& i7 d6 z. O& G1 p. I2 {: m
if( hFile != INVALID_HANDLE_VALUE ). J5 I* Z! J: g( ?" e& t- K" X' H
{
Q X7 ]& M( f CloseHandle(hFile);
. H! g+ l" m& y& l+ R return TRUE;
4 @2 ?5 @: t p }8 b$ ] p4 j8 U7 `- p v
return FALSE;& ^: a5 x, ^ i) l7 s1 o, D
}
; B8 y8 z$ g L3 C8 C0 J* \2 E& Q
( q! _+ r4 D% R# W: v/ s6 nAlthough this trick calls the CreateFileA function, don't even expect to be
: R' }% q! r! B$ U9 fable to intercept it by installing a IFS hook: it will not work, no way!
& ?8 r$ r4 P3 n" n _ z/ O6 F1 bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 W @( _7 A) y8 H' Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 ?2 e& v8 _2 V. s# W
and then browse the DDB list until it find the VxD and its DDB_Control_Proc' E$ z: U& G6 X" @
field.
) Y0 V7 R5 z0 g* y( O( n* v3 D/ y% |& GIn fact, its purpose is not to load/unload VxDs but only to send a ! q5 {+ l1 J, A5 H8 l" j8 N5 m
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 y: }5 [, X* B- fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
* r; x, T+ ~$ S5 p* O5 v9 K6 |to load/unload a non-dynamically loadable driver such as SoftICE ;-).$ I, |$ W2 B" g8 j9 ?: \! O0 n
If the VxD is loaded, it will always clear eax and the Carry flag to allow. y7 r$ C1 z- {5 o; y) H
its handle to be opened and then, will be detected.9 {4 V- D4 W. D9 m
You can check that simply by hooking Winice.exe control proc entry point: Q m7 v" s& s) q5 L3 A
while running MeltICE.6 `4 l/ ^9 g1 R+ f6 _% P
. t+ T) D9 m1 n* R0 d, L
: W8 X+ O6 y R$ m! A, v 00401067: push 00402025 ; \\.\SICE
8 p3 f$ `% Y* U+ P, l. a4 ? 0040106C: call CreateFileA5 h' ^; k3 ]6 T
00401071: cmp eax,-001' w- H8 e! _" _' s3 z6 [! x. ]) y
00401074: je 00401091 V/ O8 p8 b5 l: R0 l
1 t _8 `) U4 s' v
2 c* n# ]% h/ d7 U; GThere could be hundreds of BPX you could use to detect this trick.
) j0 L( X( q' ?. z-The most classical one is:
8 t4 E6 r9 }4 w* f BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) r! u$ Q9 A, k* n: H8 G1 X6 _
*(esp->4+4)=='NTIC'7 U1 d0 k/ S" f5 i. ~
- M0 _& @+ Y0 u4 P
-The most exotic ones (could be very slooooow :-(5 m' s7 a) `" ~0 S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' C/ e, s0 N: F* j/ }- R! t1 O ;will break 3 times :-(; o4 [* G6 T$ N& T6 ~
8 s$ U7 h- }8 `8 z
-or (a bit) faster:
9 [; S2 \/ ?3 l2 ^/ h M6 }5 Q BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); ~" A/ S6 p7 C; a
" Q4 L8 j& I% v0 ~8 ]
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ?* I& t; p; c4 `! i! ^
;will break 3 times :-(9 L* T. h0 a7 s+ Z
9 A7 n1 a, {4 @2 R! k8 f9 N-Much faster:+ Z9 g, Y' \4 x5 G' q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' g) `$ ^# k. I0 y1 Q
( H3 O) ?, o4 G( T3 y" \+ V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 Y% K8 h: c! Q J/ P/ O% A4 M- zfunction to do the same job:! s1 R/ ?, V2 H7 t
: L9 ]% L0 S1 X, j8 W7 ?
push 00 ; OF_READ
# S# I0 X7 O Z: b" c mov eax,[00656634] ; '\\.\SICE',0! ^" x9 M1 W, F$ {* j: R+ U# {
push eax& [# V9 D! p, p. C$ V" z6 _
call KERNEL32!_lopen
3 s$ x# d% T' Q4 [9 {! p( _1 i. B+ { inc eax
% E; u6 b" l2 g3 r. C jnz 00650589 ; detected
* s( s) L5 Z& x, I push 00 ; OF_READ& G6 K1 u8 O) N2 n8 l; p- s, v% [
mov eax,[00656638] ; '\\.\SICE'6 _5 X$ j+ a9 b; w* T: Q
push eax( k5 \# D$ D8 r% q4 L @
call KERNEL32!_lopen1 y0 X: O$ ]; X6 r1 X. l) N
inc eax
5 }2 S0 `3 n- u jz 006505ae ; not detected
$ E) ^, i' x; T; Q! ^( Z, U1 E
( C/ a9 ?8 {" j8 m, ]6 W, t2 D! n `1 `0 a6 }
__________________________________________________________________________
2 k. P. L; }6 [
( b9 r6 T+ @# |; LMethod 12
4 k/ @: l2 P! T I=========
/ s; [* L2 [0 ^' P5 Z
3 q& O+ h" W- I0 W8 mThis trick is similar to int41h/4fh Debugger installation check (code 05% ^$ F ^9 @5 P1 g# P. }
& 06) but very limited because it's only available for Win95/98 (not NT)
3 h% U- X- a/ s2 e' `as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* B; [( j$ \# k* J( k' n
' F3 R8 |; w5 d) { push 0000004fh ; function 4fh1 k3 {4 j) {- k; [% j
push 002a002ah ; high word specifies which VxD (VWIN32)
/ o* \, [: u& V( J ; low word specifies which service% S4 R4 r" } G5 p O5 o, ]7 V' ^
(VWIN32_Int41Dispatch): |( i" x/ }% H/ Z, _+ H; M
call Kernel32!ORD_001 ; VxdCall
# l, k9 @0 M+ ~1 r+ d: B1 z cmp ax, 0f386h ; magic number returned by system debuggers4 o' G! j! w& ~ [* ?* a
jz SoftICE_detected w& M \6 _# f/ C
' ?1 H' E7 P% A
Here again, several ways to detect it:
' ~% g1 O6 q( _- x/ M8 \
% s" f" q6 Q, E I2 t0 w. q BPINT 41 if ax==4f9 N) y z9 a7 V3 ~5 ^7 l! P* _
: _* }6 T! ?& m% J2 v5 q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% B' i5 \4 V/ M$ I2 P
' {- k4 j' F4 D% c q, ^, m( S+ `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# E; y- x# {# Q# _& O* G) r
) r- V% q0 h ]( s9 K- s
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 S2 g4 i% h( @$ g/ q2 C% d, s9 w/ u# N a
__________________________________________________________________________
/ p D- d" Z3 K
, I3 k, b; Z, m+ Y% }Method 136 Z& C0 A2 `+ L3 A! W- W% V
=========
: E6 Z' n2 P6 C* u; K+ _$ O. `+ j5 U: {! R
Not a real method of detection, but a good way to know if SoftICE is5 I8 q0 P8 B7 r/ O4 o- E/ h
installed on a computer and to locate its installation directory.
2 F* Z* n( P! c d. ZIt is used by few softs which access the following registry keys (usually #2) :
) n9 K& s' S3 r( x/ n9 x- C% v- \
- C5 \( X2 h: c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 K' m( R, F& N' h: l9 X
\Uninstall\SoftICE# B& J8 o; e; a* Z* c. T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE6 }- n" F0 X* D2 y' h) d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 l6 Q. M1 V6 V7 A$ p; b
\App Paths\Loader32.Exe
' K- b' t8 `9 x2 [1 g! ]
4 o4 e$ o$ D3 f( k# i: D* J! J3 }8 ~$ k/ ?5 I9 u
Note that some nasty apps could then erase all files from SoftICE directory
* D0 Y! {1 \" A+ D% |# n9 w(I faced that once :-(
& Y/ A) U; J- p' [% }. h! }# w% g0 s8 N1 E! _' y) r, T. X/ X" v
Useful breakpoint to detect it:
5 H8 G3 p: n. w' w, a0 p. P" n# P1 _9 k% N5 Q4 @7 x$ i
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
Z) s# i+ R) Z( ], k$ y& V, @# H: f! R0 Y, o
__________________________________________________________________________9 u, d4 G8 s! y$ h0 u# H
6 O1 x: f( _* I( {5 E; d8 A
5 V' \7 i- M$ F3 Y5 c6 I1 l% xMethod 14 5 N' |. {& H ~
=========: v( ?0 `9 l2 z! v; q" Z
1 ^! p( b% i. j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 |' n! a) B- U5 I' N8 h8 L
is to determines whether a debugger is running on your system (ring0 only).
7 M% Q9 Q; r3 I+ _. }: v, h
0 c% p7 J9 D$ ~9 m, b3 k8 d VMMCall Test_Debug_Installed
9 y: Q Z2 _& z je not_installed2 m, t. ^4 ?$ C) h- ^5 O, r
' H& [0 t% f" t: g6 N' f
This service just checks a flag.
- S6 x; z1 o4 b) V/ r. a2 A</PRE></TD></TR></TBODY></TABLE> |