<TABLE width=500>
' J; y7 u7 d! r1 L1 H% K<TBODY>
9 i4 A- Y) i+ y2 m* j<TR>
2 j; {9 i3 L3 S( K<TD><PRE>Method 01
4 Y& w* a C5 u' f6 A" N1 ~=========3 ~; d$ {, q N7 p3 `# ? W
& V$ \) c/ e0 m( u( g! x
This method of detection of SoftICE (as well as the following one) is" A) V. c1 E1 @( e: O B% y/ t
used by the majority of packers/encryptors found on Internet.
- l$ o a+ Y+ E& c ~- [4 h: fIt seeks the signature of BoundsChecker in SoftICE
5 I2 G) V& K) S) F% }) G% K0 [- L% V) j* V# Z9 V- l; a8 n
mov ebp, 04243484Bh ; 'BCHK'# _7 C* W- Y) w. V3 z9 f
mov ax, 04h
; J& U# i/ m; o" `3 I+ V: k, L( g int 3 4 W0 m$ I& d" H0 k
cmp al,48 }8 j/ s, K6 C8 [/ s! F+ _
jnz SoftICE_Detected" O# h6 f) N0 e4 {
% h8 ^% W* j- ~___________________________________________________________________________
4 q( C# d& z2 u9 U2 e' P2 Y# x, E
Method 02 ^) N0 m7 E _; F
=========
- G! U. ^0 c% w _% x/ S0 T' @& V1 g7 G0 s9 A. C0 m+ R
Still a method very much used (perhaps the most frequent one). It is used
# l/ H V3 @1 X: Y, u0 ~, E7 ~9 Gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ t% A: G# H& V; f) w5 k% {or execute SoftICE commands...
4 @% o1 z1 |5 QIt is also used to crash SoftICE and to force it to execute any commands
: K; b. W$ Z! h' E(HBOOT...) :-((
1 ~" z. T( ^9 i, e0 D
. d- I7 A, ]1 D! S k; J7 }Here is a quick description:
2 l; L/ S' T: f2 O; K4 m-AX = 0910h (Display string in SIce windows)& u5 {! h$ b% n; p# x/ Z/ R" s
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' D! f! B% D9 ^2 o: `9 h-AX = 0912h (Get breakpoint infos)+ q% o4 E1 c, R
-AX = 0913h (Set Sice breakpoints)+ F0 i/ E- y. A f2 e
-AX = 0914h (Remove SIce breakoints)4 _0 }7 ]6 E- E1 Y" {. o3 o
1 n, [* g! J: L- D3 W3 u
Each time you'll meet this trick, you'll see:1 c( U0 h) T' O
-SI = 4647h: Q/ j# \, H# q/ W) S+ j
-DI = 4A4Dh! @+ ?' o* O, ]0 j; x
Which are the 'magic values' used by SoftIce.
6 i, Q" S3 l8 I( y$ w- ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% N, Q9 S* N1 K, y$ v" W# @* s7 _2 q+ `( D% j1 H( }6 H2 Z+ r6 v+ q
Here is one example from the file "Haspinst.exe" which is the dongle HASP) S# L. N$ Z" g3 d5 N# A5 m
Envelope utility use to protect DOS applications:' H# V0 Q9 U, L) J6 c
0 Y, l, j5 Y2 g+ ^8 w$ v* U* j% u5 X3 o* D6 J+ a! _+ H/ G
4C19:0095 MOV AX,0911 ; execute command.( Z# w" b* @2 _6 J3 G
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) Q/ F( Z( |2 R# a9 A R4C19:009A MOV SI,4647 ; 1st magic value.
$ P* K% q9 j! l+ E4 k4C19:009D MOV DI,4A4D ; 2nd magic value.4 ^/ E0 g5 z" Q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( P& l. W6 y) y; A' ?; o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute' G( H; ^; v- q/ r) k. G5 E
4C19:00A4 INC CX
* B& |8 B9 C& g; i$ J; D/ x4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& s1 E! a% P7 S+ A4C19:00A8 JB 0095 ; 6 different commands./ S, ] H5 Y# J y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.. T! e8 z$ Q" H% G
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 \, f- d7 D- o2 N- R0 N
# ~% H7 i9 D9 H1 S$ A$ nThe program will execute 6 different SIce commands located at ds:dx, which
: C {6 `* w2 O; s1 ]are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; n' a8 L. V8 h0 G( m/ [) X; `, V/ l g N5 n2 z K
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ d: ^: e1 f. ^# V+ M/ y___________________________________________________________________________
+ M5 Q, l5 V% G ^0 w9 O; q' z5 I1 d6 S( _+ L0 f; V
B/ K. _* Y. D0 k. m
Method 03
& y- @+ Q5 ^9 W0 J: z# R4 R=========
# U3 U: q/ T% k% b+ R: U( Z
2 D; G% n. U6 \ NLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) ~9 ^0 u) N4 E& o" }& E+ K
(API Get entry point)
) L# w$ g5 [# @6 ]9 {
# {' b4 t- Z% W0 o8 |1 I j- o- o6 z5 u1 g
xor di,di
2 b, k6 F+ u _3 t$ L# b5 ]% { R6 V mov es,di C3 e' E3 c1 C
mov ax, 1684h
8 m% W) r6 @1 F1 V mov bx, 0202h ; VxD ID of winice4 z+ g( D1 q& W) D+ F
int 2Fh5 r9 |2 W6 p/ |2 Z, ?# e( o2 h
mov ax, es ; ES:DI -> VxD API entry point
( m% F( |3 f: j6 F% |; m add ax, di
3 o- ?7 O1 t; k5 a$ F. o! M test ax,ax' i4 m# j) a/ {: S0 A% U Y
jnz SoftICE_Detected& I% p! b* T: q! t b0 n. @
$ D9 L2 a; C& D7 Z
___________________________________________________________________________ C# u4 y. m' R
+ m$ b. H4 K6 ?- vMethod 045 }! V) g7 a2 w3 c
=========6 x8 @" Q( Y/ A% a, X e
! N9 I7 O% `- q% j$ n) T" z; [
Method identical to the preceding one except that it seeks the ID of SoftICE
) r- u* ~7 s* m" V6 d3 jGFX VxD.
" d! k1 J* |4 s1 W1 c0 q
9 |. n( `3 U8 |7 q/ Z5 u& H xor di,di
. Z- V0 X# _, s mov es,di7 N( L6 q& A6 G- H( ^7 [( z
mov ax, 1684h
+ Q6 u) ^5 V5 q# U! {5 W mov bx, 7a5Fh ; VxD ID of SIWVID! S: w9 U/ a3 k" Q8 b8 m9 Y
int 2fh
: O5 S4 V5 G# Y2 E* P mov ax, es ; ES:DI -> VxD API entry point' E3 _' x# I9 {+ C3 c
add ax, di8 N4 `7 s+ f$ ]7 M0 W
test ax,ax
; j6 K, M2 n' Y9 b0 q0 x jnz SoftICE_Detected' K3 x y2 s) Y5 B
/ s0 u8 q; s5 q2 O) L5 B4 O__________________________________________________________________________2 J5 G, Q3 \( w1 x: E" C) o
7 \( e9 F) s6 h* n
% Z* u' F, m M$ ^9 s- OMethod 051 `8 p0 E& ]- k G G- K! H
=========. A8 z' N4 X+ N7 ]: X
4 C3 k2 F! D: F2 Y: K$ q0 f
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& e% | x" I5 J0 l2 ddebugger. It calls the int 41h, function 4Fh.+ q ]% ^+ O Z3 p9 p3 k: ]
There are several alternatives. * [$ Y+ ?" A+ \; \4 C" C' g) }" I
9 f& w# O3 M r% A% i% `) m
The following one is the simplest:
6 c( x ]6 V: K0 `2 ~
7 ?6 l2 b1 v$ Y5 z. ? mov ax,4fh
3 P8 Z) e5 L0 y) D int 41h
$ v2 k ~+ B" D cmp ax, 0F386
9 D0 O' X6 F5 X jz SoftICE_detected, s: F6 G0 `: w& ~7 `4 d
" X8 a# N. ^3 H! k
& p* |) h6 T; p! `! hNext method as well as the following one are 2 examples from Stone's
$ Q$ ?) }: b# Y: R9 v$ m% e"stn-wid.zip" (www.cracking.net):0 g3 R3 `+ C( @+ {
7 F0 J; l2 c$ i6 ^ m4 O
mov bx, cs
# M5 u& T) w! O4 N c lea dx, int41handler2) N; s$ J7 o2 Z$ K8 v3 O/ Z
xchg dx, es:[41h*4]) c6 C$ K/ ^5 b0 b
xchg bx, es:[41h*4+2]
, j8 u1 c; w; S mov ax,4fh# \( {; L W- ^2 u% P
int 41h$ V, s% p" L) u
xchg dx, es:[41h*4]
9 o; h `) q; k( j xchg bx, es:[41h*4+2]! W- b' a! H! t8 s
cmp ax, 0f386h
' _( p6 ^) l, A5 d8 F: @ jz SoftICE_detected
" p1 `" j1 V# }9 Z' I6 Y4 n
0 w j8 o1 L* N. ^4 L- Y1 J3 @; Yint41handler2 PROC
+ @0 G+ n6 S# i; Y iret Y, C, x7 D' ]
int41handler2 ENDP: O% ]: N" e& N
" F/ m( A5 A n4 n
/ `( k& {1 S& J. d
_________________________________________________________________________
4 p4 i9 q; z$ U4 l8 h3 r8 W+ m0 z1 m; Q% a5 n9 R/ ~
; P4 [/ K( b! Q3 {; E2 S' u
Method 06
& v7 \- G9 n; K* q; j=========7 w1 b5 l6 g: j& T* z% y9 [+ D
* L; i$ Z( N+ h! J( R# h
4 S0 B8 N; u0 b9 l2nd method similar to the preceding one but more difficult to detect:) m I4 o$ i) }) t4 X% A
/ `. k9 t G0 \7 h
. P0 U2 P+ _& a0 O* t; tint41handler PROC) Y, q, u/ z; `5 V
mov cl,al- L0 ~0 @2 {) Z3 I. g5 j8 W+ z& |7 F
iret
- v& o' e1 A: x0 _. b6 b+ aint41handler ENDP' i( m. s5 L3 V* K5 f+ Q8 ^
( F% s- A) j) E' J* T% }
7 ~( p0 @! L9 Z! q
xor ax,ax( B o4 Y6 A1 I$ m1 H
mov es,ax) K- i1 w: A" w
mov bx, cs; d- Z0 `, f5 ?& T* r0 o: x4 v
lea dx, int41handler
5 Y" m1 i4 m2 f& V) ~ xchg dx, es:[41h*4]
2 U7 h1 h7 l* T xchg bx, es:[41h*4+2]
1 v: z' |4 h6 u7 H ]- B N in al, 40h6 }2 B) g; V6 A- c& H. Z) z+ {
xor cx,cx
( B- i: S& Q# E: Y2 |& h int 41h7 ?. ]. i' m! K9 L/ j& z6 q
xchg dx, es:[41h*4]
: b4 c1 z [+ R% B j4 [ {- Y1 g xchg bx, es:[41h*4+2]
5 n# X3 r* E9 J7 R9 X cmp cl,al4 a d& g* D: y% f( ~
jnz SoftICE_detected: ^0 g0 }# ]8 M
4 |) Q% M q, {
_________________________________________________________________________# k' C9 e1 B" C/ d4 L r
! D- e/ u- F2 \+ S( K9 J7 I AMethod 07
" X% u# K; V1 \=========& ^ Y, g4 a @& d F
" j% c1 A8 y6 h- o6 }, B* TMethod of detection of the WinICE handler in the int68h (V86)
8 @+ _, P5 ^+ U1 w; ]4 B6 x8 H j
1 a. r/ j* ^) z1 v0 @ mov ah,43h
( e5 `' [2 d9 Z& b' o int 68h
8 f* [, y$ o" n1 J" y/ J cmp ax,0F386h
8 v( w [$ D4 ?9 z: G: g$ J jz SoftICE_Detected' i8 j9 M2 q0 [3 V' `" n3 |
n4 D6 C# s4 F- {
J% t, [2 `* g4 \=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& A1 M5 G+ X6 T8 V app like this:
$ w! H! E/ y5 x7 Z1 j+ h* _8 e
- K5 U4 ^' Y8 b q BPX exec_int if ax==68: v6 T& F0 W7 s9 W3 b8 F: {
(function called is located at byte ptr [ebp+1Dh] and client eip is6 F: U* {6 B. B1 D$ q
located at [ebp+48h] for 32Bit apps)
3 a( c! ^) l9 b( A8 `1 D5 Q__________________________________________________________________________& A* c0 F- ~) R4 E& H; L/ h' v
' g! y: r5 V7 {% r+ |6 ? v2 a# {% i9 y; o$ D
Method 08
& @( O3 q) k \ {: d=========
* h d8 `2 m( D
5 m. c7 Z( {" ^1 NIt is not a method of detection of SoftICE but a possibility to crash the
4 F" x1 t* w5 d/ ` K2 v% i9 F6 Gsystem by intercepting int 01h and int 03h and redirecting them to another
/ H& L v# x6 u& S Y3 p% Lroutine.
A$ Z1 u2 @+ D' }" M/ vIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: W3 \/ x/ ~& N9 ^+ J9 h* Fto the new routine to execute (hangs computer...)
* C# z# \# ?; ?4 Q F3 O/ y7 \- P
3 c; X2 j" p3 L; j; L- D mov ah, 25h
$ ?$ F& y& {" `9 R. x mov al, Int_Number (01h or 03h)
' c8 l4 @, [' t% N# {( [9 r/ W+ |% U mov dx, offset New_Int_Routine
( B: X' B! `) l int 21h
+ _6 \& p. A1 x6 W7 ~
( h# N9 X1 |0 C. |0 a1 Q% j3 P0 @__________________________________________________________________________
* j3 q% f" M, V
& u2 X# s9 k. y7 |8 i, y. NMethod 09
5 b0 w/ H4 _- P" y8 n* D=========
& z: R# S0 K" |+ }5 i( Z0 M: R t* A# I% |- d
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) {5 v# ~8 p2 F# {
performed in ring0 (VxD or a ring3 app using the VxdCall).
4 k) l1 [! [0 c+ A1 ^: Y2 VThe Get_DDB service is used to determine whether or not a VxD is installed
6 U% p/ D8 O* jfor the specified device and returns a Device Description Block (in ecx) for
; O2 @. e+ S; I" Gthat device if it is installed.
d+ W" k! X5 f; W( p; A2 z& s2 c4 J2 _9 H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' \, ^$ T+ X1 ^0 t/ q) G9 Z t' R" N mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# }) n, C' d; D# m6 Q VMMCall Get_DDB# _5 y& r& Z: ^/ B
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- C* k8 G8 D$ `' s/ @
7 V6 M/ M! i/ Q5 jNote as well that you can easily detect this method with SoftICE:4 \% T7 D' y6 c7 Y c
bpx Get_DDB if ax==0202 || ax==7a5fh
# I& ?2 ` J# u. D
3 Y y! v0 D Y7 M__________________________________________________________________________8 r/ F) ^. \+ G9 r- t+ s
, t1 u: t& j# g& c
Method 10& E" H* H U3 G k+ J/ Q
=========: r [: p. R7 n9 X
" j+ L& }2 G" y/ e' E: M: V/ Q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
% ]: _2 B8 v2 \( ]( g: q1 b SoftICE while the option is enable!!
( m6 o/ C6 @5 x k( D' I3 u* J. Y' Q3 z$ K+ t" W. R5 f
This trick is very efficient:! [) `, Q& g1 }% Q+ d3 L( }1 D( \
by checking the Debug Registers, you can detect if SoftICE is loaded7 D$ }7 R% Y. G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 T6 c" b3 w' g2 `1 K, M
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) l K$ g/ }" F. v2 Jvalue (in ring0 only). Values can be manipulated and or changed as well9 N: [3 U! ?! Q, h8 l" y. W
(clearing BPMs for instance)$ |6 s2 e" I% m' ]9 z$ q1 S
& K' z$ _4 g' h1 T1 W5 n$ b0 F% w__________________________________________________________________________
7 M& _6 u% K5 ] |9 x" y6 H! Q; C6 s: s
Method 119 }" B" Z: R* x
=========
# d+ I* |7 G$ g# S @0 L v5 c: n8 i( Y5 A, t% h+ c( B
This method is most known as 'MeltICE' because it has been freely distributed1 b& r E9 k0 A7 L3 s9 r/ J
via www.winfiles.com. However it was first used by NuMega people to allow
/ @8 ^- y) I/ V% e& wSymbol Loader to check if SoftICE was active or not (the code is located% x2 J& A$ d, w
inside nmtrans.dll)./ t/ [9 g5 f1 @$ p' c" i" t9 j
' @5 R5 Q2 N2 ~% O( W! n
The way it works is very simple:
. U% {9 i' k* w+ p( lIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( K' z& q. j1 P8 e$ A' A! u& SWinNT) with the CreateFileA API.
7 E: ?: z2 ?! R! F5 K D% x% P& Q1 q) l6 s5 l& g; L
Here is a sample (checking for 'SICE'): M- i* V5 h6 s, I4 K
- _3 ]3 C7 `' ?$ ?BOOL IsSoftIce95Loaded()3 t4 m" M- f5 }3 F& K8 x
{
& }1 h' {, u; D9 B- f0 T/ q; X& r HANDLE hFile; Z; G/ M' L/ z7 u' I
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. @* h2 C; D* I! ]% f FILE_SHARE_READ | FILE_SHARE_WRITE,
9 |8 h, |: H. Q8 m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 _/ [4 j- @' N9 ^! S% c: @( V
if( hFile != INVALID_HANDLE_VALUE )" s+ l- w4 J" o
{7 j* s/ [9 ?# n1 z( S
CloseHandle(hFile);* I9 x$ ?8 n' Y. x7 O& I5 j
return TRUE;
5 ~4 U! N9 E+ Y" \5 X. Y }
* L) [6 {: j& ~& B4 S return FALSE;8 s9 d# z% h: y
}
; L1 s& [* d& X" P' g" Q$ V0 L. y7 y8 q, h' p
Although this trick calls the CreateFileA function, don't even expect to be
9 E8 E% Y) }, Y* P5 w$ E' w% wable to intercept it by installing a IFS hook: it will not work, no way!* V! q+ [" i1 W/ u \- H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 z. P! \. o4 Q9 Z4 h
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* n O. N0 v/ p
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; ^ ~- Z, U: Q4 P. R7 Hfield.
% ^* S* n$ X% b) D2 K- {In fact, its purpose is not to load/unload VxDs but only to send a
- [" A4 D* _5 C, n2 |3 nW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* U5 }& z% i! i* [6 c( [to the VxD Control_Dispatch proc (how the hell a shareware soft could try; j: {" d7 Q6 V4 _: ~
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* x% u+ X5 V7 D0 e1 L0 ^& dIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 o2 p0 p4 x+ N! K0 A8 ]8 l
its handle to be opened and then, will be detected.$ Q0 {" y+ d; n/ D/ ^' J4 o
You can check that simply by hooking Winice.exe control proc entry point
# X, }+ D% ?( \while running MeltICE.% ^" {6 d0 `1 b% X
& {8 G; \1 [6 X
. I- C7 K$ ~0 U. t# x8 Y1 c0 \! o 00401067: push 00402025 ; \\.\SICE) G- l, C- s& D
0040106C: call CreateFileA2 p; y3 O. t8 G+ E- s& K/ f" s
00401071: cmp eax,-001
/ ]* T: r8 l2 e i0 S& c, l 00401074: je 00401091: _ t$ h A/ g/ X
1 x6 z, y) U$ i, H
& m" Q' Y+ U: I' tThere could be hundreds of BPX you could use to detect this trick.3 X& A7 I, v9 ]% {- I7 c' q
-The most classical one is:5 i* K" O5 o( W. r, M- J
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* v$ b, f- n+ A3 {2 h/ b
*(esp->4+4)=='NTIC'
) \) r1 Y* ?( k8 p1 G C5 H1 n+ J! [: S8 e/ m. V8 L' \
-The most exotic ones (could be very slooooow :-(
- o1 ]* @; U) @' J( H$ K" @7 W4 _9 Y% U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : y) y# }' R; F4 Y# n* B
;will break 3 times :-(
' Q, T: ]9 I0 B4 r+ _( n7 j2 Z& T# ]. Y! Z8 m+ S
-or (a bit) faster: ' {1 X. n+ E+ g, U
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). d! W' @! z/ E6 s6 l
! L, E w2 K$ h7 S( @# W0 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 G4 g/ `! T; W( h
;will break 3 times :-(# E8 g. E0 D9 @3 Q4 D
1 Z5 W; p. e. ]
-Much faster:- O3 d1 |9 r0 W0 q( W; [
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 p+ M/ ~$ P/ _1 V, b) U! z" @3 Q$ I0 D% ^/ b
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 P0 {( E3 L1 l0 Wfunction to do the same job:( J# p: n: i9 S$ N
! C& f: _& ^6 a6 j) b _/ n, u% {; _/ w
push 00 ; OF_READ8 x7 |$ I% z. X j. C o
mov eax,[00656634] ; '\\.\SICE',0+ S! \6 s! S7 Z0 C+ a, ^$ E' M% u
push eax
( q1 ?* H6 t3 t9 m6 X( ^# h8 f! I call KERNEL32!_lopen
; |# `$ s y9 F Z inc eax& U0 w; V1 U9 i9 _0 P% l
jnz 00650589 ; detected
' J5 ^) E5 c& z6 o( w push 00 ; OF_READ+ T! r" b* \# q# Y
mov eax,[00656638] ; '\\.\SICE'
) v+ I' A/ ^+ X) d8 p1 y; s) W push eax
* h# `# l e) k# p9 m* y call KERNEL32!_lopen
0 u' \, t8 \4 ^. N# H4 D3 F inc eax
) n" t8 I8 f2 C1 N! C jz 006505ae ; not detected8 U/ j! x" g* g" x" D
, ^7 @4 W6 _0 v; q. w# l" w" p4 Z9 q) p. \" j
__________________________________________________________________________; f6 j5 ^8 Z8 ~, n1 u5 w6 A
/ e! ] \* s" K& n1 o" x9 }Method 12. J& F6 {" F% r7 H& ^
=========
: x) I: C" s/ L- h5 @7 D) O2 W5 ^, @" b
This trick is similar to int41h/4fh Debugger installation check (code 05
8 C1 r0 }9 f; ~* K& 06) but very limited because it's only available for Win95/98 (not NT)2 V' `: i6 h+ N- m. p7 Y# t f
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." Q. f, Y0 w G! L5 x1 y
/ s$ b: A/ b! C. `: H3 l8 X
push 0000004fh ; function 4fh! E) r+ B# V$ t B/ [( i8 |
push 002a002ah ; high word specifies which VxD (VWIN32)
$ V8 T0 D( J3 a7 _; s; ^$ L ; low word specifies which service( e( m- G& R! K c. G1 g) u/ H
(VWIN32_Int41Dispatch)$ ~/ q& C, J8 Q- R0 G6 z% t( q1 M
call Kernel32!ORD_001 ; VxdCall: B8 ~9 _3 X& n$ t. s$ M
cmp ax, 0f386h ; magic number returned by system debuggers5 l- O1 e& p( h" P
jz SoftICE_detected r: N; L- ~: Q" `
1 s. X# h/ R6 j. Q
Here again, several ways to detect it:
) {. V2 c) Z) V7 [, {. J" u2 p% P( K9 g. l
BPINT 41 if ax==4f3 H# l7 j8 t5 S j
! S- l( V0 m; y* y0 Y: ?( ]
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ g3 C1 T: s; t% I8 u& s
1 H2 E8 y3 h3 c0 j6 K! o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
e+ w k' t( ]5 X0 \
6 b3 O3 r7 ~2 z$ N# H0 w A/ m4 k% r BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: t6 b0 Z+ k7 v2 V
4 n* _* u4 L, { r1 k__________________________________________________________________________' n9 B# w8 h) D7 x1 n
{+ a" i) v( c CMethod 13
0 C4 @% k# u6 u, o% n2 H=========) x# Z) M' H4 H/ d/ w3 W) L# s
( h& f7 B1 ~0 A- M* U& B! m6 D
Not a real method of detection, but a good way to know if SoftICE is
( u0 ^5 p; d6 P2 u. }8 pinstalled on a computer and to locate its installation directory.
3 T$ U, }1 W" k6 U4 _It is used by few softs which access the following registry keys (usually #2) :
6 B2 {- z3 i, c( d8 `$ \
6 K! C2 L1 _2 t$ M3 Y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) @/ v2 i) l1 a4 C) b6 g3 i2 K- G( J\Uninstall\SoftICE
' Z% ~* I" v0 c' F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 {0 ~/ h k* l6 @) j* v: m
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 L5 o. U/ ?5 v) S \
\App Paths\Loader32.Exe# A; P7 t! q8 ~" q2 t6 _9 g+ v
) C0 b, N7 G" Y u# F1 Z' N! e2 Z7 f$ f1 w: P' @4 ]
Note that some nasty apps could then erase all files from SoftICE directory$ r y$ v4 {6 s# s) B; H2 [- w4 v' s
(I faced that once :-(
5 J' Q8 K( H8 ]1 a- J) H* @/ B0 u( Q% b' A9 H
Useful breakpoint to detect it:( U4 w! x5 F C. r9 i+ \
7 n. b& [9 H: j9 p3 e% H BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: j5 h0 o$ y* F& t# v7 L
: i3 S* P% L% B! x__________________________________________________________________________
6 z: _! Y2 m1 C& I
# n' q7 k/ C" h8 ?4 a f& A' w0 A# G1 J, u
Method 14
# u' ?, m9 f# o$ f) ]- b=========
: E% ^+ q6 l r; |3 [) h7 j7 F C( Q7 |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ I" |! |* t9 g
is to determines whether a debugger is running on your system (ring0 only).# ^) T2 d6 o; R5 J
1 @' {% F0 ]! B1 i. L- j3 ?# }9 Q VMMCall Test_Debug_Installed
( S3 \+ Z! i: r9 g' | je not_installed
, y3 ~) `, B# ~& v) t+ X
6 l9 ?' Z$ d# b! {* ]4 s+ M, WThis service just checks a flag.9 H: v: ^9 H! l) I
</PRE></TD></TR></TBODY></TABLE> |