<TABLE width=500>
# J, k# M" @+ R# }, n<TBODY>5 c& S3 {/ A$ ?# d' g; d
<TR>9 x1 ?0 ]$ t s' J) f) D8 l) w0 e
<TD><PRE>Method 01 * I5 \9 j: F. f/ B8 T4 T
=========
. w) Q4 d( L! j; A
8 y; z# S d8 B% f+ iThis method of detection of SoftICE (as well as the following one) is
. c) ]% Q" Q- H& gused by the majority of packers/encryptors found on Internet.+ }1 i2 r" N2 @: Q% m
It seeks the signature of BoundsChecker in SoftICE$ z) F" T* C' [9 r! B( |
- d9 ^# a, E; C# \2 @+ b mov ebp, 04243484Bh ; 'BCHK'
) {5 K" j4 ]1 o/ }$ V mov ax, 04h
' p% M1 D- _" @8 z, i int 3
* l/ u' P7 Z# M1 o cmp al,43 C) ^0 T. s7 L
jnz SoftICE_Detected
+ d2 J: Y0 p: n# i% }- L+ I6 s# }# L9 ]8 T" X
___________________________________________________________________________* {5 @0 F1 Q6 D4 V( [
1 T, \$ C% p' S( H$ J& d
Method 02
* w7 ^' ^! u% K8 U1 D=========; \2 d R3 e! n- }: `
: T' C* ^& j! F/ f- j+ PStill a method very much used (perhaps the most frequent one). It is used# ~* c) o9 Y1 G; y# {
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; x- c+ L* B/ Y4 W4 Uor execute SoftICE commands.../ t6 r) h8 o/ ?1 e
It is also used to crash SoftICE and to force it to execute any commands, j8 P' _9 b' j1 l+ S
(HBOOT...) :-(( : g# q5 V1 i, {* x0 D5 G
( h4 f r* ~3 o1 B2 A
Here is a quick description:6 {. b2 ^! O# M; C6 }
-AX = 0910h (Display string in SIce windows)
$ z3 {9 k. z" Q7 t4 i+ E% q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ G- M- P: M7 T/ J/ W-AX = 0912h (Get breakpoint infos)
" k9 k0 ^) Y3 T4 G* h6 h$ x3 i-AX = 0913h (Set Sice breakpoints)0 {! M1 ]2 R ^4 l
-AX = 0914h (Remove SIce breakoints)4 I2 {& l( u1 P0 L; k, y
7 p3 d$ h5 I6 p6 ` {' c
Each time you'll meet this trick, you'll see:3 r4 b# j9 y" E1 a l1 |/ Z
-SI = 4647h
6 j- Q l, d0 g. Z- f3 q-DI = 4A4Dh
) N( N1 _2 q4 t# S* e$ ^- I* DWhich are the 'magic values' used by SoftIce.1 f, o4 R' L2 T7 ]8 e J
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! |& H: H9 R3 Q4 @6 ]5 A- S6 P+ M/ R+ e; q' o
Here is one example from the file "Haspinst.exe" which is the dongle HASP1 x) U! W( E! [; G5 C: h6 ?! z
Envelope utility use to protect DOS applications:
* \/ }9 K$ S4 k' q+ K9 I
! j# }9 U; ^! `$ P
7 ^8 t9 ~! N4 N: t1 W1 W% \0 M1 Y8 W4C19:0095 MOV AX,0911 ; execute command.- b6 K" u! `+ a& T3 t
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 n0 w. h% P$ n. t% w! o
4C19:009A MOV SI,4647 ; 1st magic value.
: t: B4 R% X/ s4C19:009D MOV DI,4A4D ; 2nd magic value.
4 w9 t+ o3 l3 X0 ~* J8 i( P. a6 u4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 K+ v2 |' I# I, `; x: Y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 ?- ]5 @& |3 S' I9 Y
4C19:00A4 INC CX
" v! R( s# L, h9 V9 X& }4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: U- C! \0 _0 y* ^; K& ~4 S4 ?4C19:00A8 JB 0095 ; 6 different commands.$ E- p4 b! _( d% i
4C19:00AA JMP 0002 ; Bad_Guy jmp back.% ?) b! ?+ ?4 {# \# Y. T
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( ~( G+ D% O; b; t6 b% h
( i+ ~ {2 P! E4 [: t- U3 \The program will execute 6 different SIce commands located at ds:dx, which! G! V. Y6 T' V: p; ?9 ~* i, F3 C
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 `$ k7 K. e# D# o( W' C Z
$ l/ i) H' C% X1 U- R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.6 S1 V5 K5 w/ W% l* f1 ~9 G
___________________________________________________________________________6 R+ D: c$ }/ i6 m3 u
1 C$ R8 c: l P
- r6 j8 J0 A- s9 ?8 Y, sMethod 03
0 m3 ~2 I( f8 }=========
# t' F) {0 G; O" u9 o: T" ?; D6 y% N5 j8 ? n( b
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: l' s6 K1 S! |
(API Get entry point)+ R- s; |) {; I
0 |0 e, k# N; v+ h& q, |7 W7 Q! h' E/ I1 R6 l# V9 w
xor di,di" r) ?; `# x* a7 g
mov es,di
; \! ^( O0 _ d- x; e+ |' W- B' u mov ax, 1684h 7 A. F, ?( h+ j% @
mov bx, 0202h ; VxD ID of winice
; F! |% F9 X- R- p int 2Fh( g5 h: j) ?$ r
mov ax, es ; ES:DI -> VxD API entry point7 V7 s9 R9 c" I
add ax, di# V) o! V& L X. ^$ v) t
test ax,ax
^; x, m% {9 V2 d0 h jnz SoftICE_Detected
5 r+ \4 E8 E6 k8 q( w6 I! n' M! y' ?. O1 R6 x* I- X' E1 W
___________________________________________________________________________, @6 k- x/ ]: J& U5 ]. b- E; W
/ p( Q1 Z8 q- E
Method 04! H- @$ U" I6 N0 @. e: r) W
=========! x) a0 S* D3 R& M; k0 r; {' `6 ?
2 x, S' D9 N: L6 y) a% |1 ~Method identical to the preceding one except that it seeks the ID of SoftICE+ D6 d( i3 u; _# E+ |) ^6 [
GFX VxD.; i1 w8 B+ f) O* q& D* n7 g/ x6 l
# ~+ f" b" p) n. r8 Q! V% W# ?- p xor di,di2 Z) w7 Q. a! f( H# F0 L
mov es,di
+ E! \) A7 i4 D( L7 b7 U5 R* R mov ax, 1684h
+ }& w+ c7 x: O- i' u& D2 r7 B mov bx, 7a5Fh ; VxD ID of SIWVID
) R, ^6 m! B6 S7 F B4 w% u' z int 2fh
! W" Q1 z2 G8 V2 s mov ax, es ; ES:DI -> VxD API entry point
, O, s u+ J* q. a4 F' a add ax, di. {: I# ^ y' i& ?7 d
test ax,ax' v5 M9 Y0 Y+ ]# H* k/ T O# p
jnz SoftICE_Detected
, y" u$ d* F: f
' |1 Z. {! j* W, e( B& }2 i1 l. G, ^5 \__________________________________________________________________________
, n( a, O: y/ ?8 g6 l) |% ?! M4 ]; a! ]. j4 n
& w3 V4 a2 |9 a& h' ^/ `Method 05
$ Y2 e2 `* W R4 F0 h2 H=========* o, U" j& ~4 M& _) x2 n
- E$ s4 q; g* ~- U5 ^Method seeking the 'magic number' 0F386h returned (in ax) by all system9 }2 x' Z: [' `
debugger. It calls the int 41h, function 4Fh.
& U8 ~! x: A5 g0 s" T% Q' aThere are several alternatives. 0 z4 O* E7 ^! M `. J
1 j5 b( p3 a: F
The following one is the simplest:! D6 a0 z. F+ U( @& Q \" M6 z
- I' s0 o+ N3 W& @3 ` mov ax,4fh
' d5 F4 \7 H7 |! R, `5 i int 41h" d3 r( i* a+ G
cmp ax, 0F386) ^$ b0 }- L' E, i
jz SoftICE_detected+ p# Q; \ u* _' }
( f3 x5 m. h/ F k9 F9 ]
- t3 m* m2 N- H n" f. mNext method as well as the following one are 2 examples from Stone's
& |6 h4 ^/ m/ j"stn-wid.zip" (www.cracking.net):
* O# n. R. x1 U* `, i, L
( |& G) o1 \9 N1 I" O+ C: M$ ` mov bx, cs4 n3 {" U/ @6 z* X% p- u2 p
lea dx, int41handler2
" S3 X' t& \" d8 |% k xchg dx, es:[41h*4]
; Q* t5 p" e' r0 ^ xchg bx, es:[41h*4+2]
1 j- f3 j V/ a ?/ q# g6 O mov ax,4fh# K( W0 i( ~* v3 c/ I% m' G2 u1 o
int 41h' t6 l( B4 R/ o8 E4 C+ |
xchg dx, es:[41h*4]* R* x) @ m. |! O
xchg bx, es:[41h*4+2]
5 o6 e9 y0 ?% c( i cmp ax, 0f386h
1 Y: [+ |$ T5 ^7 p$ F jz SoftICE_detected
5 V" U6 i, b- k9 m0 _/ i. E
! X& x7 [& J" B* j7 v+ D2 _7 V" ^' Xint41handler2 PROC2 I( E8 x, ?, ^
iret, t6 {+ P# D6 Y- V2 A# a- N
int41handler2 ENDP
6 e) T. A# ^4 L. a5 y% K
: I ~7 g5 g6 D+ [; i8 e
6 e+ f9 H ^; N# y6 q_________________________________________________________________________0 `+ l4 r( F# |9 x% X v
6 Y) K0 a( q7 E7 N
# j' S7 K/ a$ a/ z& ~
Method 062 z- j6 d# L9 @
=========
( I1 R1 U4 ~0 n1 }! T' E
+ O; `5 \ k5 \! x7 Z
. \9 Q4 c) H) t8 s0 V1 T$ Y2nd method similar to the preceding one but more difficult to detect:
9 Z8 D/ Y* v7 d8 v' L5 M( @: C, N+ B0 L6 ^' b+ ^& B7 g
) w" g4 s% S" [! o, {, r
int41handler PROC
6 u) \. a b) k7 R; [ mov cl,al; i R$ J7 R* Z( W1 b
iret& j+ R( U$ S5 P. A* k% m4 @5 j& V
int41handler ENDP
W) n: P1 d b, u1 `: \6 d# N4 r2 d4 [' C" R( s/ M0 K
8 J: T+ } j7 B- \0 W$ B xor ax,ax
! Q& o5 Z. w9 v! X& n5 H( Y8 x mov es,ax
2 A) x1 E( k( B5 C9 f# | mov bx, cs0 a' C, C2 e( {8 |
lea dx, int41handler2 Y0 E0 C" Q( q" G4 i
xchg dx, es:[41h*4]
* A% i: ]4 @, i, v' } xchg bx, es:[41h*4+2]
$ V5 u" |- M: I2 a in al, 40h1 G! w7 N3 Z: ~5 @4 s
xor cx,cx
$ {8 e% x; M3 w int 41h {) N; Q, r) V/ j+ y6 e: k
xchg dx, es:[41h*4]" K8 A+ A5 k8 i5 L8 Y
xchg bx, es:[41h*4+2]
' ]3 l/ t; x! f) c- P# [ cmp cl,al
* m. ^ s) _; K9 h% T, x jnz SoftICE_detected6 o0 _3 `- s0 d6 S) }- H& `% N% w9 ~
6 v; C, ] u: ]) ]/ B_________________________________________________________________________6 H1 } k" P4 d$ O: I2 x2 ?
# i- G3 m' m B. H" h: ~Method 07, m8 u% }" y( E9 l
========= D1 t5 x1 ~. r( d- g8 j% c9 @) z
9 }8 j2 Z4 Q5 g' l0 ~5 C
Method of detection of the WinICE handler in the int68h (V86)
- {$ F6 i6 c7 y/ }! x5 i9 [/ v
/ F& N5 s/ V0 i9 L5 Q mov ah,43h+ r/ o v& E6 [) s5 O5 N
int 68h
& R; c+ [' |7 o& ?+ F# [3 L/ Y cmp ax,0F386h
$ e! o; {% t0 j6 n' W& h jz SoftICE_Detected7 Q2 G7 a% c0 S: l+ \
9 r, {4 i. i2 Y; K1 x* l. r1 B" i( B, D
. I2 f8 I( g. J' [1 {6 G) v8 |. _=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# Q7 w, J7 r' c8 {% I; I0 m- F
app like this:& G9 @5 R3 I! x/ |6 s! B
7 B9 H8 @- H$ |; r
BPX exec_int if ax==68; [, E/ a& U1 I) I
(function called is located at byte ptr [ebp+1Dh] and client eip is
1 s: ?& E- N8 t# Q: i. `# ` j located at [ebp+48h] for 32Bit apps)
5 w5 q! p1 M2 C# h8 x__________________________________________________________________________( R$ I: }" u$ ?0 F# y+ O7 R) [& A' j
T# ?8 m/ x5 ^8 x
! \7 j+ a! K! `; T7 CMethod 085 Y$ U, D; M. F; N% m9 l
=========- c2 V5 V% m& i0 M$ f) i6 \
+ j7 `. c/ ?* y7 uIt is not a method of detection of SoftICE but a possibility to crash the: H( s$ t8 W# i+ t
system by intercepting int 01h and int 03h and redirecting them to another
) i/ _: K: k. O/ Z, u. Uroutine.4 ~3 i, _1 v) l: h5 ^5 f- R9 w x
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 }9 w- |/ G" M2 N+ L$ t3 y
to the new routine to execute (hangs computer...)
8 T) }' Q6 r" k( x3 W. @4 o2 f6 W& \9 [- ^% O
mov ah, 25h# t* f" `1 P4 y0 G* r5 V$ Q% e
mov al, Int_Number (01h or 03h)
3 X, D; w( k4 C. _% {. p mov dx, offset New_Int_Routine
4 u+ v8 Z/ V- |5 m! X x int 21h2 h m1 }3 `# N
% | B& \8 C* E1 Q$ X+ Y__________________________________________________________________________
" O& U- \5 V+ h; P# P, Z/ \1 r8 B& [" X
Method 094 |& T0 z1 f5 i8 L( p" t6 O% B
=========0 U& D3 D" i! }# B# R3 p* m- m
# D9 k3 U2 r9 U" [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" X$ x3 i6 e8 [8 q2 [3 h
performed in ring0 (VxD or a ring3 app using the VxdCall).
& r2 R; l& |( bThe Get_DDB service is used to determine whether or not a VxD is installed/ |; H+ H3 ] c: S9 ]# l$ K0 X0 }
for the specified device and returns a Device Description Block (in ecx) for
$ S$ E7 d7 u: b6 E1 V3 ythat device if it is installed.9 ^0 C* }' C0 z6 } O) A
2 d, g: ~3 {" W) E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 N' d3 v- p" {0 r( p% |
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ ]3 u& B8 ?2 H `( R
VMMCall Get_DDB9 g6 |0 o9 [1 Q# w: P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& L* M& c, b3 Y$ F
8 g1 F5 g5 @ U$ ~ {* N
Note as well that you can easily detect this method with SoftICE:( ]; y: W6 Y5 @* j" U
bpx Get_DDB if ax==0202 || ax==7a5fh( N; Q) W6 A, l
& T& B8 H' O4 z7 T
__________________________________________________________________________
4 v. ^/ J& B6 V) m0 J' x' x- C- J# z0 E9 u( T5 \6 _
Method 10+ p& i3 m2 Y, x- |3 M
=========) g6 }# a* M$ m3 ^
0 o r, z6 S' ^) Q. s=>Disable or clear breakpoints before using this feature. DO NOT trace with: D& D& }0 z1 f+ t3 |( }
SoftICE while the option is enable!!
8 \1 \3 r% h8 z5 K
# @. ]7 Y8 g1 t9 K+ cThis trick is very efficient:9 Z. V; @. Z& v3 I
by checking the Debug Registers, you can detect if SoftICE is loaded/ V% b7 {! {6 z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# u7 u( b+ s) V! A
there are some memory breakpoints set (dr0 to dr3) simply by reading their
: B# x9 s& B7 _) |value (in ring0 only). Values can be manipulated and or changed as well; m/ v9 W+ A8 X
(clearing BPMs for instance)0 j; }% f$ T4 I5 o% H3 W; G
$ E! c( I6 o: Q( m7 v$ S" R__________________________________________________________________________
; S8 s6 q5 k' c. j9 b
5 w6 Q- K( G( EMethod 113 @/ U* O( M) k1 h2 A% ]
=========* t- B/ T9 p1 B U, ?+ u0 i
5 M0 S! B" _. v1 O4 [This method is most known as 'MeltICE' because it has been freely distributed+ l3 q$ E: P' [* H. {1 @7 B
via www.winfiles.com. However it was first used by NuMega people to allow* } V5 n3 r9 k! f# `; G
Symbol Loader to check if SoftICE was active or not (the code is located
- L: s6 Y- @& }. v' e, Vinside nmtrans.dll).; A1 ~$ W9 b5 B! |. x! r4 |
. a: ?, ^3 ]5 T) ?1 I# c: U$ l# s
The way it works is very simple:
/ q/ P5 Y) R6 @- @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- C/ m$ m+ e2 d; M1 [9 c
WinNT) with the CreateFileA API.+ `: Z- l% T" @8 p
; w. y4 }( ] v$ r1 @& o. B$ w
Here is a sample (checking for 'SICE'):+ q0 ?4 M2 G1 d) M) {5 X' Z7 M
9 e8 r0 z6 l4 K6 S& R9 Z% w) vBOOL IsSoftIce95Loaded()
- `& i- A/ C5 L. p/ }/ N6 C{) N, L1 o( l* h" n
HANDLE hFile; " ^4 R, G3 g, Z7 f5 Y
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) G/ j: j1 e4 w7 n9 Z
FILE_SHARE_READ | FILE_SHARE_WRITE,; a% A O/ G7 O
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! U: a7 X1 y4 ]( D
if( hFile != INVALID_HANDLE_VALUE ) l# \1 r! H' l
{
2 I& J6 t' e1 z' a/ Q CloseHandle(hFile);8 ~( L: q9 R( f h H
return TRUE;
7 z# h8 ]2 r- E3 a }
* q% A) ?' q: ^# v. Z6 J9 Z) _ return FALSE;
! W- x7 D. w4 J O# y}* r+ G* H, D1 T, Y. G7 i) F) s) L
$ v- \6 e4 _) bAlthough this trick calls the CreateFileA function, don't even expect to be
2 B) L( j0 w$ L6 L2 Xable to intercept it by installing a IFS hook: it will not work, no way!
' B, ?. q6 h+ v- \5 XIn fact, after the call to CreateFileA it will get through VWIN32 0x001F3 z& ?* n3 q) Z+ q b. u8 g% @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 E7 i3 ?+ O1 e5 N6 wand then browse the DDB list until it find the VxD and its DDB_Control_Proc) @( h2 ?8 t) {
field.. _3 w- O. x7 g6 ]7 d
In fact, its purpose is not to load/unload VxDs but only to send a % ?' ]3 h. A4 S$ v( t0 b3 L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: ~! z0 g. J% h. r3 V; i% j: uto the VxD Control_Dispatch proc (how the hell a shareware soft could try* Y, w" |; V4 u' s, H6 n
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 _4 p5 p+ I; |If the VxD is loaded, it will always clear eax and the Carry flag to allow
; t! Z6 ]5 N" p4 e8 F$ x* X+ Zits handle to be opened and then, will be detected.
! \* `! ^4 P, l! @+ ~You can check that simply by hooking Winice.exe control proc entry point: E, G8 _% c. f; V- \" ~4 |) Z' R, v
while running MeltICE.; Z/ q! \0 s6 @" s5 v: v' [
+ g6 c s- Z3 A
/ E2 d, o% c9 D5 h" ]" j5 E* V
00401067: push 00402025 ; \\.\SICE
9 |) s& O& J; H' B 0040106C: call CreateFileA
: s& F( V. H* y6 J1 l; V+ s# e! j2 ^ 00401071: cmp eax,-001
7 u' U y: x4 `, S) o: j 00401074: je 00401091) m4 C# M/ ^1 f$ Z7 z# d0 H! O. ^, }
( Q1 Q" ]9 f1 b0 u) M2 L$ T
- D( a5 E+ @3 V! i8 x
There could be hundreds of BPX you could use to detect this trick.9 ~0 u+ V# f& A6 L8 @: g9 b
-The most classical one is:+ }# L: G' s: k7 r7 f; |# \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: S! x6 [7 F; q( i, `0 }( Y$ U
*(esp->4+4)=='NTIC'
6 f) G6 H: v% E( a0 h" A" F6 g+ W; U, V
-The most exotic ones (could be very slooooow :-($ E/ H2 a: G4 Y- t2 I
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% ]; n) u5 D, f+ A+ Y ;will break 3 times :-(2 e/ O; z$ v7 K" i- F! G
# @' c2 S' M; y
-or (a bit) faster: 4 U" e& K2 l& P; W& ?0 G, `
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 f$ O& i& o7 B/ w2 Z6 z2 {6 G2 B$ Q; ~) w [8 F- n1 q$ d
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 h% y+ G' p4 n& S. W$ \ ;will break 3 times :-(
6 h+ ~$ m' e3 v# h2 x/ g* T
5 \4 A/ ^. e% @9 ], L* M8 u-Much faster:
0 q, C6 D: u) c' k' c z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') A4 r# ?- r4 U0 o3 _0 x1 M" D. N
$ `5 S9 W( J' j7 z; T1 x
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- V; s4 _! R" Q$ P, m3 i! I. I# Ufunction to do the same job:* X) N: ~8 H( P- B6 w6 U8 C4 R$ x8 p% o
! t( o2 _6 n8 k# {+ }, e% ] push 00 ; OF_READ, Q5 l3 [) J" [# n# m6 d
mov eax,[00656634] ; '\\.\SICE',0
0 u- R4 v, S* |9 A/ U6 q push eax d h+ p2 ^ E0 a% j( [1 _2 u
call KERNEL32!_lopen
" R0 s6 t& ^+ `6 ] inc eax
, B9 v! Z- n8 s' I/ D jnz 00650589 ; detected
& E; Y% c( K& O6 P$ a1 G push 00 ; OF_READ! e- F! n! I+ _
mov eax,[00656638] ; '\\.\SICE'
/ `+ m. \ B( B; w+ }) n* ` push eax7 i! `. X$ z7 G Z9 \/ ?& E6 J
call KERNEL32!_lopen, r6 l& M( V0 }% q8 m( f
inc eax( ]0 m% O+ p% r: X9 P! n
jz 006505ae ; not detected$ p( Y- K$ b* f( F
/ W0 y; p3 C/ v2 c1 L- Z
3 D W! @* \ T9 H- Z% j- J! r/ ]
__________________________________________________________________________6 o# N% j9 w; r: K& ]8 ^4 ~. Z
3 m# y# p2 p" Z7 d
Method 12 E( r- Y# B/ H
=========
8 E9 o; `; S) q& _" ?" P1 B4 _5 K! Z/ ~
This trick is similar to int41h/4fh Debugger installation check (code 05
4 @. I0 e$ w/ y C- G& 06) but very limited because it's only available for Win95/98 (not NT) Q3 K, [) |* I$ J/ p
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 j1 W& Y5 t4 i: w, w C7 c4 }! F( T1 d3 {5 Q
push 0000004fh ; function 4fh6 o4 I) m/ u- I$ n+ Y C. z
push 002a002ah ; high word specifies which VxD (VWIN32)
7 f" ?' `& F% L6 j, N& @ ; low word specifies which service
- C$ c- |7 D1 y (VWIN32_Int41Dispatch)3 s3 [ p4 A3 D$ ]
call Kernel32!ORD_001 ; VxdCall9 ?; Z3 T# g# v
cmp ax, 0f386h ; magic number returned by system debuggers
* T0 f M# f* T, N5 V jz SoftICE_detected
8 N- R. G( d/ L& M6 u6 D$ E3 W6 ?9 k: ^8 D* e
Here again, several ways to detect it:
" \6 ?3 B/ ^0 C2 f0 _/ t6 r- U+ g* {# b
BPINT 41 if ax==4f
. r& x3 C2 S; c$ h& d4 U, H6 w+ C3 c1 b ~
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& `8 N& m7 E. i. X) ~ i
( D6 B8 V" y5 R+ u& @ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 q$ Z2 i+ P: H
8 M$ K6 B0 O% \7 [ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 p# t! U8 ? B: Q( ?! [9 \3 C1 y/ F
__________________________________________________________________________4 Y# G) Z' n, ^1 Z. w& I) R+ q, E8 ]
8 i0 |, Z3 c+ c. SMethod 13
$ Z; ~1 i. h. A) p/ X+ W+ G=========
. U* {3 ]6 `9 d1 `. t- I
- r& N, B- V$ K$ E1 l- _7 K6 sNot a real method of detection, but a good way to know if SoftICE is
2 |) K+ ]7 w0 n7 U. I& `installed on a computer and to locate its installation directory.( a7 H1 Z t J$ o1 I
It is used by few softs which access the following registry keys (usually #2) :
3 k9 }9 C/ o6 D6 W" @# s9 E9 u% |! u- {2 S r: a/ D Y& L
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion N1 X1 D {5 _
\Uninstall\SoftICE7 x* u0 W" }, z9 N+ r" {
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' U) D: `6 @- G/ T4 Z! X) @
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 E/ D9 \$ m8 a; A
\App Paths\Loader32.Exe+ K) E" \9 w5 m$ {* W/ [
4 {& u: i2 a$ D7 M2 N' G6 ~. J) [
Note that some nasty apps could then erase all files from SoftICE directory
* u# W, M% G1 w, L v, g(I faced that once :-(: x5 p6 h' C) S' k; [# ~
6 I' ~. J# G, ^& t
Useful breakpoint to detect it:
4 H `4 q/ H' [6 v2 H. F4 w8 x0 t& ?& f8 V1 i/ o7 c
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 ~4 C+ y0 d5 l$ K5 Z! A
$ M. F) \4 w9 ^9 s, Q2 G# Z
__________________________________________________________________________4 t! S) h0 _& V" A! G
* w/ Z3 ^8 ^& C( k( O/ g" a2 S5 o! d" P$ W( ]2 K
Method 14
8 t' S, L4 o/ @7 E9 ^+ c=========
6 k8 {1 N/ |: }2 Z2 X
2 l& N6 l5 f* C" r9 BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! f+ {9 j3 I) Uis to determines whether a debugger is running on your system (ring0 only).
& E! M# q, O# m7 j3 U! q6 J. W) i. K
2 a) _5 Q7 n1 u' i% n% K: t& e) w VMMCall Test_Debug_Installed8 a0 Y3 j3 o" p6 p
je not_installed
) e+ q# n ]3 o, b
& u$ k1 E/ M- QThis service just checks a flag.
( c ~4 j1 M6 E; J W# p- `</PRE></TD></TR></TBODY></TABLE> |