<TABLE width=500>
* w$ Q! Z: I* |<TBODY>1 v3 s) O: D, m# E
<TR># m `! T+ m) n0 |4 d
<TD><PRE>Method 01 $ n2 ~/ Z% y Z4 T/ U# U' G# ^& h
=========; ]& v8 N+ o# g0 }9 ^; k4 x* |
2 H5 }. e. r7 R% R- AThis method of detection of SoftICE (as well as the following one) is5 L" y" v/ Z& ?8 |+ h! b" B Z$ v
used by the majority of packers/encryptors found on Internet.
8 w- n% W! E- z+ L% l: PIt seeks the signature of BoundsChecker in SoftICE
1 s! w0 j; ^3 `! |5 U4 i+ P: u# p: n4 C$ u* Z4 f- [% [+ ?
mov ebp, 04243484Bh ; 'BCHK', X6 _% p; _0 t8 i0 O5 C% C2 i8 X
mov ax, 04h
' |5 D. n% @2 U) @ int 3 " N; b$ E8 S! i
cmp al,4
& N; X2 ?5 C) t3 ^. q jnz SoftICE_Detected2 C& f/ z8 U: c, H1 X/ ^
# o. E% U' X. W7 R0 t- d) j___________________________________________________________________________* Q: N! ]' N* G
9 `; C }4 ?$ F9 i# a' T' TMethod 02
# E6 ?7 `% H4 M( b4 Z7 {# u% _1 F=========. i( c! h" K) C# z6 p) @7 Q& z
- _ D4 |* i; B2 j! i
Still a method very much used (perhaps the most frequent one). It is used
; O* J. }3 a7 I# E: k: t/ @) z* Kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,# }1 Q& I% H) v
or execute SoftICE commands...' J4 B* v+ k1 k; ~" M2 l
It is also used to crash SoftICE and to force it to execute any commands
* E7 F! t$ R0 H* G2 h(HBOOT...) :-((
5 V9 u' Z+ s" c
" N+ L/ I& \3 }6 g& Z2 b6 X* r( WHere is a quick description:
4 A& a, ~) S% ]9 u6 M5 H-AX = 0910h (Display string in SIce windows)
6 D5 X0 K+ E+ q2 Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' F! F! o0 M0 ^ a2 Y3 N6 w) @-AX = 0912h (Get breakpoint infos)+ W6 H& V- m5 ~8 W: ~, j- N! c; n
-AX = 0913h (Set Sice breakpoints)
$ _- S1 i4 O& ]4 j; D2 H' O-AX = 0914h (Remove SIce breakoints); s' |, X8 y3 c# s
3 a/ O1 G# I. i+ R2 Q- f: HEach time you'll meet this trick, you'll see:
+ z3 h( h+ C& i-SI = 4647h
4 k D3 I( Y0 B) M-DI = 4A4Dh+ Z8 V' x+ a6 i6 q% n5 t& o
Which are the 'magic values' used by SoftIce.
3 p) Q. a) ~/ j- v" g4 y! e4 w& fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& J9 l( f. M8 }4 o) Y; C s9 H u4 r$ _
Here is one example from the file "Haspinst.exe" which is the dongle HASP% _; L4 w6 R2 N& w; r( p
Envelope utility use to protect DOS applications:% ?# l, w& v! L8 @' E9 G8 j
0 C; Q. Z% |9 R0 Z" ^
2 @+ ^$ g7 m5 F# w4C19:0095 MOV AX,0911 ; execute command.4 e; R( B7 H/ u4 I# u2 ^
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 T" H5 G, U# _1 R) @7 }4C19:009A MOV SI,4647 ; 1st magic value.
% s4 j6 z, G' U) f1 }* D: }4C19:009D MOV DI,4A4D ; 2nd magic value.
8 s8 K* z( e9 K. e5 P4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
) i/ d: `! N' k$ o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 r4 a9 E. W! r; S9 y! M% c
4C19:00A4 INC CX1 ? E9 z" I; M1 K3 r; \
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% M9 k% L$ J2 C% t$ `
4C19:00A8 JB 0095 ; 6 different commands.
4 I, e$ g4 q5 n1 Q4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, |* w) h$ O/ V4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, J5 v& f6 k' M4 h+ w& P) X/ x3 S: w$ V# M. K$ t
The program will execute 6 different SIce commands located at ds:dx, which
- C. o$ h7 k" N6 S6 hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# `8 C' w8 b8 R ~% N5 q; P9 z R+ B6 o
6 T! z9 b4 ?; ?( h
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; q2 H, C, H+ k, p$ V" \
___________________________________________________________________________1 h0 }( E' K# b. B( R# e
9 }: B! N8 l$ u, @7 P1 W" V
0 S! ]" ~1 u' TMethod 03
3 q- x- x! p. Y5 J5 T6 h=========5 @ C5 d+ `' z8 v) E
9 }! a/ \, _% _1 H# t, y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% L$ z- j( X& }/ {(API Get entry point) U9 g; @+ c% _8 [! g+ L, [' t
% r/ S! q4 A- i \; x6 t7 r/ j) M- I# x& v$ s8 O0 X
xor di,di
$ Z7 N8 ]" m9 v } mov es,di
3 K! x4 }: N$ p8 h% o8 f mov ax, 1684h : d! s. U& A& K" U6 {0 e
mov bx, 0202h ; VxD ID of winice0 w {* ^; G. Q7 Y
int 2Fh H6 A q+ H% ~% D$ ?& a$ R2 h$ ~
mov ax, es ; ES:DI -> VxD API entry point9 F( p* P5 i- J$ s- Q8 d# {9 n
add ax, di2 U# }2 ^* j, V- y2 s9 l) y5 T
test ax,ax% r" o! \, |( D1 F5 n. r
jnz SoftICE_Detected
& ?1 L- J/ R6 ^' D2 b+ \+ A8 X" d9 h$ n. H# p! U
___________________________________________________________________________2 {- [: n# ?5 f0 T& J9 A1 E( Y4 ~
; a! J: b$ ^" E) O( iMethod 04
1 [# w+ ^( v! H: q. A9 _9 Z=========& g9 `3 D; ~. ^6 H) k0 g% ^ o/ B
) L' B- @6 |- o, m+ m6 o U
Method identical to the preceding one except that it seeks the ID of SoftICE' D n& }1 D! N4 O8 }, a
GFX VxD.
3 r) ^4 P6 o& x% D2 y1 a
5 F3 Q6 r% r% ?, H1 `# v xor di,di
" }5 H3 o3 E" G0 ` mov es,di* L" k6 y; ]* d
mov ax, 1684h 1 j1 \1 s/ M) \( ?. h9 D- P
mov bx, 7a5Fh ; VxD ID of SIWVID
: B) j1 l2 K$ c6 h. J1 ] K int 2fh
+ E0 u* t- v4 A# Y! x& k0 O, l mov ax, es ; ES:DI -> VxD API entry point" C$ T* K. }5 y5 B
add ax, di- W2 e3 }3 j9 J9 |
test ax,ax
: V8 T. v0 E2 h6 T jnz SoftICE_Detected
) i; o0 [6 J! @! h1 J. w
0 {% {, v+ N) e. A8 U$ z$ T1 g__________________________________________________________________________# F1 {) D" @6 S4 o! X
8 Q' L; |' D% j" E: W+ {
3 C2 x$ M" M3 i
Method 05
' O. F2 Z$ P, o1 _' I+ L* Q=========
' q$ B# | V% G* L5 G* ?2 H6 b2 t2 R1 P1 ]
Method seeking the 'magic number' 0F386h returned (in ax) by all system' I. ?: q. N( L4 @: q7 P0 e
debugger. It calls the int 41h, function 4Fh.! N) F, ]( z6 m' k5 n% z
There are several alternatives.
4 Y, C4 @0 \1 H* i+ w: o% s" a2 j# o5 _) N' W; o4 I: l+ v
The following one is the simplest:. N% v6 j& ^* ?: N. H
$ a+ J7 u* R) p& w9 p! b mov ax,4fh5 }3 |& O f+ {+ a( w2 }
int 41h
4 S6 J( L: k- ~* n cmp ax, 0F386
$ w# s, z2 [7 U/ I1 t. F: {' o3 r3 q jz SoftICE_detected4 U/ r" H2 J- N; i4 R7 m
" s% \' v. x1 P* n C
4 Q, `$ Z. E, y, F* k" oNext method as well as the following one are 2 examples from Stone's - c- s, ?/ i' M% `, ^
"stn-wid.zip" (www.cracking.net):0 H# [9 } f; B) t
6 f! X' |) ~+ p0 d( [' }5 I
mov bx, cs3 Y2 Z, x5 ^: O0 N# f* r1 W
lea dx, int41handler2! Z1 L! j$ t: L% Y2 o& z0 S
xchg dx, es:[41h*4]
$ X( I, a, m+ Y9 _" u xchg bx, es:[41h*4+2]
% }! z8 C! S8 v) Z0 {' h mov ax,4fh& ?, ^3 S% H2 P7 |# S! R; O+ G
int 41h$ ?- @/ f/ [/ C% h. J; Y9 O
xchg dx, es:[41h*4]
4 X. ^+ E1 C' ?7 Z* A+ { xchg bx, es:[41h*4+2]
) U G) `: F% D( D cmp ax, 0f386h, z9 K$ }/ L# T7 r0 a& H3 T% |
jz SoftICE_detected
, G2 l5 x9 w4 w! v! e. e, B
- d: ?: w9 d6 ^int41handler2 PROC
* ~ z7 a( |" @+ |$ T- K/ H iret/ c7 q6 w/ V' [# L6 g! b
int41handler2 ENDP; a$ V( f9 Q/ @. g
' p! F( B5 Z7 k1 J: q6 z7 d y( E: I0 ^! r( n, k! H# g
_________________________________________________________________________
, D3 L; t& l7 q3 o1 ?( J& j) _! {/ I% n+ }6 Z6 f
, |4 e! \( N3 c) v/ d
Method 06+ O, L5 D! O6 H8 s
=========
% T! ^1 \. M) v* \4 I+ ]' D) f2 u+ V6 l6 F
+ [* I" A! w. s2nd method similar to the preceding one but more difficult to detect:
' U+ I7 _& t; Q, r1 { |* A1 n/ k* \& m0 t/ u
/ J" K0 n9 n3 k M0 L
int41handler PROC
$ T+ s, Z9 d( ` ]2 _ R1 j% [# y mov cl,al
( [( e' ^ A1 ^" b3 N; G+ f iret# o" `2 P1 E. r) b( G) C
int41handler ENDP! b. r6 s: [8 X
) R, d; w& n. C$ w; J- D- X' w* k6 G9 r: n
xor ax,ax
+ ~; v& ?6 x! j mov es,ax
0 F% m5 N/ v! E: u' N! _" U% E mov bx, cs
4 ]2 p; o q% q7 g3 g lea dx, int41handler( p$ K2 R/ L% ~ V% N
xchg dx, es:[41h*4]
# E1 I# r, i! x xchg bx, es:[41h*4+2]
: p) }9 q1 h2 r' }3 v! Y/ g in al, 40h
6 o9 @& L* b6 d: H xor cx,cx' B) _1 Y2 L! e5 i- a; J9 R
int 41h
" m, v* h) {5 j( y xchg dx, es:[41h*4]* v4 S5 n6 {6 Q; A; V2 {; ~
xchg bx, es:[41h*4+2]
9 y" J) P3 i( {, m: \ cmp cl,al
& P. V/ ]% A( Z& A4 T3 q% T0 _ jnz SoftICE_detected/ p, P0 F, ^: Z$ F) I5 G; o
, p+ I- _& q! E& Y m" z% V9 Z
_________________________________________________________________________
% \3 i; m. |, i1 Q M2 b. w ]1 y
- Q6 l/ C+ K+ u, \ mMethod 07" t4 Z, `- u" S: \
=========
7 B9 h, k6 S- C8 M0 F7 _: \1 p% o6 |% F5 u% ^! _. e1 f8 Y
Method of detection of the WinICE handler in the int68h (V86)
8 L ~8 r6 A( `* g" B. F* X9 G* U+ N* v, q5 i0 _& l+ t! J
mov ah,43h
& O" L" |+ F! ?/ N8 P% i int 68h/ B( k8 ]& o( G4 u3 ?9 e
cmp ax,0F386h
9 j/ C, P2 U% q0 m8 p jz SoftICE_Detected# U9 m# O: u5 C5 F% {
& w6 `& c0 S: ~4 p" B
! J7 D7 g' b4 j. m=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' A9 T* \+ K- n! W
app like this:
1 h/ Z: F" \( U+ t; l
- n4 w4 w- j/ X+ g0 g9 h BPX exec_int if ax==688 F4 Z) O. P) a2 w
(function called is located at byte ptr [ebp+1Dh] and client eip is
' N$ n6 O6 U. A$ W+ G6 N located at [ebp+48h] for 32Bit apps)
8 C D( ^# m* u) L__________________________________________________________________________
" T; x& ]( r$ v
) C% W! Y/ G# m% ~1 A+ q9 F p; h3 V8 z$ m. ]& S( e4 {; y
Method 08
( b8 ^7 s7 u* c8 {=========
5 u! P" M6 q: c1 b- L. d5 e1 C* p7 L8 E4 y/ K
It is not a method of detection of SoftICE but a possibility to crash the" Q+ V& s H* p# X
system by intercepting int 01h and int 03h and redirecting them to another
& U9 I: r+ p, mroutine.6 |4 Z# d! @$ I# Z" C
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
8 a2 F4 ]6 c; Y( @+ L6 gto the new routine to execute (hangs computer...)! p6 O' F" i+ Q' S$ P; A: M
5 I0 j* U' h% D+ H% p# p( W3 [
mov ah, 25h
" W7 `3 \* D8 R mov al, Int_Number (01h or 03h)5 D" N8 V$ G$ K) _/ X
mov dx, offset New_Int_Routine
6 ]) V3 h% K# B8 o4 r n int 21h
& h: _4 f: c. d ^. R1 J
% ?! P- `5 I- P, e__________________________________________________________________________: y7 L/ |9 p1 [3 U! X! Q: {- ]& q
4 d# W2 X! k$ f: `, b
Method 090 M) u! [: z2 Z) V- Z0 a$ c4 Q
=========
$ o' i/ w/ e/ ~ L+ H7 l' @
; `1 S8 x5 x5 f' l5 eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) A* A' p3 O) K! f0 jperformed in ring0 (VxD or a ring3 app using the VxdCall).1 i: R, Q+ }# F8 ]3 Y( {- ?
The Get_DDB service is used to determine whether or not a VxD is installed" j- N9 t* R( ~5 K3 J+ i- b* j
for the specified device and returns a Device Description Block (in ecx) for6 b3 v% f' t5 z; Y% J* L
that device if it is installed.& i* C; e9 e0 j$ @- `. |
) Z# _* x; C. T
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, z+ A) v' ]8 w: C( [; ^ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" y1 v$ G, E, }5 I VMMCall Get_DDB
9 Y( C ?" O$ d* C8 C mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 a5 `7 Y! e) D2 H6 Q- | n2 k
$ w' N i, j3 ^3 H0 _, |% v# Q; R0 v
Note as well that you can easily detect this method with SoftICE:
& ?, a- w$ f* E& ~2 E- R bpx Get_DDB if ax==0202 || ax==7a5fh5 w' B- {( m6 H/ r9 _# ?5 N) d
7 }( f2 t F% O* J w( G" J9 z
__________________________________________________________________________
8 }/ P9 l" j0 Z# f" W- Q, k0 x
5 t. @, L* M' E7 J- [2 v: BMethod 10
+ J" W! I) p5 D2 C=========
- \. k+ V9 a! N# u" P0 ], `4 H% m# d( i" n0 m
=>Disable or clear breakpoints before using this feature. DO NOT trace with
; E9 W" U6 D, x' D8 q& F SoftICE while the option is enable!!
T; c$ Y8 i3 [$ Q2 `0 h) `- W, R& Q& v2 n" s1 \
This trick is very efficient:
) @) @9 t' ]5 f( @3 k5 q7 ]( ]by checking the Debug Registers, you can detect if SoftICE is loaded
7 k5 W" R$ }5 p5 J& {% J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; E) |! ]9 f* q9 a- K1 a, X2 mthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 x' I6 s5 J5 m
value (in ring0 only). Values can be manipulated and or changed as well
9 i* Q" v; _/ p( y. k' U: M(clearing BPMs for instance)
* c. ^' v, [( o0 P+ ]
0 S9 u1 v/ [9 i, \+ v__________________________________________________________________________
+ S8 z/ o |4 @" p4 ^& I. k+ |& f
# g+ ] {; y$ K, t0 x2 D0 z3 mMethod 11" o, j( b8 M/ B+ ]' V& L. c
=========
$ F' v# t% H/ A. v/ Q a* o a$ T" R k5 ~) @# D; W) N) f
This method is most known as 'MeltICE' because it has been freely distributed, T9 p4 C0 s. Q9 k' N8 \0 o
via www.winfiles.com. However it was first used by NuMega people to allow1 S5 b6 x- }& D. n4 y
Symbol Loader to check if SoftICE was active or not (the code is located
8 k4 v4 Z. a" h6 Rinside nmtrans.dll).6 Z; q, c3 e$ x8 P' V! y
& T u- ?9 M/ l4 t! B
The way it works is very simple:
/ Q& Z A! y( S/ @* h7 }( U6 }3 ]It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) F7 Z, Y k( w3 O9 ]6 m
WinNT) with the CreateFileA API.' |- s& Z3 O8 d2 D% U k
) c% f/ |" o! ]5 jHere is a sample (checking for 'SICE'):% q6 C! { w/ D7 m
/ |2 {4 Y. U5 W3 G
BOOL IsSoftIce95Loaded()$ M# a" f3 I! R+ u9 e" g
{
) a a1 @4 K3 H6 i& p4 c t' L HANDLE hFile; 0 m, ^) Q. U4 e6 f! m& h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! ^# ?0 ~2 ~7 G1 D% J
FILE_SHARE_READ | FILE_SHARE_WRITE,! E! d: V& g- |( h4 l& r
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; g% D4 v* h' n7 D& o# e; s
if( hFile != INVALID_HANDLE_VALUE )
$ F- @( q2 k9 T- U% ^6 G {
& f& d, q6 |) p% Y- ^# v CloseHandle(hFile);, `5 s; m5 K: H- W, K. ?0 W& K
return TRUE;9 Q' z- J' v3 w
}
8 s% w4 X( o/ q+ A1 G return FALSE;
$ G2 Y" U, Y9 s2 Y5 J% N}
2 r# f6 s* `' ?; v6 t! M
5 C' [, \- s: A& j% A7 o& DAlthough this trick calls the CreateFileA function, don't even expect to be
- \. u' B1 @6 j' Table to intercept it by installing a IFS hook: it will not work, no way!. e- ?% X! v+ r( W
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: d9 @7 K5 Z+ Y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' }4 s0 o! }: m0 @7 M8 G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 ^0 [8 @" W* w qfield.* \0 C6 D2 ]5 \6 i# h* g4 |7 q+ X
In fact, its purpose is not to load/unload VxDs but only to send a
: t% S0 q0 l& jW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! {2 j0 s3 Z$ ito the VxD Control_Dispatch proc (how the hell a shareware soft could try u+ |. G( [8 F1 n
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ Q! f6 q$ {8 j2 t* U" A7 iIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 x% f$ O7 S2 Q5 W) Q& d0 J6 A, Mits handle to be opened and then, will be detected.
+ M! D5 b/ `4 W, e jYou can check that simply by hooking Winice.exe control proc entry point1 o1 n' d' {5 V, M, P9 L* o
while running MeltICE.
5 ?: R* M+ v2 S9 Y
% k9 B5 j; E! d" M3 k% k$ O0 Z" m- q3 `: y" E* ]
00401067: push 00402025 ; \\.\SICE
( `& R3 ] y( ~+ {- [ 0040106C: call CreateFileA
9 Y5 }: X+ A9 S, X 00401071: cmp eax,-001: t! y" e, h" k W% w8 o) k
00401074: je 004010916 B7 U3 U/ v' o5 w' _+ E
6 I. J. R& j) f3 k: L
- `& f3 j$ m. | a( hThere could be hundreds of BPX you could use to detect this trick.6 D$ H n: @+ S. {0 T; b
-The most classical one is:
* h4 {! E# s% V BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; P. E) A1 a" I8 J
*(esp->4+4)=='NTIC'
4 y* s& g" u/ o7 t* n
0 D3 C2 x* \: [0 b2 b6 B-The most exotic ones (could be very slooooow :-(
j: t* v) `. h6 N BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 O% `+ v; U6 S6 k% @; e
;will break 3 times :-(
* i1 i9 f) a0 a/ j2 ]$ ]+ |. }1 V) T m
-or (a bit) faster:
9 j7 e, u- U4 [* g BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). ?* o m5 [, |
- U0 s6 M. ]' z; ?8 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' H% v) ^0 [" U
;will break 3 times :-(
. O) y" ^+ o" Z9 D. T
# n* o) [8 q5 w% k, a/ v6 F7 S% I-Much faster:& a& d; P) y" j
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV': @) M4 Q' h4 Y" x0 U/ @+ \9 d
% C5 I2 p/ j, Y: dNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
; M% i, |# I- w. vfunction to do the same job:+ ~ B, s! n& b2 ~
) l, B% E9 ]! \" J
push 00 ; OF_READ' M5 p! h1 C& W5 G: y) K
mov eax,[00656634] ; '\\.\SICE',0
7 S) s, T: @7 a& b0 s& j( k4 f8 F push eax
0 m# w: b8 {2 G, }! A3 j$ L; d/ u call KERNEL32!_lopen
2 {7 @& _9 Q' v8 Q& T3 ?* w inc eax. f0 a- ^: S4 Q) Q
jnz 00650589 ; detected8 O% \/ ]% h" y4 l" y7 d# w
push 00 ; OF_READ
8 J, U: n* t- W8 C mov eax,[00656638] ; '\\.\SICE'
$ I3 S3 o& n# b7 o' \ push eax
7 [+ r( z( O! h; ^5 m call KERNEL32!_lopen" z& U* n& ^$ |2 Y; a/ u$ I. {, N
inc eax) [1 f' ]' l4 T u- V
jz 006505ae ; not detected
5 v" h* T# W9 R, J' X* s9 ~- b3 ?& S( x2 c( d
* \" J# F& [; j5 Y" `9 }8 S__________________________________________________________________________
# \% z9 I! o0 f9 w# B$ `- I8 S% M4 A, a
Method 12$ i1 ^$ q6 H( _6 X
=========
2 `% G% L4 E+ ?8 x7 O( a' C* y: Q' m3 [ @
This trick is similar to int41h/4fh Debugger installation check (code 05
1 j8 m6 J8 J- U C- Z& 06) but very limited because it's only available for Win95/98 (not NT)
7 x5 |/ c4 F: m* M' O# zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.* D V. G3 b3 p4 L7 |
( E+ g: L( M8 F, q. o, q9 [1 Q; \ push 0000004fh ; function 4fh- }+ r# G M6 V1 m6 o6 Z; T
push 002a002ah ; high word specifies which VxD (VWIN32)
% X: E ^3 t; K5 X ; low word specifies which service( I! a4 H+ n* A( E. ?
(VWIN32_Int41Dispatch)# R3 A* L) q H- z. y A' \+ X
call Kernel32!ORD_001 ; VxdCall
; g. n3 j4 x! K& d( M cmp ax, 0f386h ; magic number returned by system debuggers
/ q z* S4 a6 z6 e jz SoftICE_detected, R$ _: O; W. D: X% u' A
7 P3 z. @; U( R) P
Here again, several ways to detect it:
- Q' M3 H @3 s: X& ^) i+ B: U5 r; s% C9 T$ y- G6 M
BPINT 41 if ax==4f' [' i& @5 }: `8 `
% N' a/ c v# K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ M5 Z5 f+ H9 Y2 l
& g! | p" J4 d" K, L0 u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ K9 S4 A2 ~, |- m$ a; f& ~( ]
4 _! C1 p! Z/ |& t# g5 w) N BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
^8 ]& N7 ]9 I- B; C$ {4 l( z% L$ j3 b% _: N' H3 y" X
__________________________________________________________________________
$ W* J; r9 }) {6 ]$ x9 v* c) I/ {5 a; p
Method 13/ `& T) B9 G6 a6 Z) i; Q
=========. v; U6 M; c0 h8 @$ s
8 `- \, h: V M
Not a real method of detection, but a good way to know if SoftICE is
\8 j* r! J; f8 Q" C; }installed on a computer and to locate its installation directory.! N9 J4 `4 c( O) V& o; @ }
It is used by few softs which access the following registry keys (usually #2) :0 P1 P- ]- G) d$ h% ]! E
; ?! z: F8 ?3 h, a j; `
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: l2 B. W: w/ F( x, E: \\Uninstall\SoftICE
0 z) Y# T# S" y, `: B* ^# t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 ?2 A/ ~9 a8 E0 r! o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 J* d- r% X* J6 x6 h\App Paths\Loader32.Exe4 T8 H' `1 L z8 D
$ O% l$ ]1 ~- m) g5 m
& c2 W( r8 k6 w; b5 f" p
Note that some nasty apps could then erase all files from SoftICE directory
3 v( k. t: `0 U- I$ `(I faced that once :-(1 E- }$ H0 j$ e* }/ \
- \& d# I* f; W2 y( j! {, ~& w9 I$ x
Useful breakpoint to detect it:
' c# |% Y3 v% G% }% T( v: j* S' }0 k7 {: i8 t* X4 W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'1 l ]9 W' N# Z; ?+ {: I( H
2 P0 l6 s9 c+ G; W/ e
__________________________________________________________________________
1 q. [. I' v6 a" E+ K+ k* }" J5 K! ^" B. m6 @$ _- E
. a; T% a) t: b3 W: p# u6 q
Method 14
# J+ L. h; M7 O5 ?) D5 |=========1 {7 W* J& g0 B
+ f% w3 a, g. U, a$ t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose% h% k' r6 v' \: Z' Z
is to determines whether a debugger is running on your system (ring0 only).! t, s8 E& @ h$ x2 ?' o
( F% x) S7 O9 z VMMCall Test_Debug_Installed% h& X! D! P1 M: w
je not_installed
y5 _: ^/ h) O& m8 B: N0 \4 E! A6 D! Y1 H3 ?
This service just checks a flag.$ z$ z/ z( l: K" x# N" k2 q6 q1 Y
</PRE></TD></TR></TBODY></TABLE> |