<TABLE width=500>
4 A0 g9 p4 }; p5 M<TBODY>; I0 F8 p: f0 q6 i
<TR>1 ]* x( f7 K. Q
<TD><PRE>Method 01 ; X8 c5 X" A6 [1 a
=========/ X) y- \5 V- m7 V3 O x
6 w' H6 O5 Y! _$ V) H$ A
This method of detection of SoftICE (as well as the following one) is- g& Y( R. J. W0 t0 m4 c8 k
used by the majority of packers/encryptors found on Internet.# V$ I. Q( B; W; A( v9 _; [) ]
It seeks the signature of BoundsChecker in SoftICE
) n9 `. ?- t" ^8 T5 R0 h2 s( ^0 y, K' ]0 R; m$ ~( T
mov ebp, 04243484Bh ; 'BCHK'
/ A1 o" E- }% n6 X4 w, M mov ax, 04h
( i, j# w+ {6 f+ s. j7 Y1 a% Z$ ? int 3
$ v' ~# f' Z5 G6 S& R# ^5 L% ]+ l cmp al,4
% ~6 Y: P- k: h* ^# W jnz SoftICE_Detected$ x4 n9 @8 U) o( H
8 A, V" e7 g" }( [0 m) b___________________________________________________________________________
+ r$ Q- Y, c4 M% I& Z
' U& D& d' C- u$ iMethod 028 v* x% ~( u7 X9 [, \4 o6 c2 O
=========$ I2 b% I+ V8 T# B9 L! l
; l/ f3 V/ V5 `6 G. _Still a method very much used (perhaps the most frequent one). It is used+ [- y5 N5 r9 t& i4 {9 ?
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,3 ~. n! {9 ?4 j) r% |$ b* Z2 F
or execute SoftICE commands...
% S1 ~0 E3 l! GIt is also used to crash SoftICE and to force it to execute any commands
5 U2 |( x1 G- z8 C(HBOOT...) :-(( " B4 l$ G; _) |( ~8 n( Y, S
& N& C7 x, F, `( F1 H" u$ y V; v/ lHere is a quick description:: `4 _4 {; b- o3 u
-AX = 0910h (Display string in SIce windows)+ ?7 T9 i) [3 ?
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 O2 y9 v; Z3 ?7 E: N
-AX = 0912h (Get breakpoint infos)
- J0 k9 O$ {, }7 S-AX = 0913h (Set Sice breakpoints)
1 e; L/ J; P4 p' y% Y3 f* F2 \; r-AX = 0914h (Remove SIce breakoints)
. {) x* W8 @) n9 O5 D4 X- @( [
Each time you'll meet this trick, you'll see:
1 Q) {0 `. `6 T% t# a-SI = 4647h
) }. h+ l1 r( h: C2 ^; l. B- o& _" V2 F-DI = 4A4Dh2 P1 R1 q8 i9 d! r- Z6 T2 }
Which are the 'magic values' used by SoftIce./ ]! x/ C: l8 |
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. f+ @9 u' @2 S4 I6 M; K
/ X8 s* S8 p7 H6 X" a/ mHere is one example from the file "Haspinst.exe" which is the dongle HASP
6 m7 @0 K' T' x7 ^4 R6 `* ^' N* CEnvelope utility use to protect DOS applications:
1 V0 I, H6 k) n0 F8 j) i3 h
% U m( Y' A8 d1 x7 B: X- q
8 ?: R& W# E4 u( E4 t" m4C19:0095 MOV AX,0911 ; execute command.- w% G3 t6 [# e3 U) k3 S8 O
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 P! L" K j4 ?" N1 Z
4C19:009A MOV SI,4647 ; 1st magic value.
m/ O, u2 A, Z* b8 \- M# s4C19:009D MOV DI,4A4D ; 2nd magic value.
0 h! D- A1 F2 A/ G' Q4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; Z5 g* \% k% j7 v9 _5 n4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, W4 V7 ~+ E( z% ~7 X7 t. T" j4C19:00A4 INC CX! X7 m% A& i3 R8 X2 M4 p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% [1 ^8 v0 e- L+ ^
4C19:00A8 JB 0095 ; 6 different commands.
: K0 X: p% o' N: V# W4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. ?8 C. @$ R( ]* z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ |# o0 {+ p" K" `9 ?4 v; Y, o# F) w; E5 E4 i9 l" E0 Q
The program will execute 6 different SIce commands located at ds:dx, which
" D8 c& @" R6 n0 |1 Qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 _) k8 F" P6 g' h3 k. C
' x3 |. k2 ?: w/ W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 [# |/ |# f- p___________________________________________________________________________* I6 o/ n+ Y- b _6 C& N# H
3 k" a, u* w) k$ e2 m0 B8 T% Q* z" |
# Z6 s0 [0 y' m: \+ u
Method 03
. f/ s! D$ ^0 E H- b=========
& B$ W3 l! n+ P+ n; \) b; Q4 Y2 S5 T5 K7 g& E/ G
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
8 N1 r& G0 V* y7 W8 s$ Q2 z(API Get entry point)6 T& n5 T/ v- w" K
1 x6 S( q; U2 N% d/ N& |7 |' t7 V
, D- [8 R% r# H: l4 D xor di,di0 s) [: M( w# G H* H
mov es,di
+ S8 v0 v4 d! L mov ax, 1684h 4 l1 o$ E: G0 x5 e# ?: `
mov bx, 0202h ; VxD ID of winice
. D# K0 s% K+ d3 x int 2Fh
& O: Q' i8 {" S' f- i5 ^% K. c/ R mov ax, es ; ES:DI -> VxD API entry point
; h% _ g2 F) s! M3 F add ax, di E, r& A2 F) M8 p' F
test ax,ax2 R6 W' f1 j! F
jnz SoftICE_Detected
+ g' ~- T& L5 P2 E# G- o2 c7 E; ]$ L" A6 U7 n
___________________________________________________________________________7 m# C; Y9 t2 ~2 r: X/ U
3 U7 Q0 D8 v ?3 b
Method 04# E# B0 ?8 K$ r; r9 E" w5 w
=========
s2 T7 h Q- L$ m- R/ V7 p& A: m# r2 ?2 H3 O9 p0 N* G% b
Method identical to the preceding one except that it seeks the ID of SoftICE
+ b' r4 A; g, ~- J8 WGFX VxD.) K0 y% D" ~; H' A/ j) i9 K* _- q
# H# H; ^" m! L; } xor di,di7 t7 h p4 C. V7 i, {7 }
mov es,di& U: }7 C5 |0 y, J; o7 v3 H
mov ax, 1684h
1 g: @$ b2 _+ N( o2 |* X+ I E mov bx, 7a5Fh ; VxD ID of SIWVID
$ g- `$ q5 A% q- i. |5 N int 2fh
! q9 s1 J+ B: B. x4 ~+ D8 } mov ax, es ; ES:DI -> VxD API entry point
, p, }: a) e1 z& R/ D: `, A. a add ax, di0 ?4 y0 i+ d7 j# {0 y
test ax,ax+ x1 V% L4 [# \( p, p
jnz SoftICE_Detected
* X! [8 P! F2 O0 M K" q, Z
! |2 D% ^4 j, A* Z9 _5 Z__________________________________________________________________________
7 L' G* Z$ h% t8 Y0 _4 z1 }% H9 N% o' F; V
& d, N, d$ Y Q+ d3 A! ^- xMethod 05
6 }- W+ \- ]. R' Q- u0 t, Q=========
5 j' O1 v0 \7 u: z& t. G( G: J7 @0 @" C8 r! @
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& }2 w8 r: `3 idebugger. It calls the int 41h, function 4Fh.* f( `# R& s1 ?% |8 G, ~
There are several alternatives.
7 i% `) I1 a& X4 r3 e% `
- U [7 F2 k7 i* O% _7 WThe following one is the simplest:
, t) a* E8 N* _$ T5 O2 ~% e$ v$ F" k$ S
( y) o: C+ i$ O$ t mov ax,4fh* Q( Y1 m1 b& V5 h# d4 g
int 41h
& z0 S+ N& ~# J0 Q- S+ ] cmp ax, 0F3866 b$ n. o9 w, D1 n
jz SoftICE_detected
0 Y4 c4 x+ O, X3 n5 W
+ P& [! `7 _: E& ^* w1 v _- ^% M* s; k
Next method as well as the following one are 2 examples from Stone's 9 \* x$ R2 w2 W. r4 g6 C2 O
"stn-wid.zip" (www.cracking.net):
& N8 r1 ?0 }' A# S) }# _ ]9 R: w" k% u
mov bx, cs
* t- {) i) o' ]/ u+ H6 R# J lea dx, int41handler2
9 [1 o5 J4 Y: p( N; D. C xchg dx, es:[41h*4]
: x3 J. Y3 q$ F5 I7 L* h- _ xchg bx, es:[41h*4+2]) L3 p8 f% u& h- _
mov ax,4fh
* |" F: B! v' a int 41h
/ Y9 C! [1 ^/ y" Q- i, X% U U xchg dx, es:[41h*4]
; @& s1 b) C/ x% { xchg bx, es:[41h*4+2]
, C' Y0 p! a& o( C2 u8 }7 s cmp ax, 0f386h
: W) V$ j# w" N5 X8 l" d2 K$ S3 @0 i jz SoftICE_detected) u; |7 b1 ^6 n5 h+ r+ V) G) @
. b9 B$ ]8 ]. Y7 cint41handler2 PROC. ~# {5 P7 D" \7 ~9 j: H7 f" n
iret
/ n* a6 m& t' n6 W1 b) W+ Cint41handler2 ENDP9 t# w3 b ^$ T% g7 K8 N/ [) z( p! F
0 m; m8 W, u4 d( w3 k3 T. ]# {. Q* t: ?6 z
_________________________________________________________________________
& @- w) [3 d6 k5 E) I
* a, D2 j @2 w; |7 d: W) q9 v- }$ H
Method 06
+ O2 ]4 b0 |& C$ l+ Z# j9 _=========* _: h1 a* a9 Y8 C Z, R
1 o2 L E# C3 N/ U$ |
. G3 Q3 ^7 J( o& W2nd method similar to the preceding one but more difficult to detect:# ~- e9 D, z3 [1 `4 c( t! h4 {
$ l6 X/ [0 g8 I! Q3 c+ g/ }
5 L. s; b9 R* P# Z0 n& \& E6 xint41handler PROC
9 }2 \# M4 d- ?0 r mov cl,al
$ @: l$ S5 O7 Z1 t2 S4 E, v( N iret
Y5 e" B) \+ p) V' bint41handler ENDP. }/ b9 B+ b2 p7 ^- p
/ N" p$ p' ~8 p; z2 b
$ d7 R3 C7 S7 W# G4 D0 L
xor ax,ax
" ? o" P* G8 _: F6 K+ G mov es,ax
8 ?; ?0 y4 U, A/ E4 x* q mov bx, cs
' X" U) R! A/ j lea dx, int41handler
9 z) }: I5 G' J. j, _0 M& e. O7 z3 | xchg dx, es:[41h*4]
7 B, L3 w; F' o7 W8 U! X$ }8 R xchg bx, es:[41h*4+2]! C: l2 V- e! L" |( o/ C- |
in al, 40h
5 m& l* ]3 T5 _* X# | xor cx,cx9 x! B/ w) Y8 a5 P
int 41h
$ r: K+ B' o6 s" y, H- N. I- c xchg dx, es:[41h*4]3 r' |, x# ^ K# C- H* u+ C% u+ f
xchg bx, es:[41h*4+2]
& }" B. J3 p8 z& X( k cmp cl,al; w/ _7 ?, v- T
jnz SoftICE_detected
$ {6 } ~8 `* B1 M7 o8 L- W! Q$ J. r" l, s3 Q p! c% _) ?1 i! C. A- [
_________________________________________________________________________& f* v! }9 {) c( x
1 d4 D: M+ L! I" c
Method 07
( _ T! m7 g% w! U4 b=========' @! x+ q3 x3 p
% g n9 M8 Q) y( YMethod of detection of the WinICE handler in the int68h (V86)( F) B9 b' t5 s
" A# V, U/ F+ T
mov ah,43h5 }2 L' a% u. n5 m" m3 B" c
int 68h
/ W; d4 O8 ^8 {2 ]0 W9 R K cmp ax,0F386h# m9 d' i$ _% n: F
jz SoftICE_Detected
) I0 [ C9 ~" v P3 }& N! ?1 A: x
+ g' V; D: [8 D9 A- P6 P X1 c+ b2 ]3 J% x6 V! y+ ^% p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; N! v5 g2 [4 X$ C! o
app like this:$ v; a& z5 V' C0 U' s3 e% V& C% u
; S1 n# F. K# J0 t: E
BPX exec_int if ax==68
: ~6 k+ Q1 E# K) C (function called is located at byte ptr [ebp+1Dh] and client eip is
, I, F, q9 [2 c# t located at [ebp+48h] for 32Bit apps)/ t K# _) P) `1 X4 z2 ]4 |
__________________________________________________________________________3 J0 R3 _/ k# V8 S" J
1 b( |! Q' E- w; J8 h, D" D! d+ ?" D- B5 Z
Method 08( W) ~0 x3 f) K( W5 r) s
=========
& f; [" O$ p' {" e% b) W3 o/ w( h7 R \1 L M2 S1 }" e
It is not a method of detection of SoftICE but a possibility to crash the( {# l* ?. H$ {) |6 v! x/ S
system by intercepting int 01h and int 03h and redirecting them to another
0 ]' n$ W! t7 C' I5 lroutine.
$ S% {6 I/ E* `8 V! R' f. ?It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 s9 |$ P- Q F" k, C# p6 ?
to the new routine to execute (hangs computer...)' Q n3 L+ I- K& p1 i" _+ a
, Q) p! v* w4 M! X- t; X1 F mov ah, 25h
( b& l, L! C/ Y+ K0 E8 D, ] mov al, Int_Number (01h or 03h)
/ g3 e3 T: ^) S+ a9 \ mov dx, offset New_Int_Routine
$ N t/ _$ k* p$ [8 |) i. C int 21h/ y: V8 N! S5 N& a( p: R% V# d
/ e1 V! r- V* T0 l+ K__________________________________________________________________________
; U o6 _& x% H! [5 T. d
- U r6 A% _0 u' `2 i, K" i J4 rMethod 093 b U5 c3 \4 m3 `$ ~. a
=========0 Z" r( {8 h- l+ L$ n( V8 k
y6 Y% ]6 K" G. ]8 D
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; e# G5 z2 m; r: ]" r& y7 I4 Wperformed in ring0 (VxD or a ring3 app using the VxdCall).2 d* j! y: N5 h8 S6 D
The Get_DDB service is used to determine whether or not a VxD is installed
& x6 t, s V" R6 J7 @for the specified device and returns a Device Description Block (in ecx) for
3 \3 F$ ?8 V: \& ]" X) _/ jthat device if it is installed.& t0 Z( Z( U- Y, ]4 i
0 q! y+ Z- v; L" N4 M {* R, r
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 L+ Z8 J. ?1 O6 d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 L: d! W9 n( w( q( E( Q: s0 K3 s
VMMCall Get_DDB/ I% {( w# @6 A/ G+ j; |
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
y) b+ A) P6 n! f
L' n' A& ?) ?4 H5 I" G; I) c$ k! rNote as well that you can easily detect this method with SoftICE:2 K" q8 v5 Q" m+ R7 u
bpx Get_DDB if ax==0202 || ax==7a5fh
9 a: e2 _5 H+ G. a! P+ k0 a
: A9 z0 J" u) n! X4 A9 D__________________________________________________________________________" ]$ ~9 I0 [& K+ ^
0 l& ^- U. m- B+ h6 y4 _Method 107 e. V5 [9 R; x$ N
=========" L# g) }' K0 R7 e( n8 _& m C
! ?! k3 U) H, I9 ]0 r=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 Y, ~" ]5 k" z# d) p* } SoftICE while the option is enable!!
) @% r9 a. e0 o, t/ C7 f5 }7 L& y0 T
This trick is very efficient:3 w! I" a* \, b8 q: W
by checking the Debug Registers, you can detect if SoftICE is loaded7 n+ q, v5 s o. k2 m1 [
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- i# q$ k! }; W9 n% bthere are some memory breakpoints set (dr0 to dr3) simply by reading their) k3 U: H0 _ O2 A
value (in ring0 only). Values can be manipulated and or changed as well
) K. R$ c% F* N4 @* Q(clearing BPMs for instance)
' c; n0 O- s) I5 A$ {9 h( k" K w! \- `
__________________________________________________________________________' ~5 P! Q/ j# m: u; I" U
' y Z3 @5 A, Y `: L. E
Method 11
, G$ i( b# E' s7 a4 E( l! p* R=========
4 \: Z; F+ A$ r B1 T2 M3 @4 }4 ]# i* e2 O* ]% I' ^
This method is most known as 'MeltICE' because it has been freely distributed3 W7 }$ ?6 a/ q2 w% B1 V+ U
via www.winfiles.com. However it was first used by NuMega people to allow
8 `: ?( Y7 L; K% Q0 ~( sSymbol Loader to check if SoftICE was active or not (the code is located
7 k; j& P, c4 S: vinside nmtrans.dll)." l H, j0 W1 Y' s r( ?. m) [ R
5 O! a s9 }; k3 f4 r4 Y6 ?, GThe way it works is very simple:
0 a1 `% s f' y/ eIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; m* n" U: v2 ^% f
WinNT) with the CreateFileA API.
8 \, F( V' R3 \2 X
5 @+ b5 K Y( x' q$ g" FHere is a sample (checking for 'SICE'):
/ r7 J4 `4 ?- T" @% U( T# [, N- `# [) A6 ]! T0 ~6 l
BOOL IsSoftIce95Loaded()- ^8 r$ B D( n, I E3 R
{5 m$ n8 f9 a5 v2 x: @* {9 M
HANDLE hFile; / ^" c5 P( S' C8 v3 f; `2 Z5 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ u( L; j. h+ u2 [
FILE_SHARE_READ | FILE_SHARE_WRITE,0 n/ L, z5 \; r, X; A+ M
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ k T- I+ F. _
if( hFile != INVALID_HANDLE_VALUE )9 l8 j* A9 U7 V3 `+ o% j, X6 D
{- f9 X- X! B# x. R' X- B
CloseHandle(hFile);$ V! _/ y! v4 J: u# ~1 J
return TRUE;9 W# z% n; h7 F/ U% E
}% q& O7 o* p5 H$ H& F
return FALSE;7 R, [6 F) @: y( t3 U* E
}
6 `/ y. ]- |. B! W5 ?5 Q* t$ E
$ P/ c4 ]+ a7 _& wAlthough this trick calls the CreateFileA function, don't even expect to be! c5 E" ^1 \+ I: F
able to intercept it by installing a IFS hook: it will not work, no way!6 ~2 S( x& q* _
In fact, after the call to CreateFileA it will get through VWIN32 0x001F F8 k$ F$ E! K; U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ d( J) {: a3 I: X! I' |3 T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 x. W2 S: Q& d& T9 w/ N$ }' Ofield.
% T. `- L4 L8 n0 I9 G5 C$ [: P7 _% @& h2 SIn fact, its purpose is not to load/unload VxDs but only to send a
/ R6 y9 P h1 YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ k4 r6 n- d5 I. I' e* T
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ b! b) L$ }7 i
to load/unload a non-dynamically loadable driver such as SoftICE ;-). J5 O) L% t/ W
If the VxD is loaded, it will always clear eax and the Carry flag to allow1 q3 v+ L) Q c) j) X6 e
its handle to be opened and then, will be detected." y* r" _+ `' ~) C" _
You can check that simply by hooking Winice.exe control proc entry point
. B4 A" G" H& E9 `/ n9 Owhile running MeltICE.% @, j- s7 D: {" ]2 o
6 U' a! U7 h. C$ I( {9 w7 i& {1 u! T( q6 `& j6 \7 E
00401067: push 00402025 ; \\.\SICE
/ U- I5 z5 G% \ 0040106C: call CreateFileA0 v4 Q2 D1 q- w* D) e2 ^- B
00401071: cmp eax,-0017 l6 Y1 s! {2 C3 v0 j
00401074: je 00401091# x: q0 [0 Q4 @0 I$ ?/ j0 v0 r
4 ^+ V* X6 \/ q
0 Q/ ^* e7 W$ S( T% ~) uThere could be hundreds of BPX you could use to detect this trick.0 z5 N2 T3 A8 T3 z+ m! T
-The most classical one is:- q% k9 q8 B I0 h& f
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! e( e4 C$ a. j *(esp->4+4)=='NTIC'
( X& X6 ]7 y3 |6 X# C' L2 @
8 \1 W! I! l* A3 [0 f- P; r! a I-The most exotic ones (could be very slooooow :-(
' S5 |/ @5 X* K* L! t9 L BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
7 O& v. f& v* U' C ;will break 3 times :-(( w! d* l: o. i4 z) c; z
& \$ S# ?3 g/ ^6 E-or (a bit) faster:
. X7 K2 b. P0 ~: M# e& o. H BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* `3 e" @1 |* ]' ^9 O
p$ N5 I; [4 s1 a) ?# ]* y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, h& ~) Y9 c# T) u; |4 X ;will break 3 times :-(+ s6 |+ I8 a0 F4 ]- n( m% S
) K( y/ O! Q1 b; I' e
-Much faster:. ^! a/ x. B, F$ B h9 R( D+ B3 Q( B
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 O& H: l; \1 X1 D' b2 z) W8 h' U+ w ~1 ~2 y- |2 N0 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 R) B5 e: {8 Q7 ?
function to do the same job:' a7 o! X+ l* V+ s: k
9 c# J! o3 r* r, O1 ?0 @, T push 00 ; OF_READ* [; D: F# k; k! F N2 e
mov eax,[00656634] ; '\\.\SICE',0* n+ {$ u: v. h9 m9 Z n) M
push eax
. c+ r3 H3 F+ [; m; r call KERNEL32!_lopen& P2 A6 B; ~) N9 Y8 u
inc eax
5 w* r9 w& g; A% X' F jnz 00650589 ; detected5 Z* m# J3 D |6 Z! n5 R( R
push 00 ; OF_READ
( K; b: ]- _0 X. K: r mov eax,[00656638] ; '\\.\SICE'1 g/ x9 k/ N* K5 a
push eax
5 ~9 h* b- W' E8 \( o0 q6 [8 ` call KERNEL32!_lopen9 g4 c- Q% C9 s7 v
inc eax
: J- |+ r1 e. ?4 y& ~ jz 006505ae ; not detected8 [5 S: B& E, B1 A1 x
) R; v* V/ H- _5 L$ H) W8 S: j6 ]. U# K7 `9 b
__________________________________________________________________________0 m- N2 o& {7 I7 }+ t
2 R$ C5 P* x" t' S7 F8 L6 ^
Method 12( V4 w+ _) j' F% e' h' F
=========
# e1 B0 f- s+ c% N$ U. n6 J
7 Y, K' c4 }' i1 E* C& \This trick is similar to int41h/4fh Debugger installation check (code 05
3 X2 j* j U# E# o& 06) but very limited because it's only available for Win95/98 (not NT)
: J r' r6 B5 }, R7 C" Fas it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 m6 K- d% f3 l6 p) i4 s; d& G0 K
- Q% x: |3 d% A, T ~ push 0000004fh ; function 4fh
- ~7 p" e8 Q1 {! i push 002a002ah ; high word specifies which VxD (VWIN32) S1 {# `; j3 f4 T
; low word specifies which service
( P% T6 T% C n5 F$ d; p (VWIN32_Int41Dispatch)( S) d5 m: E" }7 R
call Kernel32!ORD_001 ; VxdCall
0 e r7 S; N2 U' E cmp ax, 0f386h ; magic number returned by system debuggers$ j. Z# q# y) C! F1 g
jz SoftICE_detected
" d2 L1 W1 H. ^% Z" o/ f3 J+ ~' t0 k/ Z+ E* g. f
Here again, several ways to detect it:) o e, V) @, S g; H6 l
* Z& h: H( u; R5 p BPINT 41 if ax==4f
& ^& @5 p% O7 d9 I) V) r# }9 H! i3 d4 @. w, @& R0 j
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! m$ ?4 |, K1 U6 Y, P' t: D P* g+ h) j& Q6 H
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 C; K" H3 f3 \& R$ _/ w
D: e" @/ J [1 X+ F2 P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 b" r! u" f+ C
4 E9 z+ e# S1 t__________________________________________________________________________" }4 X; @. c1 M) {
6 P$ ^" I' H$ n2 |Method 13% e4 e* P: o+ K+ {, }0 z5 t3 G
=========/ j `- j$ u$ W5 j8 R3 x: U
& I6 @" i3 ~. v5 o' Z
Not a real method of detection, but a good way to know if SoftICE is
+ z6 K4 ^. a/ |# N- Z B; V' ninstalled on a computer and to locate its installation directory.: ^+ z: o8 Y1 {" y5 \) k
It is used by few softs which access the following registry keys (usually #2) :) Z" H6 l+ U+ J5 E/ t: ]
* b( B* R& o1 w/ f, G* @) T: U5 X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion i% t4 X; S; x9 e ^- b
\Uninstall\SoftICE3 f5 g$ y0 B' L* x
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 I- B' {- O/ m$ P# c$ G
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 m& m. M0 W' S p, _" P\App Paths\Loader32.Exe0 ~( s6 R! W, P+ v
6 m2 U5 L: `6 z" X; U6 D4 k7 [1 q1 l* I& O* F) p
Note that some nasty apps could then erase all files from SoftICE directory* L8 y* U7 E6 o. ^+ p" ~
(I faced that once :-(
$ `. F; J3 o: F% c. Z
1 i, Y: ~1 s; M7 ~/ _$ K9 V8 TUseful breakpoint to detect it:
& ?5 X# w& e/ e3 a0 A1 q4 Y# M4 X l7 `
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'- e, }' w0 s$ i' B' A- n' b
+ Z; T4 q0 n7 h: S) z3 u1 Z l8 F% v" @__________________________________________________________________________
/ e% u' a" o2 ~: ^, E
( n4 w8 D: Q# l2 \3 Q% U- K* L# P* b% _, c! C
Method 14 , _% H5 m+ t \* r) Y
=========, z" O) Q+ D4 x+ X' u- U' p
- ?2 L% ]: W# @9 r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) J" _ y3 ]7 Kis to determines whether a debugger is running on your system (ring0 only).
) H' P3 c8 u% C( F
7 A0 h& T; x" Q9 E8 E4 A$ S VMMCall Test_Debug_Installed H* ?# t8 i z# n+ B0 W
je not_installed" J; j5 d% j5 v
9 G# \7 S8 ?$ W/ u6 V* }
This service just checks a flag.
( A' X/ x5 F- d4 H</PRE></TD></TR></TBODY></TABLE> |