<TABLE width=500>
, k1 j0 j# N+ N) R1 C<TBODY>0 V8 i5 |' t) {9 c, J2 q7 T# D
<TR>
; e$ A3 K+ y7 _) D<TD><PRE>Method 01
1 C/ Y5 M9 P/ O$ ]9 ~% H! ~4 W=========& K6 n; w9 V- o a! j
- T$ b9 V y ` vThis method of detection of SoftICE (as well as the following one) is
- ]0 Y* F3 C Lused by the majority of packers/encryptors found on Internet.
4 G& b+ c5 s$ V1 p/ J& D5 i4 u% {It seeks the signature of BoundsChecker in SoftICE
2 S/ m. w8 E0 B. b- O
( y8 _0 ~. U% n, Z; m6 q2 ] mov ebp, 04243484Bh ; 'BCHK'. ^+ u+ ~8 \7 E- s3 \
mov ax, 04h
% v( P. R( ]/ f7 z int 3
) p( \4 y+ h7 i cmp al,48 D4 c* U4 K) e6 w/ C! S
jnz SoftICE_Detected6 r; y* v5 N* P1 h' J
: F4 O: |2 D4 R: s9 \. m3 m___________________________________________________________________________
; ?4 J1 l# j0 D" O$ X9 [
/ |# ?* z" ^3 x3 [$ w3 p$ x8 NMethod 025 H+ l g5 s# C+ X
=========4 A2 i; M7 Y; G" V* @) h# G
) h: Z0 Q* W0 j/ `* ZStill a method very much used (perhaps the most frequent one). It is used3 [7 m/ X- z! p
to get SoftICE 'Back Door commands' which gives infos on Breakpoints, }+ \+ y" s* ]# X$ x1 t! C
or execute SoftICE commands...
. `! r! d/ i FIt is also used to crash SoftICE and to force it to execute any commands
7 d% a0 q" }+ U, M0 G(HBOOT...) :-(( ' Q( b/ G3 r, u! `6 A9 s: i- L
3 K' Z! o' J# U) E: PHere is a quick description:
& H9 }0 i6 T& l3 B/ [-AX = 0910h (Display string in SIce windows)4 A9 J( b6 v! r- G0 N
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 d0 H( K# Q! g8 F
-AX = 0912h (Get breakpoint infos); V4 Q3 \: z v3 O1 d/ P6 n& a c
-AX = 0913h (Set Sice breakpoints)
$ i+ T! z" z% M-AX = 0914h (Remove SIce breakoints) T0 @2 A- w1 ^, a% i& v$ ?% E+ l
2 T4 g7 t+ ]8 ZEach time you'll meet this trick, you'll see:( t8 R2 p) H1 T2 |3 G9 U+ n
-SI = 4647h
3 F7 d2 V% T7 D-DI = 4A4Dh
; ~. P* z7 U* R0 wWhich are the 'magic values' used by SoftIce.
9 U+ |# X* ?) D8 i5 }8 LFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ D A* a/ s2 A2 f5 Y' h" O7 f$ t3 ]: K/ q+ a; z
Here is one example from the file "Haspinst.exe" which is the dongle HASP
" T. u# [% z0 e. t- L" CEnvelope utility use to protect DOS applications:1 r* {" }' W# a3 c0 J4 A& ^
2 b- g; c% V/ L- I
' x7 m* g' b# C- K' R4C19:0095 MOV AX,0911 ; execute command.0 H2 X: F* G( @0 S
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) V) D& W& a; Q) i2 f
4C19:009A MOV SI,4647 ; 1st magic value.! h7 b$ ~) M" O5 \
4C19:009D MOV DI,4A4D ; 2nd magic value.# T6 p- I/ C4 m9 T% p' n* N
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ }9 v# X( J g# L- o( J0 b+ g3 v4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 l- x" |, _. P
4C19:00A4 INC CX
0 L4 {1 w, [4 p7 s& N4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
. a4 U% x! u& p; ^- D4C19:00A8 JB 0095 ; 6 different commands.
6 M. h5 Y+ s# }9 n) Y3 O: C4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 s y; c$ z- @; [5 z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' U5 N$ d3 }* \% [- U
8 \- R5 M! Z" y2 p/ Y
The program will execute 6 different SIce commands located at ds:dx, which
2 z _0 Y% w$ ?* x" ]" C" Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( e* e( t- }% H% T; v& W Y6 c
: }9 ~2 i* A# r2 B5 v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( B, n i: R1 [$ S: |. ]3 e
___________________________________________________________________________
1 K- C! N7 g; R" |6 d2 Z: A C
3 w8 L% @) B# h' e7 A
9 N4 A; h2 n$ nMethod 03
* g, ` V8 G3 |+ g' I. H Y=========
& U/ ^' Z/ W/ v& Y. x4 ]" p# J" E: g* }, F. H; u5 u
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 R9 P+ e0 L7 c( a1 T) Z* g(API Get entry point). }% |! J8 q v9 U2 z# m
* m( b$ \: z7 Z* z9 b& s
! G- T6 u! }. m( l C
xor di,di
) b4 o5 I% M. k mov es,di
1 I$ [! c, }: s mov ax, 1684h {7 y2 J1 @9 x- d( v9 u
mov bx, 0202h ; VxD ID of winice8 m; l8 n, T9 A
int 2Fh
4 ?7 m9 ~+ T6 A mov ax, es ; ES:DI -> VxD API entry point0 F4 [' C& n) [9 V& Y; n; G6 J
add ax, di
& {) R3 J- g) `0 ` test ax,ax
3 e7 N; ^* Y( [ jnz SoftICE_Detected
5 N$ r: K7 k- E! b1 P, q% e. T% B Z
___________________________________________________________________________3 [8 c- R T6 V+ a: Y" ]$ n
; ?% a# i2 {5 J
Method 04& B$ ]( s5 s& X7 }
=========. m6 S3 `& Z5 b) ~& A$ p9 T
6 q* R5 G$ @/ S, A; v& y
Method identical to the preceding one except that it seeks the ID of SoftICE
7 f ~: j0 `) J lGFX VxD.
- _) ^& P3 {" g" d2 d$ A' W% ?& Y. c( L9 \6 F+ o
xor di,di) K: B$ W/ d9 c: s3 v, r
mov es,di/ Q; U% R0 i Q7 d
mov ax, 1684h . k9 a6 Y( ~' k4 N% R% N
mov bx, 7a5Fh ; VxD ID of SIWVID
1 G- S; K+ X/ `# S( _+ F* e. F int 2fh; `4 A, h V5 a, P* N* n
mov ax, es ; ES:DI -> VxD API entry point
# r5 ~5 }5 o( {- t& [4 b: I add ax, di/ c$ @( X, {& ^& L8 L- m; v
test ax,ax7 o/ a: S8 h& b, `4 \$ J
jnz SoftICE_Detected, |) O: V6 `' E( t$ t9 r
" j1 @3 Q! ^' z6 {5 V
__________________________________________________________________________8 a# }, z& _2 H: i' U/ |0 _
5 T+ f, d4 x4 z8 _( y! n! Q' t$ b
5 u( j+ \- w7 nMethod 05
& {' n3 l9 V3 }5 m, K=========
4 Y& b3 T1 t+ r `
% @! N9 ?& o* C/ F% OMethod seeking the 'magic number' 0F386h returned (in ax) by all system% D& l; R1 [" E7 h0 Y' A3 D$ y
debugger. It calls the int 41h, function 4Fh.+ |+ L6 P" Q* E) n7 T
There are several alternatives. ' l0 J6 z" i0 O) ~6 A
p, p9 F# `4 z, \+ W1 nThe following one is the simplest:7 t9 z* x0 Q/ D7 x$ m- T
" Z( b! ^8 {/ A# f7 B6 ~% [: F b
mov ax,4fh r, R" D' |$ C1 D
int 41h& Y7 `" U5 A* J; o
cmp ax, 0F386/ v: m2 } t% \ X
jz SoftICE_detected; B5 O+ [: L3 y$ p1 M
6 |, j9 Z) `! w. \* \
& W6 h( [) W1 R! C1 U3 v9 HNext method as well as the following one are 2 examples from Stone's ! `, c6 {. [% U8 ]. K0 }1 R
"stn-wid.zip" (www.cracking.net):
( d+ l1 P' T! i p0 ]7 E9 ^" ]* K" ~# C
mov bx, cs9 [/ i7 c1 |8 @& z# N. I0 n
lea dx, int41handler2
( E- B7 s" `, @: j1 t2 G- S% v xchg dx, es:[41h*4]) `5 j4 X& g7 L- n1 W1 H8 T5 g! b
xchg bx, es:[41h*4+2]
" c3 i6 o/ W2 @! U# _ mov ax,4fh
2 ?; J r9 n% J+ @) C. ? int 41h
. c- ^( ]8 m- T) x; K x$ ~ xchg dx, es:[41h*4]+ n% j1 V) A$ r2 j8 l
xchg bx, es:[41h*4+2]; S0 v/ l- I, E' d" e5 x
cmp ax, 0f386h
q: P* j3 J$ v jz SoftICE_detected( T% `! `5 _( z, q0 q' l. y5 V
, A/ T8 X4 P( m/ H" w9 {int41handler2 PROC5 R4 I# a* V0 }3 j% A* I1 }/ F" C
iret
]1 z* }3 y- Z/ `/ Qint41handler2 ENDP
- L# P/ c: z$ f
) O6 e: Q& e% Y7 n' |/ t1 `: y* i4 j* [4 T: C! J9 B
_________________________________________________________________________
! e4 w2 C" S d2 x1 O9 g% Z4 A; V+ u8 y6 k* ?9 X3 X
5 r4 e* {# U9 V& X4 v
Method 06
& L8 |7 v* g) A& u- B# ], t=========) y/ Y& S. Z$ @5 H. |3 I
% l$ G- r: a# p) F" l) [4 o1 E9 D0 D" ^
2nd method similar to the preceding one but more difficult to detect:& m. Y8 z+ v5 F
2 c1 s. a+ U8 z, P
$ Y& D" s2 z9 F( p/ nint41handler PROC9 j3 S- U% W9 N* l4 h/ f
mov cl,al" n* A2 w) J0 k$ [/ f
iret. R# i% f. L1 l' t* \
int41handler ENDP. s* J7 W/ O7 Z a$ a' `- U
! @/ h2 u' s5 G, x7 Q1 a
8 p6 i4 N6 v1 ^/ x4 @ xor ax,ax# h; n* @$ R1 i1 |! ]
mov es,ax* G+ }6 X2 }1 |. P3 L1 h
mov bx, cs
3 F& k, v! a1 } }: X4 `- l, ~ lea dx, int41handler1 m" u2 T3 _# v
xchg dx, es:[41h*4]$ |" w7 s" I' P q& x/ S h
xchg bx, es:[41h*4+2]
o) g2 |/ k. u6 J in al, 40h( w" [- y( V" x* A8 d
xor cx,cx# l* S7 o6 `# v+ o* j0 O
int 41h
; L$ ^0 V+ m* I+ R( Y xchg dx, es:[41h*4]$ ~. n3 ?$ P6 b- J/ d8 w- e% ^/ J
xchg bx, es:[41h*4+2], P1 M: q q/ O# I! e/ [
cmp cl,al, h0 g& B* {7 f" a/ l; _
jnz SoftICE_detected
6 Z- u+ ]* g( K- z/ \: ?8 a" Y5 g* y: v( i; F+ D6 \" {8 [4 v" @3 t
_________________________________________________________________________8 g& \6 v/ e. t( k6 _8 N: N- N$ \- O
. n0 g4 q, x6 {8 U8 W. H" ]
Method 07' G& L/ |4 m( _( u0 r' J# |- A H X! @
=========
% B4 Z2 T2 `2 x) h2 g
2 p- t5 R1 l1 X }% t* l/ m' E; OMethod of detection of the WinICE handler in the int68h (V86)7 e$ `; |0 P0 J& i* P
$ }+ o# C) j* H9 T; o* y
mov ah,43h+ V% h$ c1 E& F, I% @
int 68h
" I, o$ L' q- H cmp ax,0F386h
5 A7 ?' M* z* D- [ jz SoftICE_Detected- E( d' H) p9 X4 q2 K; D
1 m/ G- ]# C% d) ?& L3 Z7 I9 W
2 R9 [! Z9 A1 ^4 o% m6 [( O: J+ a=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit- |& P8 T/ f. q+ a% ?' X
app like this:- ]9 ?6 ^& ?+ E/ U7 d
$ C0 T2 N$ M1 a/ r% Z# o- k+ s$ V BPX exec_int if ax==68
; n$ V+ n. k1 I. Z( _0 a+ m7 N (function called is located at byte ptr [ebp+1Dh] and client eip is
/ R8 P0 O! ^6 i& Z1 v& d located at [ebp+48h] for 32Bit apps)
' U/ N1 S& k3 f& l0 U# T9 V__________________________________________________________________________
* s/ T# b. t$ p4 Z( W i8 k$ X6 e1 g: e: x( X
/ Q, [: k5 x( S' O9 w, p" z: c
Method 08
/ t7 r' j% s$ O: o" [, g- t=========
* p! ]5 o: K& k9 j5 H: Y0 T9 D9 e8 u8 w0 J8 J) _" r2 k$ q
It is not a method of detection of SoftICE but a possibility to crash the0 t/ m. i/ Z/ p6 r- I! }6 u- e5 w
system by intercepting int 01h and int 03h and redirecting them to another# v. H" j$ Q, y. _. R: G
routine.
9 w2 Y8 Z0 \" I" P3 ]. bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# j6 l1 D( w) Y4 v2 V( k
to the new routine to execute (hangs computer...)4 @+ ]1 G. X7 e* c* b. z
& x+ N; J/ n- s4 B mov ah, 25h
0 @+ A. R/ d0 ^$ }2 f: [+ z mov al, Int_Number (01h or 03h)
/ p2 x4 r7 m, P- c6 S mov dx, offset New_Int_Routine2 m5 O( K+ |2 G) ~, K1 E
int 21h4 p' |9 I9 O/ {! f" k: }$ @; z
2 v* C s7 {# q! d* V; ^__________________________________________________________________________# y# A( p& m4 S3 I2 r0 a* t
$ P0 N- Z4 I' ^+ P( g" X; c, S) TMethod 09- J/ Y# Y( c* Z0 m( f+ F' k
=========
R, O* \! l- D* y- l0 @8 d" S9 r/ U! d, `: Y3 Y( w. M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 E) n0 C$ h9 K
performed in ring0 (VxD or a ring3 app using the VxdCall).+ y- Z; u9 n- O& t1 o! @7 b' C
The Get_DDB service is used to determine whether or not a VxD is installed u: \" X/ B9 }- {
for the specified device and returns a Device Description Block (in ecx) for
/ Y$ a( n! W4 X* E0 M& q0 Q8 X6 athat device if it is installed.% h9 f3 v" X" `; a
' u/ z) y' G" U$ E' N3 J2 G
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 [' X- } |/ B, k/ k: A5 z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 }; o" w& n/ J8 |/ Y+ W
VMMCall Get_DDB
/ ~. B1 c3 W2 C7 p8 v1 E mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. k1 L2 p* E$ Y0 g* ^
- [# N3 m9 \6 q7 p/ U
Note as well that you can easily detect this method with SoftICE:" g. |. `$ _: h4 ]
bpx Get_DDB if ax==0202 || ax==7a5fh/ r, a' ^: M' L" I* @
' T( G2 V6 h9 j* R
__________________________________________________________________________
! X" Q f9 H9 c1 `: _' i- |/ z8 O- S M" g" b
Method 10# h; x( r2 B5 a( X5 R5 e
=========
) ^' b c2 r$ Y& n- y" a' _9 n5 }& u' d) r9 d# i
=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 z, u: h1 ]2 `4 ?; p- M6 d SoftICE while the option is enable!!2 x! Y' C+ l+ v" \; G( Z7 Q4 D, z
' v& W7 ?1 x. {; Q! t) N0 U, oThis trick is very efficient:! N3 U) W* [# |+ e+ U
by checking the Debug Registers, you can detect if SoftICE is loaded+ q5 @ G- g* q6 ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if c' K G1 @8 y1 Y$ K
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 H4 q/ P, t' m; O& ?
value (in ring0 only). Values can be manipulated and or changed as well
4 P6 q6 s0 V% o3 p6 h+ C4 b(clearing BPMs for instance)# ]- ?( K4 L2 l* e2 t
# R* M# `( ~; R; [! l0 s6 ~ r__________________________________________________________________________
# ~6 l* ^ t, ^- S+ y* q$ U) Q w% E/ y! U1 ~) ?
Method 11
6 w* v$ Q! f6 H% u7 a=========; y# ^9 M7 [! z: i
/ }& Z2 g8 ?" k2 z4 u
This method is most known as 'MeltICE' because it has been freely distributed6 _0 K5 v! t3 S+ e W
via www.winfiles.com. However it was first used by NuMega people to allow
1 s. i# o* B" T: p" ASymbol Loader to check if SoftICE was active or not (the code is located. D6 p* l; u9 z* H
inside nmtrans.dll).
# C v/ Z7 q" r0 N$ g" F% y7 H! p8 Y& Y% v9 s* {& v+ k
The way it works is very simple:
S9 d' J2 }* cIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. e- x( L: B& C$ |) T5 P& v. \# NWinNT) with the CreateFileA API. ]/ X' F% H" I( I
$ A& c* p" I& ?$ F9 P
Here is a sample (checking for 'SICE'):4 L& p% Y$ Q" e, u+ G
3 K& Z: ~1 J, ?% ?6 @+ u2 b
BOOL IsSoftIce95Loaded()
4 ~8 ^. K5 S/ r1 U2 {( F{
% U$ s% n7 y, u% i ]% [3 v! X4 i6 n, s HANDLE hFile; & z( ~# d9 |( t: v* l% F
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' x& p+ J: B! g( m2 ^ FILE_SHARE_READ | FILE_SHARE_WRITE,
0 y! }' T! K, W1 ]; i* o7 V1 Y& } NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 V1 V2 U( D' A: j& W
if( hFile != INVALID_HANDLE_VALUE ): ]* z/ j* o" G4 L9 A
{
/ y$ B5 E* P/ {! B CloseHandle(hFile);
- t( }4 N5 ]: h B7 R5 t7 c3 [" T return TRUE;4 U* ]& ]3 g/ p/ S: Z
}
5 d! P- h D9 @/ u! w r return FALSE;
' \% q* Y, T0 L}
6 U7 B Q+ S. g9 s" l% q
' R2 j( E/ V+ L( _; cAlthough this trick calls the CreateFileA function, don't even expect to be1 p' t4 v3 I& g1 d& I; A7 g
able to intercept it by installing a IFS hook: it will not work, no way!# d6 ]0 D5 @$ z$ S+ `
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 x) v2 L5 z, Y- p3 Z; @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& t, J5 ?6 W. A) x5 a" @7 A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ X0 n; p1 A B- E$ @# y& G
field.
) l6 n* r8 |/ s) b L2 fIn fact, its purpose is not to load/unload VxDs but only to send a $ t3 L, V: u. n! s% T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 f- T+ z3 T' z( _. f2 b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
) Q0 M% u7 ?2 |to load/unload a non-dynamically loadable driver such as SoftICE ;-).
; s- `. o$ x& k$ _' s7 y0 o- \If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 Z( }5 {% J: k& _8 h% Fits handle to be opened and then, will be detected.
' b7 `$ n X, I2 u- e4 |You can check that simply by hooking Winice.exe control proc entry point5 M% ? U" X2 |; h7 ~
while running MeltICE./ T' V( R, u! T1 t
) d, s" B+ p9 C* C1 }$ o k
) l* @' \8 m# j9 ? } 00401067: push 00402025 ; \\.\SICE) ?# C( k H% [+ L/ A( w5 x1 Q1 H
0040106C: call CreateFileA2 L7 ]) F8 w" b5 N% B; ?! b+ @7 Q
00401071: cmp eax,-0016 ~& m) ~/ G2 M9 d
00401074: je 00401091
) `5 u( H9 V. i
6 G" i. T+ O( O6 M: ?& v* W' {/ \% e
There could be hundreds of BPX you could use to detect this trick.
5 d' ], o9 J1 p! `) l6 F7 ?-The most classical one is:
3 K: ?2 _* U7 l- w3 a ~2 `+ x3 j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& f( W. y. p) X; ~9 {2 |! s *(esp->4+4)=='NTIC'
4 u, }7 M# H, n* ]& L0 `/ O2 C# e4 q) c
-The most exotic ones (could be very slooooow :-( }2 B2 f( q" Z" x$ ^) O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) I- a, ^: R& b+ C5 N; O+ t" z$ J
;will break 3 times :-(' p& [/ r/ u+ a8 z- y# e
! F3 D4 @) o0 M
-or (a bit) faster:
, y9 n0 V$ D" R1 | BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ |9 P9 u) }7 c$ z( @" y& n1 f4 t
" c( l2 T6 o2 S BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, y) d2 R* o' s+ |& k ;will break 3 times :-(. ^6 o1 M4 A/ T
, Q9 \, ?6 S& V3 k- a0 f-Much faster:
! V. u1 j$ K. d' Z. A BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" V" } ~4 d* V4 F7 s) h2 H( R5 @) c Y0 c) |! C4 f* l
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. L4 N' x) o9 q) } n
function to do the same job:
1 n: Y/ Z2 w2 e9 G# W8 l) m: N4 T" W9 p# Q5 i& P
push 00 ; OF_READ D) h7 \# ~/ Y7 L S" _) |6 R/ v; @
mov eax,[00656634] ; '\\.\SICE',04 L& }. o) v" `# K
push eax- m6 v& M2 w, i0 p! G! }
call KERNEL32!_lopen
2 Q# O( ]# h6 y, S0 s3 {/ ?, F inc eax
3 T- i% I8 v5 e# ? jnz 00650589 ; detected7 f1 @) D0 C5 q' B; U/ l H
push 00 ; OF_READ
+ K) P- b( k1 U! `' J mov eax,[00656638] ; '\\.\SICE'- N. F2 k* t' v
push eax2 _" g, H: _7 E5 \
call KERNEL32!_lopen
% ~1 g" x( A! q% ^ inc eax% N |- y8 ?" J4 v3 i7 e
jz 006505ae ; not detected& o$ t X4 i# n& E
5 }( g6 H6 ?1 P2 h p* W3 d3 [! |& [- o1 A t5 `2 N
__________________________________________________________________________
, g9 Y, ?# v( N8 b! A
3 v2 k6 P: W7 ^8 l' w0 A; ]Method 12, H- {( ~7 O* T. _
=========( \1 v5 e2 M) m' q
7 W5 W7 y9 L$ f% YThis trick is similar to int41h/4fh Debugger installation check (code 05
0 M4 v5 | f' t. L5 q X& 06) but very limited because it's only available for Win95/98 (not NT)% v% S& R# e( \" {
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 i4 @& ~" I1 W: R4 e
" G9 a; E8 F, t: u% @$ i push 0000004fh ; function 4fh9 q0 T B, ?% K6 h
push 002a002ah ; high word specifies which VxD (VWIN32)+ y- K7 N: N+ V
; low word specifies which service
+ Q/ D- Q" l3 | (VWIN32_Int41Dispatch)# x, W/ t# M1 e% C' I& |8 k
call Kernel32!ORD_001 ; VxdCall9 t% s6 B; P _8 ?
cmp ax, 0f386h ; magic number returned by system debuggers$ {; v; h/ p- S7 U9 C9 q
jz SoftICE_detected" m4 g% L9 d6 O4 p B( V2 N% r
+ o' o" \, X% B6 d% k7 m, xHere again, several ways to detect it:
5 g! D( S2 z8 S$ `% @1 Q9 b, ^" {% y2 W# x I: c; [2 }. {
BPINT 41 if ax==4f
6 b' J% U p4 H" ]3 \% l- A8 d4 \7 `+ `8 U* ~' p1 S
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ Z& f: K2 I8 j9 ?2 V( a4 E# Q: I( N, l9 M3 Y0 [1 V M( r, U
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A r- J) L6 ]) m, Y# E3 x
; b/ w7 z. \" I& i BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
& B6 H, D& ~' s: m& p$ s8 h1 v1 u; m/ D# ~. O
__________________________________________________________________________
3 T V# a" d3 Z; A- r
" ?/ v, O* @4 {) g/ U# GMethod 13
% a6 v$ _! E. m/ L=========# r; e3 r. f, c i
4 d# C H) b5 N; n$ X
Not a real method of detection, but a good way to know if SoftICE is
2 _$ _) W% O" B& Binstalled on a computer and to locate its installation directory.
: m! a* n/ {& \5 a% G+ C SIt is used by few softs which access the following registry keys (usually #2) :0 Z$ e5 `1 M v
- v* I! L2 Y. G) O0 z! O-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, A, S/ d. L O7 m/ r8 O
\Uninstall\SoftICE
: P. h$ m; }, `, p* {* B: g0 |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 A* c: l$ t! b7 L0 j-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# w0 u v" z* M( h7 k$ ?" G( m\App Paths\Loader32.Exe
\; q: @; r8 {; L, [, ^
# n' {: n0 \8 e; [; A1 p$ }# b1 S) l0 F' Z6 X K# S+ I
Note that some nasty apps could then erase all files from SoftICE directory
) v' L+ }! s6 o(I faced that once :-(9 r0 R: c! M! R' y" d3 W
1 [' N) ~* I3 g* M( u% w$ w
Useful breakpoint to detect it:
3 B' E" L- j! P7 ~% B
$ k" ?5 r! O" Y5 ]& X* i# R2 s0 J( p BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. W0 r0 u( q( m! Y [8 _% Z1 h6 j. R" N9 A
__________________________________________________________________________$ c3 x% E9 K0 @9 m; A, i
9 i) }6 W! a* g7 }. }
s$ k; O" v! h" d) V6 b( `3 x
Method 14 9 ^5 u( L# e7 ~# h& p0 J' J
=========
* L* J' c$ N) `9 ]' w% j& x, g$ W* t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
" {, Z" Z4 q- z+ w- @: B7 nis to determines whether a debugger is running on your system (ring0 only).& O6 F& K% ?$ Y8 h7 b
8 g3 H0 e( c; X6 }+ D( H) x VMMCall Test_Debug_Installed
: R& E) q4 C! a, t3 d3 c je not_installed
" ?9 T J _5 T) h
7 c8 z" A+ N# l/ XThis service just checks a flag.
1 ~0 \2 g! Q4 x* ]% Q+ q" Y# [</PRE></TD></TR></TBODY></TABLE> |