<TABLE width=500>
9 H: I& M8 a+ c, e<TBODY>
' G0 x: v3 q- }/ |# A9 o9 S<TR>
& [4 g1 A7 Q. u' @5 f& c; U; r<TD><PRE>Method 01 / N7 T8 L" r" f
=========
. L1 e8 j8 i$ V. I. t( `' A8 ~/ G+ K0 c L2 \, ^
This method of detection of SoftICE (as well as the following one) is
7 D; x S8 ]. s* ~/ z, M& U( e1 @used by the majority of packers/encryptors found on Internet.
# k* P. x4 R5 p0 { PIt seeks the signature of BoundsChecker in SoftICE
! H8 M8 U. ~& E6 W. @) I
3 c$ R( |, G6 z mov ebp, 04243484Bh ; 'BCHK'. V/ [ m2 n' I! {) r; _: j
mov ax, 04h
0 n1 ?, h( E' V' P$ c' T- [' q; }0 | int 3
7 @ G1 J: Z9 E, L1 V: l cmp al,47 I( Z2 X: @: u7 V# [* R# D% o
jnz SoftICE_Detected4 z4 g( x1 A) l7 O m( U
( w4 g: X W, \3 n3 Z5 ?' Q ~___________________________________________________________________________* l. h$ o0 [- {' L7 l; S
! C1 z3 ~, I8 q: T- r" UMethod 02" R8 e! \/ f7 l9 O
=========3 l" N& @2 C! F. u" [4 N- M1 ~1 w
% f6 Y- y0 ?" JStill a method very much used (perhaps the most frequent one). It is used; S( D3 m' k8 O+ z( v1 [ c7 h9 o
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 A! w) ]0 ^+ _. for execute SoftICE commands...( v% w/ l7 ~: l/ S0 c' B
It is also used to crash SoftICE and to force it to execute any commands( c+ U* N0 Q6 p* h) U; h
(HBOOT...) :-(( 8 b" U: i# C L x( p$ h
8 h' y3 {: k7 xHere is a quick description:3 C. W5 k6 @8 T8 c! r& H
-AX = 0910h (Display string in SIce windows)* n" M7 ]9 s- a
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 K' [+ d# O: R" P. M. R-AX = 0912h (Get breakpoint infos)
% [# |8 L! g K! d# b-AX = 0913h (Set Sice breakpoints)4 G, M+ O' ]2 O2 i+ G
-AX = 0914h (Remove SIce breakoints), V6 C8 }+ L6 C7 g. L3 h8 b
8 N; {" s; O* |2 P! Q0 K
Each time you'll meet this trick, you'll see:
. r+ l& |$ s3 O4 D4 f) K-SI = 4647h
% W% E+ N' q$ \-DI = 4A4Dh/ {: v- D) S' K+ z( v
Which are the 'magic values' used by SoftIce.
1 ] ]1 }3 ~. J2 X2 H6 m1 zFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) ^) A& ~! `" r u( o
! O+ L' F. K2 `7 s2 U% l! r9 P
Here is one example from the file "Haspinst.exe" which is the dongle HASP
+ m; p0 W% g/ _) Y' c1 xEnvelope utility use to protect DOS applications:
* P" b* r9 m/ L! S% j7 _$ L" [ h$ x" ]
$ i/ h4 }' n) m8 A6 A8 x, l0 j4C19:0095 MOV AX,0911 ; execute command.8 |$ y9 D- J' Z# |/ q" ?0 M
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; C6 o( R8 G+ k5 L- `1 g8 X
4C19:009A MOV SI,4647 ; 1st magic value.
3 T5 C$ k: L i; L4C19:009D MOV DI,4A4D ; 2nd magic value./ F* v5 Z/ o8 P( N4 p+ g0 _
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)# f3 t; w5 x% w# u/ G
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. p, a2 J! I' n) h6 U4C19:00A4 INC CX
: A' \# Y4 A% j2 ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' o/ f7 V* L' N+ \
4C19:00A8 JB 0095 ; 6 different commands.
/ }" |+ C6 ~1 {: v' I' A v( M, s4C19:00AA JMP 0002 ; Bad_Guy jmp back.. t' k9 v9 A5 e L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( w" Q) G( @7 Q( m) g
4 T, q W( m0 a, l6 F3 ~! C3 sThe program will execute 6 different SIce commands located at ds:dx, which4 z5 [6 F% [2 y! {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 G' ~( l- D9 _- K7 a R. D3 T
' | v$ d3 @9 W* h, }3 L1 }0 b- f
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
_9 `% ~( D/ [7 a) q [___________________________________________________________________________
& v; x3 I+ w, h' _$ \5 U
e5 r/ K# V8 m) m
' e2 n9 J; u/ `+ dMethod 033 z( h( H Z5 \ W" |! X
=========
6 p7 G; p0 m- ^( m$ ~" ?% |* m: V9 Q" N$ b1 B) m
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( r0 U4 o2 Z1 M(API Get entry point)% \9 M& p3 ^3 G# H0 j$ j
" m6 y& I/ P! V$ P6 x' [9 p
, t8 \6 U5 N1 i/ [. v xor di,di% \! b7 e' v% s& } v7 }& N6 y6 w
mov es,di* \* y/ I7 @, C* ?; e$ i
mov ax, 1684h , B, u; S4 M4 K/ O6 ]7 Z' h2 `. ^
mov bx, 0202h ; VxD ID of winice# a1 y* U- J/ [
int 2Fh$ U, ? s" h4 y) Y+ z
mov ax, es ; ES:DI -> VxD API entry point
6 u( Y5 ?7 v' F6 V# v- J3 f add ax, di
0 ~" w/ S* k9 a' x test ax,ax. K3 P% i! |2 p" x* | f
jnz SoftICE_Detected' m6 e' W) b; h- M1 [
3 ~( `. c( s) C+ \2 M& G___________________________________________________________________________
$ f5 I" w* H$ H- j8 F- }' U) G5 Q# J2 R g2 [3 A
Method 046 K4 w( [$ t' Y. B' v
=========
' r( X6 i9 m* U* f- S) P6 u ?
3 b* R; B/ T! @% ZMethod identical to the preceding one except that it seeks the ID of SoftICE8 C7 ?8 u! Z. `0 u7 k. y
GFX VxD., b* z& t$ Q. `$ E& [. l. d
5 x/ V5 h# s) \/ K" A xor di,di( ` \- r, }8 T, N
mov es,di
! p4 r& e# B( m% Y7 p mov ax, 1684h / A: `" {+ u3 l2 C3 n1 `5 S# O
mov bx, 7a5Fh ; VxD ID of SIWVID3 p2 z6 {! z( `- `3 l
int 2fh
O* c& x7 p% E( Z mov ax, es ; ES:DI -> VxD API entry point- m5 C9 S( x8 I
add ax, di
8 H7 u8 O5 m3 q9 |: c( ?0 Y test ax,ax) {% n+ y) J& {2 @6 [. D
jnz SoftICE_Detected- ?: _( ]% _7 W0 ?
& s# X; Q& O( }& H" P
__________________________________________________________________________: T1 j! k$ P6 o0 Z
! ~0 G3 h' ]) o2 k& ^& g
7 T W$ f% t3 F3 {5 u1 q3 P% r2 HMethod 05; x6 z/ x" T; U# X; \3 I O4 J
=========
. p% {5 b5 U, O5 i z
) C5 s. H! }( e! `: fMethod seeking the 'magic number' 0F386h returned (in ax) by all system+ u) E7 ?( S; z) ^; W% h( N5 I m
debugger. It calls the int 41h, function 4Fh./ }* ?& o; w- N8 C' L8 `$ X( F
There are several alternatives.
+ j/ B% m& e. o( e7 X: M- X1 H1 m' N3 w0 ]
The following one is the simplest:1 ^* {& f" h/ @5 F/ ?/ b
% M$ e, ?# M+ f: }. Q# E. {, g mov ax,4fh) l; j- _0 b; \" D
int 41h
$ e' w& A- `" n/ D cmp ax, 0F3867 _* `1 E. i6 l
jz SoftICE_detected
4 o4 P L. w! a, k% `- j" W. ?. U6 y+ j7 E. l3 m; t- C. P
$ m; i& B2 h$ b+ L; A
Next method as well as the following one are 2 examples from Stone's 8 c, \2 [$ u/ @2 ]) R4 t
"stn-wid.zip" (www.cracking.net):
9 C- U ?, I: d" W' p& |3 A. e# f- l% j' x
mov bx, cs
. ? }7 P% T; ?3 g3 H0 |0 K3 ^ lea dx, int41handler25 K) A) x, g" b, g
xchg dx, es:[41h*4]
7 {, d8 j" {$ q& l) o% V3 k xchg bx, es:[41h*4+2]
6 w% S! J; W% _5 A" u mov ax,4fh
" s1 e7 `, h7 p4 | int 41h! T( q! h' R# M# k; T
xchg dx, es:[41h*4]
" K: ]% J' C/ e+ Z xchg bx, es:[41h*4+2]4 |/ _ V& \7 _6 A I- }
cmp ax, 0f386h
' J& i9 u0 u; z& ] jz SoftICE_detected
( ~! e9 f" i9 f. j# x+ P" @
, f7 k I4 L5 k/ ]% L/ h9 v! Qint41handler2 PROC6 Z' y- b8 }$ S1 u' C
iret) M' d. j' c4 }$ r2 J' s
int41handler2 ENDP
9 z w) M% b6 ]* n
- h1 o3 o& I. O6 R3 D b' B" J6 Q- ~9 [3 ]; s* p
_________________________________________________________________________; {3 `, H' L9 Q. @8 r- f
3 d+ t6 A% y2 e& G( V' H
8 J% h$ b! \. _6 z% n/ E
Method 068 E' H% \" s) P# X; r* _
=========+ I$ P2 M& O5 U: K) R* i
9 ]" j0 K2 P! p' m- ^- \! K. X
* N/ M) s1 a( X0 K% e) ]2nd method similar to the preceding one but more difficult to detect:' E" ^: h$ d7 V6 c) N
9 y% I* M' Z5 o1 g' n; Z+ _% E- ?$ L7 C) D
int41handler PROC. f" a: r% { D- ]
mov cl,al
" J+ r! v! |2 ?8 o6 N! s& _ iret, F. J* P( s1 D, x+ M
int41handler ENDP
. X" q7 ~0 t6 ]$ E& v8 l9 T4 c7 w) X; B' u* v/ c% Q* G
: L) Y9 ]+ ]6 ]% ]' I3 G2 n+ V xor ax,ax
1 O! N* V# r1 ~* j* G+ q mov es,ax5 f- D& \/ L; Z; Q O. L
mov bx, cs1 V6 d& r& m, }8 o
lea dx, int41handler$ M# P, O3 ?1 @; ~0 g2 w* `
xchg dx, es:[41h*4]* |$ X; n) _. G, N( R& X
xchg bx, es:[41h*4+2]
0 y$ C2 Y5 b, u9 i4 b: t in al, 40h; V; C( |4 e: L8 M9 _
xor cx,cx5 V* j k% X+ U7 Z
int 41h
4 g* ]! K) t! A$ ~2 f! l, U xchg dx, es:[41h*4]2 I6 u) ^. [* c u( U& g1 t; t
xchg bx, es:[41h*4+2]
$ O0 O% A* \7 E+ t cmp cl,al
3 a: f1 O% q) I O3 X& I jnz SoftICE_detected+ r( `0 L4 K4 G. j, H1 O8 P
, F0 S5 Q% M U8 ~! l
_________________________________________________________________________
) i% c' _3 E9 [5 R. \4 D
" W7 x( V! W" E2 VMethod 07
& M2 }* L0 d. j=========
! u$ ?1 \9 T, e4 n$ g
2 C7 M& |$ t1 M$ M% fMethod of detection of the WinICE handler in the int68h (V86), U4 {* i* u' ?8 V( s
: R+ U# k# k Z7 c0 C' L5 s* q mov ah,43h' w! F% i }& E, C" N
int 68h
5 H7 q8 M) l% T0 J d/ b( r8 o cmp ax,0F386h/ M- M# m; }2 L3 }+ J; n9 G
jz SoftICE_Detected' y$ {4 @5 t. g( L/ l
& A8 h/ i! ^ r9 c+ t
. ? Q, r, `7 v7 d% E$ Z1 {& `=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 P; K+ m8 |8 t8 H- K% p5 y app like this:
5 L' m/ f3 f4 l" Y
" T9 |. f f8 }; J% {- z8 W t. `5 J BPX exec_int if ax==68- E- ~# w% c0 p; Y) M
(function called is located at byte ptr [ebp+1Dh] and client eip is7 h& ^; O, ^9 c, x# ?" z% A
located at [ebp+48h] for 32Bit apps)
& E, H" z x0 J( f: T__________________________________________________________________________* ?4 g6 s2 e5 Z8 T% q+ M7 t
9 a2 c. |/ c2 t* l- T& f" Q% W
5 U4 N; f6 H; S8 @, H$ I9 o, U" W
Method 08' ? C5 C6 h! X5 D) r
=========
5 g# {8 s: j/ C! F5 q
6 s) s/ l6 c1 h: z: A6 \It is not a method of detection of SoftICE but a possibility to crash the
5 J5 _$ L! b0 U" n4 Qsystem by intercepting int 01h and int 03h and redirecting them to another
7 A; Z+ ^1 J4 M9 p C* Froutine., t8 l2 G) }, B2 Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 f' y: r# _2 D
to the new routine to execute (hangs computer...); z- S/ z* Y7 m' T: _' c
0 o$ i# r1 t( \! C
mov ah, 25h
$ x3 R% T J& i% q mov al, Int_Number (01h or 03h)
1 O, X* l9 c( ~ Y mov dx, offset New_Int_Routine
h+ t3 C: l* ~ int 21h
4 I; w( g8 J" w9 V, A2 \5 I. Q% r2 x) b* Y) }7 P- |! c
__________________________________________________________________________ D0 Z9 g- o/ j7 E
( @0 S( r/ g0 v3 QMethod 09
. [0 L8 X4 D! t M# d: T: J=========
7 R& G3 S! ]! w N8 ?! H: B2 K6 P7 ~" R' d9 ]9 a+ P
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 {' |# l9 e7 n# W' n1 V" Bperformed in ring0 (VxD or a ring3 app using the VxdCall).
# x1 m' q6 U: z- t4 \) h5 H/ e- O: ]. OThe Get_DDB service is used to determine whether or not a VxD is installed/ `: I2 i: J$ G' s, {* Y
for the specified device and returns a Device Description Block (in ecx) for/ Q8 s# F! b5 k% `2 `! z
that device if it is installed.
8 F' s/ P9 d0 J. Q" |
6 m q& y% u. J mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 @) h. N. L, x$ e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
6 e7 d E, p0 U* O: t VMMCall Get_DDB
9 Z/ v% W9 p, ^" G, D$ @/ n. j5 n mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' E- O6 V0 F$ d9 [5 A* D4 e- j
$ v% ^) j- b) F) G$ q- i
Note as well that you can easily detect this method with SoftICE:# c8 V4 h8 a$ N' h$ l
bpx Get_DDB if ax==0202 || ax==7a5fh
: D) t1 o' \, o6 y; ?! g# I" b1 r4 |& f: g% k' [* d
__________________________________________________________________________/ k9 V9 G8 I/ u. R" W! ~0 P& a
! \3 N+ [7 h' x5 W9 \" LMethod 10- N) [4 {/ j4 J. w# X! K5 Z1 R$ P
=========
, H+ ~6 T/ t+ q# y
4 }, b! _* T) J, y& Z5 {0 O=>Disable or clear breakpoints before using this feature. DO NOT trace with
( v9 V+ T a0 v h4 ?0 d/ R SoftICE while the option is enable!!9 {8 k3 r; ~, g
: j; h8 M: R5 d0 v% U
This trick is very efficient:+ g- s/ v/ `6 D0 h( }8 _
by checking the Debug Registers, you can detect if SoftICE is loaded
k' y4 H4 v) v* Y' C2 F9 c q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 o1 l) l8 f7 _1 @6 l$ ethere are some memory breakpoints set (dr0 to dr3) simply by reading their# x- P+ ?3 Y' W9 i
value (in ring0 only). Values can be manipulated and or changed as well
& D# v: ~, }7 f, d8 U(clearing BPMs for instance)
8 H1 }9 ?# C9 L& t- k! e; k2 `: N/ X! [4 v
__________________________________________________________________________5 ?$ ]* |9 d( u( J/ d
" C% [% ^/ u# c SMethod 11: T5 n4 b8 i/ t$ g# M+ C( C+ s# \
=========1 C5 D* Y: n" {2 J
7 E( {0 m6 J7 E* ~7 c& F
This method is most known as 'MeltICE' because it has been freely distributed- D# l. J W7 N. c( W# U
via www.winfiles.com. However it was first used by NuMega people to allow3 [% m5 M! h( K- D7 F8 t5 Z* N7 ]
Symbol Loader to check if SoftICE was active or not (the code is located
/ ]- l* D. c5 b/ ?* K% Sinside nmtrans.dll).
) w# X5 e+ u5 t; [! r; C3 D9 `3 ^
5 F6 k: j* m3 q7 P$ d9 L3 kThe way it works is very simple:
/ b2 R& E0 r& J4 ~# J5 ?: dIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" I" I# U" Q! B9 v& N( N, J, JWinNT) with the CreateFileA API.
5 x3 n. G! \1 @( R
4 G! T/ W( O ~* U4 p m$ SHere is a sample (checking for 'SICE'):
6 \" p0 ] P5 d
- [0 t& c2 {) X! W$ s- R; hBOOL IsSoftIce95Loaded()
/ s& S3 z, @2 B* e; s4 o \{
( i% l- Y9 x: J* u HANDLE hFile; + B* o2 i& I# _6 f' D8 x
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- U4 c# J+ g0 J, G
FILE_SHARE_READ | FILE_SHARE_WRITE,( R# D- q& O# v/ ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- L! N9 l+ w4 O0 F
if( hFile != INVALID_HANDLE_VALUE )
5 Y6 s# j! c6 s2 n. q( B {
. g8 }3 E" h: G" B CloseHandle(hFile);. h; r( w2 l5 u5 ?) g( @% J
return TRUE;3 o- G! O2 ~. d6 \' q5 }
}
4 n/ e9 t$ H; \2 y' _ return FALSE;
, p4 M4 P' H) r* ]2 Y0 c. T0 [/ J% v}
7 e& G# t, U' D/ L( F
7 C B" C8 \9 ?7 t6 pAlthough this trick calls the CreateFileA function, don't even expect to be
. j9 A) G3 z- U' {* a0 B6 i( sable to intercept it by installing a IFS hook: it will not work, no way!
# E, N0 l( U: P& cIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ k% e7 {! H$ r0 _4 B
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 Z9 z$ k6 l3 X# S
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
# f: B) G) i7 R% a; n6 d1 jfield.+ z# c3 h1 G/ R$ w: M- W# ~8 B) N
In fact, its purpose is not to load/unload VxDs but only to send a & N" L+ D+ M3 N1 l B& y( N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( j" G, l6 Q0 {to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: U0 i9 Z+ ?3 e3 t2 T3 {to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( O( n! g; ]9 y& k4 gIf the VxD is loaded, it will always clear eax and the Carry flag to allow# q9 A! e) i+ O# O' h2 E
its handle to be opened and then, will be detected.
9 O- r5 S+ ? d8 ]: rYou can check that simply by hooking Winice.exe control proc entry point
2 p* w1 C# c7 V* s# k1 _while running MeltICE.$ R7 _2 t- T- Q, d+ N: h
" {0 @4 s0 A3 S$ e( @1 v y! P$ A3 f& z' f1 Z* Z6 m
00401067: push 00402025 ; \\.\SICE0 f! X1 v9 U5 g$ G
0040106C: call CreateFileA
( b' a9 {6 W) f8 ] 00401071: cmp eax,-001
& g/ b! _: C- k8 Q# } 00401074: je 00401091
& z) i; k: Q) {7 b4 ]) T
: q9 s' T, B! v. n0 U5 J( Y# A' |, l( |
8 X3 |1 z& T& l" T! d$ KThere could be hundreds of BPX you could use to detect this trick.
9 G# X* k1 x9 R-The most classical one is:
6 F. y7 S6 H5 T& ?, m BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: @0 `& S/ Y& C" N L. B& i' a( w
*(esp->4+4)=='NTIC'
) W/ K6 _1 A0 L$ r- H6 E4 N5 Y" m" d5 m, C ^6 n2 ~
-The most exotic ones (could be very slooooow :-() I# O6 x$ X+ S- }( _& O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 p, O$ k0 e/ h) B ;will break 3 times :-(
6 }) q; Z* r( m9 o0 c G' c
4 K; F/ O9 G% J+ i$ p-or (a bit) faster: ( R- v _0 e- [ ~ R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) y8 s0 M" }. N# T1 e: l( J& {
, w) q& p: S C2 j% V9 s BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; G- y' U8 {4 T' d0 N; N
;will break 3 times :-(
, C3 b0 k9 ~; T. f- |
x3 ?! f6 E" |1 @0 \1 l$ M6 Q-Much faster: ]' b. B! D* G7 x' x' T. l+ A4 @
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'# D$ }% z' ^6 G6 S3 ^
9 v: T" x. J; D) B" tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 s3 c7 H! I! K- Z9 b- Ffunction to do the same job:/ R9 |7 [0 P$ M% ^( Z
: f3 R! k, D; m1 l, O& q+ D& _ push 00 ; OF_READ
+ C G. \% `0 C6 m) P mov eax,[00656634] ; '\\.\SICE',0
$ p/ W0 K6 {. _* i$ k4 D# ?- ?7 S1 ]) q push eax6 k' @- }, P% c8 W; Q# ]7 Y
call KERNEL32!_lopen
, r) H+ d6 b) S+ d. V inc eax
. E5 X; i, a$ h* W% s( u a- E jnz 00650589 ; detected
; G2 H1 I5 l- W9 ^4 ~! n push 00 ; OF_READ' s$ @3 M( c! Y+ r5 X
mov eax,[00656638] ; '\\.\SICE'
, C6 f# M% s- H. M push eax. t7 s* y4 j( ]. ]2 m6 C" j5 i
call KERNEL32!_lopen
9 \/ j) q; o' B$ \4 h inc eax0 Q( {- w1 K4 a3 s9 J' K
jz 006505ae ; not detected; J F4 j# A& Q/ l0 ~. W6 f
8 K p7 z+ G2 e3 T
# ? L6 N P m# F
__________________________________________________________________________ l) m$ v2 P* O3 X3 t# r
4 ~ }/ I r+ V3 Z
Method 12
& s V1 n0 Y* i/ x4 k4 C( ?1 m=========
/ R( v% R4 F4 t) q; n
1 d7 Y' f# r; [7 G( NThis trick is similar to int41h/4fh Debugger installation check (code 05- m) I% d* w+ ^% V4 r! A! \4 M, a
& 06) but very limited because it's only available for Win95/98 (not NT)
# X0 q$ F4 A" D9 D2 f3 s( Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; w4 @$ u7 p; P/ O$ e H0 a$ S0 ^5 h A" d5 y
push 0000004fh ; function 4fh: ~, c( C, y* D. P7 O) X- u" Z( G
push 002a002ah ; high word specifies which VxD (VWIN32)1 E/ [3 f9 q5 m5 c- r% V
; low word specifies which service
2 e1 U# W6 |9 c& H, ]( ~1 h$ z (VWIN32_Int41Dispatch)
9 Y" o5 ^1 N! {6 r8 E call Kernel32!ORD_001 ; VxdCall! ?" C! h5 U4 W3 J9 D; U
cmp ax, 0f386h ; magic number returned by system debuggers/ A* l. D, D. x6 i8 q$ o1 p
jz SoftICE_detected% ]9 V- j3 `0 b5 g) m4 y$ k$ N5 k
2 }0 [7 Y# p& d" u
Here again, several ways to detect it:
4 u7 K; D4 q% R5 q/ R5 M m; h* S5 m$ t$ ]; ~$ @) k
BPINT 41 if ax==4f
. G- U: x R/ V- J8 h: @# R) T% R; `: F; x8 J
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( n, Q; J* i5 B- Q+ l
0 g- B8 i7 ~% t
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 t, V+ Y2 H$ q6 m$ I, R4 v* s/ G8 i) v, A! U! I% j
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 O$ i. K& F w8 `2 v V9 |0 H' ?6 b/ H! Y) B
__________________________________________________________________________! t& ]& K9 a; z B
; A3 i4 G3 C+ Q+ yMethod 13$ K9 J9 T5 h6 k
=========9 ~% y, F/ x- l
9 r* E3 l( ?( p! K% o
Not a real method of detection, but a good way to know if SoftICE is8 M6 w* u c- {* g1 m. ?
installed on a computer and to locate its installation directory.
0 w, r3 X+ k- o) y6 L8 @; HIt is used by few softs which access the following registry keys (usually #2) :
% ~' V; A6 {1 E+ z3 o# Q% a1 r* M! R" }) m, H. X% c
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 b' ?6 j9 h" T! |\Uninstall\SoftICE K6 r% u& Z- ^2 @' S% T3 B* A
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! @6 E! T4 h) |. u6 d- j8 j
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, M% G6 t3 l7 [* I6 W\App Paths\Loader32.Exe
1 T( E9 l; K# \/ w+ q, C3 D# ^# j# k
2 U; Z: x+ O0 a& k; m7 v) c6 @6 R: G, i' V2 p
Note that some nasty apps could then erase all files from SoftICE directory
7 D' f, a! h B. ]% ]7 e) Z; d$ _(I faced that once :-(
0 p1 Z4 R3 m! r. f: [+ H$ x( D" q
Useful breakpoint to detect it:
/ S$ d: C6 V \' s% s
( j; ^. w b: J! ? BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 E6 Y: e7 y8 X1 e% O. N" a
" M2 P- P; t' |# N. u, G" m$ X__________________________________________________________________________
$ ?. R j; Y& }; [) Y0 @. y: K* s# M* p$ E- R' ~
* N7 e. T4 f6 J1 h% F5 ]1 aMethod 14 2 y1 {! y4 L% O0 r0 Q( p- \7 A
========= }9 m# N& ~1 e+ r ?3 D& g
5 k+ g9 {1 j. y+ e% }! b; ? n% p: c
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
; G& i0 G- ~- G xis to determines whether a debugger is running on your system (ring0 only).: q: c: U$ a# i4 s. D6 Q; `4 H6 \
* b0 a' x. P( N, m# |% d
VMMCall Test_Debug_Installed
/ G) t3 k# y- M o4 u je not_installed
( @( W. g0 ^7 u' s5 b. S0 j! p, p/ y' M5 n% a
This service just checks a flag.
2 A, O, Q* S$ X</PRE></TD></TR></TBODY></TABLE> |