<TABLE width=500>4 \# h+ z, `( x
<TBODY>
1 t1 v+ h+ r6 U5 j; L<TR>, k4 \0 K: w/ D% s- y0 N [
<TD><PRE>Method 01 5 Z$ l3 d' _$ u/ L! l8 {$ G
========= c% w# R) K( Z3 @4 |
' N: k. r( Y7 o4 ?& p3 L" r6 |
This method of detection of SoftICE (as well as the following one) is- y" Q4 Z; i) F" i: N, E
used by the majority of packers/encryptors found on Internet.) D, Y7 A. R5 E2 Z
It seeks the signature of BoundsChecker in SoftICE+ }* F9 B6 `2 v8 E. c
, m n! o z' d, S mov ebp, 04243484Bh ; 'BCHK'3 |9 R# n( o1 d9 s, v1 {
mov ax, 04h
2 E/ ~9 |1 Y, E int 3
% ~8 `4 D( U3 s' u) b: Z/ C cmp al,4
$ ?6 Y: H& ^/ T% j( a jnz SoftICE_Detected9 d8 m- V( \( ~- S( b# R4 @6 ^
6 k. ^8 G! q& @+ ]. k, z. z6 |! N
___________________________________________________________________________) ^- u% d" d. H' S# c
# A3 d5 d Z6 w) p& qMethod 02
5 [, o) X, x# R* {" B- e! i=========
: B" } V1 n/ H4 ~! r* A: q+ p- h, b# u; [0 \* |9 W8 k
Still a method very much used (perhaps the most frequent one). It is used! F& M& f# I4 u1 x1 X8 ?
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. y3 I9 k. ?' Ior execute SoftICE commands...
+ l5 H4 c" ?2 I1 G- M/ aIt is also used to crash SoftICE and to force it to execute any commands' x, W7 p0 O# O
(HBOOT...) :-(( 8 }, ]! Q/ }8 L
% Y8 }0 \+ i; }' y
Here is a quick description:
, g6 z7 m B1 t8 u" f7 m& V; D-AX = 0910h (Display string in SIce windows)
; G+ G3 j6 r# G7 r1 L4 L' n) n-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ q2 O" a. ]. y. D4 T( W- o
-AX = 0912h (Get breakpoint infos)5 D' N: c! O% U; p+ e0 Q& q4 N
-AX = 0913h (Set Sice breakpoints)
- I6 c- H% S; g-AX = 0914h (Remove SIce breakoints)
. _# L- ]; \+ i, S8 z3 {# ^! K3 }7 l3 _7 t/ Z0 W9 V" d
Each time you'll meet this trick, you'll see:, c+ \& v9 _% i. [0 k$ W, A
-SI = 4647h$ T9 s& P# J$ c& `* u
-DI = 4A4Dh
1 @5 h" [! t& T R- G$ XWhich are the 'magic values' used by SoftIce., `: R' s5 x b) ]' D- r* u, e0 G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; Q% b4 u$ F. v* X4 M
. {+ T- \5 z. Q! K {4 {( b+ WHere is one example from the file "Haspinst.exe" which is the dongle HASP8 m4 X& X9 ]8 M! S) z$ p6 W5 ]
Envelope utility use to protect DOS applications:$ d# C' U, n( P$ i1 X$ S8 F* z" S
; U2 d6 e9 T+ l" e3 |3 B
" h# g0 v# |' C( F7 F" q2 J: v" p7 Q4C19:0095 MOV AX,0911 ; execute command., [2 U: P( ~ E
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).) ?$ d; d/ x! X' G3 W
4C19:009A MOV SI,4647 ; 1st magic value.+ b; D F4 B( Y( d% o" _$ y
4C19:009D MOV DI,4A4D ; 2nd magic value.0 Z. I* M2 c) H' ^; S- i8 S
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* \' _* Z( {& a2 e
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute0 l. S! f9 L: u* u' M( O
4C19:00A4 INC CX
% z% m8 i; W0 }; K& b4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# z+ d# P3 H8 K% s4C19:00A8 JB 0095 ; 6 different commands.
* t; p; H7 i4 C4 y4C19:00AA JMP 0002 ; Bad_Guy jmp back." g( R. R/ A4 u* x
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' i q" w) q! a( U' c
- ~* z* F$ z G* P6 @! `6 \
The program will execute 6 different SIce commands located at ds:dx, which7 X" e0 d$ Y; K' R- M% T7 y3 K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ c, a+ D7 i- u5 f' B
4 o/ Q9 m; F! U! [
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
- c- U2 R' `+ ^0 P5 I/ }* }___________________________________________________________________________* R( p, B# l- {4 k5 }1 d
3 O, [+ f1 @; v- }! V
% O4 A/ k( Z1 B, r7 E$ L e, o
Method 03+ |1 w, H, J9 r9 h' Z$ r
=========
. u0 a' A0 E3 A) ]6 r! K3 |6 j* n6 l( X0 D3 |* S* N
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. n$ |, T/ ?" C8 g
(API Get entry point)
! J4 V3 E% N* e! y 3 \+ Y1 @; k1 y, C3 j9 F
3 q- l& }; G( e: [3 E5 j xor di,di
/ h* B a! r0 s9 y" m mov es,di' J }. O: O4 w: u8 I( g6 b
mov ax, 1684h
# _7 p- }* v M6 q; C+ k9 ?5 t7 j mov bx, 0202h ; VxD ID of winice
' u8 Z" w, ?: A: o" l) x. ~4 Q int 2Fh7 ], Y9 d- ~/ T l9 X3 o H. X- F
mov ax, es ; ES:DI -> VxD API entry point4 l% M, s+ n3 c( }7 [: ?3 h
add ax, di
; z- i$ f$ K5 P( f! s' [6 ?9 r test ax,ax
) B; _, L0 R( R" ~( K+ c" \3 N jnz SoftICE_Detected
( I$ o. Y$ b) w2 O* }8 p# w
4 y& Z, F# @& X3 l: e___________________________________________________________________________
" z% C% O% \, x4 L) I5 Y/ c. M, m z# o
Method 04
0 }, |4 D& B; {8 b: W) [5 ^& p3 j/ r=========0 g5 |4 e; Z3 z
* m1 o- o% v5 {6 n3 ~! u/ [Method identical to the preceding one except that it seeks the ID of SoftICE9 \% j r2 R; E' A) Q
GFX VxD.. M* Z# G$ @7 |: s, r& p
" @! s. i& h5 u xor di,di# i2 @. s: {: b5 ^( C- \
mov es,di
8 I* @: t1 p" \% F0 K" i. s mov ax, 1684h
" {+ _/ Y g! x' r& _8 y V1 D8 | mov bx, 7a5Fh ; VxD ID of SIWVID
- ?& v& b; |; s0 q" n int 2fh! Q# Q# t/ K+ [* m4 p
mov ax, es ; ES:DI -> VxD API entry point
: p7 |5 t: ~% h2 c1 q% j3 M add ax, di
2 c8 p6 @- i* H$ I: s test ax,ax7 m# W& d0 y$ h8 a& |" s$ }* L. C
jnz SoftICE_Detected/ n; d$ y; T1 D) C2 j! A
/ D# W4 j* o6 m- J7 g
__________________________________________________________________________! v; _$ z/ s: u$ A5 ?
0 r& b& c( s3 X3 h( O
. w! C0 U J% X5 vMethod 05
% ]/ i. T, O5 R2 N=========5 D8 S3 V/ n! \' F9 V0 B
% B( ? ? Y& x' l: X
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ [) t/ D/ G! Z9 _, ~3 A" @
debugger. It calls the int 41h, function 4Fh.
4 ~# }; j9 v' y3 b$ _; n [9 OThere are several alternatives.
/ M6 d9 S% l. E! t8 p. Z2 v; K9 _2 v6 ?5 V, D0 \5 L; _" J# G" G) z
The following one is the simplest:
. F7 W* q$ O5 a/ J v
& ]9 F- @3 m- [$ u mov ax,4fh1 p$ R, f) d1 A- C+ B0 F
int 41h5 `8 V, _3 O1 @, k/ R/ l
cmp ax, 0F386) n2 n9 Z+ D R8 \5 ?
jz SoftICE_detected
9 E. Y+ P% e4 n! B& a ]# y1 q9 C. M, f
: J! f. t1 Q$ n+ X* y9 }Next method as well as the following one are 2 examples from Stone's
$ A" v H4 [% H, i8 E- I* M) e"stn-wid.zip" (www.cracking.net): {5 r6 R7 j0 i( |
- t1 j* ^3 c- s5 V. J* q# k1 U
mov bx, cs1 W5 }6 a% k9 c6 w+ Z0 d f+ w
lea dx, int41handler2( C% d2 k' m/ Z! ?) V5 p
xchg dx, es:[41h*4]
" j* X _" B* `) I8 j9 l" s: { xchg bx, es:[41h*4+2]
* @5 F" p4 ], r! C mov ax,4fh- Q" Z! ^5 O9 |# _; N/ P9 X% ?' N
int 41h' ]* n) K- f7 b4 W/ m, C5 ^& Q: @6 z
xchg dx, es:[41h*4]
5 m. k6 O# {/ @& E xchg bx, es:[41h*4+2]8 |0 l; ?7 i3 V$ s+ ^/ }2 y; ~
cmp ax, 0f386h+ U3 D' |8 T0 b$ Y U: {4 ^% {
jz SoftICE_detected
% G2 ^* M7 p9 t' p2 q3 \3 f/ e9 O' ~% f4 @. \
int41handler2 PROC
2 q3 O8 e6 s: m4 |0 r# v iret
4 R g: t3 P# n; c6 M" \! r8 Z" gint41handler2 ENDP3 c8 n* D( n' R8 |) @
* N, Z' T$ v6 ^% R# [) k% I9 ?% m
9 a! O9 Q2 Y5 ~- \- |_________________________________________________________________________
$ D9 `# q- B; T! b; E5 g! k3 h' E: \0 z5 B O) f8 y& c
8 f2 H7 w" k3 V7 Q- e: C( J+ j; E; \$ B% jMethod 06
. k' V. n; o+ ^=========
6 `! m/ H7 b. L6 P% \
2 ~7 r2 Y( {. a7 _; N2 k. F3 F/ }5 Z" l; Q1 ?2 T4 I4 k
2nd method similar to the preceding one but more difficult to detect:; S3 X6 K6 P* V8 K+ V+ ^
+ K5 L: J: v' t8 L. ?6 U' k: |
7 K1 |: w8 H% x$ k1 x# r; bint41handler PROC
2 h: u9 N; @1 ~. J mov cl,al
" t$ X) f0 N* H: @1 f L iret
8 Z: V/ n9 |/ b. K6 a7 A& O, |) _1 lint41handler ENDP
: X1 F: @8 j6 ~& r( c! C* X3 s) Z) v$ v) z
5 R" b' [- u$ y+ M/ n6 k
xor ax,ax
6 @/ `6 I( D( \9 E3 L9 J mov es,ax! y m+ ]( g5 _2 j+ s0 N
mov bx, cs6 K4 r$ W. {* {5 i
lea dx, int41handler$ x( P* J' G9 t# T6 O C
xchg dx, es:[41h*4]
$ U; s- R4 _, I* H xchg bx, es:[41h*4+2]
4 F2 k! r$ f% Y# \! k) x. C- ~ in al, 40h1 A! M% `+ O; X0 B
xor cx,cx
, O( E. l, V: `) k4 ? int 41h
+ E1 L& l. j3 J xchg dx, es:[41h*4]( ~! n1 G v' Q- C# A0 U
xchg bx, es:[41h*4+2]6 R9 d+ C/ u( m) Y. {5 g
cmp cl,al
: r. f( x/ M( e5 f6 W jnz SoftICE_detected
6 h( J+ E' F. E7 j. a& F- F5 O/ K/ H% [- }1 I3 \% K. {1 w. B
_________________________________________________________________________$ t Y: V8 k- H' v& _3 G) C
- S+ U# K. U. b P5 m3 t
Method 07
0 P& m/ l8 Q, H7 n; w& _/ e6 `8 I=========2 s+ _- [1 H, {0 {5 b
: g8 Z2 m$ g+ ^2 |: mMethod of detection of the WinICE handler in the int68h (V86)/ _4 k4 D$ l3 _2 j( F% u3 ]. {2 z
' _ W- q( R% D0 D& b9 j
mov ah,43h
1 V1 ?$ z9 w K9 v- e: r9 F! ` ~ int 68h* S& u; H9 z* d! g0 P# f
cmp ax,0F386h
' e4 I) [9 H6 T2 F+ e0 T jz SoftICE_Detected
3 l, b1 V, e6 H5 X
; q6 N4 {! D6 z, h' F
" C7 K5 H! `. y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
4 |$ y% ^2 ~7 q ^! X2 v5 V0 ^* ] app like this:! n: h6 V3 r- W+ N) a
2 |; F2 Z, `& ]7 V! q8 Q; |7 y BPX exec_int if ax==68* u1 @4 e6 x0 f% Y$ l. C& H" ~
(function called is located at byte ptr [ebp+1Dh] and client eip is
1 [- |3 i+ @" P6 b% C8 b located at [ebp+48h] for 32Bit apps)
" ]4 s8 y( o. r__________________________________________________________________________
0 s! q! J3 K) P2 m$ ]8 B
$ N- _) N4 x3 P! @# c4 x* w) E" W
Method 08( t# w0 z2 S6 ^" S' ?" h+ @3 U
=========+ Z0 i9 m& t/ S, e% ]. Q) m
% C2 i; Y9 V/ K0 M: r; g
It is not a method of detection of SoftICE but a possibility to crash the+ V5 F/ L Z p9 u2 i/ J
system by intercepting int 01h and int 03h and redirecting them to another+ z7 c, W- [0 x; E# T$ M& f# Y% P
routine.
; {) P4 e$ E6 D2 qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# j D# e+ j' v6 B
to the new routine to execute (hangs computer...)
, ]( q G% B5 X7 A/ ?
; k2 M( W) A& n" b( d2 I8 R mov ah, 25h" B) W0 e( Z# }& f0 O
mov al, Int_Number (01h or 03h)% F! f$ K' p- }
mov dx, offset New_Int_Routine: R. I [ F+ K, q% d! e
int 21h
# c# n) g f$ I% _3 `
( F! `9 Q5 I8 @__________________________________________________________________________
- j5 p; Z; m& S. U! n0 S- [$ }7 n N; ^
Method 09! f- d3 X4 m5 |* A7 z" m, C) U
=========
7 ?. l, `' h0 W+ o1 {9 W R c. ^" b; @/ G* Q; u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* A) l L! A/ ?. T3 z: D
performed in ring0 (VxD or a ring3 app using the VxdCall).. }' y$ r5 r' Y5 s; |8 J- M3 ?% s
The Get_DDB service is used to determine whether or not a VxD is installed7 _ r r; O0 N j! k
for the specified device and returns a Device Description Block (in ecx) for: v* m1 w- H# t \
that device if it is installed.
/ v, i- V z! W3 R: e' J+ ~8 S, o5 e9 A2 U+ `* j
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ m7 M# i' [8 q2 c/ M8 P$ L mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 X+ c8 D) I1 l
VMMCall Get_DDB
! q$ J% J* Z; w- C) Q- t- y" U mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: ~4 a; ^) G8 T" t4 ^/ t
& d$ Y9 `( N( i) M$ v. G9 D& b9 m" o1 D1 INote as well that you can easily detect this method with SoftICE:
# n; O' y: m- U, s+ g- u bpx Get_DDB if ax==0202 || ax==7a5fh
6 z1 s8 y4 W( A& M; Z3 o$ V
" B& _& C v( y7 F5 t__________________________________________________________________________: t2 z7 U9 j- J' h! C8 u2 Q
3 L. @* {- Z( u
Method 10
+ l- K/ V7 ]7 {, a, h. r=========4 Y! J- n+ x- K. Z' b
, R+ n8 ?' u' o- I6 i. x. t=>Disable or clear breakpoints before using this feature. DO NOT trace with2 O) m2 x' B+ P* I) P& S
SoftICE while the option is enable!!4 h; a7 I8 X2 f# A0 V& Z
# m/ U0 k6 q, \1 |This trick is very efficient:1 C0 u' @) W- L: W/ y6 T( Z
by checking the Debug Registers, you can detect if SoftICE is loaded
" s5 l8 g8 t+ [2 ]2 h! v" g) i" g(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( [4 w& U2 b3 |* `) Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their. q% \" M$ j3 t; M1 W
value (in ring0 only). Values can be manipulated and or changed as well- y+ I* J" J; t7 p; j0 T9 B
(clearing BPMs for instance) O% }/ v# G |
; b# u! c. a/ w+ G
__________________________________________________________________________. L6 J- C0 @9 ]) f/ a1 u
: q6 Y2 `6 q! k% H" }4 P i, N
Method 11/ H8 _1 }( M" T6 H$ ^4 K( ]
=========
6 `3 @' b. A, D$ l, y* \' D1 I: V" @
This method is most known as 'MeltICE' because it has been freely distributed9 }% u7 D" V0 Z% A u Y+ p# Y1 j
via www.winfiles.com. However it was first used by NuMega people to allow
6 |; x1 {( h7 C' ?$ eSymbol Loader to check if SoftICE was active or not (the code is located7 h2 Y* S9 ^6 v$ n6 \) t
inside nmtrans.dll)." _1 O; ]+ w6 y2 A9 K9 [0 J7 d0 u
- P/ x/ N* W3 o; \' ^& o5 ?The way it works is very simple:% D" C' \) ~! J) T% N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! N6 o* S6 X7 _9 q9 ^WinNT) with the CreateFileA API.
, K. z9 b. b. ~7 ~. \! U" v/ r6 R0 W, J& h( a% |) n
Here is a sample (checking for 'SICE'):0 C' S2 x( Y) i$ w1 X
& v1 S; V1 x" ~" Q; F1 ^1 i! Q
BOOL IsSoftIce95Loaded()
3 p: B. S0 U$ H{
/ j ]% t/ B. n HANDLE hFile; $ b- j- f; ]" k; |- ]0 K# p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; z# \5 q0 p# I4 v: @, M
FILE_SHARE_READ | FILE_SHARE_WRITE,
: N* S( v" |& \& N# P# v NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ F, A F9 Y# J3 l! _
if( hFile != INVALID_HANDLE_VALUE ); V9 q3 Q' Y6 W6 h( Z M6 U
{4 K' j0 m; d) L- i! Q+ u4 X6 o
CloseHandle(hFile);
9 k% W3 ~4 w# G q: _1 {" G return TRUE;
6 F8 J) e! k9 q9 F! I- \9 A4 f }: }0 H/ y+ G4 k% E; q
return FALSE;
% q+ H0 n- X+ k}9 k* F' G1 [# V' j Y
$ e0 o* J$ t( l9 {" Z; f9 I* ^- IAlthough this trick calls the CreateFileA function, don't even expect to be3 `9 Q! f5 E% q2 v5 B1 z4 y. |
able to intercept it by installing a IFS hook: it will not work, no way! N E# W6 g; l+ P! @$ m6 c
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ A R; r; z. w: z. d* K7 w
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 _. G! Z9 f0 H* Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: }6 \5 f* f7 I& @( b, `field.
2 u1 h) J& F/ K- R' n; @/ aIn fact, its purpose is not to load/unload VxDs but only to send a . }$ {$ `9 p/ \: o, ~ D+ n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 Z7 Y0 G7 `( a8 c9 m; [1 i: a, nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. Y8 }) N9 d/ p! i) H0 dto load/unload a non-dynamically loadable driver such as SoftICE ;-).; C$ j6 c5 B8 D( C; c
If the VxD is loaded, it will always clear eax and the Carry flag to allow3 ^( U4 G4 h A6 S$ g
its handle to be opened and then, will be detected.% ~' C6 n0 ]" f+ n: {- R
You can check that simply by hooking Winice.exe control proc entry point# L% c/ q# g6 C$ r- D
while running MeltICE.. c3 v, p' Q! k% C, E
5 e+ @& P V o* X. @% _
2 p, C, L, O( O$ C; t 00401067: push 00402025 ; \\.\SICE
/ T |0 n0 g* f* j) i3 q& v* g( S! @+ t 0040106C: call CreateFileA5 z+ `: Q6 ~; L
00401071: cmp eax,-0016 g# z3 M% N- ^ S( s) r5 E
00401074: je 00401091
+ O: T' H3 a- d' U2 U9 g7 M6 k g. b
: E, Z: y+ _. n8 l' S" D0 t
There could be hundreds of BPX you could use to detect this trick.
8 c u, @- H& y! q% y# u-The most classical one is:# M9 W: y. F: w' M6 Z8 }1 K9 l, W- k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||- P- P, h9 `2 X& H$ H3 x+ {' f
*(esp->4+4)=='NTIC'( C6 l# P' E/ I% v5 e4 j, x! D
/ R. K+ y% c( A# n+ G; i
-The most exotic ones (could be very slooooow :-(
/ o. h" K8 f& m; y) d& s BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* u5 r$ Q9 _9 P" t$ R2 \ ;will break 3 times :-(7 U0 G' d" Z7 M" q+ y& ~/ W- E
) ^2 K9 p1 R! m. P8 C
-or (a bit) faster: ( x" ?( @2 o) O& E% b4 G* p
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; o- }+ j" a. T2 }7 D
4 N% E$ N5 ]+ E; @, U5 L BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + y' L; n9 `+ n' p
;will break 3 times :-(
' `: c% @( b" j/ ^( c, g# }' k, w: Q$ j6 ~ u
-Much faster:
" D- a9 h5 S, }/ A' e BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* X7 F: q2 ]' q& Q9 F9 c: i2 S
& o3 w/ x, `: q$ K5 R
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 `4 H" J" K+ l$ K$ j, o* mfunction to do the same job:
0 D+ @7 V5 o+ B! w5 s, \- m+ m7 ^
* H: a0 b) K1 V) x" J) m% I+ F9 n push 00 ; OF_READ
0 M2 X( n" e7 X0 v( K2 Q mov eax,[00656634] ; '\\.\SICE',0
' @( G' `: e1 E% s0 ^ push eax
7 M' H& w' u9 y. `% \7 Q- |0 u call KERNEL32!_lopen( v4 } j @5 {" h
inc eax9 g s t) l8 t! V: s" [
jnz 00650589 ; detected# L8 F u0 D& y$ \2 x# g. o
push 00 ; OF_READ
, J" f& G1 \# U( P% [2 ^' Y mov eax,[00656638] ; '\\.\SICE'( `9 o5 J+ z0 e G6 D
push eax
2 x' v4 f4 J6 J1 [, b+ H- O call KERNEL32!_lopen" \4 c9 ^4 f3 }
inc eax- `6 ]! y! Y6 T8 U* X* T
jz 006505ae ; not detected( ~) B# ^2 I& S+ Z- ~2 J$ G
* |2 M2 [6 l& i% B
5 L) Q& S) ^) D8 `0 d( X__________________________________________________________________________
9 n; Z/ H/ Z: ], a3 E, {" t3 P' S, d" H/ Z" p% K- U4 A9 k" J
Method 12
- c7 q# g" r0 ^- N8 i=========
+ f7 O% r5 x; t: _4 t5 N) V
' N4 T& G; d0 P% d( ?% G; Y7 VThis trick is similar to int41h/4fh Debugger installation check (code 05( i; @5 j8 f8 v0 e. J4 P& c
& 06) but very limited because it's only available for Win95/98 (not NT)
9 i! O) ^* `5 Qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 Z! B9 F$ a4 T) i! `$ D
3 ]1 q7 c" G0 M" b8 E" `
push 0000004fh ; function 4fh
* `# H* }* G/ c$ p' N8 M" _ push 002a002ah ; high word specifies which VxD (VWIN32)
; y3 R0 G* d3 A" n ; low word specifies which service' J- Q% g: v* @* |3 E
(VWIN32_Int41Dispatch)
) B) F" L- z- I/ A/ J+ m! g4 ^; I call Kernel32!ORD_001 ; VxdCall
8 b) Y! H8 k- K# W cmp ax, 0f386h ; magic number returned by system debuggers
% s3 i; \6 {! `6 O jz SoftICE_detected% Q' ~( I ^2 L, O4 ^
, h. s3 |' C0 u
Here again, several ways to detect it:
Z$ f' c6 }; P3 B
- C! B- l# ^* h; B: ~# |# S0 ]! r BPINT 41 if ax==4f/ u4 Q+ d# r( o9 U7 m( J
7 W7 @$ o( r* I4 Q: k7 c
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 ~: ~- G( u7 ?& _/ W$ y# H. O% T Y9 ~( u7 e1 |
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
2 Q4 o- U; I1 s; b$ a% H: I: ]/ z) V* V0 G# @" L! F
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- N! A* S. E& ~! Y& Z* q0 [' V. p, ~ J
__________________________________________________________________________/ a2 V, \ k$ f+ F; h7 c* D
. W! F3 E, z1 g' b, c1 JMethod 133 u3 ]- T9 `: U. I
=========9 ]- D; D* b# R" }! S/ i& K
2 `. h9 G k% G$ b* DNot a real method of detection, but a good way to know if SoftICE is
, Q: n+ N# U5 b; Uinstalled on a computer and to locate its installation directory.# o( p4 B7 s. G6 x
It is used by few softs which access the following registry keys (usually #2) :8 v' x3 A3 I$ ]* G y
7 O7 h' J) B: J1 {3 y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 A' V, k) z9 u, U: o4 z8 Y\Uninstall\SoftICE. y6 K& o2 H. C0 I5 C: Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 N) ]2 c; X, i8 W; T: c3 C) A+ ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; j# N0 E% e" P9 Q: y: z
\App Paths\Loader32.Exe: ~6 |+ X1 w" t
$ F' X3 H1 R& ]! b
2 A9 I1 \/ v" N! O7 s) mNote that some nasty apps could then erase all files from SoftICE directory, g9 m$ S: D0 s4 B$ B5 O
(I faced that once :-( Q: U2 l& f6 ]0 b! g/ b4 E5 j
2 [" }. |3 R) G9 Z& f
Useful breakpoint to detect it:
# q" b4 I% R- T5 \9 y3 ]2 j
3 w/ n7 j$ V% W: K BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; X' F* }! D8 \
. h1 a1 L. e5 f0 N, |" D) A' G, ^7 `1 {__________________________________________________________________________
- q. ?9 c7 z0 H- A- Y9 Y
( [$ ] O C; o1 b0 Z
' w1 x- x5 V) \Method 14
! P9 H6 c* K' P& z: N=========4 C& Z! t( I l* F
" k0 X* M( o+ z6 V( f* hA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" m2 S' e3 Q! M' E) `- B
is to determines whether a debugger is running on your system (ring0 only).9 V) S% C4 n- G* ?6 m! H
( |- _" I% _0 t5 J VMMCall Test_Debug_Installed
& Q+ M0 J* E3 x5 Q, R je not_installed
5 l9 @/ U" {; Y$ V' a0 T* \) l" x* B; j' p* F/ F
This service just checks a flag.
+ D' x; s% w- f</PRE></TD></TR></TBODY></TABLE> |