<TABLE width=500>6 _0 S4 z L ^5 p
<TBODY>( O4 w) k- Y G" a6 }* u+ f& L
<TR>6 H5 D. G, T: E* O
<TD><PRE>Method 01
# g; u. v' H; }, p& Q h& S8 k=========
2 x' u' l3 B; [
% M1 h Q/ ] b4 V5 QThis method of detection of SoftICE (as well as the following one) is
# N6 `- p, |- @- j+ K6 h+ z; z8 aused by the majority of packers/encryptors found on Internet.. [: ~! ^1 \, V! i
It seeks the signature of BoundsChecker in SoftICE9 P6 a: `+ ^) |# I2 h2 d0 b# @% {
$ n* e3 f! _& m/ a7 B mov ebp, 04243484Bh ; 'BCHK'7 K) i2 o T1 J0 c6 [5 ^" }! b- N6 ^
mov ax, 04h
' L& G' v v: z% ?* q3 F4 g int 3
3 h: D& q7 S% k; n% `; E( \8 v( A: ` cmp al,4) M6 B% S# H2 S' F& P' C. \
jnz SoftICE_Detected/ O7 F' J1 Z: R" r
' s2 t, z. ^- J: Y
___________________________________________________________________________
# N/ ?( P/ o9 R6 \$ {$ W
9 o: _$ j: w6 r1 G) P1 t7 fMethod 02
+ a, c6 i, \- v=========
q/ H* F5 U& U: ?: W% E4 U8 k; n0 @5 u2 @. t# v
Still a method very much used (perhaps the most frequent one). It is used
6 \" a8 q: S7 y# Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints," [: ~) c% x+ I5 t! F% O* l. v1 v2 a
or execute SoftICE commands...- T; f, s7 U1 X, [7 j
It is also used to crash SoftICE and to force it to execute any commands9 N1 G( V+ d+ l
(HBOOT...) :-((
w- Y' Q7 ]0 w/ K
0 D$ b3 Z, Z' C: m) C3 eHere is a quick description:# u, @, `8 i1 |# E
-AX = 0910h (Display string in SIce windows)
, E' V; T7 o, Z" k-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)$ }' i8 g$ G. i+ m
-AX = 0912h (Get breakpoint infos)1 p: e; d& ~0 _0 I" g
-AX = 0913h (Set Sice breakpoints)/ F. r: ?! S) [. P3 M
-AX = 0914h (Remove SIce breakoints) o' H& ~4 f! R& \8 \
/ I( e# V, E% sEach time you'll meet this trick, you'll see:0 Y1 {# q4 _1 O* B
-SI = 4647h
: B0 y2 y, ^5 [-DI = 4A4Dh/ G$ a" e' w3 V+ G% b
Which are the 'magic values' used by SoftIce.0 }' h ?3 h9 L9 W0 x
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: K6 C+ s& B. i7 \2 A
/ b/ E: U @$ |9 |0 |/ o4 |* A9 `Here is one example from the file "Haspinst.exe" which is the dongle HASP4 |' ?) @& O9 `- W! s* G
Envelope utility use to protect DOS applications:
) B; Q& t6 O4 d, K+ j* c
) U6 a+ s$ `; ]( J5 B: r7 L, g& `0 ?% _( P
4C19:0095 MOV AX,0911 ; execute command. p2 i- G' k/ s, r' P2 \: g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
, k, n" p' V6 Q4C19:009A MOV SI,4647 ; 1st magic value.
1 o) P3 J( y2 Z4 d# m4C19:009D MOV DI,4A4D ; 2nd magic value.
/ Y/ @1 s2 u2 p+ r, }4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" }9 ^7 Z- [, P4 q4 h4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute$ `( C4 u) j6 _; e- J) n
4C19:00A4 INC CX
5 z; J- ~8 a) g4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* C% v6 ]5 C' ~! t. J4C19:00A8 JB 0095 ; 6 different commands.
0 @1 z& g+ o# Q* \) x& l+ i4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 I3 [. e; ]( F- ^5 i' S/ k. O4C19:00AD MOV BX,SP ; Good_Guy go ahead :): a7 }- R+ |: b0 P
) ^& ?9 k& W1 _, h& p4 l' ]9 s6 h' [
The program will execute 6 different SIce commands located at ds:dx, which
! h' V4 w; G5 |1 V' c. }7 t' g. Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 {$ m) K: z+ l! o7 j* {
, @( ` y% B, j9 ]2 E
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. B7 w* U9 V; ^ W/ v1 U
___________________________________________________________________________
6 C- M) \' ]4 s8 M6 y6 j8 v( W2 c& n/ g; c/ t
6 A6 g& x& a. \Method 03& l$ n7 q9 U! a2 }
=========. e8 S3 E9 _* J" ^" h
4 D! ~) M; N2 S5 m! F, i' Y1 {
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( y4 m" E; o2 u# t% C9 V; }6 ^
(API Get entry point)
4 i* N! m+ [ N! y$ d3 k
5 l. g# d/ {1 L" U0 C$ g+ A6 o6 H
xor di,di
Z# M* f. u) N" e$ ?0 P mov es,di# f5 y. J) X$ h+ }4 Z6 v9 s8 e
mov ax, 1684h
; v7 ^8 P9 q6 g$ `, F! }7 c mov bx, 0202h ; VxD ID of winice& x2 q( L& N# d' I+ {% b1 h7 Q
int 2Fh7 A1 y: z% B. N% y$ r) \+ m
mov ax, es ; ES:DI -> VxD API entry point) X: ]" f5 y2 o: e4 \- n
add ax, di
7 e+ [ C5 T+ G test ax,ax& W" K2 P; _! {0 S4 r. U& V% z
jnz SoftICE_Detected- y$ f- _& s/ @# B5 {
6 |9 \3 `, S. y' y
___________________________________________________________________________3 e4 O0 F% b; E
! {. t# M1 C6 { h3 LMethod 04
# c! F z2 q2 z8 h- ~=========
/ J) k8 x# m3 `& G5 g5 J* Y. r$ G/ H& Z! R$ W
Method identical to the preceding one except that it seeks the ID of SoftICE
* T3 P2 X7 |, p% N2 m) i& j UGFX VxD.
( x3 R+ k* n& M4 Y) o5 R- _- u) Q
( F3 L( |; e5 I1 s/ a/ g3 S xor di,di
- {( q! S2 f5 Q6 k( |7 f9 r3 | mov es,di
: ^ w0 i6 s& }. h' w mov ax, 1684h ! |4 x+ y# S8 O2 A! j0 n# x5 l
mov bx, 7a5Fh ; VxD ID of SIWVID) ~% r0 M( Z: I! B/ R1 U
int 2fh3 ^; d* f) W. Z4 o' b% b
mov ax, es ; ES:DI -> VxD API entry point& @+ c7 k: D- v* ~
add ax, di
0 d! s) x" k. R* o6 i" \& c2 ` test ax,ax& B& K7 W, M4 D1 h1 l: Y) m
jnz SoftICE_Detected
: {3 U- g5 e6 N; ]. Q
- b# j$ J! U9 ^0 r4 ?, j5 L__________________________________________________________________________7 k7 A1 v+ B+ V. K
+ }, \8 Z$ y9 V( V" S7 d& q# Q+ k0 A
Method 05
4 g" i( S9 A0 @; {7 j+ ~=========
* V2 \) ~0 R, |' d
& y {& T/ u0 @$ c/ xMethod seeking the 'magic number' 0F386h returned (in ax) by all system
, U9 X( E* J% ?1 ndebugger. It calls the int 41h, function 4Fh. Y9 q8 t' d% D3 K& h
There are several alternatives.
5 x' Y; }& \& a4 y2 e4 u, y( \, | G
The following one is the simplest:+ N$ X8 \/ n0 }# `9 H6 x) J
1 L$ M( u, j; a1 [; N
mov ax,4fh
9 p" q% t. q7 ~9 s5 @ int 41h
1 d) m2 V& |9 r* h4 L cmp ax, 0F386% n' o$ Z# V9 v4 ^0 I- i3 O6 ^
jz SoftICE_detected
8 @, J7 l) x% {3 {: B4 G
9 s% \2 l9 x. w4 F; C
& R/ K$ i, |0 A0 u3 @6 u s; |Next method as well as the following one are 2 examples from Stone's
3 e& [" ?) L- F( m& E"stn-wid.zip" (www.cracking.net):
, B& c7 v5 M& \0 U7 k$ o* K& P, g) c. P0 P5 G; y
mov bx, cs! |7 `3 [5 A+ T |7 `5 `- P
lea dx, int41handler2' I4 [: }' s* d3 i4 [) ]* w- z$ ~
xchg dx, es:[41h*4]- r* e6 C/ C8 f. z1 \) ~
xchg bx, es:[41h*4+2]/ L8 f# H8 {1 w* ]! y- Y
mov ax,4fh
. D# g' S5 A" ?# F int 41h
. g2 T6 T" O$ n) f0 T3 R/ m xchg dx, es:[41h*4]
, t6 X9 c% X% j: u0 T9 f0 z xchg bx, es:[41h*4+2]
* l1 M/ y4 ]5 Y L8 z* e/ \ cmp ax, 0f386h
: @2 z4 C. u! C1 c jz SoftICE_detected
! i& l9 H+ e$ n: T, y4 F
/ E. p( f+ v \8 a4 tint41handler2 PROC
+ g" C, n! ?4 A3 T" ~8 P iret# @" D1 R5 i% r- m' x
int41handler2 ENDP- ?7 C4 n ?( K7 \, T* h3 U
/ l# z$ d5 @; l, c o, K; p5 s$ F
! v% q3 A |# h6 U9 B_________________________________________________________________________
3 V, p5 U |/ ?3 \1 q1 k k) H$ n% }' q3 i2 v' i
0 ]+ x) [+ t) y0 I/ [8 ZMethod 06
* k6 z; X! _" S1 u' M=========
' g8 ~9 W" v/ D& M6 X! C) z+ d8 ]5 L5 m& `- \
7 }: k) y, e7 A' X& P) J. L
2nd method similar to the preceding one but more difficult to detect:: L- Z \" T9 U6 W$ W6 T5 w7 z. g
% G3 p, Y. l _7 b. `/ ]. A1 W
& s' P8 k2 k G1 p
int41handler PROC& ^; e6 w! t9 k$ P
mov cl,al: J" P2 J( N* }; m/ S1 B% K
iret
6 G$ b4 ?6 h; Dint41handler ENDP; r7 x& P" D# F0 D4 `( l
$ x5 U( H8 C, D% h. D
" ^3 |# v, w) n
xor ax,ax; K" @7 u; [% E/ T7 Z
mov es,ax
; E# {; ~1 i& b- w9 e" ` mov bx, cs
' [$ D( _0 e$ I lea dx, int41handler
4 R3 m$ p# Z: X6 a$ M: K xchg dx, es:[41h*4]8 p* W& ?5 Q$ [+ @4 u) Q1 U7 p
xchg bx, es:[41h*4+2]% a T% G9 ^ A/ s1 c
in al, 40h
& p. W- w7 A" ^! h5 N. ?5 g# v xor cx,cx
6 A4 t5 n9 w6 K( I% U5 a6 L int 41h( F" h9 z, a7 X/ K% Y1 ^( t
xchg dx, es:[41h*4]! [0 O% ^9 n; x# m
xchg bx, es:[41h*4+2]
; D/ a6 H4 n5 q/ Z" x/ F1 S cmp cl,al
4 c1 u. O* h3 Q/ I4 D r jnz SoftICE_detected
R" y& l7 m7 i
( r7 X( }2 ?! ] r/ H0 e4 [_________________________________________________________________________& D( ^1 H8 H) }" l8 t
0 m- H/ }5 l9 [Method 07
( z+ [/ L: {+ Q) q& h, z, I=========
5 o& j) v3 U4 F7 q1 U, q8 \7 `7 L# S( \" v
Method of detection of the WinICE handler in the int68h (V86)
& i+ |) _" V- h& ~8 N
8 ]2 |: ]2 K1 F4 D mov ah,43h9 s, m- f# D$ q" e w; k
int 68h% I6 G' `& s; w7 i: M- B
cmp ax,0F386h/ @" J% r6 h+ T$ A
jz SoftICE_Detected8 _7 f/ _- \5 ^% B
0 M M: o+ W6 W9 U
' P6 S9 T& }, o1 K9 f+ b3 }* @=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ g6 _8 n! p! E5 b8 H app like this:
! g5 ?. m- a& t, g2 M5 J0 y9 p
0 D4 ?- }7 S) p( ^' }6 X8 G BPX exec_int if ax==68/ t7 u6 V4 v& e7 P) l
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 H0 O8 R, B3 O located at [ebp+48h] for 32Bit apps)
. a/ Q( c0 y) o% C! @* w) ~0 y6 U__________________________________________________________________________. R& P+ X0 @2 M, f o
, h L& P9 f2 k2 C% M* e8 c
0 s: f# O% j3 @
Method 08
% S9 }+ }, _5 k=========7 f( k9 {0 P3 u* O
" Q2 p9 F! z, @2 I2 d) z. F% S/ x
It is not a method of detection of SoftICE but a possibility to crash the
' _( j! ^7 o$ j4 B, F: rsystem by intercepting int 01h and int 03h and redirecting them to another$ a& G) z7 Q1 P6 w3 }$ o& `
routine.
4 S$ }2 q3 T9 F& R* x+ d; aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" {) [; L5 Q& N1 L; I
to the new routine to execute (hangs computer...)0 Y0 ]* S) D- W# O( M
5 [4 A" N$ t1 l& R. F
mov ah, 25h' Q+ J1 Z+ l- W4 A5 a8 D
mov al, Int_Number (01h or 03h)
) c8 ^( J# u4 ]6 x% J2 u! ^ mov dx, offset New_Int_Routine
/ B; n; t) ^3 k7 d# w int 21h# [ q) Z1 V: U% s7 F
+ [8 A$ q. S; f
__________________________________________________________________________
5 q2 ?- |' R) y0 C1 n( b3 H/ g/ s2 i4 J# s$ h# m7 g( N
Method 09
. L4 C. |4 c& B5 j6 D=========
% z6 }3 e7 e- c: Q
3 H3 f5 Q9 d) q1 R5 [+ d( TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; X6 c: n2 c3 b5 ^performed in ring0 (VxD or a ring3 app using the VxdCall).6 u. v% a0 ^! h# P+ ?$ a7 `
The Get_DDB service is used to determine whether or not a VxD is installed9 m: \4 l- `( N8 D3 X1 m% ~1 n
for the specified device and returns a Device Description Block (in ecx) for, ?! j# M9 L* l5 V
that device if it is installed.8 n8 Q' E6 y& _; P3 ~5 T
& ?$ U" U& ?, q* N7 K% _+ N* c mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ I; E/ |8 p( d9 s
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), H4 R9 a! X- `/ G7 C
VMMCall Get_DDB
' K0 q" I% j! Y( K mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* K8 }8 I z# I2 i) ^1 N5 o$ m: E2 [
& r/ ~4 i( d( H( ?$ C# \! HNote as well that you can easily detect this method with SoftICE:
8 ^( L% s4 d3 J' r2 d4 v' Z% S& _( Q bpx Get_DDB if ax==0202 || ax==7a5fh& ~- d5 i/ A9 ]4 d$ U, q
* Q" v6 K4 h8 e" G* t6 q* B__________________________________________________________________________3 g) z i( {# w; D6 M3 C# q$ b
; O# V0 {% x3 E$ E) SMethod 10
3 m" Y! y- i" [$ D=========1 c" @ m) t/ T* w- h. K. \
& |7 f6 t5 D+ A$ @- ~% y=>Disable or clear breakpoints before using this feature. DO NOT trace with/ {0 Z8 p* b5 ^
SoftICE while the option is enable!!7 q6 O) h {8 v4 @" C2 a, s
; {9 W4 Y9 A" b+ W2 K7 i4 b- jThis trick is very efficient:8 [7 o9 R6 M) o9 _2 A
by checking the Debug Registers, you can detect if SoftICE is loaded
8 ~5 v6 Y: q: ]; s# p& b# Y2 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: b$ e. h. |7 g9 ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their' O: K! S; P0 w0 ^. _# N
value (in ring0 only). Values can be manipulated and or changed as well& u8 h* c/ x, @5 z8 s
(clearing BPMs for instance)
! o* A- Q4 ]( u
1 i* M! ~+ Y* X__________________________________________________________________________0 {/ `/ v7 y9 s! O& E* {0 j
+ c' @) m5 t2 ^/ ~
Method 111 v' ?: W% ~ D' \) j8 w
=========9 w. S& T2 c Z* P6 t# y
7 k' U7 B! ]9 k7 G* S
This method is most known as 'MeltICE' because it has been freely distributed
E3 D8 g2 @5 y* `8 l/ gvia www.winfiles.com. However it was first used by NuMega people to allow
- I2 e- K" n. s Z8 E I; a4 h# xSymbol Loader to check if SoftICE was active or not (the code is located
. I) u( T9 [( V) W# ainside nmtrans.dll). Z: v3 ^0 V8 E" q( k
& r+ l8 @( F7 S" |* x6 w6 F& t: G
The way it works is very simple:
( J% y5 v4 }- w1 h, tIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 l9 }. U8 u4 y( ?$ V
WinNT) with the CreateFileA API.9 Z, r5 K6 d) D- n9 B( N
, Y9 w; I. @4 `; i9 C% MHere is a sample (checking for 'SICE'):! v+ W+ S# M D$ N
1 U4 f8 Z, y9 A2 B8 f; x5 N# z7 }BOOL IsSoftIce95Loaded()
0 ?$ d! f2 P6 b2 R# S( ]{( W7 x/ w3 X) b' g6 {
HANDLE hFile; + o8 c+ R- y" A5 g" K; a' z8 l0 S
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* B( {6 C. W8 U; V4 F
FILE_SHARE_READ | FILE_SHARE_WRITE,3 j1 R7 ~7 Y6 ?7 O% a
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( e. V' I/ q; P4 V4 K if( hFile != INVALID_HANDLE_VALUE )( G+ r H. O" Z$ K
{9 D) q- ^5 i8 q+ H
CloseHandle(hFile);3 E, h- H! T7 m" B1 p
return TRUE;- V: q( [/ v. c6 k% |
}
6 T' F. z, j/ c: w4 t; W: L return FALSE;# Z/ \: y- a v
}
* x# D$ d9 ?7 n: E( D1 k3 q* D) y' g* K+ T4 s
Although this trick calls the CreateFileA function, don't even expect to be
7 s' A" ]! @& Y: x2 v! r9 z: dable to intercept it by installing a IFS hook: it will not work, no way!
- d: R5 @! I" `# n* e/ AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F( ^: M, q" L! M9 N; t! P
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): Q1 U0 ]8 @) }/ k; }0 Z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 b4 T0 v) E1 W+ a% C0 X& x7 R6 P0 S
field.
7 h' H1 u, H4 V9 ^In fact, its purpose is not to load/unload VxDs but only to send a
& B p, Z" d# }8 @1 g" n+ PW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 W; |+ r1 ]. S$ d) B8 A3 g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try( h1 ~+ M1 f2 ~8 T- e! M P
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- Y; {" }6 b( g1 j: b: cIf the VxD is loaded, it will always clear eax and the Carry flag to allow5 W6 _) n& Q5 S5 e: I) T
its handle to be opened and then, will be detected.; R/ m' ^+ A7 x; p t, K
You can check that simply by hooking Winice.exe control proc entry point. g' ?5 T: T8 |, S9 O
while running MeltICE.
& d4 n) v8 @1 U4 H+ r/ F
% W9 h4 L" O0 b1 v7 u& t) [- r
0 f. x- L: D9 W% x 00401067: push 00402025 ; \\.\SICE
6 D, }7 h% ]. W) V$ h 0040106C: call CreateFileA
0 b4 D) i' T2 z% k, k0 o6 r 00401071: cmp eax,-001- `. V2 v) k) p2 O; F
00401074: je 00401091
5 ?) L/ ^5 s1 [ X; c9 x! c% {& h4 u5 t' P
' l' Y; i! R; {1 w
+ k0 i2 I9 k" A* TThere could be hundreds of BPX you could use to detect this trick.: x! b3 w1 O$ C9 K
-The most classical one is:. z/ E- l9 d+ j3 d- N$ L
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||2 Q* k" n4 r' T1 B: J* q1 r
*(esp->4+4)=='NTIC') h; q4 b% Y" U. o$ s& w x) }
0 k8 z( v& V3 x% h/ d! I0 e- u
-The most exotic ones (could be very slooooow :-(; k2 T& j4 }/ S6 w
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 d% K9 k V! @& J' h
;will break 3 times :-($ F9 y$ x3 X- p" K. O9 `, b2 y
- ~3 ^2 ` l( ?7 w! l
-or (a bit) faster:
$ R+ d% |( v6 c: H6 S BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); c, q9 n! L s1 z
9 s, y0 D- n6 I4 n' ]6 D$ G8 L) D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 h6 n- S4 [6 ^4 c ;will break 3 times :-(
& p& ]3 l) |, p. L1 ]% S* W
- X! t5 `; N% J' y, O-Much faster:* B' H* L+ g. t. Y# R. V7 N
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! _* U5 g$ z9 V f
6 B3 w/ I7 H5 h2 _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# a. H% i/ ~; Kfunction to do the same job:
+ [4 s) L* X1 K
( B# a5 h! ^! p7 v9 m push 00 ; OF_READ
$ d5 `+ v4 [% P5 l( w mov eax,[00656634] ; '\\.\SICE',07 y# B9 O! X) \- C9 O! \, a
push eax
) p# c$ W% F3 q7 b, c5 e call KERNEL32!_lopen* b2 X) O g6 t* L, L/ @% s
inc eax' ?; ^! w, h% c- O4 ?9 _
jnz 00650589 ; detected$ u9 e* {8 \ y X4 w
push 00 ; OF_READ; Z4 A5 y7 e4 e
mov eax,[00656638] ; '\\.\SICE': }! p1 S k5 F2 G [$ y
push eax- G+ a p0 S" n" J: {+ G
call KERNEL32!_lopen9 [2 e( W R& Q" I9 i: N: ^
inc eax Y: V* V/ M8 `1 t) O
jz 006505ae ; not detected
% ~1 t2 {9 z' t4 r: {' v3 Z
4 [# u2 T% J) X+ W7 q- g) q, Z& ~$ O& b$ `
__________________________________________________________________________, L0 ]3 V$ Z9 D) \, n& r( u' V
* M' S% W+ b5 \2 x# M0 y# C4 OMethod 12
% z% m! u7 x. l=========6 _0 d" [/ X3 P- [
$ R! o; a V( t9 _# i* u1 h
This trick is similar to int41h/4fh Debugger installation check (code 05& z3 c& G. l$ e: i8 u
& 06) but very limited because it's only available for Win95/98 (not NT)
+ g1 P0 y7 h2 K. i3 ]as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 m! i2 f9 B0 r# y# \) |
9 r3 ?) m) R, \0 p% g push 0000004fh ; function 4fh5 T% D& i& a$ r6 u7 G/ z }# A/ B6 m
push 002a002ah ; high word specifies which VxD (VWIN32)" q4 O9 f8 q( d6 J* Z, u2 t; r
; low word specifies which service
/ J, _ Z. _, p (VWIN32_Int41Dispatch)
: U. L. E. N |/ W call Kernel32!ORD_001 ; VxdCall b. `9 k. l# t( K1 Y* u+ n- k
cmp ax, 0f386h ; magic number returned by system debuggers& u- j0 C# E/ D* @9 j* m' S% Z5 }
jz SoftICE_detected
. F+ i* L) |$ W8 i3 S
Q' L" c1 l7 CHere again, several ways to detect it:. O" }- {4 V+ S3 m6 t& Q( ~/ }2 r
J# ~; T* _0 E G- ^
BPINT 41 if ax==4f
7 Y- B& r# O% H2 v9 g) m) d1 a- h
4 H$ O, R( f! T2 @ b1 H9 z7 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 z- w2 l5 d. w; c7 Q! f* Y! v* z
$ @! V6 U0 j) o4 T- S% Z& A BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ b l/ F* W. m( Q1 L
/ c0 J0 q! B& v BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 w5 z& C" X. ?! ^2 P8 L
& L" o+ R/ N: m9 {9 x
__________________________________________________________________________
! W& R ?+ \" w0 Q$ O) O; P
+ Z& D3 U) Y4 K5 \1 m7 Y% I; lMethod 13
6 F- u! x1 _% T) l3 f- N9 `; ]=========
4 G2 n$ H: V6 F2 M
: Z' U# w- S! i& ^Not a real method of detection, but a good way to know if SoftICE is
+ T' m. m) E+ F: e2 cinstalled on a computer and to locate its installation directory.
% c/ p9 }$ V0 `5 `) [# dIt is used by few softs which access the following registry keys (usually #2) :3 n3 l* n* W! N
" Y9 c D- g# g$ C! `; \" ]1 k
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% U1 d% W& f) p! D9 b& U2 I
\Uninstall\SoftICE
5 ], k2 c! m9 l0 w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& Q# ^, \# @/ [-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, q) b4 c! M4 W8 o) N\App Paths\Loader32.Exe
) ~" G( o' k: ^& ~
/ r2 {' i+ M: @( ~: B2 D& |' s6 A$ ?
Note that some nasty apps could then erase all files from SoftICE directory
! Q0 D8 Q! [/ S9 v% k! U(I faced that once :-( \; Q5 z) i( Y! S% F7 c3 H% b
( W; P" C& \: p& lUseful breakpoint to detect it:
5 K. M" F5 t4 |2 R) J. L) f* z* B I' _6 ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE' d; _9 U& ?& m9 T s
g1 q! W( O8 V& _ P
__________________________________________________________________________" C; `- X/ G+ D) J) \" C: ?
- S" r7 Z5 U6 x& w
. e3 g3 e: ^; j: q& ~; Z
Method 14
1 z" t2 K- E4 d ]=========
8 A! u; I/ a5 L W6 b' R
2 v8 k f9 g/ o) ?- M I3 KA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! F0 S0 t1 N4 @is to determines whether a debugger is running on your system (ring0 only).& Q4 B& D1 q. W/ @, f. C
0 C$ F+ r% u6 E1 f VMMCall Test_Debug_Installed
8 @4 M- j' _4 a3 H# @ je not_installed
9 E" l) T/ o7 O9 h' z7 x
S; `1 U: t5 _+ o7 MThis service just checks a flag.
0 N& l/ M0 P( b/ S7 a2 K5 o* d</PRE></TD></TR></TBODY></TABLE> |