<TABLE width=500>
4 d: h3 l( s6 W( x, Q<TBODY>
: [+ ?8 G- B: g$ S$ s3 w4 ?& ^! f<TR>2 y1 n; W4 s- \1 _
<TD><PRE>Method 01
, f& U8 B+ T; v$ d9 ]- q z y=========; `$ z: z7 X/ ?0 N
0 |& @% F! ~: g$ _3 c& M* N
This method of detection of SoftICE (as well as the following one) is
. |* s; L+ U9 I+ qused by the majority of packers/encryptors found on Internet.7 z- Q9 p6 j* B
It seeks the signature of BoundsChecker in SoftICE2 r' u( R0 W9 p0 j! m, W
1 ^! T3 L% K, q5 z6 t ^: m mov ebp, 04243484Bh ; 'BCHK'" y. A, A" X) J9 w
mov ax, 04h
4 O/ N) Z1 S' b: u. U g int 3
4 O {& F* N0 A% W6 f2 M6 F) n cmp al,4) M5 k# S! X; |3 ~; E- `( B+ ~( t
jnz SoftICE_Detected
' b% s* L& Z: E2 o+ _" ^) W) p, U, [# E
___________________________________________________________________________
0 F Y. c- R* i" }/ l- H5 C: {6 k1 A7 o4 X+ x
Method 02
! _' i c7 O* o! E5 a" P=========
* M( \- b3 N( x a4 t, n$ E1 P. w |
Still a method very much used (perhaps the most frequent one). It is used1 U# W# `" \2 x; O; q; Z) g/ J
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( q. ^' t0 R# R Q0 u5 O# k
or execute SoftICE commands...
3 D5 c/ Z" z% ~; [; r9 MIt is also used to crash SoftICE and to force it to execute any commands
. g. h! r( V* l' J# r& z(HBOOT...) :-(( / W# Z8 {( c! L. t8 v' X" O
: O2 s- B0 A8 cHere is a quick description:
7 O0 O, n% b+ g! C; w! F. o! U4 H-AX = 0910h (Display string in SIce windows)/ t1 {8 }3 v. V f2 z2 J" Q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ e- A, z3 I4 v* R6 {-AX = 0912h (Get breakpoint infos)* J" R+ `- O9 R+ W* w( V* G5 N
-AX = 0913h (Set Sice breakpoints)
7 S1 j- z% {5 {-AX = 0914h (Remove SIce breakoints)3 n" F j! N8 v4 Q: q" K
5 U2 n, b- k7 ^% B1 @
Each time you'll meet this trick, you'll see:
5 R5 y+ B( i. y+ L$ e/ C2 K-SI = 4647h8 b6 `: Y9 J+ I5 B4 S
-DI = 4A4Dh
% {5 u5 r7 ?9 d! a1 \3 Z6 [6 NWhich are the 'magic values' used by SoftIce.
. ]7 K# l4 n; R+ D/ hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) r9 i: S3 Y6 z0 B1 P* o
; G8 U5 j/ q7 j$ v! _2 t* w
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: @. U& B# |" h" J& rEnvelope utility use to protect DOS applications:
+ J. B( M: q/ @; c4 b( h" V, _# h3 r8 S' g
* x2 c- A* c: X" C2 ^4C19:0095 MOV AX,0911 ; execute command.
5 |1 A( v. _( }5 V1 z' D( F* q4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 A9 N- F, t& ~; V9 L! _" t4C19:009A MOV SI,4647 ; 1st magic value.
# Y- O; X1 Y6 E$ T1 i4C19:009D MOV DI,4A4D ; 2nd magic value.
3 L+ p' Z3 A9 q1 R% J4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 C5 ^2 x2 v G# _4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 i' _$ @3 b, K3 Q' h
4C19:00A4 INC CX
, m. x; f, ~) R1 q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ {. X+ s+ {' D% d4C19:00A8 JB 0095 ; 6 different commands.
) D# I, I/ k. F3 y" J4C19:00AA JMP 0002 ; Bad_Guy jmp back./ I% F$ h: \7 E: J+ j$ e) d/ `5 Z- k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# h2 z H1 r* B3 E2 Q# _' B* I1 \6 P3 _
The program will execute 6 different SIce commands located at ds:dx, which
6 ~) v- q" f% T; X% vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 W' b: ?$ ~0 l: u) i' q' y. H# b* I. b9 b
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 k3 W/ [) d5 P5 J___________________________________________________________________________! K- ]3 V% e5 X8 u, v! B
* j6 h* u% c1 h$ z7 Z/ `! _
' e% g" q, Z( g, v$ B. i6 ~Method 03
5 \* J4 O0 V3 x- @+ _=========
Q5 _5 J/ W( s0 W7 l7 {- D
- u7 u0 ~6 ?7 MLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" D1 f" W8 Z' W1 d0 P1 O% Q(API Get entry point)
/ |" G7 C, k9 @& _+ b. D7 U" E
$ G9 f) N! {/ J1 [" D; F
8 c' `7 d( d$ m L/ d xor di,di; Q A& I, a, T& z' Z% ^
mov es,di
7 k- n1 i) Z- [0 B8 ?# f mov ax, 1684h 6 G9 v) j9 p6 L* p9 t
mov bx, 0202h ; VxD ID of winice3 V/ x T/ a* B K9 ]
int 2Fh( t% j1 Z! W0 l5 t0 t
mov ax, es ; ES:DI -> VxD API entry point8 q l6 D5 @4 D$ I2 n& |& l
add ax, di
+ V4 E( y* |9 v1 a0 C$ t) j test ax,ax
( R/ B# L. E, \& Z* _. w1 X! x8 `! r0 j jnz SoftICE_Detected# K% H- N' m1 w. O4 z1 o! @" }6 w
+ R9 }# A1 Y: M, C0 o
___________________________________________________________________________; m, n9 F7 h L- m) L
\! f: L; R4 g) a- |
Method 04
1 l6 p3 A9 w) b4 T& q7 U! c=========; v& ^ z# l& _% f. p9 k; d
; ]* \( @8 J0 x$ lMethod identical to the preceding one except that it seeks the ID of SoftICE
. f5 _" \7 x6 r6 [GFX VxD.' Z, B$ f5 X; {& _7 H8 S; d- e
$ k$ E/ H7 c8 @ xor di,di, L, O- ]" k! r' S
mov es,di
! ]0 B5 T8 J! v+ a% S! b mov ax, 1684h # z8 F2 L% a# y+ m
mov bx, 7a5Fh ; VxD ID of SIWVID
' y' _# g0 M5 |5 o) H2 U int 2fh+ c& a. }/ B8 d A2 W! M7 _( ^) c; x
mov ax, es ; ES:DI -> VxD API entry point
, p+ B+ `6 B( `0 l add ax, di
1 R/ N' A1 _& p u$ b. @6 x, C3 a test ax,ax
* T( J6 H( K p8 V/ g* i4 ^ jnz SoftICE_Detected
9 m4 n0 i7 r- f6 |4 M
. W- U2 Y" e* U3 Y6 V! Z__________________________________________________________________________+ K% A( W+ r8 c: \
: W, f6 L1 |2 Q3 ]6 l2 [% ]& O1 y9 x% e" g @. b
Method 05
s7 c, D( e' p0 q0 Q=========
0 r, l' k4 G" Z0 j0 q' h& c+ D8 {8 E( E7 m/ m" [
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# L {; l8 ~0 j8 R; J# Zdebugger. It calls the int 41h, function 4Fh.; t0 D& x! B7 U6 |8 ~
There are several alternatives.
8 C5 Q1 H9 O! ?1 G& ~
7 d9 w( T5 v* ]The following one is the simplest:
( e! g7 |. {$ f: R, N$ [
( y# m! k. @- y+ r8 s% A mov ax,4fh
# f2 t* d+ P. b4 d9 r int 41h6 H) ^2 K+ D1 y" N+ _ o
cmp ax, 0F386: `* P# d! D# e3 P' M' i
jz SoftICE_detected0 T+ B+ | T. k& d, q; ^4 _
" z+ a! g( k5 p1 Z2 t1 V3 j7 Q1 Y% G, i. C9 P/ K2 D
Next method as well as the following one are 2 examples from Stone's ! f% a) e% R, S1 j5 s3 b
"stn-wid.zip" (www.cracking.net):
( N' Z9 g0 {3 w* U
8 n* ]. i2 z) q4 t( d+ H mov bx, cs
# q- ]0 K% F5 `+ ~/ ^8 Y3 J9 s lea dx, int41handler2
@1 E$ n) u4 x xchg dx, es:[41h*4]
0 M1 O+ _* l% O9 T+ Y xchg bx, es:[41h*4+2]
. s; V& a4 n0 b0 ?0 F8 w s/ R4 R0 E mov ax,4fh9 U' f7 b0 J( y/ k( l3 A
int 41h
8 x+ U- @8 \$ {5 h, | xchg dx, es:[41h*4]) I: t5 d2 @( l( n U$ y
xchg bx, es:[41h*4+2]3 B( Z" ?4 x' O' L B9 x
cmp ax, 0f386h5 o8 M6 c4 `* e5 @! o6 D8 v
jz SoftICE_detected" L y; d; }2 N; N) f( _% ?
5 J }) `- v0 K& f# Sint41handler2 PROC
# P2 ~8 B- j: U2 V/ C iret
4 b" B& g+ w) c8 B7 Bint41handler2 ENDP' ?3 j5 N; c1 M$ y3 ^: w
* p0 y) Z% y( T5 p; s$ m- w
; d. s" Z7 J: H& ^_________________________________________________________________________( n8 N% W- V/ m/ I
. i! b( {! _) b( u
5 T( p. c+ G0 J6 G. Y; V1 A0 ^' ^Method 06
0 B7 ~$ F C/ P! U5 [% v=========
# Q% o }# V8 Q. x* S/ H
" w9 k7 u% i j5 b# D: v$ m E8 z; w$ d+ X! k* O0 C
2nd method similar to the preceding one but more difficult to detect:
3 \# p3 \; x! t) N: b' }" i4 u: [$ T
0 x( ]! }" V1 c0 s: S7 }$ O% g$ o% |; |$ u. r$ g( s( |
int41handler PROC
5 @) B8 m4 v- G9 e; W8 i% X mov cl,al# p7 U; G3 T: }* E7 a& D4 ?5 F
iret6 J' z% X: ^$ a' v; U% G" @* Z
int41handler ENDP
( w' C% |6 w1 I. h s! m$ A: ?4 m' y$ [( c' ]- c, I R( Y& T9 F7 `
4 B9 o! C- Z, ` xor ax,ax
' J. S9 Z0 f( { mov es,ax, u7 e& T$ T* \! e/ G
mov bx, cs/ \9 C2 F' {0 c7 Z2 U, Y* `
lea dx, int41handler
! w: _3 D0 f0 }1 S2 b/ f xchg dx, es:[41h*4]
4 B2 b; T# j: g5 B- w( X) s xchg bx, es:[41h*4+2]4 I5 w6 x& _$ v7 X2 v
in al, 40h
5 v- I$ {% Y* x4 X$ ^; ]/ z xor cx,cx* H6 A" A$ E: B: ~
int 41h B; l# H0 R! x. D: r& a$ y2 _
xchg dx, es:[41h*4]
, w+ D7 m& q# l4 V xchg bx, es:[41h*4+2]
( \9 H! O% V% W4 S cmp cl,al
( j9 Z$ k# _4 G# R! ?2 {( v jnz SoftICE_detected+ ]' j9 q2 g# G( U; }4 U5 b9 z
8 m$ M$ L% l& s$ P" U& D! l& S
_________________________________________________________________________ @8 k8 Z; X3 C8 i
4 ?; I- ]1 F- V* kMethod 072 I7 {" ^& w% h+ @, H* z
=========0 u2 o& w. x( o' T6 y( B
% l* {! E2 g1 m( t9 }3 FMethod of detection of the WinICE handler in the int68h (V86)
: t/ F' @# T: V) {
# o5 u" ^9 l/ X mov ah,43h
+ }& B4 r) o; \4 T+ t. h int 68h
- p/ z0 E/ Z3 ?3 W' T0 N* E cmp ax,0F386h
7 Y- [9 U, s9 s1 z& i, a jz SoftICE_Detected/ J* w* ]0 x; o. [! P. [
) ` z# N5 E3 }- r
: b$ z, [3 g1 X$ ]6 s# X=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ Y6 i; ^: U+ X1 O
app like this:
% t* k: O8 Y5 M" d6 s6 T
2 Y% r! V, h8 f BPX exec_int if ax==68/ N+ `) l8 V2 K- [
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ m9 V+ W- j0 @: l4 a' G% | located at [ebp+48h] for 32Bit apps)
& T) V" [! u, r4 B5 n% d__________________________________________________________________________
) M' P v* A% s6 p9 A: D0 ?4 s
/ s- o/ b" G% x+ C' h# K! ?: }$ z1 n2 w' d1 Q* X
Method 08, V* k# ?. [$ a3 i
========= e* |) v( U$ g4 l* ^: F; b* |+ O
5 |% H$ k9 M! q& } C& `It is not a method of detection of SoftICE but a possibility to crash the
- Y! f* A% \- O; Vsystem by intercepting int 01h and int 03h and redirecting them to another) R& i) s2 B' n) g4 ~* r3 _" n
routine.( S% D! ]$ {: x, V! |4 X+ f4 O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: |* p' L" h: r2 L2 z/ M3 X: w3 vto the new routine to execute (hangs computer...)% C/ E. H( W: ^
0 G6 p1 I8 y2 |, Y0 O6 N! I/ c% F mov ah, 25h7 g4 k' O5 F' R m
mov al, Int_Number (01h or 03h)
3 v' t/ n2 b9 b: t4 a$ [! q$ s mov dx, offset New_Int_Routine2 {, d' j& F7 g! a8 x
int 21h7 j+ W2 Z* R5 w) N! w
' {" k) H6 g( x
__________________________________________________________________________7 ]) L* G( h w
. q! b, M! |& o
Method 09
5 ]& z8 y( J- a4 z$ l/ {=========
2 w( Q) F$ Q) ]9 v" Y! q$ o7 H4 Z& T5 F L
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
F$ O+ F3 S% W( E: ]performed in ring0 (VxD or a ring3 app using the VxdCall).6 F! _- q* U& c2 U
The Get_DDB service is used to determine whether or not a VxD is installed k9 a" C0 r2 b1 t4 t
for the specified device and returns a Device Description Block (in ecx) for' [+ H% l7 k7 Z+ ]4 z9 M' W+ G
that device if it is installed.
0 @4 ^) l% \% s& s! @5 R5 O0 m7 `+ }' M: g; f( ?$ C
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
. J1 V1 ^9 q. o mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-): s& K) {# [3 H# P
VMMCall Get_DDB
1 v; P% G; Z% }0 t9 j- I" l; ^( I mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed5 a) x l; V! ~) C/ V
5 F- {0 \2 r+ H5 r
Note as well that you can easily detect this method with SoftICE:
* t U4 h( e7 j6 t/ @; |$ r bpx Get_DDB if ax==0202 || ax==7a5fh
" k. l" s3 Z1 j! Z. N9 J
# m: F0 q2 V) M__________________________________________________________________________6 \+ O" r$ B. ^6 C) ~/ E/ h
* j. [+ B# Q, n6 h6 N, T _
Method 107 k$ n9 x n1 ~. O1 d& `2 F) N
=========
; D1 m1 L8 k- @3 Z) k
3 f+ h4 K* w: Z( A/ l+ t=>Disable or clear breakpoints before using this feature. DO NOT trace with' c) i8 t/ T) f! E
SoftICE while the option is enable!!, S2 @* J8 m: T5 ^$ @. E
& b# e3 ^4 S. b3 P9 I1 j
This trick is very efficient:
# ~( l: K* w! h6 y7 W0 f! jby checking the Debug Registers, you can detect if SoftICE is loaded
; M! _! P$ E' i* X(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if R8 A$ F5 m3 y
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ L) c/ S* @. J$ \, O, s
value (in ring0 only). Values can be manipulated and or changed as well
0 w- _! h4 q/ T7 s G(clearing BPMs for instance)
. l5 }) u0 [* c/ C" c; i
2 m2 F' q5 u0 Q__________________________________________________________________________/ ^8 r Y9 h7 ~; x! ]
) j: F" ]) P' ~, Z4 Y5 `Method 117 z2 Y% [* |5 X% G
=========
5 C4 R/ i! W( o# W' S: }$ [. i: e6 ?
This method is most known as 'MeltICE' because it has been freely distributed8 w/ z7 r8 z: X; Y' j
via www.winfiles.com. However it was first used by NuMega people to allow$ I: Y8 C: o9 R6 ?
Symbol Loader to check if SoftICE was active or not (the code is located
+ S8 I1 m" j# j6 Z& `1 U- k5 T% rinside nmtrans.dll).' B# N; p' T. H) `, T; v
3 d6 ~0 @) [0 E1 KThe way it works is very simple:7 W0 E( D1 ^, m: L1 y7 {9 {
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! B8 U! L N- K' c2 g/ L
WinNT) with the CreateFileA API.* A" W& w( W$ t/ i
' U; N& {% d8 y# z- `Here is a sample (checking for 'SICE'):+ G& j. o4 Q" b0 a# M2 e& \7 d3 c! u
2 ~ [/ Y' A2 b9 R
BOOL IsSoftIce95Loaded() @& l3 ~* h7 c& E
{
$ `. C' l/ R# F8 G$ |/ S0 j7 W) }9 u HANDLE hFile;
" y8 E5 ]% d6 q. ?9 f( r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! i# D9 _' i: U+ n FILE_SHARE_READ | FILE_SHARE_WRITE,
. G9 @4 D( ~! o4 C4 d2 [6 m% m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 n1 e5 X1 J5 l9 _! W if( hFile != INVALID_HANDLE_VALUE )
% d: M! o8 h. [4 C, t {
. h1 D, q. w& ?. f5 l! A CloseHandle(hFile);, Y1 r: R5 }- b, `' X' m9 l: o
return TRUE;8 U& L6 E* Y" ?0 q6 R/ p
}
% ?6 K0 P' }( t3 z; t( I return FALSE;4 |: z* O# x; p* V
}' p2 J! V: H* f+ r: F* G
! Y# Y2 r& ^. |% |' G+ ] q3 j+ kAlthough this trick calls the CreateFileA function, don't even expect to be
5 V7 E- a" v' P1 ~able to intercept it by installing a IFS hook: it will not work, no way!" w4 r0 G3 P3 s9 V8 J
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 ]0 }" p1 I, `) P. B& r: Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% @' L/ b! y* R6 ]; O# [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc. `% ~( p% Y5 n) G5 ]" P# Y' {$ x8 P
field.
2 m- n: w( ]# \In fact, its purpose is not to load/unload VxDs but only to send a
9 G1 x( P8 I. `$ aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 A& x. e5 m! s6 w- U9 s! B. xto the VxD Control_Dispatch proc (how the hell a shareware soft could try
2 F4 U; h3 o5 A; \3 r( M ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 `; D8 N7 f0 K! @If the VxD is loaded, it will always clear eax and the Carry flag to allow3 \, T+ c/ ?4 L$ G% Q, R) \
its handle to be opened and then, will be detected.1 y9 r& Y) ^. t% `) ~: Q& Z; L- m
You can check that simply by hooking Winice.exe control proc entry point
. a6 \9 \2 l$ ~/ C9 z$ Nwhile running MeltICE.. `9 q, j4 U- f0 g
! y& h9 b$ m# ?# u2 J( v6 ~4 D9 M* Y: _0 S4 ?' |5 k
00401067: push 00402025 ; \\.\SICE0 K6 x( i. l, h7 N, m, c( o
0040106C: call CreateFileA# @+ M% M8 `9 n Z# p8 B' n0 F) D% q
00401071: cmp eax,-001
3 l; i# E5 ]; ^ 00401074: je 00401091- }+ o6 z" @. Y8 I- C
# c! X0 d) k( ~& |
! d5 m$ B; `8 C/ H2 |2 w1 a, YThere could be hundreds of BPX you could use to detect this trick.
! ?0 ^0 j) L* `4 u+ [-The most classical one is:
7 f# A6 G* u9 [; O8 S& | BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; ~/ a1 i+ j! G& x3 y- B' W
*(esp->4+4)=='NTIC'9 ?* ?3 o7 `$ X) J4 n
- u: S0 D3 G% l' e
-The most exotic ones (could be very slooooow :-(, p$ s* h) R. s8 |; x
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
D+ X8 ^# K7 \ ;will break 3 times :-(+ Q6 q- g2 w0 \8 d
% W1 @1 F5 Q. d
-or (a bit) faster: ; A$ C5 x6 p2 |4 Z1 g- `: }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# u% Q1 ^% u7 G$ N; I
^3 `& \1 `- M, s; J BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 U. p; W" i( `9 i' k
;will break 3 times :-(& Z3 @, ~2 _ t- N
. p1 t) S( b5 l2 M
-Much faster:: y c" g: E) _5 Z
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( n, \& {- b- R1 O: G! n( F: z
$ T( q" p9 n: ?0 \' u- TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen1 _$ T+ q& H4 n3 Y
function to do the same job:
- h5 w8 H$ ]& {" Q' V' ~$ N: l6 x. V0 Q9 C1 C
push 00 ; OF_READ: m5 m! r9 L5 ]' B! A0 X( }& G
mov eax,[00656634] ; '\\.\SICE',0
6 J _) Y+ q: Z8 u+ J push eax. W5 W( V: C; U( P9 @
call KERNEL32!_lopen
+ M2 W* w- x/ z9 A/ F/ X+ S8 L% f inc eax
8 ^+ x5 G" j9 ?- S jnz 00650589 ; detected
' F6 V3 ]* F3 N6 f push 00 ; OF_READ- e& Z, r) Q5 O) X% V4 Q
mov eax,[00656638] ; '\\.\SICE'7 T! v! e3 B I, l2 n/ T1 w$ l# F, T
push eax
3 E* |- q% l% M8 z$ m$ i5 v call KERNEL32!_lopen
$ e1 u- }% M' L# U# y' h inc eax
/ Z" h. q# m3 u: b) k0 {1 @ jz 006505ae ; not detected9 v+ t& D0 @# h$ Y. J
h" k3 ~( J/ ]6 Y: q. ^. C; f
% O# O+ c0 W* \' Y) K1 E- H
__________________________________________________________________________! X4 X9 k$ A# I7 J6 Y5 H7 N
/ R" p/ n$ F' ~% B. H q
Method 12
; }* n! Z- y! m+ G `* h2 [ o=========& _9 H/ ]& _8 z
/ {; s3 I! ~- ?3 zThis trick is similar to int41h/4fh Debugger installation check (code 05
9 z/ j2 D0 c8 G& 06) but very limited because it's only available for Win95/98 (not NT)! p4 I" i3 |; b( k& |
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.- ~7 b$ g0 f2 L
_8 t; @5 {9 A8 {
push 0000004fh ; function 4fh* t5 p$ p2 s: a* H7 T9 |
push 002a002ah ; high word specifies which VxD (VWIN32)
$ M# n, k7 W" V- e" L ; low word specifies which service
7 [# I$ ~ x/ Y& m' P- Q1 |" @ (VWIN32_Int41Dispatch)
, Y# q; g, F9 x& j; Q6 |& p$ y. d call Kernel32!ORD_001 ; VxdCall
0 x) w3 K; k2 a |+ m- }3 ] cmp ax, 0f386h ; magic number returned by system debuggers4 M1 y1 j( t6 i3 ~2 \: y$ m; u8 W
jz SoftICE_detected! ]4 S; `1 j3 K* a
9 I5 ^* H+ F* C7 A" V. V" h
Here again, several ways to detect it:0 i) A; |1 B8 q: C' C
, j" W9 q% E; z: p& b* J2 q BPINT 41 if ax==4f8 Z, ]7 O0 U" l2 Y6 b3 t
2 A5 h j) S) K2 @- {) b4 a
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 C; W$ s) F$ j3 X6 F. T" m, S n* e3 A9 f( i6 W- F3 f6 N% g, G5 R
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 q5 B1 H- s4 u. x" W9 |9 H. Y
( ^# R; x0 M3 G' V" D- H: M BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- }3 n- E; _4 | D6 Z
4 i1 L: u+ V" v__________________________________________________________________________. j2 I2 a% ^6 l9 }* C4 a
# q3 q+ L: C9 H! O
Method 133 t/ \& v+ y# B+ T8 Y5 c0 V5 _3 N
=========. u) N }; s+ u0 O5 c
* o, ]9 |. @% W& Y7 t7 H
Not a real method of detection, but a good way to know if SoftICE is8 J8 x8 t g3 e$ s8 y2 S8 p+ g/ r
installed on a computer and to locate its installation directory.
# R! m0 o! _6 U- q) xIt is used by few softs which access the following registry keys (usually #2) :
3 o. _) ]' l1 ^, w$ t/ j" b9 |/ x" |! \6 g6 M3 |; T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ Z/ N, E% t3 c! H& E, z9 C; z* Y\Uninstall\SoftICE
" m- E7 J9 {% I-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 J0 r, z* ?, z/ ~% W! p
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) i; |" S$ c8 K# ]& F
\App Paths\Loader32.Exe# K) Y3 \( l1 n) T
# R8 R/ F; H8 |4 e7 [
6 N5 A3 ^# _* w. E6 ENote that some nasty apps could then erase all files from SoftICE directory
' ^/ T4 [ e Y# o0 N8 V- R* G(I faced that once :-(" }/ P0 J2 @8 M, C3 K
' ~4 S* n7 z5 X; W6 ?! p7 O4 M: CUseful breakpoint to detect it:' N+ H' [. Y4 w$ Y
* q5 _: f# B4 w3 c: L. U" G4 w
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' ^! a1 y6 R& l3 l
# C/ b) Z! E9 X4 E: D) C
__________________________________________________________________________9 H, O' s# l n3 L D( [$ Z2 [
+ B5 ?0 ]& d! |! E6 `7 I" }
* O. w! k& W1 j! HMethod 14 % r- u8 p# H9 u: ]& u
=========6 A' v$ Z5 \- W8 k8 |4 `2 n$ I
: y- V$ G$ u( i/ L7 I
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 ?- H7 g* Z( w
is to determines whether a debugger is running on your system (ring0 only).$ y# e; v. n- Z
) [* o* p7 v2 j. Z% q. B @% O& T! r VMMCall Test_Debug_Installed& `5 M) X7 s( s7 A" O
je not_installed3 W4 u* c6 d& j% g" p
; X; x. e8 ^5 {. u; A/ B, IThis service just checks a flag.
3 t) g. C- e/ l% j% o' ]</PRE></TD></TR></TBODY></TABLE> |