<TABLE width=500>
. b9 H9 ]8 @" m% ~: T<TBODY>8 e4 F |% T2 k
<TR>
& D0 ~6 h5 r& q/ m7 l+ v3 ?* L<TD><PRE>Method 01 " l# P4 K( T0 {1 k0 x
=========+ A! _# W# f0 x Z) p
4 y) m1 I9 Q i# V9 h8 t
This method of detection of SoftICE (as well as the following one) is
/ [: b' a, C7 K6 q6 J! pused by the majority of packers/encryptors found on Internet.
3 E3 ~* f8 |* f# f1 G: jIt seeks the signature of BoundsChecker in SoftICE) D5 B+ @3 o9 l# a
, X" Y8 s1 H0 S+ u2 X) C: `" h/ Y* T mov ebp, 04243484Bh ; 'BCHK'/ P5 W) E# p8 ?% u0 l, a! B1 [
mov ax, 04h, u) R/ H% Z! X0 Q6 x# x" j
int 3
) k _% z; n. U" P; {' Y& [ cmp al,4
, q( T. M" t; k% T& D" M jnz SoftICE_Detected( o1 [) A* W# j. u5 I
% [5 M- i' E3 Z+ J% V
___________________________________________________________________________
3 L' q- d; r( `% G! u: y
% A: ~4 K& @8 o: L) RMethod 02
3 n' \5 d4 ?/ O( R( b. J; Z=========
# q1 l* U4 K( x# U; z3 @. P- p H6 R
Still a method very much used (perhaps the most frequent one). It is used, c* B8 r/ n; T% Y% [! f: Z4 V
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! S( W' c' S: f7 F# nor execute SoftICE commands...
! P4 j/ K! ~( `/ ^It is also used to crash SoftICE and to force it to execute any commands
' i. {9 z' E6 k7 |(HBOOT...) :-((
! a/ p0 c }1 I8 ]. }$ P f# D7 |) x
Here is a quick description:2 q/ p' d# A/ T$ B5 _6 z; @
-AX = 0910h (Display string in SIce windows)( j5 ~; C2 C2 |0 Y8 f. j
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ ]$ N" K6 x2 v) O-AX = 0912h (Get breakpoint infos)
4 d7 C- {, z" k2 i5 g-AX = 0913h (Set Sice breakpoints)
- v0 C4 ^* ?% Z* L/ Y, y7 D-AX = 0914h (Remove SIce breakoints)
2 G" x- l! G" X9 _2 I
" J( g. p( }) d; ~5 ~Each time you'll meet this trick, you'll see:' L$ U" Y- Z8 z: b( X5 ~% a
-SI = 4647h
( a) H! z* @/ W* b% f) [5 d( T-DI = 4A4Dh9 ?4 G/ V4 J2 K/ s: Z5 K
Which are the 'magic values' used by SoftIce.
: |1 V Y) i2 g4 s; xFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* G' h$ m. i% A& q. G3 L c: z" R. k2 L5 a6 W" i
Here is one example from the file "Haspinst.exe" which is the dongle HASP- d% r4 W" [: d$ i8 u
Envelope utility use to protect DOS applications:4 m0 {8 t8 n* `+ e. X1 {
6 {) u$ ?) t8 `7 I3 O+ }5 w$ R" H- b4 G, S$ _+ n. [7 p
4C19:0095 MOV AX,0911 ; execute command.9 ^2 g& O# M4 l. c% j: a
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). N* o: N1 D1 a3 {, Y! @ I( ]
4C19:009A MOV SI,4647 ; 1st magic value.! a6 l/ C0 f) I i9 Y
4C19:009D MOV DI,4A4D ; 2nd magic value.
0 h2 R; e D0 h2 h6 J' g2 u4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) P3 k5 Z; B. n. [) } t
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
' {) O4 v: J# V) |% w d2 o; \1 V4C19:00A4 INC CX
3 y% J" V( f6 o% g m/ n: J& n3 Z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) ^2 n* O5 m8 ?0 [4 |
4C19:00A8 JB 0095 ; 6 different commands.
" U% f1 O) g* Q" k- B; C4C19:00AA JMP 0002 ; Bad_Guy jmp back., w; Z% r/ K* R" Q; {/ z: C; g* w
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 e+ z" W) w9 r T1 J! a+ |9 U: u9 b& l9 O) v
The program will execute 6 different SIce commands located at ds:dx, which
, I6 M& A2 P% S- f; rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! s1 @0 V$ R# n) R) D+ u J$ F4 @' k5 I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ l# A' x; F( C+ s% B, ]$ j
___________________________________________________________________________
$ H2 s: Q( w8 j. } r3 i7 @) U- m2 n: N( ?$ N9 x; ?- r T
! ]7 F' w" }* D0 N- K2 T. bMethod 03
7 {/ C6 v1 j' X3 d6 A# l9 [=========4 j) | T( w' s" _' G% F6 G
3 _) M! r* O! H9 H* R0 s* l4 C' gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, l! |5 H) W2 V) r z* S
(API Get entry point)
# F# @; R8 w3 B4 X4 C
" E' @& Y9 O) v v3 C9 @
% h; U: V7 O! t( v" f xor di,di
- L5 s$ I- _' w" ` mov es,di8 ~0 o! `( |2 @7 u' i
mov ax, 1684h
2 P, H. ^4 H2 W" t4 E& ?5 s& O. v1 t mov bx, 0202h ; VxD ID of winice4 G. r- G- t0 c5 E' f
int 2Fh
- y; O& s- w9 q* K* q mov ax, es ; ES:DI -> VxD API entry point2 {. W$ k# |( u2 |
add ax, di
) r5 x" m# o9 E+ E, Y test ax,ax
& S# K+ Z- A! O jnz SoftICE_Detected1 _% k' ?- ]$ p- j3 [, m- z
8 s$ h0 k2 q4 I___________________________________________________________________________
; l% Q1 w3 C* `! k
/ W: y. O% v7 z4 d5 @- I, b# ]Method 041 F& ?) |& m% `/ ?: K8 ]. u. [
=========
0 k0 \7 d$ E& Y! i
; I1 ]( }# [1 PMethod identical to the preceding one except that it seeks the ID of SoftICE% i$ w* a* h/ \' Z$ P2 L. a |
GFX VxD.6 s, T" G# Y% ?6 t
3 Q3 g1 [, t- {- v/ U6 ^- \% M; r xor di,di* j d( _3 t7 [2 r
mov es,di
* J" O1 h9 @0 d7 h" ~7 Y* X mov ax, 1684h
4 t2 t+ [ e1 ~& R9 Z) ?0 d mov bx, 7a5Fh ; VxD ID of SIWVID
; J( J+ s" _; Z( E O }& t3 H0 b int 2fh
, e: |0 K9 q9 z8 O5 J+ f mov ax, es ; ES:DI -> VxD API entry point y5 Y5 c) o8 G9 L0 ]
add ax, di( R7 @$ X% E+ x/ O! y2 z. o: |
test ax,ax* B; C: U) x* @ J
jnz SoftICE_Detected
: X5 A7 s% ^0 F D& E' R8 j% ^4 p* f1 w: ]! z% k$ a
__________________________________________________________________________9 m* d3 E+ m/ w3 D9 V
% Z" a( m* X/ J
5 }+ j; ~# _- I9 Y" H& W. zMethod 05
+ A7 C0 p' _. F$ a$ F% e! E=========
7 O& x* f6 ` V" X% F, @; s0 N+ i: T/ |" L6 N+ T+ Y% ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system# G1 d8 K3 \& c4 U/ _! V
debugger. It calls the int 41h, function 4Fh./ S' @* [9 ?' K+ W) R+ w$ _
There are several alternatives. ! q# n, ]& x- i% l
) D; z. o5 x$ A0 }! T
The following one is the simplest:8 ?6 v Q0 L5 y5 y* X6 O$ ~( ~
5 F, K7 x4 ^ ?1 H g, j: s4 J mov ax,4fh
0 x- Y, X3 j& e, G/ A" y int 41h7 g* T) N, s9 ]$ c+ Z" d
cmp ax, 0F386( j. @- C- V z. T ]; r
jz SoftICE_detected# c4 g/ X" B; A7 k; s
1 R1 Z ~& [0 O# O( M+ g) C5 G
5 ?- r" l9 M. u) B( c2 u" J K
Next method as well as the following one are 2 examples from Stone's
7 z _: z& q/ m- W) W- i$ Z( c"stn-wid.zip" (www.cracking.net):" v* W$ C' \% U. A/ R
# O% M# p) Z# o# ~ mov bx, cs
7 L7 X9 P# h) H6 ? lea dx, int41handler2; O, r6 c4 ?2 G3 l9 V* ^! Q% N
xchg dx, es:[41h*4]2 _" U4 w( ~0 x3 d
xchg bx, es:[41h*4+2]" n U& h, `9 A6 N
mov ax,4fh
+ P! k$ S* S7 }# c" P6 S int 41h
' }: _ x( `% G# T xchg dx, es:[41h*4]3 i4 }# ~. K' H
xchg bx, es:[41h*4+2]" @' Q9 d; j% G# P# o/ o# F
cmp ax, 0f386h2 o$ q) u, \ E$ t& l- y
jz SoftICE_detected
0 i' o$ J3 Q$ ^6 ]: C/ a2 ^2 N
{6 u+ t3 w. |' O' W7 t+ ^" m! Aint41handler2 PROC, y$ ? w) v7 ^9 ? L3 e7 t0 F
iret
6 N% n4 f# y; x+ S" F6 ?/ c9 t5 n/ wint41handler2 ENDP
8 t0 d' H+ h7 r& v$ i' ^: l* X- `4 P. {1 C' ^8 G. E
0 d$ r% s0 h! T/ W& P. m( P6 h% u
_________________________________________________________________________! U8 C; ]$ c7 i# Z/ D1 W
+ v* I7 u& Q' j. A v6 a7 A9 \5 m/ o3 @7 m
Method 06
+ [1 |- K* y F4 v=========' D. H! F, d8 t& [5 }
4 L, f* k/ Q/ m! ]& L( a8 j, L! x& x( E; L( l4 d s/ B p
2nd method similar to the preceding one but more difficult to detect:
2 a4 I% r( B- u0 v' `& x/ V3 d, A+ b! j* D
- ]9 W: Y# G! n n& H7 P: E
int41handler PROC1 l7 }9 R3 K5 A! x% q
mov cl,al: z+ G7 V: \2 R+ t: o3 ]3 z
iret
0 b! R& H, q5 e7 ?7 Hint41handler ENDP
" z* O7 j! v7 D/ S: f4 r0 E$ h
" m9 f& u2 p% N' ~( l I5 ~$ d' V8 | d% y& {1 _$ Y
xor ax,ax: ?$ G/ y8 T" L( W" M
mov es,ax
7 ?! S' A; j* P3 y6 M8 t mov bx, cs
6 I l+ k, [/ P8 t# B lea dx, int41handler
. y* G' H" m, F' G; Z xchg dx, es:[41h*4]8 R D9 z" y9 n! s* V
xchg bx, es:[41h*4+2]7 n. l) @4 h) q" X/ g8 L
in al, 40h
. ~ M! [- J( x I, V N$ D z/ B4 }* z xor cx,cx) Y4 Y; h/ O" x: o9 p" e
int 41h
- d; x7 B8 b1 ?6 j xchg dx, es:[41h*4]' s8 Q1 Y0 Y" v8 C0 o6 C
xchg bx, es:[41h*4+2]) f, G% O: r- T( v( p/ z+ Q+ p3 A
cmp cl,al% ]% I- J; ~+ E) a' {0 H ?) i
jnz SoftICE_detected" U3 }5 O: h8 U8 N
: l% m; S0 {6 a6 q: f y
_________________________________________________________________________: M8 H, W) `, I' i* n; I
. n0 R& K/ b1 C& y0 Y: O8 ~! ?Method 07
; T) Z0 D/ k5 w {! \. q C# B=========) |( w2 l/ r8 n5 o; O: J6 R% S$ i. P
$ n) c* L( x: C# @+ z6 MMethod of detection of the WinICE handler in the int68h (V86)
2 p/ c, a" L6 J C4 \ Q
5 [7 i, o! G6 a3 y mov ah,43h
# w8 G, A% v. l/ j int 68h( u* C6 J5 z5 a5 \7 n# J3 W
cmp ax,0F386h
7 \ L" ?. ]0 V. S9 ` jz SoftICE_Detected
+ y; ^! O0 a3 n3 O# l/ b& n _; n. |' l/ g% k
8 v$ n% K0 F) H
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit) a/ d7 {* D7 c- F$ C; I7 [8 c
app like this:. }3 U, }5 `2 y" B
( b/ Q p; k/ d7 j6 H
BPX exec_int if ax==68
- U4 p% a+ o1 e. i; A2 @+ ] (function called is located at byte ptr [ebp+1Dh] and client eip is- |3 I0 q" l, p2 [% D
located at [ebp+48h] for 32Bit apps)
+ E# ^9 F, w( m0 A/ {" s" A__________________________________________________________________________
4 A# m" S. `# |& ]3 _' O, m0 J' q: E' M: L; v
8 r/ b$ @" Q2 g/ s& o8 l
Method 08
W8 @( |/ _; H2 V7 F=========
; b" H5 s5 d+ \9 @2 a6 h; ~; v: r: H3 j
It is not a method of detection of SoftICE but a possibility to crash the
5 j7 @" g! Y Z" v; Xsystem by intercepting int 01h and int 03h and redirecting them to another8 l, I$ w1 W3 Z4 B5 D- E
routine.8 e' v8 i* X6 w! Z$ g1 [% t8 i9 f' L
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 T# |# }! b4 |: J9 B+ nto the new routine to execute (hangs computer...)9 \. z# y; L7 E3 v
1 g3 X' ]8 `4 j6 L% g9 J. k% R+ e9 l$ A
mov ah, 25h& H6 x( ~$ H7 g# V) ~' ?
mov al, Int_Number (01h or 03h)
# m$ y9 \! W" C) `2 a mov dx, offset New_Int_Routine
* t2 ?* f( f: c+ m! }3 D$ R int 21h
' _3 F8 a2 S- ^4 M0 e% y! s. X) L4 ]; c
__________________________________________________________________________: k% N9 [ o( e8 p8 j
7 u% e4 Z2 Q: `: {
Method 09
p3 t3 I6 B. W( D+ U9 [=========, p9 p0 \% J$ X
" {7 o, k5 x; O% b! L. j. N
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ t& Z( M* @( y2 b" p) ^performed in ring0 (VxD or a ring3 app using the VxdCall).$ l! i6 j% W( D/ X/ B9 O3 I3 i" n
The Get_DDB service is used to determine whether or not a VxD is installed
. z8 t1 M4 f% f3 t9 u) Yfor the specified device and returns a Device Description Block (in ecx) for
9 H8 m9 K- w `that device if it is installed.
; b- U9 X8 n s- c: m1 Z _# K4 d& }
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 E0 T3 x; s+ \5 a4 l( l% x mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 n2 l5 g. U( j8 l VMMCall Get_DDB8 q4 c( V6 Q$ X# Z9 C" s# A
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed% i% q+ X- _0 ]+ ?
) A7 |3 Z0 o' `% l% R3 y
Note as well that you can easily detect this method with SoftICE:
0 |9 R& W" r3 Y! j3 _ bpx Get_DDB if ax==0202 || ax==7a5fh# [4 Z8 O+ U) P2 ^& W. x
7 c1 D3 o0 K( E- L! u" \' U' G__________________________________________________________________________) a. y0 j% h* c/ l
; t' Q2 x: A1 n T) T' O0 EMethod 10
5 U' B, x- Y) g9 H1 S6 n# D+ o=========! K; s. d- |% S- p% p7 X
( T$ |- C( R& K* u7 G) r+ s0 G! Z
=>Disable or clear breakpoints before using this feature. DO NOT trace with: d$ p. v. P$ ?) m- V- k( A
SoftICE while the option is enable!!. c3 v* Y4 K h0 ?* s" r; n
5 t7 H5 f _. u& w' q$ y% R. V* G
This trick is very efficient:
. r* ?+ c+ K* Z* M- o' `4 u) C$ P& {by checking the Debug Registers, you can detect if SoftICE is loaded, p% K2 z1 y2 d+ s" W/ `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 c! n. m2 g6 a1 l$ {4 Ithere are some memory breakpoints set (dr0 to dr3) simply by reading their
8 Z( y {0 ^- x8 F3 @. Vvalue (in ring0 only). Values can be manipulated and or changed as well3 O! p: N! c2 Y
(clearing BPMs for instance) F7 ^1 h& ]# n0 Z, U
7 j% u4 I- N3 p8 S
__________________________________________________________________________
7 G/ {+ [( V! p2 n3 e7 k
7 v7 u1 X: N: q; k @Method 11
+ N) h7 ^* M% Y1 [=========$ ~/ Q& o9 V* [; e% t5 y' B9 k* N
+ e- p5 G3 Z- O3 _4 M5 i+ I
This method is most known as 'MeltICE' because it has been freely distributed# c% O* y; A0 ]. D
via www.winfiles.com. However it was first used by NuMega people to allow
! M' \5 n8 [2 o* S4 m" LSymbol Loader to check if SoftICE was active or not (the code is located
3 T1 i3 y8 {8 P) ]& [4 d1 k& ^" zinside nmtrans.dll).
* Y/ [$ W) I6 f' G9 R9 N7 h5 N4 |9 C) [" |, {. }4 z. v
The way it works is very simple:
% m/ n/ m0 a* c( qIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* d+ `# n5 ~0 N$ _WinNT) with the CreateFileA API.3 B7 m( A5 Z6 J5 n. J/ Y
$ W1 [: Q' ^/ RHere is a sample (checking for 'SICE'):7 S/ a" i+ f- }& A; S8 _' T2 e
! j* \. E {2 c8 J6 |BOOL IsSoftIce95Loaded()
* o$ u, A6 M/ |4 S2 Y{$ Y5 D( A' M) }4 H4 X
HANDLE hFile;
, C- @( L! }8 Y0 V3 m, F hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
w. W, K7 O" a n0 P1 J& z. u8 C FILE_SHARE_READ | FILE_SHARE_WRITE,
8 h; U s7 T8 |9 x* |- T2 W& L NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ e' \# G, B! z, Y7 e' m3 L J( }
if( hFile != INVALID_HANDLE_VALUE )
6 V. n2 U1 j3 X4 H, R3 p {
" e1 U- q/ t) E" r! y CloseHandle(hFile);, }" W, h" e( C1 m
return TRUE;! p3 m) r% U% Z& N: _
}
Z6 r9 b- J: i8 n. | return FALSE;* u0 F# _) t" @; ]* `
}, b) B h0 M& o6 ?) h
/ s7 I0 e, }4 y5 m# xAlthough this trick calls the CreateFileA function, don't even expect to be& j, Z$ c& |+ R; a' \; r G# |9 U
able to intercept it by installing a IFS hook: it will not work, no way!
: n) P1 w# G% KIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 z5 E( a% {1 R+ g% u- Lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 N2 g9 a/ R6 \" Q4 ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc# ~0 G; X7 o" n. p, F/ K9 g
field." u. E# i) N! C9 q% t( u4 ^0 e
In fact, its purpose is not to load/unload VxDs but only to send a - i- j. L! R; l6 B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 x+ S5 Q& F2 B3 g: K, E
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 m! E, q( }3 d( P6 Zto load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 D/ ~$ q2 Q8 y$ h9 fIf the VxD is loaded, it will always clear eax and the Carry flag to allow
, _+ i9 G, A6 T8 _) K0 ?( _6 yits handle to be opened and then, will be detected.
0 p% u9 m3 \& J* p6 cYou can check that simply by hooking Winice.exe control proc entry point: c+ a+ H! L: P
while running MeltICE.! |4 k5 V0 k& w5 K) X; N4 L
, e3 d# J- a7 u/ ~6 q' c. } M) M* [. ^2 a4 |% Q, i/ h
00401067: push 00402025 ; \\.\SICE8 a2 a5 j$ M5 O# U0 j! D
0040106C: call CreateFileA g3 ~6 ~( R* i* K% x/ s
00401071: cmp eax,-001
( P6 ]/ n, C6 T2 y- M5 H& c! H' P 00401074: je 00401091
7 e+ q4 N4 y$ q$ x/ D: D& a3 {( ~, s l# j1 k4 R- C- V
3 G1 n) k) `2 F0 x. h2 IThere could be hundreds of BPX you could use to detect this trick.
. I0 J( k# j4 G# Q* H-The most classical one is:8 I+ _( i" n" z( m2 } u. O) s8 n" t8 H
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. m4 e0 W) D& F5 d k- O! B% ~ *(esp->4+4)=='NTIC'
6 N K( U0 z- V3 J
0 }3 e3 D1 m+ L4 y" l: }- c) @-The most exotic ones (could be very slooooow :-(
8 B! |5 F* c* _+ U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 u- Q; w: O9 P/ K2 H ;will break 3 times :-(
, J4 Y- e/ K P$ v% a' f: G$ ~
6 U4 b/ w5 j+ M( l! G# Z-or (a bit) faster:
7 m) m5 Y% a" B F. S8 o. P$ f3 O BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 @6 r8 q* e9 v, p3 m3 B N& A+ ]9 T4 m: u- j8 Q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 P9 d' x6 ^5 L, {
;will break 3 times :-(
6 ] ]& H) Z3 G0 V: d. Q
8 M" K8 V$ \3 W( {5 d7 r% K1 _# L. G-Much faster:5 b' t( _' V- L2 h8 I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
6 _8 u3 F1 z3 [$ w# @ |% x ?- M* q# r3 M+ y5 ]
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" j4 Z& D9 M( U/ ]+ d4 `function to do the same job:6 M' p- U8 X+ M* |0 m6 a& @
, v* g1 _" i x; V
push 00 ; OF_READ4 y) B( P; k7 E* o/ z3 p0 N
mov eax,[00656634] ; '\\.\SICE',07 _9 p8 p* S' U0 k7 T
push eax
2 ^( F) l+ e ?$ T' R$ H/ b# M call KERNEL32!_lopen
: @! H7 U% G3 H: T0 V inc eax
3 {0 y0 Q2 ~* d jnz 00650589 ; detected
: C) @5 R# V5 @6 I6 v push 00 ; OF_READ
4 O% e4 J5 c! y; z, O4 V3 ?' m mov eax,[00656638] ; '\\.\SICE'8 F" R, ^9 R+ G" M0 W" g' u/ s
push eax- R* B. H3 Z5 x, [; R
call KERNEL32!_lopen
8 N& X- ~5 H; I) t0 K- V+ v9 X, P inc eax @5 M! X2 P/ G. n y0 O+ Y: O, X$ J3 ]
jz 006505ae ; not detected
- f" a; p' H' J2 c0 }9 q+ v( x: S* a2 n, [ u5 L
# V( ~* u- j/ b- {+ n: X* A" n__________________________________________________________________________) W( _7 [1 G8 x* y9 I. Z/ L B
* a1 T5 d6 Y/ [" H" D3 `9 h+ GMethod 12, [! W! o. Z. U u# v' L9 g
=========: R: O2 V3 v5 t g) t
. q! F( X+ A% w( aThis trick is similar to int41h/4fh Debugger installation check (code 05) y4 U8 O- \+ V% g% f! J
& 06) but very limited because it's only available for Win95/98 (not NT)
# u& w: r+ V' c% E K, S7 ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ m( D4 C- f% u. k1 g# f. a+ T6 J( Z$ I. F% j
push 0000004fh ; function 4fh
1 b, `/ r% T/ d. i6 L% o push 002a002ah ; high word specifies which VxD (VWIN32)
: r$ w: T+ s5 m9 K" Y ; low word specifies which service
0 p& G# t- }8 w" Z( w6 a (VWIN32_Int41Dispatch), e% [% @# z! F* A/ z4 C
call Kernel32!ORD_001 ; VxdCall" C+ |0 P3 {2 m
cmp ax, 0f386h ; magic number returned by system debuggers. c8 u6 U$ N& U* |
jz SoftICE_detected. E6 N) N* @/ u) Z
1 P5 i4 c& }# U# h4 z3 zHere again, several ways to detect it:& A+ i- y0 h* m* \( c
k4 Y k' d+ \2 z
BPINT 41 if ax==4f
1 ?+ [; L$ K- @
+ Q5 _: R7 n# \ b BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
% e' O ], f8 h) _" O+ O8 q$ Z4 b& r
) z6 h6 c! s/ l1 _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 l% Z, Y) @( Z& A/ N( ?, s2 f# ?
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 v3 R* w2 |2 `7 Z4 ]6 c- m3 u$ K
' Z* b/ P7 d; _9 P8 Z6 F__________________________________________________________________________
: B3 u5 c$ p9 X8 r. T; @; _: g/ h6 S7 b: z
Method 13* P( c5 G& M7 W; p# m) \ Z, z1 k
=========
( R9 c( ~7 a( r( n$ I* t( {8 Y
+ [$ X8 [: b8 bNot a real method of detection, but a good way to know if SoftICE is
% C' }7 q% R; ?, n% zinstalled on a computer and to locate its installation directory.
% j4 A2 h# L; b3 X$ ^" SIt is used by few softs which access the following registry keys (usually #2) :* j# z8 J$ F" j d
: `% R2 x# m7 v- V* P [; c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, K% B G! `, f# \6 r( D+ h. b\Uninstall\SoftICE' ` z4 Q( \, B+ @( i
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' v+ ~2 w: A' _" ]9 u& p& O
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( o) V( b% C+ L/ e' y) B! R9 P+ d\App Paths\Loader32.Exe
0 ^8 P# l1 T3 z4 w
) A" p7 E- K3 d+ q+ i9 t
; |4 G% y" U! @$ X% QNote that some nasty apps could then erase all files from SoftICE directory7 j, r3 ]. U! l: z0 y& l+ B1 }* n
(I faced that once :-(
5 A1 @1 e0 q' g6 B) T w" r# g: }& h( I+ `
Useful breakpoint to detect it:/ L5 H0 B3 |, v7 X u/ \7 W
1 A0 v* `+ O- u k5 ?2 {) T( I* X, h BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: ?3 d0 ~1 I' |! I/ A: N) t6 p' t
& p0 I2 L5 K* a+ K$ I* w: M__________________________________________________________________________& N! K# O8 } Q) o& ^
; P" r1 N/ T) {: G& D
. Z2 Z8 P3 f* Y! g& g4 Z' R+ ^Method 14
1 W9 H5 w9 N6 }. a/ ?& h! X=========4 _3 n( ]) p7 A z% \2 t
. X0 [" t) `7 g3 U2 r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) ?! o/ X# _/ J
is to determines whether a debugger is running on your system (ring0 only).* ^ Z$ ]4 H% ~$ b
( N! I8 a8 R( q3 ]+ { X VMMCall Test_Debug_Installed+ u8 N5 |# U( Z- K" Y
je not_installed/ W; E; S s# `9 Y/ @7 I4 J
5 {: Z/ u: v) X0 O' L. ^9 tThis service just checks a flag.
2 h, a) ~/ U# {# a/ F4 f</PRE></TD></TR></TBODY></TABLE> |