<TABLE width=500>. x* b" Y: N5 z# L0 m
<TBODY>& o+ Y1 C% x# q- k3 W* s
<TR>, E* G$ [: k8 C! i1 R- E( n
<TD><PRE>Method 01
3 u- Z9 C p' L; i" L=========
5 |( h8 X( O1 F; G6 D0 w+ t9 P S1 W1 v
This method of detection of SoftICE (as well as the following one) is1 [& z# P+ | W
used by the majority of packers/encryptors found on Internet.
3 `5 C- b3 r0 u" x4 w* [. bIt seeks the signature of BoundsChecker in SoftICE- C! Q+ I8 } h# l2 Z! p& ~- _6 s
* }. X* D' r6 { mov ebp, 04243484Bh ; 'BCHK'9 M0 {) D* B6 P% L1 z
mov ax, 04h3 X7 w$ P' d; O% Y
int 3
* l& t2 i* b% [5 |, X cmp al,44 e! w( W- \6 q+ ]! c# L
jnz SoftICE_Detected
0 @2 d4 ^ X- t. H' C. A1 U1 T; d' u$ w( Q; A2 B& C; ]
___________________________________________________________________________
& E2 `, h5 C8 A8 l5 X$ ?8 \* s/ A6 T$ x
Method 02
, C! P) N r, Z4 y=========
* B- p/ O' K8 W n& j6 C" S) |+ \! s" U
Still a method very much used (perhaps the most frequent one). It is used
7 u% F' P1 F6 C& L/ Kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
V" z. `! G: ~% J2 yor execute SoftICE commands...
; O( W9 `& @8 ]8 J. e. NIt is also used to crash SoftICE and to force it to execute any commands! `/ v i4 ]6 Y
(HBOOT...) :-((
% z" b& @* w. x5 Y& \. ^) J* T
8 r3 V- G2 Q$ YHere is a quick description:6 N7 ], R/ i$ U) q6 F+ H$ f
-AX = 0910h (Display string in SIce windows)
% f3 s7 r# L; h& r4 P; \, O8 T: o-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# C# D% M# P- L
-AX = 0912h (Get breakpoint infos)
. Z! Y) S$ l# k9 h1 ~7 Y' T6 ]-AX = 0913h (Set Sice breakpoints)3 O, U+ P" a; v; t$ a) H
-AX = 0914h (Remove SIce breakoints)7 F* J. k% r" }/ t# k# F
3 ^* j# \6 w1 ]. TEach time you'll meet this trick, you'll see:
g: r, _6 r! G" E-SI = 4647h
5 c% P, a6 I& [/ G' j-DI = 4A4Dh. `+ f* Z7 h: j9 P
Which are the 'magic values' used by SoftIce.
9 g+ ^& v S6 d0 CFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# I- }3 [5 Q( ]8 P* d
, I8 r+ R5 G9 ^" F, J3 Y4 ZHere is one example from the file "Haspinst.exe" which is the dongle HASP
( x' d, j0 q, Q. `6 w) Q) jEnvelope utility use to protect DOS applications:
1 z% X q# y( O& N
" q- {, V# |5 r0 N" C! P
8 J% A+ j E% \% x4C19:0095 MOV AX,0911 ; execute command.
- {$ F2 i ~) @/ o- Y( H* z- x4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
+ Z! v9 X! F, s2 n4 Q2 a4C19:009A MOV SI,4647 ; 1st magic value.& A( O; x( }8 U8 S# P
4C19:009D MOV DI,4A4D ; 2nd magic value.' o X: G' q9 r9 J
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( s! {" j) \5 h1 a4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) ^/ m. \* z3 s1 l! h% ^, |
4C19:00A4 INC CX
) K' w& F. C- y3 b+ k8 Y7 w) F. ^4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ H1 `( p0 j5 U+ i* E. l+ k3 _
4C19:00A8 JB 0095 ; 6 different commands.
9 X6 o4 C4 ^, ^9 d3 a5 w4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 Q* \, R3 o: A, x) z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ ^) k1 j. ?8 f9 u6 c/ i7 n* z2 I' I7 n/ P) U3 H* q+ {4 a @- E! @
The program will execute 6 different SIce commands located at ds:dx, which% V" O% e/ o6 [% i# q! c
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 h* h) M* h e" n$ @4 |* i' y- p4 [ S
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 b" ?8 r7 [& @4 O' X
___________________________________________________________________________5 c5 X, d+ O6 W
3 P( s* v3 y' ^: p; c
- F( C/ T* y9 a; P
Method 031 ?! a- o$ O0 G0 _5 w9 N+ v
=========
* s1 m! \2 B( {$ G) U
7 O3 `1 V: F; X* ]Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" U7 m9 S' S9 t# d; Z
(API Get entry point)0 O& Y5 i, h2 M9 {9 u9 j
9 p2 {. ^% Y' c
% G/ }9 a4 U/ k' _. z9 O( ] xor di,di
. X( H) {1 h% @ P+ K0 r5 a# L3 z8 m mov es,di
% R. `2 v: _1 k( z" X9 R, y mov ax, 1684h & l( ^9 o% f8 y Y
mov bx, 0202h ; VxD ID of winice( S$ H9 s* E: c' ]
int 2Fh, z& f. {* L. P3 S# c
mov ax, es ; ES:DI -> VxD API entry point* l6 e0 o( I5 a
add ax, di
( G. p j1 q! Q1 d4 j- y( y. z test ax,ax
& U0 m" i, r( i" C jnz SoftICE_Detected* `, r0 U9 n; ?2 W X- C: j
0 \. ?, x! d! s' s* e& D
___________________________________________________________________________
- `6 \9 y6 h5 ?) E6 U
. ~& M% P( P5 `) D' `Method 04- q. f: U- I5 e7 X% ~% @4 q3 n$ q
=========
# A4 E0 L2 N6 `. m9 r. z2 e+ D
Method identical to the preceding one except that it seeks the ID of SoftICE7 d* H$ x) A G' @3 ~+ X+ m
GFX VxD.
9 I% u4 v5 ~8 w6 ]. _
- U; P- ?4 l: u5 ~7 ]4 G: b3 ? xor di,di
9 V7 d6 ~% q5 `6 w/ A2 q mov es,di- O# g) |8 w) P' y
mov ax, 1684h 6 F2 G3 D& ]6 |$ r- C" j4 u
mov bx, 7a5Fh ; VxD ID of SIWVID/ B& P- e1 e& V: s/ F. i% R$ u* ~
int 2fh
( G9 i2 L; r. N$ H8 q! T/ `) t mov ax, es ; ES:DI -> VxD API entry point' n( \8 u. |. ~0 B9 ]% X. I
add ax, di2 x% d* O( j) Z/ Z) I X. q; X
test ax,ax! T4 \: C9 }" O s% T
jnz SoftICE_Detected
F6 ^5 u7 ^9 \! U) @/ R- r7 L( W3 p- @+ c/ k# ?8 L% t9 J
__________________________________________________________________________3 v1 ]9 S* C2 ?8 E) I5 H- s
! |% v+ V4 C. ]/ E7 s: \$ t$ y
0 W+ E& R4 o. e6 s' q. _Method 05
0 U8 U" f' {- I$ ~& S: n+ Z=========% S% `. i5 J9 v, V
1 E0 S& i/ G* d1 e B: k
Method seeking the 'magic number' 0F386h returned (in ax) by all system
! X/ l, p& M, w6 Qdebugger. It calls the int 41h, function 4Fh.
/ G7 c, g" H6 u$ I8 C7 TThere are several alternatives. 1 R7 }0 P( E' c; Z7 I2 C* `
6 W" \# u+ J4 x( Z% y' K) ]* L
The following one is the simplest:
, S. {! Q; a9 G: M3 Y! \$ }& l/ f5 R
mov ax,4fh/ v: a* J7 i( V9 L2 e4 U
int 41h
& y/ g! x$ v9 e3 @; r- Y cmp ax, 0F386
3 }+ h" W" \$ o$ @0 c jz SoftICE_detected% e# X7 s( D/ M" N0 q* D0 S5 b. D
8 k5 b! G' `! z9 J/ @
% `8 @: @0 [( T! @Next method as well as the following one are 2 examples from Stone's
) e! [% z* F; ?( s$ @) t"stn-wid.zip" (www.cracking.net):
8 z% i5 c3 c4 [+ x5 R, Z n0 ^9 L6 U0 I
mov bx, cs
- @: \- d) `4 h% b4 v. S' {1 a4 a lea dx, int41handler2+ R: @! q B1 p7 F! T$ u& j
xchg dx, es:[41h*4]
0 ^+ W/ S- b( a% t* w" w, L1 c xchg bx, es:[41h*4+2]
2 R3 i) f9 f( B @# y5 g mov ax,4fh* _6 D. \7 W# _# s) B; Z- {+ N
int 41h
! Q1 ~4 a/ }$ U A xchg dx, es:[41h*4]
* q" I# ~8 @9 r# d- O xchg bx, es:[41h*4+2]
g+ H* o% H( w5 h, r' _3 y cmp ax, 0f386h
5 D6 P$ x5 ]9 t# v" q% P/ T) O7 [ jz SoftICE_detected
) c g* C8 B" N. ]
+ m2 \/ `* O" Kint41handler2 PROC
; @4 T4 c0 L f/ s0 T iret. q p9 F2 X; A7 ^0 Y& p: a
int41handler2 ENDP0 N2 s0 u& x% w# Z
9 @- F% e" z6 @+ h" P3 \" C, q- {8 s! U. `! j6 m
_________________________________________________________________________
4 ` _& A1 L) y: M3 w" S0 g; i8 b+ Y! J( W, \; G: H9 [/ N
/ `# I8 X0 u4 y+ Z" A1 k8 E5 Z& \Method 067 u- B; R/ E& Q# V
=========
. ~! ^" e4 b" N+ M4 \2 a0 w$ k3 B# i) m# Q" f6 @+ c
$ x8 b5 |, w) z$ ?4 e7 K8 z \2nd method similar to the preceding one but more difficult to detect:
' z* {! n% O: Y. }& z+ O) U% N
( f% `$ y+ M/ L4 }+ L9 ~) A5 P9 E4 h T
int41handler PROC
. e6 m5 V. O" e E, O mov cl,al# U+ K6 d, u7 [: Y2 b: w+ w! O
iret6 q/ i/ `9 M& x7 d
int41handler ENDP
/ x+ T8 a6 g( Y, Y4 Y0 L- @) v5 ?3 c0 ]
1 m( @. M* q6 Y8 J& g r5 n xor ax,ax
0 c: Y) m1 c& D( I) f5 R mov es,ax7 B+ n1 X2 q1 g9 l
mov bx, cs
0 Z7 Q" O' u8 }$ x lea dx, int41handler
" C9 \* _- j1 P; N! R& I& P% v. z xchg dx, es:[41h*4]
+ `& D0 {5 ?- N2 q7 P6 p xchg bx, es:[41h*4+2]* W# s6 p' I9 B
in al, 40h
- h. j9 o2 j; m, Z& x i xor cx,cx
" U% X q$ l2 `* }/ j; Z/ T* \ int 41h
5 Z Y' K% g; v% Z8 d xchg dx, es:[41h*4]
o8 ?2 `+ n/ E4 F xchg bx, es:[41h*4+2]
% t; T8 B0 H5 y x0 j cmp cl,al0 D! z. S$ |+ E5 j
jnz SoftICE_detected+ N q u+ N; ]1 A9 v
& B9 D: D7 P* u& l: o) N_________________________________________________________________________1 d* h) d: S4 G/ S7 l
: u, ^& b" M( |# s! EMethod 07
2 F# T$ N& o% L=========
. N2 o0 j, k }; H: f* t/ _( `3 V* P; B. {" `
Method of detection of the WinICE handler in the int68h (V86)
# S+ R9 P! a1 \# [( }2 A6 h/ ?
! W+ y7 k4 U& N mov ah,43h
* T3 |. P1 g5 @5 ~ int 68h
: ] y1 x4 U# S/ T% T cmp ax,0F386h, H. ?% R. Q0 Q1 U6 P
jz SoftICE_Detected
$ f- b5 c/ K0 J0 v/ V6 ^: y: k5 s8 s6 T
6 `9 k4 K! n" r: V3 [: _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* ^0 H, P8 C1 s k4 w5 B! F app like this:* E# h2 u/ N: w1 V/ o
* m, y7 j8 ^) D W" J BPX exec_int if ax==68
- |- m; X2 ~& {2 m# I" C (function called is located at byte ptr [ebp+1Dh] and client eip is
) h" l" o, ]: K/ r/ h located at [ebp+48h] for 32Bit apps)
* {9 V7 b; n1 g. h__________________________________________________________________________
5 ?8 L6 x- r! B( c* M% ?- h9 }6 x
' D& F! J2 T& b' d' }% ]Method 08
/ B& O# m1 D8 @: f4 a: p0 j=========+ @7 A% }7 F/ D" q! i
; E2 G% }. X8 U9 a/ G9 {+ uIt is not a method of detection of SoftICE but a possibility to crash the7 m$ `$ G4 S9 N+ E
system by intercepting int 01h and int 03h and redirecting them to another
: ]+ O# `' I! |4 \+ Zroutine." @- x: w2 Z ]" ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& Z _7 O) l! lto the new routine to execute (hangs computer...)
+ I$ o/ I9 b1 |8 W3 Q4 f ?% m0 T% d8 Z, m' ]" q$ h
mov ah, 25h
& s1 f7 g. B: v$ o; W mov al, Int_Number (01h or 03h)
5 D# W1 Q/ s1 R9 X1 T; s! | mov dx, offset New_Int_Routine
, Y! y8 f5 J6 o& p; z int 21h
1 ]- y9 O$ _) L5 W0 c" p
/ f: L: Y5 A+ x+ \7 ~5 [__________________________________________________________________________
' v+ t6 a2 e9 a7 _4 I' @5 _5 F/ G
Method 098 f: [9 S, H+ v+ _. z7 H5 v
=========# U! q+ C# c4 N5 B( v
% K3 G) h4 J: A. x. Z& m3 {4 TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* p8 k: P$ N& |* M3 Hperformed in ring0 (VxD or a ring3 app using the VxdCall).
5 S, @, s( ^6 b3 v s$ a5 KThe Get_DDB service is used to determine whether or not a VxD is installed- Z9 w. ~4 j0 i$ e
for the specified device and returns a Device Description Block (in ecx) for
' c5 P7 H. {7 a, Pthat device if it is installed.
8 U) ?% M0 `: o1 D% t( y4 l) w5 ~3 H
+ q% j4 p" d. S& x mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID" n; `7 T3 [7 f" w& {' X0 _' ^
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& P" w% k i) r) H
VMMCall Get_DDB q8 W# N- n5 o% `5 K
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* v, ^' ]( d, p* H5 U
) x/ p! S! ?& iNote as well that you can easily detect this method with SoftICE:
' _9 ^; M0 O% s1 u) o bpx Get_DDB if ax==0202 || ax==7a5fh5 @$ G) l! @& e9 L! u9 E. f# ?2 s
) u7 `: {3 F# q* S__________________________________________________________________________6 b$ G9 g7 P v9 g1 r& Z
. j: l1 |5 Y C7 W
Method 102 n. Q9 C. J; A
=========
1 T3 f ~* n' \1 \- f% }
/ i9 B/ Q1 H3 p: x. J3 a# }=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 q' H) \7 E" _; i! v8 V1 Y SoftICE while the option is enable!!
( e) O0 Q( Y' M5 F" l3 j7 W7 t# u9 v& C( M: S: {- m6 i
This trick is very efficient:* | \0 G" [. Z: g$ p) G/ V( A
by checking the Debug Registers, you can detect if SoftICE is loaded) c; P2 C% ~2 ]( S
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 Z- \/ M. m8 A7 j" g# e& B
there are some memory breakpoints set (dr0 to dr3) simply by reading their
) P" L- p; B* x/ J) }- O% qvalue (in ring0 only). Values can be manipulated and or changed as well
3 ^% s& u O8 H; |(clearing BPMs for instance)1 z8 F( `& ~$ o# x& _# y
+ q7 }. e- `8 v1 {9 }0 h
__________________________________________________________________________! r# G7 q! ?3 f B$ L+ A. A4 R
! B9 u: O* w9 D6 X- Q! I
Method 116 q5 B5 A* x' p$ k4 H& C2 L H% k
=========
) [1 n9 u0 v- k7 i5 ^/ ^( a# Z
This method is most known as 'MeltICE' because it has been freely distributed' k$ j( j" E* c: }( Y, p
via www.winfiles.com. However it was first used by NuMega people to allow2 K$ X0 V) E3 C
Symbol Loader to check if SoftICE was active or not (the code is located
R9 W$ p4 ?5 @$ Q0 E& k. {. ^" q) H: `inside nmtrans.dll).* C% u) H' q! P* y
5 u7 S! i$ y. X; zThe way it works is very simple:
" Z- L7 V7 h _6 A1 o1 oIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for5 E" k8 |5 a# h( O3 N9 ~
WinNT) with the CreateFileA API.
( r# \/ C6 @/ S+ y# X5 u! M
5 X, t' }. ]9 l6 j# Y* C; jHere is a sample (checking for 'SICE'):+ f1 e/ i$ `* ]& M
8 x |$ Z1 |) _- \. E/ tBOOL IsSoftIce95Loaded()
4 ]" C* r O; n5 I{5 Y' c, [7 G7 k: ^3 N) {
HANDLE hFile; 4 i2 p' m9 U4 E6 V0 N
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 j% A; O; V6 Y FILE_SHARE_READ | FILE_SHARE_WRITE,) Z5 p: `0 d5 P7 G2 H" H, C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 n% w4 v2 t4 |; Z( g/ ?! O
if( hFile != INVALID_HANDLE_VALUE )5 N1 V+ E" C% q3 ?4 O ^
{( o& E! U' L6 v. D: A2 `
CloseHandle(hFile);
% q' S/ g1 p. t9 i return TRUE;& [9 Q. n, N6 t4 |: A
}
1 ^' o) r* R# E' ]3 D" Y# z return FALSE;
3 s4 Y* `8 b6 e F! c' r) d9 z/ _}. u, @0 \ E' S' Z
4 B) f. ?* h, s6 s- B9 b) |+ e
Although this trick calls the CreateFileA function, don't even expect to be; Y- x5 W" Z; B0 n! \4 H( r
able to intercept it by installing a IFS hook: it will not work, no way!
" \, g* D# `' o& GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F: x: Z3 d0 K# z# T& Y1 O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 x3 e, m7 y4 s5 g) C8 T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% D' A8 q7 Y1 H* b3 {# a( Ffield.
' g+ s. J+ U+ ^* }. H2 ~2 g0 t3 R6 RIn fact, its purpose is not to load/unload VxDs but only to send a
0 u& C4 M+ L; y% C5 ]W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 C; M& |; |$ J. ?1 _6 G9 f
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% c4 y9 ]. L! l6 V9 l& l- N
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 C9 E" z4 H0 [" |) g$ p3 Q" ]1 {
If the VxD is loaded, it will always clear eax and the Carry flag to allow' z6 D( Z0 H* E/ Q, \/ s& ~
its handle to be opened and then, will be detected.5 Q+ x" i5 v: @6 D4 E' J9 E; ~
You can check that simply by hooking Winice.exe control proc entry point" S4 s' J8 y4 ?9 N7 w/ e: P5 x# k
while running MeltICE.& t* _( y( N( p0 q) N
1 _- l4 A* J6 T+ ~) K* Z7 W6 b
1 f7 {) m+ Y: {2 W$ e& s 00401067: push 00402025 ; \\.\SICE
( k$ a% ?3 x$ _( R3 _ 0040106C: call CreateFileA7 N5 k( f' b' u- T! U) ?: ?% O* z
00401071: cmp eax,-001
* M( ]7 M+ x# }7 U# \ 00401074: je 00401091/ B4 R. q+ G% _; u3 ~9 q
( x9 C2 T& A7 K' L5 U5 V$ H
3 W7 q: z7 t; }! u1 \8 RThere could be hundreds of BPX you could use to detect this trick.
9 H( q- Z. t: G! T! j M7 G/ U( t-The most classical one is:
4 U$ R$ f4 k/ y# j2 ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ M' t! [7 v( ]( L2 m *(esp->4+4)=='NTIC'$ H. W' c1 j9 l9 R, }' Z
% ~! g8 x9 j2 [$ N0 c: m- ?
-The most exotic ones (could be very slooooow :-(
: F; ?( s& r8 c8 J- l% j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( s0 l% M" Z1 r/ h7 I+ E- ], w1 G" w
;will break 3 times :-(9 h4 G$ M1 K3 l, b8 x9 i( Q
7 X. ]" r) `& z* `
-or (a bit) faster: ( {0 [- q e5 N1 k# w5 D. @$ j
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ S1 j2 H, f3 m; s
0 C: Z* M6 z/ a3 W4 L BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : E4 f2 |3 [3 U j% Q9 u9 ?. ~7 i
;will break 3 times :-(
9 x$ Q1 p5 a7 @ X" X& y9 y0 _8 c; m
-Much faster:
& q/ {1 B2 a3 C( h BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# m* b9 H4 `' p6 k1 b: a- {* v
& d I, `0 E G9 {& c nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
* I! G5 J& \* Y/ vfunction to do the same job:. m+ q- e4 J& q& W: e
- K3 s+ x4 i0 x8 c push 00 ; OF_READ
) {9 J* U9 D' H% D! c- X9 u* s mov eax,[00656634] ; '\\.\SICE',0
2 g, F3 `! M* T1 K; g/ h push eax
/ w; s, A9 F L; ^ p% l call KERNEL32!_lopen/ I" O5 M$ X/ a# V* ?/ i: n, ]
inc eax
' [+ ]4 m: B3 t+ ]3 R" @. Y1 A jnz 00650589 ; detected8 m5 {2 r3 {1 G9 h X' n s
push 00 ; OF_READ
! c" z Q- E0 _* V mov eax,[00656638] ; '\\.\SICE'
) m) M8 c6 C( W- m push eax) j" v" [+ s6 ?+ a# \( I2 f( s
call KERNEL32!_lopen
5 f. Y; d! ~5 C inc eax0 ^+ S5 a: {4 i( V; ^$ @/ q
jz 006505ae ; not detected
' X1 T. K+ Y1 o6 p; Z# N; I
4 K& M4 ? @/ K, ?0 C( x
+ M7 I- f( @: V) ^: K5 q% g$ r__________________________________________________________________________
0 h# |7 m' Q$ ?! @2 O) A/ m, w1 E
! Y* F8 W1 s4 D/ [/ I' a/ `1 BMethod 12
1 c9 {; j1 P$ p' H* S6 g=========% q6 r7 U: V! m" I
1 a; q2 Y! `: n h
This trick is similar to int41h/4fh Debugger installation check (code 05
) z4 q* i3 Y8 M1 q! ^1 _& 06) but very limited because it's only available for Win95/98 (not NT)
0 p7 L8 ^0 N) ^as it uses the VxDCall backdoor. This detection was found in Bleem Demo." `. a( i+ x5 V" o
! V/ j0 G; z' n" s2 h, C: Q
push 0000004fh ; function 4fh; j5 f& p- h7 W6 W! r. H
push 002a002ah ; high word specifies which VxD (VWIN32)* x+ E" W5 f9 o2 p# M4 j; u( ^/ m
; low word specifies which service& L" Y; H' T2 s8 `" s1 x
(VWIN32_Int41Dispatch)0 V* N/ z# H3 b) I: ?/ @
call Kernel32!ORD_001 ; VxdCall
7 k8 j; i0 E7 {" d' z( H cmp ax, 0f386h ; magic number returned by system debuggers
0 p, N- w3 c' Z) _ jz SoftICE_detected
" K1 _2 n/ m% W. s# f' e0 ?! d0 E. L8 `. ^
Here again, several ways to detect it:% E/ q4 ]- i, v- J1 K( q
0 X2 j: L* `5 m* N4 X" U BPINT 41 if ax==4f
3 { g! B1 ?0 H) h9 z* A% R) d% J! n: D- ~6 t4 v6 K
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; h: ]) d. ~* E% R9 V. d* t! p$ q7 Y6 W
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: m3 _8 K5 b7 F6 i
' G! q; k9 n9 g3 G4 ? BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; r' Q* ^" z- G: s. \7 Y/ k p0 u6 D% \5 N3 s s
__________________________________________________________________________
" V7 H/ J3 r; d! |9 q1 F. j( w: M# A
Method 13; Z# x i6 b X2 P
=========
. J+ N$ R8 B9 r( }& ]5 ], ~9 u. [, o& X4 c7 Z2 i5 X" l% h7 x/ D7 m
Not a real method of detection, but a good way to know if SoftICE is1 ~0 o5 }: U! w+ H2 I' _
installed on a computer and to locate its installation directory.
! p$ X0 Z5 q: r7 U c. CIt is used by few softs which access the following registry keys (usually #2) :
/ Y7 C% ^/ u. W
2 ]+ I1 G* p2 R% ]$ G1 a-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, P* p0 H* k: m! n( P
\Uninstall\SoftICE
2 A7 \3 p9 y- ]% O: {/ V- ~" `-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE r! V) A# E* a* C* u4 _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" n% X% r2 v: _# j\App Paths\Loader32.Exe
1 | |. K0 |! X
, w: J: p! t4 c9 V* G' @5 d5 z: i- g
Note that some nasty apps could then erase all files from SoftICE directory
- \1 Z2 O; O- `$ Z* K3 O0 U8 V(I faced that once :-(% [) ]& M7 H* ^3 V3 E; u/ `5 i
% D, n" w. O3 {, G0 f2 z5 H3 O
Useful breakpoint to detect it: i, V# o$ {2 y2 k ~+ `
1 ]7 c9 P( H, C- l! p5 w7 z; K# F1 Y BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% V0 D' k/ N9 S( I, @! Q! i+ a f( }) H/ r5 g
__________________________________________________________________________& d# S, u( n3 v' _2 a5 a7 A& E
1 L( Q' j$ }8 U' i' i
6 {5 P& F5 b& ^Method 14
4 K; f1 ^# m* n=========5 k) T6 F( F' B i7 f8 `7 O& R
3 }8 I0 S7 W& p) c0 N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- @" u/ L$ c. `9 eis to determines whether a debugger is running on your system (ring0 only).
+ a. d1 w' [7 M* \% f8 U) ~4 k$ L$ w2 K. K
VMMCall Test_Debug_Installed
2 T3 {% g. r; q% h5 W je not_installed( ?! p' j+ v7 |% c( E. V! J
+ `: j" X0 X" ? o3 }This service just checks a flag.
9 O# @0 |$ X5 m1 P# s2 @9 S</PRE></TD></TR></TBODY></TABLE> |