<TABLE width=500>
% }+ e" o) j. y; u9 I# r, u& k<TBODY>8 T+ J8 s2 V! n
<TR>; Y& e5 K1 u$ ^, b" H, [
<TD><PRE>Method 01
+ m7 i0 s- _6 S4 w=========& X, ?# L, @; ]2 r% F0 }
5 m, s. {' ~1 p: ]5 p Y: q# M
This method of detection of SoftICE (as well as the following one) is3 I, H4 T" c9 F' Y
used by the majority of packers/encryptors found on Internet.
% t+ \: c+ a# V! B& JIt seeks the signature of BoundsChecker in SoftICE9 b S( q5 g$ e$ e7 V' N& i: n9 `
" C, D* A+ [1 ?7 I$ c
mov ebp, 04243484Bh ; 'BCHK'
8 I$ r. S" Z7 M* ]' H3 c. p* g# q mov ax, 04h
9 @( s; _0 n/ p7 r' a. b int 3 & k0 G2 H8 w; ^" F
cmp al,4, x9 f+ n, W( J, o$ ~$ n7 Z
jnz SoftICE_Detected8 M2 v7 C8 {8 s& u; Y: z
2 K( D$ E* m2 e" [/ I
___________________________________________________________________________
( n. y- C6 t- a' z% C5 a; N0 \3 n9 N# ~! q" o6 O) R
Method 02
3 z. a! S( T1 V3 t& N0 B* W7 J8 @1 w=========8 ?* X+ c( E R0 W
$ O' d9 P- `) B# M" r8 R4 ZStill a method very much used (perhaps the most frequent one). It is used
3 I! X3 S& k; F+ m5 O7 ]8 \) fto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* N! N, `' L3 N! R: K. ior execute SoftICE commands...' d' k9 a1 w7 V' h8 _; M
It is also used to crash SoftICE and to force it to execute any commands& n# e! q7 t0 b, e; b; S& S
(HBOOT...) :-((
0 Q4 w7 W. }$ f& i
2 b- y0 [3 E! a+ n; J; k3 [8 SHere is a quick description:
1 p7 S1 j6 m/ }$ W-AX = 0910h (Display string in SIce windows)
$ [! c- f2 C4 @+ ?- c-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)+ s4 L O5 o! g4 K1 ?: I# E
-AX = 0912h (Get breakpoint infos)( P4 o+ g; [ V6 y% [# p/ L. P9 I
-AX = 0913h (Set Sice breakpoints)
2 d. x# C+ {9 I$ K9 ]7 G* j" F-AX = 0914h (Remove SIce breakoints)
: S2 Q2 F/ x4 { S6 o/ E$ P
+ C# Y) h) c* {6 _! J1 hEach time you'll meet this trick, you'll see:' m; F j8 h$ G1 P4 x* L6 ^9 N
-SI = 4647h. F. f- B# r7 [+ X+ H8 Y" Y
-DI = 4A4Dh4 Q3 |0 Z- [7 Q
Which are the 'magic values' used by SoftIce.
2 Q( Y& z/ d* X2 T( U) rFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- h; D4 [7 s: u2 O3 {0 b( c3 r
5 N& H, ~ L' x2 HHere is one example from the file "Haspinst.exe" which is the dongle HASP
) D/ h( A1 s, ]- c2 }Envelope utility use to protect DOS applications:
0 |9 B# Z; k! s0 e! Z
* s* Z" ^5 P+ @* z* d5 R! E* |8 M$ @
4C19:0095 MOV AX,0911 ; execute command. @) m: M) f1 e& k; X/ y1 ~
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' P, {3 c' h5 c+ L8 o
4C19:009A MOV SI,4647 ; 1st magic value.6 y( l) `; {! L& N. w! W0 |
4C19:009D MOV DI,4A4D ; 2nd magic value.
! G, C' }! `9 s* F3 \9 g5 h4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ q+ y4 x' i% I0 {" T# _
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
; B! ^6 _9 j1 p" R4C19:00A4 INC CX2 M: \, _% Y1 t# m
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 z1 T8 n! P7 |7 M, L$ A$ B
4C19:00A8 JB 0095 ; 6 different commands.
& s4 N' }( F$ p1 {9 h9 [) y$ d9 g4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 t/ ~' T; R& i4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 X* l$ n7 b! c
I9 q* d# R) m' w, e( b1 JThe program will execute 6 different SIce commands located at ds:dx, which. {/ b4 x+ p) a2 x3 H6 p
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT." j6 C8 B; H) @( P* Z2 q
3 ]7 A4 J$ q6 e8 F+ l4 O4 I# n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. F6 M1 m& N/ k( b. Y) w___________________________________________________________________________) b- I. `# c( ~- H3 v5 A
# T! l+ j) \# ^1 O! M- z
. D' m/ @4 U7 CMethod 03" u$ l+ F' H- A$ o5 ?3 r2 m
=========
7 b, @, T5 Q; D8 Z2 k) _2 Y: t( {- h5 i. P
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: A" u( G, X: w& J* y' O
(API Get entry point)& n. {8 Y3 h( R+ e% W- {6 o7 b7 n( }8 g
* M A' F- X8 L4 M% k$ ?! {6 E& M, x4 Z( z/ G1 r# r
xor di,di: ~& f) t' C; D# b0 o0 X t0 l/ o
mov es,di
/ r- h- @, h1 u3 ~$ E2 Q mov ax, 1684h % v2 n2 y9 \7 V7 I2 T' P* V" t
mov bx, 0202h ; VxD ID of winice
# z, b; w: `3 m. x% \2 L0 ~! h int 2Fh
9 a% b$ K/ p, y) y. u! Q mov ax, es ; ES:DI -> VxD API entry point4 v1 N; i9 [' J7 U; H* r
add ax, di8 I9 Y4 R* `+ K( z' K
test ax,ax
" c d; E- w2 }1 o jnz SoftICE_Detected# z& R l5 P2 d+ Q, {0 d) B _5 S) y
( r4 T4 p! G" q3 ^) i( ]' y1 |0 L# X___________________________________________________________________________1 I0 K& g9 [2 t B9 D# v) o
8 D2 Q- \% i. F: o1 |% U8 h/ [ M" t
Method 049 R+ v) f( S1 R& V& G
=========
' o% _6 M& Y, a5 x# H, z* {( b. H) e9 Q* ]
Method identical to the preceding one except that it seeks the ID of SoftICE
2 R% W& Q( [4 K5 D; V: b' oGFX VxD.
) N3 U4 a2 j! S4 A
. f% |2 B4 c' G* p* g xor di,di! [( w7 A3 ~" C& A- Y
mov es,di6 L+ y+ v8 H- I- C6 G/ E
mov ax, 1684h
! |# ` p: S$ E; l mov bx, 7a5Fh ; VxD ID of SIWVID
% C9 f- r9 m/ r7 `1 w" { int 2fh7 Y2 M5 N1 U) l3 {. F0 S
mov ax, es ; ES:DI -> VxD API entry point
8 {, f2 R9 r! p add ax, di
* c& I1 ?" _, S* l8 h. l test ax,ax
6 o& W5 Z0 Z) O( _* h jnz SoftICE_Detected: W; B- j7 _+ _. D1 r5 h
2 L8 S9 W% B, n4 \0 O8 L9 y7 m) q__________________________________________________________________________
7 L8 L4 z& u- Y9 n5 L4 T) D* O( n* A( G5 a& m4 x+ R& K8 ^3 B% k
1 p& c3 y. L$ ?% L. m7 {Method 05. E O# L O0 a# G5 h
=========4 A. T& i! c5 {7 x
3 Y0 c8 W( O* X& `0 U, F& }2 `' @Method seeking the 'magic number' 0F386h returned (in ax) by all system0 u5 @1 G5 S1 P
debugger. It calls the int 41h, function 4Fh.2 x+ { k& \$ ^9 ]- g3 z0 e" Z
There are several alternatives.
! N/ l& Q5 z: t5 F$ @# E+ ]7 o# v: G8 e) ]5 F
The following one is the simplest:# K# h: V) D$ c! E2 |
5 ?5 C4 N7 C1 S4 t
mov ax,4fh9 M- K1 u) K. n7 s) g
int 41h1 m( x1 Z. D( ]# \! M- T+ N- l! a
cmp ax, 0F386
% \* u( }6 M9 e/ S1 K$ ~1 J jz SoftICE_detected2 l% N' T+ v7 ]8 o" G, `
; r8 x/ ^* Y. i. ^. s( N& A
) n' J/ X4 P$ L, W
Next method as well as the following one are 2 examples from Stone's
- j) l$ [- }5 k! F"stn-wid.zip" (www.cracking.net):2 ]7 F8 U# k$ E9 i J; w
7 P0 R) L# N; x$ x" O mov bx, cs
& {( P* X( C+ J7 f( S& g lea dx, int41handler2
( s$ ], r7 A% E% K: }2 `& p xchg dx, es:[41h*4]
" X" q4 |; _6 @9 u xchg bx, es:[41h*4+2]
1 d- B: |; w! o2 W9 b5 [0 a3 s mov ax,4fh
. [ ^2 r' k5 [6 p int 41h
' [( `* c- P5 o( c: R xchg dx, es:[41h*4]
7 w- h9 Q" p: ]2 u xchg bx, es:[41h*4+2]' t/ o8 K v$ ]& o) W& {
cmp ax, 0f386h
9 }) ^3 W, A. R, u jz SoftICE_detected
2 O7 C3 J' S6 m9 a* h
" Y% X; [6 @& K4 F. D9 Vint41handler2 PROC
. N" S: n6 _+ w2 z5 f iret+ G! Z7 K* V6 y! Y8 q) J
int41handler2 ENDP
- g7 t: f; U; Q& C. N! Q- G$ k& u) ]: N
q0 H5 L% s2 T: k4 m
_________________________________________________________________________$ v, g$ _ R4 o0 u$ Y
6 n6 a/ g! ~1 u2 G5 R& P/ h
2 ?6 a, p' [& ~( K# |. w; Y8 dMethod 06& ^2 c; [: d) z; U9 C0 z, b; q
=========) C3 y8 P* s9 q) w0 U
7 H! O o2 b' Y0 Q( \& m! f
c4 s4 H: [" W6 b# Z0 @1 X2nd method similar to the preceding one but more difficult to detect:6 _3 d, J( q. O7 S
) V0 I' J w' D8 W! c# |5 l1 O% O) J0 Z# R' D& b8 Z
int41handler PROC2 l" V4 X0 ]+ }7 h3 H2 p3 Z
mov cl,al
; M, P0 U4 s! R iret/ p7 u o2 g2 f8 y( d. O
int41handler ENDP
. I# y# n! _/ B. @4 W
; Q0 }7 m: f) I6 d. P
# B- T1 s' T' L3 I3 s5 j xor ax,ax* \1 k4 k! h! }4 g
mov es,ax
" I9 V$ d) V: p5 b% i mov bx, cs
0 z% e* r1 Y0 ?" n: w7 b lea dx, int41handler
' X! W; \: m7 \+ d0 Z7 n3 [8 v5 {9 o xchg dx, es:[41h*4]
. T% R. _- F) \3 R. o5 g2 M% ? xchg bx, es:[41h*4+2]) f& m) D$ L/ K: y! C
in al, 40h8 B# t; \& c3 i, W, H) e- p' d ?
xor cx,cx
4 D3 m/ e* i6 i( V c5 w int 41h
2 R( @( R. v/ Q+ s, Y xchg dx, es:[41h*4]
5 a0 R! {; I4 h4 q xchg bx, es:[41h*4+2]
. v' }- }; F" O6 ?9 y) \ cmp cl,al
. M. L7 z1 r: x7 Q. t" r jnz SoftICE_detected
" P: b* l5 ?1 l1 a z* f) \/ i* z
_________________________________________________________________________/ |. u+ a% H: C; ?; N
2 R# b( B- v7 B
Method 072 q0 |# \9 C8 I G' H3 b8 E9 G
=========
4 H$ v; _. t# g4 B: s& @" b) g
/ w0 t7 ~ Q6 r7 G7 ?9 Q0 wMethod of detection of the WinICE handler in the int68h (V86)& F$ N* U; u% n/ b
' w# H" @6 R+ l0 {' n
mov ah,43h
* P) T% ~7 Y2 S _: j [+ @- I( L* T int 68h4 _& I0 }9 q/ a6 y: f- \2 H( Z
cmp ax,0F386h7 x9 Z7 n( a8 c7 f
jz SoftICE_Detected( Z2 m# ~ @/ i
! H, C1 j0 r4 R6 w
* t5 G7 B6 E' E1 y$ o2 U=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( R5 o" @$ S' {* P9 t a f) C0 v app like this:
. i6 S3 X8 M2 f J/ s
. A' `' t: r- {! z0 ~% U BPX exec_int if ax==68" M/ y+ {& ?5 ]1 v) M; d( A3 b/ f
(function called is located at byte ptr [ebp+1Dh] and client eip is
) _) r4 g/ a0 j8 a located at [ebp+48h] for 32Bit apps); z! f5 e3 R2 `- J4 N5 v. _
__________________________________________________________________________
# w/ _8 K2 Z: y
/ f2 z( _8 i$ T- j( o' E# b. y" R1 u% h( K. b( z6 T: h2 U2 L
Method 08
) a3 h& F2 f6 r4 p=========' P7 F' T Y; T- {) }/ g
2 `1 K! a; P$ m, w$ ~) N) y
It is not a method of detection of SoftICE but a possibility to crash the& A; X1 F+ w0 q) I+ b, P( m. X
system by intercepting int 01h and int 03h and redirecting them to another
0 _9 s: m. K3 `4 Yroutine.0 ~$ J) A; t) ~: ^( O; z; O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 z, r0 \2 A. U) ]3 D P
to the new routine to execute (hangs computer...)
( S3 }8 \' f$ T" r8 X `9 P7 z& C' Z, P/ Y/ }* }2 ?
mov ah, 25h
5 s/ C$ b0 q' d mov al, Int_Number (01h or 03h)+ U* |1 E# a- U5 ?( S4 E
mov dx, offset New_Int_Routine
" ^. m& x- ?% q3 u7 G8 Q int 21h
8 H1 ^! a5 P+ H4 y' a7 q! g2 W: |5 Z0 F/ z
__________________________________________________________________________
' w( y2 W! i$ z0 w8 |% s. m- `4 l: I# e6 E4 @2 ^ `
Method 09. M5 ^6 I/ m. U
=========. o* ^6 e% m/ {& O' z: G
0 u, j" {$ J' H: ]
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, l4 V, e4 D* g p0 J) Pperformed in ring0 (VxD or a ring3 app using the VxdCall).: N1 e1 |% [; y8 H
The Get_DDB service is used to determine whether or not a VxD is installed
% J- }4 B( F( G7 e8 V" H( tfor the specified device and returns a Device Description Block (in ecx) for
" n5 q' R% t7 V d5 rthat device if it is installed.' s+ i( O$ R# _* ^# [. Z- D
! ~. A; f6 I# F
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& I, ~1 ~+ ^1 U( c
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); l! ^/ M0 b$ ~! a; L* E
VMMCall Get_DDB
9 s8 z9 k" L5 j: I2 m7 C/ j# P8 l mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* N7 S; @& l1 K N' _
$ ?: n/ P/ [, ENote as well that you can easily detect this method with SoftICE:
2 } H: [% ^8 g+ O. T bpx Get_DDB if ax==0202 || ax==7a5fh
& x( w% ^+ p. V8 J
8 o7 W6 e* J4 \5 c5 f__________________________________________________________________________& Y; e! Y0 d3 H; v5 c
( i# y, t* R, \2 v. uMethod 10
* B, ]; l) g9 h9 @3 y=========
# w1 R' o+ Q' A6 }& t& v$ w
+ f; M2 G6 {# C0 f1 A" C=>Disable or clear breakpoints before using this feature. DO NOT trace with
( r8 v* k ?1 Y; }, f SoftICE while the option is enable!!/ k q) c7 S% q0 s+ k2 ^
" i( _) R7 U8 p h" ?; c) OThis trick is very efficient:3 \% Z7 S) z4 h; `
by checking the Debug Registers, you can detect if SoftICE is loaded# o3 ?, B" g& N3 o6 x2 S4 `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if- h% [; V) T1 c' Y* i" |& Z" s
there are some memory breakpoints set (dr0 to dr3) simply by reading their
2 g2 Z& I2 I" Z/ p* [$ }$ mvalue (in ring0 only). Values can be manipulated and or changed as well
' @1 Y- P$ a9 ^(clearing BPMs for instance)( W, d L4 _2 A5 {3 r$ u. N$ P! X& L
2 k' B; d" w- ^2 y. x# p! s `8 j
__________________________________________________________________________
% x& Y. }) y; ?- y2 I/ G
/ P) R) k t4 F% pMethod 11
/ R) @, A5 M! B( D/ y=========
$ P* E! H6 g. j- o5 U0 q; @( R T X: K! K
This method is most known as 'MeltICE' because it has been freely distributed
, F+ [0 U% ~) [2 j" i3 r2 ~9 r' V7 `via www.winfiles.com. However it was first used by NuMega people to allow
. f* X' \# P- E4 t5 {2 q, V# GSymbol Loader to check if SoftICE was active or not (the code is located
7 r( q6 |: N; x, R* winside nmtrans.dll).+ S) D3 `0 I+ v8 c4 d# n( D A2 T
4 B. s% J1 X3 J
The way it works is very simple:& I: w8 l+ R* k; O# O
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& o C/ I- z9 F: r
WinNT) with the CreateFileA API.
. Z5 v9 I& x2 v# K; V3 l
/ P+ }" k8 X. hHere is a sample (checking for 'SICE'):
4 H. d( Q/ D q9 s0 n/ [8 o) ^6 h! a; a8 o
BOOL IsSoftIce95Loaded(), G# g7 V) h, O( k1 U$ d* z
{8 v% p5 ?$ }- {. `" L; ^
HANDLE hFile; & \1 ^; M. P9 K8 y7 ^" J
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 b( W# C" o; d/ [; [1 F FILE_SHARE_READ | FILE_SHARE_WRITE,, d9 W7 h/ r0 i# B0 W K- V
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 `+ Z* g+ S! d
if( hFile != INVALID_HANDLE_VALUE )
- i1 _, b% f5 v3 I. v {# C) _ {% |7 Q' z" y! W9 V1 T
CloseHandle(hFile);9 b: G1 R3 s, l+ `2 ^/ n
return TRUE;
' b- j5 _ ~) z) P5 C j }
( D9 j b6 j" d- w return FALSE;( @0 M! J0 j* c, ~! Q: c5 {7 ~
}8 v- V2 L3 x, s1 S' Z1 j
" O% Z: k, u gAlthough this trick calls the CreateFileA function, don't even expect to be
, e8 l# j4 j: y: w0 @, Jable to intercept it by installing a IFS hook: it will not work, no way!
5 r, v% k) N* K& I- vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
R/ e" @! j, j7 h" v8 J$ R) J" Yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 T1 t P4 N" M$ h& O% {and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 P8 m( f% `0 W2 _; _8 cfield." J, [: k7 G4 C* a% Q
In fact, its purpose is not to load/unload VxDs but only to send a / a4 ~6 \: J1 b; T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) X7 |$ [4 o$ t8 nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
: A, X$ _! t4 f5 Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).
# l8 H4 Q8 x8 e& O1 z4 E7 _If the VxD is loaded, it will always clear eax and the Carry flag to allow
; ?& l# T; U5 R# oits handle to be opened and then, will be detected.: K# J( y) Z# y4 G: A
You can check that simply by hooking Winice.exe control proc entry point
0 U$ K9 [+ ?5 `) j) W x* d6 Owhile running MeltICE.
% g8 O. A6 [) q- ^, [ O# J; R# x9 j& \8 v
1 x+ a& I6 H3 n6 y: K$ Y9 `
00401067: push 00402025 ; \\.\SICE% [9 K8 {2 q" n6 J: w( A' P, \
0040106C: call CreateFileA
$ b5 \5 J7 ^- J1 f 00401071: cmp eax,-001! r4 D1 B* M; w0 e" {( y# A* [' l
00401074: je 00401091% q* C# i0 T9 l& }
b. t' I" x/ [( F3 i
9 m. X) h6 P4 a3 I5 {4 D
There could be hundreds of BPX you could use to detect this trick.: O3 ?; c9 v) q( M! B, r
-The most classical one is:# ]/ f H: V4 z
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; W. @* m- E: d3 i8 u" y
*(esp->4+4)=='NTIC'
) j2 b: G; Z6 ?6 Z. `$ ^0 V" a- c! F; N8 D- p4 ]7 s
-The most exotic ones (could be very slooooow :-(
% L) v3 h; w0 O+ R/ A2 B7 E' G BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: |5 `, F4 k( u! m8 g* x ;will break 3 times :-( h8 w% ?: n, J1 @1 J' z
8 R8 Y9 D/ V9 U* q' Z0 B-or (a bit) faster:
* M# w- \" T9 b& c0 x BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( u1 l/ \0 _5 J$ K( m; ^% c; p f6 y/ ~: y X' C4 P5 ?7 {2 k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( M& A* B, o a0 _ ;will break 3 times :-(
* B" S5 }9 O2 w& g8 h# z8 V+ ]) Q8 \% p# q2 L
-Much faster:
& ^) A# h& G) K% r" w1 ? BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( B# s0 Q A' m- y0 R! }# s- ~: h' }+ {' o7 Z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 v. I; f. Z1 H* I9 `0 x& kfunction to do the same job:
4 ~" T: S2 H8 T9 V
) R" q. f8 A" F$ i9 K push 00 ; OF_READ* L* U5 p4 E* _/ e# [
mov eax,[00656634] ; '\\.\SICE',0+ {' F7 o- c+ ]
push eax9 Y* s, K& }2 G0 X" |2 H
call KERNEL32!_lopen1 D/ Q0 g7 \9 X) |
inc eax! D& p0 T) x% f" W2 x/ @4 Y- L
jnz 00650589 ; detected
7 [+ @/ C' F4 j1 [0 M push 00 ; OF_READ2 f/ }3 s; k$ d! |
mov eax,[00656638] ; '\\.\SICE'' [7 `4 g8 D2 y, T
push eax
5 Z7 `" v! H! K4 i" G. ^ call KERNEL32!_lopen
: i( D4 H% R" y3 r+ p+ ^ inc eax8 Q& `2 M" f* [" ~; j' U
jz 006505ae ; not detected
! ?; g8 n5 x* E: X8 l% v5 U. Z# h% U( _
' }. ]. P8 ^0 t__________________________________________________________________________
& B. x [' J1 N: ~8 W4 y7 ~! N, m+ W& f! S( {1 Z/ v. f
Method 12
8 k- y6 F) v) R* [8 l=========
! w, E! _2 c( v4 W. n1 m7 g& x/ k9 @7 v: ~6 F: m; n2 {2 R
This trick is similar to int41h/4fh Debugger installation check (code 05
2 t! ^/ m, j8 L) v& g: O, x$ q+ L& 06) but very limited because it's only available for Win95/98 (not NT)
' a. J* ]! M# [ Y3 ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 M- R: M0 W# r6 F
( m2 u X$ M% M+ r
push 0000004fh ; function 4fh
1 c, a) A& i7 G3 X. N0 S( O push 002a002ah ; high word specifies which VxD (VWIN32)7 l1 l8 `/ P2 M; A
; low word specifies which service- W2 u1 M0 a2 g& Z' k8 X+ k
(VWIN32_Int41Dispatch)
$ n6 v: t: r: n. k' w; ~ call Kernel32!ORD_001 ; VxdCall
b2 e2 Z1 D( K5 W. V+ D& Q2 r cmp ax, 0f386h ; magic number returned by system debuggers+ ^% ]3 @+ d- |) r
jz SoftICE_detected
3 Q5 z* N T. m, E0 m9 O7 f' s( J* }1 x8 Y) _
Here again, several ways to detect it:
& I7 q2 h2 n. b
" f" ]; Y, i1 T9 g BPINT 41 if ax==4f
6 e7 v, X* X* P
7 o, P2 E) C, A' f, P/ q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: @/ Q$ ?0 a4 J& I/ y3 N w
7 G1 q+ K, [2 o
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A ^. B! x y b5 v3 o' y I0 q2 y
$ [, R) p2 A$ s* @2 d% b8 u# M
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: K5 N; O0 x8 `: @+ @' N1 Z$ W. O& U3 f
__________________________________________________________________________$ H' R# ?, n g3 l$ P$ t/ t4 g
i$ k0 g5 J9 o9 h2 b' \# dMethod 13- }% O7 s. T1 _: c- a
=========
2 |6 {; u* b! M( o# h6 l5 Z
' L" H7 O3 n1 sNot a real method of detection, but a good way to know if SoftICE is
% J8 e2 E3 p# r% a! D7 G* [installed on a computer and to locate its installation directory.- ^% ^) |- z4 z
It is used by few softs which access the following registry keys (usually #2) :
# H/ m7 w! q$ T C: N0 U* M7 e7 t, N+ e. L. w6 w. E8 O* M
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 @( V# ^+ t4 y! J4 J% |8 c4 {\Uninstall\SoftICE
0 V7 S2 z$ _8 p! h0 E4 Y4 b( k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ L, X4 J0 |! J; a
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 a# S" W& |4 H+ s7 k
\App Paths\Loader32.Exe0 ?" O/ y" q4 x
6 r, N; u$ L) J. w8 x
* E8 X* O8 v9 r; tNote that some nasty apps could then erase all files from SoftICE directory
: Q1 [% ?) e. I: @" Y! O# N6 K(I faced that once :-(% [1 U7 Z& r; _; c- M
( A1 X0 ^* ?6 ]- w. }9 IUseful breakpoint to detect it:
v/ a7 o& M" I5 d7 I; Q' ~( u" ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 q# R; z+ p3 I/ e( P# \5 Y
3 m' v- X* C: q O, X8 T4 Z
__________________________________________________________________________
: Z$ ]! x! A0 K$ i
8 {; B1 p4 N- O( J- V' \7 b& U. A
3 H0 m# R% ~! p$ xMethod 14
d. Q* \2 L( ]* J3 |' N7 X=========) E- o9 O+ H7 m* x: L
7 ?) E' D) m- _. B( r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 ^( T2 ~6 p5 n) pis to determines whether a debugger is running on your system (ring0 only).: i7 @2 a3 k" b& V/ }4 T
4 ]4 G9 T# N$ e& H5 ` VMMCall Test_Debug_Installed2 Q& M0 X w0 |' v# W$ `2 T2 X
je not_installed
8 }1 a* ^" \5 m7 E* c+ r( Q4 H" {& }8 [6 B( i; ?
This service just checks a flag.2 r/ c0 W: c* m0 ^
</PRE></TD></TR></TBODY></TABLE> |