<TABLE width=500>
g( _) _3 ]: |- G! o<TBODY>0 ~0 R3 S; I+ ?/ l. t3 R
<TR>
0 _9 _ z2 e8 }1 d& _<TD><PRE>Method 01 `2 @; _, l, I6 p" d6 e1 a* M
========= n2 y$ N. Y! y7 K
) U4 [4 v V+ J, Q$ o/ \This method of detection of SoftICE (as well as the following one) is
/ F' H- o6 _, d( _7 S0 v4 pused by the majority of packers/encryptors found on Internet.: |4 L9 x5 Q9 e' @2 h a$ t6 F8 `
It seeks the signature of BoundsChecker in SoftICE2 d; J o1 K% h; |' ^. b3 j
% \$ z. o8 P3 ^; `7 r: [7 B. X; Q( j
mov ebp, 04243484Bh ; 'BCHK'* h4 ^% m: e) _8 K$ Y7 u$ q& g
mov ax, 04h9 P1 D$ P" C8 ?
int 3 - {+ w& i/ [: j
cmp al,4! i q5 e1 `" ] E! j+ l
jnz SoftICE_Detected9 W T( D5 [3 f; Q3 g
7 h6 X$ R# C. I( U5 Y, K; s___________________________________________________________________________' F3 j" D2 @" j# @/ P, D
/ y/ h: p; ] ]2 Z; }7 @5 y' aMethod 02
0 ]# _+ Z1 q! z4 W! z- ^9 C=========
0 L4 N- Q% l; N* N
3 L: [! _! R$ g8 |8 ~( O; EStill a method very much used (perhaps the most frequent one). It is used
; y6 h! c) f& d6 o! n9 @' g1 r6 gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; b1 C0 M9 x/ @+ G# O; a* ?1 mor execute SoftICE commands...& S, R! V" ~& d) j
It is also used to crash SoftICE and to force it to execute any commands: m% m' s8 b D- J9 z
(HBOOT...) :-(( * f4 V6 u8 \& G4 J
2 |" v' D' H3 z; f/ G' ]1 v1 _Here is a quick description:
& V% d9 F8 M& Q7 Z4 h4 S6 F U. Z-AX = 0910h (Display string in SIce windows)
6 M- u6 e# p8 b-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ Q: x) [+ `4 c-AX = 0912h (Get breakpoint infos)
9 _; g# _8 s1 E& E9 i-AX = 0913h (Set Sice breakpoints)
* |6 `; x$ k3 U! u" _# d; | o" s, z5 D-AX = 0914h (Remove SIce breakoints)
& ^5 v3 u) B7 z. e4 Y3 g0 L! }# \: \
Each time you'll meet this trick, you'll see:; Z9 t" ~+ e: _' D+ ^
-SI = 4647h+ X/ f+ b4 ]( d1 {% Q5 t% i
-DI = 4A4Dh5 ?2 E9 g7 S0 h" U9 C" f: \4 J3 h
Which are the 'magic values' used by SoftIce.
3 N# z6 Z1 n: m7 mFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ U# G# c' S6 [. D9 _: H: w6 T! o; }& U+ m$ @+ C+ J1 p' }! W/ D
Here is one example from the file "Haspinst.exe" which is the dongle HASP. B: X! ]; C! d% `4 t
Envelope utility use to protect DOS applications:2 }3 y- x0 [- [
: T; M$ z$ U2 \/ I3 V
: q# }9 }( T! E" ~) t4 H* z4C19:0095 MOV AX,0911 ; execute command.* }. d/ |& T7 e. {/ I
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% e, _4 G, ~3 O
4C19:009A MOV SI,4647 ; 1st magic value.
4 X& ]; K, q7 ?: l3 p8 r4 ~- M) H$ `4C19:009D MOV DI,4A4D ; 2nd magic value.
0 j/ I1 D3 J. ^9 F' B( x2 J! l4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* m; V x! T+ s' K8 M8 [5 u7 V
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
w% b3 b/ z9 B6 S1 W: u5 M) B; v+ ~4C19:00A4 INC CX5 ^5 |7 v6 R( ]" B8 C
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ S" [& i5 N% S8 d" @4C19:00A8 JB 0095 ; 6 different commands.
; A3 ]: D2 a O# o+ f+ S4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% t, `: M9 p2 O/ o' g! r4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 ]4 {( {- f4 h( J6 d
' Y; t$ O9 a/ V+ P. |The program will execute 6 different SIce commands located at ds:dx, which( U* a/ B$ s7 q0 ]5 q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- I0 ~: q6 g8 a2 f$ F2 K* d; ? Q; p
* w* @+ U" H+ e3 F8 c7 v5 r1 v; {* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 C3 \+ C" G" K2 |9 S$ X
___________________________________________________________________________; }9 p8 `1 _% a- G1 J. g& L
+ B# {( f% q% x% @: |! L! j
u8 |6 g3 X+ l1 C9 j/ f% X6 lMethod 03
& f% |6 f8 J! t4 {- Q=========
5 Y/ u. q- {7 o/ r5 E' y0 C
# x* v. [7 X0 d0 |+ Y7 \Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" h4 n; m. w" n% Q% F2 O7 z
(API Get entry point)5 R( @5 h9 N$ L E+ @) E
$ r. \/ O- ~1 M1 e. T; ^: j
! j, L0 ^- V7 H! E xor di,di. Y8 ~6 ?4 g- m
mov es,di
+ K& @, c0 C6 w/ @; E7 e mov ax, 1684h
) {$ w3 |! N( w+ F# x$ \! x mov bx, 0202h ; VxD ID of winice, L0 C: }( K+ {# _8 c* c# G" ~
int 2Fh
- l f1 A* X/ ?0 D mov ax, es ; ES:DI -> VxD API entry point; L7 `, f5 w4 `% ^
add ax, di
9 q& O% @3 v; |9 ~ test ax,ax; n; V" z: Q( e/ r8 I
jnz SoftICE_Detected* x3 ^4 |* \8 i, R, p; J0 u% |
J2 _ m5 _; s& k3 y
___________________________________________________________________________6 m* ]" h, ^7 g6 ~. Y
, c0 G5 L+ W& q0 D5 z( V, Y! @
Method 04
O$ Q Z5 F+ i3 d. k=========
3 \% a9 A1 u1 p6 U! `8 j/ [
7 q3 A# c) a1 _" m. C$ x& R- j& PMethod identical to the preceding one except that it seeks the ID of SoftICE: q# F+ {+ b2 ?, X& H! F8 S
GFX VxD.
- ?2 C& y: I3 t. E: |) B. Z" z$ O' u }) K! y
xor di,di
7 E( u5 ?$ ` r& c0 e4 Q mov es,di' A+ t$ Y* w( R3 [. c1 {
mov ax, 1684h
1 Y; d. q: R; I mov bx, 7a5Fh ; VxD ID of SIWVID
7 } c9 r: L0 l/ z1 I int 2fh; R6 {6 o: z% [
mov ax, es ; ES:DI -> VxD API entry point
$ r! t6 b: l! \* q: J; C add ax, di
1 Y N C: [4 S m) b6 J# O test ax,ax4 b. N" J% R7 Z/ x) o/ H; J
jnz SoftICE_Detected
/ a5 k. t" |# d' H! e! a$ ~4 p# ?; y/ z" i% O% m$ t0 g
__________________________________________________________________________
' E* ]0 |: i0 U7 J! {3 L6 M0 p4 R Z
l$ |! [" C1 p3 z, n2 E" Z4 B/ Q: K* Z) |Method 05& `! x1 B, s; R4 M
=========
( a$ R, G' Y4 e+ X( d: j7 A Y. A5 w% H2 q) s
Method seeking the 'magic number' 0F386h returned (in ax) by all system
4 i+ G# l" |/ ndebugger. It calls the int 41h, function 4Fh.
, [$ H( l: @" }* L9 G# ?$ AThere are several alternatives. $ p! U7 d4 E) o$ V: T+ x
0 A/ u( Z& m$ L) p# i' }* ?The following one is the simplest:
2 l# D3 {. ~7 I! u3 V; J- v5 U7 v1 o2 |& \& t
mov ax,4fh
: T0 Y7 }7 E* Q; r4 z" d* F) b int 41h
6 l2 K8 E6 J7 A* ~3 J. U3 }: E cmp ax, 0F386
+ y" C. A \+ e7 ]8 b jz SoftICE_detected
3 M1 ^& r- `8 F7 E( i
( W. b: s+ C: {* j9 v% G& g
9 ]/ a: S, T& M! x, v6 BNext method as well as the following one are 2 examples from Stone's
9 _( O0 X# a- `5 o/ x"stn-wid.zip" (www.cracking.net):
4 B0 R1 o% N# K8 ~1 u6 J k* X
mov bx, cs$ x6 R% K0 g, e9 }, _; n& M
lea dx, int41handler2
6 u* b( p9 b+ ^" ?1 l @ xchg dx, es:[41h*4]
; S6 C: G- M! m# R+ h xchg bx, es:[41h*4+2]: g1 d) W" B) a2 p' ^+ ]
mov ax,4fh, u, {6 K0 N4 V Y0 v8 J/ d7 E: e
int 41h6 p) @6 b, A) q$ @" d' f' B; [
xchg dx, es:[41h*4]+ u) H1 n( _2 Y. L
xchg bx, es:[41h*4+2]* f% F# d+ l( n. m, Z6 m& F
cmp ax, 0f386h9 `8 {' R% @) _
jz SoftICE_detected5 f# v; i' y- e
( K5 `" t8 k0 d) U0 Uint41handler2 PROC
5 }- t5 U% h g: r% e iret8 z/ F7 t+ }$ F5 T8 {
int41handler2 ENDP" w' f' ^' v8 Z. k' s1 t
* a2 K$ g) f: w# o1 k$ M1 }2 f* f' `0 p9 E+ |
_________________________________________________________________________: P' }+ O, D1 A! S# X
' Z- w; ^; ^- |) s
I* I2 R9 t% Q) r# d& mMethod 063 L6 K- e5 ~% g4 Q0 |/ t9 F4 g
=========1 ~# f4 ]0 w+ L8 n+ ]# a
- F3 Y) n1 B2 ?6 x9 B
b" v3 S9 E3 e5 E# }& J% B
2nd method similar to the preceding one but more difficult to detect:
4 [ c* Y2 l6 \
) y5 F. w" F% K# G7 x7 P$ y! N9 a0 @
int41handler PROC
0 A% b0 m6 S2 C% C1 g6 E t mov cl,al
& _1 [: k0 }/ q iret
3 n' f+ o9 f4 r1 ] Y# F0 O' A& Wint41handler ENDP
|/ ^0 @! ^9 Z+ I8 B% I* O
' U [5 F. A, c1 E: x& p
' `% D& |* N- V1 `- k# I* A8 f xor ax,ax& O6 e( d t( r7 b. S; V4 [
mov es,ax
M0 K( ^+ p. s7 C7 P mov bx, cs
% G$ F7 r- x/ u$ W' _; b lea dx, int41handler
" `2 R1 T- ~0 I% g5 l xchg dx, es:[41h*4]6 J9 @' B( J/ d2 w$ I7 m
xchg bx, es:[41h*4+2]
. C6 A! A- ~) t1 i4 p: |1 Z# | in al, 40h
/ e+ O6 w0 r+ u xor cx,cx
. d8 E! O( H8 B# C$ Y$ b5 @% R int 41h' e5 Q S' Z) R$ H
xchg dx, es:[41h*4]: s& C- H B9 G- w* [2 W0 ?
xchg bx, es:[41h*4+2]+ o# D! i: {1 u
cmp cl,al, S7 A# o' }9 s I! }
jnz SoftICE_detected% M! v+ f, M* p }) a
8 [) ?6 H" T! I: A
_________________________________________________________________________7 g/ L ]& Z! Z. K9 _; D% M
) g* g) m* a4 j. u3 I: h! v
Method 07
7 F k! f2 `7 ]=========! b1 `7 M2 S! H1 F d- M7 {
0 t! G$ a5 R! V
Method of detection of the WinICE handler in the int68h (V86)
7 v) p/ |& W7 ]) G6 Q0 z
0 s( k1 ?4 o$ s& u3 a0 a mov ah,43h
7 x7 q @/ ]/ G9 k4 H7 V! N int 68h
3 s9 ~* r; a3 n0 l8 H. _3 Z7 [ cmp ax,0F386h% U3 Q# ]8 K- c7 j
jz SoftICE_Detected
3 k& Z/ P, N f/ \/ j' s o9 p v* @* k+ s- j* |
: U8 x! b$ T2 h6 x# ?
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 `2 h' \. i( G) q app like this:
7 S3 c6 M0 j: O: n% ]' y0 V% j4 t4 d/ y4 y7 _. w
BPX exec_int if ax==68
) G% c0 D4 b$ g; s% x9 Q/ G3 t (function called is located at byte ptr [ebp+1Dh] and client eip is8 K8 [. A- I& }9 f# {+ c! N+ ?9 Q
located at [ebp+48h] for 32Bit apps)
! r9 z2 y I: _+ `5 B__________________________________________________________________________7 \ O6 K% l K: h* _7 G
# h( a5 U2 E! v( A, X5 o
* R2 q6 o" h$ AMethod 08
" L u; V% o. i/ {& R+ F=========7 Y5 e, ^# ^* L {; r/ |# g" r
, e2 `1 |& v8 ?* n
It is not a method of detection of SoftICE but a possibility to crash the
( e* @1 o4 ]' r( e0 n1 v! msystem by intercepting int 01h and int 03h and redirecting them to another
, Y& m) y8 T9 a A$ ~7 _4 C" a8 n5 Zroutine.
e7 ~! q% b! f+ DIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 t, d" i: q9 _. U+ W, B* E7 P9 Hto the new routine to execute (hangs computer...)! A, P, k l" {* U/ _
/ q7 F! U7 ^7 z+ V; m w
mov ah, 25h
0 B ]8 q4 x8 P/ H mov al, Int_Number (01h or 03h)
; g1 g2 o. P: Z mov dx, offset New_Int_Routine
# l7 I m( J% R6 k b5 Y9 w$ q int 21h
8 v1 j6 p t4 q8 J& q9 ?& z( v' |) h9 |8 }" O$ O8 b1 A
__________________________________________________________________________8 }, l! e" j4 [/ n; P4 z6 J, D& A& S
- h2 I4 R3 i- Y# ]Method 09
5 ?8 l) H+ a5 a9 D! `7 E( P=========
: i, Z8 Y, L* ^7 `0 K
1 c, H4 ?- z% p0 WThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) ^2 r: {: N2 S9 \% b: v
performed in ring0 (VxD or a ring3 app using the VxdCall).
5 Y# O5 k0 p5 w& ?: \! {+ NThe Get_DDB service is used to determine whether or not a VxD is installed* M; f- n2 X0 @
for the specified device and returns a Device Description Block (in ecx) for
4 Q/ P! T2 p9 I1 y$ O3 \that device if it is installed.7 f& Y4 f0 \1 a7 }4 ^ t
* e% e! ^8 ]' C) y. z7 c( e
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) D# Z- i! ] Z Z- f9 e+ x mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. q( B& ~! [. @! k5 h2 ` VMMCall Get_DDB7 x9 G- W) j$ h2 j
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! V7 U$ g6 |& u' n M
, \# N+ F: ?% j4 KNote as well that you can easily detect this method with SoftICE:
! O* h. o. n) B1 A$ ?7 g bpx Get_DDB if ax==0202 || ax==7a5fh
[7 H. n7 ^' w8 |
7 I6 G9 k. j1 w- c7 P) G* k9 s__________________________________________________________________________7 y: O) m- u" E5 ?* b) f
4 O& j# @! J9 Z. m: W
Method 10
; E- [9 t/ A1 q% x" x+ Q=========
, Y& b4 k" `, Q0 U. R5 v2 t7 S$ J; R& f+ N( _) V1 M
=>Disable or clear breakpoints before using this feature. DO NOT trace with) Q7 t( y0 R' K* \
SoftICE while the option is enable!!
9 W' j' l. z" i! F& w0 l) ]) ]8 m! ^7 k
This trick is very efficient:
7 a- t" i" u1 W/ l3 }by checking the Debug Registers, you can detect if SoftICE is loaded
5 A( F* b/ v0 _+ Z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; P3 u5 O8 `# ^1 S
there are some memory breakpoints set (dr0 to dr3) simply by reading their& c0 y. f/ B2 z$ V( w
value (in ring0 only). Values can be manipulated and or changed as well
& q& v# L, ~8 _* R8 M(clearing BPMs for instance)& w# x- T! |5 g! ]
4 U+ [( v3 X. t9 y i! \
__________________________________________________________________________
* @6 F6 K" E+ q6 L" W) a# a* a) l9 G! H! n: {) E. a( {6 Z7 e
Method 11
8 I; D9 L; g5 Z$ n. C* P" B=========* Z; x* N" T7 Z
, L$ \6 R/ i4 q0 q/ ]
This method is most known as 'MeltICE' because it has been freely distributed
* t9 Y9 j" @" nvia www.winfiles.com. However it was first used by NuMega people to allow
/ P3 V: x8 w9 Y7 d2 n! C6 ~Symbol Loader to check if SoftICE was active or not (the code is located1 H: _0 Q B' F2 h9 O' c. y& F
inside nmtrans.dll).* m9 {8 Q" u) o) s+ Q/ {
( H+ U2 ]4 V& N4 [4 pThe way it works is very simple:7 n) N5 v% ~* T X3 O4 a* v- x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ v2 ?+ Y0 x. VWinNT) with the CreateFileA API.
; S8 y. R3 K# R" D4 F- @. P: Z; I% H5 F
Here is a sample (checking for 'SICE'):
6 _$ D' h! C# n& H! ]* \+ W @0 c! y4 J! p9 f5 V
BOOL IsSoftIce95Loaded()
, T5 o9 u" Q1 }" g5 ?{: D2 r$ o/ r' a7 G3 V
HANDLE hFile; . r. _0 l; e; r b
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. E% a* p) h' X3 ^# } FILE_SHARE_READ | FILE_SHARE_WRITE,
# T- Z% U) D2 v$ X' R. V6 b& n7 S NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ r3 L6 ]' C( Y% f/ Q. s3 M if( hFile != INVALID_HANDLE_VALUE )8 g8 l: \% g) u# e5 t7 I- O
{2 A( H2 b1 ]" ~) D1 ?
CloseHandle(hFile);
; I# ^* T- c1 S! n0 ]! ? return TRUE;
, s4 j8 Q& S5 ` }; t( B# \; _! a- @1 F* y
return FALSE;
& n+ x5 a) ^5 z& k: s9 E}! J' Y' B, {: ] D% \
0 U2 S& U1 U$ M$ h( WAlthough this trick calls the CreateFileA function, don't even expect to be
( O+ X) @# t0 Z2 {4 v8 Y" D# G6 {able to intercept it by installing a IFS hook: it will not work, no way!
+ R: [( E5 s: {2 h; q6 E$ y) jIn fact, after the call to CreateFileA it will get through VWIN32 0x001F4 C9 k* q9 z+ J$ z8 M
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)* \# v: g- | q u, V' Z! ^6 o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 a0 C8 E( R& r0 w( V0 \0 N Rfield.
1 c# c9 b( @0 [( n) M0 ZIn fact, its purpose is not to load/unload VxDs but only to send a
+ ^" B8 H7 k2 R; cW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 h0 m/ {. ]8 n9 u& v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* g9 v4 ?2 T- E7 rto load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ ^9 s6 P/ e" Z% T+ [+ w6 ^If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ R! L8 t$ a/ R# Y: _$ mits handle to be opened and then, will be detected.
E# }. ^' i9 E$ QYou can check that simply by hooking Winice.exe control proc entry point) ?) G5 I7 e% [8 D
while running MeltICE.2 k8 H7 W0 ^8 O3 b7 g" I
) G* C" A" n2 m, @, K; [
# O4 ?0 N- y2 i; [
00401067: push 00402025 ; \\.\SICE0 r& Q+ R( e8 C/ W
0040106C: call CreateFileA- p* a- s) l& x, ^, |
00401071: cmp eax,-001- k( U$ N( h8 ~! ?
00401074: je 004010911 U. U4 F- e. i
9 T" ]0 X. {; V4 D7 r O. f
: {5 m9 _1 {& z0 r, z- w( AThere could be hundreds of BPX you could use to detect this trick.
* G9 s) @# I! n7 s/ F/ K1 K-The most classical one is:' Q8 e6 m) ^3 R+ {3 K; A
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( B7 T* Z: ]: O G& H" n' r *(esp->4+4)=='NTIC'6 ~- l* v5 V" u5 Y
$ G/ C( o$ @" ?( w3 |6 f; Q, ~( e
-The most exotic ones (could be very slooooow :-(2 Q' P) j2 g7 L
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 W8 _# w) V/ T. I* s4 Q ;will break 3 times :-(
- |3 g; \7 ?+ f) ?0 K
( D h4 X4 J6 P9 ]8 O-or (a bit) faster:
# w5 W" D: S4 ~% q BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 l0 Y. n) Y* R$ X7 ^3 K
B* x, x( X( ]- X) X) d3 u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 {+ b$ M" f$ x1 |, v2 q! u# p
;will break 3 times :-(! _0 x# ^3 B2 P* g0 \" l
8 D$ R- r( k& Z* v0 N3 w& f. \-Much faster:
' l% ?( n M* U BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 _8 ?; }" ?. n1 Z/ _7 M( i: P5 s
" S! @: f8 i' L; c% zNote also that some programs (like AZPR3.00) use de old 16-bit _lopen4 S+ }% j2 C" e$ [, S+ L4 b
function to do the same job:5 K' R( H6 a! I6 \
0 D& P+ |4 l7 Q
push 00 ; OF_READ3 d, L/ D& O9 K- B
mov eax,[00656634] ; '\\.\SICE',0
+ v, O! ]* f$ A" y0 s1 D8 E push eax
* H5 Y* [6 k* u# Y% _8 s call KERNEL32!_lopen2 W2 Z9 Z1 k# X* S
inc eax3 j3 h/ `8 c+ u, O* v& k9 A1 o
jnz 00650589 ; detected, [; t8 Q- m0 t8 w- h
push 00 ; OF_READ
6 t$ a- y- z, { mov eax,[00656638] ; '\\.\SICE'
+ W+ b; F& A) a0 Z* i+ A: k' j' O push eax
4 G; B k. C3 I call KERNEL32!_lopen
% Y( ?' O7 B! \6 I; { R inc eax. _: E! ~5 f: \/ B0 ?8 m
jz 006505ae ; not detected
2 ]: _, f( \& c; q2 c) G' }
/ [7 T* ~ t2 K3 w9 R
: P) X1 _$ V: w0 r: s/ K" s4 j__________________________________________________________________________
; b$ ?! |1 \) ]1 z- a
9 z; s4 c* C% U! h& H$ \9 FMethod 12; h5 M4 B0 k6 C3 M* {5 d
=========0 `; [$ {. m; F8 m5 C5 g$ n9 \6 `! K
6 O/ C, {# U/ BThis trick is similar to int41h/4fh Debugger installation check (code 05
4 t" h1 A/ z! o p* @% C9 [2 f& 06) but very limited because it's only available for Win95/98 (not NT): u" V4 z9 U# g) h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# ^0 x+ ~% V% y& S: _
$ p* s+ C' f8 Q. c4 X; U+ K. a push 0000004fh ; function 4fh
: r# E; Z% U/ l8 y6 j push 002a002ah ; high word specifies which VxD (VWIN32)
3 R+ a& J( a- R% X ; low word specifies which service
; i9 P. {1 u: g: N* r+ h5 k (VWIN32_Int41Dispatch)4 D2 [; J6 H+ c6 Z
call Kernel32!ORD_001 ; VxdCall
3 o- S' t6 [9 b/ o z# F cmp ax, 0f386h ; magic number returned by system debuggers
7 }5 U5 D& i* H+ e8 m. T) ? jz SoftICE_detected
# ]5 g% F: Z" E4 I2 `/ @4 p' z9 k
Here again, several ways to detect it:( Z; m E5 ~, B. G+ I+ B9 n. X
- g$ }; P2 M3 q! i4 Z& P6 @3 J
BPINT 41 if ax==4f! [2 x4 D1 F# {5 \7 V7 n$ v
( c1 X+ L1 B( x; y' E
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: B1 W( F( _" _ D: A6 v9 C/ ~7 C
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 d* f# X" _& K
2 Z$ P1 P% \0 @' G BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 u2 _' g8 N/ b4 T
) O! z) `2 x3 w/ Z2 q, z
__________________________________________________________________________$ P6 p$ R$ `) J% e. M( @$ s6 F
2 G( J/ y6 W- x3 x9 N: q: a' a WMethod 13
7 @4 P `* S9 C: |! d=========
( |( G& ?: U' |, _6 z' F/ [7 @- ?/ }
Not a real method of detection, but a good way to know if SoftICE is) ?) h( q, t7 {1 ?
installed on a computer and to locate its installation directory.
& C) s3 v. N7 N0 mIt is used by few softs which access the following registry keys (usually #2) :
/ f# g. L3 X- Q+ c$ M
/ i* C) ~$ g6 I3 \5 y4 }-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! {: r1 D h# \6 [\Uninstall\SoftICE
; j) a9 I% e4 P8 U) t4 @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 X3 k( \/ H9 T( k-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; d& T3 `' c# e) W1 c+ j$ Q* I+ E
\App Paths\Loader32.Exe" o9 i+ b' D$ f! n5 A# `" `
/ U; S$ D6 O7 W
' O# s' P6 J d; Y" W9 |Note that some nasty apps could then erase all files from SoftICE directory
; H: y0 ~+ U. ?* y9 S(I faced that once :-(
, k4 ?/ X1 F3 E% U1 P- @- w" i! b3 Z9 r: v G1 ?+ N) L. P' F
Useful breakpoint to detect it:
K) Q: P- N- `7 p3 G, j- F! d# Z* G2 [5 J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 a; D, c+ {7 r+ x3 e" K
( N: e4 G4 L5 M- Y__________________________________________________________________________
6 G3 k+ A6 o9 p! {' q
1 g$ D8 Z y4 e5 |* f# `& u$ L! b. }% B
Method 14
, m. q- \; D3 @0 V=========
8 M1 p8 ], O& W, X- m/ { z$ F% b$ A' v H: I' r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( m, Z* M4 m/ _; k( Kis to determines whether a debugger is running on your system (ring0 only).
% n8 M- j2 q( z/ s' A" Y: U) }# |4 i; p
VMMCall Test_Debug_Installed% g+ r* \" ^' a* I" j8 `
je not_installed6 y- f0 G0 {+ L0 M
' [5 [3 Z7 o9 l" y. Q9 dThis service just checks a flag.+ U& j, z/ ^8 @
</PRE></TD></TR></TBODY></TABLE> |