<TABLE width=500>" O, s, d& U! ^( y
<TBODY>
1 f" {8 G# n) V9 L' m! j<TR>$ u- v0 B. ], D$ v) O
<TD><PRE>Method 01
1 W: b D: j1 k7 i=========
5 x* t3 |9 J/ x/ S
. U- L/ U) q/ f& K% D5 }This method of detection of SoftICE (as well as the following one) is
' _6 b% f5 R1 }% E8 qused by the majority of packers/encryptors found on Internet.- f5 }1 y2 U& M7 q6 c% q
It seeks the signature of BoundsChecker in SoftICE
7 c, I5 i) ?' F; Z1 \$ l" ?
) c, j7 i! j1 J( ^ mov ebp, 04243484Bh ; 'BCHK'
$ s) [! d5 A4 E0 @) L7 x3 }" a9 } mov ax, 04h
6 M/ y) X6 m* [* `2 d int 3
& ]+ ?; R3 [# o7 a cmp al,4
4 a5 t# G6 `# D) E$ X jnz SoftICE_Detected
! M& R/ w% t$ S9 x: ^ I( o1 k6 P% K5 Q& x0 U' `8 V$ A1 C' L
___________________________________________________________________________. S+ q0 {" L \8 r2 y0 C! v+ C
& U+ g/ Y: w9 B+ k' y) \Method 023 Q' z! u& Z8 w1 v* P' Q
=========
! m/ `" R$ I" K' Z
- n6 L5 F" N! _+ X! d* B1 iStill a method very much used (perhaps the most frequent one). It is used; c7 D+ t, R$ z; c- q7 t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
0 ^8 t5 c b0 R$ U1 ~or execute SoftICE commands...) x% {2 R8 y% o1 @
It is also used to crash SoftICE and to force it to execute any commands u1 n) f9 F: P7 q. W
(HBOOT...) :-(( + ~& F9 q E0 k' E' N- k% z
1 N0 r0 m8 Q' m9 C
Here is a quick description:
: e/ y+ ?5 k# r9 U/ g8 n( M-AX = 0910h (Display string in SIce windows)
7 Q- T" F% F L7 x. ^9 B3 s-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 W) l% ?' Y" }' g* X
-AX = 0912h (Get breakpoint infos)
% b0 M' w& G3 i9 P-AX = 0913h (Set Sice breakpoints)) f1 k1 W! ?9 N1 c5 L: W
-AX = 0914h (Remove SIce breakoints)2 ~% t; [0 y4 t9 y& v# j
0 R1 O; K( m- j/ r& T* IEach time you'll meet this trick, you'll see:* f* ~; ^8 ]6 P2 g$ K# u8 R e
-SI = 4647h0 K% {3 D: @6 G+ ^( u8 `# T* O% f4 C" z
-DI = 4A4Dh
9 r4 v' ^ F" l' xWhich are the 'magic values' used by SoftIce.
, _! [9 ~' Y0 _! i- V' G8 {For more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 O! o! X3 \# a: J4 K/ u/ L
# L* g+ M$ v+ Q" }) e5 HHere is one example from the file "Haspinst.exe" which is the dongle HASP t6 O; V* q" s9 |
Envelope utility use to protect DOS applications:: W% Y9 ]& }- D% r; f. v6 I3 ^
" D$ H3 t) p9 `5 p: h0 Y% A0 D, t( C
# f: }3 j9 Q' B9 k8 N9 G* L4C19:0095 MOV AX,0911 ; execute command.6 b3 x: B' v5 I1 E0 U: ?( P
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ O& P. _8 b. ? r1 N# `& o ]4C19:009A MOV SI,4647 ; 1st magic value." `* c) o7 F# s5 W5 D" Y8 g0 L; _
4C19:009D MOV DI,4A4D ; 2nd magic value.
R: p; c0 D7 S1 Z4 }4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 g. \! K- b- l9 c4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 v* q) c5 [8 ~& o0 z4C19:00A4 INC CX
) \) B. j- J! X' y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' s4 B- \* k' [8 q" J$ n+ R
4C19:00A8 JB 0095 ; 6 different commands.0 C# y6 R s1 q, h
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 T0 {& ^- Y! ~3 G* l; c1 z3 P$ I1 j
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 f% z/ x# m: t7 m/ h" Q
9 g/ Z' T8 k( u7 W0 Y" o7 h CThe program will execute 6 different SIce commands located at ds:dx, which
0 y1 Z9 T( b5 G2 E& w9 ?. }3 p4 k+ P. iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 u0 {3 S4 A! l2 Y* ~! N$ @8 _9 ~& ]& \) q& F0 V
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 ~: v" I2 [+ [___________________________________________________________________________2 l9 w6 P" U x. m, i; n& A$ h
- U5 _1 x! L. t; H& z. A) V( v* ?* U+ G5 M$ E8 _
Method 03
2 p8 ]& O- k7 [* V6 }- N' @=========: k0 S& p' C1 e- v6 {" I
9 X y. X$ k+ k& VLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. B4 J) ~: o4 b9 G/ c. Q. e+ d7 m
(API Get entry point)2 B) W0 T. Y( a" T8 ^6 a' @
7 K" p' ]# J* @( C( \
. ?1 Y* Y U7 [3 i4 v
xor di,di! I2 _4 o8 f, B
mov es,di
; |) \/ A, N& K9 t+ F2 C1 J mov ax, 1684h ! }+ P8 a* Z) P5 ?+ d
mov bx, 0202h ; VxD ID of winice
: U) Z! r( E* y+ r( S& H int 2Fh
; M- D. ~( X/ M mov ax, es ; ES:DI -> VxD API entry point
& H# }2 L( l( L' S* U add ax, di
4 c3 P1 y8 v9 v# g test ax,ax" o9 ~) l" B" G+ ?- d
jnz SoftICE_Detected8 F% a) q( y' Q# _5 ]0 d3 @
3 N4 A4 N* u) }! t. ~' ?___________________________________________________________________________
3 I( ^# T+ w4 r. I9 r& x% s
: Q2 g; i3 o. o9 gMethod 04
; e" X) x* a( i2 A0 @- v( `* T=========& F5 q/ Z; v( |6 g% Z$ h2 P
3 J' b! ~0 c2 }3 Y& \. l9 ]
Method identical to the preceding one except that it seeks the ID of SoftICE0 F' ^2 G0 \, n; [. ~' [
GFX VxD.
' ^/ y L3 P, C) k O) i1 [ ^9 B8 R! V/ D( G5 z
xor di,di
( ~6 A/ Q6 b! n0 i* V/ H mov es,di
, `# K3 ^# V' X! g6 D. W0 u9 F mov ax, 1684h
, l4 B( |" T7 s6 ~/ n V# t mov bx, 7a5Fh ; VxD ID of SIWVID( s2 v/ I1 a- e/ n$ c
int 2fh
" w# @5 w$ ~: w mov ax, es ; ES:DI -> VxD API entry point% d5 r* L( L7 H6 C' m+ E
add ax, di
/ C6 |2 o$ X9 `- H8 |8 @# d; A test ax,ax
' A+ a n5 H% ]* w jnz SoftICE_Detected# Y% K$ r% e: [+ S$ v9 r
8 m& b1 L% @$ |( M
__________________________________________________________________________' ?7 c7 l( t% r
' @; g4 g& L9 E5 K
. X4 T1 G8 T- T! i& n4 MMethod 05
% ] D9 T) i4 K6 Y3 E=========
8 q& q; r- D$ ]1 k2 B, b
! b( n$ z- n4 i9 fMethod seeking the 'magic number' 0F386h returned (in ax) by all system# ^- y. i. z& w$ D6 H! p
debugger. It calls the int 41h, function 4Fh., Z) l" F( w- k. G8 n0 b$ j
There are several alternatives. . K; o9 D* } N* J
, q& _3 i( w$ e3 @( Y' `) Q9 DThe following one is the simplest:% g# \, A/ E: ]' `7 i+ U" [6 h9 M
7 h* i4 B8 J# F
mov ax,4fh
; m6 S- \ j' W# i7 p/ x- I int 41h" Z9 c: ^0 u: \
cmp ax, 0F386: t/ [+ s7 i- U. K
jz SoftICE_detected
1 _7 r+ s2 p# \6 b7 S" o2 C( q6 j) v! ~, Q, F
0 A! \, S) |6 e& i) B
Next method as well as the following one are 2 examples from Stone's
: Y, U+ k7 d( q5 P/ x( v"stn-wid.zip" (www.cracking.net):$ n+ r0 G. R# `# B
. I4 |% D' X, _ t8 d1 `9 ^ A mov bx, cs* Q7 o) i2 C p( H# j6 J0 k9 I
lea dx, int41handler2
) ?# D8 T/ B- `- j xchg dx, es:[41h*4], m& ]) U" A' ?1 ^
xchg bx, es:[41h*4+2]0 p7 I: v8 H; q' n) a0 J' c
mov ax,4fh. H' o6 B8 ?/ J3 y7 G/ X
int 41h
8 G" A" m8 v+ C/ N4 r xchg dx, es:[41h*4]
: U$ J* J5 H' ^ ]- A! h | xchg bx, es:[41h*4+2]( a* D* O6 ?# t% J3 n) d0 v
cmp ax, 0f386h
. T/ Q% M" w2 x% e jz SoftICE_detected
: u+ { Z y$ A' C
w/ X6 _6 N! K2 Q3 n: Nint41handler2 PROC+ n+ Y( l4 j- S: J, q
iret8 B7 d8 Z; P8 B2 o( w
int41handler2 ENDP9 Z9 L: Y4 b: Y* a& ~( e& \% A
- z+ q0 b2 U) m. L: m6 n
* Y/ E$ S m/ H. X_________________________________________________________________________0 H4 A N' L, y' p2 X; n
6 n O+ q( y: @6 y) p3 m
' ]& ?# A0 [; c9 H
Method 06& G' f# k% t* I: p8 B9 h
=========, _ b/ P4 F! R& }2 d
6 w9 m# ?# {; [: ]- R0 H( B. S1 u# B. F
2nd method similar to the preceding one but more difficult to detect:8 v& |, T& `/ n+ C" I" }* j8 J
7 ]4 P2 K( t, K% m. W
4 o/ _! }* }/ M. _: }- U
int41handler PROC
1 D3 W( V" d1 s! ~. O; g6 _8 {% Y' | mov cl,al
4 q4 w. d% I/ I! e: V' F iret
3 f+ X! R3 H3 S* ]4 v9 e! {' dint41handler ENDP$ V5 _2 C; ^9 D7 t$ Z' r
' Z, a3 }, Y: [+ f$ J1 E5 G" m$ Y, p. u! u& s
xor ax,ax
8 ^( |8 \7 j9 x6 M) o. V mov es,ax
+ Q3 I) [0 T2 U4 m mov bx, cs
, H' w7 W+ b$ C" \. h lea dx, int41handler
) j2 V6 u1 I( @* |( U$ m. P xchg dx, es:[41h*4]
- X. v# k& C7 g1 |) w/ U) v' ?' G xchg bx, es:[41h*4+2]& ~3 p1 S) M2 k" T6 D9 R, K, i
in al, 40h
c& v1 `" ?% O7 u) @( t$ \ xor cx,cx! E: B+ M. G2 G
int 41h
1 O$ H* T5 l/ ]5 B% T" L+ A xchg dx, es:[41h*4]
+ S" |! j, m9 m7 u* [3 F xchg bx, es:[41h*4+2]
1 }2 O L ]' A# n+ i$ b cmp cl,al
( q X# e; q0 {6 L: T jnz SoftICE_detected9 e+ e, V% ~0 {- K
! E0 ]( ?' [- S- [& Z
_________________________________________________________________________
9 }- p% d) o0 j% a z0 E# [8 F4 C, w
Method 07
" g0 j! A& [7 t) i# G E=========' U9 S/ u2 [& M, Y
/ ^( [; A0 @7 ?7 L" H: ~6 i$ _. CMethod of detection of the WinICE handler in the int68h (V86)
J m, m# F% n/ ~0 q- e* Q9 o) `3 I$ M+ w) P
mov ah,43h: W- J; o* O2 M
int 68h
" f! r* @7 a- s& C1 j cmp ax,0F386h0 Y" k) J0 v0 J4 }+ W
jz SoftICE_Detected
* E/ `4 D4 i2 v2 X: b) j
2 `- @! u* q& J, h9 m1 w- u/ [; X5 { @! l: t: T
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 ]" j, J% z' c6 G, z4 t app like this:0 o% F2 l0 |0 ^9 k
1 s0 K8 G! g7 E* u: I BPX exec_int if ax==68
! S# h7 t$ \: v" O5 o3 I4 @' w (function called is located at byte ptr [ebp+1Dh] and client eip is& r, Y$ @% T) K: t' w: f
located at [ebp+48h] for 32Bit apps)
9 ]2 X, @ ]2 l L! M0 D" B__________________________________________________________________________# V6 ^6 e, ^! Y. V9 x
7 ? n' y8 T, {( C' ?4 ^2 I# g* d: F3 g/ i4 h: P0 j
Method 08& Q; ]' t) Z) z$ `/ D" X3 ~6 ^( H3 M
=========; L8 @: D* _" N( x* g
) Y" y0 |$ K0 Y* w0 V; T4 B; z; _It is not a method of detection of SoftICE but a possibility to crash the
7 F) ~/ ~& b4 R4 fsystem by intercepting int 01h and int 03h and redirecting them to another
: f* M" L- N& z$ c8 [% Wroutine.
B. r) F$ {7 j) k6 [" `' OIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) L6 w& s* ] b. y3 J* kto the new routine to execute (hangs computer...)4 q) q& f. R! F$ V' c& L1 c* [' N
2 D4 ~# a* b% w mov ah, 25h
8 k4 A, [7 j' w o [3 S mov al, Int_Number (01h or 03h)
1 q |6 k; k9 [( v) T7 { mov dx, offset New_Int_Routine
& U# x y) m0 @" w5 C int 21h( c" u# ]1 s! ?* R) s+ ^7 x0 T
, }8 m# o5 x- H" i" ~: n" ^0 Y
__________________________________________________________________________
( \5 {6 j3 V; M9 z
- _+ r" {: \- T3 QMethod 09
" G* ?+ T% ]- i=========6 v2 f2 I4 Z0 z4 ]) u
9 M3 O1 Z2 {' M- s! dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 M0 R8 H- ~) U; Q9 w M7 F
performed in ring0 (VxD or a ring3 app using the VxdCall).1 j8 q* ]9 I. i: J
The Get_DDB service is used to determine whether or not a VxD is installed8 V. e7 i) `4 S" }2 l
for the specified device and returns a Device Description Block (in ecx) for
4 E3 N0 d8 R% ?2 F" V' Athat device if it is installed.
+ j ?) r3 W3 e, D( p# J h5 y, W9 P: l
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 l- o! t5 s* e/ j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" @( v% X% h& Y1 ? VMMCall Get_DDB
) d5 Q3 I4 S' J( @0 i mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed, H% m6 n8 Q6 x0 W4 C
( b4 _( {& ]" @/ z* b: g* f( UNote as well that you can easily detect this method with SoftICE:
- F! w( V+ l7 k- ]$ k bpx Get_DDB if ax==0202 || ax==7a5fh( F, C2 O V- n: r. C1 H0 p
7 z z2 I* k( g1 d1 Q
__________________________________________________________________________
+ T L6 d8 g1 N; r6 T+ i% b& F, ]: s, ]2 I6 v% b( J
Method 10( {1 s* K" j. }- b/ T+ g) l8 P
=========- x( o% r$ F" t6 n4 j& s' g
1 t- j7 C& t4 s0 j9 t3 x9 w, Q& n
=>Disable or clear breakpoints before using this feature. DO NOT trace with
. P* f! Y+ O, \6 f E. c9 ^ SoftICE while the option is enable!!4 m9 h8 y7 I, J5 C( B- @) R
; }$ r% t# w3 n( V. |% z7 mThis trick is very efficient:
* C7 X, O9 N2 t0 G0 b1 Hby checking the Debug Registers, you can detect if SoftICE is loaded
# x/ N% [2 D3 M- B(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: r1 U& a2 U- N. t2 e; [: Vthere are some memory breakpoints set (dr0 to dr3) simply by reading their
& _5 F# n; o) I$ l& G1 Yvalue (in ring0 only). Values can be manipulated and or changed as well
/ v+ o- q: I1 \ U K(clearing BPMs for instance)$ p4 k7 O3 C- d3 m) S' |# g
5 s6 x0 G% v& B+ X a p; P
__________________________________________________________________________
9 _$ [, ?. d5 R8 a% t1 y" a" z; x
* c4 o% @( u; J9 L' e9 JMethod 11
5 n2 N* ]* U' a* x+ S=========- Q/ U% L) O; ?9 ?* _4 A
6 ?% u% O. G" ~* ^3 S V, j! j2 T, AThis method is most known as 'MeltICE' because it has been freely distributed
$ z m, q1 Z% q# q; `8 n( Avia www.winfiles.com. However it was first used by NuMega people to allow$ R' L& H* `" C& G1 _$ O
Symbol Loader to check if SoftICE was active or not (the code is located+ e/ |! I5 A7 A0 ?& a
inside nmtrans.dll).7 T4 R( D: ^* G' _% Z
* R! s7 g- j3 E7 F. z a/ p7 M
The way it works is very simple:% k6 s: g% R2 g2 o
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 Q, G0 I+ E" m
WinNT) with the CreateFileA API.
' g* |/ e! D# _) Z; v% k7 C; s) d+ P) Z1 w- t+ F
Here is a sample (checking for 'SICE'):$ [& U! I) Q6 Q; {! m- I' K
, ~, _6 o$ e! o" p; x
BOOL IsSoftIce95Loaded()
e9 A: l+ g- f; R{
. ^* ]) x1 D$ r" w$ P HANDLE hFile;
' {' c& B3 p- o hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 g4 U% w0 J* t l+ M" g" I) n
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 s( x' y) y, Z9 ]( \1 X3 R! j NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" _$ I+ y$ f9 Y' ]/ [0 o
if( hFile != INVALID_HANDLE_VALUE )" U: J) ^& g* r' I& T+ O$ K f
{( |1 l0 @# G: Z V( i8 P3 N# [+ ?1 h
CloseHandle(hFile);
]: V- O9 K' j$ U/ u5 N return TRUE;9 Q7 I. a5 e8 ^' v6 Y" {
}
. s; z% w, |; \* a! t return FALSE;
0 @5 I2 Z* {( H$ M$ l9 P}
1 g5 s0 p$ F7 u
5 r9 x. Y' ^% }+ q6 K* k& [6 QAlthough this trick calls the CreateFileA function, don't even expect to be J8 q. @5 _ X: [ s
able to intercept it by installing a IFS hook: it will not work, no way!
5 a8 D* N: f( `' |" K" z- E) DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F8 D0 w0 r( p! f) `
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& e( f0 O7 z; t1 v
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ B8 ^" F- b1 y
field.
$ B; x& k& c0 I8 R) CIn fact, its purpose is not to load/unload VxDs but only to send a ! u3 z1 `5 |( U" a/ m
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 F/ T( i# a) y
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 a8 X3 ~7 n: O- c$ p: w# @" Nto load/unload a non-dynamically loadable driver such as SoftICE ;-).) P. Q/ M4 H0 o6 Z
If the VxD is loaded, it will always clear eax and the Carry flag to allow
4 D8 k4 j% t# Y3 Aits handle to be opened and then, will be detected.& n8 K( Z' T. R' D3 D7 S9 a) w
You can check that simply by hooking Winice.exe control proc entry point
& O s# C) O2 |/ gwhile running MeltICE.
0 V' n7 u' X% @ R5 m" k% h& X4 m" r% H. \$ I1 q: L
1 C& b( `# q! ~ 00401067: push 00402025 ; \\.\SICE
( O/ A& o& _) B: J 0040106C: call CreateFileA- {2 D7 d. Y/ T6 B
00401071: cmp eax,-001$ m4 d/ H5 C* y. n4 P
00401074: je 00401091
0 v4 W% Y% h6 r6 R1 i6 m& k+ Q& L4 ?- E) l
f1 i7 V- g( h: A RThere could be hundreds of BPX you could use to detect this trick./ h i( w7 w; w; e/ ]+ a* o
-The most classical one is:
z6 `1 @, d2 r% m! |- x9 S BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||3 ?5 D5 W; } }. V8 Q5 H Y
*(esp->4+4)=='NTIC'
" b7 f# L3 g! B/ Q: I S; q" b8 d e
-The most exotic ones (could be very slooooow :-(
! j7 N4 b3 [% k4 R5 Y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, i1 z. i$ F. Y+ ? ;will break 3 times :-(
d6 s7 _1 n/ q3 N$ T. N) ]& T* B
! m, v" \! g0 a9 z$ T' O; e9 i-or (a bit) faster: 6 y# V! W/ K, V( b$ O. u
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 A' j/ f! H" I" J
( T+ e! x1 ~2 O, |5 J BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
# l6 q: G( N) S/ Y% r ;will break 3 times :-(" S8 {% \7 |% d) I5 B
9 e% s* Q0 e V/ M3 B
-Much faster:3 |* m* n9 N1 Q; c- q A
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
2 E. x8 I% \) \5 j. W; m
& Y2 L& L0 {5 ?+ SNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' a" w0 B _1 X' R* S0 B* X& s
function to do the same job:$ d* O% Y& E7 v: I$ U+ p
* {: C! f3 ^5 v3 { push 00 ; OF_READ/ M2 @) S+ i1 q$ w( t
mov eax,[00656634] ; '\\.\SICE',04 e- W& R: n2 P/ D* B
push eax% K7 f( B8 t; T7 p4 e: T4 D9 Y, ]
call KERNEL32!_lopen
" J) h; u- B& [# J9 e inc eax) ~: ~: P' D( f+ J5 \2 t/ i7 E! p
jnz 00650589 ; detected( d, e! V. H. L4 G
push 00 ; OF_READ
; u- X* o0 B3 ^ L" v mov eax,[00656638] ; '\\.\SICE'5 Q4 c; `# U. L
push eax. |; N% S) G. |' @/ x) \: f3 M K
call KERNEL32!_lopen
* O4 d. m2 e: |1 j" X E inc eax0 I9 R0 L0 ^- N& \' X6 |" M
jz 006505ae ; not detected
, F/ D/ U, V8 k7 c% x
( r/ p. L# m2 u' }2 t p, ^7 ]8 p/ d7 i
__________________________________________________________________________( M$ n) D, I4 p& v
, u4 G0 Q# x0 U9 q
Method 12
" x0 r) h8 i' j9 t=========
3 @! h# Y- y( f/ b8 u) k3 [0 I$ C
1 t9 J" M- N; L+ TThis trick is similar to int41h/4fh Debugger installation check (code 05
4 B4 A: {, R- b7 d/ z. g7 H: W& 06) but very limited because it's only available for Win95/98 (not NT)4 y9 e$ D8 S) t8 H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
) S3 u+ n7 k4 t1 M2 i
$ @) C/ l w9 L8 Y4 Q push 0000004fh ; function 4fh
# ?( ?7 ]" J9 }) B4 n! z# X# H push 002a002ah ; high word specifies which VxD (VWIN32)
* ^' M3 ?) q! R ; low word specifies which service2 ^) t. Q' e4 g% `
(VWIN32_Int41Dispatch)
6 _8 S* q3 e* j" @ call Kernel32!ORD_001 ; VxdCall6 ^; z+ _3 |, ~: Q# n
cmp ax, 0f386h ; magic number returned by system debuggers0 r" q( n! o9 [0 t9 G% I
jz SoftICE_detected
+ I( w K6 v( b0 \5 n- ?, e9 }+ A* q- E+ N
Here again, several ways to detect it:
( }+ h% U4 M) y9 v7 U0 U, S% G: h7 E, D6 |5 S7 u! c' s$ n" f: \. Q7 p
BPINT 41 if ax==4f
9 Z, O7 ~ l# J9 i. G2 r. G1 c+ a1 e( l2 ]4 R
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 u5 K6 E( M4 ]8 ^1 D8 l# G8 w) Q) O
+ ]8 U2 N, H, W, w BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' v' |( L3 R. R0 q
9 R; a! ~+ e( o$ o" v BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. ]6 q2 D4 h6 Q Y* i* @$ }% k5 a' D3 P6 [3 N
__________________________________________________________________________1 a# j4 T5 V& Y0 ^
4 L2 I9 e$ E4 m8 O& dMethod 13
: z5 u4 A, r; _0 T& I=========
2 d, V! Q4 } v, c* M# c* T: k, G2 _; z$ u5 @* q$ R4 M
Not a real method of detection, but a good way to know if SoftICE is
7 v8 C1 ]5 {" {8 z! d# |/ T6 _$ Rinstalled on a computer and to locate its installation directory.: r' L% ] C4 d1 _. ]4 }
It is used by few softs which access the following registry keys (usually #2) :
4 N' O( g3 \ ^, K! P9 S) ]8 B; y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
c5 O& o6 p! N3 X8 l\Uninstall\SoftICE
' ^+ C" D( J. i* K5 |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; [9 L" g0 O- \6 M4 B1 Z7 d4 d
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! T) A1 x+ N$ |\App Paths\Loader32.Exe. D" J* a' ] y! G. q
& v! ~% L7 g1 z. K. y
, q6 e/ I X$ Q, N& _/ ~+ h p GNote that some nasty apps could then erase all files from SoftICE directory
$ M, v# B4 r) M9 a1 X(I faced that once :-(
$ [2 ?1 U' ?8 L. K# `' Z" U& A3 O2 l! Y, A% n. a; ^, O
Useful breakpoint to detect it:
+ t% p5 [3 B' i! |' s: d$ |% d) \/ ~! g$ L9 f) @+ l, g) K- c8 _
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
' p) I% q! R" q$ W
5 ~8 }* W# q! f2 |( j__________________________________________________________________________
2 h$ n& q- ~$ y, }
. O$ R( e0 y- d7 R% j8 q# J7 R( L5 v2 g( l- X9 O9 O4 ?& N
Method 14 0 }+ L! ~6 v" ~( A* h) q. K4 Q
=========
L3 N8 k6 _2 @+ u8 c. n
' D( \" Y! U: K HA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# n& T# l5 M8 {0 J6 m8 M
is to determines whether a debugger is running on your system (ring0 only).
4 S' v/ j/ ?2 ^$ y+ F
. ]% P8 h) H5 z' p( P9 ` VMMCall Test_Debug_Installed
& H; f& L: u+ V; J+ C& v( l! b, G je not_installed0 h i3 i. b5 I+ J! k& G' m8 M0 v
+ N9 p" T/ h U V( NThis service just checks a flag.
6 \* V) U! Y x( F# `</PRE></TD></TR></TBODY></TABLE> |