<TABLE width=500>
; T, Z$ k2 d8 C. {. I<TBODY>3 M. q3 _4 |# ?* V3 R" f5 X
<TR>( r) o1 E* e- Z; f: z
<TD><PRE>Method 01
+ w3 a$ B w3 r% r=========
1 C; K4 B: E& V" I
3 r8 l0 W. W9 b) x% {This method of detection of SoftICE (as well as the following one) is
; U2 f& h7 g- Yused by the majority of packers/encryptors found on Internet.
, X- U7 B2 m5 y3 h9 G1 V8 CIt seeks the signature of BoundsChecker in SoftICE
- K- q0 }3 Z& ]9 i' B" P- r/ h" q( U& [8 {% P, d
mov ebp, 04243484Bh ; 'BCHK'5 |- F( |/ a, P$ L* G
mov ax, 04h
0 E8 Q) M. [ v, ], \( a0 O int 3
( O' ~8 e( d) R3 u cmp al,4
0 V5 R$ I" X3 L7 x0 W/ V) [ jnz SoftICE_Detected x9 g% i4 h+ ?8 p. @
8 u' R+ i0 Y, }. ~, G/ \' o
___________________________________________________________________________
! L' u8 T: z* L) B5 Y/ T' M. W
( g% k( V- p1 GMethod 02: G+ \2 q! y3 H) t8 l
=========
6 {1 ]1 i. P) C- u
8 R, ^! E# x1 B% l0 ~Still a method very much used (perhaps the most frequent one). It is used
( ~, s. C. X2 ~5 Rto get SoftICE 'Back Door commands' which gives infos on Breakpoints,- Q+ |# Y+ v* s. u% e
or execute SoftICE commands...
! h# I& H. g+ ~' U* OIt is also used to crash SoftICE and to force it to execute any commands
) O7 j$ u6 V2 s4 B! e(HBOOT...) :-(( 4 n% t8 Y5 W4 m5 J: J
Z( p7 A( B( N" a
Here is a quick description:
+ v, L; O4 f0 m3 }5 d-AX = 0910h (Display string in SIce windows)
6 z9 C" H' V* Y-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) |8 P% h4 ^1 n% V& H$ {-AX = 0912h (Get breakpoint infos)8 A: I5 y) P* f/ {$ \
-AX = 0913h (Set Sice breakpoints)
t& A. c- A% W" A4 w-AX = 0914h (Remove SIce breakoints)
' J3 Z. ]9 [; K" C) X X5 z1 h. |0 p, g4 D
Each time you'll meet this trick, you'll see:/ |* _; Z4 S# d+ B8 h8 d
-SI = 4647h) ~& z& c2 \3 U. [8 k, x) Q% ]! b
-DI = 4A4Dh
& v J2 q$ R$ e" I/ kWhich are the 'magic values' used by SoftIce.) d4 Y5 j4 c6 T- V* F1 p( I
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 O+ O8 g0 x% a: F1 ^ x' W( @, M4 p+ _
Here is one example from the file "Haspinst.exe" which is the dongle HASP
' k0 e: Y- C( k0 I+ }5 m2 }Envelope utility use to protect DOS applications:
* P/ H% Z+ o! [6 q7 W/ x% V1 |# D0 g! O
" A5 R) p9 _& [1 |; U! Q
4C19:0095 MOV AX,0911 ; execute command.
' L3 L0 z4 J, L, O4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- P* F7 @+ [3 g$ ?/ U6 m5 J
4C19:009A MOV SI,4647 ; 1st magic value.. O- |5 x& J7 H+ G. s
4C19:009D MOV DI,4A4D ; 2nd magic value.
* L; ?7 n2 a4 Q7 f5 `& V- i4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! q) {# L, i" d- T
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 Y ]5 _! u& r0 b3 X" R
4C19:00A4 INC CX
( f$ [( J& [- W; X9 `4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& p2 d7 x8 a4 j8 k4 @ e
4C19:00A8 JB 0095 ; 6 different commands.# |3 e$ f3 O4 G. D- Y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 W2 C$ c5 ?( _" X
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 g) ?5 k9 J5 U1 B* n
5 ]( |9 s# }- {, V5 f# f" ~3 k5 f- ZThe program will execute 6 different SIce commands located at ds:dx, which
) ` P K' U- nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; Z8 l, E" z# F( N- C# _
0 w) O: B( }, Q/ `: y, F
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! g# w5 ~& D d
___________________________________________________________________________* j B: J% O. ~1 R, G1 r' B2 U
5 M V5 I0 F/ n, C, `- Y7 B/ m4 K, T7 g. S( U9 M& k& ~! c' g
Method 03
8 l0 y& }1 e7 o0 o=========5 P3 ]2 d `9 f' h, w) v1 E
2 I0 ]6 a0 |3 {. v0 ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
3 l$ q" y2 `4 j: n" D5 c(API Get entry point)
: t B7 b2 ?. T2 y9 _
_. V0 c9 W7 w
$ B7 A f/ e7 D" [# y: L xor di,di
% V' {9 m6 a+ a' n1 G mov es,di
* b# Z( U3 ^* S. I* e) M8 Z mov ax, 1684h # M; }5 j; o( g' L9 a0 @: i% ^+ {
mov bx, 0202h ; VxD ID of winice/ r; j, n2 [1 f. ?$ s6 }
int 2Fh C( Y2 T: ]8 U. n! y+ a0 o
mov ax, es ; ES:DI -> VxD API entry point
* x. [1 p) j a# f0 b0 l add ax, di: \* a( E) X0 w6 R: I
test ax,ax
) s$ e3 w! _( m# i2 _+ K, M/ [3 v! g& S jnz SoftICE_Detected
# @3 _6 m& e; n$ G
8 d! }5 i5 |9 _9 e# B: [- K' e___________________________________________________________________________/ W9 a5 W+ n( b7 y* f9 k, F
0 ^" M+ f% o* x, K2 ~% h' BMethod 04
" Y: T$ Z' p; f% e6 E2 w- A=========
) O- D ?6 G! c0 X: [: `# R/ f) r) p6 m$ t" ^4 `% a7 X' G$ t
Method identical to the preceding one except that it seeks the ID of SoftICE
: ?5 T3 K! `9 g: T6 `GFX VxD.
) R2 b) r( T* }
: W) X. G7 G, B' _3 C+ M! L xor di,di$ g+ w% H, j# D( H+ p. I
mov es,di
% ?- q4 P( v8 a+ f8 u mov ax, 1684h : R# k7 i& X3 s `
mov bx, 7a5Fh ; VxD ID of SIWVID
, h- g8 t7 [; F8 } int 2fh
! j1 \0 a! ^. y mov ax, es ; ES:DI -> VxD API entry point. K# {/ L1 W: s; @4 j# ?! ]" [
add ax, di {( S" @( f! y u# ~$ p% k
test ax,ax
- V& W+ W) n6 X Q jnz SoftICE_Detected
& e$ `# r- Q( s' l
' T# O" L2 c3 ?__________________________________________________________________________) }; Z3 h Y2 g( X, X
1 Z7 k7 ]/ E9 r
: W" G( K+ P) F4 A' M U2 a
Method 05
& a& I. ] g, g7 q/ ^+ H% ]=========
4 P( p% [( X0 s! H7 C6 x, d# \1 T" u- w& q& m
Method seeking the 'magic number' 0F386h returned (in ax) by all system+ I2 O H: f0 O# ?4 g4 e# X
debugger. It calls the int 41h, function 4Fh.! h' p3 N& K0 u2 l4 N
There are several alternatives.
/ q2 K4 T8 l/ f0 `- M% @$ u
2 H4 L# Q2 b$ ~/ B/ q( i& {The following one is the simplest:
, h5 q$ p5 A( y) a( q# j7 W2 t+ q
mov ax,4fh
" I% j* c4 H6 @- [) y; [6 c int 41h* ^: w" Y* T* Z. K; G
cmp ax, 0F386. D# I2 c6 T4 F7 v" I* r
jz SoftICE_detected
" H. J0 F! Z# e: S: Q! r7 D' {/ j8 N- z( u+ \# C
4 m4 j7 Q6 ]& t9 L; lNext method as well as the following one are 2 examples from Stone's
1 X2 u* C1 y: q6 |) r"stn-wid.zip" (www.cracking.net):" E+ M1 e s5 [& j h/ l# R' \2 S- J9 X
. W+ C9 R4 a0 I! a
mov bx, cs6 `& O/ V' d9 M! g- ^
lea dx, int41handler2
2 F9 @. ? N- F3 C xchg dx, es:[41h*4]" [4 d+ s4 D% T6 I! N6 e( g5 q9 M
xchg bx, es:[41h*4+2]% H' O& a+ d# \: E& W# a8 X
mov ax,4fh
$ t e; V1 @; s5 q' W& Z, V int 41h+ |; h7 E/ v$ ?
xchg dx, es:[41h*4]
8 e! @- [; P. z& ?2 s5 {2 H; q! Q xchg bx, es:[41h*4+2]
B+ e" |- T( j. E3 z* t cmp ax, 0f386h
4 e) W0 m! ?3 k/ X; k jz SoftICE_detected: \: F, K4 o' D/ U2 s0 O
" a7 u' l6 t4 q& l& d7 a1 n. ?4 B/ I
int41handler2 PROC" t" r$ a9 T; x% X( @
iret
/ H' M2 W7 g" n1 |0 \. Cint41handler2 ENDP8 e! L4 `4 L) W( ~9 e
4 y4 R2 J! i- J- X, D' r
; l5 v% o4 `/ @6 e: B; t8 ^% ]_________________________________________________________________________& K( [4 K( \3 F
' P! \" A6 @1 A8 Y$ J4 F
% a! B. s8 F/ Y0 Y; DMethod 06
0 @2 v A/ A ?# L, k' j" C=========
" t% b" Q, V( U* ~
C4 _# Q2 h* a- N, R) W
6 ]* h; H/ Z1 }7 l3 S6 `; u( s9 B2nd method similar to the preceding one but more difficult to detect:5 X* {( O/ |! X! T
1 C: y: ?5 w+ E; d1 F2 k7 I* j
9 q3 n3 h% K* J2 I- l0 P5 q4 pint41handler PROC0 ^) `3 ^/ u3 ~8 R
mov cl,al# N/ V- R z- R$ e2 \: j) y7 y
iret; r, ^1 o, x7 n0 K1 g1 U1 A6 Y
int41handler ENDP4 A. K5 @& K3 ?* b
& e! G+ W7 v. f, A. o3 a9 w0 L" z7 p
xor ax,ax4 f6 _+ u. f1 S. Z* J) U
mov es,ax. q" s' q: y$ ~7 P% `6 l0 Q
mov bx, cs
3 H- w" q) |7 K3 ` lea dx, int41handler" \5 k6 {4 F. r/ C* D) W: X1 G
xchg dx, es:[41h*4]
3 p- @$ ?0 U' k Z& |; d xchg bx, es:[41h*4+2]
9 H# L+ H2 I4 C in al, 40h
4 d% O& t- A; u j- f/ R5 X& d xor cx,cx
6 _4 \) V' H- }3 e! n& V5 h int 41h* C5 q: a6 L, B6 h( v
xchg dx, es:[41h*4]8 k* ?. [! A9 B1 g5 t
xchg bx, es:[41h*4+2] Z3 v1 S5 f2 c" b5 ~. Y
cmp cl,al6 D9 S& h' P u* Y5 R# `
jnz SoftICE_detected2 o+ p5 k) w4 l6 F4 T
, l& b1 L$ t8 {_________________________________________________________________________
/ n1 |8 T6 ?: P- [+ r
. l8 x* P8 L7 {, [/ K* N: m% \4 }Method 072 ?6 A8 v/ u6 S6 w
=========
, `' |5 U5 [" @ h: F7 i3 r- y( @/ y. {' L6 o8 ^2 A
Method of detection of the WinICE handler in the int68h (V86)2 Y# U) j$ L' I
) Y+ [' r- X0 @, E( I- A4 c- W mov ah,43h
" A4 Q3 L A- z+ ?4 e9 p int 68h
& _4 F' d$ L/ N6 t) l# L cmp ax,0F386h( t7 I0 n( k8 V$ [/ y/ Y- @, H
jz SoftICE_Detected6 ^) k9 C$ F: ~4 M# b1 K
% O+ |2 H. W) Y, l, ~; v
% I) {3 b+ B3 }! e9 p=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 M4 @7 f) z* s/ K" ~' t! W
app like this:) ?. }+ N& Q' H, D& f& [
5 ]/ c S- F' u
BPX exec_int if ax==68) ~- \' ~& U( N: J0 I$ y: K, Q1 [
(function called is located at byte ptr [ebp+1Dh] and client eip is
W3 \+ {$ T) r3 ~4 {. z located at [ebp+48h] for 32Bit apps)
, |- A0 I. t$ ], O% ]3 C__________________________________________________________________________
/ G& ^; m4 S& b$ J0 p( G* f
# Z& H Z0 h% ?( I. y) D- n% e, r
Method 08% z; _7 s) |. O, ?& i0 j
=========
- u% k4 [- D2 T$ {& g7 O
3 A+ C- x" s& z8 l5 PIt is not a method of detection of SoftICE but a possibility to crash the
' c, W# Q' J- H+ E5 Psystem by intercepting int 01h and int 03h and redirecting them to another9 l& e; U S5 H- ?( Q! N
routine.( L1 g+ g: B8 s' C7 A
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 Z/ r3 J* L, ]$ b. \# K3 T
to the new routine to execute (hangs computer...)8 T! G0 O# n8 O1 x4 g7 e" |7 R; O
8 g! L: e6 R3 ~9 l* ~$ h
mov ah, 25h
' U/ s* P c5 q8 v& k, \! }9 L mov al, Int_Number (01h or 03h)
" A; q( \9 U$ P/ B5 B' l/ Z mov dx, offset New_Int_Routine
9 [# Q) q- g! K9 U; L' ` int 21h2 e3 S' f; ]7 \6 Y2 g/ ^ X
5 T! n# x E# g$ U* k7 A0 u. m% l& X
__________________________________________________________________________
; [3 o$ C" \3 b, v" W/ t
& |2 |; j& ~9 z7 KMethod 09
4 U _: B% i& ?2 N T: E=========
: p" W/ R4 e3 [' w) B' T; R, t. f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 ]: v5 `5 s8 Z5 H# {: I
performed in ring0 (VxD or a ring3 app using the VxdCall)., u e* `! c% {& K
The Get_DDB service is used to determine whether or not a VxD is installed& x Q# z4 V8 y' l) l6 C# a
for the specified device and returns a Device Description Block (in ecx) for! A3 Y5 ?; r d8 \& P) v9 ^
that device if it is installed.6 E+ N+ F3 U! R# q) ?/ ]% m
+ X6 I2 [+ _1 F) A: B6 W! C9 U0 H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, H! `' l* ]( h- b7 ^ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) [" n! y- b6 H! G; O8 b2 e4 @
VMMCall Get_DDB3 i( c: b s1 |& J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, l/ j! F9 `( c' s( K2 A7 {8 l' r
. l: [% n+ E) d+ ^( JNote as well that you can easily detect this method with SoftICE:* F' J- U3 S+ A, o
bpx Get_DDB if ax==0202 || ax==7a5fh
/ i5 ~: R$ u& h- b: ?8 F
1 Y# ?) ]) k, A8 `/ ^) A1 r__________________________________________________________________________
_/ A1 C: J6 v! h6 I* G! G2 F$ ?, M6 m' J, D. C- y0 c& f+ [+ r! }
Method 10
" d0 H6 b. ?5 B$ Q/ y=========; X+ B1 }, _. \7 q( ^8 M- c o
& [$ w8 K& Y k3 i# ~- Z
=>Disable or clear breakpoints before using this feature. DO NOT trace with& l ?4 P9 p {0 v5 x1 ` `' m) N8 [
SoftICE while the option is enable!!# x! u% V; K! }2 J
# R- m' c9 W3 _6 K
This trick is very efficient:! F: `( z& B, c. W" R! _2 C1 A
by checking the Debug Registers, you can detect if SoftICE is loaded
8 X4 a! d4 ~ ]5 S& O(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 {- x' V# k6 f1 x, N8 X/ {. t
there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ s8 [8 R& c- Rvalue (in ring0 only). Values can be manipulated and or changed as well
3 L; l p( Q8 s$ S& S) l* J(clearing BPMs for instance): w: p8 k: K+ w6 X/ ? }
; \0 F! e( C2 n; S6 v8 D__________________________________________________________________________
- @" B+ B# _ m" ?) p: M7 ~; X9 t! Z: u$ Y, \' v( k
Method 11" t/ t4 o: g1 M
=========# Y8 f3 I! _6 a+ V1 _
3 @- r$ C% {4 s' MThis method is most known as 'MeltICE' because it has been freely distributed9 L5 |7 E& ^* [6 l; g. G* a: m
via www.winfiles.com. However it was first used by NuMega people to allow
& ~' n) [* m2 @4 F1 I3 C, A9 c9 KSymbol Loader to check if SoftICE was active or not (the code is located
. t$ a2 L/ ]2 H1 b7 f% \! Ginside nmtrans.dll).
+ q. U& d) @$ l8 s. p! G& D: Q! k) m* J
The way it works is very simple:
+ {! C; ^, n; V3 Y+ `It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% Z1 S, I, i2 xWinNT) with the CreateFileA API.0 ]! g7 H/ |/ N% t2 W/ _8 c
. z, n. H* p! W* E3 w' B2 e
Here is a sample (checking for 'SICE'): G2 W: U9 U+ C' b/ s
& p* I4 V+ U- ~7 ~+ e T& nBOOL IsSoftIce95Loaded()
X' n1 t H+ N" L{
' R5 O7 j. v& R* j6 w0 ^ HANDLE hFile; # x6 i/ N9 e% C% O' m# @# |7 A
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% {/ }' Q* X! _, l FILE_SHARE_READ | FILE_SHARE_WRITE,
2 ?- i, ~* J1 u NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ k) H: R5 z5 i* K/ z
if( hFile != INVALID_HANDLE_VALUE )5 y9 s+ P: k& Z: w
{
7 R% \4 S" H+ R, L: d7 C CloseHandle(hFile);8 b) A% F9 Z) b: O0 v' i6 i
return TRUE;$ V3 p" Z4 Q; c. D0 `1 k
}
- C, d: P% z7 j/ V return FALSE;
" P* @" R) F, w2 @6 X}8 C; M* f, L' [3 V- t* L
/ }. m N6 _) a% x& Y* {
Although this trick calls the CreateFileA function, don't even expect to be
: R6 V4 Q* Q4 @/ M7 Aable to intercept it by installing a IFS hook: it will not work, no way!5 T( P2 y# c3 B4 s9 A0 V3 j; }+ V6 ?
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 S: H. r; f: _. R- _ b# Y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& j, i4 s& V0 U" o) u, \! B% A z" sand then browse the DDB list until it find the VxD and its DDB_Control_Proc( B7 Y* W- d7 C9 Q2 B" [
field.
2 _: G3 K0 J m AIn fact, its purpose is not to load/unload VxDs but only to send a
5 r% z; y& U: i+ lW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ k) W- R' N# [3 c" _) Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try) W& e2 }" Z& a" F0 R$ D+ T2 T u ]
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
" P# T1 w; C/ I5 v, [- Q5 b2 W! RIf the VxD is loaded, it will always clear eax and the Carry flag to allow
2 N4 c& w; a6 R+ Y* Uits handle to be opened and then, will be detected.* ^; h$ F$ @7 f l$ i* M
You can check that simply by hooking Winice.exe control proc entry point4 R4 m" M1 P% D2 l/ D. R
while running MeltICE.$ {. V$ i6 |/ y' e4 m& B. Y
& Y3 W3 O# M8 t. c
: \4 |9 }( M" u/ K4 m 00401067: push 00402025 ; \\.\SICE
% B0 v4 l* e+ A! B$ d 0040106C: call CreateFileA
' g. [' t9 m& z& B. W q H 00401071: cmp eax,-001. `2 x$ M h7 I. }9 l. I
00401074: je 00401091+ ]! s4 u0 ^5 Y$ {+ E
) O. a, R0 z1 B! ~' \, d, P: p
0 ^1 F; }. B: ]' G+ d
There could be hundreds of BPX you could use to detect this trick.
9 a1 U( m s$ V& i5 b-The most classical one is:
, @" H/ y7 f/ K# E BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* S4 z' h( L( R. Y5 Q/ W" c6 h8 l ] *(esp->4+4)=='NTIC'
6 N, R- T* H- r! ~- b
0 K2 t* \* l6 b8 g( w-The most exotic ones (could be very slooooow :-(0 O, P4 |: \! V5 k; W
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 3 ^7 v# X8 J% ?% }9 R
;will break 3 times :-(1 ]8 U2 k0 p; |# L w# X6 l$ b
z$ P- i" E: N0 f! j7 K-or (a bit) faster:
- Q* f5 @1 z7 C* u BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 }; h: Q P1 O: {) [& g
& I; M1 p+ R# X5 l: ~2 d# o* P
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 O/ K1 p) l& d( X
;will break 3 times :-(
; |# n8 R9 d0 k. s% c' ]; F- l5 p/ d; Z+ C4 E5 a5 E
-Much faster:
* G9 @/ u: R+ ]$ P" ^ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 S/ P5 ?8 Q, w3 [0 B
) Z' x4 Z/ m2 u" S5 d$ |
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& T+ e! ~" e2 M0 n+ N
function to do the same job:
3 m/ ~' W1 }# R1 N! H1 J3 e5 H J" q2 Y/ f
push 00 ; OF_READ
R; R9 |" z& K( E mov eax,[00656634] ; '\\.\SICE',06 F/ U" M9 i% v
push eax
: |, M8 e6 s+ D( k$ v call KERNEL32!_lopen; y7 z" s% }& K6 I6 S
inc eax8 w6 T8 {, g+ s1 P+ I
jnz 00650589 ; detected
" B+ `) A8 ?% n% q8 G: u# [ push 00 ; OF_READ t- V( E; ~2 D' e# w2 ?
mov eax,[00656638] ; '\\.\SICE'
( F) Z# K1 e! a% Z$ s! ~8 A push eax8 {9 F% P- B/ }. b
call KERNEL32!_lopen
o" t% i: T+ u5 P inc eax
( {% U- B4 B" y; L- B jz 006505ae ; not detected h* G+ a3 n4 ^! ~
7 U- \3 K" U" N4 _- l) n- P( S! L% u
2 P7 b4 H6 @& T6 y1 ?/ \2 y__________________________________________________________________________
0 Z, r5 w' X J6 \& H4 u$ X. I/ G3 v
Method 12
& } n2 v/ O9 _- i=========8 y$ L! L; s4 S6 ]" O4 Y
' \2 w9 P' F! i6 Y7 q* WThis trick is similar to int41h/4fh Debugger installation check (code 05
+ S$ c& n9 l- \! a2 }+ s" p6 c& 06) but very limited because it's only available for Win95/98 (not NT)
) \ P: f5 y! A& E8 z, aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ v2 w) p3 X. [# l( a5 P; \. w/ F J5 P
push 0000004fh ; function 4fh6 v1 Y0 l1 `- }
push 002a002ah ; high word specifies which VxD (VWIN32)
) y+ s( C. c2 j9 d ; low word specifies which service" x5 m5 r' o3 {4 @. }
(VWIN32_Int41Dispatch)
2 \( `' V) T5 x7 D/ S5 G/ { call Kernel32!ORD_001 ; VxdCall+ @* k* w* b7 l Z, S
cmp ax, 0f386h ; magic number returned by system debuggers7 P/ e) q" b! T, _5 ]
jz SoftICE_detected
0 Z4 E/ H$ O: K* T6 D
- G! c3 l4 _( Y2 c+ O6 O* jHere again, several ways to detect it:
; g, |6 f- i5 }& h3 d: z7 H/ Y! y# c' x6 @: N
BPINT 41 if ax==4f( A; O6 A# L) d- A; @$ b
- K+ M' ]- g# ]' h. G# M3 W
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* J) Z9 R/ K8 p0 {8 i
# T" q* o& ]# \' Y/ ^+ K- ] BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A( S; n0 K4 c: o% E" x
$ M6 ], z/ n& O/ }; _& |3 Q0 u* {- ]0 y
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' \9 W1 w3 d& A6 n$ y) S2 c) m+ g" {. w6 { h7 E. G
__________________________________________________________________________
, x* D* k7 y3 B o; f7 q3 x% K1 A# O- h( J
Method 13
, _$ w9 Z" w1 B+ G=========
( _# E. Z* P: |1 _2 _8 q+ ?9 ^2 j! f4 t9 U1 g2 M3 l
Not a real method of detection, but a good way to know if SoftICE is
6 ]' p5 C* |; v0 Tinstalled on a computer and to locate its installation directory.
6 ~4 r0 q5 _5 W1 oIt is used by few softs which access the following registry keys (usually #2) :
" Z* [. q% x1 G7 @+ \3 A% _# ?- L: c z+ E- {- u0 x9 f+ ^
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 H0 c. Y7 i! m# e, J+ Y/ A c' S
\Uninstall\SoftICE3 ~/ o8 H1 B0 ?# B4 d1 L
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! R* |0 |: F8 ^
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 p$ u4 z f! Q& l0 `/ E! s\App Paths\Loader32.Exe
2 z. t; y1 E1 \4 k3 Q& \! j6 M% S1 ]* \
5 Q8 t/ L$ ~6 ~Note that some nasty apps could then erase all files from SoftICE directory5 h% A9 E3 J8 l4 r5 C; J3 X0 E$ O* ^
(I faced that once :-(
3 o8 B) O, j% }0 ~5 O' i9 P0 f* ~& d) n0 @ p: u# x6 X
Useful breakpoint to detect it:
5 d+ y3 O9 n$ q9 |8 } ]7 m+ |, l) i, [% D/ h3 r! Y8 E( r+ k( s
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ l6 L& @% l# G
3 T. _/ D% d3 A) c# h3 } {__________________________________________________________________________
8 k; r7 j. [+ e/ M0 X* W$ K u9 ]9 X
0 F. E) R5 E% ]: Q
Method 14
+ r, R2 e( |2 U! j5 F8 I=========
% I4 W2 b; ^ u2 d* y$ w; R2 b1 K- J/ K' d& Q ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ |5 f4 G% H7 k4 `, Z
is to determines whether a debugger is running on your system (ring0 only).
2 Q* S% g7 B4 C$ H% W# `0 |6 W7 | r W5 r' @% |8 P2 n6 m
VMMCall Test_Debug_Installed. W v" w9 I, x
je not_installed
, N/ R$ l; H( `$ z6 p0 D
: X) { I" c0 i0 s% m4 B/ G. |This service just checks a flag.1 ?; n4 E$ j1 n M9 p$ _4 \
</PRE></TD></TR></TBODY></TABLE> |