<TABLE width=500>5 G* y" b8 \$ W0 L
<TBODY>
& `+ K' a; C8 [' |9 h- Y<TR>6 m4 f% `' T* z/ j- |% n
<TD><PRE>Method 01 6 A- g: y$ d" l$ U. i) W; y1 s
=========- i5 ^" s% d3 q6 C2 o: h# B, _
) _2 l0 G* X% M& L$ ^& {6 q! r- A7 Z
This method of detection of SoftICE (as well as the following one) is
5 A6 B* x; t4 Y( J; t0 qused by the majority of packers/encryptors found on Internet." o; L* I1 C5 }
It seeks the signature of BoundsChecker in SoftICE
& A2 L3 M" {( [: b& r3 a f4 @0 u
( K! o9 A! `: ~$ \' H2 ]! r* b mov ebp, 04243484Bh ; 'BCHK'* S! c+ }$ ?: a4 U# [
mov ax, 04h: B" q3 r% K% C$ J" ]+ G6 U$ A
int 3 % }8 ~+ ?$ p7 B+ b q" |
cmp al,4
/ g/ B9 N s" K9 z8 O7 w6 y, S jnz SoftICE_Detected
: C$ D8 r' K. M \. k' J( C+ n8 _% o# r# e
___________________________________________________________________________0 q8 z% d; g1 l7 R& U
+ h' [0 k9 l5 h6 V8 G* ]- C8 U
Method 02" A3 ^, a8 N1 Q% K. L8 H
=========% y5 ^) K/ c4 }1 S* L
9 v* a8 k& z% Y$ { |" } FStill a method very much used (perhaps the most frequent one). It is used
/ Q: k, Z7 u1 z3 o/ dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 e& P4 N+ Q1 [+ P4 N
or execute SoftICE commands..., S3 U- z7 O+ \- W) ~
It is also used to crash SoftICE and to force it to execute any commands& @7 V: n* {1 ]; T8 u' N- D
(HBOOT...) :-(( - w2 l: [6 L* y" B- f% r& v
' w7 g4 x3 t$ x* A4 _0 gHere is a quick description:
' w# I4 F+ O; v6 K) t+ k6 g-AX = 0910h (Display string in SIce windows); L- a* l# A5 {4 S. F
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 a2 I9 K- B7 a' j% B: c$ n-AX = 0912h (Get breakpoint infos)' X8 `. W: F' @5 c
-AX = 0913h (Set Sice breakpoints)
! O9 E u1 q/ N-AX = 0914h (Remove SIce breakoints)( j6 ^4 H! E2 v$ z5 c
+ m$ l3 @1 G/ Q0 AEach time you'll meet this trick, you'll see:8 O: @" A( _ B) x" r
-SI = 4647h
- j) U, Z: c3 {! i; }-DI = 4A4Dh2 T, q+ g' s# M. l3 `1 d( N9 P
Which are the 'magic values' used by SoftIce.
p" y+ t5 T8 f7 {; tFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 Y3 T# m6 `9 \& n, R
+ l4 L4 H5 }6 N+ X( {
Here is one example from the file "Haspinst.exe" which is the dongle HASP
5 x2 r5 E6 R# L2 z' o5 H# _Envelope utility use to protect DOS applications:! C V k8 \ v7 d" ]$ D
$ b) ~- k( y5 d* Z* R5 ^: [3 M+ R" D2 T/ v
4C19:0095 MOV AX,0911 ; execute command.3 u/ H- @3 q) N7 @- z" a+ u
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 x: D+ c5 W- _: |5 c& d
4C19:009A MOV SI,4647 ; 1st magic value.
( {; w" a' P2 D" P9 X) s: I6 W4C19:009D MOV DI,4A4D ; 2nd magic value.
; K( ?' B& n0 q" u# g4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 m1 R. z% L: {6 q/ Z( k, C! M
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
: D( m4 j, C) \8 [! J- ]. R4C19:00A4 INC CX- e+ U1 a$ l" d7 p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 n9 Z9 \ {0 r6 T) C) N- c4 `; S% W
4C19:00A8 JB 0095 ; 6 different commands.
3 T0 z* {/ z. |7 k" U4C19:00AA JMP 0002 ; Bad_Guy jmp back.) t: X C! T/ T5 O0 \ n
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 J5 Z g0 G6 a7 v& j4 y) l e C4 l& @. ~! l6 p
The program will execute 6 different SIce commands located at ds:dx, which& {& V- _! ^$ Z' g
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
- }% |4 `3 | F: L1 \: m, I
* ]% d. @8 F) j$ b2 x( g* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) u$ C" f) j+ H) Z! T% y4 W B* h6 ?
___________________________________________________________________________
" h3 m9 @* v* w. P% K; U' L3 i6 {- H$ J5 L1 s# y0 E, f
8 o3 T0 @0 D# q: _8 r' j0 ~& y+ `
Method 03
5 V5 d1 N' a" c" s9 Y8 N=========
. N( S( I8 v- l/ v/ f7 g0 h# f) l" ]$ o2 \# X
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' @( E; [2 C2 u6 i. _( }% |
(API Get entry point), s4 s# ^1 y2 ^" z8 }
& f4 w% p: I; G. B J1 q( f1 _! B* v4 Z3 H
xor di,di
1 k5 t6 D3 L3 N" h mov es,di4 c2 @) J+ |5 o$ S6 p
mov ax, 1684h
$ Z/ C( s5 h f- a5 q mov bx, 0202h ; VxD ID of winice
+ j+ N7 h) _7 c- D0 O1 s9 Z% s int 2Fh
/ h0 Q8 @. Y' U# S4 s mov ax, es ; ES:DI -> VxD API entry point" n6 y4 B! ?" t) x
add ax, di
+ `+ @% {2 A/ k( f- n, P test ax,ax$ N; h4 T( @# v# G4 ]
jnz SoftICE_Detected1 e/ h7 \$ @7 n% d2 I
& O) b) l' c2 |, n }8 q5 |% A1 w1 ____________________________________________________________________________! c5 ?7 J9 K! q8 E& [ Z
# U% t' l/ a# c5 cMethod 04
- b8 D1 Y1 Z& U& _) G( l=========
7 W( i2 _) Z! C, v& ^! n
^* T8 R4 a" AMethod identical to the preceding one except that it seeks the ID of SoftICE
) e; y; u5 W2 n* A0 q# z' a8 ?GFX VxD.' v0 M& t8 a: H' Y9 c
. @, T/ D7 r5 [3 U9 l xor di,di0 E& z3 t' \0 ?+ N8 M$ r# k( j
mov es,di
. b( l4 O% e% p9 \ mov ax, 1684h 5 J) S; {! {- v
mov bx, 7a5Fh ; VxD ID of SIWVID5 b& A4 B: L, P3 K' ] h O* c
int 2fh$ @3 _' |+ W3 ~+ B9 w7 @* t$ M
mov ax, es ; ES:DI -> VxD API entry point* x* F8 S* d! f B' y
add ax, di; ?: B. o+ `% A
test ax,ax
0 N, `7 R( p3 s8 t2 Z jnz SoftICE_Detected
+ Z: Y" S/ R l3 X: h4 H0 d2 d
__________________________________________________________________________1 S1 j- A: f% K# ]* [& k# F" a
/ c3 G3 W" N/ p9 F& }/ e6 y2 o) [4 [0 h5 C' ]1 \
Method 05/ T2 z# s# e7 K: C$ ~# Y3 n. m: X
=========
5 Z; u, f/ b: F5 S# C
! n* K6 ]. l8 @9 sMethod seeking the 'magic number' 0F386h returned (in ax) by all system: N6 X$ b) t u3 C0 y2 x `
debugger. It calls the int 41h, function 4Fh.
/ r D; V0 d* l7 J* C. oThere are several alternatives.
+ K/ t& W2 {& s: u% W8 M
) N/ _8 h" \; ~% {The following one is the simplest:
4 R: \) x- {2 y/ D( q; `8 B- w, d4 P; [+ ~( b z) ~0 w; e E
mov ax,4fh
- J7 O5 \: o6 {5 d! `/ M3 h1 @/ K int 41h4 W( |% D/ |- h0 J
cmp ax, 0F3860 o- z3 R6 s/ B- B. C
jz SoftICE_detected
a0 Y! x! ]/ @7 }! b: w; K0 W3 q+ y6 S5 i& y
% E+ A+ F" o% h
Next method as well as the following one are 2 examples from Stone's
0 H8 n( j# r. B! s) F% w( P! k"stn-wid.zip" (www.cracking.net):
1 F0 c& G7 a! `+ f3 b5 d1 y1 o# F2 g5 J: F) n, f
mov bx, cs" t @) Z" s/ G* v: K3 q; S
lea dx, int41handler2) Z; ?% M" S: I6 ]% G. n. u
xchg dx, es:[41h*4]4 [/ o! }, D" m9 X5 R4 m- ]
xchg bx, es:[41h*4+2]7 o" J2 [' z3 r4 [ Q
mov ax,4fh9 v& c( k# i- E0 o
int 41h/ ^) o" b) {+ u
xchg dx, es:[41h*4]
) Q' a7 i5 z$ [8 L xchg bx, es:[41h*4+2]8 a* C; f/ W5 {2 b! P4 I
cmp ax, 0f386h
2 f, D: k( d0 u; g8 b jz SoftICE_detected3 p+ p" r' y, T9 N3 {8 k
# t1 S) ^3 I* d3 Pint41handler2 PROC4 S, W+ l3 u" M9 k
iret2 c$ V' B: H. T: N4 B
int41handler2 ENDP# B1 d& J1 u6 u2 {. B. \: X6 x9 P
; w( F2 ~2 h2 o/ z* _! k% u6 f. V
6 z3 b" z1 y; f
_________________________________________________________________________
; U$ o* l+ T6 p4 j1 g' z6 ?
& O; }! n9 ?4 `$ i
7 _7 I; K: O8 F; G# ^1 T4 Y! BMethod 06
9 {. C% J6 N' a9 W: b: a, I=========
1 b0 T9 c3 N! }: D! y# i5 T4 p" B, Q
8 }2 f) u0 B3 U4 o3 M$ t' Q. G
2nd method similar to the preceding one but more difficult to detect:
$ D, j1 g& X) C8 f# W. h# l
0 x, p: G+ f+ Y% M% B0 o
' S8 F0 G& c6 i( [int41handler PROC- C" x; N! C" Q4 S% ~( n
mov cl,al
% [* U) @4 d9 s! O7 v. G* `/ p iret
0 J- R% s2 `! iint41handler ENDP" @2 [4 ]! z" g( E" Q
5 k: _! p+ i a1 F9 |$ P! S
" `8 s# g' Q7 s r xor ax,ax
& P f' F" }% K$ X* W8 r6 i mov es,ax+ o$ `! T0 w' S, \1 E3 L0 S
mov bx, cs
0 W1 h, q& Q7 E5 s: M, F. q' R lea dx, int41handler) o* j8 v6 m( Z$ w
xchg dx, es:[41h*4]% K% Z% d6 r9 d* F, D( a
xchg bx, es:[41h*4+2]
5 _( }3 e" f% E" E% { in al, 40h" Z+ X) Q$ o5 F! _6 a
xor cx,cx# V# A' q+ P- r9 {; Q7 |
int 41h
( c* W: @, B" x# Z$ ~2 `3 e1 C xchg dx, es:[41h*4]
6 F: X3 Q$ z# O+ _4 F v xchg bx, es:[41h*4+2]
6 ~; B0 Q6 U4 P$ ] cmp cl,al
& }, T- E/ u! s; q. Q( m jnz SoftICE_detected
: k& F2 q3 f9 c: K" j
2 n' y, e% c' r q8 O5 G_________________________________________________________________________
- W) o) t9 u) }
. `, ^, d# G( }, m* F8 SMethod 07
8 O6 ]6 [) X: r1 J* _=========8 u6 ~9 D- Z: }( M% W# j2 u
+ C8 B% r \1 ^2 K t8 j8 c
Method of detection of the WinICE handler in the int68h (V86)
: ?( A5 R1 }! w. m! j
% f6 |. t/ T5 s, k9 f mov ah,43h# o; W/ v1 P" |2 H
int 68h, w0 j0 w+ C5 D: I, E0 C
cmp ax,0F386h5 Z3 `% N! l+ y! x+ m- r
jz SoftICE_Detected
# q6 q$ h5 F, f% a$ ^( H, }2 y8 {) |0 V
' ?4 S; v# Z% @9 p/ k1 P2 P
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 o5 q0 z7 E# A' w& R. {$ o
app like this:
* O: E! B% B/ |0 M3 u! m2 A3 W3 o, E- R! W l2 i
BPX exec_int if ax==68% \, N |6 R s3 G" i
(function called is located at byte ptr [ebp+1Dh] and client eip is3 }2 E c* U$ n2 W0 T. M. N) c
located at [ebp+48h] for 32Bit apps)
, z: j; r' ~" f" t3 e( Y* q__________________________________________________________________________
+ b" K* Z% s* q& r6 O5 W' H2 r% G- c/ k5 h3 l2 j
9 k$ b; H7 o: c# I Q, O4 c+ QMethod 08
2 R* p: S+ n( a% w6 g6 a=========
: a0 u3 ]' P+ P0 D1 x9 w) p7 Z9 k) Q; T1 H7 A; k
It is not a method of detection of SoftICE but a possibility to crash the7 P6 s" `. e' h) O) A
system by intercepting int 01h and int 03h and redirecting them to another
8 B3 C8 V+ v% _% ? Wroutine.
: ?7 C% [. C4 p: k& f5 f. PIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points6 N8 d. F! r* v, u0 n
to the new routine to execute (hangs computer...)3 _3 N" J: ?/ `, k
/ P, j9 O6 P, T- g( I8 p3 z mov ah, 25h
% m( K$ `( Z) [; A: s" O4 J mov al, Int_Number (01h or 03h)! r, q1 k V- S5 r
mov dx, offset New_Int_Routine
; F( S! h1 y" ]6 e0 [ int 21h) h) A7 c( h/ c! F" [5 H) |/ _$ |
& }# F7 c. H3 A% u4 I3 V* U5 P__________________________________________________________________________5 m! S) L8 p3 _: E. h
% P& {+ t2 y9 PMethod 09- l: W9 }$ u: O! J; i
=========
) M4 Q! f" T! I
8 j# o6 b# H* k/ r$ Q; cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: j3 g4 C9 A7 U" V
performed in ring0 (VxD or a ring3 app using the VxdCall).* I: J- \9 h C# n2 T3 V2 S. Q$ C
The Get_DDB service is used to determine whether or not a VxD is installed: N$ g" b* p5 F) I# R1 f
for the specified device and returns a Device Description Block (in ecx) for0 z0 C$ f$ {) F: U* C; V \
that device if it is installed.' B7 w, e7 T" o: r; E
% X; b$ Y( u1 D7 f; @ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, v+ |7 [5 c# U mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- B6 k I% H, ]0 I" g" m5 i
VMMCall Get_DDB
2 B7 Q& H V% V$ ]0 j) C mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) F* l+ ]- O. }: @0 b$ T _
5 R$ n& w# F3 KNote as well that you can easily detect this method with SoftICE:
' u7 |8 Q8 M3 |, m: U) ]2 Q7 u bpx Get_DDB if ax==0202 || ax==7a5fh
3 u0 T* b% m$ W: Z) `( O
2 A. x) a9 V6 s" h# ]' v& a9 W__________________________________________________________________________% O7 v' p+ S2 }! Q8 f
' |7 N. l3 o$ Z; }. ?: a, }
Method 10
( h4 d- Q( ~# w" h' k=========
7 _$ {9 P# [( k* [% Y8 m. h$ s& s+ c+ U
=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 d2 E, B: {, J: M- Z1 B/ J3 v/ \ SoftICE while the option is enable!!- }* |9 j, b, V( }1 Y, B* ~% u. s
9 h: G' y& ]" H+ h7 {" N' K
This trick is very efficient:
d% |4 f: k: C# yby checking the Debug Registers, you can detect if SoftICE is loaded, z9 h- x. j, v0 \) _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 U3 D7 N1 P- T( Y4 D2 J- T% S+ tthere are some memory breakpoints set (dr0 to dr3) simply by reading their. X: W6 x. N' h5 L6 O$ [
value (in ring0 only). Values can be manipulated and or changed as well
' l4 {; B7 S( U! b- m6 ?(clearing BPMs for instance)
; e1 ^+ @( F2 }+ m, z1 Z% r: Y- P0 f, ]+ P
__________________________________________________________________________
6 D; H( z- y+ L6 A, N! J! U4 |/ p5 B( s2 `6 T h* Q
Method 11. L. i9 ]# n" P J" Z% c1 l
=========5 C; E1 r$ _2 a. y
" z" h9 W: G7 k. s* A! o' r* D& VThis method is most known as 'MeltICE' because it has been freely distributed1 F1 T: R5 O* W
via www.winfiles.com. However it was first used by NuMega people to allow
0 N; \( U. S/ F4 i! T; h" sSymbol Loader to check if SoftICE was active or not (the code is located
, j! Q/ w. o, F( ]) T6 w9 ^inside nmtrans.dll).
: Z4 l% [ L/ r* w% z' G% }5 \
- H3 r1 k8 E9 P7 N$ `The way it works is very simple:3 K! ]. p+ Y5 I7 f+ `, R. e
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 D2 }" N, e( e- t
WinNT) with the CreateFileA API.
+ `+ L4 Q% h0 d/ w6 l' f
& \5 ? k# f- \( u( S# _! {Here is a sample (checking for 'SICE'):
6 u5 z- p* `' f! n* o2 D( f* v& Z0 a6 t7 m% ^6 Z
BOOL IsSoftIce95Loaded()0 i0 c8 x% C2 ]! n2 H: l
{8 }' q, @4 g1 z: J/ Q/ r; z
HANDLE hFile;
, S. p0 M. K; Z# U# d. V+ o0 e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( ]$ @1 {9 Z8 k FILE_SHARE_READ | FILE_SHARE_WRITE,8 I7 n. C/ b' ?: A# u* A; l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 x9 B; i0 h$ P if( hFile != INVALID_HANDLE_VALUE )# x# |' ^& o# r' ?* z) ~3 z
{
; a- S% Z* N9 Z* Q8 } CloseHandle(hFile);5 x( _' p% }+ c0 N# T
return TRUE;+ c( G% T3 \9 G1 Q c
}
: e. Y; E+ n }8 G3 I4 h return FALSE;8 a0 ^+ @! V" V" k) b
}, @+ ?, _( y1 G( P" c0 ?2 m
' \7 ?! i+ f6 G% p# JAlthough this trick calls the CreateFileA function, don't even expect to be
5 x' ]. z' V# T1 n2 Yable to intercept it by installing a IFS hook: it will not work, no way!
! t; P& [2 v" J# v3 uIn fact, after the call to CreateFileA it will get through VWIN32 0x001F- ]- r: v8 Q9 c# t2 O0 s/ n% ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 s& A! b3 q* ~and then browse the DDB list until it find the VxD and its DDB_Control_Proc
' o' M1 g; w$ Z7 {/ Hfield." J7 B5 x Z$ n# z0 [! c8 t% L
In fact, its purpose is not to load/unload VxDs but only to send a
' v S L8 ^4 G( V4 p' ~W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 K2 F1 H8 r2 r( z6 Y, o! w1 Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. Y) J" y1 o7 ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
% [5 E. s8 i* m' D0 ~If the VxD is loaded, it will always clear eax and the Carry flag to allow* d" B9 y0 B% E: e: q/ u0 G
its handle to be opened and then, will be detected.( a" c, X3 J' o( p" {6 |
You can check that simply by hooking Winice.exe control proc entry point7 y: @* Z. s( S4 }
while running MeltICE.0 r8 b& J) v |$ R- T7 X2 `
+ h: ~; I) @+ E( @% L8 S3 v% {' l5 _7 i! y& X: r
00401067: push 00402025 ; \\.\SICE# V) {% q! w/ _( a
0040106C: call CreateFileA( K7 ^9 o9 W( ]) ?, s4 j
00401071: cmp eax,-001
* y, {3 ^8 Q# S% s 00401074: je 00401091; ]* D3 u' G4 R5 u2 J: U
, B% P+ s5 _/ x- `1 }, c; Z! c* Y& [! d5 }: B T& A5 g
There could be hundreds of BPX you could use to detect this trick.2 x4 v. x7 }! r
-The most classical one is:
4 z0 C* E8 {0 T# A! c ?8 L# m: q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" \; d- |6 N. V
*(esp->4+4)=='NTIC'
* J9 X9 i8 ~8 ?" ^. Z3 J9 r
+ i5 q" U( e, L% F' s6 Y: F-The most exotic ones (could be very slooooow :-(
2 n' i# A6 y) v9 ~ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 s0 i# a+ D- a5 s4 {7 _+ V
;will break 3 times :-(
" @+ M& A& Q( `& o7 o' o8 d/ y' E7 J1 E u: j9 |! h
-or (a bit) faster:
$ t/ t& L2 L% N# c" c6 n BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& x8 J6 K( J: T, Q8 h, A8 q
2 K) h* T" P' U7 ]- T4 G BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ; {2 d6 n; p7 w
;will break 3 times :-(- j1 x$ `( m ~
2 Q& C- U4 _+ Q" Z+ N-Much faster: H/ M2 y/ |+ E' S5 w* P( }: z
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 w* [! q$ y! g% a# A, d
, z7 T* R8 C9 r+ v! g4 F2 tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 Q5 W" p: v# v6 ?. t4 E- z! _; E
function to do the same job:
( ^8 i3 [/ T$ b: r/ x6 d5 m X" _* @
push 00 ; OF_READ f& C, I2 n( v4 m+ I7 n1 |
mov eax,[00656634] ; '\\.\SICE',0
g6 r. y" Z* z push eax
' u: c0 C0 l% K5 d+ \& q call KERNEL32!_lopen
$ g- ~/ R, A+ _% b& ~/ c# W, @! ` inc eax9 L; G+ H; w+ v. s/ u
jnz 00650589 ; detected& r* Q+ D L, m% s7 Q# O
push 00 ; OF_READ% E7 d& l! R0 Z
mov eax,[00656638] ; '\\.\SICE'
: a+ b/ J0 W$ U* G$ f push eax
2 _8 j9 x3 B# n1 |2 x' ~/ N call KERNEL32!_lopen
- R% ^0 o$ Z& D- q1 k inc eax4 ?' ^( j) @8 E+ _6 w6 Z) k8 j3 X
jz 006505ae ; not detected* O- b$ } \$ y& o
5 P( z8 ?( C: U* k
( N' |9 a! G: y. }8 H
__________________________________________________________________________
, Q' \( v: Q4 |! ^9 [& I+ S
( |7 l' ^7 N1 H9 S8 }+ e4 OMethod 12
6 `( E! w" P: _" C" T. L=========
) C( u8 n7 g+ ]) [5 p, i
& e! N) V! R. U! u2 _$ N" ?This trick is similar to int41h/4fh Debugger installation check (code 05
( G5 l# \/ l6 L- {: \+ B. u& 06) but very limited because it's only available for Win95/98 (not NT)
+ W" Z+ O" }; i! a' has it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 V. u; l) B) o' P; c1 _
1 }2 V W9 e+ I/ e! b; r push 0000004fh ; function 4fh
& F6 ?8 Y# \( Y4 U/ }0 \ push 002a002ah ; high word specifies which VxD (VWIN32)6 @% T" J" j, C% j
; low word specifies which service
. d& Z- F9 r9 E5 x (VWIN32_Int41Dispatch)
- r9 T. ]- |1 |4 f call Kernel32!ORD_001 ; VxdCall1 O' ]# b. e4 H
cmp ax, 0f386h ; magic number returned by system debuggers# r% j& X/ C! t4 e* i8 v8 o
jz SoftICE_detected
- e: Z2 ?) F2 Y l/ ?$ r# R j' V" V
Here again, several ways to detect it:
; ?, I, M) X9 b0 Y
$ Y+ X# i( j7 z# A- Y, b6 Q) B BPINT 41 if ax==4f
2 B! X. A( a- K7 s. }( Z) C+ M/ Y' r) A; P4 g/ D% [
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* X* b0 \7 u P1 Q. C9 x/ n
: k0 X1 h4 w7 k8 q! N7 \' { BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 W0 ~8 `/ P c8 O! M
5 h( t ?; |- Q( s) [# I! x# K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!* N3 B/ \$ i% V0 e; L8 D. P; R" ]1 T6 \5 u
0 P |" T+ P( B) s; @) e' H3 \
__________________________________________________________________________
7 S4 q9 n5 k2 M* m* n( H. p
$ i, O' G* A/ EMethod 13" p" \+ f& j5 w1 C; P$ b
=========
- B$ i- g# b& I; D0 V
! w* V# {5 v$ `# ?1 V) \Not a real method of detection, but a good way to know if SoftICE is
6 R; u* N1 A4 m) iinstalled on a computer and to locate its installation directory.7 J Z& J+ j! y+ x
It is used by few softs which access the following registry keys (usually #2) :
* w L0 V- a6 x' E$ x' e* X3 P. }. T+ C- e5 e/ x8 ^
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 O1 q" g- T/ d9 \( r\Uninstall\SoftICE
& S# D) U" x. r6 M3 d0 S. |-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ s& a: X3 f$ e3 |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* ~8 O4 L& J& u' ^4 m ]\App Paths\Loader32.Exe
' g/ ?9 p, Q* S6 f+ D' Q: f3 w
" R2 A' I% m; Y. K; P# B3 B4 r2 q3 `; s8 q* ]' E- H
Note that some nasty apps could then erase all files from SoftICE directory
# L O$ g4 x2 e+ s, s! y; r(I faced that once :-(
& z1 O& |) l0 V9 c3 @# d
* N7 S) [. W2 v: {) z$ i' XUseful breakpoint to detect it:: ?2 F6 Q9 A+ ]: ?" }+ l3 p- j
# y! M, `9 \( c* u8 K- J' ^5 Z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 {" n( }# x+ m) y# A- H
+ J8 w# y( N0 t5 N__________________________________________________________________________
H$ \% \3 ^; ^. L: k% U7 w) ~
, e) O2 z2 v$ |( Z) B Q
1 o' L+ C2 X- P( j* t0 _7 sMethod 14 0 I, F/ h+ O& D# I
=========. p' B# m2 i6 b
# v$ L5 u/ I1 o7 [; J3 w7 ^8 N5 YA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; i7 @& r% v8 l! F
is to determines whether a debugger is running on your system (ring0 only).& u# e- O' Y0 d/ P- t6 c; F0 z
8 \: V! g, Y) c8 B* l/ h
VMMCall Test_Debug_Installed8 I. O0 P# S3 B, w9 V! c0 ~/ a
je not_installed$ \) |, J/ O$ j8 v* I \
8 U8 z& ^; w+ t5 l, @& N5 e' |% V: {
This service just checks a flag./ u: C7 u2 g/ c5 F6 X. y
</PRE></TD></TR></TBODY></TABLE> |