<TABLE width=500>. X* Q5 l. e1 w0 a, l6 ^+ y& L$ {
<TBODY>. ^( d9 i' q0 x: x n
<TR>
- {" f5 k4 C9 [0 }<TD><PRE>Method 01 : f; F. T& y+ m; z9 |
=========$ G1 U3 b6 E+ J j6 A
" S* g4 w# Z6 f% o; s
This method of detection of SoftICE (as well as the following one) is9 z* s" [: Y) L6 I
used by the majority of packers/encryptors found on Internet.. b& q @, e. Z5 S
It seeks the signature of BoundsChecker in SoftICE
% L+ k: _+ \/ W$ B
$ X! g: [" ^! X' e- K0 i3 w mov ebp, 04243484Bh ; 'BCHK'& M% O5 N( `' h; M8 i( x
mov ax, 04h
& y$ W( s' W3 p" v- r) } int 3
: q# t! @2 @# k; C cmp al,4
( y% D3 n! \4 |6 m6 v/ v: e3 V4 f$ z jnz SoftICE_Detected
4 N( l7 ?2 d" \8 R, V7 Q3 T8 Q. W0 O
___________________________________________________________________________% g. \( l& w9 r% B" I
* C0 D+ Q" @8 {0 L) u* S
Method 02
" L4 T8 e& x; E7 j, e: E=========
$ r1 G; g4 V( B- K( i$ z
. a9 m) p% k. e) wStill a method very much used (perhaps the most frequent one). It is used' B' k8 U( F1 v7 z5 ~
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. G6 f7 k* Y2 |% mor execute SoftICE commands...4 ?5 L, J8 t* W" a- w# V4 X2 ]
It is also used to crash SoftICE and to force it to execute any commands
" q$ r$ N* a" _, ](HBOOT...) :-((
6 P4 u' q, g% p: V7 W5 X, f- f, d* B+ k
Here is a quick description:' e9 y8 v) v6 B- S: w) P. D* a
-AX = 0910h (Display string in SIce windows)6 y) Z1 {" S* b2 U$ ~' r2 B! k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 K8 M+ w/ o6 t+ t
-AX = 0912h (Get breakpoint infos)% y3 d" [* R7 y. t0 a
-AX = 0913h (Set Sice breakpoints)& M8 Z, b; {' d2 ^
-AX = 0914h (Remove SIce breakoints)
4 w$ R5 K3 [0 f% ]1 N
: R( Q' ^" B0 O" l6 Y9 gEach time you'll meet this trick, you'll see:
- D3 ^7 r) z# K-SI = 4647h1 _( M0 S# W+ ]- `8 v
-DI = 4A4Dh
* E! G u" T8 Z; M: hWhich are the 'magic values' used by SoftIce., M9 B( D1 H, l" ^* q) O
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ L# a3 f& t! I* Z$ ^
( {+ L' b# |4 m) B7 n8 y; aHere is one example from the file "Haspinst.exe" which is the dongle HASP
; o! \$ \& B0 q* W1 f2 N) qEnvelope utility use to protect DOS applications:$ D8 f7 S+ s& ^9 R8 U
+ ]! d& t8 @9 S) v
8 _9 T- [! Q _5 w% |# Q1 Y4C19:0095 MOV AX,0911 ; execute command.% C& i m) P; l! J+ \0 S0 j9 `
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 Q/ n+ r/ x! |* Q& D" X4C19:009A MOV SI,4647 ; 1st magic value.* o+ Y" q% M! y; V/ }* X
4C19:009D MOV DI,4A4D ; 2nd magic value.
* U) Z3 S4 I* y8 {, c6 h4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
|! |! p* n+ s4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# Q! u5 y0 C: |& C
4C19:00A4 INC CX, R9 K# T# q! s' H3 |1 N J2 {
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
3 v1 K; t9 G A. [5 s- U7 _4C19:00A8 JB 0095 ; 6 different commands.
7 R7 Q& ~" B' {) f, D. W e! }8 t4C19:00AA JMP 0002 ; Bad_Guy jmp back.) s, E! b" h6 ^. Y
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 [: u- k& k0 x4 S6 c3 y2 q
: |) J1 q2 O ]7 `$ ^$ BThe program will execute 6 different SIce commands located at ds:dx, which" k, K% R: {* `
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ c/ ]7 b5 I# z! Q4 g5 t; W7 m
) v( @1 G$ H2 w. ^. L( a* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% b6 \) Q( C% x% {( f, D
___________________________________________________________________________
+ N; f1 ]% G2 x' z% f; i# `/ U! A4 |! E8 g9 O- l
/ l5 |# q* F' R
Method 03
5 n. l; O& ?0 f1 g( i- m=========
& O% N# c. t% b- \) ]! L; H1 }$ M( I5 i' w$ y" u+ f7 L4 N
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# P# S/ r5 s8 ] w(API Get entry point)
7 C! W# a d i& ]: j" l ; p$ C7 [8 h& @
[- [ g7 I, p X xor di,di* k D4 S) \% I
mov es,di9 `% Y' ~/ i: z' r
mov ax, 1684h 0 b6 I q+ Q2 J2 j- G4 `# e3 A* }( L5 Q
mov bx, 0202h ; VxD ID of winice
5 M2 [* J/ n. ^6 F# b& C Y int 2Fh
; u7 @) k& R9 F3 ]) W! v0 d$ r- |/ t4 q( Q. Q mov ax, es ; ES:DI -> VxD API entry point
# [' t( U; H7 _+ s, m- Q add ax, di: n, D5 k9 l0 B+ S5 Z
test ax,ax
0 R/ `, s' z1 l5 V' h' M' e. s+ K( P jnz SoftICE_Detected7 M4 e. \: F+ n
8 k2 {. X6 m1 M3 j' k' C
___________________________________________________________________________
7 y( n( b5 }8 x( b- Q5 k. e e+ Y1 k
Method 047 a4 j5 L0 G$ |# x; W+ j
=========
; h; L o1 M0 j/ X7 u& K$ X: A% |& i, Z5 t; l$ L
Method identical to the preceding one except that it seeks the ID of SoftICE
+ U% j$ f/ \; {* J( X: jGFX VxD.
2 O% [- h! p- e. J& q+ Q! {* c4 p$ ?8 j5 `0 [- l
xor di,di6 B$ h r6 W2 @% |* _
mov es,di v+ d8 d9 K) r' g
mov ax, 1684h 1 U5 |+ L3 \4 Y
mov bx, 7a5Fh ; VxD ID of SIWVID4 M0 s) E7 V K! ?
int 2fh
, W5 }! \# a% P; q$ }5 N) | mov ax, es ; ES:DI -> VxD API entry point
* n0 x8 |6 a. Z, p$ \0 s' P( F add ax, di+ ~/ v. }, t' e* K1 `0 _ O* W( L
test ax,ax
1 \. I# G) g+ x: L4 j jnz SoftICE_Detected+ r# N/ I5 {: K" ?; n
; Q" z1 D$ z( \
__________________________________________________________________________& \# e- B7 G: D4 t# L
" P9 Y* P' [: h7 v8 w! k- t
3 _: S) O% ]2 @+ H- P' w
Method 05
) D' L- ]4 {# E) r+ w========= _( p1 D U% S$ x2 K
4 d+ p# }9 t0 y
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ I% O. ]- D- \! Rdebugger. It calls the int 41h, function 4Fh.7 E4 i: x! o& h0 l! K& W( G
There are several alternatives.
8 l8 |1 B9 A' U/ v$ W
: v9 V, \9 E' N( JThe following one is the simplest:
7 E. H1 l" i/ h6 D
8 C3 g r. O* u7 e; ] mov ax,4fh
3 O9 a/ w6 {; M+ i' W: D; Y( U% A1 S int 41h
) P( B7 t) h0 ?! o5 Z% r cmp ax, 0F386
6 A# |7 o7 D m8 d jz SoftICE_detected. Q! S1 d! F9 m
6 k7 A; d" p% u) N, V$ h
$ L4 G8 B. h' a6 E0 tNext method as well as the following one are 2 examples from Stone's
3 R8 d# Q o3 [. W2 P, N0 {' m"stn-wid.zip" (www.cracking.net):: a+ s# _$ [" K* h0 r
9 F- x6 B' R8 K3 [5 @* { mov bx, cs% d% [. X7 V# c
lea dx, int41handler29 f8 R8 t, ^8 {# Y ^* N( D
xchg dx, es:[41h*4]! S- z+ `! E4 A( j4 _
xchg bx, es:[41h*4+2]& F* p% p4 B6 Y; D* r. N4 n G
mov ax,4fh
5 ^9 p! d% h' l' N' a int 41h
2 j3 p/ h: c! T' \- {/ A7 ^) E" D xchg dx, es:[41h*4]
5 q- { X' }- P* ` xchg bx, es:[41h*4+2]" z/ G- u' k# K' U( h
cmp ax, 0f386h
" d0 R% z! h/ A" l; O jz SoftICE_detected
; C4 c$ d: q4 D$ E6 e, B
' I" Y0 {! H6 U5 d& e* o) E* Tint41handler2 PROC* O( ~4 y( \( P9 t6 i: s& ~
iret
3 V) L. n7 ~' b5 o. kint41handler2 ENDP( f$ V- m7 K& I6 X, o6 i
$ Y( S6 R# J: z! o4 c% H% b6 O }. P
_________________________________________________________________________
5 v+ a6 b; ~: X/ E. j# v
' g2 C1 E9 A. k z3 E
$ S* }/ F% h( t U3 [Method 06
# v$ G- E% |9 o1 D8 b! m=========
& h' B1 [ k- g2 c
5 J7 t! l+ c$ j& Q3 E
# D n5 S% @4 v' o/ R! u D2nd method similar to the preceding one but more difficult to detect:
( Q/ C8 q4 s2 ]4 u2 x7 l' A/ c# M/ Q$ |& F
& Q5 S# i" U6 S7 Eint41handler PROC
3 O) Z4 J' b0 E mov cl,al
1 l% p8 A9 K' G$ | iret! K; B! H% r7 n* p+ |. l$ t- r
int41handler ENDP
2 u$ `0 Q: y3 t# G0 }+ ]' c s% ~! b1 w; J0 f
% ?- F' g4 f- H( S+ W& }9 M
xor ax,ax& a6 b1 ], v( v4 I+ c
mov es,ax
: Y1 }6 i, F6 A) H; a# n mov bx, cs; L, w( ]! }$ o+ i
lea dx, int41handler
3 q, @. k. v3 Z3 x* K# C0 U xchg dx, es:[41h*4]
4 d3 M D: Z! X1 O a6 p xchg bx, es:[41h*4+2]/ ]6 b9 y* A/ P- [7 Y7 m
in al, 40h! L2 _# ~; E' u- _: q( m
xor cx,cx
* s7 z3 m; W# B# e1 `! Q7 Q int 41h
( k4 f7 F( n% f" y xchg dx, es:[41h*4]2 e: R: c( j) m& g5 q
xchg bx, es:[41h*4+2]8 O" O7 i: g. k4 D
cmp cl,al
! y8 b+ c3 p0 [( h" R8 D jnz SoftICE_detected5 F# x2 r% o8 T* m9 z( U9 J9 G5 w
* Z4 x* T2 P% S# P. [5 G& D( F
_________________________________________________________________________6 y/ v6 W G8 w5 n6 R! a; @8 }
4 A D- d. Z+ R Q! _3 `2 t
Method 077 [: H, p; S' D+ X0 K5 D' n, z Q
=========, n7 z* G0 l, Q/ t" @
7 Y* J+ i& Q6 s" D
Method of detection of the WinICE handler in the int68h (V86)
7 c* T+ i3 _! ~* B, w7 w( ^+ X$ B1 }5 e P: b P* T, L
mov ah,43h+ X0 Z% o9 S# f. o' X' Q
int 68h9 N" B) H$ p: c8 [
cmp ax,0F386h+ U( a! J0 v/ D! X6 R" x+ Y7 Y
jz SoftICE_Detected
' d8 z5 G4 X1 J5 @9 y
3 n, R8 ]( C! A4 j# z/ I* V% a
' X5 B5 b6 @2 i; c1 S) A=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit6 C2 n& U7 l e( e9 a
app like this:' @7 `: L0 }! U: o; G. }9 Q! M
, ~: D* O& Q4 q2 S, {' Q8 ?7 Q( @ BPX exec_int if ax==68& a4 `9 u1 Z: b8 J; K4 ?
(function called is located at byte ptr [ebp+1Dh] and client eip is1 D, O! P/ O9 R' j" K
located at [ebp+48h] for 32Bit apps)5 [# ~1 A, _5 \' |
__________________________________________________________________________, s7 J" c/ X3 T5 F4 y t* u, N
# ~" o# F- H# ~/ K. J+ b) ?
5 P2 s6 x! V# i1 [4 U: f/ JMethod 08
( _! c" |1 L# h7 f. J=========* }+ _# P5 e' r7 f7 k
9 A2 K. r4 E. n/ }It is not a method of detection of SoftICE but a possibility to crash the# S1 w- {6 @& {0 c! S( J- @9 } u
system by intercepting int 01h and int 03h and redirecting them to another
* `2 J. y: X, H+ R, R3 U; c/ sroutine.5 v; D4 \1 |; U" {/ a
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 B: g! Z1 e! ~* r8 y0 Kto the new routine to execute (hangs computer...)
% r, H$ I# E6 I1 w7 {- P4 n$ c/ j! Y
mov ah, 25h( ?7 @4 r; A. J6 u5 W
mov al, Int_Number (01h or 03h)
8 }6 B2 D. z9 d# A mov dx, offset New_Int_Routine
( u0 [/ F5 o1 `3 B int 21h5 M1 J! T5 W! j6 M
, |7 |7 Z: _% g& M, ]. k9 ~
__________________________________________________________________________
5 z' n$ e _, h( c; I
; V. [% h9 F& k$ O) MMethod 09% `! Z4 o+ y2 y* m8 X- ~% L+ W
=========# V# N7 R& x& T* Q; Z
9 [7 \ N& f, o9 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, y& E. N4 V8 m, W3 I$ S5 L
performed in ring0 (VxD or a ring3 app using the VxdCall).- ~$ N6 K/ w6 u; L* h( `
The Get_DDB service is used to determine whether or not a VxD is installed" L7 \" s/ u& J3 v( P) ?! d) l% L
for the specified device and returns a Device Description Block (in ecx) for# ^( Q4 f" ^' y/ L9 W. [; `
that device if it is installed.. l3 S# [# g2 V/ M1 ~0 O: T
1 c9 J' D$ h3 E8 R( \5 k. n1 P1 f
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 }, m; e# r, e$ ~# k$ X/ ?8 o8 O5 u0 u" ^4 J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
! f; \' X: Z3 u5 S3 S/ S VMMCall Get_DDB/ E O2 M2 K: T7 p! p* N
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( u0 R% c% h1 T- @/ A+ u) L
0 t: Y ]4 u, |' pNote as well that you can easily detect this method with SoftICE:3 T0 _- K/ ~/ _4 [' N' S6 ?
bpx Get_DDB if ax==0202 || ax==7a5fh) }5 r r% k3 S9 ^" }& j/ C: V) w i
# j! c {8 T. ^. S+ g- G9 H/ V
__________________________________________________________________________: _8 A, u" E8 X& m% C2 g7 Y* V
5 g, E/ z, y! e+ q" R7 T' j; ?Method 10' G( t% T; [8 F: C
=========& ?+ \ B3 w. m9 S
6 U& W- P0 j5 r d9 \8 ^=>Disable or clear breakpoints before using this feature. DO NOT trace with- L4 n$ i. ]+ Y3 k- M
SoftICE while the option is enable!!
1 m7 |; a% Q: [# A! R/ Z0 L$ |' B8 p1 {& |( W3 J
This trick is very efficient:
' @- x& E- K3 |& \" N- _, ~& pby checking the Debug Registers, you can detect if SoftICE is loaded
7 \& ]' C, j$ H# o0 n! j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. U! L% Q2 C7 o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
( [! S0 C( f5 s1 ]value (in ring0 only). Values can be manipulated and or changed as well8 D9 Y) U' L y2 t7 {2 }
(clearing BPMs for instance)
; U+ @8 A+ Z; ?# k* H( a' @7 }( n! @+ p
__________________________________________________________________________/ T% O: y6 s$ B3 r+ e2 T' d
- e3 r2 T+ Z3 Q6 @2 T' A3 P* V+ X
Method 11
' T0 D$ k/ q4 P9 Z% {5 M0 l=========4 u. {3 f" h( f5 E3 j2 o! P! ?4 h
8 H. @+ o) A- U* K& NThis method is most known as 'MeltICE' because it has been freely distributed
! M. i' A- m1 M5 d4 `via www.winfiles.com. However it was first used by NuMega people to allow, g, N. h2 H9 _
Symbol Loader to check if SoftICE was active or not (the code is located7 P ]6 u1 W8 U2 I
inside nmtrans.dll).3 p: r5 W2 u* `) @1 _, s/ ] z/ J) T
: s1 m% J" d0 }$ @! {$ h$ |$ x. vThe way it works is very simple:
# G; A) @; x3 A$ [% e" D7 iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
) D( w, ]& B. Z% e% |% qWinNT) with the CreateFileA API.
; {' H* V/ ^, [( v; v$ Z
; h! t4 o- Y9 r$ O/ X9 VHere is a sample (checking for 'SICE'):% z& l' w1 }, W% h
, u2 \' }/ ]; s1 _
BOOL IsSoftIce95Loaded()
2 Z# D6 K6 b! ^2 T/ ^( G{
8 x; M1 d4 D( \( v9 ^' w HANDLE hFile; ( R9 m8 l2 W6 m) t' e' i
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 X. P ]+ z5 u% r7 K$ \! [
FILE_SHARE_READ | FILE_SHARE_WRITE,
% ^( s7 s( w0 q* w NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 U" V1 F! d4 m
if( hFile != INVALID_HANDLE_VALUE )
9 F, R* B7 c6 k# [% s; r {) y* X$ u$ K* l1 B/ l6 r1 l2 G. i" V" Q
CloseHandle(hFile);. Z4 I0 v. N' P" A' `8 O' _
return TRUE;4 J B' F& u* Z2 S) Y( a1 A1 K! {
}
; u- n) J* s4 [+ G return FALSE;9 _! ?* y8 n& }4 n% [' T' }
}
" Y9 g* g1 l( @) k$ v
- `1 C( i/ v9 _# M% bAlthough this trick calls the CreateFileA function, don't even expect to be2 C% r0 P6 ~9 b+ u4 q2 ?2 j
able to intercept it by installing a IFS hook: it will not work, no way!
6 V$ X; C) X. s! [' U! zIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
. f% P# J: Q0 Z" W6 Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, S- C+ c7 I, A! x. M" f p iand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 X; V$ n! J# Q. D
field.% T+ P( ]1 G& ?! s; ] p
In fact, its purpose is not to load/unload VxDs but only to send a
, }2 Z8 B) x$ e9 n% [4 M uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ v; Y- b, l) Z* t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 j1 t( Z F- T4 E2 e, ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 Q) T% \! h. [ B: u
If the VxD is loaded, it will always clear eax and the Carry flag to allow
1 [ Q3 }5 Q3 Eits handle to be opened and then, will be detected.
1 e8 T* T1 c) | F3 i4 Z3 \+ hYou can check that simply by hooking Winice.exe control proc entry point% h( O( f- k6 V( w2 s: K, U+ Q
while running MeltICE.9 E2 t6 i1 M( o6 y7 r3 a7 |
: P3 ~) i5 t' A6 ~" H' B( C
( H+ r& O V8 j7 Z4 |9 } l6 p 00401067: push 00402025 ; \\.\SICE" J& E1 U _9 v4 O2 O: d
0040106C: call CreateFileA
6 y, g* @9 ~4 M 00401071: cmp eax,-0013 F1 Q8 }1 o+ T; u) X
00401074: je 00401091
, o: k! j; J, w+ Q2 @
# l! E; E2 h7 C" p) e
/ P/ G. c# E; X0 V# Y; s( lThere could be hundreds of BPX you could use to detect this trick.) ]0 I, F( c) ^! g3 W2 H- w0 o
-The most classical one is:; D8 S9 c0 K$ {* B5 V
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( ^" g1 J/ O- D0 a/ S8 C *(esp->4+4)=='NTIC'3 J. V( [& ^! J* h Z
+ v; T4 q ~3 M1 K& S. z
-The most exotic ones (could be very slooooow :-(# X" v: Y6 R/ ]# b: D& ^3 _, t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ' I3 U% ]! ?0 i: J" R8 ~
;will break 3 times :-(
3 p' n4 T" e& Z& O8 P0 H) A
" A/ d% L( f" x* M-or (a bit) faster: # A, p" a! F' p/ i
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 B- V4 l# ^8 ^- K( y/ O0 f
/ t0 d6 s# B5 l6 x8 i; P7 I BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: D4 G% e- P2 y3 y% Y2 O( s/ k1 g ;will break 3 times :-(
4 G. m# r8 _6 M3 P# h
) L% R1 w& B" U: o-Much faster:
: J S7 ~( D0 k) D9 M BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& H, l4 x$ ^; F5 }
6 P" b( A0 j( Q" d9 ENote also that some programs (like AZPR3.00) use de old 16-bit _lopen
. ~/ G3 z$ G4 B- ?* P: dfunction to do the same job:
3 O, D, x: r F) R! |& i: |; A0 _9 i/ O5 h) V s+ P, m4 v
push 00 ; OF_READ0 M- a5 w. s, S
mov eax,[00656634] ; '\\.\SICE',0
: f4 H; u9 O+ r4 B" M) {- z2 c: ~& G push eax
* J; J* e1 H9 C call KERNEL32!_lopen) M7 h# _3 t- u* Z& Y
inc eax( ?7 H2 a9 E/ |
jnz 00650589 ; detected. D2 w) ]9 k! |4 O/ p
push 00 ; OF_READ
7 ?' H) H p# W, i, b# V mov eax,[00656638] ; '\\.\SICE'
1 [: f2 u% L2 _ push eax& s% ^1 H2 L# b5 k6 @4 a
call KERNEL32!_lopen3 @/ I1 c+ i; I& w, h w/ B
inc eax
{+ @( w) D4 C$ ` jz 006505ae ; not detected
- f% r. j0 D* }
% @% f! U6 I5 ^. m: ~0 H# R
7 u+ o6 |2 q% }1 T0 h__________________________________________________________________________, Z' I( G" a* V& E# {: Y% z: R
8 [' e, q* \1 S4 j& O# Z7 Y, ZMethod 12- J4 c: X* p" V. h
=========: H; ]8 I8 L, m% M3 Z# `
1 [' H5 {6 e$ Y1 f7 e/ o
This trick is similar to int41h/4fh Debugger installation check (code 05
( o' x% P* W" q Q: j$ @& 06) but very limited because it's only available for Win95/98 (not NT)" B4 M7 i3 z, R# o$ o5 s, A- ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo., s1 Q. C0 U/ x- H7 ~2 E7 {
) a4 j. o& [4 B* Y1 Q
push 0000004fh ; function 4fh: f0 t2 Q5 w7 [% \) @# L
push 002a002ah ; high word specifies which VxD (VWIN32)
1 g0 Q2 i9 r, @' z. x ; low word specifies which service
$ M" q+ ] ^9 s K( s( W5 x( U (VWIN32_Int41Dispatch)
2 D$ Q( C. }" ~0 `- i( { call Kernel32!ORD_001 ; VxdCall
4 Y+ {( D" A: x" N cmp ax, 0f386h ; magic number returned by system debuggers7 G Y0 C6 v8 K
jz SoftICE_detected5 V$ M0 D& D# a
- s( h, X8 K1 d( EHere again, several ways to detect it:
9 [" c7 o- o2 p2 m2 T" G; ]: Q# }" B8 x4 x
BPINT 41 if ax==4f" d+ ~# _1 l8 G m' m5 C
$ ] [. F2 P3 \
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
6 _" G, F a: P) ^5 Q9 [: Y
t& \& }; w1 L7 N& e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' K% K" c& ?: \/ c" l$ Z
- ?, S$ K* k3 {% e; C
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- T; U5 R, F. s* d; Z6 [, v: X# ], Y. T
__________________________________________________________________________
( e1 Q8 o& d- s/ @+ ^. B; w9 L ^* s( m5 g1 Q: `0 G
Method 13
8 W6 ]# G" I2 x5 R$ c+ m0 y=========# J6 @+ Z3 x" G# ]8 h
5 I! a* w5 l T; D6 y XNot a real method of detection, but a good way to know if SoftICE is! |" S( [. n( h/ O( X2 m0 p9 `
installed on a computer and to locate its installation directory.: N- c) y1 s1 u0 A# m& \4 |8 u6 k* u
It is used by few softs which access the following registry keys (usually #2) :6 O8 ]% e& `5 o9 a( r# c1 D3 O
2 |9 J, p- \2 I+ c' H-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ y M4 |) l' p: E% E* r5 K
\Uninstall\SoftICE
& {5 |0 Q3 u' k" a( K7 H/ d: P" B& j-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; J6 d6 Y$ c: x, ]" ] L-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 ?6 i( Y: f: `
\App Paths\Loader32.Exe
& O" a |/ C( L+ h3 m% r: q8 ]% W$ _+ e1 ]% N
5 Q. e' S( h# P( @& _, Y
Note that some nasty apps could then erase all files from SoftICE directory/ E. }1 G' D. q v, e* }5 d( S( s
(I faced that once :-(
# h8 |; k6 W$ a/ m8 G ]8 j W9 Z8 M; B7 b( _' k' P2 X
Useful breakpoint to detect it:: H" e4 r z7 d
% y0 P, z# w3 x3 _. D; @ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
* k+ d0 y7 Q% g- r: g2 |
1 a; @7 h9 X+ ?* r, g, Q. P+ s__________________________________________________________________________$ N" o+ L! R3 L* z; f( V# A3 Q
$ C1 W Y5 a% D+ ]8 v- y" c2 X8 J
. e2 [# R# A$ [# h+ b0 {# pMethod 14
$ n# V, L, L# A8 K) X=========. c2 p+ {7 `7 a, O$ B4 D/ h8 c
8 H4 z! T" v, pA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- q- ]: n* q, L' q
is to determines whether a debugger is running on your system (ring0 only).; V! E. r1 ]1 p7 x; E& l A6 R
3 q: J$ @4 X2 n, N! g7 E
VMMCall Test_Debug_Installed7 T# l2 ~) f0 S4 r) a
je not_installed- c. P9 w5 }; m
3 K; }' ^9 u, ?8 b+ U! B/ B2 [/ n# oThis service just checks a flag.
! F6 ~ ?. u1 ?6 x z, x# d</PRE></TD></TR></TBODY></TABLE> |