<TABLE width=500>
) p1 {) V; |6 j5 J2 H<TBODY>
. @ p2 f' u1 r7 i8 H<TR>0 M$ r: E* H8 l4 O2 s8 @: B% k
<TD><PRE>Method 01 8 ?# ]; G/ v$ f7 m4 C
=========
2 e; m7 P+ m- x3 Z+ w. _+ D
- S, T8 D, K8 S2 }6 R2 GThis method of detection of SoftICE (as well as the following one) is
& P% u8 i) N0 Z3 nused by the majority of packers/encryptors found on Internet.
: W9 k! c7 W$ n) c1 ]1 A$ [It seeks the signature of BoundsChecker in SoftICE
+ U: C- N8 ~+ F
. ~& W+ s- n& L0 y+ N8 `0 D1 Q/ O" C mov ebp, 04243484Bh ; 'BCHK'7 U/ G7 w! v5 A1 r
mov ax, 04h: G1 J: q2 H$ Z5 X/ N9 T8 d" V2 G
int 3
7 ]0 X$ D% G5 k+ N cmp al,4
o7 q h! r2 g. L2 r. a. A0 B jnz SoftICE_Detected6 c* ~9 k( T" R) K m2 j
; b( C: a4 v2 w2 j# T
___________________________________________________________________________
( P f/ X, Y& n- p8 G9 L C w8 [- V
Method 02
& w% ]6 J- e9 Z1 V5 g0 a=========! k5 D: S1 j/ j! u
) |% J4 ?# i! ^% A4 D
Still a method very much used (perhaps the most frequent one). It is used
. d- w+ b" k7 D: \ a: B: [" ~to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 T8 n& D# d# |2 _( k. R+ l
or execute SoftICE commands...$ A" J T2 V/ ~" B) w7 z1 A; a4 A
It is also used to crash SoftICE and to force it to execute any commands
/ o& S* u1 R" l(HBOOT...) :-((
" @ n0 d" y; M) [) U( ~' H3 B* J6 L, e7 S7 Y$ ]
Here is a quick description:
, @; u+ A( r0 ] G9 i4 X" F: O-AX = 0910h (Display string in SIce windows)
4 ?4 M' m o7 n4 v; H8 t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)1 N( e# [- |5 ^+ Z
-AX = 0912h (Get breakpoint infos)
$ K) \* X }3 @% r0 O8 r-AX = 0913h (Set Sice breakpoints), @" n. u# i( j; c" ^' h7 p
-AX = 0914h (Remove SIce breakoints)' U& ~% a' q; M
2 ]! d" F1 L \, [1 NEach time you'll meet this trick, you'll see:
7 Z( p, O3 \+ d9 A) n-SI = 4647h6 J5 [$ S1 G/ G8 Q5 ?, W6 k
-DI = 4A4Dh
1 @! I' p1 e L6 q( x0 _ `" d+ j/ cWhich are the 'magic values' used by SoftIce.
+ z0 s7 ^& s8 ~For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 b1 A3 O2 x" }, S: e) n% i% j5 Y% }( W& {
Here is one example from the file "Haspinst.exe" which is the dongle HASP
) V! h. u( S& u# T: NEnvelope utility use to protect DOS applications:
. }4 x8 d% S, [, K# a% }
. F+ Y% E4 x0 b2 O4 T/ ^( b$ J( @
% t8 P! m3 f+ x" g" U3 A) h3 d2 F4C19:0095 MOV AX,0911 ; execute command.
7 x8 C0 Z6 i( M4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., I4 w, i; L6 g
4C19:009A MOV SI,4647 ; 1st magic value.) r! y! t, Y% e8 Q! C3 p
4C19:009D MOV DI,4A4D ; 2nd magic value.
- D% a1 t4 i: V) X2 J! y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! `4 w: H- x' m3 q6 p) z
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
a' }, W% ]/ ?( w% O4C19:00A4 INC CX
/ L% p8 ]4 K$ l: l: Z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; O9 |" d: C7 F+ g( k3 @4C19:00A8 JB 0095 ; 6 different commands.! ~! E/ j0 h# |; m }
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 z# p7 _8 r; C* V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) V; g& h* {8 I$ P! i) H) e/ G( X6 {" |
The program will execute 6 different SIce commands located at ds:dx, which
7 Z- r8 y$ R% T H- X6 [" Z2 nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* i* g$ r4 ]( N- D: y g
; g: k5 M4 ?' K& ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* c1 N" g4 m r( s___________________________________________________________________________
0 {* x# {/ \, O- ]8 v. p7 p0 W: ~' p7 A( I- ]% o$ s( P
4 Y6 `8 _. s# \: F9 hMethod 03$ n6 k( n" ?2 Y. V8 E
=========7 O/ Q# D% U) ]8 }
/ I, V5 f) l' f* `
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) F- c2 e% o$ z" k& ?(API Get entry point)
, K6 z2 p& \* Y L: h
, v* |! R) S" r& @) S$ G% z0 @! t3 W4 @- w, Q
xor di,di* k# X) z8 k; g4 y: u4 V
mov es,di
' B$ x7 ]! ^$ T mov ax, 1684h
6 A Q3 a' a! P, G- S2 I& }, Y mov bx, 0202h ; VxD ID of winice9 E4 _5 T2 g v' C' Z7 Y
int 2Fh
; l' n: |( l, d2 y mov ax, es ; ES:DI -> VxD API entry point
1 m0 T0 U3 @; i B9 U add ax, di
_$ I+ E0 b3 z$ f- R; W3 l1 x test ax,ax" l! h* r5 B4 Q' [- y5 `: Z# ^3 ]
jnz SoftICE_Detected
* C. f3 F8 |2 V z; c% @) H: U9 _
___________________________________________________________________________
+ f' W K/ i0 J0 y) y& v
" r$ z, \0 {2 r5 q4 BMethod 046 h/ i' a7 d/ j0 D L% B* A" N% b+ Q0 Y# R
=========8 o' r w; G# O, e9 W* E1 `
+ v) H4 |* {2 m. e! |Method identical to the preceding one except that it seeks the ID of SoftICE, p8 f; G: G+ d2 z0 C, U; f
GFX VxD. w1 Z* C% s, q, j
) a( t: K3 U8 E) i- h
xor di,di% y7 j, y1 [- S+ k3 g C8 {
mov es,di6 y6 R, `. T- ?. j
mov ax, 1684h
# x: F( f4 z. Z3 L' j. O mov bx, 7a5Fh ; VxD ID of SIWVID
- F# K! c3 r) b" F* [8 M' r+ l int 2fh* Y- t6 A8 r- Z* ?4 C
mov ax, es ; ES:DI -> VxD API entry point
5 } ]# R6 m" ~; |( ~5 L" B' D' } add ax, di
9 D% \2 y, h- c; W4 A test ax,ax, b4 r0 c$ ^3 Z' a
jnz SoftICE_Detected& S% z2 E# {! V. E! B, d) q/ R" h
) A2 q( U( x% T5 j
__________________________________________________________________________% W9 J) P5 d1 u+ G5 V
) A, W1 h9 o, A" D' a
$ a) t" K" r% L1 d9 j% V
Method 05
7 k: Q6 w" M' q/ S6 t=========
) B/ R" J2 |1 E' {# @ q4 ~1 ?4 O6 T1 ~* N# `! d
Method seeking the 'magic number' 0F386h returned (in ax) by all system, v0 _4 Q* ]2 g' X6 w& z& s
debugger. It calls the int 41h, function 4Fh.
`6 L( u& a- @There are several alternatives.
! w" a; x+ M0 m# Q q
K4 w3 u8 \! V) l O* JThe following one is the simplest:
/ N* w. T6 S" T4 u
& M% i( A- z% ^% ~ mov ax,4fh
W8 S) Q9 l) Z, @7 w int 41h
- U6 j X! k5 c0 L. } cmp ax, 0F386
1 I6 J' A; V% W5 |/ a jz SoftICE_detected
1 C* @- w. x! j' F
% w1 `- ?3 E7 \1 G U+ g
$ k3 Z( m7 ` C, ]( w* w6 YNext method as well as the following one are 2 examples from Stone's
: t) c5 Y* e9 H' H" Z9 B' C* H"stn-wid.zip" (www.cracking.net):
3 y1 ]* s* j1 K X9 A3 e2 y: ^! I6 D7 m6 E; R" ~
mov bx, cs: h! i. c P- d( ^! Z8 u0 p4 Q5 w: |
lea dx, int41handler2
: s& D( }7 P0 y) G xchg dx, es:[41h*4]4 W1 z o$ W# e# X
xchg bx, es:[41h*4+2]
' m& D9 m! A/ p* R5 ^+ ~% C mov ax,4fh
* l6 ?# T" a* q' N- E8 r! M int 41h) _, N; {! b9 Y- f
xchg dx, es:[41h*4]" k+ W$ Z# Q* ^0 Z5 W
xchg bx, es:[41h*4+2] Y9 y7 E4 J4 b
cmp ax, 0f386h; f g/ A8 D n
jz SoftICE_detected
y/ ^3 v- I7 l6 Q. V8 Y8 x
1 k/ _: p) A# p4 v0 A _ m; Eint41handler2 PROC& D, ^6 h4 E7 X a* n
iret! `: p! S5 o* [- p4 a0 F
int41handler2 ENDP
" J2 g3 S t6 V
* [# k; q8 l6 C/ z
& K/ r/ f0 t) P0 n, Y8 b2 \/ d/ \_________________________________________________________________________1 ~% d* A, F( {) o
% _( ]0 y* u$ @" h# U2 r$ j' h
. c6 A' q. A4 N3 r j2 d
Method 06
: T' [1 P+ M( t=========1 g# e. ^- Y1 R0 N( w/ A
6 i h# }* M; \* H
5 H4 c" c! m; y2 b# _$ ?, T% L! n% H
2nd method similar to the preceding one but more difficult to detect:
5 n' D! q+ u9 Y1 [, |& s" d
/ x! B# s' B2 e0 @, Z1 J7 [
) O7 J$ F% M) V3 f8 rint41handler PROC
6 d" V6 ]6 d& \, `- U$ ` mov cl,al Q- A( d- h7 m7 y4 `
iret
# x5 b" u- d0 n8 l; w5 R& Y8 Hint41handler ENDP
$ l; @) \& \7 A$ Y, M
9 O4 ~ F2 J2 R% ~8 r0 L9 \0 O; b8 C) i7 m
xor ax,ax
9 C6 c9 m4 z% S0 K mov es,ax
& f2 c( w6 f# C" h+ ~ mov bx, cs
D2 U, q0 \! v- n0 e# \ lea dx, int41handler$ Q: }3 g1 u) m* T
xchg dx, es:[41h*4]* d9 j" R, Z# D
xchg bx, es:[41h*4+2]% A0 L$ d- [+ M7 j; i& [; I& r
in al, 40h
N* G7 S" I- B9 _6 U7 u xor cx,cx5 X* A" I3 V. }
int 41h, p* s4 H0 q3 v
xchg dx, es:[41h*4]
. s/ Y) T# i: v) S; P' u9 M* [- j xchg bx, es:[41h*4+2]
5 K5 Q) r; U" Y! W6 P cmp cl,al
% g& r: k- c, t5 d9 m6 | jnz SoftICE_detected: M& t0 ]5 J8 M* r; j3 P
! d$ z/ D, ?, b4 H8 c
_________________________________________________________________________4 B; I" d7 V( e
s7 O% `5 P1 H; K% [. g7 W5 TMethod 07
A1 n- _9 B2 U$ u=========0 e8 V6 o7 {* K z! W
8 Y+ \! ~( V: G1 \- TMethod of detection of the WinICE handler in the int68h (V86); Y2 |( ?$ v9 d/ f' s7 H8 d# ]) u
4 _( V& f) } w7 D! V' k
mov ah,43h2 L' u$ D/ [1 m9 t3 [; w
int 68h( e8 ~2 i+ `! o2 \0 w
cmp ax,0F386h7 J1 e2 B6 \ C' `( j$ I- ~* C, t
jz SoftICE_Detected
\/ t1 S+ `: y, P* A+ f4 S
' ?! j% Z* \/ W1 o+ u* R: R M7 e+ F! l {% f' n; D0 F% }
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ ^* c5 S- ^8 s; s app like this:
. i: A% Z( F# P( B; b( {' i7 y, Z& `9 j7 {/ Y
BPX exec_int if ax==68( A& Z) ^" ]' T8 N: @" |1 z& V+ g
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 N! l; ?, l4 A! d5 C located at [ebp+48h] for 32Bit apps): u, I" f& ?2 z t
__________________________________________________________________________5 N; n! l2 m Q0 T. @ a
4 }" m2 c- t5 g* G
8 Z8 k7 a% d. C+ |/ ?$ QMethod 08% r7 v& k+ p o2 z
=========
0 K7 `% t ~1 G' Q# J- ]: }! g+ a; I9 t5 S1 v( L& j+ H
It is not a method of detection of SoftICE but a possibility to crash the7 e- K6 {4 A) w
system by intercepting int 01h and int 03h and redirecting them to another, W9 l3 U* q, r( A. w7 E
routine.
1 Y( F) K5 B/ ~: J1 s7 b j& nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 U: s7 a7 H* D7 s% f% u1 b' H( Kto the new routine to execute (hangs computer...)7 N1 [' Y6 B0 l; Z
" {0 |" L. m. B$ w
mov ah, 25h1 G6 K P' a5 B
mov al, Int_Number (01h or 03h)
l6 M$ [5 ~) N& s6 U% u8 ` mov dx, offset New_Int_Routine/ n: X+ u0 S+ V9 l
int 21h
, `3 |6 x* s3 O! D8 |$ a* p9 t/ P7 h
__________________________________________________________________________* V. \ I; b! z' I' H. C: I
" k& o0 K6 |. i0 T3 `Method 094 O7 g- k7 D( N. L. e- S3 _
=========
3 S# Q8 m7 p$ D3 H# }) _: Q; U& b0 H# ^5 t4 Q6 }9 y5 m- J- t
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* Q2 \( x3 m, ^5 {% |performed in ring0 (VxD or a ring3 app using the VxdCall).
3 a: P. P E) A! u/ XThe Get_DDB service is used to determine whether or not a VxD is installed3 d$ h, u g$ A( V: F6 a9 v/ s7 g
for the specified device and returns a Device Description Block (in ecx) for5 J$ f1 H3 r$ ^
that device if it is installed.. S) f9 B- g8 O0 W9 u
0 T O- ]! ?* o9 q8 E mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% t% c: M. y+ c' X5 ]! Z+ C mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# L; P2 \ s, K: c* x* h VMMCall Get_DDB( q1 l5 q1 a! W6 j4 a/ @& E
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' i5 {- E5 g( b+ _: P/ R& j
: N4 P6 }0 k/ Z* V+ O5 O! g+ V
Note as well that you can easily detect this method with SoftICE:1 n. `/ g1 f5 Q% B: ^
bpx Get_DDB if ax==0202 || ax==7a5fh
8 V- r) J* A: f$ z+ a
3 m$ P5 Y5 {! W__________________________________________________________________________6 W7 ]8 o, o( Z+ r6 W
. ^( Z5 d& O, s+ c7 G! {
Method 10
2 X9 A/ C7 E9 Y* G=========
- k$ [2 u6 a4 v# r$ x( V$ j
% s/ d& S( f% O1 H: y% C5 z( q7 f=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 C5 g) P9 f, y4 ]: R% V. w! i) \1 n# k SoftICE while the option is enable!!
! o+ E/ }# G$ K2 |) `5 }* E8 y' n4 l$ n9 L5 }3 }0 j
This trick is very efficient:
" j* f# o+ v1 p* g& Wby checking the Debug Registers, you can detect if SoftICE is loaded& q* I q2 N; g- _2 S
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ c3 D' z* a1 C/ d- p8 C( nthere are some memory breakpoints set (dr0 to dr3) simply by reading their
$ I2 Q6 z) {2 Gvalue (in ring0 only). Values can be manipulated and or changed as well% ]( s( k+ |% q2 J$ R" q6 U' s
(clearing BPMs for instance)0 J1 J9 e/ x& I
4 K" S0 A M. D. R0 }__________________________________________________________________________/ S) l% b5 d! _4 e" q
$ p* q7 `& E' a" yMethod 11, K n# M: O8 _8 i, X* V M
=========% U: \9 ?+ \) {* k
' X/ z! @5 X$ w# s3 S- q
This method is most known as 'MeltICE' because it has been freely distributed
# P1 e' f4 t' f. Xvia www.winfiles.com. However it was first used by NuMega people to allow
4 K# S) a& W. b, Z8 dSymbol Loader to check if SoftICE was active or not (the code is located
$ \6 r' z$ z) D7 r" } e. |4 zinside nmtrans.dll).5 d! d+ Z; E7 c+ y$ h% U
0 ~7 J. ~8 I* r% S: R& N) g+ m/ O
The way it works is very simple:) F! G5 ^" ^* Y/ t$ S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 W: R# Z' f9 X J6 C/ }( D' G+ P2 mWinNT) with the CreateFileA API.# b% ^+ Y+ R9 E7 M
/ k( C& \, j0 c; w
Here is a sample (checking for 'SICE'):1 I5 U& `$ Y& V3 t9 j
* H) Z5 h3 Z Y2 i6 w( l9 R
BOOL IsSoftIce95Loaded()
; `1 z" n! B: G& L{! x" p& s- `; y, p" E8 m8 S0 N3 y
HANDLE hFile; + R% b6 e# ?# E P- ]( e) H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ h, x2 r- ?2 B FILE_SHARE_READ | FILE_SHARE_WRITE,- H9 _+ H0 I( Z% N
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ C4 g2 {" z2 O3 c
if( hFile != INVALID_HANDLE_VALUE )
' R$ s/ x7 _" Y" `. d" y5 O5 D {
, b. Y- j% }2 O1 z CloseHandle(hFile);3 h% t5 n- _9 m9 f9 T, t6 c4 b" @8 @
return TRUE;
: F2 ]- R5 Q6 L8 p }
+ T2 ?6 S/ Z. I& i return FALSE;5 {9 k) O+ [' |
}
w0 r! A/ b# a* |
8 Y ] o$ ]- |% ~7 _3 pAlthough this trick calls the CreateFileA function, don't even expect to be
+ d, X* s7 q4 X) q3 V _able to intercept it by installing a IFS hook: it will not work, no way!8 H/ B# s/ z. R' x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ v7 ?* O: N" x. ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 f8 b- K8 H* M4 Z" \4 r# k. Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
$ L9 t" c8 n. t* g4 P4 @; \field.
8 w# N" U } q- eIn fact, its purpose is not to load/unload VxDs but only to send a , ] D* \! Y1 B7 r |) M
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# ~& f3 H, b; d0 Z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: ~! _8 z6 ?. B: Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
' `8 }8 @# e) yIf the VxD is loaded, it will always clear eax and the Carry flag to allow* l0 {$ k7 { K* t+ C
its handle to be opened and then, will be detected.9 G1 S1 d6 Z; K
You can check that simply by hooking Winice.exe control proc entry point1 H5 g/ x$ S' r4 ?) L, P0 c, S4 K
while running MeltICE.0 N. e& b2 W: I
! P& e, U& g2 y& ~
7 K! r M$ Q! c8 q5 Z 00401067: push 00402025 ; \\.\SICE8 `: a) x7 v- i5 Z. Z
0040106C: call CreateFileA% H1 p2 t/ U1 f5 e' F+ [' ]# K
00401071: cmp eax,-001
. Z2 i1 O) ^( Q! y4 u+ d 00401074: je 00401091/ a* G6 Y E1 Q5 N7 P
H. c5 [7 X1 v5 D0 z5 b
+ Y- N" a& v+ g3 s0 i* CThere could be hundreds of BPX you could use to detect this trick.2 L' K" F1 I& N$ C- r7 m! T0 {1 r0 g$ M
-The most classical one is:3 n2 L, C0 i' n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 L7 I( m6 D" {% h! e, |
*(esp->4+4)=='NTIC': _3 b" H7 U) L4 m7 P" q7 J
) B: p2 ?. _6 [% H- r
-The most exotic ones (could be very slooooow :-(
V: V7 s* ^( H6 t. ~ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; \: D- q0 [( d; t6 ~
;will break 3 times :-(
4 j' Q; _6 O5 I/ G3 g1 w# x" K: J) m6 S& r
-or (a bit) faster:
* s4 I v. l' [3 U BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, m' {# ]+ [$ }. s/ P2 G, G$ J7 Z3 Q9 \3 R3 U
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
- v" X7 D0 j9 S1 e$ A: L/ k, ? ;will break 3 times :-(6 p1 a$ m R7 a! D9 ?$ F+ w; n
/ k& z8 h% t* T! o" A
-Much faster:
& q* w9 c% Q+ Q D. Y7 o9 M5 y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
6 l5 r3 o, H& z# n8 L- ~
$ g% Q0 @* Y/ M$ ~Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" A. ]+ d8 i! R& }function to do the same job:3 R3 `0 c, g8 i5 w
3 N! e: U1 Q- O5 n$ R2 g
push 00 ; OF_READ& O3 Y5 Z) Q( e' D
mov eax,[00656634] ; '\\.\SICE',0
- ^& w/ [/ X' g6 K- r push eax
0 q! M3 m/ B( ], [$ w. h* w. {2 h call KERNEL32!_lopen
$ D9 F1 }% S% P n) Q inc eax
! X# x7 @" u6 O+ d jnz 00650589 ; detected% R: x* _# T6 ?) Z5 }
push 00 ; OF_READ
' H% C6 O* Q' X# q9 D q mov eax,[00656638] ; '\\.\SICE'
- v' r5 L0 f( D4 Y# b. H9 { push eax
* F1 E* B, b# P* h5 H. @ call KERNEL32!_lopen' P8 z. {' l( z3 C f0 }
inc eax2 E0 D! M! B8 V+ d5 r
jz 006505ae ; not detected3 t3 ?# W! u8 \( M' Q$ F- A" J
% w' H3 m+ A. l
4 _* W) a" Z3 w7 p: ~! D__________________________________________________________________________
# b! w* o; u1 n# v, r9 [ |% [) U9 K' x5 i, [9 C# d
Method 12
/ \: v6 C' y, i# M, F1 h=========
6 h/ K2 F: ~. Y" Y$ T! j/ Q* t/ V2 o8 B8 _+ d6 m( y, u. z
This trick is similar to int41h/4fh Debugger installation check (code 05
( z& r2 J: V# `; W ?& B! s3 Q+ D1 z3 d& 06) but very limited because it's only available for Win95/98 (not NT)! R$ s" X3 I: U4 i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 ?, q: @; f8 F/ _/ o2 |# {9 o8 O" |8 U
push 0000004fh ; function 4fh" y3 \7 e' S/ N& l( N$ }" s% o
push 002a002ah ; high word specifies which VxD (VWIN32)! I' T1 t7 W* }4 K* g! W( S; @/ W
; low word specifies which service3 ]. M; l+ F3 T m, B: F2 |
(VWIN32_Int41Dispatch)4 i& k2 h3 x& }5 M& @- J: W
call Kernel32!ORD_001 ; VxdCall
- q) h: B% C) ]- v2 \2 k cmp ax, 0f386h ; magic number returned by system debuggers( q/ x% L8 D4 J" ^/ q7 w! ]8 [
jz SoftICE_detected
' `5 K' g* l0 _0 }- [# {+ h, T4 h2 Q0 p) g9 n
Here again, several ways to detect it:
1 @- F; ^0 ^* l1 q' ?. s. r$ S0 j
+ j& `4 Q# u/ T" {& M' I/ K# d* d( D BPINT 41 if ax==4f
# } [8 V1 \7 U5 t4 p+ F! ?$ u. `
9 q% ]" [) `! W9 s0 w* c2 q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. ]; Y- u8 W1 H9 t9 e* C5 l0 E& O& m
6 J! c6 d. p3 C, w3 q& A# F BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! D# ]1 p! }! c) z1 O+ A* G1 D5 L8 D2 R8 h r7 t9 X
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' y: m" }9 E& ~: a) e% I
7 Y* G$ S1 q. W, r0 P' B
__________________________________________________________________________* D2 s P* F0 U
. E! ]. q- d; S, l2 I$ ]
Method 133 _! _/ N3 U0 u! S" p
=========* \8 M; o! D! ^
t) K! X7 h M" L* p% c% X. vNot a real method of detection, but a good way to know if SoftICE is
1 @5 V& t# j* T. Cinstalled on a computer and to locate its installation directory.. t+ Y. [ ]! T, g5 i
It is used by few softs which access the following registry keys (usually #2) :
2 v, w8 M/ e* o+ f( p; u! d
: O& H9 S6 c# y4 r% r# t-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. D1 E( S/ G0 K# b\Uninstall\SoftICE1 i l# L, E! z! F+ Q- J9 d u
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; k: T4 {" K' F5 N. v; T$ I$ q$ D-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% U; Y% ^& n& `" Q' v) J- k
\App Paths\Loader32.Exe
b+ y: H9 x2 O/ D& {- A6 D
8 X4 u H- L/ H
2 G0 k- W2 P1 ANote that some nasty apps could then erase all files from SoftICE directory
. Z J( u$ k) ^7 ^4 B- M+ B(I faced that once :-(. x& T6 `8 G1 K
6 i: @) R$ z0 p7 L7 X5 B0 x: H$ dUseful breakpoint to detect it:3 A0 u y: O; [$ R( [4 D' Y S
# Q2 \! y T* D) V BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! Q$ b! _- y% Q7 j; Q
6 k2 V8 K- U5 ~ G7 g9 u__________________________________________________________________________0 V8 x i1 E$ X2 L0 ?& t3 v
' c h9 Z. E. `/ a$ ?: C6 \
# I6 Q0 Y" a- ^. m" r+ PMethod 14
/ \9 T/ o1 B/ R# P" k3 F0 |=========" y( [, o9 V( J
( ^3 y+ n9 G$ f: LA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! |) p8 h( G: U3 T
is to determines whether a debugger is running on your system (ring0 only).
5 G6 F1 V# [# P' j& a& {$ b6 f0 X0 e; f
VMMCall Test_Debug_Installed5 S( o( b6 _7 ^* b2 C: r
je not_installed1 i8 J, v6 R4 F1 V2 {
! v) B4 S) i# F4 h& CThis service just checks a flag.
1 _5 a* b: o# O3 s; Q# L</PRE></TD></TR></TBODY></TABLE> |