<TABLE width=500>1 `5 n' w5 Y, y2 s% g
<TBODY>
% u. h- B8 {" b% R<TR> l0 W; U) } c/ _" F8 z7 @
<TD><PRE>Method 01 # V7 f( q, F7 i, e7 A! x% ]
=========( u' x* C: f: _3 \: v
' c a8 H# G& A5 X
This method of detection of SoftICE (as well as the following one) is
2 n: i: ~2 C" G% x( `used by the majority of packers/encryptors found on Internet.
# K' K+ ?- P9 {5 yIt seeks the signature of BoundsChecker in SoftICE
: q' y8 ]8 `, J& z* }- ^7 u1 N. ^' y5 E! W1 S1 K/ n% n7 p
mov ebp, 04243484Bh ; 'BCHK'" W# Y# P7 e. ]$ ^
mov ax, 04h
* G0 Y% E ^0 g+ f- J/ V) ? int 3
. P8 W$ [) [, I6 x6 O; a cmp al,46 R2 x6 e; s& N" m
jnz SoftICE_Detected) ^- {8 _% c% E! [) B
% w- M" B% M( y___________________________________________________________________________ Y, p! v; ?2 S( g, H' u; [
d. \ @4 \* Z0 [. I
Method 02$ s) O! m5 K5 D" j+ m6 Y: M
=========
9 x6 @! n1 r6 E( x! E2 P( n" W8 `. W' H+ }* p, D2 c8 u) ^' X
Still a method very much used (perhaps the most frequent one). It is used
$ X- j- G; o l. G2 B; M$ lto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 e2 [7 _+ C' G% T, \or execute SoftICE commands...
; Y9 w2 @0 w% l# B: ^, l$ C) BIt is also used to crash SoftICE and to force it to execute any commands
0 ^% u/ Z1 T# b* l(HBOOT...) :-((
& D- Q* W k7 O* G
, z# U( w7 p& c" M( [' m, L& wHere is a quick description:
3 O8 k( z M& K& w-AX = 0910h (Display string in SIce windows)0 ?4 V) W% E; x& x
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 v$ }, P0 r8 t" k- Q-AX = 0912h (Get breakpoint infos)
7 H/ |1 ~) s# k$ v( i# C-AX = 0913h (Set Sice breakpoints)5 l" n. ^" v; v* z/ ?
-AX = 0914h (Remove SIce breakoints)
1 W6 { P5 { ]6 z5 h. S: ^. Z1 ^0 f) ~- |# m/ q% {
Each time you'll meet this trick, you'll see:
' Q& ~- \1 @# V3 c-SI = 4647h: c8 b5 P/ r/ U5 S) s
-DI = 4A4Dh$ m) G* c: _+ r, M
Which are the 'magic values' used by SoftIce.6 h, N( v0 y0 P$ u" g+ ^8 b
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& \( O$ N) ?( c
4 b' @! g- N- L- x
Here is one example from the file "Haspinst.exe" which is the dongle HASP: [; a% ?/ d- O$ z4 e; E
Envelope utility use to protect DOS applications:# V5 k6 W, g9 T2 y+ \" ? {
4 Q6 t5 Q% w: e5 w
K7 q k* ^9 j9 P. Z6 T2 u4C19:0095 MOV AX,0911 ; execute command.
. J6 D% {& l8 ?! t" z: o3 q4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) s& q! A, s' L, u3 E; _
4C19:009A MOV SI,4647 ; 1st magic value.6 c' T3 |1 k7 c3 g6 o
4C19:009D MOV DI,4A4D ; 2nd magic value.' d U! [; M' Z; l
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' a2 H5 t7 k/ h( E1 j) k
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute h. U( p+ p u2 ^& s
4C19:00A4 INC CX
3 }+ b' u; b% t) Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. z* u# C: t5 p1 R4 X4C19:00A8 JB 0095 ; 6 different commands.
$ r P; e: d- N3 y& j5 X4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! P; D* R1 i& R" p4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- j# v" x5 {9 y6 Z9 K* K+ x- {2 t
, u* B& u5 D: m4 iThe program will execute 6 different SIce commands located at ds:dx, which
, P' J: |4 `7 {) J" X# v& Gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
6 E* A' ?) ~% }2 d1 w9 I3 D& g
/ L/ z5 }! o! f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ u1 v, H9 Z# R' X1 Y) d2 c___________________________________________________________________________" C" j. u. ~4 \4 w- L9 V/ W9 `
- p' B; c) j; b
& |" \, W( v- C! Z1 N/ F1 r0 E6 \! |Method 03
8 h4 V: Y7 G! k$ t8 N. j% Q% z=========4 s# ?$ a) F( F2 r8 E
% }8 R! c$ g' p5 a1 [Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 P. D: m" y7 Q, k3 q3 ~
(API Get entry point)& h; t- k( F+ r4 `3 \ Q0 h
, [8 _1 ]1 M9 o' c7 R
/ A! k+ j- N8 P6 m0 z) O% G xor di,di
. O- O6 C2 H1 A8 f4 k4 m6 ` mov es,di
- d* `- ^$ U* \" q+ K mov ax, 1684h
9 Q, @: R/ @' i+ c/ a mov bx, 0202h ; VxD ID of winice( F2 V: \/ v1 x1 g
int 2Fh
" M: {& ^/ E9 l# B mov ax, es ; ES:DI -> VxD API entry point
; q0 h$ L6 J- g: J4 ~; c$ g add ax, di5 O, h( j& a! o, @5 z
test ax,ax
$ d& S/ C- H6 S( c' W jnz SoftICE_Detected
! U) X( ]' O- ]& z" y
4 R$ T! f5 ^7 [, y+ r___________________________________________________________________________
5 i9 z& o% p d* c* H8 P- r5 v1 @# v% o6 j' U1 R/ \
Method 04+ R( @* z; ^; F( W" q1 l
=========
* O9 T+ q; Y5 n' [$ X
, V" L+ j8 b0 }* gMethod identical to the preceding one except that it seeks the ID of SoftICE$ p! v/ q) u' ~5 }3 T: U0 A
GFX VxD.4 m2 e( I; A' h1 y- J1 X7 Y* W0 V( Z
5 \8 _4 o" B6 [' Q6 V- O% b
xor di,di+ Z8 @0 `6 D8 \! c) [
mov es,di4 r! u6 I& U+ X( Z+ K! Z
mov ax, 1684h
v" o1 ]8 N' O3 ~( e$ p }4 ^3 e mov bx, 7a5Fh ; VxD ID of SIWVID
. k5 S# I1 b1 g. Z6 t( B$ e f int 2fh3 P, E; \3 V t$ Z
mov ax, es ; ES:DI -> VxD API entry point
' B- y7 [9 D* Y2 H- h9 p' j( T add ax, di
; q, N4 ^7 V7 {, t# a' |5 l+ k& g test ax,ax
! O4 n; m' G4 k5 l0 h5 ^3 w jnz SoftICE_Detected" J$ P; m' U; Y }
6 B+ }2 \$ \% I9 y__________________________________________________________________________
( b2 n; O: L# a4 U# Q; @! \
4 h, n6 ~+ y* Z1 N9 G7 z
3 g* l+ \# u; K6 E/ wMethod 059 y* ?( I: J4 G6 B, m5 ^. o
=========
$ l% H( G" V. s, q' @% E: O
& y* h* B/ ^2 b: XMethod seeking the 'magic number' 0F386h returned (in ax) by all system
+ u/ S, G) s) U J1 a wdebugger. It calls the int 41h, function 4Fh.
' Q2 v1 n$ C& wThere are several alternatives. W; ^- m# q2 }, e; o) ~: ]. a
0 K# e% H0 C4 Z7 |/ LThe following one is the simplest:6 O9 P, f2 Q1 A! r7 Q7 R3 ~1 b
9 w+ S9 p" S* `9 ^* i, x* f mov ax,4fh
3 a4 ^, w. n8 l1 H% V( [) _0 q2 V int 41h
- [) H$ D9 d/ J/ ^) C* V3 B8 O cmp ax, 0F3869 q( `0 D7 Q8 `, `5 r/ y
jz SoftICE_detected
; l7 R5 `, z+ ~5 f( ~$ s. Y: \( V. `6 C5 ?' I) k
- n2 ?. {5 g3 hNext method as well as the following one are 2 examples from Stone's , N! o$ S4 `$ F* M6 E3 Y
"stn-wid.zip" (www.cracking.net):
]# t. L# v. P# n+ R9 c: f
- q0 R* o2 Y. r$ p) j2 { mov bx, cs
# Z8 P# w- {/ @1 {) A0 e! K lea dx, int41handler25 ~1 L t" W0 Y3 V5 f% }
xchg dx, es:[41h*4]
( ~9 N$ \: H& U8 ^8 C2 o5 {" i xchg bx, es:[41h*4+2]
6 l0 M2 D* C6 U/ S/ j9 C mov ax,4fh/ K8 ~8 Q" x4 Q% D0 h
int 41h
- Z) G0 y' X& x' U L xchg dx, es:[41h*4] o; p, _2 ?8 J( N. {
xchg bx, es:[41h*4+2]+ ?" p/ L9 H5 j
cmp ax, 0f386h) y& W9 c* _) V0 D2 [
jz SoftICE_detected' @6 F5 K7 B9 h+ ~2 X- ^
/ o' V3 F* N+ ^" A& w& d
int41handler2 PROC
2 g9 L' S) e ~) V, e* H iret2 X4 V; L! V8 w9 t
int41handler2 ENDP8 h3 {' @. G% G. I9 G1 S
5 x* V% g% ?9 @4 `6 y3 K; |4 h
$ E- I4 }( F' R' T6 T_________________________________________________________________________( Y8 |* {5 R2 U: i, ^
4 O+ C( o( F* a; I3 [& h0 Y7 \+ [5 m
Method 060 e5 D3 g' l. [! N3 d
=========
* n* [2 v$ K; C1 e7 l
% ~7 d+ u8 v) A& T C1 ]
" I( G* Y' ]6 k! Q5 J2 G2nd method similar to the preceding one but more difficult to detect:
8 G9 a' ^8 y* m, g$ o( i/ Q
4 w) F6 T2 l% g6 \* E1 p4 _% |/ O# T1 h/ x6 N" e) N+ j
int41handler PROC
) @3 P( Q: }# B; J0 b& @+ z# g mov cl,al5 a: e: e6 w& B& @0 B
iret2 y/ |7 H0 w1 X5 o; e* t/ [% E
int41handler ENDP- o( \( m& |1 e3 x3 p: j/ T
( |" R) W1 C. N2 ]" x. r
|- c% b/ j& J; V1 a- T2 R: U# S xor ax,ax
h" m8 s: X& H mov es,ax& C& \% k1 `, P/ ^/ Z5 q
mov bx, cs
& c" ?* D8 }4 c8 ~* f3 n lea dx, int41handler
d5 p/ L9 H- c c xchg dx, es:[41h*4]
0 m+ m/ P p) j; U xchg bx, es:[41h*4+2]- Y9 y1 }% A1 T2 R" \% E- }* J0 H
in al, 40h
6 z+ I. N, H% R: Z# G2 M xor cx,cx
: x& E6 Q. m8 s* A _8 H int 41h
! j5 z* V2 l+ W* D xchg dx, es:[41h*4]
% Y4 M' |4 y8 J3 P" ^ xchg bx, es:[41h*4+2]% ^6 m( H" s# c9 F' B5 Q; X {
cmp cl,al
3 C9 t1 Y0 x q; U) I, y jnz SoftICE_detected
% v% A* x- O, @7 M: [: U2 l* R, G. y! x! c9 T& O$ J
_________________________________________________________________________
# f! [# b& n- e, z. r% d( h# f9 Z
) a* c% S8 |" n9 I" bMethod 078 y }" `/ z' K" s: p7 C; g
=========
0 o2 f& e4 J3 l0 i$ Z: s* |9 y) ~" W* X7 M _9 t
Method of detection of the WinICE handler in the int68h (V86)
! p: q4 W& \ J& I" o6 A- w
! R" C+ b( Z5 ]0 ^) \ mov ah,43h
) g C( w9 H& S- ]+ y0 H int 68h3 c+ y, M" I7 p$ w: d+ b# `- o' B
cmp ax,0F386h
2 P& a& d6 X* E G jz SoftICE_Detected
9 j$ i0 @; k' I% f% O0 M) c) R& J# l6 E L3 P
( \2 d' ?3 \+ B; _. L=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, K) E: c( _0 p2 }
app like this:8 O, J5 p9 ^; S1 B. t
7 @* R2 ^2 K/ |& h9 P
BPX exec_int if ax==68
# a" @0 G; Z4 T R F0 d (function called is located at byte ptr [ebp+1Dh] and client eip is
6 @9 o2 |) ?# K) h# \ L located at [ebp+48h] for 32Bit apps)6 S/ R. x5 T6 J2 o8 j5 o
__________________________________________________________________________
5 s& q: m& B, ?5 }: K7 N W/ W- [* k0 ?
% R" ~) |0 H6 ?5 i- s; O# S& AMethod 08
( A# o0 I @9 m) O6 a=========
p/ `+ f- ~ N; _
$ D, L4 v7 E% r1 K; y7 FIt is not a method of detection of SoftICE but a possibility to crash the
3 B% v& b0 F! d; J/ t. h2 Q: K# ?system by intercepting int 01h and int 03h and redirecting them to another7 q( m7 U2 C( P8 X, E+ O
routine.
9 X- |( g, L. G7 [+ C& w; \( C/ nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 u8 |( \# r3 G- n
to the new routine to execute (hangs computer...)/ {) J+ p) Y8 z4 F
8 q$ F: Z3 g+ w" n, [! O
mov ah, 25h }1 W3 n7 Z+ E2 ]" }& g- a
mov al, Int_Number (01h or 03h)
, m H3 V9 X% s2 N0 | mov dx, offset New_Int_Routine, y) u) I- P3 J6 o! v
int 21h" z: e+ M- n* I( M* N
0 }) E7 }5 G; z/ l: A# u__________________________________________________________________________; T" _3 [$ k/ \' G8 D
E# K+ Y. @$ C' I/ g( X! @
Method 09
! h+ K+ ]3 l4 C7 Y* _" W- h# H=========" m7 g5 g3 E* R- ~ S) [8 Z3 B
" J) O, O- @/ mThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
2 V. F" z2 Q" ]% `: z7 Qperformed in ring0 (VxD or a ring3 app using the VxdCall).; }7 R0 a; n* {; {8 H' P
The Get_DDB service is used to determine whether or not a VxD is installed% e( Z( F! T1 P, m
for the specified device and returns a Device Description Block (in ecx) for
( w8 O2 c; }! ~. q' Tthat device if it is installed.) H! {5 }% R; Y4 i7 M, }
# O+ H1 C. W" j mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 I. f( K. z1 O3 T( m1 a
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# W) L. V- i4 i; a0 g; C! b
VMMCall Get_DDB! f) h5 I' Q0 R6 U+ e( ^
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ s& j; L9 g; c- P
) `, |9 C/ ?2 q$ C! u) [/ A" J2 LNote as well that you can easily detect this method with SoftICE:" ~" b) n* |& V/ C( t
bpx Get_DDB if ax==0202 || ax==7a5fh- z2 y: M+ J: \
% C$ E6 q1 m! Z: z4 @5 q" l# {
__________________________________________________________________________/ ]& k; d% V9 g1 k) E k( ]- p
6 D4 e& L o7 C+ y! ]$ tMethod 10
& ?) z, J* E9 l. v=========* h# _- K) _* F& A
# t* ^3 f1 b: t j=>Disable or clear breakpoints before using this feature. DO NOT trace with: Z; B4 u) a% O' q: ]" I* V
SoftICE while the option is enable!!
8 ?& Q! N* l0 D' G: ?8 P# V6 J! j6 p8 J+ c! l
This trick is very efficient:2 ~* B* C4 R; c9 y, G
by checking the Debug Registers, you can detect if SoftICE is loaded
9 }4 Y7 `( H6 T# Y. `, s( \; h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 Q c% E7 V9 Q [
there are some memory breakpoints set (dr0 to dr3) simply by reading their
' H6 S/ n8 u& S* |: zvalue (in ring0 only). Values can be manipulated and or changed as well
/ G, k8 V' ]* [ k; v9 ?(clearing BPMs for instance)
; ^3 ^/ E. H( U! U- L
; _& b5 I! P, S- i__________________________________________________________________________7 ~. S$ v. t* v( l1 I8 D" P8 \# y
+ ]) C* \# _" g+ d% }; n" EMethod 11
" G. O' } J* G3 \( ~=========3 ?- J3 Q3 v* G, n( D
h }9 N9 g" `$ ^& `8 |$ v! @ XThis method is most known as 'MeltICE' because it has been freely distributed k. ?3 M3 V) T, R
via www.winfiles.com. However it was first used by NuMega people to allow/ P# Z# C% j4 I6 t& ]( ?$ L
Symbol Loader to check if SoftICE was active or not (the code is located" A: W6 a7 F( ~+ u2 ?) _
inside nmtrans.dll).3 {4 {1 ?' [# S6 x/ _) K( u
* f a5 t* O: C6 {9 ~ p
The way it works is very simple:% S5 r; h3 f5 b$ {
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% c- I6 t& _: G0 o
WinNT) with the CreateFileA API.
: U7 Q% L# n( V8 g' |: p) l5 h' N: D2 ^, k& K
Here is a sample (checking for 'SICE'):
9 l: ^ ~+ S/ D1 B) \) H1 T8 c" s
w3 e. M4 K/ W2 vBOOL IsSoftIce95Loaded()0 z! U' ~8 o3 ^ Z! ~8 @' `
{) d$ T2 B7 A, Q9 m3 ^- o
HANDLE hFile;
& t) ]. c$ a. x2 ]! K hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 d% v e3 k3 P; a5 O FILE_SHARE_READ | FILE_SHARE_WRITE,
* w& p2 U; w* r, R: p; N NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ ?7 d2 F ]) R if( hFile != INVALID_HANDLE_VALUE )$ x4 Z J1 E' y2 p, T- P. q
{/ T2 j0 \& b* @' m* V1 c
CloseHandle(hFile);
m x* R- S* U, o' T- o# L, R0 e7 a return TRUE;/ j! j7 y7 P5 }, L" o* F
}
( L$ _% ]# `9 K( I6 U1 F `! t return FALSE;
# o" Z' B, y7 A/ W0 {$ i4 P}
3 L4 ]- Z0 _0 E* g m) B0 S7 v/ ~- N/ C
Although this trick calls the CreateFileA function, don't even expect to be0 _% d& `) F, d- F
able to intercept it by installing a IFS hook: it will not work, no way!
/ B+ q0 L0 l0 |. S9 |In fact, after the call to CreateFileA it will get through VWIN32 0x001F! N% W7 Z$ K. M$ C8 d, f/ ?/ ?5 v
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 Y" m# B0 Z% h7 g, h; Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
* J4 N/ e3 F9 Z; [/ w) M4 S& Cfield.
' H. p% m3 E. V+ M. NIn fact, its purpose is not to load/unload VxDs but only to send a
, c! A: K& N, m0 |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE) B) o( M m( h0 v/ J* m
to the VxD Control_Dispatch proc (how the hell a shareware soft could try: f0 v4 h/ m5 L4 {1 W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! v5 q' v' c" ~0 \. X! A4 UIf the VxD is loaded, it will always clear eax and the Carry flag to allow8 D; t/ w+ o2 q6 Z. F
its handle to be opened and then, will be detected.: N. j/ N' E* z' P3 s
You can check that simply by hooking Winice.exe control proc entry point; A# G4 V* e& I$ \9 q
while running MeltICE.
$ C" L: g" Q6 Y5 m! z9 m1 u: i$ K. E) K+ R, Q
3 k/ J% {! Y% D6 F8 H; |
00401067: push 00402025 ; \\.\SICE v, n) _; w/ V& F9 m& @% s4 o
0040106C: call CreateFileA2 O- n( S- I# i5 V9 z0 H3 A
00401071: cmp eax,-001
6 \. Y. j! z) e& n1 O! o 00401074: je 00401091
) w1 _3 J# P4 _
3 P( N% h8 v& e! U0 @
$ {2 Y/ x1 D1 oThere could be hundreds of BPX you could use to detect this trick.) T3 e* j$ m# [3 M/ O
-The most classical one is:) f3 ^8 h2 X, g# y2 C. ~+ D+ T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( \2 G5 {. Z u! g" }3 d! A
*(esp->4+4)=='NTIC'
2 d/ X: P) M4 p- \3 P5 o) J. p* } Y! J8 h8 B V" X
-The most exotic ones (could be very slooooow :-(
: V( e5 N/ K$ o5 N9 a/ e% n3 U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
+ `' ~3 X* }( v" x ;will break 3 times :-(
6 O3 h5 v* g6 N( O/ k6 n" K% y% g- r6 X7 Q+ t3 X( `7 s
-or (a bit) faster: . K1 l8 W4 E/ K* Z- w8 t, ~# b
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 c' k; {! A$ `* [
. b2 |- \, d% [6 _9 x
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 `( ?; u& n4 ?9 d+ ^5 R ;will break 3 times :-(
3 I8 ]; z7 Q& S6 P$ n5 C0 F
3 p7 V2 _ M! i1 Z' T5 ~-Much faster:
+ ?* X- \5 O% |" L9 y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ Z$ \. j. {+ y; J' ?# M) d) |# `0 l- I1 m% F% Q8 W
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! G8 T9 x! n9 ^+ cfunction to do the same job:4 I$ g8 @5 V7 \' S" a* [2 m7 V
' @6 l" J9 \1 b% e7 |
push 00 ; OF_READ
% A# Q( Y& _# G! b8 w mov eax,[00656634] ; '\\.\SICE',0! K) @* R9 q7 D0 |$ \6 F
push eax i9 z1 q% K. M- T& @
call KERNEL32!_lopen
& v5 K9 ~# k. e2 s) n5 b" u inc eax
& J9 v2 a. ]- {" u; x; { jnz 00650589 ; detected
! F q; P. V( T( X push 00 ; OF_READ
8 U0 \0 ~/ V) n& O3 ~ mov eax,[00656638] ; '\\.\SICE'( J3 d# d$ |" }' l) u9 _9 c
push eax- u0 p3 G0 {! I# z6 g
call KERNEL32!_lopen
+ @& b$ m7 ~7 j* V inc eax
. a X- s. x, ~" E& s" k jz 006505ae ; not detected
1 B* G4 N5 ]! @4 Y6 z( v& P( a! t% D' b4 _
) X5 i- I$ P3 k! r) q: b! ~" W6 U$ h6 g__________________________________________________________________________1 Y" C" B0 }4 q+ M u/ w2 `! P
5 i, z& j& s: K# F3 T0 l5 M
Method 122 U! S* M/ f& i* u+ n4 `
=========
+ x1 ]$ n1 _. B/ C% {1 q* ~
7 w, A( R7 o- ?6 vThis trick is similar to int41h/4fh Debugger installation check (code 05: G$ z- N2 T* u7 p& U, b/ v8 ~
& 06) but very limited because it's only available for Win95/98 (not NT)
- f7 @( L/ z0 X/ B+ {as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 n" J- A. v+ A
. S1 D- x: _8 N push 0000004fh ; function 4fh+ X% Y: Z( R( |1 x1 s+ y2 e4 |$ |9 V
push 002a002ah ; high word specifies which VxD (VWIN32)* Z8 j5 z- C5 J! k
; low word specifies which service3 @8 X( y' p @! G& X; b& g
(VWIN32_Int41Dispatch)
4 h: J' K9 t7 V& L6 x+ ` call Kernel32!ORD_001 ; VxdCall( d" b4 ?% `# [
cmp ax, 0f386h ; magic number returned by system debuggers# ~' d$ {$ F9 `# {
jz SoftICE_detected
% x0 C: Q- C6 J' g: g7 Y" J( [0 [
Here again, several ways to detect it:/ @9 B( B+ k( N" ?5 s' l1 Y- H1 w
/ Y5 X2 Q- x* U" E. [: b BPINT 41 if ax==4f! c( a6 f( z3 u8 C6 h2 S: p% `
0 F. b8 \2 F( b& {. m0 p2 T- A7 u: d
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 s: T, d/ K. P- g1 Y/ T" m
. @3 [, H" R( b2 d6 w' _" H% E I- X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 N1 _ K5 l. X1 u1 i
% z* ~9 Y n3 w6 l BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' W. v% L s& F( ]" S/ P4 s( O1 B7 t: a. \- e9 N+ s. [
__________________________________________________________________________
- a* ]! Q: X, V- |5 |4 j
8 c; w. w1 I. i6 rMethod 13
# I# L4 d( q- Q& S+ ^=========
7 P, M' S1 }7 N, T5 I
1 ~) W0 z) U) S( V. i- DNot a real method of detection, but a good way to know if SoftICE is# n1 I! w6 M# ^7 H* U3 [- m
installed on a computer and to locate its installation directory.
$ F5 d+ x# G. g7 P) d3 TIt is used by few softs which access the following registry keys (usually #2) :
0 S1 t( x# C& R; h7 S% f. P G" W0 [6 ?; L; ]# {
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 G: @) z3 f C( L5 ]
\Uninstall\SoftICE
0 M% r* n% _, M9 J' L, i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" I* o! k1 h9 s6 S/ b-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ k3 r& n9 j! O$ `, p$ M0 r\App Paths\Loader32.Exe$ D/ A+ \% u M9 C
7 g3 ?, o, \# Y7 Z$ _! V7 h& t* n, b/ _4 _2 P4 @- i
Note that some nasty apps could then erase all files from SoftICE directory
6 n. {( a5 h/ e* @' t(I faced that once :-(. C* r. a: g ^2 T
, ~1 o; D% b' ^0 g9 H2 }" x
Useful breakpoint to detect it:: b. Z0 s/ ^; E2 J, E; G @
' p6 v6 a; Z/ @) P
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ S& Y5 X9 d$ e+ T( s; ~% B+ o' e. N& O) u9 M3 b \2 J
__________________________________________________________________________
( c9 h6 v- b% R- N; K7 x: W1 n. p& C8 D4 p- {- C- K6 v
! V8 j" E; ]+ M
Method 14 A) R1 U: Y' `! z
=========+ U; C2 i$ m% R- q
$ O, c# [0 |) M1 t$ aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: D: \4 b8 @' w8 Tis to determines whether a debugger is running on your system (ring0 only).8 ~& [. Y5 H: O, `5 R7 m9 ]; k. [
$ \2 [7 F. a1 Y, U( X1 D3 J& L VMMCall Test_Debug_Installed
/ {7 d3 l5 {& W1 a: r" }2 A8 ~! E3 n' Q je not_installed
- U/ j# s& u% {+ m A; V- {! t4 a' ~) w9 Z: t+ O7 F9 u' y+ I
This service just checks a flag.+ _1 r: S% s; W4 Z0 r7 @& {5 O
</PRE></TD></TR></TBODY></TABLE> |