<TABLE width=500>7 F" o+ h {$ r7 g& R+ E
<TBODY>
7 V2 k# d. o9 {9 Y* b) r, l<TR>6 \$ X1 Z; ~; b+ r6 G; t
<TD><PRE>Method 01
! E! T' i; q( l& h5 e0 ~ J8 T" @/ U=========& w7 M! B: h7 F6 c8 d1 F
3 ?2 l; ~4 Y; |3 ^. y
This method of detection of SoftICE (as well as the following one) is' \$ H1 D& b4 I
used by the majority of packers/encryptors found on Internet.
6 ]# ]# f; F- p! ^; WIt seeks the signature of BoundsChecker in SoftICE
- @' d5 n7 N, P1 s$ o. ~. J3 a/ u3 n. E2 s2 V k
mov ebp, 04243484Bh ; 'BCHK'
) X; K0 s0 x6 |1 d mov ax, 04h5 ?1 Z# l6 h! t l% c9 j- U T
int 3
% Y% Y8 d1 h( k1 L* k cmp al,45 E* @: |$ }0 B3 {$ q* E( b
jnz SoftICE_Detected
$ s) N% D( p3 W" P2 [- l* g( d6 [ O1 Y. ]
___________________________________________________________________________
3 {- p; {$ Q* L3 ~) ^3 P
1 Y/ [' q8 o3 {, ?6 iMethod 02
- i3 |" i* O$ \=========& {; U; F0 `& U
/ I, y4 ~- I% j/ r* F L% L! r0 r/ dStill a method very much used (perhaps the most frequent one). It is used
$ E; d ~- \% mto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: R: m! c1 p2 q, {% s: _9 Ror execute SoftICE commands...
( d6 j& P I5 t* XIt is also used to crash SoftICE and to force it to execute any commands" ]9 P% X. x+ ^1 e
(HBOOT...) :-(( 5 X: Q* b, {$ `: {1 L6 X
7 c* V8 {; X8 }& e
Here is a quick description:
) \3 X# G( J7 w( |8 [; |-AX = 0910h (Display string in SIce windows)
( B' A5 X& ~ S6 X5 _-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
O/ @$ E- B! }& s* d-AX = 0912h (Get breakpoint infos)
* w2 I' k; I, }# i-AX = 0913h (Set Sice breakpoints)
6 A/ h9 a# K5 A# p-AX = 0914h (Remove SIce breakoints)# v5 ~4 L: e9 O2 f% x8 j" ?
5 q2 Y$ N& Z& V. Q3 h+ H! cEach time you'll meet this trick, you'll see:
; \3 Q8 h, }/ t0 q-SI = 4647h$ `! b1 B5 i' @$ b) X" p% @ v! i
-DI = 4A4Dh
+ G4 F q/ T& [/ A1 e. XWhich are the 'magic values' used by SoftIce.
' O! N$ j9 p- w7 J) R4 gFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.. z0 j# ~! e _% F# t0 {
/ k+ u" o8 n3 g |# w0 Z/ |Here is one example from the file "Haspinst.exe" which is the dongle HASP
' f+ ?. A- D2 ?' YEnvelope utility use to protect DOS applications:; ], C/ S) M4 T$ @! m0 B
! s* a. @( r( k$ ^, q4 k+ b8 g
- k" e! N# z: Y7 V6 c4C19:0095 MOV AX,0911 ; execute command.
4 J) G% F. O0 @6 U9 y3 V, g4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: A; q! C$ S5 L
4C19:009A MOV SI,4647 ; 1st magic value.
y" d" W1 ?' `3 \4C19:009D MOV DI,4A4D ; 2nd magic value.! r" b: k5 m6 u( i9 N
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
( u8 _& v* {1 C: x" m" {4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" K& U3 K# u5 C0 j% }: ]2 c: A& p+ ^6 W% W4C19:00A4 INC CX
* Q8 L. g8 f3 T" B x( I% F4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& N" h9 ?% U+ s7 V4 e, P
4C19:00A8 JB 0095 ; 6 different commands.+ @' i- u! G- A: K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 L' `7 a( L E! W% _$ E4 {4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# Q3 L) c1 C4 j3 I/ ]$ n% |' m1 H
: [8 i# g( @' K, z2 gThe program will execute 6 different SIce commands located at ds:dx, which
6 j7 t8 n$ m0 S1 B+ { M7 U) Qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# W X4 V. h) G+ R
( R! l) W8 D) v2 J" I- [5 N* n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.. A7 b1 z ]. v( m& h# S
___________________________________________________________________________% Y7 \* O% r5 t% C! g+ }2 i4 m. J
) d: a h8 p' D) B" z; {
' Q: j' V7 t5 o
Method 03
3 m% r2 |8 X3 V, G6 m4 E O=========
, Q0 a: n/ y. H w% ? V6 F
5 k# I" q3 W- s8 A0 U- d" bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& R- w! f$ K# n$ I- g2 i1 {/ V
(API Get entry point)
, G& l9 }7 C6 ]7 D; ?
/ i6 g. e8 w8 c/ @! U% _2 C' T8 J% r* P
xor di,di
! L, V6 ]8 w. U mov es,di
' B; d4 |2 l5 @( { mov ax, 1684h
& x2 h9 ]& T1 J) Q5 H mov bx, 0202h ; VxD ID of winice
) J) E' u: B+ f z* u `# O int 2Fh6 I* M. D" V, H$ ?
mov ax, es ; ES:DI -> VxD API entry point
& {+ k% x0 @4 `* g \& r, V add ax, di) s7 [* U; C. o% S
test ax,ax/ Z. y1 s1 e% h5 I9 ?
jnz SoftICE_Detected
# \3 X, @2 V7 R) w( n: b$ Q/ S; N0 j
___________________________________________________________________________. N6 f, P( P/ Z
6 ^5 `% [/ h7 f. f0 sMethod 042 U5 G* h% K4 f% K+ n0 y- `5 ?
=========
7 Y7 D* ]1 U2 l! M: A* O m3 i8 d0 q+ V9 Z% x) h- k
Method identical to the preceding one except that it seeks the ID of SoftICE! h9 }1 E1 h7 B$ A9 x
GFX VxD.( {) l1 v7 G( Y. `, g
' N% b8 W! m7 }) |* c- l xor di,di
8 h9 P8 x$ M3 }8 t mov es,di' g Y# }0 ^; G! M; w
mov ax, 1684h " N* H8 I* Y3 y( o6 ~& t0 w P
mov bx, 7a5Fh ; VxD ID of SIWVID
# l) {5 l3 x: O1 d1 X! i int 2fh
3 V8 }7 U: \- N0 I- _6 z6 y mov ax, es ; ES:DI -> VxD API entry point
_& @1 h7 M, \9 g/ V8 ^$ ~& k$ f add ax, di5 q/ b; i! R6 ^' X& ~* j
test ax,ax
! B/ f! }9 ]+ F8 H* a& V jnz SoftICE_Detected
" b" j- ~* y0 w9 B+ n3 z" f
, x+ a6 C7 S# c9 n! X__________________________________________________________________________9 `9 _; k1 I; P7 b5 B. `/ P. L
, L8 G- }0 T* v$ a/ b9 L1 F* e
/ {. ^% a- B9 o1 N; o
Method 055 b3 l( x6 _2 [. t2 W- s# Z
=========
6 j( J) y7 f, }. G# C) k+ w
! [5 t# S) X% e% kMethod seeking the 'magic number' 0F386h returned (in ax) by all system
" q3 l( A# c/ g# L5 |; n1 E! adebugger. It calls the int 41h, function 4Fh.
9 r6 T8 P/ w% Q! VThere are several alternatives. 7 b2 E. H: F* v6 w" ^8 K1 `2 f [0 U
9 F9 N$ a+ y9 |. ~4 vThe following one is the simplest:7 i) [, _0 Z3 S* S) [& O; s
: w C$ u* Q! f7 o) b% {
mov ax,4fh
) J7 _& u @5 L$ |2 } int 41h; p% h( d! \0 }' \- C
cmp ax, 0F386# }& q/ {" I/ V
jz SoftICE_detected
. i8 g! ^$ R) D5 }7 w8 Z
8 y! h0 r; O1 |( { v
, u6 a- l) ]* q' iNext method as well as the following one are 2 examples from Stone's
% y ^/ l! M7 C e' O"stn-wid.zip" (www.cracking.net):
0 }: q# e2 k* C0 z0 ~
! u2 o& S- {+ v( _8 ^" W mov bx, cs
, F$ |; ~$ U q; P( G0 U lea dx, int41handler22 k4 Q0 L- ]# x% @# U# L$ k z( u: k
xchg dx, es:[41h*4]
- @& i8 S/ \; f) f3 b xchg bx, es:[41h*4+2]& j& d: c9 b8 B# ~- q% Y n( J
mov ax,4fh5 b% U( ^$ L9 y6 |1 z! W$ u
int 41h
- Z% _/ Q/ A+ q# i* U* l& ? xchg dx, es:[41h*4]( k; s" X- c; G: r
xchg bx, es:[41h*4+2]$ N0 r$ _6 M: _/ c# h" q
cmp ax, 0f386h1 c; N1 m* t3 c6 O
jz SoftICE_detected6 G4 r3 ], m: `" Y
! M+ C8 F' x2 [* n8 j2 Vint41handler2 PROC
- v) k+ k- o- z% R' { @ iret7 I3 f# M) f, U. @" ?; [
int41handler2 ENDP" V" N3 H2 B* d y3 y- ?
, D3 B1 @5 L* m
9 B" G( O5 g6 J3 d+ q% @; R# k; H_________________________________________________________________________
3 S6 b4 ^( J& z* P3 D) m; L# y1 E
. \ ^: n& q$ r( f8 j( D( `3 ]
$ E/ ]& W$ Z% }7 n' XMethod 06: D# J, w- N7 |6 N
=========
9 Y: v( Z- K4 O+ C! O; A" u/ Q% Z) s, R0 W3 t- Z. V5 O* G3 A9 F4 @
1 j) X2 l, D3 P6 a
2nd method similar to the preceding one but more difficult to detect:
N, |. ?9 x# @ s h1 E' G, U e. m3 q
: r' [6 _+ t% O: }
int41handler PROC3 G5 N& N z, I) J0 o& v, r; \/ E
mov cl,al
$ Q t9 |5 f* t; M0 r iret. f. X$ k2 {1 r0 Q% Z0 H1 F4 I
int41handler ENDP" i0 [3 Z; r( U# X$ i4 I6 R" y
# ~9 P8 f1 W5 G/ z
( l% X( V f5 W xor ax,ax
0 t) x% G o" K2 ~ mov es,ax
3 x% C u: j* s! ^& E" e: o7 B mov bx, cs9 b( _# Q+ n! {# I
lea dx, int41handler
$ o7 T* ?% l- D V xchg dx, es:[41h*4]
0 x6 d/ o) l, C- {! h xchg bx, es:[41h*4+2]! B' G3 |% e9 r9 @* }
in al, 40h
! d' d7 ~) v: o5 D+ x/ z xor cx,cx
# n R% O4 {+ L int 41h
3 c% Z1 n* ^3 u2 o9 t xchg dx, es:[41h*4]
! y" u: \( \! L9 r" }) P! h xchg bx, es:[41h*4+2]
+ y8 R* G0 C6 E cmp cl,al
2 A8 x; J: {7 g& E; h jnz SoftICE_detected% N& c. L6 M3 P, P0 d: ]
- ]$ O1 T1 P! ]: N' r/ u
_________________________________________________________________________6 C O# V; N d# y: z
- f* s2 a1 D3 A' L8 Z6 Q+ }Method 07, i& U8 }/ |2 t" u+ b) @, M
=========! ]8 k( k, J1 R5 o2 I1 I& m7 v0 }( b
, `( W/ ^5 D$ _8 a) y5 Z( D: O$ l
Method of detection of the WinICE handler in the int68h (V86)3 ~* W0 }* @5 w1 y
/ d, i$ B* x2 p1 w6 ~* h$ Q mov ah,43h- j5 ~) P8 p9 b/ `1 o
int 68h
: I. x+ ]1 K$ O3 P7 D: A cmp ax,0F386h, m, [7 v6 J# l2 s
jz SoftICE_Detected
) E+ }* {8 j4 A. p
! P, B! D: Q" P) r( D7 B9 F7 x1 B1 I; a6 @1 v7 J9 m! G: z8 P; t/ N
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 ^8 }$ n0 J4 R7 t0 Q
app like this:
2 J1 P" e6 F h2 ^! i# f, d- B$ j& d( F
5 v$ H) L3 q% x* o7 ^" ? BPX exec_int if ax==681 M, x" K) g1 R3 b o: m/ u Y
(function called is located at byte ptr [ebp+1Dh] and client eip is- M7 S; j: P# {$ Q! x9 V, X; Q
located at [ebp+48h] for 32Bit apps)9 ~5 _# A: B! E. s- i
__________________________________________________________________________2 }- G8 B. m) S8 Z$ R" [9 E
6 G: n/ x# b, {* C. h' j
: d; O( e6 z/ ]' G$ UMethod 08
8 L, ] }1 E8 T' W8 i5 @=========
0 {: b& E! O- j4 a$ G
/ C2 w' D. K/ T! d6 WIt is not a method of detection of SoftICE but a possibility to crash the
* ^ L+ K4 T* ^& Q3 V/ L5 c) A! nsystem by intercepting int 01h and int 03h and redirecting them to another9 i4 v, Y2 s5 e! X. o5 w# b
routine.
3 e7 [& E; P9 l; c* ^4 FIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
* x/ _* y k! ?( L R2 r; R$ ~) Bto the new routine to execute (hangs computer...)
* p5 G* N, D* T5 j0 G! V- s% `4 }% k }3 u% r3 q+ Q( ]
mov ah, 25h
, [6 J/ o0 n2 G2 L) h; [" b; H& a mov al, Int_Number (01h or 03h)
/ b g) @* o" q" S mov dx, offset New_Int_Routine
* Q/ k5 B7 l5 c0 J4 f, p K) E) K& T int 21h
i6 s* b& H7 r2 I$ \' w4 W# ]; T4 m
1 W. L% b' [- ~, J$ U' s: B; Q__________________________________________________________________________
0 X' L! V4 f) f1 | S/ \5 t1 ~7 i: c1 ^6 n* G. P1 B
Method 096 Y- |9 B. Z+ v* P$ q$ \
=========
, y) C- b, t6 n' v0 [
# w0 p7 O4 j6 ~ r9 Q; ~This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 G1 r: s% h& ]/ a( @
performed in ring0 (VxD or a ring3 app using the VxdCall).
1 V. d% c- O3 u. `The Get_DDB service is used to determine whether or not a VxD is installed4 E8 }' Q# I# G- \
for the specified device and returns a Device Description Block (in ecx) for
3 h% f6 F% B3 Y y3 _that device if it is installed.! q/ q) |# W, N: P5 @& D; b
% Z1 v% a: h; u9 `& H8 L
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( V$ O! C' P: a3 U- f1 K3 O8 e7 A# l mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
@& _8 F, X1 e2 x VMMCall Get_DDB; a( r& U7 o! V( M1 k; U. b9 r& g/ \
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
6 H$ j0 \( f) V J4 |
- W7 g, }# s6 o5 W" qNote as well that you can easily detect this method with SoftICE: z% H$ ?9 K& z ~7 y0 m
bpx Get_DDB if ax==0202 || ax==7a5fh/ W" I3 G" C3 J6 a! E0 w, ^* T
" K. |& L, L P+ B0 \__________________________________________________________________________
3 k3 Q: n( A# g% w8 S/ \! u# c. ]2 F$ a/ D* F' c. N7 u* z
Method 105 F+ S8 ^7 q1 g0 M. U* B
=========+ G/ t, t8 s4 j% G' u
# p5 a% ^# M) d2 F" |6 ~' I0 y: ^
=>Disable or clear breakpoints before using this feature. DO NOT trace with
. N4 J) d/ R; F% E SoftICE while the option is enable!!3 f; R, }; |2 {- n4 {5 \# z
9 K4 m0 G5 J4 ~2 T+ w+ I& NThis trick is very efficient:
; d& n6 d! G* j; Hby checking the Debug Registers, you can detect if SoftICE is loaded
4 \/ }6 p, @( g* m! h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( v$ F9 z& |, i/ g$ V" i' C; @there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 [0 K; ^" R( X1 c% @9 D& P4 Svalue (in ring0 only). Values can be manipulated and or changed as well! @# x- ?* r) i
(clearing BPMs for instance)
; q) V. Y4 l1 n- X0 O9 P6 O) l! b3 y c- U; a! m
__________________________________________________________________________9 D6 h6 X" q+ H: \- i
3 J% y( i3 J8 \0 _# Z- C1 B+ @
Method 11
/ \6 A$ T& T3 y" t=========
U+ j; y4 S, Z9 A3 n3 \
( g* @2 n- z( B* B6 e# ]/ L& UThis method is most known as 'MeltICE' because it has been freely distributed$ {5 Z z. q/ I( O/ Y. s5 h
via www.winfiles.com. However it was first used by NuMega people to allow- l) L* _* z; ~0 g2 w
Symbol Loader to check if SoftICE was active or not (the code is located
+ Q% p' x$ c0 \, s2 w# Einside nmtrans.dll).3 V1 v3 M6 m* P) H- q0 P" R
1 }* P$ U# o6 i# k* N% d" H
The way it works is very simple:0 x3 I: L' G3 [: ?, t' c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ E9 H4 Y& [& S) d. L% ?$ Y
WinNT) with the CreateFileA API.% B6 |" z- @& P& u
- w' ?& w$ Z: T; O8 N
Here is a sample (checking for 'SICE'):
# @3 ~/ G1 D; R7 G0 @5 }# N- } | B6 d f" p. P
BOOL IsSoftIce95Loaded()
) I* S u0 j" A5 n( `% A{
: _: ~6 C" B" ~, }9 [ HANDLE hFile; + k; R% p& h" [) ~& m. a$ H% j( Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: Q9 r5 ~4 K& {) K. O/ y, U) K6 S: _
FILE_SHARE_READ | FILE_SHARE_WRITE,& ? {6 M$ J- ]3 B5 s2 g' Q* e9 b- `
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ M& I7 E0 ^, k) b/ b
if( hFile != INVALID_HANDLE_VALUE ), ?5 w" k# L& v& x3 s% g4 [
{
w6 O! C( p$ W" T( }+ T0 y" i CloseHandle(hFile);: w. X6 S; E8 V
return TRUE;
7 k% e' d8 q2 U x$ t3 ?( I }
# |3 _9 Q5 `( w5 p8 i8 H return FALSE;! B* } f6 k" d/ ]
}
* O$ ]+ O- H U/ G8 S
+ S* @1 Y I( r8 A' E- iAlthough this trick calls the CreateFileA function, don't even expect to be" D0 {4 \7 }. T7 w
able to intercept it by installing a IFS hook: it will not work, no way!8 D" I, Y4 o, E# w7 N+ q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: |, g' \6 e% e/ Q. n, b2 `1 b
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
) L' R- Q8 Z* Pand then browse the DDB list until it find the VxD and its DDB_Control_Proc1 ^6 |' w+ N$ V! m0 `, B
field.( ?* i4 }, V4 x5 |) t
In fact, its purpose is not to load/unload VxDs but only to send a
0 D+ y" ^+ I8 V& Y/ HW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ I' ~, E. e, Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try
/ u3 x# A0 K+ @9 s. G! K" P; X4 hto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* p+ a* e4 b6 T3 V0 {4 d% ~/ NIf the VxD is loaded, it will always clear eax and the Carry flag to allow
7 ?% |/ \/ c- z4 K6 R7 d; fits handle to be opened and then, will be detected.
3 F8 e% k8 w4 {# |You can check that simply by hooking Winice.exe control proc entry point! s' T- I0 z5 Y0 C
while running MeltICE. g* J5 `9 ]) R# O
$ o z$ |8 e0 n. y% F0 X
+ q$ N ~3 C, h' y, ? 00401067: push 00402025 ; \\.\SICE3 F- l$ t! M* N9 s
0040106C: call CreateFileA* f% n0 {; X! W" n
00401071: cmp eax,-0015 g5 P: h' D: x
00401074: je 00401091: m3 _, ?6 u$ B0 ^; c
2 J8 e5 Z1 Q7 Y9 Y
9 {( y% _+ |* u5 x- R) E7 WThere could be hundreds of BPX you could use to detect this trick.9 v* v! V0 \1 V! F# x2 P5 C4 O
-The most classical one is:3 ^% C8 S; S2 G" d6 o$ e+ {
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- c0 W; \& V8 O2 y. e *(esp->4+4)=='NTIC'7 B5 e, K% m% r5 Y8 m
" F! B* k+ ?. v* f6 T-The most exotic ones (could be very slooooow :-(
) l) c4 P1 m: y- e0 ^+ v! u9 |0 Y BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : c2 U. n# S+ r3 x' T
;will break 3 times :-(
' B! [! q* R0 v9 N" G
2 V3 [3 B. Z+ M-or (a bit) faster:
, M% N* S& Z4 L& s BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) O; Z6 n& A3 X
& Y6 F4 S/ [0 Q5 V1 x# X! @ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, Y+ [# G$ M) l ;will break 3 times :-(
8 X, l' Z/ P/ b' N/ _$ v# e4 c; I0 k% k: h9 w) K* t
-Much faster:
4 l& N, Y8 `: P$ J/ F: L BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- _: T0 H9 \% x% S
6 z" d5 K& `. w$ c9 j- [/ DNote also that some programs (like AZPR3.00) use de old 16-bit _lopen3 k9 _8 I5 d6 n
function to do the same job:
7 r/ ^+ Z# [, o' r! e5 ~' I$ o8 `% J7 O% l4 Q3 d8 L) A' e0 B. _- d
push 00 ; OF_READ
# `- F, a) w+ I+ P2 ? mov eax,[00656634] ; '\\.\SICE',0
* X* f; @4 W& I9 d& ^9 P# f" o push eax5 D+ }; }! k" `
call KERNEL32!_lopen2 e# X* ?" X8 _8 z6 Z, }
inc eax
& z1 [+ F' G+ `# b jnz 00650589 ; detected
9 L+ v/ C; ?' H* K9 q8 @ push 00 ; OF_READ" f4 O! m8 G2 r0 x. ?
mov eax,[00656638] ; '\\.\SICE'" j3 t N# z/ [( ?1 ]
push eax
7 o# B6 X1 h9 V( T$ u/ {$ R8 t call KERNEL32!_lopen: J& m8 J: ]% [- Y0 q# @- l
inc eax
" Z) }/ q& P2 R jz 006505ae ; not detected
" V+ t" ?3 T6 m' g; [) s& ]" _
6 P: z& d* r7 s8 y3 V5 G3 h+ I0 }' }
__________________________________________________________________________( R. R* I6 B& X# t
( h9 ?! I) r/ l- r
Method 12
4 y( R( x6 W# s: r8 i- s$ {! y7 B3 q=========
/ _5 O+ g0 i3 _/ h x+ X( R$ r+ | j) c- Y. V2 r) w/ X( U$ m
This trick is similar to int41h/4fh Debugger installation check (code 05' o% q! S. f! y. T5 J$ K J
& 06) but very limited because it's only available for Win95/98 (not NT)
9 d) C- x& Q, J- [ H/ Z: ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' O% W1 j: _6 B; x# j# z7 H
! ^' G% `( N* m- z, ^ push 0000004fh ; function 4fh- k j; e0 Q4 ]1 C, O) O% y
push 002a002ah ; high word specifies which VxD (VWIN32)
3 P$ ^2 e) \0 S8 r# j ; low word specifies which service
3 D" Z3 l+ i) J8 u3 J (VWIN32_Int41Dispatch)
* k! w, X- b4 E7 S! g call Kernel32!ORD_001 ; VxdCall
& d# ^5 H4 v3 k+ m cmp ax, 0f386h ; magic number returned by system debuggers
$ x! S6 D& I Q* _7 a5 V* D jz SoftICE_detected
+ y8 I1 g# z" }0 z' g8 v0 i0 t# H" [/ \9 m
Here again, several ways to detect it:5 C3 d* ]7 s; a# @
8 J# _3 \" B- a4 D, _) ? S
BPINT 41 if ax==4f
8 X$ L0 l2 X' C4 i- n1 `$ k
& H( S: r) I" c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 T/ a$ O: |" h. a% y3 y* c
, {* f8 j T+ ^8 p- \
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: a2 t5 C9 v, C
7 z: g$ N- r2 _5 |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!# n( d$ a' M! f) K4 B6 g! i
0 f7 p/ I* W2 q7 a/ g. z/ I* }
__________________________________________________________________________
4 y" `, `) ^. }$ L+ |
4 l" Z, h$ d* ]2 [Method 13
5 l7 Y" c( O3 P X=========* u$ h2 z8 M0 K# W# I
6 A: T) o" |- i+ hNot a real method of detection, but a good way to know if SoftICE is' R# e l: Q3 M6 b8 t1 {
installed on a computer and to locate its installation directory.
3 f# r9 ]0 P8 x1 S5 m! s2 x2 }. s. PIt is used by few softs which access the following registry keys (usually #2) :
9 Q% [0 n- k! [/ a& w# o
, J( D* `' X9 X' r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 V( s' z/ y {7 i# @! {\Uninstall\SoftICE
1 F( a+ }2 ~- j" t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( T R) q8 L m0 B( s5 e& C-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. i3 a4 ? @3 u, I: {. L6 Q\App Paths\Loader32.Exe
5 F0 D- v' j/ K* }0 J) y$ D2 U* ?) X, c! |) l
, o" {' N) N! j0 p$ hNote that some nasty apps could then erase all files from SoftICE directory' _+ V0 K6 W9 j) D1 J7 M( T7 a
(I faced that once :-(
5 `( ~1 |, r; P# u' F/ T% Z% Y- |' @
: r, e/ l- f# d" O8 e3 {& X: PUseful breakpoint to detect it:+ u3 v- `$ D0 p( @# X' r
A0 X( i- b' ]- ]1 J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 N0 }* U5 [) g- E' M+ j9 u6 y
6 @$ }, d8 P) n! @. Q, n# j6 e
__________________________________________________________________________3 S$ ^) B$ t. a7 _) b
5 s# n. M( z$ E* S/ }3 P1 l8 N
Method 14
- e8 K- G6 p e, X' Z0 `: f=========
1 v4 t8 _" J: A/ q, Q: X
2 `$ Y; C# f7 s [ xA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, W0 M) Z0 k0 e$ ois to determines whether a debugger is running on your system (ring0 only).: p- g7 W+ l" V/ v/ B/ C. s$ G
, R# X$ L, m) ^8 Q
VMMCall Test_Debug_Installed! @2 v% x0 Q: r: n: L, P0 ~( |
je not_installed
- }( X( `1 W/ v6 U) J. @/ D5 x+ ~1 }
This service just checks a flag.
2 m0 c7 C+ P) S+ k% u6 D5 L</PRE></TD></TR></TBODY></TABLE> |