<TABLE width=500>* d# ^. |3 o+ Y/ X/ O3 D1 N
<TBODY>) W1 I: p( C8 o( z+ ?. B0 ]
<TR>
1 B8 \9 C* {1 x( I<TD><PRE>Method 01 / ~ n: u6 o3 q
=========
; [& B# N, Z# j/ S8 p# h4 Y* N' X; R; B- K. k( G
This method of detection of SoftICE (as well as the following one) is- m2 h# X! }8 L, r2 [) P G# Z
used by the majority of packers/encryptors found on Internet.
" E' j+ d7 V. DIt seeks the signature of BoundsChecker in SoftICE
9 H3 ?( S3 Z) r& b; i6 e
6 c4 V# y; P" K mov ebp, 04243484Bh ; 'BCHK'9 R. [0 E6 k: a) }
mov ax, 04h' P8 V( t0 j8 z; Q
int 3
$ z7 E, F; E" S" R. N* i: `3 ^% \2 B9 H# j cmp al,40 _, k3 S1 x/ n7 A3 B; ?
jnz SoftICE_Detected$ o/ s, c9 c1 g1 H" b7 t, }; w% v
; I2 }4 H0 o) Y. M- o. H
___________________________________________________________________________
( U: _5 @8 y5 R9 [& K! W3 e5 y# f1 Y- O. N# L: x
Method 02. d: T3 x- i5 w( I5 C( A. Z3 c7 N
=========
; s7 ^# ?. _3 p5 C- y, |: x. w) F% n. F9 a2 R c2 G
Still a method very much used (perhaps the most frequent one). It is used
( V+ T2 d. _: o5 \* Sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
I- Q7 N5 c* z5 t- Zor execute SoftICE commands...
" V8 A) S0 _* r( y! _* sIt is also used to crash SoftICE and to force it to execute any commands
$ ^9 N0 ?# L _: x4 r(HBOOT...) :-(( 0 E/ J9 v7 j4 h# z! P3 G
. u5 e+ D+ h: HHere is a quick description:
! a7 b1 t6 Q8 ^- Z9 N {-AX = 0910h (Display string in SIce windows)" C' L% k3 i5 v9 [4 T0 O( h" R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ n4 o# t: `1 `5 l-AX = 0912h (Get breakpoint infos)9 h/ b, q: m+ h6 w9 c' i
-AX = 0913h (Set Sice breakpoints)
$ D/ q9 Z6 k- y! `/ c( R-AX = 0914h (Remove SIce breakoints)
0 E5 R8 J/ ~+ i$ @8 C$ W, G/ J" W3 |# C6 W
Each time you'll meet this trick, you'll see:2 {/ _; e5 |8 C( b
-SI = 4647h9 H4 {' t6 _" [5 A% K
-DI = 4A4Dh
" C/ x d0 k! \& P' q. XWhich are the 'magic values' used by SoftIce.0 i# V0 f* D" @; y& i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, O5 ^0 C' {( \% w. e6 G9 h4 w: r, p) G; i0 n5 e/ R1 [6 ^* g
Here is one example from the file "Haspinst.exe" which is the dongle HASP
, Y8 a% J- n6 J: ?Envelope utility use to protect DOS applications:$ j/ h( k& n8 f
' y) o! G( m3 g2 h* G
: W3 @ E; r p6 F% ?; K0 a7 F
4C19:0095 MOV AX,0911 ; execute command.) X3 |2 n) n6 q% @( B) n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 Z5 O! d* w" B
4C19:009A MOV SI,4647 ; 1st magic value.2 y% M- Q/ X$ B: `. |, U& P
4C19:009D MOV DI,4A4D ; 2nd magic value.( ?3 K0 S& t, n* f
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 c: B# |* c+ t+ l% k$ T' R- w
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 Z8 U9 b# o! B/ C ]
4C19:00A4 INC CX
2 M$ F1 ], U/ U1 C5 ^4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: b5 V5 r2 T% O4 b6 f3 i/ b1 F4C19:00A8 JB 0095 ; 6 different commands.
) o" d, F' k& ?2 ]8 G4 R; r( {4C19:00AA JMP 0002 ; Bad_Guy jmp back.: p- P5 w! ~& N/ w+ T+ `
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)2 X: ?$ x, e& F
; Z. @6 H) g2 G! u1 UThe program will execute 6 different SIce commands located at ds:dx, which
$ c T h [* g) gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 p: ], ] D5 ?: r; W; d
1 V! k+ R( f7 s6 o' e) p4 v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! g L, E; h7 ^
___________________________________________________________________________
" V5 D! i' ]6 \' F, z0 W0 c/ f4 O; ^5 ]1 O
5 [2 N ^5 C3 y! MMethod 03& ?2 \. t+ T% h% X. ^, J. S) d! T5 P
=========& y* p; o, M' w5 J; _
4 W, R' P+ A$ |8 [6 A) gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 ]$ ^' x4 m1 |+ ]+ V! |
(API Get entry point)
+ z Z: S% R. R+ v$ |! Y/ }; F $ f. \& o6 R0 P ~9 y: @
- @' M. {% v% z, F+ [
xor di,di
) ?: Z$ L# |; U mov es,di( D+ |. B: D# T0 X* a
mov ax, 1684h
h3 O( k- P' j( A9 s( M& q8 y* Z* N, n mov bx, 0202h ; VxD ID of winice
* _. H) E# h9 m/ z# Y8 D int 2Fh
/ d" p; y# ~3 R mov ax, es ; ES:DI -> VxD API entry point! i1 [ n, g2 z S! m
add ax, di
! O# @5 \" N) u test ax,ax, ] Q0 p; Y# i5 z1 e% b! M [
jnz SoftICE_Detected3 I. o9 l, Q! P! L# F. I3 a4 L8 {6 ^+ q
" c( u$ d5 t! W/ D; i+ H( o# m
___________________________________________________________________________
7 }) Y7 e+ I4 i% _8 _
Y6 U5 `! I0 x k, xMethod 04# a3 M; ^9 u: s
=========
/ h/ a+ [7 p* J+ K6 `" w9 o3 I j
Method identical to the preceding one except that it seeks the ID of SoftICE" a0 g5 T2 t) A) M- m! B* p
GFX VxD. q6 M4 z, N1 _( s/ ?
8 a' y: U( C, R' _
xor di,di- e6 ^$ l, G& J+ K/ ^2 r% g
mov es,di
1 t4 [8 |4 p4 y& O( k; l( V mov ax, 1684h 3 c4 k5 n- n! [$ D% H o
mov bx, 7a5Fh ; VxD ID of SIWVID; n+ r" A9 W8 j) V+ z; ^2 o
int 2fh
) l" V* O) v0 ?, l& _7 y mov ax, es ; ES:DI -> VxD API entry point
" t( u: B1 g' o# _" K add ax, di
2 Q0 z# s2 l; T test ax,ax) F- T$ g+ W+ w, h
jnz SoftICE_Detected- b! ]) q) M- H7 g9 A) v" I* j
" ^: t4 E( K! V, X__________________________________________________________________________
( m6 K0 j# N9 M9 |/ q& V/ Y* _
: Y2 [3 P$ R, L, \) h2 a/ D# e7 ]3 O) R6 e1 A! v
Method 056 ?7 V3 g" I! q: Q) m) x
=========% A% s' @( n9 `3 }- `
1 [$ i3 f3 p: g7 G* ^- N, bMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# [( }5 d2 d* K) l2 M4 Edebugger. It calls the int 41h, function 4Fh.: ] |6 c. D V3 A- ?2 h
There are several alternatives.
* m1 c4 [% C! q8 B8 d2 P) i
# ]/ \! E) ~* Y4 BThe following one is the simplest:- T1 B2 Z4 L4 b/ p, K
* C+ c/ V5 @# `& [! T( n; [ mov ax,4fh
0 o5 x. H& R# v" v, n int 41h) k1 } ~9 U K& i" k0 i' Q0 B& M
cmp ax, 0F386' u) E( Z6 a- Z8 Q1 L
jz SoftICE_detected
# R0 T& U; O P% F
) _9 ?7 s" _) T3 h! {( C+ @! |' A
4 I" a2 j" K3 T3 Z+ XNext method as well as the following one are 2 examples from Stone's $ P5 z0 a4 f2 P) G
"stn-wid.zip" (www.cracking.net):
0 [' L9 E; ~3 n N8 `1 x
+ z- L; j* h; }5 J mov bx, cs# Y1 W/ _. ~* ^( I, t/ i
lea dx, int41handler22 { R' i1 z% V+ F. _/ O
xchg dx, es:[41h*4]9 P+ }( W1 U3 z0 z2 n) o& o4 R
xchg bx, es:[41h*4+2]1 H F+ t* k4 [0 ?8 P
mov ax,4fh
! l4 W- g6 K+ e& K3 b% L* z int 41h( B P- R+ Q3 ]0 F& p+ p+ b$ s
xchg dx, es:[41h*4]8 g5 m& `" s* Y+ _
xchg bx, es:[41h*4+2]
5 e- c! L) R0 k& h# u) q cmp ax, 0f386h
5 X# \, }, g/ l jz SoftICE_detected
# ]: d- c4 |& ]7 W- g0 J2 z3 w" D0 }9 o! e( U: P/ k
int41handler2 PROC
$ j2 O: s( q4 H/ z9 {7 x6 L: A iret# k+ H. u* d( a6 s, N# M8 E
int41handler2 ENDP. z7 x1 s: _& e" Q( ^6 j" D+ p# Z
2 J1 `4 y5 a2 ~& N( E$ @% j/ p
+ t7 p: F3 {2 l+ A2 z% E" |_________________________________________________________________________( J5 I# W+ ~5 V/ T9 k& L7 I
% `/ C3 n3 j' T, ^: ^, d$ [
7 w( \2 |, H9 P' K: K1 p2 P8 ?" x
Method 06
7 E, A. D( g: h* A7 y5 |=========
) t8 A: ?/ E. F# W$ N; h& Y x& o" H; M; b8 ^+ [2 S
; @) L7 _% c& P* ]7 n$ y
2nd method similar to the preceding one but more difficult to detect:
. B8 h) t0 \- n, J1 c, o: J" o! M% @8 B% b9 M" \& m
; P6 ~ h; e8 ]5 M1 _1 L) |. \int41handler PROC1 Y4 P( O `7 C) `
mov cl,al% V6 p, _$ H! a( r. R) f6 T
iret
2 G$ v4 m; b- W% S9 A+ } W% Lint41handler ENDP' ?7 ]2 Q q' h+ J+ T
( H0 _* B4 Z g) V6 ]" L0 P: Y4 h5 }+ T, {) q% A7 g4 S: Q
xor ax,ax
# D# h2 _% ]" U! V8 R( } mov es,ax; m: {1 e) R* U Z b
mov bx, cs
5 U' U( X: w7 j- h3 t: c lea dx, int41handler" M& f% ~8 a* x1 X# T
xchg dx, es:[41h*4]
' I. G, w: r- z; x/ R xchg bx, es:[41h*4+2]: [2 O2 }( B" d* s- \( Y- J
in al, 40h
+ |$ E% A6 P4 e' W, |- t& G% C xor cx,cx+ W* ^! n: k& y% F9 D. h
int 41h; O$ P3 \& s# `2 C! q
xchg dx, es:[41h*4]
1 y! F& ?* Z, d d2 E: a xchg bx, es:[41h*4+2]
W4 M$ O! r' K/ ]1 \# y cmp cl,al
' C% D: Z8 v: T jnz SoftICE_detected
8 ^& L+ o- G& }2 B% S% N' o. ]4 O
. Z! b$ Z. \0 Y. V1 P_________________________________________________________________________
5 p8 ~, l# ^* \" s
) C' P0 t/ k; @6 s" {/ l, w+ pMethod 07- p e' Y' j9 v" ^9 }
=========
/ e5 g1 x5 u0 L$ w
6 j8 Y* s; ^% A7 C0 eMethod of detection of the WinICE handler in the int68h (V86) ^* x: s0 M* b9 t8 p$ ]( K
. @* {4 ^" ~" y" {. q mov ah,43h. |& X2 Z+ M9 b2 _. q& y
int 68h$ u9 y: `* H, v5 z5 q+ }9 C6 e" Z0 N
cmp ax,0F386h8 i6 q8 W4 z2 p# a1 K5 F3 R
jz SoftICE_Detected& U: e9 m V" W' V; I' p& O
, d6 ^3 H/ U: a% U
0 C0 {' Z: a* N6 G& J& I=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 `$ Z3 B% J- r: O app like this:1 K1 Q) ^1 W- f5 ^, l
- g5 _: `5 b1 [- L! W* r BPX exec_int if ax==68
5 l: }. r J! A6 ? (function called is located at byte ptr [ebp+1Dh] and client eip is
9 x) z6 C- c( K6 P located at [ebp+48h] for 32Bit apps)
: W" s7 ~4 ` w" Q4 K0 ?* F: M5 v__________________________________________________________________________ j( @" p5 _* m' p/ u- H
" d0 ^- C* U6 R! l7 m4 \! C' r
Method 08, K. c& W' |. w/ P
=========
! `6 q. A+ {1 A& ?9 O$ T0 u0 n- H0 A8 {
It is not a method of detection of SoftICE but a possibility to crash the
7 j% L& M5 f$ i j! O& g# Xsystem by intercepting int 01h and int 03h and redirecting them to another. V% A$ k; x4 D: ~* x/ f
routine.
! v2 Y/ F( e9 b9 `" x- |2 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 C4 i; h% L8 K$ t; C: m
to the new routine to execute (hangs computer...)
0 i8 Y; d1 ?0 a) M( z n$ Q: H& p
mov ah, 25h
# t8 \6 D: ~* o# J. { mov al, Int_Number (01h or 03h)" r/ e# S, s! I* @+ a: T4 e
mov dx, offset New_Int_Routine
! [+ b4 X- y* e4 M( c* e int 21h
2 R* k( x0 ~. y( Y+ M% S$ V8 m( E9 a6 k) L, N5 ^, c
__________________________________________________________________________& f3 y5 Y4 {$ s3 F: S
* X# Q8 r% b6 W1 I# _$ }Method 09/ z3 k* Q& `5 l$ C, R4 L7 v
=========
, C1 m1 g8 q# j* b' ^; ~, @
3 |& P3 j7 n, V+ @4 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
~, }/ u- C, ^performed in ring0 (VxD or a ring3 app using the VxdCall).
2 { d6 ~9 V, Z3 M% [, jThe Get_DDB service is used to determine whether or not a VxD is installed/ ~& v/ d8 I) ?5 A3 y
for the specified device and returns a Device Description Block (in ecx) for
% `# F" p# Z8 d1 x1 Xthat device if it is installed.
( u/ F+ g) r. \6 s
; @% d7 F& l/ a/ s mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 S8 p. D( t0 ^0 Z8 l4 b mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-), D0 |3 m) G7 h" n3 P4 h/ _% t8 c, r
VMMCall Get_DDB
8 b/ U* G, H7 N0 R3 k$ k mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; N, V* x+ Z3 I/ u
& j. @; x3 Q% BNote as well that you can easily detect this method with SoftICE:! e) x( g6 y. Q1 L0 Q
bpx Get_DDB if ax==0202 || ax==7a5fh2 Y& s$ o# B& D
6 J2 g' Y3 U/ e. X Y
__________________________________________________________________________
+ ?& ]# Z1 K- n. b& I1 r3 F9 U, m" c4 k
Method 10% L$ @" l, L$ E5 t" p3 y
=========) G, l" `7 `) K# k$ q( Y5 R
, T& v7 |7 S& V. M7 A=>Disable or clear breakpoints before using this feature. DO NOT trace with7 R7 |) `4 T b, [/ T: u- w( j
SoftICE while the option is enable!!
: F& ]* I* w( d; y/ u* ?! r0 | f$ ]
This trick is very efficient:
- }0 `1 l$ U( n0 wby checking the Debug Registers, you can detect if SoftICE is loaded
8 r. |+ S' x r, O; q7 O(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* h& w/ b1 P6 O5 f% w
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 l0 O6 I9 D$ [: L& v! S% N
value (in ring0 only). Values can be manipulated and or changed as well
. {( W# V4 }# l2 V7 |(clearing BPMs for instance)
( z( m0 a% J+ a4 g
) C# @8 A, }1 s; K7 t__________________________________________________________________________
2 i2 y+ s# L. A ^" h
6 y' F' k* \4 V0 ZMethod 114 U, A0 R& f5 ?' g) Y5 [& o
=========6 e$ o) y8 c# S* @* ^$ x
% c8 X3 G! q m4 hThis method is most known as 'MeltICE' because it has been freely distributed+ v, M: ?' h1 ?9 \( d; v; D- t$ ?! L
via www.winfiles.com. However it was first used by NuMega people to allow
. X, b r, }8 h+ _, D f% G9 S7 dSymbol Loader to check if SoftICE was active or not (the code is located- }) Q) P, D4 R3 _
inside nmtrans.dll).
" f) H. F- x, o3 y
+ }+ O! q! P5 E$ ~2 fThe way it works is very simple:
$ L: Q! X9 ?& j3 Q$ z. @6 mIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" i- n: o4 W0 J& m! o& P0 i
WinNT) with the CreateFileA API.1 _8 T2 }; J3 k7 H" a1 X& {
. ]; ?6 H7 v0 \$ \4 b ZHere is a sample (checking for 'SICE'):
4 [+ F1 b6 c9 b' @1 F/ j) {3 D
, _( U% n+ t- A. u/ c' Z; uBOOL IsSoftIce95Loaded()
- U. S% d2 Q8 P+ j8 }% r* m0 ^{
[- B$ O, g+ t5 H# I1 u HANDLE hFile;
. N7 x) ~- T) x' c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 T7 {1 {! ]( p; @/ W$ z# h8 p FILE_SHARE_READ | FILE_SHARE_WRITE,6 p0 b' X* e( F4 ?1 o! c4 ?) d( c
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) A6 n; y* G! ?" t if( hFile != INVALID_HANDLE_VALUE )1 N0 u/ M: W0 q: C( t. _
{$ W4 z, Q! M, r8 ~
CloseHandle(hFile);" r B/ B9 S" n; v: M4 t
return TRUE;4 h7 l& a$ f" X
}
# x( b a; n- u5 q6 n return FALSE;/ n- A: I* b' E# ]9 g& z
}7 D0 R+ v& N: U- u; K
' p5 k7 F3 n7 D$ @/ Y0 AAlthough this trick calls the CreateFileA function, don't even expect to be
$ } U" Q0 F1 K- @able to intercept it by installing a IFS hook: it will not work, no way!
" U3 N5 S6 W1 s, p" S8 rIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" u5 `8 J2 ]( d7 eservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" ]7 B! X# s/ J- ^9 P! o7 I7 Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 [# e7 P: r; [0 e& o/ q1 n0 Q8 @- w" n
field., U! T, B o. Q! U& ~5 l7 `
In fact, its purpose is not to load/unload VxDs but only to send a
/ A* T% I: `* NW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- ]+ f' V7 X# R) H1 C* i2 {! L
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% q& v* \; X. F: y) s
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ S0 c8 L- b6 M A# {/ ^2 D1 G7 CIf the VxD is loaded, it will always clear eax and the Carry flag to allow% o5 q# W; R1 t+ q" y, `, a6 `0 X
its handle to be opened and then, will be detected. M1 q( b: K, p3 o
You can check that simply by hooking Winice.exe control proc entry point7 m' V. b+ `' K1 o" n# w
while running MeltICE., r% Y; j1 Z- R& L I g
: `/ @* x- O; Q% X( C) H: C8 X. S8 X) M2 U7 B% W
00401067: push 00402025 ; \\.\SICE9 K$ A; A' w7 w2 [- K* M) ^! W
0040106C: call CreateFileA
8 ] y7 e" R: W# z 00401071: cmp eax,-001
. a/ H4 o! ~- h, i2 y; H 00401074: je 00401091
P, r2 V% k$ W: g H; g9 x0 O* J
3 I' K+ s3 B: f, G& S7 R' V9 @8 ~6 u7 j: d2 }: r; {
There could be hundreds of BPX you could use to detect this trick.; g- \4 C6 W6 g. d! i3 b
-The most classical one is:
& B, |. U) `* z9 ?8 S/ i& @ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# D ^3 i( |; s0 g% q; F *(esp->4+4)=='NTIC'( B# ^3 Z, x! m: s
/ g" K# R5 j) V/ u-The most exotic ones (could be very slooooow :-(; z$ O9 s: d; s- U- N
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 G* G7 e( a ] K. [
;will break 3 times :-(
( K0 m' Y! q8 X" e+ S" Q: h9 S1 k. s4 {+ T0 a
-or (a bit) faster: 7 b) a6 ~& e2 Y# G$ g9 h1 f* l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
Q9 N! G$ V# l! P/ s
: T( _: |7 |2 w. H+ Q' _( s5 W6 K BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 H: R6 c& N4 W
;will break 3 times :-(; Z# N; U! S. D) i% X
- W& a5 H1 }( x9 H+ [-Much faster:
3 L% E2 [6 P) Z4 ] BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 r8 }, f ]. v Y8 C! n, @) K% a
: I2 J l, c3 |; H; A; G1 }& FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
" E8 P/ S0 D5 G5 ofunction to do the same job: I' |" A a5 ~. r4 u, d
" [ m( A+ [& E/ b7 Y" _; b
push 00 ; OF_READ0 S+ G" N& {! {! p5 p) C" G1 v3 P
mov eax,[00656634] ; '\\.\SICE',0
! Z' y$ D: D- q0 I push eax
& P! M3 M0 u% N& u- w' I, I call KERNEL32!_lopen
! [; O4 [5 f$ N. \ inc eax* ~5 m( `3 w; g6 q) t& C1 h
jnz 00650589 ; detected! Q3 J) L U+ d: _( ^, ]; X. j
push 00 ; OF_READ$ L6 ^" y0 k" d& ~
mov eax,[00656638] ; '\\.\SICE'
" H+ q. U' p9 b9 K* J$ V! _ push eax. q$ H& V3 k5 `
call KERNEL32!_lopen
9 y8 S. f& c# x; g! a3 s/ t) H inc eax
5 x3 Z; A7 X+ p! E: c; o jz 006505ae ; not detected
1 a6 s( Q/ r8 f' v5 A0 a' ` ?3 K- D- }- R! N9 o9 j ^+ f) J
" P* k9 b( I- R# }
__________________________________________________________________________( x6 c; y, w. E5 ]
2 |. S9 b. Q( f4 r0 e( R6 A3 ]3 hMethod 12
3 C, b& n7 |. C! u# t; g, K b+ @! n=========
, p; W, m! G' M% h3 h2 S$ [) r$ z+ R$ d" Y9 w$ r
This trick is similar to int41h/4fh Debugger installation check (code 05* o" a1 |$ j, | ~1 g% _
& 06) but very limited because it's only available for Win95/98 (not NT)
M( t" H; I# B; g! Uas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' G: H2 n3 i$ b, [7 Q4 i# s- L; ^9 }& N
push 0000004fh ; function 4fh3 [6 }* T; ^! Z
push 002a002ah ; high word specifies which VxD (VWIN32)$ u' O+ [8 a; F9 k- M' l+ b
; low word specifies which service
: j3 L2 ?0 W# i/ ? |9 f* Z: r (VWIN32_Int41Dispatch)
+ O" W1 t- ?5 d1 u- U; M call Kernel32!ORD_001 ; VxdCall9 L( g# o4 F6 C% ?4 u) |) h
cmp ax, 0f386h ; magic number returned by system debuggers$ |9 m$ Z; K, L* @
jz SoftICE_detected
- {5 w; i* C3 z7 L, C1 e# x* j7 v9 B, b
Here again, several ways to detect it: j6 |! F5 I/ C* U, n5 w5 E( a
) D6 v0 Y! j' ?* ^6 g, c6 G3 _ BPINT 41 if ax==4f2 r: y( I$ d m% C& m5 o9 a2 ]
/ c9 W( u) L% Q1 L/ I0 F8 X" b
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
% Q8 N2 I- V9 B
/ E* U% F# _& V8 S- e# h9 J6 e+ x BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 y4 u _3 s9 G
; W" }. v/ x8 K4 O0 s- i. a BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' G% N5 ?' F! @5 W+ f, o/ z& c6 V5 n" Z4 [8 v0 P' k& F d {- b
__________________________________________________________________________
( G B! B. k! y7 R: [3 q
6 S+ e' n( G1 Y$ z2 F1 H5 \2 AMethod 13
2 Y8 m- Z; u+ s) \) u" u+ L/ ^=========
+ ?$ q# y! O1 x
1 G$ {' u( ]; a: C, HNot a real method of detection, but a good way to know if SoftICE is# t, u) ]2 M+ m# g" e2 a b J
installed on a computer and to locate its installation directory." q! g5 r* H7 |3 o4 P E6 R% T7 v
It is used by few softs which access the following registry keys (usually #2) :0 D, a2 S2 a! g, ?
( k/ @! t6 Z* W6 r7 G+ r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; S- J# N+ Q0 ~3 S
\Uninstall\SoftICE1 \/ T2 z. e" K; g$ L
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* z8 n9 B! b' p6 e
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 x# @) S e. k2 u& i\App Paths\Loader32.Exe
9 f" l1 X" c9 P( P2 u6 Y
5 Y4 J5 p' h7 a8 _1 K5 }6 Z: O& \. r- m- ^& |( Y( y8 X8 M% Y# L5 v- ]" Y
Note that some nasty apps could then erase all files from SoftICE directory' c) ]5 x; O% l1 k' q
(I faced that once :-(
" M, Q8 f7 c$ B9 |$ h- u7 a) f
# T6 _! u5 U" n. P" S) KUseful breakpoint to detect it:
& j! I+ M4 X6 d7 u' h
$ c" y& W# p9 ~- K6 c BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' _, m9 x% `9 _! [' G7 U( V! q
7 i8 K- i; T5 D" i, E. S: ?. l
__________________________________________________________________________
" F: B# e: c* d: }) y
5 t1 ~& u5 {, B# H& u1 x
6 z Z) V; D7 {1 d3 s4 w/ fMethod 14
4 h5 |$ v( v6 @/ K+ H) z, t) v& ~. o=========+ `+ ?* w, `/ L8 n& O; u, d) n+ R
5 R$ t6 F3 J0 n( Q+ q4 qA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 f7 N& q/ A' v( i4 z9 E; qis to determines whether a debugger is running on your system (ring0 only).9 j u! w3 _& y4 x' v
, N0 } C. H( J' j E* J
VMMCall Test_Debug_Installed4 r% b- y. o9 c# K! q& [
je not_installed" ` _# R& C7 v* @ r. k
9 o" [4 @) s3 W& @This service just checks a flag.2 h0 p- ~. m0 L& Y$ H) @! w
</PRE></TD></TR></TBODY></TABLE> |