<TABLE width=500>
% i* i* ^& u: ~9 J+ Q% v* V<TBODY># A- G$ Z# |; x2 e4 ~1 J* L
<TR>
: l$ ]7 t7 p6 `) q$ m$ _<TD><PRE>Method 01 5 E. r$ A) q( m' @, [
========= u4 A4 Y& T( ^5 x1 x, Z; F6 @$ Q% y
$ X, q0 `" u. {
This method of detection of SoftICE (as well as the following one) is
3 f4 R( r4 H! ~! g8 x. Rused by the majority of packers/encryptors found on Internet.
& D4 F: E8 u! Q" n6 o7 VIt seeks the signature of BoundsChecker in SoftICE
0 d2 C' q' l! k4 ^3 |5 \9 h; e# y+ }$ [7 B/ W
mov ebp, 04243484Bh ; 'BCHK'
, V) l+ ]. \ Q8 o, d6 i mov ax, 04h2 d3 X. s7 k+ T5 m( \$ w- C' Q
int 3
6 e9 R: x- j7 g3 m8 b6 q. B) y! q cmp al,4. O. `7 b. Q5 a
jnz SoftICE_Detected; ~" M2 |2 j9 N& t& v6 I
9 D: }% H1 `+ ^: o___________________________________________________________________________) r; _: x" m$ y1 P
( r7 X! {+ U# i
Method 02
4 n7 x. N+ i ?: ^9 @& f=========
: \: G3 F6 I6 A- C, C, u: O
4 x4 W2 k; S8 c" GStill a method very much used (perhaps the most frequent one). It is used) ~" Y% Y' h$ N7 Y$ j( _0 w6 Y% h
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
K$ t$ _1 d7 `, h4 ?- ]- Uor execute SoftICE commands...
% s4 @. y. e2 S( a) @# ]9 mIt is also used to crash SoftICE and to force it to execute any commands. q# V0 p# o8 t2 k2 \$ m- Q+ t4 n
(HBOOT...) :-(( 6 y& l. k6 o* Z5 P2 {6 K# A
2 I$ U% p. M9 A& O! N/ f6 S$ S: F
Here is a quick description:, X- G9 e; a+ Y9 E5 ^
-AX = 0910h (Display string in SIce windows)
* x7 f- z2 j3 [8 Y) R: l2 \-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 O7 o7 ~: C! y! [; v5 ^
-AX = 0912h (Get breakpoint infos)0 R; t% O) _- _' A! A' N
-AX = 0913h (Set Sice breakpoints)
% N6 } `7 O) N( B4 }- ~5 w' Y( H- X-AX = 0914h (Remove SIce breakoints)0 ~3 Z8 H6 W! t+ {- F0 B$ u
. Y1 N, e: h7 |+ D3 i$ z* d
Each time you'll meet this trick, you'll see:. m/ t; j5 z3 @% n
-SI = 4647h$ [ q4 x5 f) {$ E/ s1 Q
-DI = 4A4Dh; X/ F8 [% }6 _# K; |: x
Which are the 'magic values' used by SoftIce.3 {, D+ q- \$ z7 z2 t7 v" c4 W
For more informations, see "Ralf Brown Interrupt list" chapter int 03h. F) p5 Q! F }( R9 k
l f* H$ ^ U/ X0 [( K9 [Here is one example from the file "Haspinst.exe" which is the dongle HASP( y' _) g( f% j/ F" g
Envelope utility use to protect DOS applications:
1 s( l: Y' D" J( U6 i9 j4 m6 R0 O. x4 t: d" Y# L, M
6 a, i4 G! d. m4 d) @
4C19:0095 MOV AX,0911 ; execute command.
3 ^' D1 C1 c2 T, B6 L0 t4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." G n n% X$ m6 C* x2 G( P+ P
4C19:009A MOV SI,4647 ; 1st magic value.
5 F/ g2 t% {' c4C19:009D MOV DI,4A4D ; 2nd magic value.
9 {, z0 }7 K7 ?# a* g$ w1 d# ]4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)5 j1 [" T4 X% K' P- s; |4 H
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute ]9 N+ o# e& o- j" c/ z, j" f t
4C19:00A4 INC CX4 B" A5 }9 c& Z7 l5 Q. Y. N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' D4 ?3 G) M6 _, b, T4C19:00A8 JB 0095 ; 6 different commands.% l2 W0 |- v( w; m+ ^+ T
4C19:00AA JMP 0002 ; Bad_Guy jmp back.4 I0 \# r7 J* x6 R% c. p- k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" J- C& s3 T+ H% A9 K
& m; ^* y/ F( KThe program will execute 6 different SIce commands located at ds:dx, which
' [' _- A8 d! g3 q B; nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& N' V# Z: h, S, ]' `! {: U. e0 W. v+ x7 U. ?3 H3 c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 g; ~5 t& u8 n% v" c" j___________________________________________________________________________% C% O& U! \1 H0 J5 p+ ]
3 P) s; h" u( E# | K x/ L
M; E. ^8 p z! fMethod 03
! G! W# P* O6 q# |+ [=========+ O$ P/ l) @8 j1 y2 o
, G6 ]0 I' g; Z$ e: P% Q3 G
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 Z/ F* @; r3 K(API Get entry point)9 t! b5 o8 ~: {2 `
/ e. n+ J+ e) D) x: S: g0 y
, ]& J0 t+ o! F xor di,di2 H, h0 [, f5 L: R
mov es,di
) I% R; [& y/ N: d8 U4 E. B mov ax, 1684h 3 D# t( d- u- @7 q$ O
mov bx, 0202h ; VxD ID of winice
6 f" O2 a& ^% h4 a int 2Fh
/ g" k# L& } {# B mov ax, es ; ES:DI -> VxD API entry point
, e; g6 N+ V( p2 J, B add ax, di3 U+ J- |: F. a& @; ?7 d( {7 q
test ax,ax- H. y* g- U1 ^# V
jnz SoftICE_Detected
4 [; ?6 X) C% K- J d) E5 I; |' K* J9 A9 U- z. H
___________________________________________________________________________2 i T/ ^* a* [
& v0 O% M; P9 o8 ]
Method 044 \* _1 H- S, r
========= _ e* \* V& t
9 O5 h! q3 K8 Z- G' ?Method identical to the preceding one except that it seeks the ID of SoftICE
! Y) z ~8 ~ AGFX VxD.- Q% L( b$ d: \. U8 w
! M9 Z0 c( p3 h! B/ l
xor di,di$ ?2 f% ~* q# l" z# c2 n/ }
mov es,di
) Y/ ~9 L) |. t* o6 c mov ax, 1684h
* _+ l/ u1 W1 G mov bx, 7a5Fh ; VxD ID of SIWVID
) Q! l# t( Y0 f5 N p7 E3 T int 2fh% U4 ~, H" p, P6 W4 X# k
mov ax, es ; ES:DI -> VxD API entry point
6 V4 n$ W+ J# E t& i8 i( V- z add ax, di n* i- i, m A; ?: X
test ax,ax! @5 I+ x' }# x1 I& R k+ R
jnz SoftICE_Detected
; u, i7 _: @( {; o& ~4 v/ a
6 u5 l& n7 A' |. H J1 b__________________________________________________________________________3 t% J: g5 y( X7 h- `& U$ r( J0 T& J1 z
, }! ?% H' q( p* H; v5 G y( j
0 _- Q/ N8 M5 [1 b A' n4 RMethod 05
! U `- q1 x+ r=========
3 w( g0 k( q( `8 L" `$ x
z! |9 c% \# F+ ]8 u( O% RMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 Z4 A1 h4 P; |1 B; x0 g" vdebugger. It calls the int 41h, function 4Fh.
) o7 ]8 N0 ~3 L* Y' ?There are several alternatives.
/ H9 I: Z: v+ H4 Z0 N4 T8 i0 S5 j
The following one is the simplest:
7 {- b9 u* p. t8 P H4 P. L% Y. W6 H/ t2 u& t3 N$ s
mov ax,4fh# W0 @" U+ S; w7 x8 H5 l% e
int 41h
4 O; [/ V' i3 e. ~3 G cmp ax, 0F386# S8 r/ Z e) y! X
jz SoftICE_detected! y- g; D+ [+ F: w6 h
! V# Z) W6 M z* {$ ~7 A0 a
: r' I4 l- ~; z5 a: i5 i9 y# B
Next method as well as the following one are 2 examples from Stone's
% M a& G- _7 q# N# G"stn-wid.zip" (www.cracking.net):. a- h0 q: i. R
" c! G: p3 C7 i; |7 a
mov bx, cs
: D& ]! W" c& _# L R, ? lea dx, int41handler2
9 @% p) k" K7 Y" [9 k xchg dx, es:[41h*4]
, Z7 V0 |- }8 ?8 y xchg bx, es:[41h*4+2]
# d9 s. e* r0 D4 J3 O5 y6 V+ { mov ax,4fh
4 t h2 W) [6 I/ h2 X. H! t int 41h3 A5 Z3 ]' ]8 h( x
xchg dx, es:[41h*4]: ^7 V: v3 t, u* s$ w0 f
xchg bx, es:[41h*4+2]
4 G w- i. p$ Y' q8 D cmp ax, 0f386h# K7 Q6 G1 ^$ Q: ]. k% _. h! t
jz SoftICE_detected- e! E1 x: t# {, s9 m( P
3 j: g j. D0 M; Q6 u! |" j) }9 Xint41handler2 PROC( R8 s# p# A+ }9 c
iret' q+ Z) Y' v. U# ]# x- H$ n3 E
int41handler2 ENDP6 Z+ G% u {( ^* t N9 W
8 |/ r- p( L/ d; y$ M- o( A
# ^! Y5 m& _3 J4 U) m1 H( X) f) P1 Q. t
_________________________________________________________________________; A' @8 [/ ^$ W1 ^2 c. W5 T
- p/ Q& m7 ?$ K8 z. K, `! q* Y/ ~, J* _7 P7 a
Method 06
5 `$ m% @( {* X% i" i9 X+ [=========
( K) q7 r3 M- M
2 Z0 ^2 e( ]# }0 N2 z: M6 p
2 }6 R5 h% r& }2nd method similar to the preceding one but more difficult to detect:
* G% h, p/ A) L1 z4 P$ }( B: a9 ~
% V. m. z: x/ E/ M$ M0 g
0 }% L4 u5 ~) I$ @/ E7 _int41handler PROC) A3 h; e: `* t4 O
mov cl,al& E: y7 B: D9 O( h
iret
8 I# i- ]8 |1 E% s- R2 p5 ~: V0 l yint41handler ENDP4 @& ^; ]4 O& j" e+ A" `- B: w
% D2 c3 s/ V1 q0 Z0 r: W9 R
1 y% b) ?$ ?; Y9 y5 J
xor ax,ax
- z! {, f( \: p' _ mov es,ax; c* x$ h: E; ?% |+ m' X
mov bx, cs
1 s; f) o, h+ K, B; r' Y% | lea dx, int41handler. |- _/ y) C% m; a. n
xchg dx, es:[41h*4]
, I0 n8 J; O# g p) B( Z; o0 p: E4 J xchg bx, es:[41h*4+2]6 o7 B" }8 [1 g, L. ~& q. v3 a
in al, 40h
, \( ?( ?0 v# s8 P" ^6 w xor cx,cx
3 d; h( U4 b$ E; X2 ]; b; ~% u int 41h1 V0 u& p6 i9 s3 G5 f% m4 s
xchg dx, es:[41h*4]
; E- l6 A. N0 r P2 x4 N$ s xchg bx, es:[41h*4+2]
0 U) s# m- Q- z% b' E9 m4 i5 Q cmp cl,al6 v, U* X; t# \( |4 `2 i$ }: |
jnz SoftICE_detected
`2 {+ G H0 u6 L
- ?3 u/ J5 E2 k_________________________________________________________________________
% f5 y7 S! G! C6 i0 y6 w4 m- C( X
Method 078 J& m8 z# \/ N" {
=========5 E; x' ?! [+ }# c% M
& P" z7 j; _7 W
Method of detection of the WinICE handler in the int68h (V86)
) U& p( O0 V. m$ U7 k# a/ Z
) U: J* i% u0 o" F8 M mov ah,43h! S' ^3 ~3 O: _7 R- I/ n
int 68h/ n) P) v/ @2 B' |: g& H
cmp ax,0F386h
0 Q! |; T( |3 m2 z jz SoftICE_Detected
3 B+ k9 e& R# _9 e5 w Y0 w- C6 M+ k U$ _
2 x T& S& m; {9 W9 o! x0 M=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
' a; f5 {: z- d app like this:6 Y7 z4 P$ i4 F: C; k" F
- Q" n5 S* y" [/ Q BPX exec_int if ax==68
% c& t) M6 l r+ B+ e4 w4 ] (function called is located at byte ptr [ebp+1Dh] and client eip is+ v! ~! E7 m5 ~! |$ U! j
located at [ebp+48h] for 32Bit apps)) o/ \1 w, w! W
__________________________________________________________________________' ? z" H/ J$ y6 J* l8 q
) I$ o; O1 w& d' ?+ _! a& b2 ]+ s4 h& ]
Method 087 e$ [1 H) {- l
=========
! h* k! ^5 d' V0 g. z9 K, N
* K, K1 j( }' K- KIt is not a method of detection of SoftICE but a possibility to crash the
" S9 l$ {- G) s6 C% @! M* _/ M$ k) Z6 g' {system by intercepting int 01h and int 03h and redirecting them to another0 \7 J& E$ h- T& e& Y# B" ]
routine.
8 ~& S' |4 p) z# p% ZIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 X% b5 F# k4 ?' G( M& Rto the new routine to execute (hangs computer...)
8 ~0 b$ D4 F4 Y! R8 Y" I' l+ Y) Q: ^/ G2 F
mov ah, 25h/ v3 y$ Q4 F0 L' W$ T! E7 U
mov al, Int_Number (01h or 03h)
6 p* X7 Q6 U6 Q1 T5 V4 J$ Q9 E mov dx, offset New_Int_Routine& C! Q! t% z n7 V+ Q3 Y
int 21h. g+ ?2 B% u$ X& G
/ t( ?4 a1 ~* o, `+ t__________________________________________________________________________
& o& I. I4 h( J/ L! o3 ]. r% {4 _0 B9 p# X$ s
Method 09
4 b" K/ {* c: c6 _=========1 C7 |+ m/ @: O
: w$ d1 {2 l3 z+ [+ sThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& V9 T1 K, R5 f2 o0 {. q* t3 C ], [. e; l
performed in ring0 (VxD or a ring3 app using the VxdCall)., m0 n- ?6 K# x }
The Get_DDB service is used to determine whether or not a VxD is installed
: G, U: B' R, c0 V2 Bfor the specified device and returns a Device Description Block (in ecx) for8 c( F3 g; M4 ]/ t2 b R
that device if it is installed.$ d( I) j: d. Q+ y/ P
8 y7 ]9 Y# W' t$ v% r1 }& o
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; T" ?- |( i6 B- Z! T, o, T mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% l$ ^) p3 [6 W3 S1 j VMMCall Get_DDB3 t# _0 R9 q- v( ]: c+ o8 w5 X
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, u: l6 T- T$ M7 F# M) }, k6 x( W4 g( I% @: O$ }7 L- `
Note as well that you can easily detect this method with SoftICE:
9 {& P0 N8 }- |1 f, L bpx Get_DDB if ax==0202 || ax==7a5fh
7 [6 x) S. n# v
) e' A9 e! a/ p- a2 Q$ c__________________________________________________________________________* H$ h }3 d$ T, s! z8 X" n
0 b( W, U$ ?' _9 M3 Q* o% Y8 YMethod 10/ ?$ ~1 I( n% J a8 t: z: p6 O
=========- a) N y% W7 T. E
3 r7 l( V+ ?, A: B! ^=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ d0 F! K4 W& V }* E" }/ I SoftICE while the option is enable!!
( }- b4 L& S# r& n2 Y, t
" P8 w' N8 x' R) d+ k) HThis trick is very efficient:" [4 U6 f' g" e# @
by checking the Debug Registers, you can detect if SoftICE is loaded$ Y) W& I. k* ~, F! [0 S @
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. J* U9 X' F5 T J- S4 H2 N
there are some memory breakpoints set (dr0 to dr3) simply by reading their
& u: V: G: e& H& {3 J* D0 o! j2 |value (in ring0 only). Values can be manipulated and or changed as well
9 M; o/ w5 x3 [(clearing BPMs for instance)
% m' u K) j* h3 @+ X" k4 T% K- b% I$ S
__________________________________________________________________________. ^; {6 M! \6 \" F
. U1 i, J; |8 V+ C& K8 HMethod 11
9 `) U1 f, ?) s9 l=========" f4 P# {7 f" V& [! K
& u* I0 i' n, @6 h1 C1 Y9 F, F( l7 R0 j
This method is most known as 'MeltICE' because it has been freely distributed; L" J0 d6 z+ h( \5 J' z
via www.winfiles.com. However it was first used by NuMega people to allow# C3 z# i5 p7 ^
Symbol Loader to check if SoftICE was active or not (the code is located
2 r7 d! P& i K( Cinside nmtrans.dll).( j+ Q( z1 U8 f6 }& t ~* `
: r: a: p6 D4 z# p+ H6 W# g
The way it works is very simple:9 s! t9 E, r/ o; r9 i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 }1 _, ~5 z9 t6 N, c$ EWinNT) with the CreateFileA API.
3 k# X- S4 h: A$ |( T5 ]8 f! L
) m0 V+ H2 a3 R0 r! @: K0 gHere is a sample (checking for 'SICE'):
' r7 \% Y4 w0 _7 q
; [ ]( E5 @' k2 p) l2 ?/ R6 bBOOL IsSoftIce95Loaded()0 J% u" `/ l3 X3 H
{
4 `+ m% X7 [9 \: r2 o/ D# t4 H HANDLE hFile; 5 P1 E* H9 H* p( D
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, H' f' k0 i) Y4 F* D
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 `6 w9 J5 v d NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ j/ _ E+ e( ?% p2 C
if( hFile != INVALID_HANDLE_VALUE )
8 _1 W& q+ @7 M& i# L9 K& f9 x {
. z. ?+ V9 r! H: [; S X CloseHandle(hFile);" R Z4 }1 {& j* I
return TRUE;
) `* V2 c5 C6 j1 [& d! u( T }4 A: l5 e. R% n6 ~# ^
return FALSE;* P' ?0 F& u4 k2 l( b
}( b; ~% M8 r8 f, M' N, F
C# O% V: N& k1 K1 y3 |5 I) L: WAlthough this trick calls the CreateFileA function, don't even expect to be, g) w" ]: [: ~' N G4 D
able to intercept it by installing a IFS hook: it will not work, no way!
; A; ^4 N: M0 [; w; v9 PIn fact, after the call to CreateFileA it will get through VWIN32 0x001F$ i2 y/ ?$ f. J& N9 T
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function) @: i2 j# z- h
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) T# |, i) v" ~( G, ofield.% @8 s2 F4 m% j% {. \- Y. Z
In fact, its purpose is not to load/unload VxDs but only to send a 5 D3 c2 Z% a: v) E. h. t6 i5 _
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 G O* }4 f* r) m7 F; ]
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( o6 ^/ J o0 f+ Hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
' K7 O: ~# a- V9 I xIf the VxD is loaded, it will always clear eax and the Carry flag to allow
) V3 u6 ^9 Y: a9 v5 Q' jits handle to be opened and then, will be detected.: Z) m9 z/ Q# b- ?' j& D0 O: _, S5 d
You can check that simply by hooking Winice.exe control proc entry point
! A: y" e. g* H* E& x" V1 n7 twhile running MeltICE.
* y% r) H1 P. Y
4 T% P7 J) H# t. n" l' q' _- p7 {
00401067: push 00402025 ; \\.\SICE6 F" M$ |# v, V" w2 H* ~4 c% P
0040106C: call CreateFileA* e9 u w7 h& U, g U
00401071: cmp eax,-001( P6 h# b) Y( i5 ]
00401074: je 004010912 @8 Z1 @' b2 O( @7 D: Z! Y
. a. K. x E/ S; |& y4 f* y
' b- b! }, V; H: Z
There could be hundreds of BPX you could use to detect this trick.: `/ b# G8 ~$ ?3 R7 x
-The most classical one is:
. Z4 z8 M! {2 Y/ M3 \# z7 p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 H4 m3 I2 k9 }$ v6 H4 y *(esp->4+4)=='NTIC'
$ F! L4 Z$ i9 u/ L- F2 c5 V; c7 S0 H7 D- [3 m. H9 T* ]$ o- a
-The most exotic ones (could be very slooooow :-(4 n. Y& x0 I6 }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% I) @' |8 P+ l8 O! ~% C; m) c& }" q: C ;will break 3 times :-(" m( Z7 H+ x7 x0 ]- O
* [8 ?6 y$ t9 H$ `3 n% L-or (a bit) faster:
# U' T% F. S6 H( T- ?. Y5 @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 q1 |+ f3 Y' S* T4 q
$ p7 B3 m' W" J5 q( }; k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' , A' z5 X, P) M6 U. o6 Y4 W
;will break 3 times :-(
1 Y: ?* v; t* G0 h1 ?" w% q/ Z& b w1 M' y# ~( |
-Much faster:0 X! m1 S/ f$ Q/ b
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 S# y+ n5 J; e/ `- ?# C8 |
/ l9 X, z4 Q4 ?# z" Y+ m, e7 mNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# u7 c0 v- i: Z$ U: D
function to do the same job:& V, v: c! A6 z6 n8 Q$ p
5 o$ L$ p0 Q0 D+ K) W% ]- u4 j
push 00 ; OF_READ& W" D( h3 y) n
mov eax,[00656634] ; '\\.\SICE',0, R) E+ {" j% j( A9 d6 k
push eax$ Q& [7 b2 D% P& c
call KERNEL32!_lopen$ f f/ a6 |. Z/ E* j$ { c Y9 l
inc eax8 d( X& M: b2 U$ M, t
jnz 00650589 ; detected$ _- S# C, W. ^3 \
push 00 ; OF_READ# h! k6 d, V& Z2 g
mov eax,[00656638] ; '\\.\SICE'
7 U) |$ E4 j* N) m P; E, | push eax# j6 I3 u0 T' D9 N( b
call KERNEL32!_lopen+ W, t/ O; z( ?4 f
inc eax" {/ K# {" X- n
jz 006505ae ; not detected6 [) X; i5 z' T+ s$ X# `( k [5 r
7 [/ G" Z9 t' o4 G
) r7 O$ }+ V3 R/ ]+ ]% E" J__________________________________________________________________________' Z/ y; s* V! \1 E( v
) E* d! b& ~9 bMethod 122 `) j3 o% Z' A. g
=========
# x/ A$ b b$ _5 k0 I: z9 Q$ E
* `/ ^+ a! ^, K: \; r2 d; sThis trick is similar to int41h/4fh Debugger installation check (code 05
9 g9 b4 n# P8 t& 06) but very limited because it's only available for Win95/98 (not NT)6 |4 S. [. \' A9 k8 C1 \
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.) W2 @. g6 h0 L& H% _6 \
+ m& ^: O# w$ r* C7 {$ {4 B+ S push 0000004fh ; function 4fh
/ ~* {8 ]' E8 c9 Y D$ G5 u, O push 002a002ah ; high word specifies which VxD (VWIN32)/ q7 }1 @6 C% ]) t" g/ X: K8 P
; low word specifies which service: i& g8 B+ h3 P
(VWIN32_Int41Dispatch)
* o. i" a( ? K) ? call Kernel32!ORD_001 ; VxdCall8 d2 k6 |; E! L; v9 F9 I% N
cmp ax, 0f386h ; magic number returned by system debuggers8 s, H2 ~8 C/ z2 l/ q
jz SoftICE_detected+ ~8 @0 n4 s# j# @6 H; T2 U
/ T: R; ^2 T6 K- r/ Y
Here again, several ways to detect it:2 Q5 S# T% ^5 j/ U+ M$ ?$ i5 z$ @$ E
0 U! S1 i6 } a* x BPINT 41 if ax==4f
2 c% l4 l4 x- p8 o' Q! }1 S. v/ {+ b% r
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; P! T2 r* C/ E& R
( \/ ]: ?# U( y. N) ]: R- J1 t- X BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 ?; |! B( E" w! v. Z
. l, r2 M8 d1 v/ E; ]: S, Z: J% W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!5 O# }7 v- d$ ~* o) H `: r; S% W' T% u
: U- h; z J1 ^3 l__________________________________________________________________________
6 S- s8 s) P+ o. B N& b+ @
7 Z2 C# B& x) z2 G0 l% ~Method 13( N: M% f$ i: @! c% I0 s3 G8 `
=========
: U, z, X+ c" u7 Z
1 _0 e( a( b. a# Y' E" I. h* pNot a real method of detection, but a good way to know if SoftICE is
2 h) U* I5 E4 _4 H* C' yinstalled on a computer and to locate its installation directory.- }% ?0 X: t+ e8 r7 ]
It is used by few softs which access the following registry keys (usually #2) :/ |" }% E, r2 }: L" a
+ S" C) ^3 ~- }' U. A3 Z* M
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! ]9 G& V- F& @( d, r9 {! h
\Uninstall\SoftICE
1 z* T# A+ G( p" G; g( k+ r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, t4 d& g9 M, b3 a6 @+ N; x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 \% K4 P; G, p# M$ b. F\App Paths\Loader32.Exe, n# q. ~7 J6 R* o4 ~! d
2 S. P$ a; I1 N5 c* O# C& P U
. R) M+ \4 w1 U& M7 @9 A! N4 ?. H2 uNote that some nasty apps could then erase all files from SoftICE directory( z( P9 ]# u. O# s1 d; S
(I faced that once :-(3 f0 o: z* E# ]9 P& P- C
; @4 `8 g* l% CUseful breakpoint to detect it:
" i$ H8 o1 b; O+ R
; t7 `: Z8 ~* I0 q% ~ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( v' U9 I7 n9 e. y. Z1 [" U7 r
# Z/ T6 M. T8 j* W+ W__________________________________________________________________________8 c5 w( p4 n; F, p }2 j7 w6 ^. p, a
( E. r) T J4 P# x: Q0 A# a6 t% N2 C' ~) z& t" z7 C( G" C
Method 14 * z, G2 `. v6 g p# y7 ]
=========
5 n/ C5 `: |6 I* X8 m4 a2 t3 I/ T( X# g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 z' @. q. ^0 @6 E, F
is to determines whether a debugger is running on your system (ring0 only).
5 J6 L* H4 A( s# H8 W6 _
1 n9 U6 k1 y- p2 V0 ]' j VMMCall Test_Debug_Installed1 c" U2 F4 A: j6 r1 n
je not_installed" E6 h; `1 K) b- v) P! I
3 q1 T' s; u) V3 s, _/ \; X: jThis service just checks a flag.* N) D; z! W2 D) S* I w; h0 q5 `
</PRE></TD></TR></TBODY></TABLE> |