<TABLE width=500>
' G) u# O. X1 ]4 @<TBODY>( S2 q3 O2 R5 l8 W1 i
<TR>
: J6 S$ Y) b5 h* B8 ~5 z6 Z<TD><PRE>Method 01
* @- }0 C# P4 i7 u. V/ n5 F=========$ ~$ }8 ^" R3 \& `
: m* F0 e' ]3 h& r& LThis method of detection of SoftICE (as well as the following one) is
/ ?& f A* o$ R$ T& w$ `8 k( c- Vused by the majority of packers/encryptors found on Internet.
+ `7 Z d' P, b7 p( _6 }" M jIt seeks the signature of BoundsChecker in SoftICE% c# `( w& i9 q$ e- Q
! Q6 S' s. k0 e2 w mov ebp, 04243484Bh ; 'BCHK'# @& ? e; ^7 G1 s% S9 ]7 t
mov ax, 04h
) C5 T- o" A3 \ int 3 4 s! |; A5 h4 k& x; X. R
cmp al,4
X* u, z" m4 E1 L: Z jnz SoftICE_Detected6 R& n+ M6 r. q
( O! Q7 X1 l. I0 v___________________________________________________________________________( z- V6 k5 o \8 m6 r
/ b# N' w3 h+ R+ X
Method 023 G; j. e( s6 @6 J7 l0 X" w
=========# |; Y" \9 s0 e, t3 Z7 n8 R
! o2 F& i' u2 M: R
Still a method very much used (perhaps the most frequent one). It is used
7 }2 t4 ~1 r/ U: dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 T6 [& V# ^$ _0 y
or execute SoftICE commands...2 h5 A4 _" U1 @* Y3 |+ n
It is also used to crash SoftICE and to force it to execute any commands4 p7 H3 @/ N* j6 G
(HBOOT...) :-(( . T* q4 {$ g2 J3 X
! O* ]- @# h* d( S7 F" ?Here is a quick description:! K1 P2 d. R5 |# w
-AX = 0910h (Display string in SIce windows)
' q6 Y) a4 N5 O# B' k1 O-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 Q: b+ r J1 Z9 {6 r5 R& Q-AX = 0912h (Get breakpoint infos)
" B- k; i. r+ Y2 c: k-AX = 0913h (Set Sice breakpoints)
6 ~/ G+ X0 W: \6 s; J- H-AX = 0914h (Remove SIce breakoints)
2 b& D6 W$ p9 W( z& A0 X
) {7 F; \, m; N. S- MEach time you'll meet this trick, you'll see:+ y0 z Y' x; T$ W" v% R' R
-SI = 4647h
# Q2 Z1 z8 E& b3 t" r2 G-DI = 4A4Dh
U m3 Z+ C$ M, NWhich are the 'magic values' used by SoftIce.
& `: p& H- S7 c# _ S3 o9 y2 ?For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ ~9 Z3 U/ A9 D
3 p+ n& s& I; J' k# I! M9 f: K- ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP+ E y# H0 O! n2 G9 c/ h% H9 _4 Q7 U
Envelope utility use to protect DOS applications:
# d0 l+ w9 z' `) ^: R0 W, g4 |; R' ^
1 Q- o- I0 h+ }4C19:0095 MOV AX,0911 ; execute command.
2 c* M F# u( @2 P4 i0 v4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ T: I) |& b+ O L# s9 z
4C19:009A MOV SI,4647 ; 1st magic value.4 ?& m6 M ~, A! M0 R
4C19:009D MOV DI,4A4D ; 2nd magic value.* g( I; H6 M; B; [# m3 a$ K6 Z
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*); s8 T( R6 j) W
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ R& G6 N% O7 q' m6 f4C19:00A4 INC CX
* @5 A1 E0 u5 G* x' m$ A1 V! v4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 k% S3 j' i) r2 q
4C19:00A8 JB 0095 ; 6 different commands.$ P" h3 z8 T* s& L# p5 F% Y/ f
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 p1 ?+ y; b3 e% P/ G4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 z# g. Z6 r" Z1 {: h8 X! r
/ W1 N8 v% O6 m- ^
The program will execute 6 different SIce commands located at ds:dx, which) Z& m6 f8 \# S. m
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- M- `" y! F7 p# W$ Z% g& z9 @! l
& f# T6 w% q( {4 l; s* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ l& ?, K/ N& k' `; @* P7 h ?___________________________________________________________________________
- S9 `2 k/ j$ B' a
) }) b' ]1 w. P* ]5 p0 ^& }1 v0 A9 W9 p# I
Method 03* q5 n3 ]0 s P( l. d
=========
9 _ k1 R- {! E7 Y/ W
/ i e4 x% l! y' ELess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. y. b( o7 \$ b(API Get entry point)
0 i: J4 R' t" W3 F
: S8 J0 C8 g* l5 r" G$ ?9 E* Z. u5 d# v* t- k- U
xor di,di
. L" u/ Y* o, \1 _& L# a+ U1 A mov es,di
e8 {3 h4 @- Y L+ a mov ax, 1684h ; s6 o9 w4 W( X& @6 V, r
mov bx, 0202h ; VxD ID of winice
{. u' s/ R8 r" k$ \4 G1 @ int 2Fh
: t0 q) \; w! ^. W# ~8 ~+ e! b mov ax, es ; ES:DI -> VxD API entry point. f( d, f% x+ F& q
add ax, di
- q& {, L+ O4 u test ax,ax
5 u4 z8 `6 _4 K, j5 G jnz SoftICE_Detected
' L) G) L4 I' R5 e3 x" {) @* z9 ~+ g: D$ _* _9 m: r/ u! N; t+ _
___________________________________________________________________________) ~% p* \8 b; O9 A1 [
4 D/ U- B9 E8 m) N) z( sMethod 04
' ^+ T; o# W7 |* Q, E8 K9 E/ y=========
" y1 h1 {* q" a9 X5 [
7 }# \0 R% Z- H( B% CMethod identical to the preceding one except that it seeks the ID of SoftICE4 j3 G: w# j* `" s; R6 X2 t2 X# `
GFX VxD.
& X! \- V% [0 n" X. y6 G8 Q- N8 x! o2 q @' K2 O
xor di,di
7 O# K8 Y- s4 `- F8 Z mov es,di6 a: Z% z% g( D: d
mov ax, 1684h ! J" v2 T4 s/ q. Z2 H
mov bx, 7a5Fh ; VxD ID of SIWVID
" u: _8 _4 J, y) n int 2fh
( W6 X, a) d) L/ L, x+ T# _ mov ax, es ; ES:DI -> VxD API entry point8 \. |& @- v k/ R8 A4 v
add ax, di, l% @ j- z3 O+ o
test ax,ax% W- q9 X2 s2 o: M; X
jnz SoftICE_Detected* {7 Y% W2 R# U
* E( L5 L. T( Q/ m
__________________________________________________________________________
9 y X$ y. @ s) G
7 O: C' c9 g& {7 ^
; n8 }; ~9 C# m( h& r5 t' z/ }* Q$ kMethod 05
+ a* g# X4 ^* z; K# B E! @2 u=========
& u9 M4 w5 E% e! |( L9 Z- M2 g9 u
' c0 _* |/ ^, x" }/ P6 t8 IMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ o5 z: o, H; Q" z8 ]( |
debugger. It calls the int 41h, function 4Fh.
; ^' j" M4 o X' ]0 W8 {: bThere are several alternatives. 5 P. p$ R) r- r2 S( G k& ^
Y2 x/ d" a* @. `; J1 EThe following one is the simplest:
5 k2 r& E) D$ x. K/ m4 B6 c( V: O- \% J; p8 [
mov ax,4fh; a: w1 x4 A% A0 t$ ~1 u
int 41h
# r/ U' ~: J) _& a$ ] cmp ax, 0F3864 G9 }8 o O& R
jz SoftICE_detected
* `3 W \: u+ ~7 V" M
" G) N4 y' P5 u# N6 G& a3 e
( K% K0 Z& G# T7 i* @$ W7 }7 oNext method as well as the following one are 2 examples from Stone's
. i ~, K! I$ {1 X G& F2 M$ K"stn-wid.zip" (www.cracking.net):- p/ z* p, E4 M& G
/ D$ [& U+ h; K# I3 v mov bx, cs
' F% o# g, c- O* F# F. [ lea dx, int41handler2
: s5 [( ~8 N% W xchg dx, es:[41h*4]
! s1 j2 M. F* d! a xchg bx, es:[41h*4+2]
7 ?, \; u' h' ?2 k9 o. S mov ax,4fh
/ T& N3 x; c6 u' Z: N2 R; b int 41h
5 N2 ^. t7 X4 P; n9 ? xchg dx, es:[41h*4]
) Y/ Y0 N( J- ~5 l. H xchg bx, es:[41h*4+2]
# j; W* }3 _! Z$ L3 B% ^* q cmp ax, 0f386h) G: i$ }% n- e* f4 F. Z6 S( S8 m
jz SoftICE_detected
& Q, W& ]& `: P0 I5 p
9 M8 t: U! R( a8 o0 c& }/ Gint41handler2 PROC
' q+ D" i" j# D, z& _) ` iret
1 k7 Y/ R0 w$ H+ xint41handler2 ENDP' A3 i8 `- |: A
0 L/ d' T0 a- F9 j' v
1 b- V, m% D4 J
_________________________________________________________________________# J+ d; P' l# G+ t, ]) d6 q7 w0 l
6 W( L$ j4 G6 C' r
( X, N/ k- n3 eMethod 06
& h& e2 k8 Z: w5 `3 F: _! V=========
" _% i! Q2 s) `8 d1 d! `2 m- i# X/ `# { a: |) A. V# P- c. `
; T$ I0 h- C9 P
2nd method similar to the preceding one but more difficult to detect:, z) E, M0 V V, |- D
- ~7 u. m* I, a2 W7 K5 q! T
, c x2 @' C, S1 I) T. _. g
int41handler PROC; Z5 W' f2 n7 B$ i
mov cl,al
5 Y) m: `, k1 w% e o+ l iret
- G# C$ R9 d# N- V2 ]% G Uint41handler ENDP
. w' W: z6 b K7 x$ j' I; {0 {$ V* i$ n5 N9 Y5 b, j/ L
( D' S2 K; B5 Y9 @
xor ax,ax
9 y/ w8 P! q5 Q, m- X mov es,ax
3 ]1 I. ?0 m" C- F" j7 t* D, [9 {& H+ u mov bx, cs4 F2 r! i' T9 ?- D* M5 |( _( A
lea dx, int41handler
! A1 p) P6 F6 Y! r8 ?0 w6 a# w# y xchg dx, es:[41h*4]" \* u( m y- ?5 z
xchg bx, es:[41h*4+2]' A* Q2 q5 V) N( a# S* T5 k
in al, 40h
( [) N1 Q6 e) H0 R) F5 c$ N$ O xor cx,cx
+ J: J3 p/ L' U3 {8 u2 c4 W6 b int 41h$ F" F3 w$ a% `, C. `
xchg dx, es:[41h*4]8 h8 L- [+ C- M- D& D
xchg bx, es:[41h*4+2]
2 O# V6 g4 r6 E, @, e cmp cl,al
% x4 m# s0 ? m' [ jnz SoftICE_detected
1 |1 h* h. m' k( r$ U# u
& r# I D/ k7 ?. L_________________________________________________________________________6 z7 G; ^; ?) _4 y! {
7 k4 s, r, H! P( g' M$ E" E
Method 07
- J0 C0 W+ Y( y. Q( Y, ]=========4 P9 I% S* G( \" o! a
7 ~$ a3 V. X" h. u/ k& vMethod of detection of the WinICE handler in the int68h (V86)0 y3 P- Z' _# O1 M. {- Z2 n
7 Q1 N6 l2 ]% R, Z+ C D7 W+ F
mov ah,43h
0 l! A o+ h$ Y int 68h7 M0 ?" ?' f. e h* X% o
cmp ax,0F386h6 ^6 Q; J; C" T8 N2 u
jz SoftICE_Detected6 v6 w9 a. s9 q7 c
+ o( k8 l5 }: ^0 N+ B' v3 ?0 I; H. V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, V2 ^2 q Z0 k app like this:
5 Z: f/ [5 _$ [: I) l2 }8 X1 _/ d( J" c" S4 T
BPX exec_int if ax==68
0 h1 ]2 B/ S7 J5 D* b (function called is located at byte ptr [ebp+1Dh] and client eip is4 p+ w1 I' k! A9 O9 P
located at [ebp+48h] for 32Bit apps)
4 m* ~2 k1 s5 t/ ]9 n__________________________________________________________________________7 k, j4 L9 Y1 g f2 h9 V/ u
0 p! j+ K+ F8 U
% B# {4 _# D0 fMethod 08. Y* Y0 ^3 K4 f* q G
=========4 k l% b6 c, w. C, {" y$ p! K2 \
$ Z1 R0 P& B8 `( g( K: V
It is not a method of detection of SoftICE but a possibility to crash the
! g( U" y" s6 G$ s$ ?5 b) hsystem by intercepting int 01h and int 03h and redirecting them to another0 e1 {! z5 ^1 a* ]0 d% b6 o8 g6 `, e1 l
routine.
7 M+ H9 p8 Q0 M7 b% QIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! l' t) G: F7 K! Jto the new routine to execute (hangs computer...)) c# D! T; B: \' F3 J; g+ Z' Y
3 R, E/ \ X) l$ \1 T0 I" [- ` g mov ah, 25h9 ~, k0 S* z* d7 W( n4 v
mov al, Int_Number (01h or 03h)
. U3 z6 z5 y% o9 _. @% Q3 K mov dx, offset New_Int_Routine! Z$ Y( ?, P" }6 A, e
int 21h
- A0 \1 `$ s) v/ _# a1 R" F$ X) u v9 n
__________________________________________________________________________
9 i6 T; o; h' W8 f. d! }- W
# w& c/ j% O1 _3 e/ MMethod 09
+ ~- @) {- C6 Z; h- o' a=========8 T5 x% V% N2 k2 t. W+ K
2 f' \% t6 Y: |8 x- R# XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 e6 l# n) c* @& o
performed in ring0 (VxD or a ring3 app using the VxdCall).
& P& t' y2 S! N% E; sThe Get_DDB service is used to determine whether or not a VxD is installed
! U+ F6 e. n o; Y5 Cfor the specified device and returns a Device Description Block (in ecx) for
9 O6 m+ t, z# \that device if it is installed.( ~7 t2 s- `3 h# c
7 s) Q0 t" e- z; z0 r- ?% P( R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' E6 Y& h1 a+ s; M: Q T) R
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' V: z" i/ E% {. d
VMMCall Get_DDB. P" S$ Z. _+ m' @
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! r5 }: m) v, {4 Q1 J' `- m. J Y8 u' `# x% _
Note as well that you can easily detect this method with SoftICE:9 h6 h+ }1 N" H2 J
bpx Get_DDB if ax==0202 || ax==7a5fh1 U; t$ a9 I& T7 J: w& E
' H9 i7 z, `' G6 U
__________________________________________________________________________
0 G8 S. m5 A0 ]2 O4 M& l
: k" J2 \3 M) h* B* g& v9 aMethod 10
! d& q! U: ~* F, b=========
, e: S7 G& b% n6 s& M5 h( f! R( A) x5 k: r* _. L! k
=>Disable or clear breakpoints before using this feature. DO NOT trace with u9 ]: a! ~6 U; [
SoftICE while the option is enable!!
! r3 ]3 h% Z$ {$ n5 }7 s* L# E/ G. N" t) M* t( [5 R$ W; }" ^
This trick is very efficient:! R( C& F4 ~9 x- W! ?) G
by checking the Debug Registers, you can detect if SoftICE is loaded" C2 g9 O0 g. h" g4 x( D
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! N/ |0 }1 Z; C& C# j- [, A
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 P7 ?3 j2 @/ a8 Y( g* U& X6 ivalue (in ring0 only). Values can be manipulated and or changed as well; Z' q" b& v3 v8 f- l0 ^1 o, X
(clearing BPMs for instance)
. Z8 j2 M, f+ P0 K7 r, H, i( h6 g4 f' Z
__________________________________________________________________________
' q' w( r) ?" w4 G" h' s! z- u- ^" Y+ T* @
Method 11) @% y# ~: x! \) j# T u; n7 F
=========2 X- |+ W4 s1 O. m6 V% G* o, {% E
8 ~$ t0 V: f8 RThis method is most known as 'MeltICE' because it has been freely distributed
& |! ^: |8 x$ o/ W4 I8 k5 nvia www.winfiles.com. However it was first used by NuMega people to allow
' O- \+ _* h) K R( \6 SSymbol Loader to check if SoftICE was active or not (the code is located
$ D- b5 a( h8 `1 J+ H9 q; L4 ~% g' {inside nmtrans.dll).! _5 j5 a' M9 c4 ~4 y4 O
0 T/ E( k) E( o+ g# S) V
The way it works is very simple:2 K/ O2 F( S+ @5 ?% Y5 O) M' s; z, T% H5 L
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ C3 r! u% u. t$ `. Y1 @6 p( o* B) S
WinNT) with the CreateFileA API.
$ o/ J) C; K% Z p0 a
/ O/ W$ v6 W! U+ t- s9 Q8 Y% SHere is a sample (checking for 'SICE'):! ]2 `; W) D' Q
% m3 f: v$ I2 g9 c: M
BOOL IsSoftIce95Loaded()
9 L4 K# J4 v- |" q{% {# e9 v4 |* z
HANDLE hFile; 5 \" F4 l& l0 _# z/ [- M; I- {( n
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 Y' I+ N6 @& |* u FILE_SHARE_READ | FILE_SHARE_WRITE,
2 {* u, o( z1 B NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: a' S, i6 F( E) j! V! j if( hFile != INVALID_HANDLE_VALUE )
2 s& _ w3 u/ ~- T {
8 |' B* k0 M+ p# m1 I$ i: S/ H. t# r CloseHandle(hFile);
8 W" i+ O8 i% n. r# x- r6 ~ return TRUE;; |# L- P7 C3 d0 }+ e) B( w' P
}
; u2 [5 ?; l# ~( H0 ^; V5 h: Q! Y return FALSE;
( Q( x, L9 l S E* G3 K' Y}. f6 B: g# I o" S' @! R7 ^# s
% a; O3 d5 i- {, l( g& b' r
Although this trick calls the CreateFileA function, don't even expect to be
6 u* V1 K0 p- A/ C/ ^able to intercept it by installing a IFS hook: it will not work, no way!3 g& J, h% L5 }8 b- u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; Z B5 L. E/ ^2 {+ O+ V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% T2 ? r6 M9 ?% u" Q( e; ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc# y S8 h& p0 ?! E4 {
field.1 U3 O) c8 [: s3 s# @+ K1 ?) l
In fact, its purpose is not to load/unload VxDs but only to send a + |- \ K1 U5 m: j: R; E9 a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- }3 Z) ^8 H3 F4 `. uto the VxD Control_Dispatch proc (how the hell a shareware soft could try0 ]7 E' Y6 Z" w8 ]) x' {' |0 m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).6 S0 k2 j. k# Y# t) {: v' \
If the VxD is loaded, it will always clear eax and the Carry flag to allow
! \$ F# K' p) Iits handle to be opened and then, will be detected.! @! n8 O' J6 C. V
You can check that simply by hooking Winice.exe control proc entry point
3 @) |& d+ t* a0 b) ?7 E: k+ dwhile running MeltICE.7 i2 O" x' O* f: |) U
8 a& x C3 f( ?8 p: J# O: F& ~( q6 T* ]
00401067: push 00402025 ; \\.\SICE/ |$ c: z+ \/ D" M7 W
0040106C: call CreateFileA9 \' B. r, o _' g% `
00401071: cmp eax,-0013 ]" I5 w0 n1 ^* b0 s
00401074: je 00401091
9 S7 A* L, q0 J/ {) S7 `% U
3 V) r. n) J# c; C0 p6 e/ r
* ^- ]3 F. w- RThere could be hundreds of BPX you could use to detect this trick.) @$ j: H! A; T* e2 p8 }2 y
-The most classical one is:
3 B! o# H4 N* ~1 _ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: ]2 V6 U+ C2 D2 I$ q" S: g$ i *(esp->4+4)=='NTIC'; ]* ` e. o6 k, z2 _4 M
% i' \8 H( [, H& |
-The most exotic ones (could be very slooooow :-(8 g6 k& f x& G7 I$ W, S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
' c% W$ V9 q2 z3 a" `% h ;will break 3 times :-(5 l! u3 @, c& Y2 i5 ^% H
- q j+ M( e" t @# ?$ ~
-or (a bit) faster:
- K( F _4 z) V6 @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( V% [; v% }+ \* d7 p# Y( K. G' F; m+ j# K0 b: e- ~
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
/ n3 i% r1 r \, F( Y8 j' d+ i; J9 g ;will break 3 times :-(/ e7 q+ h6 ^2 V- t7 S( P
4 B* _+ e: K- o% n4 S% _
-Much faster:/ e$ E5 u# |9 d+ V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* p0 }& P' b1 @4 j( I! d7 U
3 @% O. e" Z. o6 l
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. l9 K8 A/ n. r, E% K
function to do the same job:' m6 o% U5 A4 |8 w p8 p& ]0 |
3 g; Q+ u. q- S4 i! p2 }5 ?
push 00 ; OF_READ
6 s! \: _ Z5 w7 Y2 T mov eax,[00656634] ; '\\.\SICE',0
: Z% w- W( U& c& E& } push eax1 d- B8 t/ |$ {9 J+ I
call KERNEL32!_lopen
* Y+ G: c& X$ K& A3 M) A% g inc eax
/ d$ H9 z0 u/ ? jnz 00650589 ; detected
: }* f- y7 e. ?# ^$ j3 T) i push 00 ; OF_READ
! N( N2 H; g. s" A mov eax,[00656638] ; '\\.\SICE'1 Y5 s: ]$ P$ [# q* z4 x& w9 _' t
push eax
3 j/ a" {# L# Q! `8 S call KERNEL32!_lopen; ]* [( F& K. i5 [( P1 O5 X
inc eax3 C! X. L4 n$ L# \
jz 006505ae ; not detected
/ t3 @; B$ x! d5 B) Q6 J0 T2 Q: G- `0 R
# k2 z3 N, G# w; e3 O; w
__________________________________________________________________________
' ]# X$ n# Q7 ~5 N( P7 w
6 B; A% m; g7 l: {: n1 X) h4 EMethod 12! ^, C- r4 e4 U+ s- V
=========% J5 y4 C3 R: P) v: P5 @; @. U7 c3 I# {
1 L0 z% U7 d0 n }/ l PThis trick is similar to int41h/4fh Debugger installation check (code 05
( \4 z- `/ w! M4 ~" G& 06) but very limited because it's only available for Win95/98 (not NT)0 |8 u+ c6 {1 ?0 C
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! P7 n; z0 m5 `( k: p
) ~0 t' f" R3 r% g3 V" a push 0000004fh ; function 4fh
) ]% A/ R# }0 n) T/ d0 S. X push 002a002ah ; high word specifies which VxD (VWIN32)
8 o n2 W9 _* a* Z ; low word specifies which service
( t& m/ z2 t( Q7 c (VWIN32_Int41Dispatch)3 S- ^4 L) v% W7 B1 W' z6 s
call Kernel32!ORD_001 ; VxdCall$ u) p$ R: _1 o) p! \& o& U3 n
cmp ax, 0f386h ; magic number returned by system debuggers' M2 \7 ], L( f1 l$ u, ?9 u
jz SoftICE_detected
. d$ D$ R9 g! C- c+ R( [% _0 y% X+ |7 n5 |( a. O
Here again, several ways to detect it:5 t) _6 \0 A1 }3 R1 O
2 d& k7 Z5 s( u- V2 n; _, [
BPINT 41 if ax==4f9 T8 V. O* \* V" q
\# L4 l8 |& x6 W$ U+ b4 q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 s, O3 u- K f2 R, `. _: o7 H; ?9 f6 Y/ C! L8 `+ c. a5 l8 _1 E
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ O' ^" M/ f9 A6 O4 r7 b
0 ^' s* x# X4 q) E, \' x% l5 I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) ~0 g8 N+ N& t5 M( ~) m4 a
/ r* e, F0 `7 f0 {( X0 M/ X
__________________________________________________________________________
% ~3 B/ O6 M: d7 |) y5 X7 x2 h5 M% z, Q. T) r2 s& K/ G
Method 13$ C" n1 h8 ^- e0 x+ v6 m# i5 ^
=========5 g' z* y- ?0 n9 m) M6 C6 P
9 C# v2 I3 X2 | E6 k7 oNot a real method of detection, but a good way to know if SoftICE is
4 F) J5 j) K# ginstalled on a computer and to locate its installation directory.0 F" U2 l0 P' C3 k- Q
It is used by few softs which access the following registry keys (usually #2) :* R- G9 N3 o! E
% J+ ^# d5 ~( ]6 Q8 w; R3 }-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion E. \) h; O1 ^2 i( H1 q1 q
\Uninstall\SoftICE* u+ H8 ]+ e# q" _0 O. }( h( m' Y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 M/ u5 q- H7 G& @& z5 Y: o( A
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 e) J m) S$ _\App Paths\Loader32.Exe1 {: S- H6 s7 G# P6 k" y6 `+ D9 A
' i. d s2 d& s% }3 x" |7 U# ?" v7 d0 v' J* W
Note that some nasty apps could then erase all files from SoftICE directory
# U6 @: x& |2 ~$ W% j% @# s(I faced that once :-(
5 U7 ^( ]: i$ W2 L" p% q% P0 j( C9 k
Useful breakpoint to detect it:
# r& V$ k# f/ l2 s3 s! U- G- Y2 C3 e/ f3 u% |+ J( @4 q S' Q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 u0 B4 g* A! d# _! h6 J
3 m$ a5 E5 @ ]: o; P" W- `& j__________________________________________________________________________
+ @. d( N, k( Y
5 h* U- X7 T2 @/ j
6 C" e% l2 i B. k/ V$ Q" wMethod 14
# L. v5 |% `2 y=========) l; s; m7 g( ?0 V o
q9 ~% H. J+ T* I) }A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
D6 T. x+ _. @4 R! Fis to determines whether a debugger is running on your system (ring0 only).2 i8 ?2 @' d. }9 n) R
8 l: b& e+ B! w' \1 J R8 [
VMMCall Test_Debug_Installed
7 |; p) Y2 s! o" W je not_installed5 R/ k( h3 L3 K
. s2 ]" r* @/ RThis service just checks a flag.
6 E$ T8 U' h6 S, l) G</PRE></TD></TR></TBODY></TABLE> |