<TABLE width=500>' J7 f8 N4 l+ ~" ]# l6 ^! d
<TBODY>/ T/ i, h. @6 p1 r$ J
<TR>* y% R( h) Q2 S# C k
<TD><PRE>Method 01
# t1 N1 p) z R& U=========; H9 n# N2 ]" j( i0 ?
7 |: ?# N& X8 cThis method of detection of SoftICE (as well as the following one) is# L$ _! S1 J# e& o. n
used by the majority of packers/encryptors found on Internet.% g0 l: E, H* E
It seeks the signature of BoundsChecker in SoftICE
& r# |+ x+ P1 q- z2 r; f& ], t9 V4 Q+ W& z4 W- E
mov ebp, 04243484Bh ; 'BCHK'
) n. C i+ Z& H mov ax, 04h0 G: b* Y0 |9 v- N- ^8 o
int 3 1 v, \3 _8 S4 V6 D- q3 k
cmp al,4
# w. c$ a3 }. X3 h$ Y# E( J# n jnz SoftICE_Detected( R# v+ d7 m% k
{/ e. K# D- J4 U8 U7 o A: p
___________________________________________________________________________ d& C9 y1 j: h( Y& y1 C, ?
. q0 b l0 k3 hMethod 02
; S+ c- a6 ^6 z1 @* G4 a=========
( s, P7 O3 v7 T# x9 F
+ O$ {% @* _$ ?1 x5 qStill a method very much used (perhaps the most frequent one). It is used
% D$ ^3 G% }* Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; M, ~3 s$ i4 {) ]* a( aor execute SoftICE commands...
( j' x6 h, m: C; ~. Z5 w& xIt is also used to crash SoftICE and to force it to execute any commands
6 t( A3 ]! g+ f5 ~(HBOOT...) :-(( ! B/ P. t! `* V O3 s2 V
4 V7 ]; `. \! b, X% t4 g4 ?9 t
Here is a quick description:1 u( z* h# j5 K# ^! M9 Q+ a
-AX = 0910h (Display string in SIce windows)4 z8 T# v( g" |5 B! \4 E- l
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 q5 V P8 X% ?; N
-AX = 0912h (Get breakpoint infos)% \8 ]( j' C* B
-AX = 0913h (Set Sice breakpoints)
% B2 m0 q" f7 f-AX = 0914h (Remove SIce breakoints)
N9 D4 g; ~# m6 v ?
- G: C6 d5 |) y/ j4 }Each time you'll meet this trick, you'll see:
7 e, t+ N/ k3 [# C/ m, T3 m-SI = 4647h
7 l5 G7 z5 }/ `( L( X5 q-DI = 4A4Dh
3 I# r" j* _" d" LWhich are the 'magic values' used by SoftIce.* W) x. |" M$ V, ?. T6 ~ k; Z3 b
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 p+ ~& x% V! P, r9 q2 f! s' `3 }( w* m7 Y- b. f
Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 \" J' X2 o% v/ XEnvelope utility use to protect DOS applications:# T2 o3 B! e2 u7 ` Z- J. N K
# M( {+ ] O, z) R# \* z0 j9 K
; G- h( i. R1 ~7 N! N
4C19:0095 MOV AX,0911 ; execute command.
# |+ v! Z, Q, `. h1 O4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
. m' D. i/ E# v4 C1 T9 h- o4C19:009A MOV SI,4647 ; 1st magic value.
# ~* \5 p6 i* W' v4C19:009D MOV DI,4A4D ; 2nd magic value.9 G* ?! L' m4 j, ~% J6 J& `4 I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 P/ p+ n4 P8 V' F+ f; d
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 N7 g8 M, X- e5 ?
4C19:00A4 INC CX/ l5 |3 C6 ^8 m) f' N U; ]
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 ^+ e3 [. e" Z" ~& g4C19:00A8 JB 0095 ; 6 different commands.
# I: a1 S$ V( d+ n; \4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 g: ^' w+ ^5 z+ l1 S7 P% O. b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- f# h1 q9 p1 H% `9 b2 w/ }* _: n- E* N5 y4 G/ Z% R' ]
The program will execute 6 different SIce commands located at ds:dx, which
' J7 _$ w3 ]" ]1 a: P) T( ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 }1 N: [0 b; m) A9 I2 r9 L' }
1 W; y! c0 m8 k* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 q" f8 [5 h6 G7 J: s) x: M; y. p___________________________________________________________________________
) P9 q+ U. i; k% z2 O4 I2 C$ Z$ v6 _5 K% b
( B- A$ X, j p5 N7 d5 J% QMethod 03
) q: y" P- X( O; o' ^% d: L=========! Q* j' C/ H; f9 a! ^
' a- Y4 G5 W* P0 V) JLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) U. s( |( j& j; _
(API Get entry point)) n# u% _4 c! v7 y9 E/ g9 z. \
- y7 y- P( R6 R9 \/ J+ J3 `# x# J s, H. Q# R
xor di,di
0 o; {/ N8 ?* h& J1 _ mov es,di
J F3 L+ X) d1 `5 ^2 n mov ax, 1684h
; V8 c# b7 r* z+ M |, @ h0 ?2 g mov bx, 0202h ; VxD ID of winice' q* l8 c U3 {( q6 s& |
int 2Fh4 K% y$ y7 _3 f$ O' L6 i
mov ax, es ; ES:DI -> VxD API entry point% g6 @( V. Z6 A9 [) g. z
add ax, di
1 q, |/ v* _7 J6 M1 f test ax,ax
4 x# a' ?" Q. o ]9 X jnz SoftICE_Detected d n3 V3 K! w3 k$ ~6 }" n; o5 ^
' x2 @2 m' i- g6 C4 H___________________________________________________________________________/ Z5 l3 q4 r, f, R: p0 {8 V/ r
7 k4 U7 B! j9 w- B H( c3 [
Method 04* p3 W9 D6 a( K5 f, k0 U
=========( p# m+ W! W% o2 @. z
! c: _6 Y. u/ Q: r- ?' hMethod identical to the preceding one except that it seeks the ID of SoftICE: L N( [" V' U: j1 p9 o1 O
GFX VxD.3 _! ?$ t" J1 r( d4 f
# K" c2 q. c$ H# ?+ a xor di,di
& q' T% _- X$ L7 y, V) w3 m mov es,di* F3 j$ W; l, z# G% N
mov ax, 1684h
& m% l, n) K; A4 k* ~" y mov bx, 7a5Fh ; VxD ID of SIWVID# R( l$ J- G1 L% y9 }
int 2fh
3 a0 N6 r* z8 O$ }6 G8 {2 z mov ax, es ; ES:DI -> VxD API entry point
# q, Q( S& w5 G& \3 v add ax, di7 q8 r# p6 ^% b; D2 j
test ax,ax6 {7 q( Q3 w. y6 c6 F# M O a
jnz SoftICE_Detected2 T o8 D% m( `0 U K* ?/ q! R7 w
( S5 e( f% }! j5 {6 J__________________________________________________________________________9 q( ]3 s; u: r- v0 d' l3 U" d
- H6 T a/ k; l* t. @" y( U$ |2 l
. ^) @, l2 n; Y: RMethod 05
7 M: w! Z3 j; m" w# ^=========* U3 y& w; \1 S# c! j
, Q D6 x3 N1 y7 v8 FMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; a2 N; b+ @0 F0 m( G# T" Idebugger. It calls the int 41h, function 4Fh.2 Z8 q% d: p8 ~( b: b# e
There are several alternatives. ; j% X: x' O L7 p. J' Y2 T; l( v& c2 r
) Q( h' e- D2 I N" V- G0 _- f- aThe following one is the simplest:3 M# |9 S2 b& ^( J3 K( k2 F
! v/ A; Q k" N- X$ J# x# Q mov ax,4fh) c4 C' o7 c4 `3 ], x8 L: D% h( A
int 41h
! t* }8 L) V! W1 b. W cmp ax, 0F386' U6 [ ~3 w$ |6 Z t; X9 c) S
jz SoftICE_detected9 y# E! c8 D U; }: X8 g
: N) J A+ S- p, m
5 B+ S( K3 G# V" u' Z$ r" |
Next method as well as the following one are 2 examples from Stone's
4 Q( m2 e' T( R( s8 K; N" z$ D"stn-wid.zip" (www.cracking.net):
2 F0 e8 S$ h* ^: g( |
4 w4 ~. d9 D# L mov bx, cs
- H& t- t* O2 h5 Q. E lea dx, int41handler2" U' J) g& b! g4 E+ g- o! q( E! F
xchg dx, es:[41h*4]
+ b& t6 T1 j* S. ]6 o xchg bx, es:[41h*4+2]9 q7 A6 S3 ]9 b6 ^7 H o( e( ]
mov ax,4fh
2 S8 f/ |9 }4 J a int 41h a; g p' ]) l, V6 L
xchg dx, es:[41h*4]. W! \4 L; A" ?: o, z7 ^
xchg bx, es:[41h*4+2]
# }: l0 N P* z- j# ]/ Q" A6 p cmp ax, 0f386h
0 d5 m, Q6 S. z# k jz SoftICE_detected
, N+ @% @9 p B/ C8 P% U: S' t% Z5 c3 S% N' v
int41handler2 PROC
+ T& A+ w2 ]8 i iret2 F) N* Z" R" O# ]3 [8 u& Y$ z* Q
int41handler2 ENDP
' l- H) k! z- r# C" A2 T3 X' I# R K$ L! ?# G! T/ r" u' u
4 z7 T4 {7 R9 ?
_________________________________________________________________________2 m$ b6 C; Q. D t9 v
. r, Q- V+ m. w: V" w8 |
5 \! e6 N5 f( E3 @+ JMethod 061 `2 f2 g' U& b O, ~
=========
0 X% f# {2 k/ q) G. }) H8 c. ` C# H
6 a a% _8 W" O+ p/ Y& k
+ ?4 `; [; \. ^; e7 M" \$ X/ c2nd method similar to the preceding one but more difficult to detect:# y, k* Y5 B4 [: Q f V
( b. j2 Q7 \/ B _0 N$ D6 K
, o7 l) F1 c- A: Uint41handler PROC
1 j# J6 k- F% S: M" N7 k mov cl,al# D9 M$ R) u( A$ F) ?8 \; Z1 u
iret
Q2 b% C1 C p4 rint41handler ENDP* z1 E+ K0 _- ~9 L8 f3 w
6 \# a) p/ n; x5 _4 w$ F
: v$ E& q( B2 S xor ax,ax
& x. g4 F& P+ M9 p mov es,ax, z3 S6 f9 a1 C0 l( `3 `
mov bx, cs8 g% I1 Q5 }+ O: g6 Y6 [
lea dx, int41handler
( a( K( d% ^- l: F; Z$ z6 N xchg dx, es:[41h*4]8 y3 Y$ Y' O! B/ a) a: R8 D
xchg bx, es:[41h*4+2]
7 R: U: I' c4 W, C! Q+ k in al, 40h
# f* A' L5 P6 B: a* O xor cx,cx
, D7 B9 ^$ H2 |9 d int 41h l- h$ V7 d+ h [6 ~
xchg dx, es:[41h*4]1 ]: v8 c; F( U$ w4 _
xchg bx, es:[41h*4+2]/ h2 \! _2 P+ j/ N
cmp cl,al
0 N( r' z7 z. J- v jnz SoftICE_detected9 _1 Q2 Y3 N# \2 v5 S' u- ?- ^
& d- f2 D* r0 D0 W
_________________________________________________________________________
2 o+ A. |3 e+ Z y
- I% ?! t2 K# J% D NMethod 07
7 a1 ^$ `+ G# b' Q4 K6 U=========
Z q! @/ Y5 ~# {9 D
2 `3 y# \& _2 e# f6 \6 I9 i3 v4 m* cMethod of detection of the WinICE handler in the int68h (V86)
' h- x+ t% K: ?: d( p% e& {1 Z. r- ?: h9 C! O- V2 K
mov ah,43h5 N+ |! ?6 q9 _2 d7 h5 M* I3 z; R% T
int 68h/ g. C0 G' N/ r
cmp ax,0F386h# g( e. x( ]/ q: O! Q( B
jz SoftICE_Detected! E) m6 H! N& z3 H7 R
/ N1 h' a @1 V. |
3 l8 T/ G3 @# m' ~: \& u, M) D, Z( [+ x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% \% ?6 R; E( I; g1 |! R
app like this:! @% k5 ?$ b) j) N+ y1 }! D) Y
% m+ Q# [6 \, ~) K! V. |9 | BPX exec_int if ax==685 [' n3 w' m2 G0 f; I
(function called is located at byte ptr [ebp+1Dh] and client eip is1 G' M+ m. U1 q1 j
located at [ebp+48h] for 32Bit apps)( v* e8 [/ Z* O l; C
__________________________________________________________________________
9 O0 k/ O9 z" R6 @% u
. j' @* v: N# u0 I9 R4 h, _7 g; @
Method 08. X4 V0 s6 b& o8 ~$ |3 Y
=========
$ j R! T6 J( j$ K6 u! l: Y6 J, Z- i" f& |
It is not a method of detection of SoftICE but a possibility to crash the
1 O' \4 i2 G& V& asystem by intercepting int 01h and int 03h and redirecting them to another5 ~$ `/ G: ~0 k0 e) s
routine.. ^3 w! {1 `+ s0 {9 o) g: h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points, W- U0 e" b9 |8 f4 N
to the new routine to execute (hangs computer...)$ U$ \' U/ U" Q
" h5 t' p8 @: ]5 v9 T/ F mov ah, 25h' w# Z9 p1 T% `! Q
mov al, Int_Number (01h or 03h)
( F6 v n: ]5 u% k3 A mov dx, offset New_Int_Routine
2 s; a- Y9 v. I! I5 D) a& ~ int 21h
7 A7 L3 A7 a9 ^" s$ M" K7 B3 W) }
5 j% r0 |5 u% v2 w* @__________________________________________________________________________, l1 B2 e2 {' p: t
) k: L% Z; i6 ^# S3 j9 }
Method 09
$ q1 N" c1 |! _9 R, P=========: S% A/ G, [3 P# F: {0 ^
' _* @" l7 d( u+ EThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( T. g" H' C! A1 Rperformed in ring0 (VxD or a ring3 app using the VxdCall).6 J+ s; f! i; `2 z$ }0 x5 v
The Get_DDB service is used to determine whether or not a VxD is installed8 {% N2 P; ]% O; n O
for the specified device and returns a Device Description Block (in ecx) for; k( [ g0 x7 n
that device if it is installed.
) `; u m1 e' @' m/ g& g6 l* q5 L' z P
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 M& z" ~& m; F mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 M* X: F1 F, B$ K- ? VMMCall Get_DDB
& }* p' h3 d* v S6 x mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
1 E4 q; Q" E) m) E4 g7 Y, y+ ~: \) j# M1 ^; c* S
Note as well that you can easily detect this method with SoftICE:' d A" R' Y3 a; ~5 t5 |7 _
bpx Get_DDB if ax==0202 || ax==7a5fh4 n4 [; N f: P4 I0 x3 P
; {6 ~" c. g- e7 n" F: {- ~__________________________________________________________________________
5 e$ O; b' l; A: s" e; h
{& I9 H! A' Q7 H; \, cMethod 10
+ }3 L6 S$ g" k0 h=========+ P r: p2 V6 q; S5 J& `, Z x1 z
, z9 g6 g0 k/ O=>Disable or clear breakpoints before using this feature. DO NOT trace with7 Z; a8 N+ y* z- j( O
SoftICE while the option is enable!!2 d) i. ~$ T6 f1 V7 T
/ r3 }4 p! o; _) H6 MThis trick is very efficient:: T/ x/ L. r, }+ C2 [! |
by checking the Debug Registers, you can detect if SoftICE is loaded |6 M% d2 p0 e
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ E& A8 h1 v; ] Y2 h/ F( ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their: K! p! O1 X/ p# t4 U; U$ `4 a
value (in ring0 only). Values can be manipulated and or changed as well/ l! x2 `4 |9 {! |
(clearing BPMs for instance)
% f3 B7 {8 Y3 h- Y* e
( Q {( [' q8 ~4 `, Z" s__________________________________________________________________________
. m6 Q) m& Z3 [. F X2 y7 [. N5 \' Z1 X# h( y' ]# I1 c4 c
Method 11/ |( @2 ~1 B; P, e% S5 l6 \
=========
0 B- i+ N; }6 e6 p; x# n! U/ J) s+ x6 B5 q8 A+ f6 Q
This method is most known as 'MeltICE' because it has been freely distributed
* G3 [- ~% d$ e& N/ r. ^1 f) q# Yvia www.winfiles.com. However it was first used by NuMega people to allow/ P$ W" Q9 `5 e# L& C
Symbol Loader to check if SoftICE was active or not (the code is located
, l; ]7 e* |" B: Winside nmtrans.dll).5 B7 H% b. L; o, C
J4 B: l* x! m* v. u2 K, V
The way it works is very simple:
6 g. I$ U5 h1 PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ [# W% w6 N9 [3 R* o% h& _- h5 g
WinNT) with the CreateFileA API.
4 Q$ C7 M8 M+ u1 d3 s' ~- e. ?6 U: p, H* n
Here is a sample (checking for 'SICE'):
2 O7 e: U! D F0 M$ n% f7 K% C
+ F3 X8 K7 _8 y. r( iBOOL IsSoftIce95Loaded()
- S; Z: V& J- O6 }" Y{1 k! b" a% A$ ^. l7 H$ o
HANDLE hFile; 1 X: N. S2 M+ }. P
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
# ]. T7 J e3 l/ Y- t FILE_SHARE_READ | FILE_SHARE_WRITE, r0 w6 [: V8 K* n- s% T; U
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 k8 a$ j# {7 f# E) o- ` if( hFile != INVALID_HANDLE_VALUE )
0 C% S" i/ W$ O {
% G( |9 l6 ]) l7 c7 A9 q CloseHandle(hFile);
4 h9 T, T8 t# B! f/ D1 X9 @ return TRUE;
9 K1 r: ~/ V5 ]# f* d } }0 U6 p8 }6 B
return FALSE;' |& G9 z* M- q3 E3 y5 e
}, }, b n% o& s3 M4 ?, {. k8 i
$ u. f9 k" s0 k8 z( S$ v0 Z8 \
Although this trick calls the CreateFileA function, don't even expect to be, H' B1 R' S3 z7 |; s5 [
able to intercept it by installing a IFS hook: it will not work, no way!
" o, O: o# |3 }3 i' A5 N* p$ oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F7 V# O; C* g! X% ~+ C4 O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 E6 o! w2 Z5 {! Q5 ~! V, d
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: ^4 w) @" y; B9 C' p" b5 C9 k
field.8 y; [% Y; x# Q% P+ W
In fact, its purpose is not to load/unload VxDs but only to send a 4 q0 w, t& y: J! h9 l- G
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 U; E2 q) ^9 \! p. Sto the VxD Control_Dispatch proc (how the hell a shareware soft could try# G' U0 ?8 A" g# ^ j
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 B2 P. @) o; w/ X; n/ g- h
If the VxD is loaded, it will always clear eax and the Carry flag to allow
5 b. I S: x: ^* j3 E5 Uits handle to be opened and then, will be detected.( O" | N! Z3 L9 O; o2 [! \1 `
You can check that simply by hooking Winice.exe control proc entry point
. V* s1 z8 N# _- Hwhile running MeltICE.$ h+ P* p8 j# J) x' a. |, R0 r
9 c. N' c, k4 g0 X' g' h
; x5 E( B$ N3 L2 z. o" B 00401067: push 00402025 ; \\.\SICE
% n6 o8 G a! l, I$ R7 s 0040106C: call CreateFileA
) t* q ^! C8 M% S 00401071: cmp eax,-001- z, |4 L: l1 V+ b5 W- `8 Z
00401074: je 00401091
4 F# q5 b+ V2 V9 O& }' q3 Y/ ~, @/ w# h3 }9 r
! D8 i! \% H' [
There could be hundreds of BPX you could use to detect this trick.
* ^: Q3 h- V1 ]3 d-The most classical one is:/ [+ M' y7 @, L; A
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' || Q: f; a& M$ r! J7 I
*(esp->4+4)=='NTIC'
; }" B- R: G( N# t/ @
H, R7 {0 ~) R5 { W! s+ R( t-The most exotic ones (could be very slooooow :-(9 o# z% m3 Z' n0 s3 s# N6 P, a6 t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( l1 q2 s& t7 Y3 s ;will break 3 times :-(( {+ f% g& n- O6 q( ]
$ P: }# t# H, ~" C0 k! ~! S/ J-or (a bit) faster:
1 `4 H* J; G$ [. e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! z: z+ U- m/ f# I. E- \' ]( f% ^ C/ D. U6 p5 _
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 \/ { m7 u8 N: h+ d
;will break 3 times :-(& T4 o. e1 \7 x4 ?
& @' s' x" f3 A3 v d-Much faster:+ N; d; C; @/ F/ q/ B. Y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'7 P6 }6 }4 z6 y5 C8 ^5 F7 c' E! [
. v1 G& f: S7 S/ X: gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen+ T2 p+ G H# M( I3 X
function to do the same job:! I$ s9 b3 f. V0 e9 v$ m' D: k5 O
& J- Y7 u, l) j5 `* g; o" q
push 00 ; OF_READ/ s( }4 E' s. y
mov eax,[00656634] ; '\\.\SICE',0
. E6 N/ h- M# }( E push eax6 x( f' ] m/ {6 R) k Z( o( q$ k
call KERNEL32!_lopen+ [ d8 [& ?" ~! H
inc eax1 o1 e1 M% x# [( S* J
jnz 00650589 ; detected
: y# J: S- E3 ~3 k7 @5 r+ y" o push 00 ; OF_READ* H+ s, K0 |, B% ]! G% H' A% q9 W
mov eax,[00656638] ; '\\.\SICE'
: H% G6 c: H* E1 j" O! S push eax
( H% W7 e- i' ~ call KERNEL32!_lopen
2 J& R& x7 G: | inc eax T, O( f" v. T
jz 006505ae ; not detected7 u& T! ]: ^+ q5 b6 m0 c
$ W2 n9 m8 R/ }1 {; N
$ u) D- U( ?0 [# Q4 T+ `
__________________________________________________________________________
* s+ C" k* H/ K- r9 w8 o) a( u
6 t" g: ~/ r" l& ~3 l# K9 gMethod 127 X7 z) d4 F% z
=========
, x/ L) `# u' J% N. u1 C4 b% p3 \$ h4 H$ A5 U8 r
This trick is similar to int41h/4fh Debugger installation check (code 05
" V/ y3 r9 Y5 y( W& 06) but very limited because it's only available for Win95/98 (not NT)& ? F2 [' k9 H C5 S
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 v2 j2 Z. K* _" }- r8 A0 }
& d0 ]$ F! J/ O( \) { push 0000004fh ; function 4fh' c6 W! p( {4 e O3 |* L
push 002a002ah ; high word specifies which VxD (VWIN32)
7 i k% _6 g" S5 K ; low word specifies which service0 t1 J8 p9 w% m& l6 v! u8 D3 P
(VWIN32_Int41Dispatch)
" Y% ?6 L/ Z/ [2 y) s$ M2 r call Kernel32!ORD_001 ; VxdCall' Z1 S" D, M8 H' g
cmp ax, 0f386h ; magic number returned by system debuggers
5 J8 U* y* Y/ _& F E jz SoftICE_detected% z+ C1 k( T( E5 a. t5 p
5 A9 Y0 |, V/ N# t" {/ l) u
Here again, several ways to detect it:
& v$ O! ]. v1 L! P- ?
+ u' R( B) @& B; e' c BPINT 41 if ax==4f
+ ]. X* E% H% J$ |! z
1 F! Z6 M# V+ q9 F1 {5 Y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 \0 J0 f0 `5 ^3 j; m1 J) k7 o2 Z+ b! ?
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A+ Y9 T/ S- @$ A
& R( x* N4 W+ P4 a( J6 L' T BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% x' z2 P x# o3 l" T$ D" d7 o
1 _% H5 W% V% u9 ]; P. e- f
__________________________________________________________________________$ r" n* f! e' C* A8 ^- X& \
2 b2 T& {+ b; N! c* D. f# B$ j) i
Method 13
, O2 q' f5 J) h+ O# a- d0 R=========
' A" v4 t6 E* J- R3 `, ~0 ~
% n7 C7 u" `( C9 B+ eNot a real method of detection, but a good way to know if SoftICE is; ?& g. g. U( V% L1 k, F
installed on a computer and to locate its installation directory.' X. e" ~" m# w+ g# m' \4 H$ V
It is used by few softs which access the following registry keys (usually #2) :, y7 U1 V. Q2 G1 d/ l2 \# u0 T
( c0 V u" V; h7 g
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' a; O; e' x* p\Uninstall\SoftICE
. A$ ~& B! z5 X+ e' W-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! {+ I+ s" f" H5 ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 I! r( [% \/ A* N
\App Paths\Loader32.Exe* j; i" x2 C# ]2 N+ R* d
1 f0 ^5 r1 ?% S! b
e5 \% T& |! r7 h4 E
Note that some nasty apps could then erase all files from SoftICE directory
+ q% V2 ^9 h% E4 P4 C9 X: h3 u(I faced that once :-(
+ @/ S- ?3 f0 w
$ u U' t% J% f* SUseful breakpoint to detect it:
% H1 N. X( h) K
" U# P [7 \2 x) r9 o' n5 p1 Z& ` BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
9 w r5 P% U" R9 S9 e- u1 | W- S- @9 {; l/ |
__________________________________________________________________________' j" l/ q' R. _ j
: k6 ^% H( ]: s2 C/ G7 M1 {% X, V
' D6 L" P& T/ ~3 O2 {
Method 14 + @; `9 p& P6 x
=========
) t/ {0 T- U1 W- ^. i* v- l, K" K7 J' V* i5 G; o6 w6 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 {& y% M! V4 f f
is to determines whether a debugger is running on your system (ring0 only).
; h3 m5 A5 [0 V1 H" h7 C# j2 D3 _, k
VMMCall Test_Debug_Installed S9 z$ r3 W3 w( T$ A
je not_installed
' M' ]2 {6 [. o Q1 h0 Z
3 |, @8 A- ?, Z2 Q' Y: TThis service just checks a flag.! X* Q2 ~( T6 @& @8 g% \
</PRE></TD></TR></TBODY></TABLE> |