<TABLE width=500>
$ v( a2 p o# D<TBODY>/ X! }0 j) M2 K* L( l2 |4 u& Z1 u
<TR>& H- Z& B0 h' K7 q$ ]; y5 j1 c
<TD><PRE>Method 01
$ M- l# a8 A9 M* q8 ^=========
8 W* r- T: w1 B# U4 r' H
! G+ J0 X# H# z- ]( J, F5 ?This method of detection of SoftICE (as well as the following one) is% |, j5 Y9 y& T
used by the majority of packers/encryptors found on Internet. G! j) C" U% q# v6 W/ B+ ^4 q/ t
It seeks the signature of BoundsChecker in SoftICE
5 l& s) ~" k: m Y8 K, f% j) |. [# q/ A! b% {
mov ebp, 04243484Bh ; 'BCHK'; ~, V3 M+ H7 r! l$ S! E T: n
mov ax, 04h. B E/ v; i7 l) s9 \+ f: q, {
int 3
" i7 W, c, a* a; |% [2 u. s3 w cmp al,4
+ Y4 A) v( q1 k. A6 o; y* g/ V jnz SoftICE_Detected% B& ]0 q8 y5 n; D4 a
+ ?. X& q4 R6 O. i
___________________________________________________________________________
, X- q/ \; b: v% G0 C2 u k) s- B/ b' g) S8 ]
Method 02
1 p) L3 `% E, ?=========4 U; ^; Q7 `/ H2 y3 X: v
9 z, R8 }5 L+ j+ D! C' ~( u6 S
Still a method very much used (perhaps the most frequent one). It is used
* M2 y1 R) g& r* W1 E. n1 t) K- w1 Y/ rto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* I2 n8 _, u, V. xor execute SoftICE commands...
: u) _" T( l( W' D6 fIt is also used to crash SoftICE and to force it to execute any commands7 P, M$ U+ S) x
(HBOOT...) :-(( & t6 V9 h2 R4 {. b* q
$ R4 l- {' v# M/ \9 O! p
Here is a quick description:& t' D# _& Q, q/ b1 z% O
-AX = 0910h (Display string in SIce windows)3 o$ d; n. l! I; A
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 z8 [* d- k0 k1 _" @% y. O( t
-AX = 0912h (Get breakpoint infos)8 d4 i; c0 D7 x. }% |* G
-AX = 0913h (Set Sice breakpoints)
+ F9 B8 f& e8 ]9 g-AX = 0914h (Remove SIce breakoints)
% x' N* U, m; v( e
# ~1 E2 V5 H: `0 `; G5 U8 vEach time you'll meet this trick, you'll see:
% j& }# n% h% O: R9 U" ]' o( P( L-SI = 4647h1 v7 P( c; t3 k
-DI = 4A4Dh
4 Q0 W& j& j+ UWhich are the 'magic values' used by SoftIce.
, t1 c) G6 K0 ?7 v1 oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' Y O @- M$ A' |1 r
! v ? R. O" f* F2 e3 QHere is one example from the file "Haspinst.exe" which is the dongle HASP
2 c; Q! O0 g$ X" q0 C. REnvelope utility use to protect DOS applications:
5 S: I5 b* T* `; W# q9 [
2 D4 D) W$ O: O1 _) f$ T. b! Z, E4 ?0 i' y5 G$ M; t6 Y, N9 z0 q8 `6 Y
4C19:0095 MOV AX,0911 ; execute command.
X. }- k6 ` h* A( e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 J( X8 p( I" K+ _4C19:009A MOV SI,4647 ; 1st magic value.
1 r9 G1 q* M: F4 l5 s! q4C19:009D MOV DI,4A4D ; 2nd magic value.
" d7 e) d0 d( U5 v4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 `1 T: N' f2 P( H4 A
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 F i9 p: c2 v+ G: t8 }
4C19:00A4 INC CX" Y" e O3 R3 S# ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. @5 T. x; |' N+ E$ [' s- B
4C19:00A8 JB 0095 ; 6 different commands.
, y+ d6 E% _; ~7 V' j* l, ~4 m4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 s/ w4 a* i: P, j. P4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* J5 T/ }! I1 M. ?# L) h4 h" v/ H
! y! g; N4 g! _1 v# n: f1 QThe program will execute 6 different SIce commands located at ds:dx, which
9 {* M1 |# ?* g( o ?* A: Dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 ^9 R* y6 ?1 `' J7 N7 z: H
- N' _) o, C8 v& Y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 ~9 O6 c* b- h1 Z
___________________________________________________________________________" L4 F L. y1 C
0 F" ^/ w( T' {- H w4 m7 r& T7 S
4 a7 u" P% d: Q4 g5 A3 y2 @4 b/ Q
Method 03( q) L3 f- n9 c; S) I5 X* J! L
=========
" B8 }/ v5 ]7 {. C
' `: T1 e% J1 w$ ULess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 ~ m5 N8 I7 Y7 R
(API Get entry point)+ [: l- S: I5 p8 g% u3 w
) j* s, C: I6 j( D: Q8 g
/ b; k6 r9 O+ l8 b( O/ r$ S
xor di,di
/ M0 m. C* N" Y# X8 T" J0 q! v mov es,di: c; z* a! P, a
mov ax, 1684h
2 s5 Q8 y" ^1 H mov bx, 0202h ; VxD ID of winice
6 c' V' ]& O( G& }: Y: C& a0 o int 2Fh* |# t8 C" {& f( s1 _
mov ax, es ; ES:DI -> VxD API entry point% v, {( ~- H# ]* x/ Y" E# K
add ax, di I; S6 n) {+ F
test ax,ax3 f$ j# w3 c% N, F
jnz SoftICE_Detected# s6 R7 ?$ D4 g3 {" k( j
. y) D+ H7 f! J3 G6 u; j: {___________________________________________________________________________/ m! a; {. i4 q( B( ]
7 a5 l( u+ B @# N4 Z, `# aMethod 04) h* Z7 k v$ B
=========5 Z$ K" ^7 D) j0 z0 E1 X
( v: r/ I1 q0 n: VMethod identical to the preceding one except that it seeks the ID of SoftICE0 P# D' M- M9 ?7 L$ ^
GFX VxD.
" t q& W2 y! w! V, d5 n; p- b
' T" z( ~# v9 u xor di,di
5 P, Q' g& F+ \3 C9 l& I mov es,di
7 ~7 B. A+ c2 x8 m9 n mov ax, 1684h 6 V5 N4 j* W& F. E9 t
mov bx, 7a5Fh ; VxD ID of SIWVID. g* l- d3 B1 f" ~$ J2 Z8 E
int 2fh; ^- n, Q5 Z$ z- s
mov ax, es ; ES:DI -> VxD API entry point
6 M- @- Z* v) ?- \5 @" d add ax, di( G9 K; @: A" \0 ?$ u
test ax,ax4 L4 t- ?& }! Y% k: n
jnz SoftICE_Detected
+ H$ {, _- N- Q6 H5 s
# Z9 z! m- n) M7 y6 E__________________________________________________________________________
% }( n7 W2 j* J6 w
5 _' H. y' _) H% T% d: {; D2 w( k# e. _0 y; j& O
Method 05
0 K& F: [& X- ?+ Q: F7 F, ~=========7 R7 K# u! D) _9 Y* z) ]
3 r# F) s& k+ j6 V7 Q, E
Method seeking the 'magic number' 0F386h returned (in ax) by all system
) f" v8 Y( V2 p# J, U, Udebugger. It calls the int 41h, function 4Fh.
& ^' k8 A) s" j( A3 yThere are several alternatives.
6 Q6 u, |0 w' z
& T. p( o+ p) Y l2 C* l9 F9 }The following one is the simplest:, z, H; k1 H" Z6 T; R4 L
+ V0 D! X. d* J1 _( I% S8 Y% v2 ?
mov ax,4fh
" A4 D. t8 K$ p% ^. I! {/ q! p6 N/ e int 41h
" N/ g6 q+ y0 v: ]# h- X cmp ax, 0F386
& M. q, Z* I, r jz SoftICE_detected
2 D% Z7 z' U! Y" O
# h; v- d- ~5 l* o2 h
' o) y' D- y9 X: u: M: zNext method as well as the following one are 2 examples from Stone's 1 c* c# S) {! c: C6 ]) T4 \
"stn-wid.zip" (www.cracking.net):
, t `+ f5 j4 f5 T! c, R' n) H
, t# z% l: L9 p8 G! _8 r) \ mov bx, cs
+ ~# p0 G/ u1 M8 U6 q! ^' ]7 s) x lea dx, int41handler2
- z7 X; G" I% M# h; H xchg dx, es:[41h*4]
8 G! U, ]! O- p6 a( \ xchg bx, es:[41h*4+2]
0 B: f1 @2 M. P mov ax,4fh* h; i) O) s6 I- E$ m# l- N7 Z
int 41h$ D: h- s2 D3 z0 x: W
xchg dx, es:[41h*4]
3 Z8 u: @" }8 |0 D0 u0 c xchg bx, es:[41h*4+2]
% J2 x/ v8 v& H cmp ax, 0f386h. c/ [6 J! M" Z1 J f
jz SoftICE_detected
' c$ z. }8 C" ]3 e# T S& z
W# o3 [+ j' {* q* |3 C! y* X# qint41handler2 PROC
6 w8 N/ m! u; Q1 m6 Z) g# h iret
' G2 Y8 c- Q5 h& ]# q y, rint41handler2 ENDP
) v' h) a' ~4 Q! f7 q3 E8 j K( i3 T8 E
, w2 r5 k/ e! p" d7 L_________________________________________________________________________* s6 {; I" Y U, [6 h
4 @/ l, @% e/ x# m! k5 ?6 O9 l
9 S+ n U* [4 ^# Z% O k/ GMethod 06
7 _* D Y8 f' v=========; w$ P' _4 j& S v- N( {2 K
0 {% [. ?- l' x, i
" U% H- M( P5 ]0 ?
2nd method similar to the preceding one but more difficult to detect:
4 ?) G! p! l$ n1 Q0 e2 I7 P9 l+ T: c, R
8 L3 a8 {& i4 t( }6 W/ k) K& P* T
int41handler PROC
, ]2 h* d, m( a mov cl,al7 M& l+ u8 ]! I
iret; h; I2 z0 h3 y; E
int41handler ENDP% y9 ]/ o/ d: h. e
8 E& ~: {7 K# _! I* ^ _
9 ]5 y" j/ w# V- [: m: d xor ax,ax
. R7 y' n6 W( o8 V6 W mov es,ax( K" d0 C; R& A$ M; F* j
mov bx, cs
$ H1 k% @) s& y4 E0 B" } lea dx, int41handler
8 O9 J8 `/ V% |9 W( s xchg dx, es:[41h*4]
3 h" S" T* Q# R$ Y! ?* P3 v xchg bx, es:[41h*4+2]& p _, }" m2 y. e5 C
in al, 40h
1 I/ n2 l: j* l" V2 S" C3 O" r xor cx,cx$ C" f* c2 D( P- h9 |9 m7 |! @& x
int 41h
g% X! {: r- ^ xchg dx, es:[41h*4]
* ~. }; I6 b v* }- a; K8 K2 d xchg bx, es:[41h*4+2]
. y% Q. b' e# ^ P) t3 \2 { cmp cl,al& h; J2 j9 Q+ q6 N
jnz SoftICE_detected: V. V- [$ p/ g( R5 B4 X9 O
/ [7 p: \9 B; m0 h0 t' F* H_________________________________________________________________________3 g% J* v4 |. t+ t) Z- n' w
' l6 u" M& Q. e" G: r8 C( G
Method 07" F4 T# w1 p. n
========= |" Z& T# O2 n* {% ]
7 ~3 V: z V* g- E& J4 ^7 KMethod of detection of the WinICE handler in the int68h (V86)
. p- _ o1 p7 y7 b
8 d; r; X6 A# V+ p! I' q mov ah,43h
0 H2 f( ]" q; p- O int 68h9 k" m- }: I v: P
cmp ax,0F386h8 e+ K" E* [0 Q( E
jz SoftICE_Detected
: F& k7 C+ ~ W4 I# T' E& Q3 l9 A" |
- P) [; J; X4 y& E7 ~
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& V2 Q' U% M5 S8 Y2 k
app like this:
9 i4 i. F/ B1 r) e4 K7 r5 M) {* ^: h6 A, s; `& g3 n
BPX exec_int if ax==68
$ V4 J- o, S D3 |) F! U (function called is located at byte ptr [ebp+1Dh] and client eip is5 q" `0 a4 _4 u0 F. O
located at [ebp+48h] for 32Bit apps)5 @- y! ~5 s% g+ ]% Z1 p0 \- Z
__________________________________________________________________________5 e) {! O) g$ k' V
L% u# @ z# o
/ k4 x5 a$ Q, p5 d; `. Q: T- aMethod 08
- {' L) Q+ C- `=========
( O, L, m% i* G! e$ {* W9 g5 ^4 L8 l0 T: |8 |5 Q0 T
It is not a method of detection of SoftICE but a possibility to crash the+ R) ~& W W1 |( e
system by intercepting int 01h and int 03h and redirecting them to another1 i* t4 A3 S3 z% b
routine.6 t* j3 K0 X+ o/ E* C# Q( @3 ^- P
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ q5 Y% w& a/ E* h$ b, K
to the new routine to execute (hangs computer...)
' ?* K" e9 Q1 S, r+ ]9 w0 P. X' {- m& s% T
mov ah, 25h. S5 F) [/ \* }3 S' _
mov al, Int_Number (01h or 03h)9 D5 b5 L @& ?/ E! H" M7 V
mov dx, offset New_Int_Routine2 g( A) |5 t i. L! P; f6 c! ~
int 21h
0 g; o$ n W( A0 d* Z7 V5 _+ B2 j0 I! J7 v/ X0 T2 J% G5 E
__________________________________________________________________________
+ R% b3 V ~( t. g4 S) o- k x4 M; W# e# _
Method 09
5 w7 d2 G* W, j# G& s" x=========& p1 F( n+ ~0 ]4 y; O+ G$ z) I" C
% G4 k/ M3 |5 p7 g& zThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. n9 Z7 p! { q1 i) A
performed in ring0 (VxD or a ring3 app using the VxdCall).
, T) m, `9 Y& @$ L" R0 _The Get_DDB service is used to determine whether or not a VxD is installed a6 O* d% k$ j/ E3 m
for the specified device and returns a Device Description Block (in ecx) for
& ^& b k9 U* mthat device if it is installed.- r8 L. b# q0 q8 B1 g( r# P
5 H ]$ i0 a7 W
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. H% Y- f4 T- M; z9 z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 o/ q% ]2 Y7 G5 Y5 o4 S8 [0 x' l/ H VMMCall Get_DDB X. i+ }6 a2 H3 ]- o- j7 ~
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* C# ]9 u1 m k0 \! |. D) v% Z2 a" B/ V4 |/ |: r
Note as well that you can easily detect this method with SoftICE:5 D7 F8 d2 J# Y1 L; N
bpx Get_DDB if ax==0202 || ax==7a5fh
5 Q" m( x( z; a1 t' I1 X4 U5 j$ E7 l( r! @8 x
__________________________________________________________________________: Y. H9 ?/ s, F/ z0 T
( i# e& {6 v/ S) j' {9 c
Method 10
- E5 E! l4 H: ?) L2 l=========
' ]* ]! i0 o* i2 R" v6 t. o- c2 g+ o0 W
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ p7 D) d3 _& x4 b- i
SoftICE while the option is enable!!3 _6 t: i: Y' T# |0 V
$ Q/ d: I& _2 U6 `* | l3 PThis trick is very efficient:
! c' P8 \% x& `2 G5 k7 ^by checking the Debug Registers, you can detect if SoftICE is loaded
' W0 [: Z* ~/ H' U(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" c5 {1 S2 x% ?# vthere are some memory breakpoints set (dr0 to dr3) simply by reading their$ S2 W# I2 m* A. |) f5 k, W- L
value (in ring0 only). Values can be manipulated and or changed as well0 W$ g: v0 i: y; m7 k9 C: b; V
(clearing BPMs for instance)2 n) @) t, l+ i2 N
3 ^$ ], E5 x7 x5 U8 u" d4 F__________________________________________________________________________0 \# T6 E6 o/ h z7 i' }
9 Y) Y" @0 z+ o5 N! zMethod 114 y' t0 `: F% ~0 O
=========
) `4 }+ p* Y/ _/ k# j8 q8 S4 L4 O; M1 J
This method is most known as 'MeltICE' because it has been freely distributed4 t' M4 h. x a9 s
via www.winfiles.com. However it was first used by NuMega people to allow$ O$ z6 r; |2 v
Symbol Loader to check if SoftICE was active or not (the code is located) a, o0 ?+ a5 b, I) L) H2 a7 b2 K
inside nmtrans.dll).) }; e" s; E: t) Z! C! {& k3 c
" D: u' A' k$ @5 m" g9 WThe way it works is very simple:$ R. X% J" V9 f% [" ]3 k8 P
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for/ A/ S. V3 t+ O3 e( X+ k
WinNT) with the CreateFileA API.
- v& v) a. Q M0 z L* T, P* @$ x' K% {0 N( V# K/ O- G$ A% p9 l
Here is a sample (checking for 'SICE'):# E) j# ~* c$ P
7 R/ {( R3 O, X) j4 d, @0 SBOOL IsSoftIce95Loaded()
( H& ]% L% O0 B3 C{
# m9 x: k. L& j% ? HANDLE hFile;
4 H8 R# j0 @9 I$ ^ {' P0 s hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 I5 g4 }3 x6 {% \, k FILE_SHARE_READ | FILE_SHARE_WRITE,
3 G7 {& s" I7 X7 K; [# v0 n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" f3 o& r2 ?6 Z) z" _3 I) k if( hFile != INVALID_HANDLE_VALUE )
# g# E5 R/ D9 [+ k) G. M7 X5 {5 } {) m- A; e, l7 J
CloseHandle(hFile);! h4 z" C; f& ]/ {7 f+ r, P
return TRUE;
7 Q! Q5 [+ t9 G. F7 q) l }$ v+ r3 b+ \$ {9 S1 f
return FALSE; }( ]+ z0 w4 m( L# Z- R- r
}1 H. `* K# H2 ~: [
4 ]3 Y' h% ]% L/ KAlthough this trick calls the CreateFileA function, don't even expect to be
. Q8 G# A# {0 D1 s: U! @able to intercept it by installing a IFS hook: it will not work, no way!
% ?) w& K( `. Z. S* r+ hIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" W8 O* `) S7 z! j- j, g
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* K8 H" u& x; u2 o1 k5 p, ^and then browse the DDB list until it find the VxD and its DDB_Control_Proc
# O; x% ?7 ]; \) l9 Nfield.
9 c- l. y1 A% SIn fact, its purpose is not to load/unload VxDs but only to send a
4 U; u* J4 W; RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 z2 m' i! I: g. S5 T9 ^9 d
to the VxD Control_Dispatch proc (how the hell a shareware soft could try' E7 }3 W( n/ M% l" F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
v$ n; L8 e. c% T( N" D8 s/ dIf the VxD is loaded, it will always clear eax and the Carry flag to allow/ h( t8 z- Q, i9 I
its handle to be opened and then, will be detected.
3 H2 I, a& T7 E" u3 H7 h* ~+ m& @You can check that simply by hooking Winice.exe control proc entry point1 z5 B" R# V0 b) t+ n' T" Y$ F
while running MeltICE.
8 [, n, F2 G2 R6 X8 z2 g
/ I$ X- N9 E0 d* ]% K0 I' L$ y. b2 x. h- b/ H# |- Z
00401067: push 00402025 ; \\.\SICE
+ c, F7 x* B; @( C 0040106C: call CreateFileA
3 ] d- c; @, z6 Y$ Z 00401071: cmp eax,-001
' J5 T' `, E% k 00401074: je 00401091' @# x; k. L' G J
) Z: x7 J3 [6 ^- O4 c$ m
' K `, h+ u" ]! F9 U
There could be hundreds of BPX you could use to detect this trick.: F( l1 Z+ ^7 ^% N; S# G+ L8 S
-The most classical one is:
$ J; R2 U5 y8 F- n, n BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* D! K" ~# y( E: J% K/ ~
*(esp->4+4)=='NTIC') j. `% v3 p; Q0 L5 e
5 m8 I/ f7 x, n5 S+ }6 q+ u
-The most exotic ones (could be very slooooow :-(
0 J1 t. c0 }7 J+ I0 {, C4 H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 w; G- p- N+ \" o$ g" u0 T/ p. e
;will break 3 times :-(
# v6 J( D/ u2 W9 N
; b X* M% e9 V; C' f/ ^-or (a bit) faster:
% ?3 x5 O* b+ w! Q BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): G3 U! M# i9 p" ? {
6 G. ]) l; X/ ^5 b9 m
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 m% N2 J9 w! _# G4 [ ;will break 3 times :-(
9 `/ t3 ^9 ^0 A9 x S. `4 _! M H$ d9 r
-Much faster:
* m6 E, R: \- I( B9 p" S BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 r. w7 A/ w, e! \
& m7 z) |7 r$ {% b% J6 jNote also that some programs (like AZPR3.00) use de old 16-bit _lopen o m7 y1 Z' d1 D+ `& t- _. C9 f/ W
function to do the same job:
- e/ i3 ^% c5 w' `$ V" S
! Q# I8 ?) I5 Z; m7 P! j" x) P push 00 ; OF_READ, v& o& h* r) T9 V
mov eax,[00656634] ; '\\.\SICE',0
% N5 p' n+ Q# {; p push eax9 t! R5 H2 m) u- b2 w9 ~1 V, k+ C
call KERNEL32!_lopen
0 N& X& N" t- w7 r& R inc eax& S" r$ I% |6 r$ o' N
jnz 00650589 ; detected
, e0 ]3 V/ y V7 T% H push 00 ; OF_READ X5 C7 c5 j( Y9 r* x
mov eax,[00656638] ; '\\.\SICE'
' J" J7 A0 s# J6 V8 a! @ push eax
# T4 r! t) P; G$ e call KERNEL32!_lopen
: \+ C3 Y! u( s4 U inc eax
0 i9 z0 K$ \8 M- n2 l jz 006505ae ; not detected
g$ \4 B" t0 ]+ I9 F1 j0 P" q
" N5 Y6 {% t( u, c, P1 _5 D3 R9 O, F7 R: y
__________________________________________________________________________
0 I" j1 W; `: L: e
) l1 s m. P" E4 X+ h1 cMethod 12
6 o& `2 ~, I4 g=========1 B1 N( Q. Q9 }& `
1 T$ {# N. B: ]7 S: F
This trick is similar to int41h/4fh Debugger installation check (code 05$ w( m0 e3 c: S/ s
& 06) but very limited because it's only available for Win95/98 (not NT)
; z k4 f; {9 ^9 fas it uses the VxDCall backdoor. This detection was found in Bleem Demo./ Q$ I( L8 p1 k* }: d
1 ?2 a& u5 p: [ g push 0000004fh ; function 4fh
' c9 ~/ H9 |+ @$ a- U/ a( L% |- h! ~, V push 002a002ah ; high word specifies which VxD (VWIN32)
; \. H# P% z/ P8 { ; low word specifies which service
/ O( Q& E9 v; Z8 T2 z% U (VWIN32_Int41Dispatch)9 _, @9 i0 r! B( _7 i) L" y( X
call Kernel32!ORD_001 ; VxdCall
% l, ~- o2 B: X, t% w cmp ax, 0f386h ; magic number returned by system debuggers! W V7 A P7 {
jz SoftICE_detected
2 |$ M. L3 L7 C' N4 r/ o1 E) a- r3 v9 D8 _0 K2 C' u
Here again, several ways to detect it:) a- K w) i$ e" C9 N
( U( ~* v8 o8 ?6 |. G& V6 i BPINT 41 if ax==4f4 y/ ~, s3 V# I( n3 M: [
, }& d6 F+ D+ `2 d4 V9 Q! P( y; w BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* @3 g3 ?1 o$ p9 ?+ p. A
: S: C' o/ e; |. F- A) Z4 Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ E7 g/ h7 ^3 ?8 K4 N9 f
3 [9 _1 [+ W/ j1 x; Z% _9 k! F' S
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!3 B" v, e9 N8 D6 r' y
9 X0 S( `; g. }4 u ~+ b
__________________________________________________________________________
- W6 n3 J& m/ r9 `; q: I+ {& `" N) w( Q. [: Y9 ~$ q1 w, b9 y
Method 13' M! d. {8 C, {, X/ T
=========- c6 R4 `$ J7 L9 a
& @. H3 L1 j: e& \( |" CNot a real method of detection, but a good way to know if SoftICE is
3 N$ n4 g6 ^) Q9 J# a9 j0 F* hinstalled on a computer and to locate its installation directory.4 F0 L e* p2 e% n' J/ R/ ~& h
It is used by few softs which access the following registry keys (usually #2) :+ k( X$ l% { _7 z* E
. N: m: m" q- c4 b; L0 F8 i1 T2 B-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 ?* b# o7 v4 n {
\Uninstall\SoftICE
/ k8 L3 k, k# w3 F0 q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ R o3 u; r) T6 d5 E/ k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 K8 X7 X% E& |- o) F
\App Paths\Loader32.Exe' q2 u/ A& t( s' I
3 H( \. m' F$ Z& h+ w
d3 p" R$ Y8 A( e" {Note that some nasty apps could then erase all files from SoftICE directory
* e' q3 m1 t5 t. K! c$ X( w(I faced that once :-(
]4 a: @% S/ a3 H& l
$ q8 l, K J" A! ?" N& ]7 JUseful breakpoint to detect it:9 V$ g: b& m! s5 k+ @! O/ m2 D
" A3 h1 S1 t* }/ m BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! Q5 J& B: }! l, g- N% i' G! | t% y: r! _& P# C
__________________________________________________________________________
5 n! ]9 U4 `2 ^" z7 ]1 W7 _2 y1 V# Q
- W+ {6 e) d" I: @/ h1 N$ S' T
Method 14 J0 S( Y) O( v) {9 N
=========
2 z0 |" C6 ]4 i; F1 {
! m2 T( S! x6 v# M# u# M# ~9 QA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. W6 v) f+ T2 S3 \: C$ C: w' w8 Pis to determines whether a debugger is running on your system (ring0 only).
5 {8 q i' j, P: l- p& ?4 y" X4 W, D! w4 Y2 \8 T% s
VMMCall Test_Debug_Installed
! v0 E. f! H" d0 M je not_installed
. @% q' w2 D; g. n y! q$ G
6 Y* D# d R, b; R0 S$ BThis service just checks a flag.7 z! [$ O& J" T
</PRE></TD></TR></TBODY></TABLE> |