<TABLE width=500>
7 u0 z2 ^) x0 q0 M8 x<TBODY>
6 o5 l0 h$ Z( `2 W: }2 i: C<TR>
( H/ |0 L, F0 a<TD><PRE>Method 01
( l9 y( X7 ~0 g# r- V' j9 \=========! U) \# s5 S" ] ^
) V3 G% A% }1 I* f0 J7 ~
This method of detection of SoftICE (as well as the following one) is
* W1 v% ?* d# t' C. r+ pused by the majority of packers/encryptors found on Internet.
8 t- J* [+ f+ n/ S( NIt seeks the signature of BoundsChecker in SoftICE
& P+ ]* B. g8 k S+ `$ R B
1 L/ R6 R( U$ O# Q7 A' n C mov ebp, 04243484Bh ; 'BCHK'. |1 d2 K+ F, R9 _
mov ax, 04h$ m& f+ D2 D3 {
int 3
" [- q0 r9 Q# j% Z% C& I1 g cmp al,4# z8 x( i5 ~* z+ `
jnz SoftICE_Detected2 S! S1 w+ U' }
+ w/ l" c! N: n% ^; \0 _. ?2 U
___________________________________________________________________________
9 J- { _( K2 e8 v! H
) c1 e4 ?8 u( ~, o) n4 s% M% vMethod 028 l! q- B" [8 R! i& E" P( Y
=========% `! R: W! ^4 y& N( G& t/ s
! t3 U: Q; I1 D7 YStill a method very much used (perhaps the most frequent one). It is used2 J) E U$ S# z
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ m h- O! J5 F6 M: sor execute SoftICE commands...
/ u8 n% ?6 [& r6 kIt is also used to crash SoftICE and to force it to execute any commands
$ p/ g8 J* Q: A/ E, ?% k$ B3 \(HBOOT...) :-((
3 _) W8 U3 a! |0 k- B) i r" C8 H, o& F6 [1 f9 b" y, r
Here is a quick description:$ w$ h" m& H* l# K
-AX = 0910h (Display string in SIce windows)0 z& m& Y! y" p) @: H- _* H
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
# P+ }3 i0 H: x% [+ N( s-AX = 0912h (Get breakpoint infos), @* X1 i4 ~& U2 N( W8 ?9 R
-AX = 0913h (Set Sice breakpoints)
1 n7 ~+ m2 ^1 E# D3 t/ V- b-AX = 0914h (Remove SIce breakoints)
, y* U4 a9 [- o, Z1 I& P5 m0 B) p8 ]6 v( a' y7 Y! T b* M% n
Each time you'll meet this trick, you'll see:
* D. c7 r+ W1 [-SI = 4647h
# ~7 T) P3 Y- R+ N$ |) O$ q-DI = 4A4Dh
2 r2 M0 r- R, ~4 _* q" UWhich are the 'magic values' used by SoftIce.
& g8 _8 ~& _. b! d" FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
}; K8 {! _& c; Y w! V- r1 I+ q- s- e, G: C
Here is one example from the file "Haspinst.exe" which is the dongle HASP
8 r0 [5 m9 Q; b0 }; l* o0 m/ _3 n, X1 JEnvelope utility use to protect DOS applications:
X a8 M" ?$ o7 P) R( ~$ y, ]5 E- E% b
& Y T+ T) ~1 L8 ]
4C19:0095 MOV AX,0911 ; execute command.
+ a# D8 V7 }) ~2 I# Y1 Q0 {4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 n: w7 l; r+ _7 L! q$ ~* f: _" X4C19:009A MOV SI,4647 ; 1st magic value.
4 e6 u$ S/ @9 O& z0 ?4C19:009D MOV DI,4A4D ; 2nd magic value.
$ ~) c3 e3 x9 ]/ [0 D) G; R7 R$ K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 r* x0 ]' ^8 I( N, R9 }) Z7 x/ o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
/ T# i$ I: n% c' @& {7 p+ C) m; ]4C19:00A4 INC CX
+ ^2 N6 Q; L3 ], A6 j2 O8 D1 n2 M/ g% ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: X) i, m% ?6 s6 w; |3 a8 `0 t
4C19:00A8 JB 0095 ; 6 different commands.
9 _$ y4 x/ F! Q: _4C19:00AA JMP 0002 ; Bad_Guy jmp back.
3 c0 t. i* h9 Q5 |5 m4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 t* z& L, n8 i; a4 z! A' D/ F8 o$ E7 ?+ w7 F4 V5 ~2 d
The program will execute 6 different SIce commands located at ds:dx, which% k ]$ F+ z- ]
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& L+ B/ |9 ^0 D1 _/ B
% M1 n; c+ n9 `+ ?( a; D; y$ O* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- ?9 M K5 ~3 S1 g$ [# F6 s" X- V4 H* M
___________________________________________________________________________! L' w, Y# J1 W0 n/ d
7 P D- G& |# t; X
5 B m9 q$ W# z2 v, t7 {( S0 U
Method 03
5 q6 x/ p* B4 E=========3 N+ g! _: [7 v& i1 f% @3 L, R4 \4 q
1 ?8 N X9 p# ^0 ~8 `Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 M9 v. N! C. \) D: ^
(API Get entry point)/ f, @1 w& v) S/ g8 k% K" w
% u, x- Q/ E) W9 H$ I. e
: S: a- |5 b, K. ?9 @# Z7 i1 b1 g( p xor di,di% g1 T, U4 c% J6 m7 J+ N- O
mov es,di# r) m, Z0 v0 D0 o
mov ax, 1684h % N. M" W/ o4 x' a
mov bx, 0202h ; VxD ID of winice4 z2 ?1 W [* L
int 2Fh7 W9 z0 V s2 x6 [2 d) g# E; s0 q
mov ax, es ; ES:DI -> VxD API entry point( Z" N# x3 E/ l5 T v# l% |
add ax, di) t1 n0 v/ o# g$ _
test ax,ax
2 v+ }9 Q' S9 r5 U0 U jnz SoftICE_Detected1 ~2 T" B. W" }9 W" a
, U% k" G! }% v! {
___________________________________________________________________________
[4 r- J: `! p6 a u% c# T& g; B# a5 ?3 B2 }
Method 047 H3 @8 N" y. t, L
=========
6 e$ `& Y5 e1 L. o/ b, P. i
% c8 m% R: ^/ Q" HMethod identical to the preceding one except that it seeks the ID of SoftICE
: h9 q8 y9 x, |GFX VxD.- H! u; L8 {: d
5 ~8 N; `" o2 |9 a xor di,di
1 U! t0 y* Y" z' z% M4 u mov es,di
: {. @' K# N }( {! R mov ax, 1684h & g. V) C# y0 ~2 t& j
mov bx, 7a5Fh ; VxD ID of SIWVID" w. I! h8 [0 `
int 2fh
& g; Z6 b% A( T e mov ax, es ; ES:DI -> VxD API entry point
4 e6 E) t$ N- ]) R7 h) ` add ax, di% _' n7 ~1 e7 \+ j& _& C# |/ f
test ax,ax
4 D, I$ g- \! H jnz SoftICE_Detected
# o9 f9 p, Y) f: U7 L* [
4 E& e* u6 @5 n5 W0 r__________________________________________________________________________$ g, t( z1 C3 c3 d ~
; x& V2 X( W* s: `) q' e
# g+ X0 U3 O/ ?; ?4 q" M( i! e
Method 05
% W. } t! w$ `, B9 `=========6 a% s! ]1 F' S/ E6 u7 S- Z3 g" T6 y
! E2 B8 X5 s& e$ C3 ^) e
Method seeking the 'magic number' 0F386h returned (in ax) by all system, g! u( ~" N4 N! I- O% T; k
debugger. It calls the int 41h, function 4Fh.- [7 M3 C0 k2 J5 T" _5 t: f
There are several alternatives. N. N7 ?+ r9 w7 L- I
9 H& e) e6 C i9 i$ GThe following one is the simplest:
2 R O! p+ c! r# t
9 \- e. C: h V5 }; j5 V mov ax,4fh, |' _8 [! R( a( | ~+ h: L8 W
int 41h
( F8 E. C2 a) I( b- i) _ cmp ax, 0F386
4 _* \/ v1 e6 b0 Z jz SoftICE_detected* D4 l3 e0 i0 t5 c) v6 m
5 ?& s% t7 v) I2 d4 E7 C) x% e: S. N7 K+ Z
Next method as well as the following one are 2 examples from Stone's
4 b6 X) \0 g4 k0 ~7 T, ?"stn-wid.zip" (www.cracking.net):
- X7 H! u8 @4 k6 h; o, x
' G$ ?2 ]$ M: Y Q mov bx, cs
/ Q$ t5 r9 A& w lea dx, int41handler2) L6 H+ O1 e6 h6 @" L5 L3 a+ h. g' ~1 ]
xchg dx, es:[41h*4]
. n" Q9 `; h) H6 U xchg bx, es:[41h*4+2]
# e0 F" a L8 E( b mov ax,4fh9 j6 }, x3 R2 {0 Y6 k# S1 s
int 41h
' ?! c3 c) ?4 ?1 g$ h( T/ | xchg dx, es:[41h*4]8 j9 \+ G6 w( \" L
xchg bx, es:[41h*4+2]
u1 M( a( Q- W) x3 t cmp ax, 0f386h+ ?+ `( j t" \4 O
jz SoftICE_detected
, n6 V0 H* p8 p
9 o2 b7 q+ P& ]8 R3 F, D& nint41handler2 PROC$ E R, `% G: Y
iret
& x9 n. m8 b6 S. J7 xint41handler2 ENDP1 I, E: C1 D9 B4 n( r9 t
2 B& `0 @, e( ~! s3 ]. W9 n' f
. b4 {; Y0 p! H2 u+ e/ h+ G* k& ]_________________________________________________________________________- ]1 Z: | x% W4 @2 ?2 A- D
* r# x1 s% G+ q) O/ A. j& D
) N# R: W: d ^" G$ YMethod 06
- A* u/ l7 P o( |+ Q; v=========0 c5 p" N- g' J& s. J
0 n+ E$ }' @3 |$ b& W+ m
1 I' Z- W$ v- ~/ Q, A! U/ R2nd method similar to the preceding one but more difficult to detect:6 @1 ]1 f( t: `" o" @& F
" k! d, O- w8 H- g- z' Q7 m0 y* t3 e8 z: \2 M
int41handler PROC; s+ R9 ~" i9 p; O( Z
mov cl,al+ B; f9 b' {9 v& @$ u* C
iret- w4 ], X. V4 f0 \
int41handler ENDP
; K% j3 x9 J( R& \1 e. S/ G4 N X+ q) R( Z( w: t
) \+ k' A9 w8 I
xor ax,ax
; L) S( X; j+ s; y% j/ q mov es,ax- L+ V: ]5 u- |; x* r
mov bx, cs
9 \' a/ f7 {( M+ y& K9 G4 A8 ~ lea dx, int41handler( [1 |' M& o3 l; Y) O% ]. k/ l! D
xchg dx, es:[41h*4]
" M0 l" i# d$ Q2 C. t' z, z* M5 J xchg bx, es:[41h*4+2]5 j% @; X7 A% [
in al, 40h5 Q8 I% `* F" V x" p
xor cx,cx+ v; b. N- s9 g1 B4 ?1 V6 C5 `. e
int 41h
. D2 U6 N- D" ]4 t1 \& x! T A! y xchg dx, es:[41h*4]
' S/ h6 P' G, t+ g9 I4 |4 u6 I xchg bx, es:[41h*4+2]) S% G; F5 p! S2 _
cmp cl,al
8 c3 {7 ]3 S! e+ g& | jnz SoftICE_detected: @9 o3 L6 m3 y' c# v P% N, ]! H
6 `5 c3 G7 i. y4 e! f; _) f
_________________________________________________________________________' _. n1 k, Q6 O) U9 z
4 Y- O1 W3 w7 z9 ]
Method 07
. h9 r$ G1 }" L/ ?, [# k: E=========
* @8 z" m( A2 ?% m6 f
+ J9 y8 }& r+ }; I4 lMethod of detection of the WinICE handler in the int68h (V86)4 w! A( S! N' j4 l2 l* a O
. `6 G) Z+ K8 g& J" j8 {. J mov ah,43h
# B+ t l% S A2 M2 u int 68h7 a# u+ z* D7 c9 a' y& l
cmp ax,0F386h
) A5 |( d# {, b% |. N3 ~ jz SoftICE_Detected! Y3 m: B+ L+ Q
5 P6 F9 G, ]% _9 u
+ `/ t) y) L( v2 R=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 F# v) d. W) C3 \; s$ i# H2 l% i
app like this:+ e0 |2 Q4 c$ [! W
! d/ j# n0 _" J3 O$ s BPX exec_int if ax==68
! M& B, ?2 d' e (function called is located at byte ptr [ebp+1Dh] and client eip is8 x+ w- [5 a- l* }. C0 I3 C7 j
located at [ebp+48h] for 32Bit apps)# P0 f8 `7 Y- v5 X- ^! V
__________________________________________________________________________
+ {. B: W7 h& ?+ I
r0 T: H- c; E
2 E A/ R* S& p2 }Method 08
4 M. o7 j% w$ Y3 Z( }8 N8 e=========* N( d$ E8 t# ?) l5 j( t
; f6 {5 N9 z1 H8 v. j6 F% z# p/ u1 _9 ?6 f" WIt is not a method of detection of SoftICE but a possibility to crash the
w! Z7 y* \" bsystem by intercepting int 01h and int 03h and redirecting them to another* L1 t. _$ a1 O
routine.
9 ?) A4 I2 i6 QIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 D- l2 v4 u3 J% O5 C$ _/ s" I4 Jto the new routine to execute (hangs computer...)2 u) ]5 f3 X& I
- ^3 \' x' o7 [$ U. H mov ah, 25h" k9 P7 Z- W# U s
mov al, Int_Number (01h or 03h)5 N7 \( A* X# o* G- N
mov dx, offset New_Int_Routine0 s R; D) t4 r- u! ?* J3 V) P
int 21h8 Z0 D( l. j1 M, b7 S" M
& T3 ] }$ N/ b, a5 U__________________________________________________________________________
/ {% y1 V. o, V* c9 |/ E7 E" j$ i1 b( {* n. {1 z
Method 09
6 ?3 a" e3 V/ a2 y8 Y=========$ Q9 L9 P/ T G+ S* f/ ~% I2 N, ?
. Y) v- ^) x7 F, Y* K) [( ` b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 |3 e' v! k: Z7 z2 T' Kperformed in ring0 (VxD or a ring3 app using the VxdCall).
* b" H# T* t9 F8 n7 \: XThe Get_DDB service is used to determine whether or not a VxD is installed) e' z% [( Z. N5 q. F/ M
for the specified device and returns a Device Description Block (in ecx) for
+ F9 y9 t: x. B5 jthat device if it is installed.
9 D1 b: b3 y2 Y; p
3 v9 d2 f6 z, A" \$ p( \) L mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 \) h. G8 W6 x9 _) F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): p# J. Z6 [- Q- C1 f
VMMCall Get_DDB
; C; Z u; Y% t. v1 f8 D mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 y: O5 e+ S) ?% B
/ M* |* p! j& B3 cNote as well that you can easily detect this method with SoftICE:7 ~: _: f9 Q) W
bpx Get_DDB if ax==0202 || ax==7a5fh
$ j$ P- _5 D7 i' Y7 d9 Z L# D" X$ n, \6 _1 ~5 W8 M( C1 Y
__________________________________________________________________________
# }. y. k* p `7 R; Z" `6 H
% z1 X# J0 @. v ]4 R8 FMethod 109 `, N2 ~) d8 Q, L2 a" n$ g, \
=========
1 J' r3 v7 x* Q# g# h6 l& ~5 f8 H8 D7 @3 U
=>Disable or clear breakpoints before using this feature. DO NOT trace with u" t7 w" a# P: T$ v" [
SoftICE while the option is enable!!
$ X) i q8 K. o5 f4 ?5 U
3 n. [4 T! c( t. O! TThis trick is very efficient:
. L, C8 F0 [3 Nby checking the Debug Registers, you can detect if SoftICE is loaded" e) q8 X, k9 M `1 l3 k) i1 H
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: q1 D- n' j" J9 h. i0 L- othere are some memory breakpoints set (dr0 to dr3) simply by reading their4 o/ f1 u9 l3 ? c! n
value (in ring0 only). Values can be manipulated and or changed as well) s) K' p- q4 w# E! p
(clearing BPMs for instance)
' s6 E- w4 V6 M# b6 c/ M( L2 m. L
f$ r" h/ o/ f9 `__________________________________________________________________________9 b: X& z+ l' t3 e3 m
( o( ^- j2 X' xMethod 11' _# `9 p" ]1 X" w; \' Y. `
=========
3 K- L& Z% u! l& i
3 C$ t1 F1 Y; T* b" J% O, _This method is most known as 'MeltICE' because it has been freely distributed
8 `7 e6 [0 d+ Z3 M% w7 c% @via www.winfiles.com. However it was first used by NuMega people to allow8 ]( X/ w& V9 V2 F8 o
Symbol Loader to check if SoftICE was active or not (the code is located
% ?9 N2 m! a2 T3 h0 V3 n5 z6 u. Finside nmtrans.dll).
0 C" R$ k2 |% Q1 p5 w& u* S |7 g* r( Z5 s* T, J8 T+ l
The way it works is very simple:
. h5 f: W5 h K+ t' N, \+ A: R+ z. T% L5 hIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' U8 ]' T+ ]* p$ p
WinNT) with the CreateFileA API.
F* u) M0 q3 {+ _7 t* N$ p+ f h" }
# ], @7 K' q8 UHere is a sample (checking for 'SICE'):
. N- b. ^6 D8 p3 F( p f6 P. ?' ^: Y% [( |" v, P# Q& K! u. K" Y+ H
BOOL IsSoftIce95Loaded()
) l Y2 E3 q# k# y5 f{8 D# ?3 U# j; R0 l+ s& N
HANDLE hFile;
' B" j% ^7 C* d hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% b! J: _1 b' c5 O7 j: G2 O: }9 }
FILE_SHARE_READ | FILE_SHARE_WRITE,) t* h% z- @; S" H! q: Q9 ?
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); P( B; Y& y: i
if( hFile != INVALID_HANDLE_VALUE )
4 \- V8 t* v; [3 T4 v4 | {
! @' H) L1 f- s6 F' L CloseHandle(hFile);
& J4 k/ W! P9 a/ c return TRUE;
) `/ W' f( R( S# F" Q* t+ ` }
0 P# f6 F' N- f+ @ return FALSE;! v: {2 W' s }6 u5 S
}
# y, ?4 \$ K8 B, e. a) Y
# F+ R) J& M$ t; _! f( nAlthough this trick calls the CreateFileA function, don't even expect to be7 ?: i3 G: J) f0 _4 d$ C4 n$ l% T3 G a L
able to intercept it by installing a IFS hook: it will not work, no way!
) ~: u8 v+ F- A7 j& P) T4 QIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) a% @ Z3 L7 z0 l* M8 e( {
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ {; r5 y- {# d: @and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 b) E9 } y3 @field.% @9 W, s# @3 T* j4 E2 o
In fact, its purpose is not to load/unload VxDs but only to send a
' i0 I: R# ]+ \# i9 d7 [9 x2 |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 _/ n* g# d. g$ S4 j- J5 cto the VxD Control_Dispatch proc (how the hell a shareware soft could try. y0 k* C$ k$ \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).8 Q1 g% K8 B! f5 t
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ T' c4 a2 ^& N* g+ c Cits handle to be opened and then, will be detected.
3 S% s, G1 l. q! t fYou can check that simply by hooking Winice.exe control proc entry point
& A0 D8 O# d+ }1 S) E0 x ^while running MeltICE.2 ~- _$ S9 l1 Y
0 [0 k( p9 N+ m: b+ z6 D" ~! q7 \" C# v( y3 k' t' Q
00401067: push 00402025 ; \\.\SICE. n9 u, j* O, v: w
0040106C: call CreateFileA
0 w3 }4 F' X" m 00401071: cmp eax,-001
; K6 F9 S1 e4 P0 e9 w( X" F 00401074: je 00401091" o5 Z, _* T( h
& V3 Q! i2 a! Z3 \: a
0 I% y A; G2 W( o; l& j$ Y/ h
There could be hundreds of BPX you could use to detect this trick.$ [, Q; x B+ P) \3 C: \0 t
-The most classical one is:& b" P5 i; e3 ?! M/ e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 @- O/ q, w* B+ [5 \8 i
*(esp->4+4)=='NTIC'
) c8 K+ _% \+ R: a7 d9 O. D
. ^! p/ t6 h; k; ~- m0 G3 d j-The most exotic ones (could be very slooooow :-( I1 n) q: o7 k
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 ~* \; s& Q6 O) P4 e( p/ M$ H
;will break 3 times :-(. C1 \, N) Y D1 x
2 `7 k0 N. W% Y) U1 h
-or (a bit) faster: + [. `( l4 h+ O$ G3 c+ u1 P9 I, Q
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: W F1 W; j6 C3 y' Z9 M/ U1 k, b" V, N" i' m5 X7 k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 t4 l5 v" g) x/ s& W
;will break 3 times :-(
, M. d% S! n2 N' }5 z1 @& G* f
, d* S, V% B1 c: a) q7 w-Much faster:
: S5 Y7 N: @; E" P, | | BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' P, E9 y+ v& P4 v
; O9 G- A% _. p. ^* }Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, p3 ]1 R+ E, h H
function to do the same job:
$ z' O6 I, ^3 m+ Y* A; T1 S7 D8 L1 U7 o9 x/ J9 Q! o: m% [' X
push 00 ; OF_READ5 N2 k Z% r& y7 Y- I8 |: X
mov eax,[00656634] ; '\\.\SICE',0+ [8 p9 g; `- D) p) s/ S
push eax) G3 f z4 K! B7 n% p' u* o$ p
call KERNEL32!_lopen; Y: c9 {, o' Y/ @( ?* n) @! X
inc eax c3 o% K; h; N& C" H# i* F9 L
jnz 00650589 ; detected7 j/ a, `+ s3 L* e
push 00 ; OF_READ' o# [" s: C5 }% S' F* M+ f1 I
mov eax,[00656638] ; '\\.\SICE'! r; i2 R% @4 V9 y
push eax7 A X: P/ ?$ b8 }! }* ?4 Q
call KERNEL32!_lopen
! I9 x8 v& Z" v C& Z6 F' @$ X inc eax
. _+ \! `2 b9 A! k: p jz 006505ae ; not detected& i0 d5 [7 |- I- ], W
% P$ ?; @5 z7 U
( t+ @1 F \8 N4 i, z/ r__________________________________________________________________________
, i6 b6 t* ?) s9 R
& u3 c5 m9 h0 p! OMethod 12
' c& c/ w7 c& \) _. u3 y. q=========& m& w- R, `" g
6 D0 I3 b B9 {1 V" @7 ~% K
This trick is similar to int41h/4fh Debugger installation check (code 05& P) B7 }. m' c/ G
& 06) but very limited because it's only available for Win95/98 (not NT)& U( U2 L* }! w0 }
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 ^8 f% G" U) ^6 @ c% [# n Z- j5 I
push 0000004fh ; function 4fh+ d) o- O8 s( a3 ~+ }; l
push 002a002ah ; high word specifies which VxD (VWIN32)0 P* n$ S1 Y2 u" [+ Q- h" ^+ m& p% ~
; low word specifies which service2 I0 ?8 C1 [3 N2 E. l- R
(VWIN32_Int41Dispatch)
" r( c( x: j9 K4 A call Kernel32!ORD_001 ; VxdCall
; V8 E$ `/ g# ^0 y+ m. Z cmp ax, 0f386h ; magic number returned by system debuggers
: g$ ]3 q# x$ B5 P: p jz SoftICE_detected
7 G( P: w' X6 J& s5 s& |
( {2 [) z% W7 x; V* PHere again, several ways to detect it:
3 P+ X& Y% m) l+ P9 j
- h, @" a z5 Q/ [* n BPINT 41 if ax==4f
) p, P1 a5 b1 y0 ]% y T) \1 a3 r! `/ s+ g4 i. |$ N
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 l! b: r! \8 K7 y
t, q; z; J& ?8 Z BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
% B) ~! l8 B# V+ Q
6 o7 Y5 N. ? p BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 ?* v- w9 x+ N. t2 s5 r, i4 c& K, } n
7 b; l4 B& F4 A7 b" B. S; V__________________________________________________________________________2 f0 J6 Q% T: i8 _6 R, E3 U
( `5 v4 l$ @+ ^( F
Method 135 M3 X' u% f( I; w7 M/ I& @& p
=========. j5 t5 M- y! S0 X
4 s4 u$ i1 Q' a' e! I* S qNot a real method of detection, but a good way to know if SoftICE is
5 b$ v8 u; d1 z7 O6 d7 Dinstalled on a computer and to locate its installation directory.
7 m! P) l7 h4 s8 L2 YIt is used by few softs which access the following registry keys (usually #2) :; \! w9 S9 M0 v0 G5 o# z+ T
) w( h5 O" ]; }! b4 P; O-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ X. O- D" i+ F! i" V\Uninstall\SoftICE- P, S1 ?# g9 b* H) d
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 e. W4 [: o9 s8 e& f4 T! S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 |( f8 j! _/ ]) _2 I\App Paths\Loader32.Exe
9 S9 \$ }2 t6 W7 g' m$ Z9 l8 V8 @
; }; D& m; _/ j$ F# N1 ?, A& l' K- ]' u$ M
Note that some nasty apps could then erase all files from SoftICE directory- F2 e7 U) X, R2 z" z1 @
(I faced that once :-(+ l" d: o' z+ S$ |) g
+ d3 N! h8 z- j! NUseful breakpoint to detect it:
$ I" m4 I& x9 X3 [! T7 B' m. H( Z4 S- C- _" }/ W$ ]2 }* w0 d7 b) h) m
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 ~0 W8 f, h' R4 l2 p' i1 x
4 d. K& ?$ ?4 A% a( }+ U O1 {7 F__________________________________________________________________________2 k0 n( `" ^) ~- H! Y$ @! }
+ n0 v% v+ C# N1 }0 A
/ E$ c- z& b% L$ p# y; V4 s gMethod 14
- @3 i, d2 ~" S8 ^1 N=========
7 g2 q4 a" j6 u6 F7 C B/ \7 L/ |$ P5 W
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
; z( \& g f/ ]is to determines whether a debugger is running on your system (ring0 only).
8 W0 N% R J" ~$ Z l: L, }6 u L4 G4 z+ B
VMMCall Test_Debug_Installed
! ~" x" }/ y! C# [2 p* m je not_installed
2 N0 n# M, s! x9 x% @0 ^
- t: D( ]& [9 Z- A3 O. HThis service just checks a flag.
, [& H, w' d8 ^+ O</PRE></TD></TR></TBODY></TABLE> |