<TABLE width=500>
9 C7 a' f$ x: @) ^2 h2 ~<TBODY>
8 k3 ^- C! @8 p& c( L- ~<TR>+ _1 p# W1 O* [- K# B9 P/ k
<TD><PRE>Method 01
. i% x2 W, f7 M }=========
$ N& d; X B) T, B z2 p
" E; ]& n1 J: gThis method of detection of SoftICE (as well as the following one) is3 z3 g9 w( |6 u# M3 S" [1 j
used by the majority of packers/encryptors found on Internet.
& @ @% l! r# D* J- ~It seeks the signature of BoundsChecker in SoftICE9 L6 g0 x! N$ ^; z) m& z
0 n) Q7 _. r- O6 J% h
mov ebp, 04243484Bh ; 'BCHK'
" D% J! ?! W5 ]0 [ mov ax, 04h
( e3 L& s( n1 {: d+ F/ D1 G& P) C( P$ U int 3
! n8 ]/ f& V7 Q cmp al,4
0 e) E3 _# X2 a" ? jnz SoftICE_Detected$ k% E K0 m1 `# b' q' ] ]
; U' X O/ q% M) O- X0 c) _0 o/ ]___________________________________________________________________________; d% R6 d8 T# M5 E0 q; B1 d
1 |$ m5 R6 w2 ~( ^+ u
Method 02
4 q( {' A& t' M=========, p- S$ }: O& O( _
9 q( E8 D5 V2 z
Still a method very much used (perhaps the most frequent one). It is used; a# z, K$ f6 }: J, x! x
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 V0 I7 H: W- ?. t& m( E/ E& W: wor execute SoftICE commands...
9 m# R" p ^) n# x; Y* bIt is also used to crash SoftICE and to force it to execute any commands4 ~* {: K5 Q5 ?4 |) W7 r. C
(HBOOT...) :-((
0 |% f! m% k7 H8 W% b
5 `3 P/ q; G/ z2 U% x0 V6 N; RHere is a quick description:
5 M* h+ Q3 D! N8 c9 V- g-AX = 0910h (Display string in SIce windows)/ t3 V$ G. \+ ?" D; ^" K
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
" ]0 V: o) v$ }% x-AX = 0912h (Get breakpoint infos)
& E' @8 Q1 f0 o2 ^-AX = 0913h (Set Sice breakpoints)
8 J; v" K0 F4 u1 Z6 } i-AX = 0914h (Remove SIce breakoints)
: l; W* I ]! `' K3 Z8 U0 `
6 Y& K* X j7 aEach time you'll meet this trick, you'll see:
# I& P" |% H' E% S5 E/ Q-SI = 4647h5 Q$ D: K4 R% U( x5 }; w% b
-DI = 4A4Dh
1 k6 N8 i2 i* B' f- T. l% I5 BWhich are the 'magic values' used by SoftIce.( k8 b) R' v3 L* r9 |* K3 d0 Q1 I
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- i( b4 ^3 H/ i1 R9 G% \
& S# K: A" ~: XHere is one example from the file "Haspinst.exe" which is the dongle HASP$ N4 }3 e! d' s" h2 w' N
Envelope utility use to protect DOS applications:7 F/ l0 a8 F& r a+ ~
5 _8 l1 F. x" E+ A; j" f
x% ?' j9 m; K! z4 E
4C19:0095 MOV AX,0911 ; execute command.
* ^1 ^- J; K3 I+ G# n4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)./ m7 s/ B4 | @6 V* m% A0 q1 d
4C19:009A MOV SI,4647 ; 1st magic value.
" q3 Y+ x0 ?7 s6 d4C19:009D MOV DI,4A4D ; 2nd magic value.
$ g3 m3 V- t; d8 O) @ h* t! m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ ~* n8 j/ }& d2 T8 [, d/ D6 W1 C4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! Y1 c% C. |$ B
4C19:00A4 INC CX
5 V: _! t K8 p# e7 t9 ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 m, _# g- V6 Q7 x! w$ p( X4C19:00A8 JB 0095 ; 6 different commands.4 F$ P3 o, }$ S- l$ Y" W
4C19:00AA JMP 0002 ; Bad_Guy jmp back. h: m# P) q+ T: U
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)3 j, [& S: A0 _
9 m, B3 b* c% @! T& o& JThe program will execute 6 different SIce commands located at ds:dx, which
" ]' q7 L$ `; w& mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.# u& c: Y S/ I) _ C& ]
1 S4 \; q: ^5 T9 M8 n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ v8 \' n9 ]6 C+ I0 v/ @& \# \% @
___________________________________________________________________________
) i) N4 A9 H5 m8 V
6 Y2 @0 f" q r
( |" `$ u. ]* o2 T& A' WMethod 03" D1 M, R0 a/ U! U6 y/ |. E# B
=========# o- r3 ~# j4 c7 v1 |2 Q3 |
7 A* H1 r* g, e: s! a( `
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 L# k, l1 e( W! g2 L$ o- ?(API Get entry point)
7 h) a! N3 K; s" n; v( p! b
' F; T* W' A/ x9 x; e: o8 }4 }% l/ m8 u4 g. n
xor di,di
6 ~8 i6 v( w! R" p; L9 D( q8 u mov es,di
: N; ]3 v7 g9 w# q9 p mov ax, 1684h
3 y! M* n4 k+ p9 j I/ K V mov bx, 0202h ; VxD ID of winice1 \$ X/ f v- d! A8 o4 r$ K
int 2Fh
! c8 {8 Q. i$ b2 W6 n: b; r0 m mov ax, es ; ES:DI -> VxD API entry point/ q. }1 x. c- \3 r
add ax, di% l( b4 H4 ~$ ?( N
test ax,ax' w! m/ s( I5 n
jnz SoftICE_Detected
; Y, `# |! Z" P$ [& T: y/ c" B8 F2 p0 }# J# \. b
___________________________________________________________________________
" \1 Z; T0 H6 Z0 n) D: _& w' p$ ]/ Z5 a. \8 \9 L7 e% V- e6 j" h
Method 048 B5 F- N3 L4 {# {
=========# I t$ _! q/ F' E0 U. ?
7 N5 v( d( X3 U% N" t! dMethod identical to the preceding one except that it seeks the ID of SoftICE
' }- ?( [8 A/ a6 N" [1 ~3 GGFX VxD.6 E! Q& K+ e, z. l5 ^- {8 Z' ]
" B2 e- c/ n0 @0 N
xor di,di
. o2 F2 I7 u# q- { h0 F# Z mov es,di
$ g1 X$ O2 S- L! k4 F mov ax, 1684h , B9 r( `/ O" o; K; \
mov bx, 7a5Fh ; VxD ID of SIWVID
B5 k/ A! j+ n0 n8 `' Q int 2fh# \+ R3 }0 _" x
mov ax, es ; ES:DI -> VxD API entry point
5 [: W# P+ E# p: Y h2 t/ V add ax, di
. `, Z. q+ N1 f' K9 s test ax,ax3 `: l6 E7 b L% _& H
jnz SoftICE_Detected
& t# q9 t0 S5 L. h- E- \( p! O+ k# o2 X0 |, d7 Q
__________________________________________________________________________8 ^4 u9 L U3 W& r0 T
$ v3 Q) k+ |8 N" p5 f! }; [
! t" _% w, M. S9 X4 V' I h, zMethod 05
" V( Z& |. W! h0 U$ Z=========' ^2 L& r- Z( e' w
5 g2 ]3 l$ @$ T0 C( K1 |0 cMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 ^% }4 A d, ^debugger. It calls the int 41h, function 4Fh.
0 \) b) y [* k" y& pThere are several alternatives.
6 Y" Z+ f1 r4 V* p1 v* H/ L9 u7 x9 b3 U" Q1 M9 }/ C1 ^$ \
The following one is the simplest:6 @: F" G: Q" z. R% _ F" o# q2 l, I
$ [3 a4 |) @) G
mov ax,4fh
( O m" v' k! _ int 41h
- w. O( I' _6 ?/ g1 Q. J* b3 }% P cmp ax, 0F386
2 S; j( A3 O* c jz SoftICE_detected
" {; K5 a+ {& Q. }" Y/ A7 Q% ?: n- t+ [; E9 Z6 B
4 F! _, _" Q2 G1 W1 j, a
Next method as well as the following one are 2 examples from Stone's 1 o# L! L7 k2 S$ T2 ?
"stn-wid.zip" (www.cracking.net):* ^% _9 \8 n) A% \* [! w
1 Q8 h- T% {+ L, u( v! h
mov bx, cs
& n/ `" a% d/ ?, g( h lea dx, int41handler2
) O9 q) }$ ]3 B3 o$ w) J7 z% v xchg dx, es:[41h*4]2 ?. E/ _1 ^* V
xchg bx, es:[41h*4+2]6 k4 ?+ R2 G6 g8 a
mov ax,4fh
7 b% d) j- L0 S `% s int 41h6 Y3 V: u8 c7 {/ G' H
xchg dx, es:[41h*4]) y! j8 b6 A( m6 K
xchg bx, es:[41h*4+2]
5 z/ ?: P. F. S& `5 x cmp ax, 0f386h
) P$ d% y$ ~' O jz SoftICE_detected: G! C( d9 b5 u$ v# n
4 s3 |5 g% y! h
int41handler2 PROC4 \# u; i7 W% E, z
iret' K/ E3 S2 E3 N( P g2 n' h
int41handler2 ENDP0 F" Q! M3 s* E% ^
; ~" A5 I, m3 z" {! E3 b* a. f) N8 R& J7 V- i7 N# h
_________________________________________________________________________/ H. k5 E; f e0 o3 p
1 U3 g3 Y& g" R1 |
* ? c8 h0 Q# v+ Q8 q
Method 06
9 b8 b. k/ L% V$ v( t1 F; r; l. O=========' Z5 s, S' }3 h" q3 w* D! t
- ?/ q5 N) h) t
7 h( \7 p6 N5 c. I* s: b9 T
2nd method similar to the preceding one but more difficult to detect:
# w, F0 d( w* s! Y; f& ~! s' e' h1 Q) W( h
0 @- H: P" l: v- Y6 T
int41handler PROC8 p* Z, F: u E |
mov cl,al4 J, ?3 \: ?7 y, |/ q; u7 z* X+ @
iret
, ]0 ~* c: w! f# C+ }8 v- Hint41handler ENDP9 @# e+ o2 C- ]2 r. m, B
C( u6 P5 y2 j" H; Z* }6 `, r# O; t' {- u, i7 |
xor ax,ax
8 |5 v" K, ?3 G$ u$ k7 m/ s5 j mov es,ax
. S+ |: _8 o& W4 J4 {1 L mov bx, cs
# m! e# @6 P0 h' p( v lea dx, int41handler' u9 O7 D5 o7 c9 L/ V
xchg dx, es:[41h*4]
) ^; x9 N" g W7 z% E; w4 \; M xchg bx, es:[41h*4+2]
) A) ? }0 x2 l* H! D, w in al, 40h4 w; z9 j5 W1 [: J- `
xor cx,cx
0 E6 ]/ H: i) r3 h9 u/ L int 41h2 w) i. C3 U& Q/ X! h* l4 Q, R
xchg dx, es:[41h*4]
' A- }1 C# z9 w xchg bx, es:[41h*4+2]4 N5 |" N G$ {- b7 z9 j
cmp cl,al: ], R! `* k) B3 _7 a
jnz SoftICE_detected! M3 N- o" y9 a* `
& A A: o. C; l9 y2 _" g
_________________________________________________________________________
, X& e, d- _. R+ p1 N7 b1 R$ B8 ~0 m; n% M% u
Method 07
6 g4 @0 B' A. p+ t& ?$ b=========
' x3 y& ^! g/ S/ s8 G: `: L2 t( p" Y2 Q9 I1 x* R9 n5 F
Method of detection of the WinICE handler in the int68h (V86); c, c* F' R! m- d- V7 o
% C; c9 [& K4 A1 e: }% }+ a
mov ah,43h
/ v' v2 v+ r5 U" n int 68h' ] K* H- U3 ^2 C/ _6 V
cmp ax,0F386h8 j# k$ T+ h8 w8 K3 i& O3 p" H
jz SoftICE_Detected
/ g! }3 r I8 }6 S7 T: B
4 S$ f3 o5 ^7 r! g* z+ u4 D' r5 l8 E' w* V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: w2 Q$ u# W( x' X
app like this:
3 {5 U& E) {& ~' |* [) z6 B0 {9 X& D4 D6 V% E2 o- N& b$ U
BPX exec_int if ax==68- o3 \1 }- H! ~" c R* f
(function called is located at byte ptr [ebp+1Dh] and client eip is- L2 `! p* T6 Y5 E0 S8 q$ F& Y
located at [ebp+48h] for 32Bit apps)
7 h) r3 R9 L+ \6 O: ~5 x9 t__________________________________________________________________________ E% S3 F2 B4 |& D/ W; u
- V8 M- i! _" ?5 Y1 I R$ s3 R& |. n6 J' ]" }1 r& x1 c5 S6 G" V* w
Method 08
* ]6 w0 p: [7 t; c' d$ ~=========
1 i( y6 C* G/ S0 }! T8 w7 p- X2 s
It is not a method of detection of SoftICE but a possibility to crash the9 C" T% z! K0 b; J: P8 d7 Z
system by intercepting int 01h and int 03h and redirecting them to another
& U5 T' w8 q& v& f2 L/ D$ vroutine.
9 i+ D$ q" r: u7 bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* @" k" ]6 [0 T+ q
to the new routine to execute (hangs computer...)
& _, L" y7 ^. Y ?
4 ]: k0 ]( @; N* [7 k! i% p mov ah, 25h$ {0 o# `: d7 B& F1 i/ S
mov al, Int_Number (01h or 03h)
$ j, j/ i# _9 e$ S6 ]7 \* y mov dx, offset New_Int_Routine9 @5 W$ z l0 X* X
int 21h' o2 t) @* q; t+ a) o; W" V
g. d" A6 d. D B* F6 H# B__________________________________________________________________________
1 e( A/ c1 a8 s; P8 o. H: m |" x
/ R+ I, ?( K7 h0 k2 cMethod 09
! _9 N' h& A" W3 H# }$ Z=========
% v' g! q3 s: J5 a% G; t8 n: I z- [
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 k9 S. ^0 K+ Hperformed in ring0 (VxD or a ring3 app using the VxdCall).
4 D- \+ M6 R5 S7 E9 _0 XThe Get_DDB service is used to determine whether or not a VxD is installed- O+ ~; I$ C) k' t$ T
for the specified device and returns a Device Description Block (in ecx) for
( `; r) a/ S) J; ^& a: ~* othat device if it is installed.+ Z1 a6 N+ A# t
1 g; c' f$ X3 N3 c: _4 N8 H. U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& s2 R+ V. J; m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- k% W U; M( S5 l VMMCall Get_DDB
3 {1 Y4 U. A, a3 {+ |6 N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ Y5 k- b' k# E; M5 x1 i$ T7 U, J* n$ x0 E
Note as well that you can easily detect this method with SoftICE:
0 W9 w: V* K' E2 t8 s bpx Get_DDB if ax==0202 || ax==7a5fh& u0 ^1 c {. _5 P+ I4 P- Y
0 ?; }6 [& A; a4 j5 O [__________________________________________________________________________
5 o5 [& q" r& F/ T1 h5 ^% o* |0 l/ H) q: b+ m3 u
Method 108 s( c3 {; _7 P( h
=========) n! w i- Q' X: w, L+ Y5 h
' X* x' X6 K8 ^1 j& K0 ~4 T$ ?
=>Disable or clear breakpoints before using this feature. DO NOT trace with! \4 u8 t* ?$ c$ x" G2 M) f
SoftICE while the option is enable!!
5 b! t+ p; {- D! d- n" @# }. |
: e M: b5 a# f$ Y4 ?! kThis trick is very efficient:
4 V. n* s6 k$ \: y( xby checking the Debug Registers, you can detect if SoftICE is loaded1 [9 b# q. W7 @) U5 o
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 @$ ~8 o, O# q7 @% A
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ S5 i2 W3 K* N9 M c1 Fvalue (in ring0 only). Values can be manipulated and or changed as well
4 p2 s- x4 U9 c+ ]4 p: {(clearing BPMs for instance)
% i+ i5 W# l/ `# G r% x1 k
7 _$ _2 ~5 ^. w) M% U+ a6 @4 R$ d ^__________________________________________________________________________* }- f) H/ y( ]9 J5 Y
8 X/ q. o& H: m9 D4 c% L: R! WMethod 11
# a f n! U# A6 }! ]( R' J=========6 [0 I0 Y* ^6 r3 ]2 d
, j6 O0 c, i/ O: h3 L3 N, y2 CThis method is most known as 'MeltICE' because it has been freely distributed
! n" H2 T! v) V5 K3 ]/ r& ?& pvia www.winfiles.com. However it was first used by NuMega people to allow; a/ g/ P$ T/ e- l8 O* v
Symbol Loader to check if SoftICE was active or not (the code is located
2 b7 U: w3 w6 e. }, P" Ainside nmtrans.dll).
7 W& W" b0 R5 t2 c6 A, H- ?8 L3 ~4 b" P
The way it works is very simple:* r6 A8 l0 Q) L; g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' R% [5 q% Y$ |
WinNT) with the CreateFileA API.
9 G: K9 R4 | Z4 a0 o& E# l! Y+ n3 B
Here is a sample (checking for 'SICE'):
- V3 r6 W0 m+ }; F/ f' ^
/ W$ M7 i6 T4 b' m1 A. ]# gBOOL IsSoftIce95Loaded()
9 n. `( H" L" b7 [+ N* I{
: ^; S! E) j" e9 T6 `& Z3 r" Z* ] HANDLE hFile;
5 o, W/ w; m/ G8 T4 w hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,# `# S$ I4 N! V$ V: X
FILE_SHARE_READ | FILE_SHARE_WRITE,5 y7 H0 b* i* q8 A, _' d
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# y( h& D- ], m- { if( hFile != INVALID_HANDLE_VALUE )3 J+ [$ e8 l4 u; q' I3 k1 k
{
) ]" T/ d0 s% [; s7 | CloseHandle(hFile);
# o: k6 m( x9 k4 C2 } return TRUE;' a5 j$ R& E- w! t( [
}
- W" w) p, \, P' `0 M return FALSE;+ [. a7 e& W8 ~: {7 C
}/ Y( D. ^. u8 T6 M- k5 L
) _. W+ b d0 P' U; n
Although this trick calls the CreateFileA function, don't even expect to be5 k, E0 K- l( O& D# v) l
able to intercept it by installing a IFS hook: it will not work, no way!* U5 l$ H/ S; W
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 h0 C8 M, U/ X/ ^; F# ?& b; X
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 g$ Y2 i/ G! {0 C8 w6 ~and then browse the DDB list until it find the VxD and its DDB_Control_Proc# {0 D8 V$ Y6 m6 y
field.
- q- a5 g8 @ p$ fIn fact, its purpose is not to load/unload VxDs but only to send a
+ K7 ~' b# I, xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 t3 G2 l& `: f0 f5 N. U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ r; a5 M+ f, O! {- D* ~( l: @% b
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
; d. N: O$ I: t9 `If the VxD is loaded, it will always clear eax and the Carry flag to allow
3 h. C3 R1 {! E% @2 ~$ v. Dits handle to be opened and then, will be detected.8 q+ Z5 ~# T$ O4 b. A4 ]% S! ?
You can check that simply by hooking Winice.exe control proc entry point& r" B& `9 F e1 S8 H9 d
while running MeltICE.
% y* N$ m- L, m% g' b
* m* u2 }7 |- y% t( _+ K) W% r; N
00401067: push 00402025 ; \\.\SICE
! S0 n" {! {# q$ W1 \ 0040106C: call CreateFileA
( A$ Y: G; s ~$ S) z9 B 00401071: cmp eax,-001
m( ^+ A' ]7 l; V. X, h 00401074: je 00401091
- u- _; }% A7 Y. ~/ @. a( s- j: E1 V( ^0 T
( r% m( {% ~8 @8 X! D. k
There could be hundreds of BPX you could use to detect this trick.
0 k' W& s. g3 Q+ x-The most classical one is:& i* c' i4 Y! K0 X; u' `
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, N; R! A% _1 P# @6 j& T& @
*(esp->4+4)=='NTIC'
' K {$ g; A! m9 Q+ p9 Q5 C* h5 n8 @- X5 d q
-The most exotic ones (could be very slooooow :-(6 M: N l; e% W( A# _# P+ B
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ' {3 M& D2 ^% \3 J! u" L# V4 G$ D: M# g
;will break 3 times :-(3 ^* `$ a/ A& c: A' q8 D$ ]
* p6 P: m' ^: X-or (a bit) faster: + b) W: i6 }: o, J% u' X4 j
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! o3 O9 D. u" N4 x5 M* ]3 Q; E5 j, F& U# X( r+ u
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. _5 ]7 Z" E [3 z2 V7 P2 k ;will break 3 times :-(7 y' z. [" k5 Z) L4 H, ^, q
8 O4 x2 a7 z2 l b; T-Much faster:
6 C6 t9 k+ ~1 Y* e BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'" ~8 E* U3 p# {" C6 c5 n
$ @/ S" D) ?. ~+ V. k5 t
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- M+ h/ v5 {+ f5 P. p( H4 ]function to do the same job:
2 M g6 y. N+ t8 {6 g7 w" H
) U0 W1 G% p. K3 e8 j/ U push 00 ; OF_READ: u/ X: s4 q+ z7 w# B. _0 D7 k
mov eax,[00656634] ; '\\.\SICE',07 {7 H3 e& q+ a" I4 S" P0 k6 Q
push eax t8 q y% Y! M. Z0 o
call KERNEL32!_lopen8 X! G2 [, }* x8 s& V. ]4 I. N) p
inc eax& n. B- u% Z) b6 @% Y4 e' O
jnz 00650589 ; detected
) A. P6 B, t2 D$ p1 Y# G* [' ] push 00 ; OF_READ
( f) p+ {2 N2 v1 G; q0 | mov eax,[00656638] ; '\\.\SICE'
7 [ E0 l/ A/ A( z push eax
- u% u" T& F6 P( }8 n6 X+ D3 O3 \ call KERNEL32!_lopen& h2 K% F9 ]" f% N* W. N
inc eax
. h& v( I5 I6 R9 R. D, _# i jz 006505ae ; not detected) ?+ N X, s2 ]' z: }
0 i" t3 `& Y( G+ n) x5 d, G4 R
8 z1 X$ h- M" O8 Y, Z; o
__________________________________________________________________________
, b" ~- e4 Y* _6 ^2 g
2 ?7 i9 n- |3 O1 `Method 12 l- \6 x, g' a
=========0 j4 A5 B" C; a u( T
. L$ v& Y+ z+ K" H8 x$ n: D
This trick is similar to int41h/4fh Debugger installation check (code 05
: Y; v% K6 J5 T7 s, I' j! ]/ L& 06) but very limited because it's only available for Win95/98 (not NT)5 e9 [% J: t1 D: x( S) n
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: j" c9 j$ F5 l& Z- K- q
& T# N! D/ \ v+ O, n( o' ?5 n- s- _" Q push 0000004fh ; function 4fh
" Q' Q+ m% g% q push 002a002ah ; high word specifies which VxD (VWIN32)
" H# E+ Z# B8 Z0 @' z4 m1 D ; low word specifies which service
4 d, g# c4 M4 r S (VWIN32_Int41Dispatch)! a$ R+ t: V ]- K
call Kernel32!ORD_001 ; VxdCall4 `- O4 p {6 r/ l# O, {6 D4 n( ?
cmp ax, 0f386h ; magic number returned by system debuggers
8 d+ @& N. I5 w1 H& y jz SoftICE_detected
( Z: j3 D3 W% l& K# ]; i! E
. w: N/ E0 N GHere again, several ways to detect it:
1 @3 D" g% o2 \5 i$ I P& t) L) w0 @7 {6 @* ^9 K5 @! z
BPINT 41 if ax==4f
; x: z# ~" q; w4 x) Y
% m% v1 q* x5 j7 _& y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
6 x+ z% ^% R6 A. X* l, b0 ?
+ Y# @6 U+ M; z( }5 A" R; I, j5 x1 g G BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 N5 ]4 j# b. s H0 |4 s9 [0 J: h3 F7 D1 g) T2 N" A! S- _
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' Q! p2 K1 ~! }9 }$ V" u
. O$ {5 ]. \8 w- t
__________________________________________________________________________, i4 Z3 j. q2 q% p+ V) B' ^4 S# }
# W7 l/ V' X* g2 jMethod 13
3 `* V3 Z8 D" Z6 s) Z=========6 R# W- W6 f* p5 s
4 F& S# {) j3 j- q" [+ F
Not a real method of detection, but a good way to know if SoftICE is: k! y. ]% m& x$ m# J
installed on a computer and to locate its installation directory.
* B6 O w' j. ~ |It is used by few softs which access the following registry keys (usually #2) :1 ^9 C. _( n0 H
' s6 D k# C4 q" @ {
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 e6 O9 _. `6 {9 M7 y) O6 M7 c\Uninstall\SoftICE7 _' `4 r6 ]4 t$ s* J- I
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 W/ a0 j3 N, i% X1 u0 R5 q, u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- W0 D1 G7 H' X3 {3 ]# X, \\App Paths\Loader32.Exe
- h, G u0 r" c
: n; k2 \ Q0 B2 s) R1 X
, Q0 c( Z# ?5 v9 @$ Q9 S6 A+ R# H/ oNote that some nasty apps could then erase all files from SoftICE directory5 k1 ^$ y, d1 b% b$ B. A# H
(I faced that once :-(! K: V0 H2 J1 P8 y3 d1 t! j
, R: z8 Y5 J* y* W
Useful breakpoint to detect it:
V5 Y6 e- U" g2 c& B% a) ^0 u$ l; D2 v4 W" m
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" p3 s2 F- c( p0 g ?# e
# i& g+ o: y; }
__________________________________________________________________________) E" @% A+ t% ? }1 i% b" X
! U% m: [( I5 ?! O6 J" _
0 c6 `% a* Q9 GMethod 14
( ^. O1 G d8 v=========4 I/ Q# n" i& I0 P
" |; e1 M q$ TA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; u4 z6 i5 s: n& [. C
is to determines whether a debugger is running on your system (ring0 only).2 X. Y9 K( g0 c" P
. I6 D' N3 s3 z4 w
VMMCall Test_Debug_Installed
0 k/ H; r% b1 i2 ^; S, M+ C- ? je not_installed
% t2 j% n3 O$ k& z0 g: R3 h D$ C7 V& d% K0 i& r
This service just checks a flag.
: n" h! g5 H5 V2 P</PRE></TD></TR></TBODY></TABLE> |