<TABLE width=500>9 _3 v. V7 t k' M0 ?
<TBODY>
# y3 ^# a- `( W2 r( ]<TR>8 n" X9 ?! G! |6 b$ S
<TD><PRE>Method 01 ( i! \ R' n0 E! p, D6 t* y
=========1 J' s3 T1 V9 M- g/ H
' p+ |& N; e" m) C* r/ B1 k
This method of detection of SoftICE (as well as the following one) is
, p& O2 K9 l V b l' lused by the majority of packers/encryptors found on Internet.( r2 c9 s9 P6 E# c& o. e( P
It seeks the signature of BoundsChecker in SoftICE
' w1 d" m" ^) C7 v( O+ S8 R, x. `6 d- n! [3 B* w5 m0 g
mov ebp, 04243484Bh ; 'BCHK'
7 {5 N7 j: H% p. b% a mov ax, 04h/ j9 d4 n* F5 t) Z" M+ I. r
int 3 " t& V- D% m; w* l
cmp al,4
3 l1 e6 u/ G; g a4 U jnz SoftICE_Detected
, L( Z6 ?5 h4 F9 h. n
, u/ L9 ~& ~8 ^ ^- @___________________________________________________________________________
1 H0 r" ^" T. h8 V. _" ^& [+ o. }/ g' _6 q) W; T8 b
Method 02/ g! ]. d3 `; A- r
=========
) s W1 K% }/ x0 a$ |- c3 K) ~, q; S' _( ~* Z2 M$ L5 v* `9 Y
Still a method very much used (perhaps the most frequent one). It is used$ p' v4 K! C% v* \! V( Y0 U
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 g% ?; f& T8 [5 `# R
or execute SoftICE commands...0 F; c3 f5 L; v
It is also used to crash SoftICE and to force it to execute any commands# t. z% _, V5 Y( l" C* ?# m& B
(HBOOT...) :-(( - Y7 g# r4 |6 r6 F. I) L; y" d
: ~$ n; N; {4 u/ }! j
Here is a quick description:
$ B, {! O: b* ]-AX = 0910h (Display string in SIce windows)9 _* T1 @( ?, Q! S' j) E, K1 w7 |4 \
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( Y) y) L" R+ s+ y7 y
-AX = 0912h (Get breakpoint infos)
- A! v! k2 P7 A/ w% B* E- T& \-AX = 0913h (Set Sice breakpoints)
* N1 |1 T5 S, T/ J-AX = 0914h (Remove SIce breakoints)/ p ^6 U( {5 g9 W% m
4 A1 \1 N; Y. W3 a$ aEach time you'll meet this trick, you'll see:
8 z- w( a/ o* j# B# H' E$ C-SI = 4647h# n+ r- j' [* u5 H$ j
-DI = 4A4Dh
" r! C3 Y( d( }. MWhich are the 'magic values' used by SoftIce.
% y. \, i6 W7 Z% I- V0 D+ |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ A/ i1 n7 e1 I8 |* r; `
" g$ z# p6 c; c7 o; |
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 |1 L7 c" y6 x3 B: @- t
Envelope utility use to protect DOS applications:% u# u% E( ]. u' `( \+ n+ H
% S& M7 P5 q3 o/ T* A+ _4 x: B/ j6 X: C9 q. Y
4C19:0095 MOV AX,0911 ; execute command.
& T" t3 G1 \4 M/ _4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 b) j% {/ B' Z1 [: a1 o- Y4C19:009A MOV SI,4647 ; 1st magic value.3 b# x0 P( b8 \( k4 U' |; j) g" _( {
4C19:009D MOV DI,4A4D ; 2nd magic value.
* m: M, w: _- @$ w' B) H- q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' c% [- L R5 N7 x- E' B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
9 b8 [$ } R; l# ~$ t4C19:00A4 INC CX4 E# ?7 {8 q$ v" |, N& a
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute2 H7 |7 j1 E+ X; D0 x0 D
4C19:00A8 JB 0095 ; 6 different commands.
. F! A+ l& v( u; K: M5 ^1 Y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% m$ ^# b/ k7 v+ e; N( c4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ K0 N- q+ e- F6 _; u) e D4 R, ?* V) [. B8 v J- c- |
The program will execute 6 different SIce commands located at ds:dx, which
, U) _- @3 V' r8 S( dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# d7 ]. u7 {5 Z- c
u/ A( O6 ~% P
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. l- }: s( m" Y- b" Q
___________________________________________________________________________5 X& E+ B2 B+ n( ~ g7 V P0 q
3 `% ]. V" L: L, z( N
* |. J; {; q1 s+ q4 D
Method 032 s6 x* J2 p3 V6 R4 V7 ?
=========
' g4 A& g3 b; L, K Z, Z+ O, U0 \+ z/ t5 f% c+ {1 q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 c( T. h; x- ^7 m3 I+ u' t(API Get entry point)' q6 @4 `& x3 J- F" `/ G; J; H
# w) t* F7 z1 o+ q
Y, I* H" [7 K+ r xor di,di
: V4 x1 _. n8 ]4 b mov es,di
5 X4 j9 @( r3 U. {$ X2 u mov ax, 1684h
7 @7 U7 n- @# M3 ]* r4 [) R mov bx, 0202h ; VxD ID of winice
! z% \. C6 i- F int 2Fh
) w. G1 r3 e* T mov ax, es ; ES:DI -> VxD API entry point8 X2 Q8 m6 \+ s3 g' y2 y
add ax, di
) V) k+ {6 S5 e9 G5 w+ D9 N test ax,ax Z9 ~; a; ]+ t+ H0 W
jnz SoftICE_Detected. A2 [) x9 k, w! ]7 @
) s3 m% k7 D1 Q$ Z
___________________________________________________________________________4 Y. g3 k* m; _
# V& V9 w* {4 b5 c& z3 fMethod 04& ~7 ? x7 l6 M" g
=========* c! P$ V; V S
+ ^4 b7 F' h, K7 K6 [' X# lMethod identical to the preceding one except that it seeks the ID of SoftICE
1 `) b# x) M) t) G, y7 N$ V. JGFX VxD.7 P2 Q1 o- q1 U& v! g
/ G, E/ C4 ?/ ^; r/ D! o
xor di,di
/ d7 r; k0 P( o* |/ Z& }& o8 J mov es,di
5 k- U1 B0 i0 ]0 o: q. B/ ~ mov ax, 1684h / N0 S0 \- n2 \* F
mov bx, 7a5Fh ; VxD ID of SIWVID6 o) [$ a( c* a& X2 Z: r' `! z2 I
int 2fh+ O! r; S% |+ Z
mov ax, es ; ES:DI -> VxD API entry point
' g- c/ {! Y( e+ M add ax, di& u3 A$ [# Q. b/ S, z% E
test ax,ax
6 j7 z& `3 G& ^, e, A: }7 f3 M jnz SoftICE_Detected
4 C( A) L1 X# ^. k& x
, O/ x1 [2 X5 n& {9 Z; `* `__________________________________________________________________________! S5 D+ s8 H5 A
# B& ^/ O2 V$ f! o, C/ e- W. o7 E7 H
Method 056 c7 M. f- `# r# G) \" V5 N
=========0 Z( c8 `9 N8 E3 _, g# f |
' c! B. @. f* f: P9 aMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ u3 {# A: k& |0 T, n
debugger. It calls the int 41h, function 4Fh.9 S* s. L% q. K
There are several alternatives. + S. g! y0 Y! E3 {4 m& E
, U Z, Z# W+ j" @+ RThe following one is the simplest:
/ E6 j( |. ~7 x e
$ |+ Y9 K4 u2 A/ T3 ]2 j7 L4 s mov ax,4fh' k- z1 \- g) [7 c/ N' S% z r
int 41h" ]1 M( W7 n E" n
cmp ax, 0F3864 H1 l: `% Z2 o7 u6 Z3 l: ?' _
jz SoftICE_detected
* r; ?$ a2 C0 S) I( S' u4 X- @+ ]3 K7 c- ~* Y- E1 C' t& O* z7 B
6 O, v, C/ [: k& rNext method as well as the following one are 2 examples from Stone's
0 z: z3 o1 k& L! L2 D6 Q# S* i( v"stn-wid.zip" (www.cracking.net):
% z5 Y+ g# g. c6 d( K
/ R1 ~: R: E. B mov bx, cs
; v, m# j$ f: o/ [ lea dx, int41handler20 L& }2 g& ^: M5 e0 b& i2 g
xchg dx, es:[41h*4]# L, F: L2 ~, {+ S) P( Y: D
xchg bx, es:[41h*4+2]
9 m: d( ~6 S/ h mov ax,4fh, g) o& `0 g& @8 S5 v
int 41h* E2 ~# S. Q3 L: F( ]# e: C
xchg dx, es:[41h*4]
: N8 Q/ m4 `/ M ~# O xchg bx, es:[41h*4+2]$ ^3 B. D" v3 h; O
cmp ax, 0f386h- ^( Y9 k/ f5 Q9 f( Q
jz SoftICE_detected, J( U8 }# @% p F. E- R7 w
7 G# B3 G D, `3 x
int41handler2 PROC( L" Y- o1 z: D' |
iret
$ |2 z* M' o5 n# N. W' e3 @int41handler2 ENDP
+ j8 M$ i. a: |: P6 t' `) F
; Q- b3 ?$ p/ E$ T- i+ }2 n/ P& o/ q9 B: D5 e
_________________________________________________________________________5 [& H* B. X+ \' }2 t
. S4 f5 d% d( d
) @5 v& |$ F7 V- h1 aMethod 06
3 t: I0 w5 _2 {3 a$ K7 \1 E h8 J8 C=========
4 W1 r2 M+ d8 f- o! D1 O: m* F" g" F; p! l5 Y8 [
. H3 K1 ~2 Y; k
2nd method similar to the preceding one but more difficult to detect:
% k0 r+ H: V1 O$ b; \0 _7 G+ J, u: l) b9 d# T8 Q* Y
1 P( I( n; F" m; h2 @' [
int41handler PROC" S4 |# I0 l- w* L) A, b+ `: C
mov cl,al
6 v. h' R$ m% B& ^ iret
5 h: T5 U1 Y& Q& f/ X$ Dint41handler ENDP
( G' J/ k* M5 U
* [% u4 m! ?1 m, U* r
6 R+ r9 ^& Z, q) v* a' K( k xor ax,ax
' Z$ U; P0 N1 t5 g p mov es,ax$ E) {* H1 m$ J% R' s
mov bx, cs t& A, z' d& l) \" z% u$ q% i" O4 J
lea dx, int41handler% G2 ^9 ]0 E7 v$ R) C
xchg dx, es:[41h*4], \0 b2 C6 z8 X J4 L# ^
xchg bx, es:[41h*4+2]
* a+ s7 H2 Z5 d' ^8 i+ g7 I in al, 40h$ O. z) Z; r/ E! j* L6 Y
xor cx,cx# Q: `6 Y: ~' Z6 v' a# n
int 41h' U, J% s+ i! g. C- C1 [
xchg dx, es:[41h*4]/ x1 n) k, N7 ~5 r0 w
xchg bx, es:[41h*4+2]( h3 P' {! z+ Y J T; C+ g" ^$ P
cmp cl,al @4 Z; O& }" Z' N
jnz SoftICE_detected
3 [% c8 C, b3 H7 e3 m- m
. W/ H# M7 _" c, c- z8 d' a) ]_________________________________________________________________________+ c3 W* K- |1 _9 k% \) g# A1 {6 {6 L
+ ]" O/ I* u8 B: E9 N1 p4 MMethod 07
- d& Q5 P7 ~% l1 ]! O; ^. [% W=========
' u5 A! l% k, |& f& b7 o. r5 z" P; s% a
Method of detection of the WinICE handler in the int68h (V86)
9 M# `7 K+ C3 w7 F" `# r/ q" K" Q/ K! H! c4 L
mov ah,43h
6 D7 e: G5 P U int 68h
( B' J" p2 c* ?( }. k9 a cmp ax,0F386h
/ m1 \; l2 O! U0 @( S jz SoftICE_Detected4 m- G2 m0 E G; c, l
3 w% p k7 m/ {0 l1 l2 k
, v) p: @* Z1 T1 S=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: _4 ^' e6 A3 u+ Z$ p app like this:* Q7 \) h3 S4 x. V7 l
% J0 q5 e; y% ^% Y. Q8 W BPX exec_int if ax==68: v( F7 g: O% {" g! o0 r* }
(function called is located at byte ptr [ebp+1Dh] and client eip is
" s* Z3 {' k. `- V1 B& i# {# ` located at [ebp+48h] for 32Bit apps)* t- v# v) w" K# l0 x5 F0 J
__________________________________________________________________________
+ l! j/ i; P( ?9 P9 s, V# g/ i" n% ]: g" z1 O
; ?4 n3 }( g1 L. s1 a: w' V7 E* s
Method 08
9 m# U+ O' g5 |# i, G% u=========
x; {' g, g1 y1 |& [ L5 C7 N) {; X
It is not a method of detection of SoftICE but a possibility to crash the
+ O2 M+ m; L" ~8 v9 {9 t4 Bsystem by intercepting int 01h and int 03h and redirecting them to another
3 x. t& N# r Zroutine.
% P! O8 w( M& g2 n* ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points z, X6 {$ ~8 L1 L
to the new routine to execute (hangs computer...)
0 K" V0 n% m3 }
- n1 @$ E* K9 ]! x* I7 o, P1 R6 W+ X mov ah, 25h/ {7 z0 { I2 x
mov al, Int_Number (01h or 03h)7 X9 T! T. l r$ i7 |! J
mov dx, offset New_Int_Routine
+ a8 G; Y& `, L; N5 m) b L int 21h
4 u; T- N$ t% X u4 v& J r x# B/ n% v' b
__________________________________________________________________________
3 n# Q+ @7 G6 I- |, q) l7 U( h
- X a. U) C8 c& W" ^( RMethod 09
6 T0 S/ Z# k* w. @% \, E=========
6 N6 S# I3 o5 C/ z% [7 F# a8 d
( y: b* M* D* j1 a0 `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* H1 s. D) Z' y! k
performed in ring0 (VxD or a ring3 app using the VxdCall).* Z7 e% ]% `8 i
The Get_DDB service is used to determine whether or not a VxD is installed
* u" m( `* x2 H3 I8 Ifor the specified device and returns a Device Description Block (in ecx) for. r+ {. H5 S1 S; e$ L( j
that device if it is installed./ D- r, b7 E$ [ L& R6 v1 Z
/ }" L9 r+ m' @ [1 C5 D! ~
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 q* u' R: X" m' L1 g% ]3 v* ` mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& s; t& O; e# X" y
VMMCall Get_DDB$ c' X/ V' r! F% b' Q
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. A) Z4 k6 O4 I Z9 D v4 h, p* s+ U- q
Note as well that you can easily detect this method with SoftICE:* u5 v& H1 k2 w; I# q$ f8 K, l: [
bpx Get_DDB if ax==0202 || ax==7a5fh
' d* O) R: |7 b" ^ F, I& |; t
. h" I" v9 t* o2 y0 q7 T__________________________________________________________________________6 I$ {: [. S8 @. j: k
) j, R6 X- }' FMethod 107 M( p. h' g, T8 h) Q
========= @+ K6 a0 A. Y Q7 ]
. w6 X- v" i. V/ p. s" _=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 v0 ?0 A( K: C$ O" } SoftICE while the option is enable!!: E, N$ A7 @ [6 g9 ]: o
" L9 Y( P9 I7 a6 LThis trick is very efficient:
b2 t( u/ {% `by checking the Debug Registers, you can detect if SoftICE is loaded
( A& ?: o S4 i. n(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& a4 @, ~( i+ C: C$ @+ l# {4 I3 Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their' d& q! Z# h% v$ f
value (in ring0 only). Values can be manipulated and or changed as well1 l1 y5 T& m9 i3 o' |: t
(clearing BPMs for instance)% X0 Y6 d1 K; C' N4 f P# J& c) M
0 S+ {9 T: p+ G' B2 I/ k__________________________________________________________________________' t; _/ c3 \6 \* }( v* @
) P- A- T, D1 C: ?
Method 112 @1 w* R5 x: X, ~
=========
( A0 U$ q* l/ _1 b9 E9 n4 |% V2 N! E' t* z* u3 ^
This method is most known as 'MeltICE' because it has been freely distributed% {8 B" m5 ~- B& y5 B
via www.winfiles.com. However it was first used by NuMega people to allow
8 Y6 I% X' m1 @% S3 ~& C% SSymbol Loader to check if SoftICE was active or not (the code is located
! E7 o$ v! B! A4 M. Hinside nmtrans.dll)., m1 _; D. x/ n# |1 M& v( V
0 h$ D H1 V- C" a- h/ P! e
The way it works is very simple:* @9 p8 ^1 k c8 y f% e
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( S9 {& z" ]. L$ e* G
WinNT) with the CreateFileA API.
/ `3 e1 l( ^) H* I j
$ S# z9 q9 N7 _7 r! \& p3 `/ ~0 A3 ^Here is a sample (checking for 'SICE'):. h3 X6 s: N. a. [& E7 z% C( `+ ^
9 @. T$ I I1 X/ K: uBOOL IsSoftIce95Loaded()
/ j" _4 n. `+ @{* J$ g' B. z3 ^5 Y5 g: N
HANDLE hFile;
3 B* M$ \! ~ b7 \5 }: ]- | hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,' e9 h1 t, m7 }- L# Z3 B( U7 ~
FILE_SHARE_READ | FILE_SHARE_WRITE,% L! @( w2 @% L, W
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, X: p4 a1 T, Y9 T6 ~
if( hFile != INVALID_HANDLE_VALUE )! f5 H4 J( c, v; O
{* p* j5 \# D! t0 Q
CloseHandle(hFile);. m8 R# g: f0 x( B: z/ o
return TRUE;( E2 d1 b. Y2 D0 [7 O
}
, A( Z3 Q/ \4 U. q) J4 q return FALSE;
) I+ Q1 w& [- R! F% E2 g$ a}
! L4 ~ G( \: X' a- }( F. L
9 s6 U* j( v/ s2 n8 h/ P: XAlthough this trick calls the CreateFileA function, don't even expect to be+ N |7 p% G" W0 [
able to intercept it by installing a IFS hook: it will not work, no way!
4 ~# \3 D! [! ~. A/ J% HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
{8 I, T' }& Z$ ^service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 e- w4 E& t; ?5 o; U! M5 G7 V( t
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ W; e) y: N( h
field.
4 I# _* M u) ^8 ?In fact, its purpose is not to load/unload VxDs but only to send a
% l5 }/ R) I1 _6 t! P8 [# |$ {W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# r; A& Y& K* _0 a6 ~4 t" N4 T3 M
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* h( C- t' p7 r& u3 O8 [% j2 ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).4 a5 Z* ], y3 v6 o& q( T/ y9 x: f
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 E" q4 p0 d1 j( [2 J' m
its handle to be opened and then, will be detected.4 T. w- l/ c& D# P6 i$ \4 U
You can check that simply by hooking Winice.exe control proc entry point i# b1 Y* X3 T; L. O8 J
while running MeltICE., L, P/ Q1 A; O4 }4 G0 `
7 A: O" o6 h% }- B. l) v; p$ b8 s
: M3 m# u: X$ f5 b5 V, q: z. e 00401067: push 00402025 ; \\.\SICE
- n0 w& M. g6 R+ U% Z+ E* Z 0040106C: call CreateFileA" |8 \$ F2 G. N% o
00401071: cmp eax,-001
; e. ~9 M, e' Q6 H2 x5 S; } 00401074: je 00401091. T4 d! `2 N! l* }/ t
5 S" s' G" O% D, ^2 D; s6 B# W& s p
There could be hundreds of BPX you could use to detect this trick.
Z( O8 `# x Q, _, v, F3 ^: ~ F-The most classical one is:
/ s+ h5 S/ m/ y( A( y$ |# }2 _# m BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* } ` ^8 l' W: N" C. d3 c" c. r *(esp->4+4)=='NTIC'
+ z. v0 ^, X7 d0 Q3 q. g' s* v$ P1 G1 `0 V; N+ A6 r
-The most exotic ones (could be very slooooow :-(( T! A Z! \2 M& p8 U, B1 ^
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
9 a; \8 a( ^8 X1 b# M4 s* Y ;will break 3 times :-(
& b% J% ~+ ]3 \% S. \9 f5 ]
( q1 }) n$ y4 S3 f-or (a bit) faster: % G3 j( X: ~1 }- e0 y$ x6 W
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% {" U+ O/ a: q' K# V5 p/ g6 h
4 O/ U8 k9 o, d5 ]6 z6 a$ U BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 e$ i5 i* w% d3 P# _ p ;will break 3 times :-(- ~) i4 ~' \, E# V6 K& S/ }; g
$ B; D7 y- a( c-Much faster:
. y1 z0 O J6 _( G8 o C BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 g+ B! O6 r9 k$ f
/ p y: w1 ~, k* ]4 j
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 r2 r: x7 w9 @$ X/ qfunction to do the same job:
* S: N) E5 ?' `7 T. X. @0 _0 n- z& }7 c0 Q- J, s
push 00 ; OF_READ
( C4 J8 t! Q. T0 q( @5 | mov eax,[00656634] ; '\\.\SICE',0
5 e* N# l- n8 {: e H% E push eax
' Y1 |+ E. @' t5 }& G# b call KERNEL32!_lopen
, Z' H! g9 X. U, p+ w inc eax6 j4 E: b3 j% f! Z* J) @8 q
jnz 00650589 ; detected
, [3 `" q# |) v push 00 ; OF_READ4 O1 Z( Q6 a: D+ v: z2 n7 l, E
mov eax,[00656638] ; '\\.\SICE'5 X9 e& _+ W6 F
push eax
. B- L7 t3 I! o4 y call KERNEL32!_lopen0 [, p3 J- \# \0 @: u- {, b0 C# v
inc eax
C8 \6 `6 _0 [ ?$ M0 O jz 006505ae ; not detected/ P; v. |; S6 C4 I3 q/ R
) f! e, x' ?% g. Q% b* J; A
5 ~' k# o# b" I& x6 Z% k' b4 }
__________________________________________________________________________3 i" ?. i; `% d; O; e! H
; R/ e$ r0 q! M: M1 R! |; U
Method 122 V- x2 C* y) o/ g P
=========. g w. o( g( V$ |- D
" k4 ~# r0 U" {. y3 }0 Q- @
This trick is similar to int41h/4fh Debugger installation check (code 05
# V8 ^' L, }, L: J! x5 \3 J- e6 {& 06) but very limited because it's only available for Win95/98 (not NT)( f8 K- z: C; E# h* t
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. L& B$ {( }$ ^: p; x
- C* A2 G6 }8 E" h- i
push 0000004fh ; function 4fh. R: Y( \5 ?8 }! \* v: m; W
push 002a002ah ; high word specifies which VxD (VWIN32)
; b0 p1 B6 ?2 n0 A ; low word specifies which service
" k9 {- C: |% a (VWIN32_Int41Dispatch)1 E! {% c% p n2 p2 _; c
call Kernel32!ORD_001 ; VxdCall- b! }' E3 y3 S' a
cmp ax, 0f386h ; magic number returned by system debuggers
% J' u- W* C4 u" w. a% E2 e jz SoftICE_detected6 O8 f: D$ Y- K. ~* l ?) f
2 ? N4 N0 U ]- R0 C2 LHere again, several ways to detect it:
8 E& w5 d5 u9 f- {4 u( O3 N6 c" M D( q6 h3 V# A$ Y
BPINT 41 if ax==4f# s+ U; ]2 x2 W; `
! a+ W% b/ u" f4 D+ a
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ V" a/ c5 E# D; q& q# Z$ K: k& c U& c/ p3 @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 b3 z9 |+ Q% S* S" U1 ^* P9 u2 L. |5 E" z+ _* n& D
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 r! t7 @0 A) ~
: c8 F" @' h9 H, ?/ B+ ]3 z% p8 E__________________________________________________________________________
. {, V+ v7 e( g+ X: u# Q+ F$ m8 F! z! h/ K0 ?1 Q( F: @
Method 13
3 }4 H7 A% z' Q% `2 w=========
1 w1 ?. \' F1 b% w1 F! T1 y, `
8 e: W' o' |! V5 l/ B# eNot a real method of detection, but a good way to know if SoftICE is
, j' s6 X) F6 K# S9 ]2 yinstalled on a computer and to locate its installation directory.8 M+ n$ g, j9 _% |/ M
It is used by few softs which access the following registry keys (usually #2) :/ S( n4 p" b9 ^2 r
& A- C0 p* i% b
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 K- h# f/ @; h& H. Z+ W; |0 }
\Uninstall\SoftICE
8 ]2 T! a/ [% M-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# o6 B5 G4 }! i6 D& Q$ R9 T7 A( V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( _0 n o3 P: u! Z\App Paths\Loader32.Exe5 N5 s7 n% d; H
; Q7 Z7 D/ W9 }% A8 k
! V, y: c5 g# ?
Note that some nasty apps could then erase all files from SoftICE directory! |* A$ J" |6 D
(I faced that once :-(
) o$ r! J+ {! c" W( ~- d( `5 r
3 P% ?+ H2 z1 R6 t9 }0 sUseful breakpoint to detect it:
2 H/ R0 ~, t# v3 Y' s. p% O3 t1 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& Y. l" e% I5 Y' y: l, q$ Q
0 Y! s6 h9 _; d- Y) h9 `) d__________________________________________________________________________/ J' a6 {3 {* N. U
7 @. J$ p. q/ z- t# y+ E2 P" [$ v" M; v" H5 W( F" i9 {) p
Method 14 - \" ?" z$ A# u2 E# T
=========
w( F* B5 L; U% Z5 w8 D
3 b/ Z3 M: G2 Q3 H: BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 d* }5 J. ^. f( ]" w
is to determines whether a debugger is running on your system (ring0 only).
) o& S; z! H7 Y, h# A; B0 e: B6 n0 m2 l& P8 u& C# y
VMMCall Test_Debug_Installed+ s0 d( v( A1 ~2 n" a0 g# X
je not_installed
- w2 Y e. d- f3 q; d0 a& H% \4 o8 O1 _4 W7 F/ R
This service just checks a flag.
3 ~( }% v7 l* y8 O</PRE></TD></TR></TBODY></TABLE> |