<TABLE width=500> l/ P, s3 k+ J" d; m
<TBODY>
6 M/ z" I% V$ x" G) U<TR>
" T. T2 j3 Q/ O7 o<TD><PRE>Method 01
, a0 r: o" x: l2 P) k* d) \=========* }( X2 D H9 F! x2 d$ D& P
7 @8 ]7 { r& G# }This method of detection of SoftICE (as well as the following one) is
: M- j/ l3 c# t' B1 I; e" P& }used by the majority of packers/encryptors found on Internet.1 I9 r! A: W, ] `2 J
It seeks the signature of BoundsChecker in SoftICE
+ h/ k7 @$ n1 i) R# q# D$ u$ Q5 z) i0 t: P( y
mov ebp, 04243484Bh ; 'BCHK' c( ^0 e& G7 ?' R# L C) T
mov ax, 04h
* m8 e$ U2 q" w3 `1 E5 F) e4 \: c int 3 0 a) p. ~" [7 k6 ^; G
cmp al,44 H+ [1 p6 b# b2 m$ C
jnz SoftICE_Detected
3 p1 n8 D$ m. U* k4 L% r& c6 i u! O
___________________________________________________________________________
, Y# L0 K% j* ]) P; a7 C+ z% Z2 o9 h0 Q) x1 }) A
Method 02
5 J" T# g: u" M=========
, O8 a @2 d4 b/ t) P7 G( X0 i
3 K' Z, R. w$ [, x7 w5 z5 `Still a method very much used (perhaps the most frequent one). It is used" B& R5 e/ ~- M- @, j. j- k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 J6 C* Q6 x5 Qor execute SoftICE commands.... @6 u4 ?! S4 P2 p7 |" @
It is also used to crash SoftICE and to force it to execute any commands
+ m" ^( C, f# O: K* }(HBOOT...) :-(( 1 i' J) I3 j' b+ _
9 ]! U7 ^0 N) N2 x" `Here is a quick description:+ y7 L' U% N9 b# w+ ~8 w
-AX = 0910h (Display string in SIce windows)
! D) Q% @. i: x; W/ m! F. S-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' y! k ]) J6 |4 n6 Y1 P d& j-AX = 0912h (Get breakpoint infos)
, H8 \* p2 S+ R U/ z-AX = 0913h (Set Sice breakpoints)% j; E9 h4 c1 ^" N4 G
-AX = 0914h (Remove SIce breakoints)
/ }3 [ {3 q: q
T, I: V2 k5 [) x9 xEach time you'll meet this trick, you'll see:
" N, S# e4 R8 `: M, N( m. S-SI = 4647h
u: U! M/ y, J) W e-DI = 4A4Dh
4 s9 F$ }! _( ]; d' g6 c; @Which are the 'magic values' used by SoftIce.
9 H: R; P5 p5 x4 W% hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h./ |8 O% X9 i2 p: C
0 H% j* E }' e0 D1 K; s8 R
Here is one example from the file "Haspinst.exe" which is the dongle HASP# F2 L! D* t; p9 r, ?# ~$ j
Envelope utility use to protect DOS applications:, x% S/ I' k& Z3 ?: _/ p9 j, s% W
2 k$ l& \/ h2 d
1 o/ S5 k# X2 b! g
4C19:0095 MOV AX,0911 ; execute command.
/ @# }6 P0 d% N k" J z4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( q/ o" U8 ?* z, }4 s, N. y
4C19:009A MOV SI,4647 ; 1st magic value.
% n2 L8 a2 H6 G, B; J# W4C19:009D MOV DI,4A4D ; 2nd magic value.
/ [8 V) o4 G c& J7 h! r1 A" m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 M2 b2 d9 _ c2 `! z$ ^$ x
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# n, _+ v8 c6 o! Y) ?
4C19:00A4 INC CX2 Q# W: s$ S" E U
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. E+ l" x3 z H" m4C19:00A8 JB 0095 ; 6 different commands.1 t* T1 ]% T( Q2 k, H4 |, H
4C19:00AA JMP 0002 ; Bad_Guy jmp back.# k6 p6 }8 L9 }. X3 T
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)* v) P2 q- W! @) c; G: C
$ \3 Z( h% X% M* y# X2 pThe program will execute 6 different SIce commands located at ds:dx, which1 F$ |9 H. F$ O- R7 y1 ~* V. A" I1 G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT. a$ K$ W+ Z6 q1 g, x
" L" A1 J: J; G" p. O6 v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ i; ^" I( u2 [0 g
___________________________________________________________________________
9 w3 L* T6 T" e! Z5 q
- u& B* ^. c7 T+ S k7 E9 x- E A3 P: e L6 |
Method 031 s3 }& f7 q* W& a b
=========
" T" |& U& \( M2 B# e
( o. }7 J; Q& M }Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ G- r* [: T( f7 l9 [7 z% c(API Get entry point)
+ N) G' H$ V, ?. n- E$ Z
* O! S! o0 ]' h& o% p5 A8 z6 h) _9 l3 J
5 L& l- I- g2 N xor di,di3 h# w! N7 Q- I5 n8 O+ [
mov es,di
9 R, T# _- O* |4 v" `4 R# a mov ax, 1684h
- ]" V' ]; c: j4 x, W3 L! ^ mov bx, 0202h ; VxD ID of winice4 @0 f' U2 C- |4 d: Z
int 2Fh3 x( e% {" a' r
mov ax, es ; ES:DI -> VxD API entry point$ | G) S2 R$ S
add ax, di
2 a3 T& y2 P( j. u7 g6 C test ax,ax; u0 e/ l6 g9 Z& Z
jnz SoftICE_Detected
- U; q" l5 Q3 N6 V1 ~+ `3 z* t9 J( g% s/ h7 O+ e; U
___________________________________________________________________________
7 ?8 |# u/ @% w" o7 m- t$ N% \6 g) V( K$ ~$ M' R
Method 049 H2 @+ c* u+ O& F6 Q6 w
=========1 {! d7 k' h* r; ? N
/ {: l( V, I4 z9 ?6 }. @# K
Method identical to the preceding one except that it seeks the ID of SoftICE
& {6 ?9 R+ }6 _& Q! U# xGFX VxD.: f1 }5 d# \2 y/ w& u, t% X) a
# @1 P4 w5 r: n0 B xor di,di& D) }# f3 v0 N* |/ E4 u7 {' A
mov es,di6 z" j. T- Q# K
mov ax, 1684h
- K G* ~4 K" T mov bx, 7a5Fh ; VxD ID of SIWVID
& N$ \% F) }, v# \2 s int 2fh
9 z) b4 H( O3 F; Q1 C& w mov ax, es ; ES:DI -> VxD API entry point2 A6 e8 U# r4 v0 l' Q+ A- s7 L
add ax, di
) g7 M+ j& u0 f test ax,ax" Q3 U# z" s% \& Y: Z3 E
jnz SoftICE_Detected
2 r6 B. k9 p% [! \
9 Q. [9 q/ U0 @. ] Y0 `__________________________________________________________________________2 ~6 |% V/ t$ \9 b1 F
5 {2 M; G6 X% f8 U
0 q' h* l3 ~- ~& D/ F2 U, D
Method 05. o3 I7 R9 [: p+ `8 q0 Y0 C3 B
=========0 l5 @# O0 `3 G, w( p% s7 T
, s9 P; a& [5 T. O: V9 ?Method seeking the 'magic number' 0F386h returned (in ax) by all system; z; Y8 p4 f6 y
debugger. It calls the int 41h, function 4Fh.
3 i9 N0 C: C2 pThere are several alternatives. * b: y+ Q& F' j. q; e6 c# Z
' W$ Z! Q- j0 vThe following one is the simplest:' d) g1 q j5 x. i1 X! a. Q3 Z% @
2 h8 X5 W, }) q
mov ax,4fh5 G: n4 v# e3 x* R
int 41h
( l" D# i$ w9 L7 ^5 X; @: w cmp ax, 0F386
9 [7 G) r# G1 i( z& o% u1 T/ _ jz SoftICE_detected# w. F, x4 W" p) T* @% {
/ d' i: @ N& g, w2 u
% k e# Q5 G: ]( Z; ?* F4 JNext method as well as the following one are 2 examples from Stone's ! \* |* ] P, ?: E% v' {
"stn-wid.zip" (www.cracking.net):
) [* j q- `5 E( H, m8 b$ V2 m9 o) a5 l U3 @! Y- K6 z
mov bx, cs
% Q* L. |$ o5 A lea dx, int41handler28 e, m* O' o! \ o
xchg dx, es:[41h*4]7 }+ y$ |* \$ U
xchg bx, es:[41h*4+2]& s1 ?. A# W! Y( X$ k
mov ax,4fh
6 ?2 c1 R/ r0 F7 \' w( y% G4 m$ U } int 41h h: W# X7 u# V( x) B
xchg dx, es:[41h*4]8 Z& U3 I; k% n1 P8 W
xchg bx, es:[41h*4+2]% @+ B6 {; g0 D( K; P, L3 [5 y
cmp ax, 0f386h
/ H1 k+ H1 V1 E6 Y jz SoftICE_detected
2 P R* _( \- J* a
5 ^' L/ n: u# H0 dint41handler2 PROC
8 D$ U, B8 B3 g iret
$ X! @& c( q0 s8 c0 r! bint41handler2 ENDP: d, N! K9 u7 ]% o* W2 |
/ F% r, i+ g: P- T5 R! F
- x+ v6 k; V) p* m1 V# J_________________________________________________________________________
* L2 Y5 J" x4 [% l& K r6 t7 R! i- [8 p; E- a N9 t
+ X( Y4 _+ c$ V' V+ }% Z% D$ eMethod 06
" }+ G t! h8 d( J=========
/ a d' |: ?# b; W% c' |8 q
. g+ X ]" i3 l0 K5 C
0 M* j2 x0 u! N. I" F2nd method similar to the preceding one but more difficult to detect:- t) q0 }- a. p! T4 p( H: u4 ^" X5 ^
% A/ v4 O+ T/ t* n9 c3 q8 T+ s
/ E5 ` G6 N0 ~0 fint41handler PROC$ v, X# m0 h/ Q; t6 O
mov cl,al
! W2 I5 p8 [5 j! \ iret' R+ m. C; x# _+ Q% b
int41handler ENDP0 Q9 H4 L2 Y z( u
. f9 A* b& x" l, i8 p5 V( k. i; D5 R
xor ax,ax1 }/ r2 H8 l0 u& D5 U
mov es,ax
) t7 T! A: b8 @/ P mov bx, cs
$ \+ W! U1 }1 V& f8 d# a lea dx, int41handler
9 J- q( N0 F. | xchg dx, es:[41h*4]* `# D0 N. }: |$ e
xchg bx, es:[41h*4+2]
+ v5 @ ^. v0 } in al, 40h6 V6 v0 R7 |; D! g5 v
xor cx,cx
0 }! Z5 H' h1 e8 u3 t. j int 41h" d. `$ N3 K, A
xchg dx, es:[41h*4]
" K) ~3 k4 w7 }" N3 q2 ], s xchg bx, es:[41h*4+2]: I: `: s! p: j
cmp cl,al: D& X7 V' b9 [- U+ c; E( N- e, F
jnz SoftICE_detected9 L1 Q W- w( U+ }% y5 u
! Z5 `- U( }0 H6 ?- U_________________________________________________________________________2 t9 d& A9 ]2 j* ]. I+ L
U# L9 d2 S$ |: _# O
Method 07/ N+ g' o7 u- C# a2 r
========= N6 b+ e$ ]% G$ d
7 d! _/ `/ W( {0 R; E
Method of detection of the WinICE handler in the int68h (V86)
5 d S' L% o) P2 N9 @
) G0 B) v! [5 x1 |- x3 v' m6 q6 T mov ah,43h
0 S* l# Z" r) m5 K; M* ^0 g int 68h- `- y4 [: n/ ]( h0 r
cmp ax,0F386h3 U* e3 M% q# t
jz SoftICE_Detected
5 w# e! H# G( K3 ~/ @ e" O( n+ Z/ d4 z) B4 k: D- U
+ k9 ^' ^% W% N0 W=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 ]( g$ \, b* Z( i5 }9 n app like this:
3 l F. n7 v4 B2 d
- r8 [6 A# A( Y Q% v! }2 M$ ]4 q BPX exec_int if ax==68
$ X2 q. n D3 U0 E$ D (function called is located at byte ptr [ebp+1Dh] and client eip is
/ f& i" d: [- X5 V7 Y' s located at [ebp+48h] for 32Bit apps)
* M* z. o3 H3 M7 i. V__________________________________________________________________________
/ o' p; R( e$ \+ {: p/ d7 [% g/ a5 Z. C
$ d9 v- g/ N6 c5 `
Method 08
, Y/ L/ p* h5 S% y u; _=========8 n$ i/ V8 i; i" r- X7 }
: V4 S" Z: ~4 G* u' @
It is not a method of detection of SoftICE but a possibility to crash the, {, G4 d# I5 U
system by intercepting int 01h and int 03h and redirecting them to another
7 J) a9 f8 n! b* ?routine.. F' I% P7 d4 l) A. B1 a$ I3 {
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& e: X3 V8 v) }1 r3 S7 {" I. o) ato the new routine to execute (hangs computer...)* b! d" X& K Z8 H3 b: Y
% n; O) s6 G$ h" ]( X6 D mov ah, 25h5 O& V V; b' Y8 g5 O2 _4 E
mov al, Int_Number (01h or 03h)
t# L) Y- y) u2 ?% q' a1 ~; R mov dx, offset New_Int_Routine
0 i5 ^; i' ^9 O6 y% R; y$ O int 21h
! `' i* u" W) v4 B
& |4 ~5 K- z. D2 o% B6 g__________________________________________________________________________
5 V, `. }3 Q7 e) B4 T$ r/ F
7 A3 [9 C' @) i9 J# X3 rMethod 094 v/ {/ Y0 M2 R1 G+ [) J
=========
( O! k' S" l1 Y/ v4 @( q# F x& x: Z( F7 n: K( p
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, Q" S( K) o; A' a- U3 q4 \performed in ring0 (VxD or a ring3 app using the VxdCall).) z7 F3 I: ]) `" i) T" D) ~+ P
The Get_DDB service is used to determine whether or not a VxD is installed) U' S/ [6 P3 k! J+ M0 Z) P( ~; Y
for the specified device and returns a Device Description Block (in ecx) for; o2 j" B. Y4 g0 a6 y& w) f7 _' d
that device if it is installed.
, j3 H2 H' v" c& v
$ Y) V' j" X2 t3 m1 \- q4 E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. d7 f$ y* A1 w1 J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). f1 l: d, c$ n& M- {4 c# h
VMMCall Get_DDB- M! m% `2 z1 F$ c( V! r+ [
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- e l' p- \* W) m
& i9 n) K$ N. \# yNote as well that you can easily detect this method with SoftICE:
5 I& e, p% m" S* {& G) E: w) ] bpx Get_DDB if ax==0202 || ax==7a5fh. A- l! y" z! ~' v
! k F+ o' [5 O/ C8 o7 `__________________________________________________________________________
% y, S4 r$ h. A0 }+ j5 X- r1 o, b8 G7 G% @" f$ } K6 k- ~
Method 10
. N7 t6 W3 G1 n; Y8 s% W7 o6 O9 o=========
7 d E6 V- \% e9 p# \& n! L! v' h
) i- q' {( c9 X) a* X# e; i=>Disable or clear breakpoints before using this feature. DO NOT trace with* C: V) P) V8 k, z! W0 }# t
SoftICE while the option is enable!!( d4 z% `+ L6 |8 V
: F( G! b9 U# e0 H% E" r7 c( u1 h. ?% K
This trick is very efficient:
- C3 E! h: G" H+ `" J' x! yby checking the Debug Registers, you can detect if SoftICE is loaded$ k* _1 e( o/ p4 A( f0 u4 V) c5 M
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; K8 k+ R! B: S7 |; G; T
there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 c/ u* j- P; E4 l1 f4 h6 ^value (in ring0 only). Values can be manipulated and or changed as well4 `. z& B6 V0 s
(clearing BPMs for instance)
; `# c( \5 j0 v. a0 o' K7 y
8 K! ` b" o* M__________________________________________________________________________3 ]7 ~. y: x! o" }: q
6 N1 k M! t8 G! b) n. hMethod 11
( w% @" P! y* a! r* P, S4 O=========
: m: a$ B L! y3 t+ [% C# I: O
; E* b5 q1 q. X8 {: MThis method is most known as 'MeltICE' because it has been freely distributed
5 m7 ]1 h2 L! j: G6 f# Ovia www.winfiles.com. However it was first used by NuMega people to allow8 y; K- @7 y/ @) _8 c: g
Symbol Loader to check if SoftICE was active or not (the code is located! `# F$ M% Y! S. q
inside nmtrans.dll).* S9 k" Y, f* l" G! p+ C
( H2 I; I. u; Z1 ]4 s
The way it works is very simple:
, B* L: z* ]' |( PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) t+ B- l: y( d1 h, Y$ V
WinNT) with the CreateFileA API.
1 w, S) C# N \
4 R0 [" e0 |; W8 V) O7 GHere is a sample (checking for 'SICE'):
+ a" [/ C, n# o8 f# g$ j9 D0 O" E; m$ s" e, s
BOOL IsSoftIce95Loaded()
* f3 i. q9 W' A3 K{
: w0 H, I6 l0 q* J3 v HANDLE hFile; ) a) m7 C; ^, u" h3 S: B
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: ]! ?3 Q1 p. j7 S8 E
FILE_SHARE_READ | FILE_SHARE_WRITE,; [3 @, i/ z9 a$ n7 o* O5 N9 ~: X
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( ^4 c, B) M) _7 D; a1 C
if( hFile != INVALID_HANDLE_VALUE )0 x- M8 s8 l8 q0 E! J5 ]
{- c0 Y$ h9 c! O. \' i' S
CloseHandle(hFile);# Q# z, g& c1 Y9 {1 L
return TRUE;
9 Y- i* ]- D/ g- Z+ [ }
, ~) y* n4 N2 U6 u9 @) Y return FALSE;
8 _4 g; ]- v2 |# e+ a* f: D}
" ~6 P2 g; ^1 l' `7 U' Z
: d$ w9 A ~8 g& CAlthough this trick calls the CreateFileA function, don't even expect to be
|* A. D u2 r( rable to intercept it by installing a IFS hook: it will not work, no way!4 l4 `$ P; O% g Y( S- ?. [
In fact, after the call to CreateFileA it will get through VWIN32 0x001F [$ h& @( d. H! r* D4 n) s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 }4 L: T6 X% G; k
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% s3 M0 q: v: n8 o$ k7 {( d9 Zfield.
4 N" S' @3 x$ kIn fact, its purpose is not to load/unload VxDs but only to send a 2 A; Q1 C- V7 ^1 }! m8 i
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. | L- W; b$ e5 W1 h5 Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: _1 S: I. t. O5 A# H' tto load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 I" Q/ R) Q! `0 q8 |( h. U K9 h9 b: zIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ }# o# g* X4 n- D8 c4 E+ ~, V; ]its handle to be opened and then, will be detected. V0 N, ~: Q, H: p" O1 c, R
You can check that simply by hooking Winice.exe control proc entry point8 x O9 o, f- o9 {$ n9 E4 C
while running MeltICE.
# P d: o* b# |0 n1 S$ }3 w& Q: j9 Q& j0 L( O Y5 p
4 r# C N' ]6 p! r U+ j4 O 00401067: push 00402025 ; \\.\SICE) L3 M, X9 |" o: C) C# _ s/ H
0040106C: call CreateFileA
8 @0 R3 R6 v! P: ^# \5 p 00401071: cmp eax,-0019 w" Y! g' \* ^, C
00401074: je 00401091! y4 D I) R, }7 n: ^' k
5 m- ]. t/ N0 V
1 ^& m4 }; k* ^" A& D e/ t8 X5 f
There could be hundreds of BPX you could use to detect this trick.
9 K- C$ } P9 ]$ E" G# f: J-The most classical one is:/ J) {7 L. J+ W; C' U4 G8 `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 d; n4 H' Z6 i; F: ^1 b
*(esp->4+4)=='NTIC'
L5 e/ M4 u, N( c! a; W/ o2 Y5 m+ @/ N
-The most exotic ones (could be very slooooow :-(
) J/ @: m9 Y- ] V BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : o. e2 Y; B2 |; L9 i; Z
;will break 3 times :-(. L- T$ Y6 M7 m4 L
& n3 \6 b6 @0 |; i' n0 ~-or (a bit) faster:
4 c z' @ _5 A5 I: G BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% e( w7 e& f6 U( D* c. @" W
; x$ e! `; _8 V4 } BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 N ]/ b4 }' d5 _
;will break 3 times :-(2 `9 k* z! }6 J, v# q
4 {# z. b- l) H) ^7 S7 E3 K-Much faster:! ^' X9 I; c, ~/ m2 p) b
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'- Q; g5 p" `- r9 J$ s7 o$ U% z
* f a3 k1 q& R5 KNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ Z+ T2 n, H) p* Y; w' p1 _function to do the same job:3 G6 S s" ~* D
) Y0 k" A( `) p8 C2 G y
push 00 ; OF_READ0 b. k& Y8 u3 I! p
mov eax,[00656634] ; '\\.\SICE',03 o K1 V! Z% p+ L. \
push eax W* c; w! P2 m: B3 l- Q
call KERNEL32!_lopen
6 b6 U7 a( y) {# ]- X( U C* U inc eax6 V' f J7 _; L7 t0 @
jnz 00650589 ; detected
; T% j4 M! {: n* k: ~ push 00 ; OF_READ
' ~1 H! @$ s" J6 W: K mov eax,[00656638] ; '\\.\SICE'7 k" @$ |, k" C" t) o, \
push eax; ]3 O+ I' T3 g9 k6 @( L* _, s
call KERNEL32!_lopen. W: L- U5 N, i3 B3 }
inc eax. w: l; C1 f- f
jz 006505ae ; not detected
& V6 Y" h( ]( Q+ f0 Q5 K
/ o& z: o. e, Y' N( |6 o l6 h
3 |& E3 C# U" z) v; G. T" h: ~2 ^__________________________________________________________________________
% M. T0 `$ C# L2 d5 w7 c# u
# e4 R/ p0 Z1 b# f( W3 ~; f$ \* rMethod 12 G3 f1 L: `4 w9 U W. K P
=========# P* N+ V; y$ H; Q( C
9 b2 F/ C f! \" Q0 r4 Q: K% ?" n
This trick is similar to int41h/4fh Debugger installation check (code 05% |) G- Y6 {$ q3 W o- U$ ?/ _
& 06) but very limited because it's only available for Win95/98 (not NT); h9 o& i4 o3 O" p) {# s. \! }5 g
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! g; V; }. f+ a% ?0 [: Y7 i4 H/ h0 c% _4 J; P; r
push 0000004fh ; function 4fh
4 Y& q. K) w. _2 a# p push 002a002ah ; high word specifies which VxD (VWIN32)2 f& k6 {1 x+ c9 u
; low word specifies which service: Q5 u' M% r& [& r3 a
(VWIN32_Int41Dispatch)6 h$ U7 q- |3 h$ M H9 `- e
call Kernel32!ORD_001 ; VxdCall K3 |9 Q$ g) E- B* _4 d& B# g4 L
cmp ax, 0f386h ; magic number returned by system debuggers* Y" b0 c# Z# l& K
jz SoftICE_detected% ~. r0 ?* O+ J! u- F
4 }* P/ G1 G% m8 t+ D: [3 `" x
Here again, several ways to detect it:
: l' x' d. g b! B& ~: I2 {% N) m2 O% L! l
BPINT 41 if ax==4f
$ I3 C( ]& ~6 n' S; k& {! f
, n7 V7 L3 @% f) ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 H' I2 M: G/ ?5 r" j1 r- ^
2 c0 c' _4 ]7 X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 K. \. J& _. M6 d+ @+ d, _: B
. M% f, f/ v: Y1 K% @ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
9 S3 A, L$ {4 n" g
1 j/ ?% b# ]; d( E__________________________________________________________________________1 }& M9 \: ~- m2 Z7 T/ \
' }- {' J6 z$ r7 l: }: }2 _$ ZMethod 13
3 a6 x7 v, L7 c; T5 ^# k=========
+ D4 a9 t* e n. x& z$ F, k+ P* b! [. N9 D! U, z& V
Not a real method of detection, but a good way to know if SoftICE is
3 ~% }2 Y. Y, x) j4 ~installed on a computer and to locate its installation directory.
: k* O! m C9 s9 _3 pIt is used by few softs which access the following registry keys (usually #2) :
- }2 ~/ B3 z* x( f; m& q; i( A6 y! ~$ H$ w* P( `; k% G( z: c5 r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ E/ }4 F' M& V" }" v D, ^) x- Q\Uninstall\SoftICE
- G1 Z8 M' V: V, i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 \7 E R9 R V0 `: q
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( R# U g5 E* ~- ?! {+ ~\App Paths\Loader32.Exe4 U. t( W4 n7 H8 ]$ Y
# r9 E, g L1 J9 \( H% g( y: L
' Q/ l0 C9 H! i( D' JNote that some nasty apps could then erase all files from SoftICE directory
2 f: Y: D! h( w) V' Q(I faced that once :-(3 \1 i' u( ~$ M. ~7 d4 ~
4 q ^- S) R! ~9 w C$ P8 i
Useful breakpoint to detect it:
: h W u( Y: S& t) N- e$ g2 g2 ^; n. z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
`" q0 _: ?# m
% H) c/ f+ H- B; a( R6 M0 L__________________________________________________________________________
; h, t4 L5 ~! G0 Z% q
, q0 [0 }# {- K, i/ P. n9 z/ j8 I5 p- ]4 q9 j x2 R6 c' N
Method 14 5 R" A3 T- Q( h' ^. a; |
=========5 k' c; i @7 Z
% R; ^9 g& \' F* d" n7 ~
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! q7 L% Q- ^/ q3 \. c& \
is to determines whether a debugger is running on your system (ring0 only).5 @0 L1 U6 A* [& K; z8 s8 r
7 k# {: @: j: `% p: Y
VMMCall Test_Debug_Installed
! r6 z0 j H( C$ |# ^( m je not_installed# J" W& ^+ z: M+ i
4 Q4 p: w7 w1 a3 v7 C `6 yThis service just checks a flag.
0 ]4 E/ \7 i$ E- F) f</PRE></TD></TR></TBODY></TABLE> |