<TABLE width=500>
7 @( J! I6 V* k; c) m<TBODY>
3 ]- G- x: j2 K. u3 C<TR>
: j0 A7 i& k) }# e" f5 c<TD><PRE>Method 01
' q* b2 {% f$ z1 B=========% A/ s6 J1 K% x. w. }3 _
3 [1 |: p# ?; h0 z1 d! s
This method of detection of SoftICE (as well as the following one) is
/ d- @' t& C% _* Nused by the majority of packers/encryptors found on Internet.
0 N3 E2 `3 ^! V+ B, n/ XIt seeks the signature of BoundsChecker in SoftICE
& _; `- `8 R) F6 J2 o0 V, X# ?& X
! E* U R8 n! P8 o, l mov ebp, 04243484Bh ; 'BCHK', m, i! n4 d$ z9 B
mov ax, 04h
" I0 l! V) Q s) u% r0 r) O int 3
% n8 a, Z( ` g, ` H4 Z9 {* u. ]* M cmp al,4
$ V" U. G5 v8 q/ G jnz SoftICE_Detected
/ }0 y) q0 ^" x) r
* n: j8 h( _$ B. q d9 z# [) j___________________________________________________________________________
8 e. k9 v+ }+ K; C A" @9 p( j5 R0 z. f. X5 M& @
Method 02+ l% f: ~) D0 y& K
=========
! p3 C t0 v4 Z4 C6 }8 }
/ I5 \& R2 a) K% \- q0 ZStill a method very much used (perhaps the most frequent one). It is used
3 |# K: s1 B/ o1 Zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
8 V [6 n3 f, `3 T3 X4 f4 Eor execute SoftICE commands...
# [, [. I, ~2 m) q# g3 Z HIt is also used to crash SoftICE and to force it to execute any commands
7 X9 J; [2 T% ~- Y1 U(HBOOT...) :-((
1 e6 ~+ _+ r; T4 l) t3 S8 P
% E6 x# i. d4 _* lHere is a quick description:
6 p+ W8 n6 C( Y+ [-AX = 0910h (Display string in SIce windows)
% O: p; b) E7 ^3 o2 U& c3 M, C-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% R" q! o3 O0 {8 |1 r: G1 C+ u
-AX = 0912h (Get breakpoint infos)
* n6 B3 S4 A) g; n-AX = 0913h (Set Sice breakpoints)
, E, K; `* ~+ c% h8 F; A-AX = 0914h (Remove SIce breakoints)
/ W8 t" F$ ?. a3 g; w, Q$ J2 E( H" g$ g& s* k6 c' ]% S
Each time you'll meet this trick, you'll see:
2 e8 |9 a1 w2 b- ~2 H: O1 K-SI = 4647h" Y' x8 w2 y `3 A" h. @- R
-DI = 4A4Dh/ }* h+ d3 A4 T! Q C# b
Which are the 'magic values' used by SoftIce.
! ?* E, @4 `: ]* H: o3 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" \8 Z7 @' f, a
! y+ V/ O% a1 D+ E3 o: o1 W p. n* FHere is one example from the file "Haspinst.exe" which is the dongle HASP0 q/ V' ^1 R3 c+ v8 z/ l6 Q7 w
Envelope utility use to protect DOS applications:
# [: h# x }6 N% G
2 l' E) H2 b! d t. r' x6 n* f5 \& y
0 a+ h. Z8 n5 o6 e& V4C19:0095 MOV AX,0911 ; execute command.
0 {! D, M, d8 R& \6 v, l4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ x! _ ^% z, Q. I4C19:009A MOV SI,4647 ; 1st magic value.
|4 l, u- [5 i$ G b4C19:009D MOV DI,4A4D ; 2nd magic value.
1 I/ l1 c i( u; p- Y# V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" h8 k4 f4 M6 m; m' k( z9 r4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. S; G) ?0 o& P9 c
4C19:00A4 INC CX- q6 g: z. O8 U' A4 P J
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 F* R" O$ ^# d/ B7 \) i
4C19:00A8 JB 0095 ; 6 different commands.
$ i" I( G/ U- b9 Y8 m- i; Y+ p4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& f7 V" c' s0 ]" W$ x$ {% B& I4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ Q. {( a" J+ }+ K
9 a! w9 t6 b# u: \! K$ HThe program will execute 6 different SIce commands located at ds:dx, which ] Z# I6 l2 s5 t
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." B. S+ x! L3 |1 w6 l+ u! E2 |. K
3 e' [+ ^4 a6 N: g* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 @- H ]5 y; B) X6 p! x% }& N% A
___________________________________________________________________________" A) I" `; X+ Z0 s3 Z0 }
9 {7 K9 `+ \: ~) I) {
9 N3 P! {3 N) x r. v
Method 03
C1 B6 N$ z! Q& {=========& G( N8 i' f% l7 Q" O
, C% X) {. P+ I F/ a0 _1 v
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 m1 U& y" |9 [1 X3 h2 T
(API Get entry point)
8 y& z3 ?2 Y# o # d2 P9 E+ q! v3 N
) D" a6 I" S. l" s7 O1 F2 I xor di,di
, W, q6 F+ S9 O: _ mov es,di
# x" j3 U! [$ S9 i% i mov ax, 1684h
$ K, q/ |8 v$ y$ d Y1 x mov bx, 0202h ; VxD ID of winice8 h, G: y; ]: k2 f( ^/ l
int 2Fh- f4 ^6 B; J2 z# u
mov ax, es ; ES:DI -> VxD API entry point
, [- Y5 z q( v) Y2 r add ax, di
; ?) @! h- Y* V+ J, F test ax,ax9 [, E9 H, Y2 O
jnz SoftICE_Detected
) F3 r5 V" [$ g) g! x6 n% G, h
8 ?+ O3 E$ e( R8 ~9 J___________________________________________________________________________
* R6 D- N# ~, d$ X) G: `+ S) V" F) _5 ~/ t4 V) r2 p
Method 04: Z+ p w# b" ~! t) f; o
=========
" J# w/ |+ ]( `% H; l9 P' s# o4 T; q' [' t; h. h, N! |% u5 l
Method identical to the preceding one except that it seeks the ID of SoftICE
0 J2 T1 x$ w( l. d0 z2 zGFX VxD.* x/ J. ?# x* I
' t6 l& W2 F4 o" W& q7 `( x: c s
xor di,di9 i; [6 V8 p/ O& R: m- J* O
mov es,di# R- W+ q; J* w( Q* {& a
mov ax, 1684h
: r/ y5 E+ g1 J/ ]+ { mov bx, 7a5Fh ; VxD ID of SIWVID" n0 Q. p# c) m/ d' h) E3 C" R
int 2fh: f5 p+ @4 `; N& g
mov ax, es ; ES:DI -> VxD API entry point" {3 U! x! q' d5 H1 z/ i
add ax, di
+ F5 [4 |/ U" _6 @, Z) M$ d test ax,ax
* ]' Y' @: ]5 q1 z9 n3 i. X. b9 | jnz SoftICE_Detected; F& W% [% [% j' u* J" y/ K
/ r4 ]1 P3 ^4 f: A3 ~5 g__________________________________________________________________________
) V4 i6 {6 r7 o- D' w
/ d, T" R) h. X8 u" g1 z. y) R. [ J
Method 05
( R- G; ~" J; T l2 L. b=========* _, A2 I/ N7 Z p+ V0 b) ^& W# b
; ]8 h0 z) w- J- P5 rMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- d1 n6 `% G. B: _! idebugger. It calls the int 41h, function 4Fh.# x D! D+ W# p1 Z& Q9 D$ y
There are several alternatives.
( }4 v9 [/ D! g* O# N
; J* t0 W5 `8 S. h: PThe following one is the simplest:
/ p# E% \1 u( p3 `4 {/ ^& I: Q/ V7 M& p" O
mov ax,4fh
+ V( Y0 V S' L% | u int 41h
B1 E+ n! f0 c! ~ cmp ax, 0F386' X# G4 A; t1 R; E) E6 G
jz SoftICE_detected
$ [! [& b0 H9 |& D4 B+ \2 K" ^; U r6 w$ C! I
, v/ t0 p- H0 jNext method as well as the following one are 2 examples from Stone's
$ W8 `; V+ D0 \! V$ D"stn-wid.zip" (www.cracking.net):) \& f3 b( j& j- K/ H9 d
7 y Q6 P* S; P* z# `( Y2 {, ~" i mov bx, cs5 N& Y4 z: ~5 S5 ]2 {4 p8 J
lea dx, int41handler2
$ N5 u! o: s& b/ E+ m: {7 s xchg dx, es:[41h*4]. [' a& ]* u$ K! o. D6 s
xchg bx, es:[41h*4+2]
- K( Q! g: Q5 Y3 x1 A mov ax,4fh4 H0 \/ S7 S! ~8 Y
int 41h" p' N' y. S; s% G" e% e& Z
xchg dx, es:[41h*4]; q* G& I+ J) ], {4 Q/ U
xchg bx, es:[41h*4+2]
7 I4 M9 ?& w: V' \ cmp ax, 0f386h9 A" p- \8 ?: T3 ~+ L& y
jz SoftICE_detected
2 S2 B Z" F6 f+ [- I# b( U4 z' G% W# `4 o0 A* G
int41handler2 PROC) {/ a; ~! P7 z
iret
8 [& R6 k" B N6 g# }' vint41handler2 ENDP( R. ^$ k! { [( `$ m6 n1 d
2 p1 \. q9 H8 O
5 _2 X! @4 U7 u_________________________________________________________________________
# G9 y: C2 x& x) u- e+ J) i* @2 J% v! W0 p
* L) P3 h6 i# w, R6 |
Method 06
# H/ O @( o" |* b5 U! a% M=========1 Q6 o/ \' T3 }* w
4 Z" f- Q4 n7 z8 g
1 |# D7 r( S2 P7 v V( I3 C
2nd method similar to the preceding one but more difficult to detect:
* w: H8 h0 [/ V, l' F* d1 f/ w3 H) N: M- B6 `: \7 L' M2 C+ X1 Z
& y/ o. z( r2 A9 b7 xint41handler PROC
2 |' V- n b1 Y mov cl,al
4 F( i. V j+ [" R5 }+ @: E; T iret* ]& u& t& I1 J$ M8 T
int41handler ENDP" S6 g6 B2 |! Q: [" K! s
+ f6 u! C( ~+ b+ Y8 v! a8 c: g" K, p% a( B! j
xor ax,ax- S: |! ~' N1 O/ E4 t6 @2 S6 h
mov es,ax- ]! L8 D+ w* g7 }+ i# w8 `
mov bx, cs
; l1 D$ o; g' ` {$ Q lea dx, int41handler
5 H* k! R% f6 F! Z xchg dx, es:[41h*4]
/ H: H& h u1 Q0 T9 n. r3 A% a xchg bx, es:[41h*4+2]# r `# q& H" }4 Q9 r
in al, 40h6 o* i; O# C5 m" x$ B
xor cx,cx' I/ e8 U2 [7 z. J
int 41h
" Y/ y3 t* A5 Z7 H n4 B xchg dx, es:[41h*4], z" h3 {$ V8 O- R$ m" G0 P# _
xchg bx, es:[41h*4+2]
9 v) V: n; Z. s" M cmp cl,al
; N1 s. F9 l2 b9 \( F2 c$ a4 b jnz SoftICE_detected
$ G% m$ L6 B9 |' o% e8 `
4 b' t0 n+ ^' }" Z* o_________________________________________________________________________+ m. N# n! o ]/ I |2 h
3 b" s9 s0 F+ c; ~! B
Method 07; l: E! c; v) d. a
=========
8 x a$ L; a$ M3 u: `, h; u5 Y4 v) b8 Y. M
Method of detection of the WinICE handler in the int68h (V86)7 {* \% k* S+ Y
; t' x0 P3 |) i) ?& r6 h/ S# W mov ah,43h/ J7 E6 l; F/ N# p7 m
int 68h
1 T* i; Z# V, M5 ^& o cmp ax,0F386h: I* j; R8 J: d+ G6 Y7 D
jz SoftICE_Detected
3 v9 s; M/ c' Y6 O% z5 G8 P4 C3 I2 R7 P# R
) e0 s+ t* P0 U, H) P( p( @4 R+ {2 o! d5 t=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 C$ d4 b$ P2 V+ t$ w+ }4 P
app like this:/ M! z3 i8 s, T1 I7 P
5 ?" m% n8 D/ H/ Q3 p( g
BPX exec_int if ax==68: W: _7 k, E# R( W- [3 d
(function called is located at byte ptr [ebp+1Dh] and client eip is7 y8 s$ {, d3 y' `. h
located at [ebp+48h] for 32Bit apps); C) a4 T7 m$ R: q: L; U3 X
__________________________________________________________________________1 x5 j5 l O' ~. O
~2 J& {: m! ^6 _8 C' |
! B' c/ @9 u: e6 X( @ fMethod 08
/ n, n+ n* G( Y* |=========
9 |" q" X: p; ^4 k7 {7 Y' e
8 d5 S' b4 ]/ A8 B. J. GIt is not a method of detection of SoftICE but a possibility to crash the
, T1 H$ U! `& m$ ^. x8 Q' `system by intercepting int 01h and int 03h and redirecting them to another
! c9 I% [: f- f5 ]routine.
( G' b; T9 t, q! V% U+ E( u4 GIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- Q2 n. B6 b* `: y( ^
to the new routine to execute (hangs computer...), p# _. ^5 X3 q. q5 K E" I
$ @* U6 i/ R* o mov ah, 25h# K1 N2 Z4 Z4 _0 T7 V
mov al, Int_Number (01h or 03h)) t" q& K9 Z9 `/ k( Y7 {: A( X! e
mov dx, offset New_Int_Routine, u) b1 t( v6 H& ^
int 21h
* \: H* A# ~9 ^( k
. x; [" ?2 }# M+ G- X; S__________________________________________________________________________
3 E& @+ ~* ^! d. ]! `0 y+ V& d& N& d( ~/ i' ~0 C
Method 09+ |) c, Z: ?( h8 Y, k }, M
=========
/ S4 Z e5 i1 Y1 x6 H9 W5 B
4 \ p$ s5 y/ v( h+ M oThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 C% M$ `( y+ d% V/ }# M
performed in ring0 (VxD or a ring3 app using the VxdCall).5 b5 l, m/ C5 j: x$ a
The Get_DDB service is used to determine whether or not a VxD is installed9 i, _2 v* }1 L6 ?
for the specified device and returns a Device Description Block (in ecx) for! g( Z3 ]; J8 v3 |( w1 h/ q1 ?
that device if it is installed.
2 U2 k4 }+ m, a
- D5 g L9 M4 r1 R9 _2 n mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- h; Z3 [$ B1 ~& H5 Z1 }: g mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)6 j4 c- E9 G& m" Z
VMMCall Get_DDB
3 t8 w8 ]/ W* N. J0 _ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- L: C& a/ V- c/ E" t% i
# L4 k4 Y2 D: XNote as well that you can easily detect this method with SoftICE:/ M: ]/ T( w" `! ` B! S
bpx Get_DDB if ax==0202 || ax==7a5fh. X3 [" L1 v( S& g
% u8 E/ T! m! X' a
__________________________________________________________________________9 s: d4 |0 U& o* ]8 I1 f0 w8 {
# z1 V: Q: q0 D$ }& a3 x! D
Method 10
( i# }; c G. K! W d0 a5 M4 O+ R=========
6 c+ ]: U: _9 r! \
! S' w* B u+ G9 Q1 b% L9 j! K, E=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 N/ ?( Q! _! D; z/ f5 G( r r SoftICE while the option is enable!!8 f# c. J" k6 n- Y% H
9 f8 {2 z' c h$ ?/ B! QThis trick is very efficient:+ G/ \3 y% ?& T0 v) X! n/ Z: b
by checking the Debug Registers, you can detect if SoftICE is loaded% w# D3 u" I0 W8 L0 @ {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* E2 C2 ~; z/ i+ n0 g6 r3 P
there are some memory breakpoints set (dr0 to dr3) simply by reading their) K3 f; }$ l2 M0 Z& y0 V4 r8 m
value (in ring0 only). Values can be manipulated and or changed as well4 ?. m/ z, K6 N4 _# t8 U: t
(clearing BPMs for instance)& @: \; J1 {- z, U3 h9 |
) F ]! `4 T7 I9 M, s4 U# K__________________________________________________________________________* \1 }" q! z9 v' [( @# W
z/ f5 Q g6 {( U5 C; F
Method 11
0 t$ [/ K* D. C8 a=========
% k/ f1 D) X8 z0 h& _( }0 K9 z: Q/ ?
2 u6 p' g/ b" h( J5 hThis method is most known as 'MeltICE' because it has been freely distributed u3 }! o; v/ {0 T6 B! q5 I
via www.winfiles.com. However it was first used by NuMega people to allow+ V _; {7 n; s1 y- ?5 L6 G
Symbol Loader to check if SoftICE was active or not (the code is located
7 \/ `7 l2 e0 ^5 s& @) Pinside nmtrans.dll).. O# \3 R% X6 J1 Q- T
5 O6 q4 z: s D f+ _The way it works is very simple:, k3 m1 [- l4 e# n2 M6 ?
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ I! d. c# x7 U& S/ o! y2 `WinNT) with the CreateFileA API.# R- ^) o$ y" J8 K, D- N u
9 D! E7 s8 c4 J; S" S, g7 ~1 U
Here is a sample (checking for 'SICE'):) s: a+ ]0 z+ _, T8 N6 w) z
7 V1 T0 L M6 B3 J8 h0 b
BOOL IsSoftIce95Loaded()7 E: L* [3 x3 f9 p$ a& O/ x
{
9 ^; ^& w, W3 _5 o" m; D4 j HANDLE hFile;
9 j$ P; ~8 F6 u6 g( S) V, c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ Q( h/ B2 @! ~$ m) P( I
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 z; C/ |% O, x/ @ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 H' Z( B+ r/ G" b$ |) \ if( hFile != INVALID_HANDLE_VALUE )
! M5 \4 x1 K1 Q J% e: g4 z {
7 U9 s. Y- J, m3 ^ H3 a CloseHandle(hFile);
5 z. z6 G6 W1 S4 o return TRUE;7 G7 V7 ^5 K1 l! y6 N4 `9 {
}# s* N$ i5 G* ~; G
return FALSE;
) Q5 J- ]* T& {}1 N' x2 p8 C. { c
; s3 z9 G7 i! F |- nAlthough this trick calls the CreateFileA function, don't even expect to be
; a, ?. L0 `5 ^9 |. m2 `% Pable to intercept it by installing a IFS hook: it will not work, no way!4 a7 p8 p; p2 P) u" Z0 f
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( B$ l6 ?' u! F2 U @" k/ l
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ `, t$ z3 V$ d' vand then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 |, ~ f- t- ^; B/ b; ^3 B$ rfield.7 W/ q3 t* n! k4 i$ J8 W( f
In fact, its purpose is not to load/unload VxDs but only to send a
$ R" X! P& g ]) y" R: s0 XW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 b8 V6 b( d! Z' m" B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 v9 Z! j% A) {7 Wto load/unload a non-dynamically loadable driver such as SoftICE ;-).( u) c7 j* b: _! d
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 | G" g8 m) p) X" \- Q! \
its handle to be opened and then, will be detected./ ^- t5 ` k8 o& n
You can check that simply by hooking Winice.exe control proc entry point# K& h* Q9 A3 x: y3 j
while running MeltICE.* b% y) D( z% u# T7 ^# a
5 ` ~6 M5 c9 R: E& L' y( O; i) B1 c! E- g
00401067: push 00402025 ; \\.\SICE
* p# \3 g8 `6 o- k; I2 \$ Y+ { 0040106C: call CreateFileA. {( O7 H, U- \( ~' P
00401071: cmp eax,-001' o3 k6 K" P! X8 ~: Z
00401074: je 00401091. [% D& }" Y5 ]- I8 q
1 n- {6 P" J3 z k! ~$ m
- V$ j( E% D9 T! rThere could be hundreds of BPX you could use to detect this trick.# {0 M. y2 x5 P3 X' u& [
-The most classical one is:" }6 k) h: v! R- a( [. q0 A3 S
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||& i! z; |6 T0 Z f. |4 z
*(esp->4+4)=='NTIC'9 H/ T- r! G! L" C
" w2 C; O6 |! m* |( |-The most exotic ones (could be very slooooow :-(; c$ g+ P2 q! q( G
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( f4 b6 ^6 A0 [' }% m) L4 n ;will break 3 times :-(; `1 K4 m0 {2 f# ^8 ]( |
0 q/ t' s0 m8 `7 T-or (a bit) faster: $ f+ h$ {. K& u. B, i3 {3 {
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 S* F& L- x( V" Z, G
$ O8 @( B% {+ ?' I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% D& ?. P% c6 A/ l ;will break 3 times :-(- _* X3 c1 ^2 e; k! h
" _7 \- Q& R$ F7 {4 g, W, j5 Z-Much faster:
9 }% A5 s* G7 F BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
, r- I0 ]7 @ B# ^
; J% F8 }0 ]- x; C& xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
- V! s5 O" h7 S0 e$ Z0 j) jfunction to do the same job:! y6 b7 v% Y0 j/ ?4 k5 [
6 ?! R( t( z: I9 |8 y( C) H
push 00 ; OF_READ( O& J+ s2 ~: t& m
mov eax,[00656634] ; '\\.\SICE',0
% T' r. t3 M; x+ C push eax2 [1 f9 ?$ S0 R6 H8 V6 [* k
call KERNEL32!_lopen
" d5 x7 l/ U4 F+ i) ` inc eax
$ r; _5 Q% _2 @3 L) v jnz 00650589 ; detected
4 C- Q* x) f, ]" a2 H push 00 ; OF_READ
6 {% C! W: j( m8 y2 ] mov eax,[00656638] ; '\\.\SICE'
/ e8 J# _+ u Q. @& U/ H1 Z. |5 U push eax6 s$ [4 Y) b; n
call KERNEL32!_lopen- X1 Z5 }, H! N0 c" }& i
inc eax
# Q0 X' M5 _+ J5 ? jz 006505ae ; not detected
( `: X- Y4 s; o$ @; M9 M0 @4 y9 _" d9 j! _# M
8 W6 S" d% M( w+ @$ a3 [; N4 W__________________________________________________________________________
! i( B# G# l0 p+ B1 E
" J1 v+ f! V; E) j& `# GMethod 12; a) }, L( L; x
=========
& z- b s2 k$ A1 |1 x1 s& d% W$ ?1 Z# \: U- ?6 v; N, [ F5 v
This trick is similar to int41h/4fh Debugger installation check (code 05
3 K! t" ?' V" J5 P, P& q# X4 E& 06) but very limited because it's only available for Win95/98 (not NT)9 _0 A, w6 i) I% _7 u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.& N3 D# `8 t& S; R
% }* C- h9 S* o5 f! Q: n& r' ~* y push 0000004fh ; function 4fh6 L2 j% Z* ^/ F# c% `" V- u
push 002a002ah ; high word specifies which VxD (VWIN32)1 F/ x! P( {& k! Q% Z" H8 s) V
; low word specifies which service% c1 H6 G M# n7 s
(VWIN32_Int41Dispatch)
) E) Y! r, p' `8 A, n$ T# |& s+ V+ W6 W call Kernel32!ORD_001 ; VxdCall) ]1 s3 o& g: G" v! s
cmp ax, 0f386h ; magic number returned by system debuggers
$ v ^3 c7 _( {% ` jz SoftICE_detected( P2 F# k/ O. S: R0 |( X9 o, L
" \3 @! f6 d5 k
Here again, several ways to detect it:* |! T8 f+ S" G
3 c& ~4 O2 N2 `' V- F/ X+ `5 p
BPINT 41 if ax==4f% \7 C9 t' ?1 \8 `. w$ h }
4 e& z/ C3 \$ g& @# e% U; Q N2 c
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; Q1 U. @+ [2 q' w
/ W9 W9 Z" J; G+ k0 f BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ j8 |4 O; x2 ~9 y, i! O3 ]3 |
; a# N, Y. W9 j+ S" D, M BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
! B3 Y4 {" j- L% D9 s5 Q) H; W+ ]' s% |' A% z2 _8 j/ i7 h
__________________________________________________________________________
; ^ n5 {: F: {8 M7 n1 _7 _1 L. a F) T0 ?5 T
Method 13
0 i" D& z) _- U& O6 Q1 S=========5 e- U# F8 C& d/ d3 @ M7 y
/ Y* U6 K/ L" i( PNot a real method of detection, but a good way to know if SoftICE is2 t% F& v1 ?$ F: L% }" K4 h* L2 d
installed on a computer and to locate its installation directory.- ^- R4 i* d: J0 E
It is used by few softs which access the following registry keys (usually #2) :: c1 ?2 z* K- P- k3 E; C$ l% {2 d
d$ ^; }& T% A6 G- X3 \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 a$ ~! q- k3 m! e& ~4 u9 _
\Uninstall\SoftICE
- j8 [6 F* K) ~* p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ i- C3 Y J! M3 p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 u. j* u. P6 C0 f! e8 e1 Q* M
\App Paths\Loader32.Exe
c7 S! X+ I( l+ h5 {$ t+ O: }2 x4 c
0 R% D$ p. d: f6 c
Note that some nasty apps could then erase all files from SoftICE directory. @- Z0 ]5 a- b6 @+ F) ~. v4 Y, D
(I faced that once :-(
9 x; m! C5 @5 z9 ~ q
% k: f3 L3 r2 h1 u3 ~9 gUseful breakpoint to detect it: N: y6 T& O: j
" O4 B" G9 k. O! U5 x7 u, v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 n; K5 D0 y; r! E) A" U
1 T* R0 J3 [& [- `- K# M: _* g0 O__________________________________________________________________________* S& g7 X: t# q/ P# ~7 E# N7 @
- z1 y5 h# o V1 M: g1 K0 _4 R: r: L3 j" X) D6 `& Q2 z
Method 14
4 f$ H7 x, C( p! K5 I=========
' X% ?0 m* \ y: w# X
( W8 [% ]+ [$ x+ |# U! iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ C6 N! `8 U# ^3 B5 r b9 }
is to determines whether a debugger is running on your system (ring0 only).5 K( W& n. n! M4 V6 S: G" I
' P- w! y' u% I/ E# W# `
VMMCall Test_Debug_Installed' L& x( ]# ?1 L- M
je not_installed
1 ?+ \! ?8 T: u; N. n
8 k# L9 X; c9 E0 H* |This service just checks a flag.
. m5 ]: @. W; C6 n2 K" x5 }</PRE></TD></TR></TBODY></TABLE> |