<TABLE width=500>
, k; r S3 P% u# H- `5 E& x+ _<TBODY>
+ x% f* V$ q9 R0 k3 F<TR>0 v: _% q M* }/ `
<TD><PRE>Method 01 8 p$ c! _3 H9 h/ ~
=========
( a' E/ d& l0 k! C% d; p6 I" K; _, ~ W( A R9 _$ k
This method of detection of SoftICE (as well as the following one) is
+ k+ y1 z. N0 aused by the majority of packers/encryptors found on Internet.
6 d' }% B3 n! c( q n! W S! YIt seeks the signature of BoundsChecker in SoftICE J# I8 R5 @ M% I' W: @' C
+ x+ n1 T# T7 n$ b3 |
mov ebp, 04243484Bh ; 'BCHK'
: ], q6 y. B. Y" h8 o8 s8 P# z mov ax, 04h
8 K0 A9 b U" B; c' j int 3 ; E) n: J4 _+ B# y3 I" b$ n5 h0 x$ b
cmp al,4
_! ?" w9 e y i1 r& ] jnz SoftICE_Detected( b6 c* v6 y! {
# r. w/ W2 l' \2 P___________________________________________________________________________
8 _, A1 ^, M( a G" T# c
) I t h: i* l' RMethod 02' Q; D% {3 w6 _+ X
=========( u! w" j' z6 n6 R
& O7 ]; r. x [: nStill a method very much used (perhaps the most frequent one). It is used. V7 C: q$ x3 h% w
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! i: u4 x1 S% a; ]$ g$ nor execute SoftICE commands...
6 H" \4 p- I! i fIt is also used to crash SoftICE and to force it to execute any commands
}0 M: h c6 V/ a; U% r# Y' |1 ~ G! x(HBOOT...) :-(( ; t8 |, ~5 `* F
5 \! u* o$ Y3 K8 _Here is a quick description:
0 \3 u- A* Y, l% y; s$ D4 z-AX = 0910h (Display string in SIce windows)) f& d& I) } T' }) \. }
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ M3 Z1 Z/ S' \% U9 T$ g-AX = 0912h (Get breakpoint infos)' q3 q. w$ j" C+ ]3 u- t! O* e
-AX = 0913h (Set Sice breakpoints). ?1 c+ A1 f! t7 `
-AX = 0914h (Remove SIce breakoints)
6 B/ a" y: u4 }& u4 @) @
! y/ Y' b8 g# G/ o- h' U- e2 ]( P1 AEach time you'll meet this trick, you'll see:
1 Y# g) {! L; g \. ]-SI = 4647h
" }9 J6 O( H0 U. u-DI = 4A4Dh
5 @. U' D7 \8 L8 Z9 o$ V- CWhich are the 'magic values' used by SoftIce.
! }+ x+ C) a$ i( ^1 J* ^/ `9 eFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& M6 H1 X" \! M
0 X$ s3 o/ y, l" s, U" u* @
Here is one example from the file "Haspinst.exe" which is the dongle HASP
w, X5 R* z8 s2 h: U* \3 SEnvelope utility use to protect DOS applications:! b, u1 `& [: o
% b$ N& `) T8 I$ z' ]2 r, \3 c/ g( h- d9 J: o3 r
4C19:0095 MOV AX,0911 ; execute command., I3 y$ P0 `0 ]$ E
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 M; y& \: ?' U+ S7 R- l# C4C19:009A MOV SI,4647 ; 1st magic value.* ]+ ~9 k) F0 P. H- A
4C19:009D MOV DI,4A4D ; 2nd magic value.
+ M) c! S, _/ Q0 B% g" ]4 m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# H; H* A# v, m J4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute. D q8 d7 g# o+ f4 ]
4C19:00A4 INC CX
! A3 X5 Z9 T! c0 b# o( x& L. S( W l4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 ^: p1 g/ W( O
4C19:00A8 JB 0095 ; 6 different commands.
* N, e0 q! U) `1 }4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! i; a8 Z) f# ~3 E9 p( m! \+ p4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
! A% z% c6 Q# @% p9 @' F7 u- p
- E) `( K$ |' H. Z( ?, CThe program will execute 6 different SIce commands located at ds:dx, which% A7 T4 g( i1 N! g+ M3 O5 q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 G$ j. g/ F! ]1 }) @0 v1 w7 ~- K% @/ H
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! s# I4 u7 D+ b___________________________________________________________________________
% p9 W) M) F' d0 u! e4 X4 @# x' c& z0 [4 J
9 [$ \! A3 o3 mMethod 03% [% Z! m. Y D4 V
=========* I) O u2 y$ v* ]4 `
; D9 m" \5 q7 I1 a& t. d6 S* G6 @Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* p( C6 n2 H. I/ A% d2 ]; ?(API Get entry point), r3 f$ ?1 |4 l9 ?+ i
6 ~6 P7 S! J6 i3 q; J
R' j C; X$ R9 v: m3 } xor di,di! s0 \, r# W1 r2 ?9 D$ ~% q* v# Y- v
mov es,di. q/ e6 y# v9 W
mov ax, 1684h
- J# B7 F J" `1 s/ [1 v! V mov bx, 0202h ; VxD ID of winice
0 Y" u7 v- S# ] U" a/ S int 2Fh3 k/ v! {$ r% Q* B2 C
mov ax, es ; ES:DI -> VxD API entry point: y" l B# w" M) t# q
add ax, di
$ b1 u1 ^ e8 D1 ]1 F7 y2 R% H0 q test ax,ax
$ q* g! i: ]+ M. D- ?6 N0 o. P jnz SoftICE_Detected
: W& t- }6 r; a6 G8 ~9 }6 {! m1 s+ c' v B
___________________________________________________________________________
) w0 y0 ^ B+ [4 k) ]5 a8 y) f$ [0 ] S( M; ~) G, s1 P1 x
Method 04: a# ^, i: q6 j- `
=========7 ^1 S# j6 l( x% C4 f" e
" U$ a: ?% d9 O5 {8 h2 XMethod identical to the preceding one except that it seeks the ID of SoftICE" r: \- R2 G$ H7 n4 G$ {5 [, J
GFX VxD.
9 q; F+ M, ~- o" U
9 }2 N5 S" y8 ], u/ X6 K7 n5 M! C xor di,di
( M! @& p w; F5 U( F/ R mov es,di' h7 T: E: t+ H; u
mov ax, 1684h - Y4 l! m5 o, y1 w; [3 o5 S
mov bx, 7a5Fh ; VxD ID of SIWVID
# G3 X9 Z1 W" p5 Z+ a int 2fh' y6 Z3 X y, p+ |& q& D
mov ax, es ; ES:DI -> VxD API entry point2 e7 @7 F1 H* O
add ax, di
7 {- [3 [9 w) j9 n test ax,ax4 w0 Q& f) V$ E9 [. E8 m# s
jnz SoftICE_Detected
" x( s; \# n3 h, C
. `" {5 g' R G3 U0 c! S! ~! Y__________________________________________________________________________$ F# S7 D2 f }3 ?2 ?7 B" m: t* {
2 T, w" k2 O6 ]# _3 D9 ?$ D
( k$ \3 U2 e! x$ U, w& fMethod 05
8 x; T n' A7 I6 o' O=========* c+ u# m: O$ x* [2 z: E
% ?; I* A. I, X% HMethod seeking the 'magic number' 0F386h returned (in ax) by all system
, S. z; A% Y" X( Udebugger. It calls the int 41h, function 4Fh.
3 [: ?! m% [& k4 ?There are several alternatives. 7 B( f. G% o6 d& G' Z+ B
0 J4 _7 v+ O8 ~6 J
The following one is the simplest:
& \( c7 y5 H2 p- z" S1 J5 ]" u. k3 \! A% U5 J
mov ax,4fh
- h7 r" D% a* C/ S int 41h
2 m g) S5 h, V cmp ax, 0F386; X$ ]( y; h1 h: n" H% X* |
jz SoftICE_detected
0 e: G0 H N) k* Q; q/ e, \7 t1 u% p- x0 a7 F0 p
5 r! |) E0 M- I- ?( B) n3 m% ^Next method as well as the following one are 2 examples from Stone's
! G! w' Q" v; k, l, T"stn-wid.zip" (www.cracking.net):
' w7 W# v# F' X7 _1 b, j
+ b* Y! N! H+ D! u: n mov bx, cs
- c8 Y1 }# A! W0 F" ~( W lea dx, int41handler2
/ Z6 _3 ?1 V4 |4 m4 }% `, S xchg dx, es:[41h*4]. p3 v0 o2 b6 ^1 A
xchg bx, es:[41h*4+2]- O& z* w' {' f9 f5 l
mov ax,4fh
; k' }- u, s4 p8 k9 U% t- X, U* i* Z int 41h
4 G+ H2 ?) M2 a2 {. i! H. x xchg dx, es:[41h*4]7 x* V4 J" F( Q+ K# i
xchg bx, es:[41h*4+2]5 |+ @' y- `4 N& D/ }3 f6 T3 L" A) O
cmp ax, 0f386h, M: B# i- e% e. n
jz SoftICE_detected
7 ~2 R: T* y- }: Z! D1 h1 V
]$ m7 d4 T( f* X( ]- E& |$ cint41handler2 PROC5 _% N/ O4 T, Q8 c3 z9 E, d
iret5 s/ Q* E% T( _- ~& F# q3 ^ R6 V1 J
int41handler2 ENDP- C" g4 u+ J* \
) @5 ]9 H% `9 `* S) F3 A3 o3 d$ S3 Z0 E ^
_________________________________________________________________________: z5 i1 V. k# R; r
7 ?# W& E% v3 R4 O4 Q2 O2 p! R' x
/ k) J1 ^9 C! e2 ?: ~5 _Method 06& y! i( g. U) V# z4 v
=========
+ K A, I9 m1 c1 d4 M) Q" U) ~7 C/ i5 Z7 _$ Y: d
+ j3 o% H! \( z" Q2 f. T8 g8 y/ K2nd method similar to the preceding one but more difficult to detect:% e' ?0 H+ u5 o3 A; c
+ I5 R3 _+ o+ k9 m5 T- B" E
2 A N( I6 K! v2 {( g9 l5 Uint41handler PROC
; P4 h+ J. j5 J4 { mov cl,al
1 O/ p( v! N9 q% U iret
$ x' J h9 _# ]7 cint41handler ENDP, M! \$ L& M9 r3 r% F9 D2 L
4 m9 S7 U7 C8 R% D# S
1 Q8 q1 f2 Z4 r1 b( _
xor ax,ax/ z' n0 V0 Z* i. {( o
mov es,ax, j9 n x: l& N( s5 h
mov bx, cs; j7 f' Y) |) t: n' ^ l" {
lea dx, int41handler
4 A r" v- Z# U9 v& N5 D xchg dx, es:[41h*4]* o4 \7 W$ _/ u5 x
xchg bx, es:[41h*4+2]4 f$ n8 W/ V2 r* ~2 }1 C
in al, 40h
& {7 ^$ `# S- N xor cx,cx
& F: }, |% M# n L: C( k3 \/ g- e int 41h
+ y% s, I9 z5 f, X! B8 s; f xchg dx, es:[41h*4]
& ^( L5 ~$ P7 t0 |) q' a xchg bx, es:[41h*4+2]8 @# w2 r# [ r$ ^
cmp cl,al( I$ p* ]( q( _
jnz SoftICE_detected' A8 C3 B) [3 P
1 f7 S; h& I& H
_________________________________________________________________________
/ J6 Q% c3 l8 P$ f- U, o3 k. V) I. y8 a( _8 J4 M3 H3 U
Method 07
1 E3 w! B9 `/ V' p0 I9 m=========2 I2 u+ C5 _6 ]/ l3 p3 d6 s
) t, a. s' w, ~$ G1 {: z
Method of detection of the WinICE handler in the int68h (V86)
8 _$ g) [" f2 ~2 x' ?+ m, P7 v1 q( q7 B' y) V
mov ah,43h
6 z9 d$ ?7 i) Y; Z7 _ int 68h
- @/ C& ^5 H# j/ S6 B! A# g$ Q cmp ax,0F386h
4 Z# f/ d# W8 ~2 j2 ~, Q jz SoftICE_Detected
- m1 J; a* q7 R$ n; R& {
5 g% o6 _! _9 @3 n9 P& b
B+ Q! _3 P' D1 ^' l/ y, E& A=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, p0 ^5 d$ ?$ x! M( Z% W app like this:
' z, n7 l, a) ?- x6 f2 l( R8 B# U
1 C- E- R2 Q2 [ BPX exec_int if ax==68$ ^4 P0 {% g1 i5 R4 v' L
(function called is located at byte ptr [ebp+1Dh] and client eip is* [6 f) M+ [3 A- _0 Z4 X2 d
located at [ebp+48h] for 32Bit apps)
; w; \7 S$ \4 ?1 t__________________________________________________________________________
/ R( X4 A) f. A; v4 p" {$ b2 r$ _1 V8 B5 D9 U/ i3 L5 g% n5 o
" o7 R) ?- Z( L5 ?
Method 08
' _5 i0 e5 Q% B=========
: ^: m6 z* b& r4 {* N+ Y7 o0 }+ r: A0 ^& C1 ?9 P x
It is not a method of detection of SoftICE but a possibility to crash the0 h P6 f; w( S5 f; {- M# o( f
system by intercepting int 01h and int 03h and redirecting them to another
: a7 Q( {. T. L' t1 groutine.
4 B7 T, z0 T8 e0 K# R2 G$ j/ M6 xIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 p3 I( H# s" H* u& h9 f
to the new routine to execute (hangs computer...)
# S0 n$ g5 _1 B/ m0 C {- M( I
8 F3 x, i. ?6 |4 {! ] mov ah, 25h+ V, v' G5 y, ]& J% ^" ]! M. J
mov al, Int_Number (01h or 03h)
8 ~* c- s* n. d6 o- l. I8 Z$ K/ f mov dx, offset New_Int_Routine
5 P M6 {" m7 @% ]+ {9 H int 21h1 G* C: H" U4 i- n3 c% w( C
# l% D1 F" t. h. B9 z' t/ h5 ? J__________________________________________________________________________+ B( ^7 z! @% \# l* o8 S
8 e' U& F' m. H
Method 09
3 K1 [+ P* w1 Z=========* Z& V. Y* y. n7 p& ~* V/ i9 W
4 \, ]& P* J4 N6 V; F
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ }* J2 L! ^6 b0 C- h9 jperformed in ring0 (VxD or a ring3 app using the VxdCall).
! \# B% s/ g1 \) G7 n/ hThe Get_DDB service is used to determine whether or not a VxD is installed
; b6 b( W0 w' A5 Q4 U$ ifor the specified device and returns a Device Description Block (in ecx) for6 ], }5 M1 I$ G3 j5 l- |; R
that device if it is installed./ {6 [- O( F+ {! z
7 R, o4 m- l# v+ X mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ I$ G# z( K7 \' \ B2 [ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( X% N( [4 r8 e
VMMCall Get_DDB
! N$ O( _0 t" w1 E- S mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& T2 O& L& z4 Z' E
8 @) H& G( s r5 h! uNote as well that you can easily detect this method with SoftICE:5 I1 v3 q1 |6 u* V0 p4 K* l4 J
bpx Get_DDB if ax==0202 || ax==7a5fh
/ T* E6 u- g: h- n9 l, c; W; j; J5 t8 W: w
__________________________________________________________________________9 K( R0 ?/ ~" g5 {$ M
) R. A+ F* x2 [7 OMethod 10
2 {! N h) r9 `: }9 o3 R# N9 y" N=========5 j( b) p. x! R* j( z
# X* T2 C: s7 i( q2 u4 @7 s
=>Disable or clear breakpoints before using this feature. DO NOT trace with
_; L' Z7 M3 U8 q1 X SoftICE while the option is enable!!
- f' C5 i4 u- e+ n) x3 ^8 h$ S, y/ J* u5 l; N
This trick is very efficient:; @5 o; X- j% b
by checking the Debug Registers, you can detect if SoftICE is loaded* i. r* F' ]7 X& K# e
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. @9 B, i# o! Q* V
there are some memory breakpoints set (dr0 to dr3) simply by reading their
5 m: r( \! @2 f( P& L8 P% Hvalue (in ring0 only). Values can be manipulated and or changed as well
! T$ @: K. I9 S: B/ h(clearing BPMs for instance)
3 z( h# `+ z' J0 ]% L0 u% o- t2 D% F0 v7 `, o @3 }0 h
__________________________________________________________________________
3 N5 A( u* F8 n# ?* C. j/ O6 F7 v: q ^6 S1 d* @
Method 11- v. J& v4 _# h* C
=========. Q. H( h5 V+ X; [8 w7 l
* Y# m `8 D4 Q
This method is most known as 'MeltICE' because it has been freely distributed! [8 T0 Q/ t" L9 _2 @- W
via www.winfiles.com. However it was first used by NuMega people to allow3 w9 B6 a* D# j" |
Symbol Loader to check if SoftICE was active or not (the code is located
! | g" \0 _5 R% y/ ?- @- p( ~inside nmtrans.dll).
! k( s* ]7 m F; o. t, I; Z
. Q9 Z; h1 }1 u* W PThe way it works is very simple:+ |( ~" @4 q' _! N0 e; t1 ]
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ m9 ?% Z7 `+ i; R9 G7 q
WinNT) with the CreateFileA API./ ]& `+ N+ w9 H7 v) d& S9 i: L
4 T% v8 {. [6 r2 s B8 b4 OHere is a sample (checking for 'SICE'):
4 `" B. d L& a2 L3 _# Z/ Y& C" U, t( x4 |8 |2 z
BOOL IsSoftIce95Loaded()
) Z4 x2 }' z. A" B9 g' ?% z{6 t7 g/ Z, X( m9 Q1 H' F
HANDLE hFile;
3 v% R" O1 w" ]- w( o. V" n; G" t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( Q! w* A/ ~9 L: j- [4 g: f$ K- i! k) x
FILE_SHARE_READ | FILE_SHARE_WRITE,
! r; v/ ~* z; N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, X% J1 m9 T- ?% C+ H
if( hFile != INVALID_HANDLE_VALUE )/ A4 e r3 B8 X# a- r+ Z6 f J& L
{ i* X- {2 l8 K, N9 t( |) ^
CloseHandle(hFile);6 B5 h% j) F5 g0 w" V, D
return TRUE;2 g4 c* |7 x7 n1 x* ]+ e5 j' n# Y0 [
}9 p. x: j3 J# F; |9 y p8 {
return FALSE;$ U; s1 k1 V6 N/ y
}
, l& V/ U3 h+ x+ r) F6 i9 x2 G( e: g
Although this trick calls the CreateFileA function, don't even expect to be* V# O/ |) g0 D7 J" n: G L
able to intercept it by installing a IFS hook: it will not work, no way!% G; {/ X# G9 d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 a: Y( E- t/ N8 T* fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 V# u7 }- w. |1 O: m5 K" m i
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 w0 ]$ O8 i4 m, i: \field. S3 k# W; K- a) l! C; q
In fact, its purpose is not to load/unload VxDs but only to send a
# M/ t! ~* Y9 O, A1 AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' A0 u6 H, {4 ~+ o$ Qto the VxD Control_Dispatch proc (how the hell a shareware soft could try
, F( j4 N( g1 d( m, Z8 vto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& |4 S( Y3 i. w6 R! u( cIf the VxD is loaded, it will always clear eax and the Carry flag to allow
S- V2 Y& I; i3 @1 }* Iits handle to be opened and then, will be detected.5 O$ ?: `! A+ T5 l' g
You can check that simply by hooking Winice.exe control proc entry point
5 @2 ^. ~; L; V) Ywhile running MeltICE.1 y3 ~0 n( }* E, ?& t
{: R! U$ F+ b( Z# T0 Z
1 }! V8 t1 g2 J) j; c- w" B* q; M
00401067: push 00402025 ; \\.\SICE. T. o% }& \, O* o
0040106C: call CreateFileA
7 x! A6 b% ?2 n/ }' [ 00401071: cmp eax,-0019 X4 D. P8 b0 W$ ?% G& r' ?
00401074: je 00401091
' [7 L w9 c$ k1 O4 X+ V( s+ l1 M% N
# u9 c9 D) z$ \. l
There could be hundreds of BPX you could use to detect this trick.
- G- V/ {6 T& t0 s-The most classical one is:
$ C% T5 d; J' J8 d9 \* F7 Q' \ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! {) Y) X+ t; D8 `1 ? h *(esp->4+4)=='NTIC' l: ]1 }( g% m
) A, Z. p* q7 Y/ _8 Q0 Y4 e& Y-The most exotic ones (could be very slooooow :-(+ c( U' p9 |- e# {. j
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! G6 |) R( ^6 z/ A" Y7 d. X6 @- ~ ;will break 3 times :-(
4 ]5 Z( s. R7 ]; o
2 X3 u% w8 t0 y1 j) E$ a-or (a bit) faster: - |0 E4 V7 ]4 G* ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 ~7 L( m; B% D e! O
# R" m0 H- t1 C5 J; I- ?, Z z
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) I0 y: |. k4 ]% E2 u) [3 ^ ;will break 3 times :-(
' N, z# o B. h" }" e+ ?1 v3 L; t; c0 |5 k4 i8 S, N; G
-Much faster:+ ~" X' z4 E( u, _
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! F4 @' [( u' r) b! n2 q) E
8 E5 |# }5 i* s: ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ g1 f! W7 O# p9 A- X: ]1 V/ Ofunction to do the same job:
" U# ~" B6 b6 ~9 |2 Q
* q( `* m% x9 v. q- L push 00 ; OF_READ4 L- K3 Y' W0 r. Z7 f. B
mov eax,[00656634] ; '\\.\SICE',0
" N. }# h( u0 j$ i3 z( W# F push eax3 ?! C, Y) G2 W
call KERNEL32!_lopen
2 `. n2 j7 m; L# l$ S6 I/ ` inc eax
# m1 \0 T( o9 d; n jnz 00650589 ; detected
, p3 m! D# _8 ]8 k+ } push 00 ; OF_READ9 w* p, A. w5 ]" F, R6 Y& a
mov eax,[00656638] ; '\\.\SICE'' o! k0 @, @6 @- s) R3 ^5 j" {
push eax
7 W$ |; k1 m+ B6 b5 I" n call KERNEL32!_lopen+ s9 c x" A* o6 u3 R
inc eax
- U8 d% u# n9 q% [ jz 006505ae ; not detected3 u6 @) ?+ A8 ~6 ^# L5 d. R
: {1 R7 K) d9 ?) f8 N- e( ` Q6 @& ~
__________________________________________________________________________0 h/ U, ^1 l7 X( W) I% J; m
$ W/ L B5 g$ ~" NMethod 128 ^! T8 y! t" C/ E* i
=========
7 ^) q. @% D5 D6 A2 V" |, F3 x1 W0 E- ~0 w% t: C X& L
This trick is similar to int41h/4fh Debugger installation check (code 059 e. I5 M( ]+ a+ r9 D6 @8 r* m
& 06) but very limited because it's only available for Win95/98 (not NT)
$ y; G; f! ?. y; k8 Z" das it uses the VxDCall backdoor. This detection was found in Bleem Demo.( a9 m3 l2 \! g6 M
" I$ A$ X( I! ` push 0000004fh ; function 4fh
! B; H6 P9 G! d push 002a002ah ; high word specifies which VxD (VWIN32)
* D0 v8 H9 @# K3 r. `2 E9 C c) u ; low word specifies which service) o+ C+ z# b4 X6 M3 ^( {5 n
(VWIN32_Int41Dispatch)
- ~9 i( r; X* `- K/ C0 F" @0 _9 I call Kernel32!ORD_001 ; VxdCall) z3 a' u! B9 m, y& l" E7 {8 }% D
cmp ax, 0f386h ; magic number returned by system debuggers/ D8 m* a" R+ }' s5 O* ?) `% X
jz SoftICE_detected, q+ v2 e5 X9 e: U
3 {+ o) \' B# s; w* g
Here again, several ways to detect it:
# }2 b! A5 h* Q9 i, D. V2 V% N* ]! w$ B6 H3 h( p; ^. k
BPINT 41 if ax==4f
1 n0 A' `, H e* p& A# j. C
+ N: l0 v; o3 F. d# G& j. W6 i BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ `; G4 E! q1 \0 ?8 F* C) ?8 Z% U6 F, r) h9 E" t6 C- o; `, c
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ m7 j4 l2 I& k6 r
4 Z3 n/ U# x7 c+ s& `3 W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ @& r7 d; d; m. Y. t. S1 g% K6 Z4 n# m4 m7 x
__________________________________________________________________________! @- P7 j p& z7 K' V
( h/ }, C5 m f7 l
Method 130 S- D" U! I" ~
=========, L" ?; i' A! Z6 Z
5 j3 ?+ }( A9 t$ S. d3 E: tNot a real method of detection, but a good way to know if SoftICE is
3 |$ c+ p: F# A! B4 kinstalled on a computer and to locate its installation directory." l! k# _( Z- F! |5 B2 d
It is used by few softs which access the following registry keys (usually #2) :
5 c! u' k# m" G, X* e- v
9 U3 N+ E( d; a- o-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" A" f: h! i# q+ z# p6 Q/ G% v+ Z4 Y\Uninstall\SoftICE) _4 M$ f6 O% L+ g1 F( T% i; Q0 O4 |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 ]; V# y1 O9 R' o n/ c-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: A: v: b4 D; M' I, m) x: X
\App Paths\Loader32.Exe! Z4 C7 x- J2 E$ n# T" ~% _
0 r) z4 G" s N, Q* ]
& p( ?- l! ]# h6 n# ?5 k( n2 FNote that some nasty apps could then erase all files from SoftICE directory p J* u7 m1 S
(I faced that once :-(8 `- {2 s ?5 Z
( X( `0 o- h* g/ I5 |& k1 ~
Useful breakpoint to detect it:8 _/ ]; N' b! ~" Z% t: a
3 `1 r; v/ y: ^2 S. B9 o- d BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ j( b6 [9 G# |" e b) ~# e' m
& y- M* b. x$ U8 l( J
__________________________________________________________________________+ O+ |0 F8 N' i% ?; d+ e
& q$ ?# g0 v* M$ Q! O0 P
; m1 i G* l3 o/ `7 n3 [0 @" M" tMethod 14 + p5 D; i6 S* |) |$ U8 [' U
=========
! h( B8 O4 B5 K+ c( [
* E; Q# `) J# P" y' f5 j% NA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 V! T9 ]+ @6 n+ a# p
is to determines whether a debugger is running on your system (ring0 only).
* x9 o% s% K$ A' Y& Z& v$ A- ]: c+ W7 T" L0 Z) X/ y2 T
VMMCall Test_Debug_Installed
+ K# a' n& M2 P je not_installed
$ Y+ B$ r% M( ?& k; H: T
. B/ Z- {( S k; wThis service just checks a flag.3 j9 d& Q% Y7 o! _ T1 _
</PRE></TD></TR></TBODY></TABLE> |