<TABLE width=500>8 |4 _/ i4 d+ n9 }
<TBODY>2 M, ]# ~% U6 u+ p
<TR>/ O: j( N/ t/ I/ i
<TD><PRE>Method 01
- [0 e# I2 {/ D- J. e4 |0 C ?=========8 c5 b2 }* o8 o4 R
' i- z, a/ M2 ]% o- F
This method of detection of SoftICE (as well as the following one) is
& q- h" J* y5 uused by the majority of packers/encryptors found on Internet.- V% p6 Y" _9 R! }
It seeks the signature of BoundsChecker in SoftICE
) t, T" }- b. c$ k
" t( k' C: [# c1 Z% v mov ebp, 04243484Bh ; 'BCHK'
7 A1 l( f2 l* x8 b! a mov ax, 04h! }& E; B5 k4 [+ J, M
int 3 2 [! M% [9 O, B% ^+ M! d x
cmp al,4, s- O) R( _' x9 t- `
jnz SoftICE_Detected* B# g5 T# l8 U$ o6 _5 J4 R3 o
, i8 q; L* X" G7 q3 C
___________________________________________________________________________& R2 m; m# l0 w P) w4 ^
3 M' ?+ P! a3 V- P5 k$ fMethod 020 k! R: Q4 @' t" ?1 U
=========
" E, {8 U: a( I. N7 ~. L4 R& l3 U( t8 f2 J
Still a method very much used (perhaps the most frequent one). It is used
! F* _1 |3 v6 t" h6 sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 z! Y3 j" ]# U
or execute SoftICE commands...* E) ?* l5 L4 t; I h% w+ H
It is also used to crash SoftICE and to force it to execute any commands
* L9 ~6 g i. u. w: f- _7 \* w(HBOOT...) :-(( / K6 N9 j. X& \. b; O6 v* z- U$ }
, |' [& S q; e1 D u
Here is a quick description:
9 O+ T4 C# o* _-AX = 0910h (Display string in SIce windows)
0 c2 t. g! U! j! Z( u5 C% t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; `- i5 l1 j4 Z' N8 P. B-AX = 0912h (Get breakpoint infos). D6 D( l* _6 L# h& V$ _( B2 e
-AX = 0913h (Set Sice breakpoints)4 L- k& h8 g B
-AX = 0914h (Remove SIce breakoints)5 n9 a6 J( X0 x2 I- R0 K& R9 p; l
+ n5 z7 a( ?% f5 JEach time you'll meet this trick, you'll see:
* M6 y8 V6 t+ u" H0 X-SI = 4647h
; H+ i: X% K9 J4 X$ ~6 |$ ]-DI = 4A4Dh
- I! C% \; R5 ?" t! S9 UWhich are the 'magic values' used by SoftIce.* m. q; l ~/ H& v* m
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 `8 Y" i" h. K. y$ n6 p! X1 h3 t3 h; U6 l" X
Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ ^" F. ]: W m& l6 OEnvelope utility use to protect DOS applications:! Z. \6 F' w, L' \
2 i- y7 m/ v$ c* \# s
. T. E9 P% m* Q) D5 e4C19:0095 MOV AX,0911 ; execute command.' ]) w% h$ h, e$ F% E8 |7 j
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* Q5 z% h% g/ l4 x3 x: g! M
4C19:009A MOV SI,4647 ; 1st magic value.
^+ g. o6 a0 D) J4C19:009D MOV DI,4A4D ; 2nd magic value. ~7 q" G2 N5 \8 D/ i6 v, H, g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 ?- x: P/ n5 V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 [+ J- I" s9 ^) f8 ]
4C19:00A4 INC CX
- E. e4 V# K3 }4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" S) ?& S' l5 e( B4C19:00A8 JB 0095 ; 6 different commands.
) C, ~& ?' {! p& s4 @4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 Q4 H o- U% ^& z1 G6 @, k5 L0 P
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)& b9 A1 L; b6 \3 N+ K. M9 \
. Q- |4 ^2 @/ u& SThe program will execute 6 different SIce commands located at ds:dx, which
# q2 E$ n+ L% f3 N$ g, \% oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 X+ J; [3 }- K9 `! S( J# C
, M5 @6 n7 Y1 c& W9 N; V* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) z7 u4 O' V+ Y, z
___________________________________________________________________________
4 l1 g7 b- D# |0 k! f; A6 {' |4 I! i, \
& e/ y* e3 J8 f' Z
Method 03
1 j u7 o3 S, n=========
/ j& L# o& F) U
6 p, T! ^3 x( G7 f, v6 O1 |3 lLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 O- m m5 r/ I3 |. P
(API Get entry point)+ {/ I. N. d, _4 B' D
! r k- j# c3 M+ e6 N, a% s, }
) p& \8 R* L, |. u3 W/ s! r xor di,di
% I& R) L$ ?% K) T2 r mov es,di' k; u. x; R9 X" w/ y. [
mov ax, 1684h 3 n" W* q2 n7 f; J! x6 u& \* i
mov bx, 0202h ; VxD ID of winice
( l/ \7 ?5 W" a0 s' O) U int 2Fh) U: O+ @ o; f4 y+ U M9 H( Y
mov ax, es ; ES:DI -> VxD API entry point
1 O$ {: d7 Q. |( l6 y* i' ], t add ax, di
6 w! u0 K8 U s1 r+ a) S2 m) t test ax,ax& }5 e8 y% m. A: g# A
jnz SoftICE_Detected4 y7 S7 \6 Z! U$ J
- r! U' |$ ^% {8 U# {' U
___________________________________________________________________________
1 a' n! y* \1 j! T" } k! p- J
- h* f. {4 h- C- O& H7 J' xMethod 04
: \, [+ N% s; p; L3 X' K, P=========
, ~# R4 n$ k9 H2 C0 O; `9 S, n* ?, J: u' f/ s& i
Method identical to the preceding one except that it seeks the ID of SoftICE
`6 o9 x$ I y5 ]GFX VxD.2 ]' P2 C g, L, y
4 \* f) x) P! n J8 Z
xor di,di0 C6 G: w( O* R: V* L
mov es,di
; L" g4 f) G1 ~) A! K0 r mov ax, 1684h # A% C+ M4 J2 A# M1 q5 B: J6 r
mov bx, 7a5Fh ; VxD ID of SIWVID
* ?" c1 [$ L' d3 M9 e- |* W int 2fh
! Y2 c7 I1 K1 W# I4 X mov ax, es ; ES:DI -> VxD API entry point
' O N `; r; J6 O9 U( W2 I add ax, di' _3 D# w/ `. L
test ax,ax
5 F5 ?: I& @- _+ b, { jnz SoftICE_Detected
! P& X8 ?+ d+ z) i
! j+ P' [6 x. n: o__________________________________________________________________________
" M: |; Z+ G( f9 A
. B4 B8 [5 A% {5 I$ v7 n* e' x& h; W3 ?) T: Q
Method 05- R) L6 b- g4 K" O% ^& a4 u C: X
=========3 d1 Z/ p% `: z) ~) W6 _
) m1 w; S+ D9 w! m2 G: j1 I
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ i' i# {( q: L b0 D
debugger. It calls the int 41h, function 4Fh.
% j3 |- ? v5 ]! LThere are several alternatives.
M1 @9 @' X% [8 T& P2 u$ C) |' c' F/ B6 \
The following one is the simplest:6 S' D& n7 X" ] ]
* P4 k; p4 k; \/ {8 w8 p6 T2 t mov ax,4fh
1 P, ?* U4 L4 N int 41h5 \, _6 W$ p9 E( p% |) X- z
cmp ax, 0F3867 O: W& s: h6 q6 \$ `0 G" w8 L- c
jz SoftICE_detected
& o* r4 }- M1 c: C* |/ a K% W: u- O- t" ^
4 |8 w/ K5 w! R% p5 cNext method as well as the following one are 2 examples from Stone's 7 ~7 J5 ]1 S6 I3 W, g1 M" X( V
"stn-wid.zip" (www.cracking.net):& d5 M; k- p8 P4 V$ C5 x- O
" c2 l. Z) U) M( m9 S3 h4 { mov bx, cs
: ?+ U& y: L! n- p, r# L& E) v, \ lea dx, int41handler2
/ T# m7 C, o+ _5 w' o+ O$ N xchg dx, es:[41h*4]
0 E2 w9 z# e! R3 V9 J2 d# ^& D xchg bx, es:[41h*4+2]7 c: }# u( m+ e( Z8 ]
mov ax,4fh: `- V e) Y( q' v. D4 c4 ]$ K
int 41h
& Q* S# t3 w7 G xchg dx, es:[41h*4]
+ {/ q! P, I4 i$ H xchg bx, es:[41h*4+2]. B' s4 b$ ?+ ~3 [) j" b; u
cmp ax, 0f386h V* q" ?* N! w" T
jz SoftICE_detected
9 [. Z$ S) s6 m/ }/ d' y+ A0 B! F
- D" o0 x8 [4 ], D$ Z7 eint41handler2 PROC
9 ]6 a7 R6 P2 H% z iret4 V2 e6 L* W: J7 S+ ]0 R5 i o6 ~
int41handler2 ENDP6 {# p- {2 i$ j
3 {- M8 v2 l3 z4 w- u6 g
0 }1 J5 V8 L& Q( I4 B* p: d_________________________________________________________________________
! w* T W6 n: J' T' Z) B
/ t: u$ a* @* H2 q4 l# |
8 u! l7 }( |+ Z! z: r8 y, tMethod 06# M4 Y: q1 F) e6 T( I
=========
1 d) c) Q; m; U. n# q1 F% B+ A: k% \+ U0 L2 i& b9 u
+ I' b+ M, U0 n. M2nd method similar to the preceding one but more difficult to detect:3 c: b! l5 x: X; s
/ h8 i, N# \' l& ]8 s
1 }# \& i# ~, J* J4 }* \3 Tint41handler PROC
& z4 G, \7 C4 i# t mov cl,al
! ?. S; Q6 J3 W iret+ {5 T* W3 w9 |. c. p
int41handler ENDP
% }9 H& {) z/ n; G! E! D
$ ^* v9 z: x. w" P# [+ W V
3 o/ V( Z. B6 z. O/ c" A2 b xor ax,ax
( L% W1 D5 \& [% [1 { mov es,ax, S. B2 f: C9 ]
mov bx, cs$ {& v+ K# M4 p' P4 V) m3 U5 `! ~
lea dx, int41handler
1 z' W% w- i9 p7 }% w xchg dx, es:[41h*4]
8 z# @0 \9 d( F xchg bx, es:[41h*4+2]
7 p( ? o" L0 f% O/ J, ] in al, 40h& q3 P' G& p! Q6 D& Q, S) B
xor cx,cx
0 a5 D7 r: K- \; x int 41h
0 q# ]1 T! i! P, \7 I, p- t xchg dx, es:[41h*4]
* T) U' U" Y2 p) o( B xchg bx, es:[41h*4+2]
, X0 y0 a# n' |& I7 h, X0 D cmp cl,al5 Y$ X: \% A2 _! {
jnz SoftICE_detected9 a6 F# D5 K8 J/ [& A
& j+ K! m8 k6 I0 {( C
_________________________________________________________________________
! k; L3 j6 ?6 ^, S/ R8 ^6 d; [7 i; w: v9 q0 U! J$ Y
Method 072 o) e: s# ]! T) g
=========
, l4 B+ t1 h* e) K' q, D# g
9 w6 s Q( ?- k x- {! j- [! C EMethod of detection of the WinICE handler in the int68h (V86)
, ?8 F5 f: w$ X. z0 F. D
# _. b, g3 \4 u8 e( O, s mov ah,43h4 I& {- ]$ s4 R+ e* ` _2 b+ ]8 h
int 68h
; }, ~4 T x0 h) P cmp ax,0F386h
: t% d) s5 E3 e jz SoftICE_Detected
% v% G0 t: ^$ Y b
5 l2 c% p3 y0 F
) b/ l1 q" c }4 v; O=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit h" L4 O* j8 E- L4 K8 w% F
app like this:
$ t; W( c3 O! j9 X0 A4 B8 L
; Q$ C! k! i( P q8 Q BPX exec_int if ax==68
/ T b4 _& |& n. \! f (function called is located at byte ptr [ebp+1Dh] and client eip is
! |. Q' c; e: L0 \) j' C; T% h4 v located at [ebp+48h] for 32Bit apps)7 X) h: h4 [8 a V. m
__________________________________________________________________________ p5 ~3 k; H! N; E5 {6 k! K
/ q0 R0 z- |/ e. g( [6 O3 B0 I# B# h! ^7 h
Method 087 I, a) N! N( o
=========9 w7 G4 r8 t$ L0 i# ^1 l: r( j
9 D! t1 q }$ d. F' }5 ] i/ LIt is not a method of detection of SoftICE but a possibility to crash the
/ E+ u9 P& }% S/ n& Nsystem by intercepting int 01h and int 03h and redirecting them to another/ _) x5 P% J% c. G7 _
routine.
! O, r F: M. N- m4 w5 eIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 z/ o8 @4 Z+ u' D7 `$ j
to the new routine to execute (hangs computer...)4 W7 ^9 u2 ?% p
; M3 l5 V1 ?6 } N5 W0 C$ ]+ h mov ah, 25h
" ^+ {0 f v' L mov al, Int_Number (01h or 03h)9 I4 z3 x7 h; n
mov dx, offset New_Int_Routine
/ `6 B- M6 v4 R int 21h
1 ?! R& r/ a8 Q8 S, i7 u! V1 d. Z* c3 t1 w. N
__________________________________________________________________________' N! H( z- P, E% {9 c/ a) t9 j' c/ Q
1 [9 T: [- B/ x. G1 C0 O N+ E$ AMethod 09+ O5 _. `5 Z. e+ Q
=========
* t) r" z" y F# {6 N2 t8 w' \$ Y1 M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 c9 j/ E7 @& E2 A2 U9 r. lperformed in ring0 (VxD or a ring3 app using the VxdCall).
- n, H" `( m7 k9 [! H5 _The Get_DDB service is used to determine whether or not a VxD is installed
% O7 O" K+ k7 Bfor the specified device and returns a Device Description Block (in ecx) for
" A2 m* Z4 J- D* j; r9 }: V5 p& Athat device if it is installed.
# d4 l* ~4 [6 D/ H1 w" p7 j0 f: d
& r+ z, w6 {( h0 \5 ^3 E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 k' ]9 J1 F( F0 ?5 O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) Y4 ?7 H4 u0 D* B; l6 s, a
VMMCall Get_DDB+ @5 g, Y& G3 z0 Q6 t) F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
6 l3 l1 V P& h, _" z n3 {0 H& }* h+ S" V
Note as well that you can easily detect this method with SoftICE:
$ Z" |& a8 s6 b% o2 i$ A4 z bpx Get_DDB if ax==0202 || ax==7a5fh
+ B7 j7 c# t$ M( U6 W6 T
$ T; {! p' {, c% J/ p- N__________________________________________________________________________: C; w& l2 d5 f7 {, C
9 `1 ^7 j ?5 v, x6 Z
Method 10. z! \2 L, x6 G7 k0 _8 }
=========2 L0 ~' J) O9 i9 W0 X
2 b; d- X+ O6 x* V# H+ y+ e% V
=>Disable or clear breakpoints before using this feature. DO NOT trace with3 ^; M2 B* b" ?! G4 ^, O
SoftICE while the option is enable!!
) Q1 j5 v6 z' a3 N. |
. r# w; [" e# J; CThis trick is very efficient:# z% F2 i) d$ t& C
by checking the Debug Registers, you can detect if SoftICE is loaded$ e. T1 E5 P8 l& r2 ?- Q/ K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 d5 n d/ `8 P
there are some memory breakpoints set (dr0 to dr3) simply by reading their8 U, [; Y9 n7 ~ ~
value (in ring0 only). Values can be manipulated and or changed as well
5 ~/ E Y- d+ U' }. B$ q; |(clearing BPMs for instance)7 u! s- @2 K2 @: j3 Z
6 b* i4 C5 h* a v! V) j
__________________________________________________________________________. Q2 S% n6 Y; a$ d) x5 J4 _8 Z6 r
$ _5 M1 f& } C |Method 11- C4 |/ C. z5 `/ j/ c6 C5 j
=========6 v8 O8 t0 n0 {4 s) ^
" K9 C( h, I: l3 n, aThis method is most known as 'MeltICE' because it has been freely distributed
& g$ @# x, G- w9 |% _8 n1 Nvia www.winfiles.com. However it was first used by NuMega people to allow) d" ~! T1 E! e
Symbol Loader to check if SoftICE was active or not (the code is located! W1 R6 Z0 G# W$ o
inside nmtrans.dll).
8 S& h2 f( T! u% s/ Q
9 I* @) F0 n. | L& YThe way it works is very simple:
3 Y+ o0 ]( x( E- B7 VIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 b+ O4 r- F& m" f1 B$ U- E% AWinNT) with the CreateFileA API.5 Y/ m* O2 c; j+ N" u
% w" u m& u& v: s
Here is a sample (checking for 'SICE'):$ o6 X Y1 z0 L, J0 }( [9 j( ?* D
0 t, E, N# L0 f B
BOOL IsSoftIce95Loaded()1 ]- u. p# m# I
{% z9 @% h/ ~6 P! c2 k
HANDLE hFile; : p2 s& C& ?: j! o
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% L1 x, l" S; N N9 u+ ]5 Q FILE_SHARE_READ | FILE_SHARE_WRITE,. V7 d4 G+ ^3 |8 ]. ~+ p5 b0 z
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 M6 u$ e9 h1 e4 k, @' L! ^& C, j
if( hFile != INVALID_HANDLE_VALUE )
) Z1 h: y3 ~( S, F! H5 W8 V {
" t/ A1 s: l9 L/ p6 o" P ~% i1 Q CloseHandle(hFile);2 @5 D' d m7 W! s
return TRUE;% l+ V+ R- t% Q3 `" G, j: V
}9 B( w8 Q% s1 @' C' [0 b- q
return FALSE;
* M# h) M( S+ G" p! O, X}
2 O# L8 O, g; _1 q& p% c
! ]3 n0 f3 q8 F/ {* nAlthough this trick calls the CreateFileA function, don't even expect to be
2 C E+ W# `) z: \& rable to intercept it by installing a IFS hook: it will not work, no way!# N; f) X# Q; E1 U1 M* \
In fact, after the call to CreateFileA it will get through VWIN32 0x001F9 k% R- S, A. Y* P2 S
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! D7 r' b( c% Z% e- Z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc) P( j! p1 [/ C3 L# j, B& S2 S
field.6 E a5 X, L7 x
In fact, its purpose is not to load/unload VxDs but only to send a 8 j8 x; \7 R: r# m6 g6 D' T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' \4 x) d* Y4 t9 Ito the VxD Control_Dispatch proc (how the hell a shareware soft could try1 u8 m& s$ G* H4 p) F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 [: P( }. c) U% bIf the VxD is loaded, it will always clear eax and the Carry flag to allow: _- s! C1 W# h w; Y# K, J
its handle to be opened and then, will be detected.3 V# _. @* Q7 B% F! b* j( n
You can check that simply by hooking Winice.exe control proc entry point
7 ~+ i6 y# e3 u9 p9 x3 dwhile running MeltICE.
+ c, i, p9 z+ U, O" p [+ c
: z& O5 W. d: R4 l- p
4 b8 e* N& d; y9 F 00401067: push 00402025 ; \\.\SICE1 G0 X+ k* T' D5 _+ w
0040106C: call CreateFileA
3 B6 P- Y- p! s7 ~& a$ ^ 00401071: cmp eax,-001% Y9 c. H9 X! c$ `" m1 V6 ?( u
00401074: je 00401091! B# V) `$ B" n/ S, Q
5 I8 I8 L \$ y. B
( ~: y5 a) [) l- k2 e' A) d6 NThere could be hundreds of BPX you could use to detect this trick.
! T8 q# w8 \; a: }. U# R2 E-The most classical one is:
1 B% M6 V X( d9 o BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
" X' e0 `3 o" Q: l *(esp->4+4)=='NTIC'5 d1 R* C2 |, ^* f4 l: a* ]9 L) j
& F" l! [; Q/ m3 N: G; I0 ^9 d5 A7 S
-The most exotic ones (could be very slooooow :-(
# ~' r9 q: n: [ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% w+ y8 m: f$ ]$ ^: L ;will break 3 times :-(2 A" D" y# ^9 v( c. G8 N% X
% ], W% H& ^" g/ C& e) ?-or (a bit) faster:
' M& H. ?/ t5 p* R8 [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 d. v8 {, x9 c0 |
1 `7 Q3 N3 e$ f5 J: H2 d' F
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % A& F) m4 Q$ ?9 a
;will break 3 times :-(
8 f) s- R( k6 {( N
! t L# a- {+ B) a3 n, P& `# O-Much faster:
" O A$ V: ^# f& n1 t BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 b6 ?' ^$ J1 J, \
# F! ~9 \+ d& hNote also that some programs (like AZPR3.00) use de old 16-bit _lopen9 Z# i& w& N" _/ s0 s/ ?. ]2 t8 ]/ U3 t
function to do the same job:" R. x8 T1 |' p# g, U
. u! u: Q$ G4 a3 F5 Y* |
push 00 ; OF_READ
* b8 @/ [8 L, T0 q( r! f- Y mov eax,[00656634] ; '\\.\SICE',0
1 t! z$ c% I% ~ push eax0 h. ^2 x* K) s& ?7 `+ }; q7 a. Q; l5 i
call KERNEL32!_lopen$ g% {" C. f: ]5 Q! S' r! ], m* v
inc eax
! c( T0 r" p3 d+ }; [ jnz 00650589 ; detected
8 W% h/ |* i3 b/ r push 00 ; OF_READ
9 o3 V% a. U2 s mov eax,[00656638] ; '\\.\SICE'
9 @, h- N: N/ f8 Y7 v9 [) A push eax
+ t6 T2 W+ I6 E" b' R" c4 P+ o0 R call KERNEL32!_lopen% B1 \8 w1 x0 R) R) m. x
inc eax- x" W2 {$ V' r
jz 006505ae ; not detected- b0 X1 J! Y- _% P0 I+ a
4 G9 F2 F; \! a" w3 [0 W3 G
, t& k& M) O$ a& W# ^3 g [__________________________________________________________________________
, q r' P* F5 \ [5 h9 B
+ p; r7 w4 K& o3 vMethod 12# e3 z8 j) V! g0 d5 Q- z
=========
& L" S* N; S9 Q/ ]
* \0 N S5 z, r- zThis trick is similar to int41h/4fh Debugger installation check (code 05$ s+ v& ?' e3 O' d4 g% ~9 K/ X, ~
& 06) but very limited because it's only available for Win95/98 (not NT)" k: V$ q) L( o. I2 N4 n/ T
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# v( b2 J, s7 y' C% p3 g( |( A/ i) k3 L h/ C# r' c" j( D
push 0000004fh ; function 4fh
! I5 `+ W/ |; Z0 p push 002a002ah ; high word specifies which VxD (VWIN32)
0 K% Q9 X- L& T4 M4 f$ z ; low word specifies which service# c1 _. F* v4 K! i+ {$ _, S. z6 T& r" S
(VWIN32_Int41Dispatch)4 L8 ^( P! d5 i' }" O* D
call Kernel32!ORD_001 ; VxdCall, ^3 g% r$ s5 q+ o; g9 _2 W
cmp ax, 0f386h ; magic number returned by system debuggers
4 z; Q# B7 I( a$ S9 z( Q' S) D4 D jz SoftICE_detected9 n! l; n5 Q8 U' f- @" g
4 `! v# e% {: [5 C# p5 U
Here again, several ways to detect it:
0 K2 N9 u, B9 [" o6 K# [- E$ O4 f4 u' M, u# K
BPINT 41 if ax==4f
7 w( H: j* A/ l4 ^2 W) J
6 H2 T2 s5 q5 G% Y: e BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" m9 ^" h. W6 T+ D3 j Z4 R5 B3 Y3 f; p" N( z2 x5 ?5 n2 X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 Y5 m5 |; V) @6 Q% R% h/ A; ^( Z p* i& O: B' Z4 z# S0 z2 n9 v
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. W9 N- e/ e V; ^- ^" O
% H+ ~6 v( f) |. W+ z! L__________________________________________________________________________$ h' b$ n3 P: |8 \
; p* t" v i- G' k( b1 |" L9 P* r
Method 13' J2 _& `. k9 }) G2 C: S
=========+ |" u6 D' }% P" R a& K
3 ~/ ]0 t9 `/ YNot a real method of detection, but a good way to know if SoftICE is
8 _8 x( W+ m# E- g. l6 R6 n* Vinstalled on a computer and to locate its installation directory.; V2 v2 k: \9 q7 D s
It is used by few softs which access the following registry keys (usually #2) :
+ t% w4 A7 S5 Y+ Y* P" t, a3 s+ k# g3 [% C! a& O3 G
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 G' Z* n& i7 A' f0 b/ ~\Uninstall\SoftICE
- u: v' f4 G' A-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! U& S( \* a% c$ D. N-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 B9 B! V x. Z7 l& r
\App Paths\Loader32.Exe9 U7 f7 e: T0 a+ S6 q/ d& D
% a4 x$ Y: @/ h8 p2 e; C$ l) S7 E
+ e' v6 e% g& O5 f$ a, h* U2 {# U
Note that some nasty apps could then erase all files from SoftICE directory/ f& g/ p0 S$ |% K, i- I
(I faced that once :-(1 g5 p* n: L: L, M" F G! d& G
$ ^6 j2 ^2 I. Y4 ]
Useful breakpoint to detect it:
& u6 x! d5 B! w ~2 k( \5 H) f7 w; O( C9 t3 r# B; F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 O# d! t3 U1 {+ s% k8 y4 w
8 ?# S, o, B& v, ^; |, x__________________________________________________________________________6 b' j1 X1 h \8 n$ Y0 R+ P
# F6 q3 p9 a1 K: \+ b6 M6 C% N! Q/ Z2 @ V& V& \
Method 14 ! I6 Y) E% _' m- |4 M: M6 B
=========4 |2 Y; z6 ^5 J- e' Q
y0 {0 n; c7 { }# \- j% i2 J9 b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 x9 U/ @& u" }1 `8 [1 D
is to determines whether a debugger is running on your system (ring0 only).
* D8 F! z0 a9 B
9 U/ K4 U& X5 ^6 D& r" C" T* O VMMCall Test_Debug_Installed
! W3 {* p6 C( N% }/ J8 z {& Y9 K je not_installed) m+ [3 s3 i3 G
- n- r* ]4 z# oThis service just checks a flag.0 ^+ j5 ?) d3 |% q7 t6 i
</PRE></TD></TR></TBODY></TABLE> |