<TABLE width=500>; `1 G. J I0 J" l* C4 d
<TBODY>' I) z/ d- L" N0 s% Q
<TR>
$ Y2 g) l, I4 v& `4 m. H' K+ U: Z( R<TD><PRE>Method 01 6 G: A$ ^! \- G) U. q4 w
=========
8 g* o9 K. C& ]' k, s% A( w
8 M+ d! [& l& x% j- @( ]7 H) U9 {This method of detection of SoftICE (as well as the following one) is
. ^3 G: r( A" U# o, E v! ^used by the majority of packers/encryptors found on Internet.6 G9 ]8 M4 k* S* s+ N$ B* [4 I8 E
It seeks the signature of BoundsChecker in SoftICE
9 f, `- Z& k8 O# A1 f9 A
' k' O2 @! ]( }/ B/ a" [& [ mov ebp, 04243484Bh ; 'BCHK'
" o; o. o8 j7 S mov ax, 04h
8 c- S8 }1 @# G. m int 3
! }7 [& w9 a2 _* e: I' ]% { cmp al,4- Z& V# N9 B6 A$ l3 t& U j
jnz SoftICE_Detected' Z4 a) i& w! r. ^+ ~8 h. z6 q, B
! `" V4 t6 u2 D+ c
___________________________________________________________________________
3 V. t' p: A0 d2 l0 v+ C( z ^$ N3 M! t: j: J
Method 02# W8 \# e: S8 \& O' X" A
=========
" r* Q. u2 i s/ P6 N' r6 H5 d; }9 e) m
; m# W+ {& q5 G9 }# j: L" \" TStill a method very much used (perhaps the most frequent one). It is used! |' V" b6 D0 t0 }6 H* ]: S) M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' S4 u* f% {& ]- B$ F2 v. t
or execute SoftICE commands...0 L7 o) n0 H1 @# B
It is also used to crash SoftICE and to force it to execute any commands
7 p% M2 }2 [) z0 W* K(HBOOT...) :-((
1 B' b8 F/ G0 j$ O1 F' Y8 c. P! [, o V! D4 O1 s# W% |; N& e2 f4 c
Here is a quick description:- W* u1 ^, `" D
-AX = 0910h (Display string in SIce windows)7 Q# R" @# ?& U! ]% E* A
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! t# [5 o- `6 l4 [' p/ Y( U6 `
-AX = 0912h (Get breakpoint infos)7 F' y$ J! d* W O4 T9 @! t
-AX = 0913h (Set Sice breakpoints)
{/ I. K/ I% Y5 n0 G" O-AX = 0914h (Remove SIce breakoints)# i+ O$ |' \ t
) K: d& f+ }5 x# W. _! v. ~
Each time you'll meet this trick, you'll see:
h% h1 v; h3 L) y2 D-SI = 4647h. E( D/ t8 e# x% g0 z
-DI = 4A4Dh
p) H r) L2 E M. i6 N3 A% oWhich are the 'magic values' used by SoftIce.
4 Y1 S7 F& Z$ D: ?0 N' fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
+ Z. }0 l! s% d7 E: [) j
9 |+ n% N1 C5 ]/ R; \; g0 uHere is one example from the file "Haspinst.exe" which is the dongle HASP
- ^% W- h( t8 B4 ?Envelope utility use to protect DOS applications:
2 E! Q& [$ b* U* e& T7 y! F. z9 P0 Z% ^5 E
1 D7 b2 j' y7 \4C19:0095 MOV AX,0911 ; execute command.
P/ q/ I# f) F" a4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
' G& |% ^6 Q) f; S* D$ c& m4C19:009A MOV SI,4647 ; 1st magic value.
* X& J5 P P" |) Z4C19:009D MOV DI,4A4D ; 2nd magic value." S' e( A0 H6 T6 }* P7 v
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; t+ D& T1 E/ u2 m+ f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute" u5 O. r! r c0 p* k0 y& D
4C19:00A4 INC CX
7 A; X+ t9 @/ s( Q( i# k4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* @+ ^ U" s5 H4 \. b3 e2 X, ^
4C19:00A8 JB 0095 ; 6 different commands.0 ?! t( v f2 B6 @5 j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 k" x8 H+ e: y& I4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( H0 X. H# O, n0 E( f* h' d
# r6 \4 }2 ^+ }* zThe program will execute 6 different SIce commands located at ds:dx, which% b4 O' H# Q2 V$ F4 j
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 }8 S7 l4 ~! k7 ~
* y6 x/ W( v$ U6 m9 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 o8 A! h/ x' N- q# h7 t0 }
___________________________________________________________________________
/ S ]1 {, x. Z+ J$ f
6 L* n) \0 o' }$ l
0 P- U! u9 ]! M* y1 K0 IMethod 03/ P9 S! L- t7 |. U3 @1 I/ y
=========+ K+ l. b" x7 s" G6 h# v) f" P
3 q# q0 g; k5 O4 u8 ]) v" |' u5 j
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# G/ V! X) V% v W(API Get entry point)
' g9 ^, g' a5 g
7 m. c# `/ H5 o6 q
: V2 O% j! n% V& ~2 v$ E& I xor di,di
# G% Y1 P" \$ u+ @7 K/ c" K mov es,di
9 N6 r C: Z, f+ N8 D- R9 L mov ax, 1684h
1 `9 O& s0 P( p mov bx, 0202h ; VxD ID of winice
1 [7 P- E" C8 z* n/ M int 2Fh
( I4 ^2 W' f$ }+ U# { mov ax, es ; ES:DI -> VxD API entry point
, [) J, ~0 ?+ P0 S add ax, di3 g* v+ W4 T7 i( G2 {
test ax,ax/ U0 W* h4 t+ Z/ N3 s
jnz SoftICE_Detected
6 S; v' E! n( M* A" p! P
+ y/ M7 `; y3 F' A. f___________________________________________________________________________0 v% R& O, D ]" h+ l
4 `% g1 ?! J- A( s3 ^Method 04) g6 ]; a5 @- P! v( }3 d
========= E. N1 h6 u* q
/ V) @+ J$ }) tMethod identical to the preceding one except that it seeks the ID of SoftICE8 N! }1 z4 d, @* n: T
GFX VxD.5 f1 N) y- J5 p0 Q5 B
7 g% h0 y& h: x3 }' l xor di,di) n/ Y3 U: X1 V# N0 e8 F* m+ M1 e% i
mov es,di# X! M* c" M/ U' {; J( U
mov ax, 1684h
D. z0 e( S4 N mov bx, 7a5Fh ; VxD ID of SIWVID
1 o7 G. }$ c$ P+ a6 v int 2fh
$ f7 p, Y" ?. B9 a# m mov ax, es ; ES:DI -> VxD API entry point4 Q H/ L/ N ^$ _
add ax, di
1 m! E- j* G& w6 b test ax,ax- t; V9 O" u$ q7 `, k c" S+ L& \
jnz SoftICE_Detected
. |* I$ c/ {5 h: j F' ?7 N+ \- W- \) x2 X/ s2 a5 x7 {
__________________________________________________________________________
) {+ r; m; ~1 @ s n- T$ O8 Y2 b+ F7 }+ O4 G- t$ O
2 ]# l5 V' u. a% V
Method 05 U% o; Y. }9 v, o! m. d
=========
& A# G/ X( E4 \7 R1 U5 {( S. m
) Q' g7 e) R9 W3 }$ \Method seeking the 'magic number' 0F386h returned (in ax) by all system; D/ w- J1 Y1 ~" f: I5 z
debugger. It calls the int 41h, function 4Fh.9 \+ n; ?* X& A! [
There are several alternatives. 8 Z+ B: w: J9 i% i4 g/ \
G& l7 \' }$ h* {& P4 vThe following one is the simplest:1 ^9 `$ L3 B8 Y; }. f( ]
9 i8 m7 k! C" a8 n) g! H mov ax,4fh
% m* l6 s1 W* ]% V" q" v" ? int 41h
9 k, c5 Y* ]# s( V$ \! u$ s* j' r cmp ax, 0F3865 u6 ?- E3 J3 s
jz SoftICE_detected
: X: j! q2 d2 u+ B' j6 u/ Y5 x v- e+ c. J0 J
+ \# O: I8 }' L X( U
Next method as well as the following one are 2 examples from Stone's / f7 j* C6 [2 P/ O: ?$ S( [7 `& o8 k
"stn-wid.zip" (www.cracking.net):3 i: ]7 p: I6 O/ E, O! F
0 d6 ]6 z* q) [" E; n mov bx, cs: d0 k- n9 s2 ~% B
lea dx, int41handler2
! c6 X# b, i/ Y% k* b" e xchg dx, es:[41h*4]
8 u. \/ E- w: j9 E$ x: D xchg bx, es:[41h*4+2]
7 N. ~6 [: G. D1 [2 ]: W mov ax,4fh$ j7 f5 C% E9 J. N/ V
int 41h8 A5 L, F0 l; Q9 [& B2 Y) D5 f
xchg dx, es:[41h*4]
. i3 {0 c3 B/ d" z7 p xchg bx, es:[41h*4+2]; e6 l9 T2 T8 R7 n
cmp ax, 0f386h; }9 v) W" w+ [3 k* p/ ^
jz SoftICE_detected
2 n* K% }6 @2 l/ g* P: l3 v4 F! E+ k% N ]6 o
int41handler2 PROC2 Y8 K1 ~; b0 }' J+ H, d
iret7 w; O7 w) `7 h4 {5 C9 S3 a/ l0 y
int41handler2 ENDP1 ?* ]7 h4 |1 \7 n% U
' X2 E" V2 C) K% [# d# v) M9 {; U
1 o- v+ Z, N! [( S
_________________________________________________________________________
9 T& }$ s- N5 i9 a: H' J l5 u$ z0 m' m; M @ E% `
; h1 H5 h; Q4 V$ lMethod 06
; X0 H0 E. j C% f=========0 z+ S4 x ?5 L2 O
- H) u; H! |% y
. Y2 t5 ]. H: t3 Q# z: v, |( o2nd method similar to the preceding one but more difficult to detect:
2 |; D2 N' K% v" t, q: D
3 x# Z. k( A. J& g/ K) n+ e- ~6 S* h$ g8 D' H+ K
int41handler PROC
& n3 S1 {0 N* r& S! t. g* {) R mov cl,al
0 }% W% f6 U) T8 q+ Y D! T iret
( J) c1 O' F* ]int41handler ENDP
6 }+ `5 k; Y' h c7 t: m1 b; J! r0 |& X- X
! Y3 t- w6 I) B' j. n! B xor ax,ax
9 M6 L8 t) C7 U7 u mov es,ax, `* L5 @2 W' e" C+ }2 ]
mov bx, cs6 W" v# f* n+ _, }. t$ A8 y
lea dx, int41handler. v9 r4 n6 q4 j \$ m* K# ]
xchg dx, es:[41h*4]
( u( P9 m: Y; m) l# C3 M xchg bx, es:[41h*4+2]9 H& t# C. ~1 g+ W" Q) v$ P% m
in al, 40h& G6 e* C' f& U0 e; k
xor cx,cx
4 H+ W" s0 Y4 C# H" Q8 S int 41h9 m2 ]0 i# t* l# a; C6 d
xchg dx, es:[41h*4]
B; M1 j, M( I; y$ y5 z# { xchg bx, es:[41h*4+2]% w* z: C6 Y& @0 M7 l
cmp cl,al2 V8 H6 ^- h/ u: y
jnz SoftICE_detected
0 E3 H( w" B/ m4 v/ w0 J, m8 b& M) \( k6 [5 O2 x4 D
_________________________________________________________________________
0 }$ J5 q2 N o7 B
1 g* u% l7 N4 O OMethod 07; \2 }! f: Y, r7 A" F2 B7 q! v
=========7 G8 N/ }4 b) N; M, k5 i
1 l A6 b# G* A% G! t$ R( a: D
Method of detection of the WinICE handler in the int68h (V86)% E9 D& d: r( g1 Y
0 S( k% H& i7 D9 \9 D
mov ah,43h
1 x! k" p& y+ e1 Y O q7 [8 \ int 68h
/ }6 r3 g0 x6 t4 T) }7 T0 Q cmp ax,0F386h
/ z( z6 `, G# \ jz SoftICE_Detected
% C) ~6 |. t! m2 T3 ?: j/ T" i" S$ E [0 ]# {9 Q5 o
8 A2 @- j6 G' V) Q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 G' q5 u/ _- X8 N0 v2 i
app like this:
; Q! K! R# c5 J1 _/ p6 Z# K$ p) I1 A7 ?7 t9 V" g* e
BPX exec_int if ax==68
2 m2 `7 _0 [9 Y5 r, a (function called is located at byte ptr [ebp+1Dh] and client eip is
7 B0 v. S! p' s located at [ebp+48h] for 32Bit apps)& h( k Q' C0 b+ f
__________________________________________________________________________
e; J* k' f8 U8 k6 ?4 _* B% _+ ]: z
* z3 O2 K" n% J# o0 m" X/ BMethod 08
/ M% `5 o+ A: K$ l ~( Z=========3 Q- m/ z6 T, W, f
" i; P" N: G9 H7 T
It is not a method of detection of SoftICE but a possibility to crash the
) h+ E: b1 g9 U4 d, s0 O$ Osystem by intercepting int 01h and int 03h and redirecting them to another# ^' M8 c1 P6 x2 P+ d$ e. o
routine.
6 k( @$ J' c# U3 H* n, GIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 Z* O, n4 g: @) r* A6 V G
to the new routine to execute (hangs computer...)
l5 |6 l; R; K8 z+ z
2 \" R ?0 }2 g& R( h mov ah, 25h3 W9 H! H0 r& O. h6 m/ q. Q3 O8 d3 z
mov al, Int_Number (01h or 03h)
8 Q- ^- G: ^0 {0 a3 R( e mov dx, offset New_Int_Routine+ O' |1 }% L W! B' o: `5 Z
int 21h
) g. _2 P2 j- u8 u' K5 @1 c& A1 a% j/ P' i* H
__________________________________________________________________________
5 h& w% L, w1 _: q2 @9 u" C, p2 M2 ~/ N3 w
Method 09, u3 X3 Z# R8 ^6 J
=========
% I- U* Y( c1 V" y
# [; N5 t" [# Z- MThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 \6 X; A6 X, A. V" \+ Z
performed in ring0 (VxD or a ring3 app using the VxdCall).
: I1 O+ ^/ B. q, }The Get_DDB service is used to determine whether or not a VxD is installed
) o" H1 t0 Q0 g2 Dfor the specified device and returns a Device Description Block (in ecx) for
6 d$ W# U& e; g( \( Tthat device if it is installed.& V1 }, i5 H8 G& h7 U7 s
& H9 r! m) H2 S; N7 S
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& r$ R9 y( U6 h0 @ \: ^ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 E+ x2 A9 |# I2 P& `* N- d0 _9 J& Y VMMCall Get_DDB/ A: S+ I# Y5 |8 D
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
K$ c; S/ Z) X$ V7 Z
_7 y1 a" r) C; O+ ]$ D' |7 Q$ NNote as well that you can easily detect this method with SoftICE:1 p! U7 L7 U* j; R/ O* A, \3 T
bpx Get_DDB if ax==0202 || ax==7a5fh# L& |. P% \3 a
& b2 s7 e9 v5 V8 t3 @__________________________________________________________________________
% N7 B! x. X- `6 c- S
0 L1 N: m+ ~8 d1 U; ?Method 10$ E3 ^% L$ y) x& m0 f. M. |
=========" u' G) d: p/ S! c1 @+ e, E/ v, J
9 y; w; _4 z! ~" U( b/ ~=>Disable or clear breakpoints before using this feature. DO NOT trace with
* @: w$ _/ k: r, \ SoftICE while the option is enable!!; H$ ^, V' W( _* o' [ m% Z" V6 v
" V7 }7 z: P. yThis trick is very efficient:
1 ]2 _+ R& g! M0 ` z$ gby checking the Debug Registers, you can detect if SoftICE is loaded
, t' U! W% h3 @ B5 j3 f(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! ^' f# j5 k0 A9 Q, |/ Kthere are some memory breakpoints set (dr0 to dr3) simply by reading their
4 ]& k% M# z% \- u4 @1 avalue (in ring0 only). Values can be manipulated and or changed as well' ?- ?. G( Y, l/ W" |7 s- Y
(clearing BPMs for instance)
& o# G' j2 \# E& \) Q4 G9 `8 g- F+ _1 |3 n, t
__________________________________________________________________________
3 j6 V% s0 n: q, v' P! W% |, i9 b. k: y# y1 }4 u7 t5 k; d! R
Method 111 r" U1 T% D" y+ y3 g9 h: U
=========: G) z0 n3 J8 g/ C
2 {! D* ~) ~' X' N% L& CThis method is most known as 'MeltICE' because it has been freely distributed5 V1 X# g# C: s
via www.winfiles.com. However it was first used by NuMega people to allow# { V7 d8 @7 B' C* C
Symbol Loader to check if SoftICE was active or not (the code is located- b! a! ~: ]' C1 n
inside nmtrans.dll).
, Z. I7 Q7 d c3 s9 n! W
: q' L5 X k" G( Q' vThe way it works is very simple:( ~ @; n2 I- z# y3 u6 k8 B
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' x2 N$ @2 ?. M, T5 S4 ^7 R2 FWinNT) with the CreateFileA API.9 H8 E. D4 G% ^0 o! A1 g
: b& ~- a9 y' Q6 n3 ^9 r0 mHere is a sample (checking for 'SICE'):/ z. K! h* f: @
) X8 M$ I4 x6 J% a) G& W) R) E1 lBOOL IsSoftIce95Loaded()
/ }0 k+ ]3 d$ d{ P9 A) y' k) K
HANDLE hFile; 4 @8 M1 P9 g, K6 @* q; o; c+ y
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 m) m8 u6 D2 ~+ F
FILE_SHARE_READ | FILE_SHARE_WRITE,9 D* q; |9 e! S" I9 u+ a6 ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);) B8 F7 C# U- `- O- k( r5 v
if( hFile != INVALID_HANDLE_VALUE )
" Z% o( u/ S$ V6 d- O+ }3 H3 ] {/ h( B0 u9 ~' k; _, j$ Q1 I* l
CloseHandle(hFile);
) l4 q- ?5 c1 @* | s. _8 | return TRUE;
1 E* p$ R5 D0 c5 C }$ B9 r, O* E. d) I" I) l$ U/ |3 T
return FALSE;
- M+ I' H, n. g7 Q1 N}
8 K! ]1 { V7 x+ `# ?" f
4 W) {$ C' }2 \% ?- \, K* C/ pAlthough this trick calls the CreateFileA function, don't even expect to be
( u& L" k# b$ N& H& E! C4 Q& s9 ^able to intercept it by installing a IFS hook: it will not work, no way!
5 E# j: Z1 ]4 ~3 G0 }5 X% z* @In fact, after the call to CreateFileA it will get through VWIN32 0x001F- E, C, Q [/ S; R- ?/ p! d
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 k% q: d3 K. ]) B+ ~ X$ j" v( z
and then browse the DDB list until it find the VxD and its DDB_Control_Proc) D" w b3 ~4 s9 i/ M( g
field.
; z7 F" ^4 l' u; cIn fact, its purpose is not to load/unload VxDs but only to send a
2 _8 f; n0 D" S. {* m/ zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& M% \# v9 O+ V
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ w6 F# g$ S: d4 ^. `
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ g% j V( O9 y, Y% m: M AIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% {" j* C& |+ N4 _: G7 `its handle to be opened and then, will be detected., v6 x3 ?- Z( A/ q- n
You can check that simply by hooking Winice.exe control proc entry point, k1 |# f7 u! j+ V
while running MeltICE.
2 _& Z+ ]% [/ Q# @3 b4 h6 V9 P; O2 }" ?7 N
, _' G6 N8 i$ j- C$ F9 B( [ 00401067: push 00402025 ; \\.\SICE6 n# t( E5 R& _3 H0 \
0040106C: call CreateFileA
$ X9 n$ B1 `! v3 i X 00401071: cmp eax,-001
# k1 F* ]$ l8 e! t5 F$ a 00401074: je 00401091+ q) b9 k; W' I8 R; @' T' S6 t9 N
8 o: i+ e0 N+ d3 P% h6 D( M, {
' V: t. h6 M% G/ U" K
There could be hundreds of BPX you could use to detect this trick.. d3 j3 _: m( W
-The most classical one is:
! L3 _ f* D( {9 l+ b5 |& R BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- `# F% F! R$ I *(esp->4+4)=='NTIC'* n6 h" `: F3 ?$ i5 J8 Z8 M# w
Z9 d, B9 [. _+ j. B
-The most exotic ones (could be very slooooow :-(4 t0 \$ [, P7 p3 d5 I# L
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') , a# r: e( e# k) Z6 |6 p/ c
;will break 3 times :-(& ~! J# ?5 I0 N A7 l- A W! i: Q
% m5 ]" J' r4 O
-or (a bit) faster:
- X" J8 y5 g( C8 i9 h* o6 q BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
: }# y7 o7 r. ?, f6 l
2 E; _* t* |! ~4 a) N BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 E% |% C- T3 ~3 r8 p* o, z ;will break 3 times :-(
( ^$ m% ~. c1 l6 Y2 {' z
: B L6 d, ~4 B7 A$ j-Much faster:; @! B* Q6 w- t( q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'5 @, B" b' p" ^% ~; _
0 K5 C. r& q0 ]. s6 X) TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen# C. s/ r" }" L% f+ F% U' t
function to do the same job:
% e& i7 }/ [# P4 C6 X
8 T! e9 k3 _* t, f7 C$ Z8 V push 00 ; OF_READ
! g, Y1 ?) U' e# ]4 ~ mov eax,[00656634] ; '\\.\SICE',03 @2 m, l/ W2 f4 ?
push eax/ B9 N- ~0 d2 u8 |) C/ x
call KERNEL32!_lopen
% ]/ ]# N& b$ s0 F% Y# C0 m+ W' A inc eax: Y0 [6 X9 R; v3 ]$ O! d
jnz 00650589 ; detected
! r+ w$ r) v/ H+ ? Q! D2 L push 00 ; OF_READ& M- q5 w- {: s k1 G( _
mov eax,[00656638] ; '\\.\SICE'. O( `: Y" X) [, n7 H5 c$ |
push eax
5 a8 C" N+ o( i' H! ?; |9 Y, A/ T call KERNEL32!_lopen' ]/ b Q+ ?2 q
inc eax
) _$ H; z c% E! @; p! k jz 006505ae ; not detected5 m6 _! ]; N/ c
" h8 X! `7 g" w) s+ J0 h: j8 I- r' r9 P4 r; a) o% v" Y b0 _
__________________________________________________________________________. R7 f: o$ f4 n( h0 X
. S, d% m( l: l5 s) o8 u
Method 12
) `/ r, q/ U2 v8 B=========
: {7 P' e- i2 Y! a4 |1 H4 E
% T# M5 C# R& ^% R' Q( ^6 u' eThis trick is similar to int41h/4fh Debugger installation check (code 05
+ @, g6 B% ?: x0 `& 06) but very limited because it's only available for Win95/98 (not NT)
6 d# I) h8 ?9 C! M, y& Ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 W. g% z+ Z; h# S
4 A' \5 X, u# a/ ~# o push 0000004fh ; function 4fh
3 \5 M1 S4 }2 e$ v- t7 D& M3 D push 002a002ah ; high word specifies which VxD (VWIN32)/ C) H' N. z% j' r# ?$ b
; low word specifies which service- l0 @0 ^3 X4 a: z; q
(VWIN32_Int41Dispatch)3 Y M. {8 [( D
call Kernel32!ORD_001 ; VxdCall
S2 ~- s8 j1 K2 X/ U cmp ax, 0f386h ; magic number returned by system debuggers' O: r( F0 \; z8 x
jz SoftICE_detected% h- T6 d% b- [- m
& s! P7 L& o; R( n5 ]; k, YHere again, several ways to detect it:
$ h7 x' k9 {0 w( a
6 \( u9 {8 D! A" ^5 ? BPINT 41 if ax==4f: r: H* i0 j! i- j5 g
! L) ?5 \. A8 E1 z" b* c4 H' O BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
( s9 T7 [1 o {3 M1 z; w0 o* A! {0 {
4 o3 F, L _' \: N% @ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
: i0 N- {3 h2 w2 Q2 m+ h( L8 g! X3 W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 w+ K6 C, l _# C. q& s s d6 q2 h
__________________________________________________________________________
1 x& h/ o+ T- I d( k/ F1 G$ o i6 K* u' o" z* j2 I* O S4 l
Method 13
. X4 i8 b7 ]) g- q' e4 d. j=========
! n" y1 g2 W* n3 L: M7 D c- K0 Z: b# }' }$ q" \
Not a real method of detection, but a good way to know if SoftICE is! u: H- \. s8 X1 n; u
installed on a computer and to locate its installation directory.
W x& m& f9 Z; t2 `: m2 zIt is used by few softs which access the following registry keys (usually #2) :% L: M9 n% N4 t" {$ j0 w
, o. q( r' X% Y1 m. N$ d. f8 m-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' Q$ @3 D3 X; B- g\Uninstall\SoftICE
M/ E: N/ e8 a$ H2 b; w-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE ^4 g3 `' U8 W
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 a. _! B0 K9 {8 v% A& Q) l; ]\App Paths\Loader32.Exe+ s2 B x5 h6 V7 L! I
% N- C0 J& r( ?3 u# G' V3 Q5 K: P/ a
" C: ?. x B1 ~ d2 F
Note that some nasty apps could then erase all files from SoftICE directory
2 b* q& y( s- w- }(I faced that once :-(
7 p+ s, {. `/ ^5 n- e) E) d2 m8 a
5 c' h$ S$ {9 E$ NUseful breakpoint to detect it:: F& ?# a: d* V V& ~6 O
1 j' r4 [2 H7 D BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! \6 q2 J; t2 n: `( K7 A
2 Y- _ H" z" z3 I& v# m$ [) M$ ~
__________________________________________________________________________
5 r2 Y, k+ k3 j! k: g) J4 Q) k4 h e
/ v4 c# h4 Z& MMethod 14 7 s* `( S4 Z" z7 o/ U
=========
0 J$ y5 @0 S6 c r+ E6 k9 D& W/ L7 ^0 i- z* K: J4 B0 u' ^: n1 _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) m3 O- ~: R' B5 \
is to determines whether a debugger is running on your system (ring0 only). |; O7 E ~; H5 ?& b
0 |6 b7 y, {5 ?# k6 P& b VMMCall Test_Debug_Installed
. s4 x% s+ M: k je not_installed
" j; D# ~7 ]! I+ R+ |' ?2 g6 c
/ o2 H8 ]7 R- U9 lThis service just checks a flag.! ?& s0 K( T7 r7 ]
</PRE></TD></TR></TBODY></TABLE> |