<TABLE width=500>
3 M7 z5 ~) c u1 G N<TBODY>
4 r+ E! h/ I" M7 u* D5 V<TR>8 |- T [: a" x; d0 @2 L( j; e' w& S
<TD><PRE>Method 01 Z) O8 G% K% F6 g
=========
: k, w2 n# F, u+ b4 j) L
* Y' U1 z: T" U9 z- i8 b# `% JThis method of detection of SoftICE (as well as the following one) is
2 {: X# L! _: e8 n9 Aused by the majority of packers/encryptors found on Internet.
/ S' u, \8 ^1 _4 X, ]( ZIt seeks the signature of BoundsChecker in SoftICE
- ]) g% J3 u8 |5 c1 c5 R/ E4 P* w) g( z' S/ C+ b; J
mov ebp, 04243484Bh ; 'BCHK'
& D/ B/ v/ e+ H0 u0 n mov ax, 04h
. X# \8 \+ A1 u% Q" J int 3
' C$ e0 n. t7 p/ h! @0 _ cmp al,48 y2 o2 S& o3 }- D* L- x
jnz SoftICE_Detected
8 p' L( G- [+ s( h
7 V: F) B" N+ b8 m: u! ]2 h$ I___________________________________________________________________________! X/ T+ d( h' y4 C7 _" s8 F8 e7 H
0 V8 K% ]/ ^% ]; H L K8 P# MMethod 025 s0 b" l e* M( r# s! f
=========( k# @3 x* F0 \
, N' h1 q8 @7 M6 }( J# t/ R6 RStill a method very much used (perhaps the most frequent one). It is used, \) o0 U3 f6 O" t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' m- a0 e; I8 A: t% hor execute SoftICE commands...3 S- W/ M8 Z6 G" Y/ Y; A ]) e
It is also used to crash SoftICE and to force it to execute any commands% O6 V* y. S4 R4 R! {: ?6 S
(HBOOT...) :-((
+ e9 B) I" k# [ @; ~
8 V/ b; W9 M( V. C( w/ v# ?Here is a quick description:/ h) Q7 }- {& b2 W3 a" C
-AX = 0910h (Display string in SIce windows)0 p0 F- e6 b# v9 i+ i2 f2 h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
1 p# [% G. n, {-AX = 0912h (Get breakpoint infos)
, b1 ?; W, Q/ F+ H-AX = 0913h (Set Sice breakpoints)4 A: W& A7 N5 M0 c& k5 I, t) D' d
-AX = 0914h (Remove SIce breakoints)
" O0 `6 `+ F7 J. ]
: ]2 |+ l0 q' U' l* f& q" [Each time you'll meet this trick, you'll see:
" {' B/ y$ @: V+ {" r-SI = 4647h
4 r( s! i c( k7 h-DI = 4A4Dh
1 T9 D" u: J1 O) ~( X% M; X8 L7 `! |Which are the 'magic values' used by SoftIce.3 Q) m- _2 ^5 a0 u/ D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.) V) G/ I# M& @1 @0 Z
+ a4 N* v9 P/ ]8 w# |! ^; v% {7 N
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 w$ u0 L+ H' ^
Envelope utility use to protect DOS applications:
& e D) M b/ D& L9 c4 H; Y
4 J- c! ~/ @. u z5 S
- L6 X. B# A4 ^6 P3 w. t4C19:0095 MOV AX,0911 ; execute command.9 Q& B) C0 g8 n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; M3 B& J8 a' N- i! I3 @% u9 E; V) u
4C19:009A MOV SI,4647 ; 1st magic value.1 @7 P5 m/ y f# |! S* }4 V
4C19:009D MOV DI,4A4D ; 2nd magic value.7 e9 T( g8 y8 _' u/ l
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; N. ^2 O4 q* e+ N, G- s5 T4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; u/ }2 z+ n& {5 F' }3 ]5 Q; A
4C19:00A4 INC CX. d n/ Y* n) ^( H! ~7 _
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 K5 _0 M6 J7 v$ `2 J8 e4C19:00A8 JB 0095 ; 6 different commands.
( O( R! [7 D! h1 v8 h4C19:00AA JMP 0002 ; Bad_Guy jmp back. G: |% U. q# j5 l1 J6 I K0 H
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# ?0 D6 z) \5 `' { y
# Y/ x- a6 R0 H# f3 P7 ~- D
The program will execute 6 different SIce commands located at ds:dx, which
9 h8 l& v j4 z- mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ L- B4 c+ j j: v% @9 m( L" j2 Y
# f, i1 N1 z4 F7 r$ h3 l: X& |. T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* w4 w) q" C- f___________________________________________________________________________
, F0 \5 V' N" Z8 m% G. b x0 E; Z7 }
' C$ U3 i6 A1 M7 y7 s
Method 03
0 }: ^( C, n0 E=========( R, J) ?; _0 h* A6 x* t
1 M+ M5 c0 j% h! B" W: p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ x9 W- C: I _" c
(API Get entry point)
9 y2 p$ \6 P3 a$ W1 Q' p/ F3 U' K ) p, h4 S3 V4 {, g" D
. _3 t# O% ~6 ~6 H
xor di,di
, U1 G# j; Y) e) v mov es,di
& Z( k, H5 s: x+ {6 U/ b% V mov ax, 1684h
, W( e" C( j1 i. @ mov bx, 0202h ; VxD ID of winice
; X1 v2 A1 H) Y7 a6 o5 ^; V int 2Fh
" Y$ S; r! _5 m/ ^- Z mov ax, es ; ES:DI -> VxD API entry point4 P2 W' f, m, E4 t
add ax, di
7 d& A* f2 x. o# u4 c' L9 T/ H, V test ax,ax l% E! M4 K, P% f' g9 U
jnz SoftICE_Detected
$ W/ z# M: k0 v6 c- t% }! z7 f3 [8 P/ f1 m, `. i
___________________________________________________________________________; r- Q+ c- X. l1 h
' w& p7 ^$ N5 X. N s
Method 04& j& N( U' H5 h: e3 t
=========
+ T7 O0 c8 L) u+ c, g& ?- N( b9 G
Method identical to the preceding one except that it seeks the ID of SoftICE* s* H; Z1 d* f% V; i
GFX VxD.3 j6 r5 Z) b6 G G0 V7 U5 X8 H+ o
2 {$ ?3 o* @1 S6 [/ d9 U
xor di,di
9 H1 C r G. k; h& w4 w0 ^ mov es,di+ O" Q+ P8 r! w' W" V' A
mov ax, 1684h 5 `" `& |- C4 z$ O4 B3 F/ V
mov bx, 7a5Fh ; VxD ID of SIWVID! x J6 f9 G( |3 J& m3 l
int 2fh
- f( B g s* X, v mov ax, es ; ES:DI -> VxD API entry point3 i3 s& o9 y8 V
add ax, di( q- ?2 T/ x0 } f$ w/ c
test ax,ax6 q$ ]9 Q5 H) v! b
jnz SoftICE_Detected
. X4 [: i0 Z) C) r* J
0 t8 R. ]7 c: b' ^8 ]- J% r__________________________________________________________________________
2 K# a" I. \( e& `$ O" N9 l* s9 |' D# |0 ?5 {
4 s! b: W& B6 H# @Method 05% I1 M: l, I# G0 R6 C
=========
4 A! j- Z- i3 w: O
) N# N$ g2 d! @8 n! Z z7 gMethod seeking the 'magic number' 0F386h returned (in ax) by all system
2 i }0 a8 n/ @4 g3 [; ~debugger. It calls the int 41h, function 4Fh.
( I$ C- U4 _: J+ C$ P, u7 Y% CThere are several alternatives. $ c7 r, m8 _# X7 \, M% [! [
v; A/ I6 V- B6 K' NThe following one is the simplest:* `, ?; C* [9 S
5 I# Q- w( K5 a& J7 n+ ` mov ax,4fh4 o+ z2 H" m" X9 J% `' J
int 41h4 m# o/ ^' j" u) q6 S8 e
cmp ax, 0F386" W- Y+ L# d! I) h6 a5 r9 }
jz SoftICE_detected
' o2 T) q& a! F8 \+ I2 |1 u n* L0 p' ^! Z3 t1 t
: p) V4 K) C0 l5 u1 ?2 MNext method as well as the following one are 2 examples from Stone's 5 S \" O# s5 C- f( i5 i8 ~1 ]
"stn-wid.zip" (www.cracking.net):$ N% o* G F# k! ]1 O
7 D+ l2 ` G$ f1 {& |1 y
mov bx, cs0 _# f5 {8 }1 A
lea dx, int41handler2# i1 e1 e* C7 W S; W. o0 X; }
xchg dx, es:[41h*4]! V2 X/ A' c3 j! c. m# B- {3 n
xchg bx, es:[41h*4+2]" U& w& e+ j5 B* L+ X- H
mov ax,4fh
. f1 ^& O2 S! n9 W4 q. e* x int 41h
9 f, v3 b8 B$ O- } xchg dx, es:[41h*4]$ f3 I J, b+ y/ S1 v! O
xchg bx, es:[41h*4+2]! A# J$ X. n+ I4 M6 O% G
cmp ax, 0f386h C6 I# m; t' g U: V5 P9 A J; h
jz SoftICE_detected
: I& c0 b8 b1 u. D0 C9 b" [. K1 z0 u
int41handler2 PROC
4 C2 }, f t$ h iret0 V! s) s- Z, V* X# @
int41handler2 ENDP& {: F) U3 ]8 ^6 U( T1 r$ s
* b' l5 R* ]0 R
/ T- y9 _# i# v4 Q_________________________________________________________________________
* w6 h4 H9 @/ G8 i% A& |
9 A0 _- o4 P; k- Y# u4 E
% v! c3 O) E3 l8 B2 o; pMethod 06
* R! t1 Q4 J8 q9 {1 _) t=========- `' X9 W: [7 C8 T% G
6 Y0 Q v. D' [% E$ D; _( S8 Y
- i, H3 _5 A4 L- v' H- W2nd method similar to the preceding one but more difficult to detect:
1 c" D" J" P2 K, x) [( G8 ?3 h# q8 u7 v. ^2 L# T8 a
; c' Q0 z. y8 z5 t6 Zint41handler PROC
+ }! z: Q% @) R! z$ ]2 o mov cl,al
6 p% t: L+ ]# V% y7 a iret0 h- d% V9 `( F( `$ n
int41handler ENDP
# J/ J5 Q7 f( H( T9 j' k+ A1 u! K
: N3 ~' M2 J. Z& |0 R, R$ t
3 `1 H; n; ~8 `/ ?* h xor ax,ax
: b6 G" p3 Q/ s3 a* n+ q' Z" | mov es,ax
~3 N+ Q4 r$ t) v! ? mov bx, cs6 V* i) Q! b5 H ]' _( Y5 z
lea dx, int41handler; n7 T9 Q. w$ D% ?7 d
xchg dx, es:[41h*4]# {$ J% v9 u$ `/ o9 ]9 b- w1 i& g
xchg bx, es:[41h*4+2]; Z( o, Y/ A7 c( Y6 t& X
in al, 40h
) X+ ?* f9 V5 E xor cx,cx A/ h4 Q. |% J7 h/ v
int 41h
, F' @! A* D( e0 r, s0 H, s6 O xchg dx, es:[41h*4]
- R- g. H2 \" v6 m3 x1 E' r4 O% s xchg bx, es:[41h*4+2]- E# O. e! W$ X6 n3 n' p# k0 N% |; u
cmp cl,al, _' M& T7 w" l7 H
jnz SoftICE_detected
7 |" ?! X$ z; N/ E" k
; \: O% r/ P. B8 J6 g_________________________________________________________________________- W' T5 L S6 i% v) O
. ], T. S q4 H9 ^% [7 |" D8 h
Method 07) I1 k/ i1 U9 R) U
=========
& C9 S- N9 x0 i' Y/ \4 \8 A6 r3 o7 `$ v* |7 ~( c) d3 u( a+ J* q; W4 b
Method of detection of the WinICE handler in the int68h (V86)) }9 |- Y( _9 X! F
, [$ |' @5 N7 v0 n/ l
mov ah,43h/ v' R' i3 n% J/ T j
int 68h
6 @ u/ t' C- q+ l/ f- L: ^ cmp ax,0F386h
7 `" y/ o4 L% v+ k3 F5 z jz SoftICE_Detected
/ h" Q. S# W4 `; d$ N4 s9 |1 b$ K
1 p/ ~+ h0 h7 H1 n- c1 S' ^=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 _# j& j! J6 g8 z( U7 o, d
app like this:
+ J8 ]' J' Q* b: B& W" F
8 L- R6 L+ i1 z' Z3 r BPX exec_int if ax==68
- y6 T" m! u t% P, g, S (function called is located at byte ptr [ebp+1Dh] and client eip is
, B. Y d- m- u6 o located at [ebp+48h] for 32Bit apps)+ X$ G* w; Y+ b/ y- C0 Y3 L
__________________________________________________________________________
' v& P6 T" C& g
) t( F1 }0 ^& D, M! U0 k; b
' L G- D) s8 f% {' E* ZMethod 08
3 Q3 J" E( i$ L2 Y=========
9 K" i8 O5 s9 L2 D1 m5 \2 @* K' t( L( x2 S Y
It is not a method of detection of SoftICE but a possibility to crash the
* \, m- y( s9 i# W' bsystem by intercepting int 01h and int 03h and redirecting them to another
$ c; Q5 k: V" ^* x# `) B# N+ W3 x7 Vroutine.
3 }4 Z: W7 d8 `, y) d }4 g" sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( G. A9 z# g- Y! {; ?! X: g$ n! ?to the new routine to execute (hangs computer...)7 d% h; H3 Q1 G& M
. ~. W0 r! e. [
mov ah, 25h( f9 D' G7 Q+ h; D) O O
mov al, Int_Number (01h or 03h)
: p: n7 X0 {* b7 d$ f0 k( l" R4 U mov dx, offset New_Int_Routine
6 e2 t. U7 p; h, j* l int 21h
% O, i' `! v# r7 [1 u
; G: w' {3 j4 Y7 K# c# o' C8 [+ J__________________________________________________________________________0 Q7 b( P5 s; b
: d0 d6 W) T; \2 Q7 CMethod 09' M- i/ _2 s, S' O0 o, v8 @
=========: k$ Q+ E' {$ S. O$ ~9 S9 f
) r" O" G W4 j- [% GThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- w7 P+ \- i [; s/ O
performed in ring0 (VxD or a ring3 app using the VxdCall).
" f! r/ x3 Y4 I: m- W, PThe Get_DDB service is used to determine whether or not a VxD is installed
7 p9 W8 f2 j! b2 F" X% j+ pfor the specified device and returns a Device Description Block (in ecx) for! Z) k; r) l) V& M3 Q) j# `8 k3 n
that device if it is installed.2 z3 r$ O+ t" c& H: a
?! Y& T0 c! p, Y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- H+ g5 K$ ?$ m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# U: {; {& x% b8 @# r% z, g* X VMMCall Get_DDB
" `0 F7 m; I s8 z% R3 O% w2 w# a' Q5 _ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 }1 Q5 f. q5 X; q+ y& N* Q5 {! Z
. _ u1 x$ D$ Q1 q7 `1 T
Note as well that you can easily detect this method with SoftICE:
6 N& ^3 \' I0 m- z; G2 E4 a- ^" s- O bpx Get_DDB if ax==0202 || ax==7a5fh
5 K. i$ `% u# v5 N2 H
9 j g( c$ K: Z1 {$ D' R7 l& W# K& H__________________________________________________________________________
& W# N' p' R' U; e
. e: N* J$ H" Z0 w4 JMethod 10, s/ d8 E0 _: v) v6 P& r# G
=========" q+ Y( d) k& L2 i: n
* R! T* j+ u! S2 t& {' A
=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 B! t6 E6 U1 x$ E8 \/ P. G SoftICE while the option is enable!!
8 p8 d2 f7 `8 I) T/ G. B; f8 ]$ Z: _# O. t* B
This trick is very efficient:
' F. n3 t3 [4 l6 h$ z3 Q6 y; K. tby checking the Debug Registers, you can detect if SoftICE is loaded
+ Q6 c2 E# D9 o(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 N# w. C4 b" Y4 d+ k$ c
there are some memory breakpoints set (dr0 to dr3) simply by reading their. q( M2 m; e: F" w
value (in ring0 only). Values can be manipulated and or changed as well
3 p! g# C C9 V; v' w6 z& p(clearing BPMs for instance)
2 ]6 O- k3 A" }: |6 a" I$ I/ ]' V. j, j4 l B2 U& {$ `
__________________________________________________________________________9 L! P+ W, b6 Y" e
; j" q* f0 _. }! e- Q( f5 O! N8 ]' V2 BMethod 111 f. y6 P9 V! M- V% U4 }- C7 w
=========
0 F+ o" A! R8 i# G1 B, Y3 `# D! T4 Z& ^7 N. a/ b
This method is most known as 'MeltICE' because it has been freely distributed6 Q3 x4 Q, Z) u! a* I
via www.winfiles.com. However it was first used by NuMega people to allow
! g4 M4 [" W& @7 n" kSymbol Loader to check if SoftICE was active or not (the code is located
1 f' c: w5 {8 B# xinside nmtrans.dll).0 [! v7 J1 o8 B7 ~
X; _, \5 a2 ~: vThe way it works is very simple:
0 S% |( f2 p$ t6 kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; \) D0 m4 h# t- O* V8 l2 d2 b e$ P+ eWinNT) with the CreateFileA API." P1 e0 ?, `4 `* z* r% k4 g- o
3 b# z" {6 f1 a+ A. V0 _. [' LHere is a sample (checking for 'SICE'):0 J/ C. ?! W4 V
v D6 C& o7 @3 `$ ~. o8 C
BOOL IsSoftIce95Loaded()% @& a" Y/ ^# j2 j! z4 u
{
: ~1 L( z1 g; L6 w7 j1 r/ ^. C$ D9 U4 O HANDLE hFile;
6 G& L8 L+ ]; ]; s6 e/ g+ r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* u0 F9 x0 b6 n% [7 W# l* \9 ^# |
FILE_SHARE_READ | FILE_SHARE_WRITE,
; y0 T3 P, y2 l. e4 B NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- }" o/ T p2 m* k1 ~! R9 z
if( hFile != INVALID_HANDLE_VALUE )
/ w! D1 @+ Z/ u2 e {
1 X2 I: m' s3 {9 U, v CloseHandle(hFile);' A- \1 H8 F" P$ e6 W- |+ D
return TRUE;
0 E8 m: z: ?: A1 D9 J }5 o! v& e+ t" f
return FALSE;
6 t3 ^+ |- j' Q9 q}
! ~; f- J% m: j7 w# O
8 M6 N5 v6 X: W$ w- tAlthough this trick calls the CreateFileA function, don't even expect to be
% l% ^4 I6 D c6 a1 r, ]* }able to intercept it by installing a IFS hook: it will not work, no way!# `1 V; j$ I' x( L4 _& O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 ?7 S) Z, |' m+ lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ {! L. t. J3 L0 H8 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc5 Q0 A- u, ]" o0 X3 c4 Q* f$ q
field.
- q% z. v. S- B' R. A QIn fact, its purpose is not to load/unload VxDs but only to send a " P; b) h* n6 t% y' ]8 t
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 W; a( x; a: @( D7 ?
to the VxD Control_Dispatch proc (how the hell a shareware soft could try# p& {1 b( |6 t7 R0 U7 l) S, Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
O) Y$ j! `& A# I9 W6 }If the VxD is loaded, it will always clear eax and the Carry flag to allow
- t$ O4 Z4 y1 G% t- u1 pits handle to be opened and then, will be detected.
( V4 x9 @; A& H2 }You can check that simply by hooking Winice.exe control proc entry point: b1 n! i8 c- R( [
while running MeltICE.$ ?) t6 o& D; s) Z
: Q$ E- a! j# ^! z4 y1 X+ f. o: y' u2 O4 e% v6 h
00401067: push 00402025 ; \\.\SICE
8 \5 s; ~$ ^# {- L5 D+ z& t 0040106C: call CreateFileA
1 S6 x- \3 V- _% w" ^ 00401071: cmp eax,-001
1 m& j! e9 {1 V( N* l( Y1 C 00401074: je 00401091/ Q3 ]( k O* h# Y) P' |0 k
1 z8 Y6 r/ q6 e. \ Y$ A
/ f2 k. W" f( J5 B4 qThere could be hundreds of BPX you could use to detect this trick.
2 C6 T1 i$ ] S9 [+ g0 p-The most classical one is:) [- i4 u& ~+ c1 G& K
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 E* a# B* Q. m9 ]% y( { *(esp->4+4)=='NTIC'+ Q$ S% o: J: Q. @+ O W: q
( I& n2 W z9 \3 M3 W2 S
-The most exotic ones (could be very slooooow :-(
4 E" Q/ f5 i" X BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / `' `8 g, @% ]8 e
;will break 3 times :-(
9 g8 Z% h. K- s$ Z( O, E8 @' Q! h( R- D. S+ {
-or (a bit) faster: / E6 g: \! y0 l6 M
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% q# ?, X+ Y0 r! o8 a' s7 G+ c" z) D( Y$ o) g0 L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 5 D# g- z2 x- {2 A3 X
;will break 3 times :-(
! \/ B4 A, K5 B7 ~4 w8 e8 s: }
& }- t9 E- v7 K- A; P! X @; V6 O-Much faster:3 B6 d; f0 V! U' ?$ z, ~
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# O, K ]4 K4 a5 T2 O b) V; P: g; I* X& U$ A- A% W @9 I2 l
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen H/ q( \; x3 {! _' m" y
function to do the same job:
! T; h; l5 D; ^4 L% i1 `" ^: D; d/ j2 m" I% S3 J: d, w
push 00 ; OF_READ
" k* Q; B% b8 {$ t2 y1 q mov eax,[00656634] ; '\\.\SICE',0
% [$ m* A5 I( R' c/ A0 J2 G9 N push eax2 }& F2 I9 {4 i- z8 I8 w
call KERNEL32!_lopen4 W5 k! r2 O$ z* F) S
inc eax' p3 M8 {% |' J9 }
jnz 00650589 ; detected& U3 m: w( f" E( N! H3 W6 n
push 00 ; OF_READ F0 z; l: C+ F! e# y. x) w
mov eax,[00656638] ; '\\.\SICE'
+ l ?% r0 `( i' \3 n push eax
% o0 U$ Z& r$ C3 l call KERNEL32!_lopen
* g7 x# Q6 J7 A' @( e, d3 ` inc eax4 y' k, {% s* V
jz 006505ae ; not detected) H9 A* l/ g& l% A: B* f
) H8 W2 e4 h, {" z0 r6 ^ m; v4 m! |" D3 P1 @
__________________________________________________________________________
$ I: P+ u/ j# r& U# q- H% p2 P- l& y N7 Z2 j- K% D
Method 12
) C8 J' `0 c2 H- R' h; t( P=========5 J4 i8 I$ n/ i- B: ^1 O
6 H' }! b, ~) W0 \1 @This trick is similar to int41h/4fh Debugger installation check (code 05 a* f( x7 `$ o# N
& 06) but very limited because it's only available for Win95/98 (not NT)
/ Q: q! k/ c* B4 T- _as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
V$ p, X* }7 p- L: b2 o- k* g) w8 h0 C% ^# `
push 0000004fh ; function 4fh
j8 v; t+ M5 A2 U. U" N push 002a002ah ; high word specifies which VxD (VWIN32)3 k j& D+ w, r0 L" K6 d
; low word specifies which service( S& _6 m% A, v* t# g l
(VWIN32_Int41Dispatch) N+ {9 o* g: k; {9 w) f
call Kernel32!ORD_001 ; VxdCall
" A6 ~! s) d7 n4 k cmp ax, 0f386h ; magic number returned by system debuggers: n. h4 e8 @8 F8 O- v1 M, D
jz SoftICE_detected: }9 ]4 N* b4 z6 D: \8 U8 I% {
7 ]2 B6 l" A, Z+ Q- hHere again, several ways to detect it:" }) c% i8 ], ^& O0 r7 o4 R( d: j
% U; A% E8 R L" D q7 u5 m
BPINT 41 if ax==4f
; z* ^0 k3 ~3 g
1 Q" C$ N; I& ?; O. F9 S! F BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# R2 X3 A: o# P0 W1 f
5 Q7 M. p! n5 K: x5 s BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
, ]5 A9 X/ O' z0 t; @+ W" D7 s) z( O4 \: I6 w, [( t, Y
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 Q* J5 p4 K8 a9 ]; @" r( z9 r3 A2 `7 [
__________________________________________________________________________1 ]; O% T% Z3 i% s4 A$ v1 t" Q/ m+ S
" O$ A) ]3 Q) g) W+ [Method 13( k' J `: A: |7 F8 } ]# {
=========/ q( l5 b6 O8 e2 g( s" I& y% e @
# D9 F) A/ v' W. c e; tNot a real method of detection, but a good way to know if SoftICE is* @- n2 ^) l0 l, d7 e
installed on a computer and to locate its installation directory.
E1 y) _/ D2 q( C, fIt is used by few softs which access the following registry keys (usually #2) :( o' c% m K) M: J
3 t' J$ _3 u o9 S$ f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# e. q Q# a0 l! K
\Uninstall\SoftICE
: C) u; ~& G+ j3 C-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 F. L- L6 K6 M7 d8 R3 K6 ]
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ w; E. }1 J& i& k% S1 h9 X* x q
\App Paths\Loader32.Exe8 q" J. M8 ^: Q+ t) b
O$ W& o7 v6 c
6 T3 E0 y3 r) a+ Q# r' r# d9 q
Note that some nasty apps could then erase all files from SoftICE directory
4 e# X. f1 D( s; v0 k7 Z(I faced that once :-(
, Q3 ^$ i' U; c$ g0 ]. D9 q/ v" H
) F5 I2 ]3 Z7 r1 s: {3 {Useful breakpoint to detect it:- q6 r0 O$ {0 {' `
. a3 }/ P, A1 b2 F. K
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 K9 h8 C3 Y" f( [$ H7 x7 C
5 E8 {2 H$ T& v/ W" r9 f__________________________________________________________________________. r8 Z1 W3 g9 K5 M9 |
/ R3 b) H# m9 d/ M& U
# u. y6 J( {% N# b3 Z9 X4 T2 K# `
Method 14 4 L8 h$ i. H: T2 m1 V5 x; d
=========- @" q1 m, |/ `" c0 U# z4 D
3 K) E1 M/ G; f* R; C
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: o% X# f& v: T+ Q$ K
is to determines whether a debugger is running on your system (ring0 only).
8 S5 Z2 ?7 M0 \2 @1 J# s2 i& i$ \% H# E& X/ j: B
VMMCall Test_Debug_Installed+ k0 }6 |5 R/ F, i, o" r! h5 ]5 C
je not_installed
I! p0 w p! H0 U1 P" n6 C# D5 `- u3 y/ Z }
This service just checks a flag.
2 a: r1 [6 D9 L C& S0 l</PRE></TD></TR></TBODY></TABLE> |