<TABLE width=500>4 `& e4 [) T3 V4 M
<TBODY>
5 _' l+ t9 u; _5 l% D9 R<TR> Y! Y/ E7 H4 ~
<TD><PRE>Method 01 " Y: T# b$ v) A: K: C7 `" c
=========
+ K U# _( q6 ?, t5 Z8 }. G; o% y2 R, P5 `+ T2 ~4 R
This method of detection of SoftICE (as well as the following one) is
1 M6 U+ B4 h5 e4 i; Bused by the majority of packers/encryptors found on Internet.
% `$ b. q- @# ?1 U3 |1 e' ^It seeks the signature of BoundsChecker in SoftICE
* W. p- a# _) T: h7 R. Y/ _ R! j) J: c1 j/ u% ?
mov ebp, 04243484Bh ; 'BCHK'9 i$ O/ V& o5 @2 w7 E) l" T
mov ax, 04h
2 ?; T( |) n9 z int 3 1 L5 m% n6 @8 l9 ^" k( n0 `& F: e: P
cmp al,4' P% P# J9 G) i9 M
jnz SoftICE_Detected$ r! p. G4 Q/ K L7 \+ d2 l! U
6 B+ W4 x$ r F8 u! Q+ R' k T___________________________________________________________________________5 F& `' v) c* B) M$ U
" _) S3 B, X; g# h& mMethod 02
3 f# ^1 }: f# {$ s=========
- k3 |+ t8 ]/ E) E% L! i$ s
& ~9 u. W. [0 d, X% DStill a method very much used (perhaps the most frequent one). It is used
' m3 a N/ K6 g$ z, f5 G& eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: n% b% R( f/ z+ o2 q/ F1 Jor execute SoftICE commands...9 W; q2 k9 N# m$ i: n5 t
It is also used to crash SoftICE and to force it to execute any commands
* q l! ` z! h(HBOOT...) :-(( 6 N3 T' c- \1 u0 J, v* }
* G$ J* N+ p0 X- r! c, H: y4 }
Here is a quick description:1 Y: U0 Z1 ^0 ^4 D' h; f3 O' O! {
-AX = 0910h (Display string in SIce windows)
4 z+ x* e# h5 z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" q' G: Z g+ \* K3 y! e-AX = 0912h (Get breakpoint infos)* b# R+ u9 G! A' ~4 k) w
-AX = 0913h (Set Sice breakpoints)1 j2 M e4 d+ Y5 ]2 ~; H$ R) y
-AX = 0914h (Remove SIce breakoints)( s" b- g$ v. g/ D
) ^$ _- j* e/ S: ?5 s: _
Each time you'll meet this trick, you'll see:
6 p, P+ R$ S1 a- L( l. }-SI = 4647h
5 F/ x! I2 j6 L7 Z1 F1 \0 c) w-DI = 4A4Dh
. N% J! O; M& t8 ?Which are the 'magic values' used by SoftIce.! O5 o3 S' w7 |3 t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.# s- Z$ E: _( k7 U- {
8 |* ]) b d/ M J9 C2 ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; B6 f. e, X9 t6 l5 U4 E- Q; U: KEnvelope utility use to protect DOS applications: P$ r* g& N5 m* T) d+ O& \+ T
) ^& M# W% M$ W) ^
5 u" ?2 ~" _, Q$ J: S) u, F
4C19:0095 MOV AX,0911 ; execute command.3 B* x4 [ |. y3 C) w/ {' K7 P) b, J
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' o* ~( E+ f( j, X8 A$ \ G: v
4C19:009A MOV SI,4647 ; 1st magic value.. y: D* l1 G% Z# V
4C19:009D MOV DI,4A4D ; 2nd magic value.
+ }; w! X6 s+ l" s4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ L' m) F' U0 O9 y) y2 ^3 Q& M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute/ T! X9 z+ ^# t* `5 n) U
4C19:00A4 INC CX4 O3 f7 C( I3 k7 P4 u
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
/ |/ w( a- ~5 G w: Q5 Q4C19:00A8 JB 0095 ; 6 different commands.
9 B6 j6 ] S8 n" V: `4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* ^" V* u( M; [$ k2 e6 o9 C3 h4C19:00AD MOV BX,SP ; Good_Guy go ahead :)* g/ r0 l: I; t
( x+ m m. x( ~% xThe program will execute 6 different SIce commands located at ds:dx, which
" [2 d0 U# T' ]! g+ b# hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 X( |* ?% j# E6 l
! z7 n( P# y/ H# }8 q7 F$ K0 V, H* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' x( S2 _: }' Z. n( P
___________________________________________________________________________
8 F% @: O0 {/ m# B1 v! `9 q+ l4 X* p& O8 I+ m, c: P& F: D4 k
" |# D# e8 m0 L; b8 t4 kMethod 03
$ x- `. V; y2 {3 D2 [& ?( J8 C========= o1 ^/ e' V$ D
7 N6 \1 |1 d' |6 ~7 R3 bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! e N& c3 i) \- y: D
(API Get entry point)" y% E. `6 t3 r$ T
, X* @: Q$ {: h1 \
+ c/ N) _* T' J. ^, O3 J xor di,di2 c! T P: _% {/ v I# L7 R
mov es,di7 G6 b: x) M0 o1 ?& Y
mov ax, 1684h 4 K. ^, Z# s# c! ?+ M9 T
mov bx, 0202h ; VxD ID of winice
: R9 O. u0 o% Z' m \ int 2Fh
" g; q: I; m3 } mov ax, es ; ES:DI -> VxD API entry point
/ h: E( b% L. U. ]3 ]8 f add ax, di5 ~9 K9 ]6 b8 _5 R) s/ s
test ax,ax; \1 e+ ?3 d3 D7 `
jnz SoftICE_Detected
$ _& f* {3 C/ [
& h0 @0 Z9 J; e: l- Q( S1 s! x* g___________________________________________________________________________* k( t) `& d. ~; |- Y; v
7 y: k, Y+ m6 ]" b3 j
Method 04( D/ W( N- \* M+ X: r$ `9 k
=========
( a$ r3 ?) e. g5 X8 }5 H2 H( C6 p1 ?5 @5 R0 d8 t$ [: i
Method identical to the preceding one except that it seeks the ID of SoftICE2 Y, v. }- e4 q9 M' O4 a
GFX VxD.2 {. f* m" E4 x, e& g% Z9 Q- ?4 P
2 W! `# t+ E3 s- J0 r& `5 N xor di,di( ~$ z2 v/ e( v9 G2 Y/ O5 r
mov es,di
1 g, C: v6 Y' l( r5 j mov ax, 1684h & ]0 x. Y( _1 Q& F1 B: e9 P
mov bx, 7a5Fh ; VxD ID of SIWVID
n, J6 V$ ]: T7 o2 |6 g$ U; ` int 2fh) D& Y1 H3 U) x( t D
mov ax, es ; ES:DI -> VxD API entry point, y5 M% n- `: g2 F& {) P
add ax, di7 G1 d% p0 {+ {
test ax,ax
0 Q9 _8 j3 y" i9 [( o) x jnz SoftICE_Detected
: @2 A+ t1 O9 l" S6 {9 o2 @) V+ l9 L$ W
__________________________________________________________________________
1 _4 [/ s* }8 x6 S' N0 C2 N7 \& ^8 V# z! r% M
y$ x: ^' R: m7 k
Method 05" R/ w* q [8 C) G! M. c/ ]- |
=========
- @. T1 e+ e! \
" f5 [. J7 J; ]: p& P0 f; m6 A0 ?: CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
5 L+ g( E8 w0 P" D, M2 Ndebugger. It calls the int 41h, function 4Fh./ Q9 m- Z! m4 a4 X: d) A, C( L
There are several alternatives. 7 C+ N% I# }# N) r8 T
. D0 x( [2 X) k7 l: M( F
The following one is the simplest:
! N( L# p) x6 ]1 ~$ q3 |; O H, n( N: I& Q+ {
mov ax,4fh
( u4 ~) E. f1 ]# P/ N7 K# T( m int 41h$ g. N0 C9 I. o5 q" G+ R
cmp ax, 0F386
* \: l1 X8 b* H8 s2 e jz SoftICE_detected
}: Y* V8 w# b
% A2 l) V- u1 n0 a7 Y; [3 Y, u9 N7 ^4 u% g+ I1 ?' g. S
Next method as well as the following one are 2 examples from Stone's 9 _3 n5 O& F4 I/ T' f! r4 c
"stn-wid.zip" (www.cracking.net):
# D! C8 G W1 e! }
' A: Q# A' k. l) ^/ d L mov bx, cs8 y5 s& W( u9 C. }4 a; q
lea dx, int41handler24 K0 {, Z+ }* x0 [
xchg dx, es:[41h*4]6 y. g' {4 v* ?7 B3 Z3 V
xchg bx, es:[41h*4+2]
. C2 q. @+ G. n. B1 Q; L" m mov ax,4fh! X" B9 T* U- v+ F. i/ f' y+ f
int 41h
' Q' v; }2 X9 |1 z! W$ M+ B; R xchg dx, es:[41h*4]
% o) {6 A8 E+ t/ o' E: B xchg bx, es:[41h*4+2]
, S& o4 f! W+ O" T; l! O9 z2 r( M cmp ax, 0f386h
4 Q: ~7 `2 e" h+ E, f+ K jz SoftICE_detected
3 Y1 C/ P- ?( G$ h) i( j
- _7 m. j' d4 N* Wint41handler2 PROC7 |2 {( E# @; P: ?2 J9 D% s
iret
{& V# G0 I) I) Y( lint41handler2 ENDP
) x3 d5 r$ O. ~/ f+ }& F2 S" o3 P- ^, Z+ z% a3 }2 j! s* f5 g
: Q- ~2 r, K* i5 z' p/ s0 R' R
_________________________________________________________________________
$ f4 x3 b0 D6 }& W1 P1 y- K. k, X( b$ _0 w; Q1 o
8 h v: D" F7 U; b" c; O* ZMethod 06) y/ w# Q$ ^) l; g0 H
=========. S: H' q, d; n( a
$ ], d) L" f# G+ O; `& ^6 D
' H! k; k8 o# Y/ m M
2nd method similar to the preceding one but more difficult to detect:7 |9 `; u2 G" h' L0 |) F
- M% K0 b+ M/ E0 P& {7 c0 T& U* w
( H1 J! D4 j* {# G; P5 \
int41handler PROC* L1 p; l- r: E2 J* s' H3 ^1 W
mov cl,al& a, P0 I8 R" N, u# k# U) d
iret; Z' x7 y( f! G- y; I* X3 a6 H
int41handler ENDP
\ i5 X% | |0 T2 s: W+ A+ Y6 r, I: u9 n5 y
5 G' w. C& F( U2 `+ H xor ax,ax
6 N$ t7 B) u3 T# j, Q' S mov es,ax
& e/ U9 F% V+ U9 u: \ mov bx, cs* b' R& l0 Y+ [% W
lea dx, int41handler
; j/ E1 U2 ^9 ~- j" Z c/ z7 f* U; Y xchg dx, es:[41h*4]* |6 I; I& a: u7 P s
xchg bx, es:[41h*4+2]
. x8 L" V6 j6 t0 Q, s in al, 40h
$ r9 m7 f" b5 O xor cx,cx3 g$ ?3 a; v; ~% [
int 41h
' d) Y8 ?9 O5 H1 D* h( Y8 O xchg dx, es:[41h*4]
* t. `4 J/ p& `+ n3 f xchg bx, es:[41h*4+2]6 q- z D* M4 g4 `8 L* ?
cmp cl,al
! F6 y$ Z% k7 E/ h4 }4 w0 ?6 [. X jnz SoftICE_detected
) j( {" b6 F0 E. \% N
# D- ?+ |" o% [( h4 ?' o9 E_________________________________________________________________________& ?5 I! u1 q4 t- s/ q% a
/ m7 ]* G' ~- J" F F& BMethod 07
7 p3 d. a3 e' q, f7 X- X5 m=========
! b7 a& i( T5 B" a1 k# w4 i3 x/ _ T! t- `
Method of detection of the WinICE handler in the int68h (V86)
; n9 K/ I- Y7 z9 [) c
$ |# B1 V! v/ F0 J+ c( p mov ah,43h2 N$ k9 g, T J* n2 }% m
int 68h; f& j% u& t0 H% Q3 q' Z
cmp ax,0F386h
3 h/ Q8 ?, D0 b2 Z8 L( F- |, E# K jz SoftICE_Detected
: _' X( l$ u( i- W5 h; X% S+ Q9 s+ k4 Z
% y! }$ p! l- t+ X* s* N7 ^
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
; n5 k' x# M3 @" S! E' _% H app like this:: H- s8 C8 b' t: h* \' A/ A
6 H1 \! c' \0 K7 d* I6 ?
BPX exec_int if ax==68
: v) N% J' L2 d3 H, {" H (function called is located at byte ptr [ebp+1Dh] and client eip is; ^# v$ m8 o$ C# J
located at [ebp+48h] for 32Bit apps)# ~9 A9 C& P; C! N
__________________________________________________________________________
# B/ Q: |8 F- E) l* y* d! W' u1 \: {8 [
0 k" _: ]- R9 h
Method 08
& H# P; P; H! }0 ^' } o- Z=========
2 H/ [2 c l* O, L9 N: `1 V. U5 ~* @
+ I& o v* W' Z4 IIt is not a method of detection of SoftICE but a possibility to crash the
! P7 o, G9 y. D3 F* o* z6 j6 |: csystem by intercepting int 01h and int 03h and redirecting them to another
% A$ p5 `3 C s( ~' H6 ?$ L& M( I6 yroutine.
4 P8 s7 `& {# Z4 N& P6 X; YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points u& e& s* x* C9 r( n
to the new routine to execute (hangs computer...): b& h$ H# E8 I: y4 _! N
7 @) Z% e9 @% k! I1 h5 _ mov ah, 25h
* ]$ o& d( x9 w2 F6 q* O0 N mov al, Int_Number (01h or 03h)( _5 N7 U" h2 V1 M r# I
mov dx, offset New_Int_Routine6 M7 p* o( J, T3 W ~2 E% v9 O2 |4 A
int 21h
. h3 {7 V* @6 Y
8 A) v+ x* b* j0 d/ S3 @& ~__________________________________________________________________________
$ m, ]: n% Q" u7 D* J" h( z! v
Method 09
V6 T" x; K) P: C+ B=========
) w# `8 r( U1 } W9 s+ b6 i
! _" y, q3 ^4 f0 `. v* XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ N8 G* N2 @! \" ^5 v
performed in ring0 (VxD or a ring3 app using the VxdCall).
6 ?+ |; u6 m, V9 s% }' o& F" ]The Get_DDB service is used to determine whether or not a VxD is installed
& l( C$ `8 I& ~. \for the specified device and returns a Device Description Block (in ecx) for
1 V; C0 t$ d4 J3 v- G# Hthat device if it is installed.
4 F" C7 |5 G8 \. R0 R4 f" t7 L0 c8 K# Q' y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID N6 b T5 u4 m$ u3 t A
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; Y$ f1 y7 |2 W& [( Z VMMCall Get_DDB
0 c; T7 U4 Y) s, j/ ?9 M% @ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 a) z$ b6 p" y. i+ }, Y' T9 w: f# f8 @6 b; M& i+ x
Note as well that you can easily detect this method with SoftICE:
! x3 t' t. K8 i6 L bpx Get_DDB if ax==0202 || ax==7a5fh
0 r x2 t9 v* `. @ l
1 b" @4 y4 t. ^3 w' r__________________________________________________________________________
6 N" v1 k; c: @& \/ f8 ~7 }6 f" s* }' h' w
Method 10, n9 K! {+ ~9 o8 u" f- o M
=========
- e% A' G# q u1 n& k/ R# M3 E. H+ z# x% \/ B" t/ M5 N
=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 N0 P- P9 s0 \" ^) z SoftICE while the option is enable!!: p7 S2 b" F( n
0 C- v+ m. N) S' m2 |+ H
This trick is very efficient:. L6 b7 d8 T+ x7 p& n+ P8 N) n* g8 F1 o
by checking the Debug Registers, you can detect if SoftICE is loaded
# S& Y8 d/ B( T( K! A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ I5 }6 `6 ~: t) N& Mthere are some memory breakpoints set (dr0 to dr3) simply by reading their
* {8 c4 G3 v8 T6 L% f' Fvalue (in ring0 only). Values can be manipulated and or changed as well: `) q, b. T- V* f$ ~8 a( D: x0 E
(clearing BPMs for instance)
1 O0 r; S8 z9 N0 j V. M. ?' N; H( L0 K
__________________________________________________________________________
; p- P$ @- Y) C
% x+ c7 F& d x3 I# b: z) rMethod 11
, W5 K9 s, X# z5 O=========# t" P+ @' ?: m4 N+ C
$ X3 ~- v v5 d9 C8 L+ Z: S. K
This method is most known as 'MeltICE' because it has been freely distributed
( T( o9 w7 I# U& F' W+ E9 {$ g) vvia www.winfiles.com. However it was first used by NuMega people to allow
( i9 G' l6 w' N. H E7 B- RSymbol Loader to check if SoftICE was active or not (the code is located6 c6 ^/ k3 G" S* B5 W& J
inside nmtrans.dll).
9 y1 G( X+ G, A5 w$ Q# I5 ~' R7 Z+ l9 r7 S
[& E& L) F1 r6 u! E8 h. r# vThe way it works is very simple:
9 G7 t* {4 e/ `; s% B7 j9 MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, W) F1 x4 |" T5 {$ l& q* D
WinNT) with the CreateFileA API." H# s, @1 v" X
* D! Z8 F* b) z& u/ q9 U1 bHere is a sample (checking for 'SICE'):
1 r3 ~5 K( s! X% d' T/ q& E" q9 u5 c0 K$ h4 }
BOOL IsSoftIce95Loaded()
5 |( ]& |5 w0 l- G1 \) g7 \{
) J* \! v! w5 ^6 `$ Y HANDLE hFile; ( }4 L* z- b8 K% B5 i3 ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. g% Y2 z, c& h: T$ Z
FILE_SHARE_READ | FILE_SHARE_WRITE,; ?" d" z( w V3 n7 V8 J( [
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% {3 b2 A, E5 s3 K, }
if( hFile != INVALID_HANDLE_VALUE ); G# o3 {2 b/ w6 W% ]: D
{5 p- f) K+ t1 w/ @: v
CloseHandle(hFile);
6 Q& R2 e# Z X8 _$ j6 T return TRUE;
; r6 ?+ i( o" |* b; C( W5 ]2 j+ O }
0 y: k- X7 m$ ^$ z+ m return FALSE;
0 C6 v9 U2 X. F' W, u f2 R}+ \( C8 ~/ S$ D" P# ^
3 o+ P p$ W9 Z7 V. W' `
Although this trick calls the CreateFileA function, don't even expect to be/ @! F& e' ~% u4 h) n) R* Z
able to intercept it by installing a IFS hook: it will not work, no way!! z5 H j8 K1 p6 D# k5 z# T
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 L Y6 P2 y; z5 B, c% pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ V5 O- v' Y% u# r8 r% xand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 h, o( }- U4 X7 L, r
field.
) y$ Z. I. J8 p( q# rIn fact, its purpose is not to load/unload VxDs but only to send a
. W, o: r& Y; I/ P" y' ?- WW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 v* Y* g: o0 ]) |$ {+ fto the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 ^/ ~( f9 H8 e% yto load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 y, I. `4 E9 n6 a. `7 qIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 H% \: [: W9 r Z. T* H
its handle to be opened and then, will be detected.; e" P3 Z. f/ |- J; k+ j$ k
You can check that simply by hooking Winice.exe control proc entry point: m8 c0 R& Q% _3 ^7 ~$ w( Y r
while running MeltICE.
) ]0 F/ F$ z' {) N! U: L: K8 P7 v, b- Q1 R
/ d/ [& K5 I4 K/ ]5 J0 X 00401067: push 00402025 ; \\.\SICE& Q4 Z+ h: D/ V8 J
0040106C: call CreateFileA! z0 \( P7 e% l* ]+ {
00401071: cmp eax,-001: q$ \: W7 w! m( e+ p/ J) T. a
00401074: je 00401091
5 E! B2 {/ p3 a4 X" p; p
6 R) m/ b3 x+ I* L9 d2 ^! s7 ~& E$ A/ X) e6 x
There could be hundreds of BPX you could use to detect this trick.
+ ^* i1 i8 i7 H3 P0 N0 T2 p+ D7 ^! j5 ~-The most classical one is:6 p! i3 {2 H' w7 f
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# l0 |$ L c0 _* y8 H& y
*(esp->4+4)=='NTIC'
' H4 ?! D* k2 b. w% d! N' B" Q Z8 Q1 J* t- I% G
-The most exotic ones (could be very slooooow :-(% L+ ?. h* r1 L0 `- c
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 `% Z& l; E4 f8 g% _: m/ j* R
;will break 3 times :-(6 [/ \9 h6 S6 [
' c( [& C8 o# s- b3 r-or (a bit) faster: ; e3 y2 |. Q/ d! V) C- x0 i
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, q) R y; [- ?0 R" D6 j, h' C# K: |8 D* P
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 T. b1 U# [& W) X3 B! j
;will break 3 times :-(/ p- K& e3 R- |0 s, Z1 c; A1 ?3 G
6 G, B% h4 e, \4 {; J-Much faster:
( y; |1 B& J# x4 _/ }( s8 z# b BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
3 f) {0 i% g5 H% @! B& ]
" e5 V& R$ v# jNote also that some programs (like AZPR3.00) use de old 16-bit _lopen4 d. E2 d. e* e; b" S8 k d
function to do the same job:
9 h/ |/ [, v& J/ R; Z; E. ?! m, n! O6 N( d5 y3 [
push 00 ; OF_READ! P6 g) @3 V6 O8 h1 U# u
mov eax,[00656634] ; '\\.\SICE',0$ l, v! j- h6 B$ ^4 _5 V
push eax
; u3 C/ N1 N6 F6 A$ j8 y; ^( @ call KERNEL32!_lopen, Q9 p4 S& e, h3 c+ v M8 S: `0 W0 E
inc eax8 }" K& X! L. c2 O5 v, A0 u
jnz 00650589 ; detected
- K& o' E/ ^, g: N& @ N' [ push 00 ; OF_READ* b" K% G4 s5 }0 J( K
mov eax,[00656638] ; '\\.\SICE'0 }) i. z+ _2 h, V; Z
push eax
6 o7 p i5 s0 J! d! u( ] call KERNEL32!_lopen
* Y1 p( F! D: w inc eax$ ?, d( D' M' f* F0 D0 F. L
jz 006505ae ; not detected
: I$ K8 ]7 I1 ~: h4 h0 G2 S
6 e+ |% d i: v2 D7 Y
: ^6 B7 J0 _2 H$ A0 W__________________________________________________________________________+ e2 Q5 D2 M2 R, |" B4 w
$ Y% X/ e1 Q: V$ H& q- p) fMethod 12+ s: [# U3 @% K) \5 ?3 X1 N
=========) b" C, b* u$ f. f( `, p) z
/ F' Y( ^9 h( a: D% ?2 D/ ^
This trick is similar to int41h/4fh Debugger installation check (code 05
: Y! {7 f/ ^% D, P& 06) but very limited because it's only available for Win95/98 (not NT)( n G" k, A7 y( u7 _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# }# P: s/ a% f
+ a- w& v& Q6 d2 I' [ push 0000004fh ; function 4fh
: c9 A) z. {+ G push 002a002ah ; high word specifies which VxD (VWIN32)
! [, [$ A, J. J k# I* t, @ ; low word specifies which service* r) ]9 f; z/ _
(VWIN32_Int41Dispatch)
! y1 a" `' \( ~9 G# Y call Kernel32!ORD_001 ; VxdCall
7 ]& y7 {1 n7 W9 H/ V cmp ax, 0f386h ; magic number returned by system debuggers
% G1 \1 e5 J- w" K5 _$ N9 h# y jz SoftICE_detected. `$ S2 ?. K# l( K
& h* G- V2 t/ e0 c. F5 L' x
Here again, several ways to detect it:2 e) R% w* g0 ~
9 U; e4 f1 i# U# c: r: `. h2 M7 e BPINT 41 if ax==4f& k( R$ \6 _7 C# P% s2 m/ E2 @& U( |5 a
# m9 O* ~7 z4 c' e
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* P5 T1 v _* r v
* f( Y d0 I4 | BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 E# @7 M1 Q2 h0 @3 f, B; V" c% V
3 _+ H, D+ H: b+ K
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 F/ W0 \/ U1 q! C
5 y8 q# ^5 I+ }) ?- w__________________________________________________________________________) {# B- a: r7 M7 R4 C
3 |9 [$ K) K/ x$ S1 m/ F
Method 13
0 _# u# Q. r5 a: _( K; h& _' c/ ^=========
3 d* C" n- V e, {0 {8 t3 u/ l+ n% T, D4 y0 m
Not a real method of detection, but a good way to know if SoftICE is* ?/ R& D' j7 N: \+ k6 M: c3 v
installed on a computer and to locate its installation directory.
# r" X" e( f5 C* e* y8 pIt is used by few softs which access the following registry keys (usually #2) :
7 y4 e" {, H1 p6 u V% J! t
: ?0 M* _$ N4 a-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ @; X) z3 l# P& Y c
\Uninstall\SoftICE2 p* v* V3 v% a% R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 I/ p+ r: \# f4 T( d: H2 r* J
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& r8 R) N* S; N\App Paths\Loader32.Exe. _7 T$ ^% }& z
+ J/ \$ h' N$ u% p1 \
" \% f9 ]& N) i+ r! d9 q! ENote that some nasty apps could then erase all files from SoftICE directory
: J3 S! J b- u: F(I faced that once :-(
" z1 w( w% B! R- k: A5 b% Y0 A. d5 `6 \( y* r6 o) v
Useful breakpoint to detect it:
5 r4 f1 Q9 E" g% t* @. s
; } Z- O/ ?9 x& l& @1 U" c0 Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
& x: ^! Q% C1 X$ |! b. Q b% h `7 D
$ L2 n' \! o1 E7 m: m2 {__________________________________________________________________________
6 N8 T& F# Q; h1 f1 w7 s8 e9 j }
# m; W9 `- c3 y: q
" z6 L, [" c4 {4 ZMethod 14
+ x; D1 _& @, C=========8 W4 [6 W/ o( m0 w4 \/ H
% `6 a+ M- I3 F1 n3 X2 LA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 i& u$ d* n# H! h4 W, r
is to determines whether a debugger is running on your system (ring0 only).
8 ?* G2 M# v7 `7 f `3 X6 V$ ?+ b- \" n" C
VMMCall Test_Debug_Installed/ c8 u% k; Y% P+ o& h- |
je not_installed1 ?% a6 @2 ^* \. k m# h
$ I; ~% M- ?. D3 rThis service just checks a flag.
. y* B4 H. s8 ~! |. C</PRE></TD></TR></TBODY></TABLE> |