<TABLE width=500>( A% e0 p6 x' b- @# b
<TBODY>
G( `$ L( g; n0 c# q5 G1 B<TR>
) h6 A( n: Q7 p<TD><PRE>Method 01
6 w+ r! K$ X; A9 K( I' c=========; j( ~ x2 T1 Q
$ W9 F5 f& N& YThis method of detection of SoftICE (as well as the following one) is3 k# d# O# {# r9 L# x- F
used by the majority of packers/encryptors found on Internet.9 o( R) S. y- I2 I5 X4 L
It seeks the signature of BoundsChecker in SoftICE
+ [6 O, v! |: |" t& i8 B' s" {" [( g, r& u
mov ebp, 04243484Bh ; 'BCHK'+ G, n, r: M6 }9 n2 w* t- Q
mov ax, 04h
& Q9 @8 s8 p% v4 T8 F" x( N int 3
( [9 ?4 p. J! v; m7 J cmp al,4- r9 {' \3 Z. S1 V v
jnz SoftICE_Detected
* P* e7 U- L3 h6 L8 ?0 k& v3 C6 G, R2 l" F' M! k P' t v8 a
___________________________________________________________________________8 | U9 x' i7 S v; u" T$ K9 m# }
2 Y0 {) ? a7 P! H. w
Method 02
$ Z$ V) c7 W, C9 I9 N. }# x6 G+ E=========
& m5 T& K3 B; f
1 j j8 j4 y$ {) k# jStill a method very much used (perhaps the most frequent one). It is used. y) Z% o! Q6 E: D
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' ?- o4 `, k- por execute SoftICE commands...
9 Z+ A9 X+ w4 ]5 T0 z+ |% g! jIt is also used to crash SoftICE and to force it to execute any commands4 K% t$ C9 M4 V3 v/ h& Q7 B
(HBOOT...) :-((
( z" Y3 T: f2 T
' [/ P: `9 d" h( E {5 OHere is a quick description:0 X( Y$ Z: T6 M- x$ S
-AX = 0910h (Display string in SIce windows)/ \7 n" Z% K# t# W9 B
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
`. S5 z, u/ x: J/ ]-AX = 0912h (Get breakpoint infos)' R: N% h" g; C3 x# i, u. i/ e
-AX = 0913h (Set Sice breakpoints)
0 E) Z9 F1 r- P-AX = 0914h (Remove SIce breakoints)
( }% z4 c. T- h: a, O4 S# A! g8 ^9 Y0 k* n4 g
Each time you'll meet this trick, you'll see:! q. i! f5 g; G4 n" p, ?
-SI = 4647h
$ c G( C3 [" Z6 h-DI = 4A4Dh
; F2 `% e! M+ B, P: iWhich are the 'magic values' used by SoftIce.! K8 S, p6 A4 O. d' p* g+ p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 ^0 u! f9 c9 k/ v0 O3 b: F0 r1 q7 r9 [1 c$ @- ?' Z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
/ Y( A) t5 d) V1 F. Y2 d6 |) }Envelope utility use to protect DOS applications:
4 s' U& m9 K. X; W2 R& ?; [/ r* ]/ G" C2 X/ `. M- ]' f6 I
: E5 Z$ }9 l- a8 K+ K
4C19:0095 MOV AX,0911 ; execute command., z0 x6 R- V8 [3 h
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' V4 E; D2 S7 u1 P7 g7 p
4C19:009A MOV SI,4647 ; 1st magic value.
% \ ?& y" M. h6 }' f# W4C19:009D MOV DI,4A4D ; 2nd magic value.
/ U* m- L* S$ |# x& ?4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; ?) N- j+ C3 P9 x: G& w3 Q! ]% M4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
# T. X# y, y7 F: `" }( B9 N; X. K4C19:00A4 INC CX( @! j# t. \) U; s* e7 T
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 r e" ^% W9 [, }6 z! X
4C19:00A8 JB 0095 ; 6 different commands.
3 M Y4 e% v& S# s; K/ ?4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 w7 [+ q3 m+ v, ~& t4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 K! S' T$ w( K% a* Z
2 G7 c2 x" V% k7 UThe program will execute 6 different SIce commands located at ds:dx, which
8 r* P: D; Q" I5 C( tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 z( X* Q) H# g4 V6 `3 ^# |7 J4 a# M6 F% k2 J# M. ^7 Q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( y. m: z4 J( s% d) P* c
___________________________________________________________________________
" {6 S) X3 ~" [5 Z
( F5 I, E9 X9 j% U5 [, c, ~4 X; C x( h( x! z: E4 @5 S
Method 03
3 r8 ~2 E n9 d=========1 ]- f. x# ^ K" r1 ]( \5 S3 v6 v
+ }- {5 q% j6 W3 _ xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! `6 e) L* I2 w6 S8 }. r(API Get entry point)* s/ t6 P) e) o
5 U9 S% [( s* R; j/ t6 w( r
% A; s. m+ f& E xor di,di4 D$ O5 ~% s( z$ H
mov es,di
: A3 o; D! Q6 D+ J. T9 o mov ax, 1684h
n4 r0 e3 p+ x mov bx, 0202h ; VxD ID of winice
7 R! J% R, t9 c3 [# `; J int 2Fh
, v$ B: v4 J# [ j, E( \ mov ax, es ; ES:DI -> VxD API entry point _5 x8 d, @4 {" {/ ]1 E9 v
add ax, di$ v8 ?2 O: _5 p
test ax,ax% g7 Z" L; H$ y8 P0 ]1 l& d
jnz SoftICE_Detected' ?+ ^! x$ d2 i- p
4 X$ | }1 N$ m8 N7 `4 Y9 b7 ]
___________________________________________________________________________
1 X! f3 y4 h9 Z4 } U" }. I+ {4 f; s" l4 `/ f }. l
Method 04
/ k) z6 f1 K( U+ T* K5 p=========
9 ?; T0 S5 T2 s
% V. d) y9 w" n1 @* V& ZMethod identical to the preceding one except that it seeks the ID of SoftICE2 Y4 a9 T! _5 A; o, d \
GFX VxD.
$ H. |4 H1 e; r+ U; V& T
5 v8 }7 |/ O* |7 s: P9 v xor di,di" n* l/ g9 ]5 u+ H! P$ ?
mov es,di$ S3 `: |0 M! h4 S1 \* Z" }
mov ax, 1684h
. D; E$ y; K# i+ ^3 [9 g2 `- N mov bx, 7a5Fh ; VxD ID of SIWVID
" k2 l2 T/ [0 E \1 u int 2fh
8 p. d! b2 e: T$ g mov ax, es ; ES:DI -> VxD API entry point
S; s9 k$ s F4 P add ax, di% _+ d& d" L/ \, ?" I
test ax,ax. K1 c! s' Z; b5 b* I. w. \1 K
jnz SoftICE_Detected& `9 R! q- c2 S% h( r
* N. F9 z( N, L6 P F__________________________________________________________________________7 K! a9 K4 N* T; l6 a- `, |. ]
5 n9 t9 `" G/ D3 F, U' t
, z0 }/ g' S1 L0 d Z4 DMethod 05
* _$ c9 o8 t8 W=========
- a9 q' Z( e* r5 X
2 o8 ~8 H' S2 Y4 N; NMethod seeking the 'magic number' 0F386h returned (in ax) by all system
( l7 W+ f$ x9 P, q- xdebugger. It calls the int 41h, function 4Fh.
7 \# i4 V- z4 ^# ]3 `+ C/ ~There are several alternatives. ; C' o/ i, e( S: I
+ P) l0 [1 z; p' @6 I; TThe following one is the simplest:* s. L. T5 p6 M
8 m0 K \; F' O# U3 V! O mov ax,4fh" { V- v9 W) \- x i; m. b& U9 \
int 41h
% o; S0 a* I2 {; F' G6 h1 J cmp ax, 0F386
; a# f }7 i+ V jz SoftICE_detected( Z4 T& h* `/ [: [4 f+ ?0 Q& P8 n
4 ^* |6 z2 \1 x" r, k- R
8 ]. z/ n- h& fNext method as well as the following one are 2 examples from Stone's
& h6 O8 i' m- D+ D# A3 q8 G"stn-wid.zip" (www.cracking.net):8 u6 _# }. b; y2 T" v
& ?& _+ F# H% f1 j d- g2 l
mov bx, cs
8 d/ r8 m; [8 K* s lea dx, int41handler2# u+ L1 J& n' Z3 P+ z
xchg dx, es:[41h*4]! C$ Y/ ?1 ^4 k9 z: o
xchg bx, es:[41h*4+2]
# @0 W( [* Y. a0 w9 E8 x mov ax,4fh- I. Y0 f3 l2 G+ n. e& ^" C: S
int 41h) s! |/ R- }: l! w: ~( x
xchg dx, es:[41h*4]
5 A4 W4 G5 o. q" q" I$ ~ xchg bx, es:[41h*4+2] @" P# L! U( Q% |) \& f
cmp ax, 0f386h9 I/ `, k; u, C5 P# F
jz SoftICE_detected8 m2 y1 {+ M& [. i& n. c& m
$ j: @& @. |1 G! N: ~; Hint41handler2 PROC* z- {3 x% V# C" a! N' i
iret- l1 ~. H' j) z5 c3 V5 I; B! y# ]. a
int41handler2 ENDP
! J; c& s1 A& C2 _- s% k \* U) [
$ B5 @: a8 ]& I1 t5 Q) H' W3 V. a% K( B2 J/ `( U% z4 G
_________________________________________________________________________8 V, k* @& f9 g. B* C
5 `/ Y+ o/ }8 \1 f" ], f
5 R5 A, p) ~+ [. `+ g% M* DMethod 06
. B2 n' C1 c( R=========1 o( [& s6 d& N+ O
. g) a+ T Q9 M" n+ v( N( F4 c3 q d& c8 t* ]
2nd method similar to the preceding one but more difficult to detect:$ A5 p8 o2 l. N
/ G6 }3 D7 B0 x8 l
8 W: L) c) X6 V3 W& J8 E( sint41handler PROC( c1 ~/ O0 P/ P$ x0 e2 Y. t2 u
mov cl,al
+ N3 k6 Q M3 q8 x4 R iret
) r/ E- r* p" Y( O- v) @int41handler ENDP
K& q7 {% ]8 o8 t; b' |0 C9 _6 D7 m8 e5 K, c( Q+ ]
1 J9 K0 x6 u% ^& W: e xor ax,ax
6 J v4 z2 O) e mov es,ax
$ m( |' K0 O6 e4 U* G mov bx, cs) o( h3 i7 n8 g: v/ S: x9 S
lea dx, int41handler
5 N" O$ v( C Z& E) F4 h4 @ xchg dx, es:[41h*4]
- W+ y, N* T S" o9 i, N: l) Z% { xchg bx, es:[41h*4+2], a6 e' \3 g' M
in al, 40h
) t7 f) \0 C) F% N0 S" F xor cx,cx1 _7 ^/ M3 F; i0 Z' ^# }1 U* l
int 41h
/ Z- o8 W0 R% i; R! Q+ l7 o7 Q xchg dx, es:[41h*4]
# m6 k. _/ Y3 o1 [: R: S8 i xchg bx, es:[41h*4+2]9 u' r, g' ?( g$ g
cmp cl,al3 ^# L$ ?& M8 Y2 H; Z
jnz SoftICE_detected
4 f3 Q. a& p9 ?0 M# W; ~/ e+ }8 T! ~0 }* l4 h& j! v! y) D
_________________________________________________________________________
$ A. t/ y+ o. a% Q. j7 N; C# H3 v
Method 07
5 R0 \' ]8 g4 L=========( ~: ~9 r7 d j3 @ Z
/ p- H [: G9 w* k
Method of detection of the WinICE handler in the int68h (V86)4 H9 E/ a" y0 K2 C. |! ^' A, ?
% ~% B: f+ T" \6 t
mov ah,43h
5 C G, } B+ B7 E int 68h
# v+ g1 D9 a% r! g, }5 t" s/ A& W" t cmp ax,0F386h
7 E8 p- {' F) r4 v- m* t jz SoftICE_Detected2 k4 j; Q7 O) e J8 D% V
, }0 H j) r5 M a7 Z6 A8 a4 ?$ U8 _) l: U- q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! k, X, ~1 G0 O- d+ m ]& v( y( C app like this:
/ T9 v I* g8 g6 [; | v) J3 r
/ |" O3 b" C4 r0 Z$ {+ F' ~ BPX exec_int if ax==68
3 ^/ z# |$ ]/ [8 o0 v (function called is located at byte ptr [ebp+1Dh] and client eip is
) D3 ^3 M* f- P5 Q0 e/ V located at [ebp+48h] for 32Bit apps)
6 b9 S8 X) c" s- g) c$ Y__________________________________________________________________________
$ [7 w6 k% V, s7 W
: r+ y1 f9 J+ o R& K+ g1 S& _4 J4 {! o* l6 x
Method 08
, g0 E+ i$ d8 t" y8 M=========
$ Z* C+ W' R q0 ~ |5 Q3 ?, A! p6 G
( k( ?$ D( n7 S a/ A2 n# MIt is not a method of detection of SoftICE but a possibility to crash the
: X2 T m0 ^* |1 B% f" rsystem by intercepting int 01h and int 03h and redirecting them to another
7 ^# e1 p+ J: d% \ }routine.
6 l2 H+ W5 F# q0 H" v. R9 `. MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 e. s$ ?9 k' _* qto the new routine to execute (hangs computer...)3 X# R. s1 v7 S! X5 E
) o5 Y6 v {% p/ Y mov ah, 25h
2 s- a: e& ^: ^ mov al, Int_Number (01h or 03h)
5 S4 W \' f" i. ?) r8 ~# F mov dx, offset New_Int_Routine, H/ | b0 j0 j A
int 21h
( r- D# ^* }4 n! T: r+ J& G7 Z- V* ~
__________________________________________________________________________# m% H+ y0 p* e" z
% C% B; a; I5 V1 v( z K$ v
Method 09
& C M6 w/ W7 K1 }6 h=========/ b' D+ r3 M0 S% ~/ n% o
3 X# A5 f8 v) ^" p; r3 I7 rThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ e3 C" t2 ]/ Eperformed in ring0 (VxD or a ring3 app using the VxdCall).
( U5 J! H j6 Z+ I0 wThe Get_DDB service is used to determine whether or not a VxD is installed' S- u! _6 e1 H0 x4 B Q
for the specified device and returns a Device Description Block (in ecx) for7 h, K7 j% Y1 w2 T9 u2 F
that device if it is installed.
$ C# H) r$ [) _/ Q: @( a
7 H5 Y! E" `* @, [% O1 V/ c( ~ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 i5 }; y! J( `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 v( f1 ]7 P+ i VMMCall Get_DDB6 r6 ^: L; O2 {: Y' y# l
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed" q8 m2 q6 z1 O4 l
! W. i$ ~+ f: k8 S. T ~Note as well that you can easily detect this method with SoftICE:
, G" l; g6 |6 K n" b9 s0 y( o' f0 q bpx Get_DDB if ax==0202 || ax==7a5fh
1 Y* J2 k2 ]) o5 R% ]! }9 L" A4 r: y, S
__________________________________________________________________________
6 c Y1 l+ C$ ~! G' w5 d0 F' W4 e- ~0 [% }0 {& m) z
Method 10
# ?5 _/ D! }( e=========
; V& K7 h% W9 d- Y( b& E' t
% |8 @. }7 H5 l. Y* b=>Disable or clear breakpoints before using this feature. DO NOT trace with
& ?" @& v, N- A SoftICE while the option is enable!!
9 C! q- ~) n( y
r% F4 W5 w7 v. F+ k7 \This trick is very efficient:
# H) G5 s5 `1 s: U( g5 Nby checking the Debug Registers, you can detect if SoftICE is loaded( l a# d y+ x1 x5 K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 v; D+ d+ l" n2 U
there are some memory breakpoints set (dr0 to dr3) simply by reading their! U8 t5 G' l5 x( l4 ?
value (in ring0 only). Values can be manipulated and or changed as well Y0 u3 X n+ H0 K! [
(clearing BPMs for instance)) y; Y. X5 e, s# J! u; s
, X, u( z9 ?! V2 a/ z c8 V! r__________________________________________________________________________2 g' v7 p" t: b2 X; r+ r8 _
& `5 \3 _% l& Y6 ?( JMethod 11* a1 @# C0 K& Z# Q1 ?
=========& F: ]7 r8 q6 I4 M" R6 z
5 d4 @% {0 F( m6 L/ LThis method is most known as 'MeltICE' because it has been freely distributed
2 I6 M! [! R# }- A; S1 Xvia www.winfiles.com. However it was first used by NuMega people to allow
0 V3 `5 y6 E3 KSymbol Loader to check if SoftICE was active or not (the code is located
5 V' Z, c9 k5 f8 r5 a9 Sinside nmtrans.dll).
: l( Z. R7 Q% k6 r' Z3 n
* \, w9 A* T) o2 PThe way it works is very simple:; R% }& R, P% ?; O) {
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 ]& C X; v' B% _/ h6 V2 QWinNT) with the CreateFileA API.
2 A( c4 j6 B0 g' }1 s
9 H b, a* r! E$ h$ V! Y. HHere is a sample (checking for 'SICE'):
* ~3 m- \3 [7 K8 f9 [/ M) y3 D
; {8 f9 y2 E% Q2 d% }) @BOOL IsSoftIce95Loaded()
# J8 L/ |( e( `$ _{9 ]9 S5 M7 \. L& Z+ X
HANDLE hFile;
( Z1 G' b; }( J* q3 f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. \4 g) m8 q1 S
FILE_SHARE_READ | FILE_SHARE_WRITE,
8 @! E H4 N7 Z k0 e: D3 T. i NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( R/ l, g: ?. [4 V- K0 N' a7 m if( hFile != INVALID_HANDLE_VALUE )
2 M5 [+ z7 B/ L3 u$ [: h7 z {& Y, w; r7 o/ I
CloseHandle(hFile);* z) a4 R7 v5 a3 g( Q$ P
return TRUE;/ m3 K0 _4 y7 [, i# f. i
}
2 B2 x% ?$ N0 w return FALSE;' `; a5 F7 g- \9 H' k2 T
}
7 I0 x/ N& j3 k. t4 p6 U6 \% V% W$ r/ Z+ H
Although this trick calls the CreateFileA function, don't even expect to be
! C6 Q/ s* m* {able to intercept it by installing a IFS hook: it will not work, no way!
7 V# ^! ]- f3 Y6 _- ]In fact, after the call to CreateFileA it will get through VWIN32 0x001F5 g. q) D8 g; b) K, t% A9 C( f: `6 r
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 g: F+ L" N) s! x9 `/ ?( Z5 U }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, F% J4 c9 a; n- qfield.. M) k M3 e; R3 A+ r9 Q* ]
In fact, its purpose is not to load/unload VxDs but only to send a - [- I; r! r& W0 g$ Q& J3 m/ ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 y: F- H! r# H6 ?* [to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! S. @+ p$ H2 ]3 u( I2 [" [- _to load/unload a non-dynamically loadable driver such as SoftICE ;-).! x. R- T( U0 ~+ S+ i" @
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' L9 J9 k# u. ]5 Oits handle to be opened and then, will be detected.+ z% D! ?3 [/ a. A" }5 y
You can check that simply by hooking Winice.exe control proc entry point* j) d1 V5 g3 ?
while running MeltICE.
- h& D/ }& v# N( r1 s' N( W' ^4 c: `/ G* }5 J7 G) k! y
! D" h& c6 {4 }' S$ r 00401067: push 00402025 ; \\.\SICE+ D( U& ^% ]1 K# B3 L% o
0040106C: call CreateFileA
0 C. D) x+ A" @ 00401071: cmp eax,-001
& o5 k/ i% d# i. Q/ p# Q* E 00401074: je 00401091
# Y" z( B, Y, M$ I. b
4 `( R2 ?( J) p+ U
- Y0 n1 j" Z. p2 B! V5 \% wThere could be hundreds of BPX you could use to detect this trick.
( N# m5 F4 w0 f5 f-The most classical one is:
* p( e& x5 W! v& ~0 g BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ u4 A2 G9 Y( {% k/ @ *(esp->4+4)=='NTIC'
4 q; t: Y' J8 Z2 D. s
% Y" } x& S% j* h9 ~$ m-The most exotic ones (could be very slooooow :-(
( Z1 I4 n! W- x u5 @ H$ T) K, {! Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " v, {/ P* k- ~4 R: ~4 P4 m" Z
;will break 3 times :-(* l, B- F$ \2 c6 P# R- {6 E) \
: v! V5 V9 t3 D4 p-or (a bit) faster: 0 u9 R9 A# p: [! l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ e2 e0 a" _9 h @" j3 j+ J7 J2 E
/ R( ?5 x, B7 k% K. t/ R: S BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + N$ `' x3 z5 @, o' U7 v, V
;will break 3 times :-(
]$ \! `# l K. p: V. \+ M
$ D: p8 Z1 y& [-Much faster:- a M+ P" H6 E9 J. ^+ D; H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* v6 Y: N& P4 i* t/ [0 P+ w) x$ p m8 v7 c+ k. a) }+ A
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: {$ v& _ q, Q4 w& ]function to do the same job:
0 u0 w! ?2 Z3 f% V. } o) ^5 I
1 Q$ L7 y) c' u, ] push 00 ; OF_READ% Q n" z' I2 w) N+ z% a1 u
mov eax,[00656634] ; '\\.\SICE',0
: h' U+ \- v: X8 M" O push eax$ |+ B: T K2 c" U0 i! i1 Z. Y
call KERNEL32!_lopen$ X/ R" R2 F9 Y6 o# h
inc eax
8 K% W2 B1 S# a- S jnz 00650589 ; detected
# a" w0 k0 Y K/ K- `) i4 G x/ T4 c5 x push 00 ; OF_READ5 x( ]/ r, R! _
mov eax,[00656638] ; '\\.\SICE'& N; n* |; [: v* x
push eax7 c8 {) ?" D4 x/ y
call KERNEL32!_lopen8 h+ ^+ E2 V' A% F8 d) I+ w2 @
inc eax' |2 l- X! p2 {/ ?9 w: T1 r" W' F
jz 006505ae ; not detected
: V- u" f `4 G# J* [ _( ?% B
! w: y4 c' Y+ _6 z8 x' ^9 V5 f) F0 g- E4 S" C# X$ i3 t" Y {
__________________________________________________________________________; C- G4 L. g$ N& _; r# {
) o4 F! [/ t4 J h, W# u- ]2 _: S& `Method 124 P0 M" e/ C& K3 b. V. V H3 E
=========
& `/ I {5 U' c1 w. R7 Y" {3 I3 H9 i4 [( [; _/ l/ {
This trick is similar to int41h/4fh Debugger installation check (code 05
8 j/ {8 d: P; p5 {( f' \& 06) but very limited because it's only available for Win95/98 (not NT)
7 X" i# a) t) W5 was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 y; \6 L1 v5 a' r5 Z( g* |& ?% G& Z! C( l" x
push 0000004fh ; function 4fh
' Z. d* `6 i; y8 z( ~: m push 002a002ah ; high word specifies which VxD (VWIN32) t* `0 E% |" o
; low word specifies which service3 A9 J" d5 x$ e. `& M; v
(VWIN32_Int41Dispatch). e# R& t) T. y2 r8 _
call Kernel32!ORD_001 ; VxdCall
* e" E/ o2 E, l9 ? cmp ax, 0f386h ; magic number returned by system debuggers, A- Q5 N+ K% D
jz SoftICE_detected
9 l' v5 @# t2 d9 l) e5 _% Y; w
( C* ?& N: K3 Q8 G: l% SHere again, several ways to detect it:. q1 b0 @+ }4 w4 U1 V; u
( J$ y2 c4 Y% S7 ` BPINT 41 if ax==4f
% C. B6 M0 o0 q+ V$ T% B1 [. y
% C9 Q4 w/ U; N! { BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 n0 D, H7 D" i8 x
- W: F6 _' F6 j9 Z5 i! B, w
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' d' d, Q# V* a( o. A
- r# `& w7 l0 L) k' D
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!1 a9 r M: W! z
/ H- c0 |4 U; d; ?3 N
__________________________________________________________________________
& o9 t: I+ }- ~/ i! X( v2 a) S/ B0 y" g. O* Q" C8 r8 P
Method 13
8 \1 e9 ]: ?9 \; c& `5 T3 X=========
( c/ _. ?( y3 X ?
9 I, n+ Q# j- l$ x$ R5 tNot a real method of detection, but a good way to know if SoftICE is% C6 V4 }# ^8 ]& L# a, r
installed on a computer and to locate its installation directory.
% G" C/ [/ f# y" b4 s+ [It is used by few softs which access the following registry keys (usually #2) :
/ v8 x/ Z8 D1 c- v! { R2 {! \- {, Q: i2 U# m0 ?& ]8 y. [$ i
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion {( R# V/ P. l) `' ^7 ~' B
\Uninstall\SoftICE
. N1 g0 c0 E2 s, E! V1 z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, h: t2 b: H% g
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# {: d" ?3 ^' ?# f
\App Paths\Loader32.Exe
; D L% L$ W" M; t5 J% w0 z6 H8 q2 o/ ^2 ~8 P( C5 i5 M
7 m# f* j5 c0 W1 d( T
Note that some nasty apps could then erase all files from SoftICE directory& t3 P8 M& I- l& p1 p3 X
(I faced that once :-(
" V2 I6 x9 d* t. W4 o
! u7 c# B4 O0 k; EUseful breakpoint to detect it:' C9 F+ H1 |, e) Y1 y
- K3 r5 N# q; ?% C3 y/ I BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: d' C7 [* Q# V6 [% g+ Q8 z# I: f+ Z6 y# b( M5 W' \& p
__________________________________________________________________________
! u" G* F0 w" \; z7 S5 L
2 k6 A6 B' P; ]9 ~' [: ~
2 v9 @( O- \! _$ K QMethod 14 - Q" d( e2 b$ J/ h3 s- c
=========
; _. m; i; I1 ^5 c8 ^' F0 Q: W. M- s" T8 l& \! G! u1 K- H- ]
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 V0 D* {2 t7 |. Q3 [
is to determines whether a debugger is running on your system (ring0 only).
2 G) P# x& V7 p$ E/ C! w- E, ~ n$ ]2 X, s
VMMCall Test_Debug_Installed# R& r5 u9 F7 m5 i3 K! i3 S
je not_installed
8 W: r7 u$ M- i/ ]4 f) ~9 ]9 R J9 S- h( z. q" ~
This service just checks a flag.$ M% a( m' B5 ?$ b7 @7 `2 `
</PRE></TD></TR></TBODY></TABLE> |