<TABLE width=500>
4 g6 ]8 X# E& \9 J- @1 f K( [2 d<TBODY>
. i6 {) P$ O- T6 f& U$ w<TR>
+ f7 U8 v, u- _& a; R$ z6 I<TD><PRE>Method 01
- g$ d' T6 J8 q9 h% }) ?2 R=========' [ a: y: u- n0 @! G& @, V2 J8 s
6 C+ E( g j- Z9 C! S7 JThis method of detection of SoftICE (as well as the following one) is" U9 [2 x$ L0 s* C) c6 F4 ~: i
used by the majority of packers/encryptors found on Internet.
% V0 k* J5 F, @8 l; {1 mIt seeks the signature of BoundsChecker in SoftICE
+ ?& K' j5 S* O0 L
+ X& J' y# s# b7 e mov ebp, 04243484Bh ; 'BCHK'2 q( W2 ~) v/ F, Z0 {
mov ax, 04h
" ]1 |) E. H5 {( S: Y& g int 3
# b3 M" ^% p' `* G7 E/ A cmp al,4
5 r# s/ y( z( d& Y5 o& J1 } jnz SoftICE_Detected3 O+ @* q: ^& c6 o0 v, B+ R. R
" j) v; C' c$ ]) M
___________________________________________________________________________' P: ]* y! Z, h$ ^! r
' I: H* }+ h6 v3 u/ sMethod 02" d F6 C7 r# u ]+ x4 U
=========+ {& y$ { O/ P% j* U# L
4 [% J, o" y" QStill a method very much used (perhaps the most frequent one). It is used
4 s+ c' e3 s/ S3 s/ Sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' _1 @6 G) w" P5 l- v q* A( c3 ^or execute SoftICE commands...
: ^" J' S7 p, U* p- {9 ZIt is also used to crash SoftICE and to force it to execute any commands* k8 T! s0 k" o
(HBOOT...) :-((
5 {& ]0 Y# I6 }; T( e8 {8 G! H6 }
6 p% V+ c9 a) A1 h( e0 Z; O$ T- BHere is a quick description:. P) Z- S2 V4 p- F. ^5 `6 o4 s0 c
-AX = 0910h (Display string in SIce windows)7 \9 q6 J7 a$ Z, H7 z: ~
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) P9 w* w' E6 ?' U-AX = 0912h (Get breakpoint infos)
5 X- a/ _/ w+ Y9 g8 g7 {5 w& ]" E) f-AX = 0913h (Set Sice breakpoints)+ C* ^& x7 Z- t% B( T" }
-AX = 0914h (Remove SIce breakoints)$ b$ c$ W! G7 U6 D( ?7 }, E. N, R
/ X; D4 g4 k; f3 C7 f9 aEach time you'll meet this trick, you'll see:3 V+ [4 N6 ~& x
-SI = 4647h( D7 Z: Z- |. ^+ |1 B
-DI = 4A4Dh# ]8 { @* R/ H2 l4 M) x
Which are the 'magic values' used by SoftIce.% n- }% Z5 \* A3 ]- n
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! x* L6 t1 @5 k4 Z
% q9 v; m8 G( J* n( ~Here is one example from the file "Haspinst.exe" which is the dongle HASP3 b: q; u$ L/ L4 V
Envelope utility use to protect DOS applications:0 ?" V' s3 M8 d8 b; j; ]+ f. G
/ M4 y* `. y6 a c- j r! s. G& q$ E4 b% l$ `9 j# J; }
4C19:0095 MOV AX,0911 ; execute command.
0 _4 R, w0 n9 {/ d/ |4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 d8 R* J& A6 d* n4C19:009A MOV SI,4647 ; 1st magic value.+ h" C& O l3 r3 Q" U0 S8 M) L7 @
4C19:009D MOV DI,4A4D ; 2nd magic value.
- Z2 T! \) g o2 |$ ~4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( ?) V+ n4 ?9 n# y: z' X4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute: H4 J- L: `5 k$ C2 u
4C19:00A4 INC CX. V) F7 I$ G- p4 I
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ |! w$ Y! U( c/ v
4C19:00A8 JB 0095 ; 6 different commands.7 `3 `$ |" C1 O* l+ u0 m
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 g; {* o6 a. A7 N3 x' X! C5 n+ |4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 f7 A( b1 h! o U4 `
7 |" P8 k* g& r: F* @) UThe program will execute 6 different SIce commands located at ds:dx, which/ x7 x# x, i# T; f0 C! q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 F& \. c$ H/ n4 q$ [* N
( d7 I# Z; R; n- X2 p9 p- k* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% T. A# L2 V$ j___________________________________________________________________________
5 j0 u) {* M. Z7 p2 n5 @/ K- u, O
- [/ ^+ l$ M4 ]Method 032 n2 V( D0 r0 w* T, b& [
=========: W) E# f% ]6 G; b1 K4 W, T
7 n3 w# ^# }+ J0 BLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
% h# E% [, X- s, u(API Get entry point)3 s0 {( R! E0 y# p4 f& b1 [
6 Y; [- y% \% ~1 B
5 x! E% {- }( d5 [, B
xor di,di
6 y' z8 J+ g7 S5 m6 B0 ]4 I( ^+ i, W mov es,di
8 f/ l8 ], }% N mov ax, 1684h $ Y) l' s7 ?5 e# M" h
mov bx, 0202h ; VxD ID of winice
+ p- `" k! i% } int 2Fh- [/ C( f& V; F9 m. }0 _
mov ax, es ; ES:DI -> VxD API entry point
% b! J+ P& ]# d) Q6 G1 |' I add ax, di# ~2 y$ a! Q$ v9 E. V; f
test ax,ax- @+ i; s) H5 f3 C* w4 l+ Z4 ^7 u: p
jnz SoftICE_Detected M: U4 l1 S5 Z% G) Y# ~
i: e) z! `% i: s4 m5 x, n0 O* h___________________________________________________________________________. W5 L Q" v8 W2 Z4 a* [6 A1 h
7 {/ l3 ]' a2 a& e- }9 CMethod 04
2 x7 \8 p8 U2 b=========
+ S5 E, p/ F" z; T9 L, r4 O; f. {& z
' @/ [7 T2 G& g/ J4 [/ YMethod identical to the preceding one except that it seeks the ID of SoftICE2 Y$ W1 d( k1 ?
GFX VxD.
! J" t( @) ^* T8 R$ L" E0 U4 G! N. m) g" J2 g- d# e3 j7 O; F: i
xor di,di
2 ^, A0 J* m( O7 z, F( W mov es,di$ B+ B1 _# O, C, G
mov ax, 1684h 1 n$ S; }5 a1 [; \6 d' H9 N# Q
mov bx, 7a5Fh ; VxD ID of SIWVID3 y4 |* V4 E3 z) `
int 2fh
# U1 S5 b' V2 R3 w x# r mov ax, es ; ES:DI -> VxD API entry point
! {. U# n- C7 d1 _2 A6 l) D3 Q add ax, di4 J6 T7 |7 M" ^& {3 U
test ax,ax) F1 L- k0 y6 ]( Q ?
jnz SoftICE_Detected3 O0 K% a, g8 t" ^% x2 {+ y
7 o2 y z! f2 C" w/ `0 E4 d
__________________________________________________________________________6 B: q9 L3 V* t; Z% v
: e: T, Y3 g: [1 U$ T3 K/ w" k7 C0 k/ f( j0 k8 Q
Method 059 J- }& J) h) {/ m' i i
=========3 o/ l& \$ _8 ?- K3 v
. x. Z' c% u l- TMethod seeking the 'magic number' 0F386h returned (in ax) by all system
7 S% E7 H! Q* X2 o' Ddebugger. It calls the int 41h, function 4Fh.
% |1 `2 A6 P& jThere are several alternatives.
& Y# D0 G& S- S4 G/ T: W3 c6 G! B& l+ |: v# r$ B
The following one is the simplest:5 e# U8 S) Z$ `0 I
% e$ a+ g4 J5 k- e( q! G' F
mov ax,4fh, }! h6 j7 Q) Y0 ]
int 41h' G/ e9 H$ V6 |2 K% ^" h+ q
cmp ax, 0F3864 b* c4 v- ~4 q# _4 ~6 N
jz SoftICE_detected7 {0 C1 n V0 v' G7 f I
1 E1 @4 H# F! ] f& W5 Q
1 Z5 }7 Q: q5 `+ [
Next method as well as the following one are 2 examples from Stone's " ]/ R# J9 R/ E) u- l! `# O" [
"stn-wid.zip" (www.cracking.net):9 | z, N2 y1 x" `% K
9 G$ H* B; o2 T2 j6 \* E- I4 N mov bx, cs5 F( G. e& x4 O: x
lea dx, int41handler28 [1 \! E. b) k& r. E& j6 @
xchg dx, es:[41h*4]
( ?+ R2 c2 Z# w( G xchg bx, es:[41h*4+2]) b5 }( e/ G" e& h. ^. z
mov ax,4fh
# `" o {- g1 g. b4 c: m2 ? int 41h
9 ^& [8 e" F1 `& N0 | xchg dx, es:[41h*4]
# z# Z, d# P7 w6 C% T! d xchg bx, es:[41h*4+2]
' _& G- Z2 E5 C cmp ax, 0f386h$ Z2 z N! U1 \0 f0 v
jz SoftICE_detected
2 k7 z2 [: Z# ~) E5 t" g6 S1 N( [; \- ~+ @7 W; q
int41handler2 PROC1 ~" \3 V+ s3 H' J7 }' a, K
iret; D6 u/ n* O! W7 h- a! t Y
int41handler2 ENDP
% P! Q( A, _2 D( o; c( g$ J0 S# d8 X8 s& l. M* \. i3 \
6 V# w% D& q# e4 G& K_________________________________________________________________________. x5 p' p$ v, E5 E
9 V: ]" ^9 g. u; J! d+ j" I8 E& J$ t' d: R5 v
Method 06
" T- H3 t4 A6 f* f5 R! Y; {1 G; z=========
$ F1 u3 k. t4 K' s; T! @4 O
' d- G8 u5 g$ F+ X9 g5 {: y
6 ?2 |# w$ b8 _3 a; B' f9 C2nd method similar to the preceding one but more difficult to detect:; Q/ C) J6 p7 }% n$ \
% l3 [4 d- G0 C3 E; J, q
4 Y0 I- a- M8 o4 s2 e! c/ Y. iint41handler PROC _4 y+ T* A! m* J& R/ K
mov cl,al9 i3 t7 t9 H! @1 Z9 E
iret
5 v4 t$ ?1 S8 w. e1 ~9 w! nint41handler ENDP
& t' Y5 S% E* U. c+ i
0 }7 Q- T$ p. t8 R$ g1 P: x
% N/ L. c/ U" \) x1 x xor ax,ax. B# V5 R. ]- ~
mov es,ax
# E$ ?( _4 Q$ l/ b# u( X mov bx, cs
: T+ _/ m" B% s lea dx, int41handler$ j& w# z5 n1 x7 d- o: C
xchg dx, es:[41h*4]
$ U6 j& D' r2 j4 P xchg bx, es:[41h*4+2]( O3 Z. S6 r) K
in al, 40h& ~8 W* A' A* I5 h! c; E
xor cx,cx
, }' A+ S4 ]4 x& C9 R* E int 41h, H* D: J4 w- v4 I8 I6 A
xchg dx, es:[41h*4]
. [* }6 N- d' m& t1 o: p% J8 L, w( b xchg bx, es:[41h*4+2]
& [, w2 [4 c$ Z. T cmp cl,al
% e) L: P& P4 V. c8 k jnz SoftICE_detected
" U/ Y, \0 h" I1 w( \7 D5 o* g
; O) P' x" {0 T) N, _% c, c_________________________________________________________________________% Z+ Q% j7 Q1 L! d6 Y
! D$ Q4 z! H2 @6 b! y2 L6 XMethod 07
- _ Z" G" g* W) ~/ o6 n=========" r9 ~5 a- @* V/ E( s
4 E w' R3 Q8 E/ k3 G4 ~# f
Method of detection of the WinICE handler in the int68h (V86). U1 e7 l, `% c( q! f* ^1 U/ D% }
0 q1 C3 r4 \ u0 ` mov ah,43h, [* L" R5 O, r, {8 x
int 68h" f* j B/ ]$ p# w* f( X; M7 r
cmp ax,0F386h
c5 b* z F/ H% T jz SoftICE_Detected
$ z' l6 c: J8 k# N, b) a: g+ w, j
! }* | z. g) i1 O, X0 h- \: U1 l, K( j1 P" w; D3 @- V$ L" {
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# O; A8 B0 W' {- F, a" G
app like this: `3 {( e: E; H
# ?+ N% ^. ~: Y6 t, F
BPX exec_int if ax==68
3 v }9 p6 k" D, ~+ M (function called is located at byte ptr [ebp+1Dh] and client eip is
0 y0 ~( h! ?0 n& C located at [ebp+48h] for 32Bit apps)
$ c0 }7 ?# l8 U( g) l__________________________________________________________________________, ` c' K+ q H* e3 e- E" O3 i
. U4 }/ w8 x6 _6 m+ V. S9 N& y% Y: h$ @1 w3 Y6 M0 N
Method 08
& t, @ P4 F0 P( l0 D, G=========# j& c7 E5 C+ q5 U0 I* n$ u
" u6 ^* I; c' m5 g/ O5 EIt is not a method of detection of SoftICE but a possibility to crash the: u' ]: a: J. f" A
system by intercepting int 01h and int 03h and redirecting them to another
8 B! r9 |, O8 H& groutine.: L9 i" x4 G! U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 o" p$ }" [! v- w: w
to the new routine to execute (hangs computer...)* q _* l4 A4 w
2 z6 f, N) n$ e# D
mov ah, 25h U# K5 ~& J5 g! W
mov al, Int_Number (01h or 03h)3 C" g2 }, F3 ~) G
mov dx, offset New_Int_Routine2 x1 ?* p+ A6 i/ L
int 21h
- S/ P" a) Z; V: C- t2 g: A) G- k" |( j; g' B- ~
__________________________________________________________________________
' z/ s- |- |0 [& @; j- f, ~" e9 ^5 [
Method 093 s2 x9 I8 D2 y/ {5 u3 X- |% c
=========* R$ C4 ^. K0 m+ Z. h+ y
# S ~/ x8 x4 c2 Y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ O$ n( K. B+ J! q; X# t
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 p, m* n" {$ `2 VThe Get_DDB service is used to determine whether or not a VxD is installed
$ s7 |- n8 O# P8 `for the specified device and returns a Device Description Block (in ecx) for- t# C' M( m8 x: c+ U. _ \3 E$ R
that device if it is installed.
/ x$ E6 Z8 D/ u8 D2 P& Q" r: J0 D' W! e: s+ A. S
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) ]( g) O% q# e
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
O, w$ c$ M8 x1 o/ h VMMCall Get_DDB3 H2 T% S- k$ M) `5 k) {
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
5 e5 V) e" b8 L+ `4 p8 o9 k: V6 `% p$ l: B# r
Note as well that you can easily detect this method with SoftICE:* E6 v+ e3 x$ m9 `4 K, t, j6 m# w
bpx Get_DDB if ax==0202 || ax==7a5fh
; i/ P0 T. |: W* Y
) _9 y$ a) D- P% e__________________________________________________________________________: O" j& M- a9 M" D; j
# m0 H' h( S H$ O. ^Method 10
8 A/ l+ z( W! @=========% o' A+ a3 s3 Q8 E) H$ x6 n2 s
r d+ O- F" \: `/ m4 k=>Disable or clear breakpoints before using this feature. DO NOT trace with" t( D4 y+ \( [2 R
SoftICE while the option is enable!!: E4 Y$ L4 v$ m" A
: l4 I( |8 j+ E9 _# ^( xThis trick is very efficient:
6 v9 z! Q# l0 c: a+ n. T! f- oby checking the Debug Registers, you can detect if SoftICE is loaded
& K) {! R! Z* t0 O$ t! }: v(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" `9 I. c# E* @& X+ m/ Rthere are some memory breakpoints set (dr0 to dr3) simply by reading their
( M2 b0 o1 j( e8 D$ ?3 u! Z* ^ `" nvalue (in ring0 only). Values can be manipulated and or changed as well8 n% d r q/ y
(clearing BPMs for instance)9 T8 l$ Y1 C% z* D% D( x
- @" |: h' j& x8 A/ |9 t6 i9 O
__________________________________________________________________________
6 }& A' \3 w |8 ~1 e- k% Z, K, x4 V5 f% W X
Method 11/ V( L2 |/ W6 @2 }$ M
=========
$ d3 |9 |1 b: \
- \* \+ A% v) b: n0 k9 qThis method is most known as 'MeltICE' because it has been freely distributed
- E4 N1 g1 h9 F" u/ u$ |3 m" n- z' Tvia www.winfiles.com. However it was first used by NuMega people to allow% e0 f% l5 f3 X( I; S/ v+ O- e
Symbol Loader to check if SoftICE was active or not (the code is located& |8 U- t& z* ~+ b3 p
inside nmtrans.dll).
# m5 b+ X, w: L. Y6 t
H4 h- C6 Y( Y' {The way it works is very simple:( ?, {1 _- M6 @5 r4 ?: S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 t. m/ c. A3 r
WinNT) with the CreateFileA API.- K2 D# O( d3 [% N& M
" G- v/ G# ^$ l7 p" e) U) y' {Here is a sample (checking for 'SICE'):7 {9 ]6 x0 b' E, D
( x4 k8 F: p9 o/ G1 N7 o9 a/ N1 u
BOOL IsSoftIce95Loaded()% d7 [. f$ i4 o/ s( f
{: c, M) f% k [' k5 p7 T
HANDLE hFile; 6 y, {% d/ @4 }- h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ R/ S" g( T3 Q& \ FILE_SHARE_READ | FILE_SHARE_WRITE,
@7 _. R# C. B: V+ r5 o NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& F* A' M q G/ x if( hFile != INVALID_HANDLE_VALUE )
, Q5 W4 S0 \; Z+ c7 l* M m {7 w! a/ J3 d q' o0 q) i5 [7 q! z
CloseHandle(hFile);) G8 W8 [# p& Z: x
return TRUE;
' o6 \) _2 ?- a- Q! A7 x2 N4 M }
& d+ k* b x v, g( C! w return FALSE;( n3 V" S( K. {( M9 ~& A
}
* H" f! m8 f: F+ j. i
" V6 l% z/ Q3 p" x( n/ z- PAlthough this trick calls the CreateFileA function, don't even expect to be# q4 O5 ~5 h# v$ p2 d+ B
able to intercept it by installing a IFS hook: it will not work, no way!8 W. \. w2 d% u- G3 \9 n4 A9 Z
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 X" X% v0 @! z6 Oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 k0 H( _7 x( {3 m$ mand then browse the DDB list until it find the VxD and its DDB_Control_Proc
) N! }9 h2 o6 l% n! E: i9 v/ ifield.
: F8 |8 E3 @! E( {) Q TIn fact, its purpose is not to load/unload VxDs but only to send a
( p/ l" w) K x, h JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( w5 j; Q9 \; C6 oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 g& |3 ~& L8 [) Xto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 \- }$ \, a3 F7 M- v, [
If the VxD is loaded, it will always clear eax and the Carry flag to allow" \$ R1 g' Z7 e7 Z3 _; W
its handle to be opened and then, will be detected.+ _. r# r! s- n# v& q
You can check that simply by hooking Winice.exe control proc entry point
+ r7 ?5 g) C. Y, q, W9 P2 C# Xwhile running MeltICE.
) n' {* \5 c u: l5 F4 u" e' e3 Z
. c3 H% _# s. J$ ~! b+ E2 }* r g4 U
00401067: push 00402025 ; \\.\SICE3 |/ t Y' W& ~! e$ {
0040106C: call CreateFileA
k. Q1 Z% _) v1 i" o2 w 00401071: cmp eax,-001
" A$ g2 ]& [8 } 00401074: je 004010919 g* i/ M! C6 A2 O! @0 ?* h1 g
6 P+ Z |2 j' K4 V- X- ~. Y, V& S$ L* T; W! E$ p' }
There could be hundreds of BPX you could use to detect this trick.
& n3 T$ C7 z. q) I( G# Q$ T-The most classical one is:
, T1 K0 k, R y1 w+ F3 N BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 i8 p2 l1 \ j: I# C$ h *(esp->4+4)=='NTIC'" P ]4 S% n3 H3 j
- Y o1 A; n! Z, n8 g# u8 s-The most exotic ones (could be very slooooow :-(
2 L! D( v/ l$ i9 \" @ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( I( E9 B$ I( \- d- r
;will break 3 times :-(
3 d, c, u0 n5 m2 Q" V
8 c5 D1 y& ?" @% `4 @% h-or (a bit) faster:
v5 j% _; G# w" \: ]* m0 S BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), Y i S3 F$ H
8 o: x& N% h/ r3 T0 f
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. y2 k; L x( p% P f, q7 T) L ;will break 3 times :-(
& X! r- Q% t# b5 e2 Z/ M/ j. g; P
-Much faster:
# b. c( Z7 y% y8 u* |& N BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
7 L o6 D* h5 s+ B" {
& E2 V* B/ f/ H9 i( b4 |; [. _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen8 a0 P* ], u# u9 a, _
function to do the same job:
/ g$ k! U R y# v T0 s
# r8 t' f8 J/ }! z3 n" ` push 00 ; OF_READ" B& e* D w6 C# X
mov eax,[00656634] ; '\\.\SICE',0
/ I! \( r5 B2 }# Q9 L7 x# |* e push eax
7 ^" T7 w* k, Y7 G0 Z. |; p. ] call KERNEL32!_lopen
/ o3 E' V. i% w# n2 L5 [9 S+ a inc eax7 \4 i( t, N, k9 P5 T
jnz 00650589 ; detected
$ A2 E$ I" g1 e9 g" j push 00 ; OF_READ
: Y+ o" R+ R! Z' C l# {6 v mov eax,[00656638] ; '\\.\SICE'
1 Z8 p1 B% \: m' U5 l0 D& i* J push eax" e7 y( s9 I7 g/ m( _ Q
call KERNEL32!_lopen
! p8 ]7 f% z, C* Z6 O3 {/ e0 q: ]& G inc eax
5 K: Z) x j# b9 }* b jz 006505ae ; not detected5 R1 y2 d m q. w, m( M9 O& w: H
7 x2 G( V2 ?- j2 i( {0 z" `
$ p/ i" o0 p: \) w__________________________________________________________________________: L0 j) t% q& Z9 `( ?
6 F% L$ M; G! W
Method 12) c+ g7 |7 n( ~# H6 @% ]
=========5 ?: n2 o, F# t( Z
7 q& V8 W! I" g7 L* D aThis trick is similar to int41h/4fh Debugger installation check (code 05( |2 h! S3 {' |
& 06) but very limited because it's only available for Win95/98 (not NT)4 e! ^6 F O$ ]. S' \& ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* [9 G9 e3 ]% L" r" m5 ?% l" W+ u. R: H `/ J
push 0000004fh ; function 4fh6 x, q; {+ ~) u8 A5 y5 R3 k5 |# g5 I
push 002a002ah ; high word specifies which VxD (VWIN32)6 ^! H! I0 q7 J
; low word specifies which service8 E+ K/ |7 F2 A9 ~3 m& Y7 S
(VWIN32_Int41Dispatch), Z y! a# h" a
call Kernel32!ORD_001 ; VxdCall" d [! U9 z; `
cmp ax, 0f386h ; magic number returned by system debuggers
7 V+ Z% {6 J& B jz SoftICE_detected3 ^( f4 ?2 x7 T3 I: R/ I; n
2 g! j. b N( h, ^Here again, several ways to detect it:+ M# ]1 k- K0 I. c8 O U2 Q+ k
# Z' u2 ~% u [
BPINT 41 if ax==4f
6 }' X7 X3 N2 ]* r2 H0 @5 `0 s( x! c6 r2 s
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* o' d* v) a2 m& L
9 I1 w, O2 y/ A2 k# m! q+ T* N" c3 B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ Z* n8 |) _8 g3 r
& |2 u3 Z- r. _% l$ j' e BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 E6 k( D& e- I0 x" N
, B" F" Y) l' `5 b; I
__________________________________________________________________________
( x8 q5 b+ J0 d: e8 W- V7 n# h+ ?/ l" }' { }5 _2 Q3 c
Method 13
# v3 d- _, }" G' \% B9 D=========# i2 ?0 X* }5 M' f/ l5 T
8 k( N. L" F- W K
Not a real method of detection, but a good way to know if SoftICE is) L! S* @. t- h2 f( S1 X9 G5 z
installed on a computer and to locate its installation directory.
- z! v2 F( z( w, w4 W& s' EIt is used by few softs which access the following registry keys (usually #2) :7 e% a ^$ z% k8 S: Z3 A
# L: @5 c! H) Z6 K-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ N/ x: f8 n4 Y* s* G
\Uninstall\SoftICE/ p7 n% s! M+ @' C+ g/ u' `
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- M* M) k' y; Q& J- ^, q
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 v) |! O2 a$ z; K# I8 w
\App Paths\Loader32.Exe
+ `6 ?% W: \" X1 e) X" W3 H
, [5 x$ ^1 ~! U+ {9 k6 U
7 ` x# I! G5 X$ {9 @! _% R1 FNote that some nasty apps could then erase all files from SoftICE directory) r! y9 ^0 T v
(I faced that once :-(" S4 J1 V# {8 t: D
+ |$ |& K2 @+ u& q% b7 _/ S& z( Q8 g
Useful breakpoint to detect it:/ g2 K2 r1 Y: H0 f, v' P3 S( X' o6 L
# h7 k: Q! d- w1 P BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'/ r+ Z5 [2 |% `0 B- E
/ A8 D1 e/ F/ a z4 Y
__________________________________________________________________________* w* Q+ x9 ?: n6 |, r/ k
! H/ c# b) ^" W$ Z" n+ Y& I% v
2 T4 }5 l1 Z3 S8 Y, QMethod 14 * n. N0 U# t% b( l, z" _8 B* t, ]
=========) P: f, j6 N( p+ F
1 [3 C; j! d( y& [A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: J6 {6 M4 m* q) F% I+ p
is to determines whether a debugger is running on your system (ring0 only).; Z, b# ^1 X D# ~
2 _- K, ^5 o7 s; _+ j VMMCall Test_Debug_Installed) ]9 q6 M6 m7 D& t/ l1 r4 B2 V
je not_installed( S# }' h( ?8 c) c' x* F! Y& o
, V/ j8 R$ Y% R) h4 \
This service just checks a flag.6 r, ^( }7 W2 w/ `& D+ C
</PRE></TD></TR></TBODY></TABLE> |