<TABLE width=500>7 o* O5 ?7 |7 H6 h
<TBODY>
* M3 _) {$ @$ \* d6 t, j<TR>
! H2 [0 x, c8 ?! O7 a<TD><PRE>Method 01 $ e$ z! }% V q/ E5 m/ S& d
=========
7 w% i S% e [, i# y' _1 E6 P6 ]- Y' Y% \
This method of detection of SoftICE (as well as the following one) is' t4 L0 z0 g: W* }. o- p
used by the majority of packers/encryptors found on Internet.
( K3 g0 O( i* \1 o7 OIt seeks the signature of BoundsChecker in SoftICE
% w+ v V3 f. G, h
& J) }7 r* ~3 I0 |# E mov ebp, 04243484Bh ; 'BCHK'# }2 H7 I f3 T1 [
mov ax, 04h
: Y) Y7 e' ?) h int 3 1 i! }% E1 i) G% `- ~7 r# t
cmp al,43 w* u C' o+ V" t8 |# H- R6 k
jnz SoftICE_Detected1 |1 q r1 g0 u7 |) @
9 F' F8 F, p3 ?___________________________________________________________________________
) L5 N$ e/ I) ?% h
- k$ b$ K! v* ?& k3 \Method 02& [! }8 }1 Q4 h$ e" g
=========
$ k% u0 H) W0 i% t( M' I
" Y+ M4 Z. |6 Y5 oStill a method very much used (perhaps the most frequent one). It is used7 J0 Y7 ~+ m2 g# T4 [) H
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: J& a4 L3 L% g6 R5 \$ ^or execute SoftICE commands...2 `) H" u! S5 L2 n) \- d6 @: c+ B
It is also used to crash SoftICE and to force it to execute any commands* @7 m- s2 k% [. n
(HBOOT...) :-(( - e! ]5 I% W, m k; E
% v% E0 T0 N/ [ K. l3 [% K
Here is a quick description:4 ]4 C. y4 `9 K$ d" u' ?. K( W+ ^2 N; n
-AX = 0910h (Display string in SIce windows)( A" d( q; t" s2 B. `4 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
4 P: t Q; C% s4 x$ H7 D-AX = 0912h (Get breakpoint infos)) c5 G% n! u9 x" X) `& a3 w
-AX = 0913h (Set Sice breakpoints) y# h5 A5 i* Y' C4 O! N
-AX = 0914h (Remove SIce breakoints)( S9 A8 T7 Z% j3 }3 U
1 z! g* _5 r- C
Each time you'll meet this trick, you'll see:
/ {% |9 a9 ]/ r-SI = 4647h9 V' g* x! f: z, Z9 E; R3 v
-DI = 4A4Dh
/ u. ~ s& [' S0 ] K$ v! ^Which are the 'magic values' used by SoftIce.
* j5 k: Y1 d9 Y* L( y1 J3 Q; H0 zFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ B! j0 \! p$ n4 y" _/ x5 _3 N4 x' j; v2 p8 k& u
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 n: x# c1 l- \1 \: V$ n
Envelope utility use to protect DOS applications:- l. }2 y& g( ^$ v( ]& `9 p
" {/ L1 M* {/ v* D- q
" t( f0 z, { x- B3 ]4C19:0095 MOV AX,0911 ; execute command.1 X+ d) ]1 A7 Z* d+ F
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)./ S1 R1 [1 R+ H8 r5 h
4C19:009A MOV SI,4647 ; 1st magic value.
; x, y& {) p) }* N' @5 L4C19:009D MOV DI,4A4D ; 2nd magic value.
: I. U$ f6 \3 q0 I" s4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ `6 ~9 Q6 M5 I" p2 T
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% A6 H: {% l+ L8 ~! {; N; R
4C19:00A4 INC CX
2 S, T5 A5 ^0 j; I% i4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* Y+ _( _3 d# Y0 v* O$ [4C19:00A8 JB 0095 ; 6 different commands.
- r" i3 S. `+ J4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ U1 D6 U: M0 X/ o
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# R5 W* ~ ~2 t8 j- T' ?
; A4 f1 l9 r* j' {1 M* FThe program will execute 6 different SIce commands located at ds:dx, which
/ [$ s* k# ~8 j# H& c3 g: \are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 `9 ?" G; M4 C7 r
) G$ ~1 ~- ^: W) ~- H+ ?6 Z1 G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. G1 h% h: N6 q W" t
___________________________________________________________________________
0 g& |* I7 ?3 A8 ]. u
7 |$ Z4 W5 p0 R
* I% v5 r& y0 C- e" Y* HMethod 03
* X0 h1 p; C/ h1 i. J=========2 m4 r- I4 {+ H* @% T/ k1 X
' S" ? }# D* Q+ H! hLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. y% \' V' s* S w& V. M* K
(API Get entry point); s0 c# `; {4 h
! ?5 R) S7 P* \; H* _
' Q, |3 R" _! v# T xor di,di
3 S6 Q. i7 D5 Z2 h E mov es,di5 W( u$ d v8 U2 M/ ~6 x8 u% \; `
mov ax, 1684h z2 U, r$ K; z& M, E
mov bx, 0202h ; VxD ID of winice
( P4 u5 r, d) j; x$ W% J' ?# F5 c0 e# e int 2Fh
_. {) ` J. }* B4 p$ r7 D mov ax, es ; ES:DI -> VxD API entry point
* T, {2 {- @ R, n) o" v& t add ax, di- Q; s; o/ f. f' t
test ax,ax4 T* B" ~% d& P! }3 N) p/ \, b
jnz SoftICE_Detected
% r h, [, F Y
; [/ ]: K4 d5 K8 `$ e- a___________________________________________________________________________
# Q+ w! ?5 c$ I, ~8 y
3 o. S; [: ]7 W+ I, k9 N1 WMethod 048 B) g' x) K/ Y3 D8 w' q! D3 Q
=========- Q( `) \+ |" j; {# Z
! }. O- b* _4 C, PMethod identical to the preceding one except that it seeks the ID of SoftICE
# [4 v- K |" e/ U+ TGFX VxD.: X$ r5 _5 [; b- E* I7 K
4 R1 S. C/ _! |1 K0 a( n& [ xor di,di
' g, W, D) w, ?$ x' W mov es,di
0 p& D3 n; l8 P- [+ b mov ax, 1684h * _6 P8 l# u* _( f
mov bx, 7a5Fh ; VxD ID of SIWVID: M: l& h. N1 w( P% y3 L
int 2fh
% t' G+ ^0 V' O# z mov ax, es ; ES:DI -> VxD API entry point
8 P% l) A6 z2 e7 C9 ^! h add ax, di3 j$ j1 e2 ~* @ @
test ax,ax$ f J$ Q$ D0 N# L" g, ~6 B* k
jnz SoftICE_Detected
" ~3 T" F c% u8 G1 @) i
& Q8 z+ v# n% h__________________________________________________________________________
) b# d; b* H7 I+ t/ N' _' q, T) T9 o' s D$ @3 P
. ]" c y, ~( [0 t6 [Method 05
1 q7 l5 N0 n; m1 x& V r=========9 Z: L$ F6 n# k! e/ |
( I5 @( ^- w& D1 BMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ E" @+ k# U$ S0 f
debugger. It calls the int 41h, function 4Fh.
6 n1 S7 V. b4 C+ Q1 V: fThere are several alternatives.
1 c5 W. w# F. T: k6 x" R9 @9 O+ @5 I$ C. {/ N
The following one is the simplest:% N1 T8 N5 e* a. u: s, k+ G
& t& E+ t. r8 F3 K
mov ax,4fh$ _0 K" k/ ?$ g1 D1 A- A
int 41h# m1 l) O' n& T: ~/ a
cmp ax, 0F386, i* p% ^+ F' t- c+ R, u
jz SoftICE_detected3 A" S- M+ _$ @ O/ c: M% i3 `
; _/ G, G4 q, C1 ?* M- N; y+ P; l9 j) Q( F; s
Next method as well as the following one are 2 examples from Stone's
U* h. x8 T0 ~8 }2 G) [0 D& t"stn-wid.zip" (www.cracking.net):
" p3 N! s* O+ Z
& o; l H* K( ~; S* r/ C, ] mov bx, cs2 J! C& z9 Y/ m' e U) X+ f
lea dx, int41handler2: h. Q% \0 \9 k% W1 q; n0 X7 @8 h
xchg dx, es:[41h*4]
6 d/ h: ^) n) y& Y xchg bx, es:[41h*4+2]
0 M" k4 \% ~* p+ ~* X% }5 ] mov ax,4fh
K$ J# j6 a( P: q) m5 q: f- K4 T; a. k int 41h2 c, X. G- H9 T% [4 }" \: e/ e; T
xchg dx, es:[41h*4]3 j& K6 Z8 _+ C6 v- S1 Y
xchg bx, es:[41h*4+2]" b( P2 P2 k& i8 _* `
cmp ax, 0f386h
6 R: q9 j1 C/ c( `% p4 X3 A5 S jz SoftICE_detected
' p8 I9 o" X! R( X/ Q. b
9 H4 N) ~; m9 |8 lint41handler2 PROC
& p- K) k9 q) J G2 Z' i& Y iret
2 p: V: N4 D* t& ?( u g0 dint41handler2 ENDP
* H, x0 D' {" W9 `4 b- y& w1 Z, q5 L% t1 F4 g! E
6 V6 Z9 _6 s9 i! d, K, ^_________________________________________________________________________, I5 Q* o) U3 i6 @: K
0 x: k# u: a4 W8 W4 k! f% @9 a9 f$ i7 f' t9 ]( k- M6 \6 @3 s, M
Method 06! [& @7 \5 T) k8 ]
=========
8 s+ P) `2 b7 L. p5 ^ b X8 |
) t5 c* b" d" h" w) ~2nd method similar to the preceding one but more difficult to detect:
2 ? W: j; K! v& z. I+ e, ]$ Y6 _3 `- q8 h
3 r: m, H, G' ^# \) {% _- S- B$ Qint41handler PROC
, z4 Q9 `% Z- N mov cl,al1 M6 Y. X3 L/ D" r* q
iret4 V/ p1 g5 o" a; M- B5 {
int41handler ENDP$ O1 F0 }& t* `+ V# I, U
- Q$ H& u4 C3 ^* b; y0 w
* ?$ h' J& p/ q& S$ V# z% j
xor ax,ax3 d3 A, Q/ q% d Y+ e e
mov es,ax0 N: O8 d# v; Q8 z3 s
mov bx, cs
* E1 C' ? W2 P0 V; T; c7 I2 p$ V& W, y lea dx, int41handler
' |! c' V! @6 { xchg dx, es:[41h*4]
( U) Q; p$ r6 S3 e xchg bx, es:[41h*4+2]
* _0 l" D* k- ? in al, 40h
2 Q! S% e. T" C( Y xor cx,cx
' \0 L, f2 N7 X: G, y* ^2 u5 Z" O int 41h
8 Y# e* V2 s5 P7 c xchg dx, es:[41h*4]' [0 P6 N( K/ h0 Z
xchg bx, es:[41h*4+2]
& \ j6 G% F( ~, e3 \ cmp cl,al
( {4 B5 l- m; a% d L( J jnz SoftICE_detected
! M" R& ^" {# ^ N N/ Q9 m6 j6 f, L& @" c1 X T9 k- Y0 V
_________________________________________________________________________( G& n! C4 E3 ~! K& U9 h
8 m( v, ]6 o5 C* k
Method 07; K) z: J2 L; T7 C' n4 l5 J
========= [1 X3 ? ~. [ p/ ]
" p% L2 e+ N! w% b( m
Method of detection of the WinICE handler in the int68h (V86)
! X% V( L I0 N; w' H9 g4 }+ O2 c1 ~# W, A9 a: k
mov ah,43h* s+ ?/ C+ L4 }- t! I) \* [
int 68h6 t1 K6 ~; U) j2 o: B& g! a& m' ^
cmp ax,0F386h
# k, c8 B2 b" Z; @ jz SoftICE_Detected
* W% Y8 u: P$ `" h8 ]4 \. U3 q! g U3 I2 ~
3 A3 T# f; x$ q: X; X=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. |( ?( e$ j' r4 l& X& l app like this:
5 x1 n9 S5 a" U+ S5 g+ ^* g
) g7 }8 g5 j' Q$ X5 O; L! B! L BPX exec_int if ax==682 a; O) O+ j3 N) ?5 ?$ Z1 m' z
(function called is located at byte ptr [ebp+1Dh] and client eip is1 G$ _& r P1 r$ L' B9 {
located at [ebp+48h] for 32Bit apps)
9 c' B7 l2 D1 Y3 r- u* b__________________________________________________________________________
3 X2 o+ s0 l9 K6 d. T) j. A, @
5 s( z4 a1 ]5 w! o* K: \$ s: c% y
" f& t$ a) C# M* {Method 08( _, n1 c* [* q' d6 O4 l6 v: x3 z
=========+ _# g6 Z1 M; h
. r& i7 _* z$ _" C1 Z
It is not a method of detection of SoftICE but a possibility to crash the- O" N( K& E( A3 {; c- c, G
system by intercepting int 01h and int 03h and redirecting them to another
) U7 R: L# A. z5 proutine.
7 D5 h+ ^) A0 }7 y& _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 e$ h3 A9 s4 W# }% } }6 nto the new routine to execute (hangs computer...). d8 y) Q( K0 ?" P
3 B; l( a7 R% Q% c+ G
mov ah, 25h& u9 E% c6 q6 g I( N1 t
mov al, Int_Number (01h or 03h)$ ?' e/ x+ f/ { T
mov dx, offset New_Int_Routine, k7 ^5 V% K! C2 w! Z( d- W7 {
int 21h
4 {5 x+ Q4 n m6 [% F; i1 K/ ]0 Y( g+ e& A+ D7 k+ a
__________________________________________________________________________
: O) P+ L: I8 C% W# f$ z
5 G. R& n! [+ C" L( C1 ^Method 09# r4 b6 p9 e# I* p$ y
=========, j/ _ V* M) N. w1 o( X
% S, h( Y$ I v$ eThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 V$ V' x$ q" z5 x. w. n/ G; o! E
performed in ring0 (VxD or a ring3 app using the VxdCall).9 T$ Q0 t; `" J& _8 D& [# S
The Get_DDB service is used to determine whether or not a VxD is installed0 z2 J- L; B' X6 b a! _
for the specified device and returns a Device Description Block (in ecx) for; I0 F1 r0 v t& S5 _# P
that device if it is installed.
# d" W: F K' _ k# Y5 d. k
8 l( ]& x& f0 R$ g/ ~; V) I mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 _! m, y7 l7 i4 E$ \6 T* c- Z0 f
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ ^+ J9 u) l% ^) Z3 I9 j
VMMCall Get_DDB
& v5 w; y# t4 f2 O% H1 d mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& Q4 L5 \8 X+ I/ _, V
, J( t( u5 ^' E9 `Note as well that you can easily detect this method with SoftICE:9 v: y, \9 V7 S, l0 \( V! {/ i
bpx Get_DDB if ax==0202 || ax==7a5fh
1 b6 U& O7 a" Y) w4 c8 P! V: x& n2 t* q6 j# M J9 W$ d0 e9 H
__________________________________________________________________________4 F* u0 t! ?$ C$ W0 }) Q5 B8 H
6 q* r! d/ Q2 F5 EMethod 102 Q0 @4 S* h4 Z+ R
=========' Q5 a# \7 v) S/ I/ _+ _
, o1 _" m9 H( K- g. H
=>Disable or clear breakpoints before using this feature. DO NOT trace with; d# p9 E- w: u! |9 t
SoftICE while the option is enable!!
. i! f4 k! \# m( |# ~
( N3 d' H0 w( fThis trick is very efficient:- k4 H* W9 C4 f) ~. _2 B
by checking the Debug Registers, you can detect if SoftICE is loaded
# y, a" e- V/ p( ?/ |2 G- e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, e, B6 Z! z- `* L9 s% Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their4 K5 [! o) Y' G. w0 ]$ ?4 |8 ]7 B
value (in ring0 only). Values can be manipulated and or changed as well
/ k* c& n) M9 @; q(clearing BPMs for instance)2 n/ h4 `9 ~ c; s X) O
8 `/ K, b& z: L+ r" G7 Y
__________________________________________________________________________
8 T- o* H3 ^, L4 ]4 H' Y5 J" J, g4 B3 P
Method 11( O9 B* ~2 b6 r3 ^
=========
6 t9 Y6 f/ P F
; Z" u' ]9 Z- J6 L9 D( H/ ` sThis method is most known as 'MeltICE' because it has been freely distributed
) l$ W* T C+ _via www.winfiles.com. However it was first used by NuMega people to allow& V2 [! f2 v. N# O1 m- l/ x
Symbol Loader to check if SoftICE was active or not (the code is located
/ y) m; }- T! V5 kinside nmtrans.dll).
- @2 u2 O; j$ R! d5 ^) U% K, @
- z: z; I& z% \* P) eThe way it works is very simple:
7 p: m$ v5 c; g% w# v1 }1 oIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 S, B4 Z$ o1 M& q8 W! o, I/ j, xWinNT) with the CreateFileA API.
) \& W1 j$ S3 l5 R1 `- n# l0 |: r7 C0 D2 _1 I1 D5 S- c8 G- ]+ b3 `! h o
Here is a sample (checking for 'SICE'):$ p {# ?* R8 _0 J0 b$ P( @' _
' `- x3 Z' I- S( a9 {BOOL IsSoftIce95Loaded()0 Y! @+ k! V2 ?! B
{
/ ?$ K) r5 ~7 |- P; D) ~/ B HANDLE hFile; - z( P0 ~7 f. L
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% B/ z2 @; z* Y V8 _9 e FILE_SHARE_READ | FILE_SHARE_WRITE,! D! Y1 L: p7 t2 G+ X0 j" ~/ E1 C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* e' V" P/ P) R# D+ r5 R! y if( hFile != INVALID_HANDLE_VALUE )
* O m2 E/ J" {& x& t: b9 o {
3 @9 W( |8 i% r o" i CloseHandle(hFile);
0 \3 m& f4 K# P- v5 v4 M+ E9 t return TRUE;. Y b/ z8 ^, I, v. G
}
& [5 j* y( R9 z) U return FALSE;
5 s9 G; I5 y- n# Y& p0 i) o* r}" j1 n& ~. A4 D4 S! v0 c# C# n
" E# a% y; f& j oAlthough this trick calls the CreateFileA function, don't even expect to be5 U1 ^( S4 S: t" J' {, W/ @: e
able to intercept it by installing a IFS hook: it will not work, no way!
4 n- K; @' {: a; j: Y% AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 m# t% [, `8 E6 Q( I8 {service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
Z' M# h# i7 Y6 D8 s$ T; Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" m/ D5 m+ z4 |# y' }field.
" h: p) M* @1 NIn fact, its purpose is not to load/unload VxDs but only to send a , O# ?" m6 |8 j z( Y
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ o' z3 @, @! @. \$ gto the VxD Control_Dispatch proc (how the hell a shareware soft could try+ S# q6 s( n) N* i" [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( B% z8 E4 i5 n, K: r: k, {# b0 G3 SIf the VxD is loaded, it will always clear eax and the Carry flag to allow
0 h; A i( s- G# M) Fits handle to be opened and then, will be detected.
- H7 t- |0 t* }1 R8 L# dYou can check that simply by hooking Winice.exe control proc entry point
; U& A* T- O8 P O: Uwhile running MeltICE.4 k. W, g8 z- i3 R4 p& z5 l
( [2 I6 g! N; p" P* `8 F( Y% B1 a0 [. J- J8 z
00401067: push 00402025 ; \\.\SICE
+ P/ Q. h" }- Q! q. a! v 0040106C: call CreateFileA$ J# Z) K2 J" s
00401071: cmp eax,-001 \' Q- e* c- W( p* c, w* P m
00401074: je 00401091
/ r5 R" G8 o1 c* [; |
/ v( j6 u* ]. H
( [/ k {1 V) S. A: rThere could be hundreds of BPX you could use to detect this trick.; C$ e2 B! V3 |7 m& m4 N
-The most classical one is:8 L- O. I; x- s' P1 V; M9 D4 _5 f
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; E, o9 \$ |) i2 c* C
*(esp->4+4)=='NTIC'% e6 x4 _, m7 D, G/ I& \4 C
- j3 `$ L0 M( N7 k8 I
-The most exotic ones (could be very slooooow :-(
, Z% ?7 v" @. g5 S BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / |- J' p+ f: v' ?- a5 e
;will break 3 times :-(- i/ M, Q4 }1 ]1 _$ ~3 f
. q1 S- |/ L3 `& _9 K2 g% [9 B-or (a bit) faster:
( P! c! }' R& I+ L% W. S BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 Z# z7 \* r% Z$ t5 Y# ]6 H+ c
' u. B2 @& Y: j# h
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' # o- I+ l8 v( L V
;will break 3 times :-(7 E; e+ }# E6 {5 {: s" ]
7 R3 {; o0 m( S& q) P-Much faster:; K- ?) s+ m. E: C: f' a- w
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( c1 x* Y. l: O" K8 |1 n
- ?2 ?4 v S* M+ v8 C) r7 g7 [Note also that some programs (like AZPR3.00) use de old 16-bit _lopen- o, X- L. q/ G9 j! T. b/ b0 `- T
function to do the same job:3 A, o9 R4 ~0 a; Q" l8 i' l- t2 N
# G3 p" V5 Q: B4 K& x push 00 ; OF_READ6 ]- e& s2 f# E3 @
mov eax,[00656634] ; '\\.\SICE',09 {. r4 v8 {6 V7 P0 D
push eax4 }$ H. ?) g/ w- B5 \
call KERNEL32!_lopen4 y0 C5 B! j0 [& [
inc eax2 J, P; Z. J7 N. _$ P
jnz 00650589 ; detected. W" A, W/ V' E* x! U
push 00 ; OF_READ
" F% e6 x8 I! \$ ~, f% M mov eax,[00656638] ; '\\.\SICE'0 b1 F! e0 O9 s n6 j; G
push eax
1 f* N1 }: f3 W6 u$ B; D call KERNEL32!_lopen
9 G" Q) C/ R: L% d! q) m7 T) F2 K inc eax0 }: D- {: Q( a0 ?
jz 006505ae ; not detected
1 u7 s/ T6 ~' P# f" i) u& S
6 Y8 I- R% i' @5 s* Y3 [3 w8 ^, w) f6 N7 b8 w% Z
__________________________________________________________________________
7 g" e, C8 Z! |8 D9 y2 h3 `- u5 v2 E* L1 z
Method 12& _( j; y" u: S! S4 x" @
=========1 _7 j. d+ H: l$ R2 S7 O
* e+ x& P% A0 c* P+ ~2 V$ VThis trick is similar to int41h/4fh Debugger installation check (code 05; N. d3 ^" q0 K+ @) l: j& N& Q+ \) T
& 06) but very limited because it's only available for Win95/98 (not NT)
- z: J8 u0 `- L1 {4 ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.* f% P+ @; V5 l
# Q( ]4 ]5 h5 k+ B push 0000004fh ; function 4fh
, W3 Z: J* m& b2 V! ^) U6 I6 h push 002a002ah ; high word specifies which VxD (VWIN32): W# u4 M: u% |2 }6 Q `* m
; low word specifies which service0 p5 W3 K- [3 K: w1 u/ V/ c% f& N
(VWIN32_Int41Dispatch)* f" ^: \- e1 ]: n
call Kernel32!ORD_001 ; VxdCall# K9 a& g: @9 C* a* _4 Q0 M: n4 h
cmp ax, 0f386h ; magic number returned by system debuggers
, a# |& R2 f2 ^0 v/ g# s( n jz SoftICE_detected
# y7 L, a' Y7 k; h g4 F, d+ q% l6 ^- }2 e* J- C
Here again, several ways to detect it:* S' [, |" b. r' \
* i/ C2 F5 D2 N# _ `! n, _+ R
BPINT 41 if ax==4f
! e u* J% {1 |! F8 I& ]) f* \* W) D0 w, O9 _: ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- h ]3 P- h3 s( l
7 W9 p2 q, v) \0 Z0 A BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ z; X2 V# U# @, e2 @
- j/ p# ] n- ?4 r, _ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 p+ A8 S8 l$ W0 p
6 |: o) j* d3 A) n& B5 F; b__________________________________________________________________________5 h' d- A0 e/ n; I
6 T; ]1 b5 J$ E% p
Method 137 w* u& w7 \% ]- |- M6 B. v
=========
- n8 p. v; d/ [- X3 k( t
; b- l+ Q! S- j( R, U: {9 ANot a real method of detection, but a good way to know if SoftICE is
6 A6 i0 C% z1 ?) c( yinstalled on a computer and to locate its installation directory.& j& c3 t! |' c- R, G+ i h( e2 |+ v0 U
It is used by few softs which access the following registry keys (usually #2) :4 G( y5 n w. M4 b: k9 E9 w
) F) s$ |0 J' H, e* j# ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' O! N, R; ^& M; z( }$ D7 ?
\Uninstall\SoftICE
% {+ y8 v1 ^& o& J' B5 n) c+ I-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- U# W$ a& o9 J. e8 e" d' ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 N: r0 J8 m4 D& \\App Paths\Loader32.Exe
8 D! ]4 {( i2 n. W! Y
& ^' {1 a4 c$ n# f$ T/ ~1 r! ^; [9 ?( A+ \& [ l
Note that some nasty apps could then erase all files from SoftICE directory, h7 f1 {) b. e* u! s. p$ s, O
(I faced that once :-(+ s) u! D7 Q* u
6 G) @+ B) e9 x8 O0 \" f7 hUseful breakpoint to detect it:( T" ?- l2 R" g9 Q6 G! Y/ I
( U1 B& a a3 D& f# [
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ K. @% T; {# A, Q! P0 v; R! G
c7 ^) A: M- d( K__________________________________________________________________________
5 d7 F) a) p7 x$ ~4 _* M8 V- C' X7 J2 ^" I9 @9 [5 ]+ r6 ^! S, V
" U5 e! [! Q; v, ^& C' `" e7 X
Method 14 . V f3 L/ v0 N) M! t
=========, O' j, ^/ t3 V. T+ T9 @
$ U* X% m$ u. H! x
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 d( J l3 L& _- H2 A3 q) J3 n% M
is to determines whether a debugger is running on your system (ring0 only)./ g4 d; x# t* K- U4 h% _9 C
9 V. g( @6 h( V o6 V; |% ]" Y( { VMMCall Test_Debug_Installed
6 p) p) ~& n8 |& ^ je not_installed6 }; e) u9 W8 C+ m) Q0 O% c( |' ~
& o2 r# o5 E) \; W3 D
This service just checks a flag.
4 [5 X" v+ E! g/ L9 q</PRE></TD></TR></TBODY></TABLE> |