<TABLE width=500>
: Z8 w- R/ L; v4 f<TBODY>
! S8 J9 E6 a' k! V* b. G8 Q" }% G<TR>: q; e" s4 ~0 F: a4 _$ G
<TD><PRE>Method 01 ! Z/ D" |5 w7 b( ^! k; X; }' s6 w
========= D( P- I5 \1 l5 d: n9 _' W
% @; R# \) ^$ d; ~! R' r5 ~4 w6 Q
This method of detection of SoftICE (as well as the following one) is
9 x0 ]5 j3 A$ h& o' }$ vused by the majority of packers/encryptors found on Internet., A$ N+ h# [2 N' D
It seeks the signature of BoundsChecker in SoftICE
7 W' n* y) i2 Y. `) G7 u& j4 G/ C) M
mov ebp, 04243484Bh ; 'BCHK'
" l2 X9 _/ b$ a( G) R mov ax, 04h
! L# s( \6 { I, P6 h' \, H. M' r int 3 3 o4 ]2 ?3 _: y% S& h4 Q
cmp al,4
1 P) f+ \, R) { jnz SoftICE_Detected
2 s7 e" c q/ e, m) G. x( f- y+ \6 _3 c% L
___________________________________________________________________________
8 T8 C1 q/ ?: S2 w
^1 J4 [; k) ?Method 02! u$ `& F3 N% N) R. i
=========
; v1 B1 E* M6 B7 A
8 |- U. p* j. V; F, X/ h, {- hStill a method very much used (perhaps the most frequent one). It is used
0 b; v3 H x8 z4 j$ n9 M2 A5 l% B5 eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 [' O! g) b7 T6 F7 ^ o$ L2 }
or execute SoftICE commands...
& ^. V# L5 R x* SIt is also used to crash SoftICE and to force it to execute any commands) |+ W1 \0 M8 V6 a' ? K
(HBOOT...) :-((
7 I& I& g1 [$ U8 j, O: A; f9 _& s3 h8 Z4 |, D! Q
Here is a quick description:
( j* O5 B. W. g-AX = 0910h (Display string in SIce windows)" W; n* O2 s7 i% t
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; N% B! ^2 f! n. B# b. ]5 a-AX = 0912h (Get breakpoint infos)3 r+ y0 A3 v) e, S3 \8 T
-AX = 0913h (Set Sice breakpoints), B# }# x. k6 t3 g p( R
-AX = 0914h (Remove SIce breakoints)
8 ?$ b7 Y* s9 q! m% y5 z- p& _/ L+ A7 @; W: F
Each time you'll meet this trick, you'll see:1 E. j, F& o5 B' d) q" Q
-SI = 4647h
0 L$ @- N7 S7 x# f1 O1 t-DI = 4A4Dh) u. I7 g+ D$ n0 @# N5 u
Which are the 'magic values' used by SoftIce.# p! D5 v6 `5 I5 a$ B' o
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 \$ S/ \5 y8 h; [
$ S! v s: k. X; d6 d, B9 NHere is one example from the file "Haspinst.exe" which is the dongle HASP
2 a. `' ]" \+ N! R2 { OEnvelope utility use to protect DOS applications:
0 N/ y8 w( ^- b! D7 W C1 y: k0 r" t/ a: i6 b: c) _( A
; b# }$ U7 T+ Q: X1 v2 a
4C19:0095 MOV AX,0911 ; execute command.
/ A1 X- n& K: H# r( J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- C, Y0 r2 h4 {
4C19:009A MOV SI,4647 ; 1st magic value.
* m7 `: m5 B) b5 V g5 h4C19:009D MOV DI,4A4D ; 2nd magic value.
' y: k$ h! z/ c9 O3 E9 P4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 c3 [; N0 ?4 @4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute& }: G. `5 `, b2 ^# ?
4C19:00A4 INC CX
, I' {$ D/ n2 k( G4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, m% u2 l, F* g6 v( _5 Z
4C19:00A8 JB 0095 ; 6 different commands.7 b% X) W/ |' w' a
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 `- X) N0 c. R% U; V G4 V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 B2 f, E6 G$ | c, V
1 s: a Y; Z, kThe program will execute 6 different SIce commands located at ds:dx, which- R. n" F. o$ J- E8 f+ ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: _) c/ a) W, h1 V, G) `: W3 t
m+ s* @' K8 K# d5 C7 ~6 x1 j( ]* ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ C% }: @% y Z! ~8 m7 c___________________________________________________________________________
: \4 g0 L/ G" |6 a- z2 b5 v3 ~" W! M' r% z
8 u6 R& [: S1 j! }8 S9 hMethod 03" u; h) Q4 T; O7 c7 l
=========" \1 Z9 G: _2 S
, q( t+ d6 C/ H, u3 P2 ]/ z
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) I' p0 e* w# E/ q(API Get entry point)- I3 s4 F7 W' q, z! H3 s
" c) Y( y! c2 X6 N' D+ Q# | ]* l! R% J# q; e5 [
xor di,di% ?9 d$ N; R* w' h& y+ l2 z
mov es,di
, T1 \2 s9 n1 y; w5 i& ` mov ax, 1684h
0 o. `' p& c% c K, ` g/ [9 { mov bx, 0202h ; VxD ID of winice
$ E3 k! e8 x% T0 O+ t1 z int 2Fh: ~' T" U8 |7 U0 O. S9 e" @4 J$ X4 [
mov ax, es ; ES:DI -> VxD API entry point$ Z: o, _/ W6 d0 p6 q4 [# o5 u/ z
add ax, di
9 z/ a/ V: _2 r) V V4 k( @ test ax,ax
1 P. l2 X) z! Y/ Z* h/ G# S jnz SoftICE_Detected
: M6 r+ v* ^" t
# i3 ]3 y. ]& E! \' f___________________________________________________________________________+ Y( O6 J4 y* f$ G6 w
6 Z3 d; U: n6 V& q( s( z* S$ b
Method 04
# R* _7 z! I$ |! _=========9 {. q5 A* v% D1 \; m1 ~- X2 M
+ L( | `. Q- t6 aMethod identical to the preceding one except that it seeks the ID of SoftICE) a% B0 Y( ?; Q* z, @) ]# {
GFX VxD.
4 ?5 D" N! J7 r9 N" O
% Q- y& F; i7 j& ]1 }/ K; a xor di,di! I: ^& ~8 o9 k0 K$ H( v2 F5 Z
mov es,di
0 M5 }1 n* O3 m5 r0 \ mov ax, 1684h
8 f1 I0 F; c) I) ~4 a+ } mov bx, 7a5Fh ; VxD ID of SIWVID
/ t7 u6 f* s* L int 2fh: Z2 U! Z. d2 j0 T7 n. L
mov ax, es ; ES:DI -> VxD API entry point
# O ]. P+ O+ p; P4 H6 o0 s, f0 ] add ax, di
/ @: B+ g K6 r7 @, y/ O+ F test ax,ax! f: q6 U O* y6 K0 M
jnz SoftICE_Detected3 f+ W6 j' h4 _ d! K3 l
U! r. i" `( i6 j. [__________________________________________________________________________
. N$ g1 O8 }8 F/ w7 @
( T3 X0 U+ Z" Y0 R. Z) W6 {# b7 S9 ^" O; d8 w9 o5 T
Method 05
0 b( }% B0 I- X( A1 o, o=========
8 ?, ^' r% E$ _8 @$ ^3 T0 Y
( [; G" b/ y, aMethod seeking the 'magic number' 0F386h returned (in ax) by all system& \4 z! f% ]; ~& C+ t* Q, {
debugger. It calls the int 41h, function 4Fh.! [- _2 t; @0 o) |$ x, I! u' p
There are several alternatives.
/ ]0 _4 ?8 m7 m6 N8 _& k7 A$ L/ M+ o2 P# E4 ]9 o
The following one is the simplest:
8 C( ~, _- X- j) z( N+ s: a6 y' E* k$ v
mov ax,4fh* j- _9 c1 i3 R2 p
int 41h2 }' W! H0 p8 X; U# K, v! ^; k# `
cmp ax, 0F386! U( D1 ~0 l3 J, ^9 ^/ j, K
jz SoftICE_detected: ?: D2 ?$ B# ]1 e' }3 l: n
5 x( R9 D+ I1 c
. V# _3 F6 Q3 ~% E8 T ?Next method as well as the following one are 2 examples from Stone's y( \: U5 g# x+ H9 v. T
"stn-wid.zip" (www.cracking.net):
; u4 u5 A |) }6 ]# T( R0 B E$ H/ C3 |6 h( E& C6 C4 Y( L) ~
mov bx, cs
$ H0 s; q& [* G) d lea dx, int41handler2 y ?& ^$ L) i- J" S# J- r' M
xchg dx, es:[41h*4]
$ l" Q/ D5 A3 Z" ^; m xchg bx, es:[41h*4+2]
- H/ O1 T# Q) @ mov ax,4fh
6 O0 ]9 M+ E" q int 41h
) A" Y2 B. U( p& ] xchg dx, es:[41h*4]
' d2 X6 \ ~7 _( u1 i xchg bx, es:[41h*4+2] w3 q6 k: _; T' r
cmp ax, 0f386h' C( n8 ^/ _5 k/ W5 p
jz SoftICE_detected
; f; H3 l8 j$ A- r
2 s5 h: i; n- ^int41handler2 PROC
$ J1 G7 |% B7 W0 j3 G$ F6 m iret
" j f0 E4 v/ ?6 ]- X* Gint41handler2 ENDP: X X' q, n, R5 l) F9 v6 c# G
f9 ]# B7 o9 d8 r j X6 o, z7 D T" d7 n4 f: p
_________________________________________________________________________
) x6 _3 O+ z9 I4 U% P
, n6 g! s0 q8 o6 I, ~ t V- U+ \, X( b
Method 065 h1 s+ g9 G$ k; u; F
=========; G; @1 d* x7 \; h
2 o- W3 G) F$ r* ?& i; B/ b; E
, p! f3 }7 `2 b/ U7 d; U
2nd method similar to the preceding one but more difficult to detect:
% g. T& e% o Z& @0 G3 X7 ^3 S* N5 b1 S" B/ o- j/ @, A
" L) t- a& c$ `9 _# Dint41handler PROC) u( q; S2 L" x L" r4 R& J
mov cl,al( b- W8 |/ p* t e. q! R
iret0 V9 F+ [: W4 {8 U) E. Q, e
int41handler ENDP
: K' o& i8 ]- F0 W' A; L& {& g P- y, L0 _; F# o: q) v
3 i( d$ z' x5 {7 E7 ?
xor ax,ax
5 g! o4 s! R7 D6 i: r6 p9 w# @ mov es,ax
+ G( a' X: u+ u! L mov bx, cs
. Q* x9 s3 G; c* Q' V$ m) p lea dx, int41handler$ w( _) x1 o7 \- V$ v& m
xchg dx, es:[41h*4]
$ Y8 `* T% [2 @( P( b# G. S2 R6 k xchg bx, es:[41h*4+2]$ \6 y9 f! d3 N7 r9 V" |- a
in al, 40h) u% m. `( g1 o+ W# a- [
xor cx,cx
8 I' N l. }1 j$ y& w& B& j int 41h
( }9 f% @. g' w! `! ^4 \, e xchg dx, es:[41h*4]: N4 n& c4 B1 S2 `6 ?
xchg bx, es:[41h*4+2]
8 T; O( W& _* f) e( ~: q- D, I4 D cmp cl,al
1 ?; b- l t& z1 { z# a jnz SoftICE_detected+ _8 t5 k/ m4 A3 j0 b
! w5 h. E$ H' ?% z: ^( d
_________________________________________________________________________
1 w5 ^" t! F) ]! H
: ]( {" }) Q* ?* p- fMethod 07
& _+ x" a9 S. q=========
5 K+ L" G* z: x3 m# @' T* S$ J6 f5 E* N* y3 F
Method of detection of the WinICE handler in the int68h (V86)
6 u# }! B) |8 l, G# T
) w: k2 }" p( A) \. N0 l6 w) L. S% w mov ah,43h
; S6 w8 d2 [# q5 f L! o/ R int 68h, e1 a& i+ }/ K$ z* n
cmp ax,0F386h5 Q6 d! F7 a6 }2 l0 Z& I+ K5 v
jz SoftICE_Detected m8 E- [. B5 w
$ v/ C/ |# n; |+ o; ]6 h( z& f$ @
9 f. E3 l% o! Q( V9 I& K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( w3 E: A1 ]7 y8 ]3 s3 f5 A* n
app like this:) r1 k _5 t! @9 X f. S
: |* V% c7 k D( ~6 j" d3 D! i7 T BPX exec_int if ax==68% \2 h5 Y I Z6 c, Q; I! I% D* z
(function called is located at byte ptr [ebp+1Dh] and client eip is
: i) g5 P4 E! g- m) t located at [ebp+48h] for 32Bit apps)
/ X+ O: e6 [7 A9 P" \3 {) a6 r__________________________________________________________________________
: X T9 n0 E2 H. J, {
: R2 T' ~7 ?! m$ @ Z
7 ?& n: ]" c1 \( NMethod 08
8 b& I. `' K4 c' h9 u3 q=========
8 G9 |" c G+ V* d) e# B$ B
+ x5 P6 F$ z4 k4 FIt is not a method of detection of SoftICE but a possibility to crash the
5 j3 J. L. Q' b# Ksystem by intercepting int 01h and int 03h and redirecting them to another
+ ^( I" S! x- H* Y5 ^$ n' vroutine. r x$ Z0 B1 q* L' c* A( y. }
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 @% r9 P8 [5 P+ ?: l; fto the new routine to execute (hangs computer...)% W% Q+ l6 n+ p+ }
* X) l( o3 g4 F( j mov ah, 25h
3 s; q8 S6 J: M- _* a) y mov al, Int_Number (01h or 03h)- j- |/ u& z& P& B; O- R8 u
mov dx, offset New_Int_Routine
( p3 F* }3 S* j9 T6 j( N; }* ] int 21h
6 b, D8 T& U* _! w& t- F: A0 L" b: q# y ]# S
__________________________________________________________________________4 J* }- |) X! a2 w- }
( X7 o( n5 r" d7 j& H
Method 09
) O& b4 P- P. ^1 T# X# X+ H1 H0 U=========: M2 C3 X5 c3 }3 S7 B; C
8 t9 Y: ~+ N- \# M qThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ N2 G* ~* m' h6 s, H( M4 {
performed in ring0 (VxD or a ring3 app using the VxdCall).
7 _. u& y' N! B3 B) @. sThe Get_DDB service is used to determine whether or not a VxD is installed
% l; x. |5 i- v& efor the specified device and returns a Device Description Block (in ecx) for
# ~2 {$ i! a7 {; p3 r+ i( V8 Othat device if it is installed.* G) x3 h* T0 d" i
! \% a- t- f( s3 ?- L& z
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 \2 s8 A- v5 Q" E$ Y mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 m8 _+ Z, a* W$ n VMMCall Get_DDB6 I7 H- ]# [2 g+ q. k' M
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 d, [1 b; t# T9 l5 d2 k% ?, v* O3 I# ?' i8 G5 y$ w
Note as well that you can easily detect this method with SoftICE:7 ]+ s V% ?8 t- Q
bpx Get_DDB if ax==0202 || ax==7a5fh
& U$ b3 U% j* W5 J; a) N# a+ @; T% m9 N; v$ Q* s
__________________________________________________________________________
1 r( _8 P/ }0 f9 L$ k# E! R4 S$ R P) e: h5 i2 Z
Method 10& A/ Z. F2 i0 M! _) L/ v' _% z f
=========+ x9 d* |. }2 n
( X' G8 ^4 }8 o; b8 {% f* g( i=>Disable or clear breakpoints before using this feature. DO NOT trace with! t1 H% L8 X9 q7 b$ Y! E7 _) ~& ]
SoftICE while the option is enable!!
' k9 m1 f! h8 F7 s' z
1 y2 x$ c0 |5 K3 }4 f( [# w2 v7 u' yThis trick is very efficient:
- ^& C- L; D# \by checking the Debug Registers, you can detect if SoftICE is loaded T6 b$ p# g; {1 q9 n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! j& W/ k! a$ m" `5 ~1 @0 B: ?there are some memory breakpoints set (dr0 to dr3) simply by reading their
, B0 s# ~3 y W% Kvalue (in ring0 only). Values can be manipulated and or changed as well
9 o+ {5 Y( u) v5 R( H(clearing BPMs for instance)5 g5 i7 Z& O4 O
' _( f, C; _5 u, g
__________________________________________________________________________+ l2 t: N. H: X5 S* Y
7 q- B! J; C# X5 P& {0 ^5 pMethod 11
4 z4 e: Q) R s& L+ G========= ^2 J3 p- Q- U! s; i
. e3 C& K7 H: o! g1 x/ j& oThis method is most known as 'MeltICE' because it has been freely distributed
- s) f, g7 X$ ?5 N) [via www.winfiles.com. However it was first used by NuMega people to allow
6 ^. o. _8 N- r( f6 lSymbol Loader to check if SoftICE was active or not (the code is located( R: @' a5 |: `9 ^& K1 e
inside nmtrans.dll).
4 y8 r$ v- J; r3 _' H+ G
# g K S) @ t: g1 HThe way it works is very simple:
& B5 @) C$ B. q1 p, F. z5 fIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 [# g5 _3 ]( ?% }/ u/ w8 e$ fWinNT) with the CreateFileA API.
/ V) k+ [( G2 @# X9 f4 n, t' @3 |6 y" Y+ ^, s- g, z. T3 N
Here is a sample (checking for 'SICE'):4 n+ ?7 w; C% [1 A0 Y. q) B6 Q
2 p6 T' H$ G9 ^/ s
BOOL IsSoftIce95Loaded()$ q% V0 k1 G* w; I, i+ F
{
; J6 u6 J: G* L( K% X# X j: j( c HANDLE hFile; " A% T _7 Z; k
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,4 s( @4 }$ r9 B( ^
FILE_SHARE_READ | FILE_SHARE_WRITE,$ k# H# v% P Z+ h# l6 v
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( ~- l# ^5 p+ S/ P5 A( H9 @
if( hFile != INVALID_HANDLE_VALUE )/ B# H2 C+ o. b: o. `- A
{
. k& `- T. p! H3 a' }1 a CloseHandle(hFile);
; l# o4 [0 h7 m& X# C% Y9 v return TRUE;
6 x9 M- H5 B# `3 U0 }+ r& W }
& ?- v+ @3 K9 i0 j& q# u# _ return FALSE;
) e g! |! t; ~' D6 K}
# r* [) d5 p% v! R
' z. V; }4 \5 {2 E! F8 Z0 Z, K n2 kAlthough this trick calls the CreateFileA function, don't even expect to be' a1 @; i/ J5 [7 R" w
able to intercept it by installing a IFS hook: it will not work, no way!
/ i& P: `: Z2 V8 o: rIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" b2 z, [: m0 F" y+ Q0 p3 Nservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ E, r7 w) b {" }and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 D5 Y3 c Y. z. A* \' d) q! h
field.
7 Q. {+ W% l0 @+ X9 x. cIn fact, its purpose is not to load/unload VxDs but only to send a * U! K; P3 u7 S9 E6 | b# B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; e" o( o* I; h. Z# B9 Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
) d$ f P& q2 X! d* F5 G7 H0 fto load/unload a non-dynamically loadable driver such as SoftICE ;-).6 E- d+ _2 n. e) v8 x' q- h
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 U- i; g( t1 z5 T6 O% `- iits handle to be opened and then, will be detected.2 |4 G) ?2 ^" T' z
You can check that simply by hooking Winice.exe control proc entry point! V" h/ |( X% ?9 o- p& t
while running MeltICE.
. j3 B2 L- `) D5 s; R6 W$ M+ h1 d( k1 ^$ U4 o5 f, P4 h
- e6 N/ J# k+ K0 i% ]' ~% V
00401067: push 00402025 ; \\.\SICE
9 q! a: }2 T0 x3 e 0040106C: call CreateFileA7 r! F# G/ ^* u: W3 w9 B
00401071: cmp eax,-001" Z8 n- Z: w9 d
00401074: je 00401091! X. Y# V n& b! V: M2 t
3 J7 R" j2 Z0 H. e7 A3 V
& h" b0 h3 S$ f! V8 v
There could be hundreds of BPX you could use to detect this trick.
, a0 d* p/ A( F( l, r- L0 y5 ]( S-The most classical one is:
6 _# J/ B8 H( q: `* ]" P BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 s- i% Y8 z- s, {; [5 N
*(esp->4+4)=='NTIC'" ]3 P7 j# W, S" i& n8 r* |9 H0 t
1 S8 I6 h8 w0 f) A) ]2 A-The most exotic ones (could be very slooooow :-(2 H7 \8 e3 V" C* A+ P1 g. o
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') % _8 |1 Y0 e: M7 w" b3 F
;will break 3 times :-(/ ^+ w# o5 Q$ y$ X3 s; s7 N" [
- j+ R8 Y. t% _& ?3 e4 v-or (a bit) faster: - `. q+ t0 o: n: U
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- ?& H5 n- d% ~! j5 T/ ~4 U5 k9 S3 F3 E8 r: x
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 K3 a0 E3 ~" _ ;will break 3 times :-(, ~6 V( _/ [3 s i" Y- M0 i
8 @4 [" W$ P- f. m) X
-Much faster:9 |( g# M- i# M5 s3 @8 N
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 n/ ?8 X; y+ o [& T* B
: }- g; J! v& f# M# q0 R" INote also that some programs (like AZPR3.00) use de old 16-bit _lopen
& t8 z, }0 m' Y$ x3 v. J* Vfunction to do the same job:
0 k# l# W7 r, M! k4 }. @1 S1 _; O3 u8 \; V/ a( n! l4 Q% U: B
push 00 ; OF_READ- C2 h7 S3 q4 ~( m4 [7 s( z7 S
mov eax,[00656634] ; '\\.\SICE',00 ]0 s( K. d2 Q2 L
push eax+ @4 u' V/ m! j
call KERNEL32!_lopen
; E! Q/ T$ n* m( f3 A; @ inc eax, M, V/ Y7 v% N; d
jnz 00650589 ; detected
- G* Y( [: |* O0 v$ A3 h6 K* s; U push 00 ; OF_READ4 [( g3 s+ W3 n) i3 n
mov eax,[00656638] ; '\\.\SICE'
( m. u- C' E" G% D! H push eax
2 }: }" m5 N7 S call KERNEL32!_lopen
8 o7 ?2 y9 o# L7 g/ { inc eax" Q N6 y5 W L! R
jz 006505ae ; not detected3 y) y. L2 t3 [ s: X0 W& F
7 Y/ i/ S3 E. r0 ~- C- A/ V( I) Z* i2 q
__________________________________________________________________________9 O2 ^9 R/ t1 X. K4 q3 ]$ R
; Z* @1 F: c& r' O, K; s! l( SMethod 12
- ^ A. w" Y, T( t0 |, V; R=========
+ M# V6 O1 q v3 Q: |/ H6 r: E$ N# c" E! a
This trick is similar to int41h/4fh Debugger installation check (code 05
; N9 V; M R) A& 06) but very limited because it's only available for Win95/98 (not NT)) H& ^+ x; s# W v
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 T& G8 ^: O( ^2 e$ g
- R8 @, P- L) E4 W$ m push 0000004fh ; function 4fh. A3 ^7 ~1 j9 ~
push 002a002ah ; high word specifies which VxD (VWIN32)8 F- u+ l9 u7 h+ W* ]
; low word specifies which service
# V: K/ T) [9 a' N+ { (VWIN32_Int41Dispatch)8 W8 n. h0 K- v- l
call Kernel32!ORD_001 ; VxdCall
, C4 {3 Z* h5 r# k, S0 ~3 ] cmp ax, 0f386h ; magic number returned by system debuggers _; O6 }' u8 C0 p. p' i
jz SoftICE_detected7 x- ~( s0 I! k: C
: ?7 P4 \1 l3 n) p, n! Q, x
Here again, several ways to detect it:' X p0 L% r. s! p% m( V8 g
+ V/ ]5 w, D8 y' k7 f
BPINT 41 if ax==4f+ z7 E6 r$ B5 c6 ?& P3 }% V% }
) y& I7 @, z% G7 j, o4 j BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ m( X. B/ N! u6 u$ G
. d# N2 {; _7 k ]
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ x# U, ?) n `4 p' D, Y4 i9 \& d
% \# d! k. \+ m) b0 u
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 A7 H: O- L' H
5 Z- j' F# F8 C4 D0 o__________________________________________________________________________* W& ~9 ^' Y8 \6 P$ Z3 Z
- l2 R# k+ ?( `6 O! t
Method 13
! K6 i% @/ x! ~. @& E=========0 W/ ]4 @2 i( O( V& l# M
- x+ M1 L: H% D8 F6 t ]+ }+ p* A1 mNot a real method of detection, but a good way to know if SoftICE is' @' j) {2 Z; \8 ^! ^3 Y
installed on a computer and to locate its installation directory.
' l/ j% L6 _( E# E1 |4 }/ t7 pIt is used by few softs which access the following registry keys (usually #2) :! l8 E! H* ?0 E2 W6 l$ W
! T0 F7 H' D3 t V9 w-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ Q5 u/ s0 _' ~- a, S9 E! a! G\Uninstall\SoftICE
, v0 @: k6 h: ?: o0 }: O- G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, P* n& E% L6 x. b-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ L* a% j2 l5 Q2 H' x7 q
\App Paths\Loader32.Exe. F' n3 j! e6 P% i: M% M
) Z( m; t" H. r0 O- }# i: k1 ^6 O( m0 C; g( e% ~: @ X
Note that some nasty apps could then erase all files from SoftICE directory3 `% z% G2 a# i* a1 W5 a$ G
(I faced that once :-(
0 t# g7 ^/ F0 [( L# @8 p1 {$ h
- ?, ^7 [1 I9 rUseful breakpoint to detect it:) k8 P' b: j# a
1 C. S8 n( x: y5 @" k
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( r$ ^% J( z$ _3 _3 [3 c. \; S) V
- Z- ~( C+ P4 R$ c5 h3 f1 H
__________________________________________________________________________
& b$ I) `& z- R3 S: i: q0 M2 B: K( t4 `
+ g5 M4 o4 g) O0 Q9 \! @
Method 14 3 {: k7 h! f1 [3 N; O; R/ J
=========
& b. N# l* v. E. ?+ P3 v
1 U/ G: z0 u" o8 `3 b7 f0 tA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 A' |# O# O- X/ }& h% x! `4 mis to determines whether a debugger is running on your system (ring0 only).
/ _2 K# V0 G. R- B& F8 i) i9 W$ u$ j T l
VMMCall Test_Debug_Installed+ y; _, X% g$ M0 b+ H3 t
je not_installed& M9 M# f* P3 `; u2 ^2 ]1 Y9 }1 N
$ l& d9 a4 o0 | S) oThis service just checks a flag.% l @: `$ V; d
</PRE></TD></TR></TBODY></TABLE> |