<TABLE width=500># F& m+ U* n# P Y
<TBODY>
. X: R3 d- ]( G( W5 z0 ]<TR>, h# k/ r2 H j# |( ]. D
<TD><PRE>Method 01
. m! I9 `0 B- W: P=========5 k8 s) d9 M4 e M9 L
+ `$ P& B7 F7 F3 b2 f
This method of detection of SoftICE (as well as the following one) is
5 ]9 c) v' g9 r5 t1 ?used by the majority of packers/encryptors found on Internet.# J. o; v6 p) [5 m" y. H
It seeks the signature of BoundsChecker in SoftICE; o5 K$ o5 H h9 b/ ?
, m( |0 J' l2 D/ q
mov ebp, 04243484Bh ; 'BCHK'
u3 F! _+ T2 h0 h$ p# E mov ax, 04h
6 S5 E4 q ]3 Y; n: F3 O/ i int 3
r) N3 i# H" b- ?6 I8 h" I cmp al,4. y, D5 C( e2 L: h
jnz SoftICE_Detected
, ], `# {0 o: t: j4 S' h( s' g: E! `+ _' Z% C- {4 {
___________________________________________________________________________
5 l1 v6 U; D% q4 E/ s1 b+ e+ F5 {+ F) i
. [. P0 p; K1 N- T; OMethod 028 R5 `% B2 R# l5 M: D- h
=========
* _, ~- h* e0 f p- I* P& `; E7 R. e9 A% K
Still a method very much used (perhaps the most frequent one). It is used
. m& E+ {. `3 j8 P, |) tto get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ V I5 c+ Z5 j/ e
or execute SoftICE commands...: l- Z; i6 l+ B7 b9 `2 C2 w
It is also used to crash SoftICE and to force it to execute any commands/ J' t; [: W5 Y& U4 Y0 }
(HBOOT...) :-((
4 _; N! U1 a8 J5 {8 M+ ~$ a( \9 b" w4 N0 X- B' i8 M
Here is a quick description:/ L7 ?7 J3 U4 H7 l- X% C" g
-AX = 0910h (Display string in SIce windows)0 u3 U% \7 I% g5 B" U g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
. B5 t) y. z0 _4 B2 Y6 W-AX = 0912h (Get breakpoint infos)
$ J* X/ Q6 B! e+ B1 ?& C-AX = 0913h (Set Sice breakpoints)
6 |7 o( N9 D! D9 Q& a-AX = 0914h (Remove SIce breakoints)
9 b+ Y+ Y! R) `
0 [/ H$ P8 m0 x2 MEach time you'll meet this trick, you'll see:
- ?3 R# Y% ^7 f9 W/ n-SI = 4647h
6 j1 ~ d' d$ ~7 Y: _. Y-DI = 4A4Dh
2 w2 v3 @$ G0 Z+ _Which are the 'magic values' used by SoftIce.( a" c: s& j$ j' Y4 m" p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& } u9 a2 M! ~( A& r
0 M2 \) R; Z, n7 f" _% [Here is one example from the file "Haspinst.exe" which is the dongle HASP' c5 C* N0 R# p( q3 r
Envelope utility use to protect DOS applications:+ d8 E) s0 {/ Z, `2 j, ?2 S
: k) u1 I( q0 `6 O- E9 Y5 p' |3 j
u9 }* Y3 w! v; m& ~ U
4C19:0095 MOV AX,0911 ; execute command.! s7 v/ Q' g4 P) J
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: `1 R0 G0 j5 j# z
4C19:009A MOV SI,4647 ; 1st magic value.' ~' `7 H3 ?3 e
4C19:009D MOV DI,4A4D ; 2nd magic value.8 M: B; G2 ]+ E2 V8 y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). j' |7 [6 a) R" ?3 _& |8 p
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% R+ X* G- C+ x$ |: ~: r( E+ Q& w
4C19:00A4 INC CX; F9 D' D l. J1 l# [' @3 z' r. p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' d5 z) K% c, a4C19:00A8 JB 0095 ; 6 different commands.* m& r, u+ I0 x" E; _# w1 v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, i3 g6 ]9 ^- r; j4C19:00AD MOV BX,SP ; Good_Guy go ahead :)) m$ o. T) [/ o+ U4 A/ Z2 ~
2 o" N% x4 H3 D1 U+ {2 N8 @The program will execute 6 different SIce commands located at ds:dx, which
6 Q! A+ `9 v; p6 ?% G1 [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 z4 ^8 n5 h" w9 K0 k% {
6 t/ i3 l9 V0 _9 i
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* { m" P; ~7 H# i, E___________________________________________________________________________
( M6 c) B+ [; C9 d- n4 [- c3 m# `* f% L2 B
4 P' @9 N& w$ M0 B$ j) ?2 @Method 035 o. u3 Z! T T
=========
& m& a+ \7 v0 B8 r% N8 D0 E9 G% U7 m9 _" N/ V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 C* h( j- O1 g7 H
(API Get entry point)
- x M, F p; d
4 I# d" D& K+ c, k& a
P, T: ?( A4 z xor di,di
2 S4 u. J d1 I& }: X: r mov es,di
8 R, d# y! K% b mov ax, 1684h
; g) q- J& X( z; X q mov bx, 0202h ; VxD ID of winice
. z/ x |7 A1 A ] int 2Fh
. Z) |( k% |% R. X mov ax, es ; ES:DI -> VxD API entry point7 X u4 v3 ~1 e
add ax, di
9 Z! K6 q2 i# n+ m test ax,ax' [3 V# W' K& b
jnz SoftICE_Detected
! ]' F* J& Z; A' Z1 H% V
7 x+ d& m5 A' B N, ]5 l' A___________________________________________________________________________
R5 h5 X, s, A+ ] l0 {+ o% R6 v; S# x6 X& `: d; }- T
Method 04
' }8 i, f6 L* F" P# P=========
% X+ G5 ^# _( m5 ^/ w8 X. g$ x5 `7 N$ u# f' [
Method identical to the preceding one except that it seeks the ID of SoftICE7 d; ^& z2 t( Y# p5 f0 [9 g
GFX VxD." e8 S. I# h/ Q! ^% d
0 s7 k+ x! x/ p- ?# C% ~% W xor di,di
( ^& b. Y8 H6 C2 [$ @# [$ p3 G8 z- e mov es,di% c$ O5 N/ v6 ^
mov ax, 1684h & E3 ~* Y! A2 o3 t' q4 h/ X2 I. F
mov bx, 7a5Fh ; VxD ID of SIWVID8 V. _2 d" [6 q- k
int 2fh2 n; v6 ^/ Z, F( Q* ^* ^! }
mov ax, es ; ES:DI -> VxD API entry point/ }; k5 w, d$ M3 x4 Q/ \9 I6 m
add ax, di
+ D5 _. u) ]$ f5 V test ax,ax
" u3 C q& z" j- C n, I jnz SoftICE_Detected1 S6 `% n. ] Q4 G
6 \7 q0 x w! a2 t0 k( X__________________________________________________________________________; }3 Y1 a2 {' b* o
; ~' e J/ d, h5 C
4 @: I4 [5 L" ]3 W0 W, u j/ V# HMethod 05) N2 ?5 D9 _7 h1 V' _) d( ?/ {, t
=========, W9 _: g4 c" M, k
4 y8 R2 C% D+ h: m" N$ O" ^" f
Method seeking the 'magic number' 0F386h returned (in ax) by all system, a/ ^5 r' f, W8 g
debugger. It calls the int 41h, function 4Fh.+ [' W% `8 D7 a$ {
There are several alternatives.
2 B2 Q+ i! S- [/ r5 V, L0 m& E4 v8 h
The following one is the simplest:
1 m/ k! o, B: e6 F& E& l0 H/ h, _' [9 h
mov ax,4fh
4 d7 C$ j% O, q9 r int 41h
& y: g7 t; S5 K5 H5 ~/ l4 G6 ^6 B cmp ax, 0F3866 M: R4 m' u' V8 u6 P+ K
jz SoftICE_detected
+ C2 J2 l- l' n& G; v9 K% }0 q; B6 b
3 U1 X5 U$ r2 @& [, X) h! C( _+ H9 ?2 x
Next method as well as the following one are 2 examples from Stone's ' a' |; j- C* ~+ b Q
"stn-wid.zip" (www.cracking.net):0 l# u1 G8 @& ?1 G% M6 r% z% q2 g" z
; K8 y- y2 `" @2 d) ]8 V mov bx, cs
0 ?7 q* A' x& F l# s# F lea dx, int41handler2
1 a# _% j$ f/ E) C xchg dx, es:[41h*4]
: ?2 I& a/ K4 ?- h: s8 L# W' n xchg bx, es:[41h*4+2]
4 u% N2 [, f, o1 b- P: L! f# y& Y mov ax,4fh) w5 I! E- Z v( T D
int 41h
$ {& F4 @8 N2 ]- ]/ R xchg dx, es:[41h*4]
1 n8 q' V, h, A8 u xchg bx, es:[41h*4+2]. b$ p, L+ c3 E4 A
cmp ax, 0f386h
9 s+ P+ ?8 E3 N jz SoftICE_detected
0 ?/ o' f6 o) c
1 G9 r1 i* c4 S/ [* Z! [- O$ ^int41handler2 PROC
) E3 A- q9 P1 s) L iret5 W) [, a# m/ m/ }2 L9 S& X9 M
int41handler2 ENDP B7 p! l: k0 Q. d: W3 S
" R9 O. k$ c1 P$ m3 ]; q
/ X! M( d& U" L7 _5 y' P_________________________________________________________________________. Y& p X" b: p
|3 W3 w" M& x5 u: ~4 e5 `8 v
; p4 l& P. W* A5 H, `
Method 06
% K' `7 }7 l+ K( y8 m========= s7 \6 H+ f% N2 `' f
1 ^: L8 c$ m$ q, G2 a0 K. s3 k4 F8 r' c
2nd method similar to the preceding one but more difficult to detect:
" [$ C7 |/ ?7 ?" C. K* M4 K6 f4 `) ~5 w- V; ?% i
8 t6 O, K2 I! L% l# k& cint41handler PROC9 B* X8 ?% [$ T7 Z$ ^
mov cl,al
/ v! U6 ]# v3 Y) ^% i1 ` iret3 y; x0 K6 U& K
int41handler ENDP
. G& n. c6 o8 ?: k% ?# v; h7 f
1 r" |% ]2 i+ T6 {3 H$ s
& {) [! t0 x; H% x% I9 n3 w xor ax,ax
) J* d& B' V9 I0 D% l! o; H; m mov es,ax
7 E3 L! G! b; U. x, {9 @ mov bx, cs
6 W( @* C" V3 R; R8 O lea dx, int41handler
% l2 }1 ]# ]( k) ~8 l2 \ xchg dx, es:[41h*4]9 G: Q4 l5 X# S0 ~4 G) r. N
xchg bx, es:[41h*4+2]
0 s& j3 D- H2 p' Q# ^% U in al, 40h) q& }! F' _* n5 ]: U/ F
xor cx,cx8 m9 G& i& m V X. d1 f
int 41h, s0 s( h9 X( \
xchg dx, es:[41h*4]1 K C' b! ^/ ], W1 h
xchg bx, es:[41h*4+2]
1 L, L1 L$ w& _8 z cmp cl,al
8 T3 |8 q) ], s# z" D! @ jnz SoftICE_detected& ^: i, g* h0 Z/ Z: y
& T0 y/ |1 I' X* H' G_________________________________________________________________________: t- y8 V0 r% _; q8 Y
- V8 t( P* R9 u: `4 UMethod 07
$ H, f8 w& K2 u7 `5 c! w=========
8 h6 w* [$ U1 M' V' J1 b" G0 d L% ~1 i
Method of detection of the WinICE handler in the int68h (V86)6 `2 F$ q9 ^& x* U
: V. `2 {% M( f3 h4 ~4 J: k mov ah,43h" B( B+ X- u/ {6 Y- W/ }! p
int 68h6 m ~( }2 E; J# P
cmp ax,0F386h" V2 c5 u b+ j, C
jz SoftICE_Detected
. s- ~( \# v" M) H2 h T4 V
6 r7 c* q& f2 w* \- e' n: T5 U% U1 x m# ?. e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 E' k6 u) V1 a7 z8 w0 p/ M
app like this:
6 ~. K" f( F" @( q
( c* e- L% {/ v/ R& [: l3 \ E* m BPX exec_int if ax==68
( W+ e: E- t; v+ n2 G! V: j4 ] (function called is located at byte ptr [ebp+1Dh] and client eip is
, b/ b* n, D8 D located at [ebp+48h] for 32Bit apps)
, t5 p; x$ o( E" o; u J' h9 u/ R__________________________________________________________________________ r$ D' T3 r3 O
2 K# g& a5 @8 }+ m
; M7 _4 e( {5 gMethod 08
* b" K+ L: _- P! }- _ A=========- \+ o) d( ?. O1 E3 I3 I
! h6 W3 w( w- u, SIt is not a method of detection of SoftICE but a possibility to crash the
& z5 Y! e- `% n% S! w6 psystem by intercepting int 01h and int 03h and redirecting them to another0 ]0 h- O/ u0 u- V' A
routine.
! i2 a6 F; F% c1 NIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 r& y6 {* D% C8 n3 n7 R) zto the new routine to execute (hangs computer...)
) n: t; G" h) I" W; n
/ u2 ^) L3 K# A8 e/ H' A6 o mov ah, 25h3 ]! }6 ?* T* m8 p( |% N
mov al, Int_Number (01h or 03h)4 K" \3 v$ j/ H6 F
mov dx, offset New_Int_Routine
3 t9 C3 @0 Y7 h6 H int 21h
; |6 A, c$ W" G% c1 y$ F" b% Z/ l$ X. t
__________________________________________________________________________! u* U8 A- E4 k9 ?% {- I( v
0 D3 n8 x1 D& z4 Q
Method 09
" _, b+ ~7 p+ \/ ~=========
+ Q0 Q3 a! y) I0 l
/ n& H0 f9 ^/ A7 ~. z6 f# AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" _8 |. U9 f% c
performed in ring0 (VxD or a ring3 app using the VxdCall).
: a1 I: r& L ~, f+ C/ J5 _% pThe Get_DDB service is used to determine whether or not a VxD is installed
- _ T* n) ~4 W1 efor the specified device and returns a Device Description Block (in ecx) for
0 z+ b7 U B- W; [1 k S! O" ithat device if it is installed.
8 x& [$ t2 O5 v) L# U4 E
) h! y9 ]: n0 }! f' W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ {2 \+ r# E P( ]: P( H x( g
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# F/ n" X, ^+ n8 l% z1 s* o# C9 w. j5 O! z
VMMCall Get_DDB
4 `" Y3 s7 i6 \0 z5 Z+ Z& \, X/ Y& {$ [ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- w0 P+ ?; j6 }* q" Y
0 Y! F) }9 { H6 MNote as well that you can easily detect this method with SoftICE:" n9 X, V3 U8 i* Q
bpx Get_DDB if ax==0202 || ax==7a5fh; t8 }) d- I9 W
) h0 r. y; D0 H7 E
__________________________________________________________________________
. O* S0 O4 I" [( M6 V. N) {! V
{' ^. N. ~' }& p# w+ d) aMethod 10" d% T4 I+ g5 ]7 }" j5 q
=========
6 O9 w. N6 c, r. H4 H
. `% C3 F& t# Q/ v1 W, Z: \=>Disable or clear breakpoints before using this feature. DO NOT trace with3 u9 n; z- K3 w. n
SoftICE while the option is enable!!! @1 |$ A& t3 u' d T- t. n: W
9 ] s& E3 v4 e' S% X& KThis trick is very efficient:! T5 @6 B) ?) G- g! Y# M0 }
by checking the Debug Registers, you can detect if SoftICE is loaded& O% e9 L$ e \ L3 u8 ~! V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' ]" `2 y# ^0 K% D" s0 b
there are some memory breakpoints set (dr0 to dr3) simply by reading their) Q* Q1 B6 @! i, ~( z" J
value (in ring0 only). Values can be manipulated and or changed as well/ M: ^8 E6 }$ d: T5 [1 a/ J7 f
(clearing BPMs for instance)
: y V& a( K+ k" q2 q! [1 z7 ^+ c" T! o% N8 ]- @ U
__________________________________________________________________________
: t! J' y( K& g1 D
0 W, R& ] g0 ]. TMethod 11 z8 h- _/ z, w, Z' I/ Z( H% D
=========
% k7 h) N! o0 i3 [
6 a4 C; l8 o& VThis method is most known as 'MeltICE' because it has been freely distributed, L b$ z. L3 K
via www.winfiles.com. However it was first used by NuMega people to allow
2 W" G7 f9 X, {/ E0 R a& T3 z9 OSymbol Loader to check if SoftICE was active or not (the code is located3 f0 D/ ~' Y6 v9 O* v3 {. s
inside nmtrans.dll).6 l7 W8 {" p4 B U# l( w9 m/ L
7 J3 E/ U# U! x. S$ I" B
The way it works is very simple:& a5 m- e s% B' h# @+ ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 z% ?* ]( |# F/ H6 D% vWinNT) with the CreateFileA API.
- c. m; b' i# r, ^8 w! `4 X/ c& V0 q. [% B5 r/ W
Here is a sample (checking for 'SICE'):
: F* N+ u: V2 D8 \- f' E" Z4 i1 `$ f* _ J
BOOL IsSoftIce95Loaded()
. v5 _# S3 f/ b4 n7 X{
, ?* f* ^7 T/ _6 [* f7 l# i6 T HANDLE hFile; + T! j" Y/ n) f% A1 D3 H9 a
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! X% s) K9 p6 {. b; f$ G FILE_SHARE_READ | FILE_SHARE_WRITE,
p6 J: G0 k4 f& m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 k" o+ A% y6 S, r3 C( F
if( hFile != INVALID_HANDLE_VALUE )
3 T$ y( v: t t5 I {& f( L* ~; _ l
CloseHandle(hFile);# |6 U' i4 X/ Q% U; m* Q
return TRUE;- r- M. G7 A$ D+ e( j9 M
}
; [6 k6 G/ ~, m' X( L6 }9 q return FALSE;
5 y6 H" X/ R) X) ]8 K; W% w$ K) |}
- h" i$ k* L, c' H4 p6 K' c2 u" A4 M% \
Although this trick calls the CreateFileA function, don't even expect to be
5 e, |, B# K @& g1 w6 G+ rable to intercept it by installing a IFS hook: it will not work, no way!
2 V8 ? n$ s( Y/ BIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' G6 @% d9 Q1 A2 y6 G+ {
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 u, h6 h! e( c9 I5 N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ q2 Z9 }0 C% p' n6 y
field.6 V3 i* n V' u3 g8 x& ~) m
In fact, its purpose is not to load/unload VxDs but only to send a
; I! r- N- l' D2 AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
/ \# q4 u3 H0 Q! Uto the VxD Control_Dispatch proc (how the hell a shareware soft could try
' z& k/ r8 u* T' b8 q5 ~$ ~$ gto load/unload a non-dynamically loadable driver such as SoftICE ;-).8 J# Q- [$ o% K2 \ M
If the VxD is loaded, it will always clear eax and the Carry flag to allow
* s( c3 y8 h) Vits handle to be opened and then, will be detected.
0 U; q5 j" b; W& V- `You can check that simply by hooking Winice.exe control proc entry point# C- ^/ {, r0 G! B3 j! r4 E
while running MeltICE.
o2 T) C$ \( `% R! n6 ?3 G$ x4 S/ x7 g5 w1 @1 U9 u3 T
! U) u+ M: f3 x: Y9 G- i 00401067: push 00402025 ; \\.\SICE$ m& d8 w" z# @, k8 L0 _8 Q. x
0040106C: call CreateFileA
; r# H% I5 J+ m9 _ 00401071: cmp eax,-0012 ]/ t9 F4 q5 z5 v1 {) `9 g C
00401074: je 004010914 `( b D! l: I. w0 I) x- A6 G! t6 n
5 @4 Z3 G4 Q* w4 I# H6 T: R
9 p; V7 L! B7 u7 q2 [* ZThere could be hundreds of BPX you could use to detect this trick.4 I2 X1 r1 M0 K2 }% q
-The most classical one is:
% A) W0 w' p3 d2 c0 }4 R BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||3 j* j% {) t8 S
*(esp->4+4)=='NTIC'
' S6 J; k B& `; W2 @0 a- w
" G* R J. m b/ O7 v+ P-The most exotic ones (could be very slooooow :-(
& I. o, `0 r% v4 { l8 G6 \ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & A; j3 z- M% J
;will break 3 times :-(. o' S. C' b* f
. W) a2 ]$ t6 Z5 E+ {-or (a bit) faster: 8 N/ u, e3 k& z! W& q1 @8 h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 c3 n) U: w, N1 T( y- i* Y1 M! i2 C8 z9 ]
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 \$ Z! m* B3 j ;will break 3 times :-(
4 h, \' B8 C+ {" @- F4 Y5 v1 y/ i' d1 p' V6 |
-Much faster:/ `2 p6 C, _% P4 a. H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') M* z# w. j/ K; i# P
/ N5 {' u" L5 A
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( L; \. O' C) Zfunction to do the same job:
& G1 N3 W0 q$ Y2 ^: l# ?' x& Z2 Z# I1 x ?/ N1 Z% ^$ r; L8 g0 y
push 00 ; OF_READ3 s( b3 T6 y- g( w# j2 q2 \
mov eax,[00656634] ; '\\.\SICE',0
2 _5 a2 ]" k% G push eax
/ ]7 t: D* t+ F* G# q6 c9 |& } call KERNEL32!_lopen
+ U8 H$ _9 j* G: w) z# F inc eax5 g5 J* L8 X, @4 H; e
jnz 00650589 ; detected
) y1 |+ f% u& N" a" l, c! W# n push 00 ; OF_READ
9 p i5 ~& N2 C; ]/ d! Z mov eax,[00656638] ; '\\.\SICE'- [0 u5 o# _# z! v$ \
push eax
* \2 \: u: O- R call KERNEL32!_lopen% C U' f6 n, n
inc eax/ i# g; o& ?; w" c* ?
jz 006505ae ; not detected
: v% _; O+ Y" V6 B" U5 ]7 t1 K6 m6 \5 f* {/ d& Q. R* s9 Q* I7 r/ X
7 O, b p b# K: C! |# o0 s7 e__________________________________________________________________________
6 ~8 Y& D5 u, w2 S) S* b# B3 {) U( T' x+ y! n
Method 122 a! g( X4 p6 i! D3 s% D& f
=========
! K' N2 Z; T |" I' O. h. C
% c8 z* Q& Y6 J" EThis trick is similar to int41h/4fh Debugger installation check (code 05
0 s1 e# s; n/ ^ `& 06) but very limited because it's only available for Win95/98 (not NT)
6 i* Y- M) G; Sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! ]- w( o+ E8 B/ C. h" ^
* j- o; h# l9 S5 u# ? push 0000004fh ; function 4fh$ B$ @2 `4 B1 M U& y. g9 e) Y) M
push 002a002ah ; high word specifies which VxD (VWIN32)
' W" _2 u; `- @ f$ e ; low word specifies which service- U# \2 U; |) g. |
(VWIN32_Int41Dispatch)- |! h% t% F# r0 ?( E/ {& ~
call Kernel32!ORD_001 ; VxdCall
) h# N6 y! a4 G$ M8 a5 W/ \9 T cmp ax, 0f386h ; magic number returned by system debuggers. `. u& `( _* y- {) ?* n
jz SoftICE_detected# x c) I M, W1 G R% R' v! I
0 n+ M0 Q6 _$ D& M) O O; Q
Here again, several ways to detect it:
& F2 i& R2 z8 I
$ b4 B; s% z# l/ c* t9 _! n' u BPINT 41 if ax==4f
8 y& k# A8 | v# F6 Y. u- \/ f$ i
9 L8 Z5 ?! f. x" R BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: N7 y7 @# g, b2 G" c4 T2 n, ~3 a; Y" Z% Q, q* C1 u A
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ b" N% k1 f1 O3 x) @* f
* L1 W( g& L5 R$ K
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
9 J) O% j$ M* G! g' X) ]* u H$ b' a) F. i1 I w
__________________________________________________________________________9 o3 Q' ~# I# J7 d3 O, Z; R
" V( r5 ?' B( Y Q$ }Method 13
# ]3 k/ W8 v1 p, ~# ~& ^=========% M k' J. |1 L& X0 e( v" o
2 G$ d% M# b9 ]% p( m, p3 }. [0 {Not a real method of detection, but a good way to know if SoftICE is) G D( p0 F+ {( N5 ], l, j
installed on a computer and to locate its installation directory.1 B* i1 j, A' F- K
It is used by few softs which access the following registry keys (usually #2) :) B7 Q* J& L8 C% ~; K$ z
1 s' L8 [( Y# H& ^3 k6 O-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: C# Z8 t0 T# A6 D' V8 x* L
\Uninstall\SoftICE
& R8 Z: ~3 v) m! m-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 P2 }" P$ T1 u5 T
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion m: s7 E) ^1 c: k" t
\App Paths\Loader32.Exe$ J# {* i- g2 A& E* z6 U5 S+ E
r6 `! P# N6 U. X% @
4 `! S% }( j+ O2 I" c7 |2 QNote that some nasty apps could then erase all files from SoftICE directory% Q9 g' W! o. \. E# E! ~- [- N
(I faced that once :-(0 J9 A: \3 e& E! ]% \
' s% W/ z# M% _6 A6 @; i
Useful breakpoint to detect it:3 J$ Q* A8 j7 p9 E/ |
5 T* o' m/ K" Z# b4 ~$ R. ? BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& Q' s i& L @! e
) {; o7 b& ]) \! B6 n8 t__________________________________________________________________________
& f4 U* ~5 i7 t+ |" d+ ]7 p. }/ T! h! a) I# q# |5 A" W! @5 ~0 g
: O2 L! j! J6 {
Method 14
, N, f0 H" }. A! W$ |/ o( D0 g) T0 o=========
3 @# P8 N0 v! B4 J+ U2 r. p# {* r5 s, t. _5 I% m6 ~4 n! J
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 h! m" b* V4 V9 j/ W* E3 K* a& C( ois to determines whether a debugger is running on your system (ring0 only).
2 M$ v$ f' F h$ c! u8 ~( p( P- X8 U: g8 f% B
VMMCall Test_Debug_Installed: H5 F( W. ^* R% z( Z. l6 G
je not_installed
0 G/ @9 u3 O, q$ E, G9 V. j" J, Q4 P& u: ^5 c# t
This service just checks a flag." D7 l" Z$ V, n/ R6 v
</PRE></TD></TR></TBODY></TABLE> |