<TABLE width=500>
" r7 i0 Q0 V) @. v% {<TBODY>. J9 t7 p4 m' |' [$ T. A' e
<TR>* ?4 S& Z0 g0 }+ u" |; ^% _
<TD><PRE>Method 01 . d3 p) N! F# a# Z
=========
5 }1 K! o7 m9 J' L# p6 ~9 z9 T' t0 _& O6 R- k6 m
This method of detection of SoftICE (as well as the following one) is
1 T! j. v- l, u* U2 @$ \* C4 g: qused by the majority of packers/encryptors found on Internet.
- T' F7 ]% [& O( NIt seeks the signature of BoundsChecker in SoftICE0 q0 U5 [- \- p- f: }4 V
# \! W- F, m' V9 D3 ^3 ^4 j2 e mov ebp, 04243484Bh ; 'BCHK'
, y# U) M; N9 V" ~4 ?* X8 P mov ax, 04h, {: H& L. O9 W: \$ d1 X
int 3 - y( J; q. d6 ^( D7 Z
cmp al,4$ b+ w# n. D5 d
jnz SoftICE_Detected4 Q5 V7 d" s3 t3 Q' I9 a8 X& _
& a+ j. c' Z) ^+ J7 Q
___________________________________________________________________________
9 _! H$ a& j& U
1 N7 l7 c9 {' t4 e, v' M: eMethod 02
5 k/ W9 e& @& t; i, [, w G=========- h1 b, ]* K3 @* ~1 \
) z3 a A4 d+ j( K: P" i
Still a method very much used (perhaps the most frequent one). It is used
1 Y9 z/ O1 C* h( Q |+ wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" }- C, e' y1 `+ y. w: O7 Q; Xor execute SoftICE commands...
" F- V+ O! N5 `6 U" ]It is also used to crash SoftICE and to force it to execute any commands
) I! E0 r1 {1 ^9 ?" ] a8 l(HBOOT...) :-((
* s1 C& G) Z: \3 L, N0 G) s" K% P
Here is a quick description:7 [9 ?& y m( V2 C, n$ P b
-AX = 0910h (Display string in SIce windows)
- k2 _8 G$ B% m3 u/ G( m' ?9 I-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& p' F4 R# A+ p- O$ S$ u
-AX = 0912h (Get breakpoint infos)
% Y7 [ M( f5 r( D @9 h-AX = 0913h (Set Sice breakpoints)
6 _( D0 ?4 W5 q, \2 U1 |-AX = 0914h (Remove SIce breakoints)9 r* {" o) W3 m% w7 b' v- g' _9 D
5 \1 {8 ~% i# Y; q- iEach time you'll meet this trick, you'll see:3 B( q4 u3 E4 I* F
-SI = 4647h
5 X! T- E0 M1 X# v, Z5 [/ U) h-DI = 4A4Dh1 l$ [# `) a( C
Which are the 'magic values' used by SoftIce.
/ E: `) r/ q- v W3 zFor more informations, see "Ralf Brown Interrupt list" chapter int 03h./ I+ ?! H: T$ ?2 _5 ]4 O+ T, t
9 `, ~9 t) ?6 i; W: {' [% k0 [
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: N8 K* h; z# L' m0 MEnvelope utility use to protect DOS applications:' i! E: r. `& b7 _ U; |& M0 ]
/ h2 D3 X) B0 T0 F7 x& z
. e+ |) z8 i. V7 h$ R1 Z4 a4C19:0095 MOV AX,0911 ; execute command.
/ ^, n- j/ u% h" q# Z: t3 C4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( @% S. s# {8 p" X [6 m8 x' q
4C19:009A MOV SI,4647 ; 1st magic value.5 C( T+ p9 m1 L/ Y F6 Q
4C19:009D MOV DI,4A4D ; 2nd magic value.
* O* ?: ~% m) d4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 N' I* }0 |# R1 ]4 |4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute& g3 { G% e5 D3 ^/ u5 O0 o
4C19:00A4 INC CX d4 G u! ^) g
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# d k. o" r4 f3 m% n4C19:00A8 JB 0095 ; 6 different commands.9 s" D) i7 G8 v' y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.0 r6 I% i0 w& h3 l& I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ s/ R" y9 D. K& o) |, L+ f9 p& O5 f5 V1 v8 g. \$ F
The program will execute 6 different SIce commands located at ds:dx, which V& l6 w; x! v( W% Z4 u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 o/ d" [$ L/ R6 k0 B: m6 M
1 ^: r. u" C, x$ R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- J' ~2 Z$ j8 d% p! h
___________________________________________________________________________* S2 Z& a+ ?$ i5 O" \% t! C
& v( u2 ]8 w w" @
/ p4 B, J# V: T" E( ^; p- Z! C
Method 03. P9 Q4 X. M7 ?9 f3 ^1 k8 r' Y9 [
=========% e. j4 e7 b, X% f: p
1 ]; Q$ \9 b# b0 [$ L; M
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h F5 T' _: Z. ]% c
(API Get entry point)
( @5 ]. I" [& |2 ^; S8 B# m9 ~5 C
- `; `4 v u! j& E _) `# U/ h& g
* O Z) e. A. Z J" f5 K& q xor di,di
/ Y( t& @9 m% ]3 e$ c mov es,di) U1 r2 k+ `5 Z1 A
mov ax, 1684h 5 G$ `% b+ D+ T6 y% X
mov bx, 0202h ; VxD ID of winice+ k T# s. a u2 n! |# ?/ O% X
int 2Fh% U6 S' c8 }# O% M& P* Y' a
mov ax, es ; ES:DI -> VxD API entry point) x( B" g% u+ q! ]/ e" x8 \
add ax, di& k# o) V. ^5 ]( [# z6 \
test ax,ax
# z0 @, V, e8 L jnz SoftICE_Detected
% a" V, u) O; s2 @1 p3 g# x* g# T" h: C9 W* P4 ?
___________________________________________________________________________0 M8 q" K+ I6 G& w/ d* z3 l+ Q
1 S: b3 }6 ?5 \: u( `" M* V7 h7 l
Method 049 g" \9 Q$ Y0 I4 {' {
=========2 C" R1 B) C$ a0 o+ I' [2 E' P
: G9 b7 f- p% ~. h
Method identical to the preceding one except that it seeks the ID of SoftICE) K2 X5 H! u6 g
GFX VxD.
" z8 L. B( x e
$ Y1 ^. j2 N$ y" J xor di,di1 ]& A8 `' E. p- m& U T9 K4 k
mov es,di
( S" t! A. d: [2 ^- v mov ax, 1684h 3 h: c. `6 Q# d6 D$ t# D' q0 J3 r
mov bx, 7a5Fh ; VxD ID of SIWVID7 R9 D' L6 Y O7 `/ [! z
int 2fh/ E, D# Y" d1 X8 V7 |% }
mov ax, es ; ES:DI -> VxD API entry point
7 x E2 H; U" B4 B0 g add ax, di
& _. a/ \ R3 F( {' ]4 F test ax,ax3 B+ g N' G- Q" U
jnz SoftICE_Detected
2 W+ u+ p* ]9 }0 ~: A& m$ G5 @! m2 R# X& L
__________________________________________________________________________
( V) d D9 Q! R! g; {. l# X
, n( B- ~% g+ D7 b5 y/ B$ _9 T: x9 Z! O4 P
Method 050 K9 c& U0 B' R+ j, }
=========
' N" r4 ~- u/ Q- q P
8 A5 {7 U7 q) I5 d+ qMethod seeking the 'magic number' 0F386h returned (in ax) by all system; r3 I$ |; @) q0 K, t! `
debugger. It calls the int 41h, function 4Fh.; X) C, u- q8 g3 M7 q7 A. L
There are several alternatives.
2 h0 e& W8 @% C/ ]. D- [. D/ \ l- t0 Z4 Q2 W- _1 @
The following one is the simplest:
; ^+ C: I$ q8 \+ d! x
, R2 o: @' n- g. M ? mov ax,4fh
, L! }- }1 F! v) u; _# e int 41h' e+ b, e8 d0 k8 }' K! l9 G, Z4 D
cmp ax, 0F386
4 _5 w. G2 n0 Y' w* s jz SoftICE_detected
4 y: L6 ^6 V$ j4 `' Q; s3 j9 T' F1 d [) f
) z* }, G+ a, `. C" zNext method as well as the following one are 2 examples from Stone's 5 {, U: ^4 R' Q
"stn-wid.zip" (www.cracking.net):
+ j* K" X: W, \( w1 o+ `( j( t0 z+ D: V6 \# |- _% R
mov bx, cs
8 P1 V/ O: O0 W5 g- V lea dx, int41handler2" U$ D/ g# j3 h4 d e, a; I
xchg dx, es:[41h*4]
# ?: C- b+ N L) F8 F0 k2 O xchg bx, es:[41h*4+2]
& q8 j+ h0 Q/ \) A% ]1 | mov ax,4fh
$ K& n5 N* h. {3 }. E0 Z int 41h
: r9 s' Q6 R! x( t9 q' x$ K xchg dx, es:[41h*4]& V# p9 c q. o
xchg bx, es:[41h*4+2]
3 o6 c) C3 S, k) o' K2 a! D3 O* f. k cmp ax, 0f386h
9 V3 R7 o; {: A jz SoftICE_detected7 O% `( ^9 j# o q# R2 C
* }$ w9 h5 |8 L* [) Y4 Uint41handler2 PROC
* R( \8 ~6 ]' P+ R% o iret
5 X+ D( i" o4 d7 K) ^6 z9 Hint41handler2 ENDP1 x) F3 C! m! q% T7 j! W
8 ^ p+ \( _* H2 D! E* `8 U' K& s$ U
. D- i7 X8 U4 ^# N5 i6 p) p6 S; Y
_________________________________________________________________________4 a; Z" z; p. b5 R3 [" r$ [* |9 F
' t/ X( ]+ G( R" Z( p
" _; N, f6 R6 F+ W& aMethod 06
2 i4 o0 b/ R( n. e8 |3 t=========& e. |0 c2 E: ~9 O5 S( K2 u* z
6 q2 R: b8 ^! |- \+ k0 T
) O( R; J2 v( c
2nd method similar to the preceding one but more difficult to detect:, M* a* y0 X9 a' B! a1 d+ Q. o
' g( P% u# ~6 M* R6 U/ _% D# S9 `; D1 D3 e
int41handler PROC
. C1 p9 N/ C% J% r mov cl,al
2 F, _* x0 C0 M7 x: { iret
8 W* G$ K; m+ N% Aint41handler ENDP: ~0 b- t& l/ l! q# k% t2 F
6 ?7 }4 n0 n5 _
3 q8 B8 k5 |) Z6 s7 m- f6 \4 C! D1 _ xor ax,ax
$ d* s; r( @0 t4 {+ N+ q' d mov es,ax
; y# i4 b3 a' H0 q# H6 m mov bx, cs7 v i1 P) l& Y6 @
lea dx, int41handler- \2 z q1 F" g: j4 }
xchg dx, es:[41h*4]4 [' ?* ^! c6 t( b& x. O; w
xchg bx, es:[41h*4+2]8 y$ |2 w$ _: X9 h; U
in al, 40h
5 x& }) O1 G6 X xor cx,cx8 u+ Q7 m0 O7 s# f# c1 [
int 41h, h, A1 l: t# X' D% v% _
xchg dx, es:[41h*4]
1 H2 R& ]! w; S5 {# {& h+ V$ O' B xchg bx, es:[41h*4+2]. }+ y5 ?: D0 D( a3 X- q0 T- p
cmp cl,al
) ?$ h% t- N: j m- L! G; U jnz SoftICE_detected
+ g: E" D1 h' G4 Q
6 ]+ V* H8 C+ S! _& e& S& z7 q+ I_________________________________________________________________________7 V5 b* h0 t. J/ D
) w$ t- g. n* N, [Method 07
* i( `* d# O: P8 h=========
& ?. j; ?1 w0 [; j* a0 ^/ r' R
) ?4 f5 }+ ?+ Z- _1 M7 nMethod of detection of the WinICE handler in the int68h (V86)) h" T- s; @4 q) L2 Q8 P1 Q( b7 l
% c: o& }. v4 e1 J7 N mov ah,43h
7 ]& y1 y" Z v# `2 f5 a+ s int 68h
/ T# f# P8 {- Q& [9 | cmp ax,0F386h4 Y2 b, S& P( ^% [0 y& t9 f6 s
jz SoftICE_Detected: X' N, y% O% ~# j/ L0 I: U
# q$ J9 u1 Q, ` Z( S5 @
7 r, t+ _4 n. }
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ j0 k% e0 j: N$ J. F6 Y
app like this:
% k' M" T! W; u, }9 T! X8 l; Z* m' Y# C5 E1 }6 \
BPX exec_int if ax==680 B) |6 C2 g6 o' M+ f8 i
(function called is located at byte ptr [ebp+1Dh] and client eip is8 m1 w6 n% C" F" u6 Z
located at [ebp+48h] for 32Bit apps)7 U2 ^1 u" |/ o. E& k- C
__________________________________________________________________________/ F$ i, L0 G3 I5 D- y; L
% B. E" [5 g1 L2 L# o. {% d: T4 D! v0 G# u. J9 U5 p
Method 08* V% Q! F3 L7 A; ^7 d
=========
9 j5 X! r1 F4 z) k4 J. @: s
8 }/ f( \4 G, y4 r9 g0 UIt is not a method of detection of SoftICE but a possibility to crash the0 a* Q/ c5 H D' w( o# i
system by intercepting int 01h and int 03h and redirecting them to another) A3 z$ K6 A# s) {$ f) O
routine.1 @) z9 r5 d0 b; l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ s ~! v' G8 e/ B
to the new routine to execute (hangs computer...)4 y+ u! S" C% M5 w' {
6 H, ]7 J& k; V* f. A% v7 F mov ah, 25h9 b- y0 {: d/ x+ }
mov al, Int_Number (01h or 03h)3 j$ O, R: n; m
mov dx, offset New_Int_Routine
( L+ f. t; C. ]* }# k1 } int 21h
T0 o8 R- t2 A; X' l* Z
, @4 G/ `% |- C$ f O$ \* E( N7 ___________________________________________________________________________, C6 l+ c2 Q1 \3 c7 _
9 K2 I) N, o) @/ S0 sMethod 09' A: m; o; I5 e) J
=========' m; |5 x9 T0 z" e8 t2 ^3 h
9 t4 u9 q3 n$ c" F* y5 z% DThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" }0 [/ Z; J" T: f! W, f8 r1 D6 Z7 G9 d
performed in ring0 (VxD or a ring3 app using the VxdCall).2 M6 n6 n+ \" G
The Get_DDB service is used to determine whether or not a VxD is installed7 k* _, [3 V" d% D. T$ I. R
for the specified device and returns a Device Description Block (in ecx) for: N" l& O7 s& s" i
that device if it is installed.6 L* K; s. t1 K2 Y. [' ~$ D, H. _9 r) p
g v; m: a5 p mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
O2 B* j# V, Q3 M% e y mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 t5 `* O$ \( X1 T5 r: L b; E, v3 r VMMCall Get_DDB3 s) g5 e* F3 V/ x- k6 L! C/ Y" G
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) f" H( z% q! A; {: w; w
) W" |) N; K& M7 X- U6 NNote as well that you can easily detect this method with SoftICE:
' V9 m9 x8 d( E# X6 z bpx Get_DDB if ax==0202 || ax==7a5fh% n' v6 w$ T4 h
) r$ h+ p+ x7 B% _' D. ?__________________________________________________________________________
# q/ J; t- n" G @, _* u
( N4 W( I9 u$ L. V; y* r) {Method 10
V ^" F) R2 L5 k4 |9 B=========: @. i5 ^7 l% e5 x
; a6 M$ b+ o! S! V3 K$ m( p; k2 {
=>Disable or clear breakpoints before using this feature. DO NOT trace with' w, S; Z4 I' _2 {
SoftICE while the option is enable!!
# f4 |1 ]' U" f* x% a4 H/ {: z9 f' U, K8 {8 e7 P
This trick is very efficient:0 l3 f& M# T. c3 a4 I. F
by checking the Debug Registers, you can detect if SoftICE is loaded1 J+ p) Y: y# p. v9 b
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- u4 @; r. y" r$ C7 t8 _there are some memory breakpoints set (dr0 to dr3) simply by reading their
5 {# d: n2 q" z6 ^6 [7 N6 ovalue (in ring0 only). Values can be manipulated and or changed as well8 i: D1 c* _, ^
(clearing BPMs for instance). Q' f# I! |$ P& C6 M
% }4 l _; J6 m* z& C
__________________________________________________________________________9 _# w: E" f* g7 g
- A* Y5 \' a2 ~. q: s! L- q s
Method 115 v2 i8 K, ]! r9 Q
=========" H8 E/ p; z' z6 @4 _
$ t5 k9 B. a. d* L$ q: WThis method is most known as 'MeltICE' because it has been freely distributed
1 g* n: E$ K# ^ |via www.winfiles.com. However it was first used by NuMega people to allow
! V2 d4 e: f# C B# SSymbol Loader to check if SoftICE was active or not (the code is located: g4 r( ?6 a% Q6 O
inside nmtrans.dll).1 w' H& b h. O2 p( I3 ]
% d; S5 M4 X7 Q9 A7 A4 N0 h
The way it works is very simple:5 Q' A3 b, d/ t$ p! D5 \0 n
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& w& n& z! r: DWinNT) with the CreateFileA API.
9 T, v' m* [+ a9 t* m* {3 N
' v3 ]5 y) E/ ?$ x3 YHere is a sample (checking for 'SICE'):( y" X2 K' J" E& A; ~0 Z
+ ]0 U1 h$ r( b2 s) q" n- VBOOL IsSoftIce95Loaded()! t0 P! O; P- |- k
{
' D6 Q: e2 U2 }' b HANDLE hFile; / L5 M+ M6 u. d
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 ~1 O" L2 n/ j$ L7 v) J FILE_SHARE_READ | FILE_SHARE_WRITE,
# ^7 T" K" u. }0 p4 W2 M NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 r& N$ D" B* N2 } @3 D/ F if( hFile != INVALID_HANDLE_VALUE )
! m$ @4 s& w& I {
& Y$ G5 W7 @- I CloseHandle(hFile);; R8 Y/ |4 e, w7 V) M4 K
return TRUE;2 P- @" M/ E7 A( W) R- T
}4 E8 g7 W! A! u1 R( y
return FALSE;( T* M/ j5 L' t7 H
}/ U) ]8 d8 h/ ^& O( m
, U: J7 u9 { W( U& i. p3 `Although this trick calls the CreateFileA function, don't even expect to be
+ Y1 T) P8 ?/ X( ~! f( n' @ P6 Cable to intercept it by installing a IFS hook: it will not work, no way!4 i. s0 [: B2 ?
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) Y/ _& v: n4 y% mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( R2 h7 ?, N; k* N1 ?! land then browse the DDB list until it find the VxD and its DDB_Control_Proc
- Q4 h. l- I( U: o' S# ~field.
+ y% q4 | T9 q( l, R. _3 lIn fact, its purpose is not to load/unload VxDs but only to send a
! ]2 r; G) z( j* C+ LW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: p8 D/ L9 F0 Y+ a8 xto the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 `+ d* \& s( G* k! `0 d. fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* F- S4 ~- d) i4 }1 y4 qIf the VxD is loaded, it will always clear eax and the Carry flag to allow' v6 x; ^: d' h: v* y7 k
its handle to be opened and then, will be detected.
3 G& G' y2 l# M' I7 GYou can check that simply by hooking Winice.exe control proc entry point6 J5 O! F" a. ~9 ]
while running MeltICE.! R# w9 f- I# P( T# `
1 k1 E: W8 v; a6 p4 A
. R q0 N0 K' e% w) F* A4 [; Y5 D 00401067: push 00402025 ; \\.\SICE) a: ?3 B9 R* p" q0 t9 M
0040106C: call CreateFileA
+ E) \% o0 G" y 00401071: cmp eax,-001
$ d1 @' W+ T8 U6 _& ?" t 00401074: je 00401091
4 Z, f: Z3 \5 t6 m) e7 t8 ?
7 W, ~9 c& f& R9 J( u" d2 W0 o+ u- ^/ [/ v) X" U5 A7 z. J. {
There could be hundreds of BPX you could use to detect this trick.6 k0 ~" z ^: E8 W6 X" k1 x
-The most classical one is:; i7 ?* H7 t7 y- A& Q" ?# a: y
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 R1 L) l/ Q; [+ X7 G% J& o! { *(esp->4+4)=='NTIC'
/ Z' P' i; o" G1 Z0 L5 u/ j& L. A9 a5 F" Z
-The most exotic ones (could be very slooooow :-(
6 H& f+ B6 r+ I7 X w3 }# h BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) {5 _$ L+ x3 r/ Y t- @0 R
;will break 3 times :-(2 e9 M8 _6 ?: R5 H
+ [% x; J3 X# j& o0 q, M, C
-or (a bit) faster:
8 p8 M" B; e! ^) c3 V* \6 [' B% I BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 X8 f! C. V( L
# p r" @4 Q% V0 t
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 V" m7 |. z* r* U' u4 r' k ;will break 3 times :-(: m( C2 w# r/ w U. j% K- w
4 F3 l0 e8 K. _8 b: c% I" C& n
-Much faster:
' C1 x: V! `" m BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: a# m; v; ]; Q. P# F8 _! G* I; x: Z$ I# }- h- @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' m/ O" p5 V3 D% M% f* g+ ~. mfunction to do the same job:
9 H0 s: I, _2 v. d; o/ @) a$ g8 U7 |7 l6 K9 |
push 00 ; OF_READ
9 E) k1 D% Z3 t6 N% n mov eax,[00656634] ; '\\.\SICE',0% c3 b9 h+ f2 d: B
push eax8 K) z( v* s0 N. z8 \
call KERNEL32!_lopen$ O; T: S* E- ]' a1 x9 l- a
inc eax# J6 v8 K7 |4 D" p2 {# a
jnz 00650589 ; detected1 t0 ?% @5 d- a9 J9 t2 e1 e- G2 B! l& H
push 00 ; OF_READ
$ e6 y* K+ |4 j @7 @3 N mov eax,[00656638] ; '\\.\SICE'+ ]/ ^' Q- d! n3 ?0 R
push eax* m" C: y1 v; D9 q
call KERNEL32!_lopen) {% i3 g* a$ M' m T# G
inc eax. m9 T1 N1 e5 I7 g
jz 006505ae ; not detected
Q- f) E7 |. X5 Q
' P8 ~8 r3 b; Q2 z/ P/ y1 U, ` Y; ]/ E5 V6 A6 Z7 G
__________________________________________________________________________
) D0 L& V }" X- p
; [7 A( S3 j2 T5 ^Method 12" Y! A0 ?, e/ w' U- r6 G
=========
- y. c0 D! O! v% g) v6 d
: C/ y6 B% g: \2 N! MThis trick is similar to int41h/4fh Debugger installation check (code 05% i7 J) y+ N7 o6 c- S& ^/ o/ P
& 06) but very limited because it's only available for Win95/98 (not NT)
6 c0 E. d0 B4 u+ L. g5 K! aas it uses the VxDCall backdoor. This detection was found in Bleem Demo., C D& v2 D8 @4 l( f% O& i; f
. U- F8 x! p+ H+ M push 0000004fh ; function 4fh
, _6 W, |" O/ a j0 G' g2 b3 U push 002a002ah ; high word specifies which VxD (VWIN32)" _, k( x6 d% Q0 W' E
; low word specifies which service' G0 R! i( l# O5 j
(VWIN32_Int41Dispatch)5 _# f4 v# Z; t/ g4 T+ a& n
call Kernel32!ORD_001 ; VxdCall" q7 {0 g5 @. e: ` x
cmp ax, 0f386h ; magic number returned by system debuggers+ d1 j+ U! ~; z9 Y
jz SoftICE_detected- M- D. f4 ?* T; s
3 K% p* B0 X* m
Here again, several ways to detect it:) B& D; V. J$ O. d: r! d
2 u9 R! X% ]7 x BPINT 41 if ax==4f* [# K" p) ^, w5 i, f
* F4 \, ?! i4 T. B* M
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) {! z3 X/ b( D/ R
2 ?$ Q5 f6 T! F: r( k( v8 d BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ O$ `4 ~6 O, }* O
- x- ?! |' b# g# l% e; V BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ ^0 r6 Y. J3 p
9 p( m |; y/ d
__________________________________________________________________________
8 P4 w1 H' l" E, ~. s- L7 z% [
8 R* u) z- p# l- w6 P; M/ n) A7 B8 [Method 13( A9 j) \ ]/ r: m, ^& g
=========; I x9 h5 W' J* W" D1 v
% E% h+ g9 a. l: T* k/ s
Not a real method of detection, but a good way to know if SoftICE is, u, a p% ^) ~$ G g/ P* j
installed on a computer and to locate its installation directory.
- H: j3 R* F- v! l0 }It is used by few softs which access the following registry keys (usually #2) :
0 }( |; I. i" `" c! A; p j9 Z+ E$ o) o U! l7 A- t
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 J, y! `; T" D- X! i$ _" u: b\Uninstall\SoftICE
$ h7 J& h1 M7 e( X$ F/ e-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 D1 d6 H1 r: ~. m, f& [9 o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: F. W2 ^& v+ S: b
\App Paths\Loader32.Exe
+ t3 [5 J2 O6 n" V
" X/ ^; g7 q( C! G P, L
. I) M$ @/ \$ t" C g9 BNote that some nasty apps could then erase all files from SoftICE directory
1 `3 \& w) {, k: ](I faced that once :-(
' B0 P6 L8 b5 H; ^9 }
' j1 ^ ~+ ~5 |, ]7 tUseful breakpoint to detect it:
4 M3 ^" `0 R/ a9 Z7 X' _% x. P# i2 O# a+ A; v* q& H
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
2 x$ j% I4 [( S: U4 c N, C4 }7 L& l
9 u# h7 @ W: C2 A5 ]__________________________________________________________________________
! |4 R( k2 w4 c/ x% E: g1 Y$ K6 U; ?# m9 L* s3 N
C/ A) s. V$ m' b+ CMethod 14
" u J" G! f$ s2 M5 F u) M=========$ x6 P" r+ B" L; c0 r
9 j. e) N+ r5 o5 n4 T3 f' E7 f
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 h1 i" O9 ]' w
is to determines whether a debugger is running on your system (ring0 only).7 F) y7 u7 a7 }4 {6 J( ^
5 M9 C- z8 J1 L. M
VMMCall Test_Debug_Installed
U! q1 O* [: b& ^/ s3 W9 ^. h! R je not_installed
L! B3 p2 L, d \- }9 I7 i8 D
# d" {3 b3 W9 R( H3 e) e( KThis service just checks a flag.2 Q( e. L: g5 @7 a X! {
</PRE></TD></TR></TBODY></TABLE> |