<TABLE width=500>
' `8 u0 U5 t! z9 W<TBODY>
/ U, z' u: B) K' {) j: i<TR>2 }2 |( U5 c2 h" C" O+ i( n) O
<TD><PRE>Method 01 8 y) Q4 w. T8 Y' E, R- U
=========
" G. T- C5 |0 C: Y% h0 z* T: B6 `6 O1 O9 ^. H0 n
This method of detection of SoftICE (as well as the following one) is5 I) k( U+ y3 e$ h; L0 K
used by the majority of packers/encryptors found on Internet.; x. p9 k. Z1 A6 g1 u
It seeks the signature of BoundsChecker in SoftICE
8 E* h# A ^+ D$ p6 f7 @ D+ m
* B W/ h L. ^4 N6 S mov ebp, 04243484Bh ; 'BCHK'. C+ X* }4 M- K
mov ax, 04h
( X% ^8 W+ g" x, k' j; l) l int 3
1 i1 @7 n1 q8 a, R4 }# m cmp al,4
3 D( B- R3 O* _/ ?4 ? jnz SoftICE_Detected+ y1 T/ k9 ]2 O' ^9 _9 V; @( }# N
" z4 P5 q1 E* e6 P___________________________________________________________________________4 b9 v- O7 x. q _# b2 @
' K4 T" l+ d& P8 V$ Q D8 aMethod 02
' j) N0 ~- y5 [=========; _/ ?( s0 S" l& A8 ?9 w, [
! Q2 `. }; G o
Still a method very much used (perhaps the most frequent one). It is used
4 x' z% ]* b; d2 d3 R* c* vto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 }. D ^8 V& R& _, ^! s- qor execute SoftICE commands...
7 e: p p: p8 H" F$ n5 t$ f4 ZIt is also used to crash SoftICE and to force it to execute any commands2 I5 X. W$ Z+ g- ?8 O X
(HBOOT...) :-((
: \0 r& h$ c$ L2 a3 N# I- e9 S% I0 Q
Here is a quick description:- @: ` E. J' h0 e/ c
-AX = 0910h (Display string in SIce windows)
; W0 n1 d5 m! G6 B0 E2 ~2 r; N5 s% X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
7 H A7 I% z3 ]5 x5 n" Y) ^-AX = 0912h (Get breakpoint infos)0 W: o i2 f0 d7 e/ p
-AX = 0913h (Set Sice breakpoints)2 {2 n! L5 w( C
-AX = 0914h (Remove SIce breakoints)7 L2 R3 g1 f2 ^3 `. `( K
; }! f8 j3 y) {% R5 k, oEach time you'll meet this trick, you'll see:( A+ I7 ^# W; ^. P
-SI = 4647h
2 x; P7 O3 l: S-DI = 4A4Dh
+ p& ]/ M& b s% l% d2 }Which are the 'magic values' used by SoftIce.5 f1 {; ]& {# H4 h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' I% Y7 A! f4 ^# e, k f
) W$ h; g! x- K% q2 BHere is one example from the file "Haspinst.exe" which is the dongle HASP
- p) T8 O( c' hEnvelope utility use to protect DOS applications:
) t% @9 a6 L" R6 {- s5 C/ H' @: \
4 a/ {: j! ~2 V1 c' q8 N+ ~$ I. p2 ]+ H' G) \ O
4C19:0095 MOV AX,0911 ; execute command.% q* ?% x& r7 L6 o6 J& h
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% S" v5 i$ [) a4C19:009A MOV SI,4647 ; 1st magic value.# J. O0 c* J1 ?
4C19:009D MOV DI,4A4D ; 2nd magic value.5 y. ~7 H6 D& m1 R& N! l
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- p ]0 ^" `& a9 o4 J x/ M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
* Y' M8 I$ Z2 g! t0 X# J5 P9 h+ \1 u4C19:00A4 INC CX
. j8 p( ~- u- m4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
I5 r# ]' S* z4C19:00A8 JB 0095 ; 6 different commands.' ^7 x! H6 W! t& ^7 m
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 \; Q* f/ _3 d K1 e& k& J4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" _% q) T( J! l
3 w. D6 P& X) ?" @ {$ hThe program will execute 6 different SIce commands located at ds:dx, which
6 [0 M; R/ V* p0 W: [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! W$ w6 a% d+ e/ P/ ]
, n; H ^, o5 @: h- z* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 ?5 B/ T% w, r! ]___________________________________________________________________________3 s/ _ E3 g9 x- v) y; |
4 |; D" F( {( B
& i$ p+ G1 G6 g' o1 W8 r9 _Method 03) w+ r" C! w6 ~9 l
=========! h/ t% a0 H* e4 C
" {* u U2 g; W) \Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 l ]7 K; A4 s* b) D+ r. `2 F; O
(API Get entry point)! ~) y! e' r* U, o& E
, X* |7 h: A3 _; T
# P+ ?! V# Y. y' U/ Z/ t xor di,di3 _3 o' B L& g+ @; p3 n$ D5 ^# J
mov es,di0 S% _, }4 w1 q* c. l9 y$ V2 F8 r
mov ax, 1684h ( a: B+ J& x# k( L7 ^, _4 J6 T4 m9 K
mov bx, 0202h ; VxD ID of winice
% V% @4 Y& P# N; w7 H int 2Fh) i5 P, E. t5 ~; ]& I
mov ax, es ; ES:DI -> VxD API entry point
* h3 T& v! A+ t* _ add ax, di
2 ~; @+ w" i5 I8 H$ G P5 c test ax,ax
! W5 i* e) D5 C# I. t$ ~- f% W6 Y jnz SoftICE_Detected$ W: u2 E! t5 r; \6 s9 c: F
/ ]; ]6 x% ]) z( n) R8 v1 j' H___________________________________________________________________________& y; o; P2 k3 R0 c) Y1 D. F$ H
z3 w/ [9 C, J$ S; [Method 04
& Y8 j2 E: @; q& a. X3 _=========
$ `2 X2 Q! ~( W" H/ f' [0 N2 q# v, H7 \) R. b- v8 X
Method identical to the preceding one except that it seeks the ID of SoftICE
4 b( r8 u) ~: T- p) \1 d0 IGFX VxD.( @" W8 @" i! x7 v
- `* _0 d0 V1 q1 f& z0 w1 a
xor di,di+ |$ Q- b! V5 M
mov es,di
5 Y( p2 a4 @% F% x+ Y5 Y. ` mov ax, 1684h ) ^( |, B5 d$ X: c2 D, [
mov bx, 7a5Fh ; VxD ID of SIWVID% ^$ ~- e1 P# Y7 T" `, @4 W
int 2fh2 l; V) F* d1 X3 M" B
mov ax, es ; ES:DI -> VxD API entry point0 i- v# |+ ]* _ D: z8 |
add ax, di
8 q" L7 I) I0 Y3 |8 l, j1 E o( R# o test ax,ax/ x0 Q0 N; `$ S1 m$ m1 B4 p
jnz SoftICE_Detected2 Q: t* [3 j1 R+ u& L
3 {# @% H: J! Z K( {8 D__________________________________________________________________________
5 _5 ]. R, f+ |4 V7 q4 r2 C3 q- W" z6 Y- z" b( ]0 y& \0 s6 |
& G: \/ l' ?3 M5 dMethod 05* a8 y' h- }/ A+ A% K
=========2 c$ M' g6 z1 M4 ], c& v
2 i Q5 r; h0 iMethod seeking the 'magic number' 0F386h returned (in ax) by all system( M# D* i. R) G! G: s
debugger. It calls the int 41h, function 4Fh.
# c/ D/ |% c+ l+ oThere are several alternatives.
" y0 o V, @/ H0 x( e1 \) H0 s, O4 f$ Y
The following one is the simplest:
2 B. Z! V u5 m) C' S
( D0 j/ \/ G" Q: I mov ax,4fh
7 a- _0 P: N0 h0 k7 Z, R int 41h
6 a1 w7 k1 m5 x) ]. G! ^ cmp ax, 0F386
) X9 ^5 ^2 p& p jz SoftICE_detected
4 s8 N1 G Y% H' w$ }
8 U K1 x0 g% G$ b: Z3 |1 ]3 R* b, Y& c9 g0 C" j3 a
Next method as well as the following one are 2 examples from Stone's - \/ [0 Y8 j n+ G% v7 W
"stn-wid.zip" (www.cracking.net):
+ u6 f* u. T/ p" y" a/ [( X+ X
* O1 |( R* E* x5 K mov bx, cs& U; b8 j# Q2 p$ {- o0 V$ q2 U
lea dx, int41handler2
9 C* c$ ^0 p- d& e xchg dx, es:[41h*4]
" s4 _9 s. \+ F. W9 T! w' l; | xchg bx, es:[41h*4+2]
, M% `, v6 z" | s: P. t* X7 t5 J9 w mov ax,4fh
. K; d3 ~3 G3 T3 m7 c) Q int 41h5 x r; Q2 p: b
xchg dx, es:[41h*4]
H* [, e! J. h9 a xchg bx, es:[41h*4+2]
2 X0 ^9 A% @- O2 J/ F6 N cmp ax, 0f386h
; s- s6 a# u+ ~5 F jz SoftICE_detected
/ \) d, [' }0 y1 b1 p% ^% x* P4 x: k: @2 }6 s
int41handler2 PROC
$ z1 A$ ?1 e& z4 n iret
2 m9 z, w o, D: i8 Aint41handler2 ENDP
- j) \3 f7 }) g
7 ^9 x5 O. O! v2 F- Q5 t- P m" [, Q2 ?# C* x& V; q% [
_________________________________________________________________________
8 P1 P1 U) m/ C5 `3 p6 @0 p
. Y/ D' S; N4 @9 ]5 b8 N( l: p& D# e# W! c
Method 06( p N6 l0 S! ]( [$ ~$ S1 W
=========
( v1 M0 N- p( S. V, p2 T4 h7 [6 W, C/ a
7 h) L p( q6 W5 H0 n2nd method similar to the preceding one but more difficult to detect:& p+ K0 b% E4 g9 O M( f
% |/ b1 Y/ [7 P \% G; G" Q5 @! t
\$ T5 s) n( zint41handler PROC
& |' ?$ D/ w, b4 h9 |! G# a1 p! q mov cl,al1 l) k' g! e$ f5 i$ x
iret: g# Y* g0 p6 [% Z; c9 y) e
int41handler ENDP7 b0 g x( A( O+ x( D
9 F; `, s1 _- g* U( o
0 r3 a4 C4 ]2 T, u' ?
xor ax,ax
% w4 V* r5 F: e! v mov es,ax
# s8 v* b s/ o mov bx, cs
# |. X, z1 D" u" r3 P0 \ lea dx, int41handler. w4 G, @, {8 A0 [
xchg dx, es:[41h*4]
! k4 ?$ ~+ a8 I2 U xchg bx, es:[41h*4+2]
4 [7 k# ` M. u# [ in al, 40h
& c3 a/ V$ g/ ]* @( l+ W0 B xor cx,cx: o, z& m) k. |$ K
int 41h1 l7 f3 ]; N* |# x
xchg dx, es:[41h*4]% f* c/ ^9 f b+ m. x/ q
xchg bx, es:[41h*4+2]6 l# q5 W2 @; ~ r* u9 u
cmp cl,al
6 X, r+ D' G. S5 k jnz SoftICE_detected* a8 R) W2 @6 y
9 ^3 ~6 W' ~! L6 [; `$ d1 F_________________________________________________________________________4 R0 y6 ?5 n: b% o: ~9 N
- u: V. L# a, d. h' g. ]Method 07
1 o$ m. R; F2 b6 ], |. m9 N: B=========9 |6 a$ x- R$ |2 g) [
6 Z" a3 Z, m: y3 \Method of detection of the WinICE handler in the int68h (V86)
. y$ j. u7 s" [- d1 N3 }1 e$ I% c$ G O9 _3 Z) H3 `5 t
mov ah,43h* G6 A, F) u; ^, c, k! n/ U6 h
int 68h
. ~ D7 s: d6 S4 Y% T) U; x# Y cmp ax,0F386h) E$ Y, P2 {' R
jz SoftICE_Detected2 Q1 y$ s5 m2 Z' l* j# g; A
4 O$ [# T4 y/ R6 x) x1 M3 B( L; ^7 k3 {* e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ v/ S/ ~# h( [$ u
app like this:
' [( Z3 V' e+ a D5 }
. L* J! [ i- B) D3 H+ Z BPX exec_int if ax==682 s; B7 N+ o% j
(function called is located at byte ptr [ebp+1Dh] and client eip is1 \( o' I M% H; |2 y c; ]# k
located at [ebp+48h] for 32Bit apps)
: {) t( p5 o" Z: v& Q/ k__________________________________________________________________________1 m- j8 ?5 i0 E3 w1 @/ y/ b! z
# d7 F" J) ^" U! a0 f5 n( I9 h3 G* b
2 U( L$ n K. J7 U6 q; y
Method 08
8 Z% s0 G' j, Z3 L=========
4 X, d8 w: d4 w: s: X3 S+ t5 d3 d# T- q$ A+ R% j: e) y* ]/ F
It is not a method of detection of SoftICE but a possibility to crash the
3 \" ]- L* s( _( k8 dsystem by intercepting int 01h and int 03h and redirecting them to another
. N2 Z0 s6 q7 m) X( |9 `routine.9 Z$ V6 E, p/ F" N1 I* X
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: b: {4 e! ]6 N1 @ |7 h) e
to the new routine to execute (hangs computer...)& x C' X( I7 g/ }' S2 {$ h$ P
! i, [# m7 L5 |
mov ah, 25h9 D2 H9 Z5 v8 n( L; [0 |
mov al, Int_Number (01h or 03h)% ]" U; A3 b# p0 D0 C5 X5 G
mov dx, offset New_Int_Routine
) x9 j6 F+ l, R% K% U int 21h
. E8 w% L5 _/ W8 O8 R5 n* x. z( x# W4 N* ]
__________________________________________________________________________
. ~' s M/ V: K) \+ M
1 \ A( a3 x, SMethod 09 p: {% k! c+ L! S# A
=========4 ^/ q( ~* l ^1 I y* k
" F$ V9 K1 @* x9 U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! t1 r! v8 Z6 D) v+ R
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ m$ x/ h. I0 h( O% h% r8 QThe Get_DDB service is used to determine whether or not a VxD is installed
$ [* H x Y' J. e$ }for the specified device and returns a Device Description Block (in ecx) for3 b& V( s- e6 z4 P0 g
that device if it is installed.
$ z4 A0 U4 @" p N7 ^8 _3 ?
& w$ |$ m2 s x+ C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. t5 m, t" O' [/ R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 B0 c- f5 p" X- G- |
VMMCall Get_DDB" Q) l: m( s$ v8 ^% L6 A
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ c0 x# c2 x' N: N2 Q
$ X- }; G1 q* S2 \% J" ^% jNote as well that you can easily detect this method with SoftICE:
1 W. x/ c/ N" A( D- z: O3 D bpx Get_DDB if ax==0202 || ax==7a5fh
5 z! W1 Y2 q% i; x
/ Q6 F% i# l) {; p( W__________________________________________________________________________% @, t+ F+ h* w i- ]; q! i
+ t# P! J- f3 A/ r+ o1 `Method 10
+ X% T5 l2 z9 c5 j1 ^6 o=========2 U% R. u. H% E- f% n% ]1 V+ N
4 [1 i8 Q7 j0 P5 {+ W=>Disable or clear breakpoints before using this feature. DO NOT trace with. K4 q2 A0 a$ |3 V7 i* _2 P
SoftICE while the option is enable!!1 P2 j0 Y$ P+ v% \4 ^) Z! v
& d; M# [& {4 g5 O5 s, \This trick is very efficient:/ f2 k8 X. V z4 T; G# u4 ?
by checking the Debug Registers, you can detect if SoftICE is loaded/ x R. ^/ ^8 N1 L% U4 Q
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& I; w m3 r% o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# W2 k% b7 W* ?5 H8 M# bvalue (in ring0 only). Values can be manipulated and or changed as well# W3 l3 G) T; H; p X6 Z
(clearing BPMs for instance)! q( B6 j7 U2 w0 A0 Y G
, k/ }. r- n# _4 u__________________________________________________________________________
" Z9 t0 N6 B* M4 {3 K7 H0 ?: r( O
Method 11
" m$ `# D8 r9 L0 e5 Y% x7 P* w=========
6 O3 S( r$ S9 w' L
' p/ {) M, c& v& ?" AThis method is most known as 'MeltICE' because it has been freely distributed
, T3 ^& @/ p0 J; Evia www.winfiles.com. However it was first used by NuMega people to allow
5 \5 o7 C. o- r6 Y: BSymbol Loader to check if SoftICE was active or not (the code is located
+ }0 l# H, u1 u* Dinside nmtrans.dll). E2 R! D% L% e' n5 `/ s% M+ x4 ~4 S% E
0 I7 ~- t v# `2 P3 q$ G, u$ pThe way it works is very simple:
7 m" ^* I8 M6 N4 kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( x4 a+ N' z2 `; R8 }
WinNT) with the CreateFileA API.+ E# O7 p3 E/ h
6 i1 N) D+ ?4 P$ t! A! \- ^
Here is a sample (checking for 'SICE'):
1 n. G1 W2 U0 B# l% Z( |' V+ ^. x9 a/ l1 F) `
BOOL IsSoftIce95Loaded()
" {& Y' w* U+ @( N8 `1 U5 L{4 o, b# }- C9 T {1 @
HANDLE hFile;
5 u. G- L- E4 k$ H3 K; \* [1 T hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 r- Y0 T' o6 N( ?+ C
FILE_SHARE_READ | FILE_SHARE_WRITE,9 h/ p* [. V. `" k2 ]2 v
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 E2 u' ]! {6 D( Z
if( hFile != INVALID_HANDLE_VALUE )% W' D7 [; {' H3 W l
{" ~9 g9 [. O. N
CloseHandle(hFile);2 I$ s( _/ h; G( k2 g4 m
return TRUE;
8 [6 g0 o/ e% i. n2 i+ C: T8 S }
+ \: h2 C$ {4 K- Z" z- g return FALSE;
- E3 j A" b+ r3 R! M/ E}
* d2 C; H7 N) t; j4 Z% ?0 g6 Q- F8 Z
% x3 M1 j6 V" UAlthough this trick calls the CreateFileA function, don't even expect to be% M: ~& }8 }3 ]0 B1 i! N
able to intercept it by installing a IFS hook: it will not work, no way!+ |, k# ^* R5 Z. V3 ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 K7 S- [" L( xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 I2 i6 L# u" d. ]# ^
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ S2 G9 u& l, m. r0 \
field.* V% A" R% o! j/ j3 t5 s' K4 D
In fact, its purpose is not to load/unload VxDs but only to send a * L$ B: T% p1 T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 T& e0 L2 S0 u# h' mto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ D0 N7 T w) I" }- \0 l( g
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 t1 j& Q& A' Z' l! z
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 m6 L+ A6 `( h) S
its handle to be opened and then, will be detected.
" A* h% o G2 H9 m0 ?* xYou can check that simply by hooking Winice.exe control proc entry point
4 Y- R7 g- @8 a* ewhile running MeltICE.- l; C- v% q( D/ V( z
- c9 H+ b8 Q6 [- y' N5 Q) W
" I i* K' O5 }- C3 g 00401067: push 00402025 ; \\.\SICE5 ~0 m$ s3 O C0 Y2 `# X: N9 O0 z6 {
0040106C: call CreateFileA/ ]; m6 z& M; P4 L
00401071: cmp eax,-001# ?: J% W# N9 O& Z$ T2 n; P2 D% r
00401074: je 00401091
3 r9 O- ~" q9 y9 i2 ?, {6 }4 G
+ n/ w2 k7 r2 w/ S( @
5 ~2 v" L" N! p" gThere could be hundreds of BPX you could use to detect this trick.
4 V0 M* ~& O! }! b: ?-The most classical one is:
* T! ^7 K8 ^( O! W' i, H6 c BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
1 k( d. W. x$ s% Z2 X$ _ *(esp->4+4)=='NTIC'
2 H$ }+ ?1 v3 t& g# u. g% ~- [6 r" Z4 {* r6 Y" m
-The most exotic ones (could be very slooooow :-(& Q% }% I# ^ |) F# @( t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ V" \! V( _8 }* |6 R9 s6 g
;will break 3 times :-(/ p( S- Q4 E5 h0 E: j9 [7 y1 J
2 W% ~& H2 C* Y
-or (a bit) faster:
: f( B) d) r- E% L4 M$ | BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" @1 a% O. I- b+ z; s5 X
8 q( h+ @1 \$ j5 S$ h2 C6 D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, R* D: _, R- P ;will break 3 times :-(3 y# Z( D8 l: |0 {' s6 V
) E. x( l( z5 m-Much faster:
m; P: ]: S& Y: q! Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# Y/ {/ R [* I7 m- U6 O% p% E; [/ U: `6 [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen! u* d: \" a1 T" j/ a* T" m V+ W( `. q
function to do the same job:! R5 b+ Y7 Z& S9 Y0 l
0 E! T; t2 p$ Y4 V/ E. @ push 00 ; OF_READ! J; o/ P2 u, t2 N
mov eax,[00656634] ; '\\.\SICE',0- ^5 ]# `* V0 F3 C' @8 n' N
push eax
" R1 U0 P! Z1 H/ b; s. t+ g call KERNEL32!_lopen. Z; y, r8 X1 z7 Z7 T
inc eax& G/ n: K' b- W$ _
jnz 00650589 ; detected7 j' g/ S9 b7 h% a( G. Z0 p
push 00 ; OF_READ
8 C. u" c# U6 R" \( {8 O8 `( J mov eax,[00656638] ; '\\.\SICE'+ i! ~5 r+ z8 O! W& @& ?) ~
push eax
0 Y' w6 H! b0 p: O, F call KERNEL32!_lopen1 \7 _7 v! l7 r5 m6 t! e- n: V
inc eax
% @2 H, r, K5 L! C/ S jz 006505ae ; not detected4 Z! x' {3 ~( b: {
7 R% G) t% Y5 L
& M! n: C+ c" A X8 L9 ?/ P' [__________________________________________________________________________' w$ J) G# @3 K# h9 I" y! m( x1 t
+ P+ e- T+ F1 Y, p8 P- R( J0 KMethod 12. M1 `% \; Q( V/ Q
=========" R2 F5 A1 F, l* d3 N. }4 J
7 l4 Y/ [- e- z: q% r2 F
This trick is similar to int41h/4fh Debugger installation check (code 05 h# {" X! {( e8 t8 r+ Y0 [1 R7 L
& 06) but very limited because it's only available for Win95/98 (not NT)7 ]2 q( A0 g$ {& h+ f* ~
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 s2 W* Z8 E4 v( \ v) x
: ], S, m& q" ^5 P
push 0000004fh ; function 4fh( _: L% d0 b8 P$ b( C
push 002a002ah ; high word specifies which VxD (VWIN32)) i6 b9 w/ i/ B+ V3 m5 q) l
; low word specifies which service
1 K/ v* {/ s4 k' g& s. s$ C' U (VWIN32_Int41Dispatch)
9 N" H& e$ \4 M, m* O, ? call Kernel32!ORD_001 ; VxdCall
. W4 Z; Z2 W6 s9 U5 H5 b/ V2 ~ cmp ax, 0f386h ; magic number returned by system debuggers8 n; w; o" a8 ?
jz SoftICE_detected% `% H6 J1 Y* _
& V; P" m @' x; Q/ O
Here again, several ways to detect it:
; K% @7 \ o/ h8 {% _0 f
/ S9 i, |7 F" m2 d) C BPINT 41 if ax==4f' i Z0 G" i6 ~% B! M- I
9 J/ s6 \0 q/ }$ D/ ?4 @
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! m2 b" F, F) e3 C; f t
% }2 B2 i1 P+ x9 \3 B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' G! a8 e! G+ E" t9 m6 X3 X% l. d) j6 o8 K6 @8 ~" Q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! K" v, a9 r& I6 Y9 D% U! V5 ]5 d0 V `, m& W
__________________________________________________________________________
8 G+ s; Q/ ~! p+ m
7 Y& Y9 A3 k6 U8 n4 i$ w" o7 L( YMethod 13) v4 R6 ^ Z- X y' q& f* t- Z
=========
1 j. {: I# H1 M6 ~: u$ `5 T& k# D. ]9 B5 O0 L7 _( h: r4 D4 c: w" |* n
Not a real method of detection, but a good way to know if SoftICE is+ s9 L! {( H; ?% a$ }! H
installed on a computer and to locate its installation directory.' o) E7 g g0 X: N
It is used by few softs which access the following registry keys (usually #2) :
/ m I3 T% u# N; ?* g/ m
- Q( Z$ M! i/ [: V( y5 |, G-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# I- h( |$ L+ x) @* C5 H\Uninstall\SoftICE3 R) @1 N& o3 w+ T$ S7 ?5 O( k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 n" _- z: k0 a& ]7 z' U
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& Y" i- c2 T! M( A5 S8 b, ?5 A8 E
\App Paths\Loader32.Exe7 R3 a2 a) J! y
( M- N7 a" T0 g) P& N8 o, i/ d: Y
Note that some nasty apps could then erase all files from SoftICE directory
2 e, _1 P9 z# L(I faced that once :-(
" v: U" X- O3 U6 t# R# [- ]0 M
# F8 `$ Y; }% A9 j/ lUseful breakpoint to detect it:$ Q* H: g/ {" h% D: M( P7 Q$ H9 u
- Z; _. E5 f: _* Y
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
2 S9 ~3 C7 G% B w" d
* w9 f% y0 F- E0 g6 ^4 f0 n& M0 {__________________________________________________________________________5 g0 a) T! x2 w" K0 Y3 b$ [! y
7 F, i3 u4 l3 t# H
% O* Q3 K# j1 R% q
Method 14
% Y0 V" k% Y; Z d7 q |6 K=========# b% f; T% `' }( d: Q
2 H& x2 A3 T' N! R. K& I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 I7 r% F- O- Z& Nis to determines whether a debugger is running on your system (ring0 only).
' |6 a7 O' f! x* o" ^
8 }. V& l! P( j/ ~3 G! c VMMCall Test_Debug_Installed; R' q X6 k, y0 N4 i9 a
je not_installed/ g; v" |0 [1 [) C
1 C1 `* {/ W' M' A* |/ ]
This service just checks a flag.
/ a2 I1 d5 ~! e2 v4 t: e</PRE></TD></TR></TBODY></TABLE> |