<TABLE width=500>& P, y0 @) I u+ l, p
<TBODY>
: R+ V9 X4 p0 j- T2 ]7 P. q: w. r! m: n<TR>
2 l! n, x; x' c* y, z; |<TD><PRE>Method 01
" B/ |/ ~* I9 |$ t, y=========2 q, ^( ^9 I7 u0 |3 R
7 _# R- ^* A) A, {This method of detection of SoftICE (as well as the following one) is
) X6 \5 b& p- @, y' G9 v* Yused by the majority of packers/encryptors found on Internet.. @# R; D) J0 H: H2 w( e
It seeks the signature of BoundsChecker in SoftICE9 x4 [* X1 T% Q2 K7 k: i
" E) n" c4 ? C7 z mov ebp, 04243484Bh ; 'BCHK'* Z1 K+ ^" W8 n: t/ u
mov ax, 04h9 o7 s5 `6 J u! m8 e: ?3 }
int 3 A+ |3 U$ @) ?+ s' V& f$ @
cmp al,4
" ]3 z4 j' r" d, z/ X' @( J3 { jnz SoftICE_Detected- q/ o, G4 f k1 N3 J
' j9 p2 ]2 H1 S+ Z8 y) z7 N___________________________________________________________________________! v/ W+ G2 J5 U$ F6 Y1 Z |
" ?: E( S8 T }) Y, V7 N8 QMethod 02
" u1 K6 ?$ p" H=========1 |3 v0 m$ g- `% |+ T
# g& ?& n2 S% j7 c" nStill a method very much used (perhaps the most frequent one). It is used# A/ Q5 Z( [" E. { w/ J
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 V1 b" }; |& |! V- Tor execute SoftICE commands...8 ^6 t1 D9 T, S. }
It is also used to crash SoftICE and to force it to execute any commands
6 ~6 j+ |+ h, Q0 d- Q(HBOOT...) :-(( ' l0 y t+ Z: m- _ B; G& |6 p: C
3 r' N2 |' z0 E7 T- t! THere is a quick description:' x) l Q# J5 O
-AX = 0910h (Display string in SIce windows)
1 W8 u, a6 o# ~* j! T-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); y1 ]" A6 n' G. O6 s
-AX = 0912h (Get breakpoint infos)9 Z0 P1 `; {4 \
-AX = 0913h (Set Sice breakpoints)9 G' C* S) \' n) t8 N
-AX = 0914h (Remove SIce breakoints)$ p. J; F( ]! x2 g7 Y
2 P* n. k# ~+ w: e5 f1 b& G" h
Each time you'll meet this trick, you'll see:
* I% K5 B% Y9 d$ H c-SI = 4647h
4 q+ R8 n# R8 P% [+ T-DI = 4A4Dh9 o; a2 W( w! O/ {" K
Which are the 'magic values' used by SoftIce.$ U( J6 F+ ^+ I6 ^. S& ]- o9 m) ~
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 b) N: t/ n( ~0 u+ Z6 c1 x
9 N' W3 E! n$ w9 X
Here is one example from the file "Haspinst.exe" which is the dongle HASP; \* i! B7 _- j; T* z& @
Envelope utility use to protect DOS applications:4 C: F! } }! w9 {8 Z( d* Y* r# g
4 r( M/ {; A; A U- T+ F9 h- t
7 p9 r9 l# a! g1 P
4C19:0095 MOV AX,0911 ; execute command.2 V& Y# t! w( z# f" C; {" Y: K
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
x* A2 g- s3 J4 s% `- K4 q4C19:009A MOV SI,4647 ; 1st magic value.2 T9 u* G9 X$ v' I
4C19:009D MOV DI,4A4D ; 2nd magic value.
' i6 {2 v- q b: c/ |4 m6 K$ h2 c& z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ c% w4 ?# c* A3 k) H4 d4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 D& |9 U `$ p5 a( o4C19:00A4 INC CX
" J7 ?/ p+ Z# }5 B4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 J+ f% V& v, M* M q( e& `4C19:00A8 JB 0095 ; 6 different commands.. g4 g2 K4 j$ B& F4 }# m+ A8 X
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
. b) k# J. X4 F+ [( ?8 T4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' Q- E7 r( z3 x7 N$ E
4 i9 J4 ]4 M: A8 o: ~* K8 U1 bThe program will execute 6 different SIce commands located at ds:dx, which: g* m( N. X; s- J. `
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# Y( t0 U$ Y( y9 [
/ I8 y, {5 E- f, d3 r3 s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 C) \$ z) ^2 i+ \: e% h3 w4 w/ `___________________________________________________________________________. H. N- |; S3 V/ v% R, f
# T3 e/ u0 K' _* P, d' E
9 x! T+ L' C5 a: z( t5 ^
Method 036 s( @% N j" W) ~% j
=========0 @# ~1 G) W) z) c* ]
+ P8 a& d2 M% U7 M( y4 k6 k1 ILess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
2 H5 G' E. d; x5 d! v3 f+ {( O(API Get entry point); }" \9 {7 W$ F* \6 V* W* R/ ~
7 W8 F1 v# U" U$ J8 v& M( j- ^8 R5 S& [6 N, m# n. G4 ~
xor di,di
1 A$ Q! ~* V0 ` mov es,di
/ }' _3 ~) f# @ ~4 a, U1 t5 Y0 y0 m, a mov ax, 1684h
4 l3 w* P0 O/ h& Q mov bx, 0202h ; VxD ID of winice6 ]& [3 C- J0 m0 C- y
int 2Fh
" H/ e" U5 ^0 L! F; \9 z* q( d& s# [2 F mov ax, es ; ES:DI -> VxD API entry point6 E2 l3 K' b4 B6 n/ y% X
add ax, di
$ M0 Y& Z# @9 Y test ax,ax- ~ B, g+ m. q$ o7 A: e
jnz SoftICE_Detected- d, b3 m3 p+ R; T& T% \0 i
5 R8 W/ [6 W# K' }7 A. D/ j
___________________________________________________________________________' z b# i ?1 j. V5 L) Y7 |
; ]6 V- V7 l8 f* c
Method 04# ?2 B" p0 d; ^
=========; V' r: K; J' k' f$ l4 Y
. ^3 H" |$ t* c3 M S* o
Method identical to the preceding one except that it seeks the ID of SoftICE. \2 X; m+ I) k; a0 o+ G
GFX VxD.
: U G5 k/ H" g' a0 B' `) d% ^: r& O
) C3 Q- D, Q9 U0 |! s9 e xor di,di
9 o" K; x' K9 N& a& h mov es,di
- G9 @. P- r6 F mov ax, 1684h 9 i5 j9 z4 N+ u' Z/ w
mov bx, 7a5Fh ; VxD ID of SIWVID
! u" @; n. r$ u( `- F int 2fh9 A1 ?+ h4 ]" A9 b8 e$ V2 a
mov ax, es ; ES:DI -> VxD API entry point
% s5 h8 O2 T4 u. g add ax, di7 T6 P: i c V( c- n1 T2 B6 Y* h
test ax,ax" k& j' O) v h" a
jnz SoftICE_Detected9 R* I4 p; M4 M; E
' `: o+ v6 a$ v
__________________________________________________________________________" f7 K! J& ]- |0 U
, p) v* e+ v6 ~& f& _
5 ~: D- T+ ]; k2 w6 x6 S" r: ~
Method 05
1 u5 @/ T! F* S- \/ H- x4 k=========
& a g3 s8 q0 Q9 \; J! u
4 k8 N# Y4 N. U! w8 ~Method seeking the 'magic number' 0F386h returned (in ax) by all system; a! Z1 V, D) k1 Y3 _
debugger. It calls the int 41h, function 4Fh.
# l3 ^3 J- a6 l+ R$ ^; W* ~& V YThere are several alternatives. ! Y% t* g) z( g/ c0 I& Z. F
6 A7 x n9 U- }* r8 B4 g
The following one is the simplest:
: q% v4 V% r4 K3 S$ r, a+ c5 I! g- k; v; k5 h! L1 }0 N, d3 h# j' Y
mov ax,4fh
$ R+ g5 v5 T4 R" Y! _ int 41h7 |. e( X. u: J8 w1 R) k
cmp ax, 0F386
2 n0 Y* O" E" Q- b* q+ h8 d4 ] jz SoftICE_detected
( j$ a' r$ u y( ?6 j$ C
9 H# b2 k0 Q6 Q5 n" r4 `; A9 A2 s4 ^ n$ \2 @
Next method as well as the following one are 2 examples from Stone's " r+ u7 d# W" U/ O, B2 e6 p
"stn-wid.zip" (www.cracking.net):
3 N. K$ b; {( y" n: z5 g9 y& y' @+ a0 v: X' B9 y
mov bx, cs
j5 }- }# ]/ r0 T lea dx, int41handler21 y/ [) G+ w8 }- }2 w/ c
xchg dx, es:[41h*4]* e: N) l) v9 \2 W& P7 m6 ~7 c
xchg bx, es:[41h*4+2]
) J- L& y4 r z$ q) M9 N0 C7 w: i mov ax,4fh4 ~$ S$ e; B7 y
int 41h% ?: l; P P$ n7 C/ {
xchg dx, es:[41h*4]
: t; I1 d7 i t X4 C+ f' s5 G: h xchg bx, es:[41h*4+2]
. M' k. O, |9 A3 ?1 t( c cmp ax, 0f386h
" l: V" V( p/ |1 Y! ? jz SoftICE_detected
2 A+ r3 n i l" E
( I S z$ Y0 V% _! o( P1 Kint41handler2 PROC
0 ^5 T0 p' @, u& O- w5 S iret& y( U7 J3 g' b- o( x, O/ b8 A
int41handler2 ENDP+ I- N8 R) o* h$ Q7 g
8 V* ` j6 E& W7 V. H# w2 r! u
_________________________________________________________________________9 K ^- o4 B. u& l; V( I
j1 a; ^+ @6 V! H$ N7 c* ^! d/ E: X" h, v+ n0 y1 q5 X
Method 06
( \8 S: _1 a4 ?; T0 d8 q$ O=========( V" {3 c( \1 }6 T
3 \& d% L( P# h6 r% ~. n( l4 G8 |( T
# [9 I H* |: i* k2 w3 \% j2nd method similar to the preceding one but more difficult to detect:
+ [8 ~( m, R, E* r) t
2 `$ h6 A# |4 E7 i# b
' U0 [4 {& `3 U3 K" ?) w( Gint41handler PROC
( y+ D- o4 ~2 B2 y8 W5 Q) Z; C mov cl,al2 B% K3 b- u! I4 B1 l; y9 N
iret ~ a) @2 D) ~, X
int41handler ENDP
1 E6 ?7 c' l u3 {" s" f \1 J, u& v1 U7 g
* L: ~' t+ W4 L- G. ?
xor ax,ax/ q0 R H8 K# V
mov es,ax \/ w& H& U5 D3 q9 |
mov bx, cs
: @3 w1 ?/ p/ e! U) ^3 n4 m lea dx, int41handler; X8 J# [6 r. _* G4 g. d
xchg dx, es:[41h*4]
- z! Y6 Q1 Z+ r5 h S xchg bx, es:[41h*4+2]
( G P: e) g+ W in al, 40h
% q- v _0 z4 t0 M5 t! ? xor cx,cx$ m# w; m( L6 D8 h
int 41h
+ @; |! p- ~, g# \ xchg dx, es:[41h*4]& t. z- y' E$ p5 |6 D( Q( v. K8 r
xchg bx, es:[41h*4+2]: C }' I$ T" d; m( V& |
cmp cl,al: o# y9 g) C+ R8 u* B% o
jnz SoftICE_detected6 k% W' d! r1 ]) }/ E
! u0 ^5 `) _" r# f$ K_________________________________________________________________________' l+ \3 g6 s: F- X2 d
* s% g$ Z$ t# L" z1 V
Method 07
7 M$ P9 A8 P; Q( t, B: v4 P=========
* y' u" {4 X* f" v/ V4 e/ W
' ^+ p: n8 z/ M2 G. K6 N# RMethod of detection of the WinICE handler in the int68h (V86)
: \/ a1 x- r' a) n
$ t y6 D/ {4 v! [ mov ah,43h' @; W, N5 C9 V C" H; r; L
int 68h8 e: T/ ^7 t8 q" T8 U, t
cmp ax,0F386h! _# N5 E) w6 c& |
jz SoftICE_Detected
3 k0 u. F, U: o$ E* O& |+ ~% v; Y' R5 b- g. ]- B% {
1 M: S$ [; ~6 v# \& p2 u=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ x7 @9 \# D7 o; j
app like this:
/ u7 @! ]; R0 c
3 z8 F0 V/ d% _& Q" a BPX exec_int if ax==68; l5 f7 t* H1 k, h" t1 V8 C' [
(function called is located at byte ptr [ebp+1Dh] and client eip is
) i. D* [9 q D5 R( g- ~ located at [ebp+48h] for 32Bit apps)
9 E+ ]6 E1 Y8 W+ r7 r$ d__________________________________________________________________________
! `+ O4 Z% L v: V" n- _
% i6 R+ K9 o* M+ \# m; A/ |3 U0 |/ K3 e/ N
Method 08- \: }9 t: t( H/ u2 ^( Y
=========
O% M; t; i$ ?: b
, p. s! D" p" U6 A! f u9 BIt is not a method of detection of SoftICE but a possibility to crash the
, F; u: N6 {5 P8 w! bsystem by intercepting int 01h and int 03h and redirecting them to another
3 P( o& N" Z- Z' [* nroutine.# @' g/ E5 i* y/ T8 [# w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 C9 V( `, Z( P, Eto the new routine to execute (hangs computer...)
+ {. V- Y; K; @; m. \- I) q: J: W
mov ah, 25h
* |) e6 T% [* G mov al, Int_Number (01h or 03h)
. ?1 m z8 e( Y( j. h mov dx, offset New_Int_Routine
4 y. O) ?% M& Y) O, f) K! d. i, x8 Z int 21h
, X& y4 ?" n0 `
0 b/ `1 m" u# L( s' ~( A__________________________________________________________________________( h- f6 T! j, @
2 h! e/ H& Z& }% f# f# Q6 B+ xMethod 093 P+ ?( w3 C0 [
=========
6 n$ ]6 O: U% x& v% F1 O+ `
! Q* V2 x, H- r$ G4 ~$ H% zThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
2 ]6 w2 x9 q0 D& ~performed in ring0 (VxD or a ring3 app using the VxdCall).
' k5 |$ I+ Y$ l: ]4 SThe Get_DDB service is used to determine whether or not a VxD is installed
$ X7 \1 ~8 W0 v: n) Mfor the specified device and returns a Device Description Block (in ecx) for
, ~8 [+ U! }- Y: S6 v0 uthat device if it is installed.+ `' N3 M: z s5 I( x+ n
6 C: U( i/ u3 g% Q' w mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- P1 V: M; o& G4 N
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); L& w6 P; O: u! q) G/ w
VMMCall Get_DDB
0 q; ?5 d ^7 V% m8 f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 g" Z& I( K& Q1 L0 m- C0 A) D' X/ U1 q( q$ t
Note as well that you can easily detect this method with SoftICE:
9 J8 ^8 e6 k, m/ v- o' t% [ bpx Get_DDB if ax==0202 || ax==7a5fh o1 M2 y/ t3 Z' ?" M/ V
9 ^6 _) l, K! ~7 T3 p__________________________________________________________________________3 B3 [: C, v5 v( H3 n3 U
" L; N- j0 k- L" |3 x2 AMethod 10
- x" u1 {1 V+ C+ Q=========" i) ^6 V& h1 ^" f+ q) K& r$ l
$ t9 K+ I5 H* d7 l
=>Disable or clear breakpoints before using this feature. DO NOT trace with
% u( a7 W% O1 M' Y SoftICE while the option is enable!!9 B0 E* A+ r; w
$ p! @" f. g; s% m% [$ h6 bThis trick is very efficient:9 V1 B/ D/ C4 A- q# ~
by checking the Debug Registers, you can detect if SoftICE is loaded
" y) c; h& w6 B: s) Y5 {7 V3 v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
8 g, O2 B: r$ {% E8 _, K1 xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 R, V( \! c2 x. \7 E. xvalue (in ring0 only). Values can be manipulated and or changed as well
' E/ A) M8 c. [(clearing BPMs for instance)
3 P) A# C+ M1 F2 q' p; B- W
) d( f1 i6 w& F2 S7 m4 b__________________________________________________________________________- k+ I) G5 |3 f p
7 _/ m" q" M' `. f9 o& ?6 I
Method 11% s& n$ r9 n7 e/ y, U! E% Z- Z3 S
=========
. `' f0 \/ q6 L1 z( F9 e$ g6 s5 U" b: p# d: k5 ^, g
This method is most known as 'MeltICE' because it has been freely distributed
5 e5 Y8 B2 P, \ F3 I+ K/ rvia www.winfiles.com. However it was first used by NuMega people to allow0 l) R% i. S0 `" U
Symbol Loader to check if SoftICE was active or not (the code is located
: J( ~. y# s' h# z8 }inside nmtrans.dll).
. B& o4 C, @+ U
9 \+ i7 G7 v# m/ B! L' S. V- HThe way it works is very simple:
! }2 F4 e: e3 c- ^' PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 [( U7 a i$ Q+ g8 C1 Z# M7 X8 j+ e" w* aWinNT) with the CreateFileA API.
% K, B [- p+ j+ w% n( t8 Z6 ]8 O0 N& y+ U4 m
Here is a sample (checking for 'SICE'):
' f: v7 Q9 O& \0 h4 I
# i9 s5 L1 }+ e1 l/ z9 K1 v' a& iBOOL IsSoftIce95Loaded()
4 d) M1 f/ E4 ]$ e6 L# a9 v{ A! F3 s& ?/ S
HANDLE hFile; + q) S0 s4 u/ b* _* Z' ^1 e
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
/ W( m8 `1 g( |, j% n+ V FILE_SHARE_READ | FILE_SHARE_WRITE,6 F& J( l! c& `! O
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
m( l- I7 P8 P3 u' U if( hFile != INVALID_HANDLE_VALUE )+ U* k$ q5 ^$ A# v- Z, i. ]
{
5 r, U( a, n1 T2 m CloseHandle(hFile);0 D" l" W, d: A& _
return TRUE;
* M( o' C+ \0 C$ ~ }
# ~5 }0 V0 Z+ e% N! H& E return FALSE;
9 `: Y; r7 B1 p; q0 W5 h}& X5 e# J8 I: U' C
. ~! Z# t* |, a9 G& k3 v. V6 A% n' W% FAlthough this trick calls the CreateFileA function, don't even expect to be' c4 Y, p- q, K7 X3 F' i
able to intercept it by installing a IFS hook: it will not work, no way!5 R- b: q4 r8 c1 s& d2 }
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 i/ {$ b: ~+ g, y/ C' fservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 D6 {9 R' @$ l7 w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc- E1 c% G. p7 x) u; P* Z% p. ~
field.) r* O$ g. f X/ J4 D
In fact, its purpose is not to load/unload VxDs but only to send a
& L( r) i' T5 C! o$ v& |( a3 aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
F( Y0 d! z. Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try# f. N( u$ G4 c, ]; L
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ G: _" }. O6 i+ WIf the VxD is loaded, it will always clear eax and the Carry flag to allow% I! S' \3 ^# Z, x+ _% g& S( ^
its handle to be opened and then, will be detected.' {8 O# o0 F7 l G! Y+ t" Q; t6 A
You can check that simply by hooking Winice.exe control proc entry point
6 |6 U# n: Z- c' {while running MeltICE.
; S- C3 b# K" F6 |" F2 g( r1 e2 ~, ^) V1 S
( \0 _: G3 l3 U0 b 00401067: push 00402025 ; \\.\SICE
! y* k3 {0 ]7 ~" y% d$ e 0040106C: call CreateFileA; R- }9 r! c% }* l# S: `1 y
00401071: cmp eax,-001
- ?! ^( M) I$ [. k/ Z# w5 ? 00401074: je 00401091
! d. Z. F3 v+ _" z, K8 z) y$ S8 N7 D1 n6 T8 e
2 K) w5 h/ O j- Y3 D; |
There could be hundreds of BPX you could use to detect this trick.
, q. ~5 H& M8 c! F-The most classical one is:8 B* U+ {( `7 o4 G. h
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. A1 G9 q/ D r. b
*(esp->4+4)=='NTIC'
1 F5 q3 y3 }3 o5 E
% V* g3 c( D2 V-The most exotic ones (could be very slooooow :-(# @# W; s5 N p; }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( a5 @; ^! C2 J8 B; u5 }3 @ ;will break 3 times :-(
8 e2 q$ z r. _
" m% H% S1 o. u4 h, i7 X+ E-or (a bit) faster:
0 d% k+ I: d% d6 F7 S; x' T BPINT 30 if (*edi=='SICE' || *edi=='SIWV') U' c& P3 v+ y8 _9 G, g& S
l9 p% d3 h v: Z% J. i0 b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ O. i8 m& G$ Z3 M1 O$ H
;will break 3 times :-(
9 s) Q Z' N7 U, B8 F% v; m
/ |, N8 ~0 P9 `, x& Y-Much faster:
" M2 v) ~6 h( _8 d/ m' z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') V+ z1 f! O c! t& K% p$ V
$ t Z' S3 I% u W* }/ \
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 Y; A' i; f: ?, P& R0 e8 `! Lfunction to do the same job:& k4 Q/ h M" m! h
; b3 Y& X6 F" V% [2 E push 00 ; OF_READ5 l. o& Z" c9 d3 x
mov eax,[00656634] ; '\\.\SICE',0& l! L0 P# P7 I& R) F4 v) o R4 E
push eax
6 D0 u c+ j1 g1 o' t( g0 n call KERNEL32!_lopen
) I, K `! U# d' `& s inc eax
/ [- @0 t" p: c3 V jnz 00650589 ; detected" U( |% }7 K9 H7 f
push 00 ; OF_READ( h6 q" E; V7 f' U
mov eax,[00656638] ; '\\.\SICE'$ a5 d2 ?# h5 A# b6 n
push eax
, `) l+ T" |2 O+ I! p call KERNEL32!_lopen& c) M1 `* R+ _+ s, ~( u U6 G8 Y
inc eax
& J, y9 @& U, x1 Z3 l3 [) ^) b jz 006505ae ; not detected
7 J/ _# ^0 c8 w6 \* |
& w% H2 {. [$ g7 A$ L9 J. O6 M: H
6 E7 A& }' Q7 G: f__________________________________________________________________________
& b/ _9 L, p& r3 P; Y* }" }# ]1 F: K/ f
Method 12
. v, _( R6 m) c( b# m7 g=========: o. Z v4 h6 m3 ~
& D! c' _4 A$ ]. F+ l0 [This trick is similar to int41h/4fh Debugger installation check (code 058 [8 V8 f( k& u; y3 e4 K! m7 l2 }5 K0 F
& 06) but very limited because it's only available for Win95/98 (not NT)- R* N4 }) P/ `# ^9 S& H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 @* x+ d$ k7 l" h3 J6 z, [( e, ^( Q
( U: A. w7 M# V push 0000004fh ; function 4fh3 G2 P7 u( |7 P* C$ o5 R2 M1 K
push 002a002ah ; high word specifies which VxD (VWIN32)1 I$ c& C5 i8 g7 E
; low word specifies which service
! x/ N& Y1 ~4 T$ ?0 k3 I N (VWIN32_Int41Dispatch)
" Q! |# W, H# _" u3 ~: T: s$ N call Kernel32!ORD_001 ; VxdCall' x) b, q2 t; j% C( \
cmp ax, 0f386h ; magic number returned by system debuggers/ J" Q! v( p" Y# A0 k: E
jz SoftICE_detected
& T* ?/ T7 U: T& D0 Z: u7 K0 N8 d* [2 F( k: }: O) P7 y& |; {) U7 l
Here again, several ways to detect it:4 Z; Z" P; W# M4 ?' H9 r& u
: i! C# U3 z2 F( {" j) M0 @
BPINT 41 if ax==4f
5 J9 u0 _& J. I6 L4 N. p$ C# ?+ ~. v5 O" r+ g* A% u
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 ~, [9 [: V2 l% [! w% M4 W) c' ^4 F0 O; p: i5 ?% W
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A& ^$ M: E+ h, G3 d3 a5 @1 m
8 n( q6 {5 L% C' u& y' K$ q( ]$ m
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
9 @0 T$ R% N( j$ h& p$ V! O9 b
. ^, p7 y* ~% Q8 _- s2 @__________________________________________________________________________
9 U) c( r+ A# f, j. v* E/ F+ L
: |; w1 N( p/ `* J3 CMethod 13, Z# k! }7 N9 }7 ?
=========! B! Q4 A% Q6 I- {3 W
1 [$ h) j1 r& @Not a real method of detection, but a good way to know if SoftICE is y5 K5 \( ]% x; S
installed on a computer and to locate its installation directory.8 n* M) ~- t# U1 q1 q# A. a
It is used by few softs which access the following registry keys (usually #2) :
# i: @# {* z3 C! A) r2 G
' C5 a& D" W$ R/ z/ F% X, n8 C$ d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion V4 q1 A n7 _
\Uninstall\SoftICE
7 s3 V' v$ K, K1 E-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# C# z% k$ C, {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. {4 z7 S* p, S8 |( }; R\App Paths\Loader32.Exe
8 z: l; D5 n4 p5 h6 `( f. E/ e2 U4 r% M) S E7 \" x, L
I* J+ b3 W- f4 J' _) }Note that some nasty apps could then erase all files from SoftICE directory" D+ k7 w7 n$ x, S# |
(I faced that once :-(- i; C! i* X2 k: ~9 o3 W' H3 y. d
( v$ X7 G7 g7 c& ~2 l3 o; @
Useful breakpoint to detect it:) Q- C" L% m; }; ^8 Q9 X/ @5 T
( W/ G# n5 h6 Y! U: @4 T9 L
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% J) O! M& P; N' q8 c+ f1 E+ c
! c$ R, G r Y__________________________________________________________________________4 l6 @4 N+ ~# f/ ^8 K/ m
' t: R9 ~! A2 {% t2 I
. N5 \5 b9 F+ M
Method 14
% [- {# i# I6 `- X+ L3 J2 G=========
* i* B' s2 j! T; H0 T1 T- x( w2 z/ E3 g+ M8 b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 T* E: u9 a. x, [# Q: v$ X* h
is to determines whether a debugger is running on your system (ring0 only)./ ?$ Q5 o8 E" q% O( F( R& }
' M3 p2 t* |$ g$ w9 B VMMCall Test_Debug_Installed
) ~& |. \3 `- e, w9 d/ V& i- L je not_installed
7 l( Z+ m' {. k
/ y2 |$ J, d7 F3 u0 J) D6 b2 ZThis service just checks a flag.
" ~0 k3 p7 p/ _/ v</PRE></TD></TR></TBODY></TABLE> |