<TABLE width=500>
$ Z: ?0 g, d+ r/ J3 x! F% F<TBODY>
8 B* A/ U* s# ^: P<TR>8 l, l/ _1 g; `% ^+ t6 r
<TD><PRE>Method 01 z" |2 e6 Z. x* o6 P0 s
=========5 K$ X7 R4 }2 M6 m Y" U
9 j* Q: O# b# c
This method of detection of SoftICE (as well as the following one) is/ E1 ~" a) R1 W# L9 `: k8 F4 @
used by the majority of packers/encryptors found on Internet.
4 E- |5 _6 \' R7 _2 e2 {7 ~* n+ @It seeks the signature of BoundsChecker in SoftICE+ W. U" c( F0 r; M) J! h2 L# Z: b
$ ^, O- m; O! x& j
mov ebp, 04243484Bh ; 'BCHK'
% O" i) N' |% O+ u mov ax, 04h
1 }& g, r9 C3 n6 q' @/ G- t int 3 2 ], o7 N* h/ V7 ]0 J3 s
cmp al,4
6 C$ Y: l/ v8 Z( e) J) H5 ^' E jnz SoftICE_Detected
' L& y" F( y5 {, x% b& K z6 f* P: f* R E, I. F' o; e1 M& n
___________________________________________________________________________
; S+ h7 p% @. Z+ S) j4 @3 t5 [8 ?1 v% M
Method 02
7 o) t8 [, ]4 j8 r=========* a4 F/ _* r3 X+ i; l" Z
: k' m. }- g4 x N# V8 [Still a method very much used (perhaps the most frequent one). It is used1 P9 i8 B9 m' W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 G4 i) }, g& Y9 J- Lor execute SoftICE commands...8 z- H3 B( ?( i. @
It is also used to crash SoftICE and to force it to execute any commands9 f# M S4 p r; Z* T& H. `
(HBOOT...) :-((
8 c+ {0 B; W3 Z- V- F" e9 K" q) f/ k8 d( [ x `) c
Here is a quick description:& x& B0 e6 S/ ` m2 [3 ]2 D+ L
-AX = 0910h (Display string in SIce windows)3 {; u4 e- b, n/ ]6 e6 t
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, O r, B. }$ Z5 Z- M* W-AX = 0912h (Get breakpoint infos)) t/ r# p% Z7 e' d5 F$ N
-AX = 0913h (Set Sice breakpoints)
+ f/ n) }1 O% C/ |; X, n W* t+ ]-AX = 0914h (Remove SIce breakoints): T* R8 a5 U1 t2 `* Y! l
: T* b5 ] W# B9 UEach time you'll meet this trick, you'll see:
( q* J* P( b$ k7 \-SI = 4647h3 Y' I, @( Y. k& j
-DI = 4A4Dh
+ W i1 I/ g! q; \% ~Which are the 'magic values' used by SoftIce.
; L3 `0 y! ~3 L* e0 j/ R0 Y# TFor more informations, see "Ralf Brown Interrupt list" chapter int 03h. e. o J6 B: E0 A0 J5 _/ c4 q' L
; ]0 m) O# y( o) H; RHere is one example from the file "Haspinst.exe" which is the dongle HASP1 t. I, F1 {6 J) h, q
Envelope utility use to protect DOS applications:- p9 n9 G* W. R% W
' A! R5 y+ W. h, B
9 E+ ~4 q& X4 r2 X/ ? o( ^4C19:0095 MOV AX,0911 ; execute command.0 k3 L& \0 H1 `1 K6 m
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). v# M6 N/ ]! S: S3 W8 z
4C19:009A MOV SI,4647 ; 1st magic value.
- `3 N. K- P5 e5 L3 Y; D5 \( q$ z9 u4C19:009D MOV DI,4A4D ; 2nd magic value.& D- ?3 i8 k5 m7 ^
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& l7 `% j, P6 l: t
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
3 e" q9 W- u4 q4C19:00A4 INC CX
7 |# {2 x$ ]9 a! C: w6 A. Q& d4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& B+ g) [0 w( G" N, c! @' j$ A4C19:00A8 JB 0095 ; 6 different commands.
" p$ L( z! k/ c: @& W& ]2 p& N4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ ]8 y1 w! V. o7 i) ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ Z3 S! D; C. P' m/ y9 j. a# p$ I$ ]' r
The program will execute 6 different SIce commands located at ds:dx, which
! P1 p& [' ?1 P7 p$ i! Yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 \ E. K% M0 S- |
+ D& q; `; I6 q0 {, q; D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.8 Y0 U$ b$ a6 B. N& Z1 K& l
___________________________________________________________________________
0 y) r5 [. o7 J; c/ ?- Q- K! h/ ?; o# g
: c( M1 M' G8 K
Method 03" S" ]9 R4 |* h- G* {
=========
# D7 D" F$ N/ K" P$ H. ], ?' v, T- c# { n
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 ~) b: x1 R# l9 O& O" H8 S6 U(API Get entry point)
1 w- T5 E0 B2 G/ Q+ q' P & u+ `& |, p6 G" h5 b
# c4 c* I+ b$ a9 q3 `$ d$ A% P
xor di,di; q4 K. Z5 k p2 H$ @4 T2 I$ J' u
mov es,di
' m. L% z! w/ _1 ?# O mov ax, 1684h
- L$ V- b: z, @+ g3 {4 o mov bx, 0202h ; VxD ID of winice
' J3 F8 @/ t; K0 B int 2Fh
0 _+ I: p; t+ t5 Q, T; f8 |3 n2 z mov ax, es ; ES:DI -> VxD API entry point2 T3 K( L$ J6 q' V$ A' N- e) H
add ax, di
/ n q* m# k" r, }" \ test ax,ax% |, u5 Q$ @5 j1 l5 u+ F
jnz SoftICE_Detected5 M+ n1 Z$ ~* B0 \( e
! v9 S2 P% W/ l% g6 @* R___________________________________________________________________________
M1 k3 {; P' F, M, F! f3 u4 u' `# Y# ], ?
Method 04
4 ~/ e" N) j" K n1 f0 i0 Z7 j=========
; s9 y( k6 [" l# H8 j
$ u+ `9 s. v/ T2 K" |6 D( MMethod identical to the preceding one except that it seeks the ID of SoftICE/ M4 u( V9 I; B; ?' Y0 m. B
GFX VxD.
2 W% p, S0 N( }' T! M+ d8 q1 q; Z( q
xor di,di
( q n0 `4 Q ]/ x5 C: ` mov es,di8 O( r% m7 M9 K: g- `
mov ax, 1684h
1 Q! n" I* i" [0 a. Z mov bx, 7a5Fh ; VxD ID of SIWVID
! a7 u Q6 _0 C int 2fh
3 q* x! x& m6 x7 P5 F1 m$ S mov ax, es ; ES:DI -> VxD API entry point& W) \" B. b% G( [
add ax, di* D! Q1 E7 j% g1 l( e n6 [
test ax,ax
' }+ k( z; d+ _( S jnz SoftICE_Detected8 @6 m0 j+ S- r0 V3 d5 k
) ]; V( G% ~$ [- n6 \# b__________________________________________________________________________4 `" m( S( w5 o% w9 L V6 z( J
$ a. j- K3 I7 R/ p. i# N. r
6 c% y! g3 a0 g' O: V$ OMethod 05
W1 p6 j3 q5 E9 F6 t=========
# I7 N! w4 f; }$ m1 x5 |
0 q3 Q' B" B. G% w% uMethod seeking the 'magic number' 0F386h returned (in ax) by all system
" ~9 |& s+ K3 V+ L0 f; y( edebugger. It calls the int 41h, function 4Fh.7 l6 c7 w$ o! r
There are several alternatives.
+ ~' F: c8 C: h
* r3 q) q) P& v- Q$ vThe following one is the simplest:1 J4 V I0 j! Y2 P7 L
3 F( {7 W2 I! P* m j mov ax,4fh- B1 }0 R# \2 d! r6 |# \+ `
int 41h
5 s4 G" v0 \: t# M4 q" j* w: @ cmp ax, 0F386
/ g" I1 ]# ~3 T5 m. p7 h jz SoftICE_detected
* [9 r2 G o' ]$ O2 j$ S3 {: M
/ z% Y( c; W% |( G3 ]! q' R9 r N- z, k; Y: Q+ `5 k
Next method as well as the following one are 2 examples from Stone's 2 _9 L0 q# N; S& U% A/ N1 A+ ~
"stn-wid.zip" (www.cracking.net):
# p6 m6 k3 a8 x. d5 T! w
% p/ O% f) [( e2 t$ R7 C6 V mov bx, cs
7 h! Q* \! a) S- S/ N { lea dx, int41handler2
% l* c' p" o! \7 P2 ? xchg dx, es:[41h*4]; I4 W3 j" t6 [( u6 o
xchg bx, es:[41h*4+2]
- U8 Z1 q0 Y' X mov ax,4fh
% T! c# x8 l4 i' ]8 v' `7 N; k int 41h, Z. g* `: p- M7 p; k. x( X
xchg dx, es:[41h*4]& E o; {$ m4 h. ]) ~0 i7 k
xchg bx, es:[41h*4+2]
; F6 s& _/ ^- _2 X) y) x r H cmp ax, 0f386h
+ J. l4 l8 t; S9 {5 q jz SoftICE_detected
1 d0 i" j! _3 I9 ^' l% i9 G2 v& N+ K% `3 @& ?& e
int41handler2 PROC9 I. s4 s+ i2 t
iret
) p2 d P8 I+ [, T/ Iint41handler2 ENDP
@! i+ `. l- M3 Q u3 }- b! [) R, m/ q* o9 X. N3 C
% W" ~6 ]1 r2 K_________________________________________________________________________
1 } q6 x7 `9 G5 O7 ?$ _+ E6 y o ?7 t0 z
$ G2 a6 j) t) f9 C g8 ?- c0 X
Method 06' R' q, |- n3 r! b8 Z, U6 {4 ~' o
=========8 u$ H2 d' X6 _
4 K G0 b! T9 o( W" r+ H9 O& V8 d; r- }% v
2nd method similar to the preceding one but more difficult to detect:7 U5 s. m0 t s2 |) [
0 u& F3 J( q3 d
% q7 u7 H/ L% {& R& L2 v& lint41handler PROC
: d( z9 O2 r3 h9 s$ ~3 L mov cl,al
2 a4 m$ x4 A9 f% M+ f+ ? iret
) |- }6 `% y* _/ b3 V2 N/ @8 Zint41handler ENDP- u) C+ j' F k5 @
8 ~+ |8 j1 @0 q; m0 a6 z+ ?: u7 B
! }0 `7 C; K) Q# b8 | xor ax,ax
3 t! E ?+ ?) i- L$ Q4 z! z y mov es,ax4 T# ~+ Q4 l; V4 F) I$ Z4 k
mov bx, cs2 J% ~( i$ E- [" H
lea dx, int41handler
8 d) x- A: _$ A xchg dx, es:[41h*4]/ t' |( }% o' ?% K
xchg bx, es:[41h*4+2]( M: `' { ] Q: Q
in al, 40h" N4 y1 S6 U, p* O1 Y5 m
xor cx,cx
1 O9 G$ G, J6 ?, x+ i int 41h
# X5 U: }5 Q, U- q" E, Y& s6 \+ H0 a' ] xchg dx, es:[41h*4]
0 E& [3 r* o3 P& S6 K# }- N- n xchg bx, es:[41h*4+2]+ h6 H& S+ F) r- |( T
cmp cl,al
6 m, w% e( R% p2 H! x% L- Y jnz SoftICE_detected
8 {+ X" K; ~; T1 B8 G9 {3 }3 p$ ?2 |6 q) P0 _! b
_________________________________________________________________________" Y+ G& t& ^* ~0 U- B4 t4 j
5 z2 S1 z$ R! y1 D
Method 07
4 ~ m% u- A# m6 _. M=========3 N+ S) D6 z& Z9 f0 {; g) V
1 g, C7 V7 w9 m* H/ I3 f' X
Method of detection of the WinICE handler in the int68h (V86) J; I5 P: X' v* x
! f7 E$ S5 N+ z1 X* E* }& t
mov ah,43h- T# {8 Q- C/ _6 V, Y: y! V' \0 f
int 68h& s$ t2 _) E! F% i
cmp ax,0F386h- I7 _# {5 d0 H6 y
jz SoftICE_Detected5 t$ H6 R0 k& X- }: c& _: S! J) x
7 {2 I+ `/ [% ^4 r+ C B+ H
4 [9 C/ z* [0 {- c6 M& {
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 o2 {* i" q# O; G6 n" B# l app like this:: H8 g: R4 u1 Y5 P! M$ R" A
0 e5 f( j7 r0 h3 K5 @ BPX exec_int if ax==68! J9 C2 Y x' h3 U
(function called is located at byte ptr [ebp+1Dh] and client eip is! I/ m. M& X! s8 X' N% x2 D2 \' C
located at [ebp+48h] for 32Bit apps)- F7 E% l( U/ l* |5 P! o
__________________________________________________________________________
4 F3 z8 t* M# l: p4 H9 M
1 Q' g% }) G8 g: T8 p) O. C, k0 k9 K: W
Method 08
: N2 N. m; l5 C" v4 k% |, Y=========0 R8 D8 T5 W% l# |* f. ^; ^( y
$ N. H8 O7 W/ j- R' r! i* p
It is not a method of detection of SoftICE but a possibility to crash the
% f% B j+ {" }, t6 ?system by intercepting int 01h and int 03h and redirecting them to another3 t+ J3 w- K! [
routine.
8 b+ E; J, ^: a3 q; ~$ @& Z: qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
2 g( p* y1 l4 }to the new routine to execute (hangs computer...)
. ?+ B4 ]7 M' X5 j/ t8 I- Z% R# A. f
mov ah, 25h
" L% p6 i' o$ G9 ~) a3 L9 g mov al, Int_Number (01h or 03h)8 h8 E& I1 d! l0 ?
mov dx, offset New_Int_Routine( G3 |& {7 o- T8 {
int 21h# U% j0 o8 ]9 f1 Y8 Z
8 a' X* |0 Y' b5 u% V__________________________________________________________________________
% C2 p$ i9 p6 Q
. @( F& X6 t& ]1 p* X1 K0 k- m/ cMethod 09
. ^4 G: n8 q* v=========
2 P5 F/ w% t( l( g7 N+ ]3 l1 H
. E4 f9 v; ?7 I jThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& T$ e4 f. i+ ]" F+ w$ z6 U
performed in ring0 (VxD or a ring3 app using the VxdCall).7 z r/ D8 ?1 a0 Q$ ?; L: T3 d
The Get_DDB service is used to determine whether or not a VxD is installed
% @3 t3 u. ?% e! p! u3 i5 n% \7 J" Nfor the specified device and returns a Device Description Block (in ecx) for" ] F; W6 H! Z8 R: v- L' L, I, \7 ^
that device if it is installed.
5 @% P! W2 r- b( T
: G i8 c+ k% W mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: }% r8 [- M3 B: W8 W6 z/ f1 p: L mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 v6 P% d9 ^& N
VMMCall Get_DDB$ b6 M; A. ?, A6 S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, y9 t' |3 c7 i/ Q3 j2 P; Q& |1 `6 [7 {1 S# M% n5 I9 u5 ]8 y, u
Note as well that you can easily detect this method with SoftICE:
5 m% Z6 X+ T5 V bpx Get_DDB if ax==0202 || ax==7a5fh5 b5 E3 F9 @/ i
# \' Y7 ]4 ^5 n* @5 W# R* l5 B
__________________________________________________________________________
% P. B6 @8 l; `8 N; Y) B) Q3 \, |: d5 o8 p3 a+ D8 v
Method 10
) G6 e$ g% d* V* p! ^) I=========6 I: A' M- O; T( i
5 U$ e7 m$ r+ o* x/ T( Q) ]=>Disable or clear breakpoints before using this feature. DO NOT trace with
. R1 Z+ |! W w; v" T SoftICE while the option is enable!!" [- A! Y# p9 j% n& w# s" C# l
8 N3 ]4 ^3 P( M" k
This trick is very efficient:# A- a% \5 X: `. d( ^2 Z
by checking the Debug Registers, you can detect if SoftICE is loaded
; e; \; \1 x5 b( R# F6 e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. I4 M1 |4 y$ i. U& Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their( W2 {# j f: S6 L& x+ R
value (in ring0 only). Values can be manipulated and or changed as well( j- t0 U. r4 @0 j' H( o
(clearing BPMs for instance)
( g1 ]' n# n$ K9 B) ^; Y: g7 j3 r$ q0 q
__________________________________________________________________________
# }4 P. c3 N- J) X# q- B$ }8 q# r$ i- o, {0 f
Method 11 a5 x8 u) q/ ^9 b2 X9 L" z/ b7 i
=========1 S/ H- x4 p" H& Z
4 h4 E2 O& U1 ^% i; ]7 qThis method is most known as 'MeltICE' because it has been freely distributed
1 e9 y$ P/ s4 j- f. Qvia www.winfiles.com. However it was first used by NuMega people to allow3 e: I" [5 a5 E) o
Symbol Loader to check if SoftICE was active or not (the code is located
# `0 ~" l- ]5 G. f# d8 z% linside nmtrans.dll).
) B- K/ D9 W A: q
' r/ U$ E6 m1 JThe way it works is very simple:
7 Z. k6 C) L8 R) P+ [It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ h ?0 J+ g; N+ r. MWinNT) with the CreateFileA API.3 s$ B- p' J1 Q! x, L' v
' A8 m* Z8 H7 L* D( Y: u; S1 z7 Y' cHere is a sample (checking for 'SICE'):: d: P0 U! p+ q. D& |+ {9 e
9 b/ r5 Q6 c8 }+ z7 t- @. s7 gBOOL IsSoftIce95Loaded()
0 n& ^: U" y: s7 {0 Y' ]8 y$ D{3 k, n- \ F. h( J% l$ F
HANDLE hFile;
6 _ ]. [* t* ?2 P1 c& v9 Z* z1 N hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 C$ l2 p" D* B% k; | FILE_SHARE_READ | FILE_SHARE_WRITE,5 }! E# F+ Y( v2 W4 C( D# Y @
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 {6 } i4 E) Y# q5 M if( hFile != INVALID_HANDLE_VALUE )2 W5 ~* E- [# H4 M: j# V% f0 |+ o
{
- G# b' s( w: e8 H5 Y CloseHandle(hFile);
k/ Y/ ^3 z% B1 Z: ?, e return TRUE;
# \0 C* c- J6 f/ @' D8 f }
! x, S [% O# g' U0 t+ N3 S return FALSE;: E+ _7 U* u& }7 s2 b5 D% p% q
}3 f8 u5 }% P# x6 d# A
1 C6 v8 k4 c( f% R' i
Although this trick calls the CreateFileA function, don't even expect to be& z4 ^6 Q$ Z3 ?# m+ |8 p
able to intercept it by installing a IFS hook: it will not work, no way!
- R0 T# U: `. r& j) P8 Y9 q0 \In fact, after the call to CreateFileA it will get through VWIN32 0x001F/ r1 B3 ^2 u1 z. v+ X- A; @. s, H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)2 p' k* V6 A1 L( Z7 n8 M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 V% e! b( J( ?7 }# Ifield.
9 t* H" k5 t% nIn fact, its purpose is not to load/unload VxDs but only to send a
( Q. \1 d5 p/ O- YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. X. l9 V' ~* g# | w* Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
- k$ A) w6 T) L' I& \; I& Cto load/unload a non-dynamically loadable driver such as SoftICE ;-).
; K+ Q @. g; G3 `6 m+ n" mIf the VxD is loaded, it will always clear eax and the Carry flag to allow
& ~& B7 U7 v; Z$ rits handle to be opened and then, will be detected. \$ Y* I8 C6 a4 o5 _( `0 |
You can check that simply by hooking Winice.exe control proc entry point2 e( `1 ]# A) g2 s, F
while running MeltICE.
4 T3 ?2 U' n% f% S8 p( I% q9 }' J3 N* ]& ]. H
6 [4 l4 X( Z, X5 K. `9 C, n I% f 00401067: push 00402025 ; \\.\SICE
) A; d/ `2 \& _+ v8 l7 |6 K4 ^+ J( m! F 0040106C: call CreateFileA0 Z" I0 f2 T/ a5 @, V" `! ]
00401071: cmp eax,-0017 q; x- ~: Q: P. F
00401074: je 00401091
( U8 q7 s; ^. c
) W5 L+ ]6 H& G! ?3 V; e7 ^% n, k3 M( I
There could be hundreds of BPX you could use to detect this trick.) G H; F2 ~0 n! y4 ~/ J' h" k. T
-The most classical one is:
! u+ a; U0 p( d BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
D3 d3 H$ g& S* A8 u! i& [% B *(esp->4+4)=='NTIC'2 F3 E. P8 S' L' Z) \, I' f
0 r7 E: u) A) r4 {0 E-The most exotic ones (could be very slooooow :-(
. G8 c) @' h+ F6 ~; [3 q0 p# ^ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
+ z# P4 s, }8 Q4 J4 X8 D- I ;will break 3 times :-(2 `, J+ N# p, t
, Q" h: f3 l+ b# f! Q+ N7 q-or (a bit) faster: ; g7 B) u5 K" p' ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ x/ n/ `. O) `9 A
+ ?9 Z1 A( ~6 X: u: F" L8 ` E, n BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ a6 O' c& H. m- t7 ^3 [& K0 S7 J ;will break 3 times :-(0 h9 d4 u; c, ~$ d0 v6 S; q
$ K p6 R/ X. b: K9 P9 S
-Much faster:0 n4 v8 b3 T9 O0 K, A D# D
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'7 q/ a# Z& X$ q8 {2 ^" h o
3 v m5 y b1 E2 c
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 n: s& V# F& [( |2 G
function to do the same job:2 ~( D/ Q/ l, y2 u3 \
* l A5 ^' V T4 o$ {3 @# R push 00 ; OF_READ
0 Y! w8 G; u0 j8 \% }; l% a4 Q2 n9 S2 m, I mov eax,[00656634] ; '\\.\SICE',0
1 y2 l$ k3 }5 s- y/ ~5 T push eax- ?# x3 S" r, a4 t: R2 c
call KERNEL32!_lopen4 n. v$ f/ m/ G. ^$ U# z
inc eax
: G( o4 B( _/ G0 K0 j% L, ^# i jnz 00650589 ; detected2 B7 W" ~- _" q5 p# R5 n0 t4 A
push 00 ; OF_READ
' v: n, k$ B/ Q0 ^ Q: s# c mov eax,[00656638] ; '\\.\SICE'2 g9 \7 i# N# {5 w: [8 {/ f5 o( t
push eax' w; h$ z s3 v o; T6 ?) C8 O4 E
call KERNEL32!_lopen
: S, s/ T8 i) m) h% O inc eax; o0 |) J( R5 R* ]1 n- G) ?, t) }
jz 006505ae ; not detected
, V$ ~# ^/ i3 j
$ o5 H9 j5 j1 r# `7 M7 m
4 \( Q- S5 T( m( ~" s' s__________________________________________________________________________' \( r) \4 J) Y1 n
2 D7 x; T% G: `, \
Method 12
. B; E. n& B7 R9 } }=========
7 c0 q: N0 ^" G( P$ k A, z b
4 r* b" r+ L* P' y7 O0 JThis trick is similar to int41h/4fh Debugger installation check (code 05 _' I- u" `8 M8 n3 d" Z
& 06) but very limited because it's only available for Win95/98 (not NT)
7 W- k- |2 N9 S% i% z# Las it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 n; F- \7 a: Q. o2 e
+ s! Q6 n& S1 F9 ?4 k& s' F; S
push 0000004fh ; function 4fh
( z4 E2 ^2 n. h) e: K# } push 002a002ah ; high word specifies which VxD (VWIN32)
/ c! O3 X- l) y) }( a4 v ; low word specifies which service% F1 ]; w4 y1 n3 Z9 \8 ]
(VWIN32_Int41Dispatch); n( \, p/ S+ c: `) W a
call Kernel32!ORD_001 ; VxdCall
( h+ W$ B3 j' W8 k3 {; v1 { cmp ax, 0f386h ; magic number returned by system debuggers5 G; | F3 h0 |! W" Z+ N' v) u; a
jz SoftICE_detected
" W5 E7 A/ R2 q3 m& s
; u& Z* U ]' _2 t' uHere again, several ways to detect it:
' v U: G& C) r: S; T( o9 q
0 _5 p, `+ F( F2 [ e3 {0 b BPINT 41 if ax==4f: k* ^0 s: }% Z/ Z, x! |0 C: R: T
% \# Y/ g" a6 P4 q, O
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 z9 r( B! D" N' Z2 ^
5 ]: W# _. e1 d* F BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 ?& U% L! @6 D5 \$ P# H+ q' U+ L- x
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: i" K) V. F1 Z' K2 o7 L
$ I. f. P8 M: x* z$ ]# [6 v3 `6 G
__________________________________________________________________________; k( C, o0 J: y! s+ [
8 V; b8 d5 ~* [ pMethod 13: k2 a" F! }# x# `0 K
=========
5 X. m- n$ K! U" ]5 R& m
; ~) [. O% ~* DNot a real method of detection, but a good way to know if SoftICE is
' D1 R& w1 n. H1 ]installed on a computer and to locate its installation directory.( c& L1 V: v3 Z* I: w. T% Z
It is used by few softs which access the following registry keys (usually #2) :8 E; h' B, J2 M' ~: e0 E# l2 M
# t P% V: x$ h9 l) p& U
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! A6 T& _; S6 M: t) j* B\Uninstall\SoftICE
' r# W* ~, K! z' i6 o& |) x. {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 }6 p9 q" N2 Z+ s" C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- n ~+ A9 _$ `( S\App Paths\Loader32.Exe. L# `- C3 z- w& \6 U+ h* M$ b$ p
, J; n1 ^1 B4 U! Y0 _
9 i# _5 B! m$ ^% u9 o8 \9 I
Note that some nasty apps could then erase all files from SoftICE directory
6 d1 [# }# A9 ]$ [6 {(I faced that once :-(; ]' r5 B' `+ B( ~, Z, v" L
7 f9 E' e1 _8 \$ IUseful breakpoint to detect it:! G! I& |) ]9 x/ C, o
3 z! c9 l3 m' ?3 B+ \( T' b
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. q- y$ j( i. w8 I* X8 B$ o* d# w# W2 C9 S: Q: Z
__________________________________________________________________________
' }5 f. w* ?/ ^' D# ?5 L" c
& V% Z) O* O: l2 U$ m! K1 b& P& C) g& q: Y
Method 14 ; b. V" _( n- U4 ^
=========, r% @! o. x3 u9 [
" y9 T3 ~, @. V" x) E* i
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 \0 L4 b; B9 s$ I+ Z6 fis to determines whether a debugger is running on your system (ring0 only).! k9 K0 {) q; h1 }; [
7 y1 r9 D, w# W, @' y- V. H. d VMMCall Test_Debug_Installed
! ^: t& W$ a4 d* A+ x je not_installed4 x7 I: ?/ V6 E2 b0 V ]) s
) u \7 U, v2 b" N) g- h5 s) ^% eThis service just checks a flag.
& [% U0 w2 p$ t7 \8 w$ s. g% {</PRE></TD></TR></TBODY></TABLE> |