<TABLE width=500>
1 l1 z H0 n7 t1 `. q# W1 u<TBODY>
. C# a0 W5 N6 M2 ?9 _6 K<TR>3 b4 m }. H7 }+ l$ P/ L- Z
<TD><PRE>Method 01 : g4 p! w; ~& s. S) |
=========- x( o- ~1 K) [5 z5 p- t
+ C! v! U. @& e) `8 w# ^This method of detection of SoftICE (as well as the following one) is8 T: D$ `; i8 M9 A
used by the majority of packers/encryptors found on Internet." A9 M4 J5 z( v- X' [
It seeks the signature of BoundsChecker in SoftICE; ?4 ^" K1 \7 J7 Z5 @
$ j% h# s; T- N" J
mov ebp, 04243484Bh ; 'BCHK'
/ d# `4 i, A/ ^3 T) `. c k7 }& I mov ax, 04h
6 G8 N' F* l @- I6 m int 3 3 w4 d* d s- ]: g( E4 W
cmp al,4* x* J0 U) a$ H0 V. ^
jnz SoftICE_Detected- T, w4 \- G9 U6 _1 V5 p- Y
' ^' a/ S; @8 a) A+ V___________________________________________________________________________
* ?4 Y; z8 x) h4 y
' y5 F# V s6 i2 rMethod 025 _+ _5 @6 s* r5 s9 L
=========' w0 Y9 d6 o7 o* b) J% ^3 Q8 m& a
+ y: e7 w) T. z, x i
Still a method very much used (perhaps the most frequent one). It is used
( b( m: F- a/ Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 C- `* a; D+ ~9 _/ T! ^% ~
or execute SoftICE commands...: d" y/ Y4 u0 }* @- S0 n0 Y
It is also used to crash SoftICE and to force it to execute any commands6 _$ c7 @+ W: L4 G
(HBOOT...) :-((
8 `, }- V$ G# E; F* O% E
4 z2 w) O" H4 [3 m, M- f# w$ _8 ?Here is a quick description:9 p9 j) Q9 L- J4 M* g! S) D
-AX = 0910h (Display string in SIce windows)
8 C* F. v3 s/ t8 M, ]" Q5 e-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* h6 v% @8 B8 p/ f-AX = 0912h (Get breakpoint infos)
# N. a% g/ u8 H; R. g7 g-AX = 0913h (Set Sice breakpoints)
5 A" X+ ] v7 ~9 Y( c: R-AX = 0914h (Remove SIce breakoints) u$ Z0 X u# j8 a5 ?/ o3 A0 t
" V; q' k- m! s7 i' W! ?
Each time you'll meet this trick, you'll see:
3 f: q& ^4 I* B2 H' z, z: ]; d-SI = 4647h( E% v) h: j- C! @- d) [* Q& c3 ?
-DI = 4A4Dh
4 U$ O) S. w/ Z0 i- HWhich are the 'magic values' used by SoftIce.
# \8 r' i8 F8 YFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" a$ O! c5 M) e' \2 B! A
8 @5 [( N4 S' h9 t- O. k% D" nHere is one example from the file "Haspinst.exe" which is the dongle HASP
& V3 @/ @+ @$ v% B+ P3 Z1 SEnvelope utility use to protect DOS applications:* P4 Z! g h0 l+ {3 }- \* j
( K0 a1 I; c2 s0 |
! f# K/ D) @6 N) M9 }) W4C19:0095 MOV AX,0911 ; execute command.
" d. O$ g2 x+ U2 t3 _* |) S4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
' R* J5 _) J3 r& G w6 m1 w4C19:009A MOV SI,4647 ; 1st magic value.' a( [8 c9 t7 P! g% v2 c4 ~; M
4C19:009D MOV DI,4A4D ; 2nd magic value.
& M) ~; B0 s x( \' C& Z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ M$ i4 b* ]. x3 H5 w4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 w# A! i; D1 {) I& C# D+ a4C19:00A4 INC CX
: T8 V' @! I) D/ |. G9 A: a4C19:00A5 CMP CX,06 ; Repeat 6 times to execute2 f* ~" `3 A& L/ l; a+ g
4C19:00A8 JB 0095 ; 6 different commands.
* y% n+ t6 l: ]2 l: k4C19:00AA JMP 0002 ; Bad_Guy jmp back.
W3 T9 H" T0 D }" y% R' |4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( U3 {) W' |" W
9 |3 Y( W9 u! u- z7 EThe program will execute 6 different SIce commands located at ds:dx, which
/ ]0 V) ` c5 m3 ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 F/ @1 P' ?7 f! s
0 C# q }% {. ] b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) W; t- y3 B/ d; \2 t; L
___________________________________________________________________________
2 L/ d) f' M8 Q0 T& K: B
# @& c; i8 T! q! a" I! j7 u0 r+ H& ~. B$ \$ e
Method 03
' C; C) a' n7 o8 O) p=========
4 E1 D7 k& A8 K2 c9 r( p2 G* c* Q8 p' ]* t. z$ u9 X- w
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h3 ], x6 n) v7 T$ D8 l
(API Get entry point)
7 W1 f) W# j7 V* [9 |1 P Q/ k: b% k _* m* u
8 u0 V) n5 i) _" t/ X' v xor di,di
0 W% ?0 G# B1 x# F/ q mov es,di
5 o" [( m# w; t7 q mov ax, 1684h
0 W8 E3 h! Z1 k3 Q4 I8 R mov bx, 0202h ; VxD ID of winice
7 E( J- F) C! H" q7 L' v4 {2 w$ { int 2Fh8 y1 ^- `4 v7 c H
mov ax, es ; ES:DI -> VxD API entry point
# Y- v5 b& n# c8 I, [ add ax, di
6 Y- k. R( F6 Y) ~2 G test ax,ax$ t. f6 y! E7 V. v
jnz SoftICE_Detected
5 e5 l+ g7 f! I1 g9 @% z: \3 Q/ s3 Y9 Q) H# h6 ]6 \5 f! K% F! C% W4 y3 ]
___________________________________________________________________________
) [6 ~: c* V1 n( R+ P( ?9 N0 \: K
Method 04
1 G8 X% y6 _% l! J4 h5 |=========8 n5 S g6 e' Y3 ^2 E$ Q. S3 M
, @ {8 Q9 F1 J6 B: e) XMethod identical to the preceding one except that it seeks the ID of SoftICE B+ [! Q1 Y6 p0 k/ J
GFX VxD.( @# G8 V6 Y( p u# @) X( y* R
L3 L: Z5 i6 W7 u/ \; U xor di,di( H' V+ g1 h* v. ~& X& v8 t2 O5 U9 ~
mov es,di
1 R, R% g: u$ h" l mov ax, 1684h
% G- |+ @7 N, i/ N5 a mov bx, 7a5Fh ; VxD ID of SIWVID
. U5 ~! \" d/ r8 n/ m int 2fh2 _0 }1 M: |& E$ o" X
mov ax, es ; ES:DI -> VxD API entry point1 f# \7 Z& `, U# B H1 Y ^
add ax, di
! S8 b7 x4 b: }% J7 \5 n( a( j6 B0 O test ax,ax
6 y$ D! j) Q; } jnz SoftICE_Detected
" s& H- F5 N* N% y- K4 b5 T* G. O9 a* m
__________________________________________________________________________" Y0 ^7 _2 L4 g$ ~
" n/ n) W5 k0 ]" n. _3 v/ y7 T$ q0 G/ W. z9 m3 D0 i
Method 058 m' C5 `8 L9 @/ G) K
=========
9 b: S! j$ S/ \3 ^" w; p3 F
, o8 `) s1 Y) n f$ H4 y. rMethod seeking the 'magic number' 0F386h returned (in ax) by all system6 a8 q3 j9 w# t- l7 J
debugger. It calls the int 41h, function 4Fh.
& @$ r; Y( T1 ]' m/ y- WThere are several alternatives. 1 @3 s" P6 i- ~7 a
+ r# ?, e. Q# u# P% jThe following one is the simplest:
2 V7 E/ U" V6 V! w( [8 e V8 Q4 T8 O4 R- s
mov ax,4fh+ v' g+ v0 c' @# V# }) P+ l7 D
int 41h
+ u& o& L# j+ n7 I: ? cmp ax, 0F386/ V2 x) Q f9 h5 W1 N$ \" [, _
jz SoftICE_detected- e. K: _& v' U+ b7 x
; W2 L" f, N) z, G9 e1 `1 d3 _; ]
* o9 ~4 Z# u+ ]' \7 XNext method as well as the following one are 2 examples from Stone's
; ^. D: w, y4 W+ l"stn-wid.zip" (www.cracking.net):
p6 ^3 a2 t- y) r% g/ E8 w& `
9 x+ j' N4 a4 Y# D9 e9 `0 ? mov bx, cs; |8 g ^- Y5 L# G7 K2 p# m
lea dx, int41handler2
& r/ Y( s# `- s" V8 X4 J" x xchg dx, es:[41h*4]' ?' q$ W/ u; z6 H/ G7 G3 A
xchg bx, es:[41h*4+2]
+ a* n9 c( n2 j' g& J% k. A mov ax,4fh. _2 V8 }& l* W
int 41h E, Q1 Y" |$ x ^
xchg dx, es:[41h*4]
- D, r0 Y, U& N! x xchg bx, es:[41h*4+2]( M( K5 B! A% f) ?: K# F
cmp ax, 0f386h
4 V8 G! L- G0 y6 w jz SoftICE_detected" o& t9 T! Z1 F4 Y7 c
% |" m3 b# o; x w
int41handler2 PROC
% J( K2 L8 q/ {; _; I iret
! b6 Q! @/ l6 }6 n6 P9 p# w. t9 Aint41handler2 ENDP2 k6 Y8 d, `2 `7 b+ k8 I' }
! c% _8 x; b4 t5 R# B! [) d
/ N9 n1 z9 v# i_________________________________________________________________________4 W- m7 n% s5 n# B: \* Z
) C5 Z4 V6 Y# z4 c. U1 B8 g
, u5 a1 V1 O4 [7 f* |1 SMethod 06
$ \" g; Q& d# ]6 Z9 i5 N=========+ M4 G: X- L8 N
, h; M% g( Q: ]% G( @" V% Y5 U) q) O- O
& J/ X1 e) B, R; E: D* S2nd method similar to the preceding one but more difficult to detect:
+ z5 l+ O% g2 d/ _) i3 l3 d o, O, [" w
; P% W- ?9 k" D4 C9 [
$ _1 N1 w0 K+ K+ A0 t1 Yint41handler PROC) z% t1 V9 }7 y( e% N
mov cl,al; }- }$ k5 }. Z- V
iret
4 K. M K# z$ e, Qint41handler ENDP9 k. A& J4 e/ i! }
6 |5 j' l0 K' p% f8 A' c m, d
# ?: S! c& e: d! |3 v/ m- l3 t* U xor ax,ax
- k/ i* ~7 e. W i4 q mov es,ax+ ]/ Q2 i6 t( |; @7 J. w
mov bx, cs
: m. W7 F) c; X7 _ W lea dx, int41handler
O# U X9 b( y' o% M x xchg dx, es:[41h*4]; Q" ?0 k+ L6 r- l
xchg bx, es:[41h*4+2]
$ |6 L- z1 H+ O+ q% l in al, 40h
& B( A, d* Q7 t$ R" x) I xor cx,cx
4 q& U( V6 A6 q+ H int 41h# g& I2 f2 N5 p9 z+ y6 [! V
xchg dx, es:[41h*4]4 Z# M( A) z- D) v; k
xchg bx, es:[41h*4+2]
/ D' ~/ @- Z3 G/ e- G cmp cl,al4 N, L/ S3 Y3 W' {( m1 Y
jnz SoftICE_detected
$ _3 u8 A0 m8 X Y' I. F" i( u4 E5 x3 w4 M
_________________________________________________________________________8 p, y8 {, F% |! ^& D7 a$ W8 G$ {
$ {# e# M6 a5 iMethod 07
Z* T) `6 ]+ R- s. O5 r9 G& d========= X# k; n) `/ d
~' H. s/ J* j9 O1 c
Method of detection of the WinICE handler in the int68h (V86)
9 `! W+ F) _7 X5 G5 H, ~1 o7 e+ S: ]- |. K8 N
mov ah,43h+ x q. D+ f+ H1 x4 t
int 68h
+ g9 o" @. j K5 N+ d cmp ax,0F386h
x" u) F( l# b' B+ W" ]8 F jz SoftICE_Detected
" I. O2 N5 v# m# i8 h- o7 I8 Q" G1 l6 V7 O1 M: j
# [# T7 R- k5 j/ p
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, s) T9 V% |9 Y9 c8 ], U
app like this:: b7 ?: G1 s5 x+ }& ]
, \9 S/ f& S/ Q- o. L( t# f
BPX exec_int if ax==688 T( X' {+ z- t. w( L3 a. w2 e
(function called is located at byte ptr [ebp+1Dh] and client eip is0 g! r2 B S8 l9 z, ~$ E' ~
located at [ebp+48h] for 32Bit apps)
9 ], f3 |) P$ T. N' x( a/ s% _5 {__________________________________________________________________________, B8 |* k' s& \
; x5 _; Q, m- J) y* F
* t/ ~% Q6 o9 F* \1 _Method 08
" L9 q4 I% O6 F. Y% T=========! \9 m$ Q9 R- Z W8 |+ E! H; V! @1 t
9 X( c4 o* s7 u' M9 JIt is not a method of detection of SoftICE but a possibility to crash the
" m1 o9 V c- usystem by intercepting int 01h and int 03h and redirecting them to another
1 u. B! Y; v; A9 U: q9 a4 {+ Xroutine.1 h, R6 |1 h. Q8 m. G7 Z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# _) W) C. Y' G9 i3 ~+ l. Oto the new routine to execute (hangs computer...)
8 N( I9 `" Z$ j$ @3 x# s: m
! F2 z5 S' C1 c, Q8 F W: B- w mov ah, 25h+ R0 F/ |9 \! ]* f- d( E u: v) a
mov al, Int_Number (01h or 03h)
/ Z. K, K |, s" V; @" q mov dx, offset New_Int_Routine
9 {" z: R9 @6 y int 21h
8 t3 [; D7 G8 k' J( x' K( m0 X" W' Y+ K& W+ ]
__________________________________________________________________________# }' J8 \8 s- e/ G# y7 K
6 ^' a; y' \9 o8 ]
Method 093 Z" u* u3 Z1 e1 w
=========! R) n7 \( ?$ w. i# }
9 A" `* s5 k: @+ t: L3 Z* o" S
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 C B& v0 B4 a# O! ~: T
performed in ring0 (VxD or a ring3 app using the VxdCall).
' l2 L! D% i! _4 Q3 X( N" yThe Get_DDB service is used to determine whether or not a VxD is installed
1 a& L7 f5 Y( u) F& q" ~0 Qfor the specified device and returns a Device Description Block (in ecx) for* _& G1 J& ]# S' ~0 Z# ?) `$ E) M
that device if it is installed., e0 Y O0 Q+ ?' [7 J/ u
' F4 }3 v/ S' B+ J
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! t L7 a) z- y6 \ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 E+ {$ v4 G$ ]
VMMCall Get_DDB
7 o+ d' W$ z/ M3 Y' f1 y& \$ s/ E mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( z5 L! L! A7 O7 r/ }
) F8 M3 t1 w; w) \+ k3 C* X( D8 J, }
Note as well that you can easily detect this method with SoftICE:
4 C$ }$ D* _9 L: W4 Z5 |& U bpx Get_DDB if ax==0202 || ax==7a5fh# o9 i4 Z% W8 K: l8 s2 w* U
W5 N! |$ i1 [$ {! y+ O
__________________________________________________________________________
- w- u, f5 ]0 u, p
* W" v2 V4 y* [Method 10 X A7 o' p: g+ ]6 E& j+ g
=========7 A0 Q6 `5 o) h9 o/ B
6 j% [% d( t$ {1 T5 q=>Disable or clear breakpoints before using this feature. DO NOT trace with @# F% w6 d* P
SoftICE while the option is enable!!( q$ y3 @, a4 g3 ^) L
9 d' _2 v2 X5 e3 Z" W' @This trick is very efficient:( Z, ]+ q5 f: @) q! |: c
by checking the Debug Registers, you can detect if SoftICE is loaded$ J/ `) q3 J# t9 r" Y, ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ ]8 r+ Q6 R3 A0 j# Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ C# t; H, O. h
value (in ring0 only). Values can be manipulated and or changed as well$ W+ w7 [9 c( D6 T- T
(clearing BPMs for instance)- N6 r, [: D2 I9 [0 \( D' _2 X( R
6 O* G3 R9 |; @" t4 L4 i* i) G2 K# z) |__________________________________________________________________________5 n# T7 k: N; X3 O: E9 C# r
8 l- H2 W- p, K" z- q. r& rMethod 11
- F4 Q+ o- I6 x" v! `' @=========( o8 ~6 c2 Z1 _1 p; p1 D
3 K; c; {: G) _" C5 T7 B' g
This method is most known as 'MeltICE' because it has been freely distributed
+ E$ a: H) t% nvia www.winfiles.com. However it was first used by NuMega people to allow" e7 n0 N' h9 z V0 R
Symbol Loader to check if SoftICE was active or not (the code is located
& I3 R* I6 @: i; [; h$ jinside nmtrans.dll).
4 k* ]- z8 m$ }: C. `- l; m* Q
, y. I8 p. c2 ? m$ \0 AThe way it works is very simple:
/ Y4 ~% _+ p0 J* d1 L/ QIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 c% T$ L# d& K7 O. x0 D7 W) W
WinNT) with the CreateFileA API.
/ O4 j* `2 L; W; u8 _$ c
0 f! v: u8 s( ~5 fHere is a sample (checking for 'SICE'):' x6 i2 b, P. E. u7 k: H, n
! {& K: Q/ k3 e8 _" Q- b' a
BOOL IsSoftIce95Loaded()
) B5 N0 } @0 M: m8 M" c3 ` d{) r; z; I" R, D% f4 f& r8 @
HANDLE hFile; 4 r+ J! b8 ^: n5 U7 X
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ ]/ G: f' b1 @ L; b FILE_SHARE_READ | FILE_SHARE_WRITE,
5 U) B- x* e, K1 y3 k$ g; r NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! B% p8 z3 E7 j' \6 ?5 |( B$ ]
if( hFile != INVALID_HANDLE_VALUE )
* A3 }" p" a# t {$ i, A8 g4 y- E0 c$ ?& W. s- W
CloseHandle(hFile);8 H; f+ }+ l4 V; M" S
return TRUE;% [" O/ K/ h8 T9 k
} t$ N% R0 b& b& J- q
return FALSE;- ~+ r& L8 Z# i6 p" p' R s
}
c0 L8 ^; S4 E* N* h9 H
1 f& e/ @- d9 }- o( QAlthough this trick calls the CreateFileA function, don't even expect to be
5 h D: a3 `3 f6 Y( L" d! D8 R; kable to intercept it by installing a IFS hook: it will not work, no way!
% h- c* u: _1 N! w9 R* yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
! n. J* s1 @3 s: a4 Zservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& [ B. I' @; a- u, x8 land then browse the DDB list until it find the VxD and its DDB_Control_Proc U/ L: Z! k* o
field.. [1 ~7 \6 z. `) |' J' J* K( r
In fact, its purpose is not to load/unload VxDs but only to send a
% S: W4 Z& f* T h, bW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); ^4 f- d& ^9 b: N* `- C) g
to the VxD Control_Dispatch proc (how the hell a shareware soft could try U! U, E" Z! {+ ~- |
to load/unload a non-dynamically loadable driver such as SoftICE ;-).9 p2 i0 b, p& Z1 w; @/ s
If the VxD is loaded, it will always clear eax and the Carry flag to allow; }) \6 V+ S' c
its handle to be opened and then, will be detected.
2 c# S0 Q! j6 o+ m$ L" fYou can check that simply by hooking Winice.exe control proc entry point
( o0 x0 N- G+ S; Vwhile running MeltICE.
! e& p2 N# e( M1 _, \% q7 }& y9 r- ]. Q- S2 K% V& V# d0 c( Z
# m0 v: Z. S- }8 _% F 00401067: push 00402025 ; \\.\SICE, F3 y5 n+ D, N
0040106C: call CreateFileA
& [$ S: }. r) E6 O: G, ~' [7 O9 U' N 00401071: cmp eax,-001
3 p( X3 A% j/ C4 D) H* ?8 {4 g( R' O 00401074: je 004010913 _2 a- L: y5 _6 _, x
) l) o* ]2 J: ?! |1 I5 P
" v: }3 X0 u VThere could be hundreds of BPX you could use to detect this trick.
# ?7 Z% `. Y) S( d; v-The most classical one is:
3 s7 ^, x) u: b+ I, ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, h, \4 _ |, z2 q
*(esp->4+4)=='NTIC'8 C! ?* e9 N/ o
' m( D, }0 Y# }' w5 m
-The most exotic ones (could be very slooooow :-(' E2 N3 L& y- o6 }9 M
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! A8 Z! d) N9 ~4 h. u" H ;will break 3 times :-(! \6 K; V7 V7 I
+ E* [: y6 U* q4 x$ v
-or (a bit) faster:
% [, Y6 l, ~/ h* E3 |9 Y$ y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 _; v0 C0 o) ^
7 k5 T8 a6 n; j" W7 o; R8 Z BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
3 P0 P! g1 }5 j2 i ;will break 3 times :-(
. J( H5 r; F( {; s6 P+ O8 |1 N3 F1 g$ a" y- Q
-Much faster:% {8 l" H) R: c+ V" T) S# S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 o. o8 M1 a: V6 p# J3 y# r2 U. f7 \& Y$ _8 }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 H6 |5 ] X- T0 Afunction to do the same job:
& ?. K# O `* j0 W6 ~1 ?0 Y+ s$ ]" N/ w
push 00 ; OF_READ
' @$ F2 ?. t) H* O mov eax,[00656634] ; '\\.\SICE',0/ P. G3 `1 |" ~; N
push eax v s' I2 |- ]9 B' M8 b" x
call KERNEL32!_lopen
8 H2 Y! ~2 P3 I: q, R- b/ [ inc eax
! n \% R. H2 Q) q% ^: ~$ T) d4 m jnz 00650589 ; detected
8 |. B, `; Q1 D0 u/ j# m+ } push 00 ; OF_READ
* c8 v9 u" N0 X4 z mov eax,[00656638] ; '\\.\SICE'1 r6 `7 S/ G5 R8 W8 s
push eax0 g# |) H6 P b2 \& f/ [
call KERNEL32!_lopen' Z- b& R+ ^. n, Z! V. X
inc eax' Y' }2 X) J- ~ k9 [0 G) p. W, [
jz 006505ae ; not detected
3 V5 j4 e* h, w7 E& T! _/ ^5 q H: s/ P) ?! c9 b2 s8 x0 i- B
; G* @& L4 h+ [
__________________________________________________________________________
5 A& X3 P+ [3 u# O' j- H2 W3 x9 J5 X$ T8 _$ H% K7 o& l: J4 L
Method 12
% v) A' q# Z8 O2 B6 c/ x. v=========
5 q! p4 v) e% ~# a# O
7 S1 o) i0 c/ |$ hThis trick is similar to int41h/4fh Debugger installation check (code 05' p" Y- J8 y+ x
& 06) but very limited because it's only available for Win95/98 (not NT)$ w/ t X2 p. k
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ e4 _6 `* r" }$ Z+ Q% I* M8 [
: H3 B+ K: n1 P* E
push 0000004fh ; function 4fh) G1 s! A; \' l+ Z' A0 W* q0 x6 T
push 002a002ah ; high word specifies which VxD (VWIN32)
9 f; Q' N9 b# X: W Q ; low word specifies which service
4 ], ]4 M4 J: v/ q4 a (VWIN32_Int41Dispatch)
+ |; m3 L6 K* x a/ R' n call Kernel32!ORD_001 ; VxdCall H: \4 x# |/ S
cmp ax, 0f386h ; magic number returned by system debuggers* H, w) F- V4 w3 M, e' N
jz SoftICE_detected2 S( R- j, Y: B* |2 ~2 F! P! r
. V" K% \ j, C
Here again, several ways to detect it:) y! `, I6 `3 ]3 C, }" m, \
5 L' ~0 X% ?3 x8 D: p% S' H* ^
BPINT 41 if ax==4f
8 S: N/ H# |3 z4 { D* ?* m+ l0 J; W9 g9 G5 _1 K
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* s9 j* A9 P$ Y, K Q
0 ~3 Z% g9 V1 a- H6 @/ Y# v5 D0 A
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* B$ J) n& _/ b
( m% O, i$ w7 Y. b- M5 u BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!& h: g$ o+ n1 |
! C2 _# A- [9 x, u% P
__________________________________________________________________________8 j" R# s. C& ?
8 F4 U* P2 w' J. N$ H( C( A
Method 13( m9 ~, ]& d" L0 Z- y4 y
=========
- W$ @; z2 K1 K, }# @! h
2 B% e L2 {& ` E" iNot a real method of detection, but a good way to know if SoftICE is1 ~- N* y% M' w0 A% r3 {
installed on a computer and to locate its installation directory.' z& {3 r- e! [" A
It is used by few softs which access the following registry keys (usually #2) :
( a3 F" o8 r. _+ {3 `
; X9 r/ ^" K$ a/ s5 x' V" n-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ y- z. G) B1 s. m8 G* B7 M
\Uninstall\SoftICE
) J; v0 U* B& W o" @-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 m2 f) K, g" g8 a
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 G" ]9 N, m& s7 e: _( u\App Paths\Loader32.Exe
% l) v) i) J, [: u6 a$ h7 I1 D+ e5 y' G( ]+ r3 |$ _
; p) c' q" {, y6 }8 N0 Z: e
Note that some nasty apps could then erase all files from SoftICE directory) p5 \8 M9 }4 U- Z5 R Q! _
(I faced that once :-(
6 `2 e; w( u/ \' u+ I
& o7 j. _* `/ A5 ~6 GUseful breakpoint to detect it:
: Q$ O" ?+ L: N( A; u# {4 q' A8 n$ i
2 w' g* o4 {1 ?9 f# l) e0 C BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( V9 H; p+ R: a$ f' i N
5 U. b5 g _6 @+ \__________________________________________________________________________0 G4 K9 C% d! d
- R' p$ B9 ~% D c* O7 Q4 v0 U: d, E' X0 j
Method 14 F- q: P& a' O, s) W2 `; x! ?
=========
4 g; p1 _9 H3 |6 n/ I" C! ?* |4 T$ [5 L2 g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 {: S- C# k" \5 e: \
is to determines whether a debugger is running on your system (ring0 only).
& R9 \; }# m2 y8 |) C: u$ Z8 C8 _& U5 \
VMMCall Test_Debug_Installed
5 S" |% @+ n; T9 h5 z$ ^ G$ u+ y je not_installed6 }2 o* k% m5 P5 ?9 x8 ~0 {$ \7 K
0 u. g% J; }5 u9 i: e8 {+ w
This service just checks a flag.0 M5 q3 w# P, _4 f
</PRE></TD></TR></TBODY></TABLE> |