<TABLE width=500>( D- J# m5 x) B8 q2 }& t7 G4 h$ G: _
<TBODY>, d- U% n$ B" e/ g' a) @ Y1 M
<TR>
* I# t7 A' d! d$ T6 T% K<TD><PRE>Method 01
. ^6 U. c$ _9 n' [& ^ |3 o========= A4 U1 B$ O+ I1 i4 G! m
7 V& D2 ?. C. U7 g. ~
This method of detection of SoftICE (as well as the following one) is! i+ f+ s" i0 U+ x! x
used by the majority of packers/encryptors found on Internet.4 U. n; F9 ^/ s5 A- _$ v, n
It seeks the signature of BoundsChecker in SoftICE/ S+ e9 l% p% ?" I) y
6 G& G' r7 d7 N% Q4 m: _3 T mov ebp, 04243484Bh ; 'BCHK'
$ h6 W! }6 L0 d) c( J8 }% ~ mov ax, 04h
2 ]/ f! T; `. w4 @5 Q int 3 0 \0 e5 E& s0 _% C' Z
cmp al,4+ |9 R$ T1 \3 Q" ~7 s7 e5 f
jnz SoftICE_Detected4 b+ m9 b8 i0 Z& b/ s" b- C/ l
. F o5 ?) x# d7 u# w. G
___________________________________________________________________________
$ ?2 e* {& K: R9 Z4 a# C& F
5 B6 v, }: D' m4 N- h1 J7 B4 IMethod 02
' y) y1 I" q5 A* ]=========" F7 X9 n+ |9 V4 `3 h
! K2 h+ Y6 A( j, l* q; r' u
Still a method very much used (perhaps the most frequent one). It is used; O: f/ ?/ T( [2 L" Q0 M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,! Z: i4 r- X7 {* m7 z* D
or execute SoftICE commands...& {$ ~% f+ I/ S/ \* @
It is also used to crash SoftICE and to force it to execute any commands- I8 x8 l" H+ V9 z7 w5 ]- a4 ~. E
(HBOOT...) :-((
5 A! e* V: e) @4 R6 z7 ]* M* p9 D( u4 P& s
Here is a quick description:
( y; y8 z2 m( v0 l5 h) w% j) h-AX = 0910h (Display string in SIce windows)
% ~: b5 j5 Q' F- X4 D' z2 V-AX = 0911h (Execute SIce commands -command is displayed is ds:dx): B3 ]( D' p2 x* i+ y+ Q Y
-AX = 0912h (Get breakpoint infos)
; D6 `! |9 r2 W, }" W-AX = 0913h (Set Sice breakpoints)
5 x9 ~% S! C. g2 F( l/ a-AX = 0914h (Remove SIce breakoints)- e ?2 J" H/ E' F0 i9 ^) q
5 j' s& O% l" `! l; v1 {1 b" ~Each time you'll meet this trick, you'll see:: w. f% t9 Q. y R) y# W
-SI = 4647h
/ Y& V! k4 x" P( O-DI = 4A4Dh
6 ~- ^+ E3 ^5 d( S, m1 cWhich are the 'magic values' used by SoftIce.
' k% i! G/ Q' l$ f _8 p. j' f. x" MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& o& v) y3 F4 p, g
/ i3 ]0 N- |! z# J) V2 r
Here is one example from the file "Haspinst.exe" which is the dongle HASP
/ f5 C7 h9 I) S: f7 t6 iEnvelope utility use to protect DOS applications:2 ~+ D5 i) F) b, o9 B0 J" I: v
9 R5 K& ^9 ^( h9 G" {8 o N" y5 Z D/ H3 d# ~2 c) |" x
4C19:0095 MOV AX,0911 ; execute command.& I8 @5 B3 H$ N) H$ O% E3 v
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 Y0 O9 p* `& b+ g4C19:009A MOV SI,4647 ; 1st magic value.6 U6 @) A! D9 |& U2 ]
4C19:009D MOV DI,4A4D ; 2nd magic value.$ E3 K6 l4 N+ D& O, p
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ v+ H# t0 l% O( V2 ^; C4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 S# L, N! ^3 i* b( R3 E
4C19:00A4 INC CX p4 Y. H7 w! `% F/ M" s
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ c5 {4 u2 d1 M* F: x' Q' q5 v
4C19:00A8 JB 0095 ; 6 different commands.- S% p* e9 A! {6 |
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& c& B# V8 s5 W" @* z# R9 _4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 a' F% y+ Y* E' b
) b5 s2 ^. U x7 Z
The program will execute 6 different SIce commands located at ds:dx, which
) U( j. ?) i6 ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 k+ ?( B3 b* a3 B4 \2 G
" i9 W3 B7 C4 ?* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- H/ L- H4 E' h" [- ?___________________________________________________________________________+ ^" |+ o( O1 ]% l7 x
* I3 |5 o6 y7 W7 J# S, m
9 _0 @2 s0 X+ {" FMethod 03
* b! D0 E: p' S0 x% N' T=========1 k4 |% |7 p9 t( \
$ h- H2 f8 w0 e" b& tLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% W' Y; b" F4 C4 b- [/ q9 }$ m(API Get entry point)8 g* J% }+ {$ \$ e
1 @ N. l, S0 ]4 s4 |4 I* ^* j1 ?6 E) ^9 E3 ~
xor di,di" }1 X9 X- j0 y; z
mov es,di7 g* X4 W0 ^/ M \, _
mov ax, 1684h
6 y! n7 _0 P& g% D mov bx, 0202h ; VxD ID of winice
$ ^+ }0 `8 ~2 n& \/ s# c int 2Fh% @* e; S# K* D, r! k& m
mov ax, es ; ES:DI -> VxD API entry point
' b! [$ H8 _; `8 |) `1 ^ add ax, di8 r3 |: w6 I+ S# U0 C
test ax,ax9 e5 A6 ^ g! h6 U
jnz SoftICE_Detected% U- Q5 C; r$ t
/ k4 n& M: p# B___________________________________________________________________________
1 O7 u, H. }, G) Y+ U- J8 I8 p; D
) _& T0 D9 Y B A1 DMethod 04
2 U( ~! [4 w6 _5 q) f=========
, O5 G7 _& y' A2 |4 a
) v% x/ T# d0 g8 L# e0 i4 c7 \0 N! HMethod identical to the preceding one except that it seeks the ID of SoftICE
2 t. J0 A3 P$ s8 w6 L) F1 a6 \' ^GFX VxD.3 I; e$ I' J5 V) M* g
8 G- w3 p8 A: B, `* H4 {
xor di,di
5 ]# t$ q" H; y2 v) u! [4 x, c mov es,di
/ F* b6 @& [2 X: ~! l, h mov ax, 1684h
% o( K4 h8 E& Y1 e& l mov bx, 7a5Fh ; VxD ID of SIWVID
6 v3 K, @4 E9 i2 W% U int 2fh
: ^" u- u! ^0 ?/ y mov ax, es ; ES:DI -> VxD API entry point r% F7 b- S" i# u% b: B3 B
add ax, di
) b8 Q/ S1 c" E( Z1 r0 d test ax,ax
& H2 G+ Y) }: z. J$ w( R3 i' A jnz SoftICE_Detected
- N+ y p4 K0 `: l; M `& @* I" l, J
__________________________________________________________________________! q. ]; U0 ?* C' y- H2 a! S
1 z9 X+ U8 |! q8 l7 r
$ c) E; P9 X* \9 i& s" o' GMethod 05
7 l4 l, m+ ?$ t" x=========
/ k7 p! }6 P# v8 Z
$ I( F# e1 L6 E# J0 w' N% J6 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ A- x0 A& Y# X! i- M
debugger. It calls the int 41h, function 4Fh./ d q, X3 g& c3 F5 ]
There are several alternatives.
2 J! z$ }6 Z' o- ^9 E% _# Z
v, h a. t4 \1 _The following one is the simplest:
/ p5 M# v9 D4 t5 N1 }& P/ Q7 O" d% w t. O& P! ]+ g. {" b
mov ax,4fh- @5 o+ G7 Q% }/ N0 a2 ]
int 41h4 R2 X' N( ]# K
cmp ax, 0F386! m$ ^- d' `; |5 A' }/ k
jz SoftICE_detected, h& B7 P. ]4 O' N' l( R# _% E
6 F r7 s. k* T
/ k9 s2 ^# [0 j, T8 i: WNext method as well as the following one are 2 examples from Stone's
% Q, M: d8 ]# M) e"stn-wid.zip" (www.cracking.net):
4 H; S) u$ g$ A/ J' | Q% G! ^: j1 s* O9 r$ E8 x7 o
mov bx, cs- R. W6 Z- u" {7 m, J' W) @, i. }
lea dx, int41handler23 }* v/ Z" y2 X3 x3 A0 N
xchg dx, es:[41h*4]
# e) q6 D/ E Y+ a) f xchg bx, es:[41h*4+2]6 }% J3 j3 }8 A( j- A2 \, B
mov ax,4fh
2 P8 J% N) t6 d! e$ o% e int 41h
4 {8 J4 h4 i2 y/ M; K4 [0 T, O: Y xchg dx, es:[41h*4]/ D: x( L8 Q$ A' g% q
xchg bx, es:[41h*4+2]
& G y% }0 B9 K" n% d cmp ax, 0f386h9 R. U# w7 R2 w. D
jz SoftICE_detected
; K; G. _' X& O, a5 ?( o/ I0 [0 z, ~% }" ?/ q! |' y, h
int41handler2 PROC
5 Q8 k3 C4 O. N iret/ x/ s* P x7 T% f( N H( T5 H+ @
int41handler2 ENDP
3 V# f# n2 F% w+ K
8 J S; m% f6 p2 T. D, u6 f7 N7 N D5 B. z9 I( n V* ^% I$ x v
_________________________________________________________________________: n# O: h- _2 v7 p9 v+ G: B1 V
# u) S7 s4 n' _5 Q0 e
' F" e& N" A0 @3 e9 L" R9 \3 ]
Method 06
7 W- s0 l4 }- V4 \ n=========
" C' c+ Q1 s4 B4 ^4 H- {' c i3 V( q
, P: G, I3 b2 A4 t+ |' d5 _$ c, {/ t
2nd method similar to the preceding one but more difficult to detect:
) @% M1 A7 W* }8 @ @/ c
* v" r3 f! x" B$ E5 |( r0 E; A# |3 L
4 K: w& x' O' p# B y: n" zint41handler PROC
* i V" K. {( x/ ?% V, | mov cl,al$ u# l- b1 _" z- {
iret6 N1 B5 N, w+ U8 O, G1 B5 M7 E) i
int41handler ENDP
8 n! w! l; |& r) @7 h1 M/ C" }# ?
& ?" \- \. C, j1 q$ r( {( y+ l7 X9 Y& Z4 p) V1 n' }7 W
xor ax,ax
" U5 {, b9 p+ K9 O1 ?: ]* e4 Q, Y mov es,ax
, M0 J# i9 y8 Y% J& z6 f mov bx, cs
& g" w8 M7 M1 h# r) o6 ^ lea dx, int41handler
! `6 u4 t4 f3 R xchg dx, es:[41h*4]0 }& X- x! p& W6 D" L% V
xchg bx, es:[41h*4+2]# l; p# e2 \) |! P8 X2 @
in al, 40h
) I) V* T7 q8 v8 u$ a2 S xor cx,cx
1 Q0 z/ o8 D$ i4 B; g% }1 ` int 41h
& k @" A: c" K9 @* n U xchg dx, es:[41h*4]6 E" I$ g6 `% x% t1 d
xchg bx, es:[41h*4+2]4 |6 D. l* Q3 i" X4 e _ X/ s* @
cmp cl,al9 t7 ]4 `) E" P3 w3 t
jnz SoftICE_detected
( q+ o* c& E; k
( |+ e0 Z# x H_________________________________________________________________________3 n7 }! x. ~' B' c# ~3 j! m. [
- b+ n; a$ u8 A4 }Method 07
+ }/ U' N: k, k: R3 j- k) a=========
& q7 k" G( x Q, S3 `2 i) L( a- i4 S) w! @1 s' ^$ N
Method of detection of the WinICE handler in the int68h (V86)5 C7 |& [3 ]1 V4 ~
1 O. A3 e* K) s: W! m2 h# @ mov ah,43h* I4 r0 P/ x, K7 a' [! @4 ]3 }
int 68h5 _3 Y$ O l" A
cmp ax,0F386h
8 h# F6 U0 k- f+ f O; H9 D jz SoftICE_Detected1 _, a& D% I7 I( L6 G
! y' E4 l- y1 J0 P, p( N1 ?
6 c9 _+ `) v3 J; p: _& ?=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 [1 W3 Q6 Z" L3 l, g7 w
app like this:) t B6 \% {7 y& D. O" {8 m
% k1 a7 \ @- t5 s6 A/ H% {' y( q BPX exec_int if ax==68
4 [: E& b8 K5 S. ~% P (function called is located at byte ptr [ebp+1Dh] and client eip is
2 p1 A3 n" G. A0 X& `$ x4 T located at [ebp+48h] for 32Bit apps)9 Z4 l" z. [) F! T( Q6 ?5 {) |' R; ^
__________________________________________________________________________
) Q, x/ h! I# B3 P# f! y& K; X4 T1 [. j+ ^
8 q- f$ @8 B6 b
Method 086 ]3 D* k) I0 ?8 ^6 R3 g! `& {+ G
=========$ k% P7 U$ S& A4 A
. Q w, o' N) R E5 }, J" X' v
It is not a method of detection of SoftICE but a possibility to crash the# b5 m8 _; _7 g" w0 J- @# o
system by intercepting int 01h and int 03h and redirecting them to another
7 [; ~5 Z9 u U9 @' O: Q- ]routine.# M( y$ b# c% s( `0 D; P V
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 G7 A) U: s& C1 D5 X3 t% H/ W
to the new routine to execute (hangs computer...)
# M& @/ ?9 h: b& J$ F* a5 t- c0 v: l, C
mov ah, 25h
1 v/ c, ^5 L* y% u, O mov al, Int_Number (01h or 03h)
/ i' F, g* K1 u) I1 F mov dx, offset New_Int_Routine
; P8 n! l! E2 ]! T& F# [9 } int 21h& A8 B; F5 S" f" U- l, j' s7 ?2 A
+ n4 W) ~0 K6 L- ?* y/ D
__________________________________________________________________________
/ d9 L, h K0 O' C( }$ h$ n$ H0 A4 w: k% K" p
Method 09# K: Z8 s1 X7 E. W
=========6 i: x/ { g7 e% p( _7 O
" J- c& Y3 k1 r2 S+ Y2 q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* M3 d! O' V( Y' j8 `9 x; Y; i. ^6 v
performed in ring0 (VxD or a ring3 app using the VxdCall).) u" q( l# O' l2 W/ m, e4 J3 v1 J% H
The Get_DDB service is used to determine whether or not a VxD is installed
' m& O* ~' j7 `5 I/ G0 H% pfor the specified device and returns a Device Description Block (in ecx) for
. q; ^) b0 E/ n: P! b+ W% r* pthat device if it is installed.
2 D0 F0 K( |. ?' t) m
2 X7 T9 V5 g9 C; w9 r" h mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ ~# M U9 l" M e# f
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
m0 z4 ?2 ?7 ^% ^$ P! B) R3 ~) V VMMCall Get_DDB
; M- F6 s9 O/ `( D1 ?- |2 J mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' e% A6 o( v5 z
& K' |8 f- {6 C. Q4 l, J3 vNote as well that you can easily detect this method with SoftICE:
$ Y# u1 T0 m: C$ H6 n5 x bpx Get_DDB if ax==0202 || ax==7a5fh2 s! t# O1 y+ b
- G& L7 M2 I' k, Q& _
__________________________________________________________________________
1 q7 G6 H5 J! y$ t# l4 U
3 x7 c" Q0 f' d/ Z+ E/ GMethod 10
- x1 H' t; C+ B/ o=========6 S3 D0 d: q( ^
- |! @/ Y- W: P( z" x9 s+ g2 f
=>Disable or clear breakpoints before using this feature. DO NOT trace with c1 U. t' L6 ]+ ?: \; c% f' T
SoftICE while the option is enable!!
3 X! w# M k. ~% z$ |; s
6 a% T# F+ e" AThis trick is very efficient:- O9 G8 Z" w# d5 v. R. Y+ S8 Z
by checking the Debug Registers, you can detect if SoftICE is loaded
# a( y* i R" n8 G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( h2 Q# x) ] _
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ S' B) a/ \! lvalue (in ring0 only). Values can be manipulated and or changed as well: k g: k9 f5 [! B. F6 O6 x8 d' e* g
(clearing BPMs for instance)
3 D5 [1 \' E7 c% j2 O2 g/ X# r1 {- A- w8 S3 C
__________________________________________________________________________3 v; s- C' B' G; I# Z# ~
* w2 h z$ x, ^3 |; x
Method 116 n" M' z8 F* x9 I' {
=========
7 L* D! [9 G% g% x1 G, I, k
6 _ Z T/ d1 @( p% d" U8 ]* w& VThis method is most known as 'MeltICE' because it has been freely distributed2 O: h5 M& k/ G8 o
via www.winfiles.com. However it was first used by NuMega people to allow
7 T3 g0 d, x( W; F7 aSymbol Loader to check if SoftICE was active or not (the code is located
9 p. j; Y3 q9 Z6 Ainside nmtrans.dll).
) V# i4 f; o$ B1 w. Y
0 J$ g- m F# ?: i9 SThe way it works is very simple:& T8 N4 F9 a6 y$ k* q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 E+ J) L/ H" q5 o
WinNT) with the CreateFileA API.
0 l: X2 T1 F d% A* E3 @
: }8 l% y) t" y2 o+ H7 jHere is a sample (checking for 'SICE'):
, e9 `+ _1 m: t0 p# K& K& j5 s
8 Y2 P% `* a: M3 |, p4 W! DBOOL IsSoftIce95Loaded() g" z0 n C/ _0 S
{
+ Y7 ~: @3 \5 A$ q& g HANDLE hFile; ) h( P7 }: L5 ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: g' N/ D6 f, x" C5 K& ~- j
FILE_SHARE_READ | FILE_SHARE_WRITE,; y% g+ R, a' j+ ^+ E5 r
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- Q+ S) `5 `. @6 T6 c
if( hFile != INVALID_HANDLE_VALUE )
. X+ G4 Q. D* d {
/ c. I* B" S- t% \4 D8 \) F CloseHandle(hFile);: }1 r! H, J- R8 U# f& h. c2 h2 D' Z
return TRUE;
) e( A* } i$ |: I: ~ }
3 H s5 ?+ A& ~1 f/ k return FALSE;6 G8 }; p% a2 p/ c! b; Y, S: S0 g$ _+ @
}" v- ^0 C0 J+ f& w; I2 |5 k }
+ q! F7 E3 o2 k( F3 uAlthough this trick calls the CreateFileA function, don't even expect to be) t0 H8 I5 H0 @, b1 D
able to intercept it by installing a IFS hook: it will not work, no way!: r9 J" u* m' `4 P- y6 b3 N
In fact, after the call to CreateFileA it will get through VWIN32 0x001F. R2 t/ y$ a( a# M, r+ @" U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 ?% b6 {# U; C- d6 {, n/ f6 C, G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc! e" K) p) c/ C8 P
field.. h% Y" K7 |" l. C$ [
In fact, its purpose is not to load/unload VxDs but only to send a
8 w7 r% ]$ P* C) M; zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, a' Q3 D# f. c* mto the VxD Control_Dispatch proc (how the hell a shareware soft could try7 |7 g0 }4 m/ q/ W+ H2 @4 b1 \
to load/unload a non-dynamically loadable driver such as SoftICE ;-).+ z, h. V) C1 Z2 o. o8 s0 A
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- w# A( M5 u& ^* ?: Cits handle to be opened and then, will be detected.
M5 n; f* y" H/ K$ GYou can check that simply by hooking Winice.exe control proc entry point
6 g9 |4 \% x' v/ l. Qwhile running MeltICE.
) |1 c# B& y* _) m- G& `( g
" m3 [! S. q5 f: X7 [; D8 @9 ?( V" O
00401067: push 00402025 ; \\.\SICE
! i& V: k6 N5 o, r1 j 0040106C: call CreateFileA
5 {* b' ]/ C' E8 W3 j 00401071: cmp eax,-001
2 @: a2 ~. k# K; t 00401074: je 00401091% m( d) H- u; g6 l2 w
9 w: @& g& o# z, ]
( m& n6 q) h2 Z; ~& [5 ^0 [
There could be hundreds of BPX you could use to detect this trick.
7 g4 ^0 \( b& p- }& _& [-The most classical one is:, k; {6 L, Z& S+ |- `' x7 U9 E6 k# N
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* Q( a% D6 L2 v/ l
*(esp->4+4)=='NTIC'* Z" l) `$ U4 q0 w+ M/ f
; h0 S& L' o/ m- ^, N" Y
-The most exotic ones (could be very slooooow :-(
; a& d. ?7 g: a# @( u& y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 o4 T1 d$ e! R1 ~4 g; L
;will break 3 times :-($ {6 f* n% ^# }, e( W
' U, U; m% j' K6 n1 z4 `/ E/ P; ]
-or (a bit) faster:
6 [) V" C5 M0 U P1 |- _3 |! q# ~ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 ?) p7 C! m% D( U8 S, C( v2 p
: I- [" u! o- Q: y( b! F* \1 L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " o# ^- b3 h' s( B' q, v
;will break 3 times :-(
W, }# d: S+ F" ~* ?/ c1 q7 y9 [
- j) N4 L" E! ?& K-Much faster:
8 _" N8 l, {3 q* g9 y% C) e! D BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! v" s! Y2 O# I$ R
8 g/ ^% R7 {* JNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' C6 q& ~2 k" k+ J- Y$ O
function to do the same job:; l, Q% M# k" B, w: @
0 i) e9 q+ j+ y; {
push 00 ; OF_READ
5 @& ~% P% }$ E. w/ S mov eax,[00656634] ; '\\.\SICE',02 S0 I T2 f c- @- g3 h" n& D
push eax
+ [! Z5 W7 y/ p% [ t" h( s call KERNEL32!_lopen
& {5 R# D8 c1 i( F0 t inc eax
- J* y# M) D/ `* a9 ^" t0 J jnz 00650589 ; detected5 y9 N9 c& d% d7 p* x1 A
push 00 ; OF_READ
- l2 g+ N; F/ z% c6 w mov eax,[00656638] ; '\\.\SICE'+ v- j" q( H; I9 G, D! V$ H+ R
push eax$ p4 A; y; t8 a- K; c& ^$ {
call KERNEL32!_lopen8 s; U% R5 h' s5 Y& {* s, w
inc eax
2 \* Y; l* h( X, k6 h jz 006505ae ; not detected
0 U, ^ S+ F5 G! s: D2 r1 j2 E; P2 X* J; M, [ O$ Q
% R! f9 _) y, F$ X3 I" Q__________________________________________________________________________
$ h! J' \" X4 E& e k2 `! S0 b. Y8 C* x/ ~
Method 12- @" b$ b h( g+ ~: C8 ]2 b2 N# Y
=========0 u3 ~5 p% U: r3 x( I
4 \# P3 y- W- U! s
This trick is similar to int41h/4fh Debugger installation check (code 05
& ^( [$ J; e b& [2 D$ Z7 N& 06) but very limited because it's only available for Win95/98 (not NT)
( I$ {% o' S3 [' xas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ i) W, M8 |- z; E" q0 [
* V! N v$ L6 @% f9 u! u% \& h: D" s push 0000004fh ; function 4fh
8 \, Q! M Y3 l1 ~3 v1 _8 | push 002a002ah ; high word specifies which VxD (VWIN32)
6 f3 @" w9 W1 r1 O' H6 R+ W ; low word specifies which service$ z% V# K3 v0 |$ f/ U% n5 {; p
(VWIN32_Int41Dispatch)
6 E+ [ K( B( a5 W# h+ ^" x! D( @ call Kernel32!ORD_001 ; VxdCall
: g w' J& `4 p+ \. x# h cmp ax, 0f386h ; magic number returned by system debuggers
+ I5 w. y% y: b' L. | jz SoftICE_detected
. u' O: x& l. a! ~. g+ q* l3 \" O: Z4 a" K2 |( O
Here again, several ways to detect it:4 ]. h# f& f+ {1 G
7 {- z: E1 L' R7 i- C9 s" e BPINT 41 if ax==4f. y+ r3 j7 d. ^' }* @# }5 @ M, B
1 A2 c( U4 _0 W9 Y1 R; b) `; J BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ Q. K+ U, R' {: n- F
1 i' z" a' G4 c) Q BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 ]' B6 u/ \7 Z9 H6 V
V8 g- y; t5 T# A
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ E; }: h; E" Y1 D% v8 @) P+ K
; M( E% B; \4 i& b4 `& e' D
__________________________________________________________________________
- t2 X* K% b* c1 `( _1 \
/ y" y2 e+ o$ g% F2 M6 `) }Method 139 Q5 |; k% s8 V2 m% r1 ?# r
=========+ w6 z4 j9 T' Y+ d+ y7 D0 K7 K
$ W5 F9 z$ ]9 D c* gNot a real method of detection, but a good way to know if SoftICE is
" B% k& J) A/ e- M* h, Kinstalled on a computer and to locate its installation directory.
9 o$ P4 U, F) e1 _4 j" }( dIt is used by few softs which access the following registry keys (usually #2) :. e7 q0 H+ k( m( w4 q* S2 l s
- z- J3 j$ H; N4 l
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ N4 j" i% t3 C7 e! J, i2 m m1 }9 E
\Uninstall\SoftICE
; F4 a M2 P. C/ h5 K* C$ N+ p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ O6 `" O3 a# b% t; S-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
Z& l3 u& e: R* w8 m6 l\App Paths\Loader32.Exe( N! r& M/ _: ^7 V, y
5 J, d- G5 B$ r: V8 u( s6 {/ i+ \3 [1 l" \ L/ n) V4 Z& e( y+ q
Note that some nasty apps could then erase all files from SoftICE directory
4 p- e. L: m$ a+ c7 g- d(I faced that once :-(( `+ K% A: O1 d2 G/ Z
* n5 g" M8 I s; e, s" b9 CUseful breakpoint to detect it:" b3 w+ G7 Q0 ^* n$ o/ \( @
# ?6 d; O& C% @ `+ f BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
0 B, B6 q7 P0 ?' _( _! O
9 u# I7 n" N- _7 J& Q" z__________________________________________________________________________
0 ?+ ^9 ?* Q' s2 @+ p8 L ]- ^. U- k8 Z; a- D& j
. `) Q6 I5 v. aMethod 14 * @" z) Y0 @) k: I
=========9 K Y( k7 R( P5 c2 i5 [
2 o! x( y6 x7 K5 l
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
& _$ J: q( C \. Wis to determines whether a debugger is running on your system (ring0 only).- ?' i) _, g- e
: E' M" N$ h4 T- Q! \1 W! W VMMCall Test_Debug_Installed
1 Q6 z6 s7 s- s' |0 s# E9 `0 I je not_installed
& U: X' k6 }9 B
8 U8 w$ ^) E# b7 e& [" OThis service just checks a flag.
$ R' V4 j) w# _* G8 s3 R</PRE></TD></TR></TBODY></TABLE> |