<TABLE width=500>. h9 W+ h' J! o% Z e1 x7 _! c$ Y
<TBODY>( S0 }1 l9 B2 v# j2 }
<TR>
4 F" ]$ r" K* m<TD><PRE>Method 01
c' T: Z% {3 q=========
3 _7 d) q4 i, H5 b9 S* h; ^1 W! G& R0 @2 x$ |
This method of detection of SoftICE (as well as the following one) is& n# R7 Y& o. U% Y; H7 R2 T
used by the majority of packers/encryptors found on Internet.
! b5 j( G, s/ s3 d4 Q/ `+ LIt seeks the signature of BoundsChecker in SoftICE4 q# n- }* S) `% b" y3 P
+ C6 ]0 w, o+ r; Q9 d
mov ebp, 04243484Bh ; 'BCHK'
% K$ V' W+ P7 q* K( M' E# { mov ax, 04h
- f: Q- K; x8 M1 u. s int 3 9 M6 k( x4 D! M( l
cmp al,4
' A& O7 a/ [, O& G/ u q% x- M jnz SoftICE_Detected8 n& x6 |5 }3 b+ l# K. P
/ X: H( a' C! Y
___________________________________________________________________________
6 ?& Q$ M" v5 A9 F) o5 r
) L9 E2 y( ?% [4 ?% [Method 02
( q. f5 @4 z n- V' H=========0 Y( ]: x5 {+ W# c4 k3 ]# m
4 C1 z" Q. D4 B2 q+ M
Still a method very much used (perhaps the most frequent one). It is used {& X8 A# s2 p5 @* ?, D6 H/ A
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, N! Y. X! K7 ~* Q1 k$ V- V1 ~: vor execute SoftICE commands...2 s3 S. {0 ~' X$ g! X0 {
It is also used to crash SoftICE and to force it to execute any commands
1 j8 c- X1 K2 X5 j8 S) i# W& H(HBOOT...) :-((
1 |! m1 t' ~7 n- J
' t4 `: h* T+ w7 b0 I+ lHere is a quick description:( l2 ^2 g9 Y- K! j0 b7 |( T
-AX = 0910h (Display string in SIce windows)
4 Z6 ? ~2 r) r2 j5 p' O1 O/ a+ Y! Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! Y9 \' e0 h5 p% g7 U" }; s1 a
-AX = 0912h (Get breakpoint infos)
' G) u8 @: u U! A-AX = 0913h (Set Sice breakpoints) ^* N7 _/ M) I3 P8 V" U4 ^8 o
-AX = 0914h (Remove SIce breakoints)' m' W2 X3 a; j. L3 c" R( v
$ N. ]" R2 a+ W% U! }" a
Each time you'll meet this trick, you'll see:% b/ y' ?7 G* X6 {; e- |
-SI = 4647h, M# N* r' {0 ~( \0 U8 N. ^
-DI = 4A4Dh- ~" h. t2 \, B: A, | S! ~# c
Which are the 'magic values' used by SoftIce.
5 w. j! G- ^9 Q& h* fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.9 q9 O. o% r# l$ a0 p% k! ~5 a. U
, u$ H9 F3 ?% T3 o; S! i
Here is one example from the file "Haspinst.exe" which is the dongle HASP% j% M% ]/ s- q. ^, b) f
Envelope utility use to protect DOS applications:
h. d9 H7 [5 K& p _' P2 X* \8 m) P2 P, s0 e# h, M
- j" h3 g- j7 q) ]& r6 D4 F
4C19:0095 MOV AX,0911 ; execute command.
- b: P6 @8 e) O. \5 I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., l c$ z1 C. |7 a& F
4C19:009A MOV SI,4647 ; 1st magic value.# _% H" U3 T: O U8 P
4C19:009D MOV DI,4A4D ; 2nd magic value.0 y: t4 J) {( p4 ?2 v& i
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 @, D* }& x4 @" j, P4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) B" ~6 J- S$ X$ T9 U4C19:00A4 INC CX
& N; f, N5 @# ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 f. [7 ]/ U/ U6 F( i; Y" D
4C19:00A8 JB 0095 ; 6 different commands.
6 _6 x7 T6 b! G2 J2 W5 z2 n- K8 S4C19:00AA JMP 0002 ; Bad_Guy jmp back.
% L/ y$ q' F) E6 ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- u5 J& d! A- F5 [: f; B" ?9 z$ Z8 m* B8 u
# @6 w9 }# Q7 Q0 A( mThe program will execute 6 different SIce commands located at ds:dx, which
, a0 N n0 |9 [$ _8 a/ rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 i& Z2 h& R- N. ^) o# Y+ n: h, G
- H! c1 Z, N e, l ^* j, \1 ]* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 F& A* j B7 W, @
___________________________________________________________________________" n& W/ f( s7 G
, S- ^ M. J1 d, I: F# ]! L3 N: U3 a8 l8 R- {: P$ d
Method 03; M$ `/ ^( J; N4 T, m
=========3 m1 r9 U/ O& @5 Z9 c1 r3 N" F) v% @
' K5 B7 f3 E. ?3 l" h, [6 gLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 X. a) h' Y- G" @0 E
(API Get entry point)
4 P4 g: H X/ o* _
: F" j% M( o- _% ?3 m8 u5 W
' X4 @ z: _0 k- } xor di,di1 f" H! G: V9 V# X* n w
mov es,di. J& [3 |5 J. `' ?" j+ c
mov ax, 1684h : _2 @6 U2 d: _6 w, j$ c
mov bx, 0202h ; VxD ID of winice, m2 c2 i& f( O$ _7 @2 Q
int 2Fh
* [/ v! n4 ]: ?- w mov ax, es ; ES:DI -> VxD API entry point
. t' C+ Q8 H, }) M+ l) S add ax, di
# `. q5 z) |1 C2 r3 J test ax,ax: |& T9 t8 U1 W: F; b$ C) O
jnz SoftICE_Detected
( T- }; {$ Y! `7 l9 R
" X0 `* H. F$ ^8 J___________________________________________________________________________
; u' d2 ~: @7 i. v o9 S) v" A, I+ R; F @& W D5 }' H
Method 040 o% A4 |4 w4 ^+ E3 z! P N6 @! f
=========3 s% ]4 N/ ~5 _
6 {; _6 g$ J p9 ]" ~# NMethod identical to the preceding one except that it seeks the ID of SoftICE
5 h( K1 h4 v+ T7 |" T, M) vGFX VxD.
7 u( o0 _, |0 `' a
9 H0 R4 Y3 E7 t8 G: ` xor di,di l, S& w* d. V# k& u* U3 y
mov es,di
- M! Q% v: t* ?, T: R7 P/ Q mov ax, 1684h ; V+ U1 T) Z4 }: N1 M' Q, k9 O' D
mov bx, 7a5Fh ; VxD ID of SIWVID8 G' J% g: j: w7 i% _( n O
int 2fh
# n: P8 U" R {' o mov ax, es ; ES:DI -> VxD API entry point
* h+ {, p3 A5 ]( ^2 |0 ? add ax, di8 |- ^9 `0 ?7 }, c1 f% l8 x4 \
test ax,ax( ]& s2 T2 l# p# p o
jnz SoftICE_Detected
4 C0 S) v. e7 B6 u n7 \+ K; v; c
__________________________________________________________________________
. x2 l) O4 \ {& P5 k+ D" ^* t! W$ I9 X m( F% b
) f: Y J3 c4 r8 @. \Method 05
& D y5 B2 ^8 R# i4 M4 f \=========6 ~' V5 A; I) a
( Q, q: U* k1 k6 ~/ g
Method seeking the 'magic number' 0F386h returned (in ax) by all system
1 C( K) Y [ }debugger. It calls the int 41h, function 4Fh.4 H6 q) N8 E8 D/ j( G( ?( W
There are several alternatives. + K. U; l. w# F) ?/ C6 F# D
- ]! o: {" _8 g0 w7 [! e' j
The following one is the simplest:& \3 \7 _/ m' S `
1 ~1 l2 u$ A: d4 R5 S0 h mov ax,4fh
8 a2 e7 s. ?* h int 41h
7 N1 F+ {9 p4 l8 l$ t4 ^6 b# x: _ cmp ax, 0F386
3 ?+ Z3 W8 L Q: b/ R jz SoftICE_detected
- d5 P8 G2 w- \1 R, c0 Q
; u) F1 @) g) b- ~7 j3 m! X! Y- \% u9 j p0 x0 d
Next method as well as the following one are 2 examples from Stone's ' u" Y: q& l# m" u
"stn-wid.zip" (www.cracking.net):
2 k7 {) H- V K& L/ H: y1 b' O5 H; A/ J& Z3 x b% J4 B, E0 f& Q
mov bx, cs
$ _2 q: j# d1 z1 k5 X% C lea dx, int41handler2
% P( ^/ `2 s, A( h xchg dx, es:[41h*4]6 B* c/ k8 {0 h3 r' Q( Z5 |4 Q
xchg bx, es:[41h*4+2]* j. ]7 L8 u' r& t
mov ax,4fh7 b' F }( q( i- {" v
int 41h
% f- o/ M/ w+ s: c xchg dx, es:[41h*4]
5 r) T4 [' A: r0 v5 [ xchg bx, es:[41h*4+2]& @/ }! i+ q7 i" d7 _/ K4 N7 Y* j
cmp ax, 0f386h v# {& {+ C% u# ~
jz SoftICE_detected2 e) w$ E+ }$ p {5 e& D
2 N7 c" O D/ a4 t" t' r' j
int41handler2 PROC i1 B; U4 v% Z, z
iret
7 ^: B! F6 N1 }% a* Qint41handler2 ENDP( r( a, T! J, z* M+ J
- B, h* k0 V' ^" p7 }( m$ q
: w! h& C& e$ r5 p/ b* e$ Y3 M# l
_________________________________________________________________________5 j$ Y; o7 q' C- S; M# f
0 c$ H, E4 r8 S
2 Y& r7 l% d e) C6 L! f! ?Method 06: D; m1 N$ X* b% r( s+ W
=========
" c5 K8 Z' z$ K, G5 M/ |" Z# T3 b) [' Q: z
7 U9 j2 |9 _+ a; C2 n9 ]8 R2nd method similar to the preceding one but more difficult to detect:
8 V# `- p8 Y8 \
6 `2 b% S& F- s& M7 [
/ J5 s8 V8 B! B8 B/ k" X qint41handler PROC- E* {" B9 q3 v3 H4 W& Z
mov cl,al
' t# ^9 ^0 R2 t. F5 l5 ^# B iret$ @7 C. O* Q8 w
int41handler ENDP# W' ?: M. d3 I9 |
4 \! J9 a. Z# N7 z' }& [, {
. x( _3 D. O+ _) S% q% {. C xor ax,ax; j' {/ w- q+ w# G9 m6 r
mov es,ax" g% d; t; U4 N, w( Z+ ~! c& ~
mov bx, cs/ V: j) X# ^# [/ Q
lea dx, int41handler3 B. }6 ~9 i7 J
xchg dx, es:[41h*4]/ f+ h" T# `- E. e# o; q- t
xchg bx, es:[41h*4+2]
' w$ f5 S) N( Y+ q# v7 V in al, 40h; K1 h! n, \% Q7 O
xor cx,cx
8 Y" M b' \ i+ P/ ]. @ int 41h
1 d% x3 F: g) W xchg dx, es:[41h*4]' [0 Y1 P& e5 H4 [( ]' S
xchg bx, es:[41h*4+2]
, Q3 Z6 p9 a* u4 N. g cmp cl,al
7 h$ ]2 I+ m7 ~6 I G. _8 f jnz SoftICE_detected
1 g7 K9 e( W* H. f; i3 {* J* V/ |/ U" \! J9 G \7 Q! q% B8 Y
_________________________________________________________________________
' x9 R* |5 F; [8 p) B$ R4 X; A
& a) ?" O; Y3 K* h! ]! pMethod 07
, U( j+ j8 F5 v7 V1 r=========
$ w+ n- m% ?. Q/ p0 w& Y: B N6 J! \3 T! f3 s
Method of detection of the WinICE handler in the int68h (V86)- D- \: t4 a, S* {7 ^9 g
3 [; Q" i f* l9 i3 n mov ah,43h
! V" E8 [5 p8 E5 {! O int 68h
/ d6 O. F" h B# B cmp ax,0F386h
" M( |! M9 g: g; a+ X jz SoftICE_Detected8 {! P# Z' F, Z% p
" j3 L4 r: G$ b8 V, g+ Z
( R/ e5 n* @7 }" N=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 P5 l! X e; ^0 N! ? app like this:9 c9 _! _. l( x6 L
' L; b/ H) h( c1 x% P: u' A
BPX exec_int if ax==685 f( o$ t' w/ U# |2 ]9 K
(function called is located at byte ptr [ebp+1Dh] and client eip is
% H; F; P& H# t. L7 M, p located at [ebp+48h] for 32Bit apps)
4 K7 F5 Q0 K. u G/ G__________________________________________________________________________/ d3 A) l) O8 C5 t; t( K
8 R" X1 f4 j& A8 ^9 H6 ^8 ?' U3 ]
& z* ~0 X+ M/ e7 @- c4 _2 ?# T; U# ?
Method 08) r$ y$ C+ t% c) X8 m' O1 d
=========/ @9 o' C; m' n8 W7 _: C2 E" p
+ k% e& ?$ V4 b" ~It is not a method of detection of SoftICE but a possibility to crash the
- v5 E w6 k: Y' n# h8 N) [system by intercepting int 01h and int 03h and redirecting them to another+ u2 p1 W' n6 |
routine.% `$ E" B$ t! _
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* ^4 X4 t/ X0 r2 o9 c+ d( n+ M) J
to the new routine to execute (hangs computer...)) |8 Z1 Q# y- } C) `& o8 C
* A$ N+ a! C. t( I& q
mov ah, 25h
' j& z' e9 E( w+ o8 k mov al, Int_Number (01h or 03h)
* w {. l. A9 l9 @1 A; I mov dx, offset New_Int_Routine
+ z+ I$ H7 t- S, x) g1 k6 ] int 21h
0 a+ H: G" |6 F) k8 u* g) W% f: r3 m/ P% D$ ~; B
__________________________________________________________________________+ [$ }4 L1 O8 p D! x
7 n, A# t2 x/ w3 O
Method 09
' @2 _, l. L4 O: S% Y$ }=========, ?" T2 s3 a! g( X- e* ~) N( i
/ c/ B3 X9 q9 {& j, FThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 Y8 y( K7 t( D: M/ ~' f. kperformed in ring0 (VxD or a ring3 app using the VxdCall).8 d( U. p; l2 m8 u6 ~% Y6 {: z$ z
The Get_DDB service is used to determine whether or not a VxD is installed! R9 c! o# M& z c1 f( C' I
for the specified device and returns a Device Description Block (in ecx) for2 x0 O5 o/ `0 j* h Y
that device if it is installed.
4 ]/ B, l+ k. ?9 v' r) T; T" t
" q3 ^5 x5 {% ` mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" M' b. N0 ]9 i. P- |
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ O8 w/ H0 L0 ? VMMCall Get_DDB
6 [2 y8 v4 j! | mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! u0 I$ D4 g' _. s) M0 z3 I" D! F
& @4 P9 Q% {" O6 f; Z' a1 FNote as well that you can easily detect this method with SoftICE:
# Q: ` H) J+ W bpx Get_DDB if ax==0202 || ax==7a5fh
) E% r: @4 S( A1 B5 e6 x' L- ?5 U! R$ c0 Q# q$ d- _% W
__________________________________________________________________________
1 P1 y4 ]# P% d' l( h( K. P
( o k' L V' NMethod 103 Z; ] u5 _4 f) C/ K+ ~/ e
=========8 C% @/ _7 u8 Q* f: G
7 [5 W4 ^6 k, Q& u=>Disable or clear breakpoints before using this feature. DO NOT trace with8 _6 ?: w% ~ S' p2 f9 l0 \5 r* k, W# {
SoftICE while the option is enable!!1 `# L6 L( m! v/ i1 ~! C# Z; L9 I1 t; h
. `+ u+ _8 _9 K1 d+ k# M% _" fThis trick is very efficient:5 b8 W9 i% x- w$ I2 h9 H! g7 N
by checking the Debug Registers, you can detect if SoftICE is loaded
Y( }" {7 P% c G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) P7 p' p4 W. [; y" u1 I! z
there are some memory breakpoints set (dr0 to dr3) simply by reading their' M& V0 h3 \% n0 ]( C/ L! E
value (in ring0 only). Values can be manipulated and or changed as well, r. s" |, D3 e) p3 z
(clearing BPMs for instance)8 p9 B4 H5 _& [$ H1 I
" p3 A- p8 | n4 @& i1 F__________________________________________________________________________9 l6 d6 J$ `3 v# E7 z
3 X: k9 s% D' S( P7 xMethod 112 ?# v! g" I( T5 t* W
=========
) P5 R& r7 Y C3 h$ ?8 e5 q# k
$ }2 z5 B( _6 l4 H: J$ X6 K8 YThis method is most known as 'MeltICE' because it has been freely distributed
0 u% e6 V. U( ^: ]3 o% lvia www.winfiles.com. However it was first used by NuMega people to allow+ w+ @2 [: E* v7 h5 k, E
Symbol Loader to check if SoftICE was active or not (the code is located
! ^8 `/ B5 f( G) B9 ~( _6 m* ainside nmtrans.dll).
& o8 v: R5 O7 I# F' t2 @( Y
% c9 W r8 A* ?9 _% c XThe way it works is very simple:/ T5 ]& @; Z# s; n) }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 ]0 }6 }- k& N* u2 m
WinNT) with the CreateFileA API.
5 S9 F) M J' s4 [3 y
3 U% p+ x$ I W7 z3 ?8 S( \/ sHere is a sample (checking for 'SICE'):
. Y0 v2 M f: a
4 {& ?3 H6 A' A8 y0 |* i" D; G# wBOOL IsSoftIce95Loaded()
- x( o- k! C8 p+ `& \" P* m3 D) j{
0 B9 m( E9 i+ U" g" P" x( x* H HANDLE hFile; 0 F, J0 @) @" B" J! H# U
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; q. {- x5 r# C; T' W FILE_SHARE_READ | FILE_SHARE_WRITE,
$ U5 W" w8 A# I- w7 o! Z2 b NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) R" C. q8 S! R3 M! P if( hFile != INVALID_HANDLE_VALUE )
9 u1 G+ Z/ S9 m9 b* a! D5 [ {5 X9 y* X9 N" Q9 |2 @2 D
CloseHandle(hFile);3 a9 z6 a% d2 o0 p% g% O* ~
return TRUE;
0 o0 Z1 u( G: T5 T }
$ c, p: Y1 H* G/ N$ Y return FALSE;
! d/ i! h) K: f8 r! M6 P}' H$ M7 y0 ^5 p, `4 r+ u
- r; R. Z$ X1 \) q" L+ O/ z1 y# DAlthough this trick calls the CreateFileA function, don't even expect to be1 y! [! J) s" N
able to intercept it by installing a IFS hook: it will not work, no way!
* y- ?5 |% O5 i& y' a0 pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 O! ~2 {, b. d5 m5 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 @: A8 g9 O6 G" W1 O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. l0 z6 {$ h# Z7 Z0 U- Tfield.' O) L) G2 M3 M0 s( P3 b2 l
In fact, its purpose is not to load/unload VxDs but only to send a ) m" Z% f4 r' Q& r/ {( L
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 \ D: X+ t V7 S+ `! Z# v0 j* Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try0 ? E. D d, N$ g
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ s- v% D- v5 e4 Y, KIf the VxD is loaded, it will always clear eax and the Carry flag to allow& M. _; b6 d2 ~! y/ ^6 s* C& B
its handle to be opened and then, will be detected.) s) z, g0 E! u' Y' d6 D
You can check that simply by hooking Winice.exe control proc entry point
6 F: N- h% B% `7 C& lwhile running MeltICE.' j* _2 c% i3 G: s6 o* C
, S" D$ b* T A0 Y
7 q1 f8 @& P L1 l( O5 V 00401067: push 00402025 ; \\.\SICE( ^6 h( S2 U4 f8 N5 ~4 S- Q! T
0040106C: call CreateFileA& a, X; o9 l, B1 V. [# F
00401071: cmp eax,-001% @+ Q: n# i1 N
00401074: je 00401091& b5 Z, n8 z7 _2 O
0 \* K+ q; K+ g: L% Y" Y+ c3 R$ U- R1 \ o$ C0 o! K
There could be hundreds of BPX you could use to detect this trick.& _ |% \( z. P/ n/ D
-The most classical one is:
0 O- p5 q/ Y/ G W/ S ^% p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ B' O, n+ i# \4 s1 c1 N8 J *(esp->4+4)=='NTIC'
- z, d* A% v% P: T% Q% m9 O& C# J% N1 [) O2 X& k" Y
-The most exotic ones (could be very slooooow :-(
. m8 U. u: v- X+ s* H, W$ u, E BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 ^+ |" _. w4 T9 a
;will break 3 times :-(( A' a1 W# ?$ C/ z
$ I* a" m( y- j& K& w
-or (a bit) faster: # t! ]2 }7 Q4 V3 |. y3 ~
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% F7 D5 w$ I: G- E& }: E/ C5 N* T7 z6 J' H# R
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" |: a. e9 m' t, e ;will break 3 times :-(
& ~8 U1 |0 l6 E- q# s+ t% F. W+ }, o5 `) E
-Much faster:# x' C9 \$ s( d: C7 a# O$ Z
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( o) k4 O/ i" P3 e! }9 @
! }5 t! X/ Y6 H; l- M0 v. hNote also that some programs (like AZPR3.00) use de old 16-bit _lopen1 \# ~1 ]. Y5 p2 G2 H
function to do the same job:- y" l/ I7 x0 p% ~% `( F
# a% H2 e2 a9 c- P0 p# p- J2 ~' O$ J
push 00 ; OF_READ
+ o5 [: v* [7 y4 g7 C9 O. ^# b mov eax,[00656634] ; '\\.\SICE',0! w+ A' B! x* P) \* g
push eax
; F" K$ z# F; P: I$ t/ K/ L) { call KERNEL32!_lopen
$ X" \% ~' S$ J$ \" P; W. l& w inc eax
m! ]4 G7 s9 Z2 _# ~4 u- ~* H2 c jnz 00650589 ; detected. j3 U- M. G" P7 `5 Y3 m D
push 00 ; OF_READ
6 p7 e$ p. i' {0 w! F+ b mov eax,[00656638] ; '\\.\SICE'
0 P! [ Q! t) I1 x" r- K/ A6 L push eax
, j9 G- U- C* j9 M0 g: K call KERNEL32!_lopen
& l3 P# L' r8 ]9 G, M: x, Q4 b. \5 W3 b inc eax
- N6 D9 X* i7 e5 ] r jz 006505ae ; not detected; \# }1 l8 m( I: P
- Q: t1 M% x- x( ?5 o; h0 {/ f8 t$ i! g2 Z& I6 n
__________________________________________________________________________
6 m" S5 I6 R2 h. g2 r. u' s0 h0 G) n* V3 C8 Q F
Method 12
7 w, Q+ u1 B6 t6 n8 }( ~7 I" }=========$ A* @3 ?# j U& p K
( w- V3 O" V' t4 e1 Q ]& ?1 @$ LThis trick is similar to int41h/4fh Debugger installation check (code 05
4 [" u3 W3 B: H3 R5 t, Y& 06) but very limited because it's only available for Win95/98 (not NT)
2 ~- u# o! k7 L0 sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; b* c ?' f9 y' o' z2 B5 L4 K$ `& \: d! d! n( N
push 0000004fh ; function 4fh. V* N' J- o& `6 F( p& K/ R, ~
push 002a002ah ; high word specifies which VxD (VWIN32)0 ?4 C: k+ {# O. T
; low word specifies which service7 r8 a, {$ s |
(VWIN32_Int41Dispatch): M4 Y1 p# s: e4 d9 n& b' h/ n
call Kernel32!ORD_001 ; VxdCall$ L P! Q* q& U8 Q
cmp ax, 0f386h ; magic number returned by system debuggers0 U1 R! \0 Q9 u/ l& s
jz SoftICE_detected
* b) F" a5 ~ Z# \. Y9 E! y
* E! l% M) D2 N$ y4 V5 f3 G3 VHere again, several ways to detect it:
, m& s/ u; s3 w9 C, q* ^7 `/ y" C% j, O
0 v$ o9 x) f8 \2 L3 t0 j3 E BPINT 41 if ax==4f" S$ X/ ^3 ~7 h% j
, P% r8 P1 w" e6 O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 m1 K0 T# a3 A4 w* s
, _. D( S! ]4 o! C BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
4 K0 {9 z- \0 }% e+ N6 q- m0 E$ o5 S& o% I* S1 k& E, @
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 j. N) ^' I8 _7 H
. Q* n2 q. p* V9 I" r__________________________________________________________________________
* h; k( i' E0 Q( [& O* y( b8 s) }8 Y0 x2 k9 L
Method 13! Q' P+ `8 N* L4 h: d6 v
=========7 ~+ t* F" A3 S% L( O9 E
9 B/ e |% w& vNot a real method of detection, but a good way to know if SoftICE is
9 r# z* H+ I* d$ [3 I' I; ^( ainstalled on a computer and to locate its installation directory.
% y: p) C! a) o, Q) [It is used by few softs which access the following registry keys (usually #2) :! d2 ?7 M9 ~7 R! p
, n% M5 T+ i, T7 S- \# k# |
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, }# c' Z# E; h% V' e! O) k7 u
\Uninstall\SoftICE
5 _/ Q: n' _- z# N5 S* h! [, |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. g1 [( ] O& d" u2 [/ G
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- g _0 ]7 Q+ J9 \! H( @
\App Paths\Loader32.Exe
0 L8 }" V4 N- R+ D4 f: I$ H" z' B% F6 W/ B2 z
6 Q# R( A& @ p4 y' Q8 ]Note that some nasty apps could then erase all files from SoftICE directory; r- q2 F# J! \& @
(I faced that once :-(; b3 H* p; Z4 \5 R" G! m
" a5 O4 o1 r0 BUseful breakpoint to detect it:
( |7 s/ @$ J" n1 F) f; D+ q; j- M& b' ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'1 ?: E) l# T/ j* W1 k7 j1 V
# d8 N4 h. v. p4 G
__________________________________________________________________________0 l" P4 u2 S( P0 Y* }5 M/ h7 u
, k0 H' l* U3 Q* b
; B3 R6 i. Q3 @5 S6 h- }Method 14
6 a9 A4 d9 }1 i4 H=========
, b9 M+ t; W) Q2 `$ [, i+ C' u4 r& ?; V. f. Z# z3 _$ U0 y
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ ]9 r. c( }' X
is to determines whether a debugger is running on your system (ring0 only).
1 {! L- n* \7 o+ a
: m+ X* P @2 f1 g. } VMMCall Test_Debug_Installed
/ `9 x6 [* N6 `/ a je not_installed4 s9 E- b- @' A. H) d; E V% t
& ^' o# J% b' r* m* t+ [4 A
This service just checks a flag.
! T9 W! l P9 f; w+ i</PRE></TD></TR></TBODY></TABLE> |