<TABLE width=500>4 l8 ]& P) E4 p4 b: N0 D# v8 L
<TBODY>: j" B6 u% s) H Y2 o1 R! z
<TR>) y" L8 p5 z3 @+ |6 U
<TD><PRE>Method 01
. d' u m; K6 t1 C=========
7 P: O' _5 e/ a2 B
% n# ~( k3 O; _/ B/ w8 Q% A9 cThis method of detection of SoftICE (as well as the following one) is) e0 l D$ c1 w& p$ a+ g7 m
used by the majority of packers/encryptors found on Internet.
- O% @6 ^, E2 HIt seeks the signature of BoundsChecker in SoftICE
7 K3 T [/ [" h2 C! r6 H v7 r3 j( w4 u! [
mov ebp, 04243484Bh ; 'BCHK'
2 y4 U8 v" u0 ^# {/ }& `) b9 u; s, X mov ax, 04h
, `. I& f4 |) `7 Y# I4 T! p& a1 P int 3
6 ^4 ]) Y. m" g5 L5 r cmp al,4
4 r+ P# x; a& W" s. B. K o jnz SoftICE_Detected4 u3 P1 C+ S+ \
3 _! c$ ]5 @. Y7 _$ o___________________________________________________________________________
8 s3 ?: L9 t6 w# b2 X
( m, t j, L3 b8 d' ZMethod 022 i$ v% O) u. F# s, {5 p2 A3 |7 g/ |
=========
0 U p7 x Y; e0 A$ P
$ }0 J1 D# \; L2 L) v! w% {Still a method very much used (perhaps the most frequent one). It is used; B9 a2 A& G& B' A
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* \7 C6 {1 C3 U" l; P L% ~or execute SoftICE commands... v* q1 o' a- z5 j! Q
It is also used to crash SoftICE and to force it to execute any commands/ m0 Y0 U4 s5 k
(HBOOT...) :-(( 9 \; \0 _+ @3 C: X/ A; _
# J1 B9 G n2 MHere is a quick description:
3 K$ O6 B, n" j% I6 k-AX = 0910h (Display string in SIce windows)5 h* h( b4 ^2 V/ B( g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& I0 }- \6 N( D, ]( D; H' X* w-AX = 0912h (Get breakpoint infos)
8 F' }8 \) m; N, Q-AX = 0913h (Set Sice breakpoints)4 E: y5 l9 j- ~0 X8 D7 A4 K
-AX = 0914h (Remove SIce breakoints)' L" `' U( M! X0 O
; V1 s! ?& p+ n X; L$ pEach time you'll meet this trick, you'll see:) v: u/ l J+ {9 n$ k+ L& q9 y) Z
-SI = 4647h- ?8 i( z: s+ n! w9 i
-DI = 4A4Dh
& j# d" s* m9 w# ]3 i1 {) F5 o/ DWhich are the 'magic values' used by SoftIce.# e6 \- V* a4 Z, a" h ]4 l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 A, w. p! S9 ]2 X$ c( t2 H" O4 a7 B! i
& z5 _, u; G/ }$ ]* GHere is one example from the file "Haspinst.exe" which is the dongle HASP
5 x X9 t; S: l1 [Envelope utility use to protect DOS applications:6 f# y8 t* u% a- Z0 q( e
9 _8 ]1 p& Y2 p* q. [3 u
& y/ ^; ?7 W5 p( a1 W* @4C19:0095 MOV AX,0911 ; execute command.: \; T9 [7 @9 f- Q' s' n* I
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 v( D H# B1 F4 x+ T4C19:009A MOV SI,4647 ; 1st magic value.
! `8 T0 m6 o2 i% v6 H0 s5 W/ ^4C19:009D MOV DI,4A4D ; 2nd magic value.
! j- ?. e' N# M* x7 A, t8 ?5 ]6 w7 @4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: r% q/ k/ r! z* K- H; V4 p7 c/ f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) f2 C: {( x. [. u
4C19:00A4 INC CX
$ y/ ]3 r5 H8 H$ p* ?4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* O& i8 D2 |& @7 x) `4C19:00A8 JB 0095 ; 6 different commands.
+ h- X2 J3 H) I0 w2 h3 d4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& P: d% X0 r$ @- h" `2 J4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# Q6 _/ T; Q( o: r$ z! e
7 [1 A6 ^6 d! w3 L4 Y4 D
The program will execute 6 different SIce commands located at ds:dx, which+ E5 N3 H7 ?$ z) [3 j, L7 |3 M; K' {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) R7 d" j& T7 g( q: l( I' z
6 ]6 p3 ] w, X+ K7 k* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ U) j# X: q( l' e+ s
___________________________________________________________________________
" m- ] [) q3 b5 i7 {7 U+ [
- \/ B2 d( w+ v" }1 a* @. j# O+ h
Method 03* Y- u" H6 L2 y* s1 I1 `2 c: r
=========0 O [3 t2 q2 Q( w7 H$ U1 A( m
& v) D" Q, r4 W7 MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' {( g7 e; j6 i, u4 R" }2 n# ^
(API Get entry point)
- s; C+ X) }) m' F9 l; n
) q; b$ B6 }4 D! y: Z1 q, [7 b& e7 R# v9 Q8 }
xor di,di
: B& n! t, M/ c3 D" T mov es,di
4 D" ]8 G c1 U( r9 M6 v' \ L mov ax, 1684h 4 ~, R5 G5 x7 `% h
mov bx, 0202h ; VxD ID of winice
( C; H `1 a+ s. G int 2Fh
9 L$ r9 U- _ K, U6 U, S- x mov ax, es ; ES:DI -> VxD API entry point
7 f* M8 x5 v9 J* D add ax, di
1 w4 @" x. r. ` @6 Y test ax,ax
1 S+ y! L L% ~9 T jnz SoftICE_Detected) J. m3 o! p- ?; ?6 B
# p w* g" p0 g___________________________________________________________________________
& w9 n0 P4 g4 t2 [+ }
' }5 u# x6 S- y' l8 b: O9 M- zMethod 043 \* {# n- i P4 A- f
=========
5 t c( y" v9 l4 _
- j0 O' ] N4 JMethod identical to the preceding one except that it seeks the ID of SoftICE
7 z2 @% ` w4 U4 _5 p$ L# sGFX VxD." E D$ W& c: E: R
$ u& H' A# W/ v+ |) ?- E
xor di,di8 a r4 [% R7 D2 `
mov es,di
) `$ _$ e H x3 k' l mov ax, 1684h
7 t% g7 K/ A/ Z4 r3 ] mov bx, 7a5Fh ; VxD ID of SIWVID
, g5 M! O: p4 S int 2fh
0 G$ `* a5 {) V6 L8 n% ^ mov ax, es ; ES:DI -> VxD API entry point
$ `* b! H k, _8 K add ax, di
% p, T: [8 e) Z, `. O test ax,ax
9 @2 h8 D. D/ v* G, t( W: z2 l) S7 d8 F jnz SoftICE_Detected; B t' x" S5 @- x, K2 j* X0 s3 ~1 H
' o9 Q& w% a7 J& L
__________________________________________________________________________% u' p2 l3 w2 S7 m( y8 \
+ J2 q# X& k6 ~3 {- F4 O
0 E# Z+ K0 K. V, i
Method 05. u) R1 q$ H: [) i1 |
=========( e: O# E* U8 Y8 N
# R2 K! Q4 g5 {: b! o7 G% d3 c
Method seeking the 'magic number' 0F386h returned (in ax) by all system- Z: U* A" c( |0 `* W0 c
debugger. It calls the int 41h, function 4Fh.
+ r5 Q$ Y$ g! V# U+ ^6 CThere are several alternatives.
% z+ Y# Q" L. X% E% ` m
2 h4 }: R% l+ p0 G+ X) {( Z$ pThe following one is the simplest:
M( z' \( F# G2 S' Y. g, p3 F. T8 y
mov ax,4fh
8 W# I9 M3 [: R% r" ? int 41h
5 d" A3 W0 m3 U8 ]) x& ]2 ~. Q' ^ cmp ax, 0F386
1 C0 O1 b8 I2 u } jz SoftICE_detected
. H" h! m: X4 L' k) ^; H* S% A4 E9 C
& J4 L0 R% H5 zNext method as well as the following one are 2 examples from Stone's 2 @6 S. U1 c5 q7 n, y# x
"stn-wid.zip" (www.cracking.net):
k; \+ M' `# w6 X# M9 X( _$ Q4 W
' I4 f; I( C3 i+ e2 \ mov bx, cs1 {" F( x, p! W8 c5 x
lea dx, int41handler2
H! f0 f. ~1 X xchg dx, es:[41h*4]8 v9 y6 ?+ C; c5 P
xchg bx, es:[41h*4+2]
. M, T) O3 x' Y mov ax,4fh
$ R, a g! r. |# B' Q6 M* A* ? int 41h- V# v9 x1 F8 j* t, u$ Z
xchg dx, es:[41h*4]1 j$ r v. M, E- [0 R/ H
xchg bx, es:[41h*4+2]
S4 e! m5 ], E3 H9 Y( K# }7 i' } cmp ax, 0f386h
9 i2 n' U2 G, L# N7 a( f jz SoftICE_detected
: D3 d" r+ L1 I$ D9 J) j
7 @" Y$ ^/ \; b2 e) G6 @6 F& v/ Hint41handler2 PROC* V% y! c3 I* d3 q, ^1 ^0 R z
iret
4 g# B4 f" U2 a* v4 \ b$ qint41handler2 ENDP9 ^" D& S) A | ^1 Q- O7 M& k. P" A
4 t2 R/ l& o+ u9 _! ^ c7 ~0 }( _ o. L
_________________________________________________________________________
: L2 p2 B$ m. j" A
. d6 q) t4 A# l! g5 Z# k. t) {: ~
) r, _0 F& K |( |. RMethod 06
6 |0 U" y: O2 i* l' d. v% i1 \" d=========' y, `* ]8 B* ]$ U( t h
. G9 y/ `2 S/ n8 L- S* g0 }. a# Q2 ^ v; `& G2 y0 S
2nd method similar to the preceding one but more difficult to detect:( G) h% X. U7 ]8 [2 B# G! i
1 L# n8 N8 H5 g" p
& H7 V" h% u5 M/ J8 ?+ j$ ?* {
int41handler PROC
) s8 T' l# a. ?9 Z2 N) f* O+ ] mov cl,al. ?7 e1 x3 @1 _- `6 o
iret8 J# L3 d/ ~3 j
int41handler ENDP
6 U- F A, _0 `# `7 W$ V8 O K. p7 W+ S1 `2 B
6 q K' F4 H1 e
xor ax,ax
/ D |7 m4 c' M% S: ]: u7 V8 e# [. y mov es,ax
# U$ @3 K# U/ d6 c& f* p mov bx, cs3 P7 @! H' R8 O+ T' L, u7 s2 }
lea dx, int41handler
8 T; d u, G+ M5 a& Q5 X xchg dx, es:[41h*4]
( }% U M i1 J- v" z ` xchg bx, es:[41h*4+2]
& M9 o* |2 z) }1 r; l in al, 40h- f8 u) H: l# X# x+ \
xor cx,cx
" R1 D0 q6 G- Q" j) \ int 41h
6 b2 Q1 P8 N4 V, g8 U+ L; t xchg dx, es:[41h*4]
/ f' j9 C" ]* b8 S xchg bx, es:[41h*4+2] z5 b' F0 p+ W+ a f- I+ ^; G, B0 h+ }
cmp cl,al
: d. P$ Y# I7 l" @: Z' n jnz SoftICE_detected8 @8 q# m. M: p2 Q' _ Q$ {
! @# w1 N! u6 w& t) {_________________________________________________________________________: w1 G* v0 _/ ~
: ^2 \4 Q. Y- x4 P3 `$ C6 P' u
Method 072 t7 C6 E; Z! `! O# }) x$ y7 R
=========# v/ c6 E8 |7 }5 h4 a
6 g3 r+ }$ ~- o6 pMethod of detection of the WinICE handler in the int68h (V86)3 m, V9 h. y' \8 ~3 c& J- g
; _3 ? |0 k$ o; ?, G8 ]/ v% ]4 B
mov ah,43h
0 W {0 F' Z) x4 P/ j8 c int 68h
- C1 h% b7 w# X* H: J cmp ax,0F386h
6 X/ W8 j" x- k4 z- }1 H jz SoftICE_Detected- v# Q) F d# {! H( _4 D# P
0 U+ H0 E7 p1 G% G2 L9 W
/ H* [5 }) u, s! C; q8 ]=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. T+ a4 O7 Y4 P7 t$ ?0 k
app like this:; |. r( K' a6 U- H' v
% ?7 d D2 @/ e1 | BPX exec_int if ax==68
( U, E% n# @( W (function called is located at byte ptr [ebp+1Dh] and client eip is
5 Q/ Z/ ]: S6 M located at [ebp+48h] for 32Bit apps)! [3 J# M2 L5 `" i @
__________________________________________________________________________
* ^0 [9 U R: @2 u
* \ ]& U% x, G1 j! F- b4 ]& J2 T$ x+ i6 [9 q; @, T
Method 08
; \- z% g7 c# ?( q=========
) o4 X% H z7 B6 n# z( n8 P
: |- Z( Q. y, @It is not a method of detection of SoftICE but a possibility to crash the
% }7 ^+ V* W) m, }: l+ l- Vsystem by intercepting int 01h and int 03h and redirecting them to another5 g& X4 p9 ]% a9 V- f
routine.
' e }, |. j( o2 G# ]It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( c- g: g; J6 J) |
to the new routine to execute (hangs computer...)
9 w5 S8 i' X5 _) f X2 a5 ~ u+ a8 f R0 Y2 I3 {
mov ah, 25h7 j0 C9 M! @% S& X
mov al, Int_Number (01h or 03h)
l5 r9 J" J1 B, v' l% N8 s6 f mov dx, offset New_Int_Routine7 d. \1 U' a6 {
int 21h4 M2 m; D x8 P* z- L
F( ]; C% y: N__________________________________________________________________________ @* ]- _( T# s5 m) d
( l0 e. j W( n" o4 F. r- Y
Method 093 @4 v6 q: {) |6 L
=========
8 e; L* b1 O& {9 f3 F# {
3 L0 t& P5 U9 e$ S0 T- [3 H0 p" VThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& Q( \: m4 v, c4 P
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ A6 ^' o. s( B- ?The Get_DDB service is used to determine whether or not a VxD is installed& W3 t; ]. i0 R' l5 }9 k
for the specified device and returns a Device Description Block (in ecx) for$ b3 R% r) ]+ E6 n. q8 R
that device if it is installed.9 E, ?' y- v b6 U9 e
( d# ?( J! Y0 V
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" M& f$ e7 E! r. e! V
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 K$ r+ ~1 |' I1 V6 C J
VMMCall Get_DDB
$ {/ t+ h* i- ~7 P mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
L8 o7 x6 u* k! m. }& N9 A9 M3 u* r7 v
Note as well that you can easily detect this method with SoftICE:
e" j2 I' @# _6 ~# u l+ z3 G bpx Get_DDB if ax==0202 || ax==7a5fh
. Q( B9 q1 g0 T6 T$ y9 W8 a: R7 |: C. r' c; d
__________________________________________________________________________/ E9 ]3 ^6 ]& J5 C0 T: v R
: n& ` D" r1 x! {" T* h) zMethod 10$ U$ k9 S R e5 M' ^
=========
6 Z# M- T# L X$ P1 g! {+ b9 A2 ?- D! @# ~, T: b3 C+ ?9 G
=>Disable or clear breakpoints before using this feature. DO NOT trace with
8 N, j* }+ E! t0 S! C: f SoftICE while the option is enable!!0 A }: y& j& V* b% S( W
% \1 M& B6 k3 K, k
This trick is very efficient:
/ v8 X# ?' `% `" p- Wby checking the Debug Registers, you can detect if SoftICE is loaded. H( l2 g) F1 J& B
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ w+ R* P5 d: pthere are some memory breakpoints set (dr0 to dr3) simply by reading their
6 ]2 ?1 T: B0 t" S0 P% B- dvalue (in ring0 only). Values can be manipulated and or changed as well2 s( u: C; S/ o6 ~5 C
(clearing BPMs for instance)2 u8 R9 U8 g2 z7 f( n
' L" K& I" U1 `! y. c+ ~__________________________________________________________________________* t- P/ [/ ~( w* k
% g5 f1 l5 ]# ]5 h/ s2 O# m4 WMethod 11' D( k( o0 A' o: p2 w- ?( j
=========
9 S1 `7 K# u7 Q" U& R& I3 H4 G2 }5 ?; K$ A* u) B
This method is most known as 'MeltICE' because it has been freely distributed
6 Y; z/ X9 g5 w4 H T* r1 ivia www.winfiles.com. However it was first used by NuMega people to allow6 u4 W2 l& g2 H# s9 N% b- B8 M
Symbol Loader to check if SoftICE was active or not (the code is located1 z" e. r0 x, N* u5 ? b
inside nmtrans.dll).
3 O5 {0 E( x0 U: G. z! K
6 u- `* L' I& Y9 WThe way it works is very simple:
+ j8 T3 m. {" FIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: \% P8 I2 _' p9 d0 |3 XWinNT) with the CreateFileA API.
8 V9 z6 I ?: v2 r/ d U+ Z
1 N2 S4 P+ ?- Q) U7 WHere is a sample (checking for 'SICE'):! @% f( S1 N: {7 U
, Z$ p- U% L0 |$ ?' x* @
BOOL IsSoftIce95Loaded()
3 L$ _1 l* Q0 Z. F ~3 ^{
3 u1 w" _+ J a' d- _0 ` HANDLE hFile; + n M% Z4 A$ c* Q1 I$ A( A
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 E& F; C% t" V" [* [ o6 u9 K- ` FILE_SHARE_READ | FILE_SHARE_WRITE,$ k I& }% `- q' K; Y; F
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 b( Z% t1 V: W: \ a7 d6 s
if( hFile != INVALID_HANDLE_VALUE )
# o5 m( w! F: G" G4 B {
$ ]1 b- `9 z2 D" r! ~ CloseHandle(hFile);" S7 R( C" L* R
return TRUE;
8 F8 }1 }" J& U' c! f% J }
" Y9 X9 d) Y1 ]8 g% l return FALSE;& B/ j1 Y* _" V. k
}
6 K" e u T& A3 n
! z) M+ e L2 \* K3 M5 BAlthough this trick calls the CreateFileA function, don't even expect to be
" R0 W$ F2 b% Y- u8 wable to intercept it by installing a IFS hook: it will not work, no way!, v9 O+ H, C/ x7 H
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 {3 Q1 I( `& Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, u1 K9 P; Y1 ], t# a+ ~' Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc/ H, m; H# ?( G( c- T2 R( z* p
field.! M% n/ w5 i4 L- x% v
In fact, its purpose is not to load/unload VxDs but only to send a / ~! a8 v B: z& p5 p. S
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ z4 W; u& W! s4 N9 ^& o/ k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try+ e1 y1 T; W w% D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).) A0 J& ^% N5 G
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 v* D* f* M2 x4 w) l6 Z
its handle to be opened and then, will be detected.
) b) m" m% j4 @8 r+ M7 ]5 U% vYou can check that simply by hooking Winice.exe control proc entry point- `6 W9 Z, z4 ^6 `1 |, E
while running MeltICE." a, X1 T5 _1 b/ L' O: R8 G4 x5 K+ o$ A$ O
2 F2 }0 p: W: h7 H
?: |. c* N9 E# o( N+ ~+ O @
00401067: push 00402025 ; \\.\SICE6 c* O% y/ E! m: v0 N
0040106C: call CreateFileA
% B$ y1 j! J: a' ?' `9 n6 } 00401071: cmp eax,-001$ G$ ^( I# j- H' Y, F( b. F7 E
00401074: je 004010910 ]1 }# T' i3 ]1 z: V% c
- k9 j# M! j4 h( I. a& k# `' S! m4 g1 }5 o O& ?
There could be hundreds of BPX you could use to detect this trick.
. _8 O# j7 K4 Q# q+ z4 e, K-The most classical one is:6 Y5 H4 M4 ]6 u: X# [, t* C3 _
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||1 W0 p, _: W( x8 H, p
*(esp->4+4)=='NTIC'( i `8 V7 `+ C4 s: L$ I
0 X Q1 A' B/ w+ E, d-The most exotic ones (could be very slooooow :-() g* t6 k( @& O6 b
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 f( B, |9 h, g; Y3 C
;will break 3 times :-(, {7 C, _9 Y' E
/ Z" M1 _/ g$ }7 z2 R" n6 l-or (a bit) faster:
3 m# B+ r% m) n& ~ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 c6 \# Y. W8 X; X$ }' R7 b3 J" t- U! T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 y2 U# q! v) T9 k; S& b
;will break 3 times :-(
# h( A+ ~0 \; q6 ?8 p4 _/ `; J" j
[' l& X; Z2 B3 c-Much faster:
% f* u' E% P5 ]7 S. ]3 @ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
q/ J8 K# t x8 w2 ]& a
1 k& O# ]6 A. p9 V, \1 lNote also that some programs (like AZPR3.00) use de old 16-bit _lopen& z1 F* r) Z9 K; K3 `; N
function to do the same job:$ i4 T1 F0 Z1 c$ X( w# V- F
. ]* v {, G0 z ^% E) y push 00 ; OF_READ
2 U1 }& `( b, j4 z mov eax,[00656634] ; '\\.\SICE',0
3 v' V4 |8 q( U& ?1 ]1 W3 c2 w, B9 E push eax
5 Q" f4 N0 t+ ?' _" o. T0 w" o S call KERNEL32!_lopen& K4 n* H6 F+ }/ a m& ]1 K |
inc eax
* q1 x0 Z, S$ W jnz 00650589 ; detected
' r1 u! D1 t* q3 T& c6 z, Q push 00 ; OF_READ/ c6 u0 h0 o+ Q" T- y5 v
mov eax,[00656638] ; '\\.\SICE'
8 P, W# o, N# ^9 \/ \ push eax
8 ?9 [; y. y1 b. ]0 z call KERNEL32!_lopen! N6 u9 ]3 {8 D" y8 e: q3 j; `
inc eax; d& L6 O3 @7 J- `
jz 006505ae ; not detected
0 a) P: q' i1 r1 e) o+ @. Z4 r0 k; f0 |4 I* q3 I9 B; I* \" k& p0 Z7 F
% O5 e9 y# w) z/ {
__________________________________________________________________________
8 g6 I# m0 Q6 I% l, A
) t/ c9 U$ _; o* V6 r5 TMethod 12! K) Z( T+ {& v: k" j5 m# W
=========
8 t: z9 A, K3 G
2 p1 Y* K7 w+ M: R7 p+ ]This trick is similar to int41h/4fh Debugger installation check (code 05
: \( H' Y/ X8 E6 W$ O+ {& c4 \& 06) but very limited because it's only available for Win95/98 (not NT). S. I* T! S- M6 a1 A1 y
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% F' b$ X2 E6 q8 l1 ?1 F2 u1 J1 w3 x4 G3 x
push 0000004fh ; function 4fh* |) ^ l+ b9 w: v2 x t" l8 Q
push 002a002ah ; high word specifies which VxD (VWIN32)
0 o9 R) Q, u' e2 I8 ~, \ ; low word specifies which service
. [) u, h9 L' d (VWIN32_Int41Dispatch)( k9 {; l! B, U& Y' J
call Kernel32!ORD_001 ; VxdCall* U" k4 H+ F. g/ n9 U8 D, T
cmp ax, 0f386h ; magic number returned by system debuggers
3 b, [. W0 z: U- g( _ jz SoftICE_detected C/ g: B( @$ R+ D4 J6 z4 T
, X/ y" ~1 W) kHere again, several ways to detect it:
) F; g) f3 i' n8 i) c/ b6 s+ a& a. m2 s6 x
BPINT 41 if ax==4f! f8 O+ M" N' O- q+ g
3 B+ @( V% {! {, D* I BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 g9 z+ ~0 l! a; V8 r- y4 y3 _0 J9 e6 V4 J% K. ^' I5 j
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; A8 @/ ~7 w/ a3 j. Y: r: n4 c
& J0 T5 B; ^- z3 h! C7 R
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ [, x5 m* s' Q) z; b, |7 v ~: b: w2 l& U2 G
__________________________________________________________________________ j$ s+ K5 a7 L
3 ?6 d" d; ^) R' V2 g" G- q8 g
Method 13
5 p. b" \4 m+ }' [ I( Q5 F% t=========
5 @$ U. A R+ c% h3 y" g3 e" X# B+ ?
Not a real method of detection, but a good way to know if SoftICE is6 p- F- P; w& S
installed on a computer and to locate its installation directory.
5 P( E( G2 v, [- Q' G8 O9 [3 e6 l' q: k+ yIt is used by few softs which access the following registry keys (usually #2) :
: _7 U: j0 v# B0 ]
0 p4 T6 m6 k7 d& E' T' f-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% s7 l: Y- S1 U$ ]! f- Y\Uninstall\SoftICE
* b @- W& P+ P: h-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 r7 _3 v, u M2 D/ ~# A; |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" I J$ A5 Y- D6 J1 Z( A\App Paths\Loader32.Exe/ z6 v, l" n9 E3 J$ }+ ?
) F5 p* f( N- l
: n0 R ]) d: y5 W6 u; Q5 k
Note that some nasty apps could then erase all files from SoftICE directory0 P' {! h0 p! l+ L# R a4 H5 J0 k
(I faced that once :-(
+ e2 k* \2 `( {- q; @0 u' c% N3 a( d2 d f
Useful breakpoint to detect it:
/ u# ^6 F6 v$ i) e, l8 `' Y. c% v/ C- v) I) v9 }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( e' L3 ?8 s: Y% s. X, W8 H
; O& V5 q3 R: s7 W; f__________________________________________________________________________
( `4 W5 K5 g9 R0 G8 E4 H9 y5 W0 ]
) X$ l/ X9 Z+ e; X3 H
4 d, Q0 p: P: O1 r& rMethod 14 8 m9 s E2 \1 C0 R
=========" M6 n# V( A! _# r8 S: u
; J3 B) }3 N1 q- ~A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 r" x. p2 g# |/ Q' F8 m8 e/ k+ n. O
is to determines whether a debugger is running on your system (ring0 only).* I3 C( B. L- L5 ]$ K
1 F) d6 [8 } [8 p6 } VMMCall Test_Debug_Installed
& E- D. c" D+ E0 f je not_installed4 X. _5 G s% y
# y/ w7 E4 {5 N! u, j* h y zThis service just checks a flag. o9 i" u' I2 m* y, G, k2 |+ K
</PRE></TD></TR></TBODY></TABLE> |