<TABLE width=500>
4 N# y' ~- t. a+ _2 U1 }) O5 _<TBODY>
' t6 E# ~# a! ^' Z9 b7 [7 |<TR> \; _, X8 f/ ^( Z9 S) d5 S
<TD><PRE>Method 01 5 ?0 `' h; K- C. S
=========) C3 o Y" _) s! M$ ~1 f
# |. g7 A& l8 J& T- N/ b4 UThis method of detection of SoftICE (as well as the following one) is! g0 T1 Y, I1 S3 ]3 S0 `, k
used by the majority of packers/encryptors found on Internet.
, k6 h) O" ]3 b V( h5 G2 x* mIt seeks the signature of BoundsChecker in SoftICE
v8 R3 T8 K) N6 w9 r; j! V a3 G% j/ x' k$ _% Z0 {2 y
mov ebp, 04243484Bh ; 'BCHK', F1 x7 {# {' \ |7 D x
mov ax, 04h! O) E3 U9 O, a6 k3 I D+ W% w0 K
int 3 , Y T( H7 }0 s. `: s" {+ D
cmp al,4$ D" X! X9 Z; r
jnz SoftICE_Detected
3 l. U) I @+ f0 b: x; \9 c# L5 G$ Q# v
___________________________________________________________________________' \7 G# _8 u* \; t; S; f# K- z
) ~/ J. P3 B8 e! uMethod 02
8 y8 O, J) T8 L( w=========# L i2 g! h1 G0 D: e+ ^5 @
/ P# O5 ~2 ]+ V( w4 b
Still a method very much used (perhaps the most frequent one). It is used
2 ?) ]2 R; p, {6 k/ Q; oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, H9 A; ~( m0 X' eor execute SoftICE commands..." J0 G# b+ ^' O& U0 {: ~
It is also used to crash SoftICE and to force it to execute any commands( t" c6 y! d6 E o1 B& c& T* B
(HBOOT...) :-((
5 C6 R8 q6 ?8 A8 \6 T
) D' s9 c/ K2 G2 oHere is a quick description:
5 N& `4 m! `4 T( u* V* g; Y9 {9 Z$ M-AX = 0910h (Display string in SIce windows)
3 @9 j: a$ W/ W9 V% y: T$ e A E0 ?-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), _- f; c. n' m# {: K
-AX = 0912h (Get breakpoint infos)
% }, D% O( O& ^" F6 z- f! N-AX = 0913h (Set Sice breakpoints)
3 j7 E6 q/ V2 F( V-AX = 0914h (Remove SIce breakoints), o# ~7 d% e0 j. V" z
9 l4 ]) Z/ g. ^' zEach time you'll meet this trick, you'll see:
' @$ n! b# U i3 Q+ J" u& n-SI = 4647h* r7 {7 h H4 P6 k8 J* j+ z6 q
-DI = 4A4Dh" F4 B! n' m; q. C( m
Which are the 'magic values' used by SoftIce.
* f) B) Y/ {6 I# |+ w3 Y- GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& h# X" d$ g3 F% D; [( q( Q
. x) M/ B. E- ZHere is one example from the file "Haspinst.exe" which is the dongle HASP8 J# G/ Z/ I1 l" `1 m2 m0 t7 g
Envelope utility use to protect DOS applications:
" i0 I) }5 W. g: q ^* g
& ?( m- I: I+ b2 A( H; d
' i+ m8 J) X: x2 A) Q6 O; u1 Z) B" l+ F4C19:0095 MOV AX,0911 ; execute command.; E: Q5 o3 @6 H- g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 b; g8 `" h3 L/ H7 i# n
4C19:009A MOV SI,4647 ; 1st magic value., B8 k) |- U3 W0 a0 n
4C19:009D MOV DI,4A4D ; 2nd magic value.* y) a; j4 E# W$ C+ z
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
7 |4 ^+ ?3 H" ^3 g9 O+ A1 L, F4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
3 ~) E1 l4 {% d4 n2 H4C19:00A4 INC CX/ ~# k- I O( r+ r4 D1 e6 x
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- k3 ~0 H$ `) s9 Z4 V4C19:00A8 JB 0095 ; 6 different commands.
+ E! I# N- A/ a8 E4C19:00AA JMP 0002 ; Bad_Guy jmp back.; |# H7 u" @1 Z: p' r# ^
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" j( @# ]" w, H9 I
& H, C7 J, y5 y; @& M4 v+ HThe program will execute 6 different SIce commands located at ds:dx, which
d V A; Z+ rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' x' ~" g9 \" S2 p
! u. Q J) R+ j) U4 C* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( j! F3 L6 ]$ ]# k) s; k2 x7 \___________________________________________________________________________6 z+ l0 r" P& }( T& f& k5 U \
. {# }9 a' N& o9 E; f9 D' N
- s9 _6 i" t) [Method 034 R: o) [- E/ S& ]: v' o6 q+ e/ t( |
=========
& g t' B2 s# B- m' J7 u) Q! Y6 t0 d7 n' }- t& L: ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: s/ E* q8 Y+ b" ^
(API Get entry point)
1 ]6 M, J/ d+ B4 S7 a
! N. d) R5 d4 f/ S* }4 w& \5 p$ m+ G# P( k+ m# L- q
xor di,di# Z5 m+ b; i1 n4 u2 n8 |
mov es,di* N, c. G) x; m+ ?! X6 P% X0 @
mov ax, 1684h 2 e0 Q' D. v7 Y7 U Q8 l$ k
mov bx, 0202h ; VxD ID of winice2 q$ K& s `( T) _% e6 S
int 2Fh
' ?3 n* N# I9 U1 q1 { mov ax, es ; ES:DI -> VxD API entry point; d7 q8 F' R4 b$ u6 t
add ax, di
& o4 E- z. P- E t! P test ax,ax4 i; r( s; ^( l: M! _" [/ z
jnz SoftICE_Detected
. }; U0 q% d6 _; i5 x- [* u2 X9 @6 r0 v
___________________________________________________________________________- v& z! K) E9 N3 f' ]
5 h7 [% ?) @) }2 D+ i% d0 Z) _) ?4 W8 hMethod 04) H1 q. I* U! I" s! d! _2 f4 X8 v% w
=========
" ~2 x% s8 D. K+ \
8 Q1 h/ Q( ^( E3 c( gMethod identical to the preceding one except that it seeks the ID of SoftICE. _! \( d6 a! j
GFX VxD.
6 f$ ?+ K% I. u! N E4 n/ A# z% S$ a9 B/ _
xor di,di
9 Y+ }) Q1 p0 x7 n! \) T& F mov es,di
8 O' O# }( M) C, Q mov ax, 1684h ! d+ z7 j5 j T0 R& }' F
mov bx, 7a5Fh ; VxD ID of SIWVID' Y2 m+ u1 Y$ L3 A( C% T3 ^
int 2fh
/ ^: o$ A: p. ^ mov ax, es ; ES:DI -> VxD API entry point
; ]: r6 V4 [* \" L% G) D add ax, di
, }3 X3 M2 p4 ? test ax,ax, b4 \/ g/ h$ E' T! @3 K3 d( I$ |
jnz SoftICE_Detected
, k( y; S' j( w o6 o. R( ]# Q f) v) }5 B7 m: Z/ D9 w) u( M" v
__________________________________________________________________________
+ F3 {0 H9 j) O) P4 O- [8 W4 b0 E" ] |0 ~0 U
9 I% W3 F" @5 t% s* J/ BMethod 05/ G" |* i3 R% u& ?+ z0 A! V5 y
=========
7 x3 w& }) L( h9 ~2 d9 C! y5 a* C% V+ m7 u* N/ ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system
+ ~7 g7 ^) l) f, W, | U! kdebugger. It calls the int 41h, function 4Fh.
- q4 |& l. v# pThere are several alternatives. # X* c7 s$ Q" b1 n% M
- `+ W- D: e) V- y0 ^
The following one is the simplest:
; u0 Z& e: C' |/ @
0 P( {/ q5 w v% `+ S mov ax,4fh
: r& W( R. `$ q int 41h% w4 F( p/ l' O" r
cmp ax, 0F3866 A! g; k4 K5 y6 f3 M" d/ e
jz SoftICE_detected
* H6 x/ W9 Z+ `9 U- `( ^' m& m/ P$ ?5 p7 q5 e
. M2 u) B8 \; R
Next method as well as the following one are 2 examples from Stone's
/ O) r4 f- z" c- n6 ^"stn-wid.zip" (www.cracking.net):
' `8 k4 B" {% G0 J
4 K4 P6 h9 u5 f7 C# W mov bx, cs4 ~4 q+ U G( l) D: P: J
lea dx, int41handler2
: w- I' _/ O7 y% X* c- z7 h xchg dx, es:[41h*4]# e7 \$ W+ j8 u4 \' }
xchg bx, es:[41h*4+2]: B8 R; E& J8 C5 R! ~+ C
mov ax,4fh
; ^. T, b- {$ p7 I) Y" p; P int 41h- Y+ m1 [0 |+ W) B" M4 ~
xchg dx, es:[41h*4]
0 n5 }. Q7 F" q- \8 w; \# _* W; S xchg bx, es:[41h*4+2]
. i. j! g3 H: F, Z, D2 p. M cmp ax, 0f386h
1 d' P9 X$ c! f8 \ jz SoftICE_detected
$ k% f4 X- `! N6 c1 @- s K
6 J! x: a, h+ F O; G6 xint41handler2 PROC; w, C; t5 y5 U5 V" ]
iret
. L- F$ T8 T: T4 B. k4 D! Q; _int41handler2 ENDP
7 T1 @" \! ~; m. D% c$ l8 X
& ?2 Y' n/ Q W' I6 C% e7 d( w+ A0 j: a0 |9 ^
_________________________________________________________________________
* T9 R! n6 u8 p. c, [0 ~2 f f. ]7 l& n+ f
U0 {( J3 H# b$ CMethod 06
% J$ a. x+ S" h* W=========+ T# B5 R/ N! f7 y7 B. q
; A$ w5 {2 Y8 v* i; c* q9 B! Y. U* E+ y# @6 G. R. s# q& l2 _
2nd method similar to the preceding one but more difficult to detect:
3 Q/ F7 |9 d) N% I0 Q
$ ? j% o: R' B7 l8 N
+ h7 E8 D" p# {2 a1 }) mint41handler PROC# \' S( I, ^0 E: H8 _6 c/ j8 B
mov cl,al
8 s) c1 V1 N* ? iret
! R: o1 {8 H0 h4 Nint41handler ENDP$ n( [+ @2 p8 N; |5 ?1 R% ~
- x/ O+ v$ i! B+ K3 L' `* O0 S
?, D# a+ E$ ]4 U/ l0 Y4 e: X2 m xor ax,ax+ D1 `* B/ {5 C+ v8 c1 V8 o4 `9 A6 Q
mov es,ax8 U6 k: f3 v6 N
mov bx, cs
: ?5 _! W0 s+ {! X lea dx, int41handler
% C! c) E% W2 ?6 h" G xchg dx, es:[41h*4]; y5 j# O# D5 v/ c# z( p( S
xchg bx, es:[41h*4+2]; v* Q9 A9 C* ]/ j- u, \* k
in al, 40h
& H/ a4 l% [% t7 a xor cx,cx. C2 `! R# B( O
int 41h
- L1 c# \( E) \5 b" }' t( z xchg dx, es:[41h*4]
0 U# w" b! S& r2 K+ f/ r) B/ m xchg bx, es:[41h*4+2]
4 G( N* n) P( T cmp cl,al
1 C O: }/ Y# ~1 a+ ` jnz SoftICE_detected& H y# ~8 j7 [
9 ?: P" s' z& W8 N5 k_________________________________________________________________________
1 J \6 ?1 [( W! v9 G. q3 z, {5 [! \# U& E2 I# ^! a
Method 07% m" L& | M: y4 Z( {% i" N. _
=========
, N( o& x6 K# G, n& t& X; ]
& }2 E% v6 x- r) TMethod of detection of the WinICE handler in the int68h (V86)
/ z7 l5 v, E R K
& u* `" v% O% m+ ]4 M, H mov ah,43h
- P% I2 h4 }4 f2 t int 68h
1 _$ M0 X8 Z& p! W7 H4 Y cmp ax,0F386h
7 j+ Y. h- \* W( J* w5 q jz SoftICE_Detected9 {8 M. Q% ?6 |- h- T& \
3 g% d" X8 p7 ], n/ ]: R5 e% ~) e: l6 K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 ^; k0 @4 J6 c, U! r* @
app like this:( z' D: B. g* Q3 C) `; z0 U
5 S, Y! r) x7 ]3 ^ BPX exec_int if ax==68) f3 ]1 U- \5 a) ]/ w& ?( |# f
(function called is located at byte ptr [ebp+1Dh] and client eip is
@2 C4 u/ Z2 i x) k1 H7 g& A* @; R located at [ebp+48h] for 32Bit apps)
& Z5 q5 U6 X. m8 B1 w__________________________________________________________________________7 ?: W) v9 m& j* c0 \! r& |
, p+ p: ?4 C4 H( F
* B/ @- M! e9 u! N7 U6 t1 Z+ K8 t
Method 08
, D" D1 f$ V+ X4 P=========
: O; P4 r: _5 Q, N! y9 Z) Q. p: K# k4 Z) e/ I% v$ l) v% x( W
It is not a method of detection of SoftICE but a possibility to crash the5 G7 Q0 y" K# b
system by intercepting int 01h and int 03h and redirecting them to another
u5 }8 Q% N9 U, p8 n, @ L# Proutine.: J/ j* @7 I# f$ @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 Q- n- G$ {- |8 k" w
to the new routine to execute (hangs computer...)
6 Y( K% D* y- q* ?
( R, w+ o5 G6 C: A, f9 e- ` mov ah, 25h; F9 U! N- R: g) i" J0 z7 d3 C0 d
mov al, Int_Number (01h or 03h)' Q3 b8 E8 T: D% ]- S" V2 {3 H
mov dx, offset New_Int_Routine
# A) E' D2 ]% [& g: { int 21h
: m9 a: H. `. t) O% ]( c8 U! J& u2 g! |+ g2 R7 l
__________________________________________________________________________
1 |+ x1 o+ T- ^' n: L, @1 H3 U
" n. U" P2 c/ n; CMethod 09
+ a1 F: Z! p. \=========
! h: N* ^0 ]% B9 ]+ o( d, w3 ~" w1 m3 [9 K( P; s
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& b* n, T2 R* a: c( ^
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ g0 v0 I6 c( e9 ~1 xThe Get_DDB service is used to determine whether or not a VxD is installed
' ]& l# M7 _; \6 K, z& Zfor the specified device and returns a Device Description Block (in ecx) for8 z' ]" B( s! U( ~0 M& H
that device if it is installed.! F2 F6 X: L( D" U' e" G+ f5 u
2 \+ j, _0 w- W* `( U9 ~8 R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' w& { C( J3 R+ P/ |& j
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( T# ~" ?4 u, `0 Q' p
VMMCall Get_DDB
& V; {) M# d& ~. c* C4 L mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ M( c" D% o; ~( p
& l+ K$ x& _8 B% O) U! VNote as well that you can easily detect this method with SoftICE:
) J8 @9 C) `* \: H8 c6 ^3 V+ S bpx Get_DDB if ax==0202 || ax==7a5fh
! ~0 L' I! `& _% r; u' _- D4 c9 s: [' B
__________________________________________________________________________# K7 z$ P i, [" M0 {7 e6 K
8 R6 i7 @4 {; D" R1 f- ]$ s
Method 10
! ~: [; J6 _% Z# w=========
8 s5 z3 F6 J4 p# B4 {; }
0 c3 K- w+ W/ E& }, u3 l2 L=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 \. C* e& J" k6 m: t0 Z: { SoftICE while the option is enable!! m; U* J; L$ p0 w
# X2 _3 r t7 y/ zThis trick is very efficient:
7 z7 O9 K$ r" U/ U2 iby checking the Debug Registers, you can detect if SoftICE is loaded1 a3 `9 U- V6 G1 n1 M& b
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 ~9 b- g: Y& E' q, J( H) c
there are some memory breakpoints set (dr0 to dr3) simply by reading their
. m$ I r" t! R1 vvalue (in ring0 only). Values can be manipulated and or changed as well
% h8 r: H( Y+ v, F$ k(clearing BPMs for instance)6 x$ P8 T: I4 u
/ B _* P1 b) D# L
__________________________________________________________________________ }/ `$ [6 }, @7 n/ u( n: c
& t& ~+ c8 h, y
Method 11: C/ U9 @6 K ?% v# Z* d
=========% m# g* T& z2 Q. C. |* M! g" [+ K
' I- K9 _' j' P# j
This method is most known as 'MeltICE' because it has been freely distributed3 A9 K: j, B8 S* l c
via www.winfiles.com. However it was first used by NuMega people to allow8 r4 I: n9 H( A9 f8 W( p8 [0 o
Symbol Loader to check if SoftICE was active or not (the code is located" e' r. G9 ? Y r3 V- | E
inside nmtrans.dll).
4 \' T! G$ l" V8 Y% r/ y$ X2 _! N4 h/ Y7 q4 ~$ R
The way it works is very simple:4 G! m5 f6 ^/ N* M \+ K- k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 M: {& b) J" y" GWinNT) with the CreateFileA API.
; F2 ?5 W' W. g- V& f: D. O
: }3 V o7 m# \8 yHere is a sample (checking for 'SICE'):
0 O& b6 d6 Z+ H1 x# i# ^% {( ]: c, T" y
BOOL IsSoftIce95Loaded()2 s# h5 i" u- {8 M
{$ s! k& o& T, R! X6 p5 d1 r
HANDLE hFile;
& w5 C; I- ?6 Y& s hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE, ?$ e5 Y2 U9 Z1 T8 i; G K
FILE_SHARE_READ | FILE_SHARE_WRITE,
0 y- y v/ |1 s$ H3 H* h NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: S/ w: [% Q0 J1 v" @0 W6 E4 q+ J if( hFile != INVALID_HANDLE_VALUE )
& o6 k; J* N/ f, x4 [' c. } {
# w% U# j6 W, H+ X) {' l- W* ?0 P0 T CloseHandle(hFile);
+ z9 `% p3 A5 G return TRUE;
" j5 c/ h! e) K4 g$ O }
* c& P8 F2 {1 e& D& Z return FALSE;- k0 ]; J' B! R4 s( j; I
}
) I+ C3 {# M. I+ q1 r' D, U, `
3 q; g( n7 C, L! T" p+ {Although this trick calls the CreateFileA function, don't even expect to be* Z2 a7 V! f2 F( m( [' _, }; i
able to intercept it by installing a IFS hook: it will not work, no way!
: L3 F9 {' \, {. Q; u7 G: @2 _% aIn fact, after the call to CreateFileA it will get through VWIN32 0x001F3 { n$ N1 b0 A0 J
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& a' j2 P3 F7 W' j/ l- v( Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc. H- N+ v; {( q
field.0 A1 E# B* G- l' {: Z9 A
In fact, its purpose is not to load/unload VxDs but only to send a
8 |/ g' A: _5 }9 z6 w3 uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; ]' K: Z7 y0 W9 Qto the VxD Control_Dispatch proc (how the hell a shareware soft could try5 I7 r" M9 p4 X R3 g7 X1 \$ d# h
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." m; s( a5 ]2 K, A3 b* f) c
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ s0 g( Q# b! a) Y7 D# ~: Z' L$ hits handle to be opened and then, will be detected./ M/ c0 r$ {5 o) U% s* J% ^* b! K
You can check that simply by hooking Winice.exe control proc entry point
' n& `/ }+ `( A$ ^5 h* O swhile running MeltICE.
" e: Y* v7 B% Z# l& B7 Y7 ?0 f
8 b6 E+ x2 Z& p9 H# K
* T9 i' f* u+ _+ [0 G 00401067: push 00402025 ; \\.\SICE6 I( `( u) m3 R5 q2 j
0040106C: call CreateFileA
6 z3 E) q9 y( l2 C& G G' _ 00401071: cmp eax,-001
& d0 c* X! a% T: T 00401074: je 00401091
4 C# ]. ?5 Y9 H3 n, B* r' b9 s* G$ T, O' L
. J! a; ]7 F u2 Y' ~There could be hundreds of BPX you could use to detect this trick.
( G9 [6 W% F2 U( i/ ]1 {# ?-The most classical one is:7 |3 p4 c2 F1 k8 E
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" e/ `) C3 A5 D2 F0 q. O
*(esp->4+4)=='NTIC'
% o' }3 k7 j9 K) Z/ X$ O* m1 k9 L( ]/ L- {4 l
-The most exotic ones (could be very slooooow :-(
& K& D' D) u' ~2 P+ u6 }0 E a2 U BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') e! O, r/ _; D
;will break 3 times :-(
7 Q( A$ Y. j' p ^6 {6 A
, ?/ V) y3 O$ [-or (a bit) faster: - ~ R# W/ f$ o4 M5 A
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')+ }0 F9 @, d& E' p
: g. x7 r) l1 v6 {( K BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" P3 I- Y5 _, p# @* K' r ;will break 3 times :-(4 ^5 e( u/ W) |7 N5 e7 h9 C0 @: N
, }: i9 O! U" i9 i; Q3 a& T2 B
-Much faster:, b, E8 G) Z. y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'5 k3 x& q& I2 { ], f! W
$ o2 V* e4 O4 L, M; Q# j
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen; V& T" @1 K! G% _9 v7 {5 _
function to do the same job:
@# l q q( E+ I
4 { x. V% Q, J push 00 ; OF_READ3 w, Z2 C/ P4 J D! j9 ?% n6 c+ a
mov eax,[00656634] ; '\\.\SICE',0# e/ O. J, R; g
push eax
0 c9 H8 V4 q) Z9 I; r/ W) o call KERNEL32!_lopen5 J6 i* n1 U* q6 n0 m
inc eax9 C) S* p) b5 k, `% `# j; G4 b
jnz 00650589 ; detected5 S/ t% V, {/ n$ u5 n+ i
push 00 ; OF_READ
0 p7 H) B5 j A, s% @ mov eax,[00656638] ; '\\.\SICE'4 x6 @# j N' t) E3 E$ x
push eax
: ~' A# t4 p+ n call KERNEL32!_lopen' W8 q( h, T: X7 x" \& e$ {
inc eax/ C* M1 }7 m) I$ ]0 a- q
jz 006505ae ; not detected
/ [. o- N/ u& Q# }- g' `/ W
, h5 i+ ^" L9 ~5 ~0 U
$ V" Y5 E$ A. N# c__________________________________________________________________________
0 [4 S# C( s8 U: q3 @3 s, y9 a3 B/ H# J0 a) R( I
Method 12 M! ~# f% X! @$ v; @! u
=========
. ~/ O1 u2 g) Z$ j; e' f4 j
7 a4 y: q: `; _1 {+ R+ G* dThis trick is similar to int41h/4fh Debugger installation check (code 05
5 `: n" t3 g8 ? h! @& 06) but very limited because it's only available for Win95/98 (not NT)4 R. f7 ]1 R4 ^' S0 V/ q( ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ F1 t( A$ ~$ o4 L& i
4 B6 h( a$ X @7 f' g push 0000004fh ; function 4fh
7 h' B! ]' r" a" G. X% Y push 002a002ah ; high word specifies which VxD (VWIN32)$ \# d- ?: B, n2 A
; low word specifies which service
% H7 G6 Y5 ^! k; r$ \# I (VWIN32_Int41Dispatch)
+ c0 o% p- V+ Y+ U7 S call Kernel32!ORD_001 ; VxdCall$ ]- {) w# F0 ~6 V7 H
cmp ax, 0f386h ; magic number returned by system debuggers7 q% Q8 p* k( j
jz SoftICE_detected
1 ]. P; \. x/ {. M. C6 A8 b: U4 a! O( n; x
Here again, several ways to detect it:$ G3 e4 }* X+ H- g- M
+ L9 b, }+ P/ [
BPINT 41 if ax==4f; p; @, t; D( Z) R2 @
; I& z$ ^2 P: { V" `8 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
% { c6 p& e; m3 _8 P: @9 A/ n u% [. E# o! J
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 s3 |2 i9 l6 J Y$ k
0 e4 b$ S' {5 s1 B' k/ c& e3 D BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: N5 v4 }9 x1 f5 C8 v! w% c: x' U/ ~/ r9 O2 A
__________________________________________________________________________
) r% r7 p3 \& X' R7 n
1 C& t6 Y# B4 J1 h. Y+ YMethod 13, l C2 z I- b( R
=========3 V& o3 @0 K5 U/ W9 Z8 r
+ B6 b5 P4 N+ dNot a real method of detection, but a good way to know if SoftICE is
t2 u9 D! r% [installed on a computer and to locate its installation directory.$ O a2 m" v" C5 t8 z1 B
It is used by few softs which access the following registry keys (usually #2) :
M, z( Y" X- f; t" Q. |
. v/ C1 ` a" @) |& V& x7 K-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! O# k+ `2 q1 _# B! ^3 `$ A( m\Uninstall\SoftICE* L( S( {9 ^2 j8 w6 i: ` R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) [% N+ Y( n) M$ A7 T/ ]' R-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, L" t1 k+ X9 V: G4 ^\App Paths\Loader32.Exe5 M( B4 p$ D$ x1 s
9 c6 `; V7 m( P1 h& P9 ?
, ~- C l' r( z wNote that some nasty apps could then erase all files from SoftICE directory
3 I) W2 W# K9 d. |( O; T k; S(I faced that once :-(
8 f2 u5 n' u! k% O; V/ r9 t# y+ G; Z$ d2 U* C0 I9 C5 q
Useful breakpoint to detect it:
" Y' m+ N& C4 Y9 v8 @; j& p* R/ F6 m+ B9 U
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# c4 c8 z7 b" m, L6 n2 E$ D- D: w' F
__________________________________________________________________________
$ a. i8 V0 h; x: C8 m* n
2 L5 b: v$ j8 Y1 I) B1 Q$ r' q! Z# L- e4 X& _7 ?, m3 k0 o" o3 }
Method 14 ; y0 q# k G0 C0 P
=========
' ^. H; b8 B6 J, N# H/ B+ B8 l& M* ~4 A. w0 c( q/ Q# c
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
9 t+ p4 N, W+ I% y5 W5 I# vis to determines whether a debugger is running on your system (ring0 only).2 X! j- J/ l! o8 |* L
# q+ r6 c# ?" @; j( Z. i, F VMMCall Test_Debug_Installed0 N3 q: ^# ]0 k K& Z( W' H7 C: J: C
je not_installed+ V" {. [4 J4 {8 L9 T( k% Y$ d
]: r3 ~6 U: ?% K# @. a |! Z
This service just checks a flag.
+ \1 }, }# T% M+ O% V& q3 U</PRE></TD></TR></TBODY></TABLE> |