<TABLE width=500>7 F P3 ?( ]$ ^' F% E! [
<TBODY>6 c% E3 \: {4 u8 A5 O1 c
<TR>3 H7 T- {, v* e- P' T
<TD><PRE>Method 01 ( i& }& w7 P$ v% f" T) m/ q
=========$ ]8 q2 w4 @" W0 b5 N
[! O0 V: b2 @/ y! M" V
This method of detection of SoftICE (as well as the following one) is: K. r1 R; h+ \& C
used by the majority of packers/encryptors found on Internet.( l# ~" ?5 y5 L5 k! p
It seeks the signature of BoundsChecker in SoftICE
- V9 d% F' T, j- n6 ~$ b) ?/ R; j' j; n8 d' T
mov ebp, 04243484Bh ; 'BCHK'. q( \ \ R# a2 V8 n4 y$ Z
mov ax, 04h
4 \* r! {! S" C8 e4 ^ Y* | int 3
/ o% V8 B' g0 H, \& y9 z* b6 [ cmp al,4# T! U0 T+ z. i- K9 W+ o
jnz SoftICE_Detected
; W3 e4 P$ G& i2 p% G2 _1 D
; l1 j3 [. \1 J& S___________________________________________________________________________. [) l8 P) t) m) H
0 Y. @3 H2 E2 @$ [8 B9 y
Method 020 y# |" c6 m' J& F- B
=========
' V$ T; u/ c. ]9 y; k9 I" x6 K: g
Still a method very much used (perhaps the most frequent one). It is used
+ B& m( y. T0 v' N6 ~' eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 R2 n9 C1 p' N: h. a. Q( L- W2 u
or execute SoftICE commands...2 o5 R0 o3 K: }1 u1 R8 z
It is also used to crash SoftICE and to force it to execute any commands0 g x" H! X- e9 Z
(HBOOT...) :-((
# h- r _$ l/ F- _+ r5 K4 {6 S5 I. q! t% \9 `- C
Here is a quick description:
) e# G( X) O( s: @+ ^( p# j-AX = 0910h (Display string in SIce windows)$ y) [/ }& i2 d9 d6 N
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% T# y: \' q2 Q, e8 `
-AX = 0912h (Get breakpoint infos)) l# f2 f b( ?- p
-AX = 0913h (Set Sice breakpoints)
& `/ {# V; h W% d1 a \-AX = 0914h (Remove SIce breakoints)
1 X+ `" K' K q5 e6 Z d; |( v: [. y7 m
Each time you'll meet this trick, you'll see:4 _( M6 S; ^8 O! n
-SI = 4647h2 p. H1 K# Q- E8 b4 [. D c
-DI = 4A4Dh- y5 J# C0 x4 N- l
Which are the 'magic values' used by SoftIce.$ [3 p1 u: i% u' ]& C
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.; s$ E/ |8 p- {4 B- _& h
3 M9 m+ x( R6 N8 M+ A; I* hHere is one example from the file "Haspinst.exe" which is the dongle HASP
) k6 D7 |" G2 A- j; ]) JEnvelope utility use to protect DOS applications:) ~% i0 R. q& n$ N( N9 B3 k
% S* Z' x1 p, h2 z
% z5 }4 U! O/ t4 a2 c* z2 ]4C19:0095 MOV AX,0911 ; execute command.* i: P8 P- s' D! ?3 E! m
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 J6 ]7 c7 `3 d [( y$ t
4C19:009A MOV SI,4647 ; 1st magic value.$ t A( L) }$ E: J0 K7 V, ?
4C19:009D MOV DI,4A4D ; 2nd magic value.9 Z5 q5 y9 X2 p* }4 J
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- u/ ?# \/ ^/ d4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 A9 K! B# H6 N K7 _4C19:00A4 INC CX
& x, S6 Y: a. Y/ @% L4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" }" {+ \. a S4C19:00A8 JB 0095 ; 6 different commands.
' P& b& h3 _- ]5 N: J4C19:00AA JMP 0002 ; Bad_Guy jmp back.- f8 }- ~$ U5 [' {6 @) N- ]
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 f' l# q" }6 p
) Y: C( y) ^5 q0 t9 [The program will execute 6 different SIce commands located at ds:dx, which
9 M. C3 M2 y) ], M! ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, k/ M; ?0 F% f9 J7 Q0 k8 p
; @% }2 Q1 e- z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 Q; J. W) M) b' R, v
___________________________________________________________________________- U% g( O/ c# c1 r2 {* j
8 v5 Y' x: q( u! N6 u
, ]5 B5 {2 h! c3 d; _1 FMethod 032 W1 ?0 n. L9 X0 F! A, u
=========6 I8 `1 O% |* X: J7 q
6 k- k" `. r7 R' ?# rLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. R) T6 W0 B6 g7 W$ z
(API Get entry point)/ [3 l" r I* y( Y' _" C9 o$ r6 G
- u0 v3 t; F0 n7 L2 j/ z- {5 o
+ S0 e4 s8 y* P5 o7 c. |1 Q% {! Q) s8 ` xor di,di4 ^, ?" l% i; j7 {
mov es,di
4 X* B# J5 Y' ?+ J mov ax, 1684h
# L; {3 Q* u9 R, U g L0 J mov bx, 0202h ; VxD ID of winice
+ }$ T' d" v0 y: W+ ` int 2Fh6 a2 D! u8 S, d( O
mov ax, es ; ES:DI -> VxD API entry point
) q5 V) s! N# }" c) w add ax, di
7 G( R6 }2 A9 N6 ? test ax,ax. W9 ?# r, G8 ^( p7 n; |1 N, y
jnz SoftICE_Detected
7 K& [& I9 t' w `
9 i% M: B! I1 V' F$ B/ F" G9 n___________________________________________________________________________; w* U1 ^ e& ~
# S8 O0 ?3 N! l8 s' i, q
Method 04. @9 d0 ~% r" P- m
=========9 U q k4 I: |- R$ J
, K2 e6 T w- @0 L
Method identical to the preceding one except that it seeks the ID of SoftICE
7 |. [: R% p1 l4 L' L. H/ AGFX VxD.& n E' l5 b9 G) ~
- _8 f1 @& B7 U$ i! `
xor di,di1 L b ]( x7 N. |; F: w
mov es,di
, {9 w) i8 T9 A& I" | mov ax, 1684h - v: r7 J% Y! Y9 |. o* A' e
mov bx, 7a5Fh ; VxD ID of SIWVID
7 K4 o% a2 G( i int 2fh( f0 W$ D( n7 D) _0 @2 Y
mov ax, es ; ES:DI -> VxD API entry point7 B9 g7 P, ^; x) e, ?( @
add ax, di/ |# f7 M% L6 S. F0 Y
test ax,ax7 [/ u# j" |# E( o8 K, B
jnz SoftICE_Detected
. h+ ^4 E6 w9 @6 R; n \6 N/ W. i& ?8 E+ _/ s: {
__________________________________________________________________________7 m" m j8 H' g7 a- i/ t7 r& i
+ i9 c$ Y# d' M1 L/ s& k1 s% ?
& o. Q! O) }) o" PMethod 052 ~" T! U# A/ Y* s% t. K. O6 r
=========
2 W, {( c9 ^, N o# q" D1 [! m: G0 e }9 n0 o+ k8 v1 o
Method seeking the 'magic number' 0F386h returned (in ax) by all system
3 j S4 W" W5 w" L2 C" ^/ {. I+ ndebugger. It calls the int 41h, function 4Fh.3 n8 z: a7 j8 g; Q+ e4 ]
There are several alternatives. + p E, g6 E& M3 C3 {
8 F% R* o, ~, `4 f+ H6 W
The following one is the simplest:6 B, G+ Y" E& Q2 f" S
; _$ }- }2 G' Q mov ax,4fh
" S: t( {, g& g; c int 41h
' V3 }5 Y% ^& U# \& P/ W/ O$ J cmp ax, 0F386/ I; g* Q+ X' G# J
jz SoftICE_detected/ [5 A) Q) I3 |7 q. C% F- P6 j/ h
$ ?3 E4 H5 K' h9 L0 Z$ a9 j
3 b7 R" Y, q5 b- \
Next method as well as the following one are 2 examples from Stone's , r5 i6 E V- F8 X8 Q' {7 b: r0 P$ ^
"stn-wid.zip" (www.cracking.net):! I I. I8 G* I- ~% M; A
1 s/ ^, \1 \( x( R4 ] mov bx, cs
: | m4 p! i. X lea dx, int41handler2
6 m; b" _. @/ [; h. K: y H xchg dx, es:[41h*4]
8 e( d, U* O% M0 w6 K xchg bx, es:[41h*4+2]5 p, \( k7 v9 R
mov ax,4fh
; D- ?% X7 ?8 q8 M int 41h
4 p& S+ c% Q' v; s" Y( n# \5 X xchg dx, es:[41h*4]+ Y* a- I1 x$ X. M9 f
xchg bx, es:[41h*4+2]
: q- R2 }+ k% L$ p6 R7 D cmp ax, 0f386h
( ~1 D/ O* ~1 G' O$ ?& A6 K) Z jz SoftICE_detected
* z8 h0 K2 M) \& {5 J. i% P3 V
* Y$ x2 z. Q4 Z0 c0 \ ?) T7 r5 i# Fint41handler2 PROC2 u; ?5 Y4 C& H7 p
iret
% x7 U/ z1 b. X; Oint41handler2 ENDP/ U" m9 e$ i1 v- k
H/ L4 L; v' [7 w& [
; n9 o* R* B, j* y_________________________________________________________________________
# V& t0 [. v+ h3 Z9 Q! P& W6 N: X4 C
3 o+ o; S$ x N$ A S& s' HMethod 064 p/ @, X4 W3 s' O2 R6 r) D3 @
=========$ q& g2 `$ y' H. n$ K5 m T z. j" U7 V
. c9 W" ~2 ?6 t: W% ?5 A' u9 r! W3 ?4 b* B4 _+ o: w; i& t& l6 g" f: ]
2nd method similar to the preceding one but more difficult to detect:
; v. }& |+ {6 D
' @1 Y; |, |( W7 d1 M
5 E, c6 f9 K. p( Y$ bint41handler PROC3 Y8 o5 R4 x& n: O
mov cl,al
1 F' N4 J" x y9 B, J iret7 m; ]0 e) V/ ]! ^7 ]( l& |
int41handler ENDP9 v) {' \5 E8 `5 u8 c1 \, a
$ \% ^) F" ^8 ^5 y2 M' U) B7 T- n& V; x; @, }
xor ax,ax* B5 v% h- I; I. n9 k: ^
mov es,ax
* h- z. U2 s1 ` mov bx, cs
, }% s) a4 Y- A: j3 ? lea dx, int41handler- z7 s8 l1 S- E! ]+ y8 N
xchg dx, es:[41h*4]
" X/ n" j: t+ q; ?+ | xchg bx, es:[41h*4+2]: X9 Y% h6 X& W" f( l/ `9 ^
in al, 40h/ {2 C7 E8 P/ Z3 v5 Z6 ?# F9 g
xor cx,cx V8 K! X; P1 t2 i; H' L
int 41h4 D3 |: s8 i% [% W2 `- b3 I& v
xchg dx, es:[41h*4]
1 t6 ?1 O8 q. w1 E7 ~2 n xchg bx, es:[41h*4+2]" [: O8 z- j$ J1 B7 o4 n+ `; K4 O& L
cmp cl,al5 a( }+ z4 J7 C3 e: S8 a! m8 a
jnz SoftICE_detected
, k" U0 O8 B7 ~- T$ w+ v5 k) [
+ D6 M9 F3 Z9 y* x3 @9 C) t+ C_________________________________________________________________________
: I9 o6 O0 E# x$ b
* w o1 o; P0 w" n& o( f2 {Method 07
& @! H& w1 D2 N1 I4 z=========
: W. ]+ `4 M8 z
. v3 t% z( s/ |7 CMethod of detection of the WinICE handler in the int68h (V86)
3 e" i* t$ X, l4 a. M3 O5 I
* h5 R1 N' K% p mov ah,43h
6 {8 ], x9 u* l* @5 W, Q8 ^ int 68h. A! z/ y, \6 B4 [8 {0 N( B; J9 ^, c
cmp ax,0F386h
9 ?5 T! x+ b5 x @ t5 v: v jz SoftICE_Detected# X7 x. [( a! m J& u
* d6 W- n) c0 n3 N; q$ y+ m" n& @
* `. [9 q' f( o2 w% S1 J=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
m) A( q% g7 ^$ B5 J& w app like this:
" n8 O* L3 p! r; A+ q1 [: f& F, ]
" A+ J ?1 u. F7 x2 E$ f BPX exec_int if ax==68
w& B% Q+ q+ t (function called is located at byte ptr [ebp+1Dh] and client eip is
' t' i' _5 d- z) h located at [ebp+48h] for 32Bit apps)2 V7 T' ?; X L( `% `8 b9 j" T
__________________________________________________________________________) U4 B: K8 o0 p' }' a
5 l6 O7 ~' t7 }$ {
. Y/ }% r5 q7 }, NMethod 08
% M, \2 Y( X7 u6 J# g: L% f=========
" {4 G# ]! b' j1 H
. T9 X0 i1 Y( M' f' x+ D3 M% }8 ^. J3 AIt is not a method of detection of SoftICE but a possibility to crash the
5 \0 J- D' T) x! y- Qsystem by intercepting int 01h and int 03h and redirecting them to another* \3 j% s: K- L
routine.
9 v5 w0 J3 d# G! ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 K9 |# `. V' v% ^% xto the new routine to execute (hangs computer...)
0 j# v: y9 S9 }1 Z- |3 g0 v/ @ O* S Z$ n4 E& t4 F; a2 H: D
mov ah, 25h x6 O; Y+ Q2 m( `
mov al, Int_Number (01h or 03h)" J8 p2 h( m6 k6 J% F: s
mov dx, offset New_Int_Routine0 A: g4 K, K, C6 o
int 21h
- \! ` P2 ?2 I/ L- A
9 G m9 @9 V1 C2 F__________________________________________________________________________6 E# u: d2 D/ I/ Q; G
/ K. E7 T4 Z& q* [& Z! {& S3 aMethod 090 l9 X! w( u( F( h( i
=========
' [1 e" Z6 Y* L9 j, E1 W
7 o9 t# u3 r5 G7 @0 kThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ o q2 C% ^5 C; Zperformed in ring0 (VxD or a ring3 app using the VxdCall).- O2 m# ?, I: C& N' ^7 F" ]% N+ R2 M
The Get_DDB service is used to determine whether or not a VxD is installed* d% Q2 P8 {- Q/ d: h* \
for the specified device and returns a Device Description Block (in ecx) for
8 `# S' w6 h, F2 X, pthat device if it is installed., Q7 V6 ?) x5 {2 k
* r- A9 d5 h w* ]; {% G# W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' c" H; N& s7 k. c* u R Y. z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" |+ H7 w, X2 t6 c4 L VMMCall Get_DDB3 z& J: y% I* c6 A; _
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 H, ^ [+ E ^ {' k0 y" L& a1 f
, F2 e8 _& ?9 i+ C. ONote as well that you can easily detect this method with SoftICE:
$ L6 |; s5 v0 {3 z5 r( z4 T' B bpx Get_DDB if ax==0202 || ax==7a5fh
$ P$ a4 Z% E! w- O. t( V8 G0 y* I$ J$ g* w0 D N& E
__________________________________________________________________________) W- t: r9 g0 j; k( \
0 i Z+ A4 q' r9 t+ sMethod 10
1 u! |' P% j+ A: q! `9 u/ l=========1 ?: e8 e. r/ c: [ d+ A
& @- M V: f/ I, M0 M=>Disable or clear breakpoints before using this feature. DO NOT trace with
) p, ^. @, @, Q/ @ K+ S SoftICE while the option is enable!! c" ~/ g* ^' h* Q! ] R* i: s2 w% H
' S# E5 r v( S8 U% AThis trick is very efficient:3 Z8 K( [5 W1 i; I9 Z, k, X$ L
by checking the Debug Registers, you can detect if SoftICE is loaded$ d2 f8 @1 [! p& v2 r% ~) k l
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- ^. I4 t7 z* V( e
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( F" y; U4 T3 zvalue (in ring0 only). Values can be manipulated and or changed as well
+ E+ C- H# T o3 r/ s l: `(clearing BPMs for instance)6 T" U8 O6 h- c# | R
' S9 Q6 t6 t8 s. v4 e5 H& F__________________________________________________________________________6 X6 N+ a6 z# J
6 A" J, C: f! w, P0 H% FMethod 11
7 ]% y0 @& p( w5 w=========! V' [5 k: A% E# v X
2 w$ D( ?; x8 p" mThis method is most known as 'MeltICE' because it has been freely distributed
% P8 V4 r1 ~9 k. o+ z* pvia www.winfiles.com. However it was first used by NuMega people to allow% h: A1 L, H# Q; N$ M. E
Symbol Loader to check if SoftICE was active or not (the code is located- p& o4 T U. u3 `
inside nmtrans.dll).
0 h0 s' ]) [7 h: H# c, b
& }/ | I1 F" k7 r$ r" z* _The way it works is very simple:. z$ D# L v) t# b! R7 o& ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ c2 U. l9 Q- U' g6 _# v$ h
WinNT) with the CreateFileA API.
% M6 @1 p+ j" E& G z: w0 ~- S4 _% \
Here is a sample (checking for 'SICE'):
$ w% R7 k5 T o# {
/ Q& c' W6 k5 x1 d+ b7 ABOOL IsSoftIce95Loaded()
% u, f0 A% a3 n& f* v" f+ j{2 j" J2 N( H' y$ F/ t f3 t
HANDLE hFile;
8 j! [0 a7 g3 s( a$ L+ \0 W hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: E) J2 n( f' Z3 X8 i
FILE_SHARE_READ | FILE_SHARE_WRITE,
' d$ {$ R( w: E' h# |+ t NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, ~: C; T- Y- q _1 ^- l" |
if( hFile != INVALID_HANDLE_VALUE )
% ^8 a6 n1 i; p! s" F% ? {0 s8 T- v5 D$ e+ ~% [$ r, n
CloseHandle(hFile);) _8 t* l# b, n1 d8 L2 S- U
return TRUE;
$ j" J+ U3 w p$ Y7 H# L$ Q' ^ }
8 O& i, ~' P, R, { return FALSE;
" @* Z# E6 O1 ^! S0 _! L. @}
) C' z: J6 a% K' X: Q
# r" l3 S2 x( IAlthough this trick calls the CreateFileA function, don't even expect to be( m4 @: B- B" r
able to intercept it by installing a IFS hook: it will not work, no way! N5 f3 \' o; G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F4 a8 q# J% O" `0 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). y" j. f9 {5 d% t
and then browse the DDB list until it find the VxD and its DDB_Control_Proc* R2 {2 `8 x) b+ H% G2 v
field.- X; \! Y8 U; X+ v4 O9 @5 V# f
In fact, its purpose is not to load/unload VxDs but only to send a 7 z2 i2 T& Z% V8 ?
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)% u- w5 e& ]% `* c2 D: |
to the VxD Control_Dispatch proc (how the hell a shareware soft could try" \$ B6 z+ q+ r d
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
- _& v: _- p9 c& |/ z6 hIf the VxD is loaded, it will always clear eax and the Carry flag to allow
0 Q/ B: G" \; M# L S7 ~. O/ iits handle to be opened and then, will be detected.) m3 \2 N, S& x2 b. B
You can check that simply by hooking Winice.exe control proc entry point3 t4 W6 g9 Y( }2 x& A
while running MeltICE.
/ h" C* `0 ?5 V1 L! u
' s5 I7 w l' Z: e2 f$ p+ K: Q
$ u# F) D( p6 z 00401067: push 00402025 ; \\.\SICE
: E7 ^9 ^% v9 G; _4 b8 u7 c 0040106C: call CreateFileA
8 r) e- s8 B: Q5 Q; D% j2 X 00401071: cmp eax,-0012 L; `( [7 m7 T6 Z; B, m- [: L5 H: @
00401074: je 00401091, |" @) b: F( Y
* b; g& p& o, K4 Z5 X; O4 \( e" j; x& i1 Z
There could be hundreds of BPX you could use to detect this trick.& V8 L+ _/ i4 i/ e& m) Z
-The most classical one is:
, Q0 I' s3 @; q8 h* _6 ~% t$ S3 E BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 B) I [: \ Q$ b; V *(esp->4+4)=='NTIC'$ E: m8 U5 u' O/ P; C* ` J
8 N; k3 t: E/ d4 h/ q1 |& X5 `6 k-The most exotic ones (could be very slooooow :-( z" Z1 f1 M. Q* D: O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ! s- w5 o) T1 ]+ s
;will break 3 times :-(+ Z( @3 R9 b" {- X
- Z; K% d" t* i' N
-or (a bit) faster:
$ [. T% v+ z3 y1 j4 p, R5 s: r BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- S+ p2 W/ ?4 t4 V- o4 f5 ~3 `5 X3 s4 E! B* t3 j. N4 [; U* H: v
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) ~, c( H7 [3 Q/ f0 b
;will break 3 times :-(, X* C: b( \9 Y0 N
, Q, E/ Q0 j) l( v V" b
-Much faster:9 z! P( P8 \8 b% {+ A- w% r, P
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* F7 d5 Y& s- a9 ?* d
! s4 a# b- Y; N- pNote also that some programs (like AZPR3.00) use de old 16-bit _lopen2 M, w) U; D7 t! r+ [
function to do the same job:
. d; X% H9 S0 b7 r
5 D# D! X$ E1 A( A( L push 00 ; OF_READ
, t; w) j, E) T# T: s mov eax,[00656634] ; '\\.\SICE',0+ D0 |4 ]! H9 Q h/ }
push eax' }' M z, o- ^! w; x
call KERNEL32!_lopen
( E! z- J) l$ M inc eax
0 ?4 P6 a: D4 u. b( A' X; ?4 w jnz 00650589 ; detected7 P+ r5 Q6 b# S/ r7 _
push 00 ; OF_READ
" E) R# @9 o p9 L' N- F mov eax,[00656638] ; '\\.\SICE'
" K: H+ H- N$ ]% N9 k9 @- y, _ push eax
: V! y. l. l" A5 I# `4 c call KERNEL32!_lopen' N; `9 U5 o2 ]
inc eax
+ J3 r4 t3 a/ G# Y5 ?( J, y; s jz 006505ae ; not detected
. H3 k8 Q2 m- c$ J$ ]8 b
5 ^1 Q) ~# S, x+ @2 W4 C
1 I7 f1 e- g: j# [, V* O( U# C5 |__________________________________________________________________________2 L: p* k/ x5 R" A) |
9 L1 w6 a8 c' b1 U( \ y5 HMethod 12
+ y2 c% k' p0 |6 W# [" q6 c=========! I$ B7 ^" Q8 F$ R5 ~
. T' b% X F# ? S" hThis trick is similar to int41h/4fh Debugger installation check (code 05
9 K5 T6 ^& o l- B( J& 06) but very limited because it's only available for Win95/98 (not NT)) i1 s7 p0 a: N1 O$ J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* U, l" k! C6 |' r4 l5 z; m3 P" I
push 0000004fh ; function 4fh
. y$ N6 _ W K push 002a002ah ; high word specifies which VxD (VWIN32)
$ O3 z( Z2 F- c0 `4 E ; low word specifies which service( C3 `! p; B& I0 O- N8 w$ W
(VWIN32_Int41Dispatch)
7 {3 w9 y" G( }% S call Kernel32!ORD_001 ; VxdCall9 n7 T3 Q; i" C4 I+ x
cmp ax, 0f386h ; magic number returned by system debuggers
2 y$ U( ~; H& p# \ jz SoftICE_detected! i8 Z: r e# U1 ~7 v* i/ n+ E9 i
1 N! c$ ]6 ^. U& ^* i- _' cHere again, several ways to detect it:
% k) N' Z6 Y" A3 C9 {4 n) S; B9 Q$ Z$ D+ h# D0 D. }' r( e
BPINT 41 if ax==4f" r, a- U5 v. v$ R
! {" R4 c" f0 J! G, c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 B" Q% } R. d, k# S6 w5 F' b, m& ^ M% b
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
# ~3 ^6 v% S; L/ P
! t) V8 d7 p6 V7 Y1 u) | BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* d3 N, x- x. ~( H
- S% W; M/ F7 ?4 V$ V3 h__________________________________________________________________________
( O& l" S9 s+ U: v# e- i! {1 r; o# ]& p; V
Method 13
1 k1 }0 U/ W, T; E7 e; U=========
3 ?. j7 I4 e! j1 _' v+ r) a9 Z5 q1 ?+ h5 O7 }- p3 s
Not a real method of detection, but a good way to know if SoftICE is
3 c3 M+ U- _. h! kinstalled on a computer and to locate its installation directory.& l/ ?% B5 b! w6 ]
It is used by few softs which access the following registry keys (usually #2) :& U& _; f. M2 x
5 r; u, K7 |; G" ]" Q- ]! Q" g
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 i/ q& u ]/ P5 L2 l( f, F' J5 \\Uninstall\SoftICE
# u: P5 i/ _" W0 @3 p9 n, r8 P$ e1 J-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 x3 T/ ?' r4 f' n# B
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 ]8 h4 K4 j% K' X l2 Y" h' X
\App Paths\Loader32.Exe
1 l0 a; p$ v7 M$ F, d/ i( I5 d5 T, b$ Y( _- g" k
/ a( @! r& m' z. ^4 I% S4 N* F& j( W
Note that some nasty apps could then erase all files from SoftICE directory9 u5 l4 H; R2 [5 L- t" m" L
(I faced that once :-(2 R" ]$ p, @6 n' ^! s* Y
' M0 ]3 T9 J9 W' r1 s2 k: ?
Useful breakpoint to detect it:
% u+ y: Z" U% T S( [/ z
4 z8 G# ]0 \4 c5 S) a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 M R( E. S( K$ n
2 S( O" B p4 n" W- O7 ?2 L__________________________________________________________________________
2 v) K, u! V8 Y7 E c
( j+ |" p9 g2 m$ f5 T/ s/ W3 ~& {/ r5 Z5 F4 O
Method 14 : `" B8 i# l4 `. E* B- _% E+ j3 i
=========
3 [3 U" ~# ~4 L, N( [" o; B8 K4 Y* [; b0 S7 I/ M* ~+ S2 ]
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& N+ o1 ~) k+ e4 Y/ `is to determines whether a debugger is running on your system (ring0 only).
/ W+ O, Z- F$ G0 i" v2 } @: W6 X9 ]# `) M9 e: n% h: t) H0 @
VMMCall Test_Debug_Installed
, ^- h3 S. h& m9 r6 p: P5 v1 p) S/ K je not_installed
7 e, z: D4 W3 C& A' d
5 o, }: [$ K( y9 C2 t0 V9 e, ?This service just checks a flag.1 x* p$ [- k7 b& j" ~
</PRE></TD></TR></TBODY></TABLE> |