<TABLE width=500>, D. F/ B7 m% ]& m* q
<TBODY>
$ A4 i4 M4 g' b* ]<TR>
0 w9 T% j4 k3 @<TD><PRE>Method 01
p% g- u: D/ Z3 V3 Y=========
% V+ T* c; q8 K' X, \' ~/ c$ W7 p3 s9 ] n; `6 g6 c
This method of detection of SoftICE (as well as the following one) is* ^9 R% Z; \" {3 l1 r
used by the majority of packers/encryptors found on Internet.* y( v, a. n8 N! Z4 t! }
It seeks the signature of BoundsChecker in SoftICE
! i+ U4 o- K8 v6 ?0 c0 C! j0 X+ T2 s4 V
mov ebp, 04243484Bh ; 'BCHK'
5 |5 R! _& T% e" ?% ?7 e mov ax, 04h
+ A3 C; I4 o5 v0 V+ f& \$ D. d int 3 ! I" w3 {* F. u* q& v! h
cmp al,43 S! V( q( A2 S1 W
jnz SoftICE_Detected
4 o1 O) P+ M4 E3 [) H/ {* O: ]! _: j& r7 h' k; V0 O/ v
___________________________________________________________________________
; Y. d4 w" s( g6 c8 i
7 H* V- c* l2 M% a8 IMethod 02" O% v% Q2 p7 R1 E; O* V
=========
$ x/ y [: d9 X( c" [& h
$ O3 }/ T3 H9 ~5 S4 r' h3 T/ cStill a method very much used (perhaps the most frequent one). It is used
: b& W4 z3 s M- F9 M/ T5 j8 D x* ?& gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,: q( ?, d z8 @% @* w5 T( {/ b
or execute SoftICE commands...
' F' [& i) e$ ?; {* M* YIt is also used to crash SoftICE and to force it to execute any commands1 l) Z9 r) \, l1 ?3 A Y
(HBOOT...) :-((
+ _) x. y) `. w) ~, Y# E( ~$ ~0 L
9 `. F: I" r: p: NHere is a quick description:
& B% p2 ?" n4 A5 ~9 J+ l. c-AX = 0910h (Display string in SIce windows)
$ }' ]. ^2 u0 z: b( T2 |9 V/ p-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ y2 z y% L* u7 v3 K8 U, Y
-AX = 0912h (Get breakpoint infos)
* F) M3 X! N F* \/ A+ l- S$ a3 |: c-AX = 0913h (Set Sice breakpoints)
! R* k6 i D, T) j3 I- W# U/ j. p-AX = 0914h (Remove SIce breakoints): f) [3 V, Z5 I8 z2 Z Y- T
* N. o3 A- I6 q& J
Each time you'll meet this trick, you'll see:2 G4 I( d3 l% t/ r% D' f/ }8 s; F6 d
-SI = 4647h8 Y- Q* N& E, G4 H# F! T; V
-DI = 4A4Dh" R8 d5 i- u* L- {" P1 s
Which are the 'magic values' used by SoftIce.
2 c1 S) S- Z/ i5 vFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 X1 P2 B/ N r! X; S5 J% v _
, }; d, A9 q( ~( R' Y7 U0 {$ G) uHere is one example from the file "Haspinst.exe" which is the dongle HASP+ |6 m, `/ V' n9 }! t q
Envelope utility use to protect DOS applications:# Q* M9 e) E& c2 {' D& n$ ]
2 j1 L# _* F. e9 v; s; ^
6 W% T) V1 j9 b- \2 l" a4C19:0095 MOV AX,0911 ; execute command.
% n( `1 z5 O/ b; h) x9 ~2 o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 [1 o2 s! X' @5 j, q# c6 J0 P4C19:009A MOV SI,4647 ; 1st magic value.
0 r2 i l1 S3 J" p$ ]4C19:009D MOV DI,4A4D ; 2nd magic value./ H2 A/ R6 C6 y) a5 t
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). Y* H- c0 H7 V: j
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 a4 R$ r; N! M0 S4 T$ ?
4C19:00A4 INC CX& o" k) G/ O# r4 _% P( x5 p) L" O
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 Q8 @3 i0 ?8 V" X4 O1 n# c' e9 ^: C9 O4C19:00A8 JB 0095 ; 6 different commands.
# d( p+ G2 e; A6 N4C19:00AA JMP 0002 ; Bad_Guy jmp back., G2 o! y- o5 e' Z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. w# D3 @$ v5 w- q& A) f! i/ ~4 r$ q. q6 E. {
The program will execute 6 different SIce commands located at ds:dx, which: ?) m" e5 c" z# H6 u- ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 v# ~6 v' e& K* l1 }# R2 f0 V* |5 T6 l6 v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' Q6 X( R/ g8 @, }2 \+ l7 o! R1 y# r
___________________________________________________________________________, v8 o* D% h: G. |0 ]
2 N5 }9 R3 |) ]0 B, Z& u& y& s
! X8 a" V" T* X. w; q! A# CMethod 03
5 X" s& x4 C- E3 j x=========
T; L! p5 r7 s6 ~2 h% \1 s- ^( n' \
: S# w; p, }4 f# j, l" jLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& c5 O4 j3 d) a# Q3 L! ~& S, a(API Get entry point)
$ x& f1 V* ?% q- M* u 5 n. Z. ~. L" ^+ V4 g3 I
6 F& j- `# X# L. w
xor di,di; Y3 v: B0 V% v3 f1 ~9 Z/ z1 O
mov es,di M. w$ k9 ^# D: i; T* d
mov ax, 1684h 3 T' H. ~) e1 P4 O
mov bx, 0202h ; VxD ID of winice" P; Y2 u' d, _5 h h& t4 S
int 2Fh: V$ T) B8 H# F! x$ x7 B- I
mov ax, es ; ES:DI -> VxD API entry point
- U3 m$ J* v; d- a add ax, di
' i$ m0 o1 Q1 K test ax,ax
; ^* c$ z4 w: f+ w jnz SoftICE_Detected
$ l" s. y/ r0 }" H9 q9 M; h* I6 g, H8 z+ }6 r6 F
___________________________________________________________________________
7 @9 V0 u0 j. U+ I" c
/ L" U! [0 v, O7 ?7 FMethod 04' u# O W* _1 g- f
=========! m" t; \3 `) H H$ Z
9 s4 L) A+ J3 U* d" D
Method identical to the preceding one except that it seeks the ID of SoftICE5 D- [& ]0 c" I* c% j4 z
GFX VxD.
" h. U, z J1 y( o8 ?
& Y, p3 h6 X( G8 s: c. T3 ] xor di,di
! q9 y4 S: C6 W* H2 J mov es,di* |- F; S. O. h+ Y
mov ax, 1684h
) q9 Y& w1 f+ Z mov bx, 7a5Fh ; VxD ID of SIWVID2 @" |& M) ]' l3 v5 y+ `
int 2fh. h# @; v$ v- Y
mov ax, es ; ES:DI -> VxD API entry point
7 @ R2 E( u% Z: ^" M add ax, di
& B* } m3 U4 j/ ]5 p test ax,ax! N, G5 ]# }7 e" l
jnz SoftICE_Detected
9 _+ Q: B5 v8 d! ~, w9 x! ^
6 ~) S# k1 Y# H7 r7 L__________________________________________________________________________- E4 f$ g0 c4 Z" O# k+ J- @3 X
# Z: e* N0 t5 _6 [
% n% i" E# y" z/ Z0 a, ^
Method 05
/ g/ T- m8 q! ?5 E4 s+ U=========
1 I# r5 Y( I9 [# ^" m7 O$ L9 B% _( j. b7 G- d/ @+ {1 o
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ A/ `+ Z2 x4 W }/ G4 V
debugger. It calls the int 41h, function 4Fh.* h3 B0 }! P' H! w
There are several alternatives.
& E/ k7 \& a' O9 l. _' O4 P: d* j% J, b; n. Z' G8 B/ Q2 ~, }
The following one is the simplest:1 u; C0 n2 f( c" N, w- \
0 I( }% n9 P" ^, A4 E0 r7 h1 [ mov ax,4fh1 t2 K4 b" [1 I: x7 c
int 41h( V9 w' E4 I( n/ c J! _
cmp ax, 0F386
( e' j# \9 J+ Q) S jz SoftICE_detected; C2 e! x: M" b
L) N [" X/ L4 e& s
" j% I; u& n) |0 _1 G& Q9 ?0 iNext method as well as the following one are 2 examples from Stone's
; w7 Q* a) p9 v5 T3 U2 t"stn-wid.zip" (www.cracking.net):
( n% Z, P; v# A- {7 b
Z- F: H$ D# I% m7 U L* i' y mov bx, cs
+ M& q; W Z3 \4 n lea dx, int41handler22 Z; w; m& N' x) Y2 h0 H. ], I
xchg dx, es:[41h*4]
' T: o. w' K6 {* c xchg bx, es:[41h*4+2]" Y6 P" A1 d4 T" g' u9 L; d
mov ax,4fh; F8 B& X2 p4 n# Y" e q
int 41h
) V2 }6 d1 o; [& b xchg dx, es:[41h*4] R, R F1 E/ I+ S8 }" o$ e! b X
xchg bx, es:[41h*4+2]
I0 _+ j! @. I% g% j0 l3 u6 Q cmp ax, 0f386h
& b J# d d: S& e; b; m jz SoftICE_detected
* R$ l2 g4 ]) {% T1 z. d2 ?! Z( k/ l% d2 W% \$ _
int41handler2 PROC
: v6 A& b) y# D$ N+ L2 x iret
/ } d3 Q4 } R( o" q* Bint41handler2 ENDP) \/ X( a9 }' p+ C# U5 N, J+ l' |
% `- Y4 d* E- t" D
9 Y# e7 o$ X+ e, V/ z& R_________________________________________________________________________
. J% L! m$ U- B U5 h3 y
: W7 l+ \2 P, w/ e
' F( a3 {1 r: ]4 T: v) }Method 06
. F+ F6 z- q8 a& `=========
5 [+ { o& T+ X. ?) K2 M) @
) ] k6 y+ s2 k9 v
7 h: Q" f) C5 H& F S p+ b: B& Q2nd method similar to the preceding one but more difficult to detect:& `2 S5 j) q3 F- G6 A" H
7 P/ Q: ^! J' k$ p( f
% c9 a- Z H3 {( |4 n3 Qint41handler PROC/ \" ^* B3 F1 }$ ^
mov cl,al
- a. \( V, `) f1 b1 v9 Z- z3 W iret
& L/ M* d& ~% i Gint41handler ENDP
" K5 {: k$ [; {; Z* ^
6 V! S2 f4 s# o8 g" b
) u" ?' V4 R t xor ax,ax
$ H/ m. h+ K! h% i$ B mov es,ax4 a/ r3 L' U9 C
mov bx, cs* D2 h% y3 ]1 b2 E
lea dx, int41handler
# l: f; x- B0 }0 q3 p& |- r( v! A xchg dx, es:[41h*4]
8 U$ b) q7 F' u1 n xchg bx, es:[41h*4+2]
, B6 w- d6 t y5 w& h+ l! E- d% m k in al, 40h2 x* d8 S1 v6 l: A, q/ Q
xor cx,cx2 c8 O6 S& Y7 _( j* @$ ?
int 41h
8 [5 U1 g# Z9 K/ x6 B% w1 ?9 } xchg dx, es:[41h*4]
n! A K6 j" Y4 Y4 ?0 v xchg bx, es:[41h*4+2]1 Y E0 q: l: Y% ~' c
cmp cl,al
$ Q. z$ e, d' c! t6 c1 C jnz SoftICE_detected
6 J( Q& }! P0 m' Y# q
2 o# w x" ^$ X- F: }9 l }_________________________________________________________________________8 _% j( ~( {1 h
- B3 ]/ P) n9 L) _ Y: M6 xMethod 07! `+ c. H2 H( U" I, @( L" H
=========3 ?! W$ w. `/ A9 t, x0 G. c
. e- e4 a" v6 W& h/ O0 b2 w8 \
Method of detection of the WinICE handler in the int68h (V86)/ o W$ ^: o9 @# }5 [
/ A# |8 Y8 X; f: J4 L) ` mov ah,43h4 l5 Y# S* w( ?- F
int 68h/ k# y: ~& m' O2 t2 E& }
cmp ax,0F386h
* I* w: q3 Q' L! h" O M jz SoftICE_Detected$ y; N+ y4 e& K
' b# {& m( ~1 i1 d( [+ ?! x; t
( @' Q6 Z3 i+ E3 _9 K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) D; v$ @2 N; { e9 \8 t2 o G! s app like this:
9 n, ^( a V$ A5 \- Q2 m+ x, ^) c1 _8 ~- M7 o. \7 Q. I" `2 E+ m
BPX exec_int if ax==68+ g5 y, G& V y2 G7 f" k, E
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 i( \0 K$ }6 T! D1 V4 v3 C located at [ebp+48h] for 32Bit apps)
9 n% V0 c9 [3 g6 {; ^__________________________________________________________________________
( \# h* j% o+ k4 i, r7 v
/ p* |# `0 M1 ~' v! z
+ `, b- B. \7 e; ~9 J0 b. aMethod 08
9 T* Q( m9 R# _ A5 ^- r$ v=========0 a6 C& A' }2 b( q
! q5 h. R% z# }It is not a method of detection of SoftICE but a possibility to crash the
/ \+ [( x# ^( n' _8 m' \1 |system by intercepting int 01h and int 03h and redirecting them to another
! M, [ ^3 O. Iroutine.
# A3 P! q' C1 `& `1 ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& ?. r. a1 |; a( y2 N' Y0 ~to the new routine to execute (hangs computer...)0 m8 c: |+ V) o; \
5 h2 W" E' x+ S! y; ^* X U
mov ah, 25h
4 _+ [. ]% ~8 t+ R mov al, Int_Number (01h or 03h)% l! u) r! N1 b2 ?6 m9 |; O5 l# i
mov dx, offset New_Int_Routine
0 x; P; o) A7 l: a3 J! g0 a3 v! k- ` int 21h
" a5 L5 s! A- x% _, E! R5 k4 A. g: [9 d# o
__________________________________________________________________________
& k7 ?0 u. l0 A7 n, B/ b# \) A/ o) h# n1 R8 V* a2 Q
Method 09$ D/ n7 J8 @" J8 j# _" l
=========
4 Z+ O, E" g' l/ ?2 p8 ]; C9 c
J2 V" z! T9 {4 M$ n8 yThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ L' ]' n, ~2 J( `8 \performed in ring0 (VxD or a ring3 app using the VxdCall).
- A* v, c7 Z/ y" {The Get_DDB service is used to determine whether or not a VxD is installed
0 W4 ]. U4 p% N0 a8 U) m+ qfor the specified device and returns a Device Description Block (in ecx) for
& Y6 n Y4 P! Y8 rthat device if it is installed.3 h' {3 @+ q# o( c. e+ M
) o% L { q7 K6 z2 `$ W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) J3 q& ?6 C3 Z' F1 a- f mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
s4 A a: {3 z) ] VMMCall Get_DDB
$ M9 J+ [! \4 n$ d& l" `" _ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ {8 x3 j0 j/ h, N8 H6 O. {# x
1 D. z8 q9 K0 M& W; P1 ~5 lNote as well that you can easily detect this method with SoftICE:- D, r0 X, }, I" ]& I8 f) c- ]: C1 a
bpx Get_DDB if ax==0202 || ax==7a5fh
0 _0 @' Q" G8 p: F$ v9 b
5 s7 K( ?8 Q( C9 \9 g2 b X__________________________________________________________________________1 h! ~, ~8 D5 w1 T+ z0 {+ `( o% O
9 P# g# T/ F& h! rMethod 10
/ { `- R; q. V0 R3 U" `=========
, V6 c3 ^- J, n0 l" G7 t6 \$ q5 a5 N. E& u n
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 X" R! b5 p; n; F' {& g
SoftICE while the option is enable!!0 C9 i5 X( ^ ~1 {+ l8 f0 j! c
C" u9 o- n% W) H# K9 _9 J0 L& h+ sThis trick is very efficient:
5 k6 |6 F/ X: z! @$ T; Nby checking the Debug Registers, you can detect if SoftICE is loaded8 V/ w4 I" g9 Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' @: g: Y2 a% c
there are some memory breakpoints set (dr0 to dr3) simply by reading their# ~4 O# {; U- Q$ K7 I% n. v
value (in ring0 only). Values can be manipulated and or changed as well
: E5 ]( C3 H' D3 e/ Y8 Y(clearing BPMs for instance)
% [8 Y, S, }) x; m6 Y: N( `- y- ?( h5 Z: B5 ~- V
__________________________________________________________________________, u/ {' B( a. O. |2 H6 Y' a. {
8 Q' z! Z) S4 O/ v- |' z" u
Method 11; C( Q7 b) L, v9 D( v+ R; }
=========
/ s3 @0 b( C7 n) \' V2 y: P
+ B0 e3 T( z) }4 m7 iThis method is most known as 'MeltICE' because it has been freely distributed% o" E: _9 }' p
via www.winfiles.com. However it was first used by NuMega people to allow6 [/ K4 y3 [4 E5 [$ s& c4 ~
Symbol Loader to check if SoftICE was active or not (the code is located; `* q$ A2 ^, Q
inside nmtrans.dll).
' V% |/ J7 N2 ~0 j! z
! }$ N# x3 S) z2 z$ IThe way it works is very simple:
7 Y A( X. [8 f' `" ]6 s' }It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- \1 \$ V3 g7 Y; iWinNT) with the CreateFileA API.- C& Y/ u/ y8 Z8 V8 o* a
v1 D9 Q& S# J. SHere is a sample (checking for 'SICE'):) O& W% W5 K4 y9 Y
$ A' N, C _- Z3 U0 {& I1 W
BOOL IsSoftIce95Loaded()
4 C+ I% Q( {. G{
. A9 l) k' A, N HANDLE hFile;
& e) ^: |/ r% g5 t% ` hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, B2 N1 Z# U0 |
FILE_SHARE_READ | FILE_SHARE_WRITE,
1 J1 `% m5 |1 Y8 Z- [' ^ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 E. R- N$ V; B P if( hFile != INVALID_HANDLE_VALUE )
1 J' V' e9 _& ?! v, g {+ h" |5 {: x5 f( s
CloseHandle(hFile);* ~" N+ j& b! c4 {
return TRUE;8 t1 B# s; n. _+ w. h
}
Q- h1 l- e, o6 z( {% [+ ^ return FALSE;/ |$ t( q; h+ A& g9 Q. j9 ^
}0 P V% n j% K0 n9 ^
5 P) O2 Q% P8 v* _% e0 W
Although this trick calls the CreateFileA function, don't even expect to be+ ~0 M8 m% q7 i! X8 |' Y6 u4 y9 I
able to intercept it by installing a IFS hook: it will not work, no way!5 t6 f3 q5 e( e0 P8 O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 }; `9 s, x' n
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 ~) v7 ?. G) F, g. J" s9 }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc* J1 Z# b8 F4 i- q) e$ L
field.: J: b, e: `8 X
In fact, its purpose is not to load/unload VxDs but only to send a " U; t* n L" |" r% K' u9 m, f
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! h7 \; g: r g0 `' u& g5 gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
; c1 @/ U9 ^+ J& qto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 p/ j7 E7 `7 `. w
If the VxD is loaded, it will always clear eax and the Carry flag to allow, a) V) {5 `/ r, C
its handle to be opened and then, will be detected.
# D' G: h% z5 P" y4 ?: G3 h* r; dYou can check that simply by hooking Winice.exe control proc entry point2 H- ^7 s. m2 c9 j
while running MeltICE.
1 C+ _# D) U* J. K0 l* ^3 ?" }, V9 L; C
9 [* R4 M7 C8 Q. A" K2 O* s) z 00401067: push 00402025 ; \\.\SICE
7 [' L! P+ ^8 i0 C5 n( g 0040106C: call CreateFileA
/ X f# n; _: |$ ]8 h4 m+ y 00401071: cmp eax,-001
& C$ O4 \$ g) X/ ~ 00401074: je 004010917 q' U6 S9 j# |2 q1 F4 s! E
0 L( L0 I7 I6 C( B
" H+ p/ ^( @4 j7 u; A
There could be hundreds of BPX you could use to detect this trick.
. V( A: l$ k, g5 P( ?8 P4 \-The most classical one is: `$ x" E6 ]7 {6 T7 Q, ]
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! q, R+ f4 z! X5 l( p
*(esp->4+4)=='NTIC': V/ K/ u7 j, x; p) @) o
( ]# u& v# ?9 e, c, ?
-The most exotic ones (could be very slooooow :-(
- e; g8 T- a* d2 p( | BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 [$ s9 X% h& i; V1 M9 r& i
;will break 3 times :-(; x6 i: X( F1 l5 { a! i
' n3 B' R d; C) j# W$ f9 @8 N
-or (a bit) faster:
7 e' h5 V4 V. ^8 m7 { I BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' N/ x. ?0 R9 |* A" Y, G! y8 W# b; t" l
* D+ h5 p6 [! r! e3 r3 D; ]& ^ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' \ B% `' V0 w, |# H- P
;will break 3 times :-(. x% I3 ~. I( `. N/ |9 Z. H
) Q& ^* I: V W; i4 ?
-Much faster:
* d! d4 w; g) \* W0 h BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'- ^ j4 a- ^4 G o0 p4 e a
" w$ a }! \# O& s' x w& nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 U% k2 U# y+ N" e* P% ~1 ofunction to do the same job:1 N& ^4 E' n) h3 D, B" Q; n
& x; n* p& u, m% b
push 00 ; OF_READ
# M; N7 m. Q; f mov eax,[00656634] ; '\\.\SICE',0
6 O/ K* e1 ?, S0 h3 g. C! E push eax
. g$ _. z! Z6 r5 A& y4 d a8 `! y call KERNEL32!_lopen
1 x6 ^ ~- |" {1 y inc eax+ r7 o2 G' ~8 i3 K; Z( n
jnz 00650589 ; detected* Y5 M! p; O0 s' J/ \% k5 o
push 00 ; OF_READ
0 Q" s4 i' u2 _3 r mov eax,[00656638] ; '\\.\SICE'6 g3 J( o+ V/ z0 Q
push eax$ `4 \! ]7 R# h1 T
call KERNEL32!_lopen: R& q9 h+ G" j6 n) W, l$ {' A
inc eax
1 z8 P& S: U5 h# A jz 006505ae ; not detected
! {' v$ E3 X+ H
) O! W3 M* y1 A! ]& ]
( x$ k- c: T, e, Y5 e3 g! q0 A4 c1 D__________________________________________________________________________5 x! e1 b3 u: P% L0 A& E
2 H% n3 I+ Z& _$ CMethod 12) ^$ c1 Y# G% H; X+ {
=========
/ ~: K1 O- h7 p! Y8 @: m3 u
5 i$ s# P0 E, d. a% wThis trick is similar to int41h/4fh Debugger installation check (code 05
; _5 t9 g) q2 {* u/ v. u2 y& 06) but very limited because it's only available for Win95/98 (not NT): R. q5 A9 p; T4 v! S
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' Y9 _; P( |4 A
+ X: }+ J6 n+ X, [/ F push 0000004fh ; function 4fh
( P+ L) Q- i1 m push 002a002ah ; high word specifies which VxD (VWIN32)8 `. D: L0 k6 `2 y" H; A6 @
; low word specifies which service
2 o# j9 Z) \; n2 O/ m0 z (VWIN32_Int41Dispatch): y8 f- K8 W, O2 c* ]
call Kernel32!ORD_001 ; VxdCall
, W( y! J. d H' V8 M q6 r cmp ax, 0f386h ; magic number returned by system debuggers
8 c5 V# Q; E4 `# I) z- d1 P jz SoftICE_detected) q5 {/ t0 @ {) |: |9 ]: a! O+ K" t4 ?
& H3 I8 C& u+ S+ s
Here again, several ways to detect it:
. D0 Y# |. \3 b. j( `9 x) F5 H: J f, E) _
BPINT 41 if ax==4f9 y2 ~' ^+ W! f. V# h3 J4 l. ^
$ F( Q2 |) g$ B: i, G a; t
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one4 E1 t4 S" C) A& g# J
8 j! C8 s) E8 Y9 R* m3 ^
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 I; N- F1 }3 R$ [1 T: b' X& V2 d# _5 O' d
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
& l( M+ U1 R/ H M$ u9 b: |7 d+ r% c! l, Y! C1 K8 W# @
__________________________________________________________________________8 a% E- Q' {: ], V" P6 p, K
5 E( V' h* H# X3 F
Method 13* D% w; R9 d" V
=========( `; W! F( N5 K8 x' X9 R. A: N* m. G# K
, N3 y. T- G; b$ I) o2 L# I
Not a real method of detection, but a good way to know if SoftICE is; G5 A S8 A0 g2 X5 I
installed on a computer and to locate its installation directory.. G' Q& o5 e2 ~
It is used by few softs which access the following registry keys (usually #2) :
/ M. f7 N' Q7 t/ M1 @
; V6 D* G% l$ V5 C! b D$ F* y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 |4 g+ f5 c/ x% c1 E\Uninstall\SoftICE& d* g! z, J; D8 p
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. M+ k0 y) t8 g0 ^6 \" Z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 C8 o3 q5 o5 ~. g- X
\App Paths\Loader32.Exe
9 o" E7 `. {) n9 J( `4 b) t/ _" d: G
) |- |) b% Z" q+ P
Note that some nasty apps could then erase all files from SoftICE directory! g; x3 E4 X- M4 B$ {& s& q
(I faced that once :-(% ^* L- ^5 b l0 Y3 L
2 Q6 k# y3 s) \1 `) C' A. N! H8 X
Useful breakpoint to detect it:
C0 N, m d* R* h. x0 u. M: j0 Y! W) l" _- G, [
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 {/ T# Z/ }: O3 \7 q2 U+ P. z' t
. ~( V; @0 p1 J4 f, a1 N. B__________________________________________________________________________
) j8 K$ B/ F c( [) M8 n2 m$ @6 y9 j) @* o8 T1 |
, t! p9 L; U; {Method 14
/ l0 ~) a3 J g* z8 a=========+ I4 p* [- D1 O# O
$ h1 |1 l) ` z }( n$ E. {, s: t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 {3 s- F4 {4 f: J4 R- Y9 w8 d$ q7 X1 s
is to determines whether a debugger is running on your system (ring0 only).
: X% @1 I$ \0 D& g0 n5 ]/ @
* h) x2 h0 Y" [ Q VMMCall Test_Debug_Installed) n2 }) Z- |2 U* j$ v0 M a5 i
je not_installed
* \) d, l' }7 Z, m0 t) B; z) p
3 s% f. K* N" y5 t6 R/ wThis service just checks a flag./ T9 [1 c: {0 Y( q) ~0 d/ \
</PRE></TD></TR></TBODY></TABLE> |