<TABLE width=500>
2 g; ^( i! ?) ]( G8 [/ l<TBODY>! G9 }! `- z# }/ `" s( T& j! t
<TR>
8 i, X: Y4 r9 P$ E+ v; S' E<TD><PRE>Method 01 " c2 @4 K* |" f& k- @) m( v& c& D
=========9 p& \3 c6 f' K% E- }. n8 x ~
3 s% |2 y' q$ D4 w% s" d0 o) c
This method of detection of SoftICE (as well as the following one) is
6 |! [' f5 v7 h: X8 Nused by the majority of packers/encryptors found on Internet.4 g; B% C, M/ u6 i7 E
It seeks the signature of BoundsChecker in SoftICE
* A, T D, M1 l7 G1 Q! A( C3 S& O$ x( ]" J2 y" t' t# z' n
mov ebp, 04243484Bh ; 'BCHK'
; W; B4 A* o1 G2 F mov ax, 04h, k$ l3 l' G% k0 [: G% L" C8 j
int 3 ' J7 L H; L; p) C6 q7 Y
cmp al,4
* A# z( ^. @) |" i/ ~4 F. i8 n jnz SoftICE_Detected5 h: T7 ^9 {6 O. j/ W+ K+ Y
" F; j O" F5 H) g9 Z: P___________________________________________________________________________0 B3 z& D) Z# X. U& B) T
9 a( { t# P0 _( y8 Z
Method 02
" u$ r$ M3 S; M$ `1 d=========
; S9 \4 ~8 H8 ?8 M0 S3 V! X+ l3 m* J; `0 ?# o; }- X& u" t
Still a method very much used (perhaps the most frequent one). It is used* G% t8 `" f) M$ Z+ k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ b$ l$ p5 Z) |2 m% Z; S4 k3 w. Y: K8 |or execute SoftICE commands...+ L6 M" c/ H: r
It is also used to crash SoftICE and to force it to execute any commands, p+ A; \* x, G4 [
(HBOOT...) :-((
0 e( W( t1 p2 x
2 l9 G) t" n, ^9 n4 z; t9 CHere is a quick description:
' r$ r+ }8 |+ R$ ^. c3 U5 a& Z2 T-AX = 0910h (Display string in SIce windows)& O7 [- m" p4 w" @7 o5 g! p
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- \3 G# M9 ~+ G( K! K-AX = 0912h (Get breakpoint infos)- n/ ^* j" V. |: z6 |
-AX = 0913h (Set Sice breakpoints)! A; ?* t" }! [) m0 u. N. `- i
-AX = 0914h (Remove SIce breakoints)
9 v7 v6 b- A; c6 d; z; W8 X9 v2 `6 Z7 b1 O
Each time you'll meet this trick, you'll see:3 R8 E8 ~8 [) v6 ^! _7 _! V ]
-SI = 4647h
, R8 g( t" E1 K* G* M-DI = 4A4Dh
8 c8 @2 c0 \3 k% DWhich are the 'magic values' used by SoftIce.5 Z9 b3 r2 x8 U! O1 L
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 m7 L8 z% o* [. W- v2 D9 r5 W' X# @( ] F0 x9 a* {. V3 q3 A
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* j# M, `; f V- y" J0 G& CEnvelope utility use to protect DOS applications:
9 H' N# d2 Z% S3 N/ A& k; ~5 U1 b0 o# \7 p! s; I
7 x: N: m- H5 x: Z3 C. d% d
4C19:0095 MOV AX,0911 ; execute command.
6 |3 j" G* E( p/ c4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 Z. n8 a9 G. N8 i# }0 \4C19:009A MOV SI,4647 ; 1st magic value.9 k3 L$ ?' m+ H' Z9 t( s( S
4C19:009D MOV DI,4A4D ; 2nd magic value.
$ Z) H+ D. h1 S8 ]$ |9 n4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
! }# k( |: l3 U1 Z- l4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 h9 J6 I3 A, Y: e! s5 b4C19:00A4 INC CX
# K, G' C5 y* c: r4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- M4 U, o: _( y* ^/ b4C19:00A8 JB 0095 ; 6 different commands.- [0 C+ n9 b- {. }" Y3 o
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: J0 p* m9 J3 z7 u% B4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
! }7 e! m* a/ o+ f( `$ x
( Q' ]- Z- y, R8 j2 w7 sThe program will execute 6 different SIce commands located at ds:dx, which- o* W& k+ ^# }- w" z5 u1 E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 h& {( `& f/ N( h1 C& |1 l$ `
3 O/ t, c( }! b- y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.9 O+ }& [: Q2 J3 [/ X ]. J2 W
___________________________________________________________________________
+ a. @$ h9 \, I# z" g$ [1 m) f- C# U1 G8 J7 L
" E3 f( U5 E) |$ g- X
Method 03- F$ U t I: v& o6 c0 L
=========2 O% Q# l+ Z* k; s8 y, Y: S
: V5 s& v5 ~! y& V3 f) V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 ^: E- L! U! L2 F$ R
(API Get entry point)1 n! g& d* B( v, z
4 Z, W$ y( f9 X; }* X) x7 W
, n8 U! v: v/ c4 o9 a
xor di,di- C) U# R. P- T, h- ?) l
mov es,di! r& r( B- M8 V @2 e
mov ax, 1684h
' N3 Y# {8 }* V* D mov bx, 0202h ; VxD ID of winice
4 u* r" R: y9 y! E6 S int 2Fh
2 Z' F' `: a- x. e mov ax, es ; ES:DI -> VxD API entry point( Y. P$ G: T2 P8 S# l `' K
add ax, di
& ^. D( |7 u2 t/ O: ~- n1 I test ax,ax
( o, d# O, p7 y' q& B" N9 I5 k jnz SoftICE_Detected
2 _$ H' E+ j, a# u# a5 b" C% R9 c* w& ]; U; O
___________________________________________________________________________
7 p: l4 }' K7 q3 K) W
. n# U" A' z. M7 jMethod 04
) T. J2 T& O5 d0 u' S- c=========8 B; f& H( o9 [1 p
* }4 I/ c& O/ ^6 z# j) {; R
Method identical to the preceding one except that it seeks the ID of SoftICE
* ~, A. V; p/ h" J& ?GFX VxD.
& u9 c G$ e7 v3 T
8 x6 d [0 F% p0 f2 s4 `' v xor di,di
, ?7 ?: k; \# G | mov es,di: B' _; D9 l: Z2 y! J6 j- _6 m* y
mov ax, 1684h 2 k8 n; j% G L3 P: E3 t' Z0 q+ o$ w0 F! q
mov bx, 7a5Fh ; VxD ID of SIWVID
$ @9 d7 u; i3 ]* ~6 o int 2fh3 f u+ Y/ Y& W
mov ax, es ; ES:DI -> VxD API entry point
|1 O, U: |7 I9 ]+ a2 Q add ax, di1 ]6 Y: {, s. R' V
test ax,ax5 A/ z/ b9 O. F" f9 c
jnz SoftICE_Detected# D5 _- o- p/ z/ V3 o5 [6 l+ V
0 H) H. Q7 S4 d" W0 m__________________________________________________________________________( E6 N+ s( O. @0 |$ G
n. @/ O3 @/ H3 v% C2 Q9 J( a8 K
. x* ^/ M, s( d" j1 T! bMethod 053 C/ l+ [, v/ b
=========3 Y: ?; Q& r. y' j/ f9 W; h8 H
# [8 h/ i. _8 F# B. B8 W4 C9 P% w
Method seeking the 'magic number' 0F386h returned (in ax) by all system W# Z$ r# ?- v$ w2 M7 m8 t
debugger. It calls the int 41h, function 4Fh.
1 ^# o* R6 b: _4 rThere are several alternatives.
H$ d0 f, ]/ ]5 r2 `4 i8 u) P# M7 ^8 `0 n2 c
The following one is the simplest:* A ?, v; e$ \3 S
- @1 }7 h1 b1 |3 e# q [7 x- V8 @ mov ax,4fh/ d: E7 G. A& h U8 f, e Z8 _( [0 |
int 41h
, H1 h& f% R) c% z9 a cmp ax, 0F386! Y$ a' z n2 H2 ^( H! l/ O
jz SoftICE_detected
2 X3 M2 T9 H# ^+ Y! J: S
6 O' G4 ~+ u1 _$ n0 u. D
& p$ f1 Z4 [6 N2 C& u) JNext method as well as the following one are 2 examples from Stone's ( Z; c' p1 S% D: x: {; c% {
"stn-wid.zip" (www.cracking.net):
, h, Y3 v+ f7 E8 v
) v. |1 ^4 H( G. A& q4 {* L mov bx, cs
8 q1 x$ F/ j* y* `$ b+ H lea dx, int41handler2
5 [! I. Z$ @) l; I6 R( I xchg dx, es:[41h*4]0 g8 f) e) t& ]5 D# M
xchg bx, es:[41h*4+2]
4 h+ }4 i& f c% J+ L6 L$ y' H mov ax,4fh
- p6 B/ f# V3 z9 r! o; s int 41h
! ?7 N% H3 T: E6 ^ xchg dx, es:[41h*4]- h) t4 k: v! A) z- s2 G/ x
xchg bx, es:[41h*4+2]$ ^4 j! s( [. a+ F' L8 W8 r% q* R6 \
cmp ax, 0f386h
% [: n% Y: X! ~$ l' N jz SoftICE_detected9 D* y) M$ q% a; B2 ?
: I8 k) U; q( ?
int41handler2 PROC; W7 c9 w) ?1 S5 I S
iret" _5 f7 X# e% q4 {. T
int41handler2 ENDP2 b& t' r7 W; W" {
& t% [# w8 E2 j, o. C: w
1 W. K- n6 q7 ?$ E# M/ R, X& n& R0 T_________________________________________________________________________
1 J- ]% }. Z' q* |9 o8 i
' k; u% w& f! c' L' _
( S# U9 G8 X: w6 ?Method 06
7 g3 P6 { ]8 t7 R0 ~6 O! H=========
/ e* e0 x$ ]) J8 R' N4 P( z
) B+ ?" u) B: [2 b% ?5 S* U4 x( S) q/ Q8 w% P, U' P; ^
2nd method similar to the preceding one but more difficult to detect:
* P2 ^5 H4 |" X! |8 Z
- j3 N8 Z9 S+ E
! f/ ^0 o2 d1 v& t2 h1 cint41handler PROC; V, O0 j4 S2 | a$ ?- n) G
mov cl,al2 I ~' o* ?$ g7 _8 T9 r
iret
5 S+ w( }. p& k% p9 u" Tint41handler ENDP! A- G4 K( k' i# H# d5 C
9 ~# k' {; K6 n' o: [- f% S+ K
# z4 [3 }+ Y" F9 `, v7 G
xor ax,ax$ O* I: N. y, c' h
mov es,ax
$ w) T. g# M N4 U0 b! c mov bx, cs
& W. T+ s/ i" |$ ~ X lea dx, int41handler# i( j* C ^- O6 e1 U
xchg dx, es:[41h*4]' b% R" X2 x% Y8 m) j7 t8 P
xchg bx, es:[41h*4+2]" j4 l! m1 X% `2 b
in al, 40h0 N$ h" P' L( V! m% h
xor cx,cx
3 c' {7 B& x7 S" S8 |& D X- g- n int 41h( S( w3 E, l. c% O" ^
xchg dx, es:[41h*4]
9 n0 V) l; m! Z7 X, v% O1 O xchg bx, es:[41h*4+2]! w$ ^$ v' w5 x2 w3 d
cmp cl,al! E9 z4 E3 P) A2 u2 l3 {8 o
jnz SoftICE_detected
; `% @ {7 N7 d$ W1 m7 M; E
& g1 T: C% a5 i9 J1 }+ W0 W: ~_________________________________________________________________________; \) H1 B7 m% b9 R6 ^# ]
+ } ^ j8 E: I* M
Method 07
0 o9 c1 [( x3 e, S=========
2 j# x1 i- [/ V' l* O
) B" N. X9 M* F2 P0 ^1 VMethod of detection of the WinICE handler in the int68h (V86)
7 W0 R0 ^& }5 b2 T: Y7 l
1 W- B2 _2 O% h mov ah,43h" P3 Y+ U4 \3 `, |. D: `; P2 `
int 68h- {+ l7 c/ V7 ?9 k
cmp ax,0F386h) ^/ m. S# E* @" p' r+ v8 ~, Z
jz SoftICE_Detected
: @/ r) B7 D4 _, _" H! H
: _/ w: v2 D1 l! S+ e. W, a' b5 g. y5 B7 W4 K! F
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: r8 d" Z6 p) l. A: L6 e) |2 H- Z
app like this:5 a0 a6 [8 a/ [8 H9 ?3 O. x1 C7 j
! v! u. R. \/ }9 T BPX exec_int if ax==68
; b/ k6 ~4 M8 p3 [7 v' [4 O: J, _ (function called is located at byte ptr [ebp+1Dh] and client eip is
: P+ {1 @' [ l2 h0 G9 Y9 ? located at [ebp+48h] for 32Bit apps)
7 b L" x+ f& J6 u4 _: Q__________________________________________________________________________- p8 l8 U, F" Q( ]
$ u! a/ j9 @8 w/ f
0 c7 T* k9 y3 \3 y8 h# M0 X
Method 089 M; s* X3 j. E; q! a5 U
=========9 Q' W1 B0 D" }0 A% k& x
: r+ B- \1 Q# E* z+ p6 CIt is not a method of detection of SoftICE but a possibility to crash the
3 P* d1 T. B& V3 F8 ]5 u( h4 ksystem by intercepting int 01h and int 03h and redirecting them to another
6 W* t4 S; F8 e; D+ t& W1 Sroutine.
6 ~! w6 g3 y; Z' x) B& @7 TIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points; K: u. \) W* F+ I# [( z1 \
to the new routine to execute (hangs computer...)
$ {3 r Y* O4 U2 d: b/ U/ j4 B( f% v" v. s3 Y& W! @; N& v
mov ah, 25h
6 Q$ f& D5 F! ^+ n+ c mov al, Int_Number (01h or 03h): d- ~6 F7 R# L
mov dx, offset New_Int_Routine) p( e# Y- h4 w
int 21h D/ M/ w, \8 ~9 ^9 u
# Q* {0 a9 R, K, C/ j" H
__________________________________________________________________________/ i# e: d: H% ^: S; R* e+ R
( ~1 P% Y+ \% P4 t9 o! E
Method 095 I+ E% d! D l7 q
=========
' u0 ~) ?$ ~% a! c4 ]) g
' o% W: a( C& i: w* XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: q4 o9 Z$ G7 c/ A
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 s% x! V! u* P4 h& U; {The Get_DDB service is used to determine whether or not a VxD is installed# P/ {# ^, E$ T! h, ^% o+ F
for the specified device and returns a Device Description Block (in ecx) for
2 Z, M# w0 W8 H' N8 {that device if it is installed.
7 b+ c; y+ v& s5 b) p
7 b; L/ v! G" p; _ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 z0 b, n! y; Z( }
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* G2 P/ g# }& a4 C! ~ VMMCall Get_DDB
7 m8 U# D& Q2 V3 v% y mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ B5 \8 L L/ Y+ Y+ b
% s- m5 R ~$ Y+ MNote as well that you can easily detect this method with SoftICE:
, D+ o$ a1 C! x7 \1 P; J bpx Get_DDB if ax==0202 || ax==7a5fh
7 H& V6 l, e M( O- W+ l- H. O/ L% _, {& Y4 B% r' t/ c7 M7 w
__________________________________________________________________________
! w& o- B+ P0 \6 d4 P, l. ~7 |0 L
Method 10) v5 O1 H. F3 c! D- ]
=========/ J2 c' U) N, _; q% W
# W( ]1 P' Q+ p: F; k. H( i* H=>Disable or clear breakpoints before using this feature. DO NOT trace with! L9 N: D/ C& x$ a# p
SoftICE while the option is enable!!
3 s2 W5 b' _" \' Z) D3 v0 A# g8 P1 ` D. N- T6 V
This trick is very efficient:4 ]6 }& i) r4 j+ M
by checking the Debug Registers, you can detect if SoftICE is loaded, r* ?6 @; @; o4 q( {. v
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 U9 @1 T7 [( q" Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, h1 M& f8 r( I& @& Nvalue (in ring0 only). Values can be manipulated and or changed as well
0 O' H# F7 u" ? P, Q# _, m% ](clearing BPMs for instance) B5 s' L. y# [8 E
/ o: E8 g/ {6 x. g: m
__________________________________________________________________________ @* a8 g" r1 r/ w+ |( @
3 h3 a/ Q l% D" B n
Method 11
& {' y. L6 @0 P=========% O8 S, a& @# F& X `6 w3 b3 c
8 l& v. { t( Y* }This method is most known as 'MeltICE' because it has been freely distributed
; _* m# n \' A* |+ v) Xvia www.winfiles.com. However it was first used by NuMega people to allow6 C5 A2 E- ]6 ]3 v; Q3 D
Symbol Loader to check if SoftICE was active or not (the code is located
9 i9 I3 d- Q! C+ n: L9 pinside nmtrans.dll).
% j1 I9 r, E* I( m( v* j5 [
+ p7 B" f9 o" ?+ C" UThe way it works is very simple:
+ j$ _; j- f7 u+ V ^) JIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 l. j0 A, G& a( f4 z( MWinNT) with the CreateFileA API.
$ ^8 w5 k7 H, a9 C+ ^( G$ f L9 f S$ Z2 Y S
Here is a sample (checking for 'SICE'):
% e' j8 i* h; e) K3 f" T1 [
2 T v0 J2 E8 _2 o |. ~3 wBOOL IsSoftIce95Loaded()! J# d5 m! r, ?' H; }9 F5 z
{
& p: k9 Y& }, \ HANDLE hFile; % H V, R7 e, s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) M( F2 C. { ^! Z- `6 w
FILE_SHARE_READ | FILE_SHARE_WRITE,; t9 {/ Z# _- B# n p
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* S+ @( T, p m5 d5 n; V9 Y: h if( hFile != INVALID_HANDLE_VALUE )
. ~0 L- e j% f7 z {. v5 M% j4 _, I) M! g
CloseHandle(hFile);
3 L2 x0 |) o9 x3 w return TRUE;: u: W/ `3 G; i4 |) O0 \
}# Q1 L+ A( l! a, H
return FALSE;5 i0 W, k# J7 }
}
0 x. _3 z( P0 a, K L" Y1 _, l9 u4 ]3 T# L" v& P& I ?
Although this trick calls the CreateFileA function, don't even expect to be
- Y: x3 c) @! k$ I4 `7 yable to intercept it by installing a IFS hook: it will not work, no way!
7 V' w0 o7 j) n0 IIn fact, after the call to CreateFileA it will get through VWIN32 0x001F& F( B/ g1 v2 c0 G& p1 R. w m
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) N8 a$ F1 E3 H6 u. J
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 ]9 P6 P u: p9 Nfield.% Y: A: N9 u/ {; V4 E% O
In fact, its purpose is not to load/unload VxDs but only to send a
Z$ m5 m4 \* |( P; T2 }# YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ S- p: n/ L7 k7 u
to the VxD Control_Dispatch proc (how the hell a shareware soft could try! ]1 Y7 l# z' T+ w! {2 f
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
b$ `5 W2 j- B# rIf the VxD is loaded, it will always clear eax and the Carry flag to allow8 J9 ]) ~+ ~4 [
its handle to be opened and then, will be detected.
o6 U0 m* \) d' z1 sYou can check that simply by hooking Winice.exe control proc entry point
5 Q, D- B s2 cwhile running MeltICE.
. T7 y9 I& v( m* E0 p+ W1 Q L d7 [: i; [- }! V* A; c
9 S9 c/ ]1 e. l9 d1 H 00401067: push 00402025 ; \\.\SICE
" A7 f! y( `. N 0040106C: call CreateFileA {4 _! i$ {+ V/ R
00401071: cmp eax,-001
$ y& @7 N3 |0 a 00401074: je 00401091
0 k' E& U+ p, l' d) @- V' {! B+ j% V% J' g/ C m" v# i6 C
2 ~" P# [( |" V9 B. }7 E% W& O
There could be hundreds of BPX you could use to detect this trick.3 {; w/ ~8 K1 m& N
-The most classical one is:
9 E5 m! y$ y7 G) S; d BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# q, Q& q0 q- u; D: ] *(esp->4+4)=='NTIC'8 n }) K$ K' o
2 J+ d9 }( ]$ e ^8 A
-The most exotic ones (could be very slooooow :-(3 u/ N+ v8 g7 _+ @/ y
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " H0 M9 j0 d8 L! Z( I
;will break 3 times :-(2 K' c4 X* R* b' b) N% X
3 n$ C: @& Y4 w. \( w-or (a bit) faster:
- j# g; X% `) X' z; I' c* `' V9 b BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 `- P. H1 B, @6 Y" Q# N
" Z$ V+ {/ w# J5 k# f; p, G2 ?8 W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! }& ?. Y4 e7 W) R: u
;will break 3 times :-(3 t9 j4 A; h3 Z2 B. N& i/ [2 |, X
1 T R4 [' B. w-Much faster:
2 S- d! a/ x1 |: z3 ~0 E8 H7 ?; f BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. v8 J2 J. r2 Z7 m4 M+ ~
8 o: I8 j( H1 g& @- r& h
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ C2 E2 I B/ u8 Y/ E% F& Zfunction to do the same job:
. Y+ j3 O' K, u6 I7 [( G
+ O! b# }( U+ s$ x6 b# b1 | push 00 ; OF_READ- u8 Y, U# B* ^3 A* f0 h1 O
mov eax,[00656634] ; '\\.\SICE',0( z" p' ~: R. M
push eax% B# `' V( ?" {9 Y) {2 G
call KERNEL32!_lopen
. t3 g- E& F6 w$ }- O- y inc eax
( d, O- `0 A1 w/ b: Y- L1 u jnz 00650589 ; detected
9 I- B% A, _/ ]4 w push 00 ; OF_READ
) w& c0 D1 |. V$ [& R# `) v* g/ } mov eax,[00656638] ; '\\.\SICE'
4 w' d' w' Y0 U6 y! g6 { push eax
& C9 B$ R1 a# w- M call KERNEL32!_lopen0 V1 O7 {; |# M* n& X' e
inc eax
; {( F0 o# n2 f# i6 J, [! }" L jz 006505ae ; not detected
. h( l0 Q: R& ?* y$ H! x( b6 Y3 ]4 d$ _5 p6 w$ g
/ Z" l9 G5 d: z* }__________________________________________________________________________& n z; D# E" H3 q8 w
& Z {4 |/ I4 {; `% T' ?
Method 12+ ]" U0 J/ k6 m/ f+ H8 A# \5 |
=========7 P) h2 I% F3 N& x* f4 _. N0 k
& [. T3 W! J# [6 a
This trick is similar to int41h/4fh Debugger installation check (code 05
3 Y& s7 [8 f2 ^& 06) but very limited because it's only available for Win95/98 (not NT)
/ j: a+ z/ ]' _/ [/ v$ nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
g/ R$ T% s3 l6 H: A! _ A y( H& s+ r$ j: ^) u
push 0000004fh ; function 4fh( U6 Y/ R+ Y0 `% f, ^' }2 S! [2 u
push 002a002ah ; high word specifies which VxD (VWIN32)6 s( U4 ^- U" O2 d1 K6 B3 g
; low word specifies which service- e$ Z5 i: j! v2 i Y- |5 r- V
(VWIN32_Int41Dispatch)) m8 P% r( B* a4 m2 g3 a
call Kernel32!ORD_001 ; VxdCall
) \. Z4 X$ p5 m cmp ax, 0f386h ; magic number returned by system debuggers1 A4 p& D* x" ~' l1 N0 g+ z F
jz SoftICE_detected; V0 y" T3 n+ h$ Q
! B- W Y# ^! x, U& k/ `" B8 {3 a# O7 ZHere again, several ways to detect it:7 j7 D7 ~, L1 I) L9 o
$ N& c5 z4 J( \. L% ?" Q& f7 L BPINT 41 if ax==4f9 }9 w) ~& P# a0 e; [4 D8 V1 m, K& w
7 ?- N3 `% R( D3 f! U2 R1 w( \
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ O$ k \7 y" |; ]: @
3 g7 a; \1 [- d p- n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 \& O$ R) c' S9 d' {7 k
. u; R6 R: D- b9 j! }" G/ y
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!6 @5 L, s; G6 V! P$ c
* D, V9 r5 i, O; I! _9 Z
__________________________________________________________________________
! r6 B8 m5 [2 e5 g# S# k$ n/ X7 b0 B
Method 13) z% _. h$ ^ F4 P" U1 N; s5 p7 d
=========, L% a. Y, s3 [4 R
6 t4 Z `7 P7 G! [2 N3 x
Not a real method of detection, but a good way to know if SoftICE is
; [5 t$ t2 W2 k' ginstalled on a computer and to locate its installation directory.
- N4 x: h# y* r; g6 vIt is used by few softs which access the following registry keys (usually #2) :
7 s2 c% H6 e# Y! x$ c
5 O1 h/ s% D, H5 p0 f( ~-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 \" @* Y% Z4 [8 e& B! l% l\Uninstall\SoftICE
1 H ?2 k& @' p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 O8 s {/ H/ u) e D# u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; s, Y2 d8 \2 A* e3 w+ _" d" F
\App Paths\Loader32.Exe
- K5 q5 R2 Q8 r3 v/ F% A- p4 Z
( P, `* |: X: b& C' d5 R9 X4 p, H" C; j( K0 @8 h
Note that some nasty apps could then erase all files from SoftICE directory
1 W7 E# a+ q( _2 b0 `- J(I faced that once :-(/ e0 v" ]$ f2 ~7 R, N
3 }. w, Y9 Q, SUseful breakpoint to detect it:
2 o* _: k) J$ i+ K, ]: z, t2 Q3 ?4 I/ [: _# a7 o8 {9 }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
* i( ^3 N9 b& Q7 X" D) A- K# l0 _6 f) w$ t9 D
__________________________________________________________________________; H |3 I8 i4 m6 B/ @- ]5 M" _( {
" Z z7 _- S- ^+ p ]) q) b5 J
# l4 W' k& B$ a' f, I
Method 14
8 E' w2 h0 K7 H6 Y=========5 k6 n( ?. g& j' t
- o3 C6 \ c% g! }; c* UA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
d4 e( h$ V# S9 Uis to determines whether a debugger is running on your system (ring0 only)., j7 j# W" t: s, I- d' k b
4 A8 X" J: r8 e$ y
VMMCall Test_Debug_Installed& U* ^) l4 e! ~: ]% V& g/ h
je not_installed1 D3 O0 W0 K4 Z) I
/ H2 x9 l8 o/ {# d5 s, v1 _This service just checks a flag.# O7 p9 e, f5 W0 t. z
</PRE></TD></TR></TBODY></TABLE> |