<TABLE width=500>
' J! S9 n/ s& m<TBODY>
. V, p' Y; H2 I7 C# a f<TR>$ |% `+ u7 z7 S
<TD><PRE>Method 01 ' b( W& v6 p+ V, o- e; k* V( g+ j) P" }
=========
6 L: N8 ^! N/ L( F' s; G( ]6 d- c; w6 i% I$ {5 p* {$ N
This method of detection of SoftICE (as well as the following one) is6 T) l$ R- d" }
used by the majority of packers/encryptors found on Internet.
* A+ X5 V, s, GIt seeks the signature of BoundsChecker in SoftICE
2 z' J( Q& u& _" L; q m
0 s9 d& _* U0 F: f mov ebp, 04243484Bh ; 'BCHK'/ \1 O3 r. k7 `4 l( C
mov ax, 04h9 \0 y, F4 H/ C, n
int 3 4 J( g1 G+ V! Y' O5 t
cmp al,47 [# [$ o! S7 h/ e
jnz SoftICE_Detected
+ _& Y$ W4 ?/ U, b/ m0 X2 P0 n. M# a$ C9 i! c5 {( R2 h2 N) |
___________________________________________________________________________6 w' F6 V) B# E: Q
% J) _5 V& w7 D$ O- w: D
Method 02
. C2 K- r' L1 w& [+ {+ n$ b$ l=========
; ~! A$ f# _* U7 Z& o1 _2 @6 _
/ [, Z; l z$ J' J' ]( }( JStill a method very much used (perhaps the most frequent one). It is used$ g; z4 a6 _( E- w2 [
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 r+ ^2 I# O7 s& s' d; E
or execute SoftICE commands...
: p# E1 o* o% mIt is also used to crash SoftICE and to force it to execute any commands
8 J1 D6 H& M* K% U- y. k5 V(HBOOT...) :-((
2 A1 D& l$ i6 Z; N/ U& W" n% W d7 J) u' a2 T. C2 V
Here is a quick description: O0 E& U8 ]; C+ J; C& r! a
-AX = 0910h (Display string in SIce windows): b. x- g: G S" h1 V! `; b {0 y
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) P4 C' A- {1 B, U2 J& O
-AX = 0912h (Get breakpoint infos)
% v7 _6 S2 q! B, g& U3 d-AX = 0913h (Set Sice breakpoints)
# O% {" e, O/ J5 R5 |-AX = 0914h (Remove SIce breakoints)
3 u( R5 p+ }) G# y/ q, h, b" _$ d& p2 j4 I# b
Each time you'll meet this trick, you'll see:; x& n& p$ P. }3 a
-SI = 4647h. g3 }! O5 X+ M: q' ]
-DI = 4A4Dh
7 C/ i/ y: u1 \Which are the 'magic values' used by SoftIce.
, n4 Z, p! i) B, \; WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 w2 T- f6 D% p9 w! u1 s
) `$ c. }: m2 Z! u
Here is one example from the file "Haspinst.exe" which is the dongle HASP
' \" V' `* @' u* q6 s O. NEnvelope utility use to protect DOS applications:
$ x2 a* T1 l, d& N m+ k2 g7 \/ D8 P* C$ H
2 N k) {3 ~) Q1 \4 [; m0 d; A4C19:0095 MOV AX,0911 ; execute command.5 i3 Y! p% X/ S6 v* V# l
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., F7 I- u. ^9 P4 j& r5 G* E
4C19:009A MOV SI,4647 ; 1st magic value.
3 o8 M* p% l! i) [6 q* Q5 E' i1 P- X4C19:009D MOV DI,4A4D ; 2nd magic value.3 A V% c8 E' C4 f: p) O# u% F
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
* y$ y6 ?" E" a& c! {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
i+ `2 j p8 f6 l1 W8 I) x* I4C19:00A4 INC CX
# B% f8 F, P7 I7 V$ Y4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- ~% u; T5 ?8 e7 \4 s& N& L
4C19:00A8 JB 0095 ; 6 different commands.& r& r1 _5 F) {( b1 M2 P% d# G$ c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.) ~/ }; M/ \( x" Q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
- {& U T0 S' v7 A1 ]7 i8 A2 x* f8 ~9 q
The program will execute 6 different SIce commands located at ds:dx, which
0 c+ S; d7 V4 z! x% Nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 k+ `& N' C2 M9 h" f& j2 W0 b* C% O. `! z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! G) e: H% T, s2 ^! W0 l
___________________________________________________________________________6 O( o6 p* F# u9 {( m" y, Y
+ d" Z; o7 M# C# F3 p1 O* f
7 q" K" A* i. B/ r, s4 `+ T! V
Method 03
; {6 F* N" Z" Y/ ]! r9 R=========
: N3 y, k9 v1 O' @' h
( l! a! u4 U* s+ L: ]; {- ^7 I/ s- ? {0 ?# oLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
7 m+ q- U L5 c+ ?' Z7 ], q(API Get entry point)! u+ q1 R- v- E2 c& C. x! O! p
1 W e% ]( E: J1 t' N1 P1 P. d4 J6 J8 z& M" S( F2 G2 K
xor di,di
' u6 F5 r1 W( S3 \ mov es,di5 ^ K# o5 ?8 a/ f
mov ax, 1684h
" f% }) P$ y( I$ h mov bx, 0202h ; VxD ID of winice4 q: j* K! l- T) J; w
int 2Fh# N# T3 b- ]: B# Y5 S1 x
mov ax, es ; ES:DI -> VxD API entry point
4 f8 V% f5 B+ N$ F add ax, di
! F" C1 ?; m* @2 y& T- }# W( G test ax,ax
4 F) P( T; K X# Q jnz SoftICE_Detected
% T0 T; Z" f: F+ \: l, ^# i6 v5 y" E6 f. }2 N. M7 v# S ]
___________________________________________________________________________- h( l- R$ z" y% @: q( w
( _. `# ^( H; X# a# Y
Method 04 F1 Y+ ~' ?% i% W
=========8 m; h; E" Q2 c- z* {# H
E5 ?9 t t: x' \, I/ G
Method identical to the preceding one except that it seeks the ID of SoftICE
]( h! O" `- e6 C$ wGFX VxD.
- q1 P/ u* U0 V2 C U4 B: j1 p* H
! f9 X' M. e0 |0 I xor di,di
1 d- Z7 s8 Y1 E mov es,di0 X, H" I- `$ ^1 F8 j# c* l
mov ax, 1684h
6 w7 r- S" `0 s mov bx, 7a5Fh ; VxD ID of SIWVID5 }9 E' y+ a$ V1 B
int 2fh
, w. K: |" R9 I, C mov ax, es ; ES:DI -> VxD API entry point8 r k0 f0 ]: D3 @
add ax, di
. Z) E% _+ T( { test ax,ax
- S8 Q! I/ j6 C! Y. d3 K& ~ w# U6 L3 h9 z jnz SoftICE_Detected9 \( N* ~6 @# n. ~+ J
1 t- o* w; Q- X& g. ~) ~
__________________________________________________________________________
4 s, F* _, v" }( d/ J
& Y) I x' l4 W6 B& |
+ _% l* f0 C2 F; N2 e8 \$ OMethod 056 h) n1 @. X! G8 J* e/ L
=========5 @' @- R# T$ c1 ^6 e1 M# f
5 h4 G, F% Z L/ g, y& ]Method seeking the 'magic number' 0F386h returned (in ax) by all system; P0 v: ~* V T9 B& A/ |5 W) c7 O5 F; ~
debugger. It calls the int 41h, function 4Fh.( D/ u. c) F, l! y: [8 ^( N/ o
There are several alternatives.
a: U% } |2 Q; v% e8 @: F, \5 F8 g+ i: [# c
The following one is the simplest:+ ^) p) E; j$ F: @, `; _* o
5 i: K- k1 N: }/ G5 j mov ax,4fh
) B. `- S5 }( M, e/ R int 41h; ^8 f: p; ?! i9 j( D% A
cmp ax, 0F386! ~5 h) E& Y% f3 w
jz SoftICE_detected3 @1 i$ g- R- r$ i2 P8 q
+ T$ \) T* v% n) O
& v/ m( X! a7 L$ `4 k4 y
Next method as well as the following one are 2 examples from Stone's % ?/ A# I- |" B5 R6 p
"stn-wid.zip" (www.cracking.net):& q8 E1 C- L. @ D+ Z' A4 {
; s7 Y: e4 e$ p' _! w mov bx, cs5 Z9 U* j4 P* ^
lea dx, int41handler2
- k* u; R. n* m) p xchg dx, es:[41h*4]
4 ?. i8 p7 y* c( ]$ a% K3 ~' C. [# k* \ xchg bx, es:[41h*4+2]- x" ?9 t5 I" C/ e o. M, o! r
mov ax,4fh
! F8 L* o9 }! ]) B7 I2 L int 41h+ [& `: T9 x* v# X0 j8 w
xchg dx, es:[41h*4]! e' o0 \* \9 [) |. l" p, w
xchg bx, es:[41h*4+2]* ?2 z3 b% F1 A6 x1 b7 \2 C
cmp ax, 0f386h
) `" o' h" ^1 P( d* k( `/ k+ Y jz SoftICE_detected
3 |4 J' K8 Q8 m2 |) F
: E2 d1 j/ ]& F! Kint41handler2 PROC
O, }5 {& j" r5 \/ w# g" V$ ? iret
/ }2 C2 A8 d0 W. a; dint41handler2 ENDP; f1 O% B S9 p7 U6 n/ ^
+ D4 x+ p% b- ~: U4 m c; W N% T5 @( B, O$ [# @! X
_________________________________________________________________________
% F- ], `* q% b$ ~- f2 p; |, E& W: D" O
1 D& J# {; Y9 h9 ]' A: ]7 t! N. kMethod 06
+ e p) R9 g/ O=========! f9 L: Q: \5 r( `0 g
7 `/ o, e8 d2 z1 l
3 X. C7 r- |" m1 L9 ^2nd method similar to the preceding one but more difficult to detect:, _0 y- g6 q+ K% v. Q# V
3 e9 E0 z5 y5 e. [
9 z* O$ e5 w( l$ n) T# Z4 \3 e h
int41handler PROC' r- y9 j H+ w% K+ O
mov cl,al
* _9 t2 b$ C" w# U2 N; T% n iret
' z, b* A' h* Vint41handler ENDP
+ B2 T; v- O( B3 K' r
4 K' a( Q7 X p
6 g/ T* K* T6 w8 x9 N, k xor ax,ax
3 K6 j! Y( O. O2 p' s mov es,ax) k6 C7 O3 B7 ?2 |$ D7 [
mov bx, cs# R3 i5 }' F3 O8 m9 H4 {& U
lea dx, int41handler3 o/ M% Y8 Q5 _) d1 d3 J) g/ \( {
xchg dx, es:[41h*4]) }: w5 _' L5 _/ B; i; s6 _
xchg bx, es:[41h*4+2]
( H, h7 T( ~% u5 c9 ]0 W$ k/ y in al, 40h& M0 d/ C5 H: ?: t
xor cx,cx
; E: H! ]2 W' B j. j int 41h. A7 { [0 m) U& t
xchg dx, es:[41h*4]1 V8 y/ [( k- u+ H; v
xchg bx, es:[41h*4+2]+ [' u: f+ j3 X2 q) g+ W( G1 Q
cmp cl,al/ v" v: [2 L1 o2 \/ S% Z; m
jnz SoftICE_detected
: Z( F! H" J: _* N* h A [- E/ d8 N1 w" ^2 J! v7 r; J% o+ O
_________________________________________________________________________* F' J/ ]) D$ |6 Y# S
& y, G$ }1 G+ ^- \0 ]4 OMethod 07
& S8 U# L" Z! u4 S9 F1 }=========6 m7 V, F5 ]" ?* X: G6 M
' U$ V( ?3 a8 k4 X2 SMethod of detection of the WinICE handler in the int68h (V86); Y$ ?8 v% t( g7 m. N9 B9 K9 `5 P1 a
; g: c* d/ x; f, ^6 A0 P
mov ah,43h
. [$ q' {' y- x1 d4 q int 68h
* @: U0 @! ]5 i2 I, P/ U) i' n cmp ax,0F386h0 |$ {$ N( f0 ?* F
jz SoftICE_Detected
3 A! F( X) Q5 v; f- U2 `1 r9 A9 q
+ W( K4 G3 M4 a) S* [' x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit$ S" G4 ?5 k/ Q
app like this:2 r; q @2 _. ^& F# n1 {
. D* D! _! ]5 R! ^ BPX exec_int if ax==68' \2 ^* e. ~ w# C
(function called is located at byte ptr [ebp+1Dh] and client eip is
8 ]% C6 C( e! M& @) j located at [ebp+48h] for 32Bit apps)$ S9 t* Y& k r1 c
__________________________________________________________________________- t4 p/ {! V6 ~
C- y4 I+ j! W2 v/ a g7 ?
3 S& S' Q3 O+ K, m5 {% QMethod 08- l0 i' [' B6 K+ S9 J0 J! z. K
=========
9 k1 Z b6 G- O- D) T/ p( O0 {! ?+ i: y$ X
It is not a method of detection of SoftICE but a possibility to crash the
# x& v _5 f/ T% K$ C& d$ usystem by intercepting int 01h and int 03h and redirecting them to another. j- r/ d! q: U, |6 z1 H
routine.; o; {7 d5 R) l6 W5 k8 y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ |0 \6 s% V3 M" `4 q; \/ R- g: \
to the new routine to execute (hangs computer...)
/ E9 z0 ^ F3 R) \. \
0 c0 h! V* r! v+ m; E! z4 x& m3 [ mov ah, 25h i8 ^. K2 M9 T- z: g
mov al, Int_Number (01h or 03h)+ J* @/ P" b2 l2 o" c
mov dx, offset New_Int_Routine" `3 W2 l9 s5 m; U4 i0 t/ H
int 21h
8 }" F8 V* \8 f
% w* M% q1 x% d+ Z/ R. M5 `/ x__________________________________________________________________________
4 ?' s2 r! U7 O# Z1 O1 S) a& X4 F8 m* F/ u9 Y F9 H
Method 090 I1 i0 f# z: B) m8 t
=========
$ W. V7 F- I! z8 j$ E$ y9 x/ p. y7 D2 t% x0 M( G/ L) V- \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 g* O! Q$ M: N
performed in ring0 (VxD or a ring3 app using the VxdCall).
; E: s* P* M | l1 Z6 BThe Get_DDB service is used to determine whether or not a VxD is installed
, A c4 |8 I8 z9 @1 ~; W/ ^) B8 W5 Ifor the specified device and returns a Device Description Block (in ecx) for# a$ ^, o6 W6 J6 s* G7 r
that device if it is installed.
" `7 E& {8 [# N1 i% I
( L1 h `* ]% }+ m+ ]" G9 w mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ T! y, l: O D/ y. d, e& g5 J
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# Y! b/ Z, ~: E, @8 D
VMMCall Get_DDB
0 o3 m5 |7 F) H- y/ z, ] mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed I# X) I3 V) R, _: l
* Q6 c8 t: Q) x4 u! b. G; m7 ~Note as well that you can easily detect this method with SoftICE: \% j0 _, j E3 O' u
bpx Get_DDB if ax==0202 || ax==7a5fh$ z2 t* ?, H* \ b' P( ], l& a" ?
5 N% ^* [9 e/ P: R. `
__________________________________________________________________________* c ]8 H! c. {2 Z O6 ?) k
0 L4 |3 f1 H3 l6 T
Method 10" I$ v+ \8 M, l0 J0 a, ?4 o
=========
: f1 m5 ]6 j% v& u- H) I
/ J& n9 p$ H: S% t4 n' ~8 q) Y=>Disable or clear breakpoints before using this feature. DO NOT trace with6 p B3 c$ k. ^- Z% \. ]) M5 R
SoftICE while the option is enable!!
' W6 m( h; G$ X3 C, s7 o2 Z9 J5 a9 w
This trick is very efficient:
3 k4 e& `- s4 r* A( s1 h: Dby checking the Debug Registers, you can detect if SoftICE is loaded0 N$ [+ a- M9 r+ T" p: T& K8 T
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. \# |( s% ^3 z+ M! C- c; a# `% d; J
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, l; o b, q& I) r+ wvalue (in ring0 only). Values can be manipulated and or changed as well
0 H7 [9 g/ k; N+ q! E8 l(clearing BPMs for instance)
+ J# Y. ^. h7 w& {1 S& t* O, A- |; `' V! k: [3 q( M/ S7 C" b. O
__________________________________________________________________________0 h' i+ h% }* f1 P% K& E* R
; c/ M g7 o; X6 Q" D g' {
Method 11
' R: B) \3 w; J5 h( `* f=========
0 h; @ y9 O! v( w. V% S( G7 j
1 {* [5 y; h+ G6 m; }7 P: u" ^$ VThis method is most known as 'MeltICE' because it has been freely distributed
( G! h1 @& r/ A F; ]. p0 Ovia www.winfiles.com. However it was first used by NuMega people to allow* B6 E s7 e8 }6 W; ^* z7 m
Symbol Loader to check if SoftICE was active or not (the code is located2 J/ L, P' H7 f8 t" Q
inside nmtrans.dll).
: ]) N- _3 y! z# N8 a
3 a; J. ?; K) [The way it works is very simple:7 u- [. _" V& _9 t/ e4 M& m+ S d
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for N$ b: X9 N: r9 T3 i2 U9 z0 L6 G7 b
WinNT) with the CreateFileA API./ g$ ]9 Y ?. R
8 Q. e$ q3 [, b5 Y3 z$ f8 ?1 ^9 [Here is a sample (checking for 'SICE'):% m6 X# }4 L+ N. J% q& Y) m
! W, X* o. t: oBOOL IsSoftIce95Loaded()4 @# S: Z% Q- n' R* C$ H# D& ~
{
5 X# ~& U- v/ V. R/ g HANDLE hFile;
0 g# _ ?5 U0 B& H0 |6 p hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, Y9 T" E" E1 v( O# @/ e, ^3 ~ FILE_SHARE_READ | FILE_SHARE_WRITE, j% Y- x @0 F/ M G9 M% ~
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 i" G1 X+ O* s/ i+ x6 a
if( hFile != INVALID_HANDLE_VALUE )
1 \$ s+ Q* n* ^; n5 Y {
& i+ g, Q5 D' H2 i h CloseHandle(hFile);+ `' P: u4 g+ E; V0 U; S9 B7 W" h- N
return TRUE;- ~3 L& r* E- V) r
}3 D! ~3 D- C8 S& M
return FALSE;
& i) ~9 O y/ I4 P% I; f3 g! @- S) M}: [$ S$ f" j* N7 |+ N* L
: C8 [- U3 i( V6 i( LAlthough this trick calls the CreateFileA function, don't even expect to be+ H% X$ }( x d5 [' o% @5 K% T
able to intercept it by installing a IFS hook: it will not work, no way!
. k2 U e: ~- f( ]In fact, after the call to CreateFileA it will get through VWIN32 0x001F
, `6 @0 K- `6 ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( V& p6 Y J2 r: {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc. I$ R0 M; \& K; }* M4 Z
field.
* K8 k0 X6 c; u) |In fact, its purpose is not to load/unload VxDs but only to send a
# o/ y% s3 C5 [2 bW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" |7 l) q! O+ u0 A( B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 X: N% l J) s/ d1 d$ _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 ~. P: I5 Z$ i8 {! VIf the VxD is loaded, it will always clear eax and the Carry flag to allow: V/ ~% k* o% Y8 T8 Y
its handle to be opened and then, will be detected.% }& J" F% e( J2 {, H
You can check that simply by hooking Winice.exe control proc entry point
7 v- m* u7 \1 j: mwhile running MeltICE. v# f3 N5 k4 D- S, Q
1 ~2 Z: U1 ?& z) X# N" N4 ^6 f
( K4 _2 V, z4 D/ w8 l 00401067: push 00402025 ; \\.\SICE
3 a* r9 Q: {8 e+ e! D' R 0040106C: call CreateFileA5 Z8 R1 a! A# v5 g3 V1 u
00401071: cmp eax,-001
. h% [. S& j. G 00401074: je 00401091
/ b, w: x& R5 j9 Q$ {4 R. |2 }1 z. b- @/ f& x
! v7 a' S: p! v/ T, q# W# x& y
There could be hundreds of BPX you could use to detect this trick.
2 e' e5 @5 n. | k6 k! j5 S4 p-The most classical one is:, F9 a2 Q$ s- e5 y0 W5 ]
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; l$ }4 H: p2 A2 q# ~ | *(esp->4+4)=='NTIC'( S/ ]: t, _0 M, q+ |9 U* K
2 m- Z6 u4 Y7 R& x; v+ E
-The most exotic ones (could be very slooooow :-(7 G( z0 t3 w Z* S9 x. ^. r% P/ b% H
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
1 o) x! T+ ?9 p6 ]- W: n ;will break 3 times :-(
6 z# d$ u" D8 q- O. n- G$ @
# s2 ~. G, E5 O! A# C4 X-or (a bit) faster:
# F- J- z1 k- x$ ~& Z4 g' w+ U# f' { BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% N- C- J1 M, |
* r7 x) C& |: O6 p- Y9 f5 h
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
' A4 L6 p$ Z5 o1 s ;will break 3 times :-(4 t* u9 B! B& l, f/ n" D$ |
8 Y$ h1 l# `8 O$ x- p; I-Much faster:& K- \8 m d! j+ R% L
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: c8 z* A3 \0 c
" t# l" G" M4 d# J+ D; ]6 U; Y8 {8 zNote also that some programs (like AZPR3.00) use de old 16-bit _lopen i6 ], P) k* b- R
function to do the same job:8 e$ w3 s" l8 ^! H, _# E! l5 I
W$ H4 l7 i/ U; t( a# F
push 00 ; OF_READ3 S9 ?: m4 J5 y( v& ?4 I
mov eax,[00656634] ; '\\.\SICE',0 V1 ], G1 _5 M- s4 t
push eax& o" W; V7 U2 A3 H, h
call KERNEL32!_lopen3 {7 N) L3 B" O/ W5 t t& i
inc eax
+ m# V8 \6 e- `/ M* n' d jnz 00650589 ; detected
, _. p/ K6 h; {* i( E% g# g* I4 } push 00 ; OF_READ
1 Y* K+ }, \1 j( } mov eax,[00656638] ; '\\.\SICE'9 U" J8 c8 v a9 D$ A( b! j8 ^. q
push eax; c1 b- B: N( m ^) C5 m
call KERNEL32!_lopen
1 {9 f5 q6 f% x: a) g6 M E inc eax
2 j6 f `. Z: V* Y jz 006505ae ; not detected
# b; |4 d! a! ^, |# Y8 u% \" y! X. q& [' G" O9 ~: `/ T; R: H
& P( M! u) f6 g/ w
__________________________________________________________________________
]9 M2 q: x1 {- Y3 a$ c
* W; ]; m/ T# Y' Y4 S3 [: BMethod 12
F& o7 `+ y$ ]. V1 g2 f=========
# N! G# ?+ R# P. d6 G, v3 Y2 `% ~% W+ G4 j4 k9 | m
This trick is similar to int41h/4fh Debugger installation check (code 05
" _# O4 C q$ H' i& 06) but very limited because it's only available for Win95/98 (not NT)* K6 i: Q. M6 g4 b' H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 Q+ F+ d5 a+ ?. p# D) ^* q$ O$ j6 u5 r) o# ~' u
push 0000004fh ; function 4fh
. Z! h6 T4 D5 C: G push 002a002ah ; high word specifies which VxD (VWIN32)
7 M6 F9 M0 c+ z6 w3 G ; low word specifies which service7 H4 E! n/ o, ?: U4 \6 ?; `! D
(VWIN32_Int41Dispatch)
% ?2 z/ W+ R, q K3 L" g call Kernel32!ORD_001 ; VxdCall/ P. A2 h5 j6 _4 K
cmp ax, 0f386h ; magic number returned by system debuggers
8 d" Y/ A% M& O) f% Y' l% Q jz SoftICE_detected7 v" x* K0 x- m
4 K! Q: {/ o& @5 [! cHere again, several ways to detect it:
" [' i' O9 f4 w* H7 {+ M5 V3 b0 q- e
BPINT 41 if ax==4f
# k; I& y" K* F/ h! Q! L0 J
, t: A: h% I1 G% O4 u BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ o7 T' K/ C, U1 I9 J M
0 m9 W0 s7 v2 Q" h: m7 X1 L BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 O j4 C# M4 h1 f1 p# X$ c
6 a* P9 j u: K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 Q3 H+ u: W/ O* s/ Y3 h7 `" d+ t3 C$ B u) b; F
__________________________________________________________________________
4 k! Z$ J, ?- T5 \5 y4 U H" Y' F$ I, K
Method 131 ~' |; [* j1 i/ P
=========
3 p: a+ f+ Q9 v5 @1 |$ P3 g
7 D0 K- \6 X% x; lNot a real method of detection, but a good way to know if SoftICE is
- E2 i: ~5 H" n' x# Cinstalled on a computer and to locate its installation directory.4 V% R- J$ o' q9 z2 S: j
It is used by few softs which access the following registry keys (usually #2) :
, n- l1 b u9 D
% |' T0 {7 z3 V; K6 S9 x-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# a* b( @" ?% G; a\Uninstall\SoftICE2 E7 d0 v/ Y& M4 w9 v: o. F
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 v0 C3 z6 n/ X0 W4 F% x
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' h3 S( C* l2 d: J; D7 ]
\App Paths\Loader32.Exe
& v. z: Y7 C; W0 r/ a
0 Z! n2 Y& v! j! b* x2 g4 A0 C! X5 F( J$ u$ B6 ]/ _) x5 A- C
Note that some nasty apps could then erase all files from SoftICE directory1 T/ i5 ?" D; U$ }/ x9 Y# ]
(I faced that once :-(/ |6 g9 r+ f. v( L
( l9 K% W/ u! lUseful breakpoint to detect it:
) t1 w V4 Z6 Q/ @* v0 N) @9 {, I# U3 Q2 D
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 z/ {+ d' b5 p' W9 w; I, L
$ Z; v0 a4 I7 Z3 }4 c5 S& }- n+ c
__________________________________________________________________________
j$ H( g: Y- h0 f& e! }* I% l/ O# [1 c9 W
& \* i5 N6 T; u _) S) LMethod 14
' y2 y+ r2 d+ U3 t=========
* ]) r0 H. s; \9 q, S5 B4 S/ r, S# v1 N; f; W) ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 Q# @% v0 i2 M2 S
is to determines whether a debugger is running on your system (ring0 only).. R# m; n+ Y U' I1 U
( Q1 L& b9 }9 F' m
VMMCall Test_Debug_Installed- V2 t" `# q% K, h$ x
je not_installed6 J, D8 `. S$ u! @
7 R& ]4 U4 }/ V, _4 q% k$ L' r
This service just checks a flag." U; M5 ]4 G( u4 q7 w, v( p1 `
</PRE></TD></TR></TBODY></TABLE> |