<TABLE width=500>
" ?0 T1 H6 u2 R8 l- B<TBODY>' ]" _: I N4 o9 A
<TR>
; o% }1 b' t) ?<TD><PRE>Method 01
& U& W( T8 _6 ]% n: t( u6 X; t& Y=========4 y9 c* p) v6 I
3 d5 |( U/ r) x
This method of detection of SoftICE (as well as the following one) is
) ~+ r. z4 B% {! r) p5 gused by the majority of packers/encryptors found on Internet.
1 X5 g [; ^4 A. X8 S" Z* XIt seeks the signature of BoundsChecker in SoftICE8 C9 y" N; }# S1 f7 Y' d
7 u+ v' X4 Z& o$ F* N mov ebp, 04243484Bh ; 'BCHK'" N1 x/ y$ e# C9 i2 }3 L
mov ax, 04h( w! U" c/ q' B# A
int 3 . f) _( x. V6 {% [( k7 D6 O
cmp al,47 z/ c3 w- @3 Q
jnz SoftICE_Detected3 E5 E4 W# X/ @0 g6 @
`- q" M" i) ^
___________________________________________________________________________
9 p% W1 ^7 t7 V; X8 F5 S, K* I. V! Z" F3 S! ~+ b$ R
Method 02
9 }3 N3 h& g# v+ d5 y=========
% J/ I0 T! q# t8 y* q5 D
: n1 v; u, \) LStill a method very much used (perhaps the most frequent one). It is used
3 l7 Q% F; h- M5 e$ Ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 V# d8 q: D1 `8 o
or execute SoftICE commands...
. M: l7 f( `& ^& `* G, ?( @* xIt is also used to crash SoftICE and to force it to execute any commands9 ~ y" I" @9 \) x) G7 b
(HBOOT...) :-((
+ c( ?+ m8 S" o1 ~* y! a: N* ?/ T* S4 ?
Here is a quick description:$ }! s7 f6 `$ v7 o; v
-AX = 0910h (Display string in SIce windows)
0 M( ^7 D7 Z5 F% H' D m2 v6 o-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' b- Z& |3 R3 Y/ J' d4 O-AX = 0912h (Get breakpoint infos)
8 C0 C3 b- N) E5 m0 b. _-AX = 0913h (Set Sice breakpoints)4 g5 D n/ d9 J! L3 d/ y& c
-AX = 0914h (Remove SIce breakoints)/ F' j1 ]* l2 q. t. Q
4 j9 `( ?7 H- X6 V- B9 _' n0 jEach time you'll meet this trick, you'll see:4 _) M' L$ ]! ]4 I3 Z @
-SI = 4647h
. Y, l6 T" H2 D+ ?$ N0 O4 u- o Q-DI = 4A4Dh) D2 w( e5 M' |( c% P7 W1 P
Which are the 'magic values' used by SoftIce.( c R* o1 B; G, |4 N0 b3 c
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- L; @4 Y7 X9 P: K) ?! D, s
% [9 o1 f) u6 L3 THere is one example from the file "Haspinst.exe" which is the dongle HASP% e; i. C, Z* M" w" l. V
Envelope utility use to protect DOS applications:
5 C6 m( `% b) T/ o, o) C' S8 ]( [2 y2 ]* M5 M
$ h6 H! I+ `7 [4C19:0095 MOV AX,0911 ; execute command." u y2 H- Q; _" H
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( h+ a: b& R& M# v1 f7 c5 P
4C19:009A MOV SI,4647 ; 1st magic value.$ x* ~% V7 `0 g- K) i7 u5 |2 R, X: b. h
4C19:009D MOV DI,4A4D ; 2nd magic value.1 h5 j% [0 u9 l: l, w' [
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 z8 Y0 I# Z- k) t, N# s4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 x5 _% [3 d8 X, l% l: I: R) V4C19:00A4 INC CX
% h# |0 Y7 G4 E# l3 v4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 `/ c' R$ B k/ {( D5 ?: _4 V
4C19:00A8 JB 0095 ; 6 different commands.
/ o( z# Q5 h5 t! o# U+ z4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 j" a4 s2 t9 Q5 n0 j4 D0 Q! O
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" T4 {# m3 H1 e
5 @! H: N) ~- K$ R- k, {9 GThe program will execute 6 different SIce commands located at ds:dx, which+ Y$ b+ n% x4 m, V5 \5 j5 i
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& G% \5 }! E) a) A' h3 j( n* t
- n: M4 u& J$ c5 K* {, W
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 b# `, W; P, y2 b& k# X' ^
___________________________________________________________________________2 A& l8 r% q4 G7 M$ w8 R" M
/ _. c) Q ~# o/ ~
4 q( N3 s+ j! e
Method 03; u4 x% q9 |) F5 r8 a$ H0 t
=========' A8 b; t1 \" [! [3 c, t
5 c! [" h) R$ Q" i$ V! Y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 r5 U) G9 N& T5 v& m0 ^(API Get entry point)
y$ t$ _9 W ~+ C: C0 O * S' ]0 G; l5 Y) A. e
" k$ @: e" n3 D3 s
xor di,di
" N6 s" f6 }, Q. m' } mov es,di+ }* j6 _# {/ U- y
mov ax, 1684h 2 F" N1 E! T. ~+ O& r* k& G8 j+ u( t1 I1 h
mov bx, 0202h ; VxD ID of winice
5 z# J# y: t# z8 y/ U int 2Fh
9 r6 r8 M" F- S* t0 {5 I mov ax, es ; ES:DI -> VxD API entry point
& s- _$ ?+ F9 J6 \9 W) M1 m add ax, di% H& r5 d9 C. h
test ax,ax8 D9 K- A& i* {
jnz SoftICE_Detected
" {6 }$ U. A% L+ e0 d3 V6 _5 E% C. t. S& {7 P' k
___________________________________________________________________________5 o8 r+ C0 U' M& \* F0 E
: A4 i1 r! r, N U; CMethod 04
9 r/ f$ [# A! w6 H=========; K) W: W! q9 F
0 H0 H, X$ E, Y7 Z$ Q1 [Method identical to the preceding one except that it seeks the ID of SoftICE
+ G% y# n0 S% T1 vGFX VxD.
2 N" V: V0 j4 |, o( \$ y. O
( t( l. c5 M; D7 n% B xor di,di
; X7 z' T6 O0 U mov es,di
! k; z6 |7 C/ k& _& d& a1 ?$ L mov ax, 1684h 8 d; q4 u2 G+ y/ u
mov bx, 7a5Fh ; VxD ID of SIWVID
. E) _5 p( P2 @% { V2 j int 2fh
. v$ S1 n* U# z1 L7 x mov ax, es ; ES:DI -> VxD API entry point
9 h" f' y" q3 J add ax, di% M5 C& F: e r) U% I
test ax,ax
- E0 x2 z4 y* S" z0 z- l jnz SoftICE_Detected5 i7 |8 g- K' Z, c: R2 K9 P/ k' N
& A$ m5 C# N; E, V8 W, n
__________________________________________________________________________6 `! K- V1 b2 W9 C
2 [, q$ I) x- [/ x* v; w k# D
# ?1 b: W9 d! c" _6 q! A: e1 j+ NMethod 05* l0 z$ f5 f ~' B) T- P+ C
=========
/ @! ~; t. n- K% P# S, J
- x+ d+ x) X1 y3 j2 BMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) A1 ^+ E6 U3 r( a/ Wdebugger. It calls the int 41h, function 4Fh.5 F% ?3 j8 F8 k5 @8 e5 l9 X y a
There are several alternatives.
. T4 z9 n/ @- E5 J5 q4 R' E# U0 s I& q, ~' Y6 A
The following one is the simplest:: J& `( _4 s: b/ G& ?
: G2 s/ q3 [, H; ^- x. o4 h mov ax,4fh6 M4 w8 Z9 U% Z$ T
int 41h
7 ]3 A" ^3 A5 o3 F" x7 O cmp ax, 0F386
$ u$ T u3 F+ b2 ?/ _* \. D jz SoftICE_detected
3 u% S* q& P3 ]( F/ h# s, @( H3 B$ p Y+ P: q
0 c# }& G" r3 E* J9 Z5 V. O
Next method as well as the following one are 2 examples from Stone's & u" v! h/ T! `" F/ [; k7 C& `
"stn-wid.zip" (www.cracking.net):! z: I7 E* b' ~8 N# q, W
( t3 `& u* b. \) Y5 z! H; u
mov bx, cs
0 e, Y$ Z8 c9 D+ `' D% @ lea dx, int41handler2; m3 H0 E- E: q* y2 s( ^: I4 w2 A
xchg dx, es:[41h*4]
5 d& T+ N. w9 l: r6 f! P6 q xchg bx, es:[41h*4+2]
% e' K. P" ?7 a+ p9 `; ^& t mov ax,4fh
) \+ R. U p$ e: } int 41h
1 m" D& v ~: ~$ O# T: V3 Z C xchg dx, es:[41h*4]" C+ y& I# `, |3 O- r! @0 c
xchg bx, es:[41h*4+2]
( O' I! M) h! i$ { d: x cmp ax, 0f386h( ?) e1 O# H1 i4 m
jz SoftICE_detected# q* W. [6 D7 V9 H
1 M: {7 R; H2 s4 kint41handler2 PROC
" f' K; N, |4 _) r, ]0 ~2 H iret) s! {/ z" @" h$ _1 N
int41handler2 ENDP5 l9 Q0 ^4 F+ a" [0 g1 c
7 v% |3 C& I5 W" o
8 }: o' ]5 v2 u6 m_________________________________________________________________________0 l& ~0 ?+ y0 G7 {, I
" P5 t2 @4 a! c/ d
, K5 } P& K' [, F Y
Method 06! q5 G$ g4 l& v4 X
=========
8 w, @$ O' s7 _4 }, O' Q0 w* C3 `2 L u: a9 Y
( f3 |! G& O" v6 Y; k& k6 \
2nd method similar to the preceding one but more difficult to detect:
0 b6 S5 M1 K! [( I- p/ O' }( n: T) `" \3 }
! P7 K& {! g! M6 v
int41handler PROC& t" C2 r) R% U; c7 n% {; g# g9 ~
mov cl,al
) l9 M0 R& k) T+ J8 _ iret
2 C5 N& W; a& { y' o9 tint41handler ENDP
* z6 E' i, Y" }* p
/ M$ |/ K+ G4 u$ N8 ?5 Z5 _) D( w
xor ax,ax
, l4 K4 L3 ]8 r. g( C0 v mov es,ax
0 u% W( z( G6 D" Z mov bx, cs
# f5 v9 I# v: C% l lea dx, int41handler
2 n' w) e7 A" U2 V) ]& V# |* H- d- S xchg dx, es:[41h*4]
) [# U- {$ `, L9 b7 B8 f xchg bx, es:[41h*4+2]
* W) j& c7 R, E4 W1 E/ {# ] in al, 40h+ C5 F. u7 }9 _8 b% y) Z% Y0 }4 X
xor cx,cx& d R: B, _( a8 t- f- b
int 41h
8 z9 I* y2 O0 B; U3 y+ P: x xchg dx, es:[41h*4]9 Z. Q- b2 W4 c9 G: N& F) B
xchg bx, es:[41h*4+2]5 D! m. e2 g9 h" {& O* m# M
cmp cl,al
$ b2 u' o# E. v$ S/ A! d, b9 `% v jnz SoftICE_detected# T6 [/ y$ C. ^8 r
7 U/ B; h `& ?3 U' N/ \
_________________________________________________________________________
% Q$ x/ T/ w1 Z' V0 H# X1 P& H1 {
$ I* C$ b0 J7 B I, K# _Method 07* `1 I. G: Z( Z" w
=========
% ?: R- b r# d9 N5 V9 {, ~. A. M: r( q- t7 s+ E
Method of detection of the WinICE handler in the int68h (V86)/ V! E9 @ R2 ^
9 T) M: M# G* A/ {0 g+ d9 t" I1 K5 j mov ah,43h1 j6 Z$ v# i/ @" G% f! W" A j
int 68h2 B8 I+ s& B+ @* O
cmp ax,0F386h
4 q9 p V ]' [2 v9 f+ c. H jz SoftICE_Detected1 w7 q; g0 g+ n4 } u) q. t0 c
: _7 J. h& ^1 ~# H' [
, i2 U, b% c7 l=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 N/ q$ f% X U app like this:
. {( u& ]7 M% E5 c+ X8 T0 P) e' m
6 i( e4 |" M4 Q% ]3 s BPX exec_int if ax==68/ T* z; F1 w p& d: N, C
(function called is located at byte ptr [ebp+1Dh] and client eip is! p2 i1 b% z; U
located at [ebp+48h] for 32Bit apps)
7 p, A J$ y: ?( V) ^__________________________________________________________________________
, i' |" _1 T' g* d
4 Z" a! ^, e# X8 y7 z( A- V/ a! U' U1 x+ @* p2 d& B& c
Method 085 G# Y1 L3 a+ s! T; e
=========
+ n+ c& A4 Q) U I( a! ^9 _& [5 {. }0 d, q
It is not a method of detection of SoftICE but a possibility to crash the/ H, P% t" n0 X- T
system by intercepting int 01h and int 03h and redirecting them to another
+ P* U8 }: w' ~. broutine. P" M+ W% @# \0 D3 q; I
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# ]- \1 i }# W3 z+ lto the new routine to execute (hangs computer...)
' Q( a. O7 R, e' N$ n- Q5 G1 T
& |% Q2 ]3 Q2 i' f) i mov ah, 25h" T, o$ U( L( w! N. y% \
mov al, Int_Number (01h or 03h)$ h8 v& k6 o; e) v$ k% j8 z
mov dx, offset New_Int_Routine
& S% F5 h( D4 U2 U/ I8 Q+ J7 C int 21h& R7 o$ k4 H7 {
, L5 a8 @; V6 T1 f8 K; A# w__________________________________________________________________________
+ x ^( e# v) R- q
; y6 _# I O7 W d/ hMethod 09# m: h& D$ N8 t8 j
=========
# f3 Z/ i) f7 N- u; i7 H6 d/ o, z, d/ [
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- |, I1 h1 V* D5 f0 l
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ i5 b7 A8 |) r$ V0 S8 oThe Get_DDB service is used to determine whether or not a VxD is installed' e2 [9 m& d* T- ?; \6 k
for the specified device and returns a Device Description Block (in ecx) for
7 ~3 w! r0 e% q% M& kthat device if it is installed." M* k) I% d/ x' x+ ]# t
9 @% v/ z; L# M5 ?0 x" B& Q2 E" Q/ U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% k3 E0 y3 I" M# f; h
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 Y2 c$ {9 t: { b+ M% t7 [0 R
VMMCall Get_DDB
% p$ ~4 F1 u: u% Q3 `+ H; T C8 f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ e; Z/ N% w; T
I# ]; C/ t f- L' H* p. F
Note as well that you can easily detect this method with SoftICE:: i( M# k3 i5 D) O _
bpx Get_DDB if ax==0202 || ax==7a5fh. l, L5 f+ Z- t1 K, |1 R6 v" m
' Q n" \4 w; S% o__________________________________________________________________________
, T2 ^# s# U1 i, }2 }1 q% m. u
2 P8 T) k0 X+ F2 T$ E9 vMethod 10: s3 |' Z0 d# d# ^. y/ _. b, o
=========
! R( q( Q% F3 n- S
/ T5 I1 Z' H5 t n' }0 x! R' n=>Disable or clear breakpoints before using this feature. DO NOT trace with6 A( L5 R8 O: e. G4 F9 V# {" k8 U
SoftICE while the option is enable!!
0 P& U: T' ?' R! ?* ~+ R$ s4 M+ I( f( A! p, Q
This trick is very efficient:! F" K4 ]8 e$ Z# y' H9 R8 }
by checking the Debug Registers, you can detect if SoftICE is loaded
# F8 D5 _# w; w% z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 d0 i8 V8 g" g; E6 A( athere are some memory breakpoints set (dr0 to dr3) simply by reading their' f7 l% z# C, ^3 h, J
value (in ring0 only). Values can be manipulated and or changed as well
8 g8 \: ]8 U M(clearing BPMs for instance)4 R0 ]$ x/ V/ K. D* d9 D
. Q; U( Q0 I* e P5 {; t' s' `' X- p
__________________________________________________________________________1 a( G$ m. n# E
6 a, I! y: s7 }# u4 V z
Method 116 _5 q! r1 u5 V& |
=========
% @7 V+ D! _( T6 z1 J, X
9 ]* o( x. F* Q& K$ {. uThis method is most known as 'MeltICE' because it has been freely distributed0 e0 {$ H/ }3 d6 B0 x
via www.winfiles.com. However it was first used by NuMega people to allow, X! y9 K/ p3 D
Symbol Loader to check if SoftICE was active or not (the code is located, A! |, Y% R+ Y
inside nmtrans.dll).
0 w1 K0 d% k8 R7 P, [% g( S5 ]& B$ D" p+ ^ z+ B
The way it works is very simple:" l; o+ q& B( M. A, o
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) @9 @* E( u, e
WinNT) with the CreateFileA API.4 |9 w( @! z* n2 B
1 d, s x9 D( a; `0 ?9 y8 B
Here is a sample (checking for 'SICE'):
% ` h1 b6 J, `7 |/ W. B: _, x/ [: D. l( `- C
BOOL IsSoftIce95Loaded(): ~$ n4 U3 I% A" j( D" y# A
{3 J: H; t, t$ V1 b- C
HANDLE hFile;
! M, Y1 O6 d5 l, @% g$ g6 t hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. H( D% T( F& k( J) ?
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 m, t: n* ?6 b+ h* X NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: Y/ X6 e1 l3 X, H' ]+ u" O1 a& ^ if( hFile != INVALID_HANDLE_VALUE )6 U$ g8 f+ T) ~6 f9 ~- |- ~- b) D
{# _- }" W4 y6 a/ G- H
CloseHandle(hFile);
+ y: W4 t2 |+ v* V. u return TRUE;, I; ~2 z R. {1 j5 v: g: o
}( I* Q& ^2 l( }1 W: r5 ]
return FALSE;7 b* f: _, g2 z
}
1 _/ Y; Y6 S) X9 K; x. L. F4 h8 M( Q
Although this trick calls the CreateFileA function, don't even expect to be
0 _$ N( `( h7 u5 {able to intercept it by installing a IFS hook: it will not work, no way!( j8 W$ f& R8 O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 ^. t9 {& {+ L/ I. y' Dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)5 ?1 n Q2 Q1 W# H
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* e" W1 @: S; z5 Ffield.
" ]- w0 o, u' G9 m& H: YIn fact, its purpose is not to load/unload VxDs but only to send a
2 w% A6 s0 \$ x, B1 D1 C1 LW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 u- W' V g# R7 x& z. A
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 h; N! V- B* z, x4 V3 R! Z& Oto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 R* U- p* J" |" I* Z
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 O, Z: T/ \, {# J# @
its handle to be opened and then, will be detected.
/ z. t' m5 j& P) B; A$ M( kYou can check that simply by hooking Winice.exe control proc entry point
0 M; W3 o9 e2 H# U/ P" Vwhile running MeltICE.
) Z! V+ |+ I' ~* Z+ }' q' g5 n0 X4 O3 t/ q! p# O
# m/ s* b5 D7 S; G: ^
00401067: push 00402025 ; \\.\SICE3 l7 i" F$ k3 X% g+ j! h2 D
0040106C: call CreateFileA5 P8 ]: ~2 m7 s
00401071: cmp eax,-001
Y+ A, k( Y% a% R* j( b7 g 00401074: je 00401091
) ]6 m8 v3 p/ }" p0 H5 R. Y3 O
1 B0 V% b1 D6 P# t3 u G z* v/ B" y/ m2 o# v
There could be hundreds of BPX you could use to detect this trick.9 w. F0 [. v& A
-The most classical one is:+ \( y* T! Z" q: f3 I: l9 B+ l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 {# A% A- ^$ u: } W *(esp->4+4)=='NTIC'* E% |, O: X( \3 b
2 W2 Q+ f1 b" O% _7 p2 g* ?' ?-The most exotic ones (could be very slooooow :-(
& E0 ?, G8 v4 Z ^6 Z+ G+ R" Q6 W BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 c9 s$ G2 W% q
;will break 3 times :-(
- n3 q! E' u( j9 W" l- I4 X5 B6 d. m$ h) N8 r
-or (a bit) faster: % g: G. d; v* b9 a% U- e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 j: t/ y7 b9 y% E* D
" ?: A7 h+ J7 h b# u9 l4 `1 F
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' L o, S# s M
;will break 3 times :-(2 X7 I; Q$ Y( [
( V7 u1 k& ? `% m E4 Q-Much faster:# P% F4 x: @7 A/ H, w4 h3 r! j
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
r0 _& W; j' D4 V+ g; z# _* q/ e' K: }- }5 s& @& }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# j7 n' g2 O( c$ k: mfunction to do the same job:/ I7 U: Q6 F! M6 j3 k) r4 m
* k, L: A1 n+ l# `
push 00 ; OF_READ
+ A- M* K, _, _2 i, v mov eax,[00656634] ; '\\.\SICE',0$ b" g! V6 y9 F8 l1 R V
push eax
- x5 ?+ ?0 W; e+ t! P4 d2 k/ d ~( X call KERNEL32!_lopen
* O* Y7 N& g, G* P/ g) \; F$ U inc eax4 y& R8 l& w5 K1 `+ b( |
jnz 00650589 ; detected
# a" F; j$ ]2 [ push 00 ; OF_READ H: d" m; A9 G/ I1 P4 E+ Q0 f
mov eax,[00656638] ; '\\.\SICE'1 w3 C: M" ?& E2 h$ [+ k0 f3 y
push eax/ q$ \/ W1 {- v
call KERNEL32!_lopen- g5 J2 A3 E5 Q" Y/ _1 y! _
inc eax* `8 [+ m' U s7 k% ^0 A; l
jz 006505ae ; not detected
/ k# n/ b6 O6 O* R: N0 o* u7 P( A0 | ?0 b! k, m1 m
B& o: q7 C( I% j__________________________________________________________________________. v3 J5 h9 K2 [$ B4 a& g2 H6 L
, c. ^1 {6 E6 G! M4 A8 Q. \5 qMethod 12
. U% g' s4 m. `) j% h=========: o( T7 C% H$ [: t; C6 L& ?
|9 X( {8 C4 D: b) K( x* N' KThis trick is similar to int41h/4fh Debugger installation check (code 05
# a& o% B( G/ [ L# T' q& 06) but very limited because it's only available for Win95/98 (not NT)! D) {2 G0 d4 k0 ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 V, R6 {7 G8 `4 ]! T
. W" ], p5 S$ q) M7 x: E1 P push 0000004fh ; function 4fh
9 ?- S( \* X4 A5 Z" \, W; _ push 002a002ah ; high word specifies which VxD (VWIN32)& D( p' a& S4 y4 Y4 m: Z
; low word specifies which service( U; d0 o1 X+ K& M+ l
(VWIN32_Int41Dispatch)7 E" V1 \( {$ r" K' I$ g
call Kernel32!ORD_001 ; VxdCall
+ M; f7 I; K2 n9 u6 b' T cmp ax, 0f386h ; magic number returned by system debuggers6 ]5 `( z4 y1 r" C ?: [! @$ {
jz SoftICE_detected
5 I9 y0 B7 v7 |1 P- ?5 D& L2 T0 W/ C6 s
Here again, several ways to detect it:4 \1 P& t6 j) H- O3 ^5 V& F$ M
( N7 |0 U k1 g! e
BPINT 41 if ax==4f" P+ X) h' {( P, S3 a8 `
6 W6 |* c% r7 @6 s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 ^7 h' {* P7 g" y4 E
2 Z0 }! r% \8 V4 L& m- ?5 e/ v& Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 Y7 k$ l/ j$ K. d! ^: `' b) b7 W+ |% ^8 D
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; [: \' ?' R$ e& D7 l: L, n7 z- U
__________________________________________________________________________0 ~$ y1 A% G. {; v) ?' I" z" x
3 Q/ l4 o# U w
Method 13" D* k& C/ O4 R3 R7 o
=========
8 d2 Y" [- @. o8 H8 _. \& Z& p$ t) ^' }
Not a real method of detection, but a good way to know if SoftICE is# M5 _; ?# ]* b* {8 M8 ]7 ?
installed on a computer and to locate its installation directory.4 d/ k* j: G1 E. l2 B* t
It is used by few softs which access the following registry keys (usually #2) :
& i9 P5 M8 }, V1 J ^
1 q h9 `2 t1 O. ]6 u. {: m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; a2 u8 B3 C1 s+ d
\Uninstall\SoftICE s- P- F, Z9 p6 a2 ^# i) S
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& h. H# a& O* ]- B. s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# k' N. M3 @0 G
\App Paths\Loader32.Exe
" ^; `. G# h$ O) `9 N# h4 ]0 V6 c* ]; D, Y- p5 T) U) O1 }
! O* q# k* O% u- z, P
Note that some nasty apps could then erase all files from SoftICE directory# v7 @$ P6 z: q' N; t% K
(I faced that once :-(
2 N! ?$ N) z+ ?1 W* a" k# E1 c/ E
2 ]( T& j, X" d- N5 W* G+ r% gUseful breakpoint to detect it:8 _, L3 c7 N' `- T2 `3 W
) J7 @; m6 M { O8 H7 s BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ c( g& t1 s9 L$ Z# G! Q0 A
9 {8 R8 j2 U1 f9 Q" A7 y__________________________________________________________________________2 F* k9 i0 q' _+ J, E% v2 I5 a
! F0 u' x. u6 I; K+ h
9 Z# E5 a$ r2 {) V
Method 14
3 l* \- y* A, k/ e! p1 M: P! x=========$ P7 _9 Z7 \, Q% S/ b
$ b7 X( F4 m* y) i* K& n$ \
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 {! j$ H/ k& e! I. e9 e
is to determines whether a debugger is running on your system (ring0 only).: ?% g: |1 l! x% y3 p4 r
# R3 F- h% M! E" T# U4 A. T
VMMCall Test_Debug_Installed
$ }1 D! H* ?: X) F je not_installed1 z) l1 e. j$ w& D, t5 D* F
2 f0 p% t1 m( h* ]$ s
This service just checks a flag.6 ?6 W; w* O3 V# h: e
</PRE></TD></TR></TBODY></TABLE> |