<TABLE width=500>( z2 I$ V- t) h* m
<TBODY>( Y/ s1 t, p/ W) V$ o/ C1 ^
<TR>( k! l- T. y' d5 L( x# i2 [
<TD><PRE>Method 01
2 P- E( b1 c( z8 f1 E! \. l=========
2 d1 O2 c% {9 @) ]7 \3 F. I
- B& D8 s* Y8 S* R) WThis method of detection of SoftICE (as well as the following one) is! U6 c9 L5 c4 h% d1 p: }* v; {9 P
used by the majority of packers/encryptors found on Internet.
& f5 g. p G2 @5 b+ z1 A) x+ _$ y6 oIt seeks the signature of BoundsChecker in SoftICE8 O$ E/ I. G' t) B* b. J
, {( o1 j9 |5 ^2 ]- m1 ? mov ebp, 04243484Bh ; 'BCHK'0 o! F+ f) A1 m* s+ i
mov ax, 04h) W( i) x; x1 j, M2 B: f+ B
int 3
* d2 {. F; A; I$ h, x cmp al,4
9 I$ X' l" a, Y+ Y) w- Z jnz SoftICE_Detected
" b/ j9 j8 |( J" U' D+ h
9 Z/ z$ Y4 S; n1 h; ?___________________________________________________________________________
+ W) T2 u E6 a8 ~4 I* ~; `2 X: G& {/ }: D
Method 02/ m+ s; |3 Z( S" P- u- J( q) Y
=========# W. o' h. \5 D, I0 [
' Z( q P/ w$ Z( x# o# T O$ k, G
Still a method very much used (perhaps the most frequent one). It is used
# b6 c7 w8 t9 J/ D' ^! Nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& E5 O6 R# S3 \or execute SoftICE commands...$ j r& g* @# t" y' }
It is also used to crash SoftICE and to force it to execute any commands
# T; X/ ~4 X. i( x' k7 H(HBOOT...) :-((
) Z! s* u# H7 d( r3 P! g
! K5 w% U& p* P& [$ z2 {/ @Here is a quick description:' w/ ?9 A- d7 G% b) V
-AX = 0910h (Display string in SIce windows)1 s9 D( B( ~) }3 P$ e0 t/ R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
+ w1 q+ u: i: r0 k-AX = 0912h (Get breakpoint infos), V9 W4 F8 S) x6 C7 x
-AX = 0913h (Set Sice breakpoints)
+ t1 N+ u3 j3 h) V G% Z' Q4 E-AX = 0914h (Remove SIce breakoints)3 T8 @& {) Q# w) D& V" S! \) |
% @4 }- E- n* Y1 B V0 xEach time you'll meet this trick, you'll see:4 \, ^' e1 ?# N+ K
-SI = 4647h4 \1 n6 k4 s @$ C' `& ~+ W
-DI = 4A4Dh
0 ~. p/ w3 N- q3 Q# H: N! q; {& DWhich are the 'magic values' used by SoftIce.
- z7 n7 |8 F4 c9 S, k" n f/ PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 k, s7 G5 _8 X1 P
! O' L5 w! _) n$ x0 yHere is one example from the file "Haspinst.exe" which is the dongle HASP
& t. u* H& B- B& ^1 bEnvelope utility use to protect DOS applications:$ S8 \9 ]" H) {$ x4 J
2 R5 D& r+ s* |4 i( A% R* M$ o- U' E8 A! ^' U3 N3 y
4C19:0095 MOV AX,0911 ; execute command.
6 g/ g5 m; s! _2 m4 B1 D$ U4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).! ? w& j: Q7 R, c: B
4C19:009A MOV SI,4647 ; 1st magic value.0 q& v; p; U+ r1 s- |& q0 }5 E
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 Z) T( I3 v1 \0 s2 U1 A4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 \& N$ u& i7 f m2 X$ @4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute& _" z% D7 _4 P2 H2 }
4C19:00A4 INC CX
O! @6 f4 }/ w6 V" r4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
% A, d( b' s8 U: Y3 K* N8 c9 n4C19:00A8 JB 0095 ; 6 different commands.; T- Q* @" c! k) E3 j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
) f" g% r1 W8 i3 s" w* J4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) J+ Z% z1 A* `- Z: P) }% f, x4 v6 \' P! O2 G7 O* r) ?! w
The program will execute 6 different SIce commands located at ds:dx, which
% q" L0 S! y6 n$ Ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.) V6 W7 J' m. Z7 ~! Z; T
N* O( ]% O+ S% l: u* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 T& o% u' X( i, ?___________________________________________________________________________! Z2 x# P3 q u- A7 C* v
' d+ S7 Y6 f/ p0 r' H$ }: {
& V" Z% ?; G' p3 T3 Y
Method 03
! {, K4 s; u; B3 d3 P! E! a5 O=========
% G! n8 c8 R! _" h5 j* b& t$ _
& k4 ~- G4 }8 N2 B7 ]4 y$ m9 O b2 VLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 R$ K) w3 b, \1 P( t$ Q
(API Get entry point)
: s6 S4 I5 F& Z# v- A' S ) M1 m, z+ d. g4 X5 S6 C/ y
% U, Y& q% a. u' d xor di,di7 r1 ^/ D* }5 Q* X/ r, j- M/ A0 L; C
mov es,di
! L9 N5 p9 g! Q& J: D mov ax, 1684h
8 q, Q# D* ~! u6 g: W& y mov bx, 0202h ; VxD ID of winice
0 u& t& v2 `5 {" a1 _; P6 ] int 2Fh
% w7 h! {1 r0 x mov ax, es ; ES:DI -> VxD API entry point% _) H6 d( L$ [4 t
add ax, di3 n: J) d5 _2 O# l% z# V& x
test ax,ax3 @# E) Y% \ B9 D- @/ t
jnz SoftICE_Detected& S, A7 \$ Z1 `7 h# c
3 {1 ~- {; z C7 v) u. v( ^& R) K& L
___________________________________________________________________________. T1 a+ {* x* ]% T* J
( Q& U! G' x7 ^# }: x2 N$ Q( _! v
Method 04
0 G3 X+ s. v8 ~) A8 u( v, ~1 l R=========
% v& y- F/ ^: Z' u m: b
: p4 h. I& f* n& `* |) Q; NMethod identical to the preceding one except that it seeks the ID of SoftICE
# ]/ M' i- _* `3 K+ x3 D! pGFX VxD.
! R+ X3 c1 I, k5 w4 x a8 ] i6 a4 O
xor di,di4 [# P+ H8 ?$ }7 i$ I& o/ s
mov es,di
3 R& e* M5 l1 r9 P mov ax, 1684h
# d% g: X) s8 c; R) d _( q mov bx, 7a5Fh ; VxD ID of SIWVID7 @/ ]* N7 U/ f+ b# P# _0 @
int 2fh
3 @+ ^. I# C7 U6 a mov ax, es ; ES:DI -> VxD API entry point
, u" r) ]* A( a5 f: o2 x add ax, di
1 [9 g; |5 A+ L, s* I. m test ax,ax/ t' `3 r( c6 w" z
jnz SoftICE_Detected2 p A+ _* p1 j5 G' L) S
5 [# }) T4 T0 Y0 J/ s( t
__________________________________________________________________________5 d- B! F. h+ H6 r* J
# O& H4 ~, O% s- [
+ e9 f* n8 E4 f. WMethod 05
& z* _! S* }9 Q7 [7 g8 s=========
) l1 y2 s% p# V) J9 j e/ L; I+ A! E7 i" ]4 \- S
Method seeking the 'magic number' 0F386h returned (in ax) by all system S$ F6 w5 ~4 F3 T$ Z2 [7 A
debugger. It calls the int 41h, function 4Fh.- v" c$ L7 E' A
There are several alternatives.
* r2 a- L1 a+ a: [0 E5 ?) F) ^, z# M X% J! P; [
The following one is the simplest:
; [! U. ?# `1 g- V2 M3 K; e
+ Q+ Q% Z4 e1 r$ Q" b+ H mov ax,4fh
* \8 @* u# l5 W) k' x3 h1 q5 X int 41h
; E5 B' K' q5 Y# J% ^8 y0 v cmp ax, 0F3868 M. N' R+ r7 ^. @- O2 W3 j
jz SoftICE_detected
: X$ G i$ p# i- ?* P+ x# S' I5 |5 V4 W$ K1 N! S. v
$ Z6 P: ~+ m+ x2 ?1 U
Next method as well as the following one are 2 examples from Stone's $ {4 v! a' u4 H
"stn-wid.zip" (www.cracking.net):
3 E# g# N9 l j# g& l6 g+ d/ C6 G4 e2 H9 w: ~/ l+ S, [2 Z
mov bx, cs; p. t% t- l6 b# ^: ]
lea dx, int41handler28 O6 \8 [2 V3 h7 P7 N/ v# Z/ d
xchg dx, es:[41h*4]
/ [& Y8 K d% {( A4 b0 L7 o xchg bx, es:[41h*4+2]
% r* T5 G8 Y6 u* V: Y5 G/ r9 D mov ax,4fh
: W9 k5 J5 H" T5 j int 41h( h& H! T: F4 ~4 L9 S. V( j
xchg dx, es:[41h*4]
5 }8 M G1 e1 X, r e6 O P" N xchg bx, es:[41h*4+2]
" e6 N" }0 b# q3 X# F6 L cmp ax, 0f386h9 d8 k8 d5 {3 o. u0 l
jz SoftICE_detected8 m* S7 z& M* O: b4 C
6 q, L X" i( k" l; w
int41handler2 PROC
( [# v( V0 E, b" P# y iret6 E. C0 G# n [
int41handler2 ENDP
# s7 d8 F/ c" |7 ~6 G g1 k/ s0 u* b& W1 H( ^3 Q" V
- i& G# S% {* E: i* c( q_________________________________________________________________________
, I6 g* u, v8 h- E' i" ~5 @
' h! Y! g8 d+ g2 S6 _* ^4 G! N4 a- H8 ~1 b( W, M
Method 06" l2 i' [5 W9 s
=========
; v8 Q: M$ ?% _/ X
: g4 j' ^- I, G' L( y- A
; e+ l* {& J9 A1 b8 [1 B2nd method similar to the preceding one but more difficult to detect:
/ E& x; K6 y3 G3 J! E/ e! `, W( i% {' @6 R2 ~$ [
" \/ X; J. S; e7 {int41handler PROC
4 w- H; v6 `: [ mov cl,al
4 w0 E( W; t$ v, D iret$ A+ m" a/ K7 s& n- j0 l, ~1 ?
int41handler ENDP
5 j3 |( a: {' }; ?% g3 F2 p4 R; u8 d( S. R
( j9 t: b$ O) C/ O$ t0 K xor ax,ax
6 `4 n$ g: x, Y( Q$ m( D1 _ mov es,ax2 T. r& v4 c% }
mov bx, cs
" P7 d! q9 r" T# u' q% k lea dx, int41handler" Z* c' s. B9 l. ]; k8 U
xchg dx, es:[41h*4]- U- R1 s& I" D5 _6 w
xchg bx, es:[41h*4+2]) ^8 C1 m8 O- p" D6 x+ K4 l
in al, 40h
: o' }$ S @" q; [ xor cx,cx
; s7 J" A% D0 t9 F& e0 ]: Y# W int 41h$ }3 }: m) }: f/ ?# U
xchg dx, es:[41h*4]: u* t: a: B! Q+ ]
xchg bx, es:[41h*4+2]8 e! O& M j2 _" R) V& G6 G
cmp cl,al8 n" w5 F6 r$ q2 {6 P [2 m
jnz SoftICE_detected- k, i% _; G& G3 O7 U0 z4 r
/ r5 I+ E6 A4 F' I) n0 Z1 v7 X3 U
_________________________________________________________________________+ X4 _- D0 E" B3 |, n3 ]* b: z5 `% j
! p" F: J6 L; T6 G1 ZMethod 07
1 [' Y- R2 P; ^=========, u! @" o5 [7 Q
1 u2 h( _2 T1 X! v P
Method of detection of the WinICE handler in the int68h (V86)$ M) f/ ], `7 ^2 q6 Q
: L( R: O" C w; n( M mov ah,43h s; i% A" k$ L6 Y2 m6 P$ ^
int 68h9 k1 \' G$ C1 P5 o
cmp ax,0F386h
7 V# ? _3 t y+ p, c2 F0 a. v jz SoftICE_Detected3 C2 w0 V5 y9 @
* U8 x3 X: S" ] N9 U8 k; W
* F* D# X' ?/ G6 v/ H
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, X, H7 ?# p$ s0 x$ \
app like this:" w2 ?5 X3 Q: c+ t
" D' b; s0 e) O8 [9 t0 W3 }
BPX exec_int if ax==68
- \# J' _( u7 l+ D0 \ (function called is located at byte ptr [ebp+1Dh] and client eip is
3 z) |: ?. a# T8 k7 X& o% O located at [ebp+48h] for 32Bit apps)
- n2 l5 }# |1 ^4 N! o/ V% M% V__________________________________________________________________________* x6 d8 X/ q: u0 `" O
3 v; G( i: {) o9 [8 ]( ^! h# F$ v; F7 Y: m8 X
Method 084 u+ H, J" K6 ?
=========, {0 b) R7 K% |' m$ B" {/ ]7 H! q0 }
" U0 h: T6 T5 |) l, I5 BIt is not a method of detection of SoftICE but a possibility to crash the
% v% r) \% N9 `' K' ^& k S; }system by intercepting int 01h and int 03h and redirecting them to another) d& l2 d/ g9 X+ E* n
routine.2 w9 P3 f: P/ L# x' E
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; X- u: n! b( u# cto the new routine to execute (hangs computer...)& Z4 I; q( D8 e
) e/ R3 }+ d/ z2 d8 z. F mov ah, 25h
. I/ [7 K9 r7 J! ^- q/ q/ i mov al, Int_Number (01h or 03h)
/ T9 o& `6 U, h4 O( [5 k mov dx, offset New_Int_Routine, M; J Q+ _4 h0 I1 @ Y. [2 h ]
int 21h% Y2 S! P" j. V% c
. k; r6 i/ h( I
__________________________________________________________________________) x! P8 m/ E3 t$ s
( r) @! ~# g5 K5 [+ h. F7 x& k
Method 09! l1 G" }" u" E. o
=========- w4 e! `! J) t
9 J3 s. a" @$ Q9 o
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 b& D% r( u" ~: ?" ^performed in ring0 (VxD or a ring3 app using the VxdCall).: S! ~# c" F* [, ?1 i0 ]! N$ D
The Get_DDB service is used to determine whether or not a VxD is installed8 a9 x) R- @- x0 y0 {* a% s
for the specified device and returns a Device Description Block (in ecx) for9 T4 Q. z p4 N% k2 W, k8 s
that device if it is installed.
# z5 G. o( x5 K2 ]+ X$ p4 N Q" Y0 N
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ f" }2 Y9 E& G5 g ?) O N! L. y% T mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" l9 h6 U7 k+ j VMMCall Get_DDB# ?/ n' o' o4 v6 Z% X- A' x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) x9 m2 t, h5 h/ w/ U
# n5 t0 r) w& h: H0 UNote as well that you can easily detect this method with SoftICE:, F4 b. r. {2 g+ c
bpx Get_DDB if ax==0202 || ax==7a5fh& J% l+ B: E+ w/ t N
- `3 L$ O9 V' ?& A
__________________________________________________________________________
9 S3 ^- e* ]( T
$ G( |$ G0 n2 |7 g% m3 KMethod 10* |' R+ T0 M. @
=========- p. h7 H2 x: R9 f0 B' L" `( Y# H
* }0 Y U" l; E0 O) I
=>Disable or clear breakpoints before using this feature. DO NOT trace with
" E% H: j! C8 l- ~% U SoftICE while the option is enable!!% d2 F0 q4 `: ~3 o
* ~" T+ n" v/ X& N! |0 fThis trick is very efficient:
1 U" I% I! R' } @: x- {by checking the Debug Registers, you can detect if SoftICE is loaded
# R/ ]8 |/ s; j" J5 g(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 k" _4 |) m9 a' n! C
there are some memory breakpoints set (dr0 to dr3) simply by reading their3 f4 C" l0 {& p3 D
value (in ring0 only). Values can be manipulated and or changed as well. H p u. E7 [
(clearing BPMs for instance) `+ E: U) h/ E' \2 R w
/ j2 v- e0 R# [" m__________________________________________________________________________
+ |6 [& u3 u* O$ Y0 c/ Q
# }7 v- F% d% }* C8 y. fMethod 116 A; O6 Z6 B; J! ^ u0 [: ~
=========
$ @3 x4 I( n4 k: ~2 E
3 Y2 _0 a) ]( }) XThis method is most known as 'MeltICE' because it has been freely distributed( F5 { A$ h& f% W% S* c% G
via www.winfiles.com. However it was first used by NuMega people to allow& s3 v- }1 X: v4 H
Symbol Loader to check if SoftICE was active or not (the code is located
" C' e0 \. r7 v5 A0 y# finside nmtrans.dll).: q" C$ f9 h1 b3 E
! s! S z% H. `The way it works is very simple:) p: D9 q( ?" H& M
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# B% z! d! y* y. G" sWinNT) with the CreateFileA API.% [6 q' j% [1 Q
& z3 h6 s9 X' { X: V+ THere is a sample (checking for 'SICE'):
1 ~7 d6 }; s/ y: |* C) |( h$ m# n7 B) b
BOOL IsSoftIce95Loaded(). ]0 `$ q/ |) M
{
0 b4 u# L" [6 \: B HANDLE hFile; 4 w& l# K j" E7 u0 N
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 D' p7 q& Z- Z7 v& B FILE_SHARE_READ | FILE_SHARE_WRITE,5 X, Q& E0 O3 n0 E1 P
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ r: \& k2 a4 ]) A; l4 `3 R
if( hFile != INVALID_HANDLE_VALUE )
: B ^! K1 g/ Z% h+ e {
1 q* C: h& H7 u, ~1 ?. {) r) k$ l CloseHandle(hFile);! ?0 {: L+ j: C* M
return TRUE;
4 ^, D: j0 F. Y8 W2 l }7 O4 |' U: K# {. z! N$ ^/ L! r
return FALSE; p9 k8 N6 ]' X/ l
}3 v8 n( Q5 Y5 y
! `4 K# l+ u5 D: K0 V- [0 P. WAlthough this trick calls the CreateFileA function, don't even expect to be" y1 d% W1 o& H
able to intercept it by installing a IFS hook: it will not work, no way!
- n$ U# Z/ W o1 GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F m/ n; [9 U* N: k4 e
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 j& T, |8 F5 L& y& F: w+ }and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 c" R1 t+ E1 F$ o Q& R5 d- l3 a
field.
% m+ @4 K7 O- e2 |7 \- M' p1 vIn fact, its purpose is not to load/unload VxDs but only to send a
2 y' ]: c. S* }, @4 j5 yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 `) @/ i$ M: [+ c4 n2 C" k9 ato the VxD Control_Dispatch proc (how the hell a shareware soft could try1 b+ B1 {; T4 i0 e
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ H7 p: F6 h# d7 V7 ^& j
If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 J$ f+ l- ~" }- O6 Y3 Iits handle to be opened and then, will be detected.
- h3 b, J; K1 E! y, iYou can check that simply by hooking Winice.exe control proc entry point7 @7 Z! v$ f% ]. \, S
while running MeltICE.* C! T" n8 G/ R2 ]5 ]; J
3 [% C) }7 Y' ^
: C! ]. O+ K; s
00401067: push 00402025 ; \\.\SICE0 v# M+ J$ t6 Y9 u4 E5 [/ N+ l% P
0040106C: call CreateFileA
: b' H3 | t' c8 z! w( g7 \% x 00401071: cmp eax,-001
( c! F* k% h- p$ h! ?8 g5 p% [ 00401074: je 004010910 M4 P. s+ U) ~' G
5 U9 m0 \. i& O& c4 ]2 }
5 a, @' K/ A3 C' v" o. {5 ZThere could be hundreds of BPX you could use to detect this trick.
* _: x4 f+ S0 J6 t5 ~7 ~- U" g-The most classical one is:
& c( H( o! u- g9 b BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' I, R' [5 l4 q5 k, _ *(esp->4+4)=='NTIC'7 `" C) V X( `1 j
' Z/ W, V# Z- K- A: J5 g
-The most exotic ones (could be very slooooow :-(4 X+ y8 t" Q+ D/ a% p+ B$ x
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
3 ^4 |9 _& | k- T4 y" X ;will break 3 times :-(
& o9 E0 D* i3 X7 A, i+ \' F. x: O a+ j) n4 K
-or (a bit) faster:
; } q4 {- _" t3 z- @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
7 s. H9 V, E% U4 j; Y+ }
. m( I( ?& ~3 k; T) j; V BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, H: V2 M, f# _$ _: y ;will break 3 times :-(6 q" g! O' x5 c D
4 b3 m0 O! @4 T6 O3 h8 F
-Much faster:/ @: u* r- W Y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: A7 E6 \9 e# Y" _! u8 z8 Y, Z+ v: M* }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" H6 e8 }5 p# X" T/ _! l3 _8 f# Y/ Sfunction to do the same job:" h7 A) a3 n5 V, k
3 O& c6 I# p% J8 p+ D
push 00 ; OF_READ' c* W, F# f i: {) f3 N# D8 u) h( D
mov eax,[00656634] ; '\\.\SICE',0
7 E8 ]: N% Q& \( p: ~3 V8 B5 M2 r push eax
% ]4 J0 a H, `$ {) l call KERNEL32!_lopen
2 r/ E9 \/ \! B5 u7 ?2 s inc eax
/ b: E4 E, m! W jnz 00650589 ; detected3 ^2 p" \6 w" C) @9 @
push 00 ; OF_READ8 `) H" w+ u# n( k
mov eax,[00656638] ; '\\.\SICE'
: O7 |' l4 B+ C8 S) a push eax' Q$ }( V2 p7 s" @# |$ F. X' q* P
call KERNEL32!_lopen
V: i7 u, h* F; i+ t' f+ X2 i# B inc eax
6 R, N1 C/ c: t9 e X jz 006505ae ; not detected- R+ l7 f# p) P' U x6 N0 X
7 S" O( k5 O3 U! ?" b
! {; l4 x4 i1 j* X+ Y__________________________________________________________________________
6 t1 ^- B X! K Z, y+ O3 F. ]8 v/ C- T4 v% h$ E' N8 F. @
Method 128 ^1 I# B( l: L
=========# }! s% X9 y$ Z( Y( J3 ?
! a* B6 l; Q- w! A* _- x5 K9 _+ BThis trick is similar to int41h/4fh Debugger installation check (code 05
" m, O- p$ @8 F* G9 k" L$ m" G& 06) but very limited because it's only available for Win95/98 (not NT)
7 b! W8 [$ s' j! M- `" C5 V) Z4 V3 eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ T4 a2 e( D0 w2 ]
$ T/ P4 f, R3 s0 e push 0000004fh ; function 4fh
8 p6 `* H- ]2 ^& c8 ?% E" C push 002a002ah ; high word specifies which VxD (VWIN32)
8 C# ]; P! [" N4 T" r) p ; low word specifies which service
" l/ M! x0 B& D6 H2 p0 d7 l (VWIN32_Int41Dispatch)) j0 w! R2 m! r9 F. C# J- O; X
call Kernel32!ORD_001 ; VxdCall
' H- u1 D& [7 c( C/ H cmp ax, 0f386h ; magic number returned by system debuggers
4 U/ \0 Z! M: z jz SoftICE_detected
- \$ H X; B8 \' d4 m2 a0 Z+ ^; L8 S! i& T, d6 y
Here again, several ways to detect it:
9 q# o2 Z% @- v) M6 V" F9 V5 G1 D T. J) |5 F1 t
BPINT 41 if ax==4f7 J" M! B) F1 ?0 E3 k
( W! U; f- _/ b" `4 ~$ U" l: t BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* J c; [" m8 H" T9 X! y& v0 U; m$ N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
2 g( x+ o, D: n1 z4 s% s0 ]3 a+ L! n) i* z( `
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ j- {6 i1 w5 a: e2 f8 D1 T+ O6 {, H( G' w' U
__________________________________________________________________________" Z& [- o, y+ s* N( h6 \. k1 s
$ e4 V! J7 D1 M6 iMethod 13
1 ], p5 s+ d# t2 L=========) R5 o! j7 d9 z2 q7 m- m: ~7 e
4 X9 i+ F, I8 W6 p8 F8 C
Not a real method of detection, but a good way to know if SoftICE is
+ ~$ p4 T$ [7 ~1 A( Y! _installed on a computer and to locate its installation directory.
. \2 {1 g1 D' q: S. ?It is used by few softs which access the following registry keys (usually #2) :! y7 U* a: Y" e% G& u$ C* e% ^
+ d) `7 ] z) v7 ~. G! Q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; H: e1 q9 |8 Z/ ?) ~8 w\Uninstall\SoftICE6 S6 p4 ?& M. U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, K7 M( i* X+ H# P6 Y3 s4 D-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: ]0 {4 D: _1 H4 l/ u
\App Paths\Loader32.Exe# r( _6 L5 d( W$ W
* z9 C: R: c. H$ a6 B* p! C
/ n0 C# |1 s U
Note that some nasty apps could then erase all files from SoftICE directory
. x, s0 [6 o+ `(I faced that once :-(
: D+ U7 E% ^1 f7 T7 u, s" h8 m' A" z V) [! a" R
Useful breakpoint to detect it:0 K) q, U7 C5 W/ i3 i5 S! P5 q
; g/ r1 K4 } z# ^$ M; w BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'$ i! n/ I! F) u& ?1 P3 E) ^5 P
% q, a+ ~4 d+ z% r0 T# Y& O4 X3 V: o3 n
__________________________________________________________________________
4 @/ `, R" J, {& d$ y0 C' |
& E8 ^( y& o$ ?" N
1 A3 q* S9 Q- a+ i& g. g. h, M! |) mMethod 14 & h7 S6 ]& S& j, D: z4 b8 A' K
=========; K U& V9 ~6 k9 l
5 O. ^2 D0 @( K: o& _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- X$ U% U( E1 G" k5 V: U6 g
is to determines whether a debugger is running on your system (ring0 only).- S" K3 t( j/ J- F q3 C
, V f1 ~: h! A: X+ X3 r( t VMMCall Test_Debug_Installed
* k" P2 Q& R7 ~# k3 E' m- B- [ je not_installed
( O4 {+ V( A6 O9 M( R
7 R( S7 T3 V/ W+ zThis service just checks a flag.
, F* ~2 z5 a w. H) o</PRE></TD></TR></TBODY></TABLE> |