<TABLE width=500>* B4 z4 Z1 U3 z" T5 Y. w/ I
<TBODY>
# v0 m) m: |; z! ~* Z5 y, k% B( {1 d<TR>
7 ^* j; M: M. E" `<TD><PRE>Method 01 1 O$ A9 F$ I, k; q+ U
=========, I9 Q* v; W, [* M* h
5 E3 j% x: T$ n1 S3 Q
This method of detection of SoftICE (as well as the following one) is# G/ v: R* J8 E
used by the majority of packers/encryptors found on Internet.2 r3 ?. m, l7 |* C4 [6 \
It seeks the signature of BoundsChecker in SoftICE- ^6 g8 L% l8 M/ ^6 U7 i; V
, ^. H2 D3 X+ F; @- ~0 X4 o0 ]& o' Q mov ebp, 04243484Bh ; 'BCHK'5 M2 Z4 R; H3 O! J! i) B8 k* y
mov ax, 04h5 s# n( V G" g9 |6 p% |- }
int 3
+ h( T: N' Y( m/ w3 c' s cmp al,4
% J& V# ]8 y# q* g/ _# m- [3 F jnz SoftICE_Detected" z; s+ r! u) g! t+ |# U
1 M6 s. v8 | R% Q* t; x1 @___________________________________________________________________________( Q: a& A7 m8 Z. u7 G7 d
7 @/ Q, m0 T1 a/ T& x+ P! B
Method 02
% \( g/ ?* v% M: Y=========
; D7 u) b% [+ D% w- H9 m# D. T# H4 |9 e. x* e
Still a method very much used (perhaps the most frequent one). It is used
7 L, d% n, G: \5 K8 A/ Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! Q- Q4 `. {# z4 G% J- R1 for execute SoftICE commands...: A! Z0 `2 |- F' Q- K- \) g
It is also used to crash SoftICE and to force it to execute any commands# X4 k+ h, [8 l, n
(HBOOT...) :-(( $ ], u; P2 I$ ?! ?8 P0 Y6 e
J( e+ x& Q# ]: uHere is a quick description:# g$ l* X7 @7 m% _+ \' l) K* M/ {
-AX = 0910h (Display string in SIce windows)
9 c) u/ s$ C3 d4 U-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 a* d5 W, q6 S0 B1 c' N-AX = 0912h (Get breakpoint infos)
) t% V$ J+ U% h2 q9 K, l( `8 D) Z-AX = 0913h (Set Sice breakpoints)6 y+ v7 m% ~2 ~; z; R5 A+ ?
-AX = 0914h (Remove SIce breakoints)
0 y6 B# C+ K1 }) i
, N3 T0 O0 ?, l: \( z8 iEach time you'll meet this trick, you'll see:
& w3 M8 W# i7 c7 G Y: S-SI = 4647h
! X7 Q G8 L. j/ }9 l8 W-DI = 4A4Dh2 K) }5 c& i/ |% I5 h1 ?
Which are the 'magic values' used by SoftIce.# U1 ]; x/ O$ H# K" D6 b
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! v' L0 w- `* g6 m5 U2 v, l1 d% e
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 v0 t) I9 n1 r1 I4 r
Envelope utility use to protect DOS applications:
1 P ? p! ?7 k8 G) n9 P' r
/ \4 V3 u, C ]; R! Z' R# K3 S3 @+ A$ g- a& E- C/ ]% F9 Q$ F
4C19:0095 MOV AX,0911 ; execute command. c9 r( Y" P- ?% [' R* Q6 d/ q8 R$ p; d
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( b: ^0 E* W, z3 y, k, N
4C19:009A MOV SI,4647 ; 1st magic value.
% D- E6 y' Z3 G1 D! k0 @) y2 B4C19:009D MOV DI,4A4D ; 2nd magic value.
4 Q) s8 t3 f5 @* [9 }, u) s; Z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 O! I+ i& Q& D1 a5 h4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, k3 P% F% S _; J0 P: w4C19:00A4 INC CX
7 d0 `( q/ w: y8 e% x0 f. _0 O4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' _$ m3 O/ S; J4 [# G
4C19:00A8 JB 0095 ; 6 different commands.
# D$ ]1 i& [! _1 g4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 n1 u5 w/ n$ E# }% e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 `8 o# j) B& t4 l) `( F T
7 [% U; H1 u$ |( o1 }The program will execute 6 different SIce commands located at ds:dx, which
( W; g; k) E0 _" ^) F) Uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ g, P0 c4 s9 R7 s, \
' R& v0 c& f; H1 @1 p$ z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.+ o5 P/ l/ @: Y/ Q
___________________________________________________________________________" u) ^. H S+ L( c$ J2 S2 v4 L7 m
* v0 D$ {, [( ]( s$ E
; r3 f4 T/ B$ z0 ?" r. e& D% F
Method 030 O, p( q- S* {. T8 f0 \6 x) X/ Y6 s3 f
=========) H! x3 s& E; Z$ n, Q9 U4 X9 }; m6 y4 F
8 d, g% M. v! V1 W* U( T& j hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& H+ @! |/ Y) U$ }( O
(API Get entry point)( |$ Z- y m. r" F' c- o5 L! g
6 u+ e8 W# S1 W" O& }
! {0 O4 @% z9 k# D! `
xor di,di
6 [* x3 p4 E, }$ c mov es,di6 S! J( K4 r" t# n6 A
mov ax, 1684h
( |6 j2 R; q# j$ Y x mov bx, 0202h ; VxD ID of winice
9 A2 K8 l8 j7 S; J int 2Fh
9 I1 a5 e/ @/ B! ? x5 b mov ax, es ; ES:DI -> VxD API entry point
7 u/ f1 }2 ^) n- i: Y add ax, di
6 p3 }$ b: y' C' Y. Z! ] test ax,ax
( b5 k" e8 j7 Y; D jnz SoftICE_Detected! U7 w3 H7 K! m) s' J
1 m8 g' { d. f
___________________________________________________________________________
6 A8 o' _, q, u$ u( g$ I' r" j1 l \9 u% g, P& i$ q+ A8 {0 p
Method 04" F+ C7 x; u& ], {
=========
: O3 I- H: ~5 e1 F& i
: ~, ]% _$ Q, gMethod identical to the preceding one except that it seeks the ID of SoftICE9 ~; s1 R: H) |
GFX VxD., y/ `- K0 Z( j$ q! ?. P, a1 T
& s( m0 l T& T3 U. x xor di,di
; N7 {, w# K9 c( c mov es,di5 s8 ?' s' q$ J- L* ~! A! q
mov ax, 1684h
) z( n# t( g7 h6 N. g7 E/ Y5 u mov bx, 7a5Fh ; VxD ID of SIWVID
2 c8 z: C, {# y Y& p int 2fh
( y! R& \ t) {$ V mov ax, es ; ES:DI -> VxD API entry point
. ]4 M/ S; E9 H' a9 ?# Z add ax, di$ y9 p. j! G% r6 e$ p
test ax,ax
3 d5 h; \9 b+ S$ s jnz SoftICE_Detected
* p. P6 l m$ L T
* V' G! Z' T- j ]__________________________________________________________________________( F4 f9 ]0 {7 `. m b/ u f
# c2 ~1 f( X. t
5 g I* T/ W( d! X4 F+ r8 rMethod 05' L: ]- l; D' u3 ?. b
=========
8 t- U) x9 E/ D! |( U+ f( l. s7 _* K/ H0 c8 F" u3 Q4 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ S- w q8 ]4 c8 H$ l0 _1 C% J
debugger. It calls the int 41h, function 4Fh.0 n7 |. C& ~7 U+ h" P
There are several alternatives. 1 m" ]; j% }: w: K4 T2 D* W$ v
! }" r$ {; U8 y3 N' E: SThe following one is the simplest:# N1 G) ~/ q! U' Z
8 t/ C# a; F) G! l1 |
mov ax,4fh% L8 Y% q# m! E" K7 j
int 41h3 j" n7 A8 m% \! t
cmp ax, 0F3861 U# d* K: V: `' b) T( u
jz SoftICE_detected
! b7 D& l) _9 I# {& ]( N6 f
9 I; I8 {, u0 z5 W) q+ ^" b/ K" M' @6 F# B) ^
Next method as well as the following one are 2 examples from Stone's 4 ]4 i/ w8 z: C( i7 R0 B
"stn-wid.zip" (www.cracking.net):
% X$ H- v/ p- s$ A/ `3 m7 z5 U3 q- m, O- a
mov bx, cs+ X& d3 k8 ^* b0 I' S6 w
lea dx, int41handler24 Q6 p# V8 s0 H, J' p& J$ x
xchg dx, es:[41h*4]2 Y, Y0 \9 I1 Z2 W& \* E
xchg bx, es:[41h*4+2]
% F7 T. c8 C7 x# n7 Q mov ax,4fh
) x' v6 S* D! _; i1 I. ~. k/ H! s int 41h
3 H d) m3 g! b% R8 ~5 P xchg dx, es:[41h*4]5 c7 D. p- F" i
xchg bx, es:[41h*4+2]2 ^( T% l4 [; j
cmp ax, 0f386h* U# V/ O) M% A) L3 N, j4 T' u: a, |% C
jz SoftICE_detected+ {; p7 M3 ~, k: I# m
& K, d: r* K1 F) k& q: w& Mint41handler2 PROC
5 J6 q! F9 g% g& K" Y" l iret
! Y: l8 L0 o) m0 ^int41handler2 ENDP
: l2 R" J6 X( d% i# r+ t% y, a: B$ X. }8 U; I/ M6 i( V
! u2 d4 w b+ o3 f. C- }# P: k+ K_________________________________________________________________________6 W4 w5 b: V+ @4 `
1 r* h. I# _/ D* d
J5 c9 b8 v5 gMethod 06
. w: {8 b8 ?- L: }0 U=========
: j* H" h( y5 u: y9 f2 O* T; @9 J
# m/ V" o4 E; ^5 k0 [6 ~
6 v- Z/ C$ ^3 y5 b# b5 I2nd method similar to the preceding one but more difficult to detect:
8 f$ C0 S' ^6 c- S! J- t- o, k& R' d% h; e; S; T
) J; \$ c9 I& ]! P6 W9 c3 a, X2 Gint41handler PROC6 r+ q, A- M5 F$ C7 x
mov cl,al
8 Q* Y Z, V- Q! K. c iret
! f3 U. S: G# y; @; Uint41handler ENDP
2 k$ V7 P4 _; S! F8 q+ e7 Z) S+ x7 A, b. q" U
6 j! S/ L/ E0 ^) r
xor ax,ax
6 K) p- G4 N& x; I# S( W! `8 \ mov es,ax7 p) |$ p4 |0 z% H( ^( w) h; Y0 t2 k
mov bx, cs$ C2 S. M6 o5 c5 q" c) \( k6 Q
lea dx, int41handler
" y* J, u6 G7 O: z xchg dx, es:[41h*4]
' |3 ]& O+ _( I) Q0 ] xchg bx, es:[41h*4+2]- t5 d' F8 m9 d u. h1 g- f
in al, 40h
+ |- g4 Y" s6 K/ p1 i' q xor cx,cx
+ `! n% m! g7 X$ i: k4 i int 41h
2 w n4 H9 h0 `( ] xchg dx, es:[41h*4]
8 f, M/ `. _& T xchg bx, es:[41h*4+2]( H& |* B& [2 W/ H# i
cmp cl,al4 m5 x1 {. F1 y& E9 h, Q
jnz SoftICE_detected
* g- D2 H3 H1 k! C, `" S# e* z( d# |4 N( f/ |: b
_________________________________________________________________________+ M. r5 p. b2 w0 i* y
4 h- N: E* ?5 B- n
Method 07' K0 q5 x! S9 D( U/ J
=========2 k; ~3 {" a8 k+ x+ h9 u' F+ T3 N+ Z
( y; }. L5 D+ h+ t/ H
Method of detection of the WinICE handler in the int68h (V86)
. I2 m; u* |, X, O% P# o# y" C1 n
6 f& N4 p) V! R& _ mov ah,43h
, v% O( K% g; Z$ a+ x7 v; D9 D2 v int 68h" M( q/ C; f3 Q
cmp ax,0F386h
% a; u- |; T; Q; w) L+ K' y! \8 z jz SoftICE_Detected+ d- O( U4 F$ L/ m3 Z0 o8 m* r" n) r6 o3 P
9 r! P2 i3 I# T. j" V- l: F! @4 c3 @- O% O8 X4 t
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ l/ {6 T' b/ W app like this:
5 E9 m' v6 T* H0 j# n3 O9 o6 v* N, M& U9 [3 R1 R
BPX exec_int if ax==68
' V% C! W& _; \3 S: R (function called is located at byte ptr [ebp+1Dh] and client eip is: x J1 Q" O5 F1 [) X
located at [ebp+48h] for 32Bit apps)' y) P& a3 [ L0 q& E
__________________________________________________________________________
0 o" M- R- c1 s F! ^# i% Q6 n# Z, D% i
* I% a: M" E( i! hMethod 08! W4 a5 l" L: A9 f7 W L
=========
9 @1 p9 h7 k$ [5 H% v; G5 }
: b3 r+ Y. a0 A# ~1 QIt is not a method of detection of SoftICE but a possibility to crash the
/ v2 }% w# I+ ?: Fsystem by intercepting int 01h and int 03h and redirecting them to another
t' F4 g+ d4 D, V; N( i1 Qroutine.
9 N3 }6 x$ p" P' r- L; k; ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& k9 u0 C* q" N1 m1 F$ Y6 T, j
to the new routine to execute (hangs computer...)9 d. p2 y9 J& a7 t4 i' w
. n! G% Q% a( Y2 L7 P
mov ah, 25h: _: w. x4 C4 ?! q$ N* B( y
mov al, Int_Number (01h or 03h)+ r+ V# Y" O9 H: Y
mov dx, offset New_Int_Routine$ t4 r( S4 Q8 V. n
int 21h; g; H, V3 N3 ^/ G! W/ T0 u
( @/ p2 } d' G7 Q6 V$ b__________________________________________________________________________- U8 b/ Y h' }+ r& A* g) ]# T
( U+ a% g5 Z0 w# ~, tMethod 09
/ p F" g4 e3 H& x0 d5 b" o8 [=========9 w' s. t3 X6 f) w: b9 T
; c! M2 y: ~+ `. q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 ~% K; o- K9 d: m" G, h w: Sperformed in ring0 (VxD or a ring3 app using the VxdCall).7 W3 G' f# g" k: n8 p
The Get_DDB service is used to determine whether or not a VxD is installed
: R- i, b K1 K7 N f3 wfor the specified device and returns a Device Description Block (in ecx) for8 r/ A6 u1 s) S8 |, B- i3 u
that device if it is installed.
* b! A: h% Q0 X- G# I [1 X B; H3 q+ q" a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- A2 L4 c R& s% u) F" K) N$ V
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 G7 _, g6 T" r
VMMCall Get_DDB
" v6 K, d% o2 m5 `# x8 n mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! ~' _. }3 P; g* J% {5 ]/ Y$ j
4 |. |, g% g I, JNote as well that you can easily detect this method with SoftICE:
% t0 i. l S- e$ b% r bpx Get_DDB if ax==0202 || ax==7a5fh' k/ L9 S5 f; L& h6 A( z
0 ?4 P# j, \& C6 a
__________________________________________________________________________( a* \. ~2 |( o) v' ? E
) a; |& S' h" V7 T. N# I) G; qMethod 10
6 z& K) P* I- s8 h3 n$ C( d* @=========4 X& p( G. Q* F8 m# e
8 g9 l3 P8 K# F; J$ c6 n
=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 V& y9 Q0 o9 V0 G- S/ r2 M( o( u SoftICE while the option is enable!!
: z0 R% v2 i; k% o& A" t( F0 _1 ~. I* C/ d1 A. S* Y4 B3 P% H
This trick is very efficient:) i% v. n! ]: d' y) F. F/ g" N+ ^! s
by checking the Debug Registers, you can detect if SoftICE is loaded" f' @! t5 E7 W& U; Y# m% _5 B2 ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) G. i1 O+ j& f9 v$ X3 Y. p
there are some memory breakpoints set (dr0 to dr3) simply by reading their
' U" T0 x! C8 D+ ?8 nvalue (in ring0 only). Values can be manipulated and or changed as well+ B! I( w. W' g( I7 J; p
(clearing BPMs for instance)9 Z& Q! {3 C x
! M% U+ b3 K2 j, b
__________________________________________________________________________
9 d( |, c0 n y% ^* E# }
! y! t" L' B7 {3 O) P+ r) kMethod 11
}& H. ~5 U1 a9 @9 C6 s8 v! _=========7 ?8 p6 Z" X0 c
/ O8 d& m" o+ J- ^: f1 K- P
This method is most known as 'MeltICE' because it has been freely distributed8 M9 X" j* l( y
via www.winfiles.com. However it was first used by NuMega people to allow
* L1 L5 D* y) N; x1 T8 F$ {6 l& fSymbol Loader to check if SoftICE was active or not (the code is located
4 x( u1 {! c) E- [! x; |3 Einside nmtrans.dll).$ v' t- M2 }; d& g
/ ^4 L+ k$ n. ^9 k! m
The way it works is very simple:& L/ r0 d, c A$ E2 R; G, ^
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' t$ L; h" ~( w& Q; h
WinNT) with the CreateFileA API.
; P! h/ n) P" r! b; y' ]2 \! S1 r- x/ H3 V8 F
Here is a sample (checking for 'SICE'):. l) N9 v8 l i9 }5 R6 `. A! T& S
( m- w5 ^0 N5 H) }+ x( i( ^BOOL IsSoftIce95Loaded()* U1 e0 Q1 J1 @6 \
{
1 q1 n( \& \+ t HANDLE hFile;
9 G% {) }$ B+ v# m, i hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 a# d0 L- X |4 E: z FILE_SHARE_READ | FILE_SHARE_WRITE,
9 g+ n+ p& C* `2 x# T/ \3 ` NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ S! U y* V) G) E. w if( hFile != INVALID_HANDLE_VALUE )
5 ]8 y9 g# S4 G: C& e9 R {: G; t2 e- g: {. |) G' M
CloseHandle(hFile); x5 v) l' t M3 V1 |/ Y5 G
return TRUE;
) o! v1 z/ N' R) r3 ~& K }& R3 Q" f2 M9 v8 B: O. {: @
return FALSE;
+ Z$ a- K, T3 L8 p9 A3 l7 N}1 j( a" H+ [8 O$ O% e; M Y3 O
7 R/ o6 r7 ` J$ O" z
Although this trick calls the CreateFileA function, don't even expect to be1 G, v3 |' @1 n
able to intercept it by installing a IFS hook: it will not work, no way!
3 y2 R8 c* j3 \1 nIn fact, after the call to CreateFileA it will get through VWIN32 0x001F# A8 {3 d$ S9 S" G, A7 c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 n* D0 C3 H$ s5 e$ @+ w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc$ L+ {5 T- C: H3 l' T1 x* t
field.( Z& a7 [* ?4 U
In fact, its purpose is not to load/unload VxDs but only to send a 2 \2 n3 P# j/ y P _" s
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); _, O+ @9 D/ I* C% d" o1 J
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
6 b: y3 M! p) j* f% L* f6 M" wto load/unload a non-dynamically loadable driver such as SoftICE ;-).% g* ~! i- N* O [1 O" n
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 Q& w- u7 D ?, Q
its handle to be opened and then, will be detected./ p7 N4 H- j+ E; g$ }6 o
You can check that simply by hooking Winice.exe control proc entry point( E( a& @' d, ~. ]$ q
while running MeltICE.
( D, @, N/ J% I+ {/ c1 g P2 [# A; M0 Z! A- z! P( w G8 h0 A4 V
" z' q# c+ }6 {1 c' X* g 00401067: push 00402025 ; \\.\SICE
# H4 R8 y. p. S3 B 0040106C: call CreateFileA: ], |4 W' o1 s- E
00401071: cmp eax,-001
& m1 E* [: r7 }% R% }/ H" P 00401074: je 00401091
% I3 n6 D" f9 h8 R
+ M) p; ?2 o7 E0 r- F5 A( g, i' W
There could be hundreds of BPX you could use to detect this trick.& I% G" o% Y; ?! H. t5 P" Y, P% P* ~
-The most classical one is:1 F1 j# N! q2 T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 [; `$ Q# V. {( h, B *(esp->4+4)=='NTIC'4 q8 h8 ]+ R& o; z- B
; r$ ~; y6 [% ^/ ]' L+ |) t9 ^4 u
-The most exotic ones (could be very slooooow :-(
% i7 k, q( S2 X6 a, C BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 O( t& Q; C. g* o2 W" J# u& I
;will break 3 times :-(' Z% h: j5 w! k/ B! e( {% v; g0 g
) Y- L) C1 s- \; o; e-or (a bit) faster: * t* r5 c5 }5 n/ s, @* W* e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 T" I" [4 }, Z- N7 D5 O% I6 @6 Y! S& T8 n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - o1 f/ T9 x6 s- k3 D# W2 B4 Z
;will break 3 times :-(
0 p( c# |) ^: X; Q6 u4 ~1 r- y8 c
- O7 Y+ \8 j9 E" F6 \, s7 t& \-Much faster:- b- B- M; e- O2 E7 V& s9 g
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ G' g9 v# y. U, _# h- L
3 w. O$ m% a8 k1 ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' i- j9 H- q$ n5 `function to do the same job:
4 |! h r+ o: r0 ?, @8 I6 k$ |' |( \# V6 q" C& j- s
push 00 ; OF_READ
5 [* G7 Q, m6 k' H! D mov eax,[00656634] ; '\\.\SICE',0; R+ p* j6 h5 Q
push eax$ p" X% I; q) v6 v3 s+ e# U2 R# @
call KERNEL32!_lopen
7 B* e& D$ k! b" D9 q inc eax
@6 n0 F1 W! Q9 _9 d+ H jnz 00650589 ; detected& }) K: d' z, C7 O8 i" I/ t
push 00 ; OF_READ$ V. O0 p3 p4 e# P1 p. L
mov eax,[00656638] ; '\\.\SICE'
* F9 h- J. `4 V: Q0 w( W push eax
) n5 j% y$ L$ ]9 r call KERNEL32!_lopen8 V3 ]+ I+ h O. P
inc eax* X3 u Y4 y* L$ w# p
jz 006505ae ; not detected
! b# o. _: l, s6 @- ]7 Q# j' f5 g$ X0 _/ y. J: m0 _4 s; s
# l0 _+ P/ Z: A- J7 T$ [
__________________________________________________________________________
2 V% Q. Y3 F1 k) [5 E9 Z. Y
, Z, v$ g; N! l* r8 JMethod 12. _) F0 ^) [; M" z" K5 y s$ }
=========
! n6 q2 @1 o! P, C% ?% E# x) M5 Y! w; o& n
This trick is similar to int41h/4fh Debugger installation check (code 05/ f2 R5 R) o: F @7 j/ w. f
& 06) but very limited because it's only available for Win95/98 (not NT)1 U F X6 d* {1 f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 A: _3 `! b9 R7 H3 d
5 q! t& Q/ `( ?+ i4 C: U* a# P push 0000004fh ; function 4fh
+ U# x8 o! R2 I5 i push 002a002ah ; high word specifies which VxD (VWIN32)
1 p5 t$ p9 Q# v* O' ] ; low word specifies which service5 b- N3 R, n, _. j
(VWIN32_Int41Dispatch)1 V d! P# g7 M
call Kernel32!ORD_001 ; VxdCall) e( k% |- ]" Q6 u
cmp ax, 0f386h ; magic number returned by system debuggers
- u8 Q* q( ^3 Q/ L' T jz SoftICE_detected+ S* k/ l8 F; f. `9 `$ k
, z% e& Q& Q, w# e6 G9 x( x
Here again, several ways to detect it:
. j; q0 [4 W9 d+ C, I/ o/ n. f. K7 a; U+ T1 U3 z0 g# K
BPINT 41 if ax==4f" C4 n: D& ~ p: c' P/ u4 Z ~
3 b; b% @4 C6 v6 |( E+ O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' i1 |, v; w& `+ y
: J' h9 f! d2 L3 T1 T) E6 L BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' B1 J Q$ W- k0 P6 g$ F" `; V
5 P# b# S1 N r BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 U' G0 i+ f p1 P7 y1 S \# S) T1 a/ d# M; T
__________________________________________________________________________: H, y* s `% e7 B: v' r
: }2 t( d! d% {Method 13
+ a3 X, f$ O& c% j; {% b=========
+ F3 b* u; |+ S/ {
* o3 E" [2 d& }8 b; @7 I# Y; L( yNot a real method of detection, but a good way to know if SoftICE is
- S" Y+ ~, ~& K% k& t& h4 hinstalled on a computer and to locate its installation directory.* T8 `3 a/ @$ U7 o0 t* _9 t
It is used by few softs which access the following registry keys (usually #2) :7 p8 F9 ]: A0 f2 e. k
9 F+ n3 u( F" y* i-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 Z# S. N9 a9 B
\Uninstall\SoftICE+ A+ P- J# W; m* `; C
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& u) v: N: T1 k1 u% u9 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 b" }% p: q' b# D+ b+ ^, z5 l
\App Paths\Loader32.Exe
$ n W/ d# _8 Y& Y8 b% T. |) U, O& [8 _ c5 r# w; Q- \& w
3 }7 G' S/ t. G- ?8 I$ Y
Note that some nasty apps could then erase all files from SoftICE directory
: Z9 c& [" }. t! V(I faced that once :-(2 K! X- O4 Z4 N' B8 M
. q0 @5 K4 T. j( g: i
Useful breakpoint to detect it:( d0 x0 a. d8 _6 R! T( t6 \# z
% q, I/ U3 u" w BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' V q% Z& V- k6 f8 z+ W2 N
5 o2 h0 G3 R1 Z+ x3 y: B5 l% r9 d__________________________________________________________________________
4 W6 T9 @8 w% r5 ~- z$ }: {- E2 S5 E& y" a2 Y
5 b: a9 R9 Q$ I8 u" S7 d% a$ fMethod 14
% q/ n. Y5 J3 v9 d" j# ^=========
' a! i% b, \( g: U& L( s: x; M7 K* {( C8 Z& ^9 D) H; s. o; w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# P5 z7 O$ ~( d8 A% S! d) Q, R
is to determines whether a debugger is running on your system (ring0 only).
# X4 {7 D/ t8 a$ z
0 v: i+ R& K8 t9 D VMMCall Test_Debug_Installed1 m: ~: c* C4 \0 ]$ v
je not_installed7 T2 O! e/ z" A) M# L) {
; M9 C- z0 b5 P/ x5 k$ e/ l
This service just checks a flag.+ x% E `0 z- @! s
</PRE></TD></TR></TBODY></TABLE> |