<TABLE width=500>
# F$ \1 V" k0 r<TBODY>
2 s) x5 j% G9 B. _ }" ?, \9 R<TR>$ l5 E# F5 x! Z3 Y6 g
<TD><PRE>Method 01 5 u" p; x ~# B/ r: L7 S2 u
=========( r$ z6 Q5 k7 j; k
% p8 z1 L3 a2 n7 hThis method of detection of SoftICE (as well as the following one) is
9 c" n9 }' w4 I# e% b1 ?, C+ Q* U: n4 vused by the majority of packers/encryptors found on Internet.
5 t: g- a9 c: j' XIt seeks the signature of BoundsChecker in SoftICE, l/ F( w& {4 k9 f4 u* d2 U0 {2 l
3 H2 }3 Y, {- a! m6 m7 E mov ebp, 04243484Bh ; 'BCHK'& b! W! i6 _8 o6 z
mov ax, 04h2 _" e4 p# m% ]6 I; O
int 3 , V) z2 T# S2 G M- ? G( i& H* Q, g
cmp al,4
! X. Z$ X% Q/ j) b: r jnz SoftICE_Detected [& z; v' K' b- P' I
, P7 ]0 q# S. H) | t I___________________________________________________________________________ f- E( M" s& p
0 j* T; Q* @" L7 K- J
Method 021 I, g+ }1 B4 Z q9 j0 _' c/ L/ h
=========
, ?# w) C5 ~6 g R! y( w( d# D4 A- P5 s* L) u1 s+ Q0 r9 \0 t
Still a method very much used (perhaps the most frequent one). It is used
8 f# E& i, [3 N3 D4 ]6 h9 F6 tto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" J, Q5 @+ W# B4 J, P5 w4 lor execute SoftICE commands...) q& F! }* B* l5 w8 w" E# _
It is also used to crash SoftICE and to force it to execute any commands, o; ] R0 \+ _' G9 e! R, a$ Y! G" b
(HBOOT...) :-(( ! U; n+ Q# @% F1 L4 D/ J; U
3 A9 g9 X0 Z" w1 ]# ], kHere is a quick description:( I9 F, o Y7 h4 v* x
-AX = 0910h (Display string in SIce windows)9 e* r& ]; _! T2 i) L1 I& ^
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 l+ X* K7 Y; F; u+ [3 K. ]" A-AX = 0912h (Get breakpoint infos)
2 ^8 i4 F$ _1 A-AX = 0913h (Set Sice breakpoints)
' a6 r G! y: F5 N- ]; L4 d-AX = 0914h (Remove SIce breakoints)
! c& y# i7 e9 x. J/ A# h# ] g- S" U; ^8 q5 X
Each time you'll meet this trick, you'll see:+ D3 d# s+ o7 Z
-SI = 4647h
! R" A& C$ e o0 p-DI = 4A4Dh
9 Z0 q" C; ~" OWhich are the 'magic values' used by SoftIce.* \. O! W4 u& k
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 f) E" {6 t8 q7 K
, K. z' S i U/ _' ~Here is one example from the file "Haspinst.exe" which is the dongle HASP
) x" S+ p& R! O* N( IEnvelope utility use to protect DOS applications:
' d) v6 q5 O8 _, Y7 L- c
$ K8 j! d: w3 {2 f
/ O9 \# Y! _3 C4C19:0095 MOV AX,0911 ; execute command.
( R4 h1 N; }5 y0 ^7 J: \. X, }4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)./ N- B/ V! ~2 G( K
4C19:009A MOV SI,4647 ; 1st magic value.- b3 G# S1 t2 \+ W
4C19:009D MOV DI,4A4D ; 2nd magic value.* f* S7 a' h$ d( q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 [! P/ l: {5 }0 a+ P- `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 d/ O# h% E& V
4C19:00A4 INC CX
3 j: E, Z+ C' N& D7 R( K4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: y7 q) K. z+ }% h4C19:00A8 JB 0095 ; 6 different commands.
& {/ }7 W) Y; }5 ^3 |4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 e9 S1 ?( g) c
4C19:00AD MOV BX,SP ; Good_Guy go ahead :). r; p6 v7 }3 v4 M& E+ O
2 u+ m2 f# _% C# f: [) A5 z8 Y2 `The program will execute 6 different SIce commands located at ds:dx, which
3 c2 D3 L: j7 |9 D5 Tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
Y) E1 |# P) I( T) }) L1 h
* @5 J4 |6 I( [* V% C( u% H* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ Q5 t X( [5 a# @' h; ]- B
___________________________________________________________________________
0 r$ j8 \5 D0 C z8 C5 J
- K+ g" V, Q- P4 ?# T# b( B
/ r4 ?0 `6 O b8 pMethod 034 r( Z1 `3 F% y# h7 p- m
=========' O J3 C- M; F' B" N/ i& I
' C' O7 I6 y0 Z* ~* {8 o+ E
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! m7 N2 E; D) k7 k0 Z
(API Get entry point)0 E( k4 A! w7 W3 I7 S/ }. V
9 c; \3 D, `7 q. w" J1 V1 k, r
. B: T' M v, r* [9 x. F3 a0 t
xor di,di# Y% C" C( j' ~$ M$ M
mov es,di: {$ K7 B, d( n# s& M! k
mov ax, 1684h ! d' A! {, n, R0 |7 N9 J6 O- c
mov bx, 0202h ; VxD ID of winice7 a. g6 w% F4 i
int 2Fh m% B- Y) @9 ~; }
mov ax, es ; ES:DI -> VxD API entry point# o# t* L; c) J- n' w
add ax, di
# q2 J) ?% W/ F9 [$ i- U test ax,ax
, B2 O/ }6 c& W7 Z5 p jnz SoftICE_Detected
6 m2 E; d3 ?3 Z$ F: F$ x/ T6 H8 k1 A* }4 j, W N7 x
___________________________________________________________________________
+ x5 {( v; s% a" x$ @5 n f* ^$ L, K$ q: h
Method 04: _4 M4 a7 M' i$ B2 ~% I: E* }
=========' X- g8 K; |6 N g2 E' [
O$ T! r9 C* y# GMethod identical to the preceding one except that it seeks the ID of SoftICE
9 O* E) q0 i9 _; zGFX VxD.; l) ~4 v9 |5 X5 ^
2 V l$ m# Z' r X. b. y xor di,di' A; r7 Y% V- b+ A( b- }; Q& t
mov es,di, f% {* V( Q# Z
mov ax, 1684h
' A: L8 ]1 ~$ X H* f+ H+ A* ~0 p mov bx, 7a5Fh ; VxD ID of SIWVID
4 D& O5 c2 D, q9 k int 2fh! M1 b0 m( U6 k, s
mov ax, es ; ES:DI -> VxD API entry point
9 ?5 V( b/ ]! }5 h/ @9 P add ax, di
: t9 ~3 p8 [! ` V0 v: M test ax,ax9 Z5 i! s9 s* B7 w
jnz SoftICE_Detected
) b% y8 s! I. {; m- c- \5 T" ?6 p$ ?% e
__________________________________________________________________________
/ p" U F- C( z& \& @! j
; g1 T7 s# E2 U2 o. H9 g4 \! p3 Y3 q
Method 05' t! T7 x6 D) t1 z* R5 H
=========
2 E) |1 U' H; ]" M5 x a/ n7 ]: e% ?! Y4 t
Method seeking the 'magic number' 0F386h returned (in ax) by all system: G# X4 z) [; S* w8 `! ]9 h9 X4 i
debugger. It calls the int 41h, function 4Fh.0 ^# a( o, @5 s( n
There are several alternatives.
4 |& k: [9 k) \. U* t2 _; b
, i8 d* O5 b/ Z- g$ q% E. r, CThe following one is the simplest:) [+ b! P0 }. E1 ^ c. ~* j0 m
2 X# I X6 k6 l) N( z& r mov ax,4fh
; c- ^! {! h: t1 a! p int 41h' @6 @3 @ Z5 ]1 [6 \, U! U
cmp ax, 0F386: l; {7 |5 }& u4 b& t
jz SoftICE_detected9 e0 L2 {! f" }7 l% `# d9 ], H4 q; ^
# v! p3 A! l8 d) j- v8 y( L
* V" B' a! @2 R$ ]Next method as well as the following one are 2 examples from Stone's
9 b' L' {( w$ J) z' u: e5 l"stn-wid.zip" (www.cracking.net):
8 ~3 G7 X6 `; C7 [7 Y+ _9 Z5 [
. u0 v. `* [. `+ i+ d mov bx, cs
2 c& r( `$ F* Z1 R lea dx, int41handler2
9 o% t$ N a' ^ I xchg dx, es:[41h*4]
& _1 l5 j I3 H8 P: c7 K xchg bx, es:[41h*4+2]3 D5 T+ p: M1 f9 _8 H
mov ax,4fh8 G$ U$ e: Y* N. T6 F7 h
int 41h
& I4 x6 |. o8 R' f5 L xchg dx, es:[41h*4]
) z3 \0 L: z7 h9 g4 T( y1 y xchg bx, es:[41h*4+2] N6 F" Y N7 v" g" ~% K, I
cmp ax, 0f386h" w4 Y% _ ]) L, z
jz SoftICE_detected
! J& x9 A% O% `6 C0 }
' S& j+ r4 C/ L5 Tint41handler2 PROC
7 w' k" _! b; A iret4 I4 E& _& L+ X
int41handler2 ENDP0 P! J( |' a/ m4 A5 {
/ V" I% u, }- y& A& C; ?8 z4 b. G
4 l9 T1 i$ ?/ J, n) i_________________________________________________________________________% J' _- v* |0 v
2 ?( S' E9 s0 c, o$ U4 k; C1 [
4 y7 `1 Z: {* _3 jMethod 06
; i, O2 A# W7 Q( N. A9 M=========
# @2 j/ f# z: m5 A. r6 q; ^" A q2 I# z" f% ^/ j; F7 s" C
7 L: i3 x9 Y, H8 f2nd method similar to the preceding one but more difficult to detect:2 C) a2 r3 x: J# G% s; `
4 t/ g1 p0 |$ K+ E. C) ?+ Q" t: @; ~6 K; M l* N
int41handler PROC. L, f) R9 t S* j# e
mov cl,al: b& W7 r3 n8 P' t4 u+ \# L4 ^8 C6 m
iret+ [+ A: c. R; N. P
int41handler ENDP$ w a$ z1 P4 d. O
/ D1 H, \6 ?2 q! W
. B. Z/ e s, K/ Z) Z+ Q; Y
xor ax,ax) n) c, }6 ]9 A+ r. [( T
mov es,ax
: @% O( ? Z, ^6 P mov bx, cs7 ]1 Y$ g6 A; i/ w6 d8 v
lea dx, int41handler
, |& p& U6 B. {. M; T xchg dx, es:[41h*4]
4 P% r* u* a- h' | xchg bx, es:[41h*4+2]
* `+ d B' R4 Z& O0 z! V; x5 r in al, 40h
/ X# P" V- a# ^1 W+ r& l xor cx,cx8 ^& P# r/ u0 R$ O
int 41h e [% ?9 C0 w
xchg dx, es:[41h*4]
/ Q. G: R, d" h; Z* c xchg bx, es:[41h*4+2]8 |* L8 Q0 N/ {' X- d7 A
cmp cl,al
6 l0 ]' X; ]! y6 S jnz SoftICE_detected- p( k( B- N) A8 m/ u! U. R' I
' p. ]: o- e2 z2 t# l# ?
_________________________________________________________________________+ t8 m4 |) |% s3 N y
8 \% G3 @* V! h. ~2 v/ z8 oMethod 076 [- l2 E8 J {
=========' g1 ^1 ?9 M" i! b# j
+ U4 s) ~% T+ G$ f
Method of detection of the WinICE handler in the int68h (V86) M% ~3 U/ z5 v
3 O: ^) l1 e* g( N) k7 }6 { mov ah,43h
! [! P# N2 {- Q i int 68h" o( i) d& y6 e0 U) t
cmp ax,0F386h
# [3 c6 w) H D: s" I+ x, H- H" V jz SoftICE_Detected
! @2 ~) c4 G' C: _6 Y1 s9 I+ J4 p8 z0 C% b. {, U
1 M9 L1 D# _3 U- z9 j2 z1 I& e/ p% D=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. C3 ?( z" {$ f8 M6 `( ` app like this:' T! C0 f' w6 i A
7 x) I' o5 |& V, d" e0 _5 a0 H; O& H BPX exec_int if ax==68+ e# G! b: B! ]: ^+ c; S* N
(function called is located at byte ptr [ebp+1Dh] and client eip is" R% s( u. q: h. }, b
located at [ebp+48h] for 32Bit apps)$ G( f1 x2 }9 \: @: b+ ?9 L2 a
__________________________________________________________________________& t6 t( w4 X$ ?
) F, L* c B) h+ A0 c7 I% R) D3 e+ w
Method 08: n. l: [8 f6 O* M4 t$ g
=========
8 r' U; H" ]7 C) z: R. H
4 x3 b- x8 K8 @; M! lIt is not a method of detection of SoftICE but a possibility to crash the
3 J; p. `6 g Z7 w; ^system by intercepting int 01h and int 03h and redirecting them to another) Y2 X) \8 \1 v [( L- g3 j
routine.
; O( M% Z7 ^+ k: }4 S! zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 x4 z) e0 r1 a" S1 s
to the new routine to execute (hangs computer...)6 e1 a2 X( g2 }7 s' k
( f* n5 Q" v- j. |+ a
mov ah, 25h; o2 _5 m) x- f9 v K0 @4 v$ ^
mov al, Int_Number (01h or 03h)
& x) s8 q* j* V: T+ n1 A mov dx, offset New_Int_Routine
/ i0 Z5 Y6 ?0 V Q9 Q( C int 21h
% N! n- `- e5 V6 K6 ~& u8 [% J' K6 p2 z" k$ c/ V
__________________________________________________________________________
( Y4 E7 F: g1 \5 q
& y4 [ A$ ?% o7 u4 FMethod 09
; J5 l9 i" A3 u& [5 B" Z3 e=========
) p" J, A# t/ Q5 _! H+ l# f% s, W9 R# r: A, `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 Z* o! r( U+ f4 r+ {$ Tperformed in ring0 (VxD or a ring3 app using the VxdCall).7 a: x7 r9 W* _# H" R0 C. L
The Get_DDB service is used to determine whether or not a VxD is installed
! A5 {. T! a5 l! P7 lfor the specified device and returns a Device Description Block (in ecx) for! X0 N& l$ [" y+ k$ M x8 {
that device if it is installed.0 m3 a9 S9 N/ E2 i! [
9 A% X; q( R5 }" H# P$ o
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 Z E d/ D) B mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" ?4 q! u8 S7 a2 |0 I+ R
VMMCall Get_DDB4 P# x" E+ l0 C! T" w
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
p F m4 h; q# j( f8 t. u% ^+ }2 |) p9 u2 Y4 J3 Z$ l
Note as well that you can easily detect this method with SoftICE:! G1 U" L1 x, ]& ]+ S. w3 P& {. w4 [7 L
bpx Get_DDB if ax==0202 || ax==7a5fh, B) F3 g, Z. z% g7 s
/ n* U/ V) L9 H3 E0 U6 {. y7 `# n/ ~__________________________________________________________________________0 Z2 ~3 p3 x. p0 e
0 v% y) [) Y4 ^' N# J. H* _
Method 10
. K5 C; I- }7 r; r=========+ Z: f6 G* G+ T- m. o% ^( t
- p+ b8 S9 r) o! U- z
=>Disable or clear breakpoints before using this feature. DO NOT trace with" b. U2 O# R7 I1 A) R, t
SoftICE while the option is enable!!
8 s+ d" d2 o% X, b2 ~% ?
, [; A; j# e1 b. [& n/ D+ VThis trick is very efficient:2 i: ~" d( j- T& p
by checking the Debug Registers, you can detect if SoftICE is loaded
* S$ M$ }7 U2 c(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 R3 R' V% V4 h3 v) S' b+ T. H b. i
there are some memory breakpoints set (dr0 to dr3) simply by reading their
& D% `: h) J3 \% Uvalue (in ring0 only). Values can be manipulated and or changed as well/ K. k3 P$ z2 p) C( u
(clearing BPMs for instance)3 b# i+ g: B( K
[+ a2 e& t q A
__________________________________________________________________________& M5 h7 P1 W- c a3 C2 q. ?. {
! Q' N# }# C2 N2 Y
Method 11" {; O9 l) i2 g
=========8 v n& b9 j3 K# E
2 N' i8 R3 b6 ~- I& o( QThis method is most known as 'MeltICE' because it has been freely distributed u8 Y7 l# b7 U6 }9 R' n1 r4 n/ D$ O
via www.winfiles.com. However it was first used by NuMega people to allow: b( w" O5 a1 ]" |% }2 y* _& D
Symbol Loader to check if SoftICE was active or not (the code is located! E" b# b( {+ c0 f f' ^5 T& F: O
inside nmtrans.dll).
t' b0 l ?; M* u: }5 s8 n. u h9 I
The way it works is very simple:
) l6 e" j2 V# p! kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 r: [2 O% q* K% BWinNT) with the CreateFileA API.
. Y5 v# q- ` t) s; h' [' L- [1 ?9 q* }: |( Y
Here is a sample (checking for 'SICE'):4 i! x1 t: g! i8 V0 m3 m
- q2 \7 [$ ]% v# C4 S% RBOOL IsSoftIce95Loaded()6 y8 G7 S% v- z- `2 e: S8 v
{
$ Y8 a+ }# B7 F6 j: v HANDLE hFile;
* a& B; ^4 e. Y3 o! W5 v' j+ `7 z c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* o9 |! A5 o6 j FILE_SHARE_READ | FILE_SHARE_WRITE,
) T& k- w0 Y0 ^/ y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 k; i) [! D3 s+ J& ~0 P0 \
if( hFile != INVALID_HANDLE_VALUE )
$ m+ G* h8 n" o. S6 A {; F+ T, B" X( a- K* X
CloseHandle(hFile);
6 j& @& y9 n. G; f8 w( _ return TRUE;/ Z8 S, v- l2 n" T3 e9 B
}+ N# ?, J$ y+ c# ]
return FALSE;
7 Y. H$ d4 K p" ^- I! i}
" y8 A. r. v( j {! t6 g9 O% X \. |9 ~1 `3 ^/ }! r
Although this trick calls the CreateFileA function, don't even expect to be9 X( b/ D/ D0 D/ a4 o3 g+ h
able to intercept it by installing a IFS hook: it will not work, no way!1 Q3 {" a: P: Q5 n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 v5 T0 Z. H9 A9 E5 S$ k
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ C k' C3 l6 N2 H
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% ?2 @- u% F0 K& S5 Pfield.8 ~" o5 ?4 |. q9 k" i3 \8 r
In fact, its purpose is not to load/unload VxDs but only to send a
8 W- g) p" t1 wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 i+ n3 j0 ^' ^! ]6 G. L0 `to the VxD Control_Dispatch proc (how the hell a shareware soft could try# _& m; d0 B6 s' ]$ f7 Z4 v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& x- h# v7 G3 Z6 S/ G
If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 f+ W' a/ C' o0 X; @0 Bits handle to be opened and then, will be detected.
# I B) R$ @6 U+ J. P% G7 jYou can check that simply by hooking Winice.exe control proc entry point4 ~0 [$ c- j% G9 p+ y6 K
while running MeltICE.! A! @3 `3 j, u" `. v
) J: e4 \; L" E5 h g
' @( g6 _8 q* ]) z- W+ f5 u6 X! l 00401067: push 00402025 ; \\.\SICE6 e" I7 U( N$ p; y$ w( r, S
0040106C: call CreateFileA2 B" f" O }* @: K+ D+ D' t7 o) Z
00401071: cmp eax,-001
4 V% J! Y. q( ^, T 00401074: je 004010918 u- {- l! K% c. i
$ ~+ x1 H. f& B
0 U' t V2 C1 YThere could be hundreds of BPX you could use to detect this trick.$ v, P' p) w! }2 D" x1 g# y8 s
-The most classical one is:4 }8 ]5 z2 E$ ^: l8 ?) U- z( G
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 N/ o' n& t- }+ D/ f" z% D *(esp->4+4)=='NTIC'
( w. a" R& w1 A( L5 o- [8 P$ m. c1 O" ^# v8 U
-The most exotic ones (could be very slooooow :-(1 r. e2 d0 ] Z) b; e
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, w5 W# W6 |+ E: _ E. A9 c9 m ;will break 3 times :-(' V W0 W" |% A$ Y( X* G- F
4 ^7 s+ ~/ X: d" _' ~-or (a bit) faster: & }, W0 o, x$ q% V( j3 m
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" X0 p2 H5 q& d6 h) e0 P
; e% L1 d z" W, N
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ m, J" H# {' i9 t ;will break 3 times :-(* V) I8 V0 s, a" F
" w8 `/ P( n& h; [-Much faster:5 R0 v1 |& b& K0 s, x
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. n5 C3 g; Z8 l
2 L4 x9 c' y+ [3 H
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ q& q$ G8 g% N+ k: N# Ifunction to do the same job:/ H8 |! u! S- R0 J, }! j
: n% r4 v C* n+ v1 {# J H, j; r
push 00 ; OF_READ/ b: a7 w+ G3 z# W1 x
mov eax,[00656634] ; '\\.\SICE',04 t$ d2 D+ o7 j! `8 x% k6 I
push eax
( E$ ^( S$ a6 e call KERNEL32!_lopen: s9 e! M! d6 }/ X
inc eax
0 C9 y, m" f; Z jnz 00650589 ; detected
) W3 D& t$ s, l+ n L push 00 ; OF_READ
' j# |* w. h0 U' ` mov eax,[00656638] ; '\\.\SICE'
* k1 `0 A% I2 n0 ^% m push eax
# v; v: ?5 G& k& E call KERNEL32!_lopen( G, F8 q, S+ ^4 e: E7 \
inc eax7 F1 @& b7 Y; z. t- g
jz 006505ae ; not detected
, a3 m# A6 z! N/ [) a; r8 V8 ~3 W7 ^' R0 n
6 w- d& P: _ W# {# i/ ?# A9 C- D
__________________________________________________________________________* Z5 x1 P( _' @3 i( _& |
: V8 A# [4 p. |% e! k; ?Method 12
! p1 {& c) D8 `+ ]9 I) j: |7 Q=========
: D7 [9 E `3 w9 `3 Q
" J8 t4 n- @; bThis trick is similar to int41h/4fh Debugger installation check (code 05; a7 p1 _2 O& L
& 06) but very limited because it's only available for Win95/98 (not NT)9 c9 @! [4 {5 @' T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 f5 _- l% g# K* E% i8 U2 o
8 j3 A$ m# n, r5 Z) N
push 0000004fh ; function 4fh# ^% n( L' ~1 q
push 002a002ah ; high word specifies which VxD (VWIN32)
2 x% {. A6 w7 y. z5 ~% ^ ; low word specifies which service
4 V5 a% [8 P3 g+ m# a2 |0 j* h3 T; d (VWIN32_Int41Dispatch)
6 H- I4 _0 `- w( y8 M, w# ~' F call Kernel32!ORD_001 ; VxdCall6 Z$ `; \6 \; S0 Q+ }
cmp ax, 0f386h ; magic number returned by system debuggers
4 B# H0 S% P* P jz SoftICE_detected3 X' n! N2 P2 w& D n
( D ^ W7 i8 R% D& P# iHere again, several ways to detect it:
) d: C' @ l$ z9 W+ m4 C* i1 l# M! Q: J2 e& Y
BPINT 41 if ax==4f
3 d Q* X1 k, g8 w% L3 M' A7 t& u( `
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) D; B! @; o% r- y5 c% y
& y7 i: D! n) H8 }$ J+ D' ~ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. e8 |6 b* O5 l) T0 r
?7 i. O1 Y' i L+ ~ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- M1 S2 H: B% i, t1 b+ m
3 e6 q% ^7 V. N% L3 p__________________________________________________________________________, p5 x4 J9 _2 y$ |; H7 P {; g/ o
; m$ y$ c: J8 V: s3 A( p
Method 13! C, Z5 |, a: p
========= z8 t6 P- z# N7 ?3 w
9 ~8 }+ ` O2 j- {) J0 F0 l
Not a real method of detection, but a good way to know if SoftICE is
( e+ p$ v6 Z! Kinstalled on a computer and to locate its installation directory.2 {7 u* b. I: F
It is used by few softs which access the following registry keys (usually #2) :
) y0 O* `: @9 {- M9 c: W/ ?1 K* s) O6 G+ V; f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ g) E7 K+ ~' @0 l! P- Z\Uninstall\SoftICE
* V8 }0 E0 x. N) |! ?) W-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) s1 K4 P4 n h2 V2 [& X-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. w9 Z9 k. B' S
\App Paths\Loader32.Exe
" n3 g( Z/ o c, O
3 q" S- _6 ` M8 v9 x5 r* a6 @ l4 [5 T! k1 J4 X7 R3 X! L
Note that some nasty apps could then erase all files from SoftICE directory
+ N- [0 j1 D: Z1 h6 l" c(I faced that once :-(
0 s; f/ k; d$ Z, }, H+ e2 }6 u3 _& K3 h7 Q; M$ w: X+ d4 a1 M6 J% ~
Useful breakpoint to detect it:
" d, o O. @8 ], U2 C: s) {0 I- a K3 m3 I' i: f5 Y5 v4 V
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% ~ q2 ~7 _+ P9 J8 z. I; `2 J: j) O
( G1 V3 |: O) }; p2 |3 H__________________________________________________________________________
% H; ]- T0 z: @. c" X5 K C O! X$ @( q
3 }( V& O' _2 M6 n3 `4 j( I7 t3 I
Method 14
# z Q6 M9 c3 E9 E' j8 j( ~) n=========2 S( V5 W3 p+ c" G. j& e
- g1 g* }5 Y4 G; hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 p0 W) l: M) R& U# i) C
is to determines whether a debugger is running on your system (ring0 only).
" s, q8 Z# |0 D# u$ H% Z `
+ l5 J& v2 O3 t. T: J+ m VMMCall Test_Debug_Installed
, T5 A' Y$ G$ \: I& D je not_installed$ N# Z3 D; F6 ^- @
7 q6 ^( q: Q! u. n/ `! a& B% XThis service just checks a flag.5 E- Y) J' O0 q$ t# `' {
</PRE></TD></TR></TBODY></TABLE> |