<TABLE width=500>
/ ?0 e9 l# t$ W& F/ `/ N! ^. j( J<TBODY>
& T( U7 q. J5 x# Y<TR>: s, b) D7 |( q7 b1 |
<TD><PRE>Method 01
" A1 \) p) j2 k0 Y Q=========
& O2 d) t- X# E2 {8 a) h% ]
( c$ ?, b7 q' }: i7 w4 UThis method of detection of SoftICE (as well as the following one) is
! H% W6 w0 ]; L; W& W4 f% Iused by the majority of packers/encryptors found on Internet.; L; C& a% C( }+ A
It seeks the signature of BoundsChecker in SoftICE2 x' g1 A* f' g' H- D
4 Y9 P' `% O" s' W( E5 I: M mov ebp, 04243484Bh ; 'BCHK'9 w$ [. t' {( g+ y; y0 d+ A" f
mov ax, 04h/ ^ A' D+ `# h* m+ e! x
int 3 7 j$ M& Y$ ^6 U/ Q
cmp al,4
) c; p, A( B9 {: H jnz SoftICE_Detected
. ?; I' {( O M" n& k
7 }! m1 a# e/ ?6 E" @___________________________________________________________________________4 y2 Q% j* u9 _" n
* v. n A, K1 \6 hMethod 02
4 K- T4 q/ c! i3 o=========5 C5 X5 ~4 g% M: e8 W7 @/ d5 }
3 E; _2 i! g. W$ iStill a method very much used (perhaps the most frequent one). It is used! a! B. |) o' m$ L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' I" W2 O- Z4 j
or execute SoftICE commands.../ G% D6 x3 G) O# C, p
It is also used to crash SoftICE and to force it to execute any commands
5 I: P% B, s6 Q- ]' a& u(HBOOT...) :-(( - a* t) Y |" f$ V6 M! Y2 i
; h; L5 I ?/ b5 @
Here is a quick description:) f( z- |2 I) K8 M" a) e6 ]4 O
-AX = 0910h (Display string in SIce windows)) D/ z4 W6 y4 L( ^5 V: j
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 I9 Y/ r" q4 `' y f3 ?
-AX = 0912h (Get breakpoint infos)
$ j9 y8 y3 i1 ^$ W" }-AX = 0913h (Set Sice breakpoints)
6 g" t; D: P' l-AX = 0914h (Remove SIce breakoints)
0 m3 A+ e; b0 y& b0 e4 Z0 i6 t+ \
3 u1 }, Z, h6 U4 E9 E& TEach time you'll meet this trick, you'll see:
* b: C. N; e6 n* J5 h# |3 ^-SI = 4647h1 P# e9 a: p. R2 M, f
-DI = 4A4Dh2 y% T# p: k, |
Which are the 'magic values' used by SoftIce.
6 @( s* N8 a& p! g/ E! }2 `For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 {/ i" W# m' w8 O* X( u0 ?2 _% g4 ]5 H+ {) s8 D
Here is one example from the file "Haspinst.exe" which is the dongle HASP* R$ Q+ y9 t! F1 G3 {# s& {$ ]' e$ U( \
Envelope utility use to protect DOS applications:
6 x1 ^ E3 D4 m# t3 j/ j7 z2 i" [. ^% a1 I4 w" b
5 z9 N; Z3 a" l* I4 Z" [8 P4C19:0095 MOV AX,0911 ; execute command.
% z+ H! F T( Q1 I, Y* i4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
( _0 n4 L# ]6 T6 E2 z4C19:009A MOV SI,4647 ; 1st magic value.
# r( C7 w- n. `0 X! H" R" }4C19:009D MOV DI,4A4D ; 2nd magic value., `5 @. Y& g2 L$ C* V q; g
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& F/ k8 |/ m& l, d9 T
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 l `! c7 q" i# k4C19:00A4 INC CX
! Z, N" e% c" x( [# S+ a! A& x4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" W# R+ ]+ n6 J G9 q. t$ M. |4C19:00A8 JB 0095 ; 6 different commands.8 J x. c' m g3 O
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
3 ^- B* f# B$ u! G9 @4C19:00AD MOV BX,SP ; Good_Guy go ahead :); ^; `/ y4 [9 q: I% l, k+ N( i
, D7 y; [& w/ i( x* o2 Z6 `8 fThe program will execute 6 different SIce commands located at ds:dx, which
1 r0 t, S. C0 F' W7 T* | _are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
Z) m7 D4 k% Q( R2 T
4 o# U' E2 w7 V3 a, H$ t8 |' A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- q: v) ~+ ]$ b/ r- u! u }" A___________________________________________________________________________
* }" A) J- l' P+ c2 q2 g& B& k
' Z7 @7 s/ D+ W- X
; V8 W2 j; q/ \8 AMethod 03
4 i6 x2 \& R) x8 w: o+ d=========
D5 {. m0 H) J7 p% w7 n8 t! j
V/ y1 G3 n$ x% W! i# e8 d a' G) P$ qLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: e4 z& J& j$ u* q7 z) m; a; M0 W$ D
(API Get entry point)
: t5 L* I. V* G6 n) V- B, B4 t& r8 J
* Z S* X3 ]5 J3 G# ~& G
* z& v; K( e5 G, U& _. K. e" k I xor di,di
% k9 c. B' V& m I mov es,di
4 u; x5 K) {) y6 u mov ax, 1684h
v( D! R7 x& ^& f. `" V mov bx, 0202h ; VxD ID of winice
' n C( ^' D7 V( y: E0 W- N3 O: ~ int 2Fh2 H: m* ~0 j. `6 [7 i+ E6 K
mov ax, es ; ES:DI -> VxD API entry point! U, N9 }: e8 z$ [- \" l
add ax, di
1 p. }$ L+ W/ }- S* _2 s- @% H test ax,ax e- m& q6 S S) T, T0 q
jnz SoftICE_Detected" T( D4 W Y* L& Y, {8 m. e- j
+ E: [% C5 i1 b+ ]
___________________________________________________________________________
+ u/ I8 D& q' G% M6 g
2 L- {' V# O! Z, O/ jMethod 04
$ C. P" u* b4 ?! d=========; d( S7 ?6 w, y7 X/ L
! v* {- Q# V, X- I* P" QMethod identical to the preceding one except that it seeks the ID of SoftICE
. S& ~1 U; R" N6 x% Z' JGFX VxD.
1 S* @) a7 r; y( d+ y" D' o% H! a" B) T( _8 F6 W: C) O: \: \
xor di,di% y2 h4 @# R( q! ~3 e4 l! N
mov es,di/ ~. ^0 B5 g2 L
mov ax, 1684h
- \4 f$ _: a* h; @4 G0 M mov bx, 7a5Fh ; VxD ID of SIWVID
% F0 K' f2 z, K. c int 2fh
6 {" i8 f( D* R* v# \* ^# \2 Q mov ax, es ; ES:DI -> VxD API entry point
( o& P' D, t" T0 V; v* j7 D1 {7 n add ax, di
( t+ J v w4 {1 e8 H test ax,ax
0 _' {* C8 O* e. l4 N jnz SoftICE_Detected
! U) F$ B1 k" Q
. @# X s4 P# k) H__________________________________________________________________________
4 N+ `* z+ ]5 e/ Q6 S0 |) M9 T7 f) Q9 K) O. \" i L" x! I
( W. O2 E% M# ]
Method 05
1 v4 j( ] \* A=========
9 d& g% {9 y: c1 D. M
3 ~( g3 L& Z' e. f3 m' n8 r; O4 sMethod seeking the 'magic number' 0F386h returned (in ax) by all system' b# r' j& q2 r8 x/ Q
debugger. It calls the int 41h, function 4Fh.
# W4 m; b# r" u+ f+ f5 [; |# P7 o& cThere are several alternatives.
' R2 y8 n' u0 E; y6 M& u$ o( H p& m) t7 Y% F6 `; g
The following one is the simplest: M5 u H; K: _ X6 A
" I' V; G: S+ r
mov ax,4fh5 z2 {4 V8 P2 p- T
int 41h- ^9 t+ C5 o% N* |% u8 m
cmp ax, 0F386
/ [$ { e t' n/ Z jz SoftICE_detected7 `5 S1 A2 |! E X% ^% z8 p0 K4 K
: K6 e% L& }2 ?4 {. F3 E: N- S. X1 |+ W
Next method as well as the following one are 2 examples from Stone's # K. r0 C# g- t4 Q
"stn-wid.zip" (www.cracking.net):+ _# N# Y, ^( f7 y4 R
7 N! \7 b. }9 T. G mov bx, cs; p. ^5 o p+ y: r( V
lea dx, int41handler2
$ M. B4 ~0 u$ P6 I/ } xchg dx, es:[41h*4]% Y* Y/ O" j" r: j9 w+ u
xchg bx, es:[41h*4+2]6 T, G6 C" L3 D8 g, e
mov ax,4fh3 q& Z( S9 F) B1 V
int 41h
; Q# V7 x1 i Q! w5 L2 V, V6 n xchg dx, es:[41h*4]: f* |( L' H' n1 V* T' J5 k
xchg bx, es:[41h*4+2]
; j' A. O. o* u cmp ax, 0f386h
: W$ W3 }1 c9 w1 [1 V6 m. c! B jz SoftICE_detected
* N5 F, C5 ~: P2 U& m8 J
* B% ?: B) b4 s# @* ~& d3 gint41handler2 PROC
* _% k2 U$ z) A4 P) f1 n1 R iret
' [( [, s7 ^1 U2 y- ^: J9 sint41handler2 ENDP
" l8 i9 w7 V8 b; S8 A/ K9 p4 ^
3 b6 z+ {' ^) `6 P% i9 A; G y% t9 T
_________________________________________________________________________; i" r7 N$ d2 M; W# P! b S% G
}+ K2 ? S* w- Q- e
# v) F# y, q! F. }- S+ B+ E R
Method 06) p! S* H! j/ I
=========: ?# l; T$ S/ F/ ?" P9 ]9 P, S
! }2 ]- b4 X. _+ i/ O* q% w1 j, o5 ^ ]. s8 {* f: K
2nd method similar to the preceding one but more difficult to detect:6 F) T) k/ ^1 A) W+ D- Z7 l; y
7 e' r9 l) x6 p, u/ U& ]8 D% n* Y# A& T* U0 q" |8 S. M
int41handler PROC
~# {3 a6 m" F8 R mov cl,al2 E4 I' V E8 s c, I
iret
2 n3 `0 k$ z/ f) c" g9 B; u# cint41handler ENDP
4 W8 O9 {5 J* x9 @8 J2 a6 n D9 `. U% K1 o
7 p$ B F$ @) c# {
xor ax,ax2 m3 ?- ^9 A/ [: y
mov es,ax
0 N o4 e Q$ d0 p) Q mov bx, cs
% p9 \/ Z9 S4 {3 A/ x lea dx, int41handler# q2 y. ~9 s8 w* E) Q9 ^" U
xchg dx, es:[41h*4]
" o' e8 P# T1 G' h& e( H xchg bx, es:[41h*4+2]
8 f& |7 Q" h9 a, |* n5 k0 S in al, 40h
0 T8 E$ g9 ^& E& h xor cx,cx' f& i; G$ o( w$ @: a r0 ]
int 41h3 C+ j9 R e) ^* Z+ r9 A
xchg dx, es:[41h*4]
' s a D0 }8 I" U( B xchg bx, es:[41h*4+2]
% w9 i% H. m) C( X cmp cl,al: U. z: v+ C; y( d$ N
jnz SoftICE_detected, P- F: G' S# x1 y
?" a4 ]8 N% G% f9 y_________________________________________________________________________
: d- |; [, \8 q7 l
, N6 W! b! j0 }) q% |* d1 PMethod 076 Z' Y; {9 h: p2 f, O: w
=========
/ `2 E. m& b0 [, [$ [
% [6 W5 d; k5 ^+ CMethod of detection of the WinICE handler in the int68h (V86)0 y: m. M5 P% \+ x- |! _
% I2 c, H) h6 x# n mov ah,43h4 d. g& s r7 r& {* _7 o! n
int 68h) c3 Y& C, m! v1 P+ x
cmp ax,0F386h
/ C# a4 y& t0 B! _" v jz SoftICE_Detected
( o& |8 V1 e7 B5 n9 v; Y
9 H. W! n0 i* d5 C& o1 p& d, k
7 L2 s+ ?" s3 q7 k4 l- ^0 L=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 b6 U7 \# W x [ |; U& A app like this:
7 r/ n# a% e+ W
8 Z8 x9 X# a2 f* h% z BPX exec_int if ax==68# J2 M1 P& e; |4 w Q% k7 \
(function called is located at byte ptr [ebp+1Dh] and client eip is* O8 f$ |( S8 D
located at [ebp+48h] for 32Bit apps)7 T: q% A" i+ z& W) M
__________________________________________________________________________
3 _8 y X% G, n# i8 ?' o$ j, j4 F* S# I5 o9 b: l4 Z g
1 M$ k: b4 i. I9 [; I! [Method 08! _9 w5 E; r( J( g
=========
6 t* z4 b# }9 I- y" Z6 c
1 M1 \& J$ n+ S6 I2 g: [+ g1 @It is not a method of detection of SoftICE but a possibility to crash the/ ]* ^: y% a f
system by intercepting int 01h and int 03h and redirecting them to another8 s8 _& H7 |2 a, L/ }! z. R6 \+ Z; Y U2 j
routine.
& X0 l4 O3 k7 x( U& |" SIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& C$ k1 e1 G' H, Z) n/ n
to the new routine to execute (hangs computer...)9 o) k- C! \% E0 `
9 N* r Z% Z( W2 d& d3 i
mov ah, 25h9 T" c& S9 C7 l' T
mov al, Int_Number (01h or 03h)' R3 s8 {. i$ }- K" S
mov dx, offset New_Int_Routine5 s: c$ N! |; n' B; O9 i
int 21h* \: G H9 i; A: Q+ l) B
. Y L, A$ y( `- `__________________________________________________________________________
' g2 l/ n; a- ]2 e, o7 i# W& r' c! \ r+ O$ f
Method 09
" \% t1 x7 M8 r/ j=========
i- F& w- M0 t- o# M
1 _9 R5 X6 h4 P7 y1 t* UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: p# j2 J' r$ U a% tperformed in ring0 (VxD or a ring3 app using the VxdCall).
/ v" p' D$ k& H0 J: h5 bThe Get_DDB service is used to determine whether or not a VxD is installed
; k; c% i4 |. I. }- qfor the specified device and returns a Device Description Block (in ecx) for6 V6 q" t* q0 r5 p
that device if it is installed.
7 R1 s2 \5 _% _& M* u7 A1 p7 ~' [. E- ]2 J! z4 v
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' }6 g0 z E% \$ K mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- E! y+ [6 U- M0 n) \. O
VMMCall Get_DDB
# P* V* Y6 }# { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) ]$ g R1 s8 I1 b# ]
+ \# U# l! R, D' u# A% MNote as well that you can easily detect this method with SoftICE:
0 m5 k: A- L; T bpx Get_DDB if ax==0202 || ax==7a5fh
5 |% C4 I# }! t7 w! {
# \8 B! U) e1 p__________________________________________________________________________/ g' B' q% @# ^- z- x7 E. p/ k, {
3 _7 H, B1 p0 w. h% v5 qMethod 10
, U$ V4 `* V' \, Z6 H G0 l9 y=========
& x2 w+ H9 B; [% d8 h; R( ?
! ^. V2 m. A& F=>Disable or clear breakpoints before using this feature. DO NOT trace with* y: R5 ?8 c5 [2 V y0 [
SoftICE while the option is enable!!; i* p7 n5 Q# _$ w) ^1 H3 |* U4 x+ A
. j: C; Z' y W" E: y0 r; oThis trick is very efficient:0 O8 _* h" L1 g+ U/ k' i: ?
by checking the Debug Registers, you can detect if SoftICE is loaded5 x2 ~# h- ^- a
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: J$ L/ s7 Y8 z& m& f2 X8 vthere are some memory breakpoints set (dr0 to dr3) simply by reading their
- S" c& k2 k* c9 T1 B5 avalue (in ring0 only). Values can be manipulated and or changed as well9 w) m4 x* {7 W6 q. L
(clearing BPMs for instance)
+ r; ~* m3 b0 N& n
3 y( Z5 m! b4 k4 m# s__________________________________________________________________________1 s) C1 s; n. C2 x6 ]! ~
) p& {1 T, g8 Q b2 dMethod 11& ^+ X8 W- t0 k `5 C% A
=========
% d) b! Z9 {1 s8 i0 d: D4 E! W8 ?7 \# Z% X; t0 V- s! D7 B
This method is most known as 'MeltICE' because it has been freely distributed, v% B* y Z& X! y0 T! S
via www.winfiles.com. However it was first used by NuMega people to allow
9 g1 A. M$ M9 H6 W$ Z( {" _" YSymbol Loader to check if SoftICE was active or not (the code is located
M, ?2 O: @) Z/ h, einside nmtrans.dll).
& P/ U( Y+ Z; P6 i5 ^4 F2 O: a1 @/ M; W2 E" s$ A0 m; j
The way it works is very simple:3 m* k7 _$ b2 _, u' P4 Z \3 S
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for3 L" O1 ^, d1 W( I1 }% E) G" S
WinNT) with the CreateFileA API.
: v6 l- g) Q" }& v' D! z% O0 p4 n- F! @! s& U; [
Here is a sample (checking for 'SICE'):
2 l8 C/ ]; a* [2 h% n" C6 P
1 \4 R% j7 ?: @/ {BOOL IsSoftIce95Loaded()0 g8 `7 ?3 O% X4 S1 _7 V w
{- A. O9 |2 W1 M# [$ k7 M
HANDLE hFile;
) Y8 ]' Z' l, s9 |. @) Y7 r! s hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 x+ z! z9 ^7 j$ X FILE_SHARE_READ | FILE_SHARE_WRITE,
. R$ J! S! z5 l9 n NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 e! Q- s" f! p/ @" F4 P
if( hFile != INVALID_HANDLE_VALUE )
1 w m! G# b2 v3 W2 R6 p, L {
" d) ^& m( V7 T O8 `' p" I% S CloseHandle(hFile);) P9 v q& ~8 P" Q, Q4 E
return TRUE;4 R+ W# a7 M2 T( w
}
' `" `# b5 x! `# D. T7 T3 o( N$ p return FALSE;3 X2 w2 j9 ^& ?9 j
}
* O( v2 E0 j/ a% d) M! y8 _7 x; }6 w+ b1 O) Y. T, I
Although this trick calls the CreateFileA function, don't even expect to be
7 }( K+ `6 |: i3 Q: yable to intercept it by installing a IFS hook: it will not work, no way!
3 | i1 `: t, ?7 m5 q" JIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) o5 O% u7 c/ n# J* a% ~
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& h/ V+ A- q% t$ y6 A+ Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 i$ @! F' U0 v1 ]8 C6 d% ofield.1 {1 B9 r; {3 ]) ^
In fact, its purpose is not to load/unload VxDs but only to send a * s8 q& t N& H
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' q; P* i2 L# kto the VxD Control_Dispatch proc (how the hell a shareware soft could try- d2 ]( E0 `: o4 }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 N7 s3 {0 p) `, EIf the VxD is loaded, it will always clear eax and the Carry flag to allow0 V* V6 S# @& d! m* O) x4 [+ r
its handle to be opened and then, will be detected.
9 X& U! O" I- f" q7 v" Z% S {4 l$ ]You can check that simply by hooking Winice.exe control proc entry point- S# R. o8 o/ u8 u9 p& O: ^' }( b# [5 ]
while running MeltICE.5 I2 t4 Q1 d, W+ Q! K2 I0 r7 T' i
- |0 y3 Z0 G G2 i
" J" Q3 V. v0 k# _ 00401067: push 00402025 ; \\.\SICE2 |8 Q2 ?' c# C6 `# m
0040106C: call CreateFileA
; G- { D6 h+ l! x# m$ I' K 00401071: cmp eax,-001
" d+ A2 ^) @2 k% e! w: l 00401074: je 00401091; ?% ?! d# M4 \
$ c! c* V* c7 x3 H) S9 V
6 ]: X7 S$ @, Y5 A2 T
There could be hundreds of BPX you could use to detect this trick.
8 W/ {$ C5 E" D8 Z& n- P-The most classical one is:" @$ a: o" z$ ~) {3 h [. f
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||% V/ ^: k5 I( u
*(esp->4+4)=='NTIC'
$ T% e. `) a* A& r! ]9 Q# u, o7 J, t% W! J) V8 x) U5 Q
-The most exotic ones (could be very slooooow :-(! l) O' X, o0 |8 s7 M/ A7 { t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 {" w P" O# M ?. D8 R# t
;will break 3 times :-(
- l& p8 V8 W, C3 ^( K6 S
9 @/ [, P$ {5 x* E. {/ B+ r-or (a bit) faster: ! v* h' i0 \! ?( m& G
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 j- V2 Q! A5 ]$ [- Q
+ h" N# x, w t* O
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! G, Q7 b2 ]) J" ~, ~5 [
;will break 3 times :-(, \; Z; h1 |" l; R6 B3 I! |
" z Q8 O* g/ R* [-Much faster:
M6 b( T7 U* z ]. t- Q6 F5 q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
C! ?" c* Z( ~4 X6 \( v- h
0 h- M) Q3 x. t0 W( {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# J* D/ Y, X- g8 l7 ?function to do the same job:
& @( J3 \) C: l
2 L+ J, ]: m6 `; j5 Y push 00 ; OF_READ
' e$ z, L$ b- n( @ mov eax,[00656634] ; '\\.\SICE',0
! \1 f! y: n- F/ L push eax
8 j& q" v0 |2 `, t2 X call KERNEL32!_lopen( Z" L7 R Z2 N. Z4 J% |7 ]; G
inc eax
" y, _+ x8 K8 c& {! z& L, }) G3 Q' b jnz 00650589 ; detected7 l9 P5 O8 Z) O. H) ^5 g1 {
push 00 ; OF_READ; J" }7 Z) p) ^, w- U
mov eax,[00656638] ; '\\.\SICE'
9 _5 S+ J4 k. x; A push eax
0 P7 P# h; |: h' `7 P6 s% \9 e call KERNEL32!_lopen
6 X/ c0 v( ]( \4 L( {7 S inc eax& F: r- W' d. Q) f; t, D- e) \- y
jz 006505ae ; not detected
, |1 @" W3 }/ F. {
# {9 p: t+ C7 U; r) E8 Y8 X2 S3 y3 C3 R
__________________________________________________________________________' @1 R7 R ~8 g/ x& G' c; i
% z/ m- a" X# E
Method 129 I- R+ e; F% `6 T! f9 c1 v- A
=========# m7 T- @6 J# y5 e- Y
0 |8 W; R- X1 Z+ Q2 F
This trick is similar to int41h/4fh Debugger installation check (code 05% e+ v$ `& s5 u5 p0 z4 \
& 06) but very limited because it's only available for Win95/98 (not NT)/ h) {6 b3 s0 H K; r
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
I# ^7 ]4 `: \9 I; I/ a3 g! `; Q* ^9 `! G$ F# ]9 P5 V
push 0000004fh ; function 4fh
9 }, T6 ]/ ]: ^2 M+ D- \1 ` push 002a002ah ; high word specifies which VxD (VWIN32)3 k; A( H6 V; c+ D% J2 S5 G0 H
; low word specifies which service
) }, M4 [3 ~+ g$ @' | (VWIN32_Int41Dispatch)6 y' F5 p7 K z! V! r% k ?
call Kernel32!ORD_001 ; VxdCall6 z! }9 ~ M8 H. Y7 f3 C
cmp ax, 0f386h ; magic number returned by system debuggers
( w, Y' L1 c# i6 @0 m6 \ jz SoftICE_detected6 \, I# ~$ a, f) t4 B! G
/ O! r( C* \' W4 y0 G
Here again, several ways to detect it:( l; _. s: t K. S4 t# M
! Q9 T( \1 U9 Z BPINT 41 if ax==4f! j0 u) ~1 N8 V6 {
+ d% x* I; L* C/ M BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) b) b$ D% |" Q9 c% V7 k# v
" ]/ q9 f: T# a* S, d* O2 H' j BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ ]6 W& c! k X* k8 `
9 B5 _& M% X4 e! _5 ^; [$ u! k1 Q BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% W# l' C. W3 l+ I# z" @& J
) q; L; J/ q& O( t- z9 c__________________________________________________________________________4 O N1 \& S5 {; Z8 c" }7 ^2 q+ l
' S% e: F: L7 U
Method 13
$ C) H' T9 {! n# N- {=========
" S5 A8 X: @8 Z& J% q" K) L3 K7 Q% J4 r6 t6 {( r, K; j7 g- M, ?
Not a real method of detection, but a good way to know if SoftICE is/ s3 I* a; q( z) y) t7 O
installed on a computer and to locate its installation directory.+ l. \+ Q E" J+ i
It is used by few softs which access the following registry keys (usually #2) :9 A: b6 Z+ I' C7 p" X, k* f
; ]0 C3 G; g9 [! m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; b- D% p* m( i/ p2 V% J: z\Uninstall\SoftICE& M$ C$ P$ ?, S/ i' r9 A( T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
* K9 U/ m: o( `7 T8 u-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* E( a* s3 o1 O/ s+ {, d
\App Paths\Loader32.Exe9 g' a. B) T9 _ x8 u
3 u5 [$ }- o! g z3 R
! m* @, P3 r. l: r( ]( v) Z m {Note that some nasty apps could then erase all files from SoftICE directory
+ I( k& L% _6 r2 z" A7 Q(I faced that once :-(
6 J Y4 R+ u* G# V4 g
& z Y$ e ?) p# }8 LUseful breakpoint to detect it: d1 s& C% h( L8 ~' u2 b- R* g4 _
* F! g4 ?3 d; A
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 c( A# c6 ^! e+ Q- R! K6 Q A: O
) w$ w' |: L9 {8 R8 E, g6 b7 D__________________________________________________________________________
5 M3 g& W7 U6 y6 b4 ?1 g7 ?- r W- N& z4 d/ j
H& D& g+ W Z# n N
Method 14 . \6 H0 G0 m+ v9 L; g% m- k
=========- Z3 a9 Z( M1 N9 U% h5 `' ?
B+ K% h# j. I6 h c4 J* ^A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' T) P, f/ h! q) d t
is to determines whether a debugger is running on your system (ring0 only).0 {& v m O, E* h1 M$ a2 T
1 c5 `: h8 D) o. ?& l2 G VMMCall Test_Debug_Installed
" S" E Y& z$ ~/ w/ Q, ~) k% _ je not_installed- U, k# B; j4 S0 P' B
( c2 H' V1 }$ E3 `* S
This service just checks a flag.( P/ c( Z& c, E5 S% K7 i: j
</PRE></TD></TR></TBODY></TABLE> |