<TABLE width=500>
9 s) b! k- D: y3 z; H/ c Z<TBODY>
" C9 e0 X% [& N<TR>; Y3 f5 I- E! {0 p+ r
<TD><PRE>Method 01
/ j8 b6 W7 a: k- d2 F=========- ^6 f% L5 v/ n: k {! W5 c
" N1 E7 F3 J# k8 y( l- h1 g5 l; fThis method of detection of SoftICE (as well as the following one) is' O X- L& F# S* |4 R) u
used by the majority of packers/encryptors found on Internet.. F$ {: p/ f8 l0 N* g9 [% U
It seeks the signature of BoundsChecker in SoftICE
; F4 V* W1 f6 w6 T$ }6 x- A2 t9 z+ K' n0 M- m) @0 e3 t
mov ebp, 04243484Bh ; 'BCHK'
6 ^( _( d* h$ T {2 j mov ax, 04h
& m- M1 g+ u0 H9 x* `5 \$ |7 N2 Q6 q, J int 3 % n2 Y/ B4 |# t) f* Z3 H
cmp al,4
9 S" [' k+ P/ n- T' _# H, q# Q jnz SoftICE_Detected! d) ` A: A+ ^2 i, J% H7 J
0 Q0 L# h; \# d- m w___________________________________________________________________________3 I7 l$ T* \% C- Q- o9 o
$ }0 ~; D& U5 w% f. F
Method 023 ~- g0 ?, O2 ]* ~
=========- ?0 O6 e' ^: q0 b3 L: J- S# t2 e
' g6 ~2 h1 B/ s* S( f& f, @1 X
Still a method very much used (perhaps the most frequent one). It is used
* B! A( e7 d* g( }' D B$ Kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
9 a9 e. X5 B& N$ K; ^0 T8 ^: Wor execute SoftICE commands...1 N' M8 F4 X8 p
It is also used to crash SoftICE and to force it to execute any commands9 A) q+ s h5 F, X/ S
(HBOOT...) :-((
9 {! {* C! t5 m0 {1 N0 U+ E- K7 L5 d( z/ J
Here is a quick description:
& t* P r9 ~$ u-AX = 0910h (Display string in SIce windows)
" B4 T/ L* e, v1 {9 O6 c4 O-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)$ g% G) V; ]8 P8 W! k
-AX = 0912h (Get breakpoint infos)
6 `/ [- k% ?; o' H9 d' X& Y" ^5 Y-AX = 0913h (Set Sice breakpoints)
0 Q/ i4 |# O, I4 p% @0 z! _* J-AX = 0914h (Remove SIce breakoints)6 G% g c9 v9 ~. T) l* I3 L% M
1 w/ b! [4 w/ N* Y
Each time you'll meet this trick, you'll see:( C/ T4 o0 O" F- L6 n5 d
-SI = 4647h& R" J$ U8 n: l: ~
-DI = 4A4Dh7 I! B* k: l$ n$ j
Which are the 'magic values' used by SoftIce.8 z. E2 E2 Y( U9 G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ ? x( T7 a% ~4 V
/ G3 z. _% I- w- b4 _! cHere is one example from the file "Haspinst.exe" which is the dongle HASP0 F0 G, R9 e+ o
Envelope utility use to protect DOS applications:7 d; A: D% d- X1 f7 v) J/ b# f, x
$ A# Z% U+ H! M: F9 {0 q8 h# |
9 N( |6 y& m6 R' B$ n" |4C19:0095 MOV AX,0911 ; execute command., K8 H2 }6 I6 u. F3 a0 e# z, y
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) m1 M9 X# |3 i2 e, @6 v6 d4C19:009A MOV SI,4647 ; 1st magic value.
, {, M) N# ^6 D$ L2 l4C19:009D MOV DI,4A4D ; 2nd magic value.
, H* m0 F; R+ J0 d5 p4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 O" [. n" m5 ?
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- p* l4 `1 }7 {0 }
4C19:00A4 INC CX* x! V; [8 s" j# B0 @7 m0 x- _* J
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 Z2 Q' G+ `) F' C+ }1 A
4C19:00A8 JB 0095 ; 6 different commands.: e6 G6 Z$ ?+ K! o: c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% t) n8 p3 Y0 R* e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 d# B# D# w6 H' _! P/ S
1 |% ]! f) o& o. L3 W/ A8 V4 ?
The program will execute 6 different SIce commands located at ds:dx, which9 ]& k ~; \! ?7 @
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., q' ~" i' n5 s7 M
9 O% D4 Q7 B/ U: j' B) w* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 K$ ]3 n# c; Y. K___________________________________________________________________________) Z6 B! |* z, D2 V
3 P+ w) o5 W3 B& w0 N$ v
% K6 y4 N0 k2 X |, v" `$ aMethod 03
. _; ]) p% `# [- f. N. P=========
% }# n8 r1 b' [) Y+ M; H, N9 a* R p4 L9 G8 e9 s+ @
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, [3 n' h' l3 K1 P(API Get entry point)- s% {( b4 g' W- g
5 E/ J: r5 o" f3 n' l
+ W J( t3 y* x& X& P
xor di,di) G( @; X1 b- l. g6 U
mov es,di2 W o* k0 f6 c' u# k! _
mov ax, 1684h - E/ z+ J# q' @9 r f: A
mov bx, 0202h ; VxD ID of winice1 c$ j |9 |4 n% p) j( t. s
int 2Fh
1 x2 Z8 i! ^7 Z4 E mov ax, es ; ES:DI -> VxD API entry point2 |! V! U) R) }8 Y; c1 u
add ax, di
" B& x+ A! k' i' ]& O$ S test ax,ax
' H$ A7 A G) V( ?* h jnz SoftICE_Detected2 U2 {* S$ U* ? @2 u
6 z. u* o% a. Z+ Q* Z8 H- v___________________________________________________________________________
" k% z" S3 k/ g; t0 q
7 v3 q) [' V. ?' i6 B; T, fMethod 04
# b# C0 e: [( r9 s$ t" j8 Y=========
8 B3 Y4 i* I6 Y" a/ f1 u! L% i: i( s4 E! ^! Z1 m# {1 z+ L
Method identical to the preceding one except that it seeks the ID of SoftICE7 w* G4 E1 T! L& e/ I
GFX VxD." N- ~1 E6 M; K1 @
* U8 ?) q( e: z4 @/ ?0 g
xor di,di. Q0 N; Y2 W/ ~4 z; z8 }% o9 V
mov es,di8 m* L0 }# f# }, y
mov ax, 1684h % z8 S0 E& i% R" x% e- A
mov bx, 7a5Fh ; VxD ID of SIWVID
+ b9 p6 T$ ^; G) Q" V/ ~ int 2fh% V2 Q9 h8 d4 @- q7 A5 b
mov ax, es ; ES:DI -> VxD API entry point% E c/ L% A# A+ y/ |4 e) Y1 X
add ax, di
! Q" j+ A# k7 C( v6 r I6 A test ax,ax
1 W8 ` Q5 n1 _* a4 c3 [( I: i2 z jnz SoftICE_Detected+ I ~4 x! w) q0 z: S, s" W8 ~
# Z0 F+ I& o* D. V$ x [& R8 t" P3 g__________________________________________________________________________: Q _0 t5 o6 o/ w: k& n% k+ a
2 K6 U X1 o+ T! |# ]; v9 L& h. T! T7 O# V! p' B
Method 05. i* e- z4 s0 t
=========
0 U$ c4 K" O- G0 E0 \. w/ S/ d& E4 G9 a5 `* X8 N$ u( J$ T
Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 R4 B+ }/ t. ^ Y9 N' |! |debugger. It calls the int 41h, function 4Fh.& T. |2 R8 V2 r. c& N9 P7 Q
There are several alternatives.
/ k7 D4 q+ g) Y# w8 J2 w6 @- U8 O+ b( ~! j2 x! R4 \+ Z
The following one is the simplest:
8 p2 q, ?& }6 O2 _
5 h; S( H+ `/ t mov ax,4fh
6 y) f2 g% D! j- x$ C8 W7 v6 M+ T0 H int 41h. }2 Q; b! P% A1 G3 O
cmp ax, 0F386
: a3 t8 n# @9 y& Z/ L3 V+ F jz SoftICE_detected5 W0 X2 l" l# u7 @0 ~
8 L% l' v; }4 X% n' H/ ?0 I; @
- w' A3 n7 Q& M* }* Z2 ~Next method as well as the following one are 2 examples from Stone's # _* t0 f# K5 [ b [# s
"stn-wid.zip" (www.cracking.net):. z- E. c* A% ^. X! y
u/ y# \9 k( k' X; k/ D/ H7 e mov bx, cs
' O+ C0 ?( \: t$ s lea dx, int41handler2
+ D2 r0 ]' _& r L; S xchg dx, es:[41h*4]$ {; G F& H& [
xchg bx, es:[41h*4+2]% K, s J* K* d4 M2 |3 d
mov ax,4fh: {/ w* V4 E0 {+ c5 u" s
int 41h
- ?# ^1 R* V0 u( L6 Z xchg dx, es:[41h*4]
g! h( ~/ i& }/ N xchg bx, es:[41h*4+2]5 {+ C5 p( M6 m. G
cmp ax, 0f386h
; X& l4 O) s4 X) h5 T jz SoftICE_detected
6 M+ v7 [. z1 V5 ^4 d' V6 K1 S, t. T$ J" B7 g3 [
int41handler2 PROC
2 O' Q- `- B2 F: L. {, f iret( C: r# x" ^, X
int41handler2 ENDP3 ~2 M% I1 c( N) Y' X4 A
6 b& n* \1 { I( g
/ i0 o! O; J+ A! F& G
_________________________________________________________________________
- e* G( e3 }. n( ]7 j2 y
# D/ j( q M4 M( T- g# x
# ^0 \0 r& y- b( EMethod 068 q7 g# F0 i* p3 a" W( w( B
=========% E" p A* ]7 H/ B& e0 I2 v3 ?. V
2 I0 J4 d+ Q1 V
2 v; k" u0 j2 u V) w( P, p/ [2nd method similar to the preceding one but more difficult to detect:6 N* C- D& e9 `
/ K* _# `6 q/ y: a
# k$ ]3 W$ s( Z) L0 ]3 C( n$ Gint41handler PROC% U2 ^8 R5 N) Y2 j, _
mov cl,al1 d) K ^' o0 Q* u% k
iret
. T8 O+ |$ F$ b! d2 K2 o. }int41handler ENDP
/ I, V" v& U3 M9 L/ c; ]: i& q) R! @- t. o7 Q
) s9 |# ]( |: V* E+ K3 q/ N' I. U" G
xor ax,ax
# S ]3 e! p3 z8 s ]. p mov es,ax
+ H; h0 ^5 G' u) r1 x- v mov bx, cs
% P4 w: ~8 E; T$ B) C L lea dx, int41handler
* X3 w& V5 M" ^1 y6 m! b6 J. H xchg dx, es:[41h*4]0 ^3 C; c5 Z( @8 F4 ?, K! v. ^4 S/ }
xchg bx, es:[41h*4+2]
# z* ^/ v/ V9 N3 A5 O. L in al, 40h4 S+ T$ m0 R* w/ b
xor cx,cx" G( a4 l8 l. D+ A1 A
int 41h
: ?6 l5 h0 S1 }( D" l8 k( b xchg dx, es:[41h*4]
4 A& N; T, j! U% D5 I( R! j9 b xchg bx, es:[41h*4+2]
) g5 P K( V5 V' E* @$ i4 B4 J cmp cl,al( P" M7 V* B& `9 J
jnz SoftICE_detected* j5 V8 J1 z' G: p3 u9 Y3 i- M- I
' b9 @$ e) B, U
_________________________________________________________________________" W. n* m+ H) t" p
' {/ r, K4 X! a
Method 07
+ P; U! F" ~# ~( n=========7 L8 z) D: ~. n
3 P @9 `$ E3 [0 |8 i
Method of detection of the WinICE handler in the int68h (V86)5 k K- }2 |, z: j
4 l- {. v6 T r; s* D mov ah,43h2 t7 m' ]) Q( m2 y
int 68h
4 A! `5 }# ]) ~ cmp ax,0F386h1 Z7 g0 Z+ r1 C. g1 L: [/ i
jz SoftICE_Detected) K0 b4 T( H& p
7 H# P! x8 a% C; i7 o+ U% F0 \" Y' A; d; \4 }
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% E1 l# h- g( a* L
app like this:
; B6 h. c$ Y/ a: ?& S8 Q u, ]7 K
BPX exec_int if ax==68
* a. H% ^& Q8 ?; C$ ] (function called is located at byte ptr [ebp+1Dh] and client eip is" h0 L! f1 V+ h) V4 v! d
located at [ebp+48h] for 32Bit apps)
9 s' \% R i6 q- g: y" r, f__________________________________________________________________________( m' _7 v E% @, S! p! X
/ {0 J" }+ z' z1 f, T3 ]3 }& Y0 o2 s# L0 H
Method 087 D1 I, k# h J/ L$ @
=========' k* ~# l# s' Q( |! ?
. T) e0 {: D, t: i5 U; g& d
It is not a method of detection of SoftICE but a possibility to crash the
+ R8 l4 V# Q+ @0 i4 w" ssystem by intercepting int 01h and int 03h and redirecting them to another3 t7 h( W: Q% s% J
routine.
: O. `6 |" n ~& I( XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
|; S& }0 {5 r+ h9 L3 V6 Jto the new routine to execute (hangs computer...)- v6 |) c- ?* P, j
I9 f9 ?* k2 H, s/ o mov ah, 25h
2 G- f$ w# f. q7 G4 C5 q9 I mov al, Int_Number (01h or 03h)5 C. H3 G- V6 v
mov dx, offset New_Int_Routine
" I+ C% j5 h& K int 21h
/ Y( Z5 k$ T' V: G; j3 S( P1 }
3 j% |1 |7 P* L- x# E__________________________________________________________________________5 `1 r( u" i% g/ a
; `3 L8 @! F2 ~: bMethod 09
X* a, W$ L' [) z/ r4 f; ?" @* |=========
+ i$ X5 o: n0 u9 o' X# v
/ T, E1 Y, Z9 M) r4 a5 IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 N" ]1 }/ P2 W4 c* s! k
performed in ring0 (VxD or a ring3 app using the VxdCall)./ i1 {5 j" ] c5 @ O
The Get_DDB service is used to determine whether or not a VxD is installed
: `4 C. p% B5 efor the specified device and returns a Device Description Block (in ecx) for( K+ l1 |# M' J+ p: @7 _, H. J S
that device if it is installed." J! Q% t0 z0 u7 l
% f: S6 U# g9 n/ u. W4 b
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ j, P5 I, r) }- G: U
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 Z8 ]! w* G6 n( k' [3 Y7 y. f( C VMMCall Get_DDB/ t* x: t% R/ C5 R- Y
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: }! q6 \0 t2 X' } b1 ~* V7 {0 N' Z1 O* `! f+ A
Note as well that you can easily detect this method with SoftICE:
2 @9 g6 p4 P& M6 z8 Z& Y1 G) `# E. C. | bpx Get_DDB if ax==0202 || ax==7a5fh9 D5 [) n8 `0 S, y
: ]! @/ ]" p2 H1 j6 P5 T! ]7 H__________________________________________________________________________* D0 o* e$ q. H0 w( e; C+ w N
! I$ S: K. Y1 a1 HMethod 100 g& c3 v: Z1 O
=========9 U! I4 | F& ]" _/ R9 h
J6 g" _0 S7 s: A=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 o7 r/ y7 G* L# P2 v SoftICE while the option is enable!!
( m/ M7 e0 I3 z5 e5 ?1 V
# C2 D' C* |+ uThis trick is very efficient:
4 }1 E8 A- F: hby checking the Debug Registers, you can detect if SoftICE is loaded
( f* |: e. N0 z, g! L5 H' M. S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, k0 k3 n* |; L) p" L. l/ Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 P+ T. Q% [( r6 Mvalue (in ring0 only). Values can be manipulated and or changed as well
, j5 g! z% T1 y& D(clearing BPMs for instance)
0 E. J% B L) }& K4 Y/ c& K+ e
__________________________________________________________________________
: d# D- \3 {+ J8 Z$ ^- H! x6 m
7 W: z9 }) N5 M. xMethod 11
1 q6 s2 a& W, T1 P' D4 F" m! j=========9 B" G8 `0 U/ q# V# d6 n
) e3 ~( i+ y3 F3 VThis method is most known as 'MeltICE' because it has been freely distributed' d! F, t+ J' v+ r& t! c; h
via www.winfiles.com. However it was first used by NuMega people to allow
4 ?7 E; E9 u- F$ J8 gSymbol Loader to check if SoftICE was active or not (the code is located
8 S+ ^2 l) Q& o9 l1 F3 Finside nmtrans.dll).9 n) U. d, j( b K4 x, k
$ X( f4 S$ c* K% e/ J3 S
The way it works is very simple:, O! J! r. I2 T& q2 B9 z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ l4 d! o$ w( u
WinNT) with the CreateFileA API.
% H& V$ }! Z4 n' C( I* _. E5 `8 k. `* t4 ~
Here is a sample (checking for 'SICE'):2 E) d4 R7 O! @) F- [$ i) `* ~
; F9 J7 J3 Y/ p9 Y+ g. B; s( v
BOOL IsSoftIce95Loaded(), ]+ j: V; ]7 s9 N6 e/ ]' U
{- I3 ?0 @0 j& d2 v5 e
HANDLE hFile; 2 n' K m5 A; O& |% P, t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) V* m+ N5 R; N% h% Z FILE_SHARE_READ | FILE_SHARE_WRITE,
. o, W' X7 V: b# Q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 p, G v5 p4 T0 `( [
if( hFile != INVALID_HANDLE_VALUE )* K. I5 z1 I0 a n5 J
{+ [" L. r2 _8 j1 O( X- B
CloseHandle(hFile);' k0 `2 e3 t# X6 p7 @
return TRUE;, S1 Q4 O% S; P3 x: l9 g" k
}
- v" [3 n! s, x return FALSE;
, e# t: h( {# ~) T8 S4 {: ~9 ^}! r7 `. N& r2 }2 f. ?: _ j
' W$ I& ?1 m$ q( Q1 u% I, Y
Although this trick calls the CreateFileA function, don't even expect to be
: ~% p; B( ?1 U" o) i! pable to intercept it by installing a IFS hook: it will not work, no way!
- T. k3 m) z- }! ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F
; a5 J# a1 Z3 R+ k9 t6 H6 N- jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( j( w% v# u$ V) a+ a4 ^! f; v$ L6 {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, k- S. [/ h. Dfield.
! f' T# k, ]( W. D* T& R0 j8 aIn fact, its purpose is not to load/unload VxDs but only to send a ! Y1 _2 k5 M! ~; g# Q! M
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 l! |: n: W& Tto the VxD Control_Dispatch proc (how the hell a shareware soft could try
% R4 R3 o9 T$ y. P: A# b Tto load/unload a non-dynamically loadable driver such as SoftICE ;-).+ u* m: @; R- ]4 z
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' y" l0 J7 y9 {- d [its handle to be opened and then, will be detected.
) I3 q" u0 E) G! G# pYou can check that simply by hooking Winice.exe control proc entry point
$ s+ x# {, u( O! \1 [( K9 swhile running MeltICE.
: j' z4 |: L4 L4 [% v0 A' Y3 U* c3 w2 w- R* @$ S! ^1 G
3 ]8 Q5 r1 S# L' R6 ^1 c6 x
00401067: push 00402025 ; \\.\SICE3 h5 I% |: h1 \9 u/ t( `
0040106C: call CreateFileA
/ u4 P5 ?8 q" t% x3 q 00401071: cmp eax,-001
" J- |; Z) e' M0 [ 00401074: je 00401091
0 j* C7 N, A/ ? z% C! t9 X! {% n9 t6 s, z' X8 y( |$ @" S
. A, U+ W% w$ L. V
There could be hundreds of BPX you could use to detect this trick.
& P; ^$ B r8 k) ^0 s: h# Y+ z-The most classical one is:
+ n/ i4 c3 L m BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* w" c0 D/ U; m1 x/ {
*(esp->4+4)=='NTIC'
* x4 I& o6 c t
* G6 G5 {) ^' Y% {-The most exotic ones (could be very slooooow :-(
$ D" _$ r+ G& R; u' W7 S1 G7 U' X BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: Y* a) [8 V, b' ?7 Y" J9 a0 i ;will break 3 times :-(3 {1 T1 y) P: y2 ?0 ~
, n( H+ W5 k9 |2 X3 E! @7 l-or (a bit) faster: 7 w. I8 P/ U5 v, h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 V, u7 w4 d& [
/ P" r' @$ |8 E% M' C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% B# ^! x, s# c) e9 @ e7 c ;will break 3 times :-(
, n# v1 X, R% S" Y& O+ \% |/ \6 p/ L4 f# D
-Much faster:; z! s4 U$ k0 V( b2 G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 H7 O: c8 X+ Y; W
3 B& A0 {0 S2 B
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 k( j1 d* m$ `function to do the same job:# y) T$ P3 D$ U v) _. l
: C+ B% K& H/ J" ?/ h% N6 B
push 00 ; OF_READ) s- i# x7 r ~- C: X: ?+ \
mov eax,[00656634] ; '\\.\SICE',0
7 o2 J7 u, R5 s% r1 K. V9 ~8 z8 B3 Q push eax
6 ]8 ~4 _& T! n6 b% u3 Y7 Q4 [ call KERNEL32!_lopen
/ L" }8 z7 S, X- u4 q inc eax
1 Z! N P8 P* m+ Y/ B jnz 00650589 ; detected
& x' M' L, z9 u0 y( V& f push 00 ; OF_READ
1 C5 P. y+ d" V, R( i% r mov eax,[00656638] ; '\\.\SICE'
8 l1 B. O. M/ D) ^; {+ A push eax) h' H$ r" M: s
call KERNEL32!_lopen
; _# U2 M. U1 v h/ X inc eax, w. G2 `$ q. j% k
jz 006505ae ; not detected
2 ]* v, x! T+ V W5 \% [; N, `
( S d/ J; D9 ]. Y
__________________________________________________________________________/ e! s2 ]$ w, T9 H9 K: c; J }
3 C, j& W- Q2 k! a( ~Method 12
4 e: M: [0 {" f! }8 {5 i=========
: d( T+ y1 [. W! w4 O7 M' H
E. |' W8 x: X, N8 I3 R/ C! @This trick is similar to int41h/4fh Debugger installation check (code 052 _& d1 @) D5 g; ^1 y
& 06) but very limited because it's only available for Win95/98 (not NT)
Z1 J7 u/ E( Y' }4 M$ o) Xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 v5 X( l8 w3 w6 l
8 |$ L- y k8 S+ j; W; X push 0000004fh ; function 4fh1 d- r% m1 I* }6 q+ m
push 002a002ah ; high word specifies which VxD (VWIN32)
# p. X7 Z4 `( V" b/ @ ; low word specifies which service+ Y" y. T s: a8 v+ P+ w
(VWIN32_Int41Dispatch)# U) Q& O# a' K
call Kernel32!ORD_001 ; VxdCall
, |! q4 W/ G# }: K cmp ax, 0f386h ; magic number returned by system debuggers
. e* }% K" Q) G jz SoftICE_detected& p a+ x, I8 A% F
( N- W- m7 B) x% S7 X, ]Here again, several ways to detect it:9 N+ n, b/ v- s, w& p' w% @
0 i+ A i1 J. ^/ l3 B) j
BPINT 41 if ax==4f
; R8 P6 H9 u( ]2 L% c7 P7 F: G+ R' E
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( T0 o8 H$ [. B3 ^' q
% I2 T0 {/ m$ r- E8 h9 i
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 L) J, i0 i, r8 N2 a
x; v2 v8 O, m BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 g( V" d: ~. t8 P! x$ a$ T( t" }0 P9 }% S+ N( M
__________________________________________________________________________ h+ U0 A6 v" }: a) Z
3 x5 z# k' v2 d* i
Method 13) Z% Z! H H8 ?2 E
=========
; | i$ _+ n9 v& c6 j0 Z/ z Y! |, M9 P+ Y; j8 T( |
Not a real method of detection, but a good way to know if SoftICE is
( M) z9 t- w, F/ I2 y$ [. B. z6 B+ binstalled on a computer and to locate its installation directory.
O0 F0 z+ C9 W: a4 I* u* PIt is used by few softs which access the following registry keys (usually #2) :
; z! P& Z# P4 U) O5 K! M8 ~
5 `( Z1 m& [# D% c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. Q5 C" f' t: r\Uninstall\SoftICE$ B7 t& k. p5 }& ]. F3 _
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ Y% }( \: H' }# Y-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& k( C' l$ P1 }1 @! k) b- e4 O
\App Paths\Loader32.Exe6 h) w0 b H% _+ [, R7 ?* q
9 H0 m7 R! [! l1 A5 h
. O' ` q$ x- x3 Z, y+ MNote that some nasty apps could then erase all files from SoftICE directory6 E# k( o0 x, U% X5 J# R$ e6 g" |
(I faced that once :-(
4 \# a7 O, U. N9 R2 K& ?' \; {9 c1 s( J6 o1 P- y& {) u7 R
Useful breakpoint to detect it:
, b5 K5 A1 P! j6 K5 e. [7 o, h8 g% w2 ~! u; B: y# N3 y" j+ N
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% S- H( h6 |+ H: f
: O+ i1 b- e2 D4 U0 K2 P' K5 R__________________________________________________________________________
, l( E' o! q% x4 R$ [1 D8 x$ J$ x) r
) N( b/ {, r. d2 `1 n$ q; H$ l& D- RMethod 14 0 e% |& S9 M! ]5 T
=========
8 T7 X# }' v) \9 `5 [: r y7 q! L/ O/ Y! a# ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% J6 e; Q; C' G/ B1 q
is to determines whether a debugger is running on your system (ring0 only).) Z- q* ]+ _& e
5 u7 t5 W+ P7 L$ t6 e. b/ }
VMMCall Test_Debug_Installed8 J3 r: A; k7 v: A- O
je not_installed
8 V. _' _, _' z; b2 s! s! `, X" L, V* d+ I0 Z( b5 z5 v. F R: ~
This service just checks a flag.
) H' i9 R3 e7 ?- n: A/ m</PRE></TD></TR></TBODY></TABLE> |