<TABLE width=500>
' c/ w ^# L: L3 @<TBODY>0 S" U b8 r8 ^# B8 O1 U! w4 X
<TR>
6 u/ \/ t+ t4 H9 g) h<TD><PRE>Method 01
/ `) ~/ B; @9 f=========) _# F) _9 ~2 @/ q+ e( v0 b& ^5 I
+ A0 \, B. B/ r
This method of detection of SoftICE (as well as the following one) is* M3 z( z; ]$ ?) q _
used by the majority of packers/encryptors found on Internet.
8 @* i2 f S' B+ Z0 F* ]" JIt seeks the signature of BoundsChecker in SoftICE
0 T1 Z* S4 u' f! S6 T1 f7 l8 i3 a- Z. r3 M
mov ebp, 04243484Bh ; 'BCHK'
- n6 k( B; |9 ^8 q8 E [( y) N mov ax, 04h `1 p; x Y) O
int 3
; C5 |7 L! q0 ]* M+ \1 H5 z cmp al,4, ~% l. L* L; N
jnz SoftICE_Detected6 P. b, \ W* T( V) N7 r
0 R. {8 ? b# ^4 @2 }# O
___________________________________________________________________________! ?2 |- d' p6 @. d6 s
# x3 w& p7 V1 m1 @5 q% Q# LMethod 02( o$ ]! x( }9 F
=========$ p! `3 N( [5 S% k
4 Q E- p3 p8 G( N" n m# \# JStill a method very much used (perhaps the most frequent one). It is used% A: X7 C9 x# B2 y+ J% R& R
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 [# _9 i, p8 p# {% y7 H& Lor execute SoftICE commands...
4 g* S: R9 F& K8 Z2 T7 P5 \It is also used to crash SoftICE and to force it to execute any commands; j( l/ c3 ?, C, }) y9 c
(HBOOT...) :-((
4 V w) u8 a* X- a# h2 ?
/ S7 ?4 w; a, y' Q/ mHere is a quick description:
, B* p/ M7 g# h6 [-AX = 0910h (Display string in SIce windows)
4 K, c% k; h; p/ F7 L V$ K1 O-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 i+ {1 c8 r7 q, _4 i" @0 P1 k
-AX = 0912h (Get breakpoint infos)
M* K8 ]8 K" t8 e* e5 }% A-AX = 0913h (Set Sice breakpoints)
* x" W. g/ ~$ k, P( X, j9 ]-AX = 0914h (Remove SIce breakoints) t" |" M: r, M& z( A9 W* F* ]7 c
2 f0 _: j B0 h9 j1 V% m, O$ x
Each time you'll meet this trick, you'll see:
+ \, z1 V0 e7 v. t) K, Y: j* h-SI = 4647h
$ h( v2 v1 w+ @# v% x-DI = 4A4Dh
4 b4 D, V& R- x! e, @( w$ z* TWhich are the 'magic values' used by SoftIce.
1 L. D: w' d/ }8 s$ l' UFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* T1 d4 P& I" V+ W; V2 `$ i+ K- [0 @0 `6 y$ ^5 x& R$ I
Here is one example from the file "Haspinst.exe" which is the dongle HASP) _. f, }" e5 W, C/ x
Envelope utility use to protect DOS applications:7 b% P' u1 ~- c
& m8 k3 u+ o: O$ t
# W7 P' u* E% ]' J9 t8 k
4C19:0095 MOV AX,0911 ; execute command.: G1 x, d$ W* i8 r( ~0 }
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 t& ^& b3 s- O" s/ C1 a% a4C19:009A MOV SI,4647 ; 1st magic value.1 i. t8 { ^+ O# t# h
4C19:009D MOV DI,4A4D ; 2nd magic value.
) M* Q1 @- F! i) K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: R0 |0 [ x+ T4 {/ K* W$ `0 E; f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 d6 c# H- F1 }1 @1 U8 j# n( }
4C19:00A4 INC CX
$ W( X3 R: z0 s: s- p1 A% R4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
/ f% r8 O- r1 s; ?5 E6 ^5 i4C19:00A8 JB 0095 ; 6 different commands.& C2 h& n9 P$ [! |5 l
4C19:00AA JMP 0002 ; Bad_Guy jmp back.4 C. p# ^: x% M: \! u
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)$ P: W" U: F1 g i! a* ^$ Z+ T* k
- a( M0 D4 q# k9 w" A1 C
The program will execute 6 different SIce commands located at ds:dx, which$ }: U* o0 N8 n- r* y+ ~+ W; M- A# j
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 Q& O8 o0 r2 Z q: S6 b2 J' ^! U7 L' q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
h# {; X1 Z2 u! D- i___________________________________________________________________________
# p6 g* |4 b& ~/ U# b0 J) ^8 U; `6 q; t2 a6 z. Q* f% M5 `+ W |, W
4 x5 x/ M2 ~2 d' t f' U& c" gMethod 03
5 a' a% B* e" h; K* b1 d0 ?=========2 x4 t+ N! x% ^- W5 ~
& i8 ^: ?3 A5 w+ c6 t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 f/ A+ w/ u( F1 o0 I
(API Get entry point)' _) R1 m7 T# _0 H1 e0 f
% V( B& W* |4 ]* I) a+ r3 {! \6 H* O% K* d: t) O! c( U
xor di,di/ H+ ]! V/ _+ n2 V4 i
mov es,di. A$ a% X% Z: e! } ]* y
mov ax, 1684h 3 P- @5 x6 z4 b9 y" [" _
mov bx, 0202h ; VxD ID of winice4 _. U; M9 }; w" e3 X
int 2Fh. `. }5 W& h T
mov ax, es ; ES:DI -> VxD API entry point3 Y1 z. X/ D0 V S+ v- o
add ax, di
, l4 N0 D% O+ E( o test ax,ax$ F. }. W W$ F7 Z# ^
jnz SoftICE_Detected
) S8 C! [; i1 V' t6 l; R) x( B2 M# N4 H$ z" o% o4 x
___________________________________________________________________________& Z' q: s# l- K* U- {
/ w( }2 I J6 OMethod 04
$ Q: U1 H0 ~2 y8 a) T9 s V3 h=========
4 L. u) Y) z7 X0 S, {: q" {" o+ i
1 P" d2 b9 K5 x1 l8 _0 K0 uMethod identical to the preceding one except that it seeks the ID of SoftICE
+ z" ^- I3 a- tGFX VxD.
2 l: F6 c5 U7 T
1 i( ~9 Y0 q' i3 Z xor di,di
d9 V* S, l4 q mov es,di% }7 M7 |3 O1 K5 w4 r
mov ax, 1684h ) _7 f3 A7 N" U" M
mov bx, 7a5Fh ; VxD ID of SIWVID
! p* F6 c$ h" [/ A% Z, z int 2fh
$ S% L2 j0 d6 K% M- b# `& O mov ax, es ; ES:DI -> VxD API entry point1 j w, p: L4 G2 s+ t. z7 L
add ax, di) w) J$ `2 N. Z' h
test ax,ax% t' X: i4 Z5 B' g- K8 `6 p
jnz SoftICE_Detected+ C, A" V( K8 E! s6 o
2 V: |# L/ o% f/ J( D
__________________________________________________________________________8 W2 n6 [- F' b, Y9 Q+ O
8 k5 q3 z# ]- {3 z0 G
7 r# b8 q7 N% l" q4 f: |Method 059 N3 Y) H. L+ x$ }& B; s
========= ?' l7 A, ?2 a/ W/ d d
: J) x/ ? j2 k' s' gMethod seeking the 'magic number' 0F386h returned (in ax) by all system1 D0 v! h/ t, K
debugger. It calls the int 41h, function 4Fh.1 r; _8 Q6 `& C' J
There are several alternatives. ( ]; Y. F, }$ R! x# f
/ l$ ^+ e7 x7 i" q
The following one is the simplest:
- C2 G. b5 M7 }& O I6 ^$ {" I6 q+ Q; D/ d) \- e5 O& o
mov ax,4fh! Q9 H- I' X2 p: L" o- |
int 41h r8 E/ q5 y# D
cmp ax, 0F3863 W( y( X1 E+ \/ E9 i: [. }1 b
jz SoftICE_detected% q4 P. N( P5 A$ V; S% W
% H& T; e/ u7 G# \8 ^2 [6 O i; R
8 Y- {- L* ?" D6 Z$ I/ jNext method as well as the following one are 2 examples from Stone's
+ T& k6 L4 ^4 F$ k- m, G"stn-wid.zip" (www.cracking.net):. S; c4 k: o1 f& y0 L
5 S8 s4 G. P2 ~4 W/ K" C
mov bx, cs
. G% Y# I! b4 j- J" o/ w lea dx, int41handler25 i; _$ s/ T( m* A
xchg dx, es:[41h*4]
- k9 x7 A8 Q( B/ r+ B) J xchg bx, es:[41h*4+2]
4 o( U4 w1 q' i3 a j3 p" R7 n mov ax,4fh
) N' T6 U0 ?8 t! r' Q int 41h
0 d. l- n$ G6 z! m4 C4 y" a: B xchg dx, es:[41h*4]
( g- \4 x1 }7 `7 y% n- H4 ` xchg bx, es:[41h*4+2]/ E' V9 O) N- Q* N, B2 e" O! D
cmp ax, 0f386h \/ V) K0 k6 y
jz SoftICE_detected
1 ~. G% F0 [ ^7 ? D: }, e
2 h- i% a n+ nint41handler2 PROC
( \% Z/ G+ M b& _ iret
# N x# g+ k2 jint41handler2 ENDP7 `# [* f1 {- b% x( @; l
1 w( B0 Z2 p- }; W; d( g
% m g" Q; |5 R3 F0 X2 T' c_________________________________________________________________________3 a( M1 s0 ]6 Q" C
! J" z- j7 Y2 k5 L1 V. ?: D) L
; ~8 J7 k: f4 m) |Method 06
& k2 O- @) w2 X+ ?1 o=========
: _# J$ X% z% y- y4 y1 I0 \6 `2 b
7 G$ \+ E1 {& ]3 H! U4 ]) e$ H9 |* j0 L
2nd method similar to the preceding one but more difficult to detect:& j* d7 P& L. n
' v2 R" x/ ]& w% O6 p" i
' f t; z3 @7 l# {" S+ D9 iint41handler PROC4 C/ C. J# E5 ^
mov cl,al
& K8 h, t7 ^% Z iret
# ]; [7 b# B3 n# k7 Fint41handler ENDP
9 `3 @1 p3 Z9 _: n+ n8 \8 Z4 c0 f3 Q- M# F+ L |$ k) O2 T
% n( J0 Y$ ^" t9 c* p xor ax,ax7 y0 O. ^' A% ?* O# T
mov es,ax
9 f" [! |3 E+ C; D# b+ `1 d mov bx, cs
& c- H- g3 H2 Y1 [2 _2 t a2 d+ g. D lea dx, int41handler
' {" ]. z2 V' _8 @ xchg dx, es:[41h*4]
7 U2 y3 ]8 k$ N& N% i' G1 ?. t5 u9 W' I xchg bx, es:[41h*4+2]
! t7 m$ c( r% ?0 X5 W in al, 40h
& j: k% X3 U; ~) i xor cx,cx2 m3 k. F+ a5 q
int 41h
, d' T \% [8 o xchg dx, es:[41h*4]' s1 v' K, V- D/ r8 e7 T& R
xchg bx, es:[41h*4+2]2 l3 b& k" h2 K9 ~/ g8 J* d
cmp cl,al) v+ r/ I! c2 H
jnz SoftICE_detected
% ^# x. Z2 D$ C, f! @$ F- K6 a7 F: R* q' _
_________________________________________________________________________1 ~8 K6 p( V; M0 E* R
( z) s# X6 B+ D0 P8 OMethod 07
1 |0 S( e, w$ h K0 m0 o1 n=========$ Y; v! Z$ Q" c
1 Z/ _& E" t _ v! b9 Q
Method of detection of the WinICE handler in the int68h (V86)
1 a3 `5 m) p5 c" I+ v) S
2 X# b* e5 u% o& v/ h* @ mov ah,43h
3 y- Y( D, s4 {/ q U$ w* @ int 68h0 I5 H$ V- \- e: k
cmp ax,0F386h* f* l: a% z. K% E: R0 H
jz SoftICE_Detected
! W/ k$ H' T. K1 r
: p4 ^; I2 M0 V- p3 P& d& R) w6 X/ T2 a& C3 k4 ]1 P
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% x# {+ [1 j9 s5 M
app like this:
0 C, v; C! h8 A+ R) \3 M
1 X# |* `; x t; ~ BPX exec_int if ax==68
v- F& b+ E& \) N$ i) }. E (function called is located at byte ptr [ebp+1Dh] and client eip is/ K" m0 c/ Y. J+ d8 V0 Q4 |, G
located at [ebp+48h] for 32Bit apps)& q4 c' h- f; M
__________________________________________________________________________
0 d# o# {3 M# S: o
! u) N3 Z6 K" n& H W4 c3 ]7 `
6 v; F, K. R. }Method 08
, D8 ~. Z) z2 A! K: f=========
: d3 N. ^- `1 w/ X' @2 f; R) ]( b( O) ~) t( Z* I* A! ~
It is not a method of detection of SoftICE but a possibility to crash the
4 `8 O: ^; M$ Q' |. c) R$ }system by intercepting int 01h and int 03h and redirecting them to another
* y* B5 V: R+ x+ m" X8 h! A8 groutine.
, H# r" W+ D" }& c8 x9 wIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points: _; n$ ~2 o9 g9 m( y7 Z# \2 A f
to the new routine to execute (hangs computer...)7 Q5 v% a, F- K+ t+ N# u$ G
. \: L! J" A1 ^; u# c7 G- o0 G( K- j
mov ah, 25h
) q; W h9 O& \3 I mov al, Int_Number (01h or 03h)
h( z2 j" M$ r6 l mov dx, offset New_Int_Routine" h2 d8 ?3 G! L3 p4 G
int 21h1 D( h# W8 y' M( Q( S5 p# H0 T
& w$ h: ^' U; r/ \__________________________________________________________________________
4 l8 l+ g2 W. a" A- p2 i
7 @+ [% y9 k+ ~' v: o- dMethod 09' k- O+ Z& ~. K0 x a! P& ^4 r/ \; [
=========
7 H+ K2 E8 H+ o) ], W. P
7 o/ k& r' Q' sThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, N% j' R0 I, @1 T) Y5 b$ X2 pperformed in ring0 (VxD or a ring3 app using the VxdCall).
; S4 X# m8 V5 \/ i7 wThe Get_DDB service is used to determine whether or not a VxD is installed
8 s" o6 I1 t, S. M" t# @! Ofor the specified device and returns a Device Description Block (in ecx) for& o* L' v3 ^6 N8 v4 h6 w# e
that device if it is installed.; ^8 V" O3 Q, j8 W' c
: }' v( g) m9 m2 t/ l4 h mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ V8 f0 a! u" n
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
2 f i6 P+ k7 `) l% |3 s1 z VMMCall Get_DDB
& M X6 U8 Y1 @ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# L( t( i7 `% p' z. N6 @$ m6 o
1 `- j' L3 I9 K+ Z6 f, c1 L
Note as well that you can easily detect this method with SoftICE:2 [6 ~ V, r# H( z6 E% e
bpx Get_DDB if ax==0202 || ax==7a5fh
; F% b0 C9 b) F/ F+ w/ G$ ^+ v. t3 s8 c2 E: F: y
__________________________________________________________________________
$ v: N- J& ~$ u
3 j8 \5 x& H" ^4 }# FMethod 10
8 ?8 z. e5 o! G" B% X) x=========1 m- v/ E& U3 c2 i7 g
: a0 X4 }# I) V' F( C* q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
- r, j* i* d6 J SoftICE while the option is enable!!5 T2 C/ U% _' Z4 R( E- f
) Y% y/ V+ \9 R# x6 ~1 |5 _: Y8 }This trick is very efficient:
) N" @& y# f' [3 }0 nby checking the Debug Registers, you can detect if SoftICE is loaded3 J7 P( f/ u: ~* X5 }5 q( ^; E
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 {; x0 ~+ c0 {, _there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 [+ |. G: @, tvalue (in ring0 only). Values can be manipulated and or changed as well
f# K" G9 z, a' F3 W: X(clearing BPMs for instance)( D$ L+ p$ U% v3 ?
8 U3 R: n; ?5 c__________________________________________________________________________
$ k( [6 T& g( K, N; u; o3 T* d' P- V
Method 11
+ k* [4 l6 S( B# a- F=========
$ L0 i% S" b! x1 R, o
& W, T2 W5 Q1 {) `This method is most known as 'MeltICE' because it has been freely distributed
# u5 \, P+ d/ z+ R3 V; Jvia www.winfiles.com. However it was first used by NuMega people to allow" `! p4 y- l' v% v7 l; I7 J. R
Symbol Loader to check if SoftICE was active or not (the code is located7 ?5 y5 j* O$ z
inside nmtrans.dll).! ^+ v6 u" }! R# ?+ P" @
) v- h2 A0 O0 ` PThe way it works is very simple:! P2 Y: b/ v) N6 F/ i& d2 p
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. Q# H: V% ?) \WinNT) with the CreateFileA API.' }( T8 `9 r" W* c0 _
# M: X. @6 x2 T7 AHere is a sample (checking for 'SICE'):
3 T% t' j+ a* H! H5 u4 l+ Z, s! l* c/ d( F I
BOOL IsSoftIce95Loaded()
) A1 l4 c* q. k+ D2 W7 z( U5 N{
; ]/ `! t5 N# e5 l, y% m; X4 Z, n HANDLE hFile;
1 S2 s. z4 `8 u/ R9 {% V hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 m* u" g4 f0 Y1 a8 O7 {% f
FILE_SHARE_READ | FILE_SHARE_WRITE,1 Y( l6 I# N7 G4 }* D% g
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); G& _6 ~4 V, x2 V8 ]
if( hFile != INVALID_HANDLE_VALUE )
8 ?' Z* B! T1 z2 Y' T8 c- O {2 i" Z: P1 {" ^# q$ Q0 l8 u8 u
CloseHandle(hFile);- M) ?( ^' ^5 \! c$ D
return TRUE;
& p5 u1 N, Q' K* F% C/ Y }
9 l8 }& ^$ a/ B- t% a! ~) M return FALSE;
9 }# N2 k7 g7 S}
4 O' D/ B3 o, s7 C" U7 w- l0 d; b: Q6 P% h
Although this trick calls the CreateFileA function, don't even expect to be5 F. D6 c# M+ d Q0 j9 j
able to intercept it by installing a IFS hook: it will not work, no way!
, Z. \( y/ x" G* ?2 N; x& s" WIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
( R9 U& k: D _. U& V# L/ u9 i8 Tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 @# _, n" W% e; }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
: X/ u; J2 l1 F) V: H: N" L. `" sfield." M! X5 x. J T" J3 X. Y. u( X. ]
In fact, its purpose is not to load/unload VxDs but only to send a
" ^, E5 d# e AW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), O" @. `: H7 m4 w3 K! U( B; G
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* V6 j/ [! ^9 w; n1 h. Y" \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).$ {( p4 Y6 Q# m! n, g7 l
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 s8 T# z( P. H; j1 \. u
its handle to be opened and then, will be detected.
; G1 S" R f* S! @You can check that simply by hooking Winice.exe control proc entry point
8 M. g0 q1 \) l% Swhile running MeltICE.
6 x) m3 J/ e+ P. P5 J
& j( [9 P o4 ?+ }' X: d7 K3 U9 {+ C* y' G, ?
00401067: push 00402025 ; \\.\SICE0 e0 O# T u+ p S2 m
0040106C: call CreateFileA
! g/ @: z( }; T' j# f 00401071: cmp eax,-001
+ B3 ?' d) T4 e0 W3 N( Y 00401074: je 00401091$ [* c w1 X- w' V' O; L/ s4 ]
! D! c7 {2 r r" g+ ?
B' d0 b5 M" ~There could be hundreds of BPX you could use to detect this trick.
/ k/ `0 U1 r8 w& t/ v1 p) X( P-The most classical one is:/ a' j: p, S, x3 d
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( J, `1 u7 A" {% s( q; w *(esp->4+4)=='NTIC'8 p) o7 N8 A9 F
' s R6 q/ w9 S% I/ Z
-The most exotic ones (could be very slooooow :-(, E. ?$ q5 {$ f
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
1 p/ u8 X* ~( F7 x0 e9 \4 k. M ;will break 3 times :-(! r# s( v. r z3 U( a
& L5 P5 L; @6 Q* Y- ?
-or (a bit) faster:
7 a- a; U$ }) C- F" t+ N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) t3 g* @, L! l' K
' N+ w# p2 W1 H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 f. b, i( @+ x3 S: o
;will break 3 times :-(
. N1 B1 a( g* f% u( L7 r+ z& [6 ]! _3 X
-Much faster:
( ~1 H- V( a; R% }+ a9 { BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 g+ ]$ a3 U1 U7 S
' R: Y( T: n% c2 O) H( j( g# XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 u% U; P$ R& F: L4 Wfunction to do the same job:
0 d# W& @% z3 I5 v4 X1 R. ?: L
! z6 ]# k* f' r9 |, } push 00 ; OF_READ' O3 W W9 Z: r" y
mov eax,[00656634] ; '\\.\SICE',0
1 K A( q/ e. A; e. u# k: N# @. G. p push eax
6 E( P8 E9 h2 E! z4 c7 V" ~6 G call KERNEL32!_lopen
" C0 {# J+ Y" {2 z. X6 d inc eax
8 k, O/ c4 Q# o; a jnz 00650589 ; detected
) `+ ~: S0 c X* O' l7 d push 00 ; OF_READ3 k% r$ `3 r, o6 B7 l4 P/ E
mov eax,[00656638] ; '\\.\SICE'
9 r& e0 E+ O+ s8 @* X' A7 p' x% n push eax
% m* r; b# c M call KERNEL32!_lopen
) C0 r1 t7 w% o9 X3 ~ inc eax
, w# O6 s: W8 |: {* Q1 w jz 006505ae ; not detected
0 r5 _0 C6 W& @2 I( r! ~1 G2 q
3 O$ h* Y2 l' _
( ?3 t- v% `0 m1 W: b. e" l__________________________________________________________________________4 l+ L, R$ Y* I4 U3 t" Y
2 H8 @ D Y8 r0 ~; j: kMethod 12( S3 W4 L+ {& O$ w' v* ?. Q
=========4 } s+ C% H- o; d, Q
; O9 ]& M3 S- W. Q; N8 e
This trick is similar to int41h/4fh Debugger installation check (code 05/ V7 z* p, O$ j
& 06) but very limited because it's only available for Win95/98 (not NT)# s& u+ Z3 T. q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 k y' ?0 f, I4 `0 @+ i) d
: E: C8 q* ~$ e7 {1 F5 Y: M
push 0000004fh ; function 4fh! N, c% K) ^3 V( Z0 Q( d) G
push 002a002ah ; high word specifies which VxD (VWIN32)
' i u- r0 b. t2 A! \, Z8 |+ A ; low word specifies which service# a7 i$ J' X" e' L5 N
(VWIN32_Int41Dispatch)) x' ~) g# Z) k, K( R3 e8 |
call Kernel32!ORD_001 ; VxdCall
$ u* k/ A8 c5 t, t cmp ax, 0f386h ; magic number returned by system debuggers
( P( ?( ]8 J& e+ e. L- F& ^. t jz SoftICE_detected3 { E8 e" T0 }# S( q0 X
& S7 N' Y, ^' H" r/ Y. \Here again, several ways to detect it:( T4 t4 Z! J8 S; |0 F/ ~: `; f6 k
) M7 ~9 l& F! e5 m+ A: B O$ J BPINT 41 if ax==4f" K- O' g# ~# v9 D- k
) f+ G4 s$ `* d1 \& \. \ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ H9 Z, ?0 g/ Q9 c) Z4 }, W4 G% k/ ^" x9 {5 k" `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* }% a# n/ h* P0 D8 R7 u) n+ B" @4 \2 J- |7 U9 R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, A! q* h( Q, t5 F4 n
, N) W* o1 G5 x__________________________________________________________________________
1 @. g$ B7 |, n( g) i
5 l5 P9 B/ F3 O0 xMethod 13 h; Y# B# j) n; @
=========2 F) S4 d$ ^( f
: l; ~ Q4 o/ L) p9 M
Not a real method of detection, but a good way to know if SoftICE is( U' ?4 g, }, t1 K# H! M5 }
installed on a computer and to locate its installation directory.! d# P) K* e/ j1 ]# v$ B: D% o
It is used by few softs which access the following registry keys (usually #2) :
' p) t, @! m. g* L% p/ @) [. _+ V8 ~3 |* u7 t! @ J- h7 c
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- m# j, E$ _ _% v) J% X\Uninstall\SoftICE
! ]" C* s, @' K" {2 N- y. q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' L* D1 s" |, }2 J6 H( c5 N6 o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* q$ o1 l4 g3 ^6 `9 L9 M
\App Paths\Loader32.Exe' i5 y2 R- a. Y# W
" ^* q0 }5 w$ p! T2 e
! Z6 t0 |" H3 E
Note that some nasty apps could then erase all files from SoftICE directory8 I+ x @# [ }: m
(I faced that once :-(4 `1 X4 @5 w3 v# \3 ]
' X t1 V8 |1 o2 CUseful breakpoint to detect it:. d4 h/ L6 u$ W1 j
3 |" C- a2 M9 q% n" } M BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& @0 a0 d }9 b
6 B# V, y6 q, D L1 e) t__________________________________________________________________________3 _* V- f; K0 ^3 i
# L, S, o7 l4 D# L
2 o- \1 _& K8 f. K/ f) n, }+ a
Method 14
' Q. k7 \. {9 m7 t" D" z. L=========0 R* `8 R7 t6 o0 d* ^0 A! W/ l6 S
+ U# G) R3 q( z0 J0 k% n: |" o, I" SA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# q, Q2 k7 O" K: ~: t7 \) `
is to determines whether a debugger is running on your system (ring0 only).
+ }' A& N1 y( ^4 O& z; L
0 K( O: d2 ^' Y3 Q1 ^% g! l3 M VMMCall Test_Debug_Installed
( M2 E1 A$ _. K) h6 s" { je not_installed
5 |& f: R, ^& ]; ]- J/ L; h' D3 a6 H
This service just checks a flag.9 g0 q$ i' E _
</PRE></TD></TR></TBODY></TABLE> |