<TABLE width=500>. X0 G, ]# S4 V9 I, G
<TBODY>1 }: w5 X; ]% v) ?0 }& a5 E
<TR>
+ I; d: ^# {8 W% C6 B3 D<TD><PRE>Method 01
# e8 `0 W% D2 D8 ? s=========
- m; G7 N6 g \8 A
2 I- K0 D" V/ E# [* B. ZThis method of detection of SoftICE (as well as the following one) is; T0 o+ p4 @+ z2 r, v
used by the majority of packers/encryptors found on Internet.4 h8 g: O4 N+ B6 e
It seeks the signature of BoundsChecker in SoftICE
6 v' ?4 m$ V* s6 u
; t& ~6 F4 K& `; c0 g1 S mov ebp, 04243484Bh ; 'BCHK'
0 k% |4 l' `6 L' z# q% K mov ax, 04h q. p; e" [2 U4 Y7 q
int 3 " y9 g1 f& e0 C3 L8 u& l
cmp al,4
& e- ^& P4 K; B3 }4 ~" a0 d jnz SoftICE_Detected
7 k5 l8 E5 x' Z2 ~& k/ ^
! g2 J8 B3 g$ I& W l: \___________________________________________________________________________
' U/ \* [4 Y! _; q9 e4 Y$ ~1 E5 x& @& r) o# R2 t6 ?& ]6 ?
Method 02- {5 E. @7 V0 J; b. z$ y Q
=========
; B8 J& C7 J' ]# v8 n
( C1 e. J8 D+ i- JStill a method very much used (perhaps the most frequent one). It is used
" k+ m% A$ r2 |' A6 g- z7 E. zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 `0 H: [: A" D1 y' @6 For execute SoftICE commands.... G+ b8 Q( ?0 o0 ~3 Q( {( [8 p, u
It is also used to crash SoftICE and to force it to execute any commands' U! g- {9 Z5 }" ^# ?' Q
(HBOOT...) :-(( , o! ?% I, Z) d' T
% g, O# y, W3 e: Z4 ^- x( p1 c; f& l
Here is a quick description:( N+ ]0 M. `6 [2 ?% Q
-AX = 0910h (Display string in SIce windows)
7 K5 f! S& i0 V-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, v$ J0 z' x7 K4 E3 b& n-AX = 0912h (Get breakpoint infos); E4 r; Q( o) W% H* \/ X" X
-AX = 0913h (Set Sice breakpoints)' L/ h# D3 x6 q( m& ^
-AX = 0914h (Remove SIce breakoints)
2 H: D l$ L/ M8 M6 s& ?0 @! V7 e6 h1 Y1 N. x6 q, E
Each time you'll meet this trick, you'll see:
- R u8 U5 W2 l( c5 _1 Q; f-SI = 4647h
/ h6 }: _* j a7 ?( z-DI = 4A4Dh' ?1 N* `. A" W" H1 x% t+ u
Which are the 'magic values' used by SoftIce.
' P1 S- k8 C1 @# Y6 F1 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 Y- \5 B9 S7 o: [" Q! Q8 `: ~
2 B7 \( ]0 C3 c& PHere is one example from the file "Haspinst.exe" which is the dongle HASP) f( q6 U" L( m# K
Envelope utility use to protect DOS applications:
( K" G& j" H- H) f7 z( b$ s: A2 S1 ?0 x% P/ r
% s4 i @- J% S3 B
4C19:0095 MOV AX,0911 ; execute command.
1 ^" x1 A. L) u. [2 t5 }; e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; K" T/ f3 h3 F9 G+ e% j4C19:009A MOV SI,4647 ; 1st magic value., _3 o$ x2 o+ s: [9 _
4C19:009D MOV DI,4A4D ; 2nd magic value.( }$ ~- y; W& U) ~' H4 E* e9 M
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* V$ B$ M' P, U
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 H3 @& B! {0 n( K" |2 l4C19:00A4 INC CX
5 O* U9 u4 ?& c1 i0 X1 V4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: @0 T6 h. n0 T; |0 N' H$ ?& P1 ~" ]
4C19:00A8 JB 0095 ; 6 different commands.
' X5 Z6 j8 O* g3 F- Y" g8 Y4 U4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 V1 }) j6 [& P/ [) J t# a& K
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) L3 C+ B+ W" W" C0 p% _
1 R( Z- N$ @8 ~2 JThe program will execute 6 different SIce commands located at ds:dx, which; y/ D3 L/ G# N& l! F
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
W6 c$ V$ B& _: E. K) d" W8 A) |( k2 ]1 u5 {. ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ o; f1 V4 A4 ~, a2 \) E___________________________________________________________________________
: u* M8 F. d$ u# L f0 P8 L; | ~- W+ Y& I U/ x$ e2 x7 o
. E3 A! z& Z" R; lMethod 03) f- D; O1 j7 s. R
=========; r3 I* p0 h( \0 H% P# w# E6 ]9 ^
$ L% w. r$ {' h, K: NLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# \9 [& G( O% D' ~) [
(API Get entry point)& a9 c* b% M# C+ I5 ?, D
" V4 n+ \* @' d# B; T
+ C( }4 J0 [1 h) h* [1 P; I) e xor di,di
4 |$ n0 ^, ]. c8 z; d, n4 Z6 L mov es,di
7 N$ n7 k( X' \* o mov ax, 1684h
! r/ {# N* f( R( V mov bx, 0202h ; VxD ID of winice6 x! O! E: y8 g# D% F0 S, F* i
int 2Fh
, {" b- K0 G8 J% j9 x W mov ax, es ; ES:DI -> VxD API entry point; D1 c# `" |6 p/ m
add ax, di
$ {/ k5 C4 p: J7 e$ v% j% g, ] test ax,ax
/ L0 Y$ M+ e9 a jnz SoftICE_Detected+ f2 P. l) S6 [7 N1 T" `
, S6 d& |) Z: v9 l+ E ]___________________________________________________________________________
& u3 R+ N% B3 ~7 Q7 x1 q% E2 |- Y3 [" p: }, y; ~' n
Method 04
$ t6 i: y+ q" m0 k! e5 h9 m=========( D- d# ^4 Z1 W* J
/ r+ T6 N" Y) P: A6 g
Method identical to the preceding one except that it seeks the ID of SoftICE
* C H" b% `5 p3 d3 ~7 ^GFX VxD.: I, V9 H/ y7 n0 o
' v: U8 K t9 j1 [1 T xor di,di
; ?4 j2 C) S: J" X5 H- L, y mov es,di) ]+ `& m2 c5 L
mov ax, 1684h
) u1 w) l g% f1 Q f! n mov bx, 7a5Fh ; VxD ID of SIWVID
( S( ?0 d9 A( x2 b int 2fh+ G1 { w9 K F* @6 F* G: P
mov ax, es ; ES:DI -> VxD API entry point
" `: I- Y* u: u0 ?1 J. S add ax, di
, d1 t. B B( \2 d: Z5 c5 L* o test ax,ax
( C: e! ?% d; D& @9 [ jnz SoftICE_Detected
' A# B" }: j' a) _3 U
3 d/ U( y# z" ]: B) B__________________________________________________________________________5 k' v9 r# Z9 J g5 z
/ W' w- e# {5 N/ A: o1 q! s: [2 f4 _ t: @* q W% P) u9 G
Method 05
5 w6 d' Y4 O8 Y9 u! h6 E! L=========) B4 T+ O S% n! \0 M# u3 S
9 a- B# g! K B( MMethod seeking the 'magic number' 0F386h returned (in ax) by all system4 b! p6 h. [( i3 ?
debugger. It calls the int 41h, function 4Fh.
* W" p- ^ l& S: C4 kThere are several alternatives. 1 Q6 ]; R! E4 W& G0 a8 C
; Q3 N; j) D: _
The following one is the simplest:
1 s# Y) X! a6 V- v+ F) r
$ D6 H- W7 M, ~, ^9 x; q$ i3 L8 e mov ax,4fh2 E0 V* {5 H. z _( l
int 41h
' W0 |0 I$ |" Q/ ~ cmp ax, 0F386+ ^& J. Q# ]* U0 H1 D, ? k+ P8 i
jz SoftICE_detected
3 w% k, r# I# }4 K; q t9 _! K3 }. F) Y& o0 b' `5 M2 d
! x' H5 w$ g. h/ Q/ C
Next method as well as the following one are 2 examples from Stone's 8 E0 s c! F( b
"stn-wid.zip" (www.cracking.net):
1 r! j( z: v+ c
: w& m( }. p. |- X5 g5 x4 s4 o mov bx, cs
. O0 g7 R- x3 C lea dx, int41handler2
8 Z! D `1 c: Y4 {& ~ xchg dx, es:[41h*4]6 M/ _' `& k0 B g/ ?+ O2 i% x
xchg bx, es:[41h*4+2]
( Y7 Y: [% b$ M' b9 M mov ax,4fh
+ ~) C7 W9 E/ n( e# J2 F" K0 O int 41h
. I) j4 L4 z/ x# o3 } xchg dx, es:[41h*4]
) k7 k6 T" `( f! j, s xchg bx, es:[41h*4+2]% O, O. a, k& N" w0 z, ~
cmp ax, 0f386h
# f! x5 F) ]4 A1 ^) ]- Z jz SoftICE_detected' U0 S$ j- T& @
8 P) t/ N) p) I( d* a& E+ N
int41handler2 PROC
8 p* _& i9 n6 A# X9 ^7 X iret6 S& }& W. j1 o6 N
int41handler2 ENDP3 J0 [. k# b. G6 @2 ?
8 X+ T4 S6 C0 L
2 o o2 ^8 E" I* f: J. l& K_________________________________________________________________________8 j b" Y) L+ x/ j6 @* P
' w" I) [9 v) }3 w( C
" {& U2 L& O" U* C4 HMethod 06
' N& [: o' G; C- o+ Y/ `=========
- P1 _8 j/ H, Y: t" q+ g: D4 C: }" n" i3 u
% ?- O2 S. [- j- F5 n& n2nd method similar to the preceding one but more difficult to detect:3 d0 Y, C8 @& p; @, A( |+ b4 k% J5 f
8 l- z( d6 T; n: V. x y# W, A) C
* i, |: ]8 x: q u1 A
int41handler PROC& A5 V8 |( }8 a/ P, F, b+ z S0 `
mov cl,al
8 h; \9 A7 D8 |: i& k( D% _1 N7 c iret" L9 r8 o, Z/ c9 y+ E5 g. N2 P
int41handler ENDP
* M; N$ r" N& D- C! y w' u% A j* P1 f9 C
' \1 p9 h; z5 f I: d9 @) k
xor ax,ax2 j3 m9 Z/ F. t& f9 ?5 X& K( J% M
mov es,ax3 Q# q2 ~0 K) G/ s4 ^
mov bx, cs. K/ x6 ? Y/ r; s: j4 j ^8 I
lea dx, int41handler& ]' B/ n' i7 d% q6 W4 F
xchg dx, es:[41h*4]
1 w2 ]0 o3 c( F xchg bx, es:[41h*4+2]% G9 O1 }& U( h; a% }0 e e3 J1 M
in al, 40h
3 F& z+ W5 x; d1 m* q9 H# A1 ^& i xor cx,cx# }8 E) \7 \' O. O
int 41h! f6 v* ^3 i P/ b$ D7 B) m
xchg dx, es:[41h*4]. a- J1 O' d0 }/ W4 T
xchg bx, es:[41h*4+2]
# |1 }, X4 Y2 L% u& W cmp cl,al
: F" F( T; X K3 Z, C jnz SoftICE_detected
2 u9 f# s6 Z; F3 i+ p0 q3 U4 E7 a1 {' t% y$ k
_________________________________________________________________________8 t9 w7 d! C/ h# D# [
H6 R8 A0 ~9 z0 p1 P$ F
Method 07
& s& u: B$ S/ h3 \" ~+ k- E=========# }2 L, w% ` l
- a) S8 S5 w% P, E
Method of detection of the WinICE handler in the int68h (V86)
' V; ~0 K( i0 B2 w* k& @/ [; o. `; a4 j
mov ah,43h3 [# x4 t2 f: O \
int 68h5 M9 }: A! i" n# K
cmp ax,0F386h
9 { u+ P- p6 i" K jz SoftICE_Detected
# n$ @0 T4 f/ G6 D( i6 R) ^2 r) S) N N: Y
* Y- U) ` Q* W! J6 ]8 z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! t+ B4 v0 m$ p% N3 p1 \5 O app like this:9 Q; e, `7 Q6 p7 U; @7 B2 T
1 D& C' }# |3 ?& L' {% H( f
BPX exec_int if ax==68
, z/ \$ T- B* Z \ (function called is located at byte ptr [ebp+1Dh] and client eip is/ Z9 O2 E. w) v0 B
located at [ebp+48h] for 32Bit apps)& u5 h6 b; T- k0 Q. x
__________________________________________________________________________
9 o9 `- H' j: R( j- h, k% L3 z4 D1 c. x: J7 A
5 O- B( I9 t4 }$ K T8 ^
Method 08: V8 `4 c# S# x9 y p+ K# i
=========4 ]& M7 [( z+ }0 Q" E& [ {: N
6 a# Z5 [" A9 f( [7 q/ F: o- Z& ^
It is not a method of detection of SoftICE but a possibility to crash the
* ^- q+ V2 d* t% J# t0 hsystem by intercepting int 01h and int 03h and redirecting them to another( ^; @1 Q# v) N3 D5 P/ C
routine.
* g; N9 q; _$ Y w' B# h" L- m! a `It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ i7 n# D4 D4 _- x8 }; y
to the new routine to execute (hangs computer...)* g* l* f, X% V% k- [ n1 _9 [1 N$ m
" _, l; A" O4 N. }8 w mov ah, 25h
& Y# J# R: M9 ]' B) U mov al, Int_Number (01h or 03h)5 v+ p2 i! T4 ?8 y" D' y
mov dx, offset New_Int_Routine5 i) N& m/ D5 l3 [6 k3 l
int 21h. c, z! j$ z, ^. r: V4 G+ I& L6 ?
R# Y. s8 @6 s9 {3 R
__________________________________________________________________________. D6 C5 @ w& \& W! \
, R5 w9 Q5 \6 f9 y7 D! \; i5 }Method 09
: k! S2 u h3 J1 _! A7 h=========2 [! L* h# c/ {$ w) y/ h% F6 \
5 z- m }5 X" lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ B7 l$ r. t" Y7 d* \
performed in ring0 (VxD or a ring3 app using the VxdCall).1 t: a+ {- {, L2 l2 h; u* g: q' S% B7 H
The Get_DDB service is used to determine whether or not a VxD is installed
6 G* W: q1 G3 Y5 }! O0 vfor the specified device and returns a Device Description Block (in ecx) for
6 u& `3 F$ \ D( rthat device if it is installed.
9 j) T0 E% N4 F5 J# H' J
6 t: z7 {8 X, v+ J; m5 ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* Y- \$ i/ T, @2 a" V mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. Y/ U: E j" i VMMCall Get_DDB
* i* a) K0 D! K1 B, d2 [! B: I8 x- N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( N7 r& e+ U+ x( k
) ?/ e3 @7 D7 L7 HNote as well that you can easily detect this method with SoftICE:6 L, I/ E: u3 x' ~% Y# b
bpx Get_DDB if ax==0202 || ax==7a5fh
* B& x' x/ |6 W3 G; {$ I: z: M
+ y; P2 @) b$ _3 q; q__________________________________________________________________________9 A. e* P u; B8 }5 Z- p
# K% v. `5 q- S' ^: y- D# b7 G
Method 10
! ?8 a) Y1 k! \5 U=========( [' E6 h6 V; H( F
; |8 L3 l7 J( H! ?
=>Disable or clear breakpoints before using this feature. DO NOT trace with
; f5 l0 r0 {+ }' W/ l0 p/ l4 j2 z SoftICE while the option is enable!!
7 Z5 }' _5 n) V! p9 z3 [& E& S; e* H
This trick is very efficient:3 B: @' X6 E9 h& W$ G3 F1 _0 a
by checking the Debug Registers, you can detect if SoftICE is loaded
* D- b6 z8 f/ K k$ B) K(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; ^: c, Y0 K7 vthere are some memory breakpoints set (dr0 to dr3) simply by reading their2 X$ s/ U7 c; [+ \6 ?, R7 k2 Z
value (in ring0 only). Values can be manipulated and or changed as well8 E, s% b7 f( r2 z) ^& F: X4 ]
(clearing BPMs for instance)4 L- z7 Q" z0 I1 a6 I0 s5 A
' u" e, w+ h. _0 R
__________________________________________________________________________
0 E5 C7 M2 v% ^6 e8 {* J7 Z5 L* b# u( c( V! O
Method 11
& I: p T: o, z) Q. ?=========
2 Z Q# A7 N" _; j( B6 s; ?. c5 _6 r- o1 E
This method is most known as 'MeltICE' because it has been freely distributed u, g5 R! h9 R- ?
via www.winfiles.com. However it was first used by NuMega people to allow
2 A/ L0 C+ W$ F$ D; wSymbol Loader to check if SoftICE was active or not (the code is located* h* }3 k9 g: R
inside nmtrans.dll).& {( j* |; U7 U# ]
0 B: T% s. T/ f; B, J
The way it works is very simple:
0 e1 H" X: n- J7 N- G+ WIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( Y1 O$ M# c) ^6 c3 i( GWinNT) with the CreateFileA API.
- e- C+ B- v. n/ D4 l: q1 J1 G9 w. W$ z0 ]& d, o. ]) [+ y
Here is a sample (checking for 'SICE'):4 Q5 m8 ?* q& z, d8 Z" E- z
, d, A0 ]# G ?7 n! @BOOL IsSoftIce95Loaded()5 W3 G' w4 Y( ]& R2 i7 }
{
, s+ O6 u: S' w, s$ _" j) i HANDLE hFile; # v) Q& r6 o7 L9 a
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& C U( J3 i1 |1 L
FILE_SHARE_READ | FILE_SHARE_WRITE,
. {$ U `, @0 ~8 n2 j NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 L& T0 i% J( q& H if( hFile != INVALID_HANDLE_VALUE )& @/ Y4 L9 w; [3 Y7 H
{
2 y7 u p# J3 z. G. k" E4 V CloseHandle(hFile);
1 l2 Y0 p( R/ u return TRUE;) N# [$ I) G6 s$ D s/ A- e9 ~" J# V
}, Z5 T* z6 l- }% P E" f1 K
return FALSE;
$ m* p! T; g! _+ G}! y: @& A8 q0 M1 X. _
' g4 m1 {5 F7 f( v9 D: n* [* I
Although this trick calls the CreateFileA function, don't even expect to be
4 E0 P. \- `7 Y/ w d; l+ bable to intercept it by installing a IFS hook: it will not work, no way!7 S$ |" P" U5 c, H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ ^! j) }( a, r5 T/ M, ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 S. [9 Q0 j. p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! E3 K/ c/ ~, Hfield., ~5 H) j/ x4 U( `" q, s
In fact, its purpose is not to load/unload VxDs but only to send a
' ?1 B8 X/ v8 @7 G5 sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' V2 p S; b0 ]$ o) |7 j) fto the VxD Control_Dispatch proc (how the hell a shareware soft could try& e% k3 O; Q1 h) D; r* D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% {' L9 l# J% k+ W
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) f, D& s+ v7 [5 u, ~/ T4 Y# yits handle to be opened and then, will be detected.
! b, O1 s& t# Q6 |You can check that simply by hooking Winice.exe control proc entry point9 H+ i5 ?, n U0 T' y, {# Q
while running MeltICE.3 `7 _* q% |: L3 y( x
' }8 N b' h: M8 P$ s3 A3 _) H* I$ D
00401067: push 00402025 ; \\.\SICE
0 A# L/ T8 g9 ` 0040106C: call CreateFileA
: h i. l# i% q& |4 w 00401071: cmp eax,-0011 s9 q7 q, _9 I. l. L* `/ d+ T2 N
00401074: je 00401091- g5 I: C! M8 e' n
% d; Y0 c' P& a- `) l
9 [; d7 p, z4 [1 M4 g
There could be hundreds of BPX you could use to detect this trick.
; A9 R" o% a! x8 O* Z4 \ _% b% b* M-The most classical one is:
; K( N1 L/ r4 _ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! [" z$ C- J8 |7 [6 P6 ~5 ~! r *(esp->4+4)=='NTIC'4 Z3 \8 I8 @3 ^: }$ w6 }; K3 z3 F
5 i0 J) j6 c, U; q2 e# X4 y
-The most exotic ones (could be very slooooow :-(& u8 W* r& g2 U- s* |8 k7 w5 \! h d
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') + _# F( W2 D% z/ { r& K) ]
;will break 3 times :-(
7 N3 O, Y; [, L, ~. ^, m$ j$ g/ j# {) W' k" h7 P6 F: Q
-or (a bit) faster:
1 P9 Q( ?8 G3 K( `. w% } BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" y4 a/ k) E$ W
7 ]3 J% m+ _: C* D& x6 v
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
- `' e+ ?+ }: K$ K8 o ;will break 3 times :-(6 U4 _) `* R. @: y0 }0 C' D
0 k5 \. @9 K: W+ {) L7 J) \8 @-Much faster:
' e8 ^1 F2 j! e2 A5 k1 x BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 J7 \5 G3 ~: E: Z& B6 P% `
$ j" x# h8 B$ X2 [8 h0 q+ I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen# t0 G. H& a! g: Z9 W, n
function to do the same job:
8 S; ?+ q; v, \- b& p8 o# @. O
4 G# }8 M- _: B push 00 ; OF_READ8 B7 D" L/ ~. F- e( r! d" @" q
mov eax,[00656634] ; '\\.\SICE',09 s) P7 `+ `4 K
push eax$ M5 k- V$ L: ?. a, r W
call KERNEL32!_lopen
- e8 {3 @! p, G' j9 B0 j inc eax3 {3 p: r6 j4 j9 ]
jnz 00650589 ; detected, w: g8 m; J9 @) {: S' |
push 00 ; OF_READ6 b- n5 Q V- X: v: L# A
mov eax,[00656638] ; '\\.\SICE'9 Y8 {. o- y2 p8 m, E# p
push eax6 r" ^% ~# y- }; s; y1 W- w2 @8 s
call KERNEL32!_lopen) W, R( x; ~7 R9 v$ M
inc eax6 R$ U" S8 Z$ E$ h- {
jz 006505ae ; not detected
, m- y# ?2 X( ]5 S- i3 o, {
$ S' U$ [" c: A& n5 K) K E3 Z- v# I1 s. a! R
__________________________________________________________________________
( O( e9 p6 D8 L) B, X# l5 T6 X% f, J7 b9 r9 C5 a
Method 12% [7 z% H: e; ?
=========: d% K5 `. U! Y! A3 t( h7 {
& E7 I" ` E3 O6 x
This trick is similar to int41h/4fh Debugger installation check (code 057 S) }5 a1 d' B- C" J1 U1 l( p
& 06) but very limited because it's only available for Win95/98 (not NT)' @8 }- o2 @$ ^! N3 o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' g0 o5 f' V- {2 M: w
2 @% Q' u0 m! T2 }+ H( n: B5 N2 `
push 0000004fh ; function 4fh) |, L1 I/ ^5 ?
push 002a002ah ; high word specifies which VxD (VWIN32)
' e# A: o. C2 C; p ; low word specifies which service- `! Z) ^# r. [# a
(VWIN32_Int41Dispatch)
( g. X* z# u8 f) D- _+ D2 f/ L, ~ call Kernel32!ORD_001 ; VxdCall
. d- h5 X+ N; R! g# ]6 ^ cmp ax, 0f386h ; magic number returned by system debuggers
; Q5 v( u* k% F' g% U jz SoftICE_detected
* T$ X$ \( W: {+ R3 e3 n
0 A& w9 [. A/ |1 { @Here again, several ways to detect it:
& M4 J+ X. Q, J- {8 p- n
( k$ j6 m% T/ u( y1 P BPINT 41 if ax==4f" R4 f5 H5 e6 k- F& l4 Y
5 V/ \# q: Z% s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
& j$ _# {: y" y, J- `8 m
1 L. L; g% o) E# k' F# p! D BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
# `4 ? E1 M" W% P( v) i9 \8 c' d w) n/ H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, @. C7 D- o$ f* G/ q# Q) @; d$ f( Z. I9 x, c l- s% {
__________________________________________________________________________
[' |/ \/ B0 D4 T5 m
* A+ ~% u* V$ S V* c( t! B" vMethod 13
8 Q$ L/ a% I+ Z' A$ g' I=========3 a9 Z3 i. b8 F
6 H! [) u0 Q3 z- A" ?Not a real method of detection, but a good way to know if SoftICE is
4 r+ L: z c9 C: T3 Q$ b5 pinstalled on a computer and to locate its installation directory.' d! Z1 h1 O! P
It is used by few softs which access the following registry keys (usually #2) :
0 H+ i2 ]9 c! F. o3 K: Q
7 s# l! ^2 r6 x5 T-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" x2 Y' n0 M, h+ Q\Uninstall\SoftICE( e1 D* f# w* Z z! Z; S5 W- D! ~9 D
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 ~, H, ]0 P. y! I4 v5 C-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 |9 b. g3 }8 c, U8 L
\App Paths\Loader32.Exe$ [( @* K- e$ `# E6 E5 E3 W1 E
3 p- {1 A9 U7 W" K
2 s3 a' U7 h* oNote that some nasty apps could then erase all files from SoftICE directory
( P4 H& j) [$ k3 g$ U7 V' r+ r(I faced that once :-(1 \6 N% {! Z( p: J
R$ \# t2 n3 F- Z/ z
Useful breakpoint to detect it:0 v" `) Y4 R/ W7 ?1 G! A
}2 _" q/ ~ l# i! O( s: {% k9 ?8 \
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ x$ |1 T% w7 G2 G; ^/ `1 E& }# N# ]+ t7 H; P' o
__________________________________________________________________________
6 C' y& V5 R. Z
Z/ R. I2 a7 v& N* M, T. p4 o
' C$ Y; b7 U' JMethod 14
3 L# ]! C% Q: S=========- V4 v- B9 Z$ u, K" A" `
8 f1 P0 ~( h5 [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 L) m. @/ k9 y* p: Eis to determines whether a debugger is running on your system (ring0 only).
* I# G( C/ t _8 F
" G. s7 L) c& v5 l& K VMMCall Test_Debug_Installed
( E8 A3 j6 c1 J2 J6 n. ]# u v je not_installed# E, p2 b! U3 _) ^" [- ^
, u2 g& q m* B* c% E" QThis service just checks a flag.
& A% ?9 q, F O) h</PRE></TD></TR></TBODY></TABLE> |