<TABLE width=500>
4 ?* Q+ _ j. ~( @4 r<TBODY>/ j4 D" R3 m ]7 p$ A
<TR>- b k( i8 ~8 W7 \6 Q
<TD><PRE>Method 01 * S/ P; U5 C3 E' N* W
=========
3 H" Y0 C7 ^3 h, @6 x5 Z; f
# t/ R5 @, t: e9 x" I. D- TThis method of detection of SoftICE (as well as the following one) is
# l+ H+ r! M1 u: b6 y+ j5 Fused by the majority of packers/encryptors found on Internet.8 R! ]% z" {! ?4 c4 l
It seeks the signature of BoundsChecker in SoftICE/ i( \% S% M A" l- b: |! J
, n* Z8 G2 H- a. h- `% s mov ebp, 04243484Bh ; 'BCHK'5 x0 H2 B6 Q$ \! O* T0 C) ^# f
mov ax, 04h
! [' G; n$ k4 t k8 | int 3 ) ?2 M; ~- ^2 z! y% o) X! P& S
cmp al,4
; x9 ? ~9 U2 n/ D. i' H jnz SoftICE_Detected' V( c7 K2 A% y6 t9 }7 a# A/ {' H# S
1 ~8 f1 n% ~# V4 k: |" y/ t7 u___________________________________________________________________________* a5 `' {: }# x k+ I
! K% T. p J* E& Q2 Q4 W: v
Method 02# m: L5 F& L! T4 C
=========" Z6 F7 B7 e0 V+ P+ [6 R! ?
& s9 e# u9 b* U# }* ^4 G1 K
Still a method very much used (perhaps the most frequent one). It is used. F# E) t. W" [4 _' P7 s
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ r5 f4 f' `) P1 }or execute SoftICE commands...& h3 @! i3 B7 Q* k6 K2 r H0 y: f
It is also used to crash SoftICE and to force it to execute any commands6 T% }0 ?; H( Y o2 S
(HBOOT...) :-(( * i9 A- A& B7 h& B- @
5 Y! I# Z6 q Z# U* B4 LHere is a quick description:
$ T7 U. D5 H! H0 w9 i, Y! {-AX = 0910h (Display string in SIce windows)
' A9 k, i" t2 ` F8 n {-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; y. I- q, x( @' X [-AX = 0912h (Get breakpoint infos)
- W- }4 w/ G5 R-AX = 0913h (Set Sice breakpoints)
* B1 u7 j- z& g. \% ]-AX = 0914h (Remove SIce breakoints)
" Z6 K+ |9 a' B
" A7 K- {7 f& v `) ~Each time you'll meet this trick, you'll see:
# Y( W6 C! `+ c( U6 b, v" E-SI = 4647h: u$ A2 S) H' o: U, ]
-DI = 4A4Dh
; W/ K) V* S7 N" i, k3 _Which are the 'magic values' used by SoftIce.
9 K5 | v' s+ T; I* M: [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 i4 \/ I9 n9 Y8 O4 ^/ V% [3 A7 _
7 Q" V# c4 f0 F) Q, [/ n
Here is one example from the file "Haspinst.exe" which is the dongle HASP+ n# T3 W h/ v# [
Envelope utility use to protect DOS applications:, ?# S% L" \& |' H& b; ~
) ]' V# j. p) n
/ z" m1 n1 h% A1 H9 r! X4C19:0095 MOV AX,0911 ; execute command.4 U, c) z/ E. ?6 s; @# o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! O* c( ~* S1 x0 N S4C19:009A MOV SI,4647 ; 1st magic value.
2 i% Q1 {1 _# Z* j9 F, N2 n% N4C19:009D MOV DI,4A4D ; 2nd magic value.! h1 I; B$ u e$ R- |9 C
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), P6 _' B8 u( F& @' h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; q: Q' Y9 ]+ Y3 z; P! F8 T
4C19:00A4 INC CX( [1 K+ v/ ?+ D C* H8 D
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute ?( R* [- O! L2 q% `* o
4C19:00A8 JB 0095 ; 6 different commands.
1 o9 ~ P/ M. ^5 s2 R4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& h5 l5 Y! U& }6 |8 ]9 p A4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 y6 j+ S) Z& D
( J8 j9 C6 G% n" [; M3 ?
The program will execute 6 different SIce commands located at ds:dx, which. g( t- z. @: W% x5 h
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; d, i. X O! p) C) t
) X& i8 V: [& ?! B6 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 y0 V, M6 R' ^1 a2 B___________________________________________________________________________
5 H. ~; r- g5 s0 r, C
$ \" f; |4 i- a) G3 Q/ I" O5 Z8 ]4 u9 R3 w
Method 03
$ y5 B; }9 ~/ _8 _+ G=========
' |* H: G2 C; u2 J: D7 D5 e( g! L( G5 w
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# Y$ r' `1 T* z+ a(API Get entry point)/ R( J" G3 T+ U
) X" E1 R: q8 @: g* F! @* {/ D
/ g" h1 F& _+ ~5 O6 }& p% b) ^ xor di,di; Q' L" g7 @) B7 I5 S, P: U
mov es,di5 k7 k. A6 z2 }0 ~) C
mov ax, 1684h
; d# K3 M" T8 X7 H# I& b mov bx, 0202h ; VxD ID of winice, e; R9 E0 u3 V- C, n1 i8 `
int 2Fh
" u2 [- X8 ?: I7 D mov ax, es ; ES:DI -> VxD API entry point
/ p* _8 a6 E5 w0 t add ax, di) x' T/ T4 D. P/ R
test ax,ax
1 Z6 P% M# k$ L9 Q; ?; Q: x jnz SoftICE_Detected7 J" f; b$ f. w' A- f L
, z% X$ W. I- e' y2 j0 Q
___________________________________________________________________________
z" F; }3 }% x* `$ G- D* n1 Q
6 `( E) d, o- T- V eMethod 04
- y( i6 \. w: ~3 a \=========' r% ~' k9 t4 O) O* q
8 M. F) M8 I; k( D6 QMethod identical to the preceding one except that it seeks the ID of SoftICE
% u% R1 X) R; `0 dGFX VxD.6 n9 V+ b g- Z
7 l6 j" `. z2 n" t, ]- k( H* \4 E xor di,di
8 T8 V1 b [9 Y8 ~ I: H, ?* A mov es,di
. H, f7 Z7 y. f) H. L0 `8 e mov ax, 1684h n1 I5 `9 z. N( n
mov bx, 7a5Fh ; VxD ID of SIWVID
; a9 y5 B- A+ M" n# L int 2fh5 M% U( Y' g1 x1 ]# n- q
mov ax, es ; ES:DI -> VxD API entry point
5 M% x+ `9 N8 m( a7 O add ax, di, m b+ `. b v4 e3 F
test ax,ax
( I$ F2 v4 I) u, T3 s9 b jnz SoftICE_Detected
( W0 ]7 }8 |$ B3 G/ D6 L1 ]! F
__________________________________________________________________________
/ ~3 B- ^5 b7 n t) x8 n Z+ v( p; P9 ]7 t
R+ k0 h, w) p$ V. K+ v
Method 051 }/ [$ F. j3 H
=========
; o: M% t5 \- {+ W+ a/ p( K% [; s/ O$ g9 t. n
Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 p3 k& }, O7 m3 u0 Odebugger. It calls the int 41h, function 4Fh.
# \# {( x% o7 I3 a0 vThere are several alternatives.
# H$ s: z0 j& W0 ~, k3 I7 h K2 w
Z' O+ p! p1 Z; z* K# }1 xThe following one is the simplest:
5 I( @7 K/ s& K. C
8 I0 X" Q/ f9 D, O mov ax,4fh; V- f/ v! b K7 Y; |# G: L
int 41h) e, r3 N" d) ], U1 a
cmp ax, 0F386
1 P' D: r, v. R7 H# B; H jz SoftICE_detected
& {3 V# {6 t, x% l, s
9 C8 Z! v Q/ f; ?9 M+ g7 u! C$ w5 }' f# u( s
Next method as well as the following one are 2 examples from Stone's
9 _0 w Y- H$ q5 ^"stn-wid.zip" (www.cracking.net):
- _4 S) }6 j5 c; y( x5 z. H+ t6 q
3 f3 [9 I$ l7 M5 p& k8 g mov bx, cs
0 x5 n* l" w' M4 R4 O" h lea dx, int41handler2
& F: O0 c- k0 A- T xchg dx, es:[41h*4]5 l7 x+ @$ K1 E
xchg bx, es:[41h*4+2]( L, [8 S9 D3 U* O" A3 l- E
mov ax,4fh
/ `1 e& i, B4 R% Y int 41h- r5 _" [1 E0 l5 q( J0 ^% W
xchg dx, es:[41h*4]; |0 C$ ^8 d! O; c5 B) k! E/ Q% _
xchg bx, es:[41h*4+2]3 ] U8 `7 C7 H3 P, _* G
cmp ax, 0f386h
, s. z s) A1 j% G S! c) \5 N jz SoftICE_detected2 @1 C* w0 ?& s! w+ c& u8 h. q) Z
5 L3 L- |( B! R) N
int41handler2 PROC8 U* k' k3 p/ \0 E3 g3 }3 j$ c* {
iret. ]" t8 Z9 y( S, a! B4 S
int41handler2 ENDP1 a, g" @" E: T4 c) M
8 D/ z8 u3 r& T: R. H, t
: q- `$ U$ m. i. I7 \_________________________________________________________________________$ m; e: _, |) a& e/ n, h; q
- j1 r8 p& v' r9 E7 B3 p- u$ R9 }, ^ }' ?
Method 06' D8 t* A# H x: L
=========; E- ] C& I! T9 ]# H
6 W/ N( u3 Z+ S1 F3 @
+ L+ m: T5 g. Q2nd method similar to the preceding one but more difficult to detect:1 U7 Y. Z- I+ I: s" [! u
+ c u5 g- t) |5 h4 E: a5 A" V8 n
! _9 T3 \6 D: F5 C Z) \# y( X& b( [int41handler PROC% w7 _ X) }8 C0 K
mov cl,al; E4 i: ^( Q& B/ H1 ?
iret
5 m- B1 G, P( _* h9 {int41handler ENDP
0 R% B$ k7 A" B! K6 V4 w$ e# |; V! N- e/ ?$ d* K3 P+ G
) W3 R4 ]" A3 k& ]& x" b* t
xor ax,ax4 y6 f1 Q7 w& S' ]' L5 y/ {& @
mov es,ax @9 N* r# o5 O( O$ L$ q
mov bx, cs
% c+ _" K" J/ ?7 [ ?" I$ E lea dx, int41handler
8 r1 N2 u5 L. n. z/ Y# { ] xchg dx, es:[41h*4]0 V8 A3 b9 r5 Y: Z$ g
xchg bx, es:[41h*4+2]
8 M4 H! Y. y8 F* c1 h0 F in al, 40h
) {7 ^3 v9 d7 g! ]. G xor cx,cx2 I9 N# k1 H* [+ X
int 41h+ A( l: G# w; i8 S: d
xchg dx, es:[41h*4]$ _5 g9 r% g1 s& I6 `' ~
xchg bx, es:[41h*4+2]
2 ^# w3 K* z& r cmp cl,al
' Z( a5 f* a0 Q' ?* ~ jnz SoftICE_detected V2 E# Q* j! m/ w9 X$ z* W2 Y/ k8 \
+ i& S8 g4 y e8 e5 B
_________________________________________________________________________
( i5 ^+ C; |: R+ C7 v% `1 y
6 r+ V$ {4 U8 l; }* MMethod 07/ ?( J5 f$ E# x# Q! R- z
=========
7 l2 F2 U ~5 [" I/ P
3 G: f" s$ ]' uMethod of detection of the WinICE handler in the int68h (V86)/ a" X4 U7 ^3 c0 b0 A$ }: w j% ^
: w3 P9 Z# y+ C6 q+ U mov ah,43h5 K7 j, K) W- b# I; y. g2 L
int 68h
9 m( c3 F* K& Q$ a0 G, Q) }1 B cmp ax,0F386h
1 B1 M; N( b7 B6 ^6 w8 R jz SoftICE_Detected& O( A' e9 P9 M) [4 h, A% f! n4 [
% U" F5 f+ Y7 T2 o& I, j R
- d! t0 r9 i ?. S=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit A) f$ M) V3 y$ I
app like this:6 ^4 g$ @7 ~5 H
0 R: z, p% C" d) m3 k( ?: m BPX exec_int if ax==68
: m0 k# Z* e% S A* t. N (function called is located at byte ptr [ebp+1Dh] and client eip is
n6 a8 d1 X# n% V% w9 c/ e located at [ebp+48h] for 32Bit apps)+ @; F& v: r# ^) z$ p1 d3 J( e S) F9 S
__________________________________________________________________________ g) A: w4 k [ D+ x$ n$ k
8 i N6 n% f0 w$ U# [$ l0 W. J% b6 P
Method 088 ]6 ?$ n- M7 J- l2 k7 a
=========. V1 u- l; ~/ Q
( C u8 P; K5 t3 S& n- E( HIt is not a method of detection of SoftICE but a possibility to crash the
$ ]* Z( C H& |system by intercepting int 01h and int 03h and redirecting them to another5 ^! D* {4 b4 L3 X
routine.' g5 H9 K- l# a5 g) x
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# n7 G$ X, k) _/ X! w! Ato the new routine to execute (hangs computer...)
- Y0 m) _& I4 e$ T0 w4 M4 {, |+ v5 S1 l5 L* C/ r% R
mov ah, 25h
' o5 a! D6 ]; p8 m- o# X% l mov al, Int_Number (01h or 03h)0 K l7 m- W. ~
mov dx, offset New_Int_Routine/ E" \/ c6 s+ f2 u0 \1 X
int 21h+ b: k$ }/ B5 i7 `4 }- x; R5 }
% y ^: n: \, A* F0 E" u1 D) y
__________________________________________________________________________6 p& K) E# x0 |+ Q- E* E# J1 ^4 L, V
% M: T! d3 g: p# d3 {' H
Method 09
1 Z+ G2 d/ P$ a* }! e x6 I: z; ?=========
* [8 F5 V/ W5 e; ?4 {& z* l
2 @* F* o; s& Z* { cThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% y/ z# X$ N* Q3 x) [/ H3 wperformed in ring0 (VxD or a ring3 app using the VxdCall).
+ I. e6 u+ I) T, c! b4 a( ^The Get_DDB service is used to determine whether or not a VxD is installed
, U9 e* S) o- J7 v6 C5 v6 ^for the specified device and returns a Device Description Block (in ecx) for
E t5 H2 P9 t2 r+ j, ~that device if it is installed.
" x( [* L7 `2 d; N" j
$ p5 S1 P0 _* d- ?$ O6 E3 e mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ F8 ]2 L+ B- J$ B mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 S1 B$ b$ X- C3 v: q' ^ VMMCall Get_DDB( [+ Z3 n+ V# \% S# G
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& \: `% J) x x5 i: W% b* h$ v; H" w2 \6 c2 Y
Note as well that you can easily detect this method with SoftICE:
9 F* ~- c7 u: [( C: v bpx Get_DDB if ax==0202 || ax==7a5fh0 i$ l. Z% m w" _% d8 d5 K2 {
; r$ [* |7 e8 e4 b# m( l$ D+ Y" U/ L
__________________________________________________________________________
0 |' R/ c2 h- O8 |) V
8 C. |: R; J# M+ M- N) J" fMethod 102 \1 S& o) V+ O I o$ G
=========$ ^' X4 L: L( Q# k" H$ k
' l: l5 ~# O+ a7 j. d. m9 c
=>Disable or clear breakpoints before using this feature. DO NOT trace with5 n6 |. V1 y s# d t4 \) b3 k8 i
SoftICE while the option is enable!!
, ^1 X. r4 X; Q& I0 d! X2 m$ ~1 g. C0 L' n
This trick is very efficient:0 ~* E3 @! R5 g8 [8 `
by checking the Debug Registers, you can detect if SoftICE is loaded8 ~3 f- |/ o- t0 P( v
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! V( u. H0 K6 Qthere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ v2 J! ?; |* T& xvalue (in ring0 only). Values can be manipulated and or changed as well( e& z& {- s3 A% z
(clearing BPMs for instance)" m! f1 K: J. c) c) f5 n
4 A {# E+ h5 B% ~
__________________________________________________________________________4 u1 o, x4 {0 J- X X
* q6 }/ g u0 }& A0 j* f3 cMethod 11
. _7 V' q: |1 |. y% Y1 N=========
( ~/ t0 Q, ~4 R: N! z! m; a: c1 O5 N* l! q0 o7 ]
This method is most known as 'MeltICE' because it has been freely distributed
3 F% y6 K/ ~8 ^* O$ T$ @* Fvia www.winfiles.com. However it was first used by NuMega people to allow8 A4 Y; f3 f3 N4 I- Y6 R5 C
Symbol Loader to check if SoftICE was active or not (the code is located' Y0 p8 ]2 [1 C2 x s7 e/ @
inside nmtrans.dll).' J& r1 T ?. m3 w7 h- k5 M
A5 |* u& Z3 Y' p
The way it works is very simple:, m. s9 {% B/ q( p& S! J
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 }9 Q4 g; u* |7 T; O* j3 o- MWinNT) with the CreateFileA API." }0 X& ~' }: [5 k) w8 {+ t
: v$ x; o+ |* I
Here is a sample (checking for 'SICE'):% [. ^5 V b0 s. [2 y; K! Q
1 J! o5 ~: ?! a, ?$ j2 j+ m5 u: T
BOOL IsSoftIce95Loaded()
8 t( }* N" W& g6 U1 o7 a& J{
6 x- v5 Q0 e1 X- Q$ y- e HANDLE hFile;
4 g# m L( T' A3 O3 c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 O' Z) f- u0 T( |, o3 Q FILE_SHARE_READ | FILE_SHARE_WRITE,
$ {$ A( i- ~. |! L' i+ e NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# w4 a& g) y- j( _; K" C if( hFile != INVALID_HANDLE_VALUE )
7 P/ w" Z/ c7 j# c- ]9 V. d% W {
, f" c. f8 W1 V1 P" P* A6 @ CloseHandle(hFile);; i, y: a" b+ i$ N- P! N
return TRUE;4 T( G' S$ q# C0 X g k
}+ f- P ]# j; Z+ |
return FALSE;
$ K8 M! O1 Q' @8 s' o0 D}
* p7 m+ i. }- E0 A y. q7 e- E( R1 r1 w6 T
Although this trick calls the CreateFileA function, don't even expect to be
! l2 H3 E& Y- f; o/ U* x& Qable to intercept it by installing a IFS hook: it will not work, no way!, U! p) h% ^2 C+ j& q7 h
In fact, after the call to CreateFileA it will get through VWIN32 0x001F3 g% S6 J( G9 C* }8 M- `
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 }5 u8 r1 W4 ]; Y c w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc8 P z5 `* Z% J' _
field.- G( O! q' B6 e, @4 u+ [7 k3 J
In fact, its purpose is not to load/unload VxDs but only to send a
7 f# k0 U" r$ w6 [( c: m* BW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): W* O" P( Z b8 U) a
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
) D6 K" x$ f0 o8 u6 u7 a8 uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& G1 O- E& F' |" t- C# H3 c/ ZIf the VxD is loaded, it will always clear eax and the Carry flag to allow
: ~: u. `* ]; Z1 W: V0 Fits handle to be opened and then, will be detected.
& M, U: R3 O' l" T9 {& Y, W5 ]: tYou can check that simply by hooking Winice.exe control proc entry point
& X" f7 J$ `: {$ V% ]9 f6 Jwhile running MeltICE.' k4 H/ D9 k) Z! T; _% w2 I
! U0 T* J! k! b& e8 i( z, c; V4 ^1 \( U
00401067: push 00402025 ; \\.\SICE
2 v/ ^) d: K" \, E. _ l: L 0040106C: call CreateFileA8 |' H* t3 L9 p* L
00401071: cmp eax,-001; I% o* e' l2 B9 B7 U/ Y
00401074: je 004010916 F3 k m; O1 l! ~3 Y" p
% n7 p# a" J/ j3 i' C* u
- N. n0 X" I" KThere could be hundreds of BPX you could use to detect this trick.
M1 m% y; w) I4 P/ L/ X, T' d9 M-The most classical one is:
: T, d5 r: ?: v6 h% i% ?% x BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
0 O1 m6 K+ l5 r" j( I! P *(esp->4+4)=='NTIC'6 [) s3 n [; E* U( |! Z
% s, m2 x- q2 w, Q) f. ~
-The most exotic ones (could be very slooooow :-(
, p- v `. e3 E" I7 [7 \ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. I F% r& k( v7 S& ?4 N/ k5 T4 _ ;will break 3 times :-(& Z" U; E1 c' ?7 n# L
* [6 u, V5 i3 l v
-or (a bit) faster:
0 l% S& \3 ~9 A. r BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 x3 n4 }+ w( t! ^
6 ]* d0 c6 J% Y9 q BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
N, A6 O2 h7 |# S4 j8 L ;will break 3 times :-(
* a+ e. K, d- i \4 E$ d# J. f; Z$ g
-Much faster:& D( ~: |. S e% Q6 v( |$ B
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'5 j/ W" o/ F1 ^3 C: ]0 r. i
) n, b0 |8 b6 L! O( |Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 w+ T0 P; V S* x# N
function to do the same job:) i' L0 U% L+ \6 y0 w
$ F# E1 m+ h3 _( J& Z( f3 a* l
push 00 ; OF_READ9 W9 q. M7 f6 p! e. f
mov eax,[00656634] ; '\\.\SICE',00 \: H3 B4 X( r9 K6 Y/ k
push eax
" E& T8 u4 T, A; y& x' K! C. p call KERNEL32!_lopen3 Q8 T$ t- y. F$ V! |$ i
inc eax+ [8 Q) D& j3 z
jnz 00650589 ; detected
$ v: n. q: M% C! \5 k push 00 ; OF_READ4 P0 U6 }! O; i1 r# O# E. R7 F* ?
mov eax,[00656638] ; '\\.\SICE'
+ G) n( H/ y0 N push eax1 s) _; \3 U/ E7 L: d+ P
call KERNEL32!_lopen( m+ _: F5 O2 z! u- U" M
inc eax
+ S2 J( H$ j/ I4 E/ w" F2 G& G jz 006505ae ; not detected8 H2 f7 O: W& M% X# W! P; ]
5 K2 {" {1 f1 X: a
/ t: l1 \* L2 n* B
__________________________________________________________________________. k2 v4 i0 s0 ]
& t( y* Q! E3 p2 @; x* }0 T
Method 12* V% z; s6 ?: E
=========
) ^, l; y1 v8 Y0 Z: P5 b
' h1 g" W; }+ n7 W% EThis trick is similar to int41h/4fh Debugger installation check (code 05
# d, q% _6 n- a& 06) but very limited because it's only available for Win95/98 (not NT) ^4 y! v5 G6 |
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.% e9 j3 w |+ ]3 |
& u# n* J& I( m! ~ push 0000004fh ; function 4fh
3 _' ?* b5 E; p$ Y1 M push 002a002ah ; high word specifies which VxD (VWIN32)
: l, r6 C: U2 c) z+ R" U ; low word specifies which service
5 E2 M9 J. C1 t: ~6 X6 b (VWIN32_Int41Dispatch)
. O4 o& R" X) N- t: r- b; J call Kernel32!ORD_001 ; VxdCall/ @( m+ g0 @5 X+ X0 ]! h
cmp ax, 0f386h ; magic number returned by system debuggers
$ k5 k3 r+ q- D6 | jz SoftICE_detected; P" H9 `( j7 y$ A4 x c7 ~
/ @- y9 R1 N; K5 ^
Here again, several ways to detect it:
0 O5 N4 F1 i( |
- c8 U7 s: c- M& M" x0 Y5 O BPINT 41 if ax==4f
7 ? { V8 q& W- K% d1 ^* h
! k# m. U+ B i6 s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 q" m1 C; |" h9 c
8 K, v0 V4 d* D3 Q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A+ {; B% B* j' w+ e9 z- \* c/ u
! h/ M! y1 i' i) b! E0 P
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) `& A m0 @: x$ N& E
8 k5 A% x% B& a/ i" F* ]__________________________________________________________________________
. i' C5 @; f( c+ h: X
8 m- h5 T( N! Q. }. w! l3 P& b; O0 xMethod 13
, G# ]" n% M. |2 @=========
$ K! Z7 k3 g5 ~& S
1 ]6 ?" | ^" z; W) `# @6 e5 @6 qNot a real method of detection, but a good way to know if SoftICE is9 l: v% X& Q& m* J9 z5 |' N9 I
installed on a computer and to locate its installation directory.
; `* \2 U: Q8 G+ ~' {; w; T* Y2 uIt is used by few softs which access the following registry keys (usually #2) :
# {( y* T6 }+ G; A/ `5 }
$ K6 |2 N- `" _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" s9 I: C2 G& S: |$ @; X: y\Uninstall\SoftICE
) O$ l6 i: f" Z8 N0 W/ `-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 p9 U6 e4 k" }$ M$ }* Z" _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) Z ~, m) J2 J, e' T
\App Paths\Loader32.Exe" Y" q0 [$ L$ S. A
6 Y$ M0 }& |, \: O. {% E0 C1 V
3 y; H' U6 {# X. WNote that some nasty apps could then erase all files from SoftICE directory% ?# f$ v# f; r/ q3 S. v% V
(I faced that once :-(
" l/ `0 a5 ?- l% ?! f/ x
1 `* V& }$ ^$ d% q5 o4 AUseful breakpoint to detect it:
; u/ T' ^7 k! e ?3 Q' N. D: P% ?1 X/ W# ~, I/ p0 W) ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 v% V* u$ s3 L$ F
+ Q0 D& g; J5 g) J6 h( q__________________________________________________________________________2 r& t9 V4 d! j9 V6 [6 q
5 B$ }& c) B; V0 z. I
1 {3 Z2 L: P" i! _: e8 q. m8 FMethod 14 % E U& v( ?4 J$ F4 ^2 M2 p
=========
: M) l* t( f( r& i& \6 g7 \# w3 ]; c" h/ t8 }) W) ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ z4 d# y) G; z! u# t: Z1 his to determines whether a debugger is running on your system (ring0 only).
. N" ~6 E$ ^# l6 h7 F# c! }$ z: e" s
6 T) C* q$ m V; T! p( p: Q1 Q VMMCall Test_Debug_Installed
0 |/ r* ^9 R0 l- t, { je not_installed
' d" T8 q. ]* |! c4 q
6 [: x" z- \6 t% e+ {" |This service just checks a flag./ {" u5 K) _. _( Z7 X$ a
</PRE></TD></TR></TBODY></TABLE> |