<TABLE width=500>" m p' p! E3 J6 X6 y, z: e8 }
<TBODY>/ {- O* w, K# Z
<TR>
7 ~& [7 s$ t! X7 I p+ G<TD><PRE>Method 01
. p6 }& r- `3 j9 ?8 i+ x=========+ o Y7 J. Z) d1 {: w5 u& C7 M
# a( \2 Z: u( m6 o; e& g: |$ P& b
This method of detection of SoftICE (as well as the following one) is' U$ @, P! J+ e
used by the majority of packers/encryptors found on Internet.) S; i" v! C) [
It seeks the signature of BoundsChecker in SoftICE
' o" }) W4 y* v/ k" k. I3 f) j+ W% d2 D
mov ebp, 04243484Bh ; 'BCHK'
) x! p. L) @% v# L3 K' i mov ax, 04h$ h6 F! Z$ k9 S4 ~4 H! y
int 3 & F) `, m( a$ }: N$ z
cmp al,4
1 J, b8 y- n: z- J+ M6 F8 c jnz SoftICE_Detected
9 e& d/ i$ z5 ~6 F- U( l
# m! s9 v6 q0 a& D; S" K___________________________________________________________________________
" B! g4 q+ Z- ]4 i4 `' p
3 F7 Y$ X; N* K' N( JMethod 02
/ [0 [, r$ ]4 _. @: k=========
: I. B; t" Z( T8 K `) G4 @5 i4 t( A7 ^3 b) T+ Y; e
Still a method very much used (perhaps the most frequent one). It is used
! Z" w3 P) n* Q D" P Lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,# C- W. v" Y; j- c: o$ `
or execute SoftICE commands...
! k/ r8 Q# W) ^7 K0 o3 n1 hIt is also used to crash SoftICE and to force it to execute any commands
9 e$ I1 [7 I9 o/ O9 s$ P(HBOOT...) :-(( ) x) f, [ r2 r4 R7 {2 |* E
! ]# B; Z1 n4 K/ i, x2 r
Here is a quick description:- h0 _6 U w, Q% q# S2 H& W
-AX = 0910h (Display string in SIce windows)
6 E& j0 [; A* T% z" o-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
# e7 ?, o" v/ o6 @- @0 V! }3 ?-AX = 0912h (Get breakpoint infos)
?: R, E, u- `* S' \) P# d. r-AX = 0913h (Set Sice breakpoints)7 Y8 H# n0 j' |& \
-AX = 0914h (Remove SIce breakoints)
( K Q% z! }3 z; z" c$ B0 t. D" m
. ~4 H1 a9 S4 D9 K' ^# QEach time you'll meet this trick, you'll see:
, R) E6 C& G* Q# N7 Z-SI = 4647h
2 k# G$ w9 {/ A" ?-DI = 4A4Dh, E7 d2 f& M$ x4 T
Which are the 'magic values' used by SoftIce.
4 m8 p. Y' ?7 ?For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& D N8 p) K# S0 ]5 Z# [
( P8 N' {$ b7 P' b$ ?Here is one example from the file "Haspinst.exe" which is the dongle HASP
5 F" d, u e4 @$ ~+ ZEnvelope utility use to protect DOS applications:
0 Q5 w; X) W) D7 d6 Q0 H5 x* d/ D1 e7 X# {$ ]
/ o1 x; \: [% ?9 N
4C19:0095 MOV AX,0911 ; execute command.
$ {% Q+ f- _9 a8 J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).! C, I; k( ?& O1 x; R& ~# K( A
4C19:009A MOV SI,4647 ; 1st magic value.
- x( I3 T+ s$ f. t; F* ?4C19:009D MOV DI,4A4D ; 2nd magic value.' u, @& D( F0 k- u5 g! g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 R7 y( g0 u$ h6 T3 w
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute: I8 \/ L; [, Q5 @# R" z& l
4C19:00A4 INC CX
, N( k# x- `( d' F3 B% u4 R4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: G2 a/ }2 C, h; i4C19:00A8 JB 0095 ; 6 different commands.* N9 F4 ~- k. P* P
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ P8 i- n5 \7 [7 a, `! h P
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 C" G6 o& g+ e$ R2 C! ]
& _/ o& y) Q U: [0 q3 t; `8 ]The program will execute 6 different SIce commands located at ds:dx, which- E' M+ X, Q0 ?& v4 Y* \ f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( }3 q% S0 {- x; z; l
% I! P: N* X- I! Z. m
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 S3 c& q& P9 m4 V7 |3 ?3 f" I___________________________________________________________________________ k9 y% c) f# S% d4 [0 `
9 u) N; j( d0 m
: [6 n& X6 I3 @Method 03
% Z+ `# m! C: g, [2 v=========
9 i, V2 {+ ^# K o A1 t
% c/ x! S; m x! w$ H* }5 `1 yLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 x5 A5 h3 H K# \, P) s
(API Get entry point)
$ E9 z$ W. T4 c# H' \5 l
7 V- M* t; I; U1 j$ G) j' ?: {
1 f. F2 L! S0 S xor di,di
8 k' u: v/ Z9 L$ U6 i) ~$ m# L+ K mov es,di: C2 M' B9 {/ c/ Z% B
mov ax, 1684h # F5 Z Q/ A9 {# p6 ]: j: i" R
mov bx, 0202h ; VxD ID of winice ?4 c9 ?6 \+ g' d8 }. r2 e! A
int 2Fh4 J4 M* u* \0 X3 H- O- s/ p& r5 v
mov ax, es ; ES:DI -> VxD API entry point
* b4 z5 q E* Z" b add ax, di
, t, w2 y3 v: x$ z) o# I$ P* r" l test ax,ax1 G+ ~9 E7 ]9 u4 ] C; e0 h
jnz SoftICE_Detected
7 ?) P( y# [0 b5 j4 s% ^" t0 B
+ e5 x5 \0 a6 a" `0 e o2 A___________________________________________________________________________
! W) {9 u4 y4 y" J; P- F' c+ A
0 u: {( P7 z. _: s2 S/ G9 n; J( EMethod 042 G' n- s6 F! r$ y
=========
, t) d- x$ ?1 ^- l
1 V+ i7 M% X1 N% _- jMethod identical to the preceding one except that it seeks the ID of SoftICE
; K( f6 a) a7 g8 o8 z3 E# lGFX VxD.1 f) |! j3 q8 W% Q. C
6 |2 H+ ?! o6 @' T6 W% O+ H) U) ^- v: W xor di,di$ E3 v9 b9 z" O4 }) A! m: c
mov es,di1 R5 E0 P/ ~6 R; _1 R5 A. N$ A
mov ax, 1684h - r/ \5 j b3 Z; q
mov bx, 7a5Fh ; VxD ID of SIWVID
, s: g0 z- |% t7 z, f u int 2fh( I9 L! o; w" A4 J4 p) S
mov ax, es ; ES:DI -> VxD API entry point5 o w. G- G. k2 O1 w' x$ W; M; C
add ax, di
# N5 q0 u; F2 G+ a test ax,ax! ~3 B( C* q. w
jnz SoftICE_Detected
2 l$ t+ m" |8 v4 q: N$ {. E0 Z4 C/ V& D
__________________________________________________________________________
' d8 u# i& m7 t. \3 A8 v% P! i* S, ?% w& i' L/ |* D) V
/ i: B2 A: W2 b- \ B# H# X1 H# u
Method 05+ ?* ^* y% w. H. G5 G) p5 P. f& ]. X
=========
7 H; j6 k8 Y& ?. x! m. J) C4 r
/ @- Z A! n, e* PMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; E/ _- a& x' B3 ^/ @! M; |debugger. It calls the int 41h, function 4Fh.
. s( x- N3 F% X- W' m% ?. rThere are several alternatives. , M, @" \7 i6 B; X* ^
2 ^* A$ u/ p* s3 ?6 k$ t7 ]The following one is the simplest:
) n+ v& n; V8 Q# z: N0 B( c
( J- C" t& i2 H) l( S3 ] mov ax,4fh
4 q }( ~: G% y1 H6 A int 41h
: V* m: x0 u$ c& T# n cmp ax, 0F386
# ^# A! R0 L+ g3 @- e" y9 g jz SoftICE_detected
- h6 l' a; x& U) p0 Y0 d
) s0 n1 V, ?: X' v2 F' P/ z5 \- L a* U; y0 H5 m. k
Next method as well as the following one are 2 examples from Stone's
5 x5 s8 F% o/ B! q; i"stn-wid.zip" (www.cracking.net):
# n9 A: R4 r8 l' h+ k+ C% Q0 f9 h3 E1 R# e7 W
mov bx, cs2 ~& f* ?2 Q7 i8 u# p
lea dx, int41handler27 Z/ ]$ P5 f* r) {: G" O. B8 O, V' d
xchg dx, es:[41h*4]
6 M* u% H1 N6 P: `/ O" B+ w- [ xchg bx, es:[41h*4+2]% K& I- U1 D& [* J1 ?8 a3 n( A
mov ax,4fh
# F! _7 n' f3 T/ D& Z9 | int 41h8 H: L7 X/ |8 [2 S, ?+ i" V3 G; a
xchg dx, es:[41h*4]8 A, `( `3 x, F9 j3 x2 [# f+ e
xchg bx, es:[41h*4+2]
# {# j6 S+ M2 q! T6 G: B cmp ax, 0f386h
+ y z: X! H, }" y' }, x p8 z1 P jz SoftICE_detected/ F. E+ d4 i7 f( F# j9 y
1 z9 h# s/ L7 t# l9 Gint41handler2 PROC
4 h8 o5 i. Q5 _' _ iret
. B8 ~6 c' A; m; J K7 {+ Yint41handler2 ENDP2 C# t" n' b. C" }4 H- F. _
3 k6 }( ~$ e8 M1 e, e1 Y/ c' v
Q, q: h7 t# o0 N2 b
_________________________________________________________________________: U! n; v$ H$ z3 s; t5 g( m
( c1 p& v+ I; K6 c, {7 E$ L
1 |7 u2 A, |- R$ W1 T; E3 b9 J( @
Method 06
! H6 _3 `0 ~& p1 E+ }3 j2 u=========
! t4 s' Z5 l5 o
" @% {) a1 U: A& T3 R( s- M1 N! Q1 O, J
2nd method similar to the preceding one but more difficult to detect:
# p$ f6 c. p( P* L2 `+ W% f4 m( c) _$ `* C8 G5 D
$ L% g6 l+ J. G, |# v4 f3 z
int41handler PROC
0 o& u3 w2 W! S. A% o4 J mov cl,al
7 A5 v1 V8 T) K( p7 S iret; Q' a' }1 `& Z3 k1 ^. Z
int41handler ENDP& l; m6 x. H% K& }: N- ^
4 |- t9 m8 ?) ~! K4 G$ y9 U9 R0 U1 P" a. Y& `! Y
xor ax,ax
& O; Y9 l1 F b* i; v mov es,ax# A. D( `9 h& f8 m4 ~
mov bx, cs2 ]/ n7 u! v+ ^8 ^
lea dx, int41handler9 H; H: x9 `% F- _" U' |2 b
xchg dx, es:[41h*4]
) Z) @: L3 t: u/ V7 }2 Q4 L# |3 z xchg bx, es:[41h*4+2]
l. L0 {% ], B* r! ` in al, 40h
2 h: ?% u+ b* a3 p, F8 E xor cx,cx" ]7 c6 _1 l* x% p1 Q3 k( R/ m# d
int 41h
7 }* T( ]4 g* V( M xchg dx, es:[41h*4]
- O. l0 S1 m7 @# k& h4 r; S/ g- H xchg bx, es:[41h*4+2]2 \# x$ b/ P3 L; m
cmp cl,al
+ L( P! a) q1 w. _ S# B$ L+ j! f jnz SoftICE_detected' e5 \, E' n B9 ^) K
2 `' c% y* j/ V* a$ }
_________________________________________________________________________, S+ N* b+ p3 g- K
6 L$ Z( E% _, H6 P& R4 C
Method 07, |: e" F3 h2 U' X* D
=========
3 a9 v9 U# F; p9 K+ e( D, p" C2 c
! V: A3 ^$ K+ r# D$ ^5 R4 {9 uMethod of detection of the WinICE handler in the int68h (V86)
1 d6 H+ ?# d% i4 r7 x( C1 t9 g. B/ E1 ^
mov ah,43h' ~9 _. c* L0 ?+ o2 M2 u; V
int 68h
5 f5 F0 |1 I/ v1 F( w4 J8 a& P; K cmp ax,0F386h7 f4 T: h5 m f- u4 |
jz SoftICE_Detected2 o1 D4 D' A1 r" Z/ _
) Z0 p) r% Q- M0 g' H
! x- V ` L- n. h8 u$ F% b) x4 ]=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 Y- L2 ?; [0 {; s( F
app like this:; u; m+ v& G# h$ i7 s( _; |
6 b) L5 ^+ L2 K3 l$ I7 P: S
BPX exec_int if ax==68: `* K) }6 J% k" [1 w
(function called is located at byte ptr [ebp+1Dh] and client eip is& m" [* {8 ?* m# v. S# J
located at [ebp+48h] for 32Bit apps)
& y7 U0 g. X) ^6 M+ @__________________________________________________________________________! Y2 i/ K4 d* J
" P6 R0 ]/ u8 K4 _# d7 I6 K0 Y; O9 a7 v8 X4 l
Method 08- N7 {& b8 f" f, l
=========3 { a* w4 o' d, {& q+ V, `7 a* z z
% [$ A) j k: n, w8 l! C! V" f
It is not a method of detection of SoftICE but a possibility to crash the" |1 J* E! E4 G( D# M$ d' O j
system by intercepting int 01h and int 03h and redirecting them to another
, e" z- H2 }$ C' @$ n3 B0 yroutine.( A$ n0 h3 ~6 ?& X& V% l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: b* B7 f n) W6 M& g
to the new routine to execute (hangs computer...)$ C" J* p1 E5 W, K: Z
% J3 I8 _% \. }& x; Q7 J mov ah, 25h+ _& D9 L7 s2 I# ^
mov al, Int_Number (01h or 03h)
2 J7 G& p5 \0 ~" V- P& w mov dx, offset New_Int_Routine
( c2 M# E9 Y6 g% D6 F5 H int 21h
) A; V! c+ X- d' d/ Q9 [( p( X) Y5 K6 H: P: t" c6 z, H
__________________________________________________________________________& U x% L9 P/ S
" `3 f6 t# h. \$ L" M# H
Method 09
6 A0 _# I8 `. A0 u=========
# M m. ]5 y" V# P5 {
5 Q/ u1 `& [5 ], r+ LThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ L( f# P6 K A% p: { G% {3 E
performed in ring0 (VxD or a ring3 app using the VxdCall).
* l( Y( F1 Z! ~" j4 G, MThe Get_DDB service is used to determine whether or not a VxD is installed" j# v( f! O A
for the specified device and returns a Device Description Block (in ecx) for3 s$ W0 z# N0 B2 D0 E" m
that device if it is installed.
8 \- @4 Z; n0 l7 {
6 A4 @- ^) T2 m; i$ { mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 a; R5 h4 z4 x k( B) O$ M3 \
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)1 ^+ A6 O% j9 [( u4 c5 J
VMMCall Get_DDB# o% w- M z: N
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 y% w# V9 A7 H* k, O' U7 c
0 |3 M8 x# f3 y% m5 E6 [# aNote as well that you can easily detect this method with SoftICE:
0 r6 ?; k! q& a* w. M9 A bpx Get_DDB if ax==0202 || ax==7a5fh
( {* j9 y; o* _
. Y2 L, l+ }5 Z- H' X__________________________________________________________________________; u' s- }9 h2 s7 l
* s1 Y7 z7 r( @: B& s
Method 10
5 g/ j: u8 X& P# Z. X=========
6 {- U6 x( c( J
; \; @# t: n) N+ {=>Disable or clear breakpoints before using this feature. DO NOT trace with
" Y& W/ A$ X! F SoftICE while the option is enable!!+ d9 {. H& M/ T, m6 }
8 X8 X2 X- {4 RThis trick is very efficient:4 l4 B8 ]! F9 K* `- J
by checking the Debug Registers, you can detect if SoftICE is loaded% j8 T5 G; J) D, l( n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* x* {! M- C8 a* v5 v- fthere are some memory breakpoints set (dr0 to dr3) simply by reading their
# l2 l3 C0 W2 x9 n8 W' Zvalue (in ring0 only). Values can be manipulated and or changed as well
( a6 P% L, B/ ~/ j3 p+ r J+ F(clearing BPMs for instance)' w0 e( ^- o& N1 E! a! w4 ~2 ?
6 q. S0 X2 G J, Q( D4 e( V
__________________________________________________________________________
5 c* R' z2 `3 X% d8 @4 l8 t- v; z2 _+ G" e# x6 v
Method 11
M4 y! e$ _' A; v=========
% U. X$ Y$ G/ E" q5 I8 y& j4 N8 {4 a" x0 l% G8 P
This method is most known as 'MeltICE' because it has been freely distributed/ j9 t- J; V7 z8 _
via www.winfiles.com. However it was first used by NuMega people to allow
7 [$ f( u5 x# }$ \2 E% lSymbol Loader to check if SoftICE was active or not (the code is located
3 Y5 e. ]3 l! z6 h6 _; Linside nmtrans.dll).
# q% ]& R! y( D- M4 a
* W" M s! P9 S3 k4 D2 _# F( qThe way it works is very simple:
7 y! g; B; k- l1 \* [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' D& X9 }4 `0 F9 B
WinNT) with the CreateFileA API. H* i% S) R( j/ H% O! R3 d' @
3 c/ Q+ V( h4 E4 n) R9 J, Y) FHere is a sample (checking for 'SICE'):! y! M G5 v @1 ?' s6 v
* K) i# k2 D7 J$ M2 O) qBOOL IsSoftIce95Loaded()
4 s1 j# B. E) I7 W6 z8 V* A{9 X7 y+ F5 n) z1 Q% b
HANDLE hFile;
- Z: s" Q' \7 `: K \7 }! v& d hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 x9 V4 y/ y4 q3 s( n FILE_SHARE_READ | FILE_SHARE_WRITE,
& O+ d7 @/ @8 y" x1 v n) b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" M* J% m3 F6 t2 F6 s( q if( hFile != INVALID_HANDLE_VALUE )
3 c1 u, v3 }" A0 V) ~7 f0 ^ {
. B& T# p3 |- m9 V0 e CloseHandle(hFile);
! y! z: v. @, Y1 O return TRUE;
7 d0 ^7 E( ?2 O9 K, n& S }7 q1 ^ j5 S9 o& D
return FALSE;5 r7 b4 h9 c3 T' o9 z- k
}
& X$ M! V M7 d1 R# G
/ I8 i( i, a# J J) ~1 vAlthough this trick calls the CreateFileA function, don't even expect to be
, ?( I( q! Q, Xable to intercept it by installing a IFS hook: it will not work, no way!
2 F* N: C" m+ A. A- oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 T5 A: t+ S2 f, A: Yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 Z4 M0 R! ]+ E
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 B$ g Z7 E! ]$ R4 u# i
field.
5 A2 M6 _2 m0 i# y3 X6 [& y0 d; c# bIn fact, its purpose is not to load/unload VxDs but only to send a
~1 [3 H* d1 ^% sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 `+ F# e0 f* f) V* T, }+ }to the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 e+ f" z h) n+ L& S% d8 eto load/unload a non-dynamically loadable driver such as SoftICE ;-).- k1 A3 S/ I" h' i
If the VxD is loaded, it will always clear eax and the Carry flag to allow
& b) ~! @" h/ u$ Iits handle to be opened and then, will be detected.! N! q. z3 t4 F0 ?* z
You can check that simply by hooking Winice.exe control proc entry point4 D' a1 p! K" P
while running MeltICE.
1 B, j; _$ t) ~$ {( z! A% g1 T: z4 \% y$ z( h! [4 _! s
0 {, E6 j8 ]) n+ X, r" j 00401067: push 00402025 ; \\.\SICE
- v' V* Z. W3 r, H& T- h4 v 0040106C: call CreateFileA% t& R6 @; U( F3 o: E
00401071: cmp eax,-001/ P& j6 X8 Q8 X
00401074: je 004010910 U8 V" o w4 ?0 A1 Q% ]
9 p5 b8 R$ @: b7 r" T1 F
; H9 G, W/ d# S: E" N8 n
There could be hundreds of BPX you could use to detect this trick.) @1 G, X( Y) _9 \
-The most classical one is:
; g3 a" |- F) a/ A/ s3 X4 V p' Y# L BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
9 U7 |9 ~6 `# D( S. k8 n *(esp->4+4)=='NTIC'0 R3 \! Q& r6 P6 s6 R7 b& i& y
$ q5 D1 u4 U& J {! H5 w
-The most exotic ones (could be very slooooow :-(
% j/ o* G0 @ { BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 X* ~# @+ O8 n8 t8 a6 n1 q
;will break 3 times :-(1 Z2 {& `+ F, g% `7 w) m
4 [6 j$ x U* i% B8 e
-or (a bit) faster:
# g, W" Q5 A F0 d& [ G BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* z# k+ b$ L, _" W! n. O H8 N, e+ e3 A% G! r
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # y$ r* C- U8 |2 ]8 G5 [6 r: m
;will break 3 times :-(
1 Z1 b2 p( r/ J3 E2 B4 Q" o3 d3 m; ^* m- E" B* k/ `' V
-Much faster:
, k7 j% E( Y; T0 O4 {; X BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! m6 M) u. g. c/ q
0 Y. l, i6 k4 m4 o6 {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ Q) ~6 c I/ w$ p+ x2 z+ xfunction to do the same job:
$ n" d( K4 t# m/ e, ~* L# D' R% |7 l
$ F- m8 m( H0 t push 00 ; OF_READ/ K1 q" b# M) m& `
mov eax,[00656634] ; '\\.\SICE',0
4 N2 Z6 \9 S; {, [& \ push eax) T% J* b f! K
call KERNEL32!_lopen
* {! P) |* v6 P! c! j inc eax
% J" R4 `0 K( n jnz 00650589 ; detected9 d W. S$ L1 f# x2 @3 ^
push 00 ; OF_READ
7 p( a4 n! j! A8 t r+ x mov eax,[00656638] ; '\\.\SICE'# a/ k4 j5 I7 i$ g9 g! _; s) N
push eax4 r8 ]4 R0 I. L* O
call KERNEL32!_lopen1 i0 n3 g: u* h- p
inc eax$ P6 H) O5 x. Z; N. l
jz 006505ae ; not detected2 u) q& ~3 |! i; Z
" J. C; c2 \/ G+ k% q- n% z9 M$ r
" c6 s m8 k! f& { V
__________________________________________________________________________- F) G2 @7 O' P g# W" _5 T% Z
- M! u3 c4 h" `. C# xMethod 12
1 `/ m; g8 c9 @& D6 |% v$ g9 P=========
) m c5 U) X. V6 O& r9 b, L2 z6 Y6 F: u2 e/ g. b
This trick is similar to int41h/4fh Debugger installation check (code 05
( Q/ g6 B$ x8 T5 D; j2 E: @) m# F" @2 o& 06) but very limited because it's only available for Win95/98 (not NT)
& n7 J6 P, W0 Q+ P8 d2 fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- a4 I5 u# B8 G0 G: j3 A1 g6 q9 w1 v2 U6 d4 V
push 0000004fh ; function 4fh
# Y* D2 W; o6 O3 u push 002a002ah ; high word specifies which VxD (VWIN32)
+ |; v$ `7 ]3 ^$ c4 T3 x, y ; low word specifies which service- T- E- E1 t0 y
(VWIN32_Int41Dispatch)
9 d. g* B: {' \8 N1 y6 k8 a1 f9 A) B+ s call Kernel32!ORD_001 ; VxdCall
- w( g, Z: Y" Z5 w# d cmp ax, 0f386h ; magic number returned by system debuggers
7 V2 T* r+ M$ T jz SoftICE_detected" S8 H2 J2 h0 o- P6 @
- U9 B, ~! g% n9 b1 `7 }7 `/ ^0 OHere again, several ways to detect it:
5 n9 [) w8 R; g% D7 h$ j
" R4 m+ T: Z' F' A5 D! a' l BPINT 41 if ax==4f1 ^- w$ l! n- P! B. [# K5 F
8 o4 }7 a1 d7 M% K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 w% c1 V$ G/ i$ c, k& C* M
, o* F% U, c1 a% ^7 i( W; }2 y* c BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' n& R/ V, t6 H4 J5 Z+ g Z0 z; y! E9 I/ N, P9 j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 V, a/ {4 R; E0 W* B! ~. u" s: C# T' [6 m U( ]! R
__________________________________________________________________________' S# d$ z1 [9 r! ?! f
1 G F( z4 I5 R" D* @
Method 13
2 A, A* b( X( }& z! q6 _; `9 q=========
/ Q& K3 ~' v; T7 U4 r6 d
# V; d* j$ x0 l& M5 n2 {5 o* MNot a real method of detection, but a good way to know if SoftICE is' u s, F4 e6 G' W1 G/ C
installed on a computer and to locate its installation directory.: h+ }" v/ L- u l& v
It is used by few softs which access the following registry keys (usually #2) :& _* D* T# E3 K" `" e: d: d- L
( g0 ^/ C1 l/ @( \9 w2 ~
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 V& i+ |/ _0 I8 b0 A
\Uninstall\SoftICE
0 ]% U/ N. \$ C* n-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% ~+ Z! e( X) R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ _& H' C1 M/ G7 m
\App Paths\Loader32.Exe6 q. ]- P' ?0 ]0 x& T. y! N" O
$ [5 v9 y8 Z+ k! A$ k6 ]; w8 ~2 {3 R* \' p. ~
Note that some nasty apps could then erase all files from SoftICE directory
7 o$ N0 d7 j8 ~- d2 @3 j(I faced that once :-(
3 h- v r$ _% }+ Q6 p" k9 I) B' }. M
Useful breakpoint to detect it:
- \, j( z% s, S# u; y7 u+ S7 N% V- [; m8 z1 o" |2 l
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'. v3 @. q4 Y. E3 F8 D
" I9 l: K$ g8 \& Z. V. h& o
__________________________________________________________________________$ \- \& f( F3 x# m
6 i1 i- ~& d5 o0 y/ Z7 d% g, u9 G8 x
Method 14 4 U, B' O% Y' x$ g/ @- |
=========$ ^9 [( g/ c. t5 o ]2 F/ L- V) U
$ f- _: j }3 N" ]1 MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' v4 [' c5 r( eis to determines whether a debugger is running on your system (ring0 only).
% G, x. p: z! `# m! x
& @2 Y1 G3 O6 {3 u* M VMMCall Test_Debug_Installed
7 V" A: }& E. D8 h- w$ B0 x je not_installed, \6 w# q% J# T4 v9 U
$ E, r# H1 d' P2 U
This service just checks a flag.+ F$ V, j% z. J8 l; y
</PRE></TD></TR></TBODY></TABLE> |