<TABLE width=500>, z& s, K* S, W l
<TBODY>
7 e) w* v1 d$ h$ | t<TR>
# O1 A4 m& d" L3 \<TD><PRE>Method 01 0 l5 U2 m9 r' \7 z( I
=========
; P. V4 H5 A2 Y+ Z( X6 x- U9 t# x! l; x M/ `. d4 j% L0 A9 N R+ `; C
This method of detection of SoftICE (as well as the following one) is* V; }5 d& @6 ]
used by the majority of packers/encryptors found on Internet.' I$ s9 q) E" H: B$ N
It seeks the signature of BoundsChecker in SoftICE
- Y+ y2 b7 Z1 z% m# n S/ b6 E& B, Q( f7 \: g9 ]; _8 a7 c
mov ebp, 04243484Bh ; 'BCHK'6 P/ p% V5 W' F6 ?# V7 t
mov ax, 04h7 _) |( S8 F9 H+ ^/ p% [0 V \6 H3 o
int 3
. Z( _: C% B4 ^( e+ v9 N cmp al,42 }9 T D( Z- B9 N( u) K0 \
jnz SoftICE_Detected
+ ]$ X; H7 |& C9 r% I$ x L* w T8 S) T% K W1 n M; w
___________________________________________________________________________
" ] k3 c& M5 J u: [7 t8 {, t. S, k' D2 s. b j
Method 02* w- E4 [5 B2 t2 C# b9 V2 f- z
=========
6 Q- p: y G3 `
; V% o# }8 @1 q# z- W) vStill a method very much used (perhaps the most frequent one). It is used
% ]1 e0 `) a# Q1 b1 o: oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ R1 c7 ~' v0 n( K; O
or execute SoftICE commands...
5 ]$ `, ~/ y- I6 H+ S- TIt is also used to crash SoftICE and to force it to execute any commands
# o( B. C' ]% d7 D2 q. M(HBOOT...) :-((
& r# c! ]" [8 x$ D8 ^0 Q+ |& }. I1 a" e' m/ h
Here is a quick description:
. s5 f+ ^: A! A4 r$ G) I) b-AX = 0910h (Display string in SIce windows)8 S9 r, N$ Q, X+ {- \3 d, `
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 S7 ?* S2 m/ L0 M/ P
-AX = 0912h (Get breakpoint infos)9 W! I: N3 `3 {9 [
-AX = 0913h (Set Sice breakpoints)4 t9 m9 R0 u9 a0 v( {5 i4 }
-AX = 0914h (Remove SIce breakoints)- V4 X/ q! ]! S* t3 R% N1 Y/ {* n
6 l; o( X$ E; U9 g
Each time you'll meet this trick, you'll see:
* r6 t0 `9 {9 g6 e- N7 L+ [-SI = 4647h; U6 P2 T h8 C4 a; t% k# `- K( v
-DI = 4A4Dh+ Y2 n8 e: C. j B/ O
Which are the 'magic values' used by SoftIce.2 u# j# B. c1 H+ v% D( n' m3 N7 d
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 p0 e! c }. b- s3 R; b z' \ @; M
) H2 h5 m( M, ]6 mHere is one example from the file "Haspinst.exe" which is the dongle HASP
1 f- V- r) m E- ~7 d9 o3 p! }Envelope utility use to protect DOS applications:4 Y% w+ [. X0 q+ b: h! B
' f4 N3 l; D+ P; f" v$ \- V
) U7 [5 \/ v0 ~. Y' N1 ^+ F4C19:0095 MOV AX,0911 ; execute command.
9 e$ N! Y5 C* `4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ p0 S# `9 L6 J7 e4C19:009A MOV SI,4647 ; 1st magic value.6 D1 x5 D3 I, Q g; q# t/ r$ w
4C19:009D MOV DI,4A4D ; 2nd magic value.3 D- J7 t6 l0 p' }
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 @& M6 @, G) z# m6 h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
v9 M7 ]; c0 o, t/ d% v" j4 H8 J4C19:00A4 INC CX
. b+ o6 [; \5 t# _! v1 }4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ G6 A$ P" v* ^. N6 ]( E! [
4C19:00A8 JB 0095 ; 6 different commands.3 T9 g# C0 J1 Z; L, q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 D N- _1 A$ R' \+ `
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! h: z4 w% a9 ~8 I+ @" b
1 l3 u$ @3 j2 u2 N& _The program will execute 6 different SIce commands located at ds:dx, which
+ O/ o, H: E3 q8 W' q& k, qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 h/ G+ f; b$ T
5 P; {) V2 O" `0 S9 m; [; Z u* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- T9 f, g6 H2 @+ U7 w* p
___________________________________________________________________________, }7 i" |/ n2 \5 ?* C
0 j/ W' c& p! W8 t# z* V$ N' {3 H% i E- U& D$ O% N) G# m
Method 03' A8 f* m2 S; L9 W: `
=========
8 [/ Y' F! b6 g1 M7 Z$ P
) I. i% M* S: s8 T3 L: X; cLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& I- X. \' j/ J: q! p- u0 Z: c2 C(API Get entry point)
8 N; a* y3 q5 S+ l
* I! ?: X8 l1 ? N$ u2 }2 V6 N) k( @# v5 U
xor di,di, y# o1 ~& \; F3 z
mov es,di
, G! {- k$ s. j6 U( a* v2 F. P mov ax, 1684h
6 m- c6 ~5 |, F$ H8 Q mov bx, 0202h ; VxD ID of winice* Q) p- M, y( j5 h& s5 t& S
int 2Fh
. n) ^, d! e A* R8 F$ w% I mov ax, es ; ES:DI -> VxD API entry point
! M: l/ s0 B [' l5 O$ R add ax, di
# i9 Z5 q& f U8 q6 `& A test ax,ax
: p, V7 G- T8 _ jnz SoftICE_Detected
# Q+ K- U9 [& ~$ M
2 g1 Q: N o: s___________________________________________________________________________
+ |9 p3 K* X* \1 N' n% @+ L2 h& y4 i! c/ f% R/ v$ K
Method 048 n9 {8 J; F7 o9 t
=========% c/ w5 N+ Y2 Z
' {+ ^4 N* \4 ?2 Z0 aMethod identical to the preceding one except that it seeks the ID of SoftICE
( P1 g/ ]# v# l K, F7 L0 rGFX VxD.
- g( ]- T5 x& H0 s) @# y( _& I* i( Z; {
xor di,di
5 \8 x+ S: O/ G mov es,di: ?; k- \2 H4 H ?
mov ax, 1684h ; o. r. z6 U) ~4 J! V
mov bx, 7a5Fh ; VxD ID of SIWVID
* x6 `! \7 R } int 2fh
% D3 b. a. z2 e: X mov ax, es ; ES:DI -> VxD API entry point
8 R, O" _' a! o4 ^7 J+ e add ax, di
! J7 \( J4 ~9 I0 P( k$ f) P. d' O test ax,ax
1 S& d. k! j5 ? jnz SoftICE_Detected9 h- |; ]* l5 d. y- Y$ i
% \) J+ |4 h% ~5 F% Z. Z9 a1 g__________________________________________________________________________
; U! s5 \) q) K& K# K- ?
3 ^! E V" s9 c6 d/ x
' X* ]8 e" n( R# _9 W+ P4 `Method 057 {; j# }9 n. W, |. z2 r+ D; E. r2 w# M
=========
, d. N4 t. K+ H! M* B, o& _# I2 i5 A
Method seeking the 'magic number' 0F386h returned (in ax) by all system' Z2 ^ E& O/ z+ F) O& ?& x
debugger. It calls the int 41h, function 4Fh.' N7 W9 s1 T& `: t' }' m) k) A
There are several alternatives.
" @& ?" n) b ~9 j* u8 v, g% u' D
2 j1 G5 q/ w/ N. g; N7 c' RThe following one is the simplest:1 y, _8 ~# W* A! v5 S* u
$ O; ?4 I( x1 ^5 p: L mov ax,4fh
. U7 }. l! z: N: M& p+ U int 41h% o, o- l6 ~ u5 v+ }) V
cmp ax, 0F386/ h0 U5 [! }. X: W
jz SoftICE_detected
7 s, l+ s+ E6 D4 A9 A7 p9 t3 d; L6 y/ E
1 Q$ O! i; ?' ^
Next method as well as the following one are 2 examples from Stone's 8 K' X5 s) I$ }# a. U! E) r8 G( n
"stn-wid.zip" (www.cracking.net):
6 n( x9 O, d' u0 U l; d. U7 e: Z8 R0 m! Q7 W
mov bx, cs
+ E0 t+ N. x* V: Z" n( N0 | lea dx, int41handler2
0 m0 |5 {3 y7 E j& v1 P& U8 h3 ` xchg dx, es:[41h*4]' ?+ ^# }3 H% a8 Q0 x
xchg bx, es:[41h*4+2]
4 `& h0 f# ~" r) d7 [8 W mov ax,4fh
; D! F5 N! A' @% e int 41h
/ h' E$ {0 N5 W xchg dx, es:[41h*4]
v. W) A; ~# y0 h1 k xchg bx, es:[41h*4+2]
( k, {: k. S( V cmp ax, 0f386h
* M3 d9 u: G! _! I" C! k& o8 K) d6 q jz SoftICE_detected7 f$ h' q1 B% q) L5 I
4 I" k0 s4 R) ^ }- E1 O- d: [
int41handler2 PROC
3 L% e; K" ~- H4 _6 k4 D2 x0 @ iret9 h: l- l) z4 e5 B( N. u
int41handler2 ENDP2 `7 I: \8 y: F8 E6 V
: l, }+ o( r& K# K1 g8 d) W) x# R) ~
_________________________________________________________________________, b) B! {" U, a* b% X3 Q
% K- ?3 y* i: j/ d0 [2 n
: M0 a+ q# ]6 z9 E! d: D" W
Method 06
N$ z0 O, G$ p' v5 a9 Y=========
6 a4 m% n+ A4 z! W- h( d$ Z! D) H, j/ s, I0 P; Q+ w4 E; w, g
. I' w" l$ X$ f8 P2nd method similar to the preceding one but more difficult to detect:
. x& H! I( h. G3 O* h- K7 ?6 Y& h
* T: J5 j' J* Y5 ~5 q
8 p2 I) Q* I9 Y0 z7 }5 Rint41handler PROC
/ x, {" t* v* L6 G& Q3 V) R: z4 L b mov cl,al, B& y/ D* j" j0 w K5 y
iret, O2 |( E* ^3 \ J
int41handler ENDP
0 j5 i8 t3 U/ H" ^7 R( E
7 m( E- ~5 K9 V! d: _. b. o
) ?1 H! O+ O5 U xor ax,ax
0 T# q- _- S8 ]& o mov es,ax
( f/ a! N3 I. G0 s T7 K mov bx, cs
# e G8 j+ s; Z. L7 L lea dx, int41handler9 z/ c5 Q# ^6 k3 m' o
xchg dx, es:[41h*4]
, e2 s3 n6 I/ V$ @# ~) \ xchg bx, es:[41h*4+2]$ T, r" s m' h, G
in al, 40h
. i2 R% D* Q5 k) x* A xor cx,cx6 E g5 A& z" Y! O; N, a/ [3 s$ m3 ?
int 41h
1 l, ^* W9 S: s. k xchg dx, es:[41h*4]& n+ L% y' m+ l4 s9 x
xchg bx, es:[41h*4+2]8 |: _* B3 B1 K* ^! Q0 T' o
cmp cl,al: q( J/ ]: v' H" L: v5 Q' J) ]9 f
jnz SoftICE_detected
5 `6 r; s$ U- X# M: `
c1 X; w( _0 m' @# j: E_________________________________________________________________________) x# x* ?, p, k' W6 Q) a$ \
9 ~8 p2 \; |+ V* {/ s( iMethod 07$ ~; k; q; p& S+ i8 a/ ^
=========- T& z1 ]2 Z! h: z6 C, a) @& O# I
' Q5 o; u2 _9 C* q& U: \7 J8 TMethod of detection of the WinICE handler in the int68h (V86)! P- g; ^( \5 M' j3 L$ M
: c& ]# {- g2 o" x; t4 a/ y mov ah,43h
+ \& x: P. f* A4 _4 U' I9 V int 68h" H) t% E+ ]/ i% z. A
cmp ax,0F386h& ]# W+ q+ o W b. i
jz SoftICE_Detected
. M2 X7 X) R1 p: \6 a+ y1 a1 x* I) \% }6 |9 U( f; q$ ^( V! a
( P c) l# p" I q3 c- h8 m=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 r8 Q7 F; V; p) ?5 b
app like this: S2 e8 p' q; ? d1 Y ^$ e \
: C! L7 p3 d6 _$ q* ~5 C
BPX exec_int if ax==68/ v1 A7 i5 h2 C" m
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ Y% n1 r) ^; q9 }( z located at [ebp+48h] for 32Bit apps)! Y# a* q$ O6 b1 T% D" \# W
__________________________________________________________________________
7 }: O2 C+ Z" B" L) ~5 e$ z0 P% N. T( J# M8 \/ W
! O7 U& t8 Q; T; GMethod 08
% b s# S8 D2 I; o=========- l$ V2 n) x* v. Q( D+ _
4 G6 i+ [% R+ @) `, @
It is not a method of detection of SoftICE but a possibility to crash the8 j% c5 @8 R' f2 b; ~
system by intercepting int 01h and int 03h and redirecting them to another1 R( f+ X9 e4 T6 J4 j, d3 b
routine.' W9 v. s5 P, R, h
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) T; b! z' V' b* \to the new routine to execute (hangs computer...)- D ^! A! N" _7 k6 `: m' K7 X
) c( n; t& L7 x( S8 |
mov ah, 25h- e% F3 r7 f- Z5 w1 a
mov al, Int_Number (01h or 03h)
. f- b0 F, J0 b2 v% ]+ O* }- f mov dx, offset New_Int_Routine
0 v: m4 S# w* V8 z, j+ X% _0 ? int 21h* I' q8 [5 S9 |2 p7 e
# ?5 ]8 _* X1 ?9 i: J& P( b__________________________________________________________________________
& p, f- U5 |0 W: t! D4 c, Z1 r& m- u; R7 u' K7 ~9 g' ^
Method 09
' N5 L2 L4 B$ n=========
$ @% ]! s: f- Q* {. S, R3 D. P m5 b4 W- w) e9 H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' @" s8 u- t; Y0 o8 I, q
performed in ring0 (VxD or a ring3 app using the VxdCall).) t0 O% F/ D2 |# m) Z& N
The Get_DDB service is used to determine whether or not a VxD is installed# ]8 e& x% U7 _1 M5 a1 u
for the specified device and returns a Device Description Block (in ecx) for1 s# p2 F- U( K
that device if it is installed.
4 \ E% t- Z! T2 k% g2 K, }2 g' M& |. d
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID* Y0 d6 G B, j
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 f, \: s6 x+ E0 O
VMMCall Get_DDB! Y$ [+ `, [( ^1 V9 u2 M
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: n% Z, d' I. f2 z- G9 |. N# E+ d) k
* v- w/ v+ Y- v& |, Y; bNote as well that you can easily detect this method with SoftICE:
' P1 t( R: V% X3 B; s3 y' m bpx Get_DDB if ax==0202 || ax==7a5fh
. P0 t( f& M6 Z! I. s. A7 D/ m4 |1 @% ]& X3 g+ x+ t+ i
__________________________________________________________________________# K- i$ P' |# |% q5 Y$ j
' w, j$ J1 q) `! w' N1 \
Method 103 I' k7 \1 ^) `+ N% |
=========, e0 `7 e8 T) Z# }* ?* Q4 l8 o
& G' z! G4 u; G0 e1 o6 j=>Disable or clear breakpoints before using this feature. DO NOT trace with) D! y: r: o; \4 B$ H# w6 U4 t
SoftICE while the option is enable!!5 Q& G0 F+ W* d/ j. \
3 M9 z# S8 ]7 ~% s% OThis trick is very efficient:( i. \( O! R. \9 j9 e
by checking the Debug Registers, you can detect if SoftICE is loaded
o& C1 H; E' u6 c1 t& A: D$ E(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( j' }( n! S( M( e) E) K& e/ Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their* _5 J$ j4 L, v% i4 Y# @: t
value (in ring0 only). Values can be manipulated and or changed as well6 \- T. T3 o1 ]" n; {4 M
(clearing BPMs for instance)
v j- g! m, R/ C% N* B4 G
, M" u! _+ R; U1 `# `2 Q+ X__________________________________________________________________________
8 L. R+ O }% h8 h
/ w, V0 v) r2 _2 d3 n1 YMethod 11
5 _4 }- I+ g4 v; w; V( x/ x% ^=========
' d* |" z* A6 C! B0 ~) p* C6 Y: P4 p0 h" i! `9 O9 ^6 E' p0 \
This method is most known as 'MeltICE' because it has been freely distributed
$ P) [" L6 V) y- @; o) Q% w; {via www.winfiles.com. However it was first used by NuMega people to allow
6 X" I; n9 i+ Y+ p& lSymbol Loader to check if SoftICE was active or not (the code is located
& L' c. A' V; O- D5 r4 J" V6 s+ oinside nmtrans.dll).5 E- f. i6 U0 [1 G
6 ~0 m, O& N- W
The way it works is very simple:# a. J" p9 u& v0 L* i' D2 _
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for, i8 ~% g( Z' w! o6 X0 Y, ]
WinNT) with the CreateFileA API.# A& u( {; t9 j' q7 q; B
6 o Y0 f# M. J4 dHere is a sample (checking for 'SICE'):; K6 _& E9 K6 D% j' o; n5 b3 |
3 j# g% @, S6 y$ k5 M; h
BOOL IsSoftIce95Loaded()/ P+ G9 B6 y) C1 y0 s
{" b8 g8 {" b& a9 l. {- Z; u
HANDLE hFile;
! u4 c2 `' @8 {* s, n' x hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' H( Z% H/ _% X9 O. A0 ^2 y- K FILE_SHARE_READ | FILE_SHARE_WRITE,
+ o% z* p( s. Z: m: l NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# Q* k: Y& ~+ z. j$ g0 x9 F
if( hFile != INVALID_HANDLE_VALUE )5 p9 x; ]# w# Y9 a6 H; C6 y
{
" W* D- A' ^: X( Q6 i- \ CloseHandle(hFile);
! f) @4 }. E6 l6 P- w9 e% b' V) E return TRUE;) m% \, z5 q! T3 G. O
}3 L: J' h( q) ?0 q+ d, d
return FALSE;
$ q4 Q7 h' k# f1 i# j}
7 Q8 V* |+ O, B6 k$ |& S' b9 M; i) |4 e9 O( P
Although this trick calls the CreateFileA function, don't even expect to be: z. l4 W9 O7 z: n9 }' x
able to intercept it by installing a IFS hook: it will not work, no way!
0 v" K, c# R0 }8 MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F. \' s/ I+ n6 z( ^. p F9 e. W
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 |, K7 N1 ~! u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 h0 R0 i. }+ W4 r3 X5 W" J
field./ m. ~7 Y1 h3 V, s3 ^+ \2 a
In fact, its purpose is not to load/unload VxDs but only to send a
/ h# w5 h9 U9 T9 C- o- xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, W& @9 b; t4 i! dto the VxD Control_Dispatch proc (how the hell a shareware soft could try1 {4 q* ?; U; o+ b
to load/unload a non-dynamically loadable driver such as SoftICE ;-).7 F% n9 H% Q0 U
If the VxD is loaded, it will always clear eax and the Carry flag to allow
% j* q/ {" h/ p- P+ M9 V2 Qits handle to be opened and then, will be detected.- O7 Q7 z/ I* ]4 J! V2 z
You can check that simply by hooking Winice.exe control proc entry point
0 k. Q+ J2 i1 a7 ^, f F5 i( J0 Gwhile running MeltICE.3 f: t7 [2 c& J9 L. i
8 w! V2 X* T; i7 L
l* U" _; c/ Q$ h7 ] 00401067: push 00402025 ; \\.\SICE' }* U! T( i( `1 h8 B6 k. N7 x- e
0040106C: call CreateFileA \6 Q' \2 `8 `2 Z; [- s
00401071: cmp eax,-001
i1 H8 h" Y) Z# j# ]( | 00401074: je 00401091
5 }: S# j. |! t, E9 \( T* j
1 K. i* {& e0 x8 d$ D) T3 o8 u
! O+ o* M* U! }" f0 kThere could be hundreds of BPX you could use to detect this trick.
) o# I( v( V0 o8 m, C8 k/ o-The most classical one is:
0 O9 X4 B8 |4 B) G BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||1 H7 \# @* K" h+ h6 c
*(esp->4+4)=='NTIC') ~( j& Y: X2 ~ O" |2 o, C
/ g' R# u, k. f+ k: A
-The most exotic ones (could be very slooooow :-(4 B; ?- N) F) N7 I9 h
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') + c& }% C5 s% _
;will break 3 times :-(% b3 ]! S2 u4 q
5 f u$ T- e" q+ o5 F4 b8 V
-or (a bit) faster:
, A# O! E6 a1 e9 c3 g, i% ^! B8 I1 B BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 c& A" K/ i7 @
* d. v5 O. D) P+ O8 A& ~" [" c BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + |, s% L6 i& l( D8 `
;will break 3 times :-(7 P, T% j1 @! a2 `; `
* G3 x" b" [% B1 E8 r( L-Much faster:+ A! m( e& X r+ F: ]4 v5 |
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'1 Y ?5 ?+ ~1 U
1 ^/ a! g! o) ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 J2 b) h1 v T8 H0 {6 S) T( qfunction to do the same job:
% a7 P- o( Y! M
- n4 a* V! }* f9 P push 00 ; OF_READ
/ T' E8 @: ^' s" E mov eax,[00656634] ; '\\.\SICE',0
0 S+ @% u0 A' M1 N5 X! ]- A push eax
( U$ R; d0 j# H! u4 z/ Q call KERNEL32!_lopen3 z# a/ l" y# o7 b9 Y7 u+ P7 C$ k
inc eax9 O6 Z* b; L8 ?& p) Q
jnz 00650589 ; detected
/ J s Q* m' v4 ]" B push 00 ; OF_READ
, K( _/ Q$ V! X2 P# I" q" ~9 w mov eax,[00656638] ; '\\.\SICE'/ i5 ]4 F, [7 h. T. W5 F! J
push eax
1 e1 _" R4 p$ h+ B5 I3 z" S) _& T call KERNEL32!_lopen
7 M9 g/ u9 S' A+ p& v5 I( t inc eax
- i7 T' D; ~8 Z- t3 Y6 r jz 006505ae ; not detected& x' K8 H4 g6 M0 I
6 y; a% e: L: `" g9 T" r; I
1 g) `3 b( ?$ h# d* y7 p; E__________________________________________________________________________! x# t1 j0 f5 s5 o3 J# Y, Q
: o5 Z: j( J$ p! O7 ]) x8 e
Method 12# M1 ~1 H* Y( n9 G o. Z, u) R9 E
=========
$ b# s4 P0 x( y
; g9 O4 e& F, R; U) JThis trick is similar to int41h/4fh Debugger installation check (code 05
# c& Y: i! a! w6 S' X& 06) but very limited because it's only available for Win95/98 (not NT)
0 |" n+ b* G3 G3 Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo./ r1 {- Z4 N7 t. x) f, _
7 R2 F5 Z5 V" N push 0000004fh ; function 4fh" s1 ^1 c6 _ w) w7 R' b
push 002a002ah ; high word specifies which VxD (VWIN32)
% q" e0 M1 _$ E0 R# j- p ; low word specifies which service
1 E, s/ w( |% b+ ]) M s (VWIN32_Int41Dispatch)
+ X# |2 O/ G( G; W call Kernel32!ORD_001 ; VxdCall
$ o; [! M5 O* T5 W cmp ax, 0f386h ; magic number returned by system debuggers$ L: Y7 ]0 L9 ~6 R
jz SoftICE_detected
+ ?! r1 Y+ u+ l! r* E+ X$ @
4 s- R9 B7 k. {Here again, several ways to detect it:2 V, _4 c/ y1 L6 S
7 M3 P: ]8 p# D) u/ W
BPINT 41 if ax==4f
' X+ n7 _3 j+ e& y. z
$ p" B4 m& o! u; a: S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
# | h* J2 U- i1 y( b( }
% y2 C' Z5 J+ j# _. @( p2 e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 @( T% T/ t; J. h/ `0 N6 u1 d, d8 A9 F/ G
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) y' U# @4 R2 I2 E5 T T
( t6 {) q! X( I" p7 V9 W__________________________________________________________________________# A! ~) z" c6 {8 C1 Q1 ^9 k
, Z3 S4 S5 Q- P4 L. r0 I' F
Method 13- Y5 r% l5 ]& M; V `" y) {! ]
=========
; a* M' Q2 d% E8 a9 w7 ]( Q1 f& e5 ?' N6 O
Not a real method of detection, but a good way to know if SoftICE is
$ q5 z( O6 \( b V2 m7 {# |installed on a computer and to locate its installation directory.
+ b1 a4 ?0 J5 b/ |; l5 SIt is used by few softs which access the following registry keys (usually #2) :* H) N- R3 B2 F! D
8 \' o& c' l2 a-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' ^; k0 e1 ]3 V" [" _8 k
\Uninstall\SoftICE* m6 }2 s0 y& u' D8 r% Y0 M2 @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) f9 ~; O/ _- ], Q2 w' N) X- S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% S# o2 d0 M4 k6 m3 _
\App Paths\Loader32.Exe
3 ^3 @6 p, O" Y! ~
1 H) \& @% F& J1 z/ U( |6 T1 z8 l9 P" `
Note that some nasty apps could then erase all files from SoftICE directory
% u9 t' U/ I+ F' t, ?6 n6 N4 |4 }(I faced that once :-(3 e# a# O; J9 r% I1 |6 p
3 W% q' Y d; z" F5 A& ?1 \ EUseful breakpoint to detect it:$ y+ I% g5 m+ {7 ]) Z8 l
. P4 p" Y. k4 ~$ `3 Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ ~/ } [0 I5 I; j
9 t. k4 v9 D4 q3 q9 p( \* N__________________________________________________________________________3 B% y9 S# C" b
8 X4 \; ^, B! R# @7 d8 z
7 a) \! J, s$ X! c9 h" k* g- K: v
Method 14
; P; n1 S0 V" y% T=========
" l( m& Q7 I$ }* b& r5 S) a$ d8 h' S! P' T& j4 I, w; D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# y3 h; _5 F9 ?2 s8 C& c
is to determines whether a debugger is running on your system (ring0 only).1 \. s: _; Z: t
# z4 L0 k7 \4 @1 C t; H$ p# Z7 Q
VMMCall Test_Debug_Installed
! `* I8 L3 n& Z! Z, ]$ h je not_installed
1 g; e7 C& \! F% M2 x$ ?. P2 M; I$ K! j; A3 W" z) W" P
This service just checks a flag.
2 B6 c8 n" O7 l; Q</PRE></TD></TR></TBODY></TABLE> |