<TABLE width=500>$ P4 y8 z4 q8 a/ @
<TBODY>6 i U$ ?' n' |+ |. X
<TR># x) L* N0 t9 u7 n
<TD><PRE>Method 01
# o7 u, u& C% L/ u5 E=========
% @# h! u- _' k" O# h |; n1 ]2 i4 h+ A- I+ b+ X e. V4 w
This method of detection of SoftICE (as well as the following one) is
, X" {$ ^: S6 r9 o; D; xused by the majority of packers/encryptors found on Internet.
" c0 m7 I R/ T, ?# `" t% r2 XIt seeks the signature of BoundsChecker in SoftICE- |0 \8 J1 l: C8 X* J6 c }
: O* `$ R- f) x% h: V5 d mov ebp, 04243484Bh ; 'BCHK'
' Z+ k& h, b( r7 [ mov ax, 04h, C) B; m% k$ e
int 3 # k5 I8 G) ~. Z9 |. x* a& J
cmp al,4
" Z- p2 k+ _2 z* J& [8 x, _ jnz SoftICE_Detected
j$ R5 H* X+ |4 n0 J
4 L, f; d1 N/ ~/ I$ b___________________________________________________________________________ x2 v* m3 A# j4 f0 q' E
0 s; g& b; P1 ~1 b
Method 02
$ v7 u; ~- Q# `. S+ {=========+ d( C1 P2 r: V+ I2 O% z4 \
$ K) M$ E D- @1 e* O$ L, {9 e4 V
Still a method very much used (perhaps the most frequent one). It is used4 z/ F: e7 w% O5 o' r
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 @& B3 @' N6 ?
or execute SoftICE commands... A+ l; d! O" ~) g
It is also used to crash SoftICE and to force it to execute any commands0 E: }' I. j6 k& n6 x- k7 k! L
(HBOOT...) :-((
+ `! G0 v) n1 k1 q4 j0 Y; R3 K4 Y% M; C
Here is a quick description:
; `1 I% |. z. s$ q-AX = 0910h (Display string in SIce windows)
, T9 `' X6 f2 V9 ?* j8 z- o-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& r/ N+ k; t" m8 c& n-AX = 0912h (Get breakpoint infos)
8 X( s6 Q3 \3 @$ j7 [' |$ x1 w$ m-AX = 0913h (Set Sice breakpoints)) x; E z4 ~ \) n0 d4 Y9 K7 y
-AX = 0914h (Remove SIce breakoints)1 ?2 U. r: l6 h& n3 _
/ d; r7 j% ^- J$ r3 w8 tEach time you'll meet this trick, you'll see:$ ]/ v% ^% i- X/ E
-SI = 4647h: U# f4 `- p. L( F, E, a C
-DI = 4A4Dh) D2 ]: d% @# @5 w* g+ L" P `
Which are the 'magic values' used by SoftIce.
2 ?& d2 X8 P: w+ J+ h# oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h./ p6 i3 w: ~. i- A
9 V4 {6 o4 w1 v- n4 m) ~: u
Here is one example from the file "Haspinst.exe" which is the dongle HASP. h& g5 I. ]; K. ~
Envelope utility use to protect DOS applications:6 r/ H# P# B, P: c* B' h' L
* A# L& O( Y& w7 _' C- V( k
* w: T0 Q4 q& }$ t# ?! t
4C19:0095 MOV AX,0911 ; execute command.
4 ^8 W0 K. B. u5 M! ^4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 J- Z7 u% d! X# |' X; e9 R2 L. F0 z4C19:009A MOV SI,4647 ; 1st magic value.
3 S0 X. }+ y5 _' {7 N/ s2 `& L, i4C19:009D MOV DI,4A4D ; 2nd magic value.+ \$ u9 u" v- \; F
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 @* h4 T+ G$ w: V5 m2 ]1 q* [4 I+ z+ x4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute, t" h. X3 {) B+ g x
4C19:00A4 INC CX
' g* A% H" t, [* a& u4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! ~( G$ b- H, m) c- m( e9 `7 j4C19:00A8 JB 0095 ; 6 different commands.1 F$ r9 u" F2 }$ ~2 o9 y8 E! N/ C
4C19:00AA JMP 0002 ; Bad_Guy jmp back.# b7 k1 E5 g; ^4 F% |8 a- ^4 I
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( D5 J3 b- I; y( ~: y# k9 e. D( L# u9 g- }+ F
The program will execute 6 different SIce commands located at ds:dx, which
5 G+ r- G* o( i3 f" _are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! [* |& X( I M0 s' f1 e0 Z" }
' R+ A9 z0 G! W5 x- f" j! }" K* Y
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' O4 g$ f5 C) @0 Z( Z5 R2 Y& F
___________________________________________________________________________
) U- u4 ~, f2 A) q; Q( }; Y
Z# o" J2 j0 V: A3 d, \7 ~" t5 U, p6 x
Method 03
- y4 L9 ^9 _" N+ q5 u=========
2 F( |6 q4 `1 q. b6 S, |/ i* g) M# D+ } h, s$ m! r
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ h& w! d, B3 U ? b( r/ ]
(API Get entry point)
# c6 |, }9 {9 l3 p
0 k% G2 y! r' i, Y* J+ I1 _ A; i) o* V+ `; C# z& w% `; E
xor di,di
% l6 ]/ w, ?# w7 M# v mov es,di
6 S% K' Z, t( |& K* @& y* [$ {7 g+ ` mov ax, 1684h
* z" Q" h& Q0 ^1 G+ n( R5 l( m, B7 A1 k mov bx, 0202h ; VxD ID of winice4 Q4 {6 X0 M! }- l0 N3 _* M+ k
int 2Fh1 o; a! B; @" S( z
mov ax, es ; ES:DI -> VxD API entry point( O- @3 a j! h. T
add ax, di V$ T3 k+ e9 E; z1 ]1 B" ]' J; c6 z
test ax,ax# k q/ A0 |' @4 d
jnz SoftICE_Detected
- V# E3 j0 [% {6 B" {
' u9 H* v) z& p. ^: q___________________________________________________________________________6 D6 Z/ C: D( K$ v4 \$ I: ^
3 p1 C$ m7 b# G) jMethod 046 n7 U2 S3 ?6 r5 {; r7 E
=========1 ~& q7 P/ p: j8 @: Z! M3 u' W
s& R8 m1 ~% u4 `
Method identical to the preceding one except that it seeks the ID of SoftICE. M6 b* _5 F* d) S& i# H
GFX VxD.
/ Y: Z7 r0 B6 ]/ @6 I* e" _; s9 H+ c3 b$ ?! x' f/ G0 ~
xor di,di- m3 z/ u( o# B. z2 F1 \. @1 K
mov es,di
# F8 b5 x+ }+ Y, \% m/ [ mov ax, 1684h
; I# h$ v' |+ h3 W& Q mov bx, 7a5Fh ; VxD ID of SIWVID# a) s" A# O$ i- T1 `- D
int 2fh r+ [8 R8 ~+ b" B( K+ u5 s
mov ax, es ; ES:DI -> VxD API entry point
& t1 C! c$ [1 T" Y' `: m6 f add ax, di
5 c% F' t" w9 r' q% `* R# @ I' x test ax,ax
6 |1 K0 z: n0 `+ H, r: W jnz SoftICE_Detected5 V1 ~7 B5 f3 b/ |8 O; J% s; R
; `. X; g- ~4 W4 X__________________________________________________________________________* H$ j4 O; g' ?: n0 U* q
1 D4 ^3 X& ]. \3 r, q1 j d* T' r$ t* O$ L$ Q
Method 05
& P; Y- F. T% L, y1 ]& O6 l=========1 @* K0 t; |# r; p7 y- L
4 q: m w5 n7 Q) R4 C) k
Method seeking the 'magic number' 0F386h returned (in ax) by all system
! R0 l+ M# K, ^2 ?* H4 cdebugger. It calls the int 41h, function 4Fh.- N8 X% R, _* w9 W9 k! f! S( V
There are several alternatives. . a9 J4 v/ X; \) j4 K
, M9 d. o# S( y, T) v) d- A qThe following one is the simplest:+ q" S0 N7 t0 F8 [
Y1 D6 e9 j3 Z3 K
mov ax,4fh
; { Y' J, S% f int 41h
/ j1 Q) L) h. j1 V cmp ax, 0F386. t5 n, v0 b1 D
jz SoftICE_detected- D5 |' y+ X9 F6 ]4 V' q
! ^6 ?) r3 l1 {2 R3 q
, `+ c( E h3 P; u: p$ ?
Next method as well as the following one are 2 examples from Stone's
8 ?2 c6 \$ I# ]2 H"stn-wid.zip" (www.cracking.net):
2 [/ P0 U s: q: d# \3 F
) a: I' S2 V* S8 I, w1 X mov bx, cs
/ s) M3 R# D8 Q. B1 J# \ lea dx, int41handler2
/ j4 f6 A# Y2 e1 z' I: ` xchg dx, es:[41h*4]
; P0 V' p6 m0 ^1 Q9 d xchg bx, es:[41h*4+2]
: e2 O/ J4 K1 t& R6 E mov ax,4fh. A6 V$ e; H. n( O5 f e6 n: m: Q
int 41h4 t& s# Q5 |! Z1 X% G
xchg dx, es:[41h*4]
* ^$ b( a$ s) G: D' i2 O xchg bx, es:[41h*4+2]
8 f% A% L6 w9 n: X( d cmp ax, 0f386h
; j- ^( D6 _$ k/ X jz SoftICE_detected y, \# L0 }1 |) }6 N. t
. j3 V# b8 n- O7 v7 c
int41handler2 PROC2 m5 ]( j* {7 r) r2 {: Y& ^9 w
iret
1 L: D, z+ \9 l5 M/ t: U$ [6 Jint41handler2 ENDP- b, P |- I4 A ]. X& u
4 f" i. Y' v6 a" Q0 d) Y; E
5 o0 r* n: o6 P. Y_________________________________________________________________________
3 D7 K/ s6 {+ M- @6 Z6 Y( x
& |- r1 M. c+ }% e. Z
; ?8 a6 j y$ [0 F1 L5 l2 WMethod 06
& K l: ~6 _# f1 r- z3 K; _=========
- Z. d- p0 |1 R, N9 O. U5 C' a7 s5 V* D7 Z4 }
4 v, j( h7 C; H: h+ \2nd method similar to the preceding one but more difficult to detect:
* _) |: x# G' S, \1 M' p$ m9 W
- ?/ W5 ]9 F% N) A8 K$ y
/ l3 I4 U0 F, {. [1 T5 |int41handler PROC
( E, ?4 t/ l) @0 S2 _# i0 R mov cl,al
4 X+ _0 P/ v( a iret# p* A& a+ O3 w/ F/ g3 ~: }# w
int41handler ENDP
0 I5 d, X- B% B6 T# ?* ?" m8 ^, h. Q
7 [ W: V- } S! q
xor ax,ax
* |+ {! r$ @9 j' S mov es,ax: }3 e1 T! l5 w$ `( M
mov bx, cs/ I6 Y" u% \/ H- t
lea dx, int41handler0 A6 X o2 t# L( [
xchg dx, es:[41h*4]
$ f. p& i3 B* Y. f' n# e xchg bx, es:[41h*4+2]
: Y( M3 T( W3 V8 c0 V in al, 40h$ r9 ~( G: U D
xor cx,cx+ z/ ^- O! F! W8 G' j3 S
int 41h" `0 b7 w) L+ Q( [& V* h
xchg dx, es:[41h*4]' ]2 T8 O5 W2 h/ R4 [
xchg bx, es:[41h*4+2]) |. b3 a! x, g/ U
cmp cl,al9 T+ c; Z7 a3 `2 g# A
jnz SoftICE_detected
$ z/ K; U1 M& D9 X9 K- ]
( q0 D. O0 T8 \6 ^( o; n( ?" E_________________________________________________________________________. v; q$ G- {, P$ k3 v/ @5 X
" l" N, y8 n7 O, Z$ T' t4 aMethod 07
8 Y/ I+ h" y/ c G* u2 l) h' h=========
$ {; z: R( h0 H3 X8 l3 b+ E2 F$ b* S+ |, f& k0 L! h
Method of detection of the WinICE handler in the int68h (V86)+ ?) `1 V3 N9 w4 v7 m
6 C# P# M! @* Y: Z: k' K: ~ mov ah,43h
" h" K- y6 J9 X+ u f int 68h
- D" ~6 R9 Q4 ~% Y% ` cmp ax,0F386h
7 K$ B5 w! v1 T jz SoftICE_Detected
4 U* A5 Z# u( n$ p6 c: e& N9 c/ Q3 v: u- R& r. f3 w6 |
/ u: X8 Q5 B$ N: r% c; p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( ?4 h9 ^4 l4 z; i) J! O( Q app like this:" E" s7 T0 e# T* R. Y
; H; m7 T6 `. T% p( t& i) \/ G
BPX exec_int if ax==68
: }& Z+ S/ B: p+ ^8 T0 n (function called is located at byte ptr [ebp+1Dh] and client eip is
% @9 y( t7 g7 Q: V* U located at [ebp+48h] for 32Bit apps)* R8 S' H+ z0 A5 q
__________________________________________________________________________) C3 _2 @" W, x+ r' X/ l6 M- b5 q. v
0 A, K- M% @ l" z4 g0 D# J
. e9 L5 x5 \3 t( D2 r4 j
Method 08; x1 a- U6 ]5 J
=========4 K9 d3 V) j2 m2 B) R. q+ o& S
) G. d7 H+ r S% YIt is not a method of detection of SoftICE but a possibility to crash the) m+ J) m9 S6 v7 ?- Q2 o: S
system by intercepting int 01h and int 03h and redirecting them to another
, M+ I+ h' ^- ]3 t$ \! S3 K) Jroutine.2 e( e; U y$ A) W3 J9 E
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 G1 N/ @+ P: _" S5 A9 sto the new routine to execute (hangs computer...)1 r9 K! n, b* C" v! [
' ^8 l) F' g& I1 d/ _
mov ah, 25h U8 p' _, u/ t6 L, j, ^: y
mov al, Int_Number (01h or 03h)' c3 f& f. X9 P
mov dx, offset New_Int_Routine7 q' J/ _# m% t3 }' B @* [) ^+ f
int 21h
: _1 r' T$ ^* Y' c" \6 q& P8 T- ^# ~/ j3 _ z# t
__________________________________________________________________________
! t+ e- x0 L; a' V- k5 ^' O5 \) o# B7 B3 R! a5 h1 b+ V5 V/ M: |# p: G
Method 093 }4 @; ^, W, P, |3 R# n
=========4 [7 o4 }. x# L! R+ Q( x8 r
" x: {. b- S- m OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only l8 v! C6 A! n# ?; D7 D. D
performed in ring0 (VxD or a ring3 app using the VxdCall).
! |/ r9 Y8 |% R. O3 _7 R1 tThe Get_DDB service is used to determine whether or not a VxD is installed. V R' t7 b {4 d" J0 F" ?
for the specified device and returns a Device Description Block (in ecx) for
1 r* i1 o& i( u3 }; f+ ?- ithat device if it is installed.0 w3 N0 w; L* b7 `
7 l% g9 X( w- D' r mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 z. q6 x7 I' V4 X' Y- X% w
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). u; m! U& P! p8 V6 r" E5 o7 x5 c
VMMCall Get_DDB/ e; D! s1 n4 s8 {$ J4 a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ [; r$ _; P$ W% E+ T! V4 P8 ~4 M4 f
Note as well that you can easily detect this method with SoftICE:$ e, C* T- _. D3 }- q
bpx Get_DDB if ax==0202 || ax==7a5fh: _. S5 u5 {, S; w# ]# h. {
8 S. J5 j7 \$ l3 U; K8 \ T__________________________________________________________________________% b; o2 [* N. z; `
1 W* A1 `$ ]7 e* t2 C- l1 u" UMethod 10* d6 O' ^ G6 d1 q; ]
=========9 M. @3 n4 Q+ Y
; z7 T- i8 [; N; e8 a4 p W1 O
=>Disable or clear breakpoints before using this feature. DO NOT trace with+ x( K; S6 K4 w+ ~. ?
SoftICE while the option is enable!!
: s9 q. e8 S" u2 W* _$ R) W$ S: |0 g( U$ C+ y) ^6 W% K
This trick is very efficient:
5 M+ a9 J, d1 b* `by checking the Debug Registers, you can detect if SoftICE is loaded, G& k) `2 ~2 C/ S# v) V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ x7 ]$ `( @% ~) X0 q. X, t
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 Y1 k+ C" R/ rvalue (in ring0 only). Values can be manipulated and or changed as well) r5 O4 Z0 ?) h6 [* w9 v# Z. W" A
(clearing BPMs for instance)
3 A9 ?; I3 `$ p( {" D# N* y
# B9 }, o3 G3 c O__________________________________________________________________________
0 u1 \( w: n& J- I0 o3 K' a! ?1 k* ^ e6 R
Method 11
: M, J9 Z0 g9 ?, D6 V0 M9 i/ P+ ^=========
5 w$ A9 L2 J$ ]) z* z! S9 D. B1 x* i9 \( s0 }# f: \# E
This method is most known as 'MeltICE' because it has been freely distributed( e2 {- `' h( U5 e$ l% ^
via www.winfiles.com. However it was first used by NuMega people to allow. D! ]! b b) e/ h) d
Symbol Loader to check if SoftICE was active or not (the code is located
$ y5 R7 {2 `; ?inside nmtrans.dll).1 b2 a& U/ j# \4 E
3 O: ?/ _& h9 N4 `; d% lThe way it works is very simple:" `/ L( s1 V, S1 ?9 A4 ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ ]$ T9 j3 D G$ wWinNT) with the CreateFileA API.9 W8 s0 Q. D, _( [
, a ]: I5 n* [* {
Here is a sample (checking for 'SICE'):% E8 V' t' p3 f3 d3 F
8 C7 o+ c% ]+ A& f) n4 d$ P! ~0 h
BOOL IsSoftIce95Loaded()
# ^2 X' K5 P8 f5 A' `/ C. R0 f* V{
4 h- W& x( |$ L4 w( f- h HANDLE hFile; ! A. h5 s$ f/ }2 O& V( U7 z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 |( d9 ?' U: m# `0 Y+ b3 P! U
FILE_SHARE_READ | FILE_SHARE_WRITE,0 Z& q# k6 K. \# z. j1 k
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ m6 V' n: [# N* r/ I6 g) V/ w
if( hFile != INVALID_HANDLE_VALUE )) b, i1 b2 F2 v3 _- {) g
{
5 u/ {# V8 G( V9 h9 V; M CloseHandle(hFile);$ j3 ~6 @9 a0 V5 ~
return TRUE;
( y" U+ f" p0 S6 b- c }
- X: p2 q. O, R. S; O$ a return FALSE;
6 O( u: r8 Y+ D; {}
$ c/ d; t, m( u0 q; ?- }' ]3 n" X0 Y* p
Although this trick calls the CreateFileA function, don't even expect to be# H" I- |+ {) x1 M7 C' L
able to intercept it by installing a IFS hook: it will not work, no way!
A$ f' r+ I' _, I, LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
# c: l' o0 u% A, }service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 t# t) ^! {/ R* I3 P+ d6 `' J, t3 N# Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
' o( R# l, J7 x$ I& F7 ^9 z6 t2 ?field.
0 [8 F' `6 B2 VIn fact, its purpose is not to load/unload VxDs but only to send a 1 M% I% l) v8 `! ^6 r7 A/ r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 _/ j( L6 i0 m3 @! J$ z8 Sto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: k' k! D: r( X0 Wto load/unload a non-dynamically loadable driver such as SoftICE ;-).* N# M. C. b0 C
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 V e- L9 J/ @, ]6 I$ Cits handle to be opened and then, will be detected.
2 x0 y S8 n& t. y% }You can check that simply by hooking Winice.exe control proc entry point
) d0 K! e, Z5 Z. R6 p( [: F" pwhile running MeltICE.2 g' S/ x# s/ }) V. j
) g3 O7 p9 p! I
% B! W- Z) |0 t$ ] 00401067: push 00402025 ; \\.\SICE9 i2 \1 D- U# r- H1 y
0040106C: call CreateFileA$ E. c+ z! }( U& g7 L* {0 p( ^
00401071: cmp eax,-001
8 B9 P0 P* U0 c4 {7 [! m 00401074: je 00401091
$ k9 K/ P, D/ t' d* r/ I L1 T
& p. j$ G$ S& I& a7 V. t# G# D9 e* E
There could be hundreds of BPX you could use to detect this trick.
0 Q0 R2 d( G. B% T w3 ?& c9 @-The most classical one is:8 u3 r8 d, t1 `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* b+ n( f- a/ J% M+ Z5 n
*(esp->4+4)=='NTIC'" E: y! \/ ~% n9 ~% i" S% {
5 j7 N/ F! Y$ t" a+ E) d& H-The most exotic ones (could be very slooooow :-(, v! N* x, j/ F* ^) n- @' r" }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ _# r* E( K3 y0 T4 b2 N ;will break 3 times :-(0 [" ~2 E$ H8 ~; c6 ^& [& A
( c0 F: T% |3 `2 R, _8 n$ ?
-or (a bit) faster:
" ?$ E5 _6 {& T* t* m9 @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* b9 I+ P) s! m i* X, j, t Z
9 a% P/ a" n, | C3 n+ T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . L9 L) t9 B8 ?$ P6 d0 n
;will break 3 times :-(
7 h$ i8 Y, B- P5 D' q! N( u" o' n7 }# u9 }5 }
-Much faster:
+ d- l; }+ {& e BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" ?0 h/ U: ~+ }3 K; {5 U
. I* ^4 J7 r/ v6 _
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 k8 X+ ^% x* j
function to do the same job:
0 B5 X( Q5 j) h. K
- {: @, G/ e7 J+ _/ t+ j: S2 o push 00 ; OF_READ( K6 o$ h! F) D' u" }% F& M$ Y
mov eax,[00656634] ; '\\.\SICE',0
' y/ M& S! t2 R push eax
1 B) H% W4 l! H. Q: K2 m4 i# l call KERNEL32!_lopen
. _! r9 c9 ]! y; t1 @& V9 q" z inc eax
: f3 r! C5 }4 C* D jnz 00650589 ; detected5 J r! I6 h1 Y) K# B4 f- \
push 00 ; OF_READ
" e; Q4 U s8 p; ]1 W7 s mov eax,[00656638] ; '\\.\SICE'
' X% Q' u0 N1 d8 ]9 c' b8 c2 k push eax
- _' R! h& x6 I3 e1 [- ^/ `- V; K3 N call KERNEL32!_lopen R3 ]! n# E3 d4 g" Y: r
inc eax
8 W, B* X# {" p8 O! `! S jz 006505ae ; not detected0 k# m8 p& ~6 \$ X5 ? U- Y `8 P
, b: B: q2 R; S Q+ ]. \
* z0 D4 U; E# P9 q__________________________________________________________________________' H# w- Y4 ~. t% J
% h( a2 Z( G) n/ V1 O/ hMethod 12" d# u8 e. D( U# N- q. K
=========4 U+ C2 s3 q4 l9 J* B/ ?
3 w- I0 n; u1 n F. p# k
This trick is similar to int41h/4fh Debugger installation check (code 05) j* |) W( C. W1 q1 e5 J
& 06) but very limited because it's only available for Win95/98 (not NT), m; o& d% `5 h U& o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, Q- Y( a+ z) T0 A4 b
+ m) z: k9 r7 w$ f3 l4 O; Q' V4 x push 0000004fh ; function 4fh
! }+ s5 J- n8 e. r) F. L e push 002a002ah ; high word specifies which VxD (VWIN32) \7 z8 A/ ]2 d1 T8 O9 j; V
; low word specifies which service
, u F- I% i! n8 l7 q (VWIN32_Int41Dispatch)3 T' r1 d: _) Z4 I- J. J
call Kernel32!ORD_001 ; VxdCall. k! J F- K4 T Y( h: E* [# V% v1 y
cmp ax, 0f386h ; magic number returned by system debuggers
5 k! m, U- Y/ g8 a; ^* A jz SoftICE_detected* T2 W# `" I; O) o) s
`8 p* r6 A8 F# M* h* UHere again, several ways to detect it:
: T6 u* g9 j' C% e# B
5 ~6 O9 W0 p3 A" E) J5 s BPINT 41 if ax==4f+ a1 Z0 B/ f% |) ?3 W8 J8 {& E& p8 O
& P* j1 N/ H; z! \# g* q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
( y, l5 {$ a, D6 _+ R6 x2 A7 A
: v3 a q' I2 S2 X+ d( q BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 Q3 {: `2 y$ P7 v
" R/ Z- {# j: K) `* g7 }/ F |5 L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
K& h% \# z! Z' z' R/ t& ^9 ^. P3 w- y {$ a
__________________________________________________________________________
3 m0 Z" j. q9 |6 w
3 X t$ ^/ p7 e: a" [Method 133 _& t' V/ g, b
=========' s+ i" B+ c+ F0 R# x
: Y9 r- Z9 o9 R2 N
Not a real method of detection, but a good way to know if SoftICE is
: r4 H! V$ H* E [& B5 Minstalled on a computer and to locate its installation directory.0 ]. B/ w; ?2 p7 L6 @% X9 E
It is used by few softs which access the following registry keys (usually #2) :( W" b, h) p: Q2 q5 S8 a
+ b! j) G9 }6 i1 n, A! |% W; _
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; R! L7 N3 d1 H0 Z! Q0 g) T( U
\Uninstall\SoftICE- B8 b% o, p {5 r# S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. i6 J3 V+ U! k- m0 S9 [-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 M2 ^. e$ T8 p4 T) x% x$ ?9 z* l
\App Paths\Loader32.Exe% \. |& j; P: N1 `9 }8 C9 A0 W
* G+ [3 R- t: W) K, [9 c4 K1 T2 M7 T5 a& |
Note that some nasty apps could then erase all files from SoftICE directory3 \6 s4 M' n0 s1 y2 a
(I faced that once :-(
! O3 ^ D2 }$ Z+ Q) o' L: ]. w; H- Z9 Y' S( x
Useful breakpoint to detect it:
; j' }- ~& F; @! T% ^# F. Z* t. c: y) V0 m
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
9 h3 G% E0 Y$ T7 F
! p0 ^2 L% p, o/ Y/ D__________________________________________________________________________4 X. m/ \* X# w; E
; C( H4 V7 U3 q0 e8 L! p
4 Y- n$ d5 G9 z. o, J2 F' v# M- kMethod 14
% N9 g4 F; a3 b& t' q=========
# {- S( d- L X2 a
. [( W6 U8 e7 o5 B; _3 fA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. T/ a* A# S$ L: J _is to determines whether a debugger is running on your system (ring0 only).( L" L: [3 v5 @4 ~- R
* _8 t; f6 |! S$ h, v2 Y
VMMCall Test_Debug_Installed- {* l, M# }0 o8 K0 j
je not_installed) @# U) s& i; @- E$ j4 O6 a# {/ X
( Z3 G8 a3 `" h& JThis service just checks a flag.
! k6 L2 e5 K0 ]' \# g( F</PRE></TD></TR></TBODY></TABLE> |