<TABLE width=500>
9 J' J$ f6 Y3 B; S5 E<TBODY>
$ \8 r5 Y1 J$ O& s$ y<TR>
+ y! x' G7 O E5 V+ A$ p2 b# g( z<TD><PRE>Method 01 / `: s5 P5 Y- N, v& t
=========5 c, c: }) ?' N V3 w
! F. ~4 K; p" o- e. i. s
This method of detection of SoftICE (as well as the following one) is
$ I8 ]! j5 T! e' eused by the majority of packers/encryptors found on Internet.. q# l3 V9 U5 }, G) z7 e& Q4 a: b7 [
It seeks the signature of BoundsChecker in SoftICE
$ l" f6 u5 |" [- z9 `. z) Q& X" S
mov ebp, 04243484Bh ; 'BCHK'
; L9 V6 A* m1 l% O" E) Z" D mov ax, 04h
7 ?! {% F: v9 N8 y ~ int 3 % i- u) u. u2 D7 s
cmp al,4
3 ^2 r* u8 F. x3 F jnz SoftICE_Detected
8 @0 N3 Q; _+ g% F7 M# a' o
" J7 @" C0 V9 P. S$ t+ I0 b___________________________________________________________________________
* i6 m2 o3 v' k/ u4 C8 T5 A8 G R, H3 W) e
Method 02
# j- m6 [% N9 ~5 V: e=========
4 e+ X& }7 l) f! h0 I( d/ i9 w8 W! T, |* x4 y) X+ k
Still a method very much used (perhaps the most frequent one). It is used2 z4 P/ ]. B- W- z1 ?1 |8 d2 @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! z. d8 h: M' for execute SoftICE commands...: W% t9 q- B8 F b. i- s# A& t/ K7 C3 `
It is also used to crash SoftICE and to force it to execute any commands" Q' E2 [8 P9 h1 h
(HBOOT...) :-(( * R; n4 G, ` p
* J% ^1 Z0 _) l6 G6 {% G
Here is a quick description:
) F) d/ a5 z Q- {-AX = 0910h (Display string in SIce windows)( w ^* @2 ~' N6 ?
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
% I A5 h9 X2 I6 D$ ?, g-AX = 0912h (Get breakpoint infos)
8 c5 A2 [, |$ v7 a! h% |-AX = 0913h (Set Sice breakpoints)
- M( M' S' g7 N! i+ _-AX = 0914h (Remove SIce breakoints)" z# |- P% K9 F9 }, Y3 z; E
$ M- Q. u H) e' x5 O: r8 M) R
Each time you'll meet this trick, you'll see:$ j+ q2 C( O6 R% }; w
-SI = 4647h8 [7 H% F5 q/ X- [% J$ f* I) x* a2 e
-DI = 4A4Dh$ y. ?. o3 C9 u9 [/ W
Which are the 'magic values' used by SoftIce.
9 Z9 b, x" F0 a uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# C2 v8 H0 v: m$ [- K
3 V, a- Z: w$ W% T4 V
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 D9 R8 q. s) l7 s# T2 v
Envelope utility use to protect DOS applications:
) s, J/ L5 n% h( H0 N3 n* |2 l
; c7 ~5 ]3 C! [
/ @5 C2 S) T) M n5 J0 e4C19:0095 MOV AX,0911 ; execute command.
* \3 v, { [4 N- r" E6 E4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! M7 X& y* I* K% t9 |4C19:009A MOV SI,4647 ; 1st magic value.
0 y6 b) S' M% a& l1 p z4C19:009D MOV DI,4A4D ; 2nd magic value.8 u. E/ g7 X. g/ C* ]9 T' `; C" ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, @0 U0 R; X8 f* ?' [4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute h6 z/ U- d; x; M
4C19:00A4 INC CX( |9 ]4 U% [; F, C
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 n" p) o' C( _1 J3 q3 }3 [- x4C19:00A8 JB 0095 ; 6 different commands.# m% z( e3 @% m& C
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
{1 M$ q4 T6 Y: n V+ q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% F2 T5 G" f( {. u8 y
* h( p' }9 z3 m* XThe program will execute 6 different SIce commands located at ds:dx, which
9 J" |+ p6 _* {# r3 B Q! eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, H0 l9 h3 a8 n6 j$ h$ o; p7 `, X+ ~8 F$ z0 J9 L
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% K2 [7 G$ t, Q7 b4 g
___________________________________________________________________________
2 ~) ^4 `* g: F6 l; c
' }. N: u! c3 o @0 b% i4 L# z2 S ?% I( T
Method 03
5 O( ]2 z5 B; e=========& y+ \/ b% n+ I) S) U
. l& g% F4 {7 q( p* W2 U: KLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* `2 P( k( j! W; ~. I) P(API Get entry point)
) l+ s4 l- F7 D 5 b: U( U& Y/ k; [2 O# p: Q+ c* J
6 r$ @: E, B9 A$ Z, ^) A3 h
xor di,di
; K" f/ X8 [8 S9 w& ~ mov es,di) w: p0 W: Y$ D- g" n0 _4 Y, {
mov ax, 1684h
" P: J D& O, w% M% |" Y" E mov bx, 0202h ; VxD ID of winice
5 v- N* [# s Y A int 2Fh1 q- X2 r7 m6 K0 h
mov ax, es ; ES:DI -> VxD API entry point. D2 X/ B- @, I5 ^1 N2 j0 |
add ax, di
9 i7 t3 s) ?$ M" |" n. ~ test ax,ax' D; B7 i' i& `3 J, Y! L8 I
jnz SoftICE_Detected D% \# d3 E# n' A* L$ s6 J
. ]; O; y+ F2 x___________________________________________________________________________' `3 N$ w% n5 ]+ _& e
0 r& j1 k: Y0 |$ pMethod 04/ j% J6 ^$ t( ^$ U# \6 }: \5 t
=========
% w3 a% R9 s4 X
$ o+ j" y* G. T- ]" v8 r3 gMethod identical to the preceding one except that it seeks the ID of SoftICE
, l2 x! h6 h2 F6 JGFX VxD./ Y! x+ h I- U% z& g7 G6 V
1 I$ [1 x( N5 d9 u. M1 Q' V xor di,di
A; u0 V: a, E8 L; B! T! R3 \: U mov es,di. p/ f! _4 R% g! R
mov ax, 1684h ' S1 I' M" n6 q- {9 M
mov bx, 7a5Fh ; VxD ID of SIWVID: e" w" n9 r) m( X |% x w& y: r
int 2fh
% k3 k, v$ Y. L, t9 u" [ mov ax, es ; ES:DI -> VxD API entry point
" R& u- T# S5 ]* i add ax, di
4 z3 R% S5 S1 i1 k! H4 l test ax,ax" y, o. e0 F9 M. }, }
jnz SoftICE_Detected' s6 T' c$ s& f7 N
9 j. q. ?4 ^8 v" Z& {__________________________________________________________________________" C4 C2 C' P5 u1 R3 I
* N. t7 G/ B( `1 Y; L
7 c u0 P7 n5 e' i/ l, i
Method 05
! b3 s' p' |- l% ]' G=========
5 h, P. k3 t; k& n* J; m. w5 h! K' X$ ~' q
Method seeking the 'magic number' 0F386h returned (in ax) by all system T& @3 W- X m, K; L6 R& K
debugger. It calls the int 41h, function 4Fh.
4 s+ n- o% r) `9 OThere are several alternatives. ) y5 b+ b( P/ ~7 |/ z+ h
4 u* O9 x. w8 b0 Q/ ]# ?, a2 H: K0 OThe following one is the simplest:2 Q3 v3 q" q( m, Y, i* c
/ z1 @' i7 P8 Y8 P
mov ax,4fh( W1 b2 l' }3 X6 q
int 41h
7 m8 d; x: X. o* \ cmp ax, 0F386
- n4 z2 E( w$ R6 `& M5 s jz SoftICE_detected
9 @" q* V2 L2 `7 s8 W, r4 B
2 M. X0 H6 `5 v, E8 ]9 Z
3 I- X! o$ [% A* i$ d' l( @+ [Next method as well as the following one are 2 examples from Stone's
. V+ j7 @0 E9 ]& W! y. h$ d3 M) F"stn-wid.zip" (www.cracking.net):: d/ G+ e# ?: y1 B/ x; h
i1 u% W& G5 K+ ` ~% i
mov bx, cs n) i' w% o7 ~. p
lea dx, int41handler2
; t5 k4 O1 t/ C1 Z xchg dx, es:[41h*4]
' K- ~& z, U3 n0 p xchg bx, es:[41h*4+2]
; @0 R' ^$ E( w" d mov ax,4fh9 @( J5 H! t/ N
int 41h$ l. s7 l3 D- L6 t1 \* E. _' P
xchg dx, es:[41h*4]
% K. j5 @$ L$ B9 v. V! o xchg bx, es:[41h*4+2]
* i8 `3 E V& {( z! i cmp ax, 0f386h
) D0 M7 `) E7 i& Y; T jz SoftICE_detected' U% ]6 l- ^. H8 M6 x. P
) `* F' G' k, _int41handler2 PROC
" F( A% t0 w; }! o iret
! j( T" I5 e8 p4 d* Yint41handler2 ENDP
' P' k6 |' u) [, J g2 V
2 w9 Q+ J& i& Y* r* Z* F1 K8 i8 _
6 k- J9 D9 r1 h+ w6 I_________________________________________________________________________
* J x4 v9 ~) [; }8 ~8 a1 O1 U' m0 }1 m6 i2 L, x
: c- ?8 m1 H" q0 W
Method 06
& }# H% F, E3 T( d$ }; N& Z; q7 g+ B=========
4 a$ L K/ }" ^, W: q4 \: d+ w) h$ C
, B$ q, s. u P" m) A7 g2nd method similar to the preceding one but more difficult to detect:1 i0 Q @' R3 r( J: {$ N9 a$ b
7 v* ]8 \2 _* p: [" l
+ G+ |6 j, y' p& p1 _int41handler PROC
' z% O f$ |0 i$ c9 u mov cl,al. E0 r2 ~0 { Q0 i7 P- }
iret6 D, ]5 M3 J# ?& W, s
int41handler ENDP1 }/ m3 i9 A- }' F! j V/ [
e6 x, f3 M `* w# H3 y- P7 D
0 A: s+ W! u9 G8 Z5 D
xor ax,ax1 @" w5 `7 U8 I1 y8 ~# r& B
mov es,ax
4 C6 I& q/ @% X4 M0 ` t mov bx, cs2 ]+ [7 `# l" o; ~$ A& c
lea dx, int41handler7 o1 s! H& H' l( Q( F
xchg dx, es:[41h*4]
- }( F) n: S& E xchg bx, es:[41h*4+2]
3 V$ `" e/ S/ k% } B/ M in al, 40h
/ s$ B2 X% t: @; x xor cx,cx
$ U# M9 h8 f$ N9 B- |& u int 41h! n/ z$ j6 Z9 Y4 f5 ?
xchg dx, es:[41h*4]
4 l( [* n0 N0 w. V xchg bx, es:[41h*4+2]
8 [* J/ R5 b- g5 A6 U1 J cmp cl,al2 X# ?5 }$ k- z8 k4 W6 I' M
jnz SoftICE_detected! N* \' U+ b* N( X+ T! i; H
2 F. r: |& E' b) q9 o5 M1 E
_________________________________________________________________________
. i9 f+ h1 t) e
' a+ g! I5 {3 BMethod 07
- f: Z- |7 X/ A! s; F=========
6 V$ {/ Z; f9 b" M2 c7 ~8 b3 Q
0 L" o! b7 }! r4 [Method of detection of the WinICE handler in the int68h (V86); p& [( t0 B( ]. c* Y$ `/ J7 ^
; D; a8 V) @; q0 n1 g mov ah,43h7 \ y. Y v/ s7 L S/ G' H9 }
int 68h# s4 `" @* E) B# U) Z2 P9 h0 K
cmp ax,0F386h7 ]1 a' N2 y: b
jz SoftICE_Detected
2 f6 o2 s7 q6 D! F6 l) d( c7 b7 h: I: u$ s4 T
! d( [* {1 V: f$ \# H
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 m' d: z1 V/ z( @6 A app like this:; c# I" m! I$ s1 E* k
: k w- }" i- b: G
BPX exec_int if ax==68
5 G1 V5 Q/ Z+ F, q3 P) K8 { (function called is located at byte ptr [ebp+1Dh] and client eip is" `8 L6 W5 b1 h- y& W
located at [ebp+48h] for 32Bit apps)$ L1 o$ i" Y1 V, W( E
__________________________________________________________________________
% x( t- g; ^9 i7 D4 h& B4 b1 u) \# f5 k5 G! q" k
" }% u* { U: X$ P& U, H) aMethod 08
+ o: a# l: W- e# G) m5 r=========, i2 F7 Z6 I$ w' G# y
4 c5 Y# m0 T) a% _' x* K
It is not a method of detection of SoftICE but a possibility to crash the) S" Y4 R) E5 B
system by intercepting int 01h and int 03h and redirecting them to another2 `9 D3 k! ^! r( G
routine.
" N, A$ `* D) ^1 r" ^6 vIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 B2 \+ s6 l+ M/ }+ @, tto the new routine to execute (hangs computer...)/ X% C5 p1 |! Q
' D$ i8 L3 j+ Z( r2 |( k
mov ah, 25h4 c$ W1 A: G6 H) Y
mov al, Int_Number (01h or 03h)3 v+ E, k( a/ v/ ~
mov dx, offset New_Int_Routine7 i+ N6 _. Z7 }' C& z
int 21h. t* S' I" Z% Q9 }4 f! ?" N' ?1 l
b S7 S: X9 b0 t& \0 O__________________________________________________________________________& P( m3 ?: ]" V( i
7 o3 t+ {+ q t. o+ T
Method 09
% _1 U) L5 H; x0 U8 D n9 [" w=========) q' V+ A5 s: G7 T8 G" a' d* k
( M4 Q1 D9 ]- y0 h* `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- p: P* U% e6 V* j) p
performed in ring0 (VxD or a ring3 app using the VxdCall).& b- @6 F- x( s& U' c
The Get_DDB service is used to determine whether or not a VxD is installed O, B; V4 H! m- B) |& ]! B( D6 r, U
for the specified device and returns a Device Description Block (in ecx) for3 _8 N; y8 @% H1 R
that device if it is installed.
6 @/ T0 q7 x2 K( \! g* R. b% p$ P) j! y/ D- T- Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ X" n+ R" w: f# }
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 h4 Q' Z5 k; t1 t, K
VMMCall Get_DDB
% b" y, f4 ]8 E! C& a5 L/ G2 | mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed% ~: S$ M, x+ Z8 \
; j+ [) x$ C( L( o/ c6 }
Note as well that you can easily detect this method with SoftICE:( K/ j# Z- j. ^0 G8 i( E% r
bpx Get_DDB if ax==0202 || ax==7a5fh$ p! B" v) J1 D0 |
2 n9 k# p! }; ^2 j
__________________________________________________________________________
Y/ W7 i0 [0 u6 ~ j% p
3 t+ ]/ l4 v7 y* t' c1 N+ ?% M6 v6 wMethod 102 _1 M& }. l- r3 J6 f; C. H
=========
! \- Z4 i: o H2 \( f8 V) _/ d, O4 F$ Z' ]* p" G# ^' u. z/ u6 @
=>Disable or clear breakpoints before using this feature. DO NOT trace with
8 m" b$ h; [; P6 V SoftICE while the option is enable!!8 r: p. O. P5 D; V
9 g9 ~' h9 _1 D, Q/ A, G
This trick is very efficient:
2 ?0 U2 }3 d/ uby checking the Debug Registers, you can detect if SoftICE is loaded
6 H9 o/ @4 S( K& u9 M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 _0 ~& G8 K7 F) y9 H! `
there are some memory breakpoints set (dr0 to dr3) simply by reading their4 k ?% D e7 \4 r
value (in ring0 only). Values can be manipulated and or changed as well, N. l9 p- w5 ~* B V2 l! z
(clearing BPMs for instance)
% ]& d/ V& r l: q: w
: `. [$ v j6 @__________________________________________________________________________9 Z I- l. r( e
5 F" p: f& w& R* B: I% z2 g \Method 11
( D- T# S/ J2 B! S8 F; {=========
8 S6 S+ l1 ?6 J+ n/ C+ i+ u9 ^: I! @" v# F' {% u
This method is most known as 'MeltICE' because it has been freely distributed
: C1 c) O. b! E+ C5 y# A: Q, cvia www.winfiles.com. However it was first used by NuMega people to allow
, ~5 S7 i+ q8 k0 F) f1 aSymbol Loader to check if SoftICE was active or not (the code is located
7 Q a( }) m7 b: }inside nmtrans.dll).
; v* e# h) n4 E- W2 ?9 \2 e7 ~0 O) c; k' J
The way it works is very simple:* b. C$ _ F7 w
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' P( Q9 R8 a R$ ~5 E: ~) WWinNT) with the CreateFileA API.
4 A; b2 H) b. K' f/ }0 _3 h" Y
8 Q z5 A8 \" mHere is a sample (checking for 'SICE'):* Z, ~" c* ?) s% o
: S$ _, I c; f' \4 v; c; ^, a! wBOOL IsSoftIce95Loaded()+ g# o. a9 g! A7 Q5 l$ p
{
) W* i; W% W7 G& a+ P HANDLE hFile; , q8 t' s9 i- G+ o
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ r7 B" z" {- H* ?( n+ Q
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ V! x |) n5 {8 y6 W NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' C9 e: ]' v# g* g+ ? if( hFile != INVALID_HANDLE_VALUE )
( R& L( B: e' z% W {
a' K# o" }9 S* H& n, R+ Z CloseHandle(hFile);' T& f: \# M' s. u& W
return TRUE;
4 e7 j! U0 s& A3 J* M }. u# V& e3 n/ K) v1 {
return FALSE;- f7 c- s. H7 m$ \
}
7 W5 Q4 a; |' q% b
5 a$ g+ F3 T ` `' s/ h; Q' vAlthough this trick calls the CreateFileA function, don't even expect to be! |2 ~ E( J. A) _3 l, f
able to intercept it by installing a IFS hook: it will not work, no way!
# G1 M1 d! R/ \8 f2 {: pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" P) g# q! X8 K9 N0 jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ \+ b# V1 w7 `% a/ j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 }6 j S1 |$ t& F8 q' Tfield.
" p C% m0 p1 eIn fact, its purpose is not to load/unload VxDs but only to send a
. n4 I: |2 L, _ K9 Y' e$ U# \+ ~ bW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" m3 Y! u/ O+ M( X I& y! y7 z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try# d5 p+ R1 B' @1 f# k; W# A7 _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 F+ S4 A/ D- i" h6 M
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' K7 t4 f, P2 D: u& ~9 O/ \8 uits handle to be opened and then, will be detected.* v5 s) v* ~* r6 M8 S8 b- x( m0 k+ ]# G
You can check that simply by hooking Winice.exe control proc entry point
" I2 x4 Z3 Z9 `4 ^5 Fwhile running MeltICE., ?' l# t- ^/ R/ Y% O
$ Z( g# U2 y: D0 d7 t! g/ t" O; K/ O }$ w3 j- w% T, u
00401067: push 00402025 ; \\.\SICE1 c, p0 q$ v' g( d
0040106C: call CreateFileA. m; B, s) S% B# X, n+ y0 U8 X
00401071: cmp eax,-001; X: O5 q+ H2 ]/ ~& B" W4 X# N
00401074: je 00401091! E6 O, n+ [" S+ n# R
" W) m; h3 a$ Y4 M$ G
% O% w% d$ W x" h' l& f
There could be hundreds of BPX you could use to detect this trick.
3 e; b8 _7 {) s$ n B3 [7 l T( @-The most classical one is:# J1 M6 O! |/ s, h; }! p0 n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: A7 D: b, x, R/ w: Y
*(esp->4+4)=='NTIC'
% ?$ [1 ~ i b z K/ P. C- n5 ?" V) `
-The most exotic ones (could be very slooooow :-(
, ?& d E7 z9 P" H! ]( @: v BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " k. C3 u, X* \ m5 h
;will break 3 times :-(7 T9 Q! b+ ?( W1 o8 }6 X
" j% M- \& H" m: v/ A9 J
-or (a bit) faster: " h. E# q8 L) A0 l: D
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# |( [- d6 W" u8 E# f/ `4 ^6 Y5 B2 e3 I% Y4 ?
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 C% n; i0 ~+ n+ g4 o o) e3 u* w5 W
;will break 3 times :-(
; D M. B L0 V+ U
$ n. C' }# }) u; i# n-Much faster:7 b& a3 J7 E; S. I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' s O) j3 Y/ J
1 R& i; S) s4 T2 a) p ]5 HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
# v% L! e, v- P. m/ b* G( yfunction to do the same job:
/ p4 \: s0 y9 V7 h; I# ~$ s7 @/ y' s; i
push 00 ; OF_READ
5 [; s7 r4 q D; r mov eax,[00656634] ; '\\.\SICE',0
! u0 b) W+ N! h" O' ?, g$ W push eax
% E6 ]% u" r' g- m/ ?9 h2 v. v call KERNEL32!_lopen H. B4 `- r0 ~4 S: A. d* z" x
inc eax. I7 B7 i* g- M3 @! u
jnz 00650589 ; detected. M V/ k7 Z. g
push 00 ; OF_READ' l3 d7 `" j% y' i/ _& A% ]+ L w
mov eax,[00656638] ; '\\.\SICE'+ ~0 O8 f J4 `4 l) a0 I9 W
push eax$ E) r$ m/ @6 |9 N! p5 W8 r
call KERNEL32!_lopen, i4 L. T- D5 k' L" Q% x5 F# x& [
inc eax
8 l6 x; ?: y1 p3 a+ C jz 006505ae ; not detected }- V' n; G& P# t- Z' m% p) H1 z
1 f3 U' a% B g. L e
3 |$ e, r; A; P3 ]/ G1 w
__________________________________________________________________________/ M, A0 |+ M5 T8 ^
/ G C# J( A8 JMethod 12! M! s8 T( X: R8 [; e$ r
=========1 r& F- W8 L% {% J
7 U0 p' S5 b" h- JThis trick is similar to int41h/4fh Debugger installation check (code 05
" W7 U% S* d) P+ s) P# L: g) _9 V; M& 06) but very limited because it's only available for Win95/98 (not NT) ~7 T5 I+ M- B$ ]8 w
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.( x& v. c( S. L$ b5 j
, k" U4 j- G( a# E4 ?, V1 w
push 0000004fh ; function 4fh* V7 V0 Y1 Z2 }
push 002a002ah ; high word specifies which VxD (VWIN32)$ Q, ^0 ?7 e+ D! R! E0 z4 a
; low word specifies which service
4 s: G1 `$ n+ x- A- Q (VWIN32_Int41Dispatch)
7 T# U8 o* N/ P" W7 Z; G3 K. Q4 L2 _ call Kernel32!ORD_001 ; VxdCall
$ M9 d: j; y! |+ y2 v- f T, u) M2 j1 d cmp ax, 0f386h ; magic number returned by system debuggers
R. E0 E5 o$ a9 \: S) g& K& r: g jz SoftICE_detected
/ u2 t- M' ~% i- v8 r _( ]! N; T' z0 ~& B9 ?" r
Here again, several ways to detect it:8 Y% k1 t7 C! S0 h; @
2 e: b/ V2 w! q
BPINT 41 if ax==4f* z3 d1 j7 P& d* {) v7 O/ U
8 I5 U/ R0 Y) \! q. H& n BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ a4 L" c% z+ _" p- h: k
$ Z" D) C% x8 X( T9 H9 [ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! ]% U/ A# E1 C2 D% x# z( L0 D
& T* B8 r7 Z, c( `% ^, u9 P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
( x Z3 a: R# R2 W. I; \6 ]. D1 i6 N/ G$ _
__________________________________________________________________________
6 L$ M9 ]2 t4 F! y3 z
+ d G! z k# T6 @Method 13% @ B2 j8 ?% q2 }: u0 {
=========
" J; v+ @. f) B! z- C @
g4 B$ x( k5 {# b! e# _7 _Not a real method of detection, but a good way to know if SoftICE is
! _% s# f! l9 ^( winstalled on a computer and to locate its installation directory.
- k' i+ w1 V X1 P' k7 K( [It is used by few softs which access the following registry keys (usually #2) :
& e- E' b; D) G
. g) i/ S4 L2 f! P0 |, B2 D/ E-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 P, [; w* w7 ?" _) r# B5 \# W" ~\Uninstall\SoftICE
" y7 J# u [( s* V/ i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 f4 ]1 e# t( S7 p% V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 H5 \% d1 i: |7 K0 y
\App Paths\Loader32.Exe4 X; T/ a4 X, \
. j- V- x, d& I) l% X# L0 D
2 d) W. r+ s8 \ DNote that some nasty apps could then erase all files from SoftICE directory: z" K! U k7 B
(I faced that once :-(
* I# g4 W1 w$ ]1 e# d5 @/ W7 N5 X
+ Y* S$ P9 P: b+ zUseful breakpoint to detect it:
$ u/ B/ s; M. [4 \% a6 G7 h2 j h
& P" Q2 I+ v# z: y8 ^- Z+ d6 K8 J0 S BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
9 M, U2 E+ X6 {' U
8 @7 u# w5 O% N: U5 }3 R2 r! x__________________________________________________________________________
4 `) y/ ` f' X% x% |7 I4 Y# U& N, q6 L: `2 D* m
) k, _2 x( m; F. G- k" Q# ]2 x9 P
Method 14
& u# x5 `) i2 ~0 g& d7 M: e9 k: |=========( o5 X9 u# @7 o7 F1 W
3 e5 h$ ^+ f9 s2 K6 `2 j( E/ lA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' f* y) K; P5 His to determines whether a debugger is running on your system (ring0 only).
* ~9 E' N" R9 {8 m7 d: t9 U4 g: L( R0 @% q+ N
VMMCall Test_Debug_Installed
: A6 w9 T- }) a/ d je not_installed) k X( R \" l- R5 }
) Y# Q3 I+ b3 ?& x9 D* R2 D6 J
This service just checks a flag.( n, ]* k# z. u/ _9 e- M( a
</PRE></TD></TR></TBODY></TABLE> |