<TABLE width=500>" `, T: c; a2 b, j9 q4 |8 F
<TBODY>
8 {/ }* i# K0 p1 j1 i6 [5 X' l( F<TR># T) y( E# S( E; W$ G. A
<TD><PRE>Method 01 9 H I2 Z! P+ C6 k0 `# {/ v; `
=========' r) k6 z/ K9 K9 h7 u" t; m% U6 u1 \
( Y- {7 ~& T1 ~8 {
This method of detection of SoftICE (as well as the following one) is( S$ h! u: r6 N# p+ i2 E) n' ]
used by the majority of packers/encryptors found on Internet.# r1 c8 G# ~; x+ J7 o( ]
It seeks the signature of BoundsChecker in SoftICE
8 l6 c- l6 u- t+ i$ _
2 J+ s# Q# T: a1 R7 h! x# o mov ebp, 04243484Bh ; 'BCHK'* l) [7 v6 z6 e: |1 ?5 D% F6 i# w
mov ax, 04h
) S, P) s' o k! K6 c int 3 7 ^% F# y# s9 x
cmp al,4* U2 p% r4 l+ E2 t& e- s
jnz SoftICE_Detected
4 X/ f9 N6 S( [% l
7 Y1 _- {1 M( U- a# ^___________________________________________________________________________
+ O: N2 A. X7 y! n' J( r* ?1 Q
& D, n/ G4 L9 ]# G& eMethod 027 k3 a7 k- X4 O; l# p y
=========
& n7 n* Z5 L- f5 R$ N5 U5 G% }$ S' V" J
Still a method very much used (perhaps the most frequent one). It is used7 Q, i: B8 ^" F. {* b" R A7 O0 W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 }1 a6 A3 M9 {/ l( q. x2 Q
or execute SoftICE commands...
, Z |6 `9 c+ F. _. ?6 X! S# k, UIt is also used to crash SoftICE and to force it to execute any commands
0 q6 w# N$ J% p* m( m) l& r(HBOOT...) :-(( 1 F3 @, Y5 R' _8 c! B/ P2 r
2 C2 n/ d- z8 Q0 q* `! A0 E
Here is a quick description:
& G7 w' f( B7 ~& U; N G+ J4 D, x-AX = 0910h (Display string in SIce windows)) m* f. u' Y) C, W5 Y/ q( Z$ ]
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)( D# \/ p9 o: o
-AX = 0912h (Get breakpoint infos) d0 w! d+ c( M' U# ^, u3 {
-AX = 0913h (Set Sice breakpoints)
. O) d" T& Q5 M6 J) n, m$ Y-AX = 0914h (Remove SIce breakoints)
' F3 W. x% G+ B: g6 J6 X
6 k4 i A$ O% U2 R8 D. o. Y) q5 E6 kEach time you'll meet this trick, you'll see:
* o! B; h7 ~! S) C3 v8 F-SI = 4647h
7 Y- K/ m2 G7 M _, F2 j, z s-DI = 4A4Dh
# c* l ?9 D7 u! mWhich are the 'magic values' used by SoftIce.
5 ~* X/ a+ J; [& f% ~. u* ^For more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 c* W. j, I; K8 a+ U
, F; m+ [$ Q7 H) y' h7 vHere is one example from the file "Haspinst.exe" which is the dongle HASP4 W6 g e5 _% A; O
Envelope utility use to protect DOS applications:
2 y: X1 k7 \7 A) M9 D L) @/ z Z2 ?
2 D0 V$ w e {: z, K
& Z# a- a N! o4C19:0095 MOV AX,0911 ; execute command.; `8 }* y% t2 D& O0 @* [
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; F) n6 Q" r5 G0 s' Q. P* m$ M7 x( t
4C19:009A MOV SI,4647 ; 1st magic value.8 c- `7 s! a' h( y% F
4C19:009D MOV DI,4A4D ; 2nd magic value.4 Q" }& K+ h; R# x: W7 e( B! M, u' C4 ]
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 T: w' [" R( h) O4 O# O. Y5 F4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; h1 v3 m3 p1 `# I% |% N2 s
4C19:00A4 INC CX
6 i* d- g% n. z5 t, I4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. W7 _, j4 X0 B( E, M; }. h
4C19:00A8 JB 0095 ; 6 different commands.7 S+ D3 U ]8 z
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ u4 {9 Q( B# }: ^( J
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" L* J' K1 k; h1 a n3 m
) V% \; ^* |3 D$ ?4 nThe program will execute 6 different SIce commands located at ds:dx, which# l+ O. x' F; S: V- u
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: Z# n& ?. G# n1 L) r
& Z4 s8 w& I- F L$ A, V6 u* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." M6 C N0 ~0 o% s& m, u7 _* V
___________________________________________________________________________
, O; h+ @2 ^( `5 W$ t1 E
) P4 F! y8 M2 ^* s
5 ]' S: g5 Z3 p$ V0 ]8 d% O9 yMethod 03
c( r% x2 Q; C" A' K" J=========
4 U# z9 X, O2 a5 J& e) G {4 F! k$ d! ^; Q9 j
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: m$ t" z( \- X8 f& I3 Z(API Get entry point)
1 Y) ~$ c0 T t5 y# c3 J
) E: \5 ~, U( ]. g3 @1 G2 J# H6 |: i
xor di,di
- U% M8 i- R6 Y7 t2 o* m8 j mov es,di
5 ~9 R" G. a# H mov ax, 1684h
9 u$ @$ W4 L0 B( g4 O. l mov bx, 0202h ; VxD ID of winice
2 ~' Z5 _' J: b: h, G, d& T8 t int 2Fh, U; Z, | E7 B" Y5 w
mov ax, es ; ES:DI -> VxD API entry point& W6 I7 j0 i5 e% A; l8 Z! `
add ax, di
_' u, P) }1 v test ax,ax
6 `3 g8 ^# O! E+ ? jnz SoftICE_Detected
( G) U7 }' z2 c0 |/ K. B1 p; p3 x: }- W: W# i' |# p
___________________________________________________________________________
- a, h, C" B, [' ^5 m; K5 S" e |# d- E* l1 c
Method 04
, u' E* a$ }1 e G+ G6 e=========
7 O! v1 e; S/ G/ d/ G0 `: u7 N7 V0 `' [6 C' ~0 l
Method identical to the preceding one except that it seeks the ID of SoftICE
+ u8 U. c$ _! K8 d: UGFX VxD.
# t- p4 t6 f' K8 ]- p) {7 Q1 `9 m: Z
xor di,di8 q; Z7 i1 o Q5 ?! s0 o
mov es,di8 ?) q- W2 T: r( Z, j
mov ax, 1684h
. C- @; n) M9 E/ x3 j& h mov bx, 7a5Fh ; VxD ID of SIWVID% |, J# G4 k! n' D$ w8 J
int 2fh" \6 w4 n+ K& B7 b# k4 I1 G& @4 r
mov ax, es ; ES:DI -> VxD API entry point5 ?2 G9 u& D: N: a) i& [5 O6 Q0 n) e
add ax, di" T3 R! S- n1 ^: b7 H0 V
test ax,ax
0 a) x2 O6 S e$ L3 d8 A# E jnz SoftICE_Detected) X6 K# _, ?/ p! D$ @6 T: U
1 f' L) Y6 u$ D$ W__________________________________________________________________________
' n8 t: |5 p+ y3 D* m
0 o( k e6 N, h7 q+ x
" t& w' i2 ^3 U9 | ^Method 053 F" B* B: A/ V* l
=========
9 [& }# ~) x: b6 ^; M0 p" l6 |5 G+ D: }. n# y, d9 t
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# j6 g# q% ?& X4 I- d1 j8 Bdebugger. It calls the int 41h, function 4Fh.+ M. E5 _' [. H! R0 H" t/ d& Q! x
There are several alternatives. 0 [" o0 ?2 C8 k/ q& ^+ t L- Z% c
# m% C: `( [ |$ P
The following one is the simplest:
& x( H0 f. O: V) ]" Q9 h. ^: \: Y
& Q$ |7 y% W& n. g2 w0 a% Y mov ax,4fh* R4 j! h$ ^3 t
int 41h
' o% {% M3 d* m8 M3 k6 Z cmp ax, 0F386+ D4 [# V4 Q* {* X
jz SoftICE_detected5 D8 K1 F" R* m$ n! W0 T- b
! ^9 ], a5 v3 O
: h% ]" D0 u/ G+ k+ X lNext method as well as the following one are 2 examples from Stone's # {3 m' D7 w) A4 B
"stn-wid.zip" (www.cracking.net):
/ ]- z3 F, e7 u3 B5 l/ W" v2 y7 }) P- j- \1 C
mov bx, cs+ F$ ~, [* F: {+ ^; I6 W
lea dx, int41handler2! e/ Z" k* B! |( b9 G5 _
xchg dx, es:[41h*4]
5 g" R- l, G, B0 d xchg bx, es:[41h*4+2]
D& R' G* ~8 P4 U; q$ |6 W3 W mov ax,4fh
( ?. V0 _' {( V8 J4 r7 _ int 41h
6 F' M3 A: b5 k" Y$ ]! I xchg dx, es:[41h*4]
8 u/ a: k4 J: D% g xchg bx, es:[41h*4+2]
( P7 R; R& f+ d- d2 z1 j+ h" ~ cmp ax, 0f386h% f2 j5 n; T; p$ L1 V
jz SoftICE_detected
8 t( E3 @$ T, i6 t! x5 N! e! m9 D0 y* b! D
int41handler2 PROC i" {. X$ E) J! G
iret/ c2 [$ r: G4 `
int41handler2 ENDP
( V* `/ g. I& K3 }6 P6 K. Q. f( f+ |& f# E
+ Z2 \( _ [ w: t
_________________________________________________________________________. R8 b- s% d2 A ]
4 \ O& F$ w/ R6 p( p( ~5 H& I, y: q/ Y% m' f
Method 067 G: \( m2 W* `- x& u0 }
=========
1 w5 d7 l# N/ n$ a6 o# Z# r0 u) Q
3 R7 P) f3 u0 Y$ F+ h3 X6 B; t6 I1 q* ?% w" T/ f
2nd method similar to the preceding one but more difficult to detect:
$ w% Z1 V5 ~% Y' D* G7 B$ ?
9 d- B I# A k" Z% Q/ ^1 [% {7 n% r
int41handler PROC
9 c7 i4 X- E! ` s3 W9 C* Y mov cl,al
1 x9 b) u3 w k. g+ D6 A iret
4 D' e2 Q" Q. U9 wint41handler ENDP& f/ @1 R+ C ]. Y, Q4 w; _4 b8 L
8 _: e/ Y+ Z5 m9 f) ?2 V. @2 s: }7 |
v2 k C, u l/ X xor ax,ax! J6 o) o/ s/ X+ m/ m
mov es,ax
2 l& E+ c" f! M" _ mov bx, cs" m% {. M2 X& g
lea dx, int41handler+ p' Q% ~- n) {& U" r
xchg dx, es:[41h*4]! C6 R6 p" X2 V3 N. r
xchg bx, es:[41h*4+2]# d4 I- O T! w, G/ r/ G$ H5 u4 W
in al, 40h
) Z a' N, r5 }6 `5 x) w xor cx,cx# j8 s& o: E9 ?, K$ A3 u) d
int 41h
% G. B$ {0 p7 D$ `+ r$ S xchg dx, es:[41h*4]
( F7 P# d$ |# [# O6 E6 j' o; T xchg bx, es:[41h*4+2]6 f* _& q8 G( i( \
cmp cl,al
5 v7 d) _6 N O% ~ jnz SoftICE_detected
: P0 Z ~9 i- p! h* Z
7 T% r# t9 O3 | j+ p1 F_________________________________________________________________________* d0 R) I/ X# \9 P+ y
( C5 x. s. d7 C8 V& {' N' }
Method 07) s7 V) Z8 P% t9 ~
=========
5 T2 Q) G, F& V& b# C2 Y' P, D w5 S7 W/ D7 P* {) D
Method of detection of the WinICE handler in the int68h (V86)- |8 z8 o. c! x9 A! p
4 D$ N( H: d( {- |3 M
mov ah,43h
, `+ o' Q) t% K; q5 { int 68h- H I0 v: b- [! z: B0 |" g: m, S; N# \
cmp ax,0F386h+ [% B' u/ M5 r# ?" E
jz SoftICE_Detected: W$ H) |. F- k% Y. @6 w6 c
3 z2 a; _3 t& ~2 G
# d% P- ?' d- c1 j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# r4 @: m9 b' n
app like this:# l$ p9 o' H, j! I( N7 g' |7 n
1 B1 E8 `9 v9 a2 W
BPX exec_int if ax==68
* S* v0 ^' \7 C (function called is located at byte ptr [ebp+1Dh] and client eip is
& \5 w9 R+ g4 W9 F/ } located at [ebp+48h] for 32Bit apps)" X7 L \7 h& R# \$ |9 k
__________________________________________________________________________% K* q: l A2 w2 Y9 \- `
& v5 @# E8 A! H0 L, K7 w* D! u' m
1 A+ S0 ] V" K M2 m) Y* @Method 08
2 x: R+ n' {8 C/ c, o5 r=========
, y, a& f8 h; J) S' \
: D1 z) L# P; r# O1 D1 S0 s5 eIt is not a method of detection of SoftICE but a possibility to crash the
9 j8 {' n4 O% k" b! a0 U) gsystem by intercepting int 01h and int 03h and redirecting them to another1 m- z' R* J0 L, H1 m& _7 Z
routine.) }2 o3 ]/ G" G- [' C- F; L9 \( ?, l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! ]% A, K( w: l5 \7 ^
to the new routine to execute (hangs computer...)
3 U" ~( v3 ^: T4 A0 u7 I7 n. H2 x$ ~1 a& e5 O
mov ah, 25h
6 j+ d5 Z0 l4 }6 k0 H# a mov al, Int_Number (01h or 03h)$ s/ @: v: X, b( z
mov dx, offset New_Int_Routine+ V* X f2 Z4 @) v% @7 j' u
int 21h
3 S. U J- z0 y4 ?. |/ B2 Q/ ~& t7 { y
__________________________________________________________________________' a. A+ X5 |# @2 ~; a* `) E
: k( Z6 z, F; a3 H' a, l; kMethod 09
' @' _$ [. `+ a" `$ ^5 Q=========* T* z) l" R* e9 z4 P* b
5 @+ W: t+ y1 F9 U3 _5 [: e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" k5 N% }5 b8 e; T
performed in ring0 (VxD or a ring3 app using the VxdCall).* {, ?% x0 v; K a( s% U2 G
The Get_DDB service is used to determine whether or not a VxD is installed3 w1 V" E9 q$ R ?
for the specified device and returns a Device Description Block (in ecx) for
" k2 t- U9 p8 Jthat device if it is installed.
& j) D! r8 S6 l5 N( w( Y8 p
7 x ]* [" `% k5 q! Z mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 |: H @- F( _8 m N mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 p& Y+ L! C( j; Y& Y' t* f VMMCall Get_DDB
* m4 O; ], k: i' ]+ _7 y- J" U) B mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
9 i3 D# T7 Z/ O& q# L, d; \
! j, P; m, c+ H3 j& x% z" A& ENote as well that you can easily detect this method with SoftICE:
: n+ a) x6 r( ]6 w bpx Get_DDB if ax==0202 || ax==7a5fh# ~4 O# T# n4 o2 ]& H3 t( i' m
, S# l0 D! P! m__________________________________________________________________________% b: I, ]3 q5 j: R4 U& ]
! H7 @4 A7 K, a7 ^Method 10+ W/ Y4 z1 x9 a$ m! B6 M# U
=========
$ e/ s( {- Z# W( f% o
8 X( h; U& }- S=>Disable or clear breakpoints before using this feature. DO NOT trace with+ X/ L, @# R2 t+ m* v
SoftICE while the option is enable!!& }; s5 q# s1 ?
! V( Q9 s, L$ l3 ^, v/ lThis trick is very efficient:
- E3 [ y! H9 o/ i2 |0 f4 Oby checking the Debug Registers, you can detect if SoftICE is loaded9 H7 P+ t5 c. g' G( J, i
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ \6 w# ?5 X8 ~( x+ lthere are some memory breakpoints set (dr0 to dr3) simply by reading their
9 [5 y$ Q. {5 A- N: Xvalue (in ring0 only). Values can be manipulated and or changed as well
! ?. T2 t& l4 Y" o(clearing BPMs for instance)
; F& {9 y6 E. H7 o4 R' j
. b# l) }! w, X& o! ]__________________________________________________________________________- k7 Q: U$ Z4 P, D# u; O
3 G& a! t4 F) ~Method 11
/ Y1 a0 v9 s( w, \=========
: j$ Z, O" H/ g; t: S7 t
2 K8 u; Y+ Y2 N l' KThis method is most known as 'MeltICE' because it has been freely distributed
1 Z2 f% N2 T5 `; g- i6 _via www.winfiles.com. However it was first used by NuMega people to allow
5 e- c9 J: H' N, C% D4 MSymbol Loader to check if SoftICE was active or not (the code is located
( q) M: i& t! d2 T# U) p; Qinside nmtrans.dll).
8 j# J# X& u. t$ a% S! Z
0 f! _+ W1 R& g: l WThe way it works is very simple:
) o' ^% w+ W& c; M4 iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& [' P' ?% k6 |% C( o \WinNT) with the CreateFileA API.% z k: D* L9 a/ t
% T. f# @1 M) s0 \! x3 q; gHere is a sample (checking for 'SICE'):$ [* Q1 t- G+ m2 b; w& s
: U6 z% \ y! z) M0 h( a9 WBOOL IsSoftIce95Loaded()7 n! [5 e) l* a
{2 X/ x- m. ~) V% Z* o1 N P
HANDLE hFile; ' ?( F9 ~7 r( A* Q' ^. N
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ d7 t+ O* ^3 D
FILE_SHARE_READ | FILE_SHARE_WRITE, [/ I7 [) s* e* @" ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ T* D; a* x9 T- Z
if( hFile != INVALID_HANDLE_VALUE )
1 I2 U. U" c- n2 j2 U; J {3 q" e7 W. X: |7 r" a8 r6 Q
CloseHandle(hFile);
. R0 J# c7 d' S. K return TRUE;
* j; D& p6 Y2 t+ Q! u0 F. z }0 R1 @. }0 T3 r' P$ F5 P6 B4 r
return FALSE;1 m O7 B0 Q; S& \
}
; L8 [3 A! K9 f, w2 F. L2 p/ d& i, H( ~ r
Although this trick calls the CreateFileA function, don't even expect to be
( B8 {) M, p. l4 t% Mable to intercept it by installing a IFS hook: it will not work, no way!
5 J' _6 I0 y9 W1 ? \. R) pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" |1 K3 m! K5 F v( E& f% [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ E& b5 e/ X* ^5 n8 [' m) i4 Qand then browse the DDB list until it find the VxD and its DDB_Control_Proc
# V; M8 l8 R1 J* l, Afield.
0 X2 i/ h4 Y) n. \2 `- b; B( W" wIn fact, its purpose is not to load/unload VxDs but only to send a
8 p% J* }. o3 k% JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ X& L+ s7 k$ I+ A/ Wto the VxD Control_Dispatch proc (how the hell a shareware soft could try
) q' S# U, ^; _- X0 C2 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 J- P. v8 n9 d }% M. HIf the VxD is loaded, it will always clear eax and the Carry flag to allow
2 H5 \7 O5 B2 w- f' S3 t+ z- ~4 |its handle to be opened and then, will be detected.
* K# ]! y6 A. M! VYou can check that simply by hooking Winice.exe control proc entry point
$ Q0 a+ z7 }4 d; p- `& U0 @while running MeltICE." c. C" E* T& B% S! G& C& y1 {- U
7 N' G. X: e7 F7 Z4 R, R. ^0 v
3 K& u* V. o, r$ }, B& Z 00401067: push 00402025 ; \\.\SICE
F4 s! J8 _2 P5 r: Z0 g 0040106C: call CreateFileA
7 T4 V% b5 ~. M/ ]0 ^, Z+ z; h 00401071: cmp eax,-001
2 v6 X! Y5 A1 f5 z( X# O 00401074: je 00401091
' o% J, s6 \& L; l$ R: C l
. V4 v+ |2 L8 Q: B
, M2 V" g, V2 Q `2 A I& D7 x! OThere could be hundreds of BPX you could use to detect this trick.
/ ~! K: s+ `9 {" r' u( L-The most classical one is:
* M* n( J0 u! {/ o+ ]6 O BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 v: F" p$ U$ J* N% T) v7 q
*(esp->4+4)=='NTIC'8 p$ F B8 g- K! z- d
0 U) h0 z0 {: f-The most exotic ones (could be very slooooow :-(
& B* o% a" o4 O8 L BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') % X; k0 I! ~" N0 c! \% K; a$ z
;will break 3 times :-(+ o. F6 s- t' c
& v; M' \6 W) l0 Z-or (a bit) faster:
1 D2 j" g( `( ~! @3 J# y8 v BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* `5 g1 C* o5 V3 I: V$ L: s! z/ ?
/ a u9 e6 c: I2 t! l0 v" c% G BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % \( R* o k5 l- x/ g% h
;will break 3 times :-(: p& _& F, m5 l9 x1 l
, R9 i+ w4 }% c7 G8 j1 t-Much faster:, u U+ Z- p$ M' R" l8 G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 B2 g4 `4 m# ~9 ?) a
, G, ^7 U$ I4 c8 v1 VNote also that some programs (like AZPR3.00) use de old 16-bit _lopen$ R3 } N1 g0 o" q' z
function to do the same job:
! x5 T* B) K' f9 f, y0 e8 M _5 E. ~- m9 W
push 00 ; OF_READ
) r; D+ t j5 ^! n ? mov eax,[00656634] ; '\\.\SICE',0
+ Q. f( N$ b/ d0 X3 m/ a3 O push eax3 q0 R$ O* P3 p
call KERNEL32!_lopen
7 `% P5 V4 H1 E* w inc eax
( O! n: M2 H% m jnz 00650589 ; detected
2 o! F' d9 a" H; _, ~; q! p4 w) H* F push 00 ; OF_READ- D1 z3 y4 z$ j" c' T: \+ F+ X
mov eax,[00656638] ; '\\.\SICE'
( n' d4 r# n& A! g push eax
) q4 D1 u. y) D$ C1 G h1 Z" Q call KERNEL32!_lopen
; v. B9 d& ]( L& h. [4 \3 K inc eax
& [- ^' B1 a/ H jz 006505ae ; not detected
$ N J) Y1 l/ c# [" D$ Q. k- j
2 m |( G/ Y9 l' x3 J( m. V
P7 n$ L/ Q, ?. O% {; M' Y; ___________________________________________________________________________7 f6 h9 h) G1 P/ n
% {0 Z# |( b8 w
Method 12
" d5 h1 s* s5 j7 p( `* \, P=========2 m! w; b _* p# P- _% d
5 Z2 L8 R8 d+ m$ ?This trick is similar to int41h/4fh Debugger installation check (code 05
: i' k* \+ L6 S1 a% P1 X& 06) but very limited because it's only available for Win95/98 (not NT)
2 p- V) b) Y. e2 Y3 aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.. O. [3 S: p: H# D9 a( _
2 S' b" h, Y6 j% k8 Z6 r j& r
push 0000004fh ; function 4fh
% P# X9 N9 m% e0 _( t! I push 002a002ah ; high word specifies which VxD (VWIN32)
( r" H( L. \; U& E, X6 M. F ; low word specifies which service, A: n4 w) c/ k5 w
(VWIN32_Int41Dispatch)$ s( S. e2 g/ D% U/ _
call Kernel32!ORD_001 ; VxdCall) S% A& ~3 }5 E) {! l7 V# y. P# q
cmp ax, 0f386h ; magic number returned by system debuggers
1 A4 j) t( X* Y7 \ jz SoftICE_detected5 Y7 L7 C% l, B
/ J/ }. F' R; M1 K aHere again, several ways to detect it:
8 ?/ P) Z _' z
" ]5 N- X7 q' J8 e% u, x BPINT 41 if ax==4f
9 a/ o& ^0 @ I7 g9 I8 U3 L* O* S0 k# q0 x9 |4 N* k. n3 v3 [
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
n1 \6 Z" B& E# h( m# r Q; G
! t- I; N9 ?4 Z& w BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
9 v9 X& m2 `3 U1 q0 L7 y
' Y! x7 O3 d: N7 C! q BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!9 ^8 y; x/ f- H# v5 W" g' R
$ _! i3 f( v3 F* V$ W; Q1 M2 i6 K! ?
__________________________________________________________________________
t+ t/ D/ |0 A' i: `5 N0 }5 F5 W" _0 T+ t7 }
Method 13( ~: E5 s2 M/ C* _* l' C, W! E
=========
1 c% J8 x/ N" O* {% i8 X9 S
, T7 S1 U7 S( K0 INot a real method of detection, but a good way to know if SoftICE is
% Y- g; j2 c; G& f" m; hinstalled on a computer and to locate its installation directory.
- N7 h% l$ v# lIt is used by few softs which access the following registry keys (usually #2) :
& N4 w! j0 Q/ B9 i, o. r1 _& x- r7 ]+ D4 G/ z" O
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 d6 y, y, [) \ f7 x v: o
\Uninstall\SoftICE
8 s8 V# o! v" X4 e+ @+ T) Z8 I- a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 _0 j2 R$ Q5 x8 m B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ W" t7 o! f; t' u0 M. J\App Paths\Loader32.Exe6 k7 D Q6 b7 K
2 l3 l. k( G1 i. S
: t) u4 s3 d3 n6 ^% ]: I
Note that some nasty apps could then erase all files from SoftICE directory* Q0 ]$ a7 n# @" u; p4 {' x" Q$ Q
(I faced that once :-(8 m9 \, b# w e* P
# e7 K& b' U& p/ J
Useful breakpoint to detect it:
3 d( d* j2 N9 i9 L" w( P" i# O0 W
. k; q( ]$ G. b BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE', d- e! L2 i$ Z; m& U* l1 F
: V1 a0 A. E3 H$ w- M) p__________________________________________________________________________
* E/ _" p- O7 A% b/ h4 ]2 d" N/ S0 ]6 j0 v- w
, {- S6 S" T [3 b5 g
Method 14
- E. p7 X5 i7 F' I8 _6 n/ s=========
( k- p# [: K+ _( b; g/ x8 d4 E
( R* _7 N) p6 Q7 ^" |: b4 RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( u, ]7 ~3 F1 ?( `0 Vis to determines whether a debugger is running on your system (ring0 only).9 I' C9 w' B) a5 e
# r4 Y( X; G* H% l, v2 ] VMMCall Test_Debug_Installed
; |, N/ |+ v9 a+ D/ h5 g je not_installed7 X9 F) [% l0 }) B: T
" r( f* P' Q+ Q) U" p
This service just checks a flag.
6 G1 F6 o% v5 N' R$ f( h</PRE></TD></TR></TBODY></TABLE> |