<TABLE width=500>, A, X5 ]( D# R* i/ r. R4 Y
<TBODY>& j# J9 C7 a% j7 J' U
<TR># C1 c4 ^5 s- x% B- I1 W3 O+ r# V! g
<TD><PRE>Method 01 - M& [; R) b" d# o
=========
. L/ i8 S7 G& I7 `' K7 ^/ T2 T. e7 J# x, L2 I# P' K1 h! j1 e7 W
This method of detection of SoftICE (as well as the following one) is
4 Q0 j2 ~" s! a7 l" N# y8 iused by the majority of packers/encryptors found on Internet.% b! {+ W% J- P' l
It seeks the signature of BoundsChecker in SoftICE h7 M7 i! F" Z9 b$ u x: S
" d1 L* p: U- V) f mov ebp, 04243484Bh ; 'BCHK'
2 N, ]& D3 {8 t# q( H# M0 D mov ax, 04h
8 D, k& y+ C% ~% A# r% z int 3
5 J: A6 J$ s S6 N: b2 M" |4 W cmp al,4
[/ L4 V: e$ {% N jnz SoftICE_Detected
2 e; W+ ^! N4 A; ]0 }2 y+ h2 K# Q% W% k8 T# U$ ]& F9 ? i- K/ E
___________________________________________________________________________ u( H9 K a; @
$ }4 `- J. ]) @0 i6 \1 V4 R' R- DMethod 02
, R; v/ C: s r=========
( O+ g9 v! `4 f* R
2 A) ]& f; ^% L" @* p- D6 YStill a method very much used (perhaps the most frequent one). It is used
; }- D: l5 O& X- r$ `7 Ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* r3 r2 x5 r' Kor execute SoftICE commands...
+ G/ P: S! w- c" u0 o4 H4 wIt is also used to crash SoftICE and to force it to execute any commands
$ N4 V& g- V: }4 O% `% A) q9 H; ~(HBOOT...) :-(( 3 F: K4 P0 k! Q1 e: e
& l; m6 r2 S" L/ a6 dHere is a quick description:* \! x! ~) P5 X5 ^9 x
-AX = 0910h (Display string in SIce windows)
( [$ E4 m: D) s. ^: S }6 c; F, U-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 _/ O/ |8 L G/ b-AX = 0912h (Get breakpoint infos)
% C5 g& h( X1 L) G9 M* `4 l-AX = 0913h (Set Sice breakpoints)! Q, h6 z7 C1 s- q. Y; C7 V
-AX = 0914h (Remove SIce breakoints)5 @" L% e* f7 S N- y n
0 `, ~+ _- s! M) X6 q+ I% n! B
Each time you'll meet this trick, you'll see:6 k# c0 h9 X3 ~8 P( X* I4 T4 \
-SI = 4647h f2 _0 P3 n# j
-DI = 4A4Dh
& \+ k) i0 Q/ z8 R$ IWhich are the 'magic values' used by SoftIce.
* U8 n8 s, R% Z. g8 W% ?/ n8 oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 @& ^( [4 d2 D! |
3 C8 ~' a5 \) T# QHere is one example from the file "Haspinst.exe" which is the dongle HASP
* L+ g6 Q& ~% a1 ~" iEnvelope utility use to protect DOS applications:8 v: h$ R- _7 g. W3 V0 B
) k" q$ [7 t8 h
! m+ ]7 v' c# A5 r3 W4C19:0095 MOV AX,0911 ; execute command.
' W7 m) X$ a4 B3 l, L. I8 }4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., H+ Y( u! U5 k3 z
4C19:009A MOV SI,4647 ; 1st magic value.
% j% A% T7 L \, B4C19:009D MOV DI,4A4D ; 2nd magic value." N) ^# n+ l! G. }0 C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! p; S/ k- a }* U# d
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 x' o3 j2 V) v) w3 h4C19:00A4 INC CX
+ r2 p1 o& Z! W" Z2 u4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: u0 h( o$ F) c
4C19:00A8 JB 0095 ; 6 different commands. r: T2 O C0 ~+ U4 O- Z( d
4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 b5 F' C) Z3 X. k# S6 {: J! D
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& j1 l* W& x, Q3 R% F
+ ~" O# {9 |7 y. w6 ?7 dThe program will execute 6 different SIce commands located at ds:dx, which& L' {7 `0 [+ e5 v: l
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 m6 {( l5 w s8 x3 D% V
/ x0 j `$ J1 S$ n2 D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 ~2 g k1 F: w: N2 Z___________________________________________________________________________
1 |# H7 M7 P( [9 }. N0 _6 l5 w& N1 U4 { o( o- l% c
+ w, b% l, N4 b' d! d
Method 03
5 H1 F; K+ \$ }* U; m=========7 y, S$ V4 A3 R0 J- E7 M9 j, W
/ m. b4 C2 r( T& SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, P5 }4 e: F% [8 j) g7 w% l) o* `+ S
(API Get entry point)6 d, g) F. i9 _2 {: z
: d6 [ @2 ~* B6 Q" Z8 K8 x2 F, d d% B# I0 e* x4 R
xor di,di
0 {3 O8 o; G- @- f) K mov es,di% f& ~ K' N# M- Z6 Y$ P8 e
mov ax, 1684h 8 Y2 E. I" ~% C- X4 o& p/ @
mov bx, 0202h ; VxD ID of winice
& ^* ]9 C W) o1 R( Z int 2Fh/ I" {, G1 C" P# I% j
mov ax, es ; ES:DI -> VxD API entry point) }9 g4 z/ z4 z; t9 ~" i
add ax, di+ u- ]3 P* }+ R7 X6 w3 o8 |
test ax,ax
$ y$ W$ G) {0 S jnz SoftICE_Detected
4 G4 y4 G! s3 x% U0 O. W# I' S5 `6 V
___________________________________________________________________________
6 \5 Q( m" B( I0 W- x0 s/ _& j q- p4 Q# Q! v1 J. x
Method 04* Y q! t" b5 j+ s
=========
5 ?! O" N; s Z* Z1 u. ^2 A
" @1 Y0 r% |9 W$ r a' cMethod identical to the preceding one except that it seeks the ID of SoftICE; i) l; ?+ {! t9 |9 w8 I
GFX VxD.
; L, `4 E0 G {: x9 {6 O8 S2 R/ A, `4 v/ V3 j
xor di,di; V$ G9 G! Z. I& x
mov es,di
4 Q4 T/ l" Z. q6 E mov ax, 1684h
2 M; V0 \" d- J) [; t& q mov bx, 7a5Fh ; VxD ID of SIWVID4 L( Y+ m( a' ^7 n) R
int 2fh4 Y. ^1 n" ?* a5 M
mov ax, es ; ES:DI -> VxD API entry point6 C8 P R1 w( {1 A# C. `
add ax, di# p0 y) J- G. g
test ax,ax! t! z5 f' l% K
jnz SoftICE_Detected
* w; g2 ?2 O& |4 \! q3 P* x; e$ j6 C6 F" s. I; j9 ?
__________________________________________________________________________
4 l+ Z! Q* W& Y3 d, q5 L0 N
% m& X* U0 s ]/ v8 ~0 y
, m7 E% o7 x( T& {, h% XMethod 05$ `7 F, S* x% v* l0 \& n
=========. @( {/ x8 u/ H a2 E% T1 ]8 j
4 t8 }& T2 o5 u, k( R+ @
Method seeking the 'magic number' 0F386h returned (in ax) by all system
! i3 F% |2 U! ?. `' x$ F5 f3 M. a# @debugger. It calls the int 41h, function 4Fh.
9 U/ r9 y7 W K, D% yThere are several alternatives.
( g# I4 I0 r3 Z ^6 R+ p: b& D; ]) t3 k: ?+ Q2 [/ [/ d
The following one is the simplest:
. u+ W: [8 L$ b+ n, W2 i6 p
" Q5 r" A2 T0 k N, | mov ax,4fh
; i- Z: Q! N0 Z4 Q5 ^6 C int 41h8 i8 p$ S8 R# S; E
cmp ax, 0F386/ S! |) w' D, C- I5 A
jz SoftICE_detected! R# N8 T$ n& C" a) f6 _+ O
6 Q$ w3 u: O# D0 s( t) E9 [+ K
) H- |* g; s: \4 B2 JNext method as well as the following one are 2 examples from Stone's ' o) l1 L: h' x7 A0 b3 h
"stn-wid.zip" (www.cracking.net):
; w/ t. q9 p0 b" P0 O7 W, O
* ~2 W i* y8 D" S, h0 f. S mov bx, cs
( R3 q0 H2 y' D lea dx, int41handler20 K. ]) w, O3 R4 b3 W1 A' \
xchg dx, es:[41h*4]
1 l9 c) K# P* h5 h1 R6 G" I xchg bx, es:[41h*4+2] ?( w0 T5 R: w/ H# N n2 G8 \ W
mov ax,4fh
! H1 g' K' F+ ~& E int 41h- c2 e7 M. `- b5 ^3 X6 y
xchg dx, es:[41h*4]: K2 r$ m4 ]. b2 m4 s5 T! [) n
xchg bx, es:[41h*4+2]/ r6 \' A+ V* |7 T7 a( G, ]! X( g
cmp ax, 0f386h
" O' q# t7 l& p0 _ jz SoftICE_detected6 D @/ d) m" I
5 E# Y& \' U, ? I F% p
int41handler2 PROC7 `7 l7 h+ Y, W) O. T
iret
5 _" K5 S8 g+ M5 K* b7 y7 Wint41handler2 ENDP8 k1 E3 j2 G& A5 m
. b) ^1 W/ q% o! i" U5 z$ v+ V- D* X9 d9 M
_________________________________________________________________________
6 ^% T0 }7 b# N$ ?2 t+ n% J& R0 u; B' |6 u6 }7 P
: a) _1 p: x, R7 D$ C6 q
Method 06# c, }7 [' M9 H# ]' ]. o
=========' g" O' |8 |4 w# B+ D7 t
7 x' `6 c" R9 Y; B# Q$ H% {9 ~# o o# ~
2nd method similar to the preceding one but more difficult to detect:
6 o* _# F! i% U; f) |* r. M- o! J% b$ q2 { l
! y1 D: P. ?- r( v6 |
int41handler PROC7 F7 ~1 g7 r& T2 I$ J& N; s. a
mov cl,al& `0 W0 J Z: |$ P* A, @+ l
iret
' T7 H, u. G" v( P" }8 kint41handler ENDP, x, |/ m$ @! V- c9 U& u
7 M/ E7 f9 j3 Q! E9 w$ e
6 e# @8 g. [3 @1 ]
xor ax,ax
" j+ E3 d- Q: L+ v# w" b' h mov es,ax5 S, x: ~1 J" S' T; q. [+ p4 [* W
mov bx, cs9 J& o$ }/ ~$ e2 k1 j
lea dx, int41handler2 |7 Q1 |. A: O6 k2 W8 P$ t
xchg dx, es:[41h*4]
5 Z2 Y& h: O {% |* T xchg bx, es:[41h*4+2], I4 y9 R, ~; w5 [, g
in al, 40h0 K+ Z8 t J6 e3 [/ y7 m" T; U0 k+ [
xor cx,cx
6 j/ x! Q+ M% n& B" ~! U int 41h
6 f) Y" u, |. z0 p5 y/ p/ T9 m xchg dx, es:[41h*4]1 N8 A, r4 g2 q0 f/ l. M* x
xchg bx, es:[41h*4+2]
9 E7 m5 I8 P+ `4 l5 z) a/ H! r cmp cl,al
2 f1 R/ C& ^; X1 N: z9 u jnz SoftICE_detected1 S' I- H" O3 R$ s; [: ^
# T X0 @3 b* q7 |9 g& n% ~_________________________________________________________________________
) ^( ^# h- e$ c$ c2 c6 {0 Y7 Y$ _ @9 O& c, W6 R) H! _7 Y0 G' F
Method 07; E) l9 N$ c9 r: Y' y
=========
2 I; p' \/ s% m" }; s$ H7 B( N) a6 d; E/ c7 @0 y
Method of detection of the WinICE handler in the int68h (V86)
! S8 v8 j8 M" n/ b, v% b7 U8 _; P: t& c5 T: y6 U: O
mov ah,43h! [& i/ L* {% x, a( I; N
int 68h
, o' X1 l9 I- ^ W cmp ax,0F386h
# h+ p) V& ?1 p( \; N8 o% A( @ jz SoftICE_Detected2 h0 _3 _" a! C7 u1 F# M2 q! i# X
& q' m v9 A# j) r2 Q
% O5 Y; }) ^4 N- |& u$ s& l$ z=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: h/ t$ {% N" h: N0 j app like this:) _- A6 U, z2 X: y( q
- C& D7 l/ w; e BPX exec_int if ax==68& r/ r. M" N6 w+ W( Y D7 o
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 M, O' @( M# p2 D8 @ Y located at [ebp+48h] for 32Bit apps)
9 D+ Y" T8 F, ~- |0 v8 C__________________________________________________________________________
( o2 N+ i' w- z- I; g. I% E7 Y- M% {4 b7 S! o( X: d) Z2 L
# ]- |4 m+ s, a ?9 S. C+ \
Method 08
T: q# q J& b, Y=========
) m) ^7 I8 }+ [1 [* a' w; b& a2 c! Z" \5 m$ x; H' n
It is not a method of detection of SoftICE but a possibility to crash the
: h/ F" Y; Y9 R- ksystem by intercepting int 01h and int 03h and redirecting them to another
$ N6 y6 Q7 V+ R% V$ \ I" y( i( xroutine.. Y. Y5 S. C6 m3 R. a) F) z9 v8 b o
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ W; z0 ?! n7 b, i( B: Yto the new routine to execute (hangs computer...)4 N0 u0 `; f/ S- l$ p
' Y* ]6 M% J$ J
mov ah, 25h0 b5 ]7 S9 E% z" b* ~7 E( w, G
mov al, Int_Number (01h or 03h)
! h# {. a' D) T9 w+ d mov dx, offset New_Int_Routine
( Z, k: e: L3 @7 o& d int 21h& H/ \' U- u! }* {
2 A6 Y o2 u. L. l__________________________________________________________________________- N1 Z4 e1 Z% h6 c5 Q5 y" K4 Q4 [
2 ]1 p; F3 H5 ~( `
Method 09
+ g* ^* N* F3 T=========1 ] d8 Y4 Y/ k4 ~# B/ O
8 }, V1 r& \, j! h. k, i- x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ Q* i+ N C8 B( T1 c5 s, P4 M
performed in ring0 (VxD or a ring3 app using the VxdCall).0 O' [5 Z6 j9 \
The Get_DDB service is used to determine whether or not a VxD is installed+ w! a( x, D1 J& e5 p
for the specified device and returns a Device Description Block (in ecx) for. S* D/ O' U1 [, k- V- V
that device if it is installed.
& ~# H: y6 _" R7 `3 t* ?3 O5 Q g: j( C+ T. I3 N1 h# Z
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ y1 Y1 V8 o( O; o2 _ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# g/ V! c# M3 W: K
VMMCall Get_DDB
/ R+ ]: i2 b) O! { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 j# V5 i: G7 _8 M+ ^" K7 @6 j$ ^# T3 y
Note as well that you can easily detect this method with SoftICE:, l& c8 {1 o+ Z8 S% v* T0 W
bpx Get_DDB if ax==0202 || ax==7a5fh
( A1 l2 O& [& P# g7 @# P+ m+ g
) t& p( j+ {( I) q* b _, B8 E4 g__________________________________________________________________________- u/ Z/ D. c! @6 Z: C# Z3 V
" D# I4 E. M) _" |; S. @! i9 ~Method 10' { z _# A' N0 A2 e$ B
========= n* |" _, c1 k" S% Z
' j# K& m% f. O# w& d
=>Disable or clear breakpoints before using this feature. DO NOT trace with0 b5 t; j; T7 O, S" ]% d
SoftICE while the option is enable!!% p$ |# K+ j1 b) B- S
( E1 U ^9 u. d9 Y& LThis trick is very efficient:
) [: i' @3 l" K/ J/ r4 Wby checking the Debug Registers, you can detect if SoftICE is loaded
, H; L% e+ ^& a0 ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if$ g3 `+ e% p3 M% c5 V! a# e
there are some memory breakpoints set (dr0 to dr3) simply by reading their
% R6 ^4 q6 X: w7 O! q/ l/ zvalue (in ring0 only). Values can be manipulated and or changed as well
3 W# g5 U( u5 U(clearing BPMs for instance)# g) x) h# r- ^3 ?! k
6 Q2 t/ N \- b/ C$ B5 L
__________________________________________________________________________" ^! h. O9 t7 }) }3 A) D1 Q$ \
! k' w% n$ a3 x/ ^) \
Method 115 E' P5 @: }+ {' a( A) Y
=========
3 f& ~+ K6 y4 P# O; k& t8 Y1 R3 n& C) R+ H6 k8 P( O
This method is most known as 'MeltICE' because it has been freely distributed6 s" d6 M# s8 y2 M) d
via www.winfiles.com. However it was first used by NuMega people to allow
5 ]2 F! c; Z) h0 r0 b: O. sSymbol Loader to check if SoftICE was active or not (the code is located3 R# R: H6 x5 T
inside nmtrans.dll).9 ?2 l3 j' l; \; ^" E
) B2 Y) v; B8 F1 t, f2 \The way it works is very simple:
9 \, P' G& s- B! RIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! l; N! H- B ]
WinNT) with the CreateFileA API.! Z& s. D3 P2 \, b, D1 Q
- G+ Z4 w4 |! ]9 u0 W, UHere is a sample (checking for 'SICE'):4 h2 L- E1 |1 ^( S9 M9 e
4 v6 q u& D# I
BOOL IsSoftIce95Loaded()( [8 ]2 Z1 R" I5 ^6 x& H; P
{
9 {$ p& D& c3 s* k; Y( c1 q- z4 C HANDLE hFile;
+ z1 t7 ` U0 B- |# w. p hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 A' n0 a+ t a/ `$ x( V& k* [
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ n0 ?$ l/ ?( e' G5 X7 O/ A NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( l- I) ^! r# e L: k' [9 E if( hFile != INVALID_HANDLE_VALUE )
+ `* ?0 N" k4 ] F6 L" l7 y: D {
/ ?! p7 Q6 p( k/ }- N8 R% C CloseHandle(hFile);
: c" d" c% e5 u2 o0 K' j1 m return TRUE;
/ O! A7 O v6 c, a$ x2 } }- K# I3 {! L6 @9 l9 u
return FALSE;
& u( ]' J4 {# @+ ?( j}
2 d8 Z, b+ q) q' F3 g: Q+ c$ g1 e" T
Although this trick calls the CreateFileA function, don't even expect to be, x2 j1 r t2 S; s% [& _# x6 s
able to intercept it by installing a IFS hook: it will not work, no way!1 S" d" {& m& L( F) u. S/ u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* a& \' f9 x2 v6 l6 p/ M. Qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); S3 j) e# k% T% P+ K2 M' a# H* T+ I
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 l; R" }+ h- j, A: U& Bfield. L* i' q( H- s/ v3 N+ T) d
In fact, its purpose is not to load/unload VxDs but only to send a
! `0 C) W9 s3 Z/ @% h" D5 EW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)( O1 x9 v4 C8 H# v- @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( s" D3 R, f- rto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 t; m' p2 z3 \) c+ IIf the VxD is loaded, it will always clear eax and the Carry flag to allow" q5 C% a: q# ~) Q/ F% M
its handle to be opened and then, will be detected.5 I$ _3 o' K! Y3 D0 E* E. T
You can check that simply by hooking Winice.exe control proc entry point
9 m9 c1 k& v0 |; |, Fwhile running MeltICE.4 M- M" d3 J: z( d3 Q
* E* i9 G6 v6 J+ K: }8 f$ K
h! {# b1 Q3 O$ I' K1 b8 N 00401067: push 00402025 ; \\.\SICE6 J% Q. c `4 L! @
0040106C: call CreateFileA
$ A2 J4 t' v8 [ 00401071: cmp eax,-001
$ e r, d& g5 }# L5 H 00401074: je 00401091
# ^# @( V& m1 q( @; c$ l" j/ _2 L! k0 o x6 J; y
4 B/ h# i5 Y( ] Z" u9 t" a0 wThere could be hundreds of BPX you could use to detect this trick.5 s0 O) L* i4 U- w
-The most classical one is:# i- ^( c" f5 p1 {
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& E( \0 d& F) E( ` s" ]8 u7 u0 M *(esp->4+4)=='NTIC'- r6 ^) Z W) s2 n/ U: Z$ D+ x
h: i4 P" j) p6 M-The most exotic ones (could be very slooooow :-(! c( G! H+ E5 w4 \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 n5 d Y; X9 j& [- ~& z ;will break 3 times :-(
4 W, z1 k1 f& ~4 C1 w8 \ E! i; r7 i9 |3 b' r& k
-or (a bit) faster:
, V( X* H+ H) G* H3 ~% }4 x+ { BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). ]3 x4 b4 H1 d1 c4 q q" a
% Z& C( y$ s0 m" F BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # k* a G* I' h M4 d ]4 E
;will break 3 times :-(
v# L% o( p) k5 v3 `2 l4 q1 S5 h4 @' g
-Much faster:) y- c) J, N% n8 K! Z( S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 B( L# J- d+ o( t" n* G0 ]
K' `" k% h, x3 y0 aNote also that some programs (like AZPR3.00) use de old 16-bit _lopen( s7 n+ F, M {3 f7 V3 N2 a
function to do the same job:, |) P+ P* H8 L, O; T) f. ^6 W
0 H$ ]! F, h1 w. f1 g. }6 k) y& d push 00 ; OF_READ
. f! G1 Q5 P5 l; q+ ~ mov eax,[00656634] ; '\\.\SICE',06 H6 g+ }- R5 k6 s5 N: i5 d8 {6 j& k7 B
push eax
# X& g8 ^4 H4 i call KERNEL32!_lopen
8 ~$ _% o0 q* _4 d$ C" e inc eax- y, K- C0 M% e" ~, S0 K' N1 D' o$ a
jnz 00650589 ; detected9 i& ~+ S& T( w3 R8 b' H! J3 {
push 00 ; OF_READ# {& p2 v0 \+ z) S
mov eax,[00656638] ; '\\.\SICE'
; Q5 w3 L/ x9 J8 m6 L) n) v7 h, U4 q ] push eax9 F: b" }6 ^0 B
call KERNEL32!_lopen0 X5 o9 d" e& q# Y
inc eax* N: |" Q* x+ V9 K( t! F! z
jz 006505ae ; not detected
+ o/ d; m6 {# J/ R5 @) i& L& F8 d& g
2 U5 p% i; l. X7 S5 s4 `__________________________________________________________________________- S" V4 o% w6 s+ X3 G" r9 v
Z' J' m: Z) W* W' G
Method 12% v( G! k+ s) `- _4 ?/ a3 e
=========+ V& ]8 s' v8 N' R
# V N& r" p5 ^4 m( b# \This trick is similar to int41h/4fh Debugger installation check (code 05
; [$ R: y( h& _6 r% T& 06) but very limited because it's only available for Win95/98 (not NT)& l% y, N# p- d9 Q* A3 ~# {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# f3 @ S7 v2 @1 U; y z
' L+ W2 p8 S/ A
push 0000004fh ; function 4fh6 K* u! v* b. |: q% {' _$ b/ }/ b
push 002a002ah ; high word specifies which VxD (VWIN32)
. N% @# n6 C# G: m- [/ p ; low word specifies which service
% p, o0 D- p! ? y (VWIN32_Int41Dispatch)" ~! m! R; { a. r! ], r
call Kernel32!ORD_001 ; VxdCall
: W* x7 T+ Y1 O; b cmp ax, 0f386h ; magic number returned by system debuggers
# Y% x5 ^+ B- K6 B4 U jz SoftICE_detected: {7 b! A* ^, R% M+ h( \6 e1 w
/ N- j6 A( W6 C7 U+ ~$ S, {Here again, several ways to detect it:
. s4 f' Y! O; a) T& i5 ~+ D. I g9 c. j1 w" D
BPINT 41 if ax==4f' i/ N7 G6 y- E6 |2 T# ]
- N0 }4 z0 W5 {2 `8 s7 o
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 F; B; X# |! X& l
$ l. e+ g! d$ f5 N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 r( i! q2 d- c& P1 ^' f
+ ~9 [* H# q) G& a [5 P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 R" h4 ~5 ?3 Z. l& }6 Q8 P4 p8 p( e2 _- p/ ]9 P* b% R! _
__________________________________________________________________________
" E; ^# e3 S4 f, @* A0 ~: A4 ?9 g% |; ~- f1 r! _
Method 13, |3 p# S5 m: L9 {
=========
7 R w1 A1 E1 C+ m1 E. Q; ?. E' \! l8 j+ D
Not a real method of detection, but a good way to know if SoftICE is
) H4 ~7 B; t: @2 t; h vinstalled on a computer and to locate its installation directory.
H2 d8 v! f$ S" A, XIt is used by few softs which access the following registry keys (usually #2) :
3 ^9 I, @& X4 K3 q, r$ l* ~: O# u( P3 K3 A3 ^
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 s |) }/ @9 Q: s( |7 s* O. H\Uninstall\SoftICE
1 H7 d8 l7 N1 B4 L3 K8 p% i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' U E+ e) \3 B4 m-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion o. S( ^3 ~$ ~. \
\App Paths\Loader32.Exe
" t7 B/ r+ s; y9 @0 R% `6 Q3 ?+ X. a1 J
/ j/ E% q# U* w: [Note that some nasty apps could then erase all files from SoftICE directory
I# _' {' a4 m0 s. n% X2 [" S(I faced that once :-(8 @/ ~6 k- I4 F6 f
: M& y/ m7 {8 h1 D5 [$ R# K- U
Useful breakpoint to detect it:
" k& ]# r, D. c }1 D( g/ n0 C3 U' F8 Q$ X& x
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' @! j0 T3 D# z# K5 N* ~ i
5 I9 u) s. B' Q# m) f2 ] w: L( y( ___________________________________________________________________________
. D; M4 L- _# V7 {
' y- Q" ?* t$ e6 C g0 |( L3 b6 {0 s
Method 14 & `1 K8 R$ p, ?4 x: G; m' ?
=========
! [7 |( d8 b$ I9 [# ~5 |1 r: ^" B* S1 C+ I: c
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. K, y# B7 j6 ris to determines whether a debugger is running on your system (ring0 only).
' m7 q9 ^& s* d
1 s% A1 e2 [8 {, ^ f$ L: c VMMCall Test_Debug_Installed
; H2 y5 {8 T& {; M je not_installed
. O) `0 l+ C: ^0 {% E2 X1 ?
5 P' i9 e. Y8 g7 @9 j' z+ I/ tThis service just checks a flag.& Q+ t$ W- @ p1 H2 n, G
</PRE></TD></TR></TBODY></TABLE> |