<TABLE width=500>
& a- k: l. Z' ]- @2 C2 a<TBODY>5 h( J& \8 D$ m: x
<TR>& f1 m+ |$ q `- A5 f* M
<TD><PRE>Method 01 " @7 P* M$ i i' E* E
=========
7 }! w- s; m x" R) A" y
! ]: F, \; v( ?% mThis method of detection of SoftICE (as well as the following one) is" @$ ^5 V. v6 y
used by the majority of packers/encryptors found on Internet.
; {0 y F% D; B0 W( L+ @$ I iIt seeks the signature of BoundsChecker in SoftICE- |( K8 D2 ~# f& ?1 B; a$ k* p. S
M1 S% q Y, U mov ebp, 04243484Bh ; 'BCHK'
/ @1 A( I8 I" J' U$ q. g mov ax, 04h1 ~ e9 w& ~( F2 n/ T
int 3 & K- d2 f+ G8 F* D, a6 f
cmp al,40 Y4 S, _, E" ]/ N
jnz SoftICE_Detected+ i5 t6 [# b; i4 `
" z1 M- e9 F5 z0 `7 c/ t0 R) Z___________________________________________________________________________
2 M9 n6 x- P9 m8 b, p6 L; N3 t; L- U1 b7 T
Method 025 Y+ L$ l h: q& a: M( ]
=========
, x) @9 p- E+ A @ Y9 ?, a; T) e3 i7 E0 n) U
Still a method very much used (perhaps the most frequent one). It is used* @+ z a+ ?3 c" H/ O. u ?
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 ?8 a" M' B# p( [ e
or execute SoftICE commands...
1 ]: ^/ K! v$ }' L3 ]2 PIt is also used to crash SoftICE and to force it to execute any commands
5 F \& u8 b; s+ ?, d2 m(HBOOT...) :-(( 3 S+ ~5 T% H. _
( }/ p `/ m8 F H7 c! ?0 mHere is a quick description:$ \# V2 K' ^: S
-AX = 0910h (Display string in SIce windows)
& o9 [1 O! i- K-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, }4 P5 B3 F, f( d3 b& l3 h& J-AX = 0912h (Get breakpoint infos)
9 C6 X) e$ B% C4 m) v-AX = 0913h (Set Sice breakpoints)
4 p6 ?& S7 e( D* [% Q, o-AX = 0914h (Remove SIce breakoints)
2 f$ W) y$ @! Z3 F
9 B% H- N: M( S& F! U, yEach time you'll meet this trick, you'll see:
4 _2 }7 \. i1 o5 t-SI = 4647h
2 ~- O: P/ t& i! C& T( U+ Z-DI = 4A4Dh U/ O- m0 r! g5 y. x) z
Which are the 'magic values' used by SoftIce.1 U/ U [& v" Z+ p6 ]4 s
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.( R8 q) |3 Q/ m# e/ C) c
3 ]) l8 B* s8 \Here is one example from the file "Haspinst.exe" which is the dongle HASP
8 S5 m' [7 L+ u1 X! Q: ~Envelope utility use to protect DOS applications:
( Q2 ^; Y. c* w+ W) ?3 U5 D1 L# g+ w' ~* M) ^, K: M
8 E* t* j: u) X4C19:0095 MOV AX,0911 ; execute command.& M6 m' ]0 d7 S$ J
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). z9 Q4 ^9 t6 s% E
4C19:009A MOV SI,4647 ; 1st magic value.$ \3 m3 r0 L0 V
4C19:009D MOV DI,4A4D ; 2nd magic value.
( }' a* h! }; N" y: W3 T( T$ h6 I4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ d# _9 q, u+ ?7 |! H. ]
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
% E% x/ _; H& R& b' O" Y4C19:00A4 INC CX
( ?9 l) Z' e# |0 e) w- E, w/ D4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ r5 X6 _( D% S9 q p
4C19:00A8 JB 0095 ; 6 different commands./ G) H+ I) s& i/ U
4C19:00AA JMP 0002 ; Bad_Guy jmp back. L0 d' v$ _. Y2 a" \
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 T4 W9 Y4 l! ^$ W- E
! x3 r/ y5 O- Z( t3 Q1 q2 hThe program will execute 6 different SIce commands located at ds:dx, which
! a' ]- w3 z: h5 d ^. k9 c& ~. c2 Care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.. s% [9 ^+ j2 L: U
, \/ i! m% A& m n4 f& X
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* _/ k" V& D9 J! P___________________________________________________________________________
$ k: r5 k. y& p/ j5 ?# }- W/ i8 z2 C/ t: z' y A7 C
, v/ {7 |5 F V0 cMethod 033 j& O6 O/ b/ ^( v% E0 \+ X8 M$ {
=========
; v; B. r$ G- _ Y D: t# n! K+ _; h4 s# X4 \3 L4 A* |7 z Y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 @. b1 x! B* I- a
(API Get entry point)
, K2 `8 T6 J6 I6 R, T % s d, K8 t* ~( p9 k9 T0 |' Y) e
$ z6 O& N j. S' j4 n9 F
xor di,di
+ F# U* w; O0 | mov es,di$ T; s* t9 I+ E, a# D; |- B& x* ?
mov ax, 1684h
4 F3 M; v r. G& b& O1 L5 m W6 a mov bx, 0202h ; VxD ID of winice1 H) J2 S: K! q0 Z
int 2Fh- Z$ U! V" ^6 j" Q0 C
mov ax, es ; ES:DI -> VxD API entry point* N" U7 I' _& S: f# ?7 l
add ax, di! W7 k) m0 D; ?8 }1 k" K/ x
test ax,ax
- _9 N: f/ R1 |/ r2 V, W jnz SoftICE_Detected
' D$ j( I& F0 P$ U4 e8 B1 B8 N0 H
; {& q; c9 y. Q, @2 M3 P: m___________________________________________________________________________
! k$ f) [5 U9 `1 A" v! y- L1 V, Y2 o3 Z4 V# W- M, `
Method 04
0 F3 J% R4 K9 A* Q) X G- z- k=========
: F! E; j0 ?" N1 v# }* P7 S
, ?% X: w! k* tMethod identical to the preceding one except that it seeks the ID of SoftICE
; Z3 @8 L0 h( {- m- r/ zGFX VxD.
% Y- y3 o" f$ A3 g( y, M- m
1 v7 W8 m4 N5 `. Z3 T' o xor di,di
7 a: e) _' d0 z8 ^! N6 F8 B mov es,di- B: U" @5 V5 _& y
mov ax, 1684h
; f" w/ x3 ]' ], [, W1 m0 T mov bx, 7a5Fh ; VxD ID of SIWVID+ D% \7 M8 E# F8 v# Q
int 2fh* F' m4 h6 @& ]
mov ax, es ; ES:DI -> VxD API entry point
% b3 m! c& K+ P: H5 z9 @ add ax, di
8 w% f4 |: Z, ~( @4 J) H" S test ax,ax2 j8 [. h( o' ^5 G: c
jnz SoftICE_Detected, A ?8 w7 R/ p6 c. N+ B3 N7 o# o
! _! t* i1 J3 |) T4 F
__________________________________________________________________________
( c6 F+ v% [2 x4 D
9 T( t1 L# ^+ |- H- l6 O
2 T. ]. h! O ^" L+ f3 ?( Z. n" {, WMethod 05
, {* Z; ~. B3 g# t=========
. O& ?) z+ @1 |" P K) | U& ~; t2 T* u+ Y8 Q
Method seeking the 'magic number' 0F386h returned (in ax) by all system
* {% v0 ~- C% g& \. Edebugger. It calls the int 41h, function 4Fh.
5 y, _) {2 _' v! F+ UThere are several alternatives.
7 u5 V% b2 U, ?1 p1 J: k8 w
* ^+ z& E4 v% i( S' _' MThe following one is the simplest:
8 a. ]8 Y$ V, c0 e: V1 a
6 s! m4 w- C: a2 f% w6 d o mov ax,4fh; q* B! y& F8 n, p" x' m" ]' k
int 41h
' o# [0 u9 {- C/ [" A' S% F cmp ax, 0F386
' G/ I; p. H( K2 K' |% m/ Z jz SoftICE_detected
; L& O6 z& o+ r6 J2 V* X5 d6 Z9 B& L6 Z% w( `& h
+ m- B! q/ g: j
Next method as well as the following one are 2 examples from Stone's ( ~- U8 @+ x, d. O, F. g' v
"stn-wid.zip" (www.cracking.net):
8 s1 z2 q8 H/ e' c3 f; W/ S/ ], y% B- D5 t7 P" U
mov bx, cs
$ Z% \; _7 A$ x, } {3 b lea dx, int41handler2
; b; ~5 F+ Z4 u7 @8 f xchg dx, es:[41h*4]4 L' v; k3 H0 y4 l% Y
xchg bx, es:[41h*4+2]3 x7 A* n! g( H+ ]) K ^8 B6 S( E
mov ax,4fh8 B8 i* r6 a" v$ ^
int 41h2 `" ~( O2 F" ]* w% J' [
xchg dx, es:[41h*4]6 @; k. Y6 n" k4 T ^! H
xchg bx, es:[41h*4+2]
! e. x. W4 A8 d3 ^/ K cmp ax, 0f386h* S) F8 ?+ S( B3 S" l
jz SoftICE_detected) h }! E4 J- u' B' H& @
) I5 d1 I! A0 _: J, K: gint41handler2 PROC a0 r" G+ v9 r+ _, w3 H7 l: [2 q
iret
9 S8 z7 B$ k1 ^4 Z* Q5 W+ Fint41handler2 ENDP
& M" l; ^; x) M7 ]$ [+ P' c/ \
3 d+ Z- ]& Y9 s8 ~; @& k9 X* D U$ d1 k) ~# D: [. V. U
_________________________________________________________________________
; C% b9 w- e3 q6 m/ ?
! [- Z1 T+ e! ?3 c1 O8 h: \; S7 |
1 \ n6 \( G; \1 @0 uMethod 06
4 [. W6 H4 Q6 e/ X% k; H. {9 a=========
9 ]6 Y& L# O/ C7 s U5 ~9 v8 b; O4 v% j; r3 i
3 q. Q( U. E) C1 v- v& F" D( c
2nd method similar to the preceding one but more difficult to detect:* g5 O3 ? f" A* M: `, [
1 _; r' L( ~* l1 E
' q* z2 o( u# h% t( i/ Vint41handler PROC
2 |1 s! h+ { Z" ^" | mov cl,al
& Q8 T3 P+ H; N& _$ c iret+ x' C& P1 u2 D/ A; `
int41handler ENDP
& k+ @ Y+ H3 V$ Q+ k" L& X' r* N$ x: E& m
9 I- e- m/ N, b) O) i5 ^. Q+ j
xor ax,ax
7 p( o7 f# Y2 K! m% [ mov es,ax! ^7 J8 H2 M7 w# _" h3 V
mov bx, cs
* \2 X! K& h1 X! E5 O( z/ S9 y" S lea dx, int41handler
, F2 g5 E& ^+ |3 _ xchg dx, es:[41h*4]
8 K3 a+ [- ?$ I8 V! t: R xchg bx, es:[41h*4+2]
+ j! R- t2 C: N, I( L. r0 k$ a) M in al, 40h; c- Y9 ~/ Q0 {# Z+ T
xor cx,cx
0 [7 x @; ~, j H1 u' _ int 41h6 Y' o: h2 ^' ~. i/ W! Q1 w/ m
xchg dx, es:[41h*4]. U1 Z g! C' p" i: `8 g
xchg bx, es:[41h*4+2]
X8 k5 R0 L$ B% `2 s cmp cl,al9 B5 B7 R. M9 o
jnz SoftICE_detected0 q) h. n+ O" u4 }- B8 K3 f1 k
7 t. t) a, X# {1 m r. w
_________________________________________________________________________# D2 e# b8 o3 v d' [
: b2 W( V, x8 b: N- s, uMethod 07% \5 w( B3 ]: _# a/ ~ k2 F
=========
1 h- M$ E8 y# q$ J+ N: ~( O9 p% u, E: [$ w1 m
Method of detection of the WinICE handler in the int68h (V86)
: {: r& l' i3 ~( X) E: }
5 ~# V! p0 [% @ mov ah,43h4 |! A* q) }* ]# \
int 68h
8 u6 m3 ^( p: ]6 C; E/ F" d0 P cmp ax,0F386h
5 ]" X0 \# \0 ~# k& @& D1 H jz SoftICE_Detected" T- L$ K+ p3 f
# O- m1 Y2 l8 @ c( M$ y. J7 s3 K) h: R+ e7 z) d6 Z$ K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 ^( |# @; [0 R app like this:
" w4 S r. Q. j- x! _
" N3 B+ ?* r$ t BPX exec_int if ax==68. q& M. R @* U
(function called is located at byte ptr [ebp+1Dh] and client eip is
: h" }- @) S1 k( V located at [ebp+48h] for 32Bit apps): f9 i# ~2 Q2 N/ s9 {8 G: I
__________________________________________________________________________- V+ r& g3 x5 R9 t
5 P7 n5 O+ x4 H3 e" \& q) G5 E6 @( F" l7 F8 ^3 g) x
Method 08. k9 m, k8 k! G5 M* a. b3 u
=========- Y1 s+ _) q- ]9 W* f" `
' F/ w3 q+ n8 q8 Y& o, fIt is not a method of detection of SoftICE but a possibility to crash the( I- A' y* Z5 _$ [( e! b* M1 n
system by intercepting int 01h and int 03h and redirecting them to another6 r% ~7 t$ m0 U! C d. G: E9 T# M
routine.
6 {8 n, ], ?/ {' Z+ q }It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
* I" q% A' s5 Vto the new routine to execute (hangs computer...)) ?4 D0 L3 Q# I$ O/ X: i
3 Y2 e! h+ j* G+ A
mov ah, 25h
6 U6 `/ D3 l$ K) R. y/ T mov al, Int_Number (01h or 03h)
" n! O, G6 w; K: ?* R7 q. |, h mov dx, offset New_Int_Routine$ S7 x) ^/ ?" P3 _' K
int 21h. W: A5 R; c* f4 B- t4 X2 s
/ R2 C+ G3 I, W" \) j" i__________________________________________________________________________
. R' i& H# f) W8 }% |) Z; B8 L1 |( X5 U# Q( X% ^' D8 L
Method 09
/ }- d0 I2 B+ d8 J9 S=========6 |$ Z, k W5 R7 ~: d
/ q! }" [0 J! E+ U; t. s6 T# l
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: F, h% \' I" Qperformed in ring0 (VxD or a ring3 app using the VxdCall).
( A; T6 z# Y) Y& q) ]5 g& BThe Get_DDB service is used to determine whether or not a VxD is installed
' J1 J+ Q, Z: y- K& _& hfor the specified device and returns a Device Description Block (in ecx) for7 `7 U) G# I2 C* q) S5 f! n
that device if it is installed.: U6 h7 d( j9 @
9 r9 @# o, `( |) l
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- ]1 M/ k, ?0 j- J2 Y) ?/ M mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), H2 C2 A5 J' l! P9 a& P) z
VMMCall Get_DDB& w7 [7 O* V/ N* C# H1 L, m
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) o3 y1 ^) M- K3 t8 t
+ X8 D9 v! L2 s* gNote as well that you can easily detect this method with SoftICE:. }3 G+ ? i# {& J/ J- e+ D
bpx Get_DDB if ax==0202 || ax==7a5fh
- k! C: F; s2 ?( r* c0 ~) o% s& S$ Q i1 M5 i% f7 ?5 n9 ~
__________________________________________________________________________
. a9 |* b* b1 @8 r2 }; A4 H. B2 N7 z5 ~% N
Method 10) z# d' e# Y7 t; Y3 u- R- @# j# m* q: R
=========
9 J | C' G, t$ B0 C* S8 P: N: u! Y: y+ j Y0 h: m; a" v3 F
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ k M t9 A. n& Y3 i$ d' e
SoftICE while the option is enable!!
K' o$ X: m* a& g6 [) A b% D& L ?# K( F% N! |# |3 i2 p2 u
This trick is very efficient:, L) G3 w* N' ~5 E
by checking the Debug Registers, you can detect if SoftICE is loaded# G3 O: s n7 F% ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: i. z' Q0 Z0 d' qthere are some memory breakpoints set (dr0 to dr3) simply by reading their! K$ r5 `2 j, J) Q8 t
value (in ring0 only). Values can be manipulated and or changed as well+ c% c/ U% a( h4 V w2 ?
(clearing BPMs for instance)( Q& f, X% K: N3 I% F- u! ?
" G* A4 c. L- \__________________________________________________________________________
$ c7 A6 _& `' Z) l4 {2 s& d( J. \" `& ^( E2 \
Method 118 F O' k {" F4 l- E9 U
========= B q) k D( N
. G4 H: M$ v: Y8 E! p+ P# ~This method is most known as 'MeltICE' because it has been freely distributed, @* C: [$ Y: W+ E* q' u
via www.winfiles.com. However it was first used by NuMega people to allow9 j p( g: r2 A8 }
Symbol Loader to check if SoftICE was active or not (the code is located
1 e) S0 c- v- v0 C9 Z) m$ g& Ginside nmtrans.dll).
5 S* E/ m9 E/ L
$ Q2 |/ _' e' N& v* z% j) Q* jThe way it works is very simple:6 c1 {- M0 C n5 j8 R0 Z) X
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ b) j8 V/ n0 y* r
WinNT) with the CreateFileA API.
/ M5 L, T, ^7 Y; K: k: w# h$ N0 M( a
Here is a sample (checking for 'SICE'):/ [9 ?9 W) G7 J% |+ f# }7 }' q' H9 x: q) V
0 ]- c/ ], N. M4 ~: N+ g
BOOL IsSoftIce95Loaded()
9 z) t2 u# e/ l0 L" [{
. y. D8 |( D* q6 F8 l HANDLE hFile; 6 O8 a& {$ r; [
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," m- L7 ]/ a9 r
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 B; w& f# o) b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ e# ~: \1 r {( A- P/ ~- P if( hFile != INVALID_HANDLE_VALUE )
3 `9 @. W- \' o {# H% K. Z3 O8 B3 `4 D
CloseHandle(hFile);8 F# z% ^6 f2 _0 e2 z7 h
return TRUE;2 n) K0 d7 t$ d8 d& V8 M
}6 `% G, Z X, T8 Q6 @ f! l
return FALSE;
& d2 W a& h3 e7 B" K}
3 b& H4 [ ?/ D7 V6 {8 m$ F4 d% Z
* P5 G8 t4 q/ v( lAlthough this trick calls the CreateFileA function, don't even expect to be6 K! w6 H4 D) z- b# K
able to intercept it by installing a IFS hook: it will not work, no way!; P8 t& y1 v9 o. ~; F
In fact, after the call to CreateFileA it will get through VWIN32 0x001F, _/ y6 e4 F# [0 L- a
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ T7 i( Q' P8 a6 x; b0 |- {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc W9 T! q8 P+ O( q$ B' q+ A, a5 x
field.
# L5 P+ q$ ?/ x5 Y4 v9 kIn fact, its purpose is not to load/unload VxDs but only to send a ( r' @( [* j8 W6 a$ g3 v0 |; a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 i9 P# r/ Z) Y0 p' r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 W/ K) O: H3 ito load/unload a non-dynamically loadable driver such as SoftICE ;-).# K1 }! }/ X# j7 p& e; X
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 t F3 ^% P: Y/ p8 s6 k# `7 A
its handle to be opened and then, will be detected.+ }3 C( e* K' t) L9 K7 H2 _3 Y; s
You can check that simply by hooking Winice.exe control proc entry point
" a! I) Z1 N$ I3 m) m4 ~. m( Bwhile running MeltICE.1 S) h7 y H& a! ~# V
1 h. Q% M5 ~ a2 J5 x. X) P5 i. J) H: V2 N# A1 |: d' L
00401067: push 00402025 ; \\.\SICE+ u- C3 T/ L2 ?8 _6 e2 _: s
0040106C: call CreateFileA
5 ^: H9 Y5 h: y$ D* g! ^ 00401071: cmp eax,-001& ]' x3 q& d; d, J4 X$ ~+ b
00401074: je 00401091
% w$ K: e: H/ _( s5 W7 s; {
( W/ O& J: l2 v1 T S" W! h7 T0 p% Q
There could be hundreds of BPX you could use to detect this trick.. I- ~% [3 o/ a: C; S# v
-The most classical one is:' \1 ]0 J" Z6 `1 J) i6 X8 ]; L8 A: b
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- W' |7 w) Z3 c6 l7 W *(esp->4+4)=='NTIC'8 U5 C* n8 t% K/ I
2 H' M; z- O) T6 K- ~: o
-The most exotic ones (could be very slooooow :-(
6 H; {* h9 r; ^) R+ v BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 l) @: C% q' K# j3 r; a, \
;will break 3 times :-( d% N7 ]! P8 d( G
, Z% r+ T; `& g- ~4 `9 a T-or (a bit) faster:
+ x( s+ I0 s* ?/ G# Z7 H- T% W, G BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ ], u1 ^* J1 X+ @( X6 B+ F6 m( r- A( U3 T$ o2 I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% }+ k! ]5 K+ M. O; c2 H# L) U ;will break 3 times :-(0 G: Z6 H x. q5 [ v
! g0 O/ j: S# y-Much faster:
/ e7 o9 u5 q# @4 h0 q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) B& c. M! P: w [7 D5 Q, V* C4 f" u9 V" W' e: m$ w% Z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 f' b1 K6 n4 n8 Hfunction to do the same job:
, @5 `7 v4 R8 O. k7 {. A$ l1 [5 C* a+ g' a" P- d) E4 t5 g
push 00 ; OF_READ* n+ u% v; ?, m4 N6 q) j
mov eax,[00656634] ; '\\.\SICE',0
2 \" e+ q, v5 t push eax
+ f0 ?9 x* b9 y& q call KERNEL32!_lopen
( Q9 ]3 U9 \8 Y6 C inc eax
$ n+ e; X7 w7 ^) B0 {9 l) E8 K1 w jnz 00650589 ; detected2 n0 w' \2 w3 T6 [% }
push 00 ; OF_READ
! Q6 d- a2 E! y3 p3 y& D: e mov eax,[00656638] ; '\\.\SICE'
g# r, V& J" a3 | push eax# K" X# O) |9 Y# R0 }5 K
call KERNEL32!_lopen$ H2 a; Q+ e1 P1 J9 c
inc eax
+ G/ d2 }0 d! P7 h* ^: T jz 006505ae ; not detected! }4 F: u& ?1 K$ f: G" o3 H
, J8 E" \# D1 {) Q6 Z3 \
, S) p- K1 d3 A- `- c9 ?7 \__________________________________________________________________________
6 E" {* q; `6 ^$ ]3 Z0 o2 c6 H! `0 h
Method 120 j) K$ e! H% [
=========
9 q2 x; U X% q' R* W+ _/ k5 |, y2 D/ T7 }
This trick is similar to int41h/4fh Debugger installation check (code 058 `- Q6 d( } s. ]
& 06) but very limited because it's only available for Win95/98 (not NT)
- r: H. C( }9 {& m. a5 Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 ^- v& g1 e4 p$ S, U& r0 s% ]+ N h# ~: T3 l) }& G
push 0000004fh ; function 4fh
9 m$ K& R! N6 U! W. c push 002a002ah ; high word specifies which VxD (VWIN32)
4 P* B G+ Y, G- H; u" I ; low word specifies which service
@% G9 u& ^5 c0 @3 A (VWIN32_Int41Dispatch)3 O( J7 q, Q* @# y q1 y" a
call Kernel32!ORD_001 ; VxdCall
- \ x$ _. t7 V cmp ax, 0f386h ; magic number returned by system debuggers3 r7 M ^6 ]5 |' l( W* e
jz SoftICE_detected
* w) k! D l& K2 ]
2 _1 n, s3 R! R- NHere again, several ways to detect it:
0 ^+ C" R1 V, Q4 f9 B. r, b; q0 l9 j" J! I3 T% g* n: H) I7 R
BPINT 41 if ax==4f
' Y& N! v6 U$ l' l( c/ J9 X
7 Q) i# u* {, C; ?' Q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
3 p. a: J/ C( `# l
& |) z, h6 V7 U* s/ p/ b BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) ^2 g3 Q \$ a: s' @* s+ B7 d
. ^% a( c8 e( a; }9 j" r; P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
l Y: F3 n) s* o* m1 Y5 H! T, E M, Q" R7 m J- u
__________________________________________________________________________" [# D* M1 L. ?6 E8 V0 A
2 Y1 _8 b. N9 {# X" [/ l8 K. N
Method 13
5 b* y* P0 h! m8 [. C6 H=========) N1 x2 b3 w/ u, q2 S
, {# j, |9 V I2 c* VNot a real method of detection, but a good way to know if SoftICE is* y( g& q& E" R* T' G3 a: ]
installed on a computer and to locate its installation directory./ P3 t5 p" H- f' n
It is used by few softs which access the following registry keys (usually #2) :0 M5 e/ i8 A% c% M7 t
: w$ g, {/ Z/ q$ I+ s* X" Y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 G! {. q% G! r/ ~5 W$ d* U
\Uninstall\SoftICE
! C1 X$ _: D4 @6 ~$ G- c-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- E. K7 \% V" F% r3 i
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 L7 r9 g! g+ j* T! U4 F& I\App Paths\Loader32.Exe
3 I% M& ]6 A8 k7 _! F4 d; E8 O$ c; x& O5 N
8 |8 A/ M4 D% D) B M! P5 w
Note that some nasty apps could then erase all files from SoftICE directory
z2 D' X' _( N! v' l(I faced that once :-( L% l4 g+ X n* n
- X0 s. Q! f9 b$ ^3 p
Useful breakpoint to detect it:
6 j' x7 D/ p" a, Z6 ]2 X% ^
/ y8 i6 D- a+ T. v) ^+ J3 K" _( e BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
- {% O" Y! [ W# Y8 U& b' F8 F0 \; l9 m1 P& U
__________________________________________________________________________+ h+ H8 \. d/ ]
( }! }: C, s- x1 Y7 w
+ u5 A7 W" `5 v% [Method 14 $ A2 `8 `2 e( d$ K* G' h/ u
=========1 c# V2 L! l. [5 J" c, M( }5 ]: W' E
. Z! Q# |6 c2 U
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 K" {* e" }0 L9 d8 a
is to determines whether a debugger is running on your system (ring0 only).6 ]2 V! R# @# r5 x
1 t2 b$ K' C/ g
VMMCall Test_Debug_Installed* E L+ I: ~) U. C, N% Q
je not_installed% ^- u0 u2 e* c7 [' H
* K$ r' J; D- A$ y/ ZThis service just checks a flag.- \2 J0 d& U; v; c! M4 c, Q- f
</PRE></TD></TR></TBODY></TABLE> |