<TABLE width=500>% \, E* b9 |; p/ v
<TBODY>+ v& X4 r% ]/ d% N4 o
<TR>6 @( U3 I7 m, n, v- m
<TD><PRE>Method 01 " l s- _, O5 J+ V
=========; j' z; y8 |. u$ A% V
9 t# a9 d. {: _8 H( m2 A9 MThis method of detection of SoftICE (as well as the following one) is
6 o& y# w. s# T0 f* z4 e8 T9 `% Sused by the majority of packers/encryptors found on Internet.
6 e; L: v" \% s' sIt seeks the signature of BoundsChecker in SoftICE2 }2 l3 m' x* s e! u
' Y0 ^# J8 O, y$ \' _ mov ebp, 04243484Bh ; 'BCHK'
# `/ n9 F1 F9 d mov ax, 04h: m3 p1 j( D+ ~7 @2 J- [
int 3
3 _6 _! g) {7 B) L cmp al,4
0 p9 S' j2 ?3 }3 I* T& D/ G jnz SoftICE_Detected
+ K$ a5 y2 ?) B- l4 j% A, o: e2 E; s" q- w/ T
___________________________________________________________________________5 a- |. i3 v h
8 ~# @; j' M9 M% h7 B0 {& C
Method 02
7 v1 J* X0 A; L7 B* W=========
- {3 h* A# g0 L+ p8 M, Q+ U' h4 j% o/ o9 r, e M
Still a method very much used (perhaps the most frequent one). It is used
( M6 Q6 ~8 y8 x5 Q: d3 j5 v$ dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ [( U" `0 ?) t* f! p3 J( Por execute SoftICE commands...5 [, \( @! o9 [
It is also used to crash SoftICE and to force it to execute any commands
& x3 I8 K" }1 @9 R. b# r! F# b K(HBOOT...) :-((
+ D- g5 L! o, G1 F* N4 Z
# Q$ B v* u4 g4 p" T. KHere is a quick description:
$ K7 n1 Y7 r) N. K: |7 W-AX = 0910h (Display string in SIce windows)1 I, k" n! k' D* o5 U7 P
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 l/ [1 `- x( D) [) Y-AX = 0912h (Get breakpoint infos)4 l9 Z. [/ Y5 M, U0 C
-AX = 0913h (Set Sice breakpoints)( o- f) K6 u! Z
-AX = 0914h (Remove SIce breakoints)
5 }+ L+ q. V& {# h8 l9 U/ o, d; r0 i
+ W6 z( k& l6 i: `' \* r9 s. K8 qEach time you'll meet this trick, you'll see:
9 n" c! z2 u7 @3 ]-SI = 4647h
! l" o4 [2 @! \3 n$ U-DI = 4A4Dh) m1 j% U) S5 K! o0 F' V
Which are the 'magic values' used by SoftIce.
1 N$ T+ ~, q1 L8 oFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. p' M% ]/ Y, n3 r7 i) X, }# A b7 `0 a! S( w% N
Here is one example from the file "Haspinst.exe" which is the dongle HASP" H7 @: L# ]$ r: r8 v- T! k6 K' H* g
Envelope utility use to protect DOS applications:! S# e% b- T8 n+ Q) `. c
4 E% o2 a$ Q' T( i/ W }1 G9 L1 A
" Y. t! n; C6 t$ Z) M) F
4C19:0095 MOV AX,0911 ; execute command.! H4 {; _/ d6 B# v! }2 b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 Z* c. X. n @
4C19:009A MOV SI,4647 ; 1st magic value.: \- f* g- I3 d, a5 Y
4C19:009D MOV DI,4A4D ; 2nd magic value.0 V- d7 I; _/ u) h! o" q: p" e
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 ]1 u u( f$ e& D# {! [* t& ~8 A4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
( v, Q$ E; F0 R. B3 D1 c4C19:00A4 INC CX
+ h5 h1 }8 j) g9 E+ P9 z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 {% z a0 c$ B. g1 k
4C19:00A8 JB 0095 ; 6 different commands.
u; d1 O2 i; w1 E* M4C19:00AA JMP 0002 ; Bad_Guy jmp back.! ]1 ?6 s$ s/ g+ Q1 o. I$ T2 d
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' G( r, T- u8 b8 F9 [: J$ z) q+ _+ y0 q; M" \3 d9 a* h" O- j
The program will execute 6 different SIce commands located at ds:dx, which
. V, t+ ?* c: m* o% \are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 {' j# Y4 C. a4 V |( J; J( Z/ E! m% V
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) N" d" ?9 o+ k- R4 a5 Q___________________________________________________________________________
( ` e1 s. J: G
- e5 @, x: o# U; f; E
; O' G+ y: ]$ S1 J5 TMethod 030 G5 _5 o: X2 ]5 Z& b
=========1 D) X$ \+ q% Q C
3 ^5 r, K5 L) f+ X6 L% u
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 _* o8 ?. }0 p* c! u" a, y7 m
(API Get entry point)+ H4 S6 y- W! m# @2 r3 U
: \ m' U. m! F, D/ X7 a
& N7 K8 @' m9 B) t' @ xor di,di5 Z3 d% M0 ]9 Z, U. z. x$ ?
mov es,di) Y5 J& F% a" j) g
mov ax, 1684h # w: f" Z" X, j: j3 s) Q/ s; M9 e
mov bx, 0202h ; VxD ID of winice# J, ?9 [5 _- A8 {
int 2Fh
! F# C4 l: U8 A$ f% d mov ax, es ; ES:DI -> VxD API entry point
4 E7 t7 w \8 M, t5 c add ax, di3 Y# q( P; z0 z6 c1 x8 n- N
test ax,ax- v2 G9 f1 \0 |2 J
jnz SoftICE_Detected7 ~% L! k4 B Y- Y# w
2 t. _+ l! [. X, \___________________________________________________________________________ W5 R% j" t- {2 k2 z
3 f/ \. g/ I$ P( G9 y7 P
Method 04
) f7 Y8 h3 g& y( @% M=========
; c5 K( c5 ^! b# I$ w* @% U
' \# |1 P% ]" P3 V1 x# nMethod identical to the preceding one except that it seeks the ID of SoftICE& D+ @/ o- U% J% \1 i7 Q
GFX VxD.% E @( c1 i8 O8 O" A7 s. J
% w$ M# [% `& o+ C$ }1 ] xor di,di6 @: w% q+ e2 n: i) K ~2 J9 ^
mov es,di
7 F) B8 i. j. f2 N mov ax, 1684h
; A* o* D! t9 ?9 \3 y8 } mov bx, 7a5Fh ; VxD ID of SIWVID
' n5 l. ~1 y' p" @% H5 v int 2fh
' _9 e9 D* I9 l4 J7 b3 _ h mov ax, es ; ES:DI -> VxD API entry point
5 t# R$ q. z) J7 Z- { add ax, di6 ?) \1 F4 P) E0 T `: f1 x
test ax,ax j; F# Q' u9 b
jnz SoftICE_Detected
+ y U6 `/ {5 |4 Y: o; D* w/ ~
) \5 I% J5 E& k- j) k' W& B2 D1 d__________________________________________________________________________- m @4 C: P4 }, o( y) a2 r
" D) c" p! t. y1 _% z
: s8 x% a* g$ ~/ c! `# @5 f l; l. [Method 051 |; V8 [7 W% m6 y" E1 k
=========
* o6 c \; i% J) n* v* N6 @! V% d7 f( M/ O- M" I) R
Method seeking the 'magic number' 0F386h returned (in ax) by all system p; ^# J5 H5 N& t
debugger. It calls the int 41h, function 4Fh.. j( c5 v6 r' ?% ]# n! k8 `8 f
There are several alternatives. 2 q e/ E) i% }' Y* h! ^
! c* t1 K4 B0 V5 p
The following one is the simplest:. I& y. F, c9 z5 W1 F' W
" |# V: `- a: u
mov ax,4fh
- `1 U2 `, f% w# ] int 41h
. y3 y, x- U, V/ v cmp ax, 0F386
3 u+ \; B) m: n( O9 F! M: Z jz SoftICE_detected
3 O, s4 d- D: u# U
( K: g: x% A9 t: u' L+ v
2 P; T- z' x" v8 WNext method as well as the following one are 2 examples from Stone's ( [7 {& ^6 T- G. I! F( P8 p
"stn-wid.zip" (www.cracking.net):
& o) g( k% B; r% v
8 n4 m, H7 O$ B. I2 ~ mov bx, cs
& k- \2 ?. S1 i/ u. i: @: ~! [ lea dx, int41handler2
/ A* W; Z2 {- _6 g/ e- M xchg dx, es:[41h*4]
; `0 m7 S6 @: J# d* q4 E+ O xchg bx, es:[41h*4+2]8 D9 B3 {$ k4 {' I# Y+ M- d
mov ax,4fh$ f; y( ?2 a& ?: j
int 41h: O6 A4 k$ r0 j
xchg dx, es:[41h*4]' G5 C, v/ K6 b) P2 L- F: d- k( b
xchg bx, es:[41h*4+2] b0 J. X* [3 n. S2 u
cmp ax, 0f386h
1 w4 n) r: G! d# R jz SoftICE_detected$ [, o& d3 M( l; t# \* `( g1 g* [
8 l8 v6 u/ R, B5 A0 bint41handler2 PROC! x5 \7 |" f2 ^+ \
iret
7 p- C& p3 G& Fint41handler2 ENDP
- V6 u. [0 s3 o, q+ h9 W+ d b$ z4 S3 h' v
; g9 r M, M7 U7 x/ M* r8 l; A_________________________________________________________________________
! x# D+ {0 K) a+ H
" ? S( k Y4 J. q' {% z; o/ D8 T& r! G" A, j6 Z3 P- U
Method 06
- f) M1 v- A% ?8 }9 b3 J }4 B6 U=========
6 q. H2 t s6 Q- d
0 k) S( ~0 I+ e6 r5 d& v/ N( O r/ {1 q$ `5 v. |
2nd method similar to the preceding one but more difficult to detect:
4 \3 K5 T$ G6 {7 B" u. {
& }1 D& m$ M* {) v4 c/ z
3 E' i3 H% p; o$ [" L* i- Qint41handler PROC' P, b; }3 O! G% E! ~; c+ d. F3 A
mov cl,al
% A) v1 _. R& T6 A' _. j2 J iret
1 X! x6 X v) N' M- Xint41handler ENDP
. K+ S2 e9 V- @) x% _
" l% T+ ]; ?) a: P3 A
+ c0 K5 E$ x2 G/ m" Q xor ax,ax
% N. u [' a( U3 Z' z9 w mov es,ax7 k4 m0 X7 Z \
mov bx, cs3 R6 E b/ D3 Z O5 |# o2 w$ Y. F
lea dx, int41handler/ B l7 N* _) Z ]7 I* e
xchg dx, es:[41h*4]
2 [. K2 E( W' [ l1 Y xchg bx, es:[41h*4+2]1 G) `6 R+ ^: f0 D' C$ ~: s
in al, 40h
- @9 Z+ W- F) k: A6 P+ p4 a1 X% q xor cx,cx S7 L% t5 f! A8 I% L7 N7 `6 Y
int 41h/ f, c: v5 d5 v' z v) H: E
xchg dx, es:[41h*4]' a$ p$ ~+ f+ o' w" I5 B
xchg bx, es:[41h*4+2]
8 {$ p9 }5 f" C+ F d0 a cmp cl,al
8 T S+ F: \$ o/ a2 H& W0 q; h% a jnz SoftICE_detected
) ^: s( p' @+ l+ m) ~8 D! p# k# E q& k
_________________________________________________________________________! K1 f4 [9 s; d
7 J. z& w. G1 C) X: YMethod 07/ M- T9 C f: `8 \* e
=========1 S7 ^# S- b$ S& @1 ]+ u
. ~+ T' X- z O2 V8 ]
Method of detection of the WinICE handler in the int68h (V86)* T5 z4 f. Z& w& q! m
. W: u( ]5 s" N mov ah,43h
* D+ }& N% o+ A$ f int 68h
7 E7 W* _5 u6 J- x4 |+ K cmp ax,0F386h
7 [* q/ \& S' K- b3 ^ t jz SoftICE_Detected
% Y2 Q9 B" u% n9 e/ F2 ^1 S6 `
. \. M( }' y0 i" W2 S: y% S9 G/ v! _: L& @$ M4 h
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
W6 d% R0 X9 ^/ v3 L app like this:) |1 @6 t, k6 p1 c+ M6 X
% o' r% H# q3 e' Q, b. ^+ Z
BPX exec_int if ax==680 ~9 {4 u2 a2 R Y
(function called is located at byte ptr [ebp+1Dh] and client eip is& p* _ ]: N8 q, u- Y
located at [ebp+48h] for 32Bit apps), R7 ^; n0 N8 o
__________________________________________________________________________
2 w' B3 t$ ]) S( X0 c- D2 d3 U$ p% T
. w3 F- I5 m) d! `3 I
( j, B# w5 S3 h+ q$ B! W% |Method 08. c% k& t9 H' ]' T8 s* C1 I
=========8 q0 l# f4 A0 {# S( W; \: t
( T/ D* d3 ]9 U9 A# J' N
It is not a method of detection of SoftICE but a possibility to crash the6 R3 z3 r+ q0 S& |" N
system by intercepting int 01h and int 03h and redirecting them to another
: L$ c3 S; r) j: R) C, `routine.7 |/ D' g2 l3 F; S7 z
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 T- e4 x9 J) _. S1 l: c5 C; vto the new routine to execute (hangs computer...)+ b8 A+ B! u8 Z# e! {* X
+ u1 _; U6 x( J& G& H mov ah, 25h
. `) M) p4 P# @2 D( n! l mov al, Int_Number (01h or 03h)
, W7 H9 @! M& y$ v mov dx, offset New_Int_Routine" q$ K' |$ J% ` j8 S7 X
int 21h: D9 |5 C/ L# H2 O2 V5 A: g
' T; O, b9 ^% w$ v1 y! O$ h__________________________________________________________________________1 K Q- S7 p3 X8 D* w- u$ I
/ f' s/ X% n' B4 vMethod 090 h/ C0 Z; W2 O( w& K$ r" p% [
=========% ~1 M& @6 [7 K1 N% ]$ ~) u% r
& U0 H0 X+ U, x( s. i3 g& a+ \This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) x; a7 A7 d' m* \" \: k
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 ^. ]# L# {' Z1 M% C2 `The Get_DDB service is used to determine whether or not a VxD is installed2 I8 ]2 M% B! a, C( S
for the specified device and returns a Device Description Block (in ecx) for
O, Q% |6 J. f& q5 Zthat device if it is installed.
6 }0 @8 U# Y: { f0 o4 F- B' P" u* b4 K
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- q& L( d. C! X0 {) g
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 ]/ y; \. \( h+ o5 u M VMMCall Get_DDB
9 ^9 J/ Y: C# ?. @, p mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( F& f! Z* |" K" K! ]
. {$ I9 x3 C# x2 @& ]/ }! ]. _Note as well that you can easily detect this method with SoftICE:
6 g, _/ ?$ K8 q, n4 h7 w! B bpx Get_DDB if ax==0202 || ax==7a5fh
4 X- D0 E6 h) E1 n, X5 s _0 d
8 D" P7 U( Y( a0 c9 M__________________________________________________________________________
1 x/ S( F, v( l3 m" R- D
" ]- K8 E; N' A" m6 ZMethod 10. ~! d: S5 C" o6 k2 d5 p
=========
3 |7 z6 K% F' i$ L, |3 b7 i7 C4 m; Q0 Z' N' B: F# J
=>Disable or clear breakpoints before using this feature. DO NOT trace with" j8 h0 B* Y9 _( \' Q% g# K. p5 ~
SoftICE while the option is enable!!
$ Q4 m5 |: r1 p( _9 v
2 a( [/ t. Z1 V: y# k% eThis trick is very efficient:
" k, X k& U7 `. }# f4 F- Sby checking the Debug Registers, you can detect if SoftICE is loaded# j2 g% p; ], {! M
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 Z q# n: l+ athere are some memory breakpoints set (dr0 to dr3) simply by reading their6 c# d' [) W: d! Y7 n" c
value (in ring0 only). Values can be manipulated and or changed as well
' K9 ?: R4 L' e7 J* ]. |(clearing BPMs for instance)
4 s' h: j" X$ P
" J O( s- p5 c' D1 I/ n__________________________________________________________________________" [ X# n' i6 A$ c5 Y
4 m# v, S# A1 g y/ T6 W, X8 e8 v$ j
Method 11: U# m6 u3 H1 y* d3 N+ c
=========, \( G3 K2 }- p B6 ?+ [* \
1 e4 g0 U! v* i2 }: s' p7 ~This method is most known as 'MeltICE' because it has been freely distributed' y) l/ |3 N) g! [$ k( n
via www.winfiles.com. However it was first used by NuMega people to allow M4 D2 ?5 I6 H: R
Symbol Loader to check if SoftICE was active or not (the code is located* p; q9 Z( h/ g4 {0 `2 C- J) l- f) d
inside nmtrans.dll).+ E$ V3 }/ {! {! n" N
, R& n1 O7 t+ ^8 w2 Y+ J) FThe way it works is very simple:2 m2 f6 K4 s- }! H4 X2 F$ x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! m9 p4 d' k1 Q4 Q, s) \! {, Q7 ?
WinNT) with the CreateFileA API.% z0 D- R/ T+ y. ^$ L
2 r, w1 _. S6 A' ] ]1 B
Here is a sample (checking for 'SICE'):5 [- T* R1 G: E8 }$ R
/ n; `. I1 F- w/ QBOOL IsSoftIce95Loaded()
6 `0 u6 b! Q8 X, g- S{
% _, K; G0 E3 ^3 O( \$ M% n HANDLE hFile; 3 F4 Z8 c% O8 I# h4 s9 ^# O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, @7 p! ?5 U2 M FILE_SHARE_READ | FILE_SHARE_WRITE,! Y$ w% |7 E# v; ~, F. E' Y% \
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);& {! w# ~* Z6 H" V2 H7 t3 P/ Q
if( hFile != INVALID_HANDLE_VALUE ) _3 g" R" h0 r- X0 L
{% g* y; w# t& L7 E8 @( y4 v9 k$ a
CloseHandle(hFile);
7 w5 d/ u* O( ^ return TRUE;
6 W0 R) c: i( y: c: |% Q }/ Z# t7 j6 F% e# t; T/ @
return FALSE;7 a+ u! |5 P6 N/ U
}
! I8 R1 B; P7 U4 P! }+ c
8 \6 v F" |! U8 P2 ~Although this trick calls the CreateFileA function, don't even expect to be p3 N- u7 X) N
able to intercept it by installing a IFS hook: it will not work, no way!& ], z7 B8 N) n! ^$ f, m0 z. O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
% P2 f' U, k8 wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 p& [ S7 s. o$ ^3 ?
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ p* @3 s* Q2 S/ V/ E1 o
field.5 }- t6 L! C1 N" v
In fact, its purpose is not to load/unload VxDs but only to send a 5 V- T6 p0 c$ W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
6 l {0 c) X4 ^8 x4 e. x7 ~to the VxD Control_Dispatch proc (how the hell a shareware soft could try. r3 r: k0 q* O
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* k2 W, z- _7 L3 \+ I" ?& K6 w
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 F% L! ^1 j+ T3 C& Z8 K) j: iits handle to be opened and then, will be detected.8 t0 J" `! @- C' m* H- ?
You can check that simply by hooking Winice.exe control proc entry point3 u5 C4 @0 q7 S4 I4 f+ d
while running MeltICE.
* p* R+ j0 b* ^) f) n8 r) }% g: Z
9 l2 w) r0 q' K9 y
2 W- f1 ^9 S& B4 K: z+ T 00401067: push 00402025 ; \\.\SICE S1 p/ f! L7 `% \$ P
0040106C: call CreateFileA
1 r4 Y# T" q0 I0 S% } 00401071: cmp eax,-001
; R4 d( d* G. U+ j 00401074: je 00401091) B4 A! \# T# r: J
. E& r; a+ X3 H& F! u
' L; X/ v& u. n2 r* F5 Y6 ?! kThere could be hundreds of BPX you could use to detect this trick.
+ ?. d) h+ r8 P! v6 T-The most classical one is:
, V( _/ b0 O- j: K; `( J BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
, ?5 D' e8 T% B2 m( R' Z *(esp->4+4)=='NTIC'
- d1 }7 M& c: Z7 Q9 L) t
6 D$ ]& m9 f* L/ O" s5 b/ o-The most exotic ones (could be very slooooow :-(- G8 e! M6 }4 v t( Z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') # n7 e3 Z [. C, n1 U
;will break 3 times :-( H" q7 i t! b7 i$ V1 w
& \( Q' o6 h5 [$ ^, X5 D9 _-or (a bit) faster:
3 l3 i/ n+ s4 h n BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& j G7 k3 e/ V
' A+ V* Y! b* | o" ]/ w, k BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) X/ Q# t Q1 y \' }5 l; D
;will break 3 times :-(
: A( b4 V7 C4 ?5 u8 P& Y3 c/ k7 c- _) s; J* j4 t; l: P
-Much faster:
* e5 q @' }9 y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
3 {* e8 K& K& l) c' N7 R* B5 L( h( N+ a) u: c, y! ~
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, t( n* {$ m- q5 r3 C
function to do the same job:* L4 i1 o" x' F! Y
% v) I" ^, S8 L3 V
push 00 ; OF_READ
2 U; u( [ `- r1 ?( |: n% I mov eax,[00656634] ; '\\.\SICE',0
" c! w% R+ r/ _7 A6 x; @ push eax9 b; z/ J7 z M+ Q
call KERNEL32!_lopen
5 {; _( \6 A; C }/ w+ A$ e inc eax" H9 v; C) a) f
jnz 00650589 ; detected
; A$ }0 D5 T, Q. u push 00 ; OF_READ! K, j& c+ Z' J4 V
mov eax,[00656638] ; '\\.\SICE'
8 m9 C0 s4 \: S* A# {4 J% e' J4 g. G push eax8 F6 N0 R! M$ X. v6 _# Y- k
call KERNEL32!_lopen
& H7 J0 U0 L8 s. M' ~) p inc eax
% U# {3 Q; A' u" Q' z jz 006505ae ; not detected. d, L9 G# \- K
! o+ Q" q9 \1 T; T0 W
, ~, ]) [% i# h; t/ u1 ]4 O' v4 R3 }__________________________________________________________________________
3 `, t- m' i' u+ J# L
6 U P' g$ P& r. s* n) tMethod 12* y/ v3 `2 d+ Z, O: r& g# S
=========9 k! _- Y; J. x% |0 e6 Q3 R
: e. Q0 h1 ^! F" \! v4 D6 h4 G, e
This trick is similar to int41h/4fh Debugger installation check (code 057 L2 K/ {" @; B4 w9 a; l9 {
& 06) but very limited because it's only available for Win95/98 (not NT)6 f' P5 m6 T9 T" F
as it uses the VxDCall backdoor. This detection was found in Bleem Demo. @0 i% O) r1 k" q, i
( |+ h9 F( z" ~/ E
push 0000004fh ; function 4fh
+ a- g) d1 \ Z push 002a002ah ; high word specifies which VxD (VWIN32)
) k# J$ w9 _+ O, }( Q g& q ; low word specifies which service
+ Y% L. [2 H8 e, w (VWIN32_Int41Dispatch)
" g9 o$ @# }& F0 E call Kernel32!ORD_001 ; VxdCall% Q8 e) q. R% J" g% p5 I; _( F
cmp ax, 0f386h ; magic number returned by system debuggers
$ y+ V: c' o) R' g5 ?2 y jz SoftICE_detected
+ _6 e& o( d! G5 b/ t1 \
- u9 q A8 t( h5 p# D# U9 kHere again, several ways to detect it:
2 b; E% v# u$ z/ ]1 o$ y& a t8 T5 b, [4 M5 t# {, r
BPINT 41 if ax==4f
% I! Z9 r. o9 o) `- B: o! Q- m/ r6 J8 n
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 a! B ]' @7 w. s
! d8 i* F6 _! [
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 k3 ^6 U4 j" R9 o+ K
1 P. }8 d% ~1 O5 L. Q6 b6 T9 q! T9 f BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 K8 k" b7 f# X7 t [% m$ z* n7 C) H& H- v
__________________________________________________________________________
1 Z# }* n7 W3 N V4 ~: b( l, P7 T6 P, f$ o7 }+ L* T$ b
Method 13
0 e5 n: q% O+ Y=========
- S- a, a3 i5 j1 n5 v8 @! K( g, F5 J9 M# @5 t# K8 M1 D% ~' b& |
Not a real method of detection, but a good way to know if SoftICE is# i2 f/ H/ O" u
installed on a computer and to locate its installation directory.
9 c4 S6 z! J* O: ] kIt is used by few softs which access the following registry keys (usually #2) :
, T& Q8 q) c1 Y4 j$ l# p" C" j( M x7 p: J3 u+ W6 D+ h- n% C' f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ N4 O7 {# Y5 |0 |\Uninstall\SoftICE
5 r- Z7 L7 Q3 m$ o! B9 x" U/ ?-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ P) u7 g% _: W+ o" L" o
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. A! E, w0 [( X7 F- H. a
\App Paths\Loader32.Exe7 _; }! I( P. [6 |7 {! G/ `, B
. ^- g# J r# h/ G( _
/ E. L$ v" K K5 \/ y; C" UNote that some nasty apps could then erase all files from SoftICE directory8 o" z, R- z) d9 I8 d ^$ p
(I faced that once :-(/ J, x4 }3 i! g% q& C4 u" B" x, f
" h W5 A. P9 z; u# JUseful breakpoint to detect it:
9 }$ C; U6 ], z; i3 `
% _* S; {# j$ Y5 f' H" | BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. k3 l( c% [, P1 Q7 H) N- A& t& N# P, G) t# I! M/ \
__________________________________________________________________________7 ]* L( m. P+ S$ y
, e% B) M# F! n' L+ b3 g6 X: y
$ C% c/ f* B T1 b. o, _Method 14
7 k% L; V; _% L/ w. m5 o+ q, l {) j3 d=========8 N: k# J0 I4 w
1 c8 I9 c7 v/ z* t2 \: {. V/ AA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. r7 J3 u S4 |
is to determines whether a debugger is running on your system (ring0 only).5 a( `8 m4 a ^" B$ b5 y
. ^2 Q" p6 {( E" J VMMCall Test_Debug_Installed8 @ ]4 e5 @0 M/ R
je not_installed
3 N+ h6 m3 _1 c& D# r3 z4 K1 k! @) J1 j# H( @" Q
This service just checks a flag./ P5 x& M+ v O6 {* `6 _ T
</PRE></TD></TR></TBODY></TABLE> |