<TABLE width=500>4 D" M: |' @" J# w
<TBODY>
, k0 Y" m; d6 x0 h, f<TR>
8 R/ X5 [: L6 u1 Q2 ~/ h<TD><PRE>Method 01 ' @. e8 L9 |# R8 `# A
=========
' [, o- r+ } B3 S7 I: ^& ?" F
; w& F8 r" G* F+ ^# eThis method of detection of SoftICE (as well as the following one) is
5 L' G) f8 r& _. d. {6 Oused by the majority of packers/encryptors found on Internet.) E9 b3 h) _! g+ b5 i! Z) Y
It seeks the signature of BoundsChecker in SoftICE
' Q1 R. V- Z6 ~$ E' T$ z. H; n: O
mov ebp, 04243484Bh ; 'BCHK'
- @2 \+ d+ y* j: K; A6 Z1 k: b mov ax, 04h
2 Z1 q. x$ U1 c: A7 P0 Z int 3
* l( V( `. S( u- l( z1 p! R cmp al,4
; j. e5 b: z( a( y: U4 k& V6 k jnz SoftICE_Detected
: c1 r# m$ g% @6 K0 e+ n% R( T/ q5 K8 J, R/ D4 a
___________________________________________________________________________
% V" S5 P7 c9 g8 o: T3 y
. U) [8 Q2 J0 Q0 BMethod 022 U4 o; C G2 x& ^/ d" a. S+ P
=========7 \* f4 ^. j( K) G; T; A
4 q" R2 ^: K! K2 OStill a method very much used (perhaps the most frequent one). It is used
f ^4 [0 N; A0 _- \/ ^to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ ~% M( Z5 u( k2 Por execute SoftICE commands...
4 d" X4 q6 m" p- eIt is also used to crash SoftICE and to force it to execute any commands
* J0 s$ O0 Z1 |9 q. N7 |) e% y(HBOOT...) :-(( 0 c+ \) u; x2 ]3 p( g7 X
. v1 B1 a8 E( T( x: `8 JHere is a quick description:
3 R% h Z8 z* r-AX = 0910h (Display string in SIce windows)& g- N2 K1 Y2 t9 V3 ^$ E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 r9 ^1 r; \$ z1 r/ d; T+ S1 g1 }-AX = 0912h (Get breakpoint infos)
0 V' J! K0 P f6 V" }* G-AX = 0913h (Set Sice breakpoints)
$ Z8 r% S) Q% h, Q0 p-AX = 0914h (Remove SIce breakoints)
c) n0 l n* i5 F5 @. a1 e3 E. w- E. B
Each time you'll meet this trick, you'll see:5 H4 s3 q" V3 t& \ e
-SI = 4647h
# }# \ u9 s/ I5 K8 `-DI = 4A4Dh' h+ M* W; D) D3 E# i5 f
Which are the 'magic values' used by SoftIce.
* \) B: c7 u2 DFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.; O4 F* {. ~/ u O1 v* h4 i- y
e3 ?' G+ }" d2 J% X2 m) Q+ p4 wHere is one example from the file "Haspinst.exe" which is the dongle HASP& _" e. ]8 C# {* y1 F
Envelope utility use to protect DOS applications:
$ N) G4 m4 G4 M2 ^' J4 j- d) s: b: x
+ J( ~) q' O9 O# A5 s2 I3 V
4C19:0095 MOV AX,0911 ; execute command.8 b9 R0 [. U! I/ w
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 w3 A w5 A( f
4C19:009A MOV SI,4647 ; 1st magic value.
) S! S& A. [8 c, C4C19:009D MOV DI,4A4D ; 2nd magic value.! N# _; a/ p9 S" U8 p; q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 I+ q/ d* I/ h; B* j
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 W' F% ?- E+ N* \' t4 D
4C19:00A4 INC CX8 d5 ]2 O) r2 b4 Y7 M/ Y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 q1 r' l1 U% P5 b7 |8 O G' r
4C19:00A8 JB 0095 ; 6 different commands.7 }& R6 g1 _2 h
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: F1 e4 s" m3 [; P' y4 \4C19:00AD MOV BX,SP ; Good_Guy go ahead :), E: R# w- Y- W' r: G# _
+ L/ h- i& R) o7 y' a7 b
The program will execute 6 different SIce commands located at ds:dx, which
# w+ e; }4 Q* L& R& hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 z) A+ _3 _4 A' L7 c) J( J* n1 ]. k! O2 w- t c" s9 ?# M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. N/ P& P9 p4 {
___________________________________________________________________________
V) ^# R) @) f- `& Y# U8 [
( N7 n8 J- }: O: i3 S' B. u( }8 u. c2 ?4 ?1 E' H% T1 w
Method 03
& h! d; ^7 ]5 \4 L( q: F=========3 h8 Q6 g( y9 y
' W- A0 H& G0 r, Y' i$ C; aLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# S( N5 d0 B9 v; I9 _6 p(API Get entry point)
& k; [3 w* b6 T6 g
* ]7 I0 N; t5 w/ }& i+ w" P
4 |, `: y! K: _- V# B) ~$ N xor di,di
* g" Y: C' c2 \, ]. @' { mov es,di% d6 Y% j$ w8 M( p; `$ N0 O3 t
mov ax, 1684h
" W: v( l7 ] r7 [: m. h# x1 K mov bx, 0202h ; VxD ID of winice5 j9 ^4 a8 ?" W, {' k
int 2Fh
0 c" T: B6 v, \4 D4 k7 H mov ax, es ; ES:DI -> VxD API entry point
0 ?9 v7 I: w9 j, O/ ~7 m" \4 C add ax, di' b/ p3 d* O8 w# m+ Y3 C9 u* r& T
test ax,ax
* i2 Y' |3 {2 `6 U1 C3 I) { jnz SoftICE_Detected
# P$ q# Q% i1 L7 M" m* x
3 ~+ t9 }* W3 Y7 U___________________________________________________________________________8 X1 m) S0 _5 J3 b9 X
5 B" B/ u2 M, Y" R2 D) ~% r
Method 04+ Y* ]. k, B& w6 N& l. K+ k, _
========= E! {- { v: B0 m% F. N. G
! P6 o1 r+ T$ r+ ~- i. c/ F
Method identical to the preceding one except that it seeks the ID of SoftICE2 i! D) Z9 r+ r
GFX VxD.
' {; T! r% P7 `/ o1 m9 z- t+ ^; H! @0 [ A
xor di,di
, p$ |0 V) Q/ L4 k8 ` mov es,di
t* ?+ o& O! g" S8 n# Z! D5 V, B6 M mov ax, 1684h 8 W& a6 \0 r0 v; t7 d, l' N
mov bx, 7a5Fh ; VxD ID of SIWVID
; }# \( n: V* I+ J" V! ` int 2fh
! C1 f! D! m" j% `* l mov ax, es ; ES:DI -> VxD API entry point
; o: a. X' O, N1 v4 g& } add ax, di% y: n- Y1 X! |, }2 _$ X
test ax,ax
/ L7 {1 I& Q8 g4 O' \ jnz SoftICE_Detected x& t5 b7 m( ]" N- j
, H% T! i- V5 W. T) s__________________________________________________________________________3 z' A3 {- m# g
0 c7 N) e/ N' |* q" D0 E. k* g6 v
) K, a w% R3 x# {) t1 b: k) [Method 055 t$ |4 \ c- T
=========
2 i, z ]1 w3 d2 O* ~* b/ y. ^+ f, |8 N( ]' b, A
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) q* U8 r8 \) _) b1 L4 D$ Ndebugger. It calls the int 41h, function 4Fh.
- H9 i2 f4 q0 w$ _4 a& }$ P' y p9 rThere are several alternatives. * @' x5 K( M# {6 |( X/ @ c- R
2 j9 \3 N4 P6 y# l- e4 _. Z" W! _
The following one is the simplest:1 n" B1 p0 S. K! `
) ~, O | n* k2 L# @7 E! Q
mov ax,4fh
6 V6 n X9 X+ m' P& L% ^) X: I2 h int 41h. u8 p; s j B0 x5 |. X! I
cmp ax, 0F386
- y! `5 L( _, @0 r' R jz SoftICE_detected2 z2 _5 g+ I) s& W3 {7 K0 Z6 `
% n. l' D' r. L* P2 M6 ]& s. K+ k. ?3 B; J) a: `
Next method as well as the following one are 2 examples from Stone's $ Q, k0 i0 T& R* m+ B; ]
"stn-wid.zip" (www.cracking.net):
! {$ m+ F( K5 G; D) L7 P& g- R# E4 g
mov bx, cs
; _% ^, H3 Y) `$ v7 f lea dx, int41handler2, K8 Z( v' N$ O& a# ^
xchg dx, es:[41h*4]( A; y: P3 @# u9 e& l# s' H. b
xchg bx, es:[41h*4+2]0 H" \+ G3 q* U6 m* I& B* e8 j
mov ax,4fh
j7 Z# g) g( v. }- k7 Y4 A0 d% r& \* i int 41h1 r1 z* Z7 g# o8 q8 K# Q5 {
xchg dx, es:[41h*4]
- I2 y! i- r! K xchg bx, es:[41h*4+2]$ s& O' _. }/ D- V; p! g& c* r* s8 r
cmp ax, 0f386h
& d) |+ B5 h$ \4 i, G/ L jz SoftICE_detected {0 L; p' f: S% `5 b# Y/ `
7 u+ Z( W; o$ ]/ O Sint41handler2 PROC
1 J, y4 }, O: @( F iret
+ E$ o, k8 B; X3 U) ~6 L; Y2 xint41handler2 ENDP
4 O C% m4 o# Y9 |6 x. c8 [- ]6 u' u6 A& B* ^
8 Q/ t! D- @7 o/ E5 F( A
_________________________________________________________________________% x6 d% N g, K
" P, \+ s. \8 v2 j. m) b6 @! V! G2 h- Y3 O _% P
Method 06
, e% \0 l7 A5 J" ^" f w/ [: v7 ^=========
6 `# A. c; ` R5 ]& m8 ?4 R, r
. \. m, h* {0 J/ K- X$ k; b9 B3 _" `( c) `0 r; o q
2nd method similar to the preceding one but more difficult to detect:
9 E) {: [$ F$ k4 Z0 U6 Y
2 ~: g2 U0 _$ j* c9 O! @: R* {6 r) x9 G0 C* S7 y# |
int41handler PROC# m8 ^: i6 W6 j( R; h) G
mov cl,al0 s0 @- t2 C5 I' ~
iret
: S5 b: v3 O9 Z! d% f0 Q3 wint41handler ENDP
2 e& q3 z1 k: P9 ^
( Q' p* V% q6 i$ E0 `( H
. I) x+ ^1 M2 O$ l xor ax,ax. ]0 J/ c2 }- {( M. n3 f( D9 a
mov es,ax# O3 B8 [: B* k9 M/ F+ i
mov bx, cs9 H* v& h ~3 A- V2 H2 A7 g
lea dx, int41handler, F( T' x% I" r4 Q' s) @9 n1 Z
xchg dx, es:[41h*4]' X, v# \* X: p, C/ h
xchg bx, es:[41h*4+2]
9 m& U7 `: P: z2 @ in al, 40h
) ], {, e7 y5 D6 a xor cx,cx
8 G' A3 n. P& ~ |$ F0 j int 41h( O- d* ]5 N& z: A
xchg dx, es:[41h*4]
* \8 b$ r$ {+ Z. h: Q# O xchg bx, es:[41h*4+2]
7 H& N0 P: b7 g' a( L cmp cl,al
! m) @) F( P& f jnz SoftICE_detected$ |. X B9 E+ V# o" k) s/ [
- x5 h+ y" h/ N. ~
_________________________________________________________________________
& u: u0 g! O) U$ {7 `/ m9 p$ q( }- q
Method 07& W+ L7 z9 n0 [, `9 H
=========3 i( m" {/ g. ]/ K9 u _
# M/ H, x* G" y+ ?+ D4 PMethod of detection of the WinICE handler in the int68h (V86). X) m' x- q8 Q, p/ A( E' Z. N
. N% @& Z- L# C/ v3 H6 ~
mov ah,43h4 ?2 \8 W; g/ y% ~( [3 [' v. o
int 68h
7 D- d+ r& ]$ Q4 a9 i- V/ l cmp ax,0F386h
2 r P4 q2 B& Z7 D jz SoftICE_Detected
h) O/ K F s- r+ |" G6 W4 K4 W4 R
; G* M+ P6 K4 t6 S! m% `' R: ?2 c1 T0 c* x7 n
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& ]+ x6 G- x6 U! @# _- G& L app like this:
: X/ u6 w7 g# u2 b& i1 H( W0 E+ j1 @' f9 G% H o1 j
BPX exec_int if ax==68
, F4 H. S! R' D( ]- f; U( J (function called is located at byte ptr [ebp+1Dh] and client eip is
/ z! Q) F5 E% x0 s; ^9 F& J located at [ebp+48h] for 32Bit apps)
' X% U1 @5 Y- P C( _4 k. a+ N__________________________________________________________________________
8 m' B7 O6 K( Z5 v1 r+ a! [: s8 s6 ]( C/ E
' L7 n: d( J" J
Method 08' m5 x$ Q4 U! h, ?0 Y' N
=========2 a L Z0 l h5 C1 B
! _! V" E# I# U3 y ?/ I
It is not a method of detection of SoftICE but a possibility to crash the# r" g- E& \6 ~$ |. F
system by intercepting int 01h and int 03h and redirecting them to another
* v* R0 U7 J# {4 B5 z. G. oroutine.
: J9 f7 ]5 ]2 z" _! |3 I, MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" T) b# Z) l2 ?% |( y- K- F
to the new routine to execute (hangs computer...)
' K3 b$ }( W( Z9 n% v
) _' i' j6 g. p( O v, P" l mov ah, 25h. W- N1 F9 p0 k( I
mov al, Int_Number (01h or 03h)
" t2 |) W# b1 B" P b mov dx, offset New_Int_Routine" B5 W3 n S7 ^' M% O% F
int 21h6 f# ^0 {( \( i% V4 I2 ^( j
8 P2 M/ T. E6 ~* Y- ^3 @2 H__________________________________________________________________________% f) h$ A5 `, P: h! t, I
8 }" f- _9 K" w' v& Y% B% W8 { rMethod 09
) m/ E; s4 B8 e' k0 H& ]=========
1 |9 `; a" d5 l' O! z2 ^, h: K" W, f
1 p1 p4 X9 D W' G4 a& Z* C7 NThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' v1 {' J+ |2 K4 {performed in ring0 (VxD or a ring3 app using the VxdCall).
/ K, F" B+ f- Q- fThe Get_DDB service is used to determine whether or not a VxD is installed
) K7 `! j/ u6 p( mfor the specified device and returns a Device Description Block (in ecx) for
6 u- W9 ^8 V/ tthat device if it is installed.
8 p- j0 |( u4 c
1 c0 |$ J: B4 [! r. d mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID( Q7 G" |7 X P! ~! n8 B) H* ?
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ C8 ?6 Z8 B5 i1 @
VMMCall Get_DDB% h* f& m, u; [3 K U- {
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 H& s2 ~" v t3 j+ u
% a2 J1 n1 g# i0 q* S8 t8 `" ]Note as well that you can easily detect this method with SoftICE:
, U7 |$ z( O9 m( u% D% M H bpx Get_DDB if ax==0202 || ax==7a5fh
# n" D- f2 \8 \) s! f& y4 D0 P, a# N% T V
__________________________________________________________________________
" q2 `9 }; o- u$ w, q+ N+ M; |$ u q
Method 10
. d* X, r1 A9 s6 l1 |=========# B; s0 L7 Y5 ^8 a! T
2 b& k4 r" y4 f Q' B' f+ H
=>Disable or clear breakpoints before using this feature. DO NOT trace with# T6 X( n. y8 q: ?4 |
SoftICE while the option is enable!!- c" d, B0 M; Y
, C, L& S2 A$ x; Z
This trick is very efficient:. ?9 M2 a) Y3 f+ G
by checking the Debug Registers, you can detect if SoftICE is loaded
& r; |3 H6 {* W7 F+ b3 F3 H(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) A6 u" I- A" Y5 S' rthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 {$ o) Z0 U d, I* I% q' O
value (in ring0 only). Values can be manipulated and or changed as well0 W/ e$ V7 _9 N# ]
(clearing BPMs for instance)
% O7 B3 [ X9 i" ]7 O4 h& y! O# `/ v) x6 b3 K
__________________________________________________________________________! c8 i9 x1 U. O& U
9 M D+ |! e: H) H! p* c+ g) \9 w
Method 11
, Z% [7 Y8 {( K6 ?8 r A, t3 U5 `$ K! o=========
! p9 e: b' H, v. J
6 K7 b" }. C% G3 ]5 ~This method is most known as 'MeltICE' because it has been freely distributed3 A" d- ]' v' z1 A% ?$ Y# i
via www.winfiles.com. However it was first used by NuMega people to allow
6 U, K- X, I7 q1 c% ]Symbol Loader to check if SoftICE was active or not (the code is located; Q2 G" T& M: s
inside nmtrans.dll).$ {5 r( T1 Q' F* T
8 ]; o" p5 V, d% x
The way it works is very simple:, {5 A/ F3 F, m0 }* q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 ^7 a3 w) Z0 F' i3 ]WinNT) with the CreateFileA API.
, Q4 i% D; `" L0 |
" f8 |, u- ^( l4 [Here is a sample (checking for 'SICE'):2 B& Q6 |) |/ T; O5 t
7 `1 l* [& G4 m- ~" w' ~
BOOL IsSoftIce95Loaded()
) x" s6 G6 ^0 F7 k4 D5 e' z{' ~7 o$ v9 t1 k; h" h; B |
HANDLE hFile;
2 z0 L, i6 h/ b, v' M: p0 } hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 t5 p* ^2 w% r: [ FILE_SHARE_READ | FILE_SHARE_WRITE,$ t* [4 y4 i# E) T! l- M" r( J
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" d7 H( d9 E0 a H) B2 A if( hFile != INVALID_HANDLE_VALUE )6 t" e! n1 M& h Z9 p L' S, r
{
3 @8 C6 e! b2 S( L CloseHandle(hFile);5 L: {7 b6 r7 w7 }9 i
return TRUE;% [% b$ Q% t% u# c& _" Q
}/ d4 x2 e" t, p
return FALSE;
2 t& p; K" ^; H( x; H; L}
4 u( l; U1 G& _) P/ u* f/ g* M* G! ?( f. Y, X
Although this trick calls the CreateFileA function, don't even expect to be. ^/ g& ]' D1 o
able to intercept it by installing a IFS hook: it will not work, no way!
& z C, d; A' [3 d5 R4 R. xIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
' @% ^5 f* s: l0 U5 bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 q4 S7 D/ f9 H; ?2 T( T' ^- E4 j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc& w' p" `7 r8 h, e: d
field.
' d7 I& D/ t8 _" HIn fact, its purpose is not to load/unload VxDs but only to send a " k- _3 O' Z8 _2 a6 H
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* B- d, F1 E% g1 u) Tto the VxD Control_Dispatch proc (how the hell a shareware soft could try& y" l& ?! k# Q( m2 `. S- k& H
to load/unload a non-dynamically loadable driver such as SoftICE ;-).( g8 X$ p* o5 X3 b/ y
If the VxD is loaded, it will always clear eax and the Carry flag to allow! @* i$ x6 P! O3 }2 q" J0 X
its handle to be opened and then, will be detected.; i& H8 d2 q( w: Z
You can check that simply by hooking Winice.exe control proc entry point+ ?) M3 V- z1 K& q( I; V: D- O1 }& i
while running MeltICE.
% C& Y. _! w K8 }/ V8 o& c6 x( G$ D, S/ E# \1 l
2 e/ F: m' S, _
00401067: push 00402025 ; \\.\SICE
- ]/ c- S' V. L( q0 Y- y. H0 G4 l! o8 y* ^ 0040106C: call CreateFileA {" I/ Q5 K; b
00401071: cmp eax,-001+ K% N, B0 O3 e! r
00401074: je 00401091
( d4 B2 T3 U% O/ H* M
! m0 m2 ?. X3 e! x8 O. a, o% V* @+ [8 n5 \6 y9 K/ E, a* f& [ O" d
There could be hundreds of BPX you could use to detect this trick.
7 m) D- i5 b7 k. c& i-The most classical one is:/ I8 \: o% o# U6 h' K& L' ] c
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
" \. z+ H( L2 R( u *(esp->4+4)=='NTIC'
3 g9 q) }- F7 B Y' y
: N' w$ j. {+ o3 R& E$ T; X) z0 A-The most exotic ones (could be very slooooow :-(
; F; [* }- G: i; n$ S* s/ X BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " @: g. a5 c( ]0 C
;will break 3 times :-() D$ w" Z# P T+ e2 o
8 {7 X: _( u) X2 D/ v# K3 m-or (a bit) faster: ) X( q: g# m) g/ k! z- t
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), p2 a: G3 V1 p0 l* s2 L
2 p+ G3 }$ w, t# U2 A
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. o8 S- u# ^# P' u+ z8 H# u' h: g ;will break 3 times :-(
5 G6 h8 ^; P$ m$ C9 i! l3 _8 `) d9 F/ _* f2 O3 q' C4 l
-Much faster:
; y/ C. A2 R& x- n# @: V' c" x BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', _2 _' {$ c4 d' r3 [& q. K; U
6 H2 j8 { c; d2 @: R& F
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen4 g9 T& f9 t$ p7 ?; [9 ]1 q8 b- q
function to do the same job:8 u4 A. h9 n- p+ K W
7 a# \8 ^; U( F* j, @' { push 00 ; OF_READ; O. |9 X2 L. Z: T8 h& Q* u
mov eax,[00656634] ; '\\.\SICE',0$ j# @' }8 j7 p4 Q4 f+ D6 N- A+ N; a
push eax
9 V& y% J* Q, Q call KERNEL32!_lopen
. U; y e/ r3 v" Z inc eax' k/ {9 u, s; Z( h: }/ r
jnz 00650589 ; detected
O& a/ g, H8 b" [8 i% h, T! ^3 i1 B- Q push 00 ; OF_READ$ b" e: R7 l, W6 }/ }/ {
mov eax,[00656638] ; '\\.\SICE'6 ?. R# F2 e- [3 f/ O
push eax
* U" h4 l* \1 i$ Q/ v call KERNEL32!_lopen
& N% {7 d! H- c) { inc eax- C; B/ E& `# N. D4 e+ w% [
jz 006505ae ; not detected- c9 D/ i$ z, o& T
/ ]9 M p( e& E, P+ T+ f% Q" g S- u6 a& h- [& j
__________________________________________________________________________6 j( D3 Y0 N, |
, F3 u& }$ D O. Y6 k$ S
Method 12& E2 |) }# u7 P6 }) Z1 I2 l- p
=========
7 H. E8 Z; j# g; o/ E0 H/ H# O+ P* O' @; U- C3 t7 s
This trick is similar to int41h/4fh Debugger installation check (code 05
8 Y; y& O* t" C& 06) but very limited because it's only available for Win95/98 (not NT)+ j W$ e; b+ z- Y- [
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ k* P4 n2 v4 J G$ g; {% ?) W5 l' P: t/ y; F- c) D; K
push 0000004fh ; function 4fh
6 s, C) i) I7 T push 002a002ah ; high word specifies which VxD (VWIN32)
% ?( | K0 K$ m2 c ; low word specifies which service
1 h. K+ r5 U4 k; I (VWIN32_Int41Dispatch)' V/ n& f: |+ I2 e+ T1 j
call Kernel32!ORD_001 ; VxdCall
2 Y5 S/ T; P4 H$ L- {, P cmp ax, 0f386h ; magic number returned by system debuggers
4 P0 ]5 q. z- \9 } jz SoftICE_detected( [) R8 Q' D( f
3 P+ j% h) C9 {. k. W
Here again, several ways to detect it:) |* O4 X' j. Y5 E# T4 i- G
) z0 u* Z8 s! S. Q, e. ?" v# X BPINT 41 if ax==4f: L. d7 G4 J6 u& _+ I% Z5 P, v$ X
* M! o# m" }1 }/ w; N BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) O% `6 o" n. l/ I1 o9 k6 t+ u4 E
% t; \0 I' g; S8 _1 W+ t& [ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 ?6 }# e. Q9 M; _
0 W8 M5 n" R! n6 X/ P4 `; R/ ^2 ] BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: g6 z& r4 G2 E H/ F% h$ n, Q0 c+ K* f) R4 R3 [& D+ M3 m7 @
__________________________________________________________________________
" V/ P8 o! F( w$ a, V0 ^* r( P7 W6 r
Method 13
6 n, s# X. j0 T8 ?5 `1 V=========7 O) G# I6 X0 S4 e
9 Y" J5 T+ U" r3 g5 h2 C- ENot a real method of detection, but a good way to know if SoftICE is
" t( D* c( ?8 P/ Oinstalled on a computer and to locate its installation directory.
) O+ q+ h9 M" zIt is used by few softs which access the following registry keys (usually #2) :6 E* w. c5 t0 J/ w
4 }8 ]- q. Q4 M- F' |% v; L
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ L9 ~4 e( ^! k- b
\Uninstall\SoftICE* w: p5 J! y7 @0 i- Q/ P ~! S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' Q5 k( E5 \0 r6 O6 |-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" j5 [% L& E' u0 H0 A" H\App Paths\Loader32.Exe& A4 Q9 ]6 Z$ o0 F: T
+ `+ C* o, ~3 R
9 U2 {1 O( I9 ?2 [1 YNote that some nasty apps could then erase all files from SoftICE directory- z, A1 O/ C, k
(I faced that once :-(8 w2 D- Q) t* X# w: K, l* \9 f
# U# F2 ~% }: P) ?' c* xUseful breakpoint to detect it:
2 ^$ J7 Q# @( y1 t/ a! E# V/ q# _/ H' x2 w& n
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 c7 @" p' f* C8 I: t. h% _
7 b0 O% i5 k* p
__________________________________________________________________________
2 L* a* e0 ?, g* W
m! t5 k. E6 x @* M
! c( c7 T4 ~3 U( }Method 14 & n8 Q( Z/ G/ J8 P m! W
=========! c5 U) Y8 }$ j
) T0 w S! q% L1 p7 Y B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, J* y1 y0 F& ]$ r: v. }is to determines whether a debugger is running on your system (ring0 only).
' B; z, d$ m. @+ K5 C. w% E- s! c6 c# ^- d( V! J" p. I8 ]
VMMCall Test_Debug_Installed
) G9 u% V/ `9 l je not_installed, K/ U, s) X# q# z3 p( `
+ _# O5 u/ w; t1 y' v/ c
This service just checks a flag.
: g8 M% ?8 Q" [7 l</PRE></TD></TR></TBODY></TABLE> |