<TABLE width=500>
$ ~) R+ ~/ J* E: _<TBODY>* S8 W% T9 v: t* w8 E7 M
<TR>
' V6 ^) t$ e& S6 S) D7 n<TD><PRE>Method 01
5 A% d& J1 `5 h' `7 e0 i=========
( M* @8 I, X. N4 q9 J! k" X& J/ s9 M. o3 {9 m/ n6 Q! F3 X$ W. } M
This method of detection of SoftICE (as well as the following one) is& I$ a; \% |/ Y7 A: u% `2 E
used by the majority of packers/encryptors found on Internet.! _% h# p0 v% Q% j4 f# E
It seeks the signature of BoundsChecker in SoftICE- S! E! M. Y1 S5 Y$ L! U8 Y; c
O2 E: c4 w# }$ F mov ebp, 04243484Bh ; 'BCHK'% l ]! O! w- Y
mov ax, 04h
0 X% f/ i4 N r6 o1 U! k int 3
0 V. |$ s. \& j( B cmp al,4
" ]( h9 Q& x# R0 j3 [) z+ _$ r jnz SoftICE_Detected3 N9 q3 u! c5 Z
5 @+ V& `: ^. @2 ~2 F! I5 ?4 N
___________________________________________________________________________
1 Q1 q8 h- ` ?+ `$ z
0 p; k g( j' B/ [! l& cMethod 02
/ {9 X7 X$ B& Y2 A, W+ L=========9 Q8 j1 _& Z5 b2 U2 n( h. B9 e
% v7 \3 X, s& I* l) m2 ]
Still a method very much used (perhaps the most frequent one). It is used; Y7 ^+ ~; F: e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; C" _7 R0 c3 }, D( cor execute SoftICE commands.... Y& D$ B' L" U% h: V; j
It is also used to crash SoftICE and to force it to execute any commands9 C" c3 T2 z3 |" t
(HBOOT...) :-(( 0 [; U: v- }4 L8 Q. l! F$ s
8 S9 |+ n6 m$ @# Z' j
Here is a quick description:6 h9 M" ?- r' d8 P# q% c) L. }
-AX = 0910h (Display string in SIce windows)/ h4 L1 R3 M5 a1 \6 u! u
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( `" U+ K, [+ h, |
-AX = 0912h (Get breakpoint infos)2 u" c% V' l( T4 S! A2 H
-AX = 0913h (Set Sice breakpoints)% W8 V7 h( l; ]" R7 z. m) i* ]
-AX = 0914h (Remove SIce breakoints): R' o5 U/ o. d3 s4 @
) ^! P: |2 | O7 w1 HEach time you'll meet this trick, you'll see:
J8 a% `0 A7 |# }( S-SI = 4647h
0 y% h" r: H) m4 O-DI = 4A4Dh% B/ K8 F& @; O2 x4 \
Which are the 'magic values' used by SoftIce.# q6 E) u0 b; Q0 c7 ~9 @
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- ^9 ]' G' `: U+ a; f
# v+ ^2 i' m' o* x% ~Here is one example from the file "Haspinst.exe" which is the dongle HASP
" |" i4 [) e2 E- {2 OEnvelope utility use to protect DOS applications:0 g+ f+ N* a3 r" \% D
- `3 N3 ~: f8 D2 S0 E' k4 h- a$ y n& T' Z. n
4C19:0095 MOV AX,0911 ; execute command.
, W$ k8 Q i \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 @. G+ \$ K. ~. F: D: C E* M
4C19:009A MOV SI,4647 ; 1st magic value.
/ M7 }( C! c6 a& F# q; Y' J7 t4C19:009D MOV DI,4A4D ; 2nd magic value.
( \& V9 J6 S) w! G& b4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 t* @( s2 u& W% {
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute/ |& d. E8 _ t; y, d% [
4C19:00A4 INC CX2 u* k8 @/ \& Z0 P& b
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 \7 k$ \& B2 n1 \- _4C19:00A8 JB 0095 ; 6 different commands." r F R- N9 T5 a$ b! z* a
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 @9 I: d/ l& n" _' v7 l4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- R$ u; L6 ^9 v3 u+ g% `+ t% x/ j5 ^
The program will execute 6 different SIce commands located at ds:dx, which* C* { s4 G; n- ~$ r6 ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.2 d" s, _' r/ h2 g0 j# Z @
m3 ]2 R3 |% j/ d8 W! ?" x* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
S$ N. [0 l( M4 j% ?7 q___________________________________________________________________________
# W8 h. u: Z# Z" V: R0 E/ b7 D
. p$ t9 B \, W9 n# R, u4 ]
) x/ @5 }: y* z S7 E- ~0 m% JMethod 03
( N2 q$ W- D( a9 j A& w=========- v( o% X+ T5 y# r& N* J
2 U5 e' C9 ]* }% ~7 p5 q6 k* fLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. u$ m4 w% P/ }/ t
(API Get entry point)
# w' c# `/ h. n3 Q% m ; b; {. N0 d r
1 X ^; N P7 n- @8 T+ T
xor di,di/ @7 g0 Y- ]1 w; |4 P) R
mov es,di
s& n) Z; Z+ w: v" a" W mov ax, 1684h
! P# u! R& D2 L* Y' ~, u/ ?7 f mov bx, 0202h ; VxD ID of winice
! r/ C3 J) d+ D8 Z int 2Fh/ J7 i- k$ [( l
mov ax, es ; ES:DI -> VxD API entry point
2 |3 T; z( P" Z1 ?5 M1 T add ax, di
9 K* U, x2 ] S D; D test ax,ax
* ^1 ]4 W+ n s( \ jnz SoftICE_Detected/ Y0 z" J6 [& v- O
0 T, V- u8 K4 Q1 j
___________________________________________________________________________7 s0 C7 t H7 k" J# f/ Q% x) T
; }- K$ r) F% t/ r! r
Method 046 {% }/ x0 \( o* p
=========. G) b# i9 ?, i# `9 a
( n. T- _" h) |
Method identical to the preceding one except that it seeks the ID of SoftICE6 |$ \7 w1 }% a4 b. X4 S
GFX VxD., |7 t3 A4 q( ]: E3 N- c
6 L) i' ~5 ?$ O/ d4 }# J* m xor di,di5 S! B: y. H8 B& l- U
mov es,di
8 y% x$ `* g$ U# g I& b2 i/ Z- g! l mov ax, 1684h ! f" o c9 c3 X. C7 s1 d1 {3 W, q7 _/ }
mov bx, 7a5Fh ; VxD ID of SIWVID
7 y1 t8 J, {: K* p: ? int 2fh9 M! k/ V; x' i8 [
mov ax, es ; ES:DI -> VxD API entry point
+ }% J( B7 B. V, X6 ?! [ add ax, di" Z. T1 ^4 {6 E2 n( Q; l+ y$ z
test ax,ax$ Y& q6 z) k3 a5 [2 N
jnz SoftICE_Detected
" K: ^1 I: f0 N0 O" v% ^7 }! m" ]* b& u5 |) V( [! Y
__________________________________________________________________________
/ G$ L( y/ C: u4 _( K% A
# _' n( P- m8 m# o, K
& J+ X5 u5 c+ F9 NMethod 05$ s# o$ I( d/ I7 F/ m$ H
=========0 H- _' c7 Q! X( J2 s
/ u1 G5 }! t4 b+ `Method seeking the 'magic number' 0F386h returned (in ax) by all system) I" \0 J8 i/ D1 z# G
debugger. It calls the int 41h, function 4Fh.' ?+ M+ n1 c0 w3 d8 J6 m: C
There are several alternatives. , o4 T" u5 k F( I4 |
: }: X/ M: d0 p6 R) C; d
The following one is the simplest:
2 z( C2 {: K% L' w
/ G( H6 B) p+ o+ x3 v mov ax,4fh. Z/ X' b( }* D+ C M# e% q3 O& l
int 41h' g# W( }. ^2 A+ b; j
cmp ax, 0F386' ]3 a( X0 @' @! O$ s
jz SoftICE_detected; x7 ^4 ~* y, [* u7 P, y
' I2 N. k$ G* `, L2 W7 U9 \! K) k8 N, x1 L+ e
Next method as well as the following one are 2 examples from Stone's
9 ?, j" W, K& v+ H4 N8 S"stn-wid.zip" (www.cracking.net):) k" u K5 n: p6 _6 A# W/ N/ T+ y
! j) s, C. e- u. a
mov bx, cs% V6 S& |. T6 F
lea dx, int41handler23 Y# U6 x. v. ~# P
xchg dx, es:[41h*4]
& t h& e' F& V! b0 H* ]$ n xchg bx, es:[41h*4+2]
' U }1 d2 ?9 u2 y9 g mov ax,4fh: Y0 b" W! i4 v7 B9 X
int 41h
# \/ M; m; ]" i; R# T# X xchg dx, es:[41h*4] g, x, H" ~, g
xchg bx, es:[41h*4+2]3 h5 `9 M, [1 c
cmp ax, 0f386h! l2 y( ?% S$ e0 a, D' P$ j( k* M7 J
jz SoftICE_detected
% W2 j' Y0 j! b8 C. I) L4 F, f
6 `. n2 {5 D% Rint41handler2 PROC2 P U3 C1 m% S& X
iret) a; T4 @4 k/ c8 e+ D$ [' a
int41handler2 ENDP* Y9 m2 s: `1 J& e6 G+ K5 d
9 V4 ~1 h9 @" w$ x) d. W( V
( T* J6 u, _1 j. E, l0 s$ Y
_________________________________________________________________________
* s$ G3 e7 g( O5 ]
. r7 |2 W1 a: |. |1 w" G8 y, n
5 X" p6 _* O- c* z& F2 ^& q WMethod 06
4 P ~% I" X8 ^=========
8 h* B- @% a' p; V3 y% v4 z+ W; L; F7 {0 X8 M7 q; s0 \
" w, _2 d) `* ^* V2 z9 N
2nd method similar to the preceding one but more difficult to detect:
# \9 s3 B1 W7 B* N( Y q& ~; g
8 D' h8 r. P- A" ]$ q% X1 b8 U" b, g* I5 Z5 s/ j
int41handler PROC
6 Y( \2 \4 R; b' P mov cl,al
`' \$ P6 Q4 u G7 d iret
$ S2 d, _1 r7 {& T D4 vint41handler ENDP
" U7 |; Y1 a) z/ \' ?
8 g1 p! S Z( y u+ w
F2 n+ f0 N& t3 k0 i xor ax,ax
6 U, N# s9 q! J9 f; S- I mov es,ax
; w$ `, G+ ^, C mov bx, cs
: Q9 f) e2 S7 E* I lea dx, int41handler
# k& i2 F$ Z5 e2 W4 Y xchg dx, es:[41h*4]
) v9 q! t/ T n$ @+ O. ?" l5 m6 ? xchg bx, es:[41h*4+2]) w* `, C# }$ N
in al, 40h
5 `3 S- i- K) M% \3 k7 {5 g xor cx,cx
& j j4 x9 _( I* @: I int 41h
/ V& l$ |, l2 h" }1 m xchg dx, es:[41h*4]3 `6 c7 S& v; O7 K' l
xchg bx, es:[41h*4+2]4 I3 ?6 w! F% V3 I6 I" M
cmp cl,al
3 ?& P$ w/ ~' j6 l; Q5 i' c5 m3 m) W& s jnz SoftICE_detected. P0 v0 d! b0 ~1 L& g$ ?
- E) I/ u( X# C1 z7 n! h$ i_________________________________________________________________________
3 C7 K4 N! C% c, L7 d) L9 t* M8 I2 Q0 k( V2 v' s0 ~: _
Method 07
: g# {8 x4 F- q7 R; b=========
- {! \! j7 }* ]0 Z5 e
l( h% w- y( m. D W- c P0 ZMethod of detection of the WinICE handler in the int68h (V86)8 h5 g. b# p6 ~. N; E" p
, ?5 u5 n H6 j+ e& f3 O mov ah,43h
$ q& V/ g+ R* Y4 T0 m" v) u- Y* _: ^ int 68h
. x5 B' [ Y$ h: j/ M cmp ax,0F386h3 f1 K2 U D! M* u: p
jz SoftICE_Detected) w* P8 M- C+ V. i+ z# f4 Q! M
, x" j7 t( t8 g$ v3 z) P5 I
" O3 e( n3 f& d0 E=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& W/ m5 U- K4 f6 s- [
app like this:' @0 L* l3 L1 n0 C( Z+ ?, \
+ N/ c3 W5 S& w5 G$ d2 t0 \ BPX exec_int if ax==68
9 F: m- b" g- Y+ X* b (function called is located at byte ptr [ebp+1Dh] and client eip is
6 L: u* L5 F; E: V3 Y9 R2 b located at [ebp+48h] for 32Bit apps)
& Q: ?- H% r" n L, D__________________________________________________________________________
; F4 z" E: }4 H9 t: { ^4 Y/ r( l* o1 a7 j' F: D9 N
1 o: q' @; p, @! [; uMethod 08& H- h: d1 ^, G* s. w
=========4 Q. o5 R' f' K5 k. A
! r0 \9 E- `$ ` q bIt is not a method of detection of SoftICE but a possibility to crash the
6 ~ W7 l1 V/ v" i' j6 ~system by intercepting int 01h and int 03h and redirecting them to another5 |' ^! [( s5 T4 k# d! y
routine.
Q8 k( r7 ~! [+ I# uIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; Q5 l. q( P( r- j5 V# jto the new routine to execute (hangs computer...)
u% S0 v, x1 ^ X6 C+ L! S, i- g# V2 ]
mov ah, 25h
5 ]5 M7 B' E, p+ R mov al, Int_Number (01h or 03h)2 R" V" F% Y2 Q
mov dx, offset New_Int_Routine- d% r% M3 A5 U9 \
int 21h0 Y+ S/ d3 g' t0 t) \$ h+ R4 j% v
( V, Z5 \) F8 v0 |& d
__________________________________________________________________________5 i7 P, K/ J# Y: ]$ e- d1 f9 [
1 c9 V+ h6 {1 c/ m9 o
Method 09
6 g3 N; j+ r. K6 E' z7 `8 x! @=========
# y0 }7 B, X8 s B1 u% I& f
; R0 S! T: `0 v' j J3 JThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% ?% a" t2 v* G# C9 {performed in ring0 (VxD or a ring3 app using the VxdCall).# X5 W( s( Y. o
The Get_DDB service is used to determine whether or not a VxD is installed
+ `3 O) A1 `$ q; |& Mfor the specified device and returns a Device Description Block (in ecx) for3 g5 R$ Z" B; U6 @6 K
that device if it is installed.0 a6 A c0 f, j9 G
2 C, B* Q9 c* d2 { mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
K* d! Y; j/ y' } mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 o% l, n4 g/ U+ K! O% T VMMCall Get_DDB) X. X2 K/ z4 _6 m3 f) H
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, B8 X3 n3 n1 l7 m: v, {2 |
. ?! O2 { a. r! J p* T0 V1 SNote as well that you can easily detect this method with SoftICE:
( \5 m0 l8 `, z bpx Get_DDB if ax==0202 || ax==7a5fh9 v# ?/ B2 s' Q( O! X' \5 X
- {7 {: s, s4 [2 N4 g3 q( Q5 G8 ^
__________________________________________________________________________ x6 x f O y. r3 I
: |! Q8 O* R( |3 E7 K2 {
Method 10# r" Z. H8 p2 {
=========
2 g) O8 h! i# o- k' _4 h9 k
6 \1 Q5 ?# {: l. P8 V=>Disable or clear breakpoints before using this feature. DO NOT trace with. k. e4 Q; Y0 \! Y
SoftICE while the option is enable!!
4 \; v% ^& i( s6 Y$ b: t% J1 G2 z! e. ? t
This trick is very efficient:
, x3 X) t1 E+ U4 B; b) A! |by checking the Debug Registers, you can detect if SoftICE is loaded* c }, C. g7 O+ W; a
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
8 p9 P0 }0 f* d; n0 B. bthere are some memory breakpoints set (dr0 to dr3) simply by reading their
% C" y7 B5 h5 L0 U* {4 V- g1 Rvalue (in ring0 only). Values can be manipulated and or changed as well
" H+ r, B. a1 c; `" C% x(clearing BPMs for instance)
7 G9 i( c6 @) _" f# ` a; V
1 e: d* @* J W' f# f! b$ J& C__________________________________________________________________________
& S; X. \1 D/ P! f5 F3 o7 N, z8 q* y' ~; c' t) `
Method 11
% _& ~, H6 Z, F/ J=========
) }$ D5 h7 P/ `( w' o. c: N! E3 u) C1 `6 g
This method is most known as 'MeltICE' because it has been freely distributed( c$ E6 h/ z% Y" C! U# ~" ]! Y; _
via www.winfiles.com. However it was first used by NuMega people to allow! R7 R* ?0 P8 H
Symbol Loader to check if SoftICE was active or not (the code is located
: l3 H3 Z X; N; Y3 ^inside nmtrans.dll)./ j$ Y$ Z x& K
5 D/ F& U7 Y$ x4 |! l: W: w" @
The way it works is very simple:
. K. T$ s4 z+ H, g! ]; c6 FIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) p9 g# V7 C# `2 s
WinNT) with the CreateFileA API.
G, N, J7 y$ A5 [7 O. L
' [' z+ t6 R& @4 r6 Z5 GHere is a sample (checking for 'SICE'):: R- E; C. P0 R- f8 o/ p" I! p4 G
# V* I6 p# a# I# r( {. x: TBOOL IsSoftIce95Loaded() r. d6 Q: T* B# X
{
/ u( Q5 R6 T! `& ]8 P# [8 y6 i- J, i HANDLE hFile; 6 j! |. h0 A9 h4 R
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
N' s' O( m; x: F/ I8 i7 X' x, e4 E FILE_SHARE_READ | FILE_SHARE_WRITE,
% T0 C6 u9 X- N9 J3 e NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# Y: R# d0 T n
if( hFile != INVALID_HANDLE_VALUE )8 @6 y. L( n7 S9 z0 i
{
. _1 R) A4 f& A. m7 o CloseHandle(hFile);$ H) f2 a4 L& ^( a1 c6 } g
return TRUE;7 G0 d9 w* s' r9 |; N
}
0 n! u# ^ v- c7 X0 W7 n6 G return FALSE;
$ j* E9 C: k% c5 B$ z/ b}
! h8 L2 O& |6 h7 n9 ^ E) i) w* p7 s! R6 f
Although this trick calls the CreateFileA function, don't even expect to be
- b& G; e1 o# E/ ]able to intercept it by installing a IFS hook: it will not work, no way!6 {6 l5 Q) ^1 \, J6 s
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ [* X0 P/ T' Aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). t7 q# O( S- X! U
and then browse the DDB list until it find the VxD and its DDB_Control_Proc& `5 e5 r3 H/ V
field. v$ a/ `1 \) I9 D# z3 y6 V
In fact, its purpose is not to load/unload VxDs but only to send a
9 e: C: D( b7 W, e6 `' k0 v% r: [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 |: G, [" O5 \& b6 j! ~7 G+ |' Hto the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 {: I! C! ]1 \to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 E. ^! S' @0 `- k a
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ Q6 u% g) {# X' i5 w5 w$ ~
its handle to be opened and then, will be detected.( X5 R( p# s- E" H1 J- p; u
You can check that simply by hooking Winice.exe control proc entry point1 r/ Z. F* z3 h: _3 L
while running MeltICE.
# u( w4 b8 O. b* p, c9 ?% t! f5 }5 U$ y. X8 L2 s# v- e
2 z% f7 U! m: W 00401067: push 00402025 ; \\.\SICE
6 M1 N" }$ A; B, x3 k- V 0040106C: call CreateFileA
. X' H, h' V6 u. t 00401071: cmp eax,-001
% P1 j$ Y. }3 @9 y f 00401074: je 00401091
4 p3 `# n7 ?: d+ u6 `. V. J x5 l9 [3 l0 i" o& s0 Y; p7 U
* G. r4 C6 w* X
There could be hundreds of BPX you could use to detect this trick.
7 \1 x# u. A2 k7 a% g M0 }-The most classical one is:
, h |& y2 K' B# D7 ^- x BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( @" \5 U9 a1 q3 R M+ i
*(esp->4+4)=='NTIC'
6 T9 _7 E" q3 N# X$ y! v4 ?+ g& ^8 h6 z" `8 p1 v! Z. C
-The most exotic ones (could be very slooooow :-(
4 _" P5 l2 [7 U* { BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & @2 T( t$ a) ~
;will break 3 times :-(# Y* B, U9 _6 q# p5 d3 K
+ H7 C( n5 X$ u- V- o6 y, h-or (a bit) faster: 3 x- e2 U" O+ t6 p6 t- e' ~ h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ o! d d) r$ P# ^# o- S
& a, U$ h. X3 P S7 {' D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! w; U" p2 X+ w
;will break 3 times :-(
, S! V. r# h. I- v
/ B6 [' f2 g3 g( s& {& j-Much faster:( f; a+ @/ w% S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' c/ [ ~! K& ]3 z) G- Z# @
& i7 G; @3 u, G, |
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) G3 G3 {$ N& N9 J
function to do the same job:
& |+ ~9 k7 p( }2 O
" |/ D# C6 Y* Y; u# `. O- Y, ] push 00 ; OF_READ3 T0 d* S8 ^- F# `+ _2 C5 E
mov eax,[00656634] ; '\\.\SICE',0/ D% b+ i& A9 K+ P7 v9 Z
push eax
4 ~+ [: ^; `! n call KERNEL32!_lopen
" T! K/ V1 ~, D inc eax& Y4 P, a6 ]6 P+ o$ K% Z* Q
jnz 00650589 ; detected
; z8 H7 K4 [, H push 00 ; OF_READ
- J$ k) x, D# I9 ^2 w+ z2 } mov eax,[00656638] ; '\\.\SICE'
/ N# T" l+ K0 \3 m push eax( ^# ]% y' V# x9 b' Y
call KERNEL32!_lopen% P' C/ d8 c( G9 K- a' ] ~7 ^
inc eax
3 [1 j# O% K6 K# o jz 006505ae ; not detected
: s: T% H3 S: P4 M* P
) K6 R: T: U+ S4 Z; `
$ c ]0 @+ `: B- h' Q' b, q" s__________________________________________________________________________7 U& e* n5 Z. x
& Q7 e% i+ ]; x' E- FMethod 12& I+ W5 T* t0 h) q/ b2 v3 ^7 U
=========* |5 K; ?+ I" t9 ~9 t
/ ~+ ~+ x" }, E r+ E& z6 e" nThis trick is similar to int41h/4fh Debugger installation check (code 05
4 ^8 U8 G# j5 D( m$ ]1 \! g& 06) but very limited because it's only available for Win95/98 (not NT)* k8 T, x8 G M) k2 P; \( T7 A
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 ?3 m$ T3 o5 _3 Y7 {; q! p* Y( [" @5 ^: ^( q, x; l
push 0000004fh ; function 4fh
+ p( B% |. y; j- I) ] push 002a002ah ; high word specifies which VxD (VWIN32)4 ^9 N. W. z0 Q9 G' h
; low word specifies which service
8 P3 ~: X+ S1 ~5 a4 f7 I2 u& J9 h (VWIN32_Int41Dispatch)( e. y2 L4 ]8 g0 N# S% G5 ?
call Kernel32!ORD_001 ; VxdCall( C+ b+ V9 _: X2 a* O! p8 {! Y# T
cmp ax, 0f386h ; magic number returned by system debuggers
; N8 a5 l( A! K# q7 M jz SoftICE_detected4 b3 ~$ Y' N4 N6 |! y0 I
g3 e7 b% d6 o6 B
Here again, several ways to detect it:9 M! V+ o7 J" g0 A3 l
* S; z' V; G/ I6 v' _! l' ^6 S4 M$ m BPINT 41 if ax==4f
/ S+ ~( j; I- T' u1 Y( J
8 C4 f) f. j4 _+ c# A n9 | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* \9 r8 ?2 t. E* F5 G# A5 o7 q1 Z( R- L+ N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. J2 M- G9 o8 Z. a2 f7 j# b; Z7 y2 d& N! S. M
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: A3 O% J* K% r, `) a
2 K; T5 }2 U" u1 {+ g+ Y9 D__________________________________________________________________________) l6 N9 O: N5 \6 x, l
! w8 E6 p/ Y5 j1 N
Method 13' v, N! q% u9 Y% Q
=========. `. i. b% g! Y& P+ y( ~
" _$ H" h5 i% X2 eNot a real method of detection, but a good way to know if SoftICE is0 o& q6 Z1 L) j+ {* _ ^4 L+ |! R0 Q$ t
installed on a computer and to locate its installation directory.
. m8 ?- ^( L4 I$ X. u: J% H- H- }It is used by few softs which access the following registry keys (usually #2) :! t/ }" f$ s7 D" g- x
& V5 a: {. X, Y0 F0 I& k1 n" m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' a8 Z& ]9 v( v* l0 Z\Uninstall\SoftICE
: r+ Z" F$ O) {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' M3 u3 q) I3 Z4 H* Q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% @( R; c% T5 q& u6 a% P
\App Paths\Loader32.Exe( H" {, r; a1 |5 m& k+ K
1 x2 b0 U; G: m, h. ]: t6 z- y- T" H) F9 V. J, b
Note that some nasty apps could then erase all files from SoftICE directory; J' M, w' y8 Z5 R" x' }. O
(I faced that once :-(
, U H6 U1 \4 I, |
: z- Q& k* H1 }; Y/ S1 a0 {, IUseful breakpoint to detect it:8 J3 R ~* v7 W( A% l8 d# W
, K8 I5 Q- S. @% q3 F4 d: j: u. K% r
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 ^5 ~: q1 ^0 L p
# e+ g/ S& @# L
__________________________________________________________________________" t" f3 D1 w0 n# J
# Z6 B) N# ]+ m8 a* A. P
5 Y; X. V, @6 E& V4 CMethod 14 # u6 z% W+ v. g g2 C# ?6 B1 |, a8 S
=========0 S0 u# |1 U, U% c2 I+ J- {
) [# `4 F e5 p5 Q/ n1 N! k
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ Q3 J3 ~" }0 W, l, i- r7 U. cis to determines whether a debugger is running on your system (ring0 only).
! ~2 X+ J4 _( Q0 l. n9 I, w6 \8 i3 s$ }# q0 H- C( z O
VMMCall Test_Debug_Installed
, n+ s+ \( V0 U( u& y je not_installed
5 {5 {- H) ^6 F' C; A8 W+ r6 a, J, k4 j' z3 e+ `* w% x, o, N5 _
This service just checks a flag.
( n/ b% J/ g% t4 {4 ^' o</PRE></TD></TR></TBODY></TABLE> |