<TABLE width=500>; h( i/ J9 M1 e( D8 N
<TBODY>
5 j U3 b, [. z t/ E5 B0 x m" R<TR>, ?9 a& `" B- C" \/ Y5 i8 w
<TD><PRE>Method 01
3 |, ~8 C$ A! S, v9 m# p7 v5 q+ h# O=========9 P W" Z& g [1 t* }# v
. e9 ^( r7 w$ u! }' R1 ^- w- ~This method of detection of SoftICE (as well as the following one) is; f" Z7 P/ ]# I6 Q8 y* {( v, |
used by the majority of packers/encryptors found on Internet.3 W: I" @- ^9 `+ @4 q0 R
It seeks the signature of BoundsChecker in SoftICE
9 W6 ]( J4 j$ d1 [# }3 ~4 ~% r
5 f6 a9 J& m/ g3 s) O mov ebp, 04243484Bh ; 'BCHK'. K# \; y( ~# E0 K, v; Z
mov ax, 04h7 L/ H0 S: J% i5 B. S5 l t
int 3 ) v9 Q5 X3 u+ a {
cmp al,4/ u/ j3 b2 |$ ?! p
jnz SoftICE_Detected
: C# u% f9 U+ x0 C% e) k/ W/ a0 V$ j& E: a7 [% z; p
___________________________________________________________________________: G: r. R9 V/ ^1 i% V! Q
H; r$ [0 r! [; oMethod 02) c* n" B9 r8 Z9 k- s
=========4 {: H) r- ], h5 W8 C9 z. X
1 L/ W9 n4 ]. @7 n1 ]: X7 HStill a method very much used (perhaps the most frequent one). It is used% }( v# V w6 h( v% E2 v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
5 W( U3 J9 ]& \& Q5 qor execute SoftICE commands...' m: b1 O3 p" q4 u( ~. }
It is also used to crash SoftICE and to force it to execute any commands1 a( h% m6 i S' g ~9 g
(HBOOT...) :-((
5 G* O H/ d% u0 Q, c" C' y# O6 o/ l- t4 p o/ D. E f
Here is a quick description:. I: U* d+ K3 z. l
-AX = 0910h (Display string in SIce windows)5 x' o$ T _& b. c7 n2 t: X) b4 l
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 \ D: t, w4 S/ ~* E
-AX = 0912h (Get breakpoint infos)3 J2 n: f& j- }2 l5 N3 ^2 i, a: q
-AX = 0913h (Set Sice breakpoints)7 x" K5 g& ? ~. C) X
-AX = 0914h (Remove SIce breakoints)! m" [* s9 w J2 i
. x6 A5 a7 d# e( ]% [
Each time you'll meet this trick, you'll see:
O. G* w6 K- O8 Q4 `-SI = 4647h
6 p9 q0 `( }4 @' ]$ {2 y* S; T7 I) l2 w-DI = 4A4Dh
( z t ^, {# {Which are the 'magic values' used by SoftIce.
0 s" T Q- y* PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
5 t# |0 c1 g4 Y) X, R' g
/ O+ P6 j' @7 ?Here is one example from the file "Haspinst.exe" which is the dongle HASP/ f4 O7 o4 b7 Q( t6 X1 G. u P
Envelope utility use to protect DOS applications:% U3 }* ?" h: W
1 B/ l/ V4 g# G3 t: D! k' ]' i
7 ? A9 Z: E; S/ b; Y3 g3 G
4C19:0095 MOV AX,0911 ; execute command.
% W( N% Y* X( u4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) p. w" g% } Q( ]7 L4C19:009A MOV SI,4647 ; 1st magic value.- D- _$ L' F/ O
4C19:009D MOV DI,4A4D ; 2nd magic value.
- [4 M' J4 T/ g4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)5 B7 |) U4 Z4 Y, S
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 y$ Z: V6 N! N8 X
4C19:00A4 INC CX
2 n% G% x% y, h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" ^4 M/ j6 i1 Z# E( f6 [
4C19:00A8 JB 0095 ; 6 different commands.
$ d4 d" O1 c9 \6 ^. K4 p& P4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ K- q" f3 N, E3 s) C. p
4C19:00AD MOV BX,SP ; Good_Guy go ahead :); v" a M" t: _, e
+ [& a8 ?$ p/ X4 o5 k, A( B. ^
The program will execute 6 different SIce commands located at ds:dx, which0 E4 W) e# d3 T7 A s$ I. {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% q' w* q* D1 x4 |
; I2 M2 b6 X3 I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. `" a8 M5 Y* Y: a5 f0 X
___________________________________________________________________________& E1 K6 w" T2 P
) O, M& @; I* O( A$ L: L$ i* ^. @
' n/ s. ]5 k+ S. _
Method 032 x3 X" x5 A. Q/ i9 ~7 [
=========% ]2 p* k5 I6 o/ E u
6 W/ u/ v, `. \" d/ c- zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h+ _. w) J8 o8 q* U
(API Get entry point) v( s, T* r' o
) D' L& a- t% o# a6 }# Y
/ a& }2 _1 z' a xor di,di
8 O" C9 ^4 j/ f; r mov es,di
, a& Z% m* R4 e" G" p5 y mov ax, 1684h : b, C& M5 v) f2 z% y: f
mov bx, 0202h ; VxD ID of winice0 m# y1 J6 e# i9 e3 Y7 g
int 2Fh& A+ l& s/ d7 `$ @, R& [6 u
mov ax, es ; ES:DI -> VxD API entry point# T3 d4 S( i- q9 t$ i6 o% {! J
add ax, di3 r9 c* z9 e) U; S
test ax,ax
/ U8 Z2 ?# d* ~& [5 ]7 V jnz SoftICE_Detected6 T) j9 M& }3 F& E( Q, @) H. g6 U, e
$ l. T0 @" `$ L( C. D" a
___________________________________________________________________________" e( _ x2 B+ P
s. @) X4 v( A+ v" O! |2 W j7 a
Method 04
. a( s' T9 B. {- k0 _0 a/ I=========
1 }! [+ K. z6 _, S9 Y4 i. e. O: b2 x) a d$ X; f6 q3 q2 B. u
Method identical to the preceding one except that it seeks the ID of SoftICE
# X9 U' ?9 T- H& }! p6 `4 s/ x* lGFX VxD.
$ x- z% E; @, D, u& R5 k
# Z& y0 ]# l |3 |) U9 H xor di,di
' i; D% W* l7 k* F5 y* T mov es,di
9 [! E% A& V8 f3 `0 g mov ax, 1684h 4 S+ Y: y, t! o* T1 z+ A% g2 @
mov bx, 7a5Fh ; VxD ID of SIWVID9 ~0 P4 v. s3 }3 e" h3 C- S
int 2fh
- p. O0 t: x- x0 ] ^1 ?1 B4 S5 l8 F mov ax, es ; ES:DI -> VxD API entry point$ g5 w( J+ ?( K) L# x) B
add ax, di
1 d) E* @6 ]0 \7 F3 I) l test ax,ax& t6 Y- x9 J4 y
jnz SoftICE_Detected# B0 \8 S8 \9 L H" D2 i
, y) X. n6 d% W3 [' E
__________________________________________________________________________ @! x" y. M8 f
9 m8 Z% x, J2 [) W- c: h5 d
# c% t" U1 W; oMethod 05
$ V, p. C4 o! l! K6 P% l=========( X1 T0 E5 x5 x+ _. v
0 n1 M: k/ W( S; J: W mMethod seeking the 'magic number' 0F386h returned (in ax) by all system
7 d+ W) F- R' rdebugger. It calls the int 41h, function 4Fh.
; Q4 f% @5 G( |9 nThere are several alternatives.
" {5 R3 [9 `5 S" E8 G( V1 T7 S, B5 Y d. m/ L+ ~7 n
The following one is the simplest:) ?) c( w' ~3 O7 z2 r3 `
% q2 O; m. h2 g/ w
mov ax,4fh8 v X' Q# D/ K I% Q/ c
int 41h5 U1 I% W, W3 P/ n, x
cmp ax, 0F386
8 t" G/ ?0 U( `, W3 f2 o7 X5 v jz SoftICE_detected
) b. R, ~5 C5 X l4 ~/ q2 \- o2 n& G c. n0 h, i3 t+ X4 t( M$ z
% m T, u2 ]7 L( q- z8 l4 ^/ X
Next method as well as the following one are 2 examples from Stone's " a) u# |" o% q9 c( O4 z3 t& r9 }
"stn-wid.zip" (www.cracking.net):% |; S( u9 h, d$ {' B4 t# c: I
) z! o. \7 l, S, I6 W mov bx, cs# _, c, m8 B( _) B* A
lea dx, int41handler2" w7 m [0 b+ }5 ~- _
xchg dx, es:[41h*4]% H$ a6 E2 L2 o+ l/ o( R& {1 f
xchg bx, es:[41h*4+2]
' A* R; y2 n9 S# `" E" Q4 t! h mov ax,4fh
& _- _% s! t5 r4 m int 41h$ M' d2 g0 p1 s$ y" M5 }/ E
xchg dx, es:[41h*4]" a' x0 J" Q& z% j, t
xchg bx, es:[41h*4+2]3 a1 }( h1 j, m
cmp ax, 0f386h" f6 D& Z# v6 W/ w1 i+ U: m: _
jz SoftICE_detected2 e1 p3 O0 s. l9 r
( R6 U5 F0 A V# c: K4 k
int41handler2 PROC; a: [# Z/ l) B
iret
/ G0 b' Z; I6 Sint41handler2 ENDP
5 C% t1 x' V F5 ~$ S! b6 L
( X3 |# s Q0 z9 _' f( P/ P- B8 ]# d# z
_________________________________________________________________________! E( t3 C, n( \4 I
# I7 U' P$ h7 n/ c1 e" I# F- F
; b" ~) e; f- A8 n% c9 i
Method 06
9 `; y, d& q) V7 L=========
" e9 ?7 s _. }. H& n: e! e6 D8 i
. ?# J+ \' O( x# x
2nd method similar to the preceding one but more difficult to detect:
* Y8 e$ I$ M. C1 {, ]/ Q4 q1 K0 O. W
, S2 i5 \. i0 {int41handler PROC
' d# c' b& f! @/ O0 N! H mov cl,al( \4 N/ i) [% m9 e5 n4 [% s
iret
% S; a7 m/ _8 S! p8 N; Uint41handler ENDP
* c, z' k- z# m! k* y0 M% _
& ^. `! o( W; H
' [& K3 ?( z7 s6 s% a6 i xor ax,ax
( m. r4 d& A M mov es,ax
$ A& `. q/ X. m0 u mov bx, cs
' h2 |9 b5 H! _4 q h1 C$ _ lea dx, int41handler
6 ~! g% L# W9 ]- x1 D xchg dx, es:[41h*4]
) D- f7 F, y4 _4 F/ `( g7 W5 s xchg bx, es:[41h*4+2]3 u @% [7 e9 c. _# {( j, ]
in al, 40h6 D5 E% u0 w4 ~3 }7 N* v2 m! w
xor cx,cx
3 m7 U {5 }0 z0 i: y; d int 41h
+ j, X K! u" H0 |+ S; | xchg dx, es:[41h*4]
3 V" H# o% m x- I- j8 m xchg bx, es:[41h*4+2]
1 U" [- s3 p" U* H' y" N) N% E: x cmp cl,al
' T- ?7 b) [/ O/ N/ z$ | jnz SoftICE_detected
, @6 l* W" W. _! |1 k1 u3 ]6 m" M) j( [8 Z4 \7 O4 ^
_________________________________________________________________________
. w% v3 [8 [% t0 e4 W: A$ W* D, Y& Q) O% h* n/ G0 J& X. a$ t
Method 07 {. |7 y" p& h0 F- D! ]3 L% W
========= ^1 L3 L- C% w/ ~8 Y
2 t- q, G& T) F7 E4 x0 l8 }Method of detection of the WinICE handler in the int68h (V86)
/ {! g0 O" b' t! r0 \! C, v9 C+ N+ I3 E) k7 s5 E
mov ah,43h& R- l- ^( E9 e6 o4 Y
int 68h- l/ \" l6 m$ B$ [8 A- e
cmp ax,0F386h/ Q$ J( x) ^% {* {
jz SoftICE_Detected( Y ?8 h( z C7 W3 g
5 y- {# R3 j# e) i( x7 a9 K4 C/ `; }: H
3 c0 R, X7 V+ t$ B! F. b
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: J; [1 b, B) B/ ~: J
app like this:( j; S9 J+ U( p4 v, ]% d
2 u% a! f- e. M! k+ n
BPX exec_int if ax==68
1 |7 n5 m U) i6 a (function called is located at byte ptr [ebp+1Dh] and client eip is; ?* ]% O* \+ V U! z
located at [ebp+48h] for 32Bit apps)
+ d0 K1 P% S1 r. K__________________________________________________________________________& m* d) \' A$ y, f; D8 _' [
1 V4 W' E1 e* a1 J* p! f4 m' B; K( t; v* i3 a' a% N T+ U5 R* |
Method 08
2 w! a( k) S6 U- J4 a* K/ i=========
. ?( y6 n0 ]$ Z" x& ?5 W6 t
3 v# C# _* C* _' J& o8 uIt is not a method of detection of SoftICE but a possibility to crash the, E' w" P' A; r+ S2 y ~0 e
system by intercepting int 01h and int 03h and redirecting them to another
5 R. b6 r4 g; mroutine.7 f% u: ?% {# S( ^7 t; |2 {
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! Q$ @) d: y" T" A
to the new routine to execute (hangs computer...)& w) t: ~4 x$ e2 C5 p
9 f) \" l/ j. [, F) }
mov ah, 25h. Q8 e9 f/ v& ^) `6 T
mov al, Int_Number (01h or 03h)
' z; ? o$ y# \; ~# y: W mov dx, offset New_Int_Routine
. D' C8 A I. f2 [# w( K! r+ k int 21h1 n' x7 l( o6 Z6 i: W" V
& P+ x# X! A7 n__________________________________________________________________________6 h# T- f) ~( t1 h
8 Z2 k+ r" Q ~
Method 094 V+ ~$ f# {5 L K5 z, V
=========# g7 E8 [) J! [( H
8 g$ i8 u7 z4 a4 T) Y1 M; [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 w: I l( {2 X9 y, @8 Rperformed in ring0 (VxD or a ring3 app using the VxdCall).3 u$ X7 R8 f( e" B! Z9 Q- @% R- _2 Z
The Get_DDB service is used to determine whether or not a VxD is installed* |5 u- J$ R3 E
for the specified device and returns a Device Description Block (in ecx) for
- X! V& \. S& fthat device if it is installed.6 ~% U C# h5 V# v: O/ r$ S7 k
8 _3 h8 E- C! J4 ?% Y" a! z# e
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 N- n" w% |( \1 W
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 a* h" |6 c& X4 k VMMCall Get_DDB8 N6 V) _- x6 }2 v
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 ~& S1 }# R. `1 K) @: S) X
( v( i2 j0 b/ Y& hNote as well that you can easily detect this method with SoftICE:
" H" d- w5 p4 F) ` bpx Get_DDB if ax==0202 || ax==7a5fh% n8 s: N! d. S7 S
: N2 R9 I$ M: Q( ^/ x- g0 q__________________________________________________________________________: Z% S$ z0 f/ W) T. |
3 _, Z- E, ]5 |6 EMethod 104 q% K2 z2 V9 ]7 _" j. ?7 [
=========
6 J, w) X1 `9 q) i+ J6 K, J# T+ b# @7 I$ r5 `( H& i
=>Disable or clear breakpoints before using this feature. DO NOT trace with: {) ], ^! S/ y, w
SoftICE while the option is enable!!9 g: I {7 V* t; H, L
' K. n9 ~$ G% l5 U1 w% B
This trick is very efficient:, F) k2 X) H7 m% `# I# Q
by checking the Debug Registers, you can detect if SoftICE is loaded t0 B* O0 M& I8 G! J- k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 Z+ m7 r3 u# J$ f u( |there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 F6 y3 I% S4 k! V+ Uvalue (in ring0 only). Values can be manipulated and or changed as well7 t* w+ k9 D5 ^
(clearing BPMs for instance)
" y9 }7 b' ?+ u3 z u. O5 A8 _# d& G1 K# m+ S3 R
__________________________________________________________________________
% M5 X3 M2 U+ o2 W/ C1 f9 M5 q7 @0 u) j7 G( R) \& `! F
Method 117 v1 U- R8 U: Q( w( S
=========7 m) h* Q4 b" o) D, Q; \% u) e% y
& v1 S; j- Q; `7 N) DThis method is most known as 'MeltICE' because it has been freely distributed: i# @7 @; g' t V/ T U8 q- I: A
via www.winfiles.com. However it was first used by NuMega people to allow
1 y, \* a) V/ y7 RSymbol Loader to check if SoftICE was active or not (the code is located
2 m5 N' o( w2 [3 G% y) S! Binside nmtrans.dll).& ]; G/ I4 e; i' Q0 h
4 o7 o5 l- A8 `The way it works is very simple:. L5 Z0 \; Z8 T0 s. G% O' w; a1 ?
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ a4 M) r! m7 |; U6 fWinNT) with the CreateFileA API.7 c, S. T" S4 z* J
" [" H# Q6 Y/ m
Here is a sample (checking for 'SICE'):
! @4 ]+ Z9 R* j0 f v; @3 s
: E& \5 g2 M8 g$ T+ _BOOL IsSoftIce95Loaded()+ d' L; Y1 D/ i6 [ T1 U- b0 ~( ~
{
9 c5 s- I. R! l# t- g3 }9 Q HANDLE hFile;
- s# ?" Y2 ?4 P hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& x6 u5 L( w, t FILE_SHARE_READ | FILE_SHARE_WRITE,/ E: A$ u. b0 C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( y+ M5 I! p0 L4 o5 w
if( hFile != INVALID_HANDLE_VALUE )
7 u4 X/ R1 @& e: [ {
+ w' z( M# v( [ CloseHandle(hFile);3 ^: q9 H( i$ Y! j ?3 e9 }- T8 a
return TRUE;3 J, S& q9 D/ a0 v
}
+ g% z3 s5 `- b% P5 J return FALSE;9 Z3 ?! M% }! [: |4 z
}- J* _/ z6 A- w; z0 h4 u/ z
x" G" R- F6 O& L7 {Although this trick calls the CreateFileA function, don't even expect to be2 ~ g8 O. i9 w' i& Z$ F
able to intercept it by installing a IFS hook: it will not work, no way!+ T8 q2 ^! R R/ N! |0 `. X
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 @3 O0 S; u7 F: j4 t4 ]service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. V" s/ Q4 k, d/ H7 g% t* Q' Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc( K$ p/ M" ^: N8 J
field.
. y2 P' s1 I. YIn fact, its purpose is not to load/unload VxDs but only to send a
7 d6 L( X$ ^3 {8 y, eW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ W) X, g+ V0 xto the VxD Control_Dispatch proc (how the hell a shareware soft could try
! U* k7 d) Z% r" [, B: |to load/unload a non-dynamically loadable driver such as SoftICE ;-).
( t. D& u# l8 D2 y1 QIf the VxD is loaded, it will always clear eax and the Carry flag to allow4 u3 W9 m/ e( i" I
its handle to be opened and then, will be detected. c4 E8 D: M+ h3 n5 y3 S
You can check that simply by hooking Winice.exe control proc entry point
# |+ x0 f7 e! e, _: Vwhile running MeltICE.
1 r) x8 ]2 ^! E4 t! K/ _0 T. i* |/ M _/ W. |" z+ h [
9 E+ J; R% \+ ^# c# M4 e
00401067: push 00402025 ; \\.\SICE, ~$ C: p6 N5 V$ R
0040106C: call CreateFileA$ O% b* D# N$ E! a4 |
00401071: cmp eax,-001' h0 A, ?; i' V |! U# X
00401074: je 00401091
" R0 P: F0 u, H* s7 Q# G! S: S
' V* g9 q# \3 \5 u& b4 E; d' M4 c4 l- a
There could be hundreds of BPX you could use to detect this trick.
# J, V1 e+ `! r2 ]3 s4 y+ Y# o-The most classical one is:" y# D/ a% S2 t9 V+ w
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 @8 T' d5 |7 a$ p# ~# ^9 \- T *(esp->4+4)=='NTIC'% J) d0 b) T- N$ v# J
, |2 y( S# D8 e, E6 I. U* v-The most exotic ones (could be very slooooow :-(
2 W) P5 U2 a# ~4 d5 f: k! |: @ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
5 W: p" g7 t+ k! {. k7 z ;will break 3 times :-(
: B. J+ c* N- W4 j8 Z# N+ P0 J& g- I
( e9 z( t, [! v) j6 L) W% r-or (a bit) faster: ) v8 S* V2 u) `) P! J2 R; R+ U: I
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ T' a. Q1 @- c. b& P& E! ]& s
" |/ H+ u! H& y) I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 w0 P i& I# m3 G& _+ k: X
;will break 3 times :-(
3 N0 `2 I3 q9 a" v; {7 }) U) C, x1 \
3 l/ V8 s5 j2 v6 u3 q-Much faster:
: K( H) ?5 ]) B9 F2 J# D C* c BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! q( E) q v( P# ^8 R! K
9 Q5 {' U% [' a0 z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen- S$ p$ _( Y( D, E2 U) K
function to do the same job:9 z( ~7 p7 x- j; a V+ F
5 M" |! U2 v/ A% r! x
push 00 ; OF_READ
3 w L1 v: l5 ^0 j, z; m5 Z; R mov eax,[00656634] ; '\\.\SICE',0" u; |5 n" L! t7 Q( s" `
push eax
5 R, N8 Q5 o& @/ e0 [' B1 K+ q! D call KERNEL32!_lopen
" J# w' _9 k; e4 V inc eax
! Y2 Z& ]: i- ]2 @; p9 y3 S& _! Y jnz 00650589 ; detected+ m& K, O8 O- z( d& |5 n5 u
push 00 ; OF_READ( m# M% i9 K5 V- _, p }# P/ z* C
mov eax,[00656638] ; '\\.\SICE'
- A! B" v0 G7 [" e' c; N push eax
% X+ l Q7 a" u% d% R1 p$ N# D; R call KERNEL32!_lopen/ w( K, u' c- g: O" K4 }( w
inc eax
, J9 U" D7 P( ]0 j5 e0 u7 }8 V1 m$ I jz 006505ae ; not detected
6 T. f4 }" s* K7 d
1 M+ U2 X" |& n2 q* [- ]
, Y% M+ A, k# P- l4 ^# B1 p__________________________________________________________________________
2 g8 w, c" E2 g e
! Y4 F* q* m/ y. B/ OMethod 12
+ A$ I9 c+ T0 K% F; |=========9 ~6 ^( q( }, P2 m& f+ S
, b' g- j0 n% D4 A' M, B. [
This trick is similar to int41h/4fh Debugger installation check (code 05/ {2 \* b. }& R/ _
& 06) but very limited because it's only available for Win95/98 (not NT): s7 Y8 Z6 ^. Z( c: e8 e/ m
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# W7 R" r/ l- k! B5 n2 r! v
* y) B( |# Y+ O) C# L$ q" j push 0000004fh ; function 4fh
. F: v5 I2 ?9 k1 |: Y push 002a002ah ; high word specifies which VxD (VWIN32)
1 S, |4 Z$ b, q6 {3 t" w ; low word specifies which service) Y1 j0 c5 k7 }# W4 A) T
(VWIN32_Int41Dispatch)
& D# R/ \ D {! \ call Kernel32!ORD_001 ; VxdCall. [8 a8 G* D, [2 h$ \
cmp ax, 0f386h ; magic number returned by system debuggers
7 d+ A9 E& Q( j' k M jz SoftICE_detected
- S0 I/ W' x" e+ ]/ C6 @, h q% g1 n3 [$ R ^6 Z( k$ _# k. D# ?
Here again, several ways to detect it:3 g. s" |3 g+ ?
* M6 u7 e) l7 E' p BPINT 41 if ax==4f
9 w( r4 L ]1 ^: \ y0 J2 F: Z3 e2 R, r6 \' F5 F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one. \$ N |# @4 r5 @$ x" @# d
1 B$ Y1 Q' O& I# ]6 Z. F( r. `
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ h$ m) J7 e' n; o. }( b# A. ?. W8 }; P0 S$ j5 Z5 A. g6 c1 a
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
( N& V& s: [ z4 J" e
* y x/ u( g( Y6 j' M S$ k__________________________________________________________________________" c* M: C2 h5 b3 e% h' p' t
: q5 |8 A0 v. i, x& [0 ^: k
Method 13# Q7 X d, y& ~) I* G7 N4 @
=========6 [# m% a; J& ]6 L- q
# K! Y- J! i' K/ }: V2 r9 DNot a real method of detection, but a good way to know if SoftICE is" \" h7 s0 i. o" ?. q! i4 z
installed on a computer and to locate its installation directory.
% o$ n7 G Z$ q5 X( qIt is used by few softs which access the following registry keys (usually #2) :
6 L+ h. W8 R* m* l; Z6 v; J
( _) Z- ^+ W6 |- t% s+ f5 z& |-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 o) l% {* x# X\Uninstall\SoftICE0 g( F" V B2 x$ _ }' V7 l/ }
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE: p% z1 C. X: Y* i8 n
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 c/ i# V7 Z0 I% q" q( e
\App Paths\Loader32.Exe$ n. |0 x" P; a! l [
1 T2 C& I! K6 J' B% h, G
2 e; b8 y; J N. CNote that some nasty apps could then erase all files from SoftICE directory
4 S4 P( y( H9 v8 n(I faced that once :-( a8 P _1 Q8 ~0 G6 w9 ^
' z3 s* m3 f, Y4 }- YUseful breakpoint to detect it:/ {: N3 G! R/ v! ~% {5 ~; ?4 t
' ?3 G* _* @2 }+ e9 n* |& k
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'* [7 M& R/ x2 L: z: o
/ o! T7 K/ Q6 Q! u) v& U! G__________________________________________________________________________
* L, t6 m. e4 a g, G
) K" ]: I: Q M m
0 k) @! B* e& C% f2 }% O9 oMethod 14 3 `$ D" k9 B) @
=========2 p1 U1 ^7 T* ^% ~1 o1 o# q! V
* \0 q- I: `5 a# `" Q- sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( q# r$ u) V# @/ S! {) T( p
is to determines whether a debugger is running on your system (ring0 only).
9 h# i0 @# A; q6 ]7 w4 i8 H( ]& |5 D s. J
VMMCall Test_Debug_Installed5 I* }2 w* l. o' b o( }
je not_installed
& F0 z* i1 l$ F( ?& \8 ] \& u7 H# [+ N/ Y% Z" N
This service just checks a flag.
+ P6 B! B) L* \ q3 m</PRE></TD></TR></TBODY></TABLE> |