<TABLE width=500>' U9 g! G j& P# |8 h4 N4 _
<TBODY>8 ]( R) I( m. v2 V/ b% L
<TR>+ k5 D' Z- b {$ f' w* ]1 d
<TD><PRE>Method 01 + Y% g- B9 V, p* }, j5 T
=========
) _* b& j! Y: S g
8 N8 Q9 A2 _ x, B; |: m2 `. ~This method of detection of SoftICE (as well as the following one) is
' @. s/ R) D5 O( Dused by the majority of packers/encryptors found on Internet.
: q& R$ C, ^1 B7 i, jIt seeks the signature of BoundsChecker in SoftICE' O6 D. p4 H) p0 i0 a7 M1 g( J
7 K3 ~5 t! m- W3 }3 v
mov ebp, 04243484Bh ; 'BCHK'8 |3 S& N3 Z& s# M7 q8 e
mov ax, 04h
* o, i- G: S! ?0 g, B% z3 p int 3 ' R0 O! |2 K. ?- u" W9 B( R
cmp al,4
: S: ~: c+ q$ f2 D3 t- h& _ jnz SoftICE_Detected
8 h0 n% \4 B( O, R$ p" j$ J. @& m5 j$ [3 M" _1 R! W2 j: ~
___________________________________________________________________________
- Y8 j% t1 Q* _1 ^0 [ r( W/ N# f- J- [3 r, D* c
Method 02
8 K: j( {% B( [: E6 h, K=========' n9 L- d- E4 f6 m i
/ h$ j4 {; c' \. Z
Still a method very much used (perhaps the most frequent one). It is used% P' T3 t1 y! e" d
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ n* }$ [- `) X0 n5 f. Gor execute SoftICE commands...
/ f) I8 ^8 q8 b o) lIt is also used to crash SoftICE and to force it to execute any commands1 f1 l$ m- w4 g0 V0 I/ U
(HBOOT...) :-(( / a) K* Q) s* q" K- [8 b" I
" F% o" Z& l& jHere is a quick description:, {! _8 K3 D* E# F3 ?* i x2 n
-AX = 0910h (Display string in SIce windows)
7 M2 k. X* x* R2 z; P5 w r% v' Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) N) @! _- g! ?/ K2 Z
-AX = 0912h (Get breakpoint infos)
( G" m( W6 ?! s6 P-AX = 0913h (Set Sice breakpoints)
$ A9 I3 b7 o, \1 P7 b/ j% Q- |% s-AX = 0914h (Remove SIce breakoints)
) I8 R6 D$ e3 t& l7 n
5 R& j5 {" C. N0 p# IEach time you'll meet this trick, you'll see:$ [& }/ G% Y" C& W- K) Z& n4 X
-SI = 4647h, O1 {( ~. A* O& v
-DI = 4A4Dh1 F0 f; A# W5 ?, D; F
Which are the 'magic values' used by SoftIce.. S& p( p) y n( x' n2 o/ l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% Z& `' g* |6 p2 X2 w) R9 c
6 A; @! o4 |/ d. G: J' u& UHere is one example from the file "Haspinst.exe" which is the dongle HASP' L! S$ b" i# l; A* m0 V1 i* O9 u. K) O5 }: m
Envelope utility use to protect DOS applications:
, P8 z7 Y# [& o$ d# s! t
5 [. X5 z. g0 T: q( c+ [
' [9 z& w% v4 k6 H# u/ ]4C19:0095 MOV AX,0911 ; execute command.
9 X5 _0 R3 y3 N$ N" x- _4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." r! f9 f1 B& j4 s
4C19:009A MOV SI,4647 ; 1st magic value.
- O, D: R* V: C+ s* r% d4C19:009D MOV DI,4A4D ; 2nd magic value.
$ ~, [3 g1 @8 R0 c8 ^2 W4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 r7 N* g2 T S2 [
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! p* }& _. X6 I, a+ J
4C19:00A4 INC CX
& i ~- o" u4 z4 i+ i! v" Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 z# o- a& ^) M" r/ T, n4C19:00A8 JB 0095 ; 6 different commands.
8 z6 H& n6 ]1 v) l& t4C19:00AA JMP 0002 ; Bad_Guy jmp back.; F5 n/ S1 N1 s, o' M% U
4C19:00AD MOV BX,SP ; Good_Guy go ahead :), d& M9 W, s9 R7 ^* u2 x0 A7 F
; [$ w; ^2 y& _The program will execute 6 different SIce commands located at ds:dx, which, O& m5 I. y) s; w% O# |
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' m+ P+ M& s6 n% J. A. T4 O' E3 W+ f9 D9 H2 i. P3 i5 ^( ^% H
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., H e& i7 x$ s8 f1 k5 P
___________________________________________________________________________
. j1 i) j+ Y$ v4 ]+ r" ^4 F% E" f i) a/ N) x8 d
, l B D( j0 j4 Q/ O- N2 H+ k( Y
Method 030 n# c& ~5 B( O- y! H
=========
/ W; i3 @. H1 W! q% P$ ^) R% ^( e6 v) u: {* w# t ^
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
, Q: A# x" M0 r9 u/ a# z(API Get entry point)/ f' J! d7 `0 V: n
+ V9 Q8 v) T6 @: ^$ ~
" D2 ~. F ~6 @0 C( [ xor di,di
1 V3 q( h3 W( D$ z. V1 j mov es,di
& a/ Y$ h, H* m3 X5 G mov ax, 1684h
2 [8 z- {7 v- Z mov bx, 0202h ; VxD ID of winice
+ ^& ?2 ]# l( J% `5 d5 g6 v' W5 e int 2Fh
) }' A* F0 K. j mov ax, es ; ES:DI -> VxD API entry point
' }9 d; ~! i& K add ax, di
7 N/ Z% L* k: F6 b0 \: L test ax,ax- y; |* V1 g1 v% {
jnz SoftICE_Detected
& _" V) U/ ]4 A& h0 d, X. M7 ]0 \+ m) I/ P
___________________________________________________________________________
" F; I6 o# B, ?7 J0 \
; ^& h% ^' w4 H/ IMethod 040 b' B% W! X" G$ p7 L% |
=========
N" ?9 A& o1 f8 ~+ o
! m6 u2 q* b. wMethod identical to the preceding one except that it seeks the ID of SoftICE
$ |8 u* I/ B- r; R' v0 q* M" f% zGFX VxD.
2 _/ V' k6 b8 X3 P$ L# a8 T+ R* d
1 P V: K7 P8 z6 K6 N# u xor di,di
$ g# B! ^% t. Q mov es,di
7 K+ T; {; l' K7 u mov ax, 1684h 5 {% x: R2 x& v6 M/ L7 z+ m
mov bx, 7a5Fh ; VxD ID of SIWVID
! Y+ S! z) l' H1 N- f8 M% C int 2fh
7 O3 R" D, c% T5 s mov ax, es ; ES:DI -> VxD API entry point5 q" u. J* `& |) n/ k/ U% L) c5 s
add ax, di
! Q: |9 l* ?" J& |# @4 h test ax,ax( J$ u" H9 L2 V6 Z! F
jnz SoftICE_Detected
: L8 I' E( U/ b: x$ r0 ]
3 w( F$ _6 ~" j& f__________________________________________________________________________9 c! J9 B3 x4 ^$ T4 T, N" G) ?
6 q# {1 L- h* h- T' u8 c2 I! H5 W
0 q6 A7 y/ \) P% E3 S% ~+ i5 eMethod 05
9 n2 m& C0 ~5 I' q& A=========
" R$ g1 m4 A0 M1 |. |+ X# d T9 J0 K' H
Method seeking the 'magic number' 0F386h returned (in ax) by all system
9 Z+ o( F2 }$ Z7 e3 @- Pdebugger. It calls the int 41h, function 4Fh.
( Z+ r" j1 _* K1 z p$ YThere are several alternatives.
( n$ F3 s/ z$ |6 H v5 J; `# Z' f+ \6 [- c/ e, M, r( w( m
The following one is the simplest: t2 l# x0 N! h1 E
2 _6 F. o+ S, u( _4 v/ y
mov ax,4fh9 {+ x. G' Z: Y& |. @( z
int 41h) o8 \( s2 @1 u6 j& K9 P: [: u
cmp ax, 0F386
1 Z/ V; {7 M" y7 q( l) Y jz SoftICE_detected
u% K4 w% V8 ~, |. ^" ]' o9 H. B1 l4 y r/ ?% ^, K: m
5 C9 J$ k4 B) w6 B$ A/ d0 {* ONext method as well as the following one are 2 examples from Stone's ) g8 k0 s* A1 c! L' t
"stn-wid.zip" (www.cracking.net):4 `% _) L6 A$ U' g1 K/ D
( \6 F, {' ]; m1 j; i# X' m
mov bx, cs5 M5 p+ s2 M$ ?9 x. d1 f$ t
lea dx, int41handler2
# c3 P6 `" M9 X3 h xchg dx, es:[41h*4]
9 n1 I0 _: i" W, _2 s9 \0 m3 [ xchg bx, es:[41h*4+2]
- {" @& k6 { o: O. ^7 B- g mov ax,4fh
( ~+ P8 Q% m9 F& ?( w int 41h
* L# C9 w) p3 ^/ O- y f xchg dx, es:[41h*4]
, u' {7 L+ S4 M3 E xchg bx, es:[41h*4+2]
3 e" c/ |6 q. M K9 _- O cmp ax, 0f386h
7 w0 ?( V1 V( c+ P: h. A jz SoftICE_detected. N& G' Q; W1 w2 c% h. y4 ?; S. F
: T2 J- A/ ^+ u( H# V) M
int41handler2 PROC
) g+ g2 F# Z, i$ S2 e/ r ~* | iret
# J4 ]+ v; f5 @" U3 d+ Z9 H! vint41handler2 ENDP
3 s9 J8 [! G5 E5 W5 p7 ?5 f* b+ ]3 k% K
+ i# x7 S7 w M$ I" j& t. @2 M- i1 O; z0 _' ~* q
_________________________________________________________________________
" @4 N$ T7 H8 N
; \0 q4 D t; N: F* o$ X
* c* I& l8 E/ cMethod 06, H( ^) D, Z {9 L; k
========= i! H/ @5 [1 }: e1 b5 ~
: ]* B" K6 H. G }
5 _( l& C2 j6 e! `2nd method similar to the preceding one but more difficult to detect:
% M) D+ Z) P2 X, U& v3 w% c2 M" ~# _: G; T- ^/ i8 O; b! z
6 E7 o( n9 q9 X2 l- Zint41handler PROC
3 I2 J0 y- p( U3 S mov cl,al( ]: T+ l1 N1 |- l+ e
iret
. l2 j6 _& ? t9 Lint41handler ENDP4 A! W# h% b& s5 V& L
! W" u! N9 o! s) v" m7 H1 g4 _
; l. r$ O9 h' w* e) p C
xor ax,ax
1 E+ H A9 Y% f' ^# f mov es,ax: X* j' B4 |( a9 l
mov bx, cs
( w8 o. w% C( W. Z lea dx, int41handler
: D2 N4 J+ K+ J5 B& H0 P8 o: ~ xchg dx, es:[41h*4]
7 L; {/ @1 Z4 g4 w: h xchg bx, es:[41h*4+2]
# u9 c4 R2 X) n e7 U in al, 40h
; z* u% r2 ^4 P xor cx,cx
$ k0 i% y5 G6 Z* s int 41h# U3 Z; S9 ~0 n \3 \0 q: C! K
xchg dx, es:[41h*4]& u' _. [: G9 C0 V
xchg bx, es:[41h*4+2]. |6 O9 {. |' @" E- i
cmp cl,al
* F" N5 u0 y& I, o) t& n: l2 x jnz SoftICE_detected5 O( x7 G& x" P3 u5 R: v- g
1 v3 }" a2 g9 Y! H2 M) `4 H
_________________________________________________________________________
6 Y5 d4 h B f+ E0 @
1 y5 s5 E- W, O# y- [% a, gMethod 07) d5 r2 q n1 {# j) a# w6 ^! Y( K
=========+ d4 c$ @, m8 c( c8 i" F
; `( @) J8 v4 g7 @/ F& hMethod of detection of the WinICE handler in the int68h (V86)6 k$ d; A# h# G, i* l
* ^/ ^( g% z* j# A mov ah,43h
$ R# Q5 W9 {+ P/ ^& q int 68h. U# m. j8 M: a5 Z5 T% t4 {7 x( t
cmp ax,0F386h
0 x8 S; @+ r/ ~* O jz SoftICE_Detected
; C# W1 x9 Z# G) ]. j$ Z
" f) F( T- ~5 F3 j6 s1 f: R7 p1 y9 w. m6 a- a' K q! ^& B+ P
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 D2 ~7 i, J2 |3 t
app like this:0 `2 d* T$ A- h2 m* o
. A0 L% M1 T% [; }8 ~9 I# _: j3 g5 H
BPX exec_int if ax==684 k& I' Y! ]/ `: J
(function called is located at byte ptr [ebp+1Dh] and client eip is$ h, P9 ?1 A5 ~
located at [ebp+48h] for 32Bit apps)
/ U0 o; U2 ]2 N, }3 t7 x9 k# r; x+ [__________________________________________________________________________
- y: }7 B6 G$ ?# A5 Q0 B
: {% j. k$ O6 C, O, O# T- H& p z& M7 _1 X
Method 08
, g% ~: E# `# e1 p. f) a=========
5 A4 \1 E" n- O
6 S' K) c3 {# U2 K! J. E3 p& b" ~It is not a method of detection of SoftICE but a possibility to crash the
7 }& s5 k/ G& I2 [6 l: V. F( bsystem by intercepting int 01h and int 03h and redirecting them to another
- Z) z2 d0 b) C/ [" P: lroutine.
; k( o5 ^2 t) m5 p m- H/ \It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 ]. Z. G5 N3 Z2 tto the new routine to execute (hangs computer...)1 v! F& L- I& a7 I( ^- Q# l( F5 V
! M( \9 p! C2 a; C* f$ A$ A mov ah, 25h6 b7 P& H5 L+ H; K
mov al, Int_Number (01h or 03h)
h1 w) v! f8 h mov dx, offset New_Int_Routine/ S) T5 k% t/ e- Z6 g) {
int 21h9 H' u% {& Y6 [0 \
5 ? B+ ~# G9 f. D5 S__________________________________________________________________________
/ c, y3 I. X. H9 V7 \; F! |
) @% O9 X, z m' QMethod 09" ]! g3 b6 f: b8 Z4 ~
=========0 |5 n+ Z' b( U* F
% D9 Z1 g1 _! d m$ H( Z* A
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 A, G9 S, Z; L$ z: ?performed in ring0 (VxD or a ring3 app using the VxdCall).
0 D! K; }' r$ NThe Get_DDB service is used to determine whether or not a VxD is installed3 h z1 W$ g. t9 L S
for the specified device and returns a Device Description Block (in ecx) for
1 @2 v' c; z& _that device if it is installed.+ n! t+ w8 s$ z0 D2 {
$ J: h6 M, p- c! |) } mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- C- }7 \6 O1 t8 e* |& Y" k9 F8 r
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% I; j" O; `- s* A/ y, |. K
VMMCall Get_DDB6 X' y3 Z2 a# `- W j; K
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* Z- r3 \, L, T/ v# d4 z
% P6 h$ }9 B( U9 gNote as well that you can easily detect this method with SoftICE:% n5 x' o! w) s; q: O. L
bpx Get_DDB if ax==0202 || ax==7a5fh9 C4 v' u( |+ b8 W$ g
O- x& ~2 {) N4 C! d& E__________________________________________________________________________! \7 x" e; j9 ]
& o5 k. X1 E' L" m# aMethod 10
! l. n- R5 ]! d4 Z1 q1 g=========
, `! z$ N& C q/ e& M+ ], p: R! U$ a3 S! c" i, @3 w
=>Disable or clear breakpoints before using this feature. DO NOT trace with
* C- f N9 i" @4 |0 y5 c SoftICE while the option is enable!!
) J5 N' Y, l5 h7 e1 j
! U; v7 x# j [7 ~- {& BThis trick is very efficient:4 L2 _7 s; x X+ |7 R* B
by checking the Debug Registers, you can detect if SoftICE is loaded! i1 }7 }7 y# g j: s W
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! T, P, ~: |( c: h" Jthere are some memory breakpoints set (dr0 to dr3) simply by reading their$ R/ O% M5 j' X; l. C0 O- D8 t$ {
value (in ring0 only). Values can be manipulated and or changed as well
- x6 q3 D2 q1 ?5 K. M1 n+ r* n(clearing BPMs for instance)
7 L4 Y, x; |8 U0 h! J& H7 s Y" M& q- \( P# ~, J* B5 y
__________________________________________________________________________) F- X* K2 W3 D8 Z. f2 K
$ M7 O1 k8 o7 y) z- NMethod 115 H* Y7 N. d. o6 K' |$ I5 A
=========
) J1 U6 l+ Q# V4 N$ ?: L3 J
8 p! {7 r0 P5 y; E3 N; zThis method is most known as 'MeltICE' because it has been freely distributed
" p. [0 X- K9 o: F& }3 Bvia www.winfiles.com. However it was first used by NuMega people to allow
7 f6 \9 Y2 E# ]5 dSymbol Loader to check if SoftICE was active or not (the code is located
9 I ~3 [& V' E5 _7 v- J) H7 l* yinside nmtrans.dll).
0 x7 k4 ]/ h' d) M
+ G* |- ?; C9 q2 {% w8 ]; `The way it works is very simple:
$ B' b+ J/ C; A d/ v1 y7 i$ u& NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 G: O* I' c5 SWinNT) with the CreateFileA API.5 Z3 G/ n; ^ I8 } x
, O: O% F* m C3 a( o! h" q
Here is a sample (checking for 'SICE'):6 L/ T- U; K/ h/ c) W8 L1 J
6 p" l7 Q( |$ Q- I+ l
BOOL IsSoftIce95Loaded()
: c3 @" f2 `9 n( f* z{
$ J* b: Q/ d5 h- u( p HANDLE hFile;
5 X3 S" k. e. }; d' k, s hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 O6 J% q6 W: N3 R9 L1 k+ J2 F FILE_SHARE_READ | FILE_SHARE_WRITE,9 y: @. W/ j$ f+ g: \2 M
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% c# D- L2 z5 M- U7 ?% r$ k4 u if( hFile != INVALID_HANDLE_VALUE )
0 ^& q( k3 i: Q' V4 Z, b, K1 |5 K {
+ Y L% \* M9 N1 O' l |. e CloseHandle(hFile);
' Z' N8 U9 P: ~- ]/ x return TRUE; \7 I" D- m% M1 W5 e
}( E' Z7 G$ t! _* S t
return FALSE;
7 v# t' ?8 p: N$ a# [2 ~}9 [2 z6 d( e+ `8 J( h& j2 ~
; D9 ?& J& h2 [5 ~$ u, u$ |, jAlthough this trick calls the CreateFileA function, don't even expect to be$ J- Z) }% l: f2 \
able to intercept it by installing a IFS hook: it will not work, no way!* d: W' O; ~& Z% C
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 K. w' G" t' e0 d0 Y. o/ jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* L$ }& A4 d% L! o( e u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc3 _- b' b( A# U& l
field.
3 i- s% f- Z+ w& ]5 t2 F2 X! bIn fact, its purpose is not to load/unload VxDs but only to send a 8 W. ]! t' O% O: ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ I4 X. J+ H4 q& b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try" c( S+ G' a0 I5 [$ t* T& p
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 F" q4 Y) c& X, ]) w( d) yIf the VxD is loaded, it will always clear eax and the Carry flag to allow
0 P6 [* y# v3 l) kits handle to be opened and then, will be detected.
: g- Q1 |1 p5 o( s( ?2 K6 jYou can check that simply by hooking Winice.exe control proc entry point; ]" h6 z' s( f+ \; |0 i
while running MeltICE.* m- l3 M; Z+ `# V7 B6 E1 B" l! _/ @
! v( ^% d! b, E6 `! G
o7 T% y3 b, e4 r
00401067: push 00402025 ; \\.\SICE
( X0 B0 m* ]% [* n% u6 m0 _ 0040106C: call CreateFileA
# z( o4 c! [! @' }9 f 00401071: cmp eax,-001
7 {+ x. x- L3 T& m- n 00401074: je 00401091
3 t2 c( `3 M4 X _& x8 A1 q/ A2 Z4 O# Q2 S
+ i/ \5 T# L. a, s; w, B& ?6 eThere could be hundreds of BPX you could use to detect this trick.
, o/ k% p' `' f" V( ]' b7 H0 Y4 F-The most classical one is:* v# \' A$ b D+ F8 i; K* e
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 C# b: J+ l) W& e
*(esp->4+4)=='NTIC'! U% n+ j5 C8 V% ?. E+ x
9 ?6 P5 v4 x9 C5 B: f+ ?
-The most exotic ones (could be very slooooow :-(3 C/ n* M; Q! o8 @- J8 x
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( F/ T: H0 s5 K7 e; ^9 p
;will break 3 times :-(
" |) N3 Y0 h, ?5 b. k" |( S0 A' \
$ W/ H/ R% c* Q8 f( f4 Y1 ^-or (a bit) faster: % [( e) e8 j0 L6 p$ u. R8 [: e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 j3 h$ }" `; ?" ~3 |2 x9 s5 R! C, _: ?
2 `! k1 `; \2 k3 X; H) z i
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
; P/ l) d1 S2 j ;will break 3 times :-(
2 Q, y" n* @0 S
6 h6 `! F% Q4 _1 N, F3 s9 b: j-Much faster:
1 u1 i2 {0 o$ U' M i BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 ]$ k8 X- s3 t6 ]1 B
8 [- r4 D! b8 y* \& iNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' z5 Q- q) ]7 s# ^9 r; A1 p
function to do the same job:
. e; p' E* e1 ~5 G4 q9 |
5 U$ j' U3 K9 h. y9 Y" ]9 x push 00 ; OF_READ
" G/ e% T4 Z1 I' `- b mov eax,[00656634] ; '\\.\SICE',0( D/ M- T% B7 K; |- j) n0 f- k
push eax
; l0 w$ L& o0 M, p0 } call KERNEL32!_lopen/ R4 [$ A: x" u8 {; c9 u9 o
inc eax) c/ l- w, |9 f
jnz 00650589 ; detected. Y9 x( R0 W& z, z
push 00 ; OF_READ
' P5 O9 n) x% h: [: x2 w mov eax,[00656638] ; '\\.\SICE'
3 _; Q/ U, D$ @4 n3 ?2 Y# l. F push eax, c2 V! Z( j! @7 g& i* Q
call KERNEL32!_lopen2 C# p0 P% m% Z2 D9 z
inc eax$ C B6 d7 M9 P3 O; j
jz 006505ae ; not detected6 b, V7 ~' e, g5 i
" G" w! b# f* C9 u; D7 h
& {6 |+ B* G7 H/ M1 H, S0 D__________________________________________________________________________
6 F9 y, j6 e0 z6 v* [( ?
8 S+ |( }1 ~: G JMethod 12
* S3 E8 {. d; n6 [+ E; U=========
$ h: D, Q. t% r2 I r3 z# N* n5 t* F/ e, d5 n0 }6 E; `
This trick is similar to int41h/4fh Debugger installation check (code 05, w0 p/ n! c& z
& 06) but very limited because it's only available for Win95/98 (not NT)0 x" N1 L% L+ `% |$ g1 k* h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo., f' ~2 n" m L, N. d2 S+ _
' e. J" s' Z! P w& b: B4 q push 0000004fh ; function 4fh
/ z( t+ B- ]+ W" K push 002a002ah ; high word specifies which VxD (VWIN32)! x1 C% ~- Z( R& Y1 {( s9 x
; low word specifies which service
, e" h9 A& L5 u9 O& j1 s (VWIN32_Int41Dispatch): m9 G' X+ C; m8 P, e" z# A
call Kernel32!ORD_001 ; VxdCall
1 e1 {# h: }7 L S cmp ax, 0f386h ; magic number returned by system debuggers1 A, X4 t( Z V% J+ q
jz SoftICE_detected/ R+ S. ]& K$ R9 O
" N; c0 [0 a# b% n( l# s$ U
Here again, several ways to detect it:
, ]4 j2 \# T! ~, `! G0 Z
6 A" b( R3 [, {, A( V1 D BPINT 41 if ax==4f
; p9 p0 j+ N4 b! V; E3 b% m" a9 V8 M* Y0 S
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 `: B7 n5 t: `! U& w9 f# ]$ H, M
5 Q+ C+ e& ^: j/ R2 U# b BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
, G0 r; b$ D- F+ ^- V/ J% k* M; S: h5 H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!" e3 r' q& y1 n% }5 S, b4 u6 G
! ]# v+ Z+ B% h) \; g b
__________________________________________________________________________
9 M' O) C9 @; e4 e* L
}1 {% t4 m7 ]. oMethod 133 j1 W9 Z: J; Y
=========% W, }# o! g7 @
- R, F" \9 B, ~6 j
Not a real method of detection, but a good way to know if SoftICE is
5 \/ _9 p: p. r( winstalled on a computer and to locate its installation directory.
# ?2 i5 ^. n( V' c( U. }It is used by few softs which access the following registry keys (usually #2) :$ |4 x0 i- s4 ^) {, V
6 P) b- Q, ^8 ?3 O1 O- z( @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( i* a8 i1 D! T( n$ z6 D1 }\Uninstall\SoftICE
- Z; v+ |$ b: s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 J% h5 H" G1 l( Q( T3 q% \' T
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& Q Z) ?/ D. h\App Paths\Loader32.Exe
6 r/ w! N+ T+ u) h B7 T! S8 i
! W1 n5 H% m: g- Z1 `' Z* L- ^ [7 b$ `
Note that some nasty apps could then erase all files from SoftICE directory
% g! _$ b0 t' j; g/ D9 A(I faced that once :-(
, m; n8 l) [$ O- A9 T8 w! a0 {) e4 p' s* L. O. Y1 ?
Useful breakpoint to detect it:
6 i( P: n9 t, ^* H0 E8 m+ I9 `0 X! h g M: }) G5 u' Q( [3 a
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 e+ Y3 _; W7 p% x V L7 D
+ u; v; c% `7 S8 x9 y" ?# j__________________________________________________________________________9 t7 H9 I! q% a
0 v7 t9 F1 h% {" k
8 _4 u; e$ o' s4 v& `
Method 14 , ^& ^& U, C. e- z
=========
/ b' a& @* f2 o5 k5 d3 t7 T6 b T4 B+ g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* y2 v1 P6 e. j% o2 h6 }' V6 T7 r
is to determines whether a debugger is running on your system (ring0 only).
2 G+ T, H0 c* X/ g* o/ c+ w( W) u9 U6 D0 N. Q! i* F @
VMMCall Test_Debug_Installed
" o" O: ~6 b" l, T- q je not_installed# X* S C. y. O+ ]) W0 L6 d& }6 Q
; g5 L7 h3 h, t4 L& j
This service just checks a flag.
1 [7 g0 T! H; f6 d</PRE></TD></TR></TBODY></TABLE> |