<TABLE width=500>
' C: @6 i+ U, r<TBODY>6 d. Y6 G3 I- l3 N" b
<TR>: @, a$ z a7 q8 W
<TD><PRE>Method 01
" Q& d/ c3 I4 c# ?! M; x% G+ e=========6 y" x8 k3 B% U0 d$ M; h, s
9 a i9 B, w( v0 z# VThis method of detection of SoftICE (as well as the following one) is
5 v$ ?; ~: y3 n4 m( ^, T, p6 Tused by the majority of packers/encryptors found on Internet.- N8 @) o0 W% O3 x
It seeks the signature of BoundsChecker in SoftICE
5 v! Q1 |6 v8 g+ d
- J) L0 d+ v l0 I mov ebp, 04243484Bh ; 'BCHK'
8 i' j" Y* Y+ l* W% d# O4 z$ ^1 j mov ax, 04h
5 f) h0 G A4 P% }" ]9 \/ u int 3 / k4 l* q: i' P2 s+ v5 ?) K, Z
cmp al,4
4 h" ]. R1 g" D" d( m jnz SoftICE_Detected/ _0 V7 o& a, p) }
) N6 q+ a. {7 D' @ M9 R
___________________________________________________________________________
" Y4 T* ^. i, b, L" [2 o7 i y$ x6 C3 a/ x8 }! D9 B5 T
Method 02
5 S8 R8 \; M9 E=========# }/ ?. W3 t$ R3 k# {' k& W
. p L5 k$ E1 _' R" p) u
Still a method very much used (perhaps the most frequent one). It is used
1 b6 R2 g5 Q b' Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,* d7 q$ H8 X! J' Y: Z+ p
or execute SoftICE commands...
/ e- A! G6 q) IIt is also used to crash SoftICE and to force it to execute any commands
8 G/ p' g3 K- z9 u9 _2 I4 z* D(HBOOT...) :-(( ( B! K& K4 b2 r+ }; V" r: o) i
" z% H7 K- {) t/ f7 F
Here is a quick description:
) X0 p* N. L/ k7 l: w3 G- [-AX = 0910h (Display string in SIce windows)+ [ s5 H% W$ A/ ?; E) a' M m
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' f- b( E Z7 M/ u5 ^# [/ k
-AX = 0912h (Get breakpoint infos) N( W" v: s' ~4 |3 Z1 ~+ j( t& D6 \
-AX = 0913h (Set Sice breakpoints)
; p& i: t2 @2 ^, }4 m-AX = 0914h (Remove SIce breakoints)- Z6 p6 s: L3 C; @& \
9 i, s; I; k7 Q- k- mEach time you'll meet this trick, you'll see:
' P* e, _( u: g/ J! O' k-SI = 4647h
& z$ m y# E5 ~/ G$ I' v-DI = 4A4Dh
6 k/ B8 f3 J5 K2 _Which are the 'magic values' used by SoftIce.
0 Q1 D( g& @% Y. ^6 N O1 GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 B2 G3 m, k) z. r0 x
( C5 {$ o8 Y9 }, g+ y, {5 z) xHere is one example from the file "Haspinst.exe" which is the dongle HASP; s2 m+ c3 E% M' `3 ` Q) z
Envelope utility use to protect DOS applications:6 ^4 g! y, j8 b* j4 h* x, {
! T, N. k8 T: L5 O o. U5 J2 W0 r8 s! `$ g2 {' _$ B7 e* m$ p- z$ T
4C19:0095 MOV AX,0911 ; execute command.9 t( Q6 D# v4 q9 Q2 a ?6 v
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ R( X. n" _+ Y$ C$ T4 _ _" ~( y4C19:009A MOV SI,4647 ; 1st magic value., x( \$ Q( F) S5 B" @
4C19:009D MOV DI,4A4D ; 2nd magic value.
# o9 H8 L2 G E4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 M7 M, J1 L) J& n ~1 C
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* S7 w" ~: L! g2 }$ Y, Z: E
4C19:00A4 INC CX% A7 k0 w1 @2 M1 l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
9 ^+ d* M7 E+ c4 l( H" Y; }$ L4C19:00A8 JB 0095 ; 6 different commands.
, g( `, u3 u/ t* {) \1 Q4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ Z9 Z# r4 \7 v% F, M! m( I& k4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& [- w+ o# w" x' V5 G: D- d& j: Q) ~ W% p8 B- V
The program will execute 6 different SIce commands located at ds:dx, which8 E% b9 p1 p# r' L1 V% p
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) X1 N% M. Q2 z$ o% U! W
$ z$ x4 Q q* s6 x2 e- k& \& u* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- c$ i# Q' n$ m) S
___________________________________________________________________________
0 @- C% r, D, c: p! R0 r5 T8 L2 v. u$ G
; Q4 Y* @ b' c; E6 D* q/ L
Method 03
6 K: J/ E+ s7 m7 C1 y9 J; a=========
: C: @5 E: k% U* X% h& X4 h8 X3 X2 w, ~! m8 Z7 ?; m1 d
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h; P& ^4 Q2 A, K' `3 ?. y
(API Get entry point)& S( u+ v ~5 ?( N O1 Q
9 N( z6 ^6 l7 f. E8 R! B3 c( F
# K# p% L) g' R* o c" K
xor di,di. N& v6 H4 c( Q8 ]7 g4 c9 G$ J7 C; n
mov es,di2 t9 T1 M* b* Z/ } y0 X: ~8 M
mov ax, 1684h & s- P* A% ~" _6 b6 m: a
mov bx, 0202h ; VxD ID of winice& k. _( l& g. w9 y
int 2Fh
0 M& T" M$ d. I8 m3 Y mov ax, es ; ES:DI -> VxD API entry point
% q) d" [7 @8 o( b( d add ax, di% `9 H/ R# E& J1 n) h* d4 ]
test ax,ax! b. Q" r6 w3 n
jnz SoftICE_Detected
; {* Y& K! @5 i+ k& q C+ A1 J- h c6 ?! Y
___________________________________________________________________________
1 ~" |9 A1 q' x$ q8 |% }4 J, D* E; }# A
Method 04
p7 A- a- r5 }+ ]9 F- x% c=========. X4 q0 N- V4 ]1 I) P
1 y* {7 S, m; D; X! V& HMethod identical to the preceding one except that it seeks the ID of SoftICE6 p- y- o$ o0 ?! h+ U2 y
GFX VxD.
2 v5 S# ~: X+ R: L1 v
) t4 I( d" l+ Y3 D xor di,di
+ i% g2 s' B- V/ t mov es,di
5 G* s6 r9 u! P% j! Q+ D: a4 H: Z mov ax, 1684h # j0 ~* R0 j/ ] |; r
mov bx, 7a5Fh ; VxD ID of SIWVID' c. B: O* X3 q, w
int 2fh
$ o0 A% ~" N8 r& R' z mov ax, es ; ES:DI -> VxD API entry point6 Y8 U6 E8 W& J
add ax, di4 d/ e$ }4 J- [% l0 e' P; T
test ax,ax
- u h$ n5 U5 I+ G- H# q jnz SoftICE_Detected# S, l: R2 }; j% d1 p" b4 \
" P* w8 F7 c# M5 z6 z/ o( w! m__________________________________________________________________________& d( T' Y0 n8 O6 g( }* R6 D/ c! C
# }' e. w! v0 V$ V, y% i4 i9 |; A4 }
$ g+ X! z) o. J L7 C: b
Method 05, s5 u; X6 j7 {0 ]4 X& D
=========
- ]( c1 T; d( c9 C& L9 Z& K/ t$ G- N/ Y) P1 m# {$ k4 @
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ w% _" _; a8 d! F7 L
debugger. It calls the int 41h, function 4Fh.
; P% U6 N2 X9 R6 {, NThere are several alternatives. 0 x& ]) o! _; K$ W
* E2 v5 F( }& s. h+ [( `% i2 h) mThe following one is the simplest:
' v8 g3 v z* [( S( m6 v5 g
3 i0 H9 z2 c5 ]: E mov ax,4fh4 o8 z5 c0 H- k
int 41h- x5 m, t p& U) E5 R, ?
cmp ax, 0F386
0 I1 f. z" j2 B7 Z7 _ jz SoftICE_detected
) N4 v1 V: I+ s: D* x
1 P& P R! j+ V$ b$ S
5 T6 T O( b* u2 ^+ FNext method as well as the following one are 2 examples from Stone's
+ C4 R; U! E2 \' |/ g* O% I5 k"stn-wid.zip" (www.cracking.net):
0 s1 r5 }) C/ z8 \ I1 L. z' t
% {+ s6 r5 B; J) w mov bx, cs
& M @, ^" Y* I7 @ lea dx, int41handler2% V/ \' @6 P" E' p3 G6 O$ D
xchg dx, es:[41h*4]" @7 K9 K' z( K( S
xchg bx, es:[41h*4+2]8 Q4 ^7 {7 _9 n' `
mov ax,4fh
3 K4 w6 [3 Z: u9 ~, {6 | int 41h5 Y, v& N6 X) k
xchg dx, es:[41h*4] h& ]% P4 Q7 m9 X% |% m$ q
xchg bx, es:[41h*4+2]
1 k& V2 h* U4 |. \9 k! r- m+ ^/ y cmp ax, 0f386h" w+ G2 m( v0 v0 I" y/ y/ t0 P9 |. t
jz SoftICE_detected
- j: N* j8 j4 S( d- C% u& c1 f9 ~: o1 w1 Y) a% T' b& a8 h
int41handler2 PROC
9 x4 ^7 ?0 l6 O9 z2 \% [1 E iret
4 m) i3 H! g4 b, ~# v7 hint41handler2 ENDP& Q7 |$ S; g# R k
- L! e V6 `/ n0 a
4 j9 e5 |9 }# D5 G! x
_________________________________________________________________________
2 a( Q" p6 g! s4 A, |0 d- n3 ^
% O0 y( y! {0 C% e4 s3 G4 ^' `; N: h* Y$ G7 o3 L" D
Method 06# R* Z) L" a) [+ x0 C* X4 B
=========
" ?3 ?3 q' ]9 M: B2 W% M
6 i/ o& C# ~% @" t' S3 {& v4 U6 q' b0 i ^* `, s$ v: Z
2nd method similar to the preceding one but more difficult to detect:
; T' \8 G! A6 ^8 Z, x& W' M) D: s# {' E' O
7 H3 d O& N f _4 i
int41handler PROC
/ E, U" C9 V% S. M mov cl,al/ W$ X1 F N) a6 ^. O0 h/ i
iret
# B& W8 ] P) d% x( Vint41handler ENDP# s B2 Z$ I4 t0 Z4 G
) e' ^) i! t8 i9 r
0 d( K9 y+ E% B0 F6 V s
xor ax,ax
2 a0 ^# M; h6 t2 ^0 j: }" f mov es,ax
! G- h& B8 ~: {+ o; [) i mov bx, cs
2 k) J0 F! R, j/ V6 F9 ] lea dx, int41handler: [) ~: M- u, \! G: x- N: i4 f
xchg dx, es:[41h*4]
7 m. ?: E- I( V+ u, B) c' B; N xchg bx, es:[41h*4+2]+ D3 `* ?# v/ g/ Z
in al, 40h
+ \8 ]1 [& ^9 Z& D1 B( @: `/ m3 P xor cx,cx4 |& `) E/ Z7 w6 `$ t) \- b* b, M X
int 41h
2 d6 n7 A$ S: H$ S) M/ X5 _6 y; s xchg dx, es:[41h*4]( |: @$ Z3 j! K# k7 I6 ?3 i
xchg bx, es:[41h*4+2]
) l; a9 E, O9 ?& D# h- J cmp cl,al3 ]+ Y& P' Q0 Z7 l! x4 j
jnz SoftICE_detected
) M" f/ b, s8 w: |
+ U* }4 N7 }: D; s0 {; G; W4 ?_________________________________________________________________________
/ O+ C. X- w8 U: ?' f) L0 O8 n: H" e/ i1 w% |, U V: p# P, r. }6 U
Method 07( C% n' [) I! b. l
=========
6 Q5 l- m. [: O" d! Y8 m4 X1 H9 g
@6 i) [" S7 k9 W5 Z7 e9 vMethod of detection of the WinICE handler in the int68h (V86)2 U6 e h6 Q% p: s
" m2 C" w. e+ R8 k* M! z: v2 E mov ah,43h$ g2 d9 G7 {) s. {- W, B
int 68h+ g" p2 B# l3 F
cmp ax,0F386h
4 A& W! t& G6 i! X6 H* L& R jz SoftICE_Detected
) \0 H/ \8 Y j8 W7 g& g3 M
4 r" s( N; o, q( U% E1 o
& V' }. \0 R5 z' \ C% o=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 o1 r! t' @5 E/ m$ P2 w1 i
app like this:* j+ Z7 A- ?$ m. B7 b# x1 I
, I; E2 I1 S% J4 x
BPX exec_int if ax==68( F" m( _, J* p( r3 e
(function called is located at byte ptr [ebp+1Dh] and client eip is
! h" O. M5 P' }# [! b+ r0 Q, t+ c located at [ebp+48h] for 32Bit apps)* g5 ]9 s* _" G5 \# c/ f
__________________________________________________________________________
4 L# t" l" T, s" F X8 P4 E$ F% g2 S6 Y! t" ~! m+ k
) c+ u' k R5 R, M0 [, c# d
Method 08 }) C3 E8 u! \5 I( `
=========
8 r z" [' @5 V2 q
: G: [! i$ T ]* \7 ^; a6 SIt is not a method of detection of SoftICE but a possibility to crash the5 N! `. v' p0 {+ x# V9 V m
system by intercepting int 01h and int 03h and redirecting them to another' J$ z- a' d; S8 V
routine.
, v( X$ |6 l, o' q) H# aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
* B4 u& `, ~* k. D% `4 N- pto the new routine to execute (hangs computer...)/ z: ~4 H3 g, V0 n! Z! w9 s8 T
8 g* { Q) q. \: V
mov ah, 25h6 S5 T$ V1 U0 S( e
mov al, Int_Number (01h or 03h)
# U% T' V+ J P& D) W/ f$ p, D mov dx, offset New_Int_Routine1 G/ H: b1 n$ o J. f. ~+ Z2 t
int 21h( ?2 i% g$ f- x& D( f' d _
- s6 A; D9 {9 ~0 y7 `9 Y__________________________________________________________________________! Z, t# H( H0 ?. c E0 Z0 P1 g u4 n
1 w- D5 X# Y( c2 Y0 B2 A) _' RMethod 09
7 J) ?. E/ }4 R( v/ Y o$ f=========
; I, \5 N( \ r) p% R6 B+ Y4 X/ P1 b7 ~2 d
! o7 f3 ~5 K9 ?+ J6 B }This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) }, `/ r/ ~8 o! g& R3 t* T8 s) ~performed in ring0 (VxD or a ring3 app using the VxdCall).
& e' G& a& A) t" e1 E( iThe Get_DDB service is used to determine whether or not a VxD is installed
4 t, d: R& H! M& j3 }! s: Hfor the specified device and returns a Device Description Block (in ecx) for% C6 d R& t; s+ i2 s
that device if it is installed.
7 _ B, k, i* M2 |( o9 ?6 H, A V) }5 C4 n& A* k& d- @
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 @0 Z! p1 v: F9 q. N mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% ?+ R4 i, W3 M# d7 i) z3 M VMMCall Get_DDB
, l! I9 ~ q# t | mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. A5 S, P* l8 w% A2 p
) h9 o1 [0 Y, s, j& C# U- y( PNote as well that you can easily detect this method with SoftICE:2 ^: p" z; v K
bpx Get_DDB if ax==0202 || ax==7a5fh
4 B+ @# E$ A: O# v/ s" T
& m l. N( o1 J K__________________________________________________________________________
9 m( x9 Q) O; K9 P
& K( W3 G0 T8 SMethod 10
, Y3 i2 X/ D3 Y9 A$ u=========
' i: B! P+ V- t1 _- x+ J s/ s( [1 x. k$ C( D6 V2 {: F# M
=>Disable or clear breakpoints before using this feature. DO NOT trace with
# A6 N0 k0 ?4 {$ l# R SoftICE while the option is enable!!
) b- E3 V7 S" [$ B# }) S- W4 G5 p; p: ?) t- f5 ]0 M1 p& R, k: `$ ?
This trick is very efficient:' b2 U: i4 @: T7 ^$ b! k4 f. a/ M+ L
by checking the Debug Registers, you can detect if SoftICE is loaded
. f8 [6 ] L, e3 ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" n- V. Z( h/ X: V( h$ R3 _+ G
there are some memory breakpoints set (dr0 to dr3) simply by reading their
% y, j! O' z" q5 [ g# o! a, Hvalue (in ring0 only). Values can be manipulated and or changed as well
4 K: v t. P/ B& P* M, _: Z(clearing BPMs for instance)8 u: ~% ^4 L; q0 U* m
/ M7 S1 O% ~* F, z2 J$ L& z__________________________________________________________________________
$ O: l7 ?+ O+ E0 G3 t! p7 F! p( ~
, ^) d: i# F8 ?! [2 g; ?- s5 LMethod 11
, q' c, N+ ?( r=========7 s. D) m, H1 g* L9 E
( Y4 K5 n) ~% D, Y, z) |; x
This method is most known as 'MeltICE' because it has been freely distributed# G, x% O' w O2 \' S
via www.winfiles.com. However it was first used by NuMega people to allow
B6 _( v6 \ I$ w, s) sSymbol Loader to check if SoftICE was active or not (the code is located0 R2 I% J- w7 m
inside nmtrans.dll).) \5 B7 c& q s1 @ o
' u# N- W1 e/ G* P6 i) t+ AThe way it works is very simple:4 M( X$ A5 h# Q- x: w
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, ^7 I6 d% {" o$ _/ x8 VWinNT) with the CreateFileA API.
x" o4 g( L( Y1 F% t8 V# ^ A& \) O# A! }6 e/ q
Here is a sample (checking for 'SICE'):/ _! c" }' D5 ]
! Q/ ?, E% O6 K% r) cBOOL IsSoftIce95Loaded()
7 x5 S1 i' q: }{
' y! b, T6 t# l( l1 @& Q HANDLE hFile; ( J5 Y6 @' w6 j
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ ~% l% ^$ Z) J5 O+ B' Z M/ T FILE_SHARE_READ | FILE_SHARE_WRITE,
, M; ^/ d( g& ^5 s0 W: S4 @ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 J0 E' I* w+ t! d5 x) h$ y if( hFile != INVALID_HANDLE_VALUE )
- @1 e% B) N% ^) `8 l) k* B+ Y {
2 C9 o; M/ b9 V% ^ CloseHandle(hFile);
; J w$ t/ y; v# l. a return TRUE;# Y! l0 [' K3 m5 p9 J
}* j7 y/ ?" O& B/ }
return FALSE;7 ]6 P. {- N: [1 s2 w8 y
}
: ~/ w- X& h6 X: k6 w" I
! O0 ^9 h! q4 i/ O. EAlthough this trick calls the CreateFileA function, don't even expect to be
( m1 Y; W! w7 P" T+ \able to intercept it by installing a IFS hook: it will not work, no way!) X" M; j' _0 f0 `
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
# N8 { B7 c" F$ Q; f# j% X3 O! gservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 ^4 z) ]7 B, ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
L+ ~9 v# P: N) K) wfield.
V$ i% X O8 D7 S1 o) mIn fact, its purpose is not to load/unload VxDs but only to send a ! d$ |. P: o% r% T- j5 i! {3 G K. a( s
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& d: g" l4 C- d+ L0 `to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 _0 ~: f4 @6 c, w
to load/unload a non-dynamically loadable driver such as SoftICE ;-).! I: B/ J+ o* q8 A5 `- ~; X! Z
If the VxD is loaded, it will always clear eax and the Carry flag to allow
# p2 [# W1 N7 c5 l& _7 @its handle to be opened and then, will be detected.5 N; L6 ]/ D+ m% L
You can check that simply by hooking Winice.exe control proc entry point6 b3 O0 G7 j0 i; K( p6 K
while running MeltICE.( b5 T3 `! J0 n
4 @2 v5 ~8 n$ G& }7 p1 F
( A( O- U0 o5 D# a
00401067: push 00402025 ; \\.\SICE
1 f5 Z7 I, I/ O1 W- f$ Y 0040106C: call CreateFileA
1 ^7 m6 Q, y' Y( \' _# c 00401071: cmp eax,-001' }' m8 v" O, n. Z
00401074: je 00401091+ {3 @7 _0 i. o2 i( o
. b7 U. z2 y0 h5 W7 i/ a2 K
" N, r1 F F iThere could be hundreds of BPX you could use to detect this trick.- h$ Z; h0 W" T7 q m0 V3 p7 {/ T
-The most classical one is:# B! j7 ^. p% `* v# J
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. A# Y' l! B6 \5 R& @( b' m
*(esp->4+4)=='NTIC'. ]5 v4 Q" N0 S
5 T8 B2 I. w$ A9 n' w
-The most exotic ones (could be very slooooow :-(
1 f7 p/ e: X# u BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 t( W. r! _8 K4 T+ }6 }7 g) O7 w
;will break 3 times :-(
5 n( c( V0 C! x; p7 ?$ [. G4 H- r! ?" l5 k$ E. Q$ D
-or (a bit) faster:
5 M# t1 ~& u. a$ H BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- N2 ~& D1 D2 k; u) p2 X3 _" C- J3 ], u+ O8 S v2 B
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 O! M. u0 F5 Z4 k
;will break 3 times :-(
) ^& D0 A6 M1 P9 Z7 `1 |2 u- E, h7 l; l
-Much faster:( e* k% a; D+ w. r! K
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 H" t4 M/ y/ N, y5 A" j7 J' ^3 f( J
) A% z! |5 [) y- Z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. B- f. Z7 \- \( T0 a, p0 qfunction to do the same job:; l, q, m$ R0 s( v' u" p
0 ?) t; D( D, D1 S2 O push 00 ; OF_READ, L- ], G" {/ E+ M
mov eax,[00656634] ; '\\.\SICE',0% S( G- V: I/ \! l# O) [; k
push eax
8 j, z8 C7 O" M' u7 Q) O call KERNEL32!_lopen, P9 @ p2 t6 l: l
inc eax
1 K. l% {) q$ T! c6 z8 X* t( [ jnz 00650589 ; detected# a. v- `% `" c8 h, f4 q% l( \
push 00 ; OF_READ2 O& o- @4 Y, T) ]: {9 f5 a
mov eax,[00656638] ; '\\.\SICE'
& C5 ?3 r1 W# q" L, J4 _! q push eax
8 k% R5 m X9 E; u call KERNEL32!_lopen: D. M2 N. v% D+ R3 H
inc eax
% I: }6 w ^& Y( p- q jz 006505ae ; not detected- u4 S! ?- x; |! T% `- n
- ?" o s @8 Y% |' y
6 d3 p+ z% m) S; P, y__________________________________________________________________________8 R- Z x0 f! r t$ A
) b$ k& ~9 x: W5 L9 N4 D1 UMethod 12 l0 z$ R& i$ s' x3 Y) |4 w
=========
, Z( W8 c: J0 ~0 j. m: V" v/ J& V) ~: J7 u
This trick is similar to int41h/4fh Debugger installation check (code 056 {: g5 I2 b$ e* p0 T: Z
& 06) but very limited because it's only available for Win95/98 (not NT)
& C4 F: D# f, s6 x% c% y! kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 [) w9 P) H' a# B9 J/ p0 n8 R1 N: B% ~4 m3 x
push 0000004fh ; function 4fh
( b0 R/ @. A8 H4 O! `* l$ u% c. K9 ] push 002a002ah ; high word specifies which VxD (VWIN32)
- {/ D( g8 M1 i# m ; low word specifies which service( I, n1 d" \ q5 x, o
(VWIN32_Int41Dispatch); I, |6 Q, K9 v; g1 H
call Kernel32!ORD_001 ; VxdCall
8 g5 O- p' E6 p cmp ax, 0f386h ; magic number returned by system debuggers
2 u: W. @3 ^+ B4 {/ J! i jz SoftICE_detected
- O9 r: M- W- [. p0 Q } B, a/ o; n: A
Here again, several ways to detect it:. s4 N, X$ j2 B# l1 \# S7 w7 g
8 r+ i: P, s. O2 b! J2 b% {6 X BPINT 41 if ax==4f
1 v* n: z. |9 p' g. g4 s" e& y# b9 M _" P4 n6 h- i- K5 t% W
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 T7 m: {5 v* }# X, ^! G) R$ u$ ?: P1 m
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' x5 S$ p7 C" L/ [( G0 _
# \6 P" ~. d2 P# W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# \, y1 q$ ^ s3 Y$ G, m" K
9 f( ~; c1 E7 [* c# H' k" c__________________________________________________________________________
6 ^# ?8 |6 I7 b" d2 z6 G2 s$ h) S
& S" R- h4 w0 A( n& ?Method 13
5 C3 s/ p) ?/ @/ K& i=========. c' S* Q1 L8 Y$ |
5 m8 ~5 u- N! O3 V' X# L; u
Not a real method of detection, but a good way to know if SoftICE is' f. S/ I! m& O$ u) U
installed on a computer and to locate its installation directory.
4 l1 q3 k5 s; ^It is used by few softs which access the following registry keys (usually #2) :7 Y2 t1 y9 r2 N0 ~/ ~
7 x& s; E7 S* \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ f) `% n+ a: M3 I0 U5 c\Uninstall\SoftICE, C/ W* c* a- N Y! u' s6 I
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; B4 M% A' V S2 f8 S. ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 J- {7 `4 t8 B+ W, M1 z\App Paths\Loader32.Exe
( C2 [& [3 Q. m- p7 T8 o" U k |, `/ l8 m; ?3 A$ M! ^: d, \" z) L
3 P9 q8 ?% }5 U! d$ p4 CNote that some nasty apps could then erase all files from SoftICE directory
4 d- X) i; j) L3 J: F* Z(I faced that once :-(4 y& w7 N4 x( M, h
~* M4 x! v/ W4 N! {
Useful breakpoint to detect it:5 T, g. x8 X5 E9 {) s) B% E
- f9 X" `6 v" y! ^ a
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 k4 p! [3 \9 j; f
8 h1 m: z( D- m& i$ q__________________________________________________________________________. g" V C1 s, o2 j% ?7 N. {- P" V
E- Z. C: K6 f: o+ `9 Y# ~
& R. _% [4 E+ L! t' Z* PMethod 14 % a3 M0 F: `, I& \
=========+ N) X2 T% |3 O) _0 K
4 n0 e' L u& i6 Z) |7 f) [# i) j; D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: \( K" p# f. }/ Zis to determines whether a debugger is running on your system (ring0 only)." ?7 f! x K8 v& [" d" }: f
3 y( |/ {3 o! Q# \- X
VMMCall Test_Debug_Installed4 l* g) O3 D; G$ H' ]3 e6 @# T
je not_installed
1 X( P! t& S4 M9 ~( c: _7 R
, p& ?# _3 v9 \2 U+ u! L, T0 ZThis service just checks a flag.
( @( k$ A5 F4 x</PRE></TD></TR></TBODY></TABLE> |