<TABLE width=500>
' D* `) ?: F2 |5 W! k, |<TBODY>
- A; h: F# B4 C( q<TR>
' G8 L% x- t% z<TD><PRE>Method 01 ( d( c% j, q) b
=========
- b2 `, W6 s. }: z$ A% F X0 D) }8 w+ B- M3 y
This method of detection of SoftICE (as well as the following one) is
% W; y6 @/ [1 X( w) fused by the majority of packers/encryptors found on Internet.6 X$ ~6 \! f* g
It seeks the signature of BoundsChecker in SoftICE
* t f- F1 H. c4 \1 D
( f6 H- t; q. C9 b7 W' j/ M mov ebp, 04243484Bh ; 'BCHK'
; \, ]* \: P# V' E* y# A2 u$ C mov ax, 04h6 `: Y' `$ k; H( A4 b7 Y2 e7 ]- f
int 3 7 w& a( e; B+ O- Z0 N6 V: r! y! P% Q
cmp al,4! I/ e+ J* r$ |3 z% g
jnz SoftICE_Detected* v. Z6 [6 n5 c2 q3 y* z8 H$ _
3 F8 E$ k0 r, ^2 K/ x) p
___________________________________________________________________________
# m6 b7 S) M* [8 H6 e
4 j4 q' ?, H2 t uMethod 02
/ W# @" ?9 A% ^+ g=========5 c9 x' @; E6 [9 K0 n0 Y. F
8 ?+ T n3 E- o( ]; \; m) Z
Still a method very much used (perhaps the most frequent one). It is used2 Z* l8 ^: _2 i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) W8 L4 K0 X7 ^6 g7 eor execute SoftICE commands...3 r# ~0 r5 |" K. ^/ {3 F9 ]
It is also used to crash SoftICE and to force it to execute any commands: s; f }7 m3 K# I$ b, E% }8 Y2 ^
(HBOOT...) :-(( ( t0 Y; m2 i% e. E6 C" x
! X/ [7 b+ g. _$ T |& {" vHere is a quick description:
: t1 g; j& O7 H, }( c-AX = 0910h (Display string in SIce windows)- o) B; p# t0 t5 ^
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 a0 a) g/ E5 V; k; q1 F0 z% e
-AX = 0912h (Get breakpoint infos)8 g% i1 k, K4 T
-AX = 0913h (Set Sice breakpoints)
6 Q5 w1 \: x# Q8 j* K- C-AX = 0914h (Remove SIce breakoints)
5 i8 ~6 D) Q& r! N% z
; N9 J6 U2 X$ ]+ K x' @7 t) Z8 }Each time you'll meet this trick, you'll see:% m2 T7 B" r5 m+ x
-SI = 4647h" T( n9 P# h/ x9 N- {
-DI = 4A4Dh
" Q, O4 e- x9 [ o9 o+ aWhich are the 'magic values' used by SoftIce.& T0 m* ?8 [0 J% Q7 B6 j# V
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 x5 A( R a9 B) b' K4 B U
+ \" |# X$ m! h- V6 rHere is one example from the file "Haspinst.exe" which is the dongle HASP5 t. c0 n/ H6 m* q& c5 y
Envelope utility use to protect DOS applications:+ B" f7 F" X; o: S5 A7 E; P
! }- h! g& H- `0 X+ j
1 o2 s) W* L8 u& q( f# b4C19:0095 MOV AX,0911 ; execute command.8 c/ p% [/ s+ h. F5 n; P( \. Z
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' A9 w' k/ r9 ]9 }4 ]
4C19:009A MOV SI,4647 ; 1st magic value.1 X- R( c2 k. B% q, k# c* h# {
4C19:009D MOV DI,4A4D ; 2nd magic value.
6 x+ R/ K c, K% `4 I# a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- P% n( D5 |4 x) q/ o$ z" b k
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& I {' K" W( }0 V4 J* a4C19:00A4 INC CX
/ t. F2 z6 Y8 F" `; J( W4C19:00A5 CMP CX,06 ; Repeat 6 times to execute7 r! J0 u2 T- ^! W$ ?* g! L
4C19:00A8 JB 0095 ; 6 different commands.
1 X* H& j& o' x, r8 G2 I; r4C19:00AA JMP 0002 ; Bad_Guy jmp back. `( @4 Z9 \' T# |
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 ~% `; _7 w( ?0 Y# u9 n: T6 S8 Q2 ~" K8 ]+ s( Z4 P# H
The program will execute 6 different SIce commands located at ds:dx, which) i8 X9 \/ b0 f) T
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 p& K1 ]0 p I V+ E& h+ f
$ E+ K' J) f4 ?, q9 W$ i' D) O! a* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) D, k/ V& k" H2 M7 L( W6 m, T
___________________________________________________________________________
7 p4 A5 {3 h4 h' [6 j
) n0 N. u$ A' q5 I% s a
5 k: r; k* P" c) b9 j/ c4 V7 ?6 a3 QMethod 03 \0 J( N( T. @ ]4 K* \1 B. J0 i
=========
5 h1 r/ c' @& p0 q" s6 T
. D$ U: {" i4 O- f" L" B( j/ cLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' C( t2 r' n. b+ d: K
(API Get entry point)9 v2 H/ O' @: y) ^
2 ?. F: L5 t6 _" v
& Q: C+ ?+ P! [
xor di,di
0 Z/ K. S* w8 Z mov es,di
$ E) N" [3 M& @' o! u mov ax, 1684h
2 _$ z, v: l8 Q3 E! H mov bx, 0202h ; VxD ID of winice2 y# }* o# _" h6 p9 k
int 2Fh7 I+ m( o" h9 N+ L0 ?& x
mov ax, es ; ES:DI -> VxD API entry point
7 O; i/ {9 r4 y, V% b8 Q% B c add ax, di
, F8 L0 `8 I+ D" L/ Y$ b" h# h test ax,ax# P3 q! ?' k3 Z; P2 L: e
jnz SoftICE_Detected& P, }/ G7 }+ A/ ]9 C2 b
0 A, D8 @1 w- e9 y q( `* F9 G___________________________________________________________________________
% l* T! _" k* {8 h4 G
" ^5 q1 ]$ x# g8 {Method 04
& A1 ]/ x# c5 a1 x& u9 N7 f5 I=========
9 |! N) h: D' ~- \; j* z$ e) R, U4 b
Method identical to the preceding one except that it seeks the ID of SoftICE& r8 b& c+ B1 b/ h# K: @ k; ~: Q
GFX VxD.
4 t1 g* P6 a/ O, s1 L: X2 p0 V7 d( ]8 v$ H8 m
xor di,di% {% z; k2 ~# r
mov es,di
+ `7 S- i! l8 i8 z0 d mov ax, 1684h 9 e/ A- S& V/ c# u& C
mov bx, 7a5Fh ; VxD ID of SIWVID
% T Z( N+ \ l int 2fh
+ O u, y. v8 X v" C+ N5 T8 S4 n mov ax, es ; ES:DI -> VxD API entry point9 a, W3 i8 T0 @5 a. |: i0 V9 D
add ax, di
+ H" c9 M( k3 i" K/ t test ax,ax
; h* j1 n8 ^9 Y; f3 Z jnz SoftICE_Detected
/ [" W" s- U$ }; P- |7 V
/ O+ j/ A9 N/ p) ], E2 e2 p__________________________________________________________________________
& Z5 p0 G6 O/ ~' E9 X/ w, a5 I7 g9 H2 V
2 `4 [# [" Z. [5 H: y
Method 05# z" o8 `0 d2 d) W% c& c$ i
=========
. H1 P9 f4 b# s4 ?( d/ |8 E% \3 s' Q' y- k
Method seeking the 'magic number' 0F386h returned (in ax) by all system5 A7 ?3 K+ G9 v" ]2 y$ A
debugger. It calls the int 41h, function 4Fh.
; o: _4 R" c' R( ?( f. uThere are several alternatives. , i! _: `( B) Z- ~( a) f
) x6 k1 |$ A @3 ^The following one is the simplest:
+ Y* d% [* k* `
# h! `5 e v6 d* ~! }( \: X mov ax,4fh* d5 v; N7 F6 v$ q5 [" r6 W8 `
int 41h2 p" W" E- i% T6 C% U/ B' j+ b9 ?
cmp ax, 0F386
6 V# M& _" {+ E+ `+ i jz SoftICE_detected' h7 X' o% g( T7 N( e/ v, j
5 V3 }! _2 k9 V/ f0 N5 }, q! O1 P3 I8 k; o
Next method as well as the following one are 2 examples from Stone's
1 q1 e: U8 `( Q: J% d% p. l"stn-wid.zip" (www.cracking.net):# E5 p, m; Y! ^5 n
4 \4 R$ j( q/ Q$ Y& x- W; m
mov bx, cs
. L: n% l3 g7 h; W* P3 a lea dx, int41handler2
5 y- }( m7 T# E5 H5 ~3 L xchg dx, es:[41h*4]
" W+ l2 A1 s; X, A, h xchg bx, es:[41h*4+2]9 b2 [$ e! k5 H. b8 K
mov ax,4fh- X& g# x$ _$ r% C& q
int 41h
2 m2 {# O- L; A9 J1 h xchg dx, es:[41h*4]
5 _6 ?$ A. l: O xchg bx, es:[41h*4+2]9 |( h( }' Q7 r/ J) S6 l6 f
cmp ax, 0f386h$ u! w* t4 t0 @% q& v7 w1 L4 T
jz SoftICE_detected0 g1 r6 M4 f# O# v
{6 k8 w$ i$ m: A8 L, j
int41handler2 PROC
8 x9 h6 m0 Q3 Z; M iret7 k# y( i* M; W9 O% c4 A' r
int41handler2 ENDP+ a' n6 _+ x/ A% q) y4 r
$ A4 Q; ^- |4 l: z4 P. A
G# G! |. H2 a1 @) B3 __________________________________________________________________________
% u4 ^- e' G8 c2 |7 [ |
' S9 u9 M) [" a* l
0 ], U3 C- d' S* E& CMethod 06
3 M, _, y% [) x! C3 c! a=========" v0 e$ F$ }% J. ?% I8 x! v& p
/ p1 ~) ]8 N9 x
, @! t/ j& E0 {$ b- F& P2nd method similar to the preceding one but more difficult to detect:% F2 H" h5 G+ U4 E0 b# N: w
/ V# o- z ]' ~( M, L: J: ?6 Q& C" \' T4 s8 B! v3 @
int41handler PROC2 f0 K, h4 f! R5 ?7 |) O* S9 l2 t
mov cl,al2 O/ |- S% {5 X; j2 A+ H K
iret
/ r; J6 O5 z$ U, ]7 @: `int41handler ENDP
- u; J3 [6 ?0 ^ ]. C8 j3 Q8 v3 i' J. h& u, b8 C
A y$ [& j& S. r xor ax,ax
3 I4 y9 @8 @* g L8 d. Q* P* r: S$ V mov es,ax9 [2 K! ^+ B8 m0 H' m6 [3 ?2 F" V
mov bx, cs
' }. U$ c+ U% g2 ?9 L+ @5 ^ lea dx, int41handler
+ S) Z9 F% Y1 N0 n0 o7 ^0 M9 `0 t xchg dx, es:[41h*4]# s+ m. m: E- w0 I
xchg bx, es:[41h*4+2]
4 z6 h% ^. |% ^: [7 { in al, 40h2 N0 b7 Q% [4 ?7 k' s
xor cx,cx
0 g" y! d8 v0 c" [1 x+ W5 {% ? int 41h
, D6 V8 O! _$ P" v3 q% ]3 a5 ^ O3 w- e xchg dx, es:[41h*4]7 y" o- |/ P8 t' w
xchg bx, es:[41h*4+2]% n6 |8 E2 ^4 Q0 Z" e4 \. m
cmp cl,al
2 C0 M1 a0 S5 g* F: t2 [ jnz SoftICE_detected
0 |0 _3 I6 h! i' u3 d/ P% n! Q" I" y; {" X `+ c6 U# [; @
_________________________________________________________________________5 y' F' N- q1 R0 Q( z
, N( F7 q3 t4 S3 A+ ?8 w9 h& TMethod 07: A% _9 D3 e1 g4 V2 {6 w
=========
, R3 v9 T3 v& V$ ?% I/ n' z7 b$ u' l6 |4 u; n
Method of detection of the WinICE handler in the int68h (V86): a$ I% c2 @9 |! w- Q: L
' a0 p' ]2 y' n% A. M6 a. g- L mov ah,43h
- Y7 r q+ X H int 68h
; A9 K! n. b4 R* w c4 A1 z! p cmp ax,0F386h
% m; k# _- V7 g) P K% r4 ^8 y8 m i jz SoftICE_Detected
9 `1 g/ ~* M9 l5 K+ t$ z- p2 B1 b! z' o- e8 q% x% q
8 X& ]" q- X y) p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ n+ q- e# @* @4 r& N" ^
app like this:# @2 Y7 ^! E; W
/ ?0 T/ _3 _% [. m) p BPX exec_int if ax==68* H* r* Z- O/ I& B& F& H
(function called is located at byte ptr [ebp+1Dh] and client eip is: z' P% B. t4 K/ c }- n' d
located at [ebp+48h] for 32Bit apps)
( I' `/ L% {4 J__________________________________________________________________________; f. u1 Y; ?. ^! T
" \/ a) r* l" T# W* l
9 N, t' Y3 B0 n/ S7 X" e8 z- Z4 d
Method 08" R% m1 S& I! z& o
=========' u8 y( [' m) S3 v% o/ b
; s3 t5 E- v- n! LIt is not a method of detection of SoftICE but a possibility to crash the+ d2 O2 b& H$ g; n4 G
system by intercepting int 01h and int 03h and redirecting them to another" R& e2 b( A7 Q$ L9 H
routine.
9 z8 d b# z" p5 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points0 p. T5 W1 o; j2 l
to the new routine to execute (hangs computer...)
) ^1 K# |7 p4 J$ N; M0 ~) o1 M' e0 s- p9 X* n
mov ah, 25h1 G7 K" ]' x3 @* ]9 |( U$ A: u
mov al, Int_Number (01h or 03h)7 L) u" ^% f8 h$ f
mov dx, offset New_Int_Routine3 i W1 B5 g; S; g
int 21h
/ \: e& E% u$ e" t# E' B& h" N$ ^4 b* E4 v
__________________________________________________________________________
Y/ K( Q, t( M/ Z' C3 q+ R
# h5 [: H4 q* _& wMethod 09 E6 F( K T# {8 f! N4 W
=========
. i: r* Q+ U# v+ N( T: O! Q7 w5 c( l; D" V! A# H% d! i+ C O
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
. B' K0 y- Z. z. @7 Q1 |performed in ring0 (VxD or a ring3 app using the VxdCall).
$ f; C' k0 P J8 S+ ?The Get_DDB service is used to determine whether or not a VxD is installed
, ^$ h2 M o3 b- c$ ^for the specified device and returns a Device Description Block (in ecx) for
( i2 K( R. a" c7 [! Ythat device if it is installed.3 i/ M; B0 J0 ~- V. \7 p- ^
! ~, o+ [2 _/ u' W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID K% m P; O& U# ]7 l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# b8 V6 \! d0 [2 y/ ~ VMMCall Get_DDB
6 ~; C1 d( H9 y- V9 F. ? mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 J; p) o* w3 V" r G# S7 [/ g* @7 L" [8 g/ g8 J6 N2 d
Note as well that you can easily detect this method with SoftICE:' J1 A% }% l( O+ f1 w( q: k; x$ h
bpx Get_DDB if ax==0202 || ax==7a5fh" O+ Z9 [& o+ r, T$ i E5 U: H
) U$ i7 B- x" X
__________________________________________________________________________
2 A( C1 H) C9 U0 }' Y; i3 Q* [7 S( g6 T& a7 g
Method 103 M6 ?/ ^* k! R8 t
=========# U' _9 G% k! J8 ^7 {, S, v" v9 ?+ F
# _+ T: H% j# v: c2 _8 u3 X' j/ L
=>Disable or clear breakpoints before using this feature. DO NOT trace with; k, z! [" }; f$ C$ t m
SoftICE while the option is enable!!$ |# g+ D r3 d u
3 k4 ?: Z7 n4 X. Q6 O2 y
This trick is very efficient:
% d& m9 ]& z3 }1 E! z" R) @3 nby checking the Debug Registers, you can detect if SoftICE is loaded$ U2 P& B1 b; b2 B' o8 S
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, b! }5 J! _' J( ]$ k7 cthere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ v: l4 d% ~0 \2 g$ O1 F9 avalue (in ring0 only). Values can be manipulated and or changed as well
6 g" C' K8 L: G% |, q6 v. i(clearing BPMs for instance); I( @/ c3 A3 A$ r0 D B# |
$ c' {5 r- x# w% j! X
__________________________________________________________________________& |$ v4 J/ R7 |
* h; l1 f3 f$ e9 E0 _: X2 eMethod 115 \7 Y2 Z2 H8 [( I
=========% i$ ^4 t/ N- A
) Z4 ^) K9 z" K+ C/ q# ?This method is most known as 'MeltICE' because it has been freely distributed
9 S% S7 u, @- V! Q0 v) zvia www.winfiles.com. However it was first used by NuMega people to allow+ u+ c6 P! k0 O0 S6 u
Symbol Loader to check if SoftICE was active or not (the code is located
+ w- ~0 ]+ G) @inside nmtrans.dll).& Y1 L) |! T9 D2 D. A6 Y* e; `
9 n2 N- v7 f/ f$ k. s! TThe way it works is very simple:
4 @. g" m( x- \0 L1 @$ R1 @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 C1 l0 {; {+ X7 Y k
WinNT) with the CreateFileA API." t ~0 k& i6 }
$ R1 B9 R- g+ U3 ~5 b F, k
Here is a sample (checking for 'SICE'):
# z3 h& O4 d! I7 N7 B1 |7 ]# H* Y! [4 \5 S2 Q9 y) ~, ~
BOOL IsSoftIce95Loaded()
( L3 H6 S, A) s8 g{, Q9 Q; c2 m5 m4 }: E$ N
HANDLE hFile; # e% _9 @& C Q8 t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( V2 _4 ?/ X% ?2 G# ?2 v5 f- ^: l
FILE_SHARE_READ | FILE_SHARE_WRITE,) z, r8 _4 E. A, ] d
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 j" F9 N( O7 ?5 b9 ^1 j5 ~
if( hFile != INVALID_HANDLE_VALUE )
5 _2 T5 l/ s. }# t: `, I# _9 x {% \0 q9 X [5 x
CloseHandle(hFile);( w! U8 w0 q# B
return TRUE;' o' P3 ^' V7 v. Q! h2 t
}# ] ?. M- u0 c' \1 i! h8 I4 Z' h
return FALSE;* ?. G+ J- \1 F3 |
}! Q3 A& K" R/ S2 R# u* O2 l# Y
, Y+ j* C2 E" r# A- dAlthough this trick calls the CreateFileA function, don't even expect to be ]" v4 ?3 K) ? y0 C/ k
able to intercept it by installing a IFS hook: it will not work, no way!
6 E2 p! k+ K$ `! Y' i4 K4 @In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 k. t& k: x! o$ b% c7 d8 eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). m7 J5 m7 B; `* E, l* Q$ Z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; \- g( z# p6 h1 p9 ]' j. S$ n9 Sfield.4 z, K8 \* A, z5 U3 X
In fact, its purpose is not to load/unload VxDs but only to send a
8 c- S1 r" d4 U5 c- B/ U! CW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ p; ?+ |9 Q) H/ S& Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try0 l" R: q0 E# o h- [1 s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 l3 j' _6 D2 x& dIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 Z; |* y: @3 f- Z Z: ~0 F; e4 \
its handle to be opened and then, will be detected.( A& @8 {, a+ w/ J7 B
You can check that simply by hooking Winice.exe control proc entry point: G0 D4 J) W" _5 r" u
while running MeltICE.7 v! z9 {9 X- H
7 W4 U* \/ l9 a( N4 X) U# Z; l, g0 `/ m
00401067: push 00402025 ; \\.\SICE# m' d$ f$ h% F- Q7 R9 J
0040106C: call CreateFileA
2 v7 p. X9 @( ^$ U 00401071: cmp eax,-001
) \# n$ Z0 R4 { 00401074: je 004010916 @$ p5 Y# _0 ~9 t" |
& O; n( q. {2 h8 Q9 N
: b( h6 d1 {, G+ l
There could be hundreds of BPX you could use to detect this trick.
z. h! z1 m! O0 K* e-The most classical one is:1 G: h8 R; ~0 ?$ F- i: ~$ m
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 `1 ~3 c* X7 m( P4 V
*(esp->4+4)=='NTIC') W. R" I0 j$ Z8 j/ Z7 C2 v
0 B) S2 r$ g1 r, D-The most exotic ones (could be very slooooow :-(
; e! \3 m+ i8 K( N BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 I" N; ?8 k) P( l" @
;will break 3 times :-(' U1 C. k8 L! `+ c5 ~' z) E- c7 [
- ` k) c* Y) W0 f6 B4 N-or (a bit) faster:
0 T" V6 P. i* f/ @$ S1 H4 Y BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). _8 |8 V; Q9 r
6 t( i2 ?3 Y7 A, ^
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) Z9 O5 \! k1 c3 }2 y3 g+ m
;will break 3 times :-(5 K8 @) }* _0 P
4 Q; |# Z! |; \0 c-Much faster:* y. ~6 Y) @* h2 ]% N
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. k+ \8 m1 J6 z( R# c, r* l; T" V
: a \( } t+ y. nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
# H, i, C5 u# w4 L% o; [function to do the same job:
" c) d( G" R( k g# e" J8 s" X* k+ A4 J4 |8 }
push 00 ; OF_READ
. `1 X1 ]+ w0 @+ W: l9 A4 n mov eax,[00656634] ; '\\.\SICE',0
5 n. X( j) w [ Z8 @ push eax
) d5 Y; w, w) o2 X; X- I& r call KERNEL32!_lopen
( y" W$ h4 r/ T$ }/ g+ C% m% J inc eax
: n8 w" Z) K9 ^6 m6 g8 q2 c jnz 00650589 ; detected8 `) R0 {# }2 u G- i
push 00 ; OF_READ
. `/ n. j0 t7 o mov eax,[00656638] ; '\\.\SICE'8 z& X* T5 {0 e% ~
push eax$ W- b5 L. [, m/ o8 W! u
call KERNEL32!_lopen% i2 i5 z$ f% i8 [1 _
inc eax
& ~+ }- |, u9 ~9 A jz 006505ae ; not detected
, B! P) O+ J+ {- H+ l2 V- e4 j0 O) }; G
. l5 z* d; W+ [
__________________________________________________________________________' ` @ A3 n& K! }
7 M* a1 S, D5 U2 {% k9 L$ p- u
Method 12
: v# y6 C/ K: E: m) s, V=========
9 p& O: O8 t% g7 l: h
- L% w& T% o" e- A: e ~& k: EThis trick is similar to int41h/4fh Debugger installation check (code 05
0 A/ `( v9 s: ]7 c. a' B" V. ^, K& 06) but very limited because it's only available for Win95/98 (not NT)
1 D3 z) k) l2 `' V+ A) Kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 j; l: K/ \) ~* \) |1 {
3 J! I) T" U1 X* S j
push 0000004fh ; function 4fh
$ x. U; p# t8 I6 ]/ F" ^, |, a push 002a002ah ; high word specifies which VxD (VWIN32)
# y( l: K) _! S q ; low word specifies which service
. A. T. `# ^% B$ V (VWIN32_Int41Dispatch)4 x- V, c* M/ x4 N" z/ ^6 }) q6 m# @
call Kernel32!ORD_001 ; VxdCall
6 [. k) I+ L* T cmp ax, 0f386h ; magic number returned by system debuggers
9 ]# o( f7 l2 [& T! C jz SoftICE_detected
* r2 V" l7 N2 t9 V. O( w- u
# ~$ r% G' y; Z2 {5 S6 B+ lHere again, several ways to detect it:
+ k6 J$ @4 E1 Y6 \3 t% {$ f& |( }
BPINT 41 if ax==4f" E& o- ~3 B* ?0 J- X! x
+ ]' u, a! x/ ^* G, k
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. E I, Y3 _0 h" N1 u* B
3 ^+ M8 s* E7 F% o# L$ c
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
& B g# M; G" V6 \
8 P* ~7 |( r! B% I- b BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ X7 S. P( W- |7 ~$ _/ x- M: n
% S2 z2 p- m0 v, Y) k9 i
__________________________________________________________________________: y8 c% L, i2 g
# n2 g/ [2 I) r$ YMethod 13
; G/ R* V1 O O: U7 H6 m) O/ x1 I& i9 o=========
7 M: K) m8 M: v1 |$ g- S/ L+ u! j* H3 ^; T* j
Not a real method of detection, but a good way to know if SoftICE is
9 P' h4 t( v: T0 L- I- _" A: Linstalled on a computer and to locate its installation directory.8 P! @% N& A' A$ L8 ^
It is used by few softs which access the following registry keys (usually #2) :
3 C% k0 D+ E1 Q7 e7 |: N
& J3 o9 w7 [+ L9 X-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 m# D& F" ^$ S9 N
\Uninstall\SoftICE
; ]4 s5 }+ l2 E- q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 L! a. T0 R3 K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' F4 \4 Z. i6 I- l
\App Paths\Loader32.Exe0 v& L7 {2 {$ K1 \% ~: S
% A; b7 {8 N% z/ @& \1 Z/ d, s* W
8 e, A6 \7 q2 M$ A2 ~) I! ENote that some nasty apps could then erase all files from SoftICE directory
+ s1 G, T0 y9 n* K(I faced that once :-(
+ @4 i8 v( F8 L# X& i: \3 y0 c/ n8 u8 M; ?0 @
Useful breakpoint to detect it:5 |5 ~* j7 a* g2 r6 q e
) a3 j& V2 Y0 O/ K4 @$ h BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' \) m. z/ s/ }2 B
! j4 O% k: t$ }6 f0 u6 H9 g- _0 Z__________________________________________________________________________
3 Q3 k! P+ A+ k0 q
! S( M# M- I# ^; E3 v% _/ q: x! O8 {' K# P& k' j
Method 14
, q5 m7 r/ |- u- G n& ]' Z=========$ s5 d7 u( c. r+ O4 H% N- v/ ~. M
3 _3 O7 V, n1 o) u9 iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 K6 t+ k& z% \+ u. p+ Z5 i
is to determines whether a debugger is running on your system (ring0 only).5 V8 J7 Z- h! H( H3 f* X
% n5 e) J# w. o. f0 g' d; Y VMMCall Test_Debug_Installed [& e1 c/ e9 l( T7 B3 E& u
je not_installed3 H: h7 y, G+ A3 u2 e( r/ o
4 Q4 X: F- j4 J% X3 XThis service just checks a flag.4 ]& R% W B0 Q
</PRE></TD></TR></TBODY></TABLE> |