<TABLE width=500>' K) _/ F9 B @8 k, e
<TBODY>8 F; w; @1 S V5 \$ N( Y
<TR>& }" e' ?/ q, i
<TD><PRE>Method 01 ) x3 q: o" u) |: g
=========
, R! e9 a# v C& o1 v& J( a' B
6 W4 s9 g9 e7 \2 M5 b; EThis method of detection of SoftICE (as well as the following one) is; n$ Q( \* M) N$ y
used by the majority of packers/encryptors found on Internet.3 N5 d' _" W$ s" @
It seeks the signature of BoundsChecker in SoftICE
e5 }. E1 y) X0 M: M5 d0 r
" N' `$ z6 g: \- V4 G mov ebp, 04243484Bh ; 'BCHK'4 Q' D6 U3 a- `1 G# l: K+ Z
mov ax, 04h7 Q" g# i; X/ i/ t _$ N& m
int 3
* D( Y" z+ f/ v3 B, h cmp al,4& K$ s* e/ Y' h% D6 Y; i
jnz SoftICE_Detected
3 j. ~6 r8 s w0 H8 _1 k) u0 l: y) H: }3 Y: ]
___________________________________________________________________________
' q" u/ ~( U% r6 t9 C' b/ c1 _. i+ h: b& D
Method 02
& ]* G" U! I( T9 n" ]=========
& ~+ \8 D4 W1 [4 a' t
' p/ T3 H; ~: H3 w" a& aStill a method very much used (perhaps the most frequent one). It is used
) J8 H( q% ^; q4 ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ l/ X: ^) s* q( ~& j
or execute SoftICE commands...
; t8 f4 R: X/ wIt is also used to crash SoftICE and to force it to execute any commands/ ^, s8 J; }6 T. B* T, M' W$ a% s
(HBOOT...) :-((
4 [ W. T! ]( r/ @
6 Z3 G9 C- r4 M; A, d: y. {9 HHere is a quick description:
, S6 B3 S3 q1 E-AX = 0910h (Display string in SIce windows)& `; @7 M5 r! i |$ R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, W8 r y# x2 K5 J) I-AX = 0912h (Get breakpoint infos)
2 w% Z% c: L8 E-AX = 0913h (Set Sice breakpoints)
/ x2 _ ~$ ? l4 G2 g-AX = 0914h (Remove SIce breakoints)
+ Z/ C' ^ G/ H( j2 ?$ H+ k* c. F& c1 t+ o
Each time you'll meet this trick, you'll see:' g, s5 _$ L: W0 |8 a8 D
-SI = 4647h, H5 b- x: U' Q4 E
-DI = 4A4Dh: {/ B8 o& [+ b) `0 z
Which are the 'magic values' used by SoftIce.
! |8 }( \( u7 H2 F& r& TFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' O0 R4 w9 x% G9 A6 A6 N8 i( J, c3 }6 l0 d
Here is one example from the file "Haspinst.exe" which is the dongle HASP& r* C0 @3 u$ |
Envelope utility use to protect DOS applications:
5 Z( e _1 k8 T5 {& a# F B' v# J% W+ n& E# B% R
5 U8 t7 g- O. M$ ^( z8 m0 d4C19:0095 MOV AX,0911 ; execute command.; f2 t- e" P5 @" ]
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ i$ p4 J- Q+ Z3 ?4C19:009A MOV SI,4647 ; 1st magic value.
5 r3 }+ r. v* K5 ?' c* Q" u$ u4C19:009D MOV DI,4A4D ; 2nd magic value.
2 \+ X( D- z( T8 @* r6 n& v4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 h3 a9 _% Z* }1 {4 p
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; x5 }* a$ z. h# ?4 Q8 [8 H
4C19:00A4 INC CX h; V1 ?8 v- o
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute q$ v9 n; I0 _1 U
4C19:00A8 JB 0095 ; 6 different commands./ \: @3 q8 Q1 b( ~
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 f- R5 S" @1 i( U* @1 ]4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 Q0 l7 T- ?* i x5 r
0 y, Y0 U- Q! F5 }
The program will execute 6 different SIce commands located at ds:dx, which$ C# {4 _& N8 @. V" z/ V; [
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 \3 b9 d' ]3 y
+ G0 c7 ^* S% u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 C5 K5 U. c e; {' f4 H
___________________________________________________________________________& L' K: K! E- g% K3 `( K! y
" W8 n4 k2 E% B& }2 d& M; J
! R# i/ l; t* B' m5 L3 tMethod 038 L, u X: e2 k5 S; H
=========
" Z0 L6 `0 {0 D3 J
1 A! b W- l, @4 sLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( h, n: @5 l% Q4 b' `0 y! W" R(API Get entry point)- w! F2 z. m7 _( [
5 ^/ N* N) g0 M7 n9 t2 U8 i# n
7 C1 }( p6 s% V# O. w xor di,di
3 h& ~/ v- X+ Y* `; x9 Z* [0 x- ~ mov es,di
# s: b C7 s, q: Z" _ mov ax, 1684h " O ?2 `1 a1 l/ M' ?9 s
mov bx, 0202h ; VxD ID of winice# L# a: P9 Z5 [ Z3 j
int 2Fh
6 b6 C, v' J, N! W( n mov ax, es ; ES:DI -> VxD API entry point# a! E6 e J: ?: ?4 F: V, w
add ax, di
5 ]3 \2 G3 k$ x3 E test ax,ax
- Q, z1 H' K9 O+ s+ p5 M* o jnz SoftICE_Detected# o5 S2 Y7 _1 ~, k
) y$ f n+ U' g! V
___________________________________________________________________________, Q/ }7 D# ]7 ]3 W6 u
* [0 n' S4 h, r) P4 Q4 v2 BMethod 04
i1 G6 n; N7 x! h) Z8 @: k=========
/ T; A, a4 \' z& H: G! Y( u, M, f
+ P$ D: H# L6 R4 @4 `Method identical to the preceding one except that it seeks the ID of SoftICE% b) `' n3 B+ l/ S* c5 C
GFX VxD.0 l% i3 \ B, m9 v- j! J
3 P* T/ y" a4 u( [8 J- f# Y: F! M3 w5 k- {
xor di,di6 y' ~8 \+ L9 a, [
mov es,di" @5 @' ?! L3 r' \; Q
mov ax, 1684h
! R& H( T5 c2 R) H) v# p% ~2 `5 H mov bx, 7a5Fh ; VxD ID of SIWVID/ \# q1 N" m6 `% u# S! h+ F8 t
int 2fh
: i! f6 r9 G, @- U& e/ n$ [ mov ax, es ; ES:DI -> VxD API entry point* q- q# |/ a% K: e, M# f
add ax, di
3 v5 f% p* i( ? test ax,ax/ V, M; K7 y- v- f" k# m9 a
jnz SoftICE_Detected
# n* S! P$ `$ z# W, I6 i; Y& l3 r* F4 [# t0 @
__________________________________________________________________________
5 X+ M4 V& @2 X6 e, v9 ?9 c6 J1 N! K& X
. q. X/ `3 A( S& r2 RMethod 05" u) C% [1 u9 j
=========: \( m3 x# s6 B; U7 E
4 e, n" {/ g( E
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, v8 z" A& u/ A; p) Wdebugger. It calls the int 41h, function 4Fh.& g% z" F# N8 {, C: S
There are several alternatives. ; P$ h% X* F! [' t( }- q
' x' I5 m! @ N' S2 c& i1 N- DThe following one is the simplest:
: K1 J$ b9 r: \! F9 \0 c9 c# k. s6 ?2 C% c. a3 N5 a% j8 b+ A
mov ax,4fh
1 F' r6 b* r& L/ J X4 `& Z2 U int 41h
0 B5 M8 p2 d* V! N1 y cmp ax, 0F386
) n" G$ _2 }7 {! B- X: K* W jz SoftICE_detected9 T! f$ ^5 m" o l" t
8 ?- S" Z& X, k% S1 L% c+ F# {3 d9 Z7 I! D" n
Next method as well as the following one are 2 examples from Stone's
5 j' d" S2 \$ x4 v4 P"stn-wid.zip" (www.cracking.net):6 n+ v X1 G: F% Y$ R
2 Z/ N) ?, B; G& c8 F$ m mov bx, cs
, }1 S, A+ ^2 Q( ^7 Y3 D. I lea dx, int41handler2
) Z4 u3 y+ m7 u8 T xchg dx, es:[41h*4]$ _! ^: |3 m# d4 E* @
xchg bx, es:[41h*4+2]% k0 a7 U, X+ Q0 p
mov ax,4fh2 [1 ]( ]4 A6 r- ^; R8 x' I+ i
int 41h
2 W; v6 x: [( B4 r xchg dx, es:[41h*4]' |: G$ i* @2 v6 J+ j6 t
xchg bx, es:[41h*4+2]+ M) z k7 \/ {' @2 y8 v, x
cmp ax, 0f386h, i/ l* }3 k6 r4 p' ]) Z0 T
jz SoftICE_detected
. B9 I$ I# `: Z& g9 Y3 u' M/ q l2 }% N! E
int41handler2 PROC7 o2 I2 g9 f& q3 m# \
iret
9 [* `6 F! E- o" @int41handler2 ENDP+ }* A0 ^- O: J) J* |3 j
- } G, u Y: C" d. n" x' o( o( O+ u
" F- V; g3 e# `! e) u5 F) [: z: K
_________________________________________________________________________
) M. W8 @/ _; y v' [+ K" D. s: m0 z7 m4 y( {5 B
: z# N2 ^3 U! d& M9 O( L: Q/ L
Method 06/ W) O1 w8 P. m3 b, A1 b
=========, @7 P, P) X" c: [5 f ^
& h# U8 Y4 H2 x6 Q
7 N4 }: L) X; j2nd method similar to the preceding one but more difficult to detect:
) j, N2 T; _+ x1 s7 ^: U5 c. U
7 L9 N1 P/ j: D
' w7 r$ s! m8 O kint41handler PROC- |1 g- Y/ W% }7 T8 Y, |8 U4 s
mov cl,al
) h7 ~9 o4 f& |8 z iret' G3 Q% ^* ^' s1 K0 ^. k
int41handler ENDP( Z7 ?. ^3 Q% R2 n
1 l2 n o- Z& P U1 g c" n
/ i7 |1 U9 S: c! A+ Q. G8 {) M xor ax,ax
5 T4 _1 m; D- T) O4 L# X0 x mov es,ax
2 }' D9 n# G& Z mov bx, cs! L$ n7 X' O% q: i/ }8 }
lea dx, int41handler3 g! M/ ?& k4 K( I1 I; T4 O1 C3 a
xchg dx, es:[41h*4]8 R8 [ m8 p( M" Q! f* p
xchg bx, es:[41h*4+2]# X. e2 M8 P" s( f+ h" a, O
in al, 40h+ L2 p- n! e/ H D5 W
xor cx,cx) j! D- A( D/ z/ \' ^, A6 }
int 41h
: a% w: x+ h$ h, G. i. t! a xchg dx, es:[41h*4]
4 D% W2 d; {# H$ e& f+ {9 } xchg bx, es:[41h*4+2]
- q' p( ]4 [- z# h" X8 p6 B cmp cl,al
4 V. j! Y1 W5 w" w- C* U jnz SoftICE_detected
3 h; s: y# f; @1 |; J6 X$ r
6 H1 y( H# K: Z/ t7 | H1 v_________________________________________________________________________
. c3 I; q8 V$ w0 ?
- [/ z2 h* v6 {( n+ J t7 PMethod 07
1 v; t+ S/ Q& @=========
4 p& i8 [6 j& \
3 @. B7 _1 h* O$ M" X0 f& p3 rMethod of detection of the WinICE handler in the int68h (V86)
0 n/ l: V7 G6 v! S1 K! t4 ?
8 n1 U& \5 Z. U9 @ mov ah,43h" W" m9 v8 @ O* s
int 68h& g3 n) v! G: _* t. `3 p+ n& P
cmp ax,0F386h
9 `3 V* x# h* @# r3 H jz SoftICE_Detected
4 M# _& r6 {1 N: b: k; w. [
, i2 z8 g, i- T' \0 _5 Q. x+ j- D+ m7 j K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& B# Z5 X7 ^! b* u
app like this:. u. f! u0 o5 q8 x4 O9 s: ?
0 ?" y) }' V# b S" } BPX exec_int if ax==681 [; g- Q* f6 e. i2 D9 w+ s
(function called is located at byte ptr [ebp+1Dh] and client eip is
/ X/ g, B/ V! m4 ? located at [ebp+48h] for 32Bit apps)
v) V+ ^0 @; h! y8 f2 K% ^" [) D__________________________________________________________________________& Y$ L7 O2 F5 l
4 u2 K- |' h2 N$ A" o
! k2 R- o% h7 y( e' M7 @0 c2 vMethod 08/ q6 i& m, a1 L3 H2 `
=========+ a, l2 T( ^ f9 s
3 h* f5 H7 r" m" y! `It is not a method of detection of SoftICE but a possibility to crash the
3 B( h% J: e% Z! U- Zsystem by intercepting int 01h and int 03h and redirecting them to another" t) e- H8 o* F1 _- V$ L0 a y
routine.
: j) V( l# u1 t" V, O0 aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! G) W1 `: ]% h* u, \6 M
to the new routine to execute (hangs computer...)1 p: h8 f; w/ ]
: V W$ y0 F+ t3 }* _ mov ah, 25h
& l& }9 n, k% K5 H2 t9 b mov al, Int_Number (01h or 03h)
5 U+ l7 j4 z0 R6 Q mov dx, offset New_Int_Routine
! l6 c0 o5 @; ]- ?8 Q int 21h4 v; i `( C8 u& m, F
# o* d7 Y/ E/ g J
__________________________________________________________________________
j- z7 J( ~7 }3 t" M+ S0 ?! ~6 e1 c
6 S$ P/ W' P$ y: \Method 09. j; [ B0 F. _
=========+ d0 h, A$ Z; z. ~0 ~1 X+ U7 ^
* `. I4 S( `: @4 d
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' U, b% D. V2 K; I
performed in ring0 (VxD or a ring3 app using the VxdCall)." X3 c4 |( {+ x7 ^: D# k* y r
The Get_DDB service is used to determine whether or not a VxD is installed/ d# {9 C* V+ V/ U( m
for the specified device and returns a Device Description Block (in ecx) for3 |5 X8 \6 N3 E
that device if it is installed.
3 Z7 d @5 o3 ?( }+ P V S) t- p9 _ d
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, z4 n" |6 P9 u( O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 {% d- D& a/ l) w; q VMMCall Get_DDB
( R9 v& [0 L1 G9 o mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, a* q5 {- m/ Q1 o: E- m5 B
& c' s/ S3 t- G, x; `" U2 kNote as well that you can easily detect this method with SoftICE:3 ?1 L) J: W% y9 x) W. p7 L+ W3 X
bpx Get_DDB if ax==0202 || ax==7a5fh. Q" ?$ F% `; h
7 k, e5 W* i9 n/ x4 r' L g__________________________________________________________________________
2 D, R/ c6 v$ t+ D1 r
. q* w) `& k0 Q! g) ZMethod 107 L4 B5 Y' F' N0 f: q$ F: r! Z5 X
=========% h( o( a; e, z1 j; x" e
) E. \$ w; L) T m1 `
=>Disable or clear breakpoints before using this feature. DO NOT trace with. k0 ^% {% J3 I1 A
SoftICE while the option is enable!!
# l, _& H8 M( ^" `1 \: N* Q' S! `- T* @. S) r) U! T; A1 w
This trick is very efficient:1 Z$ \0 \2 \: J& r. b4 K" Y
by checking the Debug Registers, you can detect if SoftICE is loaded
( v8 S9 [$ S) q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 R( {% [# _! s+ R
there are some memory breakpoints set (dr0 to dr3) simply by reading their. h% {% a, v6 }5 o4 ]
value (in ring0 only). Values can be manipulated and or changed as well
0 q% R I% d7 q+ c" i(clearing BPMs for instance)
" v+ W! r0 g$ w2 {8 c+ Y4 L$ m2 ]0 y# q' z4 Z/ B$ J: \6 p6 R
__________________________________________________________________________" V# y5 C8 \) y2 e8 ?1 s5 Y1 n
; m% |6 p5 k/ ^( K* j" l+ }0 j& e
Method 11$ n2 U3 `( i) W& \4 N
=========. m( [/ t/ g( }& C/ l9 Y
& ~- m) ?* C5 F" y; ^# f! ZThis method is most known as 'MeltICE' because it has been freely distributed
; y6 y% W+ z1 Y, `- Svia www.winfiles.com. However it was first used by NuMega people to allow
# f% ]# F: B, q# ~5 d& a! V `Symbol Loader to check if SoftICE was active or not (the code is located% B! a" J* T* x( S
inside nmtrans.dll).6 ~" a( A6 m$ L4 P2 e# Y( P
2 w$ x: [$ V7 U) T) a
The way it works is very simple:3 U) d) u! w' i- X% v. ]
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% G0 [$ x w# Z2 j+ k! k$ v* MWinNT) with the CreateFileA API.
0 |" c* H, a0 B1 z6 E& l3 ]2 z& P8 A2 ]4 ~, z# W. U
Here is a sample (checking for 'SICE'):* |! G, `4 y' N2 F. H+ H5 ~2 \! Q
2 z7 O3 G6 ]* H6 [! Y( i5 qBOOL IsSoftIce95Loaded()) M9 L. v! [1 _; @. y! a) P$ z
{
" J5 Q9 P, X* P" ?6 ^- n HANDLE hFile;
% y" e: o8 o0 u% R5 n3 P/ W7 c: J hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% g0 t: J6 d4 e! L! ]1 L FILE_SHARE_READ | FILE_SHARE_WRITE,7 s+ Y; p9 I3 z5 i
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
, b4 Y& T1 l8 L3 D8 S1 D6 t if( hFile != INVALID_HANDLE_VALUE )
# x0 u* c) Y# u6 h& O3 j, ~ {: b' e: O, Q1 e, |
CloseHandle(hFile);
! G) I/ c% Y! [) V% o return TRUE;! W0 s% R+ f0 B( F) r
}, C$ Q% B6 E. T
return FALSE;
1 a, d( o/ Q4 f/ \- t+ A" u0 Q}
9 D, V, i! n. `" ]/ k1 o
0 N4 R5 p7 p1 E. j# oAlthough this trick calls the CreateFileA function, don't even expect to be. X; m m: I$ {. b
able to intercept it by installing a IFS hook: it will not work, no way!/ E, G8 X* {; q0 c) k/ g
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 [7 t; P5 f& k% @service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 C( l( t/ |: Q1 \and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 [6 }+ y# j, I- qfield.
/ x, N& y6 |! `! jIn fact, its purpose is not to load/unload VxDs but only to send a 4 H6 {4 s ?" u) L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): o, Y# K0 F6 ?5 t. t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% x, ?! y- O1 ~, n( Xto load/unload a non-dynamically loadable driver such as SoftICE ;-).# P2 u% t3 ?& n! `. X+ J
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 I/ l" z, u0 l3 u! A, X. B
its handle to be opened and then, will be detected." ?* R- Q9 m8 i- h* L3 i8 f: ~
You can check that simply by hooking Winice.exe control proc entry point
* ?, c! X8 V# mwhile running MeltICE.
; T9 |1 O! C8 L; {* ^5 ?
. ~! g$ U5 ]% P6 g
5 ?) X+ e" h) p7 J# K, m5 N9 J 00401067: push 00402025 ; \\.\SICE
; w7 R& {! [3 T% `; F4 ~/ h 0040106C: call CreateFileA
* N& J1 ~* X6 v9 m& r. L: E: R- } E: v, C 00401071: cmp eax,-001
7 Y( o, ^! h' ?7 e 00401074: je 004010913 b8 o* u; ^2 J+ x3 w7 s
+ F# |, K: b/ Z, @4 m* k+ ^, P9 n$ c1 {( y& j$ Y
There could be hundreds of BPX you could use to detect this trick.6 i3 i6 W5 K" K5 y* R
-The most classical one is:
' A p% n2 }9 ~4 ~/ l; O BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: p( Y+ G- x3 d9 J: c$ b. e) Y *(esp->4+4)=='NTIC'
8 H% ]6 Z( J8 U+ e+ i1 U6 G2 j: j7 a' V0 n
-The most exotic ones (could be very slooooow :-(( E! W5 P5 ]7 d X4 _
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') # h1 A$ }& y$ A) T6 y
;will break 3 times :-(4 K2 k8 N7 F F& D9 }3 l
( ]1 j+ M3 S/ V% e$ ]3 e* x* z
-or (a bit) faster:
* U# G Y$ b% J& \% r BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 [, I" o( }, O6 l3 p, u% H
" V" v2 L$ ], w4 r7 ~* [
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. s. R- o5 K( ^' @* F3 m5 v ;will break 3 times :-(
7 F5 N' _; c9 D4 @2 F( ]; C
8 I0 T7 H8 Q3 S# a: I5 z7 z7 u-Much faster:+ M" y0 q; k% ^
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ _! i( j( v6 Z. o2 ^% `) x
, o1 I" y5 H0 o# K7 oNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
% ]7 A- c: g9 r& }# m( v" d* Rfunction to do the same job:, {4 y5 y9 } d$ C* y# r' z/ U
) L& s* V/ ]% O" Y6 B7 w/ \$ j
push 00 ; OF_READ
, u' Q% ?: i) |( u mov eax,[00656634] ; '\\.\SICE',0
v& t- `; }9 L+ v6 }+ k% j. F push eax- K7 A9 Y7 O* z
call KERNEL32!_lopen4 ?- Q- L; V9 |8 g
inc eax8 _" i* O5 `# e/ f; X! R
jnz 00650589 ; detected
' n+ e @0 n3 K$ `4 p push 00 ; OF_READ
, e) T! G: C+ m# B T2 G mov eax,[00656638] ; '\\.\SICE'
& ~* L" c/ q. H push eax8 X- Z0 R. W/ y0 [& {. e
call KERNEL32!_lopen
2 W/ r- w, l( h0 L/ c inc eax
# r9 }$ l8 c# w l/ Z jz 006505ae ; not detected5 P3 p3 O) H; J
+ }3 b4 C$ T2 ?; ?3 q
. W( m% [! N# j' ^$ d; {__________________________________________________________________________
; Z: x* o1 k6 r! v; j5 I
! E6 V" N5 \, W+ q( T& \" H0 E1 nMethod 12( q2 f4 M: Q* @) z
=========* g; s: u. k; b$ Q$ [5 v1 B
( k: O3 c1 T) H, a2 O2 m
This trick is similar to int41h/4fh Debugger installation check (code 05
. S, m# V% w5 T% i; H- ?4 [& 06) but very limited because it's only available for Win95/98 (not NT)' f$ U, }! ]6 }0 i. t0 j8 N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 Y* B0 ^% q/ c8 y; \8 @' G
# l2 d* |* ~. N! \: A: W: e6 ~ push 0000004fh ; function 4fh7 q7 B9 m: N1 R) F1 t
push 002a002ah ; high word specifies which VxD (VWIN32)7 D6 j, A( B/ }) Y
; low word specifies which service
" T/ E m X8 \7 J' A9 K (VWIN32_Int41Dispatch)6 {/ p, I+ W* c( e8 ^0 K6 M
call Kernel32!ORD_001 ; VxdCall( }2 o! R0 _9 G# F5 H7 b5 B
cmp ax, 0f386h ; magic number returned by system debuggers- d' X3 ^; I. A- `3 T3 {* j$ c6 M
jz SoftICE_detected# \1 q3 `$ v& z0 d/ Z, D
6 p/ a6 \' A. oHere again, several ways to detect it:
3 n7 G3 D# a+ N. k6 |* N6 X; a
8 {5 K6 b, r0 a6 n' w6 P BPINT 41 if ax==4f
' u1 `; B# _3 u4 m+ e; x% | o/ @/ f' [
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 W; [2 h0 ]" E' O
& {; f( I) Y8 F' k BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 B* M9 z- y9 q) F8 Q6 V6 z$ h; \+ v) v
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!3 P& b- w; L' A \5 c
! M. ^7 v8 d. y+ h( E% d- I
__________________________________________________________________________3 |( r" U+ x T$ z5 B3 K. y
2 K2 O2 o2 [, U/ m, u! v2 F/ dMethod 13
7 e" i9 u$ e' J% P8 a8 J, |=========$ ^& o) r3 m) W4 k: d5 s& Y
- |2 l( r& }" j, iNot a real method of detection, but a good way to know if SoftICE is# N7 B9 E1 G! n4 |$ k5 H6 ~3 K
installed on a computer and to locate its installation directory.
9 a& l9 b% m/ M9 VIt is used by few softs which access the following registry keys (usually #2) :
+ ?( F! y; ^( o. z& C; M& D& b& c" g8 ]6 }! f+ N. I
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( l6 Z) P5 D7 R& E: l6 L' ~! a\Uninstall\SoftICE
) y* z. [9 S" o8 d-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 x, P L" A+ x9 w/ d% N
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 R3 {, d5 B% g/ G* w: ?% p
\App Paths\Loader32.Exe
* m V5 q2 D+ u/ `4 c" `- K7 t+ t- ?. E9 `
# `8 N; F3 u$ bNote that some nasty apps could then erase all files from SoftICE directory+ z$ e; K2 y- u3 X: L+ ?/ R
(I faced that once :-(: b4 I+ r% B' i U+ T* }' o: c9 P/ o
4 g- }* O; w9 e0 N& f# N0 Q
Useful breakpoint to detect it: W- M4 \0 i: P! I+ X, E
! ^1 i- H7 [* J- H- D' L% s- ^
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
, l+ K+ r, C# O3 e7 U+ }
& _8 w% T. P; _+ I: B__________________________________________________________________________
Y6 A4 F/ ]- v# i6 D4 C5 {: \6 z- L5 M& ^ E
1 I: l2 \$ A* @* Z( r W( s8 iMethod 14
2 E: A& H! W% l1 s% @=========
# @* T; c' o& g" R2 V+ F0 F. |2 f, }6 s! L, m
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* _ I1 }$ w; D! b7 P
is to determines whether a debugger is running on your system (ring0 only).
& K, J( L+ q6 e6 a/ m% n( @3 J6 _, L; S5 ^, E0 I0 S! G: ~- o7 `; ]# C0 t8 b
VMMCall Test_Debug_Installed2 d- Z- k, L: k7 W* ]# ?
je not_installed6 h$ ^% [ c& g$ m$ l: @
( G9 M* C: [5 ~8 J- gThis service just checks a flag.1 `7 E( s' e$ V1 P r h
</PRE></TD></TR></TBODY></TABLE> |