<TABLE width=500>* D7 B- _/ x" X; H& i" U7 |- C9 v
<TBODY>
' Z* \* y7 T# B& N<TR>$ |" K% m: R- G$ Q) a. ~
<TD><PRE>Method 01 % Q" `, r3 q1 O7 o3 u/ }2 ]% k1 p) |
=========- v8 M/ C6 x: B- @& Q- x
! ?( P' Q3 t. Q" E+ ]
This method of detection of SoftICE (as well as the following one) is
" s& W/ v8 Q! Z! q( B; w+ }" T& ]used by the majority of packers/encryptors found on Internet.
: X0 [4 N: c ^0 j: I: b" c0 z- XIt seeks the signature of BoundsChecker in SoftICE
! y4 s r- g2 Y' H/ e; Z. M* j C |) N) `
mov ebp, 04243484Bh ; 'BCHK'4 d6 l- t& M6 v) \
mov ax, 04h5 o2 b2 [' z A4 h5 E/ }
int 3
! H o& k Q" S8 n; b" d cmp al,4
$ O9 h) k3 F! g3 \) e jnz SoftICE_Detected
: E0 L8 Y: @$ c K3 M3 a3 R3 |2 k& e
___________________________________________________________________________/ b6 |5 t, u& D8 V# d! j
% C1 ^+ A H6 e$ b1 l) C2 tMethod 02
9 g+ p0 d+ n' m" c, m4 v=========
! [4 U" x/ a7 _% X8 i1 R* J8 Q
! |+ w# y# I; w1 a& BStill a method very much used (perhaps the most frequent one). It is used
0 o0 M; ^) {, X+ j8 e' }7 w0 J# fto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ Z; \. _5 j; l% K7 ~or execute SoftICE commands...+ y! ]3 n' M& }5 _
It is also used to crash SoftICE and to force it to execute any commands' O* Z' }2 ?, U5 p2 E4 O$ P0 k
(HBOOT...) :-((
; t; Z3 u. U, L5 o! R4 Z a7 K' d8 v) {. g8 o5 K8 y
Here is a quick description:
4 ~! Q2 |7 O8 Y5 p: [: T-AX = 0910h (Display string in SIce windows)
9 L t+ x) J' Z/ v7 e& c-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; Q0 y3 e( u& C3 X- F6 E1 `-AX = 0912h (Get breakpoint infos)# F7 h# X- R0 O# _) u8 d4 [
-AX = 0913h (Set Sice breakpoints)
8 K/ V6 f: \3 s( h-AX = 0914h (Remove SIce breakoints)
- } C# ]5 `5 [/ o3 R; ?7 d3 w& v: {6 X+ p5 L- x
Each time you'll meet this trick, you'll see:
3 j9 F3 `$ o9 {& g/ Z) p0 L-SI = 4647h
0 x. k! j: p: S; {1 j, r% U-DI = 4A4Dh1 y: M( {2 W2 a: G9 O! z
Which are the 'magic values' used by SoftIce.9 f0 i' k6 L( ?# [4 V# X
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.- _1 k+ n8 [# ^$ F5 L/ r5 X
3 f+ P/ b6 z& H' eHere is one example from the file "Haspinst.exe" which is the dongle HASP- U0 X: U4 [) h/ G; I
Envelope utility use to protect DOS applications:
7 q" f, v: X9 A$ Y0 i0 G$ D1 [9 C
" h2 g# Q+ w3 V5 z9 |" d/ G0 k2 i8 }3 X* s5 G
4C19:0095 MOV AX,0911 ; execute command.2 k2 P( e' n" A1 A$ d
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! P: O. N8 n- s- r3 _4C19:009A MOV SI,4647 ; 1st magic value.
& {( K1 n9 J, v2 W+ n/ c1 g4C19:009D MOV DI,4A4D ; 2nd magic value.( s8 z3 l7 [* [+ {3 v0 q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 i; ?, b z7 ]9 G4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute' Z+ g _2 y5 j1 S4 t8 {2 d
4C19:00A4 INC CX
@& ]) p5 h& W, \% d2 T4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. G, w( M0 p3 U; t/ V9 b, F4C19:00A8 JB 0095 ; 6 different commands.
0 i) x8 }1 P6 C( Z% j4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& N% A+ J% r# ^1 e& V1 G. ?+ u$ Y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
3 ]' O: f, O3 Z, K2 k% Y* y% V9 Y. `0 c# B4 R/ b) W
The program will execute 6 different SIce commands located at ds:dx, which
?0 ?/ [. C; @0 w6 eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 i) Q7 M$ l, T& [) d
4 u# n% F% t% E+ x
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& L% u) x" U& R
___________________________________________________________________________# r) S! Y1 G3 n" M- ~5 v# I
/ q9 g0 ?& C, {7 y
* r1 r5 @; C% V Y0 VMethod 035 a' y( K4 Y5 V8 V
=========; d/ `( ^* i! N4 }3 Y: L3 W! C4 N2 `
# M1 F9 c) Q" ]& G; d7 p- h' PLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 M$ ^$ |& R* b7 g0 `
(API Get entry point)- y$ @; c, p! R$ ]8 H6 \
4 K3 e8 t4 \& d! l
$ x3 K( V8 F; P l' T- u xor di,di+ E# \7 ~, M4 {+ e" L
mov es,di% M# b9 D4 T3 F7 w
mov ax, 1684h
* p6 Q1 t+ D, a4 G9 j9 K S mov bx, 0202h ; VxD ID of winice: w* m6 [1 F& X) i) j, U* [9 @
int 2Fh
1 b2 T4 d" [2 l" Y mov ax, es ; ES:DI -> VxD API entry point
- b- \0 {0 s R" y5 m add ax, di: S8 b8 e- }; W T6 u
test ax,ax9 b( U+ C, q) a/ J
jnz SoftICE_Detected
. F- f9 R, O Y4 L9 z# R. S: `. B3 k) l) A( X5 _5 t
___________________________________________________________________________
% u2 S$ g( u9 x1 g6 [) R/ ^& N$ Y2 L6 b9 |
Method 04 Q4 t$ @, }0 D, k& m/ ]
=========
2 w! m* i4 {- G( T+ l$ _+ r5 q; Q. |3 e8 w, }
Method identical to the preceding one except that it seeks the ID of SoftICE
4 |5 h5 Z: `4 g5 PGFX VxD.9 a5 X- g: r; b2 _. D7 S
& X5 O& J" ]. [4 i6 ? J
xor di,di3 e5 j2 L% {* S+ R- K) Q
mov es,di
9 R/ g3 x+ ~ e* R7 c) m mov ax, 1684h 9 i: h. J F% n( y( z; P0 M
mov bx, 7a5Fh ; VxD ID of SIWVID( k. }; K; k" V: o3 t2 c
int 2fh
3 h: d% Z0 u6 g) V mov ax, es ; ES:DI -> VxD API entry point
1 K, g8 F+ h1 K add ax, di* o) q* R+ |% ?; J$ f
test ax,ax) W V' e3 [" F. \( S& A% R
jnz SoftICE_Detected4 x( m& E0 z+ [. Q+ m7 e' R
7 |+ M. f( L3 d+ M__________________________________________________________________________; f+ C) i7 F0 }+ I. v K \6 S( L
; q7 U* D8 e( W: b/ B( O7 c
% {" K a: l. D$ E I/ cMethod 05
2 K2 l. Q: @: P& o* \=========6 ^" a# \; V+ y7 n2 h' |
. s$ ?6 W u3 \; q5 Y2 U( X
Method seeking the 'magic number' 0F386h returned (in ax) by all system5 w- N1 f* t2 ^, L+ Y8 I
debugger. It calls the int 41h, function 4Fh.
5 {* P ]; |% t' L9 W fThere are several alternatives. 0 Q4 D& Z- j3 x) e. r. ?# F( G
" `% R3 H0 G3 R1 t' Q
The following one is the simplest:0 O. V7 U- _: ^' Q4 d
" \' @! @" S$ U
mov ax,4fh- d" d0 r" t _1 o- T
int 41h
7 c6 h; K. t9 f% P; W& L" F cmp ax, 0F386
2 Z! }5 Q+ N, f& @1 \ jz SoftICE_detected" H/ h s2 n* p3 A; E- d
M" X& F8 E2 n' |' j
( a# c: T1 C& m! X! g/ R4 HNext method as well as the following one are 2 examples from Stone's $ }" T2 L. c- L& w3 ^: P
"stn-wid.zip" (www.cracking.net):8 }3 x6 m! M# U6 u% s, k
. u H5 p+ F+ s" \ mov bx, cs
2 A6 t- ?- `% ^* U lea dx, int41handler2
7 z! M9 l1 \8 Q& `' T xchg dx, es:[41h*4]" o/ n7 U2 s$ f8 R$ F0 u
xchg bx, es:[41h*4+2]. V8 }# v K, q0 U8 m' x$ e! E
mov ax,4fh* {8 _, i1 Q& Q) N% K) C( ~+ y
int 41h1 ]8 G- A. t1 z- H" ]: l
xchg dx, es:[41h*4]
6 e- O8 x6 g( {7 z6 p2 a xchg bx, es:[41h*4+2]9 {8 P, H9 o6 `& g
cmp ax, 0f386h$ @" Z' O1 _' J
jz SoftICE_detected
2 @; ^, Y$ x) R! F$ Q& N% o- g7 C8 B6 S7 O) Z+ v2 m. |5 M
int41handler2 PROC
; o8 f2 m1 O {! d iret) [4 ]; M& l& \
int41handler2 ENDP
1 I/ W. L& b& Q% {% e
, O, z& v) ~2 S+ {+ ~
1 `& h$ X3 ^9 o) ? A' i_________________________________________________________________________
5 A+ J7 `9 F- u: c/ ^1 J" ?8 B8 Q( O0 G% p: b& ~* [% W
; `7 o p# I2 m1 Y$ M3 pMethod 061 `+ z: k: G5 z* E
=========
% y( P! g: l9 c& j; w# I
2 z4 I5 W9 ~+ j4 T7 J+ {5 ]/ ^# v0 \# l
2nd method similar to the preceding one but more difficult to detect:( O, H* }6 V# l9 Y2 b
8 i: j5 ~7 d4 ~0 a
9 B2 z3 V) N6 w+ J! @/ j
int41handler PROC
. h6 w" D5 F6 R. s( W V% Z" ~' A mov cl,al
) `7 W8 o8 J; k2 a4 u8 G iret& w8 f: e' ?+ y
int41handler ENDP
4 K! W Z2 f7 r4 S1 i2 l
2 w0 h- Q9 h3 b3 X |% I$ ?0 ~ r6 C: H* W! O
xor ax,ax
p& e9 \1 k( U2 B( r! ] mov es,ax
0 D d; ]0 U/ ~6 ]4 s+ f$ y mov bx, cs
: r0 Z1 w* d3 G& c lea dx, int41handler
- j3 y, L1 ^8 D2 Y9 K" ` xchg dx, es:[41h*4]
2 @( |( `- d: V7 A0 H# X. @ xchg bx, es:[41h*4+2]
' T/ w, C. d/ ^4 E: _+ \9 f& b in al, 40h
3 p2 |8 [# l8 F/ ]- O" t' K; C xor cx,cx2 x' @( G/ i! a/ W& H" `, a
int 41h
9 V+ t3 }- b, y2 l/ C xchg dx, es:[41h*4]
( Q. ~' m* G: ? d0 x xchg bx, es:[41h*4+2]
3 Y% ?4 n' \3 S0 ^5 D1 O cmp cl,al
0 z. D1 c6 S9 @% y& e) S jnz SoftICE_detected
6 {5 }3 Z8 Z9 @$ M- u" j
" Q8 r+ \2 s3 C% W5 ~_________________________________________________________________________; z$ d+ ]) O' ^. M6 ~
7 b2 r- O. A! j7 A7 ]1 `& wMethod 07
1 n) n, T. u, u0 @. R=========
7 m9 @+ ~! l' f( Y
2 R+ g- O+ @% W: T( z p0 kMethod of detection of the WinICE handler in the int68h (V86), a' s! X' U1 y3 s
$ o% U% H5 r! ?/ ^0 w8 f
mov ah,43h
% a3 c7 Q2 C8 @3 m5 L int 68h4 M s8 M2 V6 h8 {
cmp ax,0F386h
# D* l7 c* }7 m4 K: P! l( l6 R jz SoftICE_Detected8 f. Z+ {6 x* x) _
: J) S/ O/ h, X- A+ H4 @+ q5 k2 L
7 b5 K* W: H& Z; ], {=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit- }2 r0 w/ q3 j) o
app like this:% m; X5 E6 A+ D) ^
2 t% |( G% Y. L1 e
BPX exec_int if ax==68
2 \$ i; D$ _# u0 ~ (function called is located at byte ptr [ebp+1Dh] and client eip is
: l) g1 i1 H2 S, _ located at [ebp+48h] for 32Bit apps)( V+ {8 \1 P0 @& m+ I# ]1 m" f: `
__________________________________________________________________________# @% f% ^- ^5 q; H6 {. [
7 x) D4 j5 j& E$ P5 E- N
7 t) l& h0 _- s0 F4 GMethod 08
; c$ U# v. D( P& ^# f5 z1 H$ D=========
, e/ D! F/ Z' c8 s# d$ M9 x7 v2 v/ X
( j7 L) Q4 u4 ]It is not a method of detection of SoftICE but a possibility to crash the9 n9 o% l, l; i z. \- |3 {& q* [
system by intercepting int 01h and int 03h and redirecting them to another
3 u* ^; v& m: h8 T; d9 Aroutine.1 A( h: }; {6 @, h5 {" J! a/ [7 v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 c1 D2 A$ p, F0 Zto the new routine to execute (hangs computer...)
$ T* ~* P& d, k. w% E2 g5 m$ C5 n% p
mov ah, 25h
- `. P0 L4 b* v8 x) D* |! v/ c mov al, Int_Number (01h or 03h)# |% P2 S$ e/ S1 f9 c2 M8 f
mov dx, offset New_Int_Routine
* Q5 p% O+ G+ t4 U6 B int 21h! J9 T9 f. B4 e. q. S3 }# y$ E
7 {3 c7 t! p% R# e__________________________________________________________________________
$ X% ?; W' X0 b6 N/ x( V- ?4 r9 u% f8 K% u
Method 09, t; u7 a m5 L4 O' y
=========! |, d8 Y* \0 b" V8 P
6 ~ S$ t) T+ L$ J) U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 _) e1 W7 y6 @. z9 M* `1 c
performed in ring0 (VxD or a ring3 app using the VxdCall).
# t. v. | @' @; rThe Get_DDB service is used to determine whether or not a VxD is installed6 K4 R+ {( S5 P# \: n1 }- Y' V
for the specified device and returns a Device Description Block (in ecx) for
~' J, \' y1 hthat device if it is installed.
6 f% u/ z3 V% ?
& K- e! X7 u% Y ^0 I& h mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- s |: ]* F ?* O+ J$ n/ ~
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 {- _5 J! a1 p7 T/ h" }' k
VMMCall Get_DDB
0 h) r% m o0 l( M/ b; _0 ` mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' p4 B- |+ E, r! l3 n, J t' K5 [! D* H0 E# P/ O/ K) T" Z
Note as well that you can easily detect this method with SoftICE:
, A7 ]2 a1 B0 b0 Q. ]' b% N bpx Get_DDB if ax==0202 || ax==7a5fh3 I% D$ J/ D- n/ U* x K( y+ @
( q! N! y* R. A% A" u
__________________________________________________________________________
2 X; ]9 s/ R- z, }0 E
4 w; d% s+ r4 P& @Method 10+ p9 }2 _+ j8 C& P4 B+ z
=========
( S) g# q* R% C* H
1 X/ \( J% W) @. M8 ?& s=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 D+ [8 Y3 i* G$ U. W6 E SoftICE while the option is enable!!
& o- s; S5 b) t5 ~7 c) b3 o4 Y8 k3 y( P) Z
This trick is very efficient:
* J" Q3 u( s% ^by checking the Debug Registers, you can detect if SoftICE is loaded/ g0 U3 B* N( N" f3 c0 p* e3 V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! A6 T- E% G- c
there are some memory breakpoints set (dr0 to dr3) simply by reading their
/ c# B- t( p7 e4 i$ h; V+ bvalue (in ring0 only). Values can be manipulated and or changed as well
$ ~3 Q" [6 |7 \( g: P% W(clearing BPMs for instance)
. Q1 p3 J; M2 P; T0 G7 b
1 J0 [5 k( R/ U__________________________________________________________________________0 Z' J3 {" s" i, d" c- m2 k, y
& A3 X. `' \; w
Method 110 {5 a' ]1 O. J) `4 U s. d$ { ]
=========# k/ o$ t' b& ?& u; O( F
+ F A; P! K% o7 P& |" YThis method is most known as 'MeltICE' because it has been freely distributed
4 y; [+ x2 ^6 ?) y: {5 g; w. yvia www.winfiles.com. However it was first used by NuMega people to allow. T6 `& i7 t+ b7 L- z1 b" | Q2 \
Symbol Loader to check if SoftICE was active or not (the code is located5 D: j4 Y& j' u: V. i5 v! X
inside nmtrans.dll).
( Q6 q: |! `) [/ ]8 h: D
' y. t+ e& U7 G) YThe way it works is very simple:
' ?* f; E% X: ^, A5 PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) n( v+ ]' m+ n) r; g( g- O
WinNT) with the CreateFileA API.
" e: u% Z2 l7 R8 [7 \3 ^% B3 W; U( V4 O% _' J2 p
Here is a sample (checking for 'SICE'):; ?( c1 p5 u0 v5 y: `! N, g: o6 n
8 z$ |; L2 r* CBOOL IsSoftIce95Loaded(): D. ?* h4 m! \2 ^
{* A7 O- L+ V3 t" A8 l) E
HANDLE hFile; ( g9 P: X* |% u9 ^
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 I1 r& o. K q( Q5 t! U- u6 N FILE_SHARE_READ | FILE_SHARE_WRITE,
5 Q. s! L6 F/ x$ v9 Q2 f NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 N( _- ^9 d5 e5 ] if( hFile != INVALID_HANDLE_VALUE ). ~' P' e& M( E3 n8 |; V6 A% O$ |
{* H& p. F5 m) C0 J2 [
CloseHandle(hFile);) e2 @, x3 O( e0 p H
return TRUE;* E) _1 T0 L5 k& Z8 S
}
/ H# P( {; A! q return FALSE;' l) Z/ p' r9 i
}5 S7 ?* }5 c8 f9 q
( b; \2 B$ B, Y; ~! o% z3 U# }
Although this trick calls the CreateFileA function, don't even expect to be
1 z, C( Y n4 y/ q2 D5 kable to intercept it by installing a IFS hook: it will not work, no way!' }+ e3 F, H, K. I6 V( |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 K7 C* j" t( M0 Z$ c8 eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" ^- n. S' z3 U6 N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: F3 {8 X& Y+ _$ ~7 {* x5 D
field.* n0 q' G' q5 s9 D+ t% x7 Z2 q
In fact, its purpose is not to load/unload VxDs but only to send a $ ]% A5 T9 P* ^+ B4 ~
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 B0 N" R" B- E* H
to the VxD Control_Dispatch proc (how the hell a shareware soft could try2 X6 O$ w. Q) R( e
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! n$ w1 s4 x; V: a, y# y% b* m9 LIf the VxD is loaded, it will always clear eax and the Carry flag to allow
- }9 V2 z$ J* |its handle to be opened and then, will be detected.
^3 H/ u+ l$ H6 r8 `! E& n8 TYou can check that simply by hooking Winice.exe control proc entry point* X/ A1 a) s, s" S8 S. Z# Q
while running MeltICE.
8 d/ m& m3 `( D8 h, [8 T
( X( s, n* a2 ]; E* w% }6 u4 [ C+ y* H9 o9 y* I
00401067: push 00402025 ; \\.\SICE& ^# r$ ]! z- k7 b
0040106C: call CreateFileA8 J- |1 \7 c! X9 ^& L
00401071: cmp eax,-001
, _6 {3 M1 P; j 00401074: je 00401091) U0 `/ n3 {; Q' u' `: R
# }7 w, u- |, g. d3 O
! J8 q" \, O# k. vThere could be hundreds of BPX you could use to detect this trick.5 b" A+ A" u; s
-The most classical one is: U' @: J; m4 A3 f" \- O
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; L- h* Q- j: Y# W; ?
*(esp->4+4)=='NTIC'
5 b8 ~, A4 _: h! ]7 `' V
1 o( O7 e$ a" g2 Z$ }+ P1 R-The most exotic ones (could be very slooooow :-(1 O5 ?1 @8 {8 T) W
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 A9 B, o r) T* O# l
;will break 3 times :-(+ y- \0 _6 B8 S9 S$ X
4 @/ r$ ?2 k& g9 ~-or (a bit) faster:
) l+ n2 ~* \ F1 V BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 z' Z, T9 P7 N4 t
# r3 @" A& y3 o& V! A BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
# |; Y( ]& @* d3 G" z ;will break 3 times :-(
$ X9 _6 h+ h Z; K7 S! }& Z. X- w8 d% U4 U7 J
-Much faster:. h/ B( @: E4 M+ K
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& f: s5 q7 ~) c* c! J
' `: y- ^8 b; d% q4 ?, i* a
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' l; V2 V) m* B) F0 ~2 k( Ifunction to do the same job:$ v) b# K H8 Z/ x) _! }: _
: a ?1 }9 \, X9 Z push 00 ; OF_READ: a: X5 y- f8 m( e; H9 `
mov eax,[00656634] ; '\\.\SICE',0
) v. ]; S5 P+ A0 D$ g/ o push eax8 _- k" _! U& a
call KERNEL32!_lopen. ^: C4 V0 Q0 k( C9 l7 h1 G
inc eax
: l1 W B0 w7 L jnz 00650589 ; detected
. J' M/ }9 d4 Z# X3 ] push 00 ; OF_READ: @6 i# Y& _0 x' E* `. V
mov eax,[00656638] ; '\\.\SICE'$ h5 r- {1 E3 a9 i8 g
push eax( e$ ]* Y9 z6 S- v1 o; |
call KERNEL32!_lopen6 n" t; N+ }3 N* x6 s+ T$ h
inc eax/ f! O- `" _* N8 d' h, `
jz 006505ae ; not detected; { W0 o) _* I2 M+ S5 `0 k8 T
& Y( F) W5 [- ~* d% X
$ j" J. L3 ?; E1 H__________________________________________________________________________. s9 u6 R# g3 I6 i: l$ d# q
. _( Z) C; D: [% c6 k9 YMethod 12/ A7 v. Y7 a% k3 \; i: h7 q0 [
=========3 ^* _( ?, ?1 b; [' M$ X
4 Q8 o! Q. Z: L2 e
This trick is similar to int41h/4fh Debugger installation check (code 05" I. o2 `( S# Q* r. E7 {& e
& 06) but very limited because it's only available for Win95/98 (not NT)# H8 p' z+ j5 u$ }" E
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 T: ^0 I7 K" H+ ^; Q3 ^
! f$ e. E {- K3 h push 0000004fh ; function 4fh
Y3 T3 |; S! h# W push 002a002ah ; high word specifies which VxD (VWIN32)/ O, m* K: e* @9 c7 Y8 ], t
; low word specifies which service
1 V8 F; W( i; x& i1 ~+ e4 I) u (VWIN32_Int41Dispatch)4 h1 y% L+ `9 d( a
call Kernel32!ORD_001 ; VxdCall/ Y9 \* j/ K. b; E; R/ t5 s
cmp ax, 0f386h ; magic number returned by system debuggers
# S, c D2 f6 c+ G, N jz SoftICE_detected0 P& D9 _. V% e$ m2 ~3 R
) c7 F. [3 N) d7 I9 G; Y* J' Y% UHere again, several ways to detect it:- H4 ]& A+ N( k7 l+ P7 L
* C1 a& ]2 q. _ BPINT 41 if ax==4f
6 {7 k; t' J1 Z" E* a( A2 o6 O1 M' ? N8 B3 Z6 D& l
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- i% J9 f3 v$ d7 k3 {
$ C5 k( B' A% @3 \0 y' Z+ \) n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 B0 z& v: n% L3 s0 V
4 x3 ~4 Q' E: d7 m g F9 ? BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 X. M: _# p8 h6 z" G
) C8 b3 i2 g- q0 V__________________________________________________________________________
# E) e: F9 W+ U A9 M+ U5 Y w5 @0 W" ]8 l, e/ H3 n
Method 13
, |: v6 G) \( X [; z* _9 f/ ^=========
% I& s- }4 ^! B2 ?/ H \7 c E! O- U
Not a real method of detection, but a good way to know if SoftICE is
: L6 Z# p; G. \) D# t% Oinstalled on a computer and to locate its installation directory.5 s3 {" e$ H: o
It is used by few softs which access the following registry keys (usually #2) :
7 M3 a. A+ ~5 t: n. j% n9 N" z- I: @* E+ s
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% f' G& A; o5 z: ~7 @; t, r. v\Uninstall\SoftICE
( W; H# |& F9 o/ ~-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% B. f, D m7 y/ b1 w. n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 @1 K- b( F7 x1 l3 Q* r9 r3 s
\App Paths\Loader32.Exe3 p0 m7 U- t* V# X5 J* B$ E* F
4 p9 |! |5 L9 F2 Y4 o
! s+ @* y u$ b6 l" s
Note that some nasty apps could then erase all files from SoftICE directory
( n1 W% f B& c% Q' K(I faced that once :-(
3 A N8 Q1 ` |( F ^7 M& W, {$ ^, j. X# n! x
Useful breakpoint to detect it:
! J. @/ \8 A$ K% A! }4 B7 `2 k) D7 O, L
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; e8 K- f7 v M1 X3 P) ^
9 a6 B1 v" G* w
__________________________________________________________________________! H1 M F' j5 s: c( M2 [
: T' R4 A* ~2 \1 X; Y* @) a5 G% f0 F) s7 A% F( s- l
Method 14
7 ^9 x3 d& g4 E$ _=========1 O$ \' o7 X3 G0 a$ A+ s% M
+ R1 j; V2 y: U2 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ V0 I% G" j. z: G2 uis to determines whether a debugger is running on your system (ring0 only).
6 H. t: F" v) l. @: ~* u; w. G: M- e9 {, p, H
VMMCall Test_Debug_Installed! r2 w0 X& z9 _/ A& d- {" U9 `
je not_installed% `, c- f( y% g2 O9 V! D
6 P, u( y }' \- z+ IThis service just checks a flag.) D6 W' g8 C g% }
</PRE></TD></TR></TBODY></TABLE> |