<TABLE width=500>
, @; t. k W$ F) g5 t! W6 X<TBODY>
* T! S: b! z! o" q! a<TR>% Q; ?; k$ Y9 g& Y/ ?, p9 _- E
<TD><PRE>Method 01
8 x$ ^4 h" K# O: O0 H" W# ^. c% _( t, A=========
' z- p% Q2 K$ v, z" X! ]# O) |) C; b
This method of detection of SoftICE (as well as the following one) is( [) s* I; y1 D$ Q; q
used by the majority of packers/encryptors found on Internet.
( Q* }9 x _; ? g) k$ ?' _: OIt seeks the signature of BoundsChecker in SoftICE9 c' V+ Q6 C% m& q. [/ H5 B
0 C4 L6 `7 j3 ]4 T: ~+ s
mov ebp, 04243484Bh ; 'BCHK'0 [3 |/ y! _( l; o
mov ax, 04h
1 Y5 I, @' v% x Y int 3
, {% s8 h0 `; E cmp al,4- E% Z- @, f% A) {
jnz SoftICE_Detected
! c$ M8 F. t: ?3 y- K1 b0 E/ W
- G1 ]9 [- e& S+ v" C. m___________________________________________________________________________
* |9 ^1 O& R. P# M0 {$ r) y* ]) B5 a" p1 C4 c" z! {0 X
Method 025 T& J, d6 z8 G" h3 M
=========
7 O6 }4 m( e6 ]: w/ r7 ]6 l$ ^' m. h6 G3 D4 G t
Still a method very much used (perhaps the most frequent one). It is used
5 S u+ D! E$ h, T$ v7 X' N8 y& o, ]to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' Q0 H" x4 E% @& [; v- h
or execute SoftICE commands...
1 ^! U% [3 [" C" I( Z6 UIt is also used to crash SoftICE and to force it to execute any commands
) [8 @( F i* ~- c8 X/ |1 v! t# x(HBOOT...) :-((
! I4 f8 A1 |9 d7 ^
. {6 B- ?- Y4 X% ~Here is a quick description:
+ O* z# Q! L k+ I/ `-AX = 0910h (Display string in SIce windows)- d: G- U8 U! [
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) r, L! R' ?2 ]/ `! r& m5 _: B-AX = 0912h (Get breakpoint infos)3 Z/ f/ g: s' k4 R& t5 L% _/ {
-AX = 0913h (Set Sice breakpoints)$ C, I0 U* S$ _$ h' U
-AX = 0914h (Remove SIce breakoints)
% ?8 G/ x- [; Q5 Q
( b1 x1 I- A# uEach time you'll meet this trick, you'll see:4 G t/ V) h+ G6 E6 T! P j
-SI = 4647h
+ K# U7 W2 }! a* T; d1 F-DI = 4A4Dh
, E6 q& T4 D q6 G, n5 JWhich are the 'magic values' used by SoftIce.5 D1 n: E7 Q' @0 F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
) J( B1 O H- i- X; g2 L( ~4 U8 C' [' b: I. N2 b
Here is one example from the file "Haspinst.exe" which is the dongle HASP9 P5 |# e8 ~; d2 Z7 w
Envelope utility use to protect DOS applications:
- z0 _- @" y2 C. Y! V) b- |8 `2 J* E
: g" f h; w% ~3 q
4C19:0095 MOV AX,0911 ; execute command.8 Z$ [9 r0 n* K* f; P9 A7 G
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* G( k# _3 [0 ^
4C19:009A MOV SI,4647 ; 1st magic value.
$ p/ c5 C9 V. N2 }+ a9 F2 P4C19:009D MOV DI,4A4D ; 2nd magic value.3 f: b; [- E! L
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)% c+ \- S% t6 |$ q U- N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
/ O$ v2 l, }( ?: ~4C19:00A4 INC CX: A$ H! h! o5 w. _; c. x
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& k* @; @8 `, R1 ^7 @* a2 F
4C19:00A8 JB 0095 ; 6 different commands.) `+ E2 E) C' g; ?
4C19:00AA JMP 0002 ; Bad_Guy jmp back." N y: L+ E# E) H' U1 k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- R$ `) p6 Z9 s: B
7 c2 |9 K. A2 J" @3 M% T/ U& }9 a
The program will execute 6 different SIce commands located at ds:dx, which/ k+ B# [5 G( L2 v
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 Q* R6 n! v& s1 z0 o `! K$ U; f+ _3 ^( H% f. ~% L
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! R. L- q7 }1 S g/ u: [___________________________________________________________________________
9 [, O8 r7 Q8 v7 I; I4 a$ E, s; s \* o/ B, G3 |! X8 T
3 _4 g/ Y4 x# W% }: j! T; b
Method 03* s7 N1 Y8 M8 c' y u, B# h
=========
' b5 S1 v5 m$ P; t* U
4 t+ @5 k k: Y1 P( x- \. {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* E- m, F# i4 z+ F h% ?
(API Get entry point). y2 B# [4 o3 Y5 M; ^6 r" R" w9 V
5 f) U; x9 g* g' K- P
$ N* K& B# u. J+ p5 U: ^ xor di,di
4 o1 I- n2 X0 L2 u mov es,di
4 \/ L, v1 Z6 l+ [, g3 F mov ax, 1684h " E5 h' S' m2 _- l, P, j& A- }
mov bx, 0202h ; VxD ID of winice* q# u4 m/ [" J( C8 v$ q m k
int 2Fh. N5 L2 p+ d$ R+ d) L. f
mov ax, es ; ES:DI -> VxD API entry point8 ~: e- d+ J- W. V* A# n6 y
add ax, di+ U$ N/ v$ m; X8 Z0 @( f, a
test ax,ax6 u7 D8 h B$ Z" d- n8 g4 b4 l
jnz SoftICE_Detected* a' s3 c4 d. t& H
& P# I; J1 o- k# w( u/ E
___________________________________________________________________________
0 }7 Z. n. A d
# o2 x& x3 X8 w- [! [) BMethod 04
2 B/ I+ i I1 U# b2 ?. Q=========
2 H. B4 e) U& O3 x
8 l# ]3 \0 X8 S/ b, D& |Method identical to the preceding one except that it seeks the ID of SoftICE
6 R2 p3 ^( [4 J; L% ~GFX VxD./ p1 V ?/ j, R: `' P
* P* w) u e; |) x) t
xor di,di w. o# s: A9 g- l D8 o
mov es,di: X1 R. B& ?4 C+ H% w/ H
mov ax, 1684h
( X( V6 h- M( ~0 b3 y7 u6 M mov bx, 7a5Fh ; VxD ID of SIWVID/ v+ Z* ]; v& y0 M& R& @; x
int 2fh
- g# j8 P. G) m mov ax, es ; ES:DI -> VxD API entry point% @. h$ N2 v% V) t) G4 F
add ax, di
3 q. q% O: V+ B test ax,ax
Q; Y2 \# k4 i. H+ v jnz SoftICE_Detected8 g5 C$ |! \* @( J5 G$ G
5 q5 w0 c9 h: _5 E1 z, Z
__________________________________________________________________________+ ^. X5 U% i4 Y; N2 d; d9 y
5 h9 ?! ^! I' ? O& K+ L" S8 u" s. E- K. Q
Method 05
+ D- G6 J8 n u) p) a" A, _8 e! T2 G=========* @ w4 _0 K4 `0 u* M
9 ]* h. k" h: J1 T- J, ?Method seeking the 'magic number' 0F386h returned (in ax) by all system- S+ @9 e5 F, a
debugger. It calls the int 41h, function 4Fh.6 c4 a$ Y4 ` x+ u% M$ K
There are several alternatives.
1 ?$ f! A( F" p3 D+ q; L, E9 K/ u4 b3 j8 z U+ j
The following one is the simplest:/ }* l$ n% P/ V8 s
3 f) ^+ G3 _/ {7 W) J8 y
mov ax,4fh/ D; U/ }3 i l) R/ m3 ?
int 41h; m5 z$ @3 h9 g8 U2 }( {
cmp ax, 0F3866 M9 W4 K4 ^4 B9 L2 c
jz SoftICE_detected# [" F- _; @8 I1 F d& U
- ? @! { ?5 T) @& M. ^8 N; K
) Y1 l2 M$ m* @# b& B# n1 H1 jNext method as well as the following one are 2 examples from Stone's
- I* a- _; a9 w' S, c0 P"stn-wid.zip" (www.cracking.net):0 T$ d1 J2 c8 u3 A9 S
0 ?" Q% }0 [+ U. n- t0 p% c
mov bx, cs
7 i/ v& H: [' S8 J7 \ lea dx, int41handler28 X" i5 o; i0 t7 c4 o) ~6 u
xchg dx, es:[41h*4]
4 b2 ^. w( Y9 i3 q7 z( j xchg bx, es:[41h*4+2]
8 C+ D! Z2 X% j) g mov ax,4fh
7 G! z" W% X: A3 w, D7 [ int 41h# a4 u- w& N. V7 f7 I' P
xchg dx, es:[41h*4]
( x9 _8 n& R, q xchg bx, es:[41h*4+2]! H7 T$ n0 V$ f% _9 U
cmp ax, 0f386h
/ w) e. q( k; e' u& s jz SoftICE_detected+ N, U: d0 n6 \3 L/ j
: ^. ^/ I! x+ n9 b
int41handler2 PROC! g+ x; I! e6 N& e* k
iret
( c, x ~3 H7 i' T Mint41handler2 ENDP; h. g* U- i8 b2 u
8 h, q7 `9 {: k% |, A }
, L! r* V2 |+ ?3 ]4 w; o_________________________________________________________________________
) ?8 C' n) h# `1 ~3 l2 d r5 z0 f5 M+ m- U! ]6 r( R0 _) E; u
* s/ c% _' \$ }Method 06
# Q& l4 ]* T$ D$ _=========" k8 O* \" W0 d, F+ F& ~
- }7 Y h1 v6 {+ H$ S! g. j6 s, u- Y) S
2nd method similar to the preceding one but more difficult to detect:, N% T8 ]5 D4 e+ Y$ Q: w
5 d! ^3 i( {+ s, _6 P. `1 |* r- `) l9 u
int41handler PROC
' O- s' m, |9 _0 v* ~ mov cl,al
) ]4 p& j6 J4 d" q) U& n& J( Y iret! U* |/ X+ p2 i, `8 i% S6 }
int41handler ENDP, n9 Q5 r0 ^, y' Y/ t- h5 @
+ j& z# X+ g- [; G9 C) x. v1 q- m4 o( U: f
xor ax,ax" ^, m: d0 M1 j1 A1 u8 q/ g
mov es,ax- P# `3 ^# C* f f& D0 u& D! l
mov bx, cs6 E) ~6 o- N8 s0 Y
lea dx, int41handler4 o6 f9 a7 t+ f* W4 `
xchg dx, es:[41h*4]
9 `/ i) d5 K5 m5 B$ l xchg bx, es:[41h*4+2]9 }' L# H6 Y% j j' v4 o. x% d
in al, 40h
+ q; v2 `/ F0 w2 a xor cx,cx2 l' ]# n0 B+ n
int 41h
- l7 Q5 {- C! G# u" l( R xchg dx, es:[41h*4]
4 N* u. c% ~3 z: _3 y5 g xchg bx, es:[41h*4+2]
+ ^6 C5 a* ]$ T2 J0 A: Q% s cmp cl,al
- H+ m$ l/ X8 } jnz SoftICE_detected& r1 z7 @( \# k9 x. o& P
, g- W$ p& M/ U) j* V2 ^( h, R
_________________________________________________________________________9 n' d. G) L, N
1 n/ x4 [, O8 O: g9 G1 T T
Method 07/ f0 h4 C! w/ n- d
=========
% G. X! m4 Y5 i/ z
; k2 F: \; e* v y% DMethod of detection of the WinICE handler in the int68h (V86), {* X+ W8 U8 l# U6 X0 T
8 Z* C" Z$ ?$ e8 |3 S2 Y- n
mov ah,43h& g. H/ B c7 Z x
int 68h
1 U4 U! c, H# X0 Q9 z2 G* x cmp ax,0F386h
2 y6 N( A1 M' x) ]4 l2 h( _$ | jz SoftICE_Detected
. W' W3 A- y! J3 Y: ]8 A; ~/ |& P
" s" k- j- i% c/ J, [9 a
+ C/ {, w* X8 d1 D, e% X( `=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% }2 J; E6 J; H! R( m app like this:/ b% j* |% O% M
% B% b* h1 U! c BPX exec_int if ax==68
" u5 i/ _* j7 c0 c" ?8 e (function called is located at byte ptr [ebp+1Dh] and client eip is8 l* U% v5 t7 @, B9 ]
located at [ebp+48h] for 32Bit apps) Z6 b3 X) Y# q- C& A
__________________________________________________________________________! s+ F, Y' u- s4 u$ U m; j
, l8 U. _7 U' U& m* ~
1 Z& d/ F! X( h+ Z" T7 g3 I# n: W! uMethod 08" l2 P! u: W: e1 |
=========6 S) r! N: m+ J" T
3 _+ A9 B4 F2 i% Q2 U, n% U' \& d' t
It is not a method of detection of SoftICE but a possibility to crash the
! ?& ^. B3 A9 U, F) ?( |! X/ msystem by intercepting int 01h and int 03h and redirecting them to another( B$ O2 U/ q- p2 d% f
routine.& R: B8 Q& c/ W0 n7 c$ [$ s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# D& x4 Q- k8 K5 e* W* s7 Eto the new routine to execute (hangs computer...)
, g. ]6 M# I1 f: j+ r/ k p9 P. {0 n
mov ah, 25h
. j2 I' Z. b* z5 C, D mov al, Int_Number (01h or 03h): w! m' X1 @5 r) N: Q6 ] l
mov dx, offset New_Int_Routine
$ z2 x; R' i; L& s int 21h
]/ y* h) N3 R* {9 v% y- t: }4 Q v
__________________________________________________________________________+ j7 O' _ p$ ~( w& m
# }, e* q ? f% Y& V) s" F8 E3 LMethod 09& ]( W$ S C8 {' T: c
=========
5 n6 i& I- Z) F# N, i6 F8 q5 W- h) f% g3 Q5 }, v' K1 z* R( y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. C& `- j7 y6 b+ D: n
performed in ring0 (VxD or a ring3 app using the VxdCall).
' a0 p$ a/ W6 I# ^The Get_DDB service is used to determine whether or not a VxD is installed6 [, u0 p/ W" [6 B4 Y3 j. q& [
for the specified device and returns a Device Description Block (in ecx) for- w. m. W8 q) |& m& ^
that device if it is installed.
, v2 a/ Y$ R$ \! L0 T* b5 m6 g$ \/ L! {
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
; `7 ^/ ~. g- A$ I; G mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 \( z! s) A; m1 z
VMMCall Get_DDB( K3 W/ ~ |' u7 O
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 u) k& l6 j! X: U- C
! ?, w: P: N; [0 k* V2 I: Y7 ]Note as well that you can easily detect this method with SoftICE:3 M/ c2 A2 P0 J0 ~7 a9 n% f( e% r
bpx Get_DDB if ax==0202 || ax==7a5fh9 Z' M1 R# Y: x3 r$ l' U
& B8 Z! e8 |! N( j8 u! r__________________________________________________________________________
# H& B- o# t6 _$ _: t9 }2 v: U% j: j" C6 K* c# X" T$ Y! \# Z
Method 10& ~# C; n% @! _ O; a7 l. ]- ?3 G1 g9 X
=========: n$ F( N5 Z6 R0 z( k
) @9 z& w# s/ K7 {
=>Disable or clear breakpoints before using this feature. DO NOT trace with
! f \) C$ Y7 j/ w SoftICE while the option is enable!!
8 k U" i! i# f) o
+ Q! W: s# M# c" tThis trick is very efficient:
6 h2 C f! N6 ?; \: O9 u) d1 ~by checking the Debug Registers, you can detect if SoftICE is loaded
2 P r/ r, ?1 v. ?& L3 {(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
7 x8 I' A+ Z: w( q( O! k- A/ D4 V+ L; mthere are some memory breakpoints set (dr0 to dr3) simply by reading their
% q- W- H, t5 M. x) ^7 J4 O* Z; Avalue (in ring0 only). Values can be manipulated and or changed as well
- h% u1 y& f- ~/ i ^(clearing BPMs for instance), |# }& _- ~! t- `4 `% y. x
% Z9 X- Q* R7 W ?0 E4 r+ n8 d
__________________________________________________________________________ W/ P. V$ a) B: O
' M7 ]7 T* W# C T
Method 11
1 j7 F4 O+ S8 y/ i1 V=========
( k! y$ r: d$ t% w3 Q. O( H: X) a1 J
This method is most known as 'MeltICE' because it has been freely distributed: w( z3 ]. `1 _4 F# U7 s0 i
via www.winfiles.com. However it was first used by NuMega people to allow& O3 c3 t" B- u: }5 | {
Symbol Loader to check if SoftICE was active or not (the code is located
3 Y" f: Z+ e5 k/ X5 |inside nmtrans.dll).
9 Q+ M. q; q5 N, [3 u% E
1 \ c0 E. R! v) w2 i7 cThe way it works is very simple:
5 x- E% n5 O2 \" A9 g& y! p5 [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 I( X7 c5 L" n M+ [
WinNT) with the CreateFileA API.
% q* F. {' b. m4 l
9 A& ^4 S; U' O3 KHere is a sample (checking for 'SICE'):, y8 w F; W6 L2 B+ h
3 |" v5 J' l: t7 C8 I c
BOOL IsSoftIce95Loaded()( e: H5 Y, |6 n+ U3 L
{
7 x( e; t4 \8 p6 |3 R; G HANDLE hFile; : ?; e3 s2 I9 O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 X* Y4 B a }" c2 f. Y% g FILE_SHARE_READ | FILE_SHARE_WRITE,0 A8 v- P+ y* x
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ r- H# A5 J* c1 v8 `) E if( hFile != INVALID_HANDLE_VALUE )
- u" C' u ~: H! g \' ` {
* A: }% A3 N4 y7 N CloseHandle(hFile); A; L! j) p I
return TRUE;
- |9 ?# c2 `! b) H }
7 X. Y0 A! o8 I2 z. ? return FALSE;
* W4 h# ?9 G# } T& V}
3 n# P5 e8 L5 s/ {$ k+ o, N( A: T2 m
Although this trick calls the CreateFileA function, don't even expect to be
. E- W* J r+ K9 ]9 C6 @& [2 dable to intercept it by installing a IFS hook: it will not work, no way!
9 M/ T2 f' d$ GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F8 [# ?$ Q, f& n# y8 Z+ g
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( J: l% K4 c6 s, T0 v4 N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: C7 M9 K- I5 i! M/ K/ ]
field.6 w9 h% x5 v) G3 ]# Q" C% G
In fact, its purpose is not to load/unload VxDs but only to send a 2 s4 y% j8 q, L. _3 }& } B
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE) b% O6 F9 W7 F) U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, ]0 {$ l9 P- @ Hto load/unload a non-dynamically loadable driver such as SoftICE ;-).# L! ?( X/ V' [; |- x: E
If the VxD is loaded, it will always clear eax and the Carry flag to allow
7 t P1 _6 c1 a% d! {its handle to be opened and then, will be detected.8 H& Z! V. O$ e5 N; p& u( h
You can check that simply by hooking Winice.exe control proc entry point+ E; A1 D, \' F Z
while running MeltICE.8 ^2 L; c3 d( M4 T6 O+ t
" |- C8 F: b) T! Q% s* `' C5 w& y {2 I! h
00401067: push 00402025 ; \\.\SICE
& f1 ?3 c& S& a$ _5 A) { 0040106C: call CreateFileA' \+ X. X& k& |6 B
00401071: cmp eax,-001 s0 I8 f) m4 l. n: ^
00401074: je 00401091
5 T6 ]+ P6 F+ U2 [, ?/ i {( A1 I5 ~/ ^
, B" }4 S: N5 S9 i; gThere could be hundreds of BPX you could use to detect this trick.
4 W# M4 Q. Y$ s' F9 s* R3 b5 J-The most classical one is:2 o- T* _6 M+ R& L+ ^$ p
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 i0 A9 N& F7 t *(esp->4+4)=='NTIC'
" r% B1 s) ^( { b. t5 _3 c( g3 [' r" O
-The most exotic ones (could be very slooooow :-(7 I, N3 I5 H: r7 A
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ j2 J6 r0 S S: @ ;will break 3 times :-() O4 I4 T$ u! }6 _6 X
0 {! X4 Q% w1 S. ]5 a
-or (a bit) faster:
/ W' c8 i/ V3 J2 i BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 r Q6 `- m/ M4 Z: G
k, q* A1 F8 m$ W/ {$ s/ `- H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) S |9 G1 O& `9 ^- O$ @ ;will break 3 times :-(
% l( I1 K! S& W p* Z/ C! D. T: s0 K' o- p5 g- @8 i* n8 X
-Much faster:
1 P# C/ Z! ?3 C2 y N& a, Z, U BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', Y9 d( I4 @. `3 j+ n$ d+ S4 a& Y5 F
5 }4 H9 M! _, w* t; L6 ]Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 P5 L. N8 A0 m
function to do the same job:
1 J" X1 t1 f3 t. g; K5 D; L
+ ^8 E$ m2 n# k' c push 00 ; OF_READ
1 Q) b0 Z# {# Z, C mov eax,[00656634] ; '\\.\SICE',0+ J- N7 D# Y6 }
push eax+ x7 p4 x }( s) l
call KERNEL32!_lopen
1 `7 d' ?! Z2 C" X4 }# U5 |& e inc eax
# s T) V0 {2 C( c jnz 00650589 ; detected. y' r; y5 E9 C' K/ ~
push 00 ; OF_READ' H4 N# j$ A0 [) Y' r
mov eax,[00656638] ; '\\.\SICE'
' \. s. e! v% w8 D5 j+ L push eax
1 m: y! P2 K+ m2 F! z: q. K( } call KERNEL32!_lopen; j" d: k& K4 {6 ?# y5 g' w
inc eax# h# B2 a: }9 f: U$ Y9 e) M5 c
jz 006505ae ; not detected
, P1 T$ m" n" s' M
- c( P; j2 o2 J$ h2 Q9 d0 @; @' b+ d# q) {. X+ i
__________________________________________________________________________
6 h2 V k) h( W( P% H8 X$ F' ]. ~6 B4 ]6 X7 A
Method 12- m9 W: H" u: C1 Y
=========
: e( ]" d; \3 R9 M" G
- C! F+ I( ^4 Y8 |1 ~3 yThis trick is similar to int41h/4fh Debugger installation check (code 05
! M5 {9 h3 e; ^2 w& 06) but very limited because it's only available for Win95/98 (not NT)0 o% Z. a# O6 g* w
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 H1 x9 \5 f" N6 p, m: o, G6 O
7 U9 J9 Q' q$ w$ \* J o% Z3 J
push 0000004fh ; function 4fh
/ F. u( w+ F" {: w push 002a002ah ; high word specifies which VxD (VWIN32)# S1 d; L6 Z0 r; h# B/ d+ l
; low word specifies which service
* r& a$ g( N0 J (VWIN32_Int41Dispatch)7 @# _2 t ?4 }& s$ \5 `% S
call Kernel32!ORD_001 ; VxdCall
# w2 y) C0 l0 x5 T+ r cmp ax, 0f386h ; magic number returned by system debuggers1 t6 X" m# o5 B# H S
jz SoftICE_detected! u6 s0 D6 {# h
# n2 l+ V/ |: H b6 l6 x' j% ZHere again, several ways to detect it:$ L& e4 `+ |' S
7 | B+ K9 X. g BPINT 41 if ax==4f9 P' T! P# |/ L
% c |2 a1 C- G i' |5 x6 v BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 K) ], ^, p" _) T) s/ _
1 t1 C! z1 h; _. i0 f' f BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ G8 E/ n9 K2 i9 _. Z
7 U7 n q1 r6 t
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!4 \. Q* u& N6 T/ N$ m& O& A$ c
; Z3 I1 @- B- R. O+ g* X5 ?
__________________________________________________________________________' ^1 ]% H+ v) N+ S
/ A7 x8 n" A7 E( w2 {) PMethod 13# }) b f: y) f/ d0 R/ g9 @5 d, G
=========
5 l1 G9 b3 r( x5 g& I) ~- p
. U9 K* {9 D f" X, R& Q8 f( U0 xNot a real method of detection, but a good way to know if SoftICE is
% W" [; o9 p" D. q. Pinstalled on a computer and to locate its installation directory.
' k9 K# I4 P- `8 N nIt is used by few softs which access the following registry keys (usually #2) :
7 y! B# L3 V8 r- B M9 V( U
- R5 P; ~) {( S' S4 y1 _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 O* L& r( Z$ e2 w% ]
\Uninstall\SoftICE
, O# \( l9 |) S0 G+ ]4 w* p2 V$ f-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 i# n% A6 L% S# \0 h
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# K9 E2 [6 p4 H: Q; |# o\App Paths\Loader32.Exe. j& u6 ?5 @6 o) c
4 d, c' }! d* O! A2 \7 A1 ?+ k
Note that some nasty apps could then erase all files from SoftICE directory; ~. u% i& O7 ?% `' S4 f1 I
(I faced that once :-(
0 a4 v* {; K6 P0 i0 z
7 b: m7 g) v+ F+ @Useful breakpoint to detect it:
- O% G& H! e7 x& d5 m9 L% s1 \2 Z7 h0 k0 F# K
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
2 a& M% X; f0 v7 V L O* A1 k! r: N- C$ N; ]& K% a
__________________________________________________________________________
7 n6 q, i% |+ {& H0 R% a
* q4 [( e+ ] J
0 `" t8 p) E. ?; @' R; B1 Y5 l6 FMethod 14
8 V9 r6 @1 j2 Y* v=========# q& V" m$ N: m0 ?
% e8 X2 c0 ^& \% K( } XA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
9 o1 S. Z4 H6 f8 T3 X- Vis to determines whether a debugger is running on your system (ring0 only).$ T: O6 b* c7 W4 o3 c! J2 C
, r1 L- z. z! r VMMCall Test_Debug_Installed+ e( T8 Y5 S4 d2 Z. C
je not_installed
4 Z6 ]; v4 r9 ]5 S# Y* N2 \9 a5 M5 z; W u
This service just checks a flag.
* h, i* E# }4 A- c" _</PRE></TD></TR></TBODY></TABLE> |