<TABLE width=500>
& w& |% i+ p7 [: Q8 \5 X<TBODY>
, K" c+ s, r4 j/ G0 }<TR>
" U9 \4 V4 ?8 H* `" [( L/ e4 x! L<TD><PRE>Method 01
9 O% S9 o5 |3 c8 f& M! `=========3 b1 t/ ?1 @; G( }( H1 s
( L' f, v) w- [$ v) a( r9 ~This method of detection of SoftICE (as well as the following one) is
* V6 _( v/ z6 m2 Xused by the majority of packers/encryptors found on Internet.
. `% f! U# ~/ B+ i2 ^3 QIt seeks the signature of BoundsChecker in SoftICE: R' `& s- B8 X1 B
5 a% S6 }5 w- D, [ mov ebp, 04243484Bh ; 'BCHK'
' m& t/ @: z, P mov ax, 04h
( u2 |0 R! {4 H% v int 3
, Y, A; e5 ^4 W8 a2 d% G( o5 z/ @ cmp al,4
, B$ U6 M( z/ J jnz SoftICE_Detected+ q+ t1 Y! P/ S
0 c% l1 H$ e1 F+ E* q2 G1 P
___________________________________________________________________________
. K9 Y* r1 x% E" l6 b
: ~/ M: j9 ~8 Z- {9 yMethod 02
; P: C6 b5 J) l! ~6 m& Q1 j! V v5 E=========1 B& Z8 y0 x, x0 h% X: t
/ |8 l0 V* ?# q0 V n8 M
Still a method very much used (perhaps the most frequent one). It is used8 I& J- l ~; X) P5 v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 n9 ~, x, Q0 g g% e+ n1 }
or execute SoftICE commands...
+ J" \- ? H) x, `0 qIt is also used to crash SoftICE and to force it to execute any commands
( _' H7 Z! u- Y+ _& A) F! [0 s(HBOOT...) :-(( * F5 U" g$ |# h% q% m# l' s# W
1 p A& a/ J3 F: W \# _+ D
Here is a quick description:) K& k2 g4 T) u" n. s+ J% ^
-AX = 0910h (Display string in SIce windows)$ d P) ~4 L# n& E9 V) M
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)9 j1 `* h0 h0 \% y8 r
-AX = 0912h (Get breakpoint infos)
5 b5 C' h$ h& n' s o0 Y4 {-AX = 0913h (Set Sice breakpoints)) \2 c# ?# _5 O+ I) Y
-AX = 0914h (Remove SIce breakoints)5 E* A: {6 G- y3 y e$ i8 |
; w8 \% q8 S0 O% n& c& j5 E1 nEach time you'll meet this trick, you'll see:
( }) q& O' x: B4 ?) B-SI = 4647h! F1 m" v+ G4 e, q; x; g w$ F
-DI = 4A4Dh
. y1 }+ A+ F8 }& p8 |7 `( q' Z3 z" e) d3 pWhich are the 'magic values' used by SoftIce.
0 A) v# ~/ w* aFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. D+ t8 ]* M! _* g7 L" u
; y% g% M$ X) h8 B& K% nHere is one example from the file "Haspinst.exe" which is the dongle HASP' f) Z% g& T: ]+ }& F
Envelope utility use to protect DOS applications:
# A, N- x3 I1 j, f- m, n, n8 o2 X/ J7 c' u# q* W+ j: J: M
4 [+ s9 v. H& ^$ ?0 P4C19:0095 MOV AX,0911 ; execute command.
3 U3 Y- Q1 l6 Q- Y% b( H4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 v+ @0 C0 y2 x
4C19:009A MOV SI,4647 ; 1st magic value.1 M' Z' A* i4 X, E! C# k3 y
4C19:009D MOV DI,4A4D ; 2nd magic value.
2 c9 d& _# U0 N4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# f9 i, G4 d/ R$ R' S4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, x1 h% A% N9 L8 s' h0 |, m
4C19:00A4 INC CX5 \8 A1 j9 r/ G# D# p. o/ _. @5 ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute7 n7 w! i7 o7 [% U5 U6 k
4C19:00A8 JB 0095 ; 6 different commands.* b1 {) ]$ f: Y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
; |/ q" \, | ?4 D$ U4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ [0 q5 Q, O; \7 H- A3 U
2 r% [0 K7 c9 `' Z. [
The program will execute 6 different SIce commands located at ds:dx, which0 n# S( q4 j( v" b1 u$ D* e
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." V; J) L; G) R2 C7 B
V8 g. {2 `" S! f, B1 h& e* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ V% M0 V. A% C0 G, {. w! G___________________________________________________________________________; L( N, Q7 i: \9 R+ M) e; Q
- V4 ^( ?, k# X! u" [
6 _; g% s1 p! R0 ? a N0 xMethod 03
, u8 ^, F2 s$ a- R- q: x=========
: [- H; |' w3 x6 l0 D) G0 P3 m0 y5 B9 C, s
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 n( s; {8 x5 A. ~: J0 S8 @+ ^(API Get entry point)
}3 M: A' B! u " w+ z& @% U1 G, I
# i3 G% R# {9 w# {' Q
xor di,di/ g4 x7 b# M& u
mov es,di
0 E- ~" x# e; ^! p mov ax, 1684h * N9 |4 ^' }" P! b. R( D
mov bx, 0202h ; VxD ID of winice
" N' [7 _0 W9 q$ b% b int 2Fh
$ g) d" n# i# i' p6 K1 q- } mov ax, es ; ES:DI -> VxD API entry point1 Q) K$ r% O; H+ [2 d
add ax, di
" ?0 v5 f* Y" x& L- t test ax,ax# X) w. R* M" R$ P3 D
jnz SoftICE_Detected
. }: y# V5 D- Y5 }# s$ t+ g
6 ~0 p0 |: ?" ^0 U3 s___________________________________________________________________________
2 i o4 }+ C: `+ @* Q/ F- B$ Z- z X0 {
Method 04
1 [4 t! o9 F* t: l0 t6 S i: I' |=========
0 G7 S: C0 b- S4 g$ Q- c% y, D- b7 ?( \. |& |
Method identical to the preceding one except that it seeks the ID of SoftICE b% ~9 M5 ]5 y9 ~- [& j& U
GFX VxD.+ l( ?5 D# o/ c5 ]/ x' ~1 y
; \8 y) b8 Z R, l E# v xor di,di
* Q# V: \& G2 S0 Q2 C mov es,di
# P+ f4 r' A" _5 t mov ax, 1684h ; D |' E. D8 f( s! \
mov bx, 7a5Fh ; VxD ID of SIWVID
9 i% D7 }2 V% b3 f7 z6 j$ I int 2fh7 Y: V% `& ~+ J+ s' n
mov ax, es ; ES:DI -> VxD API entry point
5 m; ~ p( G k! x- w add ax, di
# a0 k! y8 ~2 \ test ax,ax
" s1 T* t! O# o* G; o6 b% U6 F- o jnz SoftICE_Detected
9 q; `# P2 p% k% ]: v5 Y+ p% M1 x o8 X- u
__________________________________________________________________________
* ^+ N3 ~8 h. C" W+ S+ H1 \; o# G( a
* A: k- D9 D4 ~ s( t- rMethod 051 m% k8 r4 C2 g, D0 ]8 P w
=========3 }' T6 i$ E" C+ Q& p: {$ I: g
9 _ Q" ]& h- ~* u: v2 UMethod seeking the 'magic number' 0F386h returned (in ax) by all system
8 D/ o, x/ `" Z X- [* X$ ldebugger. It calls the int 41h, function 4Fh.
1 H8 {" c: S9 v- [There are several alternatives.
. F6 D8 S: F1 e! Y% [3 P
7 z& T% U7 Y( m @" p- d" ?. EThe following one is the simplest:
* R2 b i& g" r! y" I( ^5 S" N. A$ Y; G Q8 ?" e; S; }
mov ax,4fh
' G- \9 A& R4 k& W' O9 K int 41h: z" i+ z& R$ f" a* X/ I
cmp ax, 0F386% p5 X" |$ k3 V- X1 _! e3 g
jz SoftICE_detected* P+ @/ ?9 z% E, Y8 w, w5 ?# d
) H7 d1 ], A( _' q2 L
2 y) B0 z0 J. p# B0 M+ F
Next method as well as the following one are 2 examples from Stone's 2 o( P( f) ^8 t/ }2 B
"stn-wid.zip" (www.cracking.net):
7 F( T* V( K2 K& r/ K9 S) @! S5 k: q- d- H
mov bx, cs: z. X9 S w' v* X6 [* u: ?
lea dx, int41handler2
2 }" S3 U/ V' z xchg dx, es:[41h*4]
) R; ?8 E7 e5 D. M xchg bx, es:[41h*4+2]0 w- c& C9 g7 _
mov ax,4fh0 ]2 b- X6 @, A2 p$ W: x( V6 K& U6 H$ T
int 41h M7 P, k0 i; [8 L2 N) a9 h$ k
xchg dx, es:[41h*4]( w( Y. _4 `; t! _' g' P. b
xchg bx, es:[41h*4+2]
$ w) a6 h/ U4 N! ~' m+ ~& h8 w cmp ax, 0f386h! x6 C/ C; `* N$ d* i9 ^
jz SoftICE_detected
* S; U- A# h6 p* z) l3 B# x A6 f {; S$ I K! B
int41handler2 PROC
. q5 a' g/ A) k- G! j9 K) d @ iret, p8 _3 K) c" F9 O2 Q
int41handler2 ENDP" S' c; x9 s$ ] V5 h( p' h
, u' z+ D+ n, b* |! u
' r; n0 _) B5 p3 b
_________________________________________________________________________( v" M1 f. [* c
7 |+ Y1 U* u5 n9 Q8 B( @6 Y0 H$ u( t8 }7 t: ?2 z9 Q
Method 06( Y. V: s2 g1 y8 P0 x
=========
- F5 g; R% `, D
r6 i% |8 b! h& b9 |9 `" S4 }; @" d5 Z! H3 ~
2nd method similar to the preceding one but more difficult to detect:; I& \9 x+ g* Q, v
) _8 c8 ^% I. t$ W2 s: G. I8 N: ^
7 q: H4 d& A, ?6 Z2 ^0 z1 T$ r
int41handler PROC
/ r% N, v2 C, x: s9 P$ t! X5 m mov cl,al
* w0 G- f" T. u4 W2 _% | iret5 x0 k) p6 E" b$ `! m: {- g7 o
int41handler ENDP
. _4 C3 _5 j. P& ]2 g
; J" w# b# ^. n8 r9 X
' J$ }0 G) A; U+ j) E xor ax,ax
, X8 u5 f2 y0 C* b mov es,ax
' L% O! Z3 m+ ~. d5 _ mov bx, cs) D7 A; B; @" E$ ~* j+ N u) ~
lea dx, int41handler
- a) D0 r, g+ `& i3 m1 `# G8 }* A xchg dx, es:[41h*4]
; h. V, o4 W$ R% f xchg bx, es:[41h*4+2]
+ ]3 i1 a2 Z7 i/ d. t2 X in al, 40h
0 P6 w/ A7 s2 d xor cx,cx- k( y/ C8 i6 F& d8 i+ i$ w; p
int 41h
. o! v5 B/ ?* ] xchg dx, es:[41h*4]
: B2 q% r5 b5 j$ w8 c xchg bx, es:[41h*4+2]7 R6 v; q) @) i& [
cmp cl,al
! }8 H8 N. t) B4 i7 j jnz SoftICE_detected& u! g! E |) R7 b7 [
1 F4 H% f9 ^) r0 U_________________________________________________________________________, O8 H- z0 _' F A: ]8 I! K7 X
0 u4 M9 a6 F0 ~8 W- x0 kMethod 07
% Z5 E0 A/ s+ p=========
/ D# I! r) B. |3 i- v
0 c; j# f0 P$ B) m; `Method of detection of the WinICE handler in the int68h (V86)
! t0 ^' l: ]( I+ p* V
4 P; {% a. v- q- ]$ ` mov ah,43h+ I: K1 f9 c2 L* k6 p' y
int 68h8 t, E2 s6 y/ n: ?3 A
cmp ax,0F386h8 M9 K4 ]; [/ V/ v
jz SoftICE_Detected! f/ m1 `. R: e0 O8 d8 X) }/ V
4 H$ X! A7 R% g5 B+ Q3 e8 d( w5 n9 F% A3 J4 C8 {( p9 i
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, q }8 D" u5 p$ s1 Q
app like this:
: j* r" X& x: ?4 N* j4 w1 r6 \$ R: J# {
BPX exec_int if ax==680 R" }; b5 \) M$ j; W
(function called is located at byte ptr [ebp+1Dh] and client eip is
! P7 B3 j! }3 L9 O9 @ located at [ebp+48h] for 32Bit apps)3 t+ u# z& k& g% O. [
__________________________________________________________________________
6 Y! K [+ V% K8 m
# K0 j1 \6 q5 r8 ^8 e7 G% c) r/ z$ ]7 t7 R# C" A# y
Method 08
9 s, \& z0 j+ X1 [7 [=========
?5 r* }$ G! b" h" ?- r' |$ X% n/ K( B) m
It is not a method of detection of SoftICE but a possibility to crash the$ T# A8 m* Y( u1 {* T3 l
system by intercepting int 01h and int 03h and redirecting them to another6 a- n, n' U" B+ t0 ?% s1 d: L6 }0 B
routine.
+ F6 c7 G$ d+ ZIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ G8 r7 ~+ p7 k/ Wto the new routine to execute (hangs computer...)$ h. A+ t# l+ z( _. B8 M0 _8 X
1 `3 S$ l+ O+ S' P) N mov ah, 25h1 y( q! w$ p' T! M
mov al, Int_Number (01h or 03h)" R8 v$ D" U$ b/ C A1 O/ s* a k
mov dx, offset New_Int_Routine
! _) |+ p7 r" d( _- i4 s) _$ ~( t int 21h
: G9 A* R. C2 _* C6 I- m9 Z8 e. s7 c
__________________________________________________________________________
% D9 N+ P+ w; }6 b1 Y3 w9 a0 Y& D+ b6 C! r6 x9 Y4 P1 z
Method 09
0 L; _4 A' l8 d0 H, N- k6 \/ C=========
" X8 ]; @( [) D& D+ [
. i3 t9 j, b% ^) T0 e( yThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) Z) X9 s0 B* m* K$ g' \1 ` L
performed in ring0 (VxD or a ring3 app using the VxdCall).: k: w! X" _) W- f4 f! B
The Get_DDB service is used to determine whether or not a VxD is installed1 [& i v/ T% J8 `) w1 u+ V& L
for the specified device and returns a Device Description Block (in ecx) for ?$ \" s( N8 c- Y- v4 H
that device if it is installed. J( C( L4 G K! V: `" V
7 Y! C( F' t# F4 U: @9 U1 U c$ ` mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID; R5 Y' F! m" g$ v
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), i; u* \7 T( i0 ^& K, e
VMMCall Get_DDB
: p7 G; |& @$ o0 O5 D* N$ J mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 Y, K+ e& k' l9 p a6 @
% p+ W9 L Y0 {# j, N/ y rNote as well that you can easily detect this method with SoftICE:+ q c4 `9 @) M' E1 |
bpx Get_DDB if ax==0202 || ax==7a5fh0 a9 k4 p+ K) s) G" V- Z
8 P+ x; {' M9 ?" b, G! f8 j* G__________________________________________________________________________
. L* r. Z- X- T. \ h) _% K" t2 b; y( N2 n# a+ H
Method 10
& R) E$ u: _) v0 g' ~, i=========" ?0 r4 W- t! O9 o% m$ W; t: M8 _% k! C# y
' E" d: ~- n; L1 X/ j, Q! P. ?=>Disable or clear breakpoints before using this feature. DO NOT trace with+ x; a# v0 C, T
SoftICE while the option is enable!!
1 \( t5 n% g* H5 D1 R" w9 l. E0 o/ Y5 D3 j, d
This trick is very efficient:3 Q/ @4 W* @% R) s/ y f6 `. L: ^' m1 j
by checking the Debug Registers, you can detect if SoftICE is loaded H4 C! N6 ]% B$ F. }$ X3 f5 n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 ~8 L) C& c5 n, K5 W" L
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 ?+ a( Q+ t( A1 D; z, mvalue (in ring0 only). Values can be manipulated and or changed as well
. Q5 ^2 L* l6 g- q( g( w(clearing BPMs for instance)
* J2 u: \1 b7 y% `) L
4 Y9 ~# S' M. x4 _% g__________________________________________________________________________
3 R- L2 ~. a6 b8 h8 U
6 \; g# I8 E! J+ Q' a, Y3 EMethod 11
8 H% h. D! |( ~* Y [' b. r=========$ v0 p2 Q9 `+ h; ?
3 M4 t5 e4 B E$ e8 ?
This method is most known as 'MeltICE' because it has been freely distributed
$ s) J, ?8 T9 xvia www.winfiles.com. However it was first used by NuMega people to allow9 q" O" ~& b9 ]7 F
Symbol Loader to check if SoftICE was active or not (the code is located
+ ^" b6 d9 `* r8 Yinside nmtrans.dll).0 B, k/ l; p# y+ W0 z" \
3 F7 w; S2 v7 @( |1 E" I/ W6 W% D
The way it works is very simple:
; J& S) P% }; i3 j# K, T2 z( HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% s4 E- t" z" U! f
WinNT) with the CreateFileA API.
+ ?8 v* s$ R! C- o: c
4 l5 L* e( R3 {& [7 p p6 AHere is a sample (checking for 'SICE'):
" b3 W# A' |- I2 T1 o. a; l- p6 i6 A1 n4 m' I& h2 f
BOOL IsSoftIce95Loaded(), L4 a6 ]$ K) f" F* t0 m9 b& V
{
- J- b6 `0 G3 I) U4 [ HANDLE hFile;
3 h ?" j; s. N) v hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 {6 I" ]; |8 K FILE_SHARE_READ | FILE_SHARE_WRITE,
8 X4 g5 Y) ~+ V w2 ], q* n+ U O NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); b! x. H* E1 U, L" p1 ]
if( hFile != INVALID_HANDLE_VALUE )
" X% C) g6 M' G {' j* S# y! _4 d, s; ]
CloseHandle(hFile);
" w% Y T/ E: n; }: ` return TRUE;
$ Z0 p! @, w, F" S+ c# E9 a }+ y. Q7 f3 X& @5 Q, b# `5 K
return FALSE;* Z- i" }; y; ^3 }5 Z
}, z9 ~. o+ a0 Q1 m# S7 o6 M
1 p0 T/ V8 R7 s' Y% G4 v' [ w% VAlthough this trick calls the CreateFileA function, don't even expect to be' N) _4 c, g, y9 [
able to intercept it by installing a IFS hook: it will not work, no way!' C0 \# E8 r+ z) [& `
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 w: x5 X( ^/ c: J$ { V8 Eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ G4 {$ ]! o4 |/ T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- H8 Q9 z, t! _1 @( Z
field.
8 V; k# B8 B7 f' b/ @9 mIn fact, its purpose is not to load/unload VxDs but only to send a
' f1 Q, y/ @9 C' u) B# I1 P, F, x1 [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
4 h* I# k: v' W) t* k" l% p! Xto the VxD Control_Dispatch proc (how the hell a shareware soft could try5 X" Y9 I" {* ^$ z' A9 N
to load/unload a non-dynamically loadable driver such as SoftICE ;-).: M' e- J' D: Y; A
If the VxD is loaded, it will always clear eax and the Carry flag to allow
( G4 o+ B3 ?" u" K/ o, ?& Fits handle to be opened and then, will be detected.
- L0 I' H& S) z4 p* ?( W6 H3 A" XYou can check that simply by hooking Winice.exe control proc entry point
$ `( f- F0 ]4 X1 s4 X0 Hwhile running MeltICE.
" o7 F5 h8 D$ H+ l/ d- t: n+ Z6 }, W) j6 D$ y
, Q* z5 c6 ?9 z1 z& i
00401067: push 00402025 ; \\.\SICE
: M5 Y( c: u/ B 0040106C: call CreateFileA' J1 \/ _, k* v4 p% j: P
00401071: cmp eax,-001
3 I5 Z' p- e* `9 A/ V 00401074: je 00401091
" z* @* z3 U b! T3 U& v4 Q2 B
0 \6 ]1 B& X$ Q! U+ B# l6 V2 j$ g. d3 c/ {& {- q" \) e- A) w+ s, z9 @
There could be hundreds of BPX you could use to detect this trick.) W: U; U( w+ s& a8 l& f/ j; w
-The most classical one is:
; m8 b; d1 N0 z) J BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 e7 @2 _. E! i2 J$ B
*(esp->4+4)=='NTIC'
7 H2 u0 w1 U7 C$ O" c5 d2 f4 i0 k9 a2 |* ^& m2 h: ~
-The most exotic ones (could be very slooooow :-(# m& f8 z- F) p
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / ^) \6 k9 g* Y9 I, T
;will break 3 times :-(
3 l4 ^! R+ Q, [. d
! K X( Q q" J. z: d- E8 c-or (a bit) faster: 3 o& w- t7 D: m* u! Y s6 ]$ v
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% d4 F( \0 \: j ^6 x
: H8 C" G% |9 q" u: g2 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' L/ J s9 ?: X
;will break 3 times :-(# l b1 _6 U8 b2 I% |
2 m' Z4 [: D+ w0 v1 o$ l& T
-Much faster:% q: ~! x3 u l$ z$ Y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', [$ x" ~% k! g q1 E
. G( _, Y @5 P2 g1 \Note also that some programs (like AZPR3.00) use de old 16-bit _lopen% D Q a5 n- t5 n' n3 q
function to do the same job:
P6 C [) _9 f4 [1 C3 h0 ?0 k! s8 [- `$ N
push 00 ; OF_READ
% I: R, ^, K9 S2 v& O3 c; s mov eax,[00656634] ; '\\.\SICE',0
, H4 T7 o5 h$ [; A. d0 i: r( w, U push eax8 r! P2 m9 T% T/ W6 g) c# o
call KERNEL32!_lopen
) P8 A! G& d3 d5 A4 E( r inc eax( s3 L' U6 O6 D6 N3 m
jnz 00650589 ; detected
' g3 R2 W1 A$ `: Q7 } push 00 ; OF_READ
! s( y3 i! _( n# u mov eax,[00656638] ; '\\.\SICE'
5 b/ {" |7 J6 a0 S5 s push eax6 M: Z1 E0 U/ p l1 d( K8 g. v
call KERNEL32!_lopen% m, u* F1 Z9 e4 J6 b& u4 @
inc eax
& r+ B" Q4 f! B% O0 n" w& E jz 006505ae ; not detected
+ S8 C$ w! }8 n, [9 K( L, ?' }( S
F, A. \& [; V9 ^& M3 h0 k1 M y# w+ X0 w. g# y( P( @, d: N
__________________________________________________________________________
2 t& m' ~1 V* b/ D
. M' v! `$ n; Q8 AMethod 12- }* g+ r- P" V/ {
=========
* D1 B% H% Y' w: k- O3 n2 r: S, e( f0 D! S5 M
This trick is similar to int41h/4fh Debugger installation check (code 059 r$ b/ G, [$ ~
& 06) but very limited because it's only available for Win95/98 (not NT)
2 ]) O* L5 ~; bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 w- c0 p( p8 e: l% e% D
; |# q+ l' q$ b1 @& V5 d5 E+ a push 0000004fh ; function 4fh$ b0 X. a$ l, P* ]
push 002a002ah ; high word specifies which VxD (VWIN32)3 \4 n7 P9 e5 D3 u( }5 W, Q
; low word specifies which service
# X! X( {- [) Y. { (VWIN32_Int41Dispatch)
) i# U" i* G2 X' ~ ^* T4 J call Kernel32!ORD_001 ; VxdCall+ `- O) `* m4 r' \$ T% u
cmp ax, 0f386h ; magic number returned by system debuggers
5 |! p) e; [9 ^0 w+ i jz SoftICE_detected: x- n% H0 Y" o% A
" v/ l, A* [. V) V7 XHere again, several ways to detect it:
( m1 C( l! a9 b6 Z% U' A! w a h6 j! X. [+ D! i9 \5 v6 J
BPINT 41 if ax==4f
2 { l, R: \3 s x9 S3 P b5 x& j. ?5 u7 D+ {, Q. U
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 A7 @. K, d! X# e2 Y$ J
2 r3 }+ X: p" `5 H) Y# r BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' q0 z$ O3 D$ b0 G! y- y9 m+ e
8 _+ O2 l* q( r o/ ?5 }) ?' }
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. H/ A; h. X \/ y1 E
5 l: v9 O# ~* P' }__________________________________________________________________________
, ^! @1 L& z' I, Q, H/ R& w+ a; S: B4 P
Method 13
$ `, M( w! E$ A q0 ~ \ o=========
' ~$ O& O, i% f2 U( b1 e+ q9 a {: A+ k
Not a real method of detection, but a good way to know if SoftICE is
1 V* E6 m6 A- l) F9 Ginstalled on a computer and to locate its installation directory.
. G" D) @. F5 _) L! a5 i* j" ]. DIt is used by few softs which access the following registry keys (usually #2) :3 _4 S, u7 K% L6 _
# x; ^! H6 A- w8 D9 s! t6 G4 n-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( ]" G2 c( n1 b3 R! \7 y
\Uninstall\SoftICE) U4 f1 \9 k6 G5 W
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 S1 `) @% ?% R% F, [3 c* F-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! ^3 Q. \/ R+ B* `( ^) D\App Paths\Loader32.Exe
$ ] ~- n& S7 i% c7 ~# H- M$ C, r5 m, H& V' Z
* x) X) D6 M' F* T& ?5 `0 ]" w
Note that some nasty apps could then erase all files from SoftICE directory6 L" H l- C5 m+ h
(I faced that once :-(6 Q% g* O2 H( w/ y7 W1 l
2 t! I) x5 F: lUseful breakpoint to detect it:
% Y' Y0 T" U5 X( Z0 N n9 m* O
/ D& p, Z1 u- Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
8 M7 I0 T9 T* S" f. s& @6 X' G: S, W# s/ P% c- [
__________________________________________________________________________! m( s# p/ B! w/ j5 V- T9 P& K
' i' T( ?" a; Y" O8 V( j# {
% A% n9 }' f0 S3 P5 T+ tMethod 14 : `5 U, @7 l0 s4 m5 w" {: L
=========
2 S8 j3 q: A9 L# m- B' z0 r) ?! p. u; V9 U/ H5 s+ q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ f2 i2 }' n. J5 E4 B8 N/ F7 [
is to determines whether a debugger is running on your system (ring0 only).1 x% u* |7 E8 v$ I. h* t: u" ^
. E N6 X: v! P) v VMMCall Test_Debug_Installed
( o2 Z) i1 F' L je not_installed3 F' A p3 e% @- t' ?- D& n
: s6 s% ^2 c3 ?This service just checks a flag.$ j: W+ @# w5 [/ l) W" ~; i- g0 W
</PRE></TD></TR></TBODY></TABLE> |