<TABLE width=500>
4 S5 \1 m4 V3 N7 @8 O<TBODY>3 h5 `! w: b0 q, V! O. c7 g
<TR># @" n5 V; ?# f. G6 _# }9 s
<TD><PRE>Method 01 * [* ]$ U, L. y1 s) Q6 I
=========3 m+ t; a4 J o
9 }$ k- V8 X* R' v) D
This method of detection of SoftICE (as well as the following one) is7 |8 A8 c) X# b/ O* G" j
used by the majority of packers/encryptors found on Internet.
+ p/ o# W1 f' |It seeks the signature of BoundsChecker in SoftICE
+ w& S2 E# Y& T) F# R9 O( P4 H* m' l- T5 a) _- k
mov ebp, 04243484Bh ; 'BCHK'# U. k2 ]+ K1 d, o
mov ax, 04h+ D; ], \1 y0 c% Q
int 3
; s n- e5 P" \6 p cmp al,4- X$ ~- A2 i( K- D
jnz SoftICE_Detected5 E0 [+ @ i+ ]3 R
8 h$ N5 K% Z) f5 m: x+ _" s
___________________________________________________________________________
9 L* a9 ?/ V+ |9 M9 f" }2 i X' v" m: N( N
Method 02, Q( O! k7 Y; F' c3 t& e4 `
=========
7 O f+ H8 z' B: r+ e2 x
+ F) C- q( C) M* [: S6 RStill a method very much used (perhaps the most frequent one). It is used z' e6 V( ^8 G3 L' _/ ? z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( T& {& C4 \, ]6 f& k0 M1 \ o9 O
or execute SoftICE commands...
' B& C$ q: ^4 `5 p3 L1 DIt is also used to crash SoftICE and to force it to execute any commands! r' h& h/ \7 m; V: [
(HBOOT...) :-(( # t+ @/ J, g$ m2 W8 h* r) V0 _& e
! g9 k' Y& {5 Z
Here is a quick description:
/ L3 @! {& z# P& ?-AX = 0910h (Display string in SIce windows)
9 z+ Y/ |2 S" q2 g-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 g, A: h& ]( R: p! K-AX = 0912h (Get breakpoint infos)% k+ m" u) n( N$ p( Z- y
-AX = 0913h (Set Sice breakpoints)
3 [* F. K# |9 N0 R-AX = 0914h (Remove SIce breakoints)
. w1 ?% |1 ~5 R" P+ x6 ~3 ]
, I8 i4 }: ^1 {. d. yEach time you'll meet this trick, you'll see:
0 f- j% a" n& Z- v$ f-SI = 4647h
) i# F- |0 ~2 F w-DI = 4A4Dh
% Q4 \ ]1 c; `# w ~ E' mWhich are the 'magic values' used by SoftIce.
4 e. t5 i: Z# Z) P7 o- Q h+ JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- q6 v. U( z. F0 {- m
* U+ H0 ]+ {" t1 d+ r) fHere is one example from the file "Haspinst.exe" which is the dongle HASP
9 X3 R+ Z# D7 B% LEnvelope utility use to protect DOS applications:/ D! W# [9 W! p) S: \! z
9 v3 i2 {3 l! `
0 B" [ Z1 A- P$ P5 q4C19:0095 MOV AX,0911 ; execute command.! e- Z' T+ M/ a; g% ]8 `) J: g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 Z- I e( m5 ]% |5 _/ ?4C19:009A MOV SI,4647 ; 1st magic value.
8 j4 Y8 J7 _7 r- `( Y4C19:009D MOV DI,4A4D ; 2nd magic value. Y( ?/ j! w$ D5 j; S7 X
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 k5 q( V, `" j: b- Y: Z4 ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- O$ v1 D* L4 B7 G: z0 J: d/ Q4C19:00A4 INC CX( B, n* v: R" b( r1 n
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, n# b6 v1 ?4 U; [, t4C19:00A8 JB 0095 ; 6 different commands.6 u' r5 b) v3 r: r; t0 e' `# |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. {# A! A" z' R, r7 w0 a4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" G9 K4 D) q( i# y" m* H) r& e# W9 o; Q: \5 c# u$ P
The program will execute 6 different SIce commands located at ds:dx, which
. ] t0 F# I; w: p1 ]1 B* a) ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( s- O" I1 s, m3 C# u1 l3 ^: t0 ]
: l# y- C1 j* ?3 e# S6 [. x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" |8 N8 u9 t! I m% O7 V8 B; ^) x9 d0 }___________________________________________________________________________3 A- o; O# ^: E8 j- v, M4 o4 A) N! b
+ Y! B: w! k' B C9 s; y$ w2 d! H: Z
Method 03& U! Q; g* K) y% U1 n
=========5 z) X9 T, f+ a" N1 e4 T& b3 a8 B8 w
: T0 q1 ~3 e) X0 M- j7 T6 i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. r6 R! ]% u' p5 d
(API Get entry point)
% P, B* O P! h5 B2 C 4 C8 D0 ?9 h' c1 b8 x# f
4 G) g+ \4 w' s9 y4 k' u M4 O7 C
xor di,di7 }) a% K9 B3 {& G
mov es,di! r# X' N6 C1 n
mov ax, 1684h
* R' \* M3 r- Q7 P- ?2 G! ~: ]4 r" X mov bx, 0202h ; VxD ID of winice5 t! V: N" h+ Q2 D/ T
int 2Fh, O& @' }: U4 L
mov ax, es ; ES:DI -> VxD API entry point( [1 l7 ^; p0 M2 i Q
add ax, di& V: ?2 c% Q5 V7 e
test ax,ax. S3 ^- j2 s# }+ t N! e" g
jnz SoftICE_Detected3 \/ L( E' Z4 E! o/ d6 E
+ [% A) J) v" C& L0 ^
___________________________________________________________________________2 }8 y8 C+ q3 u7 y/ C0 {7 }
' k( W! |& S) U9 TMethod 04
# N, T1 Y: a; r; T3 ^; E/ j=========0 f6 j) O# h$ b* q4 V, x0 V
& T' J' o4 c; L& GMethod identical to the preceding one except that it seeks the ID of SoftICE
* }! Z7 }5 g% o* ~6 wGFX VxD.
, b% {2 h6 A5 n) I2 M
6 q0 Z' n& q& Q9 z h% n- F% P xor di,di
. X- O" j! a! @# J* c, m mov es,di
6 [ c K% @+ s- a, _" h0 e: ?; p mov ax, 1684h , C2 o0 Z/ W& r& ^! v: \) b
mov bx, 7a5Fh ; VxD ID of SIWVID
" C& l5 z- \$ @6 [ int 2fh$ `2 X: ~# f6 }" C
mov ax, es ; ES:DI -> VxD API entry point
3 V J. H1 U, w% x) R add ax, di. W7 X) K" e" i' c; f. r* s
test ax,ax2 r2 Q5 E- ] q0 Y; e( E
jnz SoftICE_Detected
3 M* k" Y, D: y9 |$ b6 ~
# T4 \8 ?+ l: w; H2 f' c% l7 ]/ ]__________________________________________________________________________* b* e0 t8 Z, W* S2 A1 _9 T' O- s, P
) }. v7 O6 t! L9 |) |; r# }' e8 ^
+ G8 h- o& i" r j; P/ [/ `
Method 05! q& g" P6 R7 i" g* i
=========; c& x" W! S' g+ s/ ~0 `
3 d4 w9 M7 y8 |, W7 `7 R
Method seeking the 'magic number' 0F386h returned (in ax) by all system6 y) r; T, S) L. O0 q
debugger. It calls the int 41h, function 4Fh.0 _1 z! g3 X; {4 s$ i u
There are several alternatives.
. e% x* \$ [! A% i9 K4 L5 U. j9 Q* |5 D# b: [7 {8 f
The following one is the simplest:- ?0 B3 K8 {% |/ f
9 s& A+ ~8 j, s( I) C) K9 F& ~
mov ax,4fh
' \' y& G" D' @* V* p2 t! p int 41h6 K; ]" C0 n% a% u( s
cmp ax, 0F386
6 y7 ]9 h3 c9 V" i1 q4 e6 N6 w5 D$ E jz SoftICE_detected
$ ^$ l( B& Q9 U. R/ C8 _0 j, i" t, C% |7 p% s) _+ o
p+ h1 a3 G. n& |Next method as well as the following one are 2 examples from Stone's 6 F' S/ _3 ?- J9 o$ ?
"stn-wid.zip" (www.cracking.net):
& {7 F0 k8 Q m' y% b' [' V8 z+ z% I9 p6 o
mov bx, cs
3 ^) h, h( ?9 w- r; k" f lea dx, int41handler2
& q" ~5 r' t- S& z1 k i xchg dx, es:[41h*4]. q7 c2 F# _$ j7 p6 F, D
xchg bx, es:[41h*4+2]) w6 e! E0 p: [" u y5 v! q, R1 ?9 E' E1 e
mov ax,4fh( ~/ n6 O5 Q y: Z
int 41h* Y& A; h2 Q# l7 e
xchg dx, es:[41h*4]2 |. Z: \$ T6 {- _3 v8 t
xchg bx, es:[41h*4+2]
0 p6 ^& \6 r. Z: { cmp ax, 0f386h# t0 }2 ^* c# c
jz SoftICE_detected
/ W( ^; Z% o% F- k- V
O+ ?) _4 b0 ?+ L w0 j; v: ]int41handler2 PROC! a; N6 `+ N& q
iret* c" H- k2 K0 @. U; p
int41handler2 ENDP
' i2 H% ?9 l& R' ?* w' ]: A' q, M4 _& c( T% {9 t
/ D9 O0 Z! ^9 a3 i8 R0 A) J" E& I_________________________________________________________________________1 f0 q6 [2 P, C8 V
. l3 V! p+ e1 U2 V& P& f( i
; H8 z& |: g( h+ q: t# ~) TMethod 06
) a! `3 p$ k& `=========
- m) l% |* G/ D3 H6 l& D0 y
# X! r! g- i' ]
1 h4 S; l V! u: t* ?2nd method similar to the preceding one but more difficult to detect:
7 H: ?1 a; C+ ~1 I7 u
+ A. R4 e! M& {- o: J
3 K4 V7 \2 [9 M% e/ |# Fint41handler PROC# n8 D( g% [+ w
mov cl,al
. O! z+ E: P4 V, `, W) s* W4 k iret: z' P4 a1 [7 r4 U. P; J( l
int41handler ENDP
+ t0 _0 ?: A$ W( t+ _5 |5 l/ V1 ^1 Y; Z/ c$ j
0 h ]+ F7 s" f5 E. W( d
xor ax,ax
$ C+ A0 p; O- R) H# R# z/ F# I- I mov es,ax
4 U) A) `( W O) v7 h z- Y mov bx, cs
8 Y3 W- G- |( y* ]" y7 [ lea dx, int41handler
6 } ]. X* |5 Y1 ?+ T! K. q# A3 [ xchg dx, es:[41h*4]
R7 a: t# P: S( v xchg bx, es:[41h*4+2]
2 b# C2 m( r3 o+ W% h in al, 40h
5 w0 y9 n' } U xor cx,cx% d0 s1 k) ?* E% ^- T$ A5 K
int 41h
7 v+ x- v* M1 [ xchg dx, es:[41h*4]8 u" K$ b* `! z0 o5 ]1 c
xchg bx, es:[41h*4+2]
5 p W0 G1 X4 i4 ` cmp cl,al
( E1 p- S# x$ M6 z6 w: Z( H* r jnz SoftICE_detected4 \6 h. e" O7 n: \# F; F. O7 U
& a/ i; u$ c; j5 a, j% Z+ S; M
_________________________________________________________________________2 n% U2 d$ p% F# m9 w/ C, x( v3 f) h* S
' j8 A8 e6 O0 d1 m, [6 R
Method 07! Q9 \) E; _1 K1 l" L
=========
! F o$ Y$ U& a; k& W) F0 W, T( @9 O J A$ f
Method of detection of the WinICE handler in the int68h (V86)# K4 a! |! L4 w4 P* H% n: w* h( d
$ U9 y# E. M9 o" e5 c
mov ah,43h
& n8 x$ I0 n/ e int 68h
0 i. f% y2 Q3 k2 k# s) E cmp ax,0F386h* j; T5 `) Q3 X! @
jz SoftICE_Detected
" U3 C5 p5 B8 l& I. H
" V! o; q6 B+ V+ |" i
) E6 E1 R c0 D3 |=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" v: J; k# Q, b; D- a* l/ e app like this:
: p0 F- R9 Y- m- P! r" ^" Y! U6 @6 a* R: t4 ]+ v- j
BPX exec_int if ax==68+ e% s4 K/ t* o' U9 \
(function called is located at byte ptr [ebp+1Dh] and client eip is
; W) R4 h% e* f, B located at [ebp+48h] for 32Bit apps)
* a! ~, Z; }9 |4 s. j__________________________________________________________________________
4 \/ z: g% @& ~- V
& u: _4 B7 F5 Q4 E \0 b6 m
9 p. p: V3 Y Q7 @ P; TMethod 08
/ t! F2 x6 a1 F' C; ~; T=========/ t7 V7 M0 u) h, k' r
3 W- k- _. N8 ?8 l+ N, tIt is not a method of detection of SoftICE but a possibility to crash the- D6 f+ H' F5 p2 x
system by intercepting int 01h and int 03h and redirecting them to another+ u! ~+ n1 V9 [1 `
routine.
6 k1 y- S- W; O- W. ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 M$ B2 l i0 p# K# Xto the new routine to execute (hangs computer...)
. g# O" a$ l9 C! w, g4 A2 ~! a. D7 C" s7 |( P. \# ~
mov ah, 25h
1 W, K, |1 o4 @3 N2 [ mov al, Int_Number (01h or 03h)' q% P" f( H! q! j, A
mov dx, offset New_Int_Routine+ E; U7 g3 _ s
int 21h- v4 F4 }8 Q' u4 O1 Y
) i m6 p$ _( C7 B: X
__________________________________________________________________________! f3 D' Q4 Z2 s
* s( ~: v3 w: f9 b5 w4 O. ^$ PMethod 09. W5 @* X4 l: z* c8 h7 B4 b
=========# `5 `7 ?; L( d* [
* b7 O {6 a0 w+ \3 d
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 v+ t3 R/ i+ O% |% i/ U/ C, Jperformed in ring0 (VxD or a ring3 app using the VxdCall)." I4 J. J' r4 r. W- i/ H; l8 K
The Get_DDB service is used to determine whether or not a VxD is installed- c/ j# p/ C* W
for the specified device and returns a Device Description Block (in ecx) for; I/ e3 ^3 ? E$ Y3 }& r' l: e
that device if it is installed.5 I4 a3 [9 \: H, M' F% D
7 ^, }/ T7 B2 s
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ ^8 m4 w# z+ O t7 h; `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 d6 s5 P# K4 p7 R' F' [ VMMCall Get_DDB7 W8 M# f) P: m# \0 ^
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 _5 o. q; K7 p# T+ \* e
' n' ?2 B$ M' B% L. KNote as well that you can easily detect this method with SoftICE:
- g% o$ B F: \4 o c8 f- B bpx Get_DDB if ax==0202 || ax==7a5fh. j- m* a+ C0 ~& Y' n
* Q+ w$ Y% K2 B8 b7 `8 H7 i8 w$ C__________________________________________________________________________
, g" c6 H/ M6 e0 `2 m: I7 \6 H8 i
2 z0 K/ g. n9 w/ b1 d4 ~" F" rMethod 10
$ L- q; h+ G/ f, }4 y=========
- j, ~9 S# t+ K& V L9 _+ w$ v5 {0 v1 W* B. e& `5 p: M
=>Disable or clear breakpoints before using this feature. DO NOT trace with- H8 a2 s, y3 c% w
SoftICE while the option is enable!!
+ w1 f$ h8 _0 N! |' G2 [! o" i! j4 z% s
This trick is very efficient:+ e7 i" z4 h0 r7 X
by checking the Debug Registers, you can detect if SoftICE is loaded" ^! c% C2 g" \% H9 Y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 D, H' k y+ t( v
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 W8 g6 T, o. I, P/ n3 U! l+ n
value (in ring0 only). Values can be manipulated and or changed as well
# t& y- q. b: _# K* X; H(clearing BPMs for instance)
- d, G5 n5 A. }% z2 P+ F
: E7 R, F' X* c4 z__________________________________________________________________________
: \ ?* h) c8 Q0 G
1 T, R& E& Y8 u( T9 l; j$ P1 }* OMethod 11) V& v9 R& Q0 E2 B# a1 b
=========
% w3 b: Q" S) f, r0 @
# }8 m5 w/ D+ \) YThis method is most known as 'MeltICE' because it has been freely distributed
7 E: v* T, ]3 m6 O/ q8 ~via www.winfiles.com. However it was first used by NuMega people to allow
) p% t. k4 Y1 U/ ?9 ?2 ZSymbol Loader to check if SoftICE was active or not (the code is located2 }1 E: a5 P6 _3 |2 X" ~9 P
inside nmtrans.dll).
0 `2 H9 |# c U3 ]% q* F ^: u5 r% `6 k& d# T7 `
The way it works is very simple: d- A6 Z9 q* ~9 Z7 V$ d
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( I! ~$ s; l+ a+ w& z' @2 G5 s
WinNT) with the CreateFileA API.1 n; H/ [4 S- ^9 ~6 p
3 Z( o- ^9 P7 @+ k0 c
Here is a sample (checking for 'SICE'):" X/ n# ^$ o4 {/ M! d
; e& {* e3 X# O. w. l* K
BOOL IsSoftIce95Loaded()! R6 @, n v2 S2 R2 Q
{) z8 S+ p& ?8 P: z+ q: S5 d
HANDLE hFile;
' i! r! M% A/ Q1 t6 K2 P) l hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 ~# F2 V% g" Z3 Q, A) M
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 V9 ?4 j9 w, W) D9 k; v- c6 X NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( `# g& P, z- c6 }8 h: }, w if( hFile != INVALID_HANDLE_VALUE )
0 c7 L6 g: ?5 d4 j {( {3 {$ P7 L- Y5 A; m
CloseHandle(hFile);
6 ?/ p2 b& t2 J" ^5 x3 @6 | [ return TRUE;
, i4 g: o( _; S4 s }4 t7 x; ^" A' m* X3 G
return FALSE;
0 u" Q' H* P: c2 A8 A4 d5 }}
# _3 \' k3 ~" _( l- k4 K `" N0 C% n& o
1 u0 d6 a. q" i9 l- p7 E# A* KAlthough this trick calls the CreateFileA function, don't even expect to be
. a! M9 h1 \: x& V) G% Lable to intercept it by installing a IFS hook: it will not work, no way!/ Q" G2 `4 N( T" J' U0 S2 K& i+ P
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ a# @) N% R" Z1 T& v
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 p; c: K) T; a2 }8 A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. B$ _: e* v& q1 n2 ?5 Mfield.6 {# [; Z6 G# m; Y3 v
In fact, its purpose is not to load/unload VxDs but only to send a
7 w- B1 c$ ~9 k2 wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 k6 {- X8 Y9 `. r# _7 }to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# j' g0 i# W% Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ K" i. E8 m1 P) t) B4 y0 UIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ B! y7 ]$ x' D- @$ S( u$ u9 c$ l/ oits handle to be opened and then, will be detected.- q4 \ n. |! ?+ |" `7 V
You can check that simply by hooking Winice.exe control proc entry point
8 v6 ~- Y& |: u# ^9 _while running MeltICE.
; l; |- r# y* v& O( b
5 x+ L6 e# ]' w/ X$ Y4 Z# c& S' s9 H* _# A6 ~
00401067: push 00402025 ; \\.\SICE9 P. a) [- L% @! v3 H
0040106C: call CreateFileA
; K0 Y! \- @7 G5 Q0 g" l# x# L6 {; c 00401071: cmp eax,-001- g9 q# }" s1 Y7 G, H
00401074: je 00401091
7 x5 j2 Q. k8 l! l9 K4 s9 B+ j
2 i& m% }0 o) f' N: N/ S9 H- ?( ~/ u( T- B2 K P1 n
There could be hundreds of BPX you could use to detect this trick.
0 [- y& [4 {) n" z2 D-The most classical one is:
7 s- T" ~# W+ v( p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 E4 v0 x3 D+ n7 z" I5 R# G: h3 B
*(esp->4+4)=='NTIC'
7 m/ _, N) C" u+ Y5 h6 |
: a4 ` J3 q, Z: H1 {% y4 A-The most exotic ones (could be very slooooow :-(% l- H& Y( X3 [2 L8 Q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . [1 w+ [' q# N, i2 b' F7 s* n
;will break 3 times :-(
7 x- L/ w& ~" M0 |9 T3 W4 j$ b
% E$ ?# ~+ T% Q/ K( W \. q-or (a bit) faster:
5 e# m5 F$ ^$ H& _; L BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ [) y; ?0 v0 w! Z1 _5 X6 G2 F. K( v9 i! C7 K0 P- b
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 y& S: q: s/ s7 P1 V& Y7 @ ;will break 3 times :-(2 d6 V' a4 R% U. V! r
) s! ^1 \, ?& Y* \* n7 R-Much faster:
9 M9 o N) F0 ]8 r BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" z8 o' B$ G. f2 J
- P3 O$ F q$ g/ N, ~4 ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen4 s }7 g5 s. X% j6 R0 s/ B
function to do the same job:
: g- d' Q3 `" }* P8 \& j) ?
9 t3 X; O" M7 [' K8 [4 `/ E push 00 ; OF_READ. I' A4 R" l; X
mov eax,[00656634] ; '\\.\SICE',0
# @9 h- k1 V. M1 T push eax
3 d2 g5 {- V. {" U# G call KERNEL32!_lopen/ [& E4 S1 j( T6 c& q
inc eax
* u% c6 J0 U S ?( N. o, P# |0 x7 G jnz 00650589 ; detected
; o; V( K1 z% ^2 k$ I- F9 e( ~4 G push 00 ; OF_READ
7 g5 Z ~6 O6 C6 A& j7 p. d. ] mov eax,[00656638] ; '\\.\SICE'
. a+ \2 f) ^+ c push eax8 b/ r+ m6 b+ j0 d2 |4 u! _
call KERNEL32!_lopen3 Z6 I6 j' }7 y& w* p
inc eax8 j& I3 G2 n) J9 C; c
jz 006505ae ; not detected6 f, f4 i9 N+ p
' o8 W2 j$ E3 A- Z* I
0 f) D% p, B/ a5 F; j__________________________________________________________________________1 Y) u1 x L4 a
: t2 S' M* u+ A l3 B @
Method 121 O& [/ S( _# H: D7 I/ X% B
=========
( l$ p: H! q; S
" a7 ^+ _9 Q" }/ G" C0 `This trick is similar to int41h/4fh Debugger installation check (code 05
! n+ k" X2 }( ^& 06) but very limited because it's only available for Win95/98 (not NT)
6 D2 m e7 }# k7 y* {( G6 F% @# Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 G2 v# ~ N# S+ X
9 k, b ^ S" U/ ^4 P/ I push 0000004fh ; function 4fh
2 m& d6 k# Q# n8 ^+ h( |# Z, z; ~ push 002a002ah ; high word specifies which VxD (VWIN32)- n) T4 |, Z/ T- b2 h. U
; low word specifies which service
; Y4 R% A' w3 N [ _ (VWIN32_Int41Dispatch)
! O6 L r$ A# f' I call Kernel32!ORD_001 ; VxdCall
e; v( @9 \8 m5 J, O cmp ax, 0f386h ; magic number returned by system debuggers% H% R# A0 v- Z0 Z% T/ u U
jz SoftICE_detected! H& g% k6 N: ^4 i
; d: U# Q2 n2 J7 c7 |Here again, several ways to detect it:, |5 P, D0 B8 n+ x, O( h k
: I+ I! }! y8 G0 q% G1 J
BPINT 41 if ax==4f
& `/ R( ?3 y; I8 D5 v: Z% [* ?( o% k6 p. R9 a! k
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# r# N! ?" a4 L4 \
: z: x+ j/ O* V _3 G& C" q$ @+ e! C BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' a5 f, b* J `( Y. n4 Z5 \# X: A& r ^0 O
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: g: h K% T" E6 M. ]" g1 \
. t2 S- W" J3 T__________________________________________________________________________* f& k" e C4 K# z7 s
# Q( Y4 w6 R |3 N- j& }, \3 O9 oMethod 13$ I' W" f. h$ x7 v6 M4 [* r
=========/ b: e. ^" m$ C& z5 t! D- C
/ X/ H+ [6 |. C* b! `1 T" Z* a2 n
Not a real method of detection, but a good way to know if SoftICE is* u3 K, H0 r- ~6 _: p
installed on a computer and to locate its installation directory.
7 G2 ?3 D: j) c( W4 [' i2 BIt is used by few softs which access the following registry keys (usually #2) :
- u. k. q0 w3 s" a% B" ^ k$ E* x, q1 [- a. _, i( }
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: [# @! L |% B6 U) c& P* r* v\Uninstall\SoftICE
! v" l5 _- I- i1 s- r6 o! D, @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, Y) g' o% {4 U3 M
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: _% K! c5 g/ g+ ?\App Paths\Loader32.Exe5 e5 |3 l1 C" L0 o. Q8 n: _: Q
" q) Z2 Q) S. c) [
6 W5 z6 X/ Q, q u0 j( w7 j
Note that some nasty apps could then erase all files from SoftICE directory
6 K& E$ I0 n; u# J7 B7 x(I faced that once :-(/ h: |% n$ Q% a1 e. D7 m/ \3 I
2 V( d5 S( m3 M, e% ^* k; Z+ G
Useful breakpoint to detect it:2 M" n- q6 j3 ~% c% ?
) T! i6 d9 ?3 D2 E" e0 x% }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ s- c8 k" I# e6 n6 d _% d- g4 s/ |" I' J9 H" W
__________________________________________________________________________
5 ~) ~5 [9 y- ^ O! s. n* R7 I) @% V: A& `( i# y. M, j5 v
: ^3 ^, \2 `$ M5 `" I; ?Method 14
) ?4 L! N; w4 r" a" L=========
6 l/ s2 J, x8 p, N- X
1 d1 R* [% F2 L3 N5 p5 YA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 k6 G8 h4 m# M6 V
is to determines whether a debugger is running on your system (ring0 only).
- Y2 k1 Z2 a3 C2 c6 D: C' T7 G0 X% i6 k
VMMCall Test_Debug_Installed
# D2 |. {5 ]3 s0 a1 T. q je not_installed
' @0 {. \1 J6 x6 y! d: s! c5 M4 v, f1 }2 {0 e, ?+ U
This service just checks a flag.
- X1 O6 S& g4 K1 {8 U& U</PRE></TD></TR></TBODY></TABLE> |