<TABLE width=500>
) D; B/ C; m. S; X- e<TBODY>
; j. O8 _% n9 }<TR>: }' B! A/ }- i( _3 h6 R4 y
<TD><PRE>Method 01
6 r ?% ^8 X3 K=========
2 Y1 [+ g" C* [. j# C
& K# I6 ^$ ]- V/ V" jThis method of detection of SoftICE (as well as the following one) is( G2 k+ I, f9 M) N) V" I* D7 n" J
used by the majority of packers/encryptors found on Internet.
' E% a% ?) n3 W2 t- n: Y: uIt seeks the signature of BoundsChecker in SoftICE J# |( L. ?0 d3 O; ?% q6 U
- O1 b/ m2 y% S- @ mov ebp, 04243484Bh ; 'BCHK'' s1 Y: F' c2 F) z" J5 j" c
mov ax, 04h
2 T# m, R# u. s- x( h* e7 W; q2 K int 3 & ?$ A+ c' A: {% U% N
cmp al,4* W% p% z( h( B+ m
jnz SoftICE_Detected: R6 g+ i0 V$ o- n9 x0 L" R
' ?: [8 `! Z- d1 {# v5 c___________________________________________________________________________
* z! V x4 C& j- r$ P* b. u( v" B7 s$ Y! u$ ^ D; k
Method 02
+ Q8 Y; n4 o9 `=========) g, a" e# {, v
6 d" {3 G# R4 b% v$ \6 E
Still a method very much used (perhaps the most frequent one). It is used% `" i6 ~3 G1 ^6 R4 e8 D
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 S) b& P: D+ H$ P, B5 o* ]8 T4 _
or execute SoftICE commands...
! [( r5 F! W$ C$ aIt is also used to crash SoftICE and to force it to execute any commands
- v. c8 {9 }) ~2 ]% q(HBOOT...) :-(( ' G$ _; f' P) A* c' K7 `, b
6 w$ V( _8 Q p3 y$ |# N: l8 _/ kHere is a quick description:
! _+ f+ q& T! }! V; G" E. W1 u-AX = 0910h (Display string in SIce windows)! }3 n1 I- u. b' J
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! h$ J/ o* P. Y, A- o; c+ x-AX = 0912h (Get breakpoint infos)
; v& I' J7 H7 ]6 L6 c-AX = 0913h (Set Sice breakpoints)
6 G9 s' z/ }& c3 V6 m-AX = 0914h (Remove SIce breakoints)+ ]9 r! e! {" m
% S3 r& S/ ?5 [. O0 i1 w) D9 BEach time you'll meet this trick, you'll see:
" H; A# G2 J" M. o7 O1 F-SI = 4647h
& W8 t/ n4 W# {9 a( d-DI = 4A4Dh5 Z% ~) C0 H' i
Which are the 'magic values' used by SoftIce.6 r! a) E1 K7 @' l$ t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, M) K4 o( Q5 M( P
1 A. F# O) }6 H8 oHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 Y3 f' j3 c- m) x( f( `Envelope utility use to protect DOS applications:
) H# m! W% o% a, A# W/ j9 Y8 W/ {2 ?# z8 b( `% X/ I
5 F9 d$ V& b- V4C19:0095 MOV AX,0911 ; execute command.: _ |% d7 I0 c
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
- M8 {6 G# @9 F% W" w+ A- t, |4C19:009A MOV SI,4647 ; 1st magic value.8 S g/ L4 T: n5 s4 t
4C19:009D MOV DI,4A4D ; 2nd magic value.) h4 Q1 i7 ]0 w" T6 p5 y: p# \3 p
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- t+ G' [- ^- L4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 W/ s' I# r/ }3 t% `& ]7 E5 m: s/ s
4C19:00A4 INC CX
* N: y/ \, L" `4 a# K4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 k f% C! U+ E* ?% P
4C19:00A8 JB 0095 ; 6 different commands.
) r! y' [+ `. ~' W( i% g4C19:00AA JMP 0002 ; Bad_Guy jmp back.: [2 B2 }* k" q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ y4 Y$ W: n* P `; o
l. e8 \ A9 ?8 q
The program will execute 6 different SIce commands located at ds:dx, which
" p/ b! ^$ B$ i0 W1 e0 Y7 Xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( ]6 l% g; l% L0 p+ e4 D
0 T I- R) c) C( q7 H2 k8 T, C* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 I0 J' T: r; {2 d" l___________________________________________________________________________
( t/ T) D: w5 r4 v7 H
$ l0 L$ q0 c" B2 f U! Y3 I
# v. k1 o7 v+ WMethod 03
# J2 \4 c8 i4 }+ ~; l% _========= e8 |; r# `7 R- J) ^) G
3 u' i9 w' ?7 J, }9 J
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 V" j- E; O4 x# c, c0 _
(API Get entry point)
4 L. }5 E/ z) y& C! P# X: ` & V# B# J! H# i
& U; L! m8 t: I* a7 F0 I
xor di,di- Q v! X2 [2 ]6 j
mov es,di, t$ Q: \7 ~. u0 v
mov ax, 1684h
c5 Q: _" B) ]6 C5 Y: `( o% f mov bx, 0202h ; VxD ID of winice
3 |. v$ ~! e6 o- f% f int 2Fh
0 {% `: c) S8 P* z2 f% F! H mov ax, es ; ES:DI -> VxD API entry point
* b. I G6 y) U) X, y add ax, di9 r' f$ a) [% V+ a3 O: l4 O3 b
test ax,ax
+ |, D; l5 F4 u' r1 L$ V8 w jnz SoftICE_Detected1 H, c, p4 \+ z! S/ Q
3 A1 T' g% r- L) n& A, \% z, O___________________________________________________________________________1 a* S; w- g6 f$ V
0 Q# `0 R2 j' _: ~& I6 D& h/ x4 H4 |1 }Method 04* b! e. f* {: E, |% o
=========$ w/ _5 W, {( S
r6 e& O" D' m9 L4 ~) t( k, qMethod identical to the preceding one except that it seeks the ID of SoftICE
; d9 R. X9 M5 L; I1 wGFX VxD./ i3 t: e: G$ ~
6 u; ~$ h% X) s. w2 U
xor di,di; m/ H+ U7 U, a
mov es,di
8 `& r2 Z3 V& T mov ax, 1684h
' E {# M6 d% n$ {5 T5 q8 e mov bx, 7a5Fh ; VxD ID of SIWVID
" J: `2 X& ^4 [ int 2fh) s4 X0 ^' y" i$ E, L% j+ J& h
mov ax, es ; ES:DI -> VxD API entry point( S6 M& Q# P- K* m6 J8 E- M
add ax, di
. ^; G* K( e+ \ test ax,ax
% j9 ?4 F" K3 U1 p5 i$ q2 `# l5 z jnz SoftICE_Detected
9 P1 M9 a( e7 A% s* M& W8 d9 K, h; J% ]8 C5 |* J! K
__________________________________________________________________________% `+ F1 g9 p# G g
) y! r7 q# l) w) o
4 X6 k i0 L! h( Z8 k3 LMethod 055 N2 T- z" I7 Z* A
=========
0 H& q) d2 b8 C* d6 Q4 w* P% T k& R% r" X8 F- ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system
; V, m- P# }+ j# [ [! X# }% [' sdebugger. It calls the int 41h, function 4Fh.
& l+ C7 w. x/ e, M2 YThere are several alternatives. ' D. Z/ d* p: W" h
0 {8 b/ ~# p' a
The following one is the simplest:
* @" B' Q' j- j# W$ I8 q
2 o- b* W* \$ C$ D4 N) o mov ax,4fh+ t* h: v% l# s& V4 M, P `
int 41h9 P# h$ M1 S4 H; T
cmp ax, 0F386
1 v8 I4 E4 @. g jz SoftICE_detected
% r. f R, c6 y4 z$ S
# | p' J [( [* ~( h
3 @/ p' W; x& s7 c" h( E" NNext method as well as the following one are 2 examples from Stone's / @: y+ L& V! W
"stn-wid.zip" (www.cracking.net):0 g% I$ ~$ R5 T4 v/ i% {( W' n
9 N- g- v) p7 x& ?& \
mov bx, cs6 }6 `# k: L$ u* D9 |
lea dx, int41handler2+ R, q1 b( J) C2 j
xchg dx, es:[41h*4], J% q6 \6 z" e% j
xchg bx, es:[41h*4+2]
0 \& h3 ~; d m* M1 W8 I mov ax,4fh. R7 z* j$ c. ~* V2 y
int 41h
3 q+ c5 b7 u2 ^+ ?% d xchg dx, es:[41h*4]- v1 K) K8 [; { O; _
xchg bx, es:[41h*4+2]
9 C1 [$ {9 ~/ z: x5 j cmp ax, 0f386h
2 n# o' Z+ Z4 f0 u$ Y$ q jz SoftICE_detected
# K5 g6 g7 ]# ~" y( M6 L/ f0 H: G0 l$ d% y8 ^6 Q+ F1 ?6 ^8 j
int41handler2 PROC2 [' U: W! B1 c/ c7 C2 b, D
iret
% W+ [& D B) o: X3 m' tint41handler2 ENDP
/ [5 f# s$ y* Y. c1 r
+ N9 d8 ~) P3 e8 Q+ f; X, r9 ]( i2 w: B' h7 Q( y8 V4 {; W3 ?
_________________________________________________________________________! d; p! P' Y, b4 a
5 F/ ?8 \4 V( C$ y2 p
; F4 e q' y$ E8 ^/ `! EMethod 061 ]# P5 Y" { _3 s1 r% A4 C v" ]
=========( q; L; j" ]$ \! r7 F+ I6 O
7 X9 X$ P, g3 R+ s5 Y+ ?1 b9 s" g8 z2 v4 p$ I* P( y
2nd method similar to the preceding one but more difficult to detect:
3 W1 H/ e( u; m+ {) ~) k8 @- z. T- S" {7 _9 _9 ]
8 ?$ O7 s& o( X" u# u1 C
int41handler PROC
/ r, d8 a* z, `. @ mov cl,al
, z/ }6 [' G- Y# a7 o2 j iret
( y+ q/ w. t9 ~5 L# r4 @. vint41handler ENDP+ }) G; e5 Z( p
a1 ^- t K% O# V7 R
% O) ?, a. y4 j$ X4 v3 V, n xor ax,ax6 O8 L# T5 o/ f, O4 R3 j V
mov es,ax
) M U6 Y: H1 F( P0 E. c: A1 x mov bx, cs
( S* O1 z+ j3 G" _7 ^ lea dx, int41handler" O9 G4 l1 g* |( l0 T% X9 K# ]6 {
xchg dx, es:[41h*4]5 g- h7 c+ g% F0 v
xchg bx, es:[41h*4+2]' S/ r7 r+ Z- M5 c
in al, 40h* n, N, J) e+ @0 [4 b
xor cx,cx9 y: w$ _ R' G3 W6 C ?$ |
int 41h
! u$ h9 V7 y: G2 Y0 a6 V6 v xchg dx, es:[41h*4]% H- `3 D: ^* G6 Z5 ~7 y5 c
xchg bx, es:[41h*4+2]4 l. B) F4 r) t, U$ G" m8 l( w
cmp cl,al
$ N' Z5 y# |& `( G4 p( C$ R" p6 c jnz SoftICE_detected4 s3 m+ d5 V! [. N+ ^% H( q6 d: `
! U# i i. v2 F! A( B" i; {6 O5 s
_________________________________________________________________________
0 |5 c( R9 \0 D+ Z4 p3 s3 |$ a3 [0 ^1 O& F, Y6 M' i8 N1 T' [
Method 07
# ]% v9 \/ u S2 a! y$ G# H/ x2 W0 b=========
5 V7 d' f% q+ b. A6 v, b+ ~: U( m4 F% `* |4 G
Method of detection of the WinICE handler in the int68h (V86)
& ?! E: Q3 i4 F: S, v! D. O
# O* E, N X: h" I! `, V; l0 U mov ah,43h
- d. L9 |& S* \+ I! g: i int 68h
1 B$ X6 F6 T, @! A) \$ c cmp ax,0F386h
G1 t) l6 ~1 P$ B3 T% J7 u jz SoftICE_Detected5 c( `" |3 k9 h" X% n6 r
' c: k$ {' G, b( e5 E8 e# a1 c+ N! S: W; i, W. V" E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit `% I d. Y6 ]" h
app like this:
$ {; K8 P3 H7 a* R
) I" n- R X$ d3 J; J8 O1 d% W! L" ~ BPX exec_int if ax==686 O; V. F- P2 V( m' r0 K1 v: V
(function called is located at byte ptr [ebp+1Dh] and client eip is+ M5 F$ G& ?, u; Z" D
located at [ebp+48h] for 32Bit apps)$ t* K- S: y+ V+ S, V! x3 p
__________________________________________________________________________
5 J% C7 f0 k! w. E) M. y6 o* C4 V' y4 k3 L
% ~8 p( q: L: g! E9 {4 c$ t* q
Method 08
' ~6 X9 k# Y( h6 ~=========
0 _3 ^6 V( P" y; F3 }
$ C! z" C* k8 V' Y. |8 V. M. L! sIt is not a method of detection of SoftICE but a possibility to crash the. C1 R, S" R6 d: _2 J. J/ @- }
system by intercepting int 01h and int 03h and redirecting them to another
[& x2 J2 V+ r7 Q% sroutine.0 d9 d# u" N% L, i/ y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- G) U) d" H ?& V8 k! uto the new routine to execute (hangs computer...)0 Q% a- T1 f: \. `1 {5 N
2 o% b* w3 O' j" q; g! p, s0 E5 B
mov ah, 25h
( S0 q7 J3 L2 B: W* \: n9 _ mov al, Int_Number (01h or 03h)
3 b% k5 }; J" I7 l: g$ H mov dx, offset New_Int_Routine" F4 E. i, A: [ J( _3 i0 i
int 21h, ~3 L3 @6 v2 Q4 w& S( N \2 M
1 E3 N# ]5 U% n8 `; U _% T8 D" D' B$ `__________________________________________________________________________. _2 k" @4 \( ~# y8 Q& @) {. g
8 E, R) {3 ]7 _1 X# }
Method 09
, @! d) B. N0 ?4 B1 o=========
8 T9 ]4 t; D+ k$ {( n, g l/ w6 \! M) m) w6 E3 D. S& R7 x e& }
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ c+ b2 y4 w9 Y" m5 p1 D, N4 B
performed in ring0 (VxD or a ring3 app using the VxdCall).7 t) m" C# Y- ]# v
The Get_DDB service is used to determine whether or not a VxD is installed3 ?% l) z, z: @* o) e4 C* J1 ?
for the specified device and returns a Device Description Block (in ecx) for
4 U0 V) S/ s& _+ |% athat device if it is installed.( j; @- r- Q2 Q$ ~" V
$ i7 O' Q: F, N4 n( @
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* Z5 B8 @3 u9 ~% }+ ~ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 Q' N0 U) J0 ` VMMCall Get_DDB$ Y* }1 H- W4 c
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! X( G0 u. w; s
, v2 f d% T; x/ ]Note as well that you can easily detect this method with SoftICE:* d6 ]0 p5 \$ R f7 M/ C
bpx Get_DDB if ax==0202 || ax==7a5fh
5 h( L9 n& o4 [0 Q; v/ _/ S, p/ p; |. k* f5 L4 R- W% z$ S
__________________________________________________________________________) y( n, U; M9 B% O' s
' g( E n' N7 [2 V3 b3 F+ gMethod 10
+ c7 [* E9 R. A& ` Z3 i3 v) @=========0 e) ]1 z. i! N. D: q4 W3 }
, ~% z+ j7 E" m4 @7 l% u
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ V5 r/ v; [! W+ u
SoftICE while the option is enable!!
5 L+ v/ B4 o: R
# d$ W9 [9 V9 _& c+ SThis trick is very efficient:2 W8 P! Z. N. |
by checking the Debug Registers, you can detect if SoftICE is loaded, ]3 A3 f M( X' R3 F) ?
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: I- z, y1 V# `" Lthere are some memory breakpoints set (dr0 to dr3) simply by reading their
# I" d- h$ o3 y# Yvalue (in ring0 only). Values can be manipulated and or changed as well
+ b6 L2 f+ l. o' x2 ?(clearing BPMs for instance). Y' o3 j$ I8 w' e: O$ D
1 W, F4 o" k+ s. A/ `__________________________________________________________________________! R- Z1 X* |+ L" R* p; H' L
k3 M0 d" k# Q1 L: _
Method 114 N& w/ n" z( I
=========
: u! X4 W, H9 m2 T) J5 u
b5 g9 U( j6 G1 pThis method is most known as 'MeltICE' because it has been freely distributed
# ?3 O1 f: Q0 n6 W3 Hvia www.winfiles.com. However it was first used by NuMega people to allow
{5 G! {1 Y0 eSymbol Loader to check if SoftICE was active or not (the code is located
3 p- e! _9 o5 M; r4 n) E9 }inside nmtrans.dll).: f3 t3 {& C4 j; z8 C+ e1 V$ [
0 y# R0 z! {* {' j; N$ vThe way it works is very simple:* ^' C! w+ y1 m7 D. f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for+ ~. R( P @8 q, W
WinNT) with the CreateFileA API.
! H/ w i! l' y1 p6 o( V/ Z* s; \) X4 p; n" p1 G: v9 T
Here is a sample (checking for 'SICE'):
7 |" A" t, v$ H- s# S' v) f I; K' e8 c+ Y2 w, b X
BOOL IsSoftIce95Loaded()! P5 b# \% R1 q/ r4 v3 j
{
# ~7 n+ O% V8 v; w2 `0 z* T HANDLE hFile; / L! f! t7 D7 G: p- t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& p! v; H- }* i7 | FILE_SHARE_READ | FILE_SHARE_WRITE,
. D6 ?5 i, H2 O NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' q! G* F5 B% W% {3 r if( hFile != INVALID_HANDLE_VALUE )+ a3 e2 j+ v" `1 Z) b& I
{2 P1 ]: z2 h* C
CloseHandle(hFile); [. S/ I% ^! h" o. k3 b
return TRUE;
- B( G$ x7 l, i. y# @ }
& j2 B3 C3 S* K return FALSE;
# }/ ?( L* P2 p}
2 ^* X4 K0 e( u4 X1 s; H# |, e5 h8 X& o8 Z- g9 P
Although this trick calls the CreateFileA function, don't even expect to be
& Q7 i+ N+ k: N2 l' c* oable to intercept it by installing a IFS hook: it will not work, no way!
, g8 o+ R1 M; w8 f' rIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 o6 v I! s8 w' [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' E' T) f. L8 H2 V+ J* A# Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: F' L9 K5 g2 k# `field.4 t$ Q8 H4 A' ~6 y: z( ~
In fact, its purpose is not to load/unload VxDs but only to send a
5 h" m& w( o& @* JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) N R5 B: |+ I T& z- y$ a, Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try( U; _. D b, b% a. | q/ [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 H2 T* `6 w/ A" aIf the VxD is loaded, it will always clear eax and the Carry flag to allow2 [' T* w) y5 E$ Z, t5 }& J
its handle to be opened and then, will be detected.8 \% [% L$ P" c; M: d8 b
You can check that simply by hooking Winice.exe control proc entry point
8 x3 e$ R& Q7 y% @1 J" L8 r( Hwhile running MeltICE.
0 B, N6 X. i: I
5 K$ i" S+ N: t$ m' e8 ^ q% H3 t1 i) \4 @# [% G5 r! Z
00401067: push 00402025 ; \\.\SICE
& m5 W' z& W/ |* a( u 0040106C: call CreateFileA
L2 h. Y1 {3 c& c6 R 00401071: cmp eax,-001
' s0 y+ r# g' k$ _* E# b9 f8 U 00401074: je 00401091, ` ^/ U& b: Y" H% P, Y9 A
1 E* T- y! _' T% L4 }; M* u8 M
$ \. b- Z: e% nThere could be hundreds of BPX you could use to detect this trick.
- o/ Z4 V1 W2 J3 T2 U- u-The most classical one is:* N. l. w% t- V: h) d1 U; h! F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
" U: f' Z0 s0 l4 @7 t0 t *(esp->4+4)=='NTIC'9 A+ ^: m9 Q1 n7 w. {' s
3 d- {+ V4 [$ K-The most exotic ones (could be very slooooow :-(
' c+ ^6 |% j; p4 x5 E BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') b9 ]* H: ^6 m
;will break 3 times :-(6 ]2 E+ c% v& b8 c0 h& B4 ~
6 i5 B& u8 @4 _/ D-or (a bit) faster:
& @3 I8 K! |! g, e9 ]3 u BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* M8 V6 F+ N" O, m( m. Q' {
. L) w5 C6 ^. G7 @, R1 c
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
' u& r. |! Z/ f( E4 O" p2 B ;will break 3 times :-() Z0 {; k! g* h5 d+ ?/ I; }5 V2 ]& E0 z
5 d1 B3 j r3 Y' @
-Much faster:
. f5 x/ y$ w" g$ W3 x- s BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 x) F. x$ d6 ?; {. l% q
/ I; n7 F7 m# M+ H2 z5 a% gNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# s6 |0 b% i! d2 v- d: E
function to do the same job:
8 h ]% W! p* g1 i( R( u
7 ?% X2 r$ G! [1 Q8 b) E( z' W" Q. ` push 00 ; OF_READ) Y ?" {9 r2 f' u/ x4 z
mov eax,[00656634] ; '\\.\SICE',0
5 N$ \. i4 f' ~) I push eax2 |+ N- a3 C2 V( o& d; j
call KERNEL32!_lopen
0 Y' _) i! x/ O& @5 t4 S+ Z inc eax% E% p/ }/ [8 K/ Q9 |: B+ v, M
jnz 00650589 ; detected$ e# C& C9 N# ~: R
push 00 ; OF_READ& f M. E% C6 A# {
mov eax,[00656638] ; '\\.\SICE'
$ @, R, Y Q$ U, _ push eax
! Z9 {3 i1 }. n1 X/ t' @. Q call KERNEL32!_lopen
4 @/ x/ u- S7 H& b( p2 o6 O inc eax
5 ^2 d! A" F* {3 ~/ ? jz 006505ae ; not detected* ^% p, h1 v# }: r* o I
}4 s G- k% |
: C# P. w* s3 C6 T( o__________________________________________________________________________8 W" M8 i! }% {3 u7 E6 x
. S# x5 B' ^) A" r
Method 123 o/ p/ Z' m7 m l
=========/ _) y8 d: `# n' Z
: p v3 ^/ v; v) h/ S: O& l0 I+ w nThis trick is similar to int41h/4fh Debugger installation check (code 05+ d5 {* F' Z7 I6 g6 T
& 06) but very limited because it's only available for Win95/98 (not NT)8 I* [# ]% s: d" ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* y3 ?) B/ a% X% K6 B6 e
. _& N1 f$ {* o! F push 0000004fh ; function 4fh
: g6 Z" r$ m) g; |( m$ u% p/ @ push 002a002ah ; high word specifies which VxD (VWIN32)! E4 w5 y/ L' x8 d9 p
; low word specifies which service
# j2 }) s! [( o- p* a) _" L (VWIN32_Int41Dispatch)) X- @( N, V5 y2 l. M
call Kernel32!ORD_001 ; VxdCall. D9 ?7 L4 U/ D7 H" W6 V9 w% g( u' [5 ?
cmp ax, 0f386h ; magic number returned by system debuggers: |" F2 ?/ y1 B$ J0 k q$ f
jz SoftICE_detected
+ N& y9 A9 e- R: z( X& t0 @" S, Z( B/ X: @
Here again, several ways to detect it:, i* q; X: M+ [, A
+ d' ?8 b; }% P% c4 H, ] BPINT 41 if ax==4f1 J" m$ ^# y% e6 y7 {$ I D9 F8 N
! K+ J3 i; w) _1 O3 M3 ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 Y. d- f# ?( W7 O7 _
7 w& }0 U8 q8 I8 Q- {! ^9 h1 `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ |6 Y& U1 K7 ^, ^4 b3 C/ u* r
$ F, Q: }2 @4 H; Q BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; W, {; [) `% z! n1 b& i: X8 b2 ^9 L+ a4 t
__________________________________________________________________________
! b" c. s9 u- M. O# t2 k7 f; l
; G/ @: G1 y/ Y4 }1 r& Q% t( N3 Q6 f1 oMethod 13
! W$ m% N/ z# |" [' l5 q4 ]% l% |=========5 J, [' c# _$ K2 }4 v
0 V8 {$ U* L9 c# u& a* P5 kNot a real method of detection, but a good way to know if SoftICE is% P. m' b1 e2 m- r5 ?
installed on a computer and to locate its installation directory.
: J% y+ }/ k5 a' ^/ J Q5 P* \It is used by few softs which access the following registry keys (usually #2) :( ]0 ~& X& J5 O6 b M7 K
) ^! {2 c f9 W4 D6 v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 R; ?- |# [- m8 p+ X\Uninstall\SoftICE# J4 P$ v9 N& }- Q8 ~& Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 S! ~2 L7 Q! n+ ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 ^7 m) k: g) h( c9 \4 n
\App Paths\Loader32.Exe
4 Z# r4 ^0 Y8 x5 \2 y. B
! e) P; ? J8 L6 C5 d2 D: |. g4 `- p$ c" D2 N( h i
Note that some nasty apps could then erase all files from SoftICE directory8 q2 m- ^: N. c* K& h
(I faced that once :-(
0 j! b0 F1 i* `' w7 ]0 J. Y8 G1 L' k2 O8 v$ O) P7 N2 O
Useful breakpoint to detect it: g) v1 i9 d% [+ l
1 c8 `8 J0 D& l7 B. d5 b" P
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; K$ G' |) r; U' U& }) G
+ {7 ]5 F3 p- x. P$ ~__________________________________________________________________________
- h) f2 \+ s/ D4 P _, U# E E! ?3 P7 ?% a0 m i; Q
( h, h8 ^1 |' _! j* b1 h
Method 14
- d+ m) P/ \% ?' X% M+ u' |5 \=========. A' [/ M O: K
; C' x" ^ ] y! Y% r7 ~+ EA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 U! L8 ~: T" T+ j' ?# r1 K: T( y
is to determines whether a debugger is running on your system (ring0 only).- s) ]$ g. i+ ^/ h, s& d% z% u
0 B/ K' ]+ s# j
VMMCall Test_Debug_Installed
4 T; Q& Y `( W; N) L6 | je not_installed% A, T( P; K& u" W% f, K; N T/ F# I
1 v. Y* }# ?; d* g( s4 fThis service just checks a flag.* {/ r. B+ V5 Y* V/ Z3 k; F& B
</PRE></TD></TR></TBODY></TABLE> |