<TABLE width=500> U7 J2 u& ?+ Z- w# f m1 _
<TBODY>8 C; z2 v$ _5 _: E
<TR>3 I/ \0 t! K( J4 S" `) t) [) m8 _" k
<TD><PRE>Method 01
* z7 v% J4 P" G; s0 @4 Y: @=========
# ~2 @0 G9 r- c& U8 p; C6 ?" [; [" o/ ?1 k6 F9 R
This method of detection of SoftICE (as well as the following one) is) s( I) D4 A9 I. }" t2 Q* j( W
used by the majority of packers/encryptors found on Internet.
/ W |2 H) g# IIt seeks the signature of BoundsChecker in SoftICE$ A, M6 H ^ \9 d! a
' T% \5 W6 f" W3 x
mov ebp, 04243484Bh ; 'BCHK'/ t, t) A: Q9 i' b) K
mov ax, 04h
+ m% b: ?; _9 D; b0 l8 i. n int 3 , s1 _1 p$ h) s! ]" x- b- g/ Y
cmp al,4
& [6 \+ d/ h; |! T9 m( n jnz SoftICE_Detected
[, o; T1 ]) T& X, i" \4 t0 B* x9 R; U" z2 @
___________________________________________________________________________% j+ n3 _7 G" f; [/ ^4 n# C
6 E/ k0 b: I# G4 n5 _ H3 h8 @Method 029 A) y+ ?8 i+ b) I
=========% B7 V; X) ^+ d. L
$ z( B" L* t- x. K; r0 v: Z: NStill a method very much used (perhaps the most frequent one). It is used2 t6 `6 ]0 O" m, n$ M' N" O2 t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 C* J! s% k; R1 T
or execute SoftICE commands...) s! P, N0 ?8 d/ b. ]1 q4 t
It is also used to crash SoftICE and to force it to execute any commands( u5 u) M- k+ x; H& t( ?
(HBOOT...) :-(( ' J8 ~( D8 o# h* W' r
1 v' a. H7 s" F4 w* Z
Here is a quick description:
' E7 q% ^5 c* j$ y7 }/ e-AX = 0910h (Display string in SIce windows)0 b/ o! ?, K2 M7 W
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
7 `& z! Q# @( b8 g-AX = 0912h (Get breakpoint infos)
% n# @& }1 F6 U8 z! Q7 I% x-AX = 0913h (Set Sice breakpoints)% n, F$ N# }* Y/ S: i5 |0 w/ G" ^2 M
-AX = 0914h (Remove SIce breakoints)
* ^: R* v$ m. B1 ^$ s1 N+ r9 h6 }; f1 e1 Z
Each time you'll meet this trick, you'll see:
$ U4 M1 M- {, U9 r9 u4 Q8 ^( L-SI = 4647h/ v$ Z& [/ S& v
-DI = 4A4Dh
. c9 a* v6 w8 oWhich are the 'magic values' used by SoftIce.
8 v% J' Y; @* Y/ {) fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, T h: M, R5 H
3 t% f9 g. Z) C* B+ U+ C9 n. o7 w9 |4 EHere is one example from the file "Haspinst.exe" which is the dongle HASP) {- v) H4 f7 p: @% @
Envelope utility use to protect DOS applications:
* @. d* C8 r# X4 o7 g$ B- V/ G# T9 L2 Y' ?2 s: j$ q+ ?
" c: f; ?* G6 | H \, N4C19:0095 MOV AX,0911 ; execute command.
) B% u/ G1 b" y& [4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 L9 l- O r$ ]1 z. J
4C19:009A MOV SI,4647 ; 1st magic value.
2 z- d6 ]! i1 Z! `4C19:009D MOV DI,4A4D ; 2nd magic value.
7 e1 p' i* w A& f, m7 Q. X2 m& T& m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: v& c6 p2 g3 e2 K4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 @! i% F. B' [8 L3 D3 H1 M, M4 i1 Z: U
4C19:00A4 INC CX- P* v8 g! o* `# M
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 j: X- v M! M9 c) i: ]% l4C19:00A8 JB 0095 ; 6 different commands.# i' D, x: Y4 A# A$ | y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ C* N7 n }4 G; H4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 h( F9 W$ X; X& J+ O$ y! k
9 X" _$ C1 S9 j3 L. H4 |
The program will execute 6 different SIce commands located at ds:dx, which
9 X- Y" P8 G5 V& Z7 uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 e3 Y& B \" Z) T7 G* b
) c) G0 ~: v: U1 T% U n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' I' H, u0 [3 b; a' y3 Z; E9 r4 }0 H
___________________________________________________________________________
, l+ o9 N% x }. N+ x. q# O8 q$ [$ M5 q- e. u' H/ |$ a5 E; N
' D" J& k; k$ ]1 `- RMethod 03
$ {( }- a, M: V8 }8 w=========
% d0 ^6 p! e1 K4 z5 O* i3 S r. W: l; U$ V0 u: E x" {; r
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 p- n# }, R$ S
(API Get entry point)
' s3 \2 \5 r( |6 N& B1 l 2 G) b) D' Z+ u; H: M
; e5 @3 c8 e9 ] xor di,di
9 o5 j! P5 F/ ~7 q- g8 G mov es,di8 w! p7 r& S; W: U! Y/ h: J
mov ax, 1684h 4 I$ d3 I& H( y: i! E1 I
mov bx, 0202h ; VxD ID of winice
0 f" I" a B) S int 2Fh
. Y. h- x9 }+ l8 g0 r% d mov ax, es ; ES:DI -> VxD API entry point
4 p/ t* [7 g! B- U* i0 m: v' Y add ax, di
7 F: X" G1 X2 T6 v test ax,ax
. W/ p. y% J) G0 \9 [4 H jnz SoftICE_Detected% q( R/ f. t6 b- b$ w# ]
" T1 Y6 G l0 U- y* Q' @) |
___________________________________________________________________________
' b2 S' u/ \+ m8 ~, i V* M* V! r+ O& C
Method 04, k( C* O7 @) G# E* K6 n
=========
3 r5 E* a* u5 K6 n, O+ B4 t! R6 x/ s5 ^' T2 K
Method identical to the preceding one except that it seeks the ID of SoftICE
8 m3 Q" D, e* l2 p5 p& ^1 k- i4 E. rGFX VxD.$ f/ V' P4 k h0 ]. G5 |
) C! `4 q4 O3 U. s9 x! [2 ]
xor di,di
7 g( K: l7 U. \3 H6 k# Y9 R mov es,di9 I; O0 T- K# ^. ]& @+ q T! n, H0 M- T
mov ax, 1684h
% v$ j9 B/ o5 B& V mov bx, 7a5Fh ; VxD ID of SIWVID
( v& i5 l9 i/ x* r int 2fh
/ r: U; f7 i& B* B$ f mov ax, es ; ES:DI -> VxD API entry point
, n" i- E2 ^) M2 C add ax, di
$ L6 c# ~+ p; s0 a& F6 |# K/ q test ax,ax
6 ~+ i, h! L( V jnz SoftICE_Detected
0 _( }7 ]8 l9 V: n& Z7 e+ o7 [' R# x$ p* @) a" }+ ?
__________________________________________________________________________8 V( {$ p! e/ k# E" l
! V7 T9 Q+ V* d+ k, }2 g6 S. n6 h, e7 m3 a3 t, ?' ~# Z
Method 05
' T+ J0 @5 j: y# k# \=========. l. {7 V, s, O) t: R i, t
4 S2 m% D$ ]$ H. X2 x" l! z
Method seeking the 'magic number' 0F386h returned (in ax) by all system: r5 b0 c$ }0 \1 }9 V
debugger. It calls the int 41h, function 4Fh.9 k" H" I! J6 N, C. Z9 X" f& [
There are several alternatives. 9 d4 q4 h: W% ?- S# h, ~5 l
Q) E# ?' v) `The following one is the simplest:
* N) y; I# r' x i
) {* q+ n7 V4 E; {. P; ~& P mov ax,4fh" X3 h7 b! a, R, C) F& Z2 ~
int 41h3 b+ W. b* K/ P7 {, ~8 L
cmp ax, 0F386+ V5 F4 a B4 P2 R- W2 X0 `( i
jz SoftICE_detected4 z/ U; a H) e. D1 V
8 D& g \$ Q3 i; t. K+ s; Q- C. [( u5 m, f& x% Z/ B
Next method as well as the following one are 2 examples from Stone's
, K6 p& U! @3 a, H0 ^"stn-wid.zip" (www.cracking.net):
! {4 F }. `5 d6 k0 d
; ^8 v% h, O, |0 d) X mov bx, cs9 w8 z" h! ~- s P
lea dx, int41handler24 T; P4 L. b/ g& f8 ~( |8 l
xchg dx, es:[41h*4]
: A' a$ V# Y7 q xchg bx, es:[41h*4+2]# p2 H# _' |" T3 j/ C
mov ax,4fh
- P' q. `7 h( i int 41h @. ]/ Y$ ]5 T8 A/ {5 d5 j
xchg dx, es:[41h*4]
8 U6 h+ x7 d* N* K xchg bx, es:[41h*4+2]
H: N; F1 z y3 f: k! Q cmp ax, 0f386h
& V* B0 a( I& p0 {- ~! F jz SoftICE_detected
0 e- S( h$ J- M5 \& B- M+ e
$ A1 \5 Z( X# e& Q! nint41handler2 PROC7 F* k9 [* _. a; C; H: y2 f
iret4 Q! E" m d' A- X! `: c
int41handler2 ENDP7 y8 _' a% g/ c
" b; W5 f$ V4 A1 q0 w; n
* [# a7 n' W; S3 s7 N_________________________________________________________________________& K8 ]4 p+ w. k' a6 R
2 B$ V/ c( e0 [. ?/ Y5 h" z2 h H$ [% N- m
Method 06
5 n: l7 v: Y& B# K7 V=========
U" X4 @3 c1 N. w/ S3 ]. I' N. K D; c1 W J4 Y2 d
, r( _. W, d1 H8 F, ~) t5 }2nd method similar to the preceding one but more difficult to detect:# b) @5 Y3 s' a9 i6 I
2 W4 @7 Q& t8 b9 c( y7 V" j3 y7 X
]# ~2 I: D9 U; g4 n! S: ^int41handler PROC
\ E$ W9 {6 t mov cl,al4 c# D* M; d6 l/ `
iret
" K; y# c; N3 S! W {int41handler ENDP
8 \" v( d. l& v) q6 ~* B3 a- w& G" O3 Q, H$ i9 N/ @! y- P+ n. K
. G& i& ] W* p) P8 @& g) Z0 ?( E r
xor ax,ax% ?' w8 S, U7 D' V, Y( z7 i4 i
mov es,ax4 B& @, E8 O w1 Z/ @
mov bx, cs+ q5 [# x2 m1 ]0 E
lea dx, int41handler
z2 o# t) q5 Y3 k0 W6 T4 w# a# } xchg dx, es:[41h*4]$ ?# Y1 {& B; s1 C
xchg bx, es:[41h*4+2]
& Y; g8 X8 P+ G$ ~' e: v; _: R in al, 40h
; Z x% h0 E" @. J: L. u xor cx,cx+ f) S# _ r" p
int 41h
- P1 e% [- s9 s4 n7 N xchg dx, es:[41h*4]
7 @% v ]/ M) \1 O9 @! K xchg bx, es:[41h*4+2]
- k% Z; d* D' b4 V cmp cl,al+ ^0 r$ Z' v( S# N
jnz SoftICE_detected
) P8 Z9 a+ w, x2 J, R) K9 K3 `: u$ F9 ~
_________________________________________________________________________
6 @6 R$ C2 T' N4 q% m, T: Y2 I( Q1 g( `! h; ^8 l* N
Method 07/ l- _" D" a4 a. Y. F9 s4 V
=========0 J. x. e. A/ \) H
5 L3 n* t; d9 O$ P& _7 h" YMethod of detection of the WinICE handler in the int68h (V86)' f" }+ E( ~! E0 O
% F: d) j9 e3 F& } J2 q! g% U" O
mov ah,43h
9 H& y; r+ o6 d9 G _) Z8 }2 [5 O int 68h
1 h+ f3 O8 Y Q4 d2 s, Y# w cmp ax,0F386h
) Q \: |" e7 {6 K! ^ jz SoftICE_Detected2 Y( `+ r+ k3 h1 ~! m) L
# A! v( L2 B+ t
& h8 H8 t: [5 k
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 `! g* a' }* A app like this:2 }% Z' \" D6 c- n( H
9 H' J, c6 g Y" C
BPX exec_int if ax==68
2 w1 h! z7 {3 }2 b+ q (function called is located at byte ptr [ebp+1Dh] and client eip is0 }- Q4 v' m4 f2 I% a/ i. [$ H7 C$ ^
located at [ebp+48h] for 32Bit apps)
: K7 z, m, c1 B w__________________________________________________________________________
+ \+ S# j& b7 g3 C
+ V) _, l0 C( w, y, H B* i
. ~! Y5 K2 N3 P: |Method 08- n4 E# z+ k, {# C5 p- C$ k
=========
$ d! O* p. Y; K) E; _
5 N% V( d' h" t3 S1 G' d8 nIt is not a method of detection of SoftICE but a possibility to crash the6 d) M' T1 U( E k8 w, h
system by intercepting int 01h and int 03h and redirecting them to another! m8 p$ B; @0 z# C, }' C
routine.+ w8 v- X& v. K8 F
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" j/ R- T/ o: F7 i$ l- [to the new routine to execute (hangs computer...)
# V) z. }* }. \% J& i' b2 P6 n6 _0 ?7 S5 r
mov ah, 25h* n- Z3 V: a5 |& c* v
mov al, Int_Number (01h or 03h)# U+ [2 M) d v: X
mov dx, offset New_Int_Routine
* ], L% D( a4 `) u% v' Y0 b int 21h9 [: F+ U0 z/ ]) y" T$ A
. K& A. |" g" j! N1 L/ {__________________________________________________________________________
2 Z8 p9 J2 k0 F& V, K
/ O) I. z! r9 G/ _9 AMethod 090 |. q; }: X4 _3 T9 ]' {
=========
% h* n: [* ~6 Q) B# \& `# a! G" U5 c) l, p9 ]' f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) P% @, o: S$ a X& S% Qperformed in ring0 (VxD or a ring3 app using the VxdCall).
& t2 Z5 N: I6 o; QThe Get_DDB service is used to determine whether or not a VxD is installed4 j) k5 [1 s' q+ s) Y+ s. s/ C
for the specified device and returns a Device Description Block (in ecx) for6 q6 o( N6 s% B; g* s3 [5 c$ ]
that device if it is installed.+ A3 v$ t2 N3 a2 A1 [
3 m3 Y' y, \: j0 H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 S) q1 W. l/ W# B mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ B# ~3 }+ N% V& Y# x! M VMMCall Get_DDB
, k( g! F2 X" L, ~( x9 g! H" x mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 a; A* i* l+ f* G
. M6 `; N2 _4 j( h1 Y, KNote as well that you can easily detect this method with SoftICE:
+ B6 k0 Y0 {: P; @% h4 C6 @ bpx Get_DDB if ax==0202 || ax==7a5fh
6 ]$ U L- k8 }! w$ l4 u/ Y4 z
__________________________________________________________________________
0 m& i" n1 M0 z0 v7 Z, h' k! g$ `0 F% a7 q
Method 10- i8 c! i, v4 _/ V
=========
1 @- f8 F5 H$ N, ~7 w
. J8 Q" w2 g7 u0 w' U0 V=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ K5 e4 C+ {+ M- V SoftICE while the option is enable!!
r3 G. C- n( r9 X3 _$ @
& S" r) x8 ^0 N; j' K4 i+ jThis trick is very efficient:/ {- D" v& S" i
by checking the Debug Registers, you can detect if SoftICE is loaded. a% Y# o' A3 e% D8 w
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 m& l; O9 r6 }/ }% m* s, |there are some memory breakpoints set (dr0 to dr3) simply by reading their& B6 y' V1 a5 i8 q1 N- K7 A
value (in ring0 only). Values can be manipulated and or changed as well6 U2 z' u9 K+ j
(clearing BPMs for instance)
f# A+ ~% l% [4 D2 I3 T6 Y
2 B4 O0 D2 U L2 v r5 j__________________________________________________________________________
+ l+ \; [ n* T
& s5 L: w) O: u* @4 `' ` V: H# GMethod 11
: b6 d+ b9 N/ O5 {2 U* Z# d=========
# o+ R: S" c) ^+ R; h. ]/ X/ ]. d7 K' G. [9 S0 p9 ]' d: Y
This method is most known as 'MeltICE' because it has been freely distributed
" f4 z5 l9 M; I% Y* i- Mvia www.winfiles.com. However it was first used by NuMega people to allow
# ^8 b Q9 G! y8 e. Y4 {Symbol Loader to check if SoftICE was active or not (the code is located: D9 n9 T* U: J4 y1 @4 i
inside nmtrans.dll).
# K* L& u4 p/ a" L* W: X# @0 T$ R# ]& z& f1 |4 u/ E
The way it works is very simple:9 W; c6 l3 ~& Y& R; M/ ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* |0 x6 X5 j1 n5 SWinNT) with the CreateFileA API.( V' f$ ?' m! r* c
6 z, y. N- G; sHere is a sample (checking for 'SICE'):
6 ^8 e7 s- m6 [& g$ e9 X+ c" b* z, \$ r/ x
BOOL IsSoftIce95Loaded()
! Y3 ?0 `- t. m+ E% _{
$ C) d. v% N) d$ ~0 C! I% q HANDLE hFile; ; s3 m* S! E! t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. N) Z' ?( x' Z4 _9 w
FILE_SHARE_READ | FILE_SHARE_WRITE,! V! {6 ] ^( M& E% Y: k! e# r1 k
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% ?# O6 `; f G) c1 H R: V5 j if( hFile != INVALID_HANDLE_VALUE )
* L; T. O# W+ P; U( }/ J$ ]5 j {- ~" C! i; g1 |; T! o. f( \
CloseHandle(hFile);
/ d# j- E$ L; {) G% K return TRUE;
9 ]- a% e6 _& y: E }
6 f& p! Y7 Z0 ]$ Z8 d, { return FALSE;
u8 B# u+ d4 o3 K( f}& D# T; }, J. ^5 U
. L" V/ X! S# p3 m3 U, X' ]4 sAlthough this trick calls the CreateFileA function, don't even expect to be
# f* \: m8 m' M6 ]" J* Y) vable to intercept it by installing a IFS hook: it will not work, no way!$ H- y8 j6 n; N9 q" n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F# I: K2 r% ?0 R
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( m' E1 v6 g7 x( |
and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 _$ @5 G9 l- C) S% z1 C
field.7 ?" d8 O' s9 w9 o! A0 Y0 n/ O- n
In fact, its purpose is not to load/unload VxDs but only to send a
& s5 j) p, _8 L. [5 M- y! RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: V" z- g, [ u7 C' \# Uto the VxD Control_Dispatch proc (how the hell a shareware soft could try. ]8 P$ `! ^; D" U5 Z8 S
to load/unload a non-dynamically loadable driver such as SoftICE ;-). O6 A' _$ i- o1 H, W
If the VxD is loaded, it will always clear eax and the Carry flag to allow/ W: Z# i5 B3 @
its handle to be opened and then, will be detected./ ]3 K7 F% C# _; }# ?1 j$ Q
You can check that simply by hooking Winice.exe control proc entry point0 B( ?0 K7 i. ?1 P* r& i
while running MeltICE.
+ C6 ^& {: N5 B( D4 b$ I
6 j; A- ]8 y5 k7 y
2 `: [* N4 e7 y# _- m 00401067: push 00402025 ; \\.\SICE
( g6 B8 D& @( n 0040106C: call CreateFileA% r% F1 g2 n& u0 W8 i$ j* x0 F
00401071: cmp eax,-001 I% Q6 C. z8 L* O- j6 R
00401074: je 00401091
9 U. h( S4 w3 i' ~; v7 o& o- _! Q7 O& p+ S
! ?/ R! M! Z: A$ g2 u; j
There could be hundreds of BPX you could use to detect this trick.6 G' R+ U" h' p _
-The most classical one is:" O2 L1 Y) e B1 m9 m: \
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; T# R7 U5 x% Z5 C B+ \: m9 c *(esp->4+4)=='NTIC'
, ]6 }3 }5 I2 ^3 ^( K. C+ O0 B4 z! m3 ^' r
-The most exotic ones (could be very slooooow :-(5 A5 N2 T$ o# L6 J' ^$ j
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : V' S3 v1 [9 c" Y! V
;will break 3 times :-(( Y, X( h8 @' T+ d& s
T3 C* y4 s2 @8 ~# h8 ~-or (a bit) faster:
" v4 [1 R" G- L" a- L BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 k+ p% t! m; g" h, f+ ?
( x# e1 c3 z8 D. J" }) x* l$ |3 p _ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 L' ^9 [& f0 V; K' M/ u0 S
;will break 3 times :-(
& C' h7 n0 c/ x& ]; ~: C+ |3 Z( j6 [7 {+ w' k
-Much faster:- U) w" j# H1 r
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ k( [( H9 |9 c
+ L5 l, U9 X* T; {: DNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
' h2 c: L3 J- l6 k* q/ wfunction to do the same job:
1 K& B- \3 Y( P7 P2 Z0 p/ }
8 A7 r: y! p8 {+ L push 00 ; OF_READ5 D& p- H* q6 `% p
mov eax,[00656634] ; '\\.\SICE',0
, [. j" t7 }4 q! G6 Q- z! I* C push eax; S. ~5 z h* O" Y+ |$ B
call KERNEL32!_lopen
+ b# y- \" }% L% ^ inc eax
9 o; e+ X, O& V7 G jnz 00650589 ; detected
; t& L8 W% r- Q! X) ]: d push 00 ; OF_READ
0 a: A5 V; w. u# |$ c1 Y mov eax,[00656638] ; '\\.\SICE'
$ c4 q& \2 F, q! r; q4 s push eax7 \% K6 c3 t; D! G/ a. X) C$ A
call KERNEL32!_lopen
) e- r* X0 `4 h3 J, k5 L' T2 Q. _ inc eax
# d+ P$ A/ N& B jz 006505ae ; not detected
4 O0 x8 w* K4 f* ~! P5 ^- q
1 v9 Q4 B- P; l9 n& N- m
" j, n' p6 f3 m$ U' i. e__________________________________________________________________________' r/ ~' t0 j& v% i- {- u3 c! h
( O$ |# g& ]- [$ E
Method 12
+ e* G5 |- f* e=========* Z3 K4 {! ^& n" P
; D) z( k% A* O2 K1 R
This trick is similar to int41h/4fh Debugger installation check (code 05
+ `" y- T& [+ M6 Y& 06) but very limited because it's only available for Win95/98 (not NT)# i% s8 ^4 K7 ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& D/ o* N c: U$ |/ }* ?- H! ?# F6 W' E; h
push 0000004fh ; function 4fh
( m. O' [* i+ N$ t n push 002a002ah ; high word specifies which VxD (VWIN32)
0 ~" Q3 R0 O' S: W, q& ~0 f2 j ; low word specifies which service
+ Z" |$ y; |, G4 W (VWIN32_Int41Dispatch)
" T1 H8 D# e+ n; s O6 U call Kernel32!ORD_001 ; VxdCall
; m1 V7 C: r8 r cmp ax, 0f386h ; magic number returned by system debuggers& ^$ S7 ]3 v6 M
jz SoftICE_detected
" V5 _* [/ a5 |! e" {" Y. G5 _( |$ {3 F0 z& c7 Q2 z- u' L- A
Here again, several ways to detect it:" a3 ` V- t9 V0 q) L& n
" Z3 q* M' W* Y/ \1 h& h) h BPINT 41 if ax==4f! W: o+ C, O* }7 e& \3 D
/ E9 c: `/ A! }: `5 x
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 T8 i- j/ t( t2 D' F h7 g3 Z! H# r: ^$ `- d+ v: I
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 w5 {" |9 k- P5 b2 E/ @
+ C( \2 j6 W" ]' w8 ?: I2 G BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 U0 k' n Y+ t" k- L) o
0 u' B/ L2 @# N; _% U& C__________________________________________________________________________
1 n$ {) r% n- }2 ~6 b* u/ h- b$ x$ }3 W& l
Method 134 _3 W. @7 S: N }+ n: p$ v# R$ k
=========
% g- y! [) Q7 K) ~4 P/ s0 n6 L9 ?4 ?8 c ~. G4 M
Not a real method of detection, but a good way to know if SoftICE is
" Z( I4 l3 k! X1 binstalled on a computer and to locate its installation directory.
8 f5 h/ y( l OIt is used by few softs which access the following registry keys (usually #2) :* G6 q f) P/ Q9 |; C
* }4 X0 X7 x; }: a7 P% W t& P
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 }8 b2 D! O% w9 c\Uninstall\SoftICE
: G4 g6 C" \5 G-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* [/ }, X) O8 e0 v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# w1 Y- P3 E- N9 @, Y; h\App Paths\Loader32.Exe
/ s+ `1 Z& r" c; f% ~7 d+ f. C+ c) E" Q3 L2 Q) f' B
. n& M8 s" q; ?' t6 b" s6 R; `Note that some nasty apps could then erase all files from SoftICE directory$ K: v2 _3 Q9 [
(I faced that once :-(
7 \7 o# E, Y% ?0 L9 N. ]) r" x8 k/ D
Useful breakpoint to detect it:
! I+ V8 V% c% l; @
1 T/ O) X2 t* ^9 k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 u6 K, Y O1 k
j- U7 b$ J: c: D% A& j( e__________________________________________________________________________
8 t" Y# k7 H, p- w3 G6 T+ X: N% l. S0 X
+ N* k) d% C8 v& R! EMethod 14
+ a7 a* \8 x; ]=========- f4 @( ?3 f; n! k
) c9 _- b% Q7 O+ C4 @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: y1 ^9 a/ X2 @. m9 L6 w7 P
is to determines whether a debugger is running on your system (ring0 only).- {; g: y v- o/ }: V
+ @9 o1 H* S: J1 w }: G VMMCall Test_Debug_Installed* X* k* g9 m7 S9 R5 }0 B
je not_installed
) Y0 |2 ~7 a6 F% [" ?$ u+ [6 I3 f+ m% a
This service just checks a flag.
4 G1 _" t8 K" P/ m$ } ^- n, G</PRE></TD></TR></TBODY></TABLE> |