<TABLE width=500>2 a, g9 R) p, R1 {
<TBODY>" G1 j6 i) r4 F# P7 J1 Y
<TR>
% u0 u0 ~$ `' f& H<TD><PRE>Method 01
- A1 Y7 v0 U: q7 @; N; r=========# c3 v8 }) {* @; s8 F; ^! \+ Q% O
% Q6 V& Y2 k1 x. U/ T. u4 gThis method of detection of SoftICE (as well as the following one) is
5 f) W% u# x5 W P* M$ l% l$ `+ E0 `- |used by the majority of packers/encryptors found on Internet.& V2 @5 x9 }- Q+ u4 W4 x
It seeks the signature of BoundsChecker in SoftICE
' n' L3 j9 B ]4 D/ {4 P% |$ g* [2 P7 R1 P
mov ebp, 04243484Bh ; 'BCHK'
4 N& h% L) B @- K, n3 y1 p mov ax, 04h2 u& a: k" S! c' z2 B6 Q" w; N
int 3 ( b$ P; d* R- b. ~9 e* C
cmp al,4$ l' i9 u- v; g1 |8 k! v
jnz SoftICE_Detected
, ]: y& |9 x, U) [4 P* Y6 _) M1 [+ S; }) L; U* S, m
___________________________________________________________________________- B# S/ J% j* F, g# P/ a, J
: Y7 U" d1 h" u v6 H
Method 024 Z: z3 f* X b3 S' K$ C0 ?! s
=========
8 [# A& z, q7 A6 j0 {% `. Y) D( D$ |8 K8 u" W9 d
Still a method very much used (perhaps the most frequent one). It is used
- k, j6 f" u7 N4 Yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" e+ b* V+ E2 f Y! [1 E8 C eor execute SoftICE commands...4 k4 i" I0 O! ]
It is also used to crash SoftICE and to force it to execute any commands
: o7 R5 d: N9 B9 {% ](HBOOT...) :-((
/ g P$ w' q& k& J, O! y- {- i9 n' R8 R
/ F {" W6 M; a6 ?8 G! \$ R1 XHere is a quick description:( ` @3 q1 N7 _! D; q
-AX = 0910h (Display string in SIce windows)
+ {: y3 J: L' P* N& ~-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, ^* t8 E- C n K-AX = 0912h (Get breakpoint infos)# C; u1 s8 \& j9 ~ Y# y
-AX = 0913h (Set Sice breakpoints)9 S6 h4 V# `4 X* l+ H
-AX = 0914h (Remove SIce breakoints)* h, O W- N* U- t' q; h
1 P- i' v' q, gEach time you'll meet this trick, you'll see:. `. z* Q2 z5 K h. \
-SI = 4647h* T% {2 K% x& f4 w$ }
-DI = 4A4Dh
/ M* v& {( Y1 `4 J- \3 hWhich are the 'magic values' used by SoftIce.; O4 H0 a& \( j+ r
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' c9 ?: q+ p0 f& ]* r4 K5 s) R, D9 m, g$ P3 G# ]
Here is one example from the file "Haspinst.exe" which is the dongle HASP5 T& V8 V8 ^/ d; c' a8 J
Envelope utility use to protect DOS applications:
# I, R- a6 W1 a- b& d, M
k0 m6 K, g( I6 A( q4 L
, N/ @6 \% u6 @: F3 O! X& g4C19:0095 MOV AX,0911 ; execute command.+ G% u: {+ ]" Y! R9 D6 Y5 `" I
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 `: f- A5 g: w; i4C19:009A MOV SI,4647 ; 1st magic value." }+ |2 S' N* o& [ v4 |( M- d
4C19:009D MOV DI,4A4D ; 2nd magic value.$ E# h' a% |) a& |$ `* y- @
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! T7 ~' @; o e; `, u0 H5 H
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 Z7 G- V/ E7 [5 R! B2 P$ }! D
4C19:00A4 INC CX
6 P( m! k* }6 v2 b' r; Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( A. o4 n+ _, E' n& E% L4C19:00A8 JB 0095 ; 6 different commands." J# O# Q+ D H6 T( ^5 e& i- C# J, Y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.# C+ Y, |: r0 Y A U) ?, [
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 k" N4 R O. N$ o
% G7 @7 \' F, S- t
The program will execute 6 different SIce commands located at ds:dx, which
|% W0 O; c8 y3 a! i8 hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# E; }" e% e7 C% Q, a4 p4 T3 q3 j O8 H" W _/ G
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
g- X' ?8 k' `! F0 H___________________________________________________________________________+ Y) R D, w# D: z5 F
8 b7 w+ a I6 f
! z# W/ z' Z9 @Method 03' f, h. X6 e2 _1 m: L) c
=========
% O3 q$ I8 O# o% i: ?. K! O
$ S3 {6 r! A9 d4 `9 SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h2 k8 u" K- S2 s: l" {& ?+ J8 Q# X
(API Get entry point) L$ a" m- {' N- {: @
- p% z/ n% m* j2 m( R
* V) d, @8 B* s9 C6 D- `0 ]4 A* v xor di,di) B7 W! o1 Z; M& k
mov es,di5 L& R8 d" Q# ]* ~: e5 L; f6 b! [
mov ax, 1684h
' ^! N' q* B* [+ U) _5 p# O- u2 A mov bx, 0202h ; VxD ID of winice
) _, @ E- ^3 \& `9 | int 2Fh
J- U4 M I) x9 X1 `: x) B mov ax, es ; ES:DI -> VxD API entry point, c9 b/ I( M; U* b+ V4 e
add ax, di
0 x6 v. w. Y5 o: j test ax,ax& k) z6 r% q0 e
jnz SoftICE_Detected
# c) i4 M4 H+ T+ \$ u$ r. W# n) n; M! U# R+ ~2 i( ~4 [6 ?
___________________________________________________________________________! {- s% i1 N0 L( ~4 M7 v" X! v
. p/ U: @' y L ~, K0 n+ ?% T, aMethod 048 ^- C3 T9 [& T
=========0 F# _# U! X) x
! w0 c0 o6 h9 X/ p* H, NMethod identical to the preceding one except that it seeks the ID of SoftICE
: O. ?9 ?( @& D, {4 r3 ]4 tGFX VxD.
, v" h% r0 P+ Y% B1 I
% n3 g, A5 j$ ~+ ?5 I$ I6 j xor di,di
9 @2 @% T+ }7 M3 u G mov es,di9 `( i8 H8 R* [, Y9 F/ k+ A3 }
mov ax, 1684h
5 Z& A5 J6 [0 X& V' E2 j: C3 [ mov bx, 7a5Fh ; VxD ID of SIWVID
( e' Q* S- V. |7 Q int 2fh
; j7 v0 r+ g$ P! P6 u3 U5 \ mov ax, es ; ES:DI -> VxD API entry point! m4 i6 k# _' K* s4 q6 U" t' w$ f
add ax, di
3 Z1 D. c; O4 `1 a test ax,ax
* w* M- \7 r( j, g' ? jnz SoftICE_Detected6 }9 J" a; X9 S8 z% x
5 E, I" ?/ C9 y* O& y5 W
__________________________________________________________________________
, S( D, E" I1 Y3 t) O4 \' M1 p7 E! `3 A3 N) ?, @3 {: D
4 X5 w3 g2 Q* T
Method 055 Q/ R8 u, H) G) H$ l& N
=========
, a( h8 j, R9 c* z3 X- |$ Q( i/ j# R7 w! Q v# `
Method seeking the 'magic number' 0F386h returned (in ax) by all system: C5 C4 f# L( j' C# g: n
debugger. It calls the int 41h, function 4Fh./ s4 Q+ q5 _4 c6 o8 d
There are several alternatives.
$ X7 Y- ^9 W _+ r' g2 A
! A: V$ K* E; s7 z% r2 G, zThe following one is the simplest:4 X: |- _( O9 z' i, U
* d0 D9 z6 S" \. V8 | mov ax,4fh
3 K5 _8 ?% Z, z int 41h* l. I! l2 m7 w; O) j
cmp ax, 0F386
% B p+ u+ i6 t* a. ^ jz SoftICE_detected
1 ?+ D, a1 e5 F, R& }( D& Z7 `9 F: H9 {" o. q8 v# o7 H. _5 M6 w
0 f) l5 Z2 U2 K) R. l. W2 h8 ]
Next method as well as the following one are 2 examples from Stone's
; {& A( t8 z: f9 G- j* u$ n+ o"stn-wid.zip" (www.cracking.net):
( s, p2 F' ~, o4 {6 D2 U7 R
8 I/ n& Q5 ?- }: H F8 c% i mov bx, cs
5 e& G% s9 D- L( O2 G7 h) W lea dx, int41handler24 Q, U0 N" T$ \, A3 X& C' v6 v7 l* W
xchg dx, es:[41h*4]
8 i1 a; t/ P7 t) |" q! l xchg bx, es:[41h*4+2]- ^. B: j/ n% O3 F l
mov ax,4fh* [3 U) b7 `0 V9 x3 T. I7 a
int 41h& S( s( i& g9 V8 D3 D3 q
xchg dx, es:[41h*4]
/ t( y) \' Z( K4 M xchg bx, es:[41h*4+2]4 r4 N7 o4 L2 M8 g( c
cmp ax, 0f386h
) L* @! G$ L2 Y. h4 K% y) @! Q jz SoftICE_detected
5 \+ z& I$ O3 b8 a- W$ F5 C) X9 ]4 w4 r' R" o) M
int41handler2 PROC' t& u. R1 s0 F! ?0 s& a1 ^
iret6 w! l( I3 U) h+ V' ?9 p- y
int41handler2 ENDP
/ w/ U/ ^5 V6 [8 G3 X4 q
$ K. S2 k5 s# T$ p
: k/ J3 Y: {0 h+ m a3 M+ n) g_________________________________________________________________________+ Q! c8 y2 ^" K6 T
. v1 T2 \% u0 Q3 p, I, |
8 U8 k7 h4 j8 s
Method 06
$ a, q6 M `3 e- I1 \8 L$ h=========
2 O7 n3 p* r, Z8 _- `2 J, B4 w' j, x) L X7 e6 ?
( O( Y: F% i" H7 ]/ z) {5 `
2nd method similar to the preceding one but more difficult to detect:
! |% y8 N9 w( Y, W$ L, U) ~& t ~" S1 t' B& \
9 l- ~2 F3 v9 k9 J9 oint41handler PROC
, i& A: @& T" [3 { mov cl,al
) {* {. B* m1 z5 u* W! z iret7 g2 d2 H. o0 ^/ j F& b
int41handler ENDP
# x3 t' Q) p0 b1 @0 Q& K
/ `5 e& e+ J, O/ Z3 ]2 e( K. q7 w7 y
xor ax,ax
& n3 a+ P2 ]- ^ mov es,ax
0 d* ^5 t; X: o8 R! { mov bx, cs. N1 z! {: q. ^4 h( F9 S9 {
lea dx, int41handler
% X4 V" k+ E3 n5 `) E3 \0 F xchg dx, es:[41h*4]3 j+ O8 X8 f) y) h( I
xchg bx, es:[41h*4+2]: L+ I2 g+ S4 d1 D
in al, 40h! k% ]+ _. c" R0 D. V0 x- m* x
xor cx,cx( N* l6 `2 e. D' H
int 41h
1 Y2 F) r- ]1 i. ~ e xchg dx, es:[41h*4]8 O, k( t; D* ~" k; y9 P
xchg bx, es:[41h*4+2]7 O5 t$ Z. ?1 Z0 Q$ H
cmp cl,al
+ d8 t2 @7 M0 g9 T jnz SoftICE_detected+ Q9 _% \, |- y9 _4 `
) W/ @4 Y- Q% I% G_________________________________________________________________________+ _+ c5 X5 u4 V; P2 x b
9 k0 q5 i, K, I, z* {3 A- RMethod 072 Q6 [1 g- {: W- ?1 C) L& ]
=========% R* e4 j2 k& o+ J
8 K, P9 v7 n) f C% y7 `
Method of detection of the WinICE handler in the int68h (V86)2 Y9 @5 `) J6 c/ A5 t" |
# L j: l7 A/ Y! X" u
mov ah,43h @! ?. w& O* e1 x1 A6 j7 J
int 68h) r, _ |' x) Y$ e" Y$ C
cmp ax,0F386h
6 z0 H' L% v2 }6 j+ |! l jz SoftICE_Detected
, L& D5 f' T$ t Z* I5 ?' L
, C6 A3 Z6 C* z9 K: R
4 F: S% W/ @0 T0 I/ ~$ u4 @=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. \$ {1 t2 ?, B/ y! }
app like this:+ Q [/ C( y( [' s- Z% G
& ]( a3 {! O7 D1 e k& V
BPX exec_int if ax==68
; i# k" H2 t3 W# m$ Q (function called is located at byte ptr [ebp+1Dh] and client eip is
) Z8 u/ a; @7 V" ^ located at [ebp+48h] for 32Bit apps)) n, f3 X% ~* w: q1 c
__________________________________________________________________________. l' z/ T. j; e) F [
_* c+ f% F D+ w" o3 _" T A2 G/ r, e4 f" n8 C
Method 08
. C1 X- ?9 c y* e. |, l, E=========
$ V& d$ S: L, M; L
: F1 Q* H8 x0 y* y, D& a& cIt is not a method of detection of SoftICE but a possibility to crash the
/ o0 k9 E- A* M/ w/ Xsystem by intercepting int 01h and int 03h and redirecting them to another
1 W$ m, P$ E x; _2 t! V$ Sroutine.2 v6 U% A$ [8 I; }: `) K8 F7 X2 j( N
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ x( n0 m3 ^+ o q: F, H
to the new routine to execute (hangs computer...)
]7 O: V6 c" Q
; c. h2 p/ s. p# O5 U2 D mov ah, 25h; d" S5 r+ J( L
mov al, Int_Number (01h or 03h)1 h' ?7 k! j0 I& X
mov dx, offset New_Int_Routine' i! X* M& g# D, T' b# e8 R' F
int 21h
3 V3 V: t" u2 v# @1 a. E+ n
% c# o _5 F- ~* R, O8 l# r__________________________________________________________________________/ b: R D3 Z8 l; r1 {
& q& W5 k) Q8 j4 ]+ V& e/ b) a6 P# hMethod 096 J" Q+ g7 u; i6 c' R$ C8 R+ o
=========
k @/ ^0 y' ?3 U% m" S6 L ^$ j1 E3 j8 b5 M$ @. H
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: g6 U; {0 e# ^; A9 n; l/ q9 Kperformed in ring0 (VxD or a ring3 app using the VxdCall).
! B4 ]3 k& Q w5 G& ?The Get_DDB service is used to determine whether or not a VxD is installed) K$ p7 J1 z8 k, p
for the specified device and returns a Device Description Block (in ecx) for" [0 L3 H; w1 @9 t6 e
that device if it is installed.( L$ M( [+ q+ H7 T, q c
: A8 Z1 t9 a/ F1 }6 d9 k) u! V
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 X/ Z% \* g6 S
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 u6 i' ^, a9 d) P
VMMCall Get_DDB* }3 c. k+ ]5 `# }4 z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
p7 ^+ [7 x" ~" j4 w$ a% @) r; V" O- n6 P- h: o% O
Note as well that you can easily detect this method with SoftICE:+ m' V0 d1 C* O c, z/ E% U
bpx Get_DDB if ax==0202 || ax==7a5fh
4 x5 F% H$ c) c6 m; j9 t( W1 q% L
. W' ~7 P+ k7 Q# [__________________________________________________________________________
4 \# \# o3 b" Y" x$ h; V- h D) G: J. ]* O. t
Method 10
7 t3 g/ {9 R4 B7 ~/ g=========3 O: U5 n( @* L' m- W/ b) |
& j( t& @& q* ~% F r9 W=>Disable or clear breakpoints before using this feature. DO NOT trace with. H: c* Z: @8 U H4 H7 W
SoftICE while the option is enable!!
- B! K% M- b3 r
( N' X; g, Q- K% J5 }! i0 yThis trick is very efficient:# N0 x$ N5 G) k7 Q. ?& S4 M
by checking the Debug Registers, you can detect if SoftICE is loaded
5 v7 O/ T; v7 S. r$ G(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ k+ v6 j9 x- S* Z2 R$ wthere are some memory breakpoints set (dr0 to dr3) simply by reading their7 Z7 W) M* T$ O; }) o& h+ Q
value (in ring0 only). Values can be manipulated and or changed as well* c- w- V& k8 |/ v
(clearing BPMs for instance)
# i J+ v5 c) N8 J/ C4 q
! g' U2 j7 I$ N- x__________________________________________________________________________
# w/ }' T7 G2 D5 f1 ~; p4 I) Q& i
5 h" z: k# o& JMethod 119 n1 ~1 a2 G% r
=========4 O$ p2 s H5 B' J
; {3 m$ z6 ]+ P4 |: F! `This method is most known as 'MeltICE' because it has been freely distributed$ L3 X( f& T. h% z: H s: Z* F" p
via www.winfiles.com. However it was first used by NuMega people to allow
5 e: b; E2 ^; xSymbol Loader to check if SoftICE was active or not (the code is located5 l1 E$ Z( G4 X8 ^/ H
inside nmtrans.dll).
! B \" H& _* }" s1 k& l9 v/ [" W
The way it works is very simple:* H. h7 T1 ^& p
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
8 N; i9 e7 e! K6 G5 kWinNT) with the CreateFileA API.
4 v* N& n2 K8 P9 W+ [. }& o
3 r3 m6 P } B+ K) NHere is a sample (checking for 'SICE'):
" K& t+ [+ B5 F/ ]- k8 R7 `+ {' P5 {6 j ^) O+ {
BOOL IsSoftIce95Loaded()
0 U \! Y' }7 j9 |& L{& z/ Y# a) I$ T; Z) x
HANDLE hFile; ! T$ |8 }' M$ T
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! n( e, b4 \4 D6 P- D2 X- @
FILE_SHARE_READ | FILE_SHARE_WRITE,
% x. s) { e2 p, u" @) k: Y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, K0 K, b. H. N5 q2 Z2 w8 e& a
if( hFile != INVALID_HANDLE_VALUE )' V F' { c# a3 m% n
{& G8 E& V% t0 p0 {+ g0 i6 E9 q
CloseHandle(hFile);
/ N0 [: {0 d+ q' n# k0 j return TRUE;( Q: s, {( W# \" R0 ]
}
% ?# n ^( W9 \ return FALSE;
6 N5 F# D& `3 n}
+ V% @: v/ ], N5 ]. H% C* K. H. x% ?+ l8 I8 J7 ?# d( ]* G
Although this trick calls the CreateFileA function, don't even expect to be& _! s' n1 h4 C9 [
able to intercept it by installing a IFS hook: it will not work, no way!
; ~. i9 a4 n& j, cIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 v- x/ y) o) f& F5 R5 Wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 e1 i! q$ \# z/ Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ d9 T7 j5 Y* ~: _
field.
& u3 L1 q1 M; SIn fact, its purpose is not to load/unload VxDs but only to send a
* \/ \! F8 X T( [W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 V; T2 \' u; v$ a& |, o8 }
to the VxD Control_Dispatch proc (how the hell a shareware soft could try# N, K% L c' N" ^) v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).6 Q1 B' L6 R. u# y( q% s
If the VxD is loaded, it will always clear eax and the Carry flag to allow7 O& M' O, M. |0 S' V( ]
its handle to be opened and then, will be detected.% y8 ]5 M5 Q. b9 R( X" x8 f
You can check that simply by hooking Winice.exe control proc entry point
/ \+ G7 B. ^: J" @7 N" J! E; vwhile running MeltICE.
: M" M9 G' D6 V% o- i
& l: O9 C0 C* {& x7 u- ]. i$ B5 j0 q$ e
: c' f4 U- h+ X 00401067: push 00402025 ; \\.\SICE+ ^/ d9 q! P' |9 R$ x
0040106C: call CreateFileA( Z4 c8 F$ F+ Z0 k3 X* ~
00401071: cmp eax,-001: s( S* m. b9 q- S) @. U
00401074: je 00401091: S2 {8 ?; O) X3 s0 _$ R7 z
$ [1 q0 Y. h1 U' K& w2 j
* g& A; [9 x) X: m7 }
There could be hundreds of BPX you could use to detect this trick.. n/ x0 Z1 ~. b2 @7 E& r+ `) S6 U
-The most classical one is:
" e" I6 l: t1 _. H1 j% x BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. w8 U! m) Z1 `# @% A' {" f *(esp->4+4)=='NTIC'
' t- K& Q" }2 a6 B% ] T" s% m, l h
-The most exotic ones (could be very slooooow :-(
. l' @: m7 p, Z% Q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. L+ f( }8 q7 b7 F$ Y6 ~6 r3 {0 { ;will break 3 times :-( y7 y3 ?- l1 {6 E, h' H
- m- w* v* ]* z) N-or (a bit) faster: 9 ~8 w3 t5 J: r- V* X; h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): A7 J& a% n% ?7 b( m
$ v2 V8 W" L/ G7 P
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 }& P5 J8 y s, g. _) d ;will break 3 times :-($ _6 ~" f/ N* \ y, V6 K7 q
5 Z" q$ N- W: [- Z1 B W-Much faster:; a0 F B0 j2 }( s8 g9 H2 k; w5 S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( X) d3 A8 L o {: c: G. v0 y9 F& Y8 m
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( N* v9 \ c( {1 O" x8 l5 Dfunction to do the same job:( N. @: [- j- f! p/ s K% v8 }
$ k8 g6 x' b0 N push 00 ; OF_READ/ J1 y* T& B% |. T2 W2 s+ H
mov eax,[00656634] ; '\\.\SICE',0* u* n9 u2 l; S/ k) ?
push eax
% Q5 Q& A7 S+ n' N" N* u call KERNEL32!_lopen0 ` ~* X$ c; |( ?
inc eax! B3 ^8 S" U9 C5 a
jnz 00650589 ; detected
; F, \6 i$ o/ I% g9 f' y' S- d push 00 ; OF_READ
* l* _! d1 m0 z mov eax,[00656638] ; '\\.\SICE'
/ W8 F& c: X- m push eax
# M! Q( M7 m9 H call KERNEL32!_lopen
, h/ M, q( ^' @/ Y, V- R inc eax
0 G# f' o6 o; J2 Y& M+ d jz 006505ae ; not detected
+ f+ {; H$ k" d, \+ Q8 {( J# c: f0 X1 B" n- s3 T
/ `3 q' D0 r* a4 i__________________________________________________________________________! o3 K7 c- | L# Y! y3 y- E0 `
' g3 \) x3 F- x& D9 V+ y6 x0 tMethod 12
h# k# `, @7 R1 p" e/ t=========
8 D4 x0 s# d2 {5 {
, W/ Y2 Z6 d _, n' c% r7 U6 bThis trick is similar to int41h/4fh Debugger installation check (code 05% ^0 `' W; `& ?" V
& 06) but very limited because it's only available for Win95/98 (not NT)
! Z& k) W- e6 o k- M2 W# z" ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.* X6 `- z8 s m3 m' b/ T9 r2 e+ f
$ H- D, ]$ U& V- U4 V push 0000004fh ; function 4fh
5 z5 f1 d P" M- t push 002a002ah ; high word specifies which VxD (VWIN32)" S7 O z2 I/ V k. j4 I4 z" C
; low word specifies which service; ?9 Q$ h$ ?, U6 ?8 k$ \* M
(VWIN32_Int41Dispatch)! u% G, r* O/ v+ i, G* ~! Z
call Kernel32!ORD_001 ; VxdCall0 t; b) F* z L, W" S, f
cmp ax, 0f386h ; magic number returned by system debuggers9 i; M; q! p4 B- u9 o0 Z# h
jz SoftICE_detected6 X! u! ~( v9 H- n% g$ D Z' F9 ^
9 m$ b4 h" h; F; X' f! ?7 N
Here again, several ways to detect it:4 I, |3 c% x: X1 q
3 d0 Z* C1 B1 g3 n
BPINT 41 if ax==4f
' ?& W4 U9 Z4 X$ R' y
- B3 r8 R: C' p; ?; S4 K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: h$ Y0 F4 \- |/ ~( k- E$ U6 I) L
3 l/ C, A _7 s
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! W2 f6 f0 T! N3 i
6 V- [# ]1 m% @% B BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 e; a+ I1 u6 G. _- c
$ d; t$ P j' {! y1 B% }% f3 |__________________________________________________________________________
5 X" { t- u! w5 l
( i% @. o2 Z& t$ E) TMethod 13
& A, k2 Z8 x+ w=========
! S6 \/ r: F1 W0 j& j3 W/ Z0 g6 O8 V$ P6 H
Not a real method of detection, but a good way to know if SoftICE is9 V) N# m4 T6 H; x
installed on a computer and to locate its installation directory.
9 ^" J* o) }' R3 f7 }' \: }& oIt is used by few softs which access the following registry keys (usually #2) :
. I% O& i3 B& F% T9 T- [/ j! T
4 _0 [2 u& h+ N4 f-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- P. F$ M$ _- l+ C" @
\Uninstall\SoftICE
- S; G# i/ U' w4 Q8 u-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 H3 u9 F6 z9 M3 G+ u
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' Z4 n+ o {6 p% f' u4 w, Z4 Y/ `) q# m
\App Paths\Loader32.Exe1 y" L. i0 a o) H" j
7 n2 B1 Z) p! u' Q4 E$ J3 }
: f* Z' F9 X* U1 V. w6 F
Note that some nasty apps could then erase all files from SoftICE directory
* _' c- P* y# @+ P(I faced that once :-(
( C! K5 ]! ] u. T: I( L% R/ D/ @; Z% J
Useful breakpoint to detect it:* z' e3 T) ?- z
/ _/ N) f5 B4 n. q" Q. b
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" ?1 I$ |, Y% o& D* j$ T
, i# }, ~) X3 [$ M, p
__________________________________________________________________________
9 C! @* G( S4 c' u# w9 c- Q. U W( ^+ F. }4 e
. G! p l2 e/ s$ q8 | O: s; T. LMethod 14 6 l# v) l t1 E$ M% X
=========% m% B0 h3 s9 S# _, Z3 h% }# E0 f- D V
7 A/ D3 F* E1 t/ x5 K! C
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
8 t& d& F2 Q- S' W! Sis to determines whether a debugger is running on your system (ring0 only).0 l4 Z8 Y/ }5 v, t
% [0 n3 T$ i' ?: K; T3 K z: T
VMMCall Test_Debug_Installed3 ^) ?, `# N" a4 M3 t
je not_installed
8 c2 M. ]% ^% x& e% l5 [( D' V# {) f6 b$ g6 q+ z
This service just checks a flag.1 N7 }; F {7 u
</PRE></TD></TR></TBODY></TABLE> |