<TABLE width=500>
/ Z4 l9 ^' }, d: F6 I- f4 v2 Z$ L/ g<TBODY>; N5 z x! {( Y# ?/ q; }5 {. O
<TR>, b0 _: z1 m* Y- B
<TD><PRE>Method 01
& b/ _* f/ ~. S( [& m- ^* s- N9 y/ D! T=========
! U2 O* h `! G8 u+ g0 G# g
- L2 a7 b/ l Z: @, RThis method of detection of SoftICE (as well as the following one) is7 g2 j0 o# O n6 Z* ` u) C
used by the majority of packers/encryptors found on Internet.* l# D+ ?7 C- R, v
It seeks the signature of BoundsChecker in SoftICE# Q9 v6 s( m# S3 F" x+ B- U
1 L+ S3 [, S( G* Z
mov ebp, 04243484Bh ; 'BCHK'
( F- y; s8 i5 K# o- [% G( U mov ax, 04h* |& M- C6 w' a0 R7 K# ]( u
int 3
" Y2 e1 U2 Y; m6 z7 S' c$ @ cmp al,4* w: O: L4 _# Y$ e9 s0 s
jnz SoftICE_Detected
6 T. n2 _% O# `& Y% x2 M0 r1 Z; Z4 I' s
___________________________________________________________________________& d( f9 F( n; r
; W( _( S0 c0 a) l$ R9 D8 l9 s" qMethod 021 [: i# H% U5 q$ B& }# l9 `4 r
=========
5 \ m# m5 F8 {( x# r. i8 Z% |8 ^3 g" J. P$ i' W9 f
Still a method very much used (perhaps the most frequent one). It is used
) c- T! H+ N4 H7 X, oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 q8 ]& S ?' a- m& o/ a0 Mor execute SoftICE commands...& c4 s: Z# K4 l9 L
It is also used to crash SoftICE and to force it to execute any commands
) s! ~2 u; W3 b$ @) O(HBOOT...) :-((
9 R9 W/ S# i- Y4 s
) m& d ]% u( K, I( y- ]3 BHere is a quick description:
6 v1 R. O, P: `+ t-AX = 0910h (Display string in SIce windows)
0 N- F7 D# x3 N& v. S-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
. N9 k3 U9 d) R-AX = 0912h (Get breakpoint infos)
" ]% O" c8 h2 w-AX = 0913h (Set Sice breakpoints)$ N, e1 h, i l/ H/ ^6 s4 M& m J
-AX = 0914h (Remove SIce breakoints)
- o* D4 }! R$ c2 [$ K3 C! `3 P1 U% N; n1 {) s0 v. `# l; h3 r- U E
Each time you'll meet this trick, you'll see:
j( N; \* c# p-SI = 4647h( z) t/ W' Y0 E, Y* X
-DI = 4A4Dh3 {, C$ D' I2 A' z/ U
Which are the 'magic values' used by SoftIce.
* K% ^7 p6 u) G$ I3 q- c3 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 x& C7 [/ l) b$ ~9 S
t7 D6 I, k0 K! E! OHere is one example from the file "Haspinst.exe" which is the dongle HASP8 c5 t6 K; z4 Z L. L
Envelope utility use to protect DOS applications:, t( M6 j' |8 \; s* \) n$ W
, `- z0 e' r( V3 k. Y/ ~& }$ n$ R: S! _ L2 X9 E* E
4C19:0095 MOV AX,0911 ; execute command.1 c) O; {8 }0 _& W' e- Q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 F4 D* c0 ~8 q" j+ c, d0 I
4C19:009A MOV SI,4647 ; 1st magic value.
9 }) C5 Y' d9 W2 ]4C19:009D MOV DI,4A4D ; 2nd magic value. o; A4 c& U5 [7 [! ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 a s- b5 d6 V& C1 t _. K4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
' A3 z$ d* T8 u2 q4C19:00A4 INC CX
; \. J7 K S7 q5 _4 n4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 V1 S6 \9 S m1 ]+ g: P6 m: a5 x) S4C19:00A8 JB 0095 ; 6 different commands.
; V8 |% p* h3 B5 d/ i4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 h7 y, a% h+ ]( K! C
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ {, B' O' {. ]) s) P% e
& }8 n' j7 x$ S! ~The program will execute 6 different SIce commands located at ds:dx, which( U3 W% E" z4 X/ n$ C( G6 b1 {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& e# J6 Y6 C) x# l$ k' j% L! U
% s1 ]$ @, Q( m9 i5 K2 m# K) M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 T. e1 l% u9 Q' s5 B% R
___________________________________________________________________________
3 z$ v, l {9 c- c. i0 s8 y5 O. y2 S" G$ O
5 z8 u! A9 E$ {# x
Method 03
8 m) B) {, ^5 J=========
2 W: p6 F1 v0 Y" Y" g) M& E0 i7 J2 t+ x2 F- g( _% n8 Y" s6 i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 G9 ~$ ]# {8 Q6 ]! d5 h(API Get entry point)5 O9 H* g. s1 C8 f
4 ]$ v! W. m; v6 @( o4 X4 i- [" n* y. j% w9 W7 Z, H. X
xor di,di
8 K; t$ d$ g/ s4 y mov es,di6 @ i& Z1 d {: f, [9 u0 p0 V% B
mov ax, 1684h
" g: N& ^( n& g& V0 `, s$ d; @' J mov bx, 0202h ; VxD ID of winice, z- T; G& }2 x: ^# z: m
int 2Fh
# @: n8 ?, ^ e+ J mov ax, es ; ES:DI -> VxD API entry point& a0 W( u* b, _3 P0 z0 u! ~. \ i
add ax, di2 a$ A3 p% J8 ^' w
test ax,ax
5 d# ]% o* s4 v jnz SoftICE_Detected
. E, E0 j/ B1 B5 v2 Z! p Q, H# G' o; m$ }: F0 M# X7 k1 D
___________________________________________________________________________' P3 W! j0 U9 I6 v. N H
: q6 g& N/ O( h) ~+ Z8 O
Method 04
# t% q9 F5 g% k$ H6 w: C=========
' U2 x5 e, L% I$ r! X7 D0 K- M- X
2 A5 X, |; r: p/ B: m+ d, c* BMethod identical to the preceding one except that it seeks the ID of SoftICE" Z4 ?( x( C4 {+ ?6 N; V' A
GFX VxD.5 g6 L- U3 [9 L1 b) s3 c
* V- B! k' K: y3 j. J
xor di,di
U* [7 i2 B/ ?! H! q1 S mov es,di9 H& {6 {' N V4 S+ R) b
mov ax, 1684h . Q8 B @3 |3 y9 o' j7 @0 z Z9 D
mov bx, 7a5Fh ; VxD ID of SIWVID
2 R: B1 q: D1 ]7 @" t- L int 2fh
4 T3 t# x" |% A- ^ mov ax, es ; ES:DI -> VxD API entry point: T! R9 E7 y: f* T% X
add ax, di3 L: ^7 Q/ ?- Z% o( i: k
test ax,ax1 q: N v: p- s; u- ?" j% J
jnz SoftICE_Detected2 {& T6 A: O5 G5 x* d4 ?0 ]
! J- [& v% O/ ]% ^+ D4 t# k__________________________________________________________________________, \; ^. g D2 \ m$ i
6 n E2 i$ Q7 |2 B0 b% g$ g
/ V& U" j" U: w2 p/ t2 B+ rMethod 05
( v5 V( ]7 R% c5 |5 k=========2 G9 a" n0 z! W5 ~9 F. n
2 t4 d8 b4 P' N- `: @8 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system; A0 O6 f$ d7 k1 I7 c
debugger. It calls the int 41h, function 4Fh.. a% u4 E9 |4 ~0 S# e* |' o9 {, p
There are several alternatives. % F+ o1 L/ @# |' X
9 P# m+ B" e+ JThe following one is the simplest:
; H9 d6 {/ E' h! r- U7 b
# J* k7 \, c" x1 z* I mov ax,4fh. @( G. }4 O; {2 P) Q
int 41h5 c7 E1 d6 v% h. N* t! E* b( Q
cmp ax, 0F386$ I8 J7 @: u' s8 l5 E- h) f1 n
jz SoftICE_detected
5 [: W$ i+ i% B
4 D+ S6 n) @; s! ^9 r
A: M: T" Y8 ^Next method as well as the following one are 2 examples from Stone's % y: o1 k. K, V- R' Z2 P
"stn-wid.zip" (www.cracking.net):
" R0 ~+ G. M8 a, G
5 j- K2 i3 E7 Z1 `8 T9 o mov bx, cs" G) x7 E M/ w$ D, n0 G n
lea dx, int41handler2
' T m( B4 f S& l. | xchg dx, es:[41h*4]
8 R1 M$ c1 y% I2 J xchg bx, es:[41h*4+2]+ [/ u9 j7 [: t: q/ _
mov ax,4fh
' I, k5 t* e# G: r" t2 a. ~0 w int 41h
6 s/ b J: v, _* M$ Z% I xchg dx, es:[41h*4]
+ ~. l- D% S( \6 y xchg bx, es:[41h*4+2] L5 A& k2 g) F2 U( Z5 ^! N1 ]
cmp ax, 0f386h8 I* I; T, V' i6 r, R+ Y
jz SoftICE_detected
. O' e, N. l! E9 j- d1 M. \; w2 [% k; Z
int41handler2 PROC
% w8 k( P% p1 T# r8 e iret
% N2 u, R& Y9 k; A! uint41handler2 ENDP+ p {: L0 N: I+ w
' b Y1 b$ c1 l: e
9 t9 a3 p) ^! A/ ]5 j_________________________________________________________________________6 x: j. y+ O$ A* A
. W' v- t: y; R6 Y( M9 y
8 _% r1 }3 t+ l. LMethod 06
5 r( N* O5 Z- | G6 e0 j=========5 G f* i- H! q- B* _
" M# B c6 ?8 D% Z* K0 q
8 w l' X5 g6 y3 A$ l& j
2nd method similar to the preceding one but more difficult to detect:$ e! {/ |9 s4 P7 I
4 [ }& C. ]4 q' T1 J2 J7 m3 m9 ^, e( _. N, J
int41handler PROC
/ [) H0 z+ o. y4 a9 }* w2 u mov cl,al; I% o! X8 b- ]* d$ \8 z1 }9 M
iret' K+ B& b8 \: z
int41handler ENDP8 A/ y% K0 d! s+ E2 s3 m
4 Z8 d. v1 }: b* b8 _: S6 d
) Y" @( Q: ~ D+ C* U0 m' [ xor ax,ax% N- T, s ~( l/ l) T$ D
mov es,ax
) b$ y8 n$ i( ^7 d% j0 b& d mov bx, cs
; |; v! z( g* S) S3 s' ?; y; K lea dx, int41handler6 K5 }; J6 `/ S+ ?7 Q" w+ H
xchg dx, es:[41h*4]3 I$ d$ Y4 O; A- D8 _
xchg bx, es:[41h*4+2]# i0 z! z, v# m, ~
in al, 40h e/ A) l2 Z% \. f- z$ I
xor cx,cx; W, ^8 s: ]3 n. A! w6 O" u8 J
int 41h
" H$ o, Q* G2 c; W xchg dx, es:[41h*4]
; h' m% m1 ?# i: o xchg bx, es:[41h*4+2]
% j$ x$ e7 Z" {9 W$ b cmp cl,al5 n; x4 N! w0 x# t
jnz SoftICE_detected
6 H$ }% k& s1 _0 D L
1 M: Q! a4 d4 ]* \* ^_________________________________________________________________________- v. t9 q/ P$ P& a9 @
( O( [7 q2 T7 I8 z. bMethod 07
( ~; I. t- c. r=========: e5 t# o' G# ~- [9 p/ w
- f9 @( ^* [2 [$ g" k! u
Method of detection of the WinICE handler in the int68h (V86)& P6 e# R5 }: ]
8 t: i8 d" }, h0 f8 I mov ah,43h
# i$ L: _- o* B4 e2 H% h' c int 68h1 J7 `0 L3 z3 A; f& V
cmp ax,0F386h
, d8 e C9 O$ L& y2 w' X' y jz SoftICE_Detected
( S& Q3 \( Q( z. A. T- U9 T; Y2 ?' E6 T
! W7 z4 {, W6 m6 R( q' s( D=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 D7 ]5 S3 m1 o& N6 z0 q$ R6 x% R- K
app like this:& q2 s9 A4 g5 m2 X
: ]' [ X G& t) E9 S; c; B; P
BPX exec_int if ax==68
5 v- w( H) j5 i. h: g/ F% ^4 @ (function called is located at byte ptr [ebp+1Dh] and client eip is
" }8 h' u i# @# o- H0 ` located at [ebp+48h] for 32Bit apps)
8 |) D+ k, y3 N. |__________________________________________________________________________
8 d2 @0 Q( ?. V# G9 x
1 J5 {9 q7 P/ `& L3 o0 m8 [# D. I& \4 e8 i; s w' S0 P% P
Method 08+ k9 t4 _: o" ?
=========- y+ [, p! \/ b( c4 I1 d: B
$ m4 o) g- e, w# iIt is not a method of detection of SoftICE but a possibility to crash the
' {3 D$ C" _; z4 k; N: bsystem by intercepting int 01h and int 03h and redirecting them to another, ^2 T/ G5 a4 }. G' U
routine.& v- x4 m- x) k
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 i0 U3 X. w# Q2 m6 I
to the new routine to execute (hangs computer...)
, T p$ M. ]1 F5 {& o
* C0 A1 R- B* Y1 F- U mov ah, 25h$ J; ? q7 o8 i4 F5 U
mov al, Int_Number (01h or 03h)
& j. }% C4 ~+ Q2 d$ P" t mov dx, offset New_Int_Routine
2 b8 C# `' t7 ^1 Y! M) A5 u int 21h
5 ~+ z' a: ^3 t7 S
% G4 o2 Z- `5 v__________________________________________________________________________ t8 }7 c. w& D7 P* t, d7 Y8 h
7 {" [/ _7 ^4 A" V# P4 }
Method 09
* F% e v7 U/ r( y1 T=========7 u1 [: V3 K: K' b
: p; B0 N+ k: m, N0 e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! N' c1 k% d! N- H4 W( S! _1 I
performed in ring0 (VxD or a ring3 app using the VxdCall).
8 ^: f. Z' @' U! Q2 H9 dThe Get_DDB service is used to determine whether or not a VxD is installed- ^# d% P. w- L: \, M! S
for the specified device and returns a Device Description Block (in ecx) for
, X4 j3 f1 g: W2 C* O$ Othat device if it is installed.
& `" n9 w4 c. S" i% k/ c* P5 y& l# Z! `8 @) p
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 X+ ?; O4 ^6 o3 k mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 s6 |3 L* X8 G0 w" b4 Y0 w VMMCall Get_DDB+ n0 `' X1 o8 P* E0 H2 l
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- `1 _' \6 T( P3 A. ~
/ e& ~( v( |3 YNote as well that you can easily detect this method with SoftICE:1 N. l1 Z# a' p" r u: j [
bpx Get_DDB if ax==0202 || ax==7a5fh X% P: i6 w/ Z& V, Q
7 X- o% ^; x ~' ]0 n__________________________________________________________________________: q) i6 Q# L y# m( L! ~
4 ~8 H2 p/ j4 R3 |* D) q, MMethod 10
, x+ L! o9 t2 A% ]0 l6 ^=========& e2 N d8 M/ c. a
1 v Q6 e5 o4 v6 _6 W=>Disable or clear breakpoints before using this feature. DO NOT trace with
& ]2 W& ~' W/ D5 u1 }% S SoftICE while the option is enable!!
9 Y; z0 y$ l7 P5 c6 K
! s5 z, Y6 s& @1 ~1 x" ZThis trick is very efficient:) J7 q% }% z/ O/ Y8 t
by checking the Debug Registers, you can detect if SoftICE is loaded1 `1 v5 i+ M w6 K+ O ~0 `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' \* y. B9 ^) C. V& `/ A. w! jthere are some memory breakpoints set (dr0 to dr3) simply by reading their# B; i% M I9 l+ k4 ?# ?' M
value (in ring0 only). Values can be manipulated and or changed as well+ \/ E- `1 \$ D6 y$ O3 R9 i7 w3 Z" q
(clearing BPMs for instance)
5 h# E+ B8 Q! x4 [, \
3 l. h R/ t- Z__________________________________________________________________________
' {9 a" X: R- l$ h
/ `+ s5 E0 O3 F, rMethod 11
3 |6 Z" d0 W; g) K2 I=========! W/ {5 h0 z/ n$ v
4 Q, N0 ?( W8 Y, C N( f4 [* p
This method is most known as 'MeltICE' because it has been freely distributed
; L4 V" A1 |% J: ^1 uvia www.winfiles.com. However it was first used by NuMega people to allow
; H+ A1 Z! ?& d6 aSymbol Loader to check if SoftICE was active or not (the code is located. W8 I( g: A0 R
inside nmtrans.dll).
, S$ S N9 L6 S# }' [( L. R" j
0 G3 C! t5 m/ F, A3 L/ ]7 u0 HThe way it works is very simple:" j. O3 w: ~2 A) u4 c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 w/ u1 Q8 c4 z5 }% h) j
WinNT) with the CreateFileA API.
1 c$ d, y6 ?, w" s4 F# E, h$ `% Y" X: v, Y! w
Here is a sample (checking for 'SICE'):
0 k, C8 j+ f+ r& U, z- |' I# c! h
5 U; S: l" D l8 t" q6 e5 kBOOL IsSoftIce95Loaded()
- r# N* N: a$ Q1 w: t ]{2 }1 o* Z& Z' m
HANDLE hFile; & N7 p. [ |' Q) |4 o& M
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, W6 {$ y' I6 x
FILE_SHARE_READ | FILE_SHARE_WRITE,( i/ s% O2 k) ~1 n7 ^
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% J: E( R; P5 v- W/ ] if( hFile != INVALID_HANDLE_VALUE ); T1 A4 Q6 Q2 V$ Y1 I4 Y% [
{; M0 v9 ]! i5 [' U& Z" ^. w
CloseHandle(hFile);3 p' s; w8 }: K1 f) N2 y) K
return TRUE;- p* @/ K* {- @) W
}
& j I8 ^5 ~, T& C% N return FALSE;. J2 m- U6 X+ H: D9 m
}
5 N0 @7 a: t$ {, I! h3 X+ E. B! {. J& T
Although this trick calls the CreateFileA function, don't even expect to be4 g4 V& z' ^- O3 G" j4 K1 |' g
able to intercept it by installing a IFS hook: it will not work, no way!/ R. t/ W; u5 W% |2 @- T. d% j
In fact, after the call to CreateFileA it will get through VWIN32 0x001F, d1 X# k8 ^# A/ M1 F! P( m9 p6 t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 V; z# y8 t2 H4 V! ?0 y' y* `and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, N6 j0 b: L3 o0 ofield.
4 h2 ]2 T* h" t" f6 sIn fact, its purpose is not to load/unload VxDs but only to send a & ~8 ~1 E; Y3 H) C5 m5 E+ f
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 r' e& e. @% I3 D9 o- Q5 Fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
" y6 p6 t) M& N+ U }to load/unload a non-dynamically loadable driver such as SoftICE ;-).# t1 o0 s" \' S' w
If the VxD is loaded, it will always clear eax and the Carry flag to allow9 E# v, [% C7 l. u, |( k) g) Y, C3 h
its handle to be opened and then, will be detected.( H- Y. g5 v' v& h) c
You can check that simply by hooking Winice.exe control proc entry point
5 s% j) M# J% f: Z' B8 Cwhile running MeltICE.
& n+ i9 k* x8 t) E& c2 h. Y6 D# g2 H$ ~* X
2 k! v( E0 m e# s z9 s! ]: u1 n0 G 00401067: push 00402025 ; \\.\SICE: i1 r6 ^+ ~/ a4 k* M5 E; n/ Z% o8 o
0040106C: call CreateFileA
: j$ F( g8 A1 ~ 00401071: cmp eax,-001$ o. p5 c# m, s) f- ^
00401074: je 00401091
. j% A A6 [, E2 T
; j2 ]* A/ w4 X! N4 x! T# t
4 U3 X, ?; C7 a1 q, XThere could be hundreds of BPX you could use to detect this trick.: p# g' s" y; C$ S6 _
-The most classical one is:# ^5 z4 |; Y* a) A
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% h: T8 t3 g1 Y5 F7 D9 I *(esp->4+4)=='NTIC'
4 i6 u5 W* \# M) S! G8 n3 E6 `; N$ i/ E) _
-The most exotic ones (could be very slooooow :-(
4 i- m* s2 P9 K( j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; c/ i" V3 p; Y/ D/ f
;will break 3 times :-(
" M/ w/ g8 g/ b& A2 b) N
9 w0 x7 W: U) z" w. o-or (a bit) faster: % t! T6 ^2 r6 p! j& f3 c6 j! _
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& I4 M4 _. E" i; y. E) \$ P* z1 T v) i
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 ]; B" T0 `* V' C& g& v$ M ;will break 3 times :-(
* e1 n5 f$ [% s/ n _
1 W) M: m* u9 g-Much faster:: L5 A9 n& X; \" G$ P" b
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ B& H: {0 }( @
" r- c) o3 v. s$ t' tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
* ^# M( N8 X5 }! U- k6 wfunction to do the same job:
4 T, } i$ V+ F8 D ]$ @2 h/ j1 s" Y# U
push 00 ; OF_READ" K5 x$ i5 L. f& |4 E7 y0 Q% Y
mov eax,[00656634] ; '\\.\SICE',0$ i1 y8 E. K2 U" v' S7 c" |! Q
push eax
* J& I5 Q0 i( i* z, `9 |$ R9 z1 a call KERNEL32!_lopen
5 w/ ?) z' j8 K' }, Z inc eax: Q8 o- d5 t: \& s
jnz 00650589 ; detected
6 l/ j1 D2 |3 X7 D5 l push 00 ; OF_READ
8 O* h4 S: `1 k9 F" g$ u mov eax,[00656638] ; '\\.\SICE'$ R ]* @$ i* Y* A
push eax
' b3 B9 a4 v& l0 _9 Y% Z9 Q call KERNEL32!_lopen
+ m! Q- j U5 m& W- i+ f inc eax
' `; k. x0 i6 j7 |3 i+ w2 ` jz 006505ae ; not detected; z/ q" @0 N( e( B7 _, k' z
6 E: n2 N; `" G2 h, r% L$ r- J! ?6 T. W8 a6 y
__________________________________________________________________________5 p" I+ d. m; d% t6 V
9 a' l# Z' L# _! xMethod 12
5 _8 i* _! {1 C=========3 i0 F+ U' h0 t) I* \
0 S1 ^% v/ M7 T0 Y9 pThis trick is similar to int41h/4fh Debugger installation check (code 050 b" j9 m, S- c3 x
& 06) but very limited because it's only available for Win95/98 (not NT)
# P; ~- K0 Y) m. m% N: O, q# Zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
" x2 g0 w6 i3 w: x0 u7 ?$ e. ^) ^7 N8 ^3 _) U
push 0000004fh ; function 4fh. I# {, [8 W P& K1 \0 z; U1 Q* M
push 002a002ah ; high word specifies which VxD (VWIN32)/ B) h1 ]; ?$ M7 i: x+ a k
; low word specifies which service. {4 A0 e' Z) ~0 P. i0 m' o& t
(VWIN32_Int41Dispatch)
}2 e0 G2 p. J. k5 N call Kernel32!ORD_001 ; VxdCall0 j6 W0 B) z, ^
cmp ax, 0f386h ; magic number returned by system debuggers) }3 `! F b& ~/ S4 J% o! |
jz SoftICE_detected
" V$ D/ q0 g6 S4 g
% H* r1 G Y2 b/ r; S( N* m: Q% H$ m. YHere again, several ways to detect it:
7 T" A7 _+ p2 c1 Q
3 C" ^0 V$ G/ V. J; a BPINT 41 if ax==4f
) b: I, U, S8 S# n( S4 l* }
3 h2 M. k$ v1 U0 b BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
3 J) h2 U5 J* ?5 z& k2 e% p
+ `8 b) p7 s" W BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
# p& q6 ^1 x- Z1 f/ i- T4 V9 L$ R1 Q5 P. Q% J: W- I
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!8 ~* |. ?3 q3 d& }3 u* ^6 b
0 J9 T0 A- e- \! }__________________________________________________________________________: G3 f* f1 \+ @2 Q
2 h1 c* f& l5 D- x+ M* A" O5 K
Method 134 s, G% H2 H. T' _. s
=========, c8 B6 r$ c* M" b4 k) K
5 N' L* w7 U( Y" b3 ~: p, \8 {! c
Not a real method of detection, but a good way to know if SoftICE is: G" H: n# m* C' z+ _/ W x. Q2 F
installed on a computer and to locate its installation directory.
m. @4 K( a! [3 s. l4 wIt is used by few softs which access the following registry keys (usually #2) :" F: \, Z4 [% z/ f& r9 D+ m$ X
9 @ R4 V3 Y4 g8 z$ I1 y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* M; P! T( s- G7 a+ [- T0 D4 p
\Uninstall\SoftICE
3 E9 B( a: x' c: g+ \. q) p" ^) i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ c7 q# R4 k2 K- Q# n6 T& w-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ L! l3 c9 d* \0 E* M1 x8 M @0 f- F$ t
\App Paths\Loader32.Exe* Y) F+ W1 X* ?# {3 E: M3 ^, x
/ C, B3 @- E- X3 A
* \4 M R9 O) a2 H' t3 ?Note that some nasty apps could then erase all files from SoftICE directory
6 N5 r. f, O0 |) `* t9 i# h. J0 G; K(I faced that once :-(7 i n3 h0 x2 ]4 X
# ]+ D4 j$ Q6 y7 ~Useful breakpoint to detect it:/ [7 B' W$ S$ c/ f) C2 n
! K6 `5 C- s! T$ w6 B BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% T+ n& Q9 ?3 V" T& g& m
9 ?; N) {) a$ G0 G0 q9 K__________________________________________________________________________
- i3 C+ U" o7 ^' r- O% A8 e+ [) E, Y# R
: ]' Q& x& ~4 `1 r6 DMethod 14 - }5 U" { }& r+ f9 S
=========
: F/ v! D" p) X. T0 N8 C* \+ p2 ]' D+ {7 w9 e# F% ?+ j
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* _( K2 ?$ t6 u: ^% H" [
is to determines whether a debugger is running on your system (ring0 only).7 Z- @+ ?) f/ Q3 O8 c
, p; ~5 J. E; t$ |6 I
VMMCall Test_Debug_Installed
) q- Z" _; [0 @/ D8 k. h$ ?# Q! Z je not_installed
9 {$ X' @ J/ o4 f2 w; i
2 I, y% C+ j# I4 o$ cThis service just checks a flag.; p0 K# ^8 {6 X5 n8 y0 ^6 F) p% F4 g
</PRE></TD></TR></TBODY></TABLE> |