<TABLE width=500>. [* C9 K& j* q
<TBODY>
5 k: e( \$ P2 ~: b8 D<TR>; L2 \; x* D* C
<TD><PRE>Method 01
( _% C3 U+ J! L! C=========. H& A! Y" P: ^( R2 U
9 y& t2 h. ] I& E; u6 _& ]This method of detection of SoftICE (as well as the following one) is5 t$ |. l' g0 Y0 N
used by the majority of packers/encryptors found on Internet.: s! `9 p" X! D' n' j
It seeks the signature of BoundsChecker in SoftICE
! Y( Q k$ V8 R/ Q& f/ f
& ?) x; Z7 h- v& U: u+ l mov ebp, 04243484Bh ; 'BCHK'
+ v. d/ W" `8 V' i mov ax, 04h
?$ z. V7 l* J7 }, D9 e int 3
$ l0 z d0 z) R3 c cmp al,47 j- S# L9 g# E/ ^5 l( {: N
jnz SoftICE_Detected' z, m: _1 |- d4 B
5 h" B* x& t! e4 z3 A8 J___________________________________________________________________________
W1 l" H" g ^" W9 F$ M* U% k4 {5 z- b' `5 y$ T
Method 02
$ ]4 r& l% o' g4 a( ]=========
0 ]. E, _, a7 J7 Z A% [2 w! C- m9 T+ {9 i0 b- G
Still a method very much used (perhaps the most frequent one). It is used' J- w: Z! R D& u: I; M5 ~) w+ `/ @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,- C7 R# `. G# \2 f5 y( T) b5 Q
or execute SoftICE commands...1 Y! N# d3 s; V8 G; d
It is also used to crash SoftICE and to force it to execute any commands
$ c& N5 `; W! _/ P(HBOOT...) :-((
+ t; T: Y3 K* C4 I3 P% s$ i- B! y# j; }# c
Here is a quick description:
/ ?" Y' ?) Q. Q- e% [* D-AX = 0910h (Display string in SIce windows)4 Z% c' Q2 o5 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); e9 v- D4 c5 W8 A6 y @
-AX = 0912h (Get breakpoint infos)! |; \! K }( P2 i
-AX = 0913h (Set Sice breakpoints)
6 C6 f, i& D4 n0 t* A1 a-AX = 0914h (Remove SIce breakoints)5 Z' `# q; |7 @7 t" g9 I. }
2 k( ~. p0 @3 OEach time you'll meet this trick, you'll see:2 i& S5 G! n, O* i: `' [0 S
-SI = 4647h/ |; m2 ?# p9 P2 w5 b# p
-DI = 4A4Dh
, u! L# K! ]- N L# T& vWhich are the 'magic values' used by SoftIce.
* V; ~8 t1 y7 j( cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
j# n; b4 g' O0 P3 a( f
; E6 q, ^" N# i, @Here is one example from the file "Haspinst.exe" which is the dongle HASP# i0 k* p9 B- s7 s
Envelope utility use to protect DOS applications:
* R9 S) V. j: |$ D/ ^1 r' V" }6 J( W s& Q/ T1 o- c \
% @0 x( U; ?% @2 y1 B/ M0 W
4C19:0095 MOV AX,0911 ; execute command.
& i# l, l* g* y" Q( f4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
- ~! W: ~; j$ x5 t+ N4C19:009A MOV SI,4647 ; 1st magic value.
5 |2 d2 v3 Y% A& f4C19:009D MOV DI,4A4D ; 2nd magic value.
# a$ _5 r4 _! g M) P$ J$ ?4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 p# `& |8 P$ Y( N. i4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ l, ?" n% o" t3 i8 l2 e- L+ i6 b: T4C19:00A4 INC CX* F3 m9 o" d+ ?1 C6 D8 f$ {7 p, o
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ ~2 P. }) j# d, I& o% \' C5 O0 }. j
4C19:00A8 JB 0095 ; 6 different commands.
* H* K5 m) N+ S1 J/ V4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 f' y7 w4 E- H) h8 Q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( q) D( B7 Q2 Q! }0 f2 f
' U% c$ z; e; q( Y/ K+ Y2 _The program will execute 6 different SIce commands located at ds:dx, which: J2 o+ L p( D6 n
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
Z& k& a+ y2 L1 Q7 P) M
& a! I8 F" X0 [. f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
, h0 I2 \ H0 T( `) l4 ?___________________________________________________________________________
! V+ A; a2 y6 J0 h
6 F: W" C. G, ]- m7 K2 ] @0 I+ R( J: ~9 k k, r' V, @
Method 038 R7 U' y# M5 a) L% T e. {/ {) ^
========= D/ l( S) Q" o& b- i
a% f$ N- F XLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 a+ q- P* d ~(API Get entry point)
+ {1 D1 q& t; ^ s& K - n( a+ f$ k% \
9 g- s1 x$ k% W% B xor di,di
& @/ o$ |2 F8 f; Y) f% ^3 D mov es,di
2 p% D% u9 M$ v- @) m# l; N" Q+ p mov ax, 1684h
& |9 I9 r8 P a( r" h( m$ k mov bx, 0202h ; VxD ID of winice
* \. i& |$ n/ W. _ int 2Fh
; F4 n3 V0 T: e& d4 b mov ax, es ; ES:DI -> VxD API entry point
5 _6 z5 Q2 ^7 p7 m- T4 v& C9 v, g' Z add ax, di3 f6 w+ I2 e8 m8 C* K+ O
test ax,ax
# O: |0 T1 P1 O: _# B jnz SoftICE_Detected, w5 c$ h. B5 k. N' i1 }/ B
1 y! ]% v1 k: g2 Y2 g" _8 \0 d) h9 _
___________________________________________________________________________
" g) i' ^. ~8 c' p
# g) `# ]) d# R* }3 Z. ~; \Method 044 w( l u, q6 s: o( O* P( T) `
=========9 ?% T* D& J1 |" H% y" {4 J; x& x
" f# X# h' X5 }6 [
Method identical to the preceding one except that it seeks the ID of SoftICE9 C; v8 x9 l, s& L8 E
GFX VxD.7 R- ?: @$ z, w$ K% m. k) A" S
4 ?, O" M! V5 K% N
xor di,di
' ?! s6 @: h) @: z) z mov es,di+ ]& P! i7 `7 P! D* _+ Z
mov ax, 1684h + M$ ^; I' C6 z
mov bx, 7a5Fh ; VxD ID of SIWVID
$ L! |) F' J; @" I) ]* u int 2fh, v% Z% z; f( q7 m, t1 U: U
mov ax, es ; ES:DI -> VxD API entry point
2 t( `. @% ?5 X; i( d2 g3 S add ax, di
8 c( H& p' ^) \+ ^* Q+ @6 i test ax,ax$ q7 |0 o+ C" B+ C" u
jnz SoftICE_Detected
# v# ]3 q |. v7 Y! _" x# B& Z" l8 H2 t
__________________________________________________________________________$ T! {% e! J: ^: a
1 H5 D% I5 m2 @ Q+ q
Y! U g) O2 Q) l0 RMethod 056 X( _' F# Y9 f# j3 p+ U" [
=========
. W" g. v( O, h& I5 \) T# }' G) Y/ J/ Z* C* q3 T" J# c% F( R0 M
Method seeking the 'magic number' 0F386h returned (in ax) by all system8 R9 s8 [ ^: w4 t; ^/ U
debugger. It calls the int 41h, function 4Fh.( c P- W4 p) |9 ~8 h
There are several alternatives.
7 k- e6 z' p" U7 `; D3 z, ^2 U |
$ h3 _, N; \, G' o+ wThe following one is the simplest:( P5 q+ E! U( g+ `1 J
: K0 e" e$ w3 {3 K, L# a mov ax,4fh% r& O& v( ^2 u9 l( r4 @
int 41h
+ |9 ~4 f7 l9 j/ H cmp ax, 0F3869 n: Y( }3 p, k% y ~, q) r
jz SoftICE_detected
! j( I. K3 X- O1 X4 Z
/ M6 M$ F$ f2 B* s% u" _' M9 R( i7 m6 \5 Y4 `/ s3 C
Next method as well as the following one are 2 examples from Stone's
% g% b: J6 p. A6 I. T! I1 x& \. Z"stn-wid.zip" (www.cracking.net):4 s/ l3 g; Z Z. L' x; R
1 y3 D. N0 h- R2 w
mov bx, cs) ?+ G% {- U) J/ v) u5 w5 N
lea dx, int41handler2' M# P% q* u4 k3 U
xchg dx, es:[41h*4]
+ Q* r/ Y. [3 \; v xchg bx, es:[41h*4+2]' Z: K* z5 Y! C7 Q2 g
mov ax,4fh
3 v: j2 J2 e2 }+ a1 N int 41h( b& S( G: B5 V& G& x
xchg dx, es:[41h*4]- D9 }$ A$ n- _ e3 o
xchg bx, es:[41h*4+2]
' ^) b. O# U, V! T7 |$ L cmp ax, 0f386h
7 y( @* C. a4 g0 Y3 ]1 y" t2 c( B0 h jz SoftICE_detected
3 P# }" O5 |. e( z
! m# Q+ J9 R3 S; Y! c- y2 L$ u5 K4 ^! Zint41handler2 PROC! Z8 c' q' O0 @5 v( Z" J! x% Y
iret7 S0 q6 D+ Z9 x4 c+ Z4 H
int41handler2 ENDP
, P9 A9 D/ `$ l' _7 Q5 j1 f- b+ ^! S& y5 f7 |
' `7 h' l+ [ d$ h0 S+ G/ ^$ n/ Y
_________________________________________________________________________# V* }3 b& d. U& r% h
7 u+ Y+ F2 `* ]% P
& W) ?- P3 t: a6 uMethod 06 d6 }* B" `" N* Z, L& h) c
=========
3 V$ H, f5 D! B* v) ^* s! }9 F
4 P' }) [' ?! |8 d" v
8 c, f9 v* I. Y( j2nd method similar to the preceding one but more difficult to detect:
4 F4 L( A% a- b! M: R& d( {2 g" a( p. g$ Y
" c8 F1 V1 W/ K* eint41handler PROC
6 }& d% I6 L$ e4 r& J# S, _ mov cl,al2 F; t% K; k1 N/ ]# h* \
iret
5 j8 |) i4 T4 X- @9 t0 j( H9 m3 _) `3 Cint41handler ENDP
3 V% y/ v" q5 M: Y/ s9 l
& \3 W& G2 @5 Y. v E( V/ }7 x3 ^: g. `+ K+ ^( E
xor ax,ax
" l3 _" }. Z0 ]1 y mov es,ax( O K) Z% o" H9 B/ U2 `+ c4 Z
mov bx, cs
* ^, n# _6 b' U Y( O lea dx, int41handler
+ A% A; Y" O% y/ K xchg dx, es:[41h*4]
( c1 x+ M: c. K/ {5 d xchg bx, es:[41h*4+2]: a% v3 a' w- u- ]% x/ X
in al, 40h
; k) J) z9 Y7 U xor cx,cx
: N- Z$ `6 L% R6 M# T int 41h1 m4 u1 s' g$ _( Z
xchg dx, es:[41h*4]
9 V l; q4 k" K xchg bx, es:[41h*4+2]
c! b* ~+ u h, I L cmp cl,al. N; l0 B: N+ _3 B( g+ e. d4 e! r
jnz SoftICE_detected; q9 l2 |. c3 `/ D7 w8 F+ D* R3 i
# w3 H) K: I% _6 ?6 [_________________________________________________________________________4 m, g7 E4 a/ e; Z- h
2 F% i5 j) X# f. U# k. p3 Q
Method 07! q' p/ G) f/ q& C' G; a: d# q
=========
8 v5 A( }* N s. g! S- W5 R! g% ]5 Z
Method of detection of the WinICE handler in the int68h (V86)3 x; j/ M8 h7 x2 D: q3 o
2 f v. F+ B- l7 K' ?) N6 ]
mov ah,43h
" \2 p6 y4 W7 q" O8 a int 68h# y" t0 S' u0 h# `
cmp ax,0F386h
) s7 L) q! }0 Q8 C9 A+ c4 E7 J; y jz SoftICE_Detected0 B/ }' K* O! g6 b# s) q
+ m& E& _) S( V% \ j
7 w6 W5 ?7 f+ L0 F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit8 ~& u7 A1 P- R' n# L: e4 c" B
app like this:/ t* q9 X! c% C) G
/ q, b8 }4 P+ e# X$ p" W BPX exec_int if ax==68
3 C/ O; f% O3 S; G6 l (function called is located at byte ptr [ebp+1Dh] and client eip is: S+ @- q& D1 K3 x* ?
located at [ebp+48h] for 32Bit apps)) @$ f) H0 T* G( x0 x+ k
__________________________________________________________________________
( T, C1 E% H: r( H, m& l, y! H" q# L) L
; h' q/ _+ ^( K# I o& fMethod 08
J$ W( |# n! ^: Z' z+ s8 ]=========) U$ \) {: @3 K* m
2 N# F8 E5 i0 {8 M) r% ~$ aIt is not a method of detection of SoftICE but a possibility to crash the( z: k- |2 j5 v8 ` A
system by intercepting int 01h and int 03h and redirecting them to another) O4 y2 r M4 W2 U
routine. {, I$ j5 N3 H2 v' _, C
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 U9 i- C* x! C; W9 d- w* @to the new routine to execute (hangs computer...)
, m) v4 {$ I2 C" x( M2 c& ^$ C. b$ m' }2 O
mov ah, 25h
( U$ L+ }* j5 ^! ] mov al, Int_Number (01h or 03h)
7 @* r/ Z6 N; k mov dx, offset New_Int_Routine* ~2 f3 e- C' p: x9 v
int 21h: Z" s$ c/ K- X7 U# {4 {
1 M4 O7 O! d$ l/ D' J. }__________________________________________________________________________
) ]0 B. k% G' s+ H1 W4 @: I
* m1 b1 p8 Y- @0 M9 W2 } B' Y! \Method 09
! X! q: M2 R/ }& ?% L" ]=========6 @) ^! a5 _6 X8 q
9 d6 B" H0 s% i4 u! ? G, Z3 V% LThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 u) a3 q1 c: M7 l- w1 s
performed in ring0 (VxD or a ring3 app using the VxdCall).. n/ H7 }" {+ y0 S% {% @( q9 }
The Get_DDB service is used to determine whether or not a VxD is installed* t" [4 B" Q$ ]' ~
for the specified device and returns a Device Description Block (in ecx) for
7 K# e0 [2 X* t! |& d& B% u& ^" D0 o. Wthat device if it is installed.
T- Y9 ]" r- g2 P6 J# ~% D- N$ C6 i" G* o$ H0 w2 u- B
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% r* q0 S. W7 G5 i. O! w9 C mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. d( e7 _' K" x2 K) G VMMCall Get_DDB
4 _% z3 W% `7 {" |( B$ n' R; K# K8 c1 g+ I mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- A$ m9 V/ L; y& y& ?
" ]" n# O% A# Y% @# [" Q9 n Q3 l4 QNote as well that you can easily detect this method with SoftICE:( T% i0 `3 J) u; i
bpx Get_DDB if ax==0202 || ax==7a5fh' D+ Z$ Z* K: T! l, R. D1 Q, l
0 i0 {2 u0 r( \& Q. f3 j) L. f6 E
__________________________________________________________________________1 g7 {4 _+ | s
' Q- B; B7 n4 tMethod 10
3 i8 k$ a' l3 c8 H=========
+ ?; o) Y; Z, x, G1 v2 N" V8 k; g* m' i$ v% v% c
=>Disable or clear breakpoints before using this feature. DO NOT trace with, u0 P( A+ m* S: z# _) f
SoftICE while the option is enable!!
0 y+ F& g: b6 |
5 j9 o' z6 @ n' A# j; eThis trick is very efficient:
, [; F- f' h, X$ Uby checking the Debug Registers, you can detect if SoftICE is loaded
* u# ]2 Q2 |+ R(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; f4 w4 }5 k" O* c7 X* othere are some memory breakpoints set (dr0 to dr3) simply by reading their
) M; k( g1 n3 L8 Wvalue (in ring0 only). Values can be manipulated and or changed as well
. B6 A8 @ Y i1 z3 g W(clearing BPMs for instance)! J5 g) W" P9 S" B) `: l% C0 }' w
9 F$ i8 `6 [, u4 C6 G, J c0 a__________________________________________________________________________! w% Q n9 R3 X- m0 o) c' V( [
0 H/ x. {$ i+ T5 r4 {. j6 K
Method 11" ]# @6 Q5 [# t1 b3 ~, X: ^( X1 S
=========2 ~( j9 o' X% Y2 Q( x7 @/ u3 J
% l# K s" z' ?$ fThis method is most known as 'MeltICE' because it has been freely distributed0 P+ B0 ?3 Q/ ^3 d$ w3 b
via www.winfiles.com. However it was first used by NuMega people to allow9 T. \" r7 X( d, H! n6 i
Symbol Loader to check if SoftICE was active or not (the code is located, r _5 y2 |- S8 q, O
inside nmtrans.dll).$ A/ ]' \; c- R+ x/ y9 _. H
8 d2 n8 I" A3 k0 `! P
The way it works is very simple:
" w9 a( E5 j( `+ CIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; x* f; l" O4 Y. CWinNT) with the CreateFileA API.
. G/ T' ^7 f$ U- Q S9 m. ]7 K9 P
Here is a sample (checking for 'SICE'):' N4 v( X! @# @; h
! t+ Q, l& A/ f
BOOL IsSoftIce95Loaded()
* n6 d3 H% _& W8 ]" f7 w{
" _$ R! u6 w9 s! Y/ Z- U HANDLE hFile;
# i* w% `: R* K1 X) J( s1 R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
: a; G3 M/ }' z" z0 m/ @5 J& d FILE_SHARE_READ | FILE_SHARE_WRITE,4 H" }9 M9 [/ ~9 r3 w. o4 x
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% b* N( p0 @& x9 q; t if( hFile != INVALID_HANDLE_VALUE ), X+ Q; f, z1 x# j! p% q
{
0 Q1 e$ A7 X* w: ^ CloseHandle(hFile);
0 D. ^* w7 I5 ~8 k; Q9 n return TRUE;
. I2 y% R! v3 e/ G5 a5 M# U! d }
+ O1 G1 z+ c7 K+ P# J, q) o. O* A return FALSE;; B- K# Z) i7 y
}
! Q% [9 e9 f i( U1 O
7 X7 k9 _% \( O9 a3 A6 jAlthough this trick calls the CreateFileA function, don't even expect to be
7 w" a8 b4 C4 z( F6 K& U$ R; Dable to intercept it by installing a IFS hook: it will not work, no way!+ o6 S S8 n. ~2 v7 l7 u! I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F" z4 i8 f( D& u+ r2 N, \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 m2 q9 L. v8 ?. A2 W6 [6 i
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
: e1 m* O! Y. Y( E' r9 kfield.
1 F- r/ ^0 j+ C5 G1 h( M; jIn fact, its purpose is not to load/unload VxDs but only to send a + q, G# ?+ Z* O
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& o: i! V% g% ?8 ~to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ B; A, [+ M8 o8 F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% t! Y( ]) O2 r8 K
If the VxD is loaded, it will always clear eax and the Carry flag to allow
5 E }- C( I8 ]$ Sits handle to be opened and then, will be detected.
8 C7 \8 ~" g* J; j$ B* g1 WYou can check that simply by hooking Winice.exe control proc entry point. F* e+ l5 a( L P$ G. C1 @' w y
while running MeltICE.
/ K" o7 Q1 H$ e- H
* g! K0 y `; R: ~5 Z7 [ V. M! M6 O% H1 s1 b
00401067: push 00402025 ; \\.\SICE
- ]/ w+ m2 k% n3 T# ?4 W. X' m 0040106C: call CreateFileA
3 l/ f& K! ?! T7 H+ X 00401071: cmp eax,-001
* g4 f: E& c2 y# w3 G7 e 00401074: je 00401091* ?- j4 O/ `1 V4 A+ n( v0 ]' I4 t0 \
d: v ?) f# C" G
, r: { l ^7 _4 s: Z3 dThere could be hundreds of BPX you could use to detect this trick. J( L' s- j" D/ M" R0 x
-The most classical one is:4 V# X% x# Y! x2 I
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& p. U6 j2 ^6 E2 |/ g7 U% r *(esp->4+4)=='NTIC'( n- l0 ~2 `& ^+ S+ y8 P
; w0 F+ g- i( M1 p1 f; a9 t
-The most exotic ones (could be very slooooow :-(
A+ ] A" m6 R& r% S' T3 U; ~* ^( B BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* {) {$ D) ? ^- T) R5 ` ;will break 3 times :-(
) K- g& o4 ]! @% Y" ?) s# I. `1 A; g# u7 L7 ?5 p
-or (a bit) faster: 7 @2 K. Y# D+ t% g
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ S. a1 l: }9 p+ g. ]- a
3 c8 P+ a; b' k, A" k/ B BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 t. q$ D- D+ G8 a _0 N7 V' I
;will break 3 times :-($ f2 y ]# `) l2 U/ [: l
7 D8 {, z. t( n+ r* N P5 w-Much faster:( m4 z( r2 L) J, ~
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' h0 h# H& u- R4 o, @1 M' v
* z6 _, L0 A5 \1 w% ?' P& J
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 |5 k$ q' ?3 X3 U7 h( s/ H
function to do the same job:! j, c; E O8 h _
3 ?& a$ W3 o2 d- j* ]6 n
push 00 ; OF_READ: q4 N8 Y6 F3 p3 j3 Z
mov eax,[00656634] ; '\\.\SICE',0
8 K! q8 k) f( U+ c5 r push eax
i! V, O% F! f5 K5 V call KERNEL32!_lopen
2 V0 J6 |% }8 j* c7 r* X. x inc eax) t: m. k7 ~; Q* q x
jnz 00650589 ; detected Q/ ]. r2 M% f: ?
push 00 ; OF_READ' X' [1 f% K5 p3 Q8 u% X
mov eax,[00656638] ; '\\.\SICE'0 G+ Q+ C: u+ {' {+ z$ H# j
push eax
" v, I. g0 ~( l1 Q D/ X call KERNEL32!_lopen+ K. o. C6 m6 l8 ^
inc eax5 T& F! o- o( t: I
jz 006505ae ; not detected p- H6 u0 c6 U0 u$ |
; d& [2 m3 ]5 ~6 ?& `* j
v; i( }& y( Y1 o. B4 e, G__________________________________________________________________________
9 |: n+ x- ]4 _& U1 K9 f0 c2 q& U: d+ k6 A
Method 129 k( @5 Z/ f, W4 }2 b9 k4 U
=========
/ h: J2 O. o$ ~7 U2 G2 q9 z8 Q
& r8 @" \ p8 n ~: TThis trick is similar to int41h/4fh Debugger installation check (code 059 U* j) ]6 ^3 V: a3 p/ q
& 06) but very limited because it's only available for Win95/98 (not NT)& |6 ~+ ]; A5 X6 p% C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ y; l7 c0 [' e6 d H! ^3 k/ r) P, v4 Q; C0 D( M5 i
push 0000004fh ; function 4fh- M+ b$ O9 h1 }+ n# _
push 002a002ah ; high word specifies which VxD (VWIN32)7 h3 ^+ V, U3 N! x, X
; low word specifies which service
7 u' p: ~; {5 O* E$ l (VWIN32_Int41Dispatch)
9 v0 M' U. h1 @+ k* g call Kernel32!ORD_001 ; VxdCall
" J9 Q2 T: f: |8 h6 Q5 n/ E cmp ax, 0f386h ; magic number returned by system debuggers
+ S' i- L! r5 G7 I3 X' {2 f jz SoftICE_detected
( a& x* {: Z& J& h
( c: a% l. `$ { ^( U* f9 YHere again, several ways to detect it:0 }; U( y8 o6 [; d) w! G3 e- O
# _" a* l# X. E+ w& |: b/ l, X2 X
BPINT 41 if ax==4f
/ R! p# K2 R+ m
; W' i6 M) u; B; V BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. i5 C4 G( e1 j, v
' R. D0 S6 o; M9 K# y BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A- _. _$ X' s9 \/ U6 h) O2 [% N
3 B- I( G+ a3 E/ }* o# |/ M. T V0 m
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 ]# o& x0 Z# x2 y. z
; L& ~; W9 ^! l$ Z__________________________________________________________________________ y+ C; U& y: _% q, Y0 O+ z& R
; |7 t4 g1 ]& b: {: g8 RMethod 13
) D U6 t2 F3 C `=========
- ]! o& r& a0 a+ n! M
2 i- \) i% |; B0 \ n+ U* j3 d4 Q$ uNot a real method of detection, but a good way to know if SoftICE is: @* G' B1 M+ D! K# a
installed on a computer and to locate its installation directory.
3 h6 S q, R% P" O- N9 n2 k+ SIt is used by few softs which access the following registry keys (usually #2) :
7 y9 N% B F, h1 d( ~1 c$ ?8 Y# d" t8 h; U* l+ g. @ X
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 H. L: @1 K+ o
\Uninstall\SoftICE
; m) s1 o: ^0 c/ N-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ q* |* O* b& b4 m; ]5 [7 I" E
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 x5 Z# ?+ [% E
\App Paths\Loader32.Exe- {+ H7 w2 |% K- E& u1 S6 z; Q
L! W/ @2 r: c d9 H+ w: b( G2 e2 F
! F' Q0 N7 w' W9 k6 {4 b) CNote that some nasty apps could then erase all files from SoftICE directory
, U- S/ f, A* x9 @9 f. H/ X(I faced that once :-(& _8 U3 i+ K S; \
& i; ^+ u" C# R3 y3 _5 J; h* NUseful breakpoint to detect it:
2 Z( W( r& W; z* `& Y5 Q0 u1 g: V& n1 m; B2 N7 g: H! h
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
& H8 p0 D; s2 o R$ p7 ~, c$ Z
- H+ ?6 c$ u! `$ p__________________________________________________________________________( i# l( z1 x: N6 U
# g4 l% A8 p; s! b! m
. A8 m# a' V) T' _ cMethod 14
/ x" a8 Y$ b# h8 I# e=========
4 z- p1 D- B8 E* R& |0 m( I' t& X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 T, r9 P x- K6 w: Q5 C) ?. n$ o v
is to determines whether a debugger is running on your system (ring0 only).4 o1 b2 y3 p, d+ q
4 t! l8 [% Z* g+ }( B8 H; U
VMMCall Test_Debug_Installed
* V8 W0 F# A; ^6 F je not_installed/ @$ v2 A0 a5 T3 I B
; J. v1 Z) `+ L7 o; j0 Y0 KThis service just checks a flag.
* y; B8 W3 b2 g: j. X- K</PRE></TD></TR></TBODY></TABLE> |