<TABLE width=500>
5 J2 X. z( u X6 o, {8 s<TBODY>5 u' N0 ~5 G3 K1 z+ _5 |# ]
<TR>
|( Q" A6 u( T# T3 M6 ~2 e<TD><PRE>Method 01
L r5 d% i! U=========
+ t' W8 E" u0 z; `9 H5 @. u
# H' y" U' d+ v3 DThis method of detection of SoftICE (as well as the following one) is
5 S" k" `* U8 j+ k/ nused by the majority of packers/encryptors found on Internet.
* [ K6 w% } }4 bIt seeks the signature of BoundsChecker in SoftICE
9 @# ]# a' ^. \8 V; |7 M; s* q `" o" p; ]: E, d! s& d
mov ebp, 04243484Bh ; 'BCHK'; \% k6 c9 ]: b- c3 q
mov ax, 04h. a* l) C: O) ]# w$ z G- f
int 3
4 z4 l- g- O1 C) Q cmp al,4
( v4 m9 ^" I% b, d jnz SoftICE_Detected
1 v2 z( J+ ]- y8 {: k6 J& z z2 G0 p. H0 f% w" P! \% @& q
___________________________________________________________________________
2 D8 p/ O& a' W T# f( s# d/ f! A5 v3 q" ]# R, n: @
Method 023 ?4 W, W$ S" r0 }( S$ m
=========) [* h: F+ _6 o5 r/ Z
4 R) U1 L; |2 z/ O" g# u5 `Still a method very much used (perhaps the most frequent one). It is used( e$ F! e+ y0 A5 ]5 i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( @4 {; P6 ~% For execute SoftICE commands.... `* s* A4 p* H( L0 Q6 e8 t
It is also used to crash SoftICE and to force it to execute any commands
/ A) n: e: `6 z0 f) b(HBOOT...) :-(( ; l3 s6 p1 N' @' K$ q' L
/ }- F& |+ Z6 |- I, AHere is a quick description:
- l6 K- D4 g; }3 u' V-AX = 0910h (Display string in SIce windows)
2 g0 s8 f7 s! q+ d/ ]9 u-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)9 M" s! F" C! H5 w2 l% p$ A$ ^0 c8 ~ P
-AX = 0912h (Get breakpoint infos)
4 j# G: X# a' ?/ n o-AX = 0913h (Set Sice breakpoints)
2 i3 c! g. k% f9 x" g1 Y-AX = 0914h (Remove SIce breakoints)9 z t. T$ Y4 F3 Y8 v' J
* W( `1 v6 u w( R% z" jEach time you'll meet this trick, you'll see:
5 U4 D6 T& ?( U% n4 X! K-SI = 4647h
9 y k1 C3 `: ]- d5 N7 G' k1 z) e-DI = 4A4Dh
9 w' g- G" s! T! d* H. FWhich are the 'magic values' used by SoftIce.- f7 M: y# b5 e6 ~0 s
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% I/ K) S) A @2 N
' _! T9 ~% Z/ Z8 |% G( XHere is one example from the file "Haspinst.exe" which is the dongle HASP
% u6 ?% E) P& R* A: S3 l" Z: \Envelope utility use to protect DOS applications:5 ~1 B+ [+ K5 R
0 D+ V3 r, F$ j) o, d5 n3 A$ `4 S/ p
# i' F- W+ i+ a5 E1 u2 [9 H: C' J0 p$ }
4C19:0095 MOV AX,0911 ; execute command." i1 d2 u( I3 \ r7 [" [
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 r" Z, N; f& _ W' c S
4C19:009A MOV SI,4647 ; 1st magic value.; G" t/ k4 o/ |
4C19:009D MOV DI,4A4D ; 2nd magic value.$ ` |% x/ Y. i$ ?8 K5 n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& e( e" Y" n+ v$ e, W
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 u& X' N1 q) H+ p- z! U" C
4C19:00A4 INC CX; c, _' g$ W+ I1 l/ X/ K$ V
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 N" n* X0 j( H+ ~4C19:00A8 JB 0095 ; 6 different commands.+ }+ h& g( [) g+ M: O% _/ S! _
4C19:00AA JMP 0002 ; Bad_Guy jmp back., n4 c" G' D4 j
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
; ^7 g" F0 d/ }/ A8 M; H+ ]7 Q, ]6 j+ u1 D
The program will execute 6 different SIce commands located at ds:dx, which: E* i+ f) w$ U. Z- h+ G
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ n' ?/ M1 u8 Q* a6 f5 O" Y
" v% g* R/ Y, M7 j* Z2 f4 e" L* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% x8 _* [2 r8 T& B___________________________________________________________________________- Z5 J7 Z9 S0 A9 t
5 A& a" @9 E- U8 G2 F# ?# n/ T1 P9 z
' q+ Y8 Q& O, W, m# [- T* h3 JMethod 03
0 a! @: E+ I" s+ f0 y' @0 x=========7 [; r" ?& F6 u3 _! U
4 W# j, `; L* b: L! N& q+ d# L e$ M( {
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# f4 @, _) i- X6 P2 b+ ~; \' b
(API Get entry point)
8 D9 B( [" D" @( [* [0 }+ x
; m5 d9 s* e! }0 j6 V& ?
; d6 t1 o2 D0 G! J n6 L7 B; ]7 v- E/ }2 F xor di,di
' l* x" S8 I" {- V3 S5 B mov es,di* u: E7 B O1 H# d
mov ax, 1684h
# ?: ^3 r( b/ p0 e mov bx, 0202h ; VxD ID of winice
- y2 p0 f q' h int 2Fh
0 ?0 v) A4 J, |( l2 } mov ax, es ; ES:DI -> VxD API entry point0 H M6 f! h' C9 e2 E7 \) M9 \
add ax, di g) B; L% e @2 h0 z1 t
test ax,ax! O. Q# c. u8 l! C7 ]
jnz SoftICE_Detected
) U2 o' B/ U7 X+ z0 z: k# ^' v6 l7 {3 p5 l! P9 l
___________________________________________________________________________
+ o9 t2 F) ?1 Y: w
% |3 ~: o/ J# k, V8 SMethod 04
7 J0 P& c; P! z=========, {2 z: F5 t( D7 t. `) R& g
7 a8 J: g- v7 }4 r& L
Method identical to the preceding one except that it seeks the ID of SoftICE
4 l3 b! X: x3 {$ N8 H, UGFX VxD.' p4 A1 S2 u0 U4 y ]7 V$ C
6 C7 O# p. i) I xor di,di
* ]1 N* h/ L8 @* C* J( t3 G mov es,di& |% ]: [) o7 ]. O5 e+ `
mov ax, 1684h
% \' m* u/ D) T; c+ U/ v% H& ^ mov bx, 7a5Fh ; VxD ID of SIWVID
t7 I8 y9 T& x# R. l. {8 Q6 { int 2fh
1 a* Y# R. _3 g/ R3 p3 z2 U mov ax, es ; ES:DI -> VxD API entry point5 L* {% s* d! ?9 j
add ax, di
6 s! H' O! W2 C1 Z: i# I test ax,ax
5 B" b' q# V0 _! B jnz SoftICE_Detected( q+ [+ b" @/ ^6 f& S9 X4 H. s
3 H* p3 [3 k4 v. A- |4 {
__________________________________________________________________________
`1 N7 O G3 B' e" {" v: D6 r
1 a* F# V1 s, k5 d1 ]- O1 {( y$ Z0 U [1 ~5 z+ W7 s
Method 05, M+ y! x; P. s# `5 H# [6 v
=========
' O/ T8 O, @$ U3 Q; }7 n
) f" y* i* r* K5 VMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) {, e3 ]/ u# l) h5 l! W* Kdebugger. It calls the int 41h, function 4Fh.3 W+ b9 Q0 M# R* i* ?
There are several alternatives.
4 x' x7 u2 [4 M- ^; @
. w3 O; ~5 w9 p5 T; `# z& U' S( K5 AThe following one is the simplest:" Q$ w( x6 D7 p7 E. G, @% x0 q
& m) t) ~. S( D mov ax,4fh
* V% L3 C7 Z( |! g int 41h
! b6 ]) n. U. Z0 H# _ cmp ax, 0F386
; s) S; v( Q( S3 X) U5 o( I jz SoftICE_detected
: O0 t7 }6 L7 Y
: N H& Z# @0 _# G$ K5 S0 F- O4 E9 V4 a
Next method as well as the following one are 2 examples from Stone's
1 F" k" I0 }* G"stn-wid.zip" (www.cracking.net):
5 L5 l0 h1 N# V6 {) z, ]' V8 d+ ?; H/ c5 F0 H& \, v1 i
mov bx, cs1 ^+ U: A$ f0 d9 x, r8 R
lea dx, int41handler2
$ Z5 q3 O* } k& K* r xchg dx, es:[41h*4]
% F" C* N- L! k/ d3 s xchg bx, es:[41h*4+2]
8 j) Z/ P E/ y7 N# B, k( k mov ax,4fh
/ h. O* @/ c6 N3 v6 u int 41h
" U& I2 L+ j9 v, z& o; V$ W1 G9 r( g xchg dx, es:[41h*4]
$ k" d* Z; c4 e( c9 `& [; J xchg bx, es:[41h*4+2]+ t% ~, C5 l1 ^* w3 H0 k
cmp ax, 0f386h v7 s! d8 e% @
jz SoftICE_detected$ P6 B# y* b( _( b' r" V. o. F
. s( B5 t7 z/ S$ ]
int41handler2 PROC/ N" s! K5 p; [8 {3 t6 w `) R
iret* X( j7 D% u& V& Q6 c/ s8 X) O
int41handler2 ENDP
% f3 G% u! E" B' Z7 X; j3 h) Y) R. J9 F+ u, F
& O: d/ m9 Q. v) a- n% b/ }_________________________________________________________________________
! y' G6 u; r$ O. ^. D0 Y; q L) u+ s' _( S$ t) L: V
- u) z* Z( [2 Y
Method 06
; Z4 J, W+ l6 m6 X=========, D( H& L3 W+ @* T
' L5 I% t. u! `1 d* J7 f$ D) z5 n1 D
: U# _. j4 I& I. D' i
2nd method similar to the preceding one but more difficult to detect:# ~$ w3 _/ K" s
" p& x* `7 @6 \% X. ]3 Q: z
" q! W. ^3 ~7 W9 P9 v. F
int41handler PROC
% O, b; M5 h- q' Q k mov cl,al
! c( x$ h& s# }5 ~( K iret
9 v% u+ I$ F3 z0 c2 yint41handler ENDP/ Z1 ^( N4 X% T" p
8 e: V5 J: K) n# a
$ u2 {( h# a& y$ ?9 z- L, B; v2 T" B
xor ax,ax& T% ?/ U( V! b$ S
mov es,ax& V4 \* t' J0 `6 o& O& C" o8 R
mov bx, cs0 Z0 z. b1 ^6 U
lea dx, int41handler2 f' d! `/ `: N2 F+ u+ o( \$ U
xchg dx, es:[41h*4]
" ?, Y1 D3 b3 A5 Q& ^" o- Z8 W, O xchg bx, es:[41h*4+2]" G* U0 K$ e# `" y3 z
in al, 40h' l4 C$ ]8 t) N$ J
xor cx,cx
1 ^2 v( ?) Y( y0 J int 41h
) D2 ~5 l, D; r7 A, e0 | xchg dx, es:[41h*4]& W& m. p+ ]% E0 ~
xchg bx, es:[41h*4+2]
0 }& ]! f( P- f7 L5 j' k7 b cmp cl,al( T& N4 n, J9 O% D7 n5 c
jnz SoftICE_detected
5 w% [+ Z& T$ ~1 p0 W2 _, x$ z/ ?/ ?) ]6 ?1 t9 q6 l7 v- b
_________________________________________________________________________
: P& x% Q0 ^' ^+ A6 q# T7 ]0 k+ u5 Z
Method 07
7 C: Q7 ^* z# d( a=========( \: H- X3 w, B+ K! Y/ @
3 @& }4 \$ [% r6 }# s2 N
Method of detection of the WinICE handler in the int68h (V86)
. `+ t2 [1 a( m
6 U' k1 t+ }& A6 p mov ah,43h. ]( K6 Q4 `6 r5 o7 j5 v
int 68h- k+ V9 s' G' C/ d
cmp ax,0F386h2 M+ Z! o* _5 P7 K/ U
jz SoftICE_Detected, u+ y: C, F# }
1 b" b6 t) ~& x. W7 Q9 \. F) e
- m' O1 {. ^5 B5 r" O5 j# T: H1 ^( b6 M=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
3 D3 D+ Y' u3 t }/ V+ x; F q app like this:* A7 h6 g' G9 v/ K
" e+ o3 _5 `# \/ W# P" K
BPX exec_int if ax==687 _( C3 r' G4 j# m
(function called is located at byte ptr [ebp+1Dh] and client eip is* {1 g- ^" F9 a' x. Q4 _
located at [ebp+48h] for 32Bit apps)& H) U) y, u9 \4 a( e2 {6 y
__________________________________________________________________________
* q7 {' T# v" E( W% U& A b ~, ~3 _3 [) s% V
8 x/ Y" O8 l, z/ Z9 k: mMethod 087 }2 m% ?. Q3 K* P5 d
=========
/ u; z5 R* K8 h+ {- Z- t6 |6 r/ D6 C# E8 s& B4 _# s* M# j
It is not a method of detection of SoftICE but a possibility to crash the
2 j. X; `: n* Csystem by intercepting int 01h and int 03h and redirecting them to another
1 Q9 e$ @( h! Q, m5 aroutine.
" _( K$ f7 t3 u$ g7 XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 c/ R/ G* ~: S' Z5 L
to the new routine to execute (hangs computer...)
$ J B* g- T7 J+ c( e
, \* P) k9 h. s+ W# S0 q1 z- r* f mov ah, 25h: V8 c0 ?9 t" R- J/ s8 n) }! k! d
mov al, Int_Number (01h or 03h)1 K" w' W1 J) \) ?$ ^& i B
mov dx, offset New_Int_Routine, Y: T* A$ n" F9 Y% \- b7 _
int 21h/ J1 A" J d1 Q9 G0 t, x1 O# ? c
9 f6 O v1 c; k/ E* {
__________________________________________________________________________
9 ?4 O$ [( h! \5 Y* H: C k, h0 O( U$ Z& s: G" s2 l1 F# }5 C
Method 09
8 ?3 ]! u$ R$ K=========
% k( X! ?4 {2 H
\/ P( u0 q! O3 Q2 ~4 j- G3 }This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( s/ J7 B/ x9 N: pperformed in ring0 (VxD or a ring3 app using the VxdCall).8 L0 d3 I: {* \- n: L
The Get_DDB service is used to determine whether or not a VxD is installed
- H* x4 Q. i! u7 ~for the specified device and returns a Device Description Block (in ecx) for" B0 r) {, D: d; O* A: Q7 c
that device if it is installed.
9 j4 p% R) E- n& k# `
0 |: L" @6 z5 y0 H6 D mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. ^: j! y* a& f+ P1 s. l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) _6 S! a" z8 o' p" u; J VMMCall Get_DDB
$ M1 ~1 M& {: y+ D4 q) y6 ^ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 s/ B% r' r8 a; k
9 p1 r4 T( P0 [2 s. WNote as well that you can easily detect this method with SoftICE:
0 v" A3 y4 b7 A5 a( p9 Y; Q( R bpx Get_DDB if ax==0202 || ax==7a5fh4 {) V8 F: P7 H R: C
4 _: ^. x! _, K& x8 R: m1 j__________________________________________________________________________
4 U1 t6 @( u9 G& f5 ~9 r% a) R9 J& Q6 w
Method 10
! l/ t2 w. ?7 Y8 C=========
5 T; I, [! E r
0 A0 x6 Z z8 c8 S/ R" D=>Disable or clear breakpoints before using this feature. DO NOT trace with- Q! }; k6 [6 O4 _9 S
SoftICE while the option is enable!!/ d. C6 l8 J1 N# j* j5 F
7 q6 t5 _. F8 `' ~) c9 I
This trick is very efficient:
9 b9 ^" A8 A+ B* G& Sby checking the Debug Registers, you can detect if SoftICE is loaded4 y+ c4 D, F6 u' ^- B+ Z; _0 i' y; g& x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ g9 Y+ w. W& Qthere are some memory breakpoints set (dr0 to dr3) simply by reading their
) b7 m N, e7 Y2 U4 x9 q% n* Tvalue (in ring0 only). Values can be manipulated and or changed as well
- x4 g$ W! T( p' Y$ S+ p0 F(clearing BPMs for instance)% K$ t. O* [; _# ]" B# E
7 z/ B$ e: [( ^9 Q__________________________________________________________________________
/ P% f+ l" e1 M# g' N4 n3 `0 \ p8 [3 ]4 {$ x: U/ M$ ?+ X1 q
Method 11
& I: w! C3 P C( F=========" J$ P# M1 _( I ~" Z- c$ o
( F2 W6 O+ \. k8 E
This method is most known as 'MeltICE' because it has been freely distributed1 x4 k5 X' I: e
via www.winfiles.com. However it was first used by NuMega people to allow
1 u) J# e p+ s+ uSymbol Loader to check if SoftICE was active or not (the code is located
5 }! ]6 o) Z, c- minside nmtrans.dll).' F1 R2 o) }: Z, s3 h
5 P W) K1 k$ {" d+ mThe way it works is very simple:7 l0 I, X2 _3 [6 Q! t/ c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" h/ t5 Y/ H1 Q# ]: }& y; r m
WinNT) with the CreateFileA API.& F5 [4 g2 s/ h* o- S; j6 r9 N
. D) W& c: }! |7 R; B8 p2 KHere is a sample (checking for 'SICE'):
3 r# v1 C5 B: ^) ^( L
) \ H6 C& S8 o+ T4 j! {BOOL IsSoftIce95Loaded()
8 K3 \3 W& I- v! O5 [/ K{
9 n: y' H. B4 ?9 j3 Q+ c HANDLE hFile; 8 d i1 |1 G* ]) z
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
3 d0 R8 b0 x9 G6 J FILE_SHARE_READ | FILE_SHARE_WRITE,( i7 H+ H# Y* `% ^* G4 }$ ^, m
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% u+ j6 x% w' W
if( hFile != INVALID_HANDLE_VALUE )" W& H" `, L, j( }
{
6 {, Q# I& J2 W4 T% n CloseHandle(hFile); [5 a* V0 X# v% y& Z1 ~
return TRUE;4 H w+ D7 W) G1 y: U* ~+ Z) v1 M! @5 p
}
' O% V5 j' C8 c9 n9 y( L+ [ T return FALSE;
& W" M. x! l2 z% e4 j0 e- k}
2 o% _. o- j8 c1 U! E
) F( x, H9 ^9 \4 h* l+ l* G5 Z1 M3 } zAlthough this trick calls the CreateFileA function, don't even expect to be
, m+ t& S+ d! y; i5 K: c. ?able to intercept it by installing a IFS hook: it will not work, no way!# `$ ?/ T& {: d% `( S/ G/ g' I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; Q8 ?3 D, P8 c: r5 d8 N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) x2 q; t. A: ]& A2 |5 @* a' aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
) `: U: F) J: R( T7 G3 ]$ I4 B: qfield.
. Y/ j# Y( q/ q" {- _( b1 OIn fact, its purpose is not to load/unload VxDs but only to send a
' ~4 Q l8 f7 u% j! uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 ?4 P% [9 n5 O( d$ N' {' l4 o* Xto the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 T; @3 M$ l6 c3 |to load/unload a non-dynamically loadable driver such as SoftICE ;-)." r7 _* G; q- C, V; G) F& F
If the VxD is loaded, it will always clear eax and the Carry flag to allow
! C9 S6 i% j- b! g. Iits handle to be opened and then, will be detected.
4 J' |2 i0 ]2 }" l* `You can check that simply by hooking Winice.exe control proc entry point
3 `7 } s2 N5 f$ rwhile running MeltICE.4 Q% s8 g) o+ N& J: _( X
$ I7 Z) s0 |# i b. v8 H: j
; _% T7 W' n7 v0 U9 U 00401067: push 00402025 ; \\.\SICE' q$ i9 \# R7 G. w( c2 [
0040106C: call CreateFileA
( n2 ^( D0 t3 v& K6 ]* c! H5 H 00401071: cmp eax,-001; O* G1 S6 Y* `. B
00401074: je 00401091
6 V# u! G. `6 h: V) Z0 W1 T; q/ {* E" l
# m) c/ f, ]; N: _- s6 x+ sThere could be hundreds of BPX you could use to detect this trick.0 A+ [ K) f, F! w9 ~0 f& N+ T
-The most classical one is:/ o9 w: q+ p M, ^
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) m6 I- }3 J& p6 U' v5 _
*(esp->4+4)=='NTIC'
2 N; ~- Y, A0 ~
* M( N7 d( E3 ~; d-The most exotic ones (could be very slooooow :-(
9 W, L0 Z5 ?- f/ y8 l6 {" N BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* V' }6 i3 I5 R C ;will break 3 times :-(
8 l3 F; Y# A6 _ z3 |' @" F- H) X8 p! E( @* c( q
-or (a bit) faster:
3 J3 B& o$ e1 d/ @. I, W5 K2 o BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 E4 [/ \( k3 k- @$ @
8 n' S5 g$ M/ h x6 H$ i$ {0 N' t; u BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % w3 Q) e: H0 p
;will break 3 times :-(
1 u0 m- z0 o4 Y
! f4 U& s5 y- }' p \-Much faster:' o$ h& m3 b6 x7 R0 G) \
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 p! s t- c) \' F
6 V4 P" R; ?1 x* N# J
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 ^: k0 E, \- h- L; ]# ~8 Z3 {function to do the same job:
. T- i% e& l- w' f! F- x# L# Q( A+ [& l
push 00 ; OF_READ
1 @3 b/ s; m* R% A, e mov eax,[00656634] ; '\\.\SICE',0: d X. t/ o0 k: n) Z
push eax( @# X; Z u' ?9 T* g
call KERNEL32!_lopen/ E0 g! y# |( ~8 s8 x9 \
inc eax+ Y, t) b+ P' A& N- ^$ r
jnz 00650589 ; detected: ^5 ]7 d4 t8 `, q! d
push 00 ; OF_READ
. G+ l. h6 b4 N, A3 R5 ?# Y# N' d mov eax,[00656638] ; '\\.\SICE'
7 O3 H( t6 o- v& \# O( ~7 a* { push eax
4 n2 f" f5 m: \6 h call KERNEL32!_lopen7 E4 ^) _ {0 z2 m- C. G
inc eax
7 X5 w- T3 r: y4 c! E jz 006505ae ; not detected
1 f1 q3 C6 _7 ~# M/ ^, y$ L9 M# o% x. J; d7 y- K
; w0 I5 Z, z/ G/ f
__________________________________________________________________________4 T, A, |8 F, P4 L* \- I
2 t" A4 c( j" L, S
Method 12$ l) c, G8 o2 ]' s! ^$ ^
=========
7 C( r3 c% _' W4 [8 P2 [4 J% |0 v' V4 t$ v; m$ ?1 m- B- g
This trick is similar to int41h/4fh Debugger installation check (code 05
$ l M+ ]" ^% e( f5 z& 06) but very limited because it's only available for Win95/98 (not NT)
" H u' j( R' U, d/ T- z, |as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. H$ N+ D; o5 ]9 `2 R
0 j% N; R" a7 `9 S push 0000004fh ; function 4fh- f+ z3 l @( ]4 P0 y
push 002a002ah ; high word specifies which VxD (VWIN32)+ J3 H+ c6 L) e% u! d$ Z; E1 d2 H" o7 n
; low word specifies which service
# A0 Y8 ^" B, _. m (VWIN32_Int41Dispatch)
& ]3 ^/ d5 v- |! X7 m! |- l call Kernel32!ORD_001 ; VxdCall; B9 U+ e# }" F9 w' y) x1 U
cmp ax, 0f386h ; magic number returned by system debuggers. ?1 e6 l* r$ L) |
jz SoftICE_detected: @( p/ y |) k9 w
, i$ V& h$ s8 G$ j" Z. g; n- u* T9 f
Here again, several ways to detect it:
d% Z3 ~9 t9 d- g- w! [+ r7 ?/ K
2 t$ Z- `0 D# ^2 ~ BPINT 41 if ax==4f/ X2 ?4 ]! p& e9 K
e3 N; D) P5 K& q' q6 C7 m4 s: V BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 _7 x1 e$ p2 x" N
0 \/ q f" Z- _7 B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A& P: B# C d6 [1 R
3 o) K" i! T5 v6 R1 M8 Z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!" w6 P7 f9 O7 z7 k1 F) {
& t. w6 f# H. ^3 Z. T# ^__________________________________________________________________________/ c0 @ b2 T3 D) U4 O, A
* t; l! X, k/ z( K( K" @6 IMethod 13
( m9 ^" ]4 ^; V( O; j=========0 D4 U& [- _: l( t$ g- c% c) R
: n- ^8 Q e( k4 S YNot a real method of detection, but a good way to know if SoftICE is8 G$ Z8 H8 j% n6 J4 A4 d' \
installed on a computer and to locate its installation directory.
( x/ i, v) Y. c& k0 rIt is used by few softs which access the following registry keys (usually #2) :
. b- }/ a3 J' G' ?
9 n8 X- u/ n' c3 F' v) p-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# R$ v4 V; O* V5 @: S' q\Uninstall\SoftICE* {, s+ `% l: Q- c- [0 A3 @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) ]4 n) l, m+ [+ r7 |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 g+ [$ W3 Y8 r! H) J. V8 W\App Paths\Loader32.Exe# g1 N0 e+ H/ I0 b' H% i
8 g6 r+ p" @ V: Y
0 [ h. r" r, s& t p0 P RNote that some nasty apps could then erase all files from SoftICE directory
' ]: _' u$ O0 T* h3 w: P' Z(I faced that once :-(
$ ?+ L- ^( ]; u' c
4 V! i5 _" O4 o( ^( IUseful breakpoint to detect it:' a. ]4 y j) w2 M9 I- W
" A D; i& Q1 z" R; T8 I# D
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% V& t+ a, Y6 {
# M, B7 U \+ U2 i__________________________________________________________________________) Z( Z O9 A8 J6 Q6 i2 o) o
, V; J& H6 G1 I' |8 I
$ p$ n; a" O# w7 e; V
Method 14
$ \5 J9 _: V/ f/ H R- h=========
0 m' R S0 I& V' r* F, e* y. E5 s) ?4 s* j2 M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# P# q, U- l {' C9 y. {' V! k6 Eis to determines whether a debugger is running on your system (ring0 only).' X) K* n1 d x, d, Z, Q: J( p2 m
4 x% n; d# ?* }* y3 k8 t( k& d! ^8 ~
VMMCall Test_Debug_Installed
) F9 x1 _6 @( j1 h( C je not_installed2 v# s; b4 `0 e* e5 ?
( j; a) E. T' }0 W$ |7 R7 v2 J& M7 bThis service just checks a flag.
' z" f3 \0 f3 Y0 s* B/ d7 ?. Q: \</PRE></TD></TR></TBODY></TABLE> |