<TABLE width=500>0 q. {9 {' `, f2 [; {9 r: L1 z3 U
<TBODY>1 p) l: n7 o& L$ V! R" q8 S( M
<TR>
. \- N& x7 j+ x* T<TD><PRE>Method 01 8 L2 n+ a: U+ g# F7 K. x
=========# ?8 F5 S9 @6 {3 H5 J7 s
/ e3 ^. {4 s& A! E( o/ J0 \
This method of detection of SoftICE (as well as the following one) is$ J3 N7 S& D2 w5 \3 n. K' \
used by the majority of packers/encryptors found on Internet. P& y. L# S! m4 E+ K- {; j
It seeks the signature of BoundsChecker in SoftICE# ` N9 Y" D" G6 M9 `
& h% I) P$ L# m. T& A) | mov ebp, 04243484Bh ; 'BCHK'
( f& `; M* C2 D) o# @: z mov ax, 04h
, N8 I8 J8 j5 V9 ]+ x9 b" M) v int 3 8 k& p, e( r4 Y# Q- D D2 b& _
cmp al,43 l7 h0 [; Q5 O0 U
jnz SoftICE_Detected
( ]9 \/ m" f8 x, Z. M
6 N! M6 g! v: X! `' `' c' `___________________________________________________________________________7 V, D' e, a2 v! k0 }& ~
# c+ |' C$ K0 W) T* d) R( ?) G$ _
Method 02
0 c) U% m, m/ z. z# o=========# R6 x S+ T' ~' w* A5 F
+ @7 z I7 X4 d( [Still a method very much used (perhaps the most frequent one). It is used
' n o5 T! ` Q- h9 v$ u) ?to get SoftICE 'Back Door commands' which gives infos on Breakpoints, F" e0 L9 x0 r* H
or execute SoftICE commands...
$ l0 i0 e# z, g6 XIt is also used to crash SoftICE and to force it to execute any commands5 q4 V7 p& [' t4 ]' @5 r5 Y1 n S
(HBOOT...) :-(( , u( L& V" |" S' W
' T8 }2 W; x$ _$ \5 L! f fHere is a quick description:, b% ?- K" z; V" [; F
-AX = 0910h (Display string in SIce windows): v7 M9 x: C" ?' G6 [- {1 x
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
a# [7 Y/ Z6 O6 f0 |-AX = 0912h (Get breakpoint infos)+ i$ N& p2 G2 |& D+ d* |
-AX = 0913h (Set Sice breakpoints)
) o" f8 U4 `5 D0 c4 O-AX = 0914h (Remove SIce breakoints)
- X0 X! t& _% I* F0 t
) b0 k3 O, K+ VEach time you'll meet this trick, you'll see:8 c2 f" B$ s) \9 }% W* ^: ~
-SI = 4647h: x% |3 _) S3 r
-DI = 4A4Dh
7 D8 _' M! J; z9 l; mWhich are the 'magic values' used by SoftIce.) f9 w8 W- f# i( H
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 W) W* q" _* M
. X. B- \! w4 Q" t) x! q# O% k
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! [& r" x( f1 s# i1 W; ~Envelope utility use to protect DOS applications:0 ^( ]% u% j9 d+ \ S; P
# \; G1 w" |* v: [! _* z
& q: W7 c# o9 ` X$ w4C19:0095 MOV AX,0911 ; execute command.
. r4 [/ r- {% X* F1 C6 f4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* G- q* ?1 L" Z+ p+ r4C19:009A MOV SI,4647 ; 1st magic value.
8 z, h; }+ w6 q& _! a' j4C19:009D MOV DI,4A4D ; 2nd magic value.& z: e, K$ }, t2 l b
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, P# f' i$ O, o+ Y0 P6 l4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 H" u/ Q8 ?( H N$ |" O/ y4C19:00A4 INC CX
R! D' v7 r) \4 y% b5 D4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 e, i- [' Z$ S$ }; [& \4C19:00A8 JB 0095 ; 6 different commands.7 S/ n g: _) ?/ @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.0 S' a) l9 r3 e. m; S
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! j! g0 b3 F, ^& Q$ u. q* ~5 [- W
8 l- y3 l- |# _, P0 rThe program will execute 6 different SIce commands located at ds:dx, which
$ N, T4 O- g2 j- A7 i$ Ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& {# Z: j% z3 t L. M7 J
: z8 u" u! ]( T+ e! k! U+ l
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 K% C4 T u# o6 ^0 n- W
___________________________________________________________________________; N6 m! `( m& B# q3 j) ]! E+ f* j! w) p
/ M8 {$ Y: Z1 C; B
: K+ L0 L& r+ P& ZMethod 03/ { @' q2 R( U ]" q: ]
=========
/ i9 U& {% N/ d( A: O2 E
1 m4 s# _- o0 E. ]Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' u: q) J7 R6 X! o# h' b
(API Get entry point)
1 b& a% R* { a
! x" ? P6 q" F" g8 J8 h$ Q. M; n& n" O$ D- E
xor di,di
& k6 N* k* j1 T! b R, G% W, M$ e mov es,di
2 t/ j6 v' y" s mov ax, 1684h
9 s2 w5 \* I& |, O3 B( u3 J) [ mov bx, 0202h ; VxD ID of winice- `( l w. ^) g6 ?( D" e
int 2Fh
X0 T, B, C- D& V mov ax, es ; ES:DI -> VxD API entry point F0 t3 W3 r: k9 n8 q
add ax, di9 u& d- Z# u% k* ]
test ax,ax
# \% P7 s6 s. X# N1 B. p jnz SoftICE_Detected
' n/ j2 l5 I1 \
; e) ? W5 |0 H" Y- u) q% V( P. ~___________________________________________________________________________, H/ n7 M8 |' `
5 Z& i3 w3 i2 p" E, O2 z/ iMethod 044 v* R* N- ?9 n
=========
+ k. \0 n( Q9 z
: ]+ `. L1 T* s6 oMethod identical to the preceding one except that it seeks the ID of SoftICE
9 T7 ^3 M' F9 @GFX VxD.1 B, k) b% G$ n: C$ s2 \( v4 y
7 P' F# ^, R( V! R
xor di,di
* }3 K& O: E& O* n8 L0 g9 J: F. n mov es,di1 ^- A. H2 k& n& l
mov ax, 1684h $ d4 [3 {$ _! L" N+ d4 ?+ F2 }
mov bx, 7a5Fh ; VxD ID of SIWVID
5 H1 j2 e& T/ |" Q' Y) E) s int 2fh& C+ R5 n2 t; ]% Z# D1 g
mov ax, es ; ES:DI -> VxD API entry point
( m% n8 o; ~1 {1 n9 x$ s add ax, di
. @! m9 D# k) T3 s; h H test ax,ax
' s1 z: l' B" e- `! i' T" } jnz SoftICE_Detected0 Q" {5 c) n/ m! l# A2 ^4 ?4 C, |
7 t6 p" V9 I- W4 M& V9 a5 H- L( E1 E
__________________________________________________________________________ ]7 Y0 X6 J9 f! y
, r; v2 U: D& p: t
4 J: A( m9 l: M7 m' w A' X
Method 05
- X" Z5 v0 W. L ?0 V=========& [, E8 z& b* L3 I5 _' z+ z
G- p7 O0 m9 Z1 I1 ]& z0 ^8 b Y, Y
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 j, z Y/ {4 s4 n8 P% r1 ]8 I" Vdebugger. It calls the int 41h, function 4Fh. y/ b, N* a! ]% _! f: f q
There are several alternatives. 5 i( D: D' V4 S, l) [
; f) |7 j% T$ w i- ?
The following one is the simplest:
) e8 X! e. u4 e7 u; |6 N
\2 s: N, U; g6 V4 e1 p mov ax,4fh9 y+ u4 Q3 {% \( U \
int 41h" \/ Q9 E3 a0 y) _9 X
cmp ax, 0F386
/ c* F0 D2 u% t' v4 n6 L; u jz SoftICE_detected
" L8 T; K) ]/ Z# P5 R
2 D- W- y6 p6 r1 Z8 g5 e$ }# g' a+ t- h
Next method as well as the following one are 2 examples from Stone's
% E2 A& L( K9 |. {8 t/ j"stn-wid.zip" (www.cracking.net):
9 U: Q6 U$ q) |; B. k" Y/ e& b: s
' G7 ~% p& F0 j mov bx, cs9 [/ D+ ?; |$ W! ]% k9 ^
lea dx, int41handler2% C. x1 D7 q- e0 K
xchg dx, es:[41h*4]$ s! l7 P* L# }
xchg bx, es:[41h*4+2]
* T4 I! ^/ r" Q3 R0 @( N# l mov ax,4fh
6 V( g K( j! u* U% c int 41h* u$ @* ~1 N% `- u4 ?
xchg dx, es:[41h*4]
# P' Y7 b3 y, c2 Q7 T9 v xchg bx, es:[41h*4+2]
0 m) P' g) M; I4 R# t, \9 S% v cmp ax, 0f386h
9 j6 h7 j1 a7 {2 f, k8 y* v jz SoftICE_detected3 w" L0 s! Z0 K' M0 _; t
' i( j* F b# a# n( L3 B& gint41handler2 PROC
# u8 |) u* w) T4 F) j iret1 Z3 M- ]$ Z5 s, h& y
int41handler2 ENDP: n0 ~* ^. K5 I7 t" ]: p- O
- s6 ^5 d; H8 U6 z
& H) q* I, |' z" o: k
_________________________________________________________________________
3 E( f( X/ d, [, F. U
% J* E, ^, O( k9 J8 i
9 k- V% _: Q. d. f( ]$ jMethod 067 i4 g2 m& v( i! B5 S: M/ _: Y# j
=========
, Z8 Q+ T" G/ t; V9 ^/ M" p& c; q( {8 ^! C% k" n1 ~
9 R7 [( M- _4 w! R6 y
2nd method similar to the preceding one but more difficult to detect:& n4 J- T+ M, B- ?3 V& n& I
! H& J8 N( l) E2 ?5 R' Z9 N8 l. A$ q; K9 k) g- Y Q1 K% V
int41handler PROC
( d& y) M, n f. I0 Q: ` mov cl,al
; [# u* t; R/ ^7 {8 Q$ h) { iret
- A3 Q# v* R7 F' Aint41handler ENDP
8 d4 Q, j; |0 K! Z
3 R2 ~0 T) e/ X7 C$ ^" g* |
$ j$ s' i0 l3 Z3 v xor ax,ax. _; m- B! T/ @3 I* K/ F5 u
mov es,ax" O9 e0 @- A6 E V$ ~& Q/ U+ C
mov bx, cs
) Q+ P7 S0 \4 L# T/ I lea dx, int41handler9 p/ t: a* u2 u) a
xchg dx, es:[41h*4]4 \4 ~4 W3 p+ H. A5 N; M/ W
xchg bx, es:[41h*4+2]
+ V# ]+ {; y0 T; k in al, 40h- f2 `9 s% \8 w% T6 J
xor cx,cx1 [6 G. J% r6 t3 y+ N
int 41h
3 S* F! W- z) n+ q q2 h xchg dx, es:[41h*4]
9 B- F0 Q3 I5 O" h3 t xchg bx, es:[41h*4+2]
5 k7 M& [9 S3 [ _* I$ |1 C cmp cl,al; {6 X; V" ~! h& {
jnz SoftICE_detected
; a ]. u- y) U% ]4 [7 p8 U3 v/ Q8 G& q* @+ O
_________________________________________________________________________
! o- _6 m( V& g t# }6 e) V, g' ?5 O
Method 077 N. N3 b1 ~ G/ t- x
=========
% w4 `6 W6 Q ]9 x
: w- |! g" c/ A6 D |3 rMethod of detection of the WinICE handler in the int68h (V86)
% V3 h9 u" r4 A1 |0 n$ y. D
% K, Z/ e) T; Y& \8 n2 ?% f' | mov ah,43h- P9 R& I1 ]8 h+ e9 N; k4 g* r( @1 U6 k
int 68h
* Z4 D S9 Y; l( H3 `: q# L6 z6 i u cmp ax,0F386h
$ Y( W/ B; g# \4 O9 o. [7 J jz SoftICE_Detected, f3 [" k9 Z8 b0 G
% }4 h, Y0 |7 ^* {
. e: G3 D2 W8 J9 H" }+ b=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' i$ |) S, F; y" J
app like this:7 ?3 Q8 k" N U/ h
1 @6 N7 V2 l, I0 @$ C" w BPX exec_int if ax==68
: Y2 h, K$ H; W& D (function called is located at byte ptr [ebp+1Dh] and client eip is
" L' T! _4 N# @2 f. t" ? located at [ebp+48h] for 32Bit apps)
7 i+ l0 \5 c/ x3 s__________________________________________________________________________; q9 k% E) k, z2 }
$ ^3 O+ N6 ` ]
2 B3 z0 c/ _6 `0 Q0 o& ?% G0 gMethod 08
; v$ I8 u; p' ^. f. Q=========
1 w& ?/ K6 f% h4 A7 }- L
. s) e/ W# C6 r( u* I$ ZIt is not a method of detection of SoftICE but a possibility to crash the
. P( E; Y* V! e( M5 f e1 vsystem by intercepting int 01h and int 03h and redirecting them to another+ Y; O: u/ J- g
routine.
$ p4 R) t6 k4 s$ x) \It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ e O8 w) J+ ?6 B2 g) {
to the new routine to execute (hangs computer...)- [5 }$ D: P* [* L% m
& X( P( k8 z+ z mov ah, 25h
- m4 s- o0 T' M5 P mov al, Int_Number (01h or 03h)
1 [$ i# ^: ~3 `1 [& [6 _ mov dx, offset New_Int_Routine
2 r8 x3 A# X% G int 21h& m8 t4 h! E/ u4 C4 [* e
1 H" [9 h# R6 @$ {1 B* F; d__________________________________________________________________________
4 ]* y1 w# N: X( i5 R& m" ^1 D3 U* h b( F$ R
Method 09
! R7 f1 v8 R9 T) p& {+ Y4 v" |=========" k5 Y6 Y2 Z* e, w! f- [
\2 U8 G) o. `+ Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 H0 R2 |$ c" @; jperformed in ring0 (VxD or a ring3 app using the VxdCall).2 k. V* z5 G$ j
The Get_DDB service is used to determine whether or not a VxD is installed8 v# P ]4 |6 G0 E0 q( @6 a
for the specified device and returns a Device Description Block (in ecx) for
4 n t# T4 @& Y- Y7 p0 {5 i, Nthat device if it is installed.1 p3 \9 {* o* t9 G! n. c% x/ f G- ~& l
/ t/ H- E; Y- H( u3 k$ @9 q# B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" m* O0 B7 i5 d1 b1 o mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 T. Z7 v) k+ N. W! c% s
VMMCall Get_DDB
; ]/ q7 z' q7 h; F mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. ~# R. }4 D. Y8 u( y% x$ e: w, f. V O. f0 I
Note as well that you can easily detect this method with SoftICE:' a0 D$ \* U: k3 ^6 O, u1 |! p+ K1 c
bpx Get_DDB if ax==0202 || ax==7a5fh" Z9 l7 A. V, h; _
2 w: z9 A6 [, u/ P9 T) ]__________________________________________________________________________
/ {! w. \, z# B% X$ P2 t' }- J4 K' ?3 V: _9 Q+ S5 i1 Q+ A
Method 103 i' p- V7 X9 g J+ M$ u; h! w
=========. C+ x5 y6 s, c8 ~: I$ }
6 `4 H+ [* k' K2 p' ?# f=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 N! n2 V6 Z7 y& P; ^. Z! Y! D2 \, ` SoftICE while the option is enable!!5 F0 X% [' R5 H$ c1 F( L- P) Z
9 J% j0 L+ x4 z( C9 k! OThis trick is very efficient:
; P5 b2 E4 Z9 r2 R6 `by checking the Debug Registers, you can detect if SoftICE is loaded" N3 h Y# A2 I' ^
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" e3 ~9 `. l8 t5 ?1 |* h
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! j z' K- \( @& K7 j" M: Q% ~value (in ring0 only). Values can be manipulated and or changed as well! {1 v% g A4 R9 b1 \1 u' [
(clearing BPMs for instance)
& X* [: u! C) _
4 E* V+ H v; ~5 ___________________________________________________________________________
$ q6 H. V& X4 ^9 h$ n+ R0 I2 |" N3 g% j1 J
Method 116 q2 @9 w% A6 E( x# \
=========4 R/ F* G) M3 F; Z2 W" v0 k. B6 ~
) `0 T8 O' R5 c3 o& `4 D& Q
This method is most known as 'MeltICE' because it has been freely distributed' D/ h4 Y+ N4 }' n; ]5 U
via www.winfiles.com. However it was first used by NuMega people to allow
|. g6 w3 D1 y& E2 Z9 fSymbol Loader to check if SoftICE was active or not (the code is located: A: P) |, T/ }, w8 x) Y+ `0 R
inside nmtrans.dll).
& ~* J# s- W$ a. D/ Y; U! ]" g
" o$ {" t( ~( z$ A# z& gThe way it works is very simple:, F" A/ g5 {4 \* E! f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 f: W3 q7 r" O# _( qWinNT) with the CreateFileA API.6 k& o9 p# M! B7 y2 J y2 t. R
( F# z" X9 J# UHere is a sample (checking for 'SICE'):! P) v4 T0 A/ L9 y2 s0 _! t
6 Y0 f8 F4 I& r3 v ^; F VBOOL IsSoftIce95Loaded()
1 U+ o3 N0 F; D& p: J{2 \! i$ f d2 Q" o' g
HANDLE hFile; ' [' R' u8 H6 |' J9 R: L' b O0 {
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; h- o' E4 e1 T: K8 g5 Q# Z# r, T
FILE_SHARE_READ | FILE_SHARE_WRITE,
( l2 t9 u5 J, B% z' C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 H* z9 I# W: X' K! \6 J if( hFile != INVALID_HANDLE_VALUE )' W S4 h8 W. r" s. B6 U
{
2 ]! S7 e4 S3 U+ t" h! x D CloseHandle(hFile);
+ z# @2 B6 V' o' r$ v+ |: `- R2 u return TRUE;% H+ ]8 R/ Y- v) n m
}
: d! B0 `1 ]9 ]0 n, ]0 X( N0 m return FALSE;! r, c; P$ K9 H! I. \$ a
}$ a) e, Y( X9 e# m$ ], {) }
9 t5 B& A6 Y( x- @Although this trick calls the CreateFileA function, don't even expect to be* a ]* y% P% z7 }
able to intercept it by installing a IFS hook: it will not work, no way!
/ p# R) d8 P nIn fact, after the call to CreateFileA it will get through VWIN32 0x001F$ t/ X1 ]/ J# l' \% f
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% E5 L0 n# s7 Vand then browse the DDB list until it find the VxD and its DDB_Control_Proc- c8 f _6 a3 B: X
field.; B4 x, B3 w5 \* t5 _* j
In fact, its purpose is not to load/unload VxDs but only to send a . p% }2 ~8 L M2 V5 K: v% q/ w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ Y' ^& D$ N5 D4 x( {; D: O: |
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 ~6 r' {1 ~+ c5 B0 M4 v" [& @& y' `
to load/unload a non-dynamically loadable driver such as SoftICE ;-)., t6 S% b; ]# e
If the VxD is loaded, it will always clear eax and the Carry flag to allow
, t, [! l6 n! t$ _9 yits handle to be opened and then, will be detected./ n# ?+ O* j2 F6 s
You can check that simply by hooking Winice.exe control proc entry point
& J# Z2 l% R4 B% L# l/ zwhile running MeltICE.
: y! K- k4 C$ }; A l T6 B1 E1 `( c- s; b, [
$ _, ~* @' O9 C; I 00401067: push 00402025 ; \\.\SICE
# h. ?1 s9 z" k6 I* w8 ?% r8 Q 0040106C: call CreateFileA
# Z# W, k# c" f2 B$ r# ~' }& \$ z 00401071: cmp eax,-0019 L0 E4 R' `4 R& ], Z
00401074: je 00401091
y4 M' o2 ]; b: ?- [! V8 L2 @+ ]& Y2 R G) o" [9 a. _8 o; }
+ h% A; i B5 G, l
There could be hundreds of BPX you could use to detect this trick.
& v! ^: b. }" ?6 x4 ]+ K2 Y-The most classical one is:
/ ?; T! C, G+ ]" _' n0 T BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 G, T" C" y; {6 F7 k! Q) @ *(esp->4+4)=='NTIC'8 ~2 H1 @+ P. Z( Q
4 f+ M% \0 _7 j
-The most exotic ones (could be very slooooow :-(
4 O6 n, b7 A1 a7 H" P: B' [9 y( ] BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 m1 ?. i! j" W( `: W$ D& G0 N* ?
;will break 3 times :-(2 i1 i$ T4 s/ O- g6 Y
0 p. z) ?, {0 d a; ]) M( n' V
-or (a bit) faster: + @# M; N3 Q- ]2 A, v" p
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' f" H' R, B# b8 ?, i% f; \5 b: i u8 U0 J4 O4 i
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : e. J6 F# W/ g; c+ g. `
;will break 3 times :-(: m) Y9 \$ S' }' R/ _3 N0 {
# Y: V; u4 s% Y8 d: i; I$ F
-Much faster:4 a% j! L2 X* P) U3 E# b, D5 s* i
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 p( X$ W) c- s& F8 a3 _2 q
. t: y* j9 _7 ~6 p" C! rNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 e0 L4 m& E7 `' j6 }- K, a, a3 Pfunction to do the same job:9 U, B# X8 u f2 F
/ G* [8 ^7 Y9 r
push 00 ; OF_READ
& y$ s; L7 A* r1 h* G9 A# N+ } mov eax,[00656634] ; '\\.\SICE',0, [* K* c2 x% {: M: u( c) P
push eax s b6 j( D+ ~0 A9 A! \ r
call KERNEL32!_lopen
7 A" A, V+ j4 ?' @ inc eax% u x! w5 T* R$ x ?
jnz 00650589 ; detected2 t" J2 K. V8 [4 w/ x
push 00 ; OF_READ
/ \9 [- I, T4 N1 C* a0 o- i8 J) w mov eax,[00656638] ; '\\.\SICE'# p$ l" C4 g8 t+ ~3 K: @
push eax4 w( U1 m6 |4 B- {. b
call KERNEL32!_lopen- `; n4 }# A8 {+ i/ e' `
inc eax
2 u9 u5 K, q- H. o) z jz 006505ae ; not detected/ y! P% c+ O' ^% u- {6 x- H. \
- ?$ C; V" _7 T' y X) ^1 Z" B
# ]& {/ \1 H: x4 O- ^" e__________________________________________________________________________0 ]( |! l1 y. p, H: |5 `8 v! N8 C' d
: U1 y! r# `/ c* VMethod 12* G2 z6 X7 Z/ L( k* R) q
=========* c+ S E" K6 p/ A: ?
. ], j- d+ s' U/ e5 N: Y
This trick is similar to int41h/4fh Debugger installation check (code 05
+ y3 L4 v+ f! D3 e/ x: {% X& 06) but very limited because it's only available for Win95/98 (not NT)5 N# h2 \' T3 g
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, Y: n6 _- j2 f8 V' u; n$ z+ a) O- Y" Q' v# v; M( p
push 0000004fh ; function 4fh4 } _6 J+ C* d9 t. h3 ^
push 002a002ah ; high word specifies which VxD (VWIN32)
: o- m% ~1 d i o* g ; low word specifies which service
$ a" h9 |+ h* P3 A (VWIN32_Int41Dispatch)
' u9 N2 n2 ^) ~ F call Kernel32!ORD_001 ; VxdCall
6 T G' w# c2 S8 }3 m1 K cmp ax, 0f386h ; magic number returned by system debuggers( Q: r0 T1 U5 X
jz SoftICE_detected
! g2 J+ K4 t4 Z& T( G) s+ G0 t2 n# J. k- G/ B* U
Here again, several ways to detect it:: h( `9 \: M5 M# a
) e0 b V9 o4 \& R- i9 b. j: G BPINT 41 if ax==4f
1 l( I2 S% ^. o3 V1 X8 x+ f1 e1 X0 e) p: G& o
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 q2 U3 |% a* f0 [
% t ~8 d4 v& H& Y5 z: |) O BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 _3 s z {# H2 s3 @5 q, n: S7 W& q* O9 C
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!* n" M, s3 k* u0 X! h4 |! i- I* T* X
1 D! c( K0 o/ u! x8 x
__________________________________________________________________________
`& P- e- K! J( @! `* i
, d; [& V% X$ ]% \7 AMethod 135 i1 ~4 A! h$ L% `) q3 e% G$ z
=========
* F, {; L7 N2 Z$ S8 {/ Z4 n4 T, S) u! j8 E, b4 C2 \
Not a real method of detection, but a good way to know if SoftICE is
" E) ]) ^/ E4 B; ?4 \9 X3 tinstalled on a computer and to locate its installation directory.# S2 u( W3 s% G- A% n9 m
It is used by few softs which access the following registry keys (usually #2) :
" h3 D, {# X( \* `' N# E
* B5 ~3 Q* i% r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- B$ D) L( w) w$ x# K: t
\Uninstall\SoftICE# ^# u ~* n$ H; F) S& t& _ s* G; `5 q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& ?2 J% P9 a* c C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 N, t7 p3 `/ B( E+ w! A\App Paths\Loader32.Exe
2 C+ i+ g; |; R
9 |) K/ m# m) J7 j; X9 Y
- k! R- P. U r8 a0 l% VNote that some nasty apps could then erase all files from SoftICE directory
' o4 H. p9 f+ H- Z5 J' y* E(I faced that once :-(
& `1 x7 W" d" ]" T
2 i1 h; w1 u# `( A9 t6 R; Z O0 WUseful breakpoint to detect it:
; B3 W. `, ?1 t8 v) l+ V2 t* z
4 ]* t- Z$ u! x. B% y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; H9 W) `" l8 j0 ^" o `9 j( J
. Y+ ^8 h: ]7 X* r3 t8 J/ Q! {# g__________________________________________________________________________" Z/ H: e" a( f7 s9 U
/ p+ a/ M/ T* b1 N7 K1 S2 C0 Z
, \/ n9 E" W- y) [Method 14 9 g: A- T9 ?2 k* I
=========( q0 {4 x- j/ g" S
) _; z1 {. ]2 E; O& v4 Q( z' z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: f" e; y: A: ?- d
is to determines whether a debugger is running on your system (ring0 only).0 k `+ y/ T7 J T/ R
2 T* ?1 m4 H# Y: y" ?: Y1 j. \
VMMCall Test_Debug_Installed3 W: m' z2 c) J6 M. m+ h1 C* C, [
je not_installed+ T+ r5 D. t: k* q2 P% T/ f
# _+ J! G6 U2 C7 `% ZThis service just checks a flag. P7 x8 u: g9 H% I7 d
</PRE></TD></TR></TBODY></TABLE> |