<TABLE width=500>
3 I) s% C. e9 ]* Y# ^) g' S<TBODY>
- J8 Z7 ?% e: ~8 j# j$ O! O<TR>
1 L, p; K) c( `6 l" P& h7 q2 R4 ^" i6 X<TD><PRE>Method 01
' @+ d" ?& I2 Z. w" [=========
/ }5 _* H! P7 Q6 ], {: `
2 k7 \& }" n) A- j3 v5 HThis method of detection of SoftICE (as well as the following one) is
/ ?0 L* r9 w! b5 o* Nused by the majority of packers/encryptors found on Internet.
( X& w' n0 g5 F/ u+ _& vIt seeks the signature of BoundsChecker in SoftICE
9 v* k- M8 `2 Q! f+ V
( s: }" L0 K }/ X/ ?4 F9 q4 ~# p mov ebp, 04243484Bh ; 'BCHK'
# W% x/ Y" a \3 t, k! K$ Z mov ax, 04h
( q" M M9 {# ^0 _: b" r2 Z/ \5 w int 3 3 H4 u; a% [/ l7 q1 O& n- V% U
cmp al,4
C9 d, j% F, G jnz SoftICE_Detected
6 ?1 Y8 V$ g) O/ Z# l ~; G+ }$ E- z) |$ k! m3 z, [
___________________________________________________________________________
b0 _# s! |) o5 F7 C9 X. G, V Q+ V
Method 02
- L+ s4 A5 d7 r: F" r=========4 K7 d- X% E3 M5 q$ ^
8 q1 u: m- Z1 D5 d' W% p2 R
Still a method very much used (perhaps the most frequent one). It is used$ {; p3 P+ p4 S2 g0 G
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) E1 _* I1 L; t$ X/ N2 {4 K
or execute SoftICE commands...
- l% G/ S& |) c4 w! SIt is also used to crash SoftICE and to force it to execute any commands
# o; p' _4 [9 x( C5 g(HBOOT...) :-((
+ h% \: z/ v# G% |' x$ q( G
5 s( d, S: t6 f! f) ^0 IHere is a quick description:
. R( S6 f+ l1 [4 O-AX = 0910h (Display string in SIce windows)/ d3 k) v; T d9 X* _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 ?1 o j' ?& [0 x$ I! ?! E0 A0 L-AX = 0912h (Get breakpoint infos)
2 r/ U4 \2 [: O0 q5 S3 V-AX = 0913h (Set Sice breakpoints)7 M4 x. l. u. o ~. L+ n _3 ^! f
-AX = 0914h (Remove SIce breakoints)$ b B, s6 O3 p4 {! N; m" T
- t- q" G5 \- |% e( Q; {
Each time you'll meet this trick, you'll see:
1 ]% V1 @# ? Y8 y) H3 f1 G% d# O-SI = 4647h
) x. V" d. X3 a-DI = 4A4Dh
) |# H" \& d+ `# }6 n! g6 _& y, mWhich are the 'magic values' used by SoftIce.
4 f0 x5 b. ]0 ?, F0 K; qFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 M$ f ]8 F" R: b0 B% m- K- ]8 i
1 r' c( k3 `( I; }2 ^" |
Here is one example from the file "Haspinst.exe" which is the dongle HASP
$ W& `( T9 n" L& N8 O$ e! i" gEnvelope utility use to protect DOS applications:
" o* f" [' T3 \0 u2 s6 C0 {4 o8 s6 @! l: m/ g
1 G* v$ N3 j! c4C19:0095 MOV AX,0911 ; execute command.
' L+ G7 M( b' k* [( H# T4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% A& n B# n0 K# ]( S0 P5 w
4C19:009A MOV SI,4647 ; 1st magic value.# n: k8 G( J# I' S' H: L
4C19:009D MOV DI,4A4D ; 2nd magic value.
9 h7 y% G# h, i& n2 Y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)4 W' i' f$ v+ ~ z) Q) T( ]
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! e6 r$ C, H# P2 ?0 R
4C19:00A4 INC CX
Y6 l+ x6 z3 f9 D1 k4C19:00A5 CMP CX,06 ; Repeat 6 times to execute; h/ ]2 p5 U; P6 \9 Q9 P0 \4 W
4C19:00A8 JB 0095 ; 6 different commands.% l. {3 M5 v$ x) h
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. @# A9 K; K, ?4 u! m, z# m3 z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 {% n) A2 x5 }$ p, N! z6 i$ V
% ^: [% Q( Z ]' P$ p DThe program will execute 6 different SIce commands located at ds:dx, which# m' n; J) \: B, p+ t& A0 E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. ?' v3 v( X9 w& G, R# {" W1 g5 R3 } i
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. _9 j5 v i8 n6 p
___________________________________________________________________________! o1 o' [' F& x7 }) h. o; T
/ U: x" j3 L* v# d. ?- |0 | I. X0 r
" F1 k4 o" `7 e' r2 Q3 RMethod 03
9 C0 P: u0 c W=========7 ?$ U. A, O2 `% ]) E! B7 P9 f
: c- S( A( \! m: a% x; tLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% k" j1 n4 a3 n: X) p( {(API Get entry point)' {4 x; X+ D- S P1 W$ i6 D
: V/ r; T) {0 {: s6 L) A' G- f% } _! ]* q
xor di,di! |- @0 Z7 P! d3 X7 ^. E
mov es,di+ i9 X4 A/ |! e$ \; q
mov ax, 1684h : o2 Y; M a) t8 \1 N6 c
mov bx, 0202h ; VxD ID of winice" S$ l% O* _8 e- Z+ O L3 \) ^
int 2Fh" h; S+ C1 }: M8 \
mov ax, es ; ES:DI -> VxD API entry point
8 x$ E. {! c& h% T. ^ add ax, di
* s, |# J* N! k0 Q/ ^ test ax,ax! J* x- W) [: P4 H, E9 [; p
jnz SoftICE_Detected
" b2 ~* ^9 i( m/ C6 W) z
- l2 g$ o) F" `1 X___________________________________________________________________________
2 H: Q ?- Z* T6 ?7 i& ?( F& E) Z: r& W4 _* H' ] x; x7 g" S# F2 ?
Method 047 V: u& l8 L+ o- U0 ]
=========: b* }* ?& d/ Q; E9 M3 x
; W0 h( i7 ]( I7 {) g% O
Method identical to the preceding one except that it seeks the ID of SoftICE
# g3 b" l' h* CGFX VxD.
/ p& _+ {' s/ k3 t2 a2 g+ ^. u$ E6 Q; K- A; V9 ^( O, t, }
xor di,di
8 |7 ~7 [: ~3 Z2 ?; f( u2 O3 d mov es,di
7 h: q/ P e) n. i: u! X mov ax, 1684h ; S, c* f$ T+ _; B" j
mov bx, 7a5Fh ; VxD ID of SIWVID
+ B! t/ J; h `. J# b int 2fh! j$ L, ]3 k) Y8 Z; w0 G
mov ax, es ; ES:DI -> VxD API entry point" c. [/ [& e4 ~# M% _
add ax, di7 k5 n! k# T1 x: B/ c* P
test ax,ax
7 J0 B) ^" h+ T; f T jnz SoftICE_Detected, K6 u% I$ p% d" I1 e
6 P# ~3 t, j9 W6 @7 Z4 `* s
__________________________________________________________________________% n( S$ _- A, Y, W
o- f1 G- e* k# n0 C2 ?
( w# [4 F5 x3 u: F: O9 I) ]; wMethod 05
: F9 v. T8 D! Q* m8 Y=========
. {. _& r& }% h
V( F! E9 C# i+ d+ ^' ~Method seeking the 'magic number' 0F386h returned (in ax) by all system- v/ a0 A' r4 h
debugger. It calls the int 41h, function 4Fh.
3 V' j- P" U! @' w" n+ Q2 jThere are several alternatives.
+ T' R a/ Z5 v: _' H; y' D
* `- z' ]6 d+ h9 f1 ?The following one is the simplest:
$ m! w( a& b1 Y6 k" x3 M7 ?8 A2 w; f1 H
mov ax,4fh, g/ o2 M) e. C
int 41h6 _1 v' ~# v# k- l% f
cmp ax, 0F386
/ M5 F0 _- h2 i: D jz SoftICE_detected/ M" e! ]$ l; J& c; d5 m! `
% \( e+ T+ |+ K+ B
4 \3 P& m/ `5 Z4 O* \: A
Next method as well as the following one are 2 examples from Stone's
/ j( ]9 S6 c# p% \9 w"stn-wid.zip" (www.cracking.net):
+ U x4 t0 n1 K- |7 e4 n8 F" [
5 B# v5 h3 U& T0 |/ t mov bx, cs
: e0 s6 d4 z" P' L lea dx, int41handler2" ]) ~+ `7 n/ k+ G( h$ E
xchg dx, es:[41h*4]
; V* S0 e1 K M9 w0 r3 b xchg bx, es:[41h*4+2]
' k: Z/ Z9 Q) |- i: `1 ~0 f mov ax,4fh
! o2 K: B3 C! t; k int 41h" r2 N0 ^8 ^1 \4 i9 L2 I
xchg dx, es:[41h*4]
8 Z- ]9 |) Q" U. d" @) Z M xchg bx, es:[41h*4+2]7 k& N5 O2 ]9 u. J
cmp ax, 0f386h% n: m$ N" T: J0 D& O) v
jz SoftICE_detected
* I7 d5 p( d U+ y$ \
7 i, a9 S& W$ ]/ c1 zint41handler2 PROC
; y5 y7 C, b9 [9 A$ l2 r* a iret
& z7 m. f* [* K) ~% G3 rint41handler2 ENDP
3 w, j" v9 N' u* w; f
8 D4 j& Z, b6 p5 m& |) V4 l0 M4 I
_________________________________________________________________________9 h& N$ G% y& _2 h
# U1 d8 D* B V0 U- h
. V% l* L0 _ z- vMethod 06
- N( ~4 q- U. `8 F=========
7 M/ U8 _5 O# U$ Y. j
' E0 N& i' D. Y0 m7 t" ?" n+ B! \) w C' p
2nd method similar to the preceding one but more difficult to detect:
7 v$ w( K7 Z% O6 a) H3 q" ?
: z" L* Y7 Q+ n2 U4 [& }' A
! W: ]0 G* K2 l6 n2 rint41handler PROC8 h7 @% d5 z. B3 s8 d
mov cl,al8 ]% V( v6 H; l0 j- q* k
iret
, N6 t( `4 d) Fint41handler ENDP8 L. i+ e H G; P0 X" u
1 T. s* |7 u6 s: F. |3 \
/ f8 m5 }( ?+ l, n* J xor ax,ax9 Z" V1 \! h* r9 q+ x3 d6 o2 V7 P
mov es,ax7 t% _1 E$ X) `/ x
mov bx, cs7 J1 \$ C/ V. q2 a8 P
lea dx, int41handler
7 J" s$ P _2 h" B4 s xchg dx, es:[41h*4]3 H/ k- p- G+ J! Q: _
xchg bx, es:[41h*4+2]
/ J- f+ `# B& G" I+ W7 E, Z0 D in al, 40h! O/ q6 N/ E6 S
xor cx,cx
- s3 v7 n5 g5 y8 W8 I. c6 H8 t int 41h5 R9 k$ l* w1 j5 F/ I4 N0 M
xchg dx, es:[41h*4]
1 J1 l7 V' [1 Y. Z xchg bx, es:[41h*4+2]
2 j N" n( p# s: S$ p cmp cl,al
5 L. ~$ T! O( L jnz SoftICE_detected# K; I1 J; T( y3 r' d: V9 r
- j1 C8 @7 m4 e9 C( Y
_________________________________________________________________________. L7 {2 u! N' o% x& {
5 P3 ?! w" n5 ?- B3 r- e0 ]) vMethod 07
2 W' Y _: G2 H1 U+ h Q=========6 g! q0 d* F: r/ q$ B9 E; `# V+ N
@# z y6 i% Z5 k, W5 k* P
Method of detection of the WinICE handler in the int68h (V86)
) T/ h- Z- _! Y* V t+ B/ ~. E! C2 I( @! c# ^
mov ah,43h1 u) r$ I* }! v& Y$ }+ v* G
int 68h
& T5 l: i9 c+ C! J' \! E% |; c; V2 U cmp ax,0F386h
% W" X3 i7 O6 T/ t& h jz SoftICE_Detected
& i/ v- b$ u4 g4 x
# B9 d" j& D7 d" o
5 n5 o8 P, J" ?: |5 ^6 W/ c8 C=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
1 n* U* P7 K: | app like this:* f$ j- `8 d2 c8 q! ~1 Q
* D3 O4 ?$ P8 P) [4 v. \+ y
BPX exec_int if ax==68
" Z) p1 J( E+ W6 f% i (function called is located at byte ptr [ebp+1Dh] and client eip is9 n& ]6 v+ i0 C; m
located at [ebp+48h] for 32Bit apps)
* ?+ |1 S5 \' v; P2 h__________________________________________________________________________
2 h1 A/ p i- W, N9 }6 x6 C9 |" e* w% d5 V3 F! B! Y
1 L) ~$ b l8 Y7 x0 B) ~Method 08
9 Z- h( U+ o- h, r4 k7 U$ p- `. v% [& K* O=========
5 M/ ]9 Y! @$ r2 S
6 m, D/ N! U2 W2 r" v: MIt is not a method of detection of SoftICE but a possibility to crash the6 b6 p U! D1 K8 ]
system by intercepting int 01h and int 03h and redirecting them to another+ c9 }& |% ^7 A6 `3 g& f. |( V
routine.
( _8 u2 d! C" o) v CIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 R) U5 T8 x9 o
to the new routine to execute (hangs computer...)
2 ]/ A0 ^) S0 m+ V* m0 u$ N0 d! o; } h! k) Y' G# Q5 R
mov ah, 25h1 _$ j* u) s3 g4 e2 a
mov al, Int_Number (01h or 03h), ]5 u4 g2 M s# E1 v
mov dx, offset New_Int_Routine
: e N. U9 j2 i* G9 x. V int 21h: Q' y3 t' _* a0 A8 M. B6 T6 Z" g5 Z
9 Q4 o/ A' `* I; j/ C__________________________________________________________________________
+ V- i3 d' V! d% m. H
1 E$ I" e5 o6 uMethod 09% b/ s5 q1 P- }+ a% g
=========6 Z$ F* C/ ^, ~3 J# b$ K# @7 g, o
7 ~. L# y/ T- @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 h- ~. o! ~' m# x1 S' {" V
performed in ring0 (VxD or a ring3 app using the VxdCall).2 v6 H- y) ^* A5 X6 K% G3 j" e
The Get_DDB service is used to determine whether or not a VxD is installed; J4 n) i3 m, D- s5 \5 h
for the specified device and returns a Device Description Block (in ecx) for K3 q8 v5 J( c: \ T. N. d
that device if it is installed.' n7 A9 S2 y1 ~8 V* |, q2 S! m
* A) Z6 c% c) L; m c* A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" k- `/ z. w: a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' i. Y& x! h: L: @( |' e7 X
VMMCall Get_DDB
/ U1 g$ C" o* G9 a0 ~8 j4 J6 E3 t mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& z& c( G( }9 t9 o
8 i# i/ H9 `" N4 A4 INote as well that you can easily detect this method with SoftICE:6 }4 b/ Y$ N7 g! c- N0 L
bpx Get_DDB if ax==0202 || ax==7a5fh
8 d5 j. V7 P1 n$ \$ l! v* n9 b. S! a: z" r1 r* C
__________________________________________________________________________. o: ^$ f5 `) P: B
5 N- b' \1 t5 @; p( wMethod 10
6 m& y$ X* H; ^ E% \=========" u0 l, T# }6 M) i+ M0 ^
# N/ V' b a2 j5 A9 o6 A9 e=>Disable or clear breakpoints before using this feature. DO NOT trace with$ } X- q! w: C$ f- P' F& y
SoftICE while the option is enable!!
5 i( {+ I# \+ o3 \
% P& Q- N; u- E2 L. jThis trick is very efficient:5 R! V/ }& b* j# i R4 S) _, }, f
by checking the Debug Registers, you can detect if SoftICE is loaded5 Y$ \; [5 v" j; M1 R' q! n9 E8 X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# ^' o, q* A# B3 cthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, H5 e$ y Q( {, j+ k) `& O7 yvalue (in ring0 only). Values can be manipulated and or changed as well
3 u" m3 Y' Z3 z1 T- K0 c! u(clearing BPMs for instance) k/ \$ N5 u# a1 W" m- \( a" {& ^
3 i5 T1 V! D! p__________________________________________________________________________8 ]) q1 U, i3 P/ r6 L u0 m
1 n2 u( O$ x4 _
Method 11& e+ N" F( O3 _7 t9 w2 E
=========- q) Y: H8 r/ o6 M* x- ]) S; u
/ C2 _. \$ v. G# W$ t: jThis method is most known as 'MeltICE' because it has been freely distributed. t6 O& @. l, W O6 Y9 Y1 i% t
via www.winfiles.com. However it was first used by NuMega people to allow
% c$ n! o8 ^" U& r; h% x% _Symbol Loader to check if SoftICE was active or not (the code is located0 R, Q2 E; B& Z) X
inside nmtrans.dll). X# ~% b: l1 S
5 W1 n# u8 x" O7 [- h& f' `8 J8 e
The way it works is very simple:# x- x W4 M: X6 B, U4 V
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. ?. `/ @ t8 N: R- E I1 @8 C" MWinNT) with the CreateFileA API.
# z7 f: B: k' J
. N! y" d) x) X4 UHere is a sample (checking for 'SICE'):
l1 S9 y/ \* D4 L$ h0 M
. T2 e% j6 p" ^( ?' b7 A pBOOL IsSoftIce95Loaded()
6 m# b+ Y9 ~. t; X0 J Y{
4 u, P3 K6 R9 q1 U HANDLE hFile; 6 _1 ~( w7 M8 M2 k2 Y$ A2 s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- H y* |, \8 H; ~1 D, _
FILE_SHARE_READ | FILE_SHARE_WRITE,
0 P; A$ j8 ^0 ]# W NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) i& _0 l; y! e5 U% I if( hFile != INVALID_HANDLE_VALUE )
0 V" O4 r7 \8 @; \8 G/ S: E) H4 j {
5 n: \# i( j* a& i9 C+ i% a CloseHandle(hFile);& X i# j/ g) e, H" d- J) A/ I
return TRUE;/ y& v$ `$ ^* x2 S7 ?6 {! m1 `9 S7 J
}" W2 X# U+ u J
return FALSE;
9 g$ O2 X6 o& I) u}
- b) h) G8 ^8 l0 y# H+ B+ f, S
5 k& O Y+ ~" U. I/ jAlthough this trick calls the CreateFileA function, don't even expect to be) l8 i" ~: m6 _( d w3 \
able to intercept it by installing a IFS hook: it will not work, no way!
# ]1 {1 d+ ]/ ~: zIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
& I, {" J8 \% ]8 w& zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- L1 {# E+ k3 n9 [5 E& b
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 J" B- A w! |# e( ^field.( w: i, p3 a7 ]7 J' v% G
In fact, its purpose is not to load/unload VxDs but only to send a
; z+ x( C+ S/ w; w9 _1 H! aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); c& e4 T1 D o- M( r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try: x7 }8 @) h! c% @9 r
to load/unload a non-dynamically loadable driver such as SoftICE ;-).+ H N" _) u7 ~: F" O P
If the VxD is loaded, it will always clear eax and the Carry flag to allow. _1 ?7 V& i' t
its handle to be opened and then, will be detected.- e. ?+ A g+ M
You can check that simply by hooking Winice.exe control proc entry point2 [) @( I$ A2 U5 P% N
while running MeltICE.- ] X, [" T O
4 s: f; O8 T& \; {) _4 Z2 _3 v
6 U% X2 N: O1 e; ^. J 00401067: push 00402025 ; \\.\SICE
8 ?' ^7 r8 E2 e! d" D* D! n/ { 0040106C: call CreateFileA
4 Q, D) k9 h7 x 00401071: cmp eax,-001
, K$ j0 K: }9 S 00401074: je 004010913 O3 u3 e1 ?4 r' m4 a) ^% [
* \! |- H5 Y$ Y, ]6 U+ f
5 S5 N. ]" ?4 b, [There could be hundreds of BPX you could use to detect this trick.
/ J, P* X: {! i-The most classical one is:
$ m3 |2 }/ W# L BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# x+ ^1 t0 _. N
*(esp->4+4)=='NTIC'
* W6 r' g1 I `+ o, x/ v0 n# c# n5 [, |) X4 V
-The most exotic ones (could be very slooooow :-(
( m! b, x0 ?' a- H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 {1 q! Z9 X6 [/ H# [ ;will break 3 times :-(' a: p |2 b* S% m, R
; U4 ^2 y p% R5 g9 J-or (a bit) faster: + i: V3 p7 ?& i, t+ T6 y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 Q4 X) L9 E' r6 j5 A n3 I" {7 r( z A& A
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; D( R* F( p- }% f
;will break 3 times :-( o8 ~' J9 m. P# q1 P$ e. [
- M7 Z, x; y6 d( {7 U/ Y! p; c-Much faster:4 n. I# j$ E$ T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ u( |8 x A. ]# c _7 B2 a6 R: e
# Z8 X/ J0 j# R8 Q2 KNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 `2 _3 u; M1 `5 \/ m! Wfunction to do the same job:
3 y3 d: q/ Q! @ X) G2 p) G5 L2 i/ p2 w( y, b
push 00 ; OF_READ' @# X6 i# N- S2 W# s
mov eax,[00656634] ; '\\.\SICE',06 X) e2 n p) t% d4 e# i
push eax
; ?; ?2 \3 A C% V call KERNEL32!_lopen
& H! [) d# N$ y- M9 L, @- `& l inc eax4 m8 r4 u+ u# O
jnz 00650589 ; detected5 S4 [3 `/ B, L" ^" [
push 00 ; OF_READ
2 }7 r9 C0 Q; _3 o) _( G mov eax,[00656638] ; '\\.\SICE'6 b2 z$ ^6 S( L: z2 h! P
push eax
6 u1 y; K' a1 O. W- Y% U call KERNEL32!_lopen; j" J0 n' z. h+ U( r" t
inc eax+ b/ G( q% r: s9 P
jz 006505ae ; not detected& T% A) I6 b- q1 N
! r& S) C* ^7 t# V( y* t8 Z" T; a
3 C( {0 \5 u$ v9 R1 R7 @$ |__________________________________________________________________________: u P0 ~9 P0 }( w- ~/ h
- V& l: b: N6 {# J0 x0 p2 IMethod 12" K8 P) {( b$ a# u- G; D& v$ h8 @
=========
8 v2 q: ^5 R$ ?) M$ ~2 b: m; ?8 @. o6 W* Q
This trick is similar to int41h/4fh Debugger installation check (code 05
* A+ h. w$ g+ I& 06) but very limited because it's only available for Win95/98 (not NT)6 R$ K/ `+ ^( P
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 g& k7 d, [: p6 a U7 j
4 h; X$ @; Z2 V push 0000004fh ; function 4fh% Y* K9 t1 i( s2 ^: `, n
push 002a002ah ; high word specifies which VxD (VWIN32)
3 o) b2 N6 M3 y6 L" \: o6 B+ \ ; low word specifies which service9 e/ w8 N0 e3 \- {
(VWIN32_Int41Dispatch)
* x7 |2 o; f- N) x3 c9 n call Kernel32!ORD_001 ; VxdCall& X- {8 m5 n3 m; Q3 R/ |
cmp ax, 0f386h ; magic number returned by system debuggers
5 m' ?1 @% |5 Z/ X/ Q: D jz SoftICE_detected
, G p& B: i' q- c# J c+ |- E5 y8 w# M; S6 r/ }
Here again, several ways to detect it:
- a g$ f ~) y. R. ^$ S4 W @0 ?' P y; O, C" ~8 f6 M5 r
BPINT 41 if ax==4f
3 K# f8 k" j T- Z/ f& F0 E( Y( T) a) e: q2 R
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 u1 y% i/ ~5 X0 S- Q1 J
* }; t ?8 [- ]' o$ i( \9 K/ @ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- R1 X0 k8 [/ \1 O* M5 i7 S3 |) v7 ?( S9 M0 J | T
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: Q. Q9 ]1 Z) Y( B6 p
- f; ?3 U* n/ U# `( b [__________________________________________________________________________/ ~. B5 t; [9 V; _& y( y
' ` b3 Q; G5 ?0 C2 {4 E/ PMethod 13( A! K: _" M; e. v2 N) Q
=========
! L+ Z \, q9 N) Y1 e8 b* u7 V' {! J8 U& V* c
Not a real method of detection, but a good way to know if SoftICE is; t& l) ?. x) l; d0 _: p
installed on a computer and to locate its installation directory.
B) U& V z% H* @0 ~0 `% D4 g) SIt is used by few softs which access the following registry keys (usually #2) :
3 m7 o9 ?) f% S, `/ }' V7 x6 Y7 j# K q( E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 v, H7 I# z; y C3 ?, ]( a\Uninstall\SoftICE- S5 b/ Y2 W( H" C6 o$ D8 ~
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 d1 x/ O: Z5 G+ z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 G4 Q& K' c. }1 Y# `4 f1 b
\App Paths\Loader32.Exe
: s) K. y& U1 R* V
6 G* V3 \% u1 R* N9 `2 t- l! ~4 b6 n: K6 T- W/ a5 C n
Note that some nasty apps could then erase all files from SoftICE directory: N: [/ A P3 F. r6 b) s% I) R
(I faced that once :-(: ~. ] g5 H. n* J
& z5 v6 m2 x+ d4 X- bUseful breakpoint to detect it:, N4 Y" a0 W( k0 D
# F) `2 [1 E3 k0 \
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" J" l2 i1 C# a& v
# `: c' ]% t1 s- q1 `( O
__________________________________________________________________________
$ Z* U4 |# @. w( P6 o8 [. @
7 v7 h0 ~" |+ [4 x: a9 G
/ v3 [7 l5 ~$ u" u, Y+ r, rMethod 14
- Y. u! c5 q$ t- h1 M6 |+ G=========6 V4 k) _% I: V; l/ t6 j- R; X# B
6 D+ S: q( u0 k; V& P
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 \+ b& D4 j2 C# ?* J
is to determines whether a debugger is running on your system (ring0 only).
! c' q8 Y3 c' H: N' E
, F3 O2 D( K; d& i! a6 K- w VMMCall Test_Debug_Installed6 F A' q9 p8 G% b' @, @
je not_installed
) M- R1 ]6 D. R3 L( N g
( H$ h3 V& u7 N( M% e$ f9 f ?This service just checks a flag.9 _! z: ~' d H& f* c9 u" D
</PRE></TD></TR></TBODY></TABLE> |