<TABLE width=500>
+ L9 e" j( {( x5 S a; }<TBODY>
( [; z' t! C' \( Y& m. Q) ~<TR>
3 ~4 O3 u3 L) _5 x<TD><PRE>Method 01
" i/ F0 s' g% F* R=========
( F$ I2 N. O# r, S) C, c) i# R n: E' }& m. _5 i' @
This method of detection of SoftICE (as well as the following one) is
/ j& R4 O% ^1 ?( N. zused by the majority of packers/encryptors found on Internet.4 Q5 D- p1 ^% C; r5 F( a
It seeks the signature of BoundsChecker in SoftICE
5 M+ E: B' P3 p" a f
& y. [$ a8 E4 ?8 N4 m( ?" N mov ebp, 04243484Bh ; 'BCHK'
, n) T: }" |- ]4 B/ g mov ax, 04h
! T* V$ R: j. U/ m int 3 2 b. i6 B( p# ^) H0 i
cmp al,4
7 R0 ^; m% _6 ] w' b1 u" J0 |; ] jnz SoftICE_Detected; O+ @, T0 h1 _4 _
- g* E6 E5 b I+ Y' j___________________________________________________________________________
$ t6 r- x# k. t4 T* M
9 `7 f9 ]0 m7 W1 }6 P! wMethod 02
/ t2 }9 Z. M9 V" H( E0 n5 \=========
# r0 N2 `, T9 w* o# k8 J
- M7 K9 s4 K0 ?9 B3 f, nStill a method very much used (perhaps the most frequent one). It is used
3 S" K, I1 O1 I$ X: E# j/ _7 Q; Fto get SoftICE 'Back Door commands' which gives infos on Breakpoints,) o3 P3 z; n: c. p' ^" M/ R* W
or execute SoftICE commands...
5 C/ B- R# S* D5 _ fIt is also used to crash SoftICE and to force it to execute any commands% X' S2 p+ W. G, U8 e
(HBOOT...) :-(( 5 t. c; L6 X. }3 M5 t
& T: R$ w8 ?2 d- S
Here is a quick description:& q M# F' `! T, ?
-AX = 0910h (Display string in SIce windows)
; s- |- E$ l4 {-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ n! S* O/ \; K2 }3 t% ~
-AX = 0912h (Get breakpoint infos)
5 ]& W8 G5 J8 {# f0 w& {-AX = 0913h (Set Sice breakpoints). p$ }9 ]$ F" m( L! c
-AX = 0914h (Remove SIce breakoints)
0 {; Y) H+ s: N1 b! `/ c& r% w% S/ x/ P: S9 V2 x4 w6 S- q
Each time you'll meet this trick, you'll see:
, g3 G, y% l2 q9 r7 k: l-SI = 4647h
5 p7 \( P! o0 _4 H$ ]-DI = 4A4Dh! Z! Q# @* h9 B' ?5 z) C8 d1 U
Which are the 'magic values' used by SoftIce.
. O' P) d+ J: Y1 f7 cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 d9 u Y0 |/ d2 j; j7 l+ B1 o5 I% k8 r0 Q! @) x1 ^' x' t/ s# W
Here is one example from the file "Haspinst.exe" which is the dongle HASP; ?; {* L/ B* U4 r7 p: b
Envelope utility use to protect DOS applications:3 u ]3 r0 y" V, V8 t
9 i3 z; w2 e( A M! C: M
3 F: b, N2 V# h ^+ j; W; ?
4C19:0095 MOV AX,0911 ; execute command.
, e5 c, M% z) C G% T& E4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).! e7 L( ]- s* m/ H- O; d% `
4C19:009A MOV SI,4647 ; 1st magic value.
* F! z1 b4 T2 e- F. T! b4C19:009D MOV DI,4A4D ; 2nd magic value.
4 e6 G# n, _$ j: w1 H# ]4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
* N2 i! L7 [6 g/ N4 D0 @. p1 D( T0 `4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 p/ `7 Z. d1 N9 b/ R: {4C19:00A4 INC CX
8 A6 P4 l: y1 \. m! @3 [4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& V* c. Z$ ~) S" s' B
4C19:00A8 JB 0095 ; 6 different commands.$ n, \% Z' H- t* Y4 K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 u: F% H4 G6 P6 w8 d+ k8 n' Q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 `+ d! N/ ?* O3 ^4 i% X |
+ s& M& O: l$ j8 X& }$ [2 H- \& a% wThe program will execute 6 different SIce commands located at ds:dx, which4 a+ a1 ^' h1 k( E/ @
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* F9 ^0 v: B: [ R; s# ]! K
6 J7 n- ^; `$ Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ p1 R6 P5 A/ M3 L0 B___________________________________________________________________________
; U9 r- y4 v! F8 w+ W7 n2 x4 h( P$ C. d6 n6 W4 T8 q
! ?( Z; b' | f; U4 l8 xMethod 03
6 A+ @- e: O8 {& O; V=========6 S# {- a- p6 |
0 _; l3 u- p. n" h0 e; b% Y1 @: k. y( NLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: j; x' \4 l/ \0 b- N(API Get entry point)
; v9 E9 L2 r5 ^; l" u0 Y. O ! ^) x' ]3 x+ Y4 Y f$ s
$ m: S$ r& |: L* {" \
xor di,di1 B, X" h8 p% g) S
mov es,di4 C" @) s2 Q; U
mov ax, 1684h
% E0 K( {4 ?" Y) X6 j Y3 ` mov bx, 0202h ; VxD ID of winice K3 b9 |5 s& @6 w* A
int 2Fh8 n) _, U' q8 q- |2 n" d
mov ax, es ; ES:DI -> VxD API entry point* t: s* e8 F. r: p
add ax, di0 \8 S- @% {' f1 J: D+ x+ Z! p( r
test ax,ax' l7 ^& m# ~& l6 X5 `. H. R6 Q
jnz SoftICE_Detected
' o K) ~2 ~. t4 ]1 n0 Y
/ V; R7 H; E7 s___________________________________________________________________________) s8 z Q9 A" O
# D- c+ f+ L, u( {6 _) B/ P
Method 04! t* ]. E+ T$ b7 e, c0 B
=========
2 ~' H$ a: X' W! t1 G5 h( s2 X \/ B( Y9 v; Q# B& C
Method identical to the preceding one except that it seeks the ID of SoftICE; ?. L& e6 i( Z2 Z9 }7 \3 y
GFX VxD./ a& }9 @4 k) b; @" ]
5 J& u. o: V- L! I- l' } xor di,di
' \3 i0 d+ S% x1 e! k( E mov es,di3 A8 m. t) r0 p
mov ax, 1684h
# N+ d% z! X0 i" A9 m6 [ K mov bx, 7a5Fh ; VxD ID of SIWVID% l% E* o5 O. S5 J
int 2fh
* Y4 E1 L5 X% o, [" \5 o mov ax, es ; ES:DI -> VxD API entry point, `0 u) i9 v" x) l0 h
add ax, di
3 t0 @7 e) h$ \0 `% C( j test ax,ax
. \3 d5 z- Y2 c jnz SoftICE_Detected% P& K, G+ \" e- {; L+ E g
8 d; t; m& f1 O3 o: Y' J__________________________________________________________________________2 C/ p: \9 b7 O+ F' K3 K/ F
[ f7 ~( q, L" ^$ h: b' _5 p7 i3 J3 j6 H" F! z7 J2 f
Method 05
/ |8 b/ C0 `7 _! l; o=========" c% ?& J8 `& `) @( p$ W: u
/ Z E) U* C' A, x- q! @. gMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- K8 x' z! E) d* n, ?6 O; Adebugger. It calls the int 41h, function 4Fh.* [- [5 b) U1 v. n
There are several alternatives.
- ?, n D9 X! E) v4 y! W, ?( z: a3 o& C! b' d& x
The following one is the simplest:
# c0 ]! F0 {- |% s* g! m' I4 i( n
6 W* \6 `! k! {8 Q( J& d mov ax,4fh/ k& @5 e8 E# P; T6 K
int 41h% Q1 n: @% D" b! M+ A4 K
cmp ax, 0F386 ~* U- U- i4 e. E) c( ]
jz SoftICE_detected
- N. [# k5 f x( t1 B. N: X
0 ~0 q% e6 |$ P9 V* A4 t. n- s; Z6 {. \/ w% R% z/ r; \
Next method as well as the following one are 2 examples from Stone's / C8 c: w" `9 r1 t5 u; _7 [, ~
"stn-wid.zip" (www.cracking.net):
: F; E4 E. J" ]5 k; S7 h
: {* A0 g3 ^2 G! E mov bx, cs( ?# ^' v& f3 m
lea dx, int41handler2# x; C, `; M' ?7 d$ F M; w
xchg dx, es:[41h*4]) T- x8 N9 Y% l2 D6 Y) R
xchg bx, es:[41h*4+2]- O: Y0 l N+ U* S. ~0 G
mov ax,4fh, q' y4 R- m2 {1 b1 M, `+ k
int 41h8 _- ^5 R H# }; t0 S5 U' H
xchg dx, es:[41h*4]* j& U- p1 {6 W& g# P. `
xchg bx, es:[41h*4+2] }' y9 E; h) S+ r! y Z
cmp ax, 0f386h) ^3 l. E+ R* L* P0 Q
jz SoftICE_detected# ~) L/ y( l4 a; Q& b
; Y/ W9 l" `* U/ `, D
int41handler2 PROC- T+ f# f Q) j/ P
iret
4 S% n# B9 ^7 @# Cint41handler2 ENDP0 _, w0 P( l" l" K3 P3 s( J
8 x4 r3 W! H* U: p* L
3 i! _- h8 G; x+ ?; @' t/ F_________________________________________________________________________
! Q* `7 B( h2 I+ y3 W
+ c! q" x: U' ^; Z$ K
5 G& i" c; v3 m0 p* Q% p2 dMethod 068 ^7 J4 E" e5 Z. T6 U) s
=========
4 m% w& A/ e: f! k$ r; _, O) y
6 { p T7 n" b. R+ X
, }/ U/ `7 b- S+ s& ^2nd method similar to the preceding one but more difficult to detect:
7 n# N1 d% U; ^
7 Z; h/ @. s* U& E% T! R5 P( a% b) \: S9 ^
int41handler PROC4 u+ M6 V5 U- X
mov cl,al) {$ m4 i2 o$ r7 c
iret
! k0 z' m" m4 x! c: tint41handler ENDP
7 g& v9 I& u$ }' a8 s& D
) K6 ?. ^0 }5 x" E0 k g' X6 b3 y+ t4 q w4 G
xor ax,ax. }1 ]! l+ @6 t; a
mov es,ax
* k2 k+ R( B3 C- r: G6 S! P6 t l mov bx, cs+ O g- P% K' \% L
lea dx, int41handler
; F: g' v1 Q# c% y. D' A! D xchg dx, es:[41h*4]
5 t3 d% s+ R9 V4 U xchg bx, es:[41h*4+2]! _& j& h4 z4 Z/ _* F6 Y
in al, 40h
, {5 B/ V4 x0 W- J, h4 X: k- n, T- o# a xor cx,cx L( S0 ]+ X5 b
int 41h9 q4 N* H$ D7 L+ [* z( k6 m
xchg dx, es:[41h*4]2 ]. S2 d. W' o+ A$ M- N Y U
xchg bx, es:[41h*4+2]( I8 _6 A8 J" \* V' _4 p* q
cmp cl,al
' s, n# o8 U4 X. Q jnz SoftICE_detected! B( t( g x3 n0 j9 h
c' y, a* W, O9 _( S
_________________________________________________________________________* i% V9 v& H% C, ~: e! |" b" X
+ O: R e6 M' X% G) }! f
Method 07
0 e; m* Z# O! h6 ^2 q=========8 F& l+ v5 }4 D7 G
* ^, m. y5 u2 qMethod of detection of the WinICE handler in the int68h (V86)) E' {3 I1 j- i- r1 s
6 }: T# H& q* b8 O$ _ mov ah,43h
. B" b9 B& P) ]' J3 { int 68h" W T$ Q5 H+ n# t! S9 j T/ {
cmp ax,0F386h
6 o5 G, d7 k4 ?9 P5 r) ^$ G( b jz SoftICE_Detected. y" m' N1 f. c: H. B- J, \( s
" V$ y* ~) n- ]# s9 H$ o# ]7 x( W9 x, ^! U, k* r$ R# ?
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
# r5 k, s9 y) U' h' z app like this:7 |3 G5 K/ |4 C, b1 I9 ? F& M
+ g+ { U5 y# r$ N. t% l( L0 [ BPX exec_int if ax==68
4 U) ~1 N8 R7 M/ P (function called is located at byte ptr [ebp+1Dh] and client eip is
; q. m( ~8 _% q0 N( @2 u located at [ebp+48h] for 32Bit apps)
8 O2 `1 X) f' h' P4 T2 f__________________________________________________________________________
: L/ o: b# j [1 ?2 X6 A% L2 V/ b1 Z m
- d8 L) V9 L- G. {1 OMethod 08
% B* E5 \! }6 y=========, K+ z; C S, v0 _
8 D" m" p) C0 aIt is not a method of detection of SoftICE but a possibility to crash the
8 K" U- m- B- ~, `2 a: G9 N" vsystem by intercepting int 01h and int 03h and redirecting them to another B# E' Y- A& e/ T9 G5 n' A& X
routine.7 E k( \! m6 @2 G0 S/ I! ?8 @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ `) f( B9 {# u# [3 ato the new routine to execute (hangs computer...)
; |3 q& B) e8 B. t7 X a' Z$ U, i) Q: o i* h9 q
mov ah, 25h; _$ o- c6 [0 q
mov al, Int_Number (01h or 03h)5 d4 ?2 Z# j- {5 k
mov dx, offset New_Int_Routine
; v7 w" x i! P" W9 x. H# Z/ A8 S int 21h
4 `% C( b% G! m* H9 n# J) V, ]
: X% I4 q- [/ }) Y__________________________________________________________________________
: a* X) b- X, D5 q \/ }# P+ j+ i' z n8 F& q8 t/ O
Method 09
) r$ x o' \& r$ l5 q5 Z; r. t=========
( b' {# N$ {4 ^; }: X7 q; Y! A1 s5 A1 \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 x3 v- a2 i+ g
performed in ring0 (VxD or a ring3 app using the VxdCall).
1 K u# q3 w7 X) h, WThe Get_DDB service is used to determine whether or not a VxD is installed4 j1 W4 j9 r) x, I, |+ Z
for the specified device and returns a Device Description Block (in ecx) for
7 x; T3 g% ^9 S( p2 pthat device if it is installed.5 ]. V- M" p6 d2 |: @3 l* K
/ c# \# b5 @/ T4 v- u
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 V' Z! S) n& g; ?6 Z3 ]
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 p% a I" k3 r2 `
VMMCall Get_DDB3 f; F) n, ~& D, m7 @
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- F6 Y4 Z8 t3 [# e; W3 t
1 |) J) C( D" f& y3 mNote as well that you can easily detect this method with SoftICE:
& k3 g3 L# _5 _$ v! t3 L) U bpx Get_DDB if ax==0202 || ax==7a5fh
7 h" b7 v6 ?5 O5 q! I+ y& C
7 D1 L J+ Q1 X__________________________________________________________________________
$ @9 T# }0 N6 g' j- J: N6 F3 ^* N: |- C2 W' a2 Z
Method 10
' q5 o5 R3 S* ?# ]=========! P5 G8 ~! n( |) {/ B# ]" `
: o4 D7 ~. _$ q6 ^( F: L=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 p+ _$ L! }& f r. n SoftICE while the option is enable!!+ {( W% z( |8 F$ |+ |: V6 ?. [, T
& l& z+ h# g7 r% F
This trick is very efficient:
U% ]% G6 P5 G2 h% B# l) P4 Sby checking the Debug Registers, you can detect if SoftICE is loaded
$ K# d/ h, `" H; {# t(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 g! S$ t- X/ L! Q
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ j" f$ G2 e$ E2 W" w
value (in ring0 only). Values can be manipulated and or changed as well/ o8 p2 T( T2 a- t
(clearing BPMs for instance)3 _4 ~; B9 P6 ~; i4 b
$ d: T! _! n% J5 h, t
__________________________________________________________________________% ^3 \1 Z _3 n+ i
( \" y" K; K3 ^8 u0 [
Method 11
/ x: L/ ]* B2 P=========/ @) x0 o! ^. e& u" Z
' s- { }, A, Q3 v4 d7 ~$ GThis method is most known as 'MeltICE' because it has been freely distributed
, u) K! [2 ]# M% _, ^via www.winfiles.com. However it was first used by NuMega people to allow! [. |/ O n B, x
Symbol Loader to check if SoftICE was active or not (the code is located2 g( J& y1 \% @# Y6 m! V
inside nmtrans.dll).
/ H3 E9 v5 k: c2 N
6 g U; k- p- f4 bThe way it works is very simple:7 W: Y. E; B% G
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 F4 D( p& F/ D$ {6 }( J
WinNT) with the CreateFileA API.* j, i l( W* m4 {/ E, J9 D% T
+ d% T$ W% B3 @8 N& q5 H( G
Here is a sample (checking for 'SICE'):
q' u( K2 H B; k! ^
9 I+ M+ j. ^7 k O9 |5 A [5 IBOOL IsSoftIce95Loaded()' I* E9 F1 [) U; U; R, V
{% S: K1 g. P8 e: V6 a" X1 e
HANDLE hFile; 0 V1 U g3 \9 X6 n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 f' C# X" Y! }) x4 r) U4 _6 T
FILE_SHARE_READ | FILE_SHARE_WRITE,8 s; l# ]3 @. O( p. ^* I9 L# L
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' V0 @& B; i9 d8 @
if( hFile != INVALID_HANDLE_VALUE )/ o p; m: D( s6 b3 g; f, T; I, c( V
{
4 x! q' E% \: v& Q/ T$ M) M7 J8 n1 t CloseHandle(hFile);
2 o: E9 m3 L+ C1 @( u return TRUE;( a4 L0 C) ^3 |% b5 l
}$ ~6 L$ N; W h% C( Y6 A( C% Q
return FALSE;
4 e: Z6 ~* ^: k. G} _/ E; G3 w" e" u4 W8 g; U
& f" _6 Y3 f$ X1 K- p! u5 b4 M
Although this trick calls the CreateFileA function, don't even expect to be$ u/ z) j# T3 P: e1 o' u
able to intercept it by installing a IFS hook: it will not work, no way!
! y* P8 n# Y1 w& v# C6 G0 B; NIn fact, after the call to CreateFileA it will get through VWIN32 0x001F6 _5 C+ {9 Y2 `9 m( O- ~+ Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ K* X3 r# A2 `- Y0 i; f* ?- ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* @2 j' y( L( j% Y, d$ t- G' Nfield.- H2 U3 W1 ^8 @ ]( U& ]9 L
In fact, its purpose is not to load/unload VxDs but only to send a
. V) W2 H5 b% A9 aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! a- ?/ f5 C* d+ }: B1 H- f \to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 j1 T- @# _+ \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# E* v* c A& \+ tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
4 F, O( L4 O1 Y" }5 Oits handle to be opened and then, will be detected.8 ~' h' J7 w' ~' K- `/ d. g
You can check that simply by hooking Winice.exe control proc entry point# t. a" d1 e9 R; _ N8 m7 F$ {
while running MeltICE.
! X- k# C; }9 m4 {
# b) f5 V* d; r* B9 J9 r9 Z
# c- j7 y; c- X) q) _ 00401067: push 00402025 ; \\.\SICE3 t- p) G9 N- C! J) F. y! b
0040106C: call CreateFileA
0 f2 d6 p" H4 M' O: B- z) c 00401071: cmp eax,-0010 V$ s8 y3 g+ o+ m2 V" ^* N- x
00401074: je 00401091$ _2 o, o4 z5 l: V6 ~
: v, q2 z. o- v; |% Z
. J- C5 M( _& rThere could be hundreds of BPX you could use to detect this trick.
4 E& i& r8 ^ h* a/ G& V5 L-The most classical one is:* S: c( h0 f6 p5 ]0 R7 `8 N6 ?. U
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 o% h+ a* G- Z0 P% y# D
*(esp->4+4)=='NTIC'
; A/ L% D {! |& f. i* F% {
" B V1 Q G' Z-The most exotic ones (could be very slooooow :-(6 k* B2 O9 v* I0 [& T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. W; q: d2 d9 `/ K: D& t- v ;will break 3 times :-(3 s( D' E8 k6 v( ^( w
/ N( [2 F% M4 q9 J( W-or (a bit) faster: $ U' B; N: M' c3 i* z- V8 y4 ~7 R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 s7 S& m( [# L
: ^ B( p; d! d! d" M5 G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * K3 L4 k! N0 Q0 w# u
;will break 3 times :-(
U2 ]7 e2 \0 J& c+ O- A5 k, C
$ a4 H( ?; b) f4 A-Much faster: f7 q7 x4 A6 e' \* H$ _
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# g; u) ^: h& Y3 [3 V
5 h% i5 [! ~ u( K+ C; y4 FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen8 K6 _- ]6 y2 K( [
function to do the same job:8 j$ h: f6 E! L! }. ^
# ]! p7 i4 `8 N push 00 ; OF_READ
4 v( M) [" n# U: I mov eax,[00656634] ; '\\.\SICE',0
; h7 s5 |' c- E, h3 P push eax& u, n/ L/ _$ K$ `
call KERNEL32!_lopen" m, v9 m& f3 b$ Z- N |
inc eax$ B6 |% N1 f8 o3 |7 X
jnz 00650589 ; detected
! }! h& l; ~" _+ m5 P1 x push 00 ; OF_READ* D1 P6 E: Q( k) }/ f. d) y, ?
mov eax,[00656638] ; '\\.\SICE' ]( X% G' H) b( |, T- ?
push eax2 m2 j e+ h) O3 @
call KERNEL32!_lopen; t- T" w4 m- }2 e6 \9 I7 b
inc eax7 p B* [0 r+ O4 j
jz 006505ae ; not detected) f0 X4 O" ?1 F; l" G: I
$ ^: S n0 F* a0 v
4 a: I* ]3 }) ` N
__________________________________________________________________________) l' H" r: l- Z
: X- }1 \% q# t
Method 12
! t5 L+ h5 O0 ^$ \! Y=========
5 {! ]6 f, i9 A8 v" r5 R& M0 }3 X2 a* ?+ e. n
This trick is similar to int41h/4fh Debugger installation check (code 05
: O! z) v9 \" n9 B( @- r; [& 06) but very limited because it's only available for Win95/98 (not NT)
7 @0 a% B3 {7 m1 i; W- u7 Yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 y4 ^& ]* S6 w) t4 o: r: {8 B3 D2 F8 ^: J" B4 B
push 0000004fh ; function 4fh8 P; b: V. y7 x' l: ?9 P# q, P
push 002a002ah ; high word specifies which VxD (VWIN32)
- B8 b% ^2 n- @: A* u ; low word specifies which service, U }3 u7 a) l2 l5 y
(VWIN32_Int41Dispatch)
z$ B6 X% _8 ?5 E9 R7 _$ y( i call Kernel32!ORD_001 ; VxdCall
* ]" s" \. c7 S& u! E cmp ax, 0f386h ; magic number returned by system debuggers k( c. k- x$ p2 k: ]
jz SoftICE_detected
, z5 Y/ a0 l$ e! I
4 A8 F& H; g4 s, i# F9 _Here again, several ways to detect it:7 P' f, a- L" Y4 T1 f
3 U9 V6 E" X4 h2 n1 W
BPINT 41 if ax==4f
% q( K) {& q/ T
; i4 i& L, Z5 F3 ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one$ K' ]' @1 J0 U& m* _% I
) V7 `" p3 }4 X4 A1 z; }
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. T# s7 j5 ?) @7 \0 ^& ~7 @
i0 e. @4 F/ G r" i- s0 H/ t$ z
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, U2 W- P L6 E6 D6 Y" w$ p
4 S0 R! ^+ M4 o# C5 t__________________________________________________________________________
' A- C; J9 g! E* l u3 \, ~+ D8 I( C; l- N, j$ ?6 P: G" M: ]
Method 131 f0 E1 G( n9 Q6 \& k) |
=========
! o. E4 U3 j( Q0 ~9 k+ U! R- a* p9 L) C" f2 M+ n
Not a real method of detection, but a good way to know if SoftICE is
0 e9 j3 a: y: R$ t# k" f s/ g$ Qinstalled on a computer and to locate its installation directory.
) c) N. s$ T) hIt is used by few softs which access the following registry keys (usually #2) :& C( N7 F5 O% k! q" \
. [, E, o1 D6 ]5 [+ g/ c) I; f-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; ~: m6 o# w& U' Y; ]\Uninstall\SoftICE, M# C$ V' _* b- j8 A/ |+ ~/ q$ ?
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" x6 X- m7 u" F3 x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 u' h) H! ~& M( I, O5 ~# J
\App Paths\Loader32.Exe
1 y' y; _: X' O/ a( K( Z+ Z5 s |" R
4 R6 C5 j: y# z$ p) D k$ `. K) `- \ \ F
Note that some nasty apps could then erase all files from SoftICE directory* y1 T; V: L& q ^) {
(I faced that once :-(3 F) ]2 H+ ?+ P1 w+ v
. Y# _& U/ B% lUseful breakpoint to detect it:
, Z0 e! P, e( b
8 | |* p, J% r+ ~" [& a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 \( t. b9 G4 m" L2 a1 ?; Z, L( @2 Z5 e1 q- q7 B
__________________________________________________________________________- P! A* z) Y# |' n) E
8 j4 i4 y4 q2 |8 {/ v- D
6 h4 G# `! P3 b, W) CMethod 14
% g: I$ N3 U* j, ?: Y8 Q" s( m5 p=========9 P V7 {/ w/ M
1 J$ y8 D- b2 t+ `0 D/ b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ y. I+ y; }+ G" {9 r( [% p
is to determines whether a debugger is running on your system (ring0 only).
! }/ x5 E- x9 O5 y' R1 N* C, X9 T9 `6 f4 q$ d9 n) U5 E i" }( L
VMMCall Test_Debug_Installed
2 m9 L) R7 x/ r' V' y5 J je not_installed
& F5 O7 ?* J% n. W: {+ K2 x: u$ T7 m4 N0 w$ e% D* w
This service just checks a flag.
! G7 l( w) M0 V; o+ u6 f$ L</PRE></TD></TR></TBODY></TABLE> |