<TABLE width=500>
$ R( F, e- I! X<TBODY>
/ v: A5 ~' b) S# ?" Z, W* P<TR>$ k, a! ~8 K) \6 Q% n; ?# Y
<TD><PRE>Method 01
3 ~# o. g5 m/ R, z' N=========
/ P9 K% |9 G9 U! c w2 V
& e6 }& V9 L, j5 }This method of detection of SoftICE (as well as the following one) is4 n4 J$ o/ Z* W; \- E: d3 P; o
used by the majority of packers/encryptors found on Internet.
5 Z" A2 Y& \: p) ]It seeks the signature of BoundsChecker in SoftICE7 G- B5 L, f* y0 }# D$ P
0 ]3 ^6 h7 ?. p! L" k& l
mov ebp, 04243484Bh ; 'BCHK'5 t) ?% O) S) z7 `
mov ax, 04h! \- g6 Q: a4 C7 Z
int 3
) a B, p5 t: x1 R5 ]5 ` cmp al,4
9 q. h. s0 A4 O& h: b2 l jnz SoftICE_Detected
1 `0 S, u# g! n) G6 F; O
: k- V/ i# ?" m1 \: P% d; T0 S4 ]___________________________________________________________________________4 t" n/ p Q1 O- F+ H- r. ^
- l- J/ z4 }/ ZMethod 02
1 W; a. A% _. |$ Z+ C=========
* t! v5 }* L0 J- W0 x* l
* s3 D, z: K1 E7 c5 XStill a method very much used (perhaps the most frequent one). It is used, F0 L" X1 j/ R: _( S4 ]
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* a, J: V3 e- [4 } n p
or execute SoftICE commands...
7 w+ a2 R; _- f8 Z1 e+ A8 GIt is also used to crash SoftICE and to force it to execute any commands) M) K2 a4 z$ Q* R# L6 W! H
(HBOOT...) :-(( 2 V2 r' ]" e, ]: Y0 r5 n. f6 s
+ ]5 W; j& [/ RHere is a quick description:6 b6 X& V# Z8 G( C% o5 w
-AX = 0910h (Display string in SIce windows)* Y% R9 f% D h% G! ?' P
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# ^7 \5 E' }' W; S6 W1 {
-AX = 0912h (Get breakpoint infos)2 I8 X" J7 v2 x' i c9 X2 Y l& a$ G
-AX = 0913h (Set Sice breakpoints)2 J C5 {1 D8 G, q
-AX = 0914h (Remove SIce breakoints)6 Y* I$ m( m+ g' `( E: c& o/ m
) R8 B2 J$ ^: }- u3 m8 Q7 ~: m; QEach time you'll meet this trick, you'll see:
: E/ [- b6 z1 w) l-SI = 4647h& V9 f9 X$ ~* q3 l8 i6 _
-DI = 4A4Dh8 Q- p' K* E5 q N9 W z
Which are the 'magic values' used by SoftIce.) f3 c- x/ S1 V6 v5 o R& t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- K( U# \5 l h$ F% A+ Z {- Q$ B2 g5 N3 J
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: g; V9 z2 Q, h7 f+ B, q& J HEnvelope utility use to protect DOS applications:, y- E* e* ]/ Y! z2 }3 h9 \
! k' x; O* U0 P$ v: R# A. s
3 ~! X# n x* E. m( t6 ?
4C19:0095 MOV AX,0911 ; execute command.; C' d$ D6 C# o+ v) X
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
# @! b( H! v& F1 K: w4C19:009A MOV SI,4647 ; 1st magic value.. i1 W, y2 S( c" s6 P
4C19:009D MOV DI,4A4D ; 2nd magic value.! i& `9 ^( s& ]) A, I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
) i4 J. k4 J0 h& Y- y: B' Z5 Z4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 n, h" R U( W0 Z: } Q$ D
4C19:00A4 INC CX0 m9 l' X! _: G1 T0 F
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; S, R( A" t" ^0 S4C19:00A8 JB 0095 ; 6 different commands.
" D5 }6 z2 M- s' y, j* x) b" T4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& q/ M$ f& j: K& \+ t4C19:00AD MOV BX,SP ; Good_Guy go ahead :), I" `5 `0 C4 ^# [& ~( _
. z Y/ w, A- |- o- z$ E
The program will execute 6 different SIce commands located at ds:dx, which
4 N7 A( N! H7 }5 ]9 Q$ b7 jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 b9 ~( i# F7 o6 K* \8 f
4 b' p) E. ~4 h$ T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 d0 x" H% H' T1 ~" ~- h. u3 V___________________________________________________________________________
5 E+ ?/ d, t( P* e: }- d/ ?9 Y, A6 J# f5 n/ a0 n. t k& d
: {1 k8 Q; q: j
Method 03
' ~" X( a) j- k/ r=========
- `: j. H3 e) I f: {# f. z3 Z6 j {, C) s1 L
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( a* j/ `5 z( A \
(API Get entry point)! f" c" F; H: w2 S$ I3 ?: K: _2 x
! \2 }$ Y/ k" ]" N8 L6 E& k v
/ [6 O: \" `% @9 Q xor di,di
- u! q6 L7 P Z9 V# {) ]- j+ K mov es,di! G! n& H9 |; S x+ v, l" A9 q: t
mov ax, 1684h
4 L; W& Z/ l9 z; ] r' A mov bx, 0202h ; VxD ID of winice' F1 u' y8 ~# y8 A+ |$ X$ [
int 2Fh5 J8 {5 `) a0 g8 N! j% @
mov ax, es ; ES:DI -> VxD API entry point: \0 `- n) w- u" \" |
add ax, di" g) P3 H) O h. R7 h& X$ c, `
test ax,ax- ~, J {9 u1 m
jnz SoftICE_Detected6 W7 N9 R& J3 y/ q& u( q5 C
% `4 u: F( H+ _+ e" a/ }
___________________________________________________________________________
' ]/ V) l' h2 R! \) A0 u- u: u& e( n# P7 }
Method 04
' T8 d3 S* O5 b, B$ D4 E) y; X7 X=========
; K) f; P! K5 O+ X8 u/ O" i4 x6 ^6 y5 G& C6 P& e5 ?
Method identical to the preceding one except that it seeks the ID of SoftICE0 `, X# I; v6 {# B
GFX VxD.3 \4 k- x' Y5 o$ J5 M: S
/ I5 m) g1 g& p( G# R xor di,di
. S' y3 a7 _ @ mov es,di
0 D' I- Z+ C6 h' B$ w% g mov ax, 1684h $ h* L# G$ G# ]+ N) T. k! W
mov bx, 7a5Fh ; VxD ID of SIWVID9 O! J3 n" e" s2 M( R9 C9 c
int 2fh* x% k; j$ N8 T" `. b8 Z
mov ax, es ; ES:DI -> VxD API entry point
9 X: X9 ?) E& n add ax, di7 V# v |% D! `' b( M5 x: C
test ax,ax
& j0 v$ w: r: W" x5 d* X9 g jnz SoftICE_Detected
* Y6 y5 I/ @& K: |. ? H- ]4 T) |0 o2 [3 c0 Z
__________________________________________________________________________
# r9 B3 p; `" u" g' ~, m' F$ k. J \0 R; s
, m* x/ f/ D0 IMethod 05* W3 F7 M3 V& b# @
=========
6 X: E- ^1 N, _" M
" M1 m% Z0 L% B @9 c9 j$ wMethod seeking the 'magic number' 0F386h returned (in ax) by all system1 C: m# x8 A* N+ F- ^. W
debugger. It calls the int 41h, function 4Fh.# B2 v8 A3 t: u# I
There are several alternatives.
% D$ f# @& A6 ~0 n
1 J5 R1 j$ K q" T( J& T7 g+ tThe following one is the simplest:4 J3 T( A8 a: X9 E
* k ^! R$ T: B9 J$ h7 e" B: z mov ax,4fh4 j0 l4 R' W& Y7 L# |$ y8 Y
int 41h4 e4 K+ _) T+ o" J) H/ a" |" b& o
cmp ax, 0F386/ ~* o( `+ V+ {$ k/ Z
jz SoftICE_detected
5 D1 w% V) ]& L; W* Q7 M
, K. K7 [/ H: \$ E: K1 a2 O- _9 Q4 J1 q! y, B9 T5 `
Next method as well as the following one are 2 examples from Stone's
' X0 p5 e* [* \1 g9 ^3 @# t"stn-wid.zip" (www.cracking.net):" I. b: g8 V* y
. n& v: S/ z* b: L6 d m
mov bx, cs8 Q1 q! @3 Y9 `. z9 F
lea dx, int41handler24 B8 Y$ L3 S) r1 E0 N9 l7 [5 Z
xchg dx, es:[41h*4]! i1 b$ d# ?6 F. H9 h# Q7 A
xchg bx, es:[41h*4+2]% f+ J( v( h A
mov ax,4fh
/ \4 i }& u6 t int 41h& I( h& d2 M% s& `4 y' K, \
xchg dx, es:[41h*4]7 I4 S" R! j3 l6 F4 S4 p6 P
xchg bx, es:[41h*4+2]% U/ }$ {+ b) p6 d
cmp ax, 0f386h
& v% D( j- k) q/ b8 l7 d jz SoftICE_detected
0 i5 x6 ]* }. V0 A+ k& o, ], v" P/ Q# p; M8 F5 B. X
int41handler2 PROC
, j* | Y% b6 Y, y3 i$ F iret) }- o. L c1 j
int41handler2 ENDP, c. E$ `5 w. C* x( Q) F
( c; L: b! T& }+ ]; ^0 j
6 ?2 c4 d" S" p' W
_________________________________________________________________________5 H' z7 P5 I- J0 F
. i. P) i4 S# `
4 u! ?. S% w# c! O& B8 c
Method 06# ~/ J9 U U1 l; `6 |' Y
=========- C/ o5 V( l1 c0 s. [
0 N# j- \% s/ ?5 @( C: {4 m x
. u6 y/ {# E+ B- T B6 @; W/ a- O0 Z
2nd method similar to the preceding one but more difficult to detect:% C7 B1 b( ]" \1 u. G8 P& [
4 q3 J: ?; s* l( V8 B- r, l8 d
1 H. S/ q, v: D: b: r0 X. _9 T- R
int41handler PROC
5 l' x, P4 T' a mov cl,al7 z6 w6 R, B( V8 d) Q: @* h
iret: u; [# R4 B. l1 [. D
int41handler ENDP0 l" |& h/ C) B2 n1 r/ @' Y
0 J7 p3 ?' {6 @6 q- B" I
' a* P$ E8 }9 g; [! ?4 L
xor ax,ax
6 L! N0 g. d" u mov es,ax8 ], I3 y5 j3 u) N4 k- W/ ~1 Y, N' ~
mov bx, cs
1 A, k4 }) I. l' P; U lea dx, int41handler
5 _$ K) q: K. A xchg dx, es:[41h*4]
|& [0 o2 o/ L; p* J xchg bx, es:[41h*4+2]6 V3 ?% {$ ?' U
in al, 40h, n* r, A0 P# I4 v' A. X
xor cx,cx; p8 h3 k$ U0 F
int 41h
9 b3 \7 @# p" ]" m3 b xchg dx, es:[41h*4]# K2 B, _+ ]5 z+ d* r
xchg bx, es:[41h*4+2]/ a2 h# F5 z) S2 M3 }
cmp cl,al
3 }6 w5 t( }6 u" S/ M jnz SoftICE_detected
/ {( E0 S9 P9 C3 n1 F- o/ E
5 ?- s$ f3 K# [) m4 J1 n3 F_________________________________________________________________________0 P l) s0 B7 J
1 x; O/ ~7 j- r. w+ }Method 07
J2 I3 i ?: x- c8 y% w=========
, z$ y5 l u! L) q/ Z8 a5 W! D+ M' c* V7 ]! w/ M
Method of detection of the WinICE handler in the int68h (V86)
3 T5 I' P! Q+ I+ H" W+ H( E6 @+ [2 u. p& r9 t' V
mov ah,43h
) J* P" X" _3 @6 }$ f0 e/ y3 U8 _ int 68h
9 D+ w- |# }4 S- B cmp ax,0F386h
* @' l6 R( [5 W! \: A jz SoftICE_Detected4 t/ k$ p) z6 ?6 `
; L0 m# y4 h/ o. d/ Z1 |0 M3 r5 L& u& @0 W' Y* F6 M4 H
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# @2 I( x' |( u1 A! @2 U Z7 Q
app like this:
$ Z4 N2 L: u0 C% A( b0 B5 u8 Y
* x3 q4 I# K, G BPX exec_int if ax==68
2 L; _- G2 g( j: L (function called is located at byte ptr [ebp+1Dh] and client eip is
2 g. W$ Q% s, L3 D ~* W4 B located at [ebp+48h] for 32Bit apps)
! K$ L0 N8 L( m: y__________________________________________________________________________
6 q3 q8 W, ~6 F+ }! J
7 f: x" A( }0 P: A; ~) j
* x2 Q$ r& b U, ~( k5 DMethod 083 D# n% V# G& F8 ]
=========! @* O r* i6 N, Z
1 T* _2 h8 C, x3 ^, |" fIt is not a method of detection of SoftICE but a possibility to crash the- {% I: d2 j7 w. n8 H% R
system by intercepting int 01h and int 03h and redirecting them to another F8 \0 X* c* M1 \* s
routine.
% n: \. z) N8 n1 Y" OIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ O: M( n7 x) ?- K* U; Uto the new routine to execute (hangs computer...)
) s* x- t5 `. j2 d+ x/ z. q& Z, p8 n9 S) R' T" ]3 M" y
mov ah, 25h
; j' e- U- ?( b9 M& X mov al, Int_Number (01h or 03h)
2 L x% t" c/ I1 q7 t6 k8 F' c mov dx, offset New_Int_Routine
. a9 r3 L9 V: W9 f2 K6 B int 21h
7 C* A) C9 z3 r& U% s, i
" K0 s3 r% ~! S" g__________________________________________________________________________/ C D2 Z' d9 n* k1 H+ `4 U
" Q% m- M3 G1 G5 GMethod 09
# g+ o; Z2 H! K6 |& C. n=========6 i: z- W; S( C ^! _0 e
3 H& A/ m; t# l% [ v/ i5 GThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' ?- x2 L) ~8 C( ?: i
performed in ring0 (VxD or a ring3 app using the VxdCall).
: w3 t S: E$ R, V- yThe Get_DDB service is used to determine whether or not a VxD is installed3 i% z( d7 a! g# G2 [% r4 Y
for the specified device and returns a Device Description Block (in ecx) for
9 p2 \) O) G" }" T, p2 ethat device if it is installed.2 ~; ?. C0 S4 }1 `0 ~& v9 A% b5 e
) w1 D% D# ` A- J: U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) U* c- ^4 |" P1 h' `) Z! U mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) S5 t7 i ?4 {8 V. L: I: V v
VMMCall Get_DDB# y6 F# `6 [" M" V4 v
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 |+ b" q0 D; y0 A5 s
6 |" X! M# Z( ?9 u6 vNote as well that you can easily detect this method with SoftICE:. ^8 ~9 O) f' [: ~0 g
bpx Get_DDB if ax==0202 || ax==7a5fh
% d! E$ C3 M& Z0 E6 W$ n
7 m) p8 n- g+ D: u# H8 g__________________________________________________________________________
' e. [* \! K/ M' w7 @8 T0 ]$ y) `- i' v$ J0 E8 o/ u* B
Method 10" |1 @, s; l, z
========= u/ y- y" M' Z/ ~* \
7 J% m% P( G0 U2 q; D' h' ?0 A& V" ]
=>Disable or clear breakpoints before using this feature. DO NOT trace with) o G- k8 e6 R3 r" e. M; A3 L
SoftICE while the option is enable!!
/ o: Q8 u6 v$ F- V' A* r# X/ l1 S* w2 J+ a; R
This trick is very efficient:( b d( n- y7 ^5 ?1 O
by checking the Debug Registers, you can detect if SoftICE is loaded3 ?( l- v% E+ ~. N, v
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' f5 \* g) y- k$ `
there are some memory breakpoints set (dr0 to dr3) simply by reading their7 t5 S) J& U8 {4 F- P. `8 E
value (in ring0 only). Values can be manipulated and or changed as well, T5 s6 a* h# O# f
(clearing BPMs for instance)
/ h: a8 u A2 B7 e" N2 a
; a) b. _5 ?0 |3 T__________________________________________________________________________
. \( w' m2 D4 c) U) X8 {6 q/ J- N2 L* ~- U a9 I% f. r( P- U2 ^7 O
Method 11
# K* p+ V4 N, C/ V=========( p: v# Q$ C% p# o: n- T
2 F6 O2 \- I3 I* [9 M
This method is most known as 'MeltICE' because it has been freely distributed
K: I. Y& W% f- P) {7 p& bvia www.winfiles.com. However it was first used by NuMega people to allow
! y& M7 G0 z- j, W0 mSymbol Loader to check if SoftICE was active or not (the code is located
2 s. N0 F* [; y7 c1 zinside nmtrans.dll).5 u! U7 Y* v* B; d' }
% y% h( a/ w. j% u/ H
The way it works is very simple:; P _" Z$ W( ^" I( I
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# W$ A I3 b' c4 O7 |2 y
WinNT) with the CreateFileA API.* b; `( x' x8 b% K' [) B
" d% W* K, ] G2 Z" |* yHere is a sample (checking for 'SICE'):/ e6 @! @ V; q# d D0 v0 X- R: c
$ D+ J. X8 }2 A/ B
BOOL IsSoftIce95Loaded()# ?1 x& c( m6 O; W" S" @
{
- X$ Z; O4 R" |7 b% m7 a HANDLE hFile;
8 _, C. ^$ ^+ R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 q& A" [& o2 w5 J8 p
FILE_SHARE_READ | FILE_SHARE_WRITE,) F- }0 u0 ~# f$ _/ e. u" D. w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" c5 A8 j* {; X: u3 z" z& ]3 g
if( hFile != INVALID_HANDLE_VALUE )& J; }: D4 y" H2 l
{
/ C! Y0 \ Q0 F ^5 w CloseHandle(hFile);( y7 q- j; k: ?( D: L! v5 d
return TRUE;
" }. c2 F; Q1 X0 z0 Z! _ }' @& N- v% A4 _. E1 K* J6 G
return FALSE;; k4 e. M8 j2 |( }! c! G* p! \) c* F
}
2 b4 q+ X1 d, \" ~
' c2 g' s# y3 o+ CAlthough this trick calls the CreateFileA function, don't even expect to be
7 \" n) m4 |, W1 Wable to intercept it by installing a IFS hook: it will not work, no way!. r( `# T) l3 W( A
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ ]* W+ B; l, a3 c' N. sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* {9 d2 ^1 B% A( P, ^: d$ mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 j1 L" Q4 |. n b% mfield.8 @+ ~& ?$ o- t2 C. J
In fact, its purpose is not to load/unload VxDs but only to send a / L, Q- Z1 K0 y+ Q0 Y
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 o1 J! _* \2 w5 X
to the VxD Control_Dispatch proc (how the hell a shareware soft could try. F; R4 w& T8 u
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% E1 `# f5 O/ J
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. q d8 B# L. Qits handle to be opened and then, will be detected.! R, C# b9 d0 [2 J+ o- `# s
You can check that simply by hooking Winice.exe control proc entry point
: `( k* v! H2 i; ? g' jwhile running MeltICE.& @# g1 u/ X7 \/ j. d
- j" e3 S7 F1 m
' }9 p7 Y5 `$ x0 u# j- B) a2 s 00401067: push 00402025 ; \\.\SICE* K: \" U" H+ R5 F, \6 Y) ^4 X7 N
0040106C: call CreateFileA
0 \0 D% L3 y. {+ ^; K! J& J 00401071: cmp eax,-001/ ]7 a3 {1 `5 \$ Z: z& E
00401074: je 00401091$ Z6 D) b, Q* F0 u' f$ R
7 P; V( D2 F3 l, r$ z( | K# H p5 z# O, v+ P' Q0 K2 O3 m! }6 y- {
There could be hundreds of BPX you could use to detect this trick.
1 H5 d* M8 ]: L, j5 N. @. u-The most classical one is:
3 j3 e _5 l. {3 r% U9 i! t" l/ @% [ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: A1 a6 W4 O* Z1 [' ~( g4 i *(esp->4+4)=='NTIC'
6 `8 r& ~" ^! t k1 G, T/ K) a7 N' O( D
-The most exotic ones (could be very slooooow :-(
' B0 [* Z/ U4 Q. U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% _3 i$ H) L1 L; ^! L6 D' j& s ;will break 3 times :-(
' w# f0 n# O/ j! s5 F) g* b; }- u8 w; A3 C0 y+ O# y
-or (a bit) faster: 9 I9 k1 @; F* F! Z' s3 ~; W
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 P: ~1 E) E" X, \9 ?6 ~5 K
5 ~, X( X2 }! z, v4 { h4 _ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) s" n1 [1 Z# e, _9 f6 G1 j( C, R% \8 s
;will break 3 times :-(# U5 ^6 a- u! T1 w/ X' o
4 R2 a9 L8 r$ R- N
-Much faster:
6 c0 J" S' N* }8 ], g BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* p+ u5 I6 S& z; c& v6 A+ l
2 U) F5 L5 f# s" J8 c& y( GNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 S- E8 ?, E( hfunction to do the same job:
3 E7 c! M' C; y2 I7 T' H3 N% T5 o: _8 J
' s7 R, }: u9 j! d" t$ f8 ? push 00 ; OF_READ
; Z {7 |/ h* e: J9 S mov eax,[00656634] ; '\\.\SICE',0
' Y1 ]5 Y2 W( O$ _ push eax
, R- D: I' D8 |5 X call KERNEL32!_lopen
: @' {' ` Z# t% W inc eax
/ c& q( F( c0 i. ^ jnz 00650589 ; detected9 G. q# v2 Q3 i5 ]5 E
push 00 ; OF_READ
v9 B2 k! c) Q- m' m mov eax,[00656638] ; '\\.\SICE'
# W. g7 e d1 M% a* ] push eax5 ?4 R1 h2 @& M9 R! W
call KERNEL32!_lopen2 {' e/ D0 N* K
inc eax
( y7 D/ l) s7 v$ ]; O jz 006505ae ; not detected2 I0 ?+ z$ `- C/ M% T" x
4 Z- R y# g5 i7 E
& s) K8 S) c: I7 s
__________________________________________________________________________
. U* x1 J% _$ ?" q$ `1 F5 u' B/ E8 Y t
Method 12# R; ~4 K8 ]5 M$ W) W
=========+ u* w* q8 Q6 j+ S' _/ c+ ^/ \
' I ~! e7 c) ~: B7 I( L jThis trick is similar to int41h/4fh Debugger installation check (code 05
6 ]3 E5 N# b/ h& 06) but very limited because it's only available for Win95/98 (not NT)% W) N4 z* H' Y7 ~& ]- E8 B: n
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) Q9 K* ?; w5 l! w) [! E
5 B0 K; Y& l8 Y e push 0000004fh ; function 4fh$ J0 X; O: R9 l5 e9 q2 ` \
push 002a002ah ; high word specifies which VxD (VWIN32)
! g( {9 Y1 k& s! V5 }$ u ; low word specifies which service" t* Z( b9 }( t- y! y6 \
(VWIN32_Int41Dispatch)1 L8 B' L7 ?; a4 D& J6 L" Y
call Kernel32!ORD_001 ; VxdCall
, D, K1 w0 i5 J. f$ r+ K cmp ax, 0f386h ; magic number returned by system debuggers
- L8 x/ A. l. g. o/ w jz SoftICE_detected' h$ e X) O4 [$ ~/ I
' \. f3 v" M( a Q% THere again, several ways to detect it:5 c0 K9 p# f! ^9 I* n1 r! _
: j. c+ I/ Z% Q4 ~7 b+ w
BPINT 41 if ax==4f
. w3 s& O! V% i% C8 N5 B
# E) s8 l/ G4 ?$ ~# I* \" h3 s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& \3 i. ~8 S) g. S/ ], x! j+ d8 X1 r9 q( f
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ `. I- G7 K& r6 y+ E' I6 A! v) n/ J( I/ f5 y% |4 k
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 P, `/ f! Y: p/ l" @( P
3 D; n. B8 _; L8 }5 r! s' P2 j__________________________________________________________________________6 L. u' ~: H6 E
* }( i: a1 ^$ {% oMethod 132 f. [2 E; R0 _6 N( s7 B4 B
=========. g" F! K6 p2 p
2 c) l6 o2 R9 P" S& x! c' f' C$ v& P
Not a real method of detection, but a good way to know if SoftICE is4 n: V/ D0 ]& r- f# d: L
installed on a computer and to locate its installation directory.! D; N: k4 S# j2 X
It is used by few softs which access the following registry keys (usually #2) :& {* s5 A% p- J
" q; _" V; `: I1 ?7 o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 k1 V$ l# }" P; V7 {7 s\Uninstall\SoftICE
3 P8 v/ w+ W( q$ D: I-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! L& H+ Q1 s/ m6 m( K
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ @3 E$ O& \/ N8 j) T( C\App Paths\Loader32.Exe
, w* P( ~8 j; |# N% v8 h0 ~! |2 l$ X8 T
, T6 Q3 ^# y0 ~Note that some nasty apps could then erase all files from SoftICE directory. k$ E& j' L) P9 Y. }8 C6 k
(I faced that once :-(
- S7 v' t; P4 s2 G9 f1 u9 c$ _4 R
1 U1 ~6 B- Z* J% |- I7 }! uUseful breakpoint to detect it:
8 W' H E- C/ B* A
$ i1 Q) f4 Y, }1 T# O" R1 y" e BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' g4 T6 Q9 V9 i9 i# |! y. H, t3 e2 I8 \7 w5 h% V4 t$ X$ ^
__________________________________________________________________________+ L2 s4 W' L& \0 }" F6 u; Y
0 ]$ \# _8 z% n# C# h: `- s7 N
+ ?8 L0 r* ]4 A: y: {
Method 14
9 \" C/ r1 f% k2 a, a8 m=========5 w6 V* O' P% {
5 b. x5 M B. J: I% w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose U3 K2 R. j1 {$ D1 y: ?
is to determines whether a debugger is running on your system (ring0 only).9 c! M; I7 K. _# s6 _* i
2 g3 C2 V7 I7 A3 N5 K, l
VMMCall Test_Debug_Installed
/ J! |& k/ D& F2 p" {! k1 L je not_installed @- L4 E# Y2 l& b
' F& o0 F& ]; B0 c+ W/ a; X+ r# w
This service just checks a flag.
6 o6 S' g" j8 u</PRE></TD></TR></TBODY></TABLE> |