<TABLE width=500>
: p, R9 p2 m9 o" W4 ]<TBODY>5 F( p& ~& ~0 |8 `+ y# O
<TR>3 r5 _$ H5 m+ o& O3 `4 q$ u) W( o
<TD><PRE>Method 01
6 W# s5 K( [- J=========6 W L1 U: C, H3 t% w8 R
# x; `8 m1 e% ^& h; v5 ^! f/ \
This method of detection of SoftICE (as well as the following one) is! V3 t' R9 i9 V: a
used by the majority of packers/encryptors found on Internet.+ _7 U1 ~# w, N6 r5 c
It seeks the signature of BoundsChecker in SoftICE( t3 F( N* ~) X
# w% ^+ A( G- s3 l8 ]" A
mov ebp, 04243484Bh ; 'BCHK'& F5 w: q4 c' r/ g; I
mov ax, 04h i2 {' N( O( n, b& G" g8 [4 j
int 3
4 l9 H- _- n( V5 z9 r cmp al,4
7 V! ?& U! Q3 k* ]' J; L* z. M jnz SoftICE_Detected
1 W/ f- q! f+ |4 H3 W- e& ^0 @# Y6 t5 A8 v1 r6 A
___________________________________________________________________________, q8 t0 T9 D& B) L: f
8 ?$ u, T, l! m$ g# bMethod 027 |% r* V% G; A% ^9 }9 ^; L
=========
1 {5 x- v" B6 G, ?* K" ?7 X+ w" q! `2 N5 U% H6 I
Still a method very much used (perhaps the most frequent one). It is used2 _! G5 s# S+ o/ T' T: C7 {
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
l' l% D# J* s2 tor execute SoftICE commands...
+ h6 C8 n4 }5 p5 Y: T) F/ wIt is also used to crash SoftICE and to force it to execute any commands0 |# b3 X6 c& E% v, _
(HBOOT...) :-((
4 M1 i |5 U2 W: f0 G6 U t3 L: ~3 [8 j! a+ G
Here is a quick description:
& i% Y7 J& l8 D1 B-AX = 0910h (Display string in SIce windows)4 r6 ]* B6 H2 N4 ]- Y* o
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 i) ^( t2 i( l3 |# ]( d3 p) `- T, c-AX = 0912h (Get breakpoint infos)
0 B5 r6 @, u2 [( l# |7 Z( i-AX = 0913h (Set Sice breakpoints)& F5 t( f, F8 d4 p
-AX = 0914h (Remove SIce breakoints), {5 J+ B) n0 Y: r$ p
! Y- n/ d w: ~ TEach time you'll meet this trick, you'll see:, R" j% M) t4 ?/ ~
-SI = 4647h+ D/ p* t8 ]3 V4 _& m% m( Y
-DI = 4A4Dh8 G6 [- ], M" ?# c _- ]& L
Which are the 'magic values' used by SoftIce.9 C+ [; C" `8 e! A* \4 Z
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 H" Q9 V% e$ O$ r0 L. d+ u* k# A: r
Here is one example from the file "Haspinst.exe" which is the dongle HASP4 ] i7 }% x3 W
Envelope utility use to protect DOS applications:' o+ ~" t4 x& t% `1 ~' M% _
( ]9 O' E# s. U* z$ E; ?9 x ~2 C5 w+ ]
4C19:0095 MOV AX,0911 ; execute command.8 x$ d% m7 N8 e+ t( f' {, w
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) N; k- C J2 L2 n% o4C19:009A MOV SI,4647 ; 1st magic value.
5 v s S( y- z2 _4C19:009D MOV DI,4A4D ; 2nd magic value.
5 C9 g2 U7 C6 L) _. V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& m' u9 c/ b/ o6 g/ S5 Q& b
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 N0 l2 r7 A. }. f5 v
4C19:00A4 INC CX
, m$ P* W2 F8 f9 z4 F( a4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ J& g' h; _9 s4C19:00A8 JB 0095 ; 6 different commands." D5 O! S" f9 d6 Y0 ^0 w: G) t
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 \) G4 E v# m4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 m: y# l! v8 Q3 v% l- `
* W1 K% x5 p2 C. Z; V0 X! }0 W
The program will execute 6 different SIce commands located at ds:dx, which. t. J) y- r5 Q1 ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 L; i8 |) V5 o f, ?0 r. C$ v+ R" [% R6 z( L
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.9 }# _" Q8 J" [0 M
___________________________________________________________________________1 B4 S+ l. m% \* i4 E" `
$ l2 f; t( o3 l% r3 C
2 P3 _& b5 i! \# ~9 Y2 C9 mMethod 03; X( a1 E4 R8 Z& v+ W
=========
# m9 |% R" V8 U! e+ q
/ q/ L# O: d) c0 w& h* E4 t+ m% BLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) T& K( F8 ~8 C
(API Get entry point)# D4 @+ l% V4 \: }
, y! {7 n4 A1 Q0 m9 C/ j$ S3 q6 b% Z' o, `9 {1 I- J' O9 y
xor di,di6 x* ?6 S" W& p# y1 n0 z9 `
mov es,di
& N3 ^$ c& e- u mov ax, 1684h
- h, q; N( J" b. b, ` mov bx, 0202h ; VxD ID of winice1 _* u) N/ I5 C6 @' W4 \7 w
int 2Fh
% |/ P. e$ T, q# G mov ax, es ; ES:DI -> VxD API entry point
1 c$ ?; r$ |, X: L: e add ax, di
! e! i4 d! Q: B test ax,ax3 I2 n! j# p0 O7 o
jnz SoftICE_Detected2 V9 q% ]& q G& V9 `: C" R
6 z( Y( N/ f1 {0 b, b+ y( y( `+ v
___________________________________________________________________________
$ f: L8 u8 x) Z; A7 I+ D
# x9 C) |9 V# B- X; z QMethod 04# ]4 Q& p, @. \0 P! M. G$ X: W) E
=========/ M) v0 z# ^% n8 g' H
- O7 ]# y" i& ?3 MMethod identical to the preceding one except that it seeks the ID of SoftICE
* A+ d& j( A# EGFX VxD.9 ^) M8 g6 s; I2 x
) U& `5 p$ z+ v9 I7 H3 w& b& F xor di,di4 [2 Y/ @8 H s1 E) n1 J( X, h
mov es,di9 w9 i; n, ^5 b
mov ax, 1684h 3 w, s- F A' H: d7 W; q5 B- u4 h
mov bx, 7a5Fh ; VxD ID of SIWVID. e! g3 t. s3 o. Y+ T
int 2fh
2 z; L. G U! {' w2 X mov ax, es ; ES:DI -> VxD API entry point
- k- K$ q3 ?, P$ Q0 K add ax, di
6 b0 q' O. \' q/ ~, F7 u. } test ax,ax
" k, E6 i7 r4 W jnz SoftICE_Detected0 g' X+ o; {% A G/ n( C# l
5 `$ @: g% e* J1 b
__________________________________________________________________________8 d& Q5 U! S! p2 a/ S2 d. U0 Y8 s
) |6 \8 Y2 o! g2 T/ K7 g; |
0 X- F' N9 D+ V9 m2 X( bMethod 05
& t) A: A9 p& f2 i. c. b=========
2 r6 ?9 Q; d% r8 I6 b: d
& M" r0 J7 i( @" A- {Method seeking the 'magic number' 0F386h returned (in ax) by all system' `" c& ]/ `0 K# |5 U
debugger. It calls the int 41h, function 4Fh.. P$ }! E. S4 ?
There are several alternatives. : T8 P( o3 ?- Q
, _5 k/ a. A# J" K4 j: e+ x
The following one is the simplest:3 ]! ^5 m1 ]" y; y( s
' ]6 m: W+ x% M9 } mov ax,4fh
& v* K! H) p( m1 w5 x- [0 d int 41h
0 R4 C! O. \8 } cmp ax, 0F386, [' o f0 U6 T# T, u
jz SoftICE_detected
; A( E1 r( z, C' `5 ~* d0 h/ S" p0 a& `; B# l) r
8 u7 h- t `9 ^( L% \( g) H$ E# iNext method as well as the following one are 2 examples from Stone's
8 i/ p( f- ]8 D+ |: k, ~6 D"stn-wid.zip" (www.cracking.net):
4 [5 Q. B' K& S B
) `- C& Y. f. ]; ~- |& G: f4 V' H mov bx, cs
' B2 p2 e3 s7 s/ ~0 I/ ~ lea dx, int41handler2
. Y: F, @3 C2 A8 ]9 x T. H9 B% ] xchg dx, es:[41h*4]8 A: B/ x; c$ s/ N' ]
xchg bx, es:[41h*4+2]
% }" ]2 D% t! t# G mov ax,4fh
. m0 |) ]1 q8 h0 W9 V% \2 i int 41h
! f: c7 f' |* k9 c xchg dx, es:[41h*4]
" @' u# I% J' h& r( w xchg bx, es:[41h*4+2]$ k5 ]0 p4 J0 h; e6 o( B6 B
cmp ax, 0f386h- A3 [! {6 \8 h7 w) {3 c
jz SoftICE_detected
2 {, ~5 @, e5 O2 k$ p0 q
6 J$ S1 A. f$ u' k1 q5 X: Hint41handler2 PROC- T' H( P% e9 Q' A
iret5 F a$ [- l9 j
int41handler2 ENDP
c0 Q9 f* y9 @0 w
8 P$ m% X# c7 H+ s" {) @2 F8 l
2 G3 `, i/ ~9 s$ O; N_________________________________________________________________________
2 `) R- t* `( E0 v; C
3 ]! Z& D& v+ b+ G% L6 S% W2 j7 u4 ]2 y/ I( ~
Method 06
* U$ z4 [1 Z: G+ h0 W1 a2 y3 z+ h=========
9 W$ l1 E; [1 V' J' Z
- [7 y# t8 u% q3 D, b( J: k% {2 N% Q- E
2nd method similar to the preceding one but more difficult to detect:
0 c4 q) S! n& r% Y) C
% k% e3 e2 Y6 N* v8 u- D
4 D0 j4 {7 g( O; x) Rint41handler PROC
6 i: j! n2 T% j# \3 z4 v H mov cl,al
, }; N; E6 R( B4 \- h* J- f iret
6 E0 ?7 d) y% ` g3 cint41handler ENDP
: Q- m: ?5 [5 z0 D$ V2 |, @" G* a1 z+ T* c8 {8 h
& {* D" |; {" e xor ax,ax9 c$ E: P4 c% C! ^1 y& c
mov es,ax! |# M$ Q% _2 D$ e) u- j
mov bx, cs D. e7 o; `5 r$ K
lea dx, int41handler0 H' `6 f1 p" U8 u5 h. f* Z
xchg dx, es:[41h*4]/ t& ?) ]8 Q' `# j1 B
xchg bx, es:[41h*4+2]
3 d$ `1 |/ Y% N in al, 40h
, B* Y- _( K0 U xor cx,cx
* l/ t1 [7 R% f+ } int 41h
4 D% n+ s' ^- m, e6 B& U! a xchg dx, es:[41h*4]6 u9 H& F* W& {" b2 Y
xchg bx, es:[41h*4+2]9 M8 m V& n, g+ \- U/ x
cmp cl,al
3 V6 C7 H; f+ ~9 A0 B jnz SoftICE_detected
) w$ o+ P* o" [# V' K- Y, K/ m. u
_________________________________________________________________________, o W( l/ h) O. p. Q2 b4 O
$ s2 T6 s V) N' {+ X+ H" ?- t, v
Method 07
3 {. m. O) I4 c _8 ^=========7 Y1 k: D7 ?: [. s8 C
% ^9 H& R1 B' HMethod of detection of the WinICE handler in the int68h (V86)( I! O$ Q3 @5 N7 F/ s& G! a$ f. a
6 S/ x% B, J1 |0 T6 ]0 B4 z
mov ah,43h
$ Z( G; x* \0 H6 `' P& a- ~ int 68h
8 @5 w' ?+ d4 I8 a; J) W cmp ax,0F386h" }, I& g# [1 x4 M% |3 Z$ e$ D
jz SoftICE_Detected2 A! d3 N3 G9 P& D; w8 m
* H8 P" H0 f# y w5 j$ n
! L' F7 s# t$ g: d. r=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: @( ^$ n' A0 u0 Q: K( P0 @' q app like this:
; ]: H- I; `8 V& O4 p) r6 Y% p& t# B) s: l B e
BPX exec_int if ax==68
; w! k& Y1 w+ T5 [2 n9 M (function called is located at byte ptr [ebp+1Dh] and client eip is
/ |! k5 C$ k5 t6 P! T) }; Q located at [ebp+48h] for 32Bit apps)
2 w0 c2 H" v( u( |2 m! v- F& z. W# U__________________________________________________________________________, z, g& S& H( x4 q
& n. E- w) W* P, p% S
2 w" A& ?% J5 `& `
Method 088 R% g# Q0 z/ g4 |! v
=========
- n( |0 P5 O5 P- o7 ?% u* ~+ m& t8 r1 z8 N4 m
It is not a method of detection of SoftICE but a possibility to crash the
. ~$ D0 Q0 Y# g; \; z& S" W6 qsystem by intercepting int 01h and int 03h and redirecting them to another8 g' n( z9 T' Q0 ^
routine.
; y% G9 O+ G) UIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
}. ]( |: C4 Z% j. C9 O: Cto the new routine to execute (hangs computer...)
" _+ f0 q4 `4 x3 K0 z5 _! H' `, `' K& q
mov ah, 25h
4 _& ~6 L6 T9 | mov al, Int_Number (01h or 03h)8 p: K; r: `" g* A
mov dx, offset New_Int_Routine
9 L( \4 s4 \. @9 j( j) J" W4 q int 21h
: \3 x' ]$ o! `' l' l: V- s: W! c. O0 a9 s; I& z
__________________________________________________________________________
4 |3 V6 f0 d4 \* f( U$ ]
8 |( G/ E* I/ { dMethod 09
% |' `2 \+ h- N: s/ H) X! X=========
* d# S" |, e. Z/ T7 n
2 V; F7 h0 g e, {( Q" Y! eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 `7 b7 D, Y$ j0 gperformed in ring0 (VxD or a ring3 app using the VxdCall).3 E& c: {, w" h" F0 P
The Get_DDB service is used to determine whether or not a VxD is installed
" c6 E, g! k5 \! f5 C q% e3 z5 f$ lfor the specified device and returns a Device Description Block (in ecx) for. E5 _5 X! S' R" b; W; T) r) \, ?
that device if it is installed.8 H2 I% r5 }1 R
0 Q7 A+ Z5 K- |# _: ^' u
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 [) f2 |( S/ \5 p, l' Z5 R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& S, P$ L3 {! H! J5 Z
VMMCall Get_DDB
`7 q- m4 |& h& ]* @ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 J% s$ u3 _- z
6 S$ W9 B8 G2 k( K
Note as well that you can easily detect this method with SoftICE:
6 V i ~9 @1 E( ]- k bpx Get_DDB if ax==0202 || ax==7a5fh
0 U5 k! W6 Z5 A' ?$ T1 S N2 O
/ D& k* r b* |4 I2 m__________________________________________________________________________
0 O- q! z% T# Y5 x" [# u7 U4 p) Y. p" x
Method 10
* V$ m" @- c# X4 X$ S6 Y=========& l+ A/ \/ D k% o0 o
6 ^1 s& a& i& v. r8 D' W& M5 |
=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ g# D, _; G$ k- D; v* V: n SoftICE while the option is enable!!3 q' F* g; I2 f
, T4 I" g" _" }4 o$ U% S
This trick is very efficient:- p# w2 J& w8 q' |2 I }! D" X
by checking the Debug Registers, you can detect if SoftICE is loaded) k* V6 ]3 X+ d2 A8 V' t* L+ Y- i; ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ a0 C+ U) `5 |$ d# N3 V, Dthere are some memory breakpoints set (dr0 to dr3) simply by reading their" y5 k( h' M& x/ W8 Y
value (in ring0 only). Values can be manipulated and or changed as well* P, r6 J8 y: `: e, m! M, Q
(clearing BPMs for instance)
) S, @. h R7 d6 \' _0 Q7 |: ?! H' ]: o) b* u
__________________________________________________________________________7 m! T' t/ x7 V
& ^ {3 O6 G3 c- y. M
Method 11
# i6 x. z) o9 n+ m% _=========( e7 E1 J6 y, K: Y
- y! m( i$ N7 D1 M! j) cThis method is most known as 'MeltICE' because it has been freely distributed
' W% ]% u8 Y4 n, J2 ]via www.winfiles.com. However it was first used by NuMega people to allow
1 \7 P9 \' \* e5 C2 i) _6 X% U- i pSymbol Loader to check if SoftICE was active or not (the code is located* ~0 I* W# Q* f: W+ ~( e1 _
inside nmtrans.dll).1 \3 Q3 D$ [# q, |" X/ D" C' l
2 _- t& z0 C( `, A4 q5 ^% s* B# yThe way it works is very simple:0 p* \8 I. J& m% u# u# |
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 s3 L! {8 i- d. r! t
WinNT) with the CreateFileA API.
) _8 d$ g2 L3 I0 I1 P4 L. S0 b, j x5 ?4 F% C4 n, H
Here is a sample (checking for 'SICE'):" d3 b6 ? }/ I# R9 k
* w n1 N/ ]( R8 G
BOOL IsSoftIce95Loaded()
% j& Y6 Q' l8 \% g{
* d; T* U& j7 s HANDLE hFile; ) s% Q/ J1 q2 O' g
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 ~, p3 t: L+ d5 N2 O; e$ K FILE_SHARE_READ | FILE_SHARE_WRITE,% A/ f$ b1 n0 W! s( [
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 U% @& F0 a$ C# K; ?
if( hFile != INVALID_HANDLE_VALUE )
0 h P1 V4 w, Q {! n- ?. C; d q! q) E, a
CloseHandle(hFile);2 t, _# q" y! s8 M
return TRUE;
2 C2 R1 A& D/ r! B1 B6 n }
2 J. m6 J1 m0 x1 J; \+ R2 d return FALSE;5 j3 b: e; E0 H; j6 K
}! z5 g5 D5 H% O& T; W+ W7 W
& B' e( a6 D) {6 _0 k9 D& n2 eAlthough this trick calls the CreateFileA function, don't even expect to be* ^9 ^7 Q; h6 j
able to intercept it by installing a IFS hook: it will not work, no way!
/ j4 Z5 {3 `7 Z% Q- @0 kIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; L$ R) F$ E7 o1 G3 K" z3 K
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- D8 o( ~5 a4 G2 A6 e) h1 x
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- N7 m) Z; r$ c0 `$ W% ]; u# Z
field.+ p. b; r" Q- P5 g/ F1 ^+ V
In fact, its purpose is not to load/unload VxDs but only to send a
$ `$ _( y5 V$ ^W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( E2 k! g( r/ v8 V# tto the VxD Control_Dispatch proc (how the hell a shareware soft could try( v t/ z6 h9 }2 F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 N& m9 ^9 P" r& ~, z) kIf the VxD is loaded, it will always clear eax and the Carry flag to allow8 G+ {2 E& L' Y- y. ]( _: R: g& X
its handle to be opened and then, will be detected.
% b4 D ~( l+ CYou can check that simply by hooking Winice.exe control proc entry point* Y9 z0 K# a$ B" j" p
while running MeltICE.
. y# u( M% d4 q3 L% Y
1 P3 i) U% V4 ?9 @# C# @
4 a8 H+ |3 t7 J1 A$ G 00401067: push 00402025 ; \\.\SICE
; |- }2 o8 g. H, X6 \$ ? 0040106C: call CreateFileA
$ \' J" Q; @8 a, _6 \ 00401071: cmp eax,-001; E( J: ?) p0 ]' U
00401074: je 00401091/ o! |- s$ Z% n1 D: [8 S8 ~+ I
/ e: ]* A3 Z6 [& s! U+ c8 ~# I0 r h# G' e. n5 |
There could be hundreds of BPX you could use to detect this trick.
( j9 G. N u: t, c6 W. |7 H& @-The most classical one is:8 v) N: Z% G( d, W4 A8 ]+ u& p
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: }$ f- x( I$ Z& a% x' R* C
*(esp->4+4)=='NTIC'+ e% i L6 \; \9 `# Y
( W9 U/ D; b+ [. L. `6 C n
-The most exotic ones (could be very slooooow :-($ e8 a. G+ Z8 A$ _1 R' E) y1 Z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( U, I. ^6 x% }7 _1 X" o+ @
;will break 3 times :-(2 j4 [7 I6 W' y, R9 J2 H
4 Q; U! ~" s. ~, t' `; V" E! E/ T
-or (a bit) faster: 1 _ X2 Y6 F% j q2 R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% T. K: V( S% x. `
% l) R9 H2 ~+ } {) v& B7 k BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' c- }. Y4 k! I! c4 Z+ K
;will break 3 times :-(& B/ r, l$ ?5 n ?3 \; T5 N
9 a8 w1 z8 I% u9 |; v& y9 G; N-Much faster:& _$ j' P7 K, x- h
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'% o2 ]( e% r( b0 o5 v i
4 n1 H* i$ q' KNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 q: _# v9 _3 Y) ]function to do the same job:
. k. C7 m8 Y4 Z S% t( q% l& U/ @% d
8 {8 \& J4 W7 Q/ q push 00 ; OF_READ
: o4 ]2 \) n, H) w mov eax,[00656634] ; '\\.\SICE',0
" y9 i( O8 k9 \ L push eax
: F6 K6 q5 E5 W call KERNEL32!_lopen, q+ z( ?/ A- \7 b# T4 t0 B, N
inc eax) v- G: G j5 u2 b: W, I4 ~( e
jnz 00650589 ; detected/ m8 }2 R ]' b3 V$ {% l: \
push 00 ; OF_READ2 F. e8 Q- ~( D' Q5 K
mov eax,[00656638] ; '\\.\SICE') ~9 I8 L' [ p; n( E- {) A2 C
push eax
3 v. g; r& h+ K4 [4 ^; U call KERNEL32!_lopen# |2 L9 u% ]4 i: n9 o
inc eax
: m- y# H# W( e" F. n, W8 n jz 006505ae ; not detected
) F, B/ a9 j" j9 C4 `* j5 l: T% O, B. Q. @ R) i9 Z' X8 S
% o+ p- H2 L5 L7 D* M9 P
__________________________________________________________________________
# z W8 S/ G! b% s: `, m
( I. N# L# S# _- @+ LMethod 12
5 [% |4 Y% Y2 a7 [% N' R=========6 B' M* s: }0 Z& e& K) R6 ~
3 U) d! d+ f8 K% g8 I7 x* d# ]/ [This trick is similar to int41h/4fh Debugger installation check (code 05
& H5 s0 T- h# v& T' K& 06) but very limited because it's only available for Win95/98 (not NT)4 U3 o/ e! ^( _' T) h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 c8 t# `: d- G/ e+ K
8 \) O6 v3 O9 Q- \# L! Z. L push 0000004fh ; function 4fh* R& b" w L% u, h
push 002a002ah ; high word specifies which VxD (VWIN32)0 O& Q5 M+ e% ^ E; {' Y% D! s
; low word specifies which service
% |7 Y9 b% f+ M9 J (VWIN32_Int41Dispatch); E$ Y3 F& x& F7 n
call Kernel32!ORD_001 ; VxdCall
) D: _+ t2 x/ o+ x: j; s& f cmp ax, 0f386h ; magic number returned by system debuggers. Y7 N* {' z4 |
jz SoftICE_detected
2 g3 Y) D# w9 z: }7 A$ X
. G5 e) I3 }; H; B% g2 u% T7 y- ]Here again, several ways to detect it:
% n9 V$ C. E) E `7 n( _4 ?7 x, r/ r& b/ d7 `# ^5 N
BPINT 41 if ax==4f/ g0 \- l# r0 h% b. ?0 W8 l# b* d; a' i
0 R; [8 C) F2 R& ~0 G2 w
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 R# Y8 F6 a# ~# }/ N8 D% @6 _4 c. u" p& ]1 Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; w) O* j' n. R6 ]( Q) m: V; f$ Y, u+ e' i, ^
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 u C- [* y" t1 S
J/ ~$ M; c# g- q__________________________________________________________________________
7 j; e8 W) E( s! @7 |
' E5 s7 P3 L* MMethod 13
7 m. W5 Q* \+ r0 U=========5 [( C7 i6 X9 s" p ^0 @6 |
$ M9 B. |9 Z, y; h' `Not a real method of detection, but a good way to know if SoftICE is8 J. L+ q* N% c' B5 Q/ k. q
installed on a computer and to locate its installation directory.! j1 k9 \/ Y2 k. v; `0 [# ?
It is used by few softs which access the following registry keys (usually #2) :5 l. J/ S( q0 x* z6 X( p% n% ^; q7 r" |
t8 l* }$ c+ n f* W-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" l q' V/ x1 d( c. D
\Uninstall\SoftICE
9 U( v5 W/ a2 Q" }+ h& h3 l; @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. e6 F, F C4 f8 v( g5 _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 H% q0 [: g B& U( X\App Paths\Loader32.Exe
: G4 \% X7 G+ M. ^9 {" H' w. h4 r! r
: ?( I7 p! W9 L* ]% E# h
Note that some nasty apps could then erase all files from SoftICE directory
2 j- k, v# g9 Z0 w( J(I faced that once :-(2 B: t1 i: a' G. D3 y9 h9 C4 I% ]
) k; }: R2 W( q+ `9 n. c
Useful breakpoint to detect it:
, d5 D, q+ d; I# C$ y# J8 P. I% l6 G4 {0 ?
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 E S: S7 I+ c& V2 A2 d9 x: }7 T
: b: g' \+ n9 s3 y' ^
__________________________________________________________________________# @ \- ]$ U% M+ S
9 z: q0 l) T& ]1 B4 y5 s f1 v7 C, m U. V" V. l9 S+ {* c2 C
Method 14
. y% m0 |: |# L8 K6 s=========# {+ Q2 S* w! A! O4 r% `: Y
O& R- l" r/ b3 VA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 Y8 n7 L& b' v, K
is to determines whether a debugger is running on your system (ring0 only).
) I* I. [" F; H0 v! U/ b% F' a+ ?
( C+ Y; p( Y$ g/ }: Q: n! b! a5 | VMMCall Test_Debug_Installed E5 P, \: X8 G3 R
je not_installed( |5 q! D% d- n' n$ x
A5 p* \4 z, U) C& i7 S+ g3 BThis service just checks a flag.
1 [7 Q' C- S% A) o& G9 U</PRE></TD></TR></TBODY></TABLE> |