<TABLE width=500>* d- l; G0 ?' D3 q1 W/ h
<TBODY>
( V$ A* d6 r- A. I" f0 |, I<TR>2 B, r! ^0 _$ T
<TD><PRE>Method 01
$ ?2 e; E$ v$ A9 Z ?=========2 B% O ] f! w$ e! T" v, J
6 o# _# Z) y, B
This method of detection of SoftICE (as well as the following one) is
' ?! \$ k: l- t% oused by the majority of packers/encryptors found on Internet. Z: U: R; L* @4 k0 J( u
It seeks the signature of BoundsChecker in SoftICE
/ T% a0 Z; M! F! g7 Z- M8 ]
6 E; b: q/ q" H" `. n mov ebp, 04243484Bh ; 'BCHK'
3 l+ b8 G0 x' I& g+ ` mov ax, 04h
9 @, C% ^0 Q, t int 3
, a, Z6 C( n9 n0 i% D( n- C- N cmp al,4
' l) r2 R+ L& ?' x7 R, X$ l2 }% b/ z jnz SoftICE_Detected
# n4 _) o r {# B
6 X& D+ Q1 y6 X; ]6 _* `* `& m___________________________________________________________________________
/ y9 ?4 o) k8 d# k0 Z+ |- Y8 O% ^0 }6 w
Method 02
# T. |3 n+ Y6 L! N=========
& ^4 x2 }- f& P8 }/ I# P
q* x3 [9 W! \5 CStill a method very much used (perhaps the most frequent one). It is used
+ x# G+ a: F' L6 ato get SoftICE 'Back Door commands' which gives infos on Breakpoints,' ~9 R" c/ \$ g' C) B( m
or execute SoftICE commands...
: [5 K+ v% B) |2 N; G; N3 X7 oIt is also used to crash SoftICE and to force it to execute any commands6 E( s7 {# g9 _; D/ |2 z- N
(HBOOT...) :-((
9 A' K5 ]" ]3 I3 \( J7 Z" r2 o( X. c0 Y6 a; N) F
Here is a quick description:
' H% s L" P' F# b& b0 r-AX = 0910h (Display string in SIce windows)' c0 f6 ?5 ^# i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx); l4 R, B9 H& |- f" `8 v" Y
-AX = 0912h (Get breakpoint infos)
+ V& Y7 G8 J; a3 A9 M4 c, Q1 `2 P-AX = 0913h (Set Sice breakpoints)+ a3 \9 S$ }; m J, C
-AX = 0914h (Remove SIce breakoints)4 Q3 [) D" [4 K1 K
7 T$ k0 Y( x& EEach time you'll meet this trick, you'll see:
: P5 j7 `0 C! b5 a. S. i-SI = 4647h
4 S6 {- G/ S1 f-DI = 4A4Dh6 c; S# J# W: l
Which are the 'magic values' used by SoftIce.
, N% z5 l( B& K! u2 {4 CFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.% N8 H3 I2 q! _
; B8 n _- d$ a& M
Here is one example from the file "Haspinst.exe" which is the dongle HASP
0 P# h& d1 [. M" d& d- O8 K7 D0 SEnvelope utility use to protect DOS applications:
- j8 X! Z6 [ @
1 X; c+ i1 _7 J$ J/ |
% m6 B# C9 }* Z: [: A' l @4C19:0095 MOV AX,0911 ; execute command.
( Y* D* J# k0 r. x6 |4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
/ G" z1 M5 l/ i4C19:009A MOV SI,4647 ; 1st magic value.
2 j6 w6 U- ]/ H! B* a' ]7 r4C19:009D MOV DI,4A4D ; 2nd magic value.7 j z9 q% i0 _ r9 R4 d
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' K1 u" x. H& q; N2 L4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
3 X" w, I2 j7 h$ @1 v' e8 I2 `4C19:00A4 INC CX, I% X* E, z- }8 A: r5 I0 w- ~
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 m @9 x$ a* u( N& _
4C19:00A8 JB 0095 ; 6 different commands.
# H, g: R0 t t4 {; m4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" @6 y* j5 f' ~* W9 ]! j4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 a8 h5 C" ]6 i" P# F" l2 \
/ a6 I) b6 M; k4 M/ Q4 O
The program will execute 6 different SIce commands located at ds:dx, which
2 s5 q6 ^6 U6 r6 c4 F% [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 L7 [. O- _( H, c- P
3 X6 p& Y, }. b( Z4 X$ |+ V. ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( D% |5 I9 _. A+ l, {+ H
___________________________________________________________________________
, s" m% x4 `* L
/ |: a; c) H. }9 `6 K& y) H2 D. ~! ~8 `
Method 03- C# a2 ^0 e7 n( m
=========
/ k( r8 V, I. K7 x+ v( G0 u" E: n
7 l9 @4 p" K; PLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h$ \% L1 Y. s* V( I0 n
(API Get entry point)6 z7 x- k, P/ Z9 a6 L* T# e/ i
5 A# `+ F, {. D+ }& `; H% N* j6 W6 X) Q/ _
' q) s: h0 _4 b0 r xor di,di8 B8 } K8 z4 A7 C/ W' C- ^
mov es,di
' }5 P$ `8 A) E' D0 y; v( n mov ax, 1684h
# Z9 l' V1 n+ p2 T mov bx, 0202h ; VxD ID of winice; X. F) M% y! V, W
int 2Fh2 h, t7 j- {! b
mov ax, es ; ES:DI -> VxD API entry point6 J3 L: W3 K1 @- ~7 }$ R' V: t6 D$ L
add ax, di
3 c( c3 z" D% ` test ax,ax, b3 A- C( Q+ b; y2 M+ c
jnz SoftICE_Detected6 x$ n3 d1 Y* ?* E0 [. A! C
- u$ I3 H O, d9 s% z; I___________________________________________________________________________5 j6 Y9 Z* u) x
' e4 F% h8 M) O; M; `# r- vMethod 04
: Q! U" P, g; g6 ^9 Y========= J2 ^" m, ^! I
! j8 o2 ?$ w6 p* oMethod identical to the preceding one except that it seeks the ID of SoftICE6 ~' y1 s0 y( N1 K" T% g* Z" c
GFX VxD.
+ I4 x3 l# g2 ?4 ^
9 ?- E* ]6 V# ?8 T xor di,di! k& [! s0 H" S
mov es,di
4 A& s6 ?4 e7 l3 z$ z& b) E mov ax, 1684h # ~0 v* Y/ b! E O- o$ U0 p
mov bx, 7a5Fh ; VxD ID of SIWVID
i! D7 ]' P& w9 I4 j) K [" l int 2fh# Z7 M% R+ x0 m% u4 K' a
mov ax, es ; ES:DI -> VxD API entry point
' M( w2 N% P" ^ F1 P) W" ~* b add ax, di/ M/ D9 }$ x( U( }' v
test ax,ax( b* S. g3 f0 |! L
jnz SoftICE_Detected
" E7 ~; w S( N. \
0 v: _% N9 {2 M& ~" h( l5 N__________________________________________________________________________4 r; @6 B K0 q$ F1 K
. j6 ~" ]! X7 k- s4 c1 W8 t _
# W6 q5 W# z) J- a h& N9 w4 Y0 {* pMethod 05
% Q6 I- Y- T8 I+ h6 ~9 Q: F=========2 P& r K$ U. B! q( w$ ^# \/ w$ q# W
5 l1 K3 i( E( JMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 p2 u0 ~- A6 a$ L6 V1 vdebugger. It calls the int 41h, function 4Fh.
9 w$ G- t+ S1 a X7 _There are several alternatives.
4 m& W) F9 G( E4 j# p& n, a6 \. Y) ?* R% O/ N4 w
The following one is the simplest:+ z8 @, y" Y, Y9 g: v' ^$ C( e2 T
- j! C" o: @! O6 b8 V mov ax,4fh5 a& ~3 r' U) q# u
int 41h
* g+ k' S' x4 S cmp ax, 0F386
2 d/ s% J& @: r W jz SoftICE_detected
7 G; J. m8 e& ~/ a0 R2 ]
& }; k4 k& c" ?; T- E6 N
% B( w6 n9 Y9 t& Y7 S+ }Next method as well as the following one are 2 examples from Stone's # X! p) d, Y4 ~
"stn-wid.zip" (www.cracking.net):8 y' b: J1 g6 |6 E9 \& E0 Y
& p, A% l0 B& W
mov bx, cs
6 {1 `2 G+ c; T9 M8 M1 V8 b lea dx, int41handler2. q$ I m( H/ F: y5 l' _% ~. p
xchg dx, es:[41h*4]
# v( S7 d/ k4 D. l5 A2 G0 { xchg bx, es:[41h*4+2]
/ x" I$ }6 v3 u) `/ d/ {$ V mov ax,4fh
{* r$ _8 J% p2 ?8 @5 k, T int 41h
% N2 C$ t# s' k, ~ xchg dx, es:[41h*4] t7 U# S0 I" A( j+ r
xchg bx, es:[41h*4+2] n |# N, J a5 R1 b
cmp ax, 0f386h7 }6 X% L& m, z% p6 e" l
jz SoftICE_detected# O) [! M. ^6 w/ ?
* J/ e. l. @8 Y
int41handler2 PROC
1 N2 @# T5 n, p& F# e: E& } iret9 Z9 Y& }5 g+ h$ X( J9 l6 d
int41handler2 ENDP: `" d' _1 M9 s/ a7 e
9 @7 L: d$ Q* {. o" g; W
2 f6 Z! |- B7 U% X
_________________________________________________________________________
4 i* I4 j+ b0 w- q/ c/ p) h+ J& M: U% ~# P: S% r
: z' f4 h# G/ R6 O9 Q! a3 z. `$ x
Method 06/ M2 x1 Y5 w) T+ X; P
========= }& l6 J5 |7 E' K
7 x9 ?2 w$ w9 _( y+ _$ C, ^1 w3 n3 K* x: }% \5 n
2nd method similar to the preceding one but more difficult to detect:1 H$ e2 e; D$ U/ x6 i
8 u& b# `7 _8 L6 D' e/ s! {' v9 ?! q
int41handler PROC( x7 ^' A6 A- I; I$ d
mov cl,al5 I: L4 \( Y6 V. Q! L
iret
- e& B+ u6 |2 U; Oint41handler ENDP
9 A \1 k. a. a5 r$ |
N, F/ G. u) Y4 B$ O E7 N
7 C o1 S1 H: p! W xor ax,ax' r" ~3 K3 L$ \" ?
mov es,ax/ K2 ?# `, V# c- ?: G+ }+ g b
mov bx, cs
' y F1 E% G+ v$ g lea dx, int41handler1 S) n1 J! Z4 c2 G7 d( r! K& A W$ d
xchg dx, es:[41h*4]
. `: T* m9 e# p2 y xchg bx, es:[41h*4+2]
, S4 C3 V6 q+ L1 e: V3 w( z in al, 40h- ]' j7 u* n' h) E3 R! y* b
xor cx,cx8 K; @5 I3 Z- Y; r# W( K
int 41h, ?+ X0 h1 |! p. g! r4 i
xchg dx, es:[41h*4]
3 b! _9 ~$ w( d! u% m xchg bx, es:[41h*4+2]
; r1 q: j/ W. K' D# ] cmp cl,al
( f6 Y5 |- T% V3 u5 \ jnz SoftICE_detected" M) H ]: m" ^9 z8 s9 k8 ?1 p6 ~
: R4 h# L) A+ s. i) d
_________________________________________________________________________4 y+ ]" G1 K- }0 ]1 ^/ |
7 J5 P1 b" a: l7 C8 ?Method 07) M& r5 `: e+ D8 z
=========/ e( r' E; H# j
8 m4 ]- S( ]9 N' zMethod of detection of the WinICE handler in the int68h (V86)
9 x$ c+ u5 J" ?$ ?: t* M& P$ ]3 b/ t4 Y' m) n5 f
mov ah,43h, z& ^- t8 b9 _; ?, D( i
int 68h
) E- l' j- C! b" O- | cmp ax,0F386h
, W# W' J1 G3 P' T jz SoftICE_Detected) r4 z6 [. y% j8 W# l
6 j Q4 k& H. Z8 @) [- I' E' f) c& @7 @, I8 r/ y1 A X
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit P6 J, f0 E% {- a
app like this:
7 [* J5 O/ J% N+ Y$ M4 Z9 q7 B
' h6 w* @( w: L BPX exec_int if ax==68& w2 S" M' X$ a8 S
(function called is located at byte ptr [ebp+1Dh] and client eip is
3 g5 r2 b5 A3 u, _8 ` located at [ebp+48h] for 32Bit apps), e4 }+ _/ w2 g( K3 s
__________________________________________________________________________7 }9 J- {4 C! G5 N
4 A0 Q$ q; B2 q% T5 B; W6 u7 r, I% Y) s" R
Method 082 V2 V- N, Y- b J2 P( s k. ?3 |' u
=========, V3 x" M9 V0 U. c/ l4 `0 X
( M' Z: ~" |9 B& X2 Y4 T9 [5 [It is not a method of detection of SoftICE but a possibility to crash the# o! X9 B/ J( H& R/ n# n* @" y
system by intercepting int 01h and int 03h and redirecting them to another
3 K! M2 o% D. [: s9 b t: {routine.
8 h( R _/ F$ P% C3 a% e# ~* cIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 h6 S4 o9 t) y$ w6 V5 _
to the new routine to execute (hangs computer...)
7 y* @' ?5 Z( Z4 p- \" r; Y7 L% T" m- ]
mov ah, 25h
4 n: R! V& S9 x# \ mov al, Int_Number (01h or 03h)) Z: e+ K% e! W. l; ]. e
mov dx, offset New_Int_Routine
. ^& }) u3 v' S+ u2 Y: `( W; ~ int 21h7 v/ {) @. b& I9 a( f
1 R! m0 |# M& d__________________________________________________________________________
8 ~' C) ]1 x: `: y B7 m3 w4 L% q* ]" ^ W
Method 09) d0 F1 _/ l- X, d7 x
=========
! f0 l9 T; _6 W4 r
4 }/ L4 B9 q$ C( J6 P5 V9 y' {This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: x1 w5 n/ q& u( u# K$ N+ |6 H
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ F/ A1 z# R$ A4 t4 n: r8 `The Get_DDB service is used to determine whether or not a VxD is installed4 f$ e" k; Y1 k6 z9 n4 K
for the specified device and returns a Device Description Block (in ecx) for, t% l) O- u: w& ^3 ^1 n) G
that device if it is installed.
/ v3 b" H7 q8 R' R8 E; K0 Q9 m& Z: q$ [5 e I# \$ Z, E# A# `& H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID( K3 A- c) H' y9 y0 Y8 g
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
' j. Q" [( t" R5 O VMMCall Get_DDB+ N( E/ n4 k8 @* V
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" f1 U) X9 U$ O3 ]' T/ F1 [# U3 S. b- _0 J
Note as well that you can easily detect this method with SoftICE:4 n, w6 O& [0 k% B
bpx Get_DDB if ax==0202 || ax==7a5fh
, S7 m8 g# m9 n. b+ |/ _" V* A& ~% q% h
__________________________________________________________________________
0 x- I; J0 L6 W' D. c: ~; L7 _5 u- d V& Q5 N: F% z
Method 10
+ m8 S' [) U% c3 C=========
7 M1 z2 ~2 y5 E H' D8 ] l5 k2 J V! @ l
=>Disable or clear breakpoints before using this feature. DO NOT trace with
) u) i: F6 p. a, [ SoftICE while the option is enable!!
: r0 j( ^$ r4 h* V4 m( R' z+ }0 b, b) t" A' j6 ^
This trick is very efficient:% u1 z8 q# o2 t$ i3 q
by checking the Debug Registers, you can detect if SoftICE is loaded
# K& S! C( n5 H9 G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 i6 I9 \/ E# n$ y& b6 O
there are some memory breakpoints set (dr0 to dr3) simply by reading their. U! p& X' y9 u1 Q* p; L8 W
value (in ring0 only). Values can be manipulated and or changed as well
2 Z* i" y- o. b(clearing BPMs for instance)6 d: c* o; E4 D$ C4 j
! V! _1 W# ?6 ^6 h6 \% V0 V
__________________________________________________________________________/ g; v( T9 w5 v. P
3 n! a. q' d- [* pMethod 11
& t2 ]4 f9 U, Y- C4 ^=========# y# e; ?+ [! o9 a: E
# i* e$ A; c9 H4 `0 KThis method is most known as 'MeltICE' because it has been freely distributed
' B+ P; L6 c l9 Pvia www.winfiles.com. However it was first used by NuMega people to allow
6 S. ~% a4 J. R2 c6 dSymbol Loader to check if SoftICE was active or not (the code is located$ b$ @# k D' U6 O$ }7 h: ~' g8 k
inside nmtrans.dll).
( L' M; j8 `) @4 q
8 Y5 K, b3 @/ W% G/ I- mThe way it works is very simple:
: J% S h, w" Y! i* NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& f) J; R5 q" F5 F& i
WinNT) with the CreateFileA API.- C- X& @, W. O; q/ K
! S7 v4 J; o! n! b6 H9 g3 B/ zHere is a sample (checking for 'SICE'):$ s( v" R: I6 Z! Q5 V: Y
; o$ G5 @/ X: c' m
BOOL IsSoftIce95Loaded()
" o* q/ m5 `" N V" v& @( d |{. E) R2 @% i; D5 l
HANDLE hFile; % g0 y3 c3 K, v$ ]5 `" w0 M% L
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) y! U1 a, N. }- t6 U: ?( |) P
FILE_SHARE_READ | FILE_SHARE_WRITE,/ ~( U1 F% y5 J7 ?
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
R3 C( p2 N1 o9 K% _, z if( hFile != INVALID_HANDLE_VALUE ) Y) f6 V0 _! ^9 `
{
0 r0 z/ H. F( ~( |$ T' H; y CloseHandle(hFile);' R9 b. e' r$ v' \1 s c* R( y
return TRUE;) E! {& n4 b0 P# _: f- U1 a
}
, F8 m1 s& v$ r! |: @' i N9 V return FALSE;* @7 s2 c P, H8 F5 a
}
# f. t( G& t5 f2 U! ~6 ]: o' q; ]+ `+ F* } X$ C
Although this trick calls the CreateFileA function, don't even expect to be
$ k9 I H4 R" Cable to intercept it by installing a IFS hook: it will not work, no way!
$ B( T% A6 v' t# Q6 n+ l7 UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F& f8 m" I! p" ^6 n: t/ n
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function) r4 B- `& b, }( r: S7 x% H& L
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, n* J; K: e! p% A! ffield.
' q4 X. Y! X/ j: s7 `8 VIn fact, its purpose is not to load/unload VxDs but only to send a : s' Y8 g5 ]6 _: \
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). J: O4 X, J+ M4 Z5 [; n' i
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
' u$ Z0 a+ L8 D# ~- Dto load/unload a non-dynamically loadable driver such as SoftICE ;-).( P) c& G3 h1 q
If the VxD is loaded, it will always clear eax and the Carry flag to allow- r6 n( X/ G* H6 }3 ^
its handle to be opened and then, will be detected.
/ S) y; S. w) d9 nYou can check that simply by hooking Winice.exe control proc entry point/ y& H8 C4 R2 B8 K
while running MeltICE.
& U; v8 |/ \% g H$ S9 }9 c% ]; P% ~; y# n( d" p( Y% E
. M4 _; B" z0 P% v3 m6 T
00401067: push 00402025 ; \\.\SICE9 K, ~6 V/ y% P6 C6 u; F. ?
0040106C: call CreateFileA
: u! g ~% W7 l0 k9 d 00401071: cmp eax,-001; j! k9 p0 S. W' D2 y% g7 B
00401074: je 00401091
; o1 T, H9 N Z r% @7 R, L
) \# \ b' V% E0 b( k* r, c9 }0 [) i4 r; L3 w
There could be hundreds of BPX you could use to detect this trick.
3 L" W. i1 j# h" n x" w6 I-The most classical one is:( p7 L4 f* P8 `: n# w0 i% k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 m" C+ P7 B, f2 `+ V3 ~6 x *(esp->4+4)=='NTIC'
, o x6 K* o0 X) ^
2 c+ [- O8 q. M% |+ @& ^-The most exotic ones (could be very slooooow :-(- K# k' R6 A) p, A; f
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ' C3 _6 W" y9 T7 m' m9 m: G
;will break 3 times :-(
2 k3 C% ^+ H! q3 x# Q1 @
n2 n) F: L) v-or (a bit) faster: # `$ q/ N' J( s% w% ]' v* k
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) E3 T/ }! W1 W; U: G4 _; V* O0 O) A8 q) z
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 c8 U, y9 I) ` L& i ;will break 3 times :-(4 @# T% I6 d* q
G$ n2 U" K) [0 e" T# X-Much faster:: J1 K! Y4 F" y% X3 R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ O5 O8 b. s+ @. D" ]7 R
. k5 k# Y( Y# E5 G& ~; cNote also that some programs (like AZPR3.00) use de old 16-bit _lopen0 ` P9 D3 M5 F) p* u8 B$ A7 ~
function to do the same job:
0 U- S3 [4 g9 N! E$ v3 {& I; L& w) P; }$ W- r( a8 G4 n
push 00 ; OF_READ
2 b+ S. T8 Q5 ~ mov eax,[00656634] ; '\\.\SICE',0
& t$ k( B% h& t push eax& x! B5 d# e/ b4 K* `5 h4 \% Z% N
call KERNEL32!_lopen
- r: `) T6 \ B/ F6 Z. O; C inc eax
4 I! b& B G+ t; o5 y! m8 U# C jnz 00650589 ; detected$ h8 o% E# z/ c( M6 N$ w
push 00 ; OF_READ
- |3 x: M' c3 r* y9 r7 Q mov eax,[00656638] ; '\\.\SICE'( Q8 }0 g4 d( k e, K3 W( L$ l
push eax& F/ _( | E l& d4 D- m
call KERNEL32!_lopen
1 r4 ~' O, I1 p# G8 c0 _+ o: A2 b inc eax- w6 @- J% G: g0 i( b M
jz 006505ae ; not detected
/ i2 b: p2 u+ N/ y1 b, C
5 L: W6 G; b4 G: q' s6 W3 U8 S3 _+ j1 ]7 P% M) x! |
__________________________________________________________________________
6 Z* u4 ^- H) f1 s) @ P6 W3 | k
" b+ n0 v0 S" @& Y4 } [Method 12
* R0 F1 B2 N9 i: H! {! T6 X=========
! m' ?# I% B& m
' ~3 a g: B1 S5 D2 `This trick is similar to int41h/4fh Debugger installation check (code 05
9 P( h" J( o% [! N& 06) but very limited because it's only available for Win95/98 (not NT), b7 G8 B) p2 I5 Z1 f8 I! b
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.( m; }5 Z. W0 m/ c
/ r% l9 O+ ^, |+ r push 0000004fh ; function 4fh$ `! n( v8 a8 }! S
push 002a002ah ; high word specifies which VxD (VWIN32)
/ l, h1 Y6 E9 o0 x4 R# O ; low word specifies which service
5 l# J" T8 `% M0 c. A. ~ (VWIN32_Int41Dispatch)
1 @2 A% J4 l3 [ call Kernel32!ORD_001 ; VxdCall
; E. ` n8 U" \( `% Z9 ]" X! o4 d cmp ax, 0f386h ; magic number returned by system debuggers
5 P/ u3 B2 ?! {: D0 \ jz SoftICE_detected
. b& l# o7 K1 g- D2 L/ z9 S
* V) Z$ w% R7 L4 W, z+ ]+ _Here again, several ways to detect it:
0 u& S( Y( e4 A. ] r2 ?! W0 n$ S3 d# M) `- i* o
BPINT 41 if ax==4f
6 a( {0 A6 m2 B- \/ {
H, X- x* i4 ], A& u) K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ R$ c4 r- M$ |( `8 q) ~/ R
6 c0 k* b) c, p. p0 s9 r' n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ H4 d: U% w2 Q- J% B
+ e0 h3 ?3 A. J; u
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( X8 ^9 M ~& U8 E* C5 H
3 W- }% {, G- Y: F; K__________________________________________________________________________
5 N( Q; A. m8 U( I/ g
7 ?% @. j4 G$ i: f! P, P: N- nMethod 13, G5 [! A8 S [8 b% R4 a4 f
=========
! p" s- \' `# w
' n2 ^$ R5 N4 m: Y8 p8 S/ rNot a real method of detection, but a good way to know if SoftICE is
; T) B; b9 }. l' j% o/ \" j6 [ Dinstalled on a computer and to locate its installation directory." d6 U, e6 J1 o q0 A$ A
It is used by few softs which access the following registry keys (usually #2) :
& _0 ?% n9 a! \. E& g( ]5 h1 q7 L; C! X# V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% o0 M/ J/ U$ ]1 }. }! m
\Uninstall\SoftICE
- Q& ?! R1 @/ r/ N-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* l8 p5 S9 A4 H$ L5 P2 G-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion x( w, C$ y4 n& w W+ L. f" U8 o" A! K
\App Paths\Loader32.Exe6 e6 `; R' B C' [. n
* {* A* D4 A# v" w1 Y7 D
' \% D7 ]' e. S; o" J u! Z
Note that some nasty apps could then erase all files from SoftICE directory
( `' N# \, C0 F9 s" z8 w( @7 r0 w( ](I faced that once :-(- U k1 c6 j* l5 }; k
; M! u; ^5 d8 i9 l; }7 F8 YUseful breakpoint to detect it:' z% R; `) R' e( ]5 V5 b7 [
6 B8 k% u2 u) m& Z" S! A5 R BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; t9 G" d# A# u( ]/ o; v
M5 j0 S$ I! m: }* P__________________________________________________________________________" E! k5 p U+ {- q
9 w, w) E% r5 }
2 V [% c5 Q9 S- o4 t3 I$ Y! qMethod 14
% q& ^& x* ?, c( H" Z3 h=========9 h2 h% i. E, Z; p/ [4 Y
7 L* s: n& f' HA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" v ^7 p7 W8 f/ i& wis to determines whether a debugger is running on your system (ring0 only).
+ e+ u1 I M/ `+ d/ H, R! G1 C4 J( h" l) o7 `3 n. y
VMMCall Test_Debug_Installed: l5 r, ^- P) \
je not_installed0 X3 D5 e6 G1 l2 m" l. y" U5 C
) ]5 y! b8 d% \" RThis service just checks a flag.
7 `9 u5 o/ h! {9 f8 _7 @</PRE></TD></TR></TBODY></TABLE> |