<TABLE width=500>$ Q3 e% X/ v: F4 {
<TBODY>
6 _: `9 f5 D7 W<TR>+ V6 l, H1 o8 c* L6 ]: d z
<TD><PRE>Method 01
. ?. i( s" r6 \=========
[5 c6 s( v% b. J( Z4 v0 ~$ [* I
@7 W& \8 f4 M/ i/ C, B- ?3 S0 MThis method of detection of SoftICE (as well as the following one) is
/ r0 x D% E$ Z/ Zused by the majority of packers/encryptors found on Internet.3 K; u: G& {+ U! D. w
It seeks the signature of BoundsChecker in SoftICE
0 `/ R+ G/ A8 e l4 {
, I: T( ?( b) ~! h1 R A mov ebp, 04243484Bh ; 'BCHK' }3 {3 [( s% R4 m Y% L# a
mov ax, 04h
4 _* P: J6 e: ^9 P! g int 3
4 L+ F8 _8 P; E% {5 c* C8 s cmp al,4( V& N( x1 o- ?( n5 e( _% t
jnz SoftICE_Detected* U1 z* t( P2 O& S$ r, `# _
5 M. ]/ q: `" X8 @8 u/ l___________________________________________________________________________
/ P6 @& C. F6 M: e+ N7 _5 [, f+ R* C1 f4 V: D; n
Method 026 m4 i: F6 Z4 P8 P8 \
=========$ c# m" G; Z* o
. U; Y& w$ ] V
Still a method very much used (perhaps the most frequent one). It is used, i6 y# f8 |) o7 }/ I0 d1 }
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 K! ~: T! z w5 L0 o- E
or execute SoftICE commands...! W+ }0 U6 _% g& A
It is also used to crash SoftICE and to force it to execute any commands/ t! w7 u/ {* n" [, H/ b/ r
(HBOOT...) :-((
H5 T3 n# k0 g$ I$ g4 Z' k U
" P% m6 [) P' t# c. P& g0 eHere is a quick description:- M0 Q0 ?# `$ U/ Y
-AX = 0910h (Display string in SIce windows)( m8 u& R1 `) b* r* K
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)7 x$ l# T: L7 e2 a8 y+ a2 j/ v
-AX = 0912h (Get breakpoint infos)9 ]3 D3 _' \4 S8 o' I9 C$ _
-AX = 0913h (Set Sice breakpoints)2 S( U0 _3 X4 K5 l4 L& M' J
-AX = 0914h (Remove SIce breakoints)
; A1 Y: M8 N. s9 B9 q( C+ j2 q7 L; }9 D$ N5 C( K5 D) a, @
Each time you'll meet this trick, you'll see:
& j7 w' r1 b3 C5 L b-SI = 4647h
( s s- e4 V# ~- c+ i; U u, o, U-DI = 4A4Dh
! E+ ~( g6 e3 b& Y, v* lWhich are the 'magic values' used by SoftIce.
' j, {; z+ }3 C( V0 P% L5 m, c: |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 B7 r. c' L' c. k( Q6 C- R
7 K; p& W, K8 s7 o9 v! [" X
Here is one example from the file "Haspinst.exe" which is the dongle HASP
& Y F- ~, A$ A2 s; xEnvelope utility use to protect DOS applications:5 O% a1 K9 {% _& j0 V* Y2 m
# z0 Q- y% A! V7 N# P' k' k* L
5 ?: @% A* O8 w/ c2 d$ g1 C
4C19:0095 MOV AX,0911 ; execute command.
5 G: n M9 u; u+ [. u+ e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 z+ I! q# ~- G. z) c" S
4C19:009A MOV SI,4647 ; 1st magic value.
. m( G% C1 f- A2 W" T ]4C19:009D MOV DI,4A4D ; 2nd magic value.* H$ M+ [' }5 S7 X3 _( L
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ x6 \9 H7 B: m4 R |' [4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 a* c1 R& |1 X' J* \- C2 m- c0 ^4C19:00A4 INC CX& f2 v* D. M" P: g9 L- P
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( }- [' W/ o7 y2 q) g8 L
4C19:00A8 JB 0095 ; 6 different commands.( f1 S& p5 Z, {/ X1 B6 p2 d5 _; L
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 M( w4 n, O" Y* Q+ V; o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 H8 b: H! S1 C, R
, u0 [, F1 z4 v! L
The program will execute 6 different SIce commands located at ds:dx, which
! [- Z+ c: h- h' oare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 a7 s% K# c6 X# c
% L4 ^& I* @) f3 S
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.+ S7 z i H* d" W# _& A$ b
___________________________________________________________________________
2 N" e5 k" o, `5 o ?. ?/ B6 t3 Q4 k6 x8 j: _( y
! F$ V' b4 l- `& R4 I4 s
Method 032 c" P' O4 Z+ Q: g) @
=========5 ]/ v& ?. P) V! ^1 R) B
% F& S+ K( v M) A* KLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
* n" M: R; [- K/ u/ c# q+ O3 A(API Get entry point)
: a3 _4 o ~, @- c( h! Y
) E7 h4 w. e1 m1 g* W5 b4 n: u l0 l; W- G3 ?0 B
xor di,di/ [: b, B: G% j5 E! D7 @
mov es,di7 }1 m/ H0 T+ l6 y1 j6 N) a A
mov ax, 1684h " g' q. S; h& Q8 F) p8 U' S
mov bx, 0202h ; VxD ID of winice
2 |- U8 N A) y. J8 n+ d int 2Fh
c0 e, X# i6 f' P; z" D% Y! j mov ax, es ; ES:DI -> VxD API entry point
0 \! f: Y; e, [7 Z1 y. m! Y& c add ax, di3 Y1 ]+ A1 |' P* n& {! u! Y
test ax,ax
% @8 Q/ l; f' _) |9 Y jnz SoftICE_Detected" \+ a% r- {6 k9 k% S
: N' i; j$ _8 z! q. U9 W/ m
___________________________________________________________________________6 b% a, W& x; B
# T* A( l0 |# R! yMethod 04
; Q3 E" h( _1 W$ N$ R# I% `; x=========0 W$ R7 h% j+ Z4 q v+ I# P
0 S: G; U) P, K- T% c, V, o" V/ J9 h0 DMethod identical to the preceding one except that it seeks the ID of SoftICE. P% R8 H- g: t2 U
GFX VxD.
. N W% K v* Q$ k r0 N) X$ S' m: S& Q( s
xor di,di
, `6 `* S% c- n' c+ d% o, R- r mov es,di
& j4 @8 N# e2 ], S mov ax, 1684h
7 B8 A: T+ |' b- J8 A6 K mov bx, 7a5Fh ; VxD ID of SIWVID
o5 l% m, T4 H4 T" S int 2fh
8 W- X& F, G1 s$ K' H; [9 e mov ax, es ; ES:DI -> VxD API entry point# ], p: W4 w$ i
add ax, di
$ u4 H# O" _1 B1 x3 L* [8 w test ax,ax
& ] \/ |/ l% C6 V jnz SoftICE_Detected
5 F+ v) b3 Y6 u
3 |0 z/ l; @) Z+ V; a__________________________________________________________________________
. p4 b8 U+ [. @! I7 [$ _; @0 Y" M2 p1 _
. i. [3 a' i' o/ P/ X" P6 b6 P
Method 057 I& T# j5 X( [' o1 `- g+ f' |
=========
+ \) v. D3 g8 k4 E# s, j
0 k' j8 x2 Z. xMethod seeking the 'magic number' 0F386h returned (in ax) by all system7 O4 c* ^: K( B- |7 t" B
debugger. It calls the int 41h, function 4Fh.3 }; u% ~' l( s2 Q O; O3 `
There are several alternatives. / `( D* K8 a, K* w! G1 C' ^; D( E; e
0 N4 t1 `3 E( V. `' U
The following one is the simplest:
, F. C& V* c- z3 t+ {, L3 \; x
0 A/ \) X5 p$ _( M( `( R7 A mov ax,4fh6 H! ]7 u$ U/ @8 ?: ?
int 41h; f7 O5 f" T- J+ x0 I4 ^
cmp ax, 0F386% z% C) l7 X2 G3 Q# I
jz SoftICE_detected0 O# P0 ]; l) ]/ Z3 p3 C" _
6 v4 l' m, x1 D+ ]
& \. c' G% I8 k. v0 ]Next method as well as the following one are 2 examples from Stone's
$ o1 l/ C/ V% h+ f4 h3 q* h"stn-wid.zip" (www.cracking.net):+ B# R) B' S6 D
$ a1 v( g4 |/ V& @9 R4 ~ mov bx, cs
/ z+ _. s' I# M3 J7 f* l lea dx, int41handler2) U' p5 ^6 q- Q# C8 ]. s
xchg dx, es:[41h*4]
: c5 p4 v( p" ~. i+ r! ^8 O: \ xchg bx, es:[41h*4+2]
' V( |( @9 ~3 |& t. j/ ~6 C$ @ mov ax,4fh: K/ ~/ P! D. Y2 O# ~
int 41h: W! t' y, A% y- ` w. n) q
xchg dx, es:[41h*4]
# q' `0 b. C7 E xchg bx, es:[41h*4+2]& o* Z& F# x" n* T3 ]
cmp ax, 0f386h
0 \ f4 {+ M' |+ j% e/ r# J% m" R5 e& M jz SoftICE_detected7 X& d1 Z$ z% j: ^4 N* c7 m7 q, s5 l! h
9 m" R) G0 S1 }9 q! G6 r( hint41handler2 PROC. u- s; Z9 k9 E+ F" E
iret& Y% j' n& K* N7 h9 n% w S8 a
int41handler2 ENDP' O5 B, F: }- W+ {
7 F0 J; g5 J) T2 o- |3 o8 w9 h
8 m+ `% U& b2 _. ]$ o# H* o_________________________________________________________________________
+ \# Q* S: k/ j$ B! G8 u1 L( B2 O! J0 l& A$ c
S( {% q' x8 n
Method 06: S- R# W9 [) b
=========
! _0 B5 a8 o3 t8 A
% I4 m2 b9 v# U( d3 [+ t6 y8 ], x3 r0 k: d6 K
2nd method similar to the preceding one but more difficult to detect:# t; ]0 G/ b, ^" `8 t
2 t, S/ B- g- h& `, Y9 ^' Q- G7 F" w, V! n* A' z8 t( d+ }- c
int41handler PROC
$ V6 g* s8 F) [1 {: w: s mov cl,al) G' o( ~% G a4 U' R
iret
! D% d; i5 x' F5 Q- h/ lint41handler ENDP+ d: l$ i' k# T( p+ p' a
4 Z4 D! R' A- b" O4 l
2 F# e4 l7 m% e5 k0 \5 b xor ax,ax
# v5 Q: j) J! o. k mov es,ax$ y; s+ ^1 e w2 d: F
mov bx, cs
8 R9 j/ U; U F+ G5 b6 ^ lea dx, int41handler
8 C' c4 {: N r2 Z" f- { xchg dx, es:[41h*4]# R) n+ K b ^( r* _/ E0 ]+ h" s1 N% z
xchg bx, es:[41h*4+2]- y2 p9 _0 a9 @, l. m4 E' B5 @
in al, 40h4 w7 S% B7 Y o. w) K3 G( d) z
xor cx,cx
: f' ]) S7 b6 _! Q: b k1 V int 41h
6 k* D3 f: I3 u/ G2 `9 t xchg dx, es:[41h*4]4 @4 {- V: C* ^$ T2 E
xchg bx, es:[41h*4+2]
% n J ]9 e, f+ I cmp cl,al% _+ {' T6 _! r: i) q) E( y
jnz SoftICE_detected
8 p/ M# u$ k+ W |7 b8 B4 G9 ]1 a3 y9 M$ l2 l6 E1 ?
_________________________________________________________________________, ?5 l- k9 E1 q+ d0 e0 P
" m" G" R) V9 ?3 C0 f. G
Method 07
, i4 Y6 l K5 |4 E1 a: ~=========7 ~ Q, W6 j; ?1 E
$ r( l5 z: r9 n. L& G# UMethod of detection of the WinICE handler in the int68h (V86)
1 ?7 f9 o6 j8 A" J5 c4 H# i- z
4 e4 j& r& c( _( H& w/ @6 v" W mov ah,43h* O! N6 B. V/ F+ N; q
int 68h
4 I. q0 T8 P$ N! Y: v cmp ax,0F386h
' W1 a5 f1 [$ Q. i# t jz SoftICE_Detected7 `% Z- ~ C6 f% q
; U/ J6 h: {5 k- b I; ~* K8 T' P; z# O
8 P0 A) |: x2 J2 a! p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit X7 u5 K- U4 u2 \; P2 e# s
app like this:
! B3 s$ o) R) `% G( Z
% A3 U! u' ~; b' f: B0 t. c, i BPX exec_int if ax==68! Q7 n% Q5 B7 `: v
(function called is located at byte ptr [ebp+1Dh] and client eip is
2 V2 b$ M5 F% O" M+ } _7 e I located at [ebp+48h] for 32Bit apps)
3 C- A. {- W$ c. `* A__________________________________________________________________________
' y/ X2 S8 D2 l9 ]5 P: d; g9 B5 }0 j4 K: i
( g4 I% F, X* J2 P5 G) sMethod 080 W1 h! s' B; n( C) ?) }) E' f7 R
=========
2 W: U5 }$ O% k! s; T T3 `; o0 f! X# f2 ?8 D# Z _; E
It is not a method of detection of SoftICE but a possibility to crash the' A, t" _' Y3 }7 f2 [1 y! }
system by intercepting int 01h and int 03h and redirecting them to another
& |) p$ I& q! ]# W( D9 \routine.4 r- q0 P4 N* o) H* O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 [. O* Y( l1 {& m2 S/ H5 Ato the new routine to execute (hangs computer...)
! P& H6 N: k4 [1 b2 j" N' x8 Q% D
mov ah, 25h
( P5 `' b5 e% H8 M) A0 h mov al, Int_Number (01h or 03h)
# g$ N" w4 ]0 M mov dx, offset New_Int_Routine
/ \( U j1 f7 v9 K6 B+ f) x) { int 21h
+ W0 X1 Y1 R7 ?+ V9 s" J* z9 i7 q# U; c' d1 K' D* O% G6 b! P3 Q
__________________________________________________________________________
' \' h( ~, V/ G2 \/ D9 U
: N$ h. O( R4 T" c; G' C# ZMethod 09
& x2 f) C, Y m2 `; @- {=========
1 M0 u$ ~5 Z3 m' |" O
! }+ g, Y* c% B+ |/ NThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ K9 g* | d3 d6 A) @; `* A
performed in ring0 (VxD or a ring3 app using the VxdCall).
]* W; k3 ~+ { w4 CThe Get_DDB service is used to determine whether or not a VxD is installed
. l1 P$ W. `, T9 Y% P+ f/ p2 a. z! q+ xfor the specified device and returns a Device Description Block (in ecx) for
. f; ?0 r% i* r: hthat device if it is installed.2 O: w4 a; I: H0 R' K% Q
3 w. g4 s6 w/ I- J B! g9 R1 p mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, i% |! P2 o2 c* U5 h; e
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# i& B( O" w9 K, G& i VMMCall Get_DDB6 t9 r- p2 s. ^. E3 |
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
1 v) r6 r% A1 s+ { z0 l8 E6 ]2 I6 L. X+ J
Note as well that you can easily detect this method with SoftICE:: P; \2 F, u: k$ C! c% ?1 Q
bpx Get_DDB if ax==0202 || ax==7a5fh
0 y7 D o5 }8 N( ~6 l( w& \; b+ O4 P3 N$ Q9 v: I
__________________________________________________________________________
, I) t9 B" u7 r, D# J. p* |# X
1 f& _$ f) G8 C. z/ l6 r# s4 _) XMethod 10
* f! R# p# k9 O( x=========
- F# o& k' {/ A- x+ U- V4 g h" P
) F! ~& \. e" F3 w5 {6 v: W=>Disable or clear breakpoints before using this feature. DO NOT trace with
' ?5 [; X" O9 N3 S) _! D) i SoftICE while the option is enable!!5 l1 o) e" i7 D- ]2 f
% {8 M3 a" H) w) S, f0 \
This trick is very efficient:$ R& d9 h/ z5 s# b
by checking the Debug Registers, you can detect if SoftICE is loaded4 f+ H7 O0 B9 J+ W
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! @7 A: ^ E1 s5 B6 _
there are some memory breakpoints set (dr0 to dr3) simply by reading their# l2 ~# R0 F; _6 p$ Y2 m
value (in ring0 only). Values can be manipulated and or changed as well
# D. y# D% X/ _" |& ](clearing BPMs for instance)
9 k( Q# I1 o: d1 Y, [, v4 l$ [& C
& [4 o- E1 X7 w3 F) y9 y__________________________________________________________________________! j5 N ~ R! z2 |8 x
8 d q- F! F! D: B! t6 }* bMethod 11+ f& ~. F* `$ N( ]9 R( [
=========
% M' C3 o' d3 L+ M1 Z8 v7 a6 U
0 r) [! ?" d& m" h0 GThis method is most known as 'MeltICE' because it has been freely distributed5 [$ V- A: v: g' h" R( M+ z
via www.winfiles.com. However it was first used by NuMega people to allow
4 a |( ^7 n- ~9 W L( V4 CSymbol Loader to check if SoftICE was active or not (the code is located
' g" M# j4 V. B9 K( {/ N' a8 l3 cinside nmtrans.dll).
+ P% ?# O8 x( R" V" O; N3 q0 i5 r$ Y' M" ~
The way it works is very simple:2 Q/ Q' E, x0 Z( M( u
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; k1 o0 j* `1 e
WinNT) with the CreateFileA API.! v* D. [6 Z# u2 o
/ r/ ~( H1 A# B7 vHere is a sample (checking for 'SICE'):6 J. |. r/ t+ I. V
) q2 F- k; A `- X+ R8 c5 |1 d: VBOOL IsSoftIce95Loaded()
/ Q s+ t. S1 ~% }- @! W+ \8 H{
+ t2 w9 }2 ?! E* }: S1 {6 ^ HANDLE hFile; * d k; d, {$ O; L
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 j6 Y( j( e% `! t1 @
FILE_SHARE_READ | FILE_SHARE_WRITE,
! C5 i( Q7 X$ q+ t( X: P NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: n% Q# [$ R" X U! b if( hFile != INVALID_HANDLE_VALUE )6 }6 ^8 W/ d( p5 @. z- D+ R$ c ^+ H
{ ~- U1 a. n7 \! C
CloseHandle(hFile);
* d9 ^5 L4 ?! d& _ return TRUE;
2 y4 L# Q; ?3 C8 R( P) h1 J Y }9 n1 a! O- A, A
return FALSE;4 s* w! H; f5 R9 [) J
}" {7 p9 U v% p8 ]- f
% K- Z+ c: k3 Y* w7 {Although this trick calls the CreateFileA function, don't even expect to be5 j/ V. l' f* k$ D* i6 Z' V( G
able to intercept it by installing a IFS hook: it will not work, no way!
7 V" |' @8 y. f, UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ ~0 i8 W& I( {2 [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 z6 s% {7 n( R3 C6 }and then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ Y j2 ^5 I: M' O4 ~' cfield.5 P2 h. y+ b+ ~6 D, }0 Z1 u3 G
In fact, its purpose is not to load/unload VxDs but only to send a 9 H/ P1 b! S; q/ ~4 n6 w
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 P$ A+ C. L) f( A
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- R& Y' O0 s9 w- T9 U, yto load/unload a non-dynamically loadable driver such as SoftICE ;-).& P e( V3 U2 {% R& t3 ^+ q
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; i* t: _0 j1 Z9 z/ n3 J) b4 Vits handle to be opened and then, will be detected.
+ S9 P; U; u) [# ?2 N2 {# mYou can check that simply by hooking Winice.exe control proc entry point; Q8 W, p& g; r5 V
while running MeltICE.+ Y) @0 \, F7 b: x; q) `
7 ^% B2 y, o, a! d5 L- ~
, I4 O, L4 y- q- K6 J7 Q4 F
00401067: push 00402025 ; \\.\SICE% M5 l* e1 h' S$ U
0040106C: call CreateFileA3 G$ N8 u; k6 ^6 d ]
00401071: cmp eax,-0016 [7 i# P9 ^8 A. A7 m: V/ f
00401074: je 00401091
5 ?* T) v3 K; `! U! {6 B
, K2 g0 x- N' t6 m& i. t# \# @7 I y I% u* d$ }
There could be hundreds of BPX you could use to detect this trick.
" Y; ^6 c4 N* T% G6 g& U( g* D-The most classical one is:
& U/ k0 Y, ]: z. }5 c/ l* Q$ o& G BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
@- U* I+ x- S *(esp->4+4)=='NTIC' [) h3 j r7 t3 I
: U% T. e) k% Q) m" _
-The most exotic ones (could be very slooooow :-(. n S1 r. R) ]9 `
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ Q0 x8 ?- D4 j: ~4 t
;will break 3 times :-(
, ?, ?" t, S, ]" l* c: |" M
; P% X7 |" o$ t) c0 d# D4 X-or (a bit) faster:
9 Z8 y6 b4 U, W- L4 b BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 l# h7 O) G. `8 \7 ~
* k. ?( `4 Q, F1 C4 z; _ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 x3 @8 k. t( O- J. ^5 k
;will break 3 times :-(2 o) ^4 D9 d) o5 v
/ r5 A( w% q- g. f0 c+ h" v8 W2 _
-Much faster:
9 G4 o0 E- ?+ `0 L BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& s1 j. `1 T' ~9 _" Q
0 G. z! U) V g/ DNote also that some programs (like AZPR3.00) use de old 16-bit _lopen5 d) ~" f( |# \
function to do the same job:' x& o8 C+ \9 Z/ C1 r$ r
" O/ w6 k8 Z1 w7 g' f
push 00 ; OF_READ6 x; U4 J. T8 Y# G# i, U x
mov eax,[00656634] ; '\\.\SICE',0
7 P3 E* b, l. I% n# A8 d push eax! I: }) Z/ r# q7 ^& v5 O
call KERNEL32!_lopen
, z. @" I9 _6 x2 a. _' F# D inc eax
; W3 C# {% {8 h( T% Z* ~0 u- T jnz 00650589 ; detected. j: P6 _" `# j0 ?* u
push 00 ; OF_READ
% c/ O$ c# @5 O4 C* f4 ^% T6 H+ Z3 N mov eax,[00656638] ; '\\.\SICE'
, d6 Y* v7 ~. {+ W7 c( S push eax/ G* Q3 p3 ? \2 b# C
call KERNEL32!_lopen
$ ~* T! o. g. F) C% ?; X6 x inc eax
: l( N3 u7 g" d& m/ J% m" ^ jz 006505ae ; not detected. F. i' D3 m8 a1 P
8 F: R4 O8 P, i% Q
% [* o M% N( d# J3 E0 e1 B* Z
__________________________________________________________________________+ V! L7 G" Y$ s
. K7 n9 P. X: S+ o) ~Method 12: A2 X4 I1 G" l8 c5 `
=========
, o y9 u ?. K( X( V) A4 U5 `5 V! Y& S3 @
This trick is similar to int41h/4fh Debugger installation check (code 05
. O" P, J' K3 [& t2 d& 06) but very limited because it's only available for Win95/98 (not NT)
/ t9 A2 i7 p7 }- o8 xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.* s( |. k( t% X# C9 y
. i3 G' K9 Z6 H0 [ p, z" w1 O
push 0000004fh ; function 4fh
P! b" k% x2 m) Y push 002a002ah ; high word specifies which VxD (VWIN32)
' z L, m$ V6 Z7 p* C! x2 k ]- g ; low word specifies which service
. v! _* m+ u2 o2 x% h/ H (VWIN32_Int41Dispatch)0 W% s9 l3 r2 Y' l
call Kernel32!ORD_001 ; VxdCall8 [' x( a/ y5 b, h5 o
cmp ax, 0f386h ; magic number returned by system debuggers7 _7 O: g/ L4 d
jz SoftICE_detected
7 Z8 P0 h5 K0 G) @& K# v7 z; t, ?* i/ V$ a
Here again, several ways to detect it:) X8 F/ ?% Y! ~2 o, _8 ]& {* z
`2 J4 w+ M: W3 \, ~6 {
BPINT 41 if ax==4f
3 z, p5 |2 }$ w2 |2 V0 ?" Y3 D: |4 W
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 [! C5 ]8 x+ S% j* _# e3 L9 X# M8 b) l0 y. B0 g$ ^! X* i
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 B. a" a/ @3 V/ ?8 o( Z# [- o5 r$ U3 ]4 S- u7 R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ x4 ^2 R) Q d( D4 h) M& g' V. r
__________________________________________________________________________3 [$ t5 h4 {8 p) p/ c4 M3 g# q1 s
, ^0 A1 O0 ]& U8 C- @( R' ^
Method 134 \& n N5 u7 N H
=========. r' T9 {- N7 A$ m
0 W0 H* d5 ^7 j8 [. `Not a real method of detection, but a good way to know if SoftICE is& [9 i' c7 o" n) F& d; }
installed on a computer and to locate its installation directory.
9 P% o+ N" Q2 ^% \. Y- JIt is used by few softs which access the following registry keys (usually #2) :
( s( S3 E: Y$ f9 @3 F$ @0 G1 o5 W( z e: K# M
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' H/ R: R8 N+ p3 l" k+ e
\Uninstall\SoftICE9 Y0 j- N9 E3 D) c4 q' a, y( {
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* ]9 j# _. T/ r: [-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 R$ P/ Q! m% t5 p( E\App Paths\Loader32.Exe
+ o- X* F- p3 r, p3 v; g0 X; j9 [$ W! Y2 z% H9 C
8 t6 e* j5 y3 @$ N x9 ?! ENote that some nasty apps could then erase all files from SoftICE directory
' v2 W/ d& s0 P% d- A1 }8 H0 R(I faced that once :-(
* K4 |8 O6 w7 q7 f) T
8 _7 R; H9 \9 @9 f8 O FUseful breakpoint to detect it:) X! q v! z2 h# t
! \; d( e1 }3 r/ e# P% d- F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ e( Q( Q0 w2 e! i0 t5 R( M1 G$ q) b7 j) U) ^, j& n* Y
__________________________________________________________________________
, _/ E9 ~8 h* H
5 k2 u1 U% f. M8 \* |" a& ~3 B) e
6 X/ B/ }$ n+ r" vMethod 14 0 j; [6 P, b( G* }+ ]/ w) i) y
=========: d `' N% e* K" D
+ g- B/ j: l4 ?9 e8 e& eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- w: M& D+ @$ \is to determines whether a debugger is running on your system (ring0 only).
# j- [! {: d2 Y2 g% n( h
- c. ]$ \- q# a" A0 v9 s, O( B VMMCall Test_Debug_Installed
: o0 J; [: y7 [' [ K je not_installed( J. M1 @+ D' {1 e$ M' B3 K0 r
7 P$ I- p- C$ @" W( a( g
This service just checks a flag.
5 Y" \) P; j5 X1 I- R</PRE></TD></TR></TBODY></TABLE> |