<TABLE width=500>
2 ~6 _# u3 M3 u; q! }! A& o$ q9 }<TBODY>
8 }/ ]* E3 _. Z7 s9 z<TR>
5 {5 K% ^. l' H: V. U4 R<TD><PRE>Method 01 . `1 }( @+ I7 z2 G5 y" K7 m
=========
' Y+ o" l& R7 g; f" l
7 U( V7 |4 k3 d& G/ ?This method of detection of SoftICE (as well as the following one) is
/ N, n3 |! T( d) \+ s1 \used by the majority of packers/encryptors found on Internet.6 S2 t/ L4 L& W% g2 ]
It seeks the signature of BoundsChecker in SoftICE
4 h Q, B6 _- [5 m7 Z* ^/ c! _$ K; ~2 N: `" R
mov ebp, 04243484Bh ; 'BCHK'
. V2 L' J; m. L0 k mov ax, 04h
: j/ @) g. F- E9 q- v int 3 # \; f$ N/ }7 ?5 R
cmp al,4
; w+ n5 D1 r' x' q$ O) t# ^# u jnz SoftICE_Detected( s1 U" g8 {5 r
9 u/ s% C/ e% S: k
___________________________________________________________________________6 S' Y# ^. E7 Y
: M0 n0 h: c9 ^5 ~* r4 i% J$ S" A
Method 021 Z0 A8 K# E) M* c
=========8 b, z5 a% h x \& x1 W6 q
, j5 H! m( M; z0 |& k$ F H+ N3 K/ WStill a method very much used (perhaps the most frequent one). It is used# W* y# G1 Q. l+ p/ w
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; q- o. z8 p6 l3 y7 cor execute SoftICE commands...
. ?* G; d F9 j' ?) xIt is also used to crash SoftICE and to force it to execute any commands
" S6 D) [/ \& ~* q D; ^: D(HBOOT...) :-(( # M4 H9 U7 L9 q$ O
! S5 G A3 r$ a" s; K( q
Here is a quick description:- L; U2 k' g, c- h0 }" n
-AX = 0910h (Display string in SIce windows)7 K/ K8 V' w9 i+ O) N
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! W Y" ~2 v9 a-AX = 0912h (Get breakpoint infos)
6 x, m- z% J1 Z1 h1 V1 M: N9 y5 X: D-AX = 0913h (Set Sice breakpoints)) I3 @, ?& R: v# L& h
-AX = 0914h (Remove SIce breakoints)7 z" T6 j8 m) y, q# Z5 Q0 H5 o- y
$ n z4 O, S: T. w
Each time you'll meet this trick, you'll see:5 W" G2 W7 {/ \2 c+ e2 k0 [. D( c s
-SI = 4647h+ ~/ e; j2 L: l( {' I# B4 i
-DI = 4A4Dh
9 `( e" ]% u- s6 \! y8 T$ c2 ~Which are the 'magic values' used by SoftIce.
2 s0 h6 Z; R. n; O0 `' A+ k; s% JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
8 V! j3 S' b7 z( ]6 [1 V3 J6 E/ {$ n; n
Here is one example from the file "Haspinst.exe" which is the dongle HASP- v% Q( V/ T' O' J8 ~" {% \- I( A
Envelope utility use to protect DOS applications:
& F; I- D P& e' d( E+ I* b9 f3 g' d' F8 o- W
0 C+ b+ o" R7 l% }/ `% M" X4C19:0095 MOV AX,0911 ; execute command.( Y! p1 S: @ b/ A
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 }; ^ h- V! v! |, j) q; g4C19:009A MOV SI,4647 ; 1st magic value.5 I* S' J4 Z# m, y6 U
4C19:009D MOV DI,4A4D ; 2nd magic value.
. E5 f2 L4 ]% u9 j5 v4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)% s5 o! k- ?% R- a! [" u: n, e
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 b8 M; W1 a5 x, O' ]; m
4C19:00A4 INC CX( R8 _8 R3 W: v- U
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 t" s2 _( E; `0 W: Z
4C19:00A8 JB 0095 ; 6 different commands.' [8 Z9 _8 K1 S4 B& I, j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- a; ]* x) [* U6 k, V4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 W: z. @' a, S. V' F; W, O) j
! ~+ s% @* a8 K6 |( J9 kThe program will execute 6 different SIce commands located at ds:dx, which
: s0 ^8 R) @3 X5 ~are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.% _( m0 y8 V) z# ^
( ^2 s) G1 {- A1 T0 M1 R3 M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ K7 E6 L' M( F5 R& ]8 z7 H___________________________________________________________________________8 ]( N( J. o& }" U- E$ f4 x
/ {! U* H$ T1 q
5 K* _/ b( X8 O1 FMethod 03: L1 U7 _" j! q" `$ c7 P! e+ y& A9 o
=========# P7 X4 d7 h4 L4 N7 [4 U
, ?, {$ o) `' J5 n" S3 y# NLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 v. { G: s6 s0 q
(API Get entry point)* @5 m( s5 L0 U: I1 c" a+ V
% T. E; k- r6 u* ]) V; Z# h% N5 }/ f9 ?0 p O
xor di,di5 `$ ]$ i0 f+ H. l2 e _
mov es,di
- i$ v% H# k R1 j mov ax, 1684h ( z4 Y7 I4 O0 X& m( z$ h3 x+ [5 g
mov bx, 0202h ; VxD ID of winice8 l& r( N- \7 O) j, |
int 2Fh
* w: E! i. Z% E mov ax, es ; ES:DI -> VxD API entry point. g: x4 H; N; P2 d7 |
add ax, di! ?; u8 R1 M; ]2 U# t) q' ^& Z
test ax,ax5 f$ q4 f' d+ m# `, ]
jnz SoftICE_Detected
) X/ _; y; B9 n- F
, ?; M7 k; ^0 N- L# i5 X___________________________________________________________________________
2 R) n! i3 ?, @) A v
6 o: _: A" }, m% pMethod 041 F5 L3 A% o8 A% o9 i
=========
& ]2 ~% I- d" J* }7 }
2 Y% X7 t. }3 _1 c- b) I. ZMethod identical to the preceding one except that it seeks the ID of SoftICE/ f7 x& x5 j7 R* M. `1 Z$ A% w
GFX VxD.
' D8 `3 z6 ~/ {4 U9 P) O' C- m
' K; ?) U5 f! w2 O0 y" Q% j xor di,di
U! T$ O& Y$ x2 }' } mov es,di5 B' z& x P. ?# \- E; w
mov ax, 1684h 7 B1 [0 C6 h/ Y0 |% \( \* J
mov bx, 7a5Fh ; VxD ID of SIWVID: Q5 C( C- H: g( `. x3 t' [
int 2fh/ }9 \8 K, T8 ~( B% p& t+ V
mov ax, es ; ES:DI -> VxD API entry point8 d7 }" {- R/ c5 R
add ax, di4 N3 |# @/ y u1 B: p8 t
test ax,ax& G% G" }. l: o7 n9 R
jnz SoftICE_Detected
U% I2 Q% Z/ u9 Z
- n( D3 a$ Y3 P- |__________________________________________________________________________- t+ Q4 }% e8 \; \5 o
, M8 Y8 Z, l% g# _& m$ N' }; X% m
. L N! r3 D* _9 o1 r, x lMethod 058 P C/ w5 W3 }+ @* c
=========
/ v0 X7 S+ X l& Q
; G0 ^' Q! b0 D' M' X% JMethod seeking the 'magic number' 0F386h returned (in ax) by all system d4 I0 i/ S! O/ i
debugger. It calls the int 41h, function 4Fh.; A( E& U- `# F4 v& K
There are several alternatives.
2 F+ L2 D+ q( V7 o2 b( l! f4 O. d
The following one is the simplest:) v/ n3 O7 f7 m0 O* D* x8 O, [! u7 ^
l; ]5 ?, Y3 K1 p3 X3 L6 \' h mov ax,4fh
( R, u2 W' W1 y9 x2 A; H \: y" H+ r int 41h
5 o+ _$ [" l' q cmp ax, 0F3860 y9 E7 t8 Z' q2 o, v& l7 f7 Y
jz SoftICE_detected
% A4 k6 l# N4 Y7 E: C$ \
- t8 p# w7 A' |! Y5 E$ g8 q9 `4 K I1 Y& K& Y
Next method as well as the following one are 2 examples from Stone's 1 g( p% g; O3 {8 Z& E7 g0 [# @5 |! Z
"stn-wid.zip" (www.cracking.net):4 J/ d2 i2 C E- P. L2 ~
7 \0 U% O9 G3 I mov bx, cs0 d& h4 {% D! n
lea dx, int41handler2
3 L0 [/ f# d! o7 G' ]3 i3 `# v+ ` xchg dx, es:[41h*4]+ b R2 M3 ?) T, _8 [5 |
xchg bx, es:[41h*4+2]
. r. ^2 a9 e; H1 S& X5 j' v/ _ mov ax,4fh, r+ v+ Z) x8 Q" H
int 41h
$ O; c' L% F# C" M8 m4 B xchg dx, es:[41h*4]8 _7 }* h( }" R4 v, I
xchg bx, es:[41h*4+2]
, C* D# [% G7 e. |0 X, n: U) X& X cmp ax, 0f386h
* \# V( ?% R# j4 _( Z2 m jz SoftICE_detected
0 O& Y/ [( e9 a. G) b! d1 W4 b8 g. y1 a7 H8 ~
int41handler2 PROC/ l6 Y& B1 {0 y
iret
2 H' E Q7 b7 r, u7 k/ Hint41handler2 ENDP
- s/ U4 a# ^+ ?" \3 x+ x- z9 C! v/ D8 W8 x2 p! x( x# d: D
: q* b# J+ Y2 u p+ i
_________________________________________________________________________) Q: W$ v, M6 o6 w; q
) s% W- b3 z1 Z$ A0 e( I4 Z$ W8 X$ \( t7 J- o5 N' U- [
Method 06* {: [' K; f) R% B1 {8 z3 ^
=========
* X8 P3 d( a1 v/ X# c
, S: R+ h/ J8 |6 N5 G0 L6 f0 P# w) l2 l0 Z) m; d
2nd method similar to the preceding one but more difficult to detect:
/ F) H! K$ C' J0 S* r! }# b- }$ A2 @0 U2 `/ r+ W8 H9 W
0 Y" Q: b' O/ q9 h
int41handler PROC4 V, j I" L% [' a. }# _$ w* t, _
mov cl,al
4 J- C! q+ [& L8 \6 O: F iret7 b6 `4 R3 {2 i+ ?# @6 \7 `
int41handler ENDP
( k( Q9 @- C/ z
: r' C% c' s6 m- I
1 q$ R& Y4 i9 d8 [- r& K xor ax,ax( Y& n1 r% [ ~9 h
mov es,ax/ D% \* _( B& v
mov bx, cs' k' t6 U# R4 ?/ [
lea dx, int41handler+ O! V5 P7 T0 J* i) r/ Q
xchg dx, es:[41h*4]
$ h+ \' @4 x! h" b( C4 g# `! [ xchg bx, es:[41h*4+2]
% X1 B/ x8 K1 k) g in al, 40h- @1 v: [( f+ W% ^
xor cx,cx" v/ ?/ ]/ x" L9 p
int 41h
, F: k2 ?) ^9 a' g' y0 h( K- {! t+ j& G xchg dx, es:[41h*4]' F5 |4 v% @( [' `; ^0 @; m
xchg bx, es:[41h*4+2]
5 {1 n1 w$ a+ ~% P! Q cmp cl,al5 a" u% t6 c8 _5 }
jnz SoftICE_detected; i/ S7 n0 w/ H2 A9 Q
' C6 m* a6 B( F2 a; N& ~6 y; p_________________________________________________________________________" V% n$ f9 E% Q8 o: n" ?* }' g
% O7 T2 K3 z6 b4 d9 ]. t; sMethod 075 k2 ]( L {. q- q+ D+ ?' {% _4 _
=========8 g! d" n) r- q$ r9 f
1 t( m. d' G( u9 rMethod of detection of the WinICE handler in the int68h (V86)
4 g9 X% i1 w9 y. k$ |8 j$ ~0 v( F; \0 w2 U7 m3 n i$ W {
mov ah,43h
3 a& V" q1 J6 i4 h( Z Z- ?4 ]/ k. R int 68h
/ U0 E, ?. ^" @% P5 t: Q5 |" y cmp ax,0F386h5 L9 a- V6 M8 `
jz SoftICE_Detected# I# x/ }) b) }
& M$ \5 r6 h. b6 ~% e
" [; X$ |( F& a% H=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! L- ]7 g& T: ]4 y1 P" i1 I& d" m+ V app like this:
: t' s" A( L5 c9 e% O
) H: y3 o" U4 c. x BPX exec_int if ax==68
2 G. a3 I( t8 q- ~ (function called is located at byte ptr [ebp+1Dh] and client eip is" \( u& P2 L/ V( e5 b8 E
located at [ebp+48h] for 32Bit apps)! C. A+ B" x% ?7 l6 u
__________________________________________________________________________5 ]; b q% [6 t$ _
5 m Z5 h! a4 w2 m! O
% Q1 `* e! p! X2 h9 f$ VMethod 08- }; a' r$ B# R4 }( R
=========0 S# h% V4 b* P% S0 \7 Y4 b
0 m2 S0 t! }1 m2 }3 | wIt is not a method of detection of SoftICE but a possibility to crash the
3 s7 a% k% O' X0 `system by intercepting int 01h and int 03h and redirecting them to another- l/ r: b2 m/ f
routine.
e: _2 C" x" {2 \& c, V1 _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, X5 D6 ]& o4 q' lto the new routine to execute (hangs computer...)5 ^( Y2 U# o: h3 h. M3 K
) e1 Y9 e- Q/ P6 I0 ] mov ah, 25h
- F4 @0 N6 H' ~ mov al, Int_Number (01h or 03h)
2 d( V3 v7 z5 c" O/ ~ mov dx, offset New_Int_Routine: E8 F: u' f" P" ~
int 21h
6 h" R2 ?0 K3 G8 r& a
- i- L) Z/ o% K7 g__________________________________________________________________________: B+ X, l2 \, m2 j0 `6 Z0 y7 Z
, W8 e/ F; D- G0 Y
Method 09
; j% u3 ^3 N" V0 j=========
V& k% n1 Y t" b0 G% q+ g9 T# T. {3 x% a# h; g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 V: ~: A. P: Q$ l* K4 R$ l- u, Dperformed in ring0 (VxD or a ring3 app using the VxdCall).1 Y7 @; V. k3 f' a; o
The Get_DDB service is used to determine whether or not a VxD is installed1 a8 ?: o$ E9 `) b9 L
for the specified device and returns a Device Description Block (in ecx) for& P7 C0 r- h K9 Q$ g4 ?! y
that device if it is installed.) m6 h2 i* u0 Y: Q% h' D
& Q h7 Y. R/ u& R# E
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! l- }0 p3 g0 l+ ^: N
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ D. Q W, X' n; i& E VMMCall Get_DDB7 A! M& B' Q; |' x- Y8 r
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
) u7 \6 a R: x9 v* Z( _
4 g/ B: q; V. |4 R4 P, PNote as well that you can easily detect this method with SoftICE:
! s1 C" C8 v% \+ s7 }* B' E bpx Get_DDB if ax==0202 || ax==7a5fh- A. V( m7 B( u/ o' d
+ q6 z) x7 a" Y' e__________________________________________________________________________
4 ^, l) Y) Q) a# w' s5 u0 B
! r0 I" j/ s3 }) v* lMethod 10+ f$ T% z3 Z& S. W2 q
=========5 B4 v; ?4 @: L4 Y" Z" c
! m/ y6 Y% [' Z0 ~; l=>Disable or clear breakpoints before using this feature. DO NOT trace with
/ W0 m( X$ l9 u: d! R9 r5 x SoftICE while the option is enable!!. [; I4 d) ^+ H# c
; c$ J7 ?; R! P* R
This trick is very efficient:5 p- E+ y7 L+ n/ P% J. w* @
by checking the Debug Registers, you can detect if SoftICE is loaded3 u6 }+ _( }1 m) B( {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 M$ L$ }$ h5 `, Q, L& b1 h
there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 W& P1 S- D( S+ ]& R. ?8 Hvalue (in ring0 only). Values can be manipulated and or changed as well
5 }. c' s' p$ _/ X% Y% a(clearing BPMs for instance)5 V q$ ~2 a* r7 W p0 U
# L! _% n: D9 z) Q, E1 N8 U
__________________________________________________________________________
( d7 S) F( S* |) a* K8 t# P. B$ z4 l% ?
Method 11 [! D3 r+ t# j7 v
=========
( L0 P0 c( D0 H0 `# ]# ^6 |+ g0 q6 L! C' h! \! l
This method is most known as 'MeltICE' because it has been freely distributed
A3 h7 @8 n/ L: ]5 a B* Vvia www.winfiles.com. However it was first used by NuMega people to allow: c2 b0 Z5 G: m
Symbol Loader to check if SoftICE was active or not (the code is located
1 B1 O+ g; R) ?9 i- I- s& Rinside nmtrans.dll).
. i# q- _( X7 N2 m# u5 W* s0 H' F- C+ `
The way it works is very simple:
6 H$ _- r# g7 g9 X. FIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! W8 R6 Q* m2 p- mWinNT) with the CreateFileA API.$ W$ Q: S$ ]) n& v/ |2 j, r7 [
7 \; g7 @7 r$ t- ^$ |' C( y
Here is a sample (checking for 'SICE'):
' ?6 `( I7 ?( ^; T% X6 q7 n' Z" e- @5 W- q- t/ S1 k
BOOL IsSoftIce95Loaded()- y( z; @2 h: s
{
# h {2 u1 k, q' l9 H$ j e3 X6 |% G HANDLE hFile; ( [; {" v9 m( R7 Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ j. ~/ I2 e/ C) ?( D; Z
FILE_SHARE_READ | FILE_SHARE_WRITE,9 i6 }( P& J0 E
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 y/ r* T) f1 w% _3 R+ u# L
if( hFile != INVALID_HANDLE_VALUE )
" _3 U- M. ?9 L8 y2 I6 D% r {
% L$ `" F5 g6 @& r! A1 S CloseHandle(hFile);
4 G# r) d8 X. d& ~# \ return TRUE;7 r5 }$ s: q- Y8 {! {( {- E
}
/ u9 }# a/ X+ T return FALSE;5 o/ ]! p9 R' |8 Z: h4 ^) l
}
5 d3 `: s2 ?1 z' R$ N, ^3 j0 k0 n2 l- x7 E
Although this trick calls the CreateFileA function, don't even expect to be
, E9 Q* D& {% L) K0 g9 c7 g- Aable to intercept it by installing a IFS hook: it will not work, no way!4 o* V, i0 q) s- S6 ~4 W
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
! i+ ^# _7 s4 w, uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): ^- W w& V- [, v1 V; ^( ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 m: i& q! @& p# tfield., i! Y2 O7 Y% h
In fact, its purpose is not to load/unload VxDs but only to send a
9 b3 M9 X+ n6 \: y' zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE): p' W- G' f; ~: B0 B
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, X) m0 u. |6 t4 h8 ]- |0 M8 q6 ^to load/unload a non-dynamically loadable driver such as SoftICE ;-).
{, I) Z* i( |; u" ?If the VxD is loaded, it will always clear eax and the Carry flag to allow
4 {# P/ L/ K O5 Mits handle to be opened and then, will be detected.
$ {; q6 r8 A$ a+ [You can check that simply by hooking Winice.exe control proc entry point3 N" t. P* ^' X
while running MeltICE.
! c" D& h' l% `' X. d' {/ u; z" ~2 W2 J( A7 ~! a: J+ K' y
8 A3 a* N3 ]/ Y# a6 p, ? 00401067: push 00402025 ; \\.\SICE
; W& U/ d% \1 ]2 M/ C+ t5 W 0040106C: call CreateFileA
. l& w7 y2 d1 t2 X/ P5 O 00401071: cmp eax,-001! R' D# s: T. u/ f
00401074: je 004010919 Z3 h" p3 Z( E2 \) v7 S: g
1 P6 e l: G, `4 F7 m, x! ^, ~7 e
$ m" F8 r+ R% eThere could be hundreds of BPX you could use to detect this trick.) J" m6 l' b" f& }5 R
-The most classical one is:
X5 J% q; I2 F8 e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 ?0 Q$ P' ~- O *(esp->4+4)=='NTIC'
: \" z) q: m4 R5 a
1 t$ b+ v+ A+ J$ L-The most exotic ones (could be very slooooow :-(, M3 a, e" r% v3 c
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 [$ H' L, N4 n6 F l- X; J* g8 X ;will break 3 times :-(. a; k5 e! z" h' a! X- O
% T: ^( Q* O" r) {3 v3 f' m! |-or (a bit) faster: 7 o4 B5 n# M" e+ I. Z6 l$ [- R- o
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
7 \* N6 d2 v; c; ^& ]& V9 [ J3 H7 y5 m6 u) O! g1 t0 ?9 N! i5 W$ w/ p5 s. W
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
2 i1 R$ q/ g' V5 z6 J ;will break 3 times :-(
% R* |6 U) i. z( k6 O' R, X5 n# l( a
P% r. G; z' b. n, w7 t, W6 z' H-Much faster:, n7 g w' ^ J
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 U) i8 P8 q4 p9 u o7 s) `! ?. b3 x& F& V( X
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ \" i& D3 x" h. ]2 q" B$ ~function to do the same job:! _7 s% e8 [# J+ {
2 s# V, k2 ^( ~, I% X: n. I3 C. i push 00 ; OF_READ' |& o5 g1 ?' F% V
mov eax,[00656634] ; '\\.\SICE',0( F2 y5 y3 l: J- ^/ F
push eax& h) g: v# J2 C! K" A& ]! o
call KERNEL32!_lopen7 F1 p( v+ f; F* U: d* Z$ R
inc eax8 {: }( b2 Q/ X7 s- }# p
jnz 00650589 ; detected B" L4 }( i. e
push 00 ; OF_READ$ e5 u. t+ L# X0 ?5 `3 Q9 Z8 Q
mov eax,[00656638] ; '\\.\SICE'4 ~+ p9 A' Q: \* z0 s7 d8 m
push eax
1 x& c. ^6 T5 G+ d* C0 x# k( J6 F call KERNEL32!_lopen
5 ]1 d1 b# o, a8 j$ r9 H7 r3 _$ p inc eax
2 b/ T+ r3 n; ?; v- t7 H jz 006505ae ; not detected) O8 u4 P6 L. Q: v- g) w
2 {5 p3 j; P# Y3 [
* s: Y, L |6 T: _8 s__________________________________________________________________________; R, Y9 J' V- i: {6 L; [6 w9 |+ S, v
0 G$ ?9 H+ z1 ]( u* }& z
Method 129 Q6 n7 {/ G0 b; z/ W, O
=========( k, s% E5 S n8 `' f
* B' P; X0 P* c; d# H$ O6 T7 o0 }
This trick is similar to int41h/4fh Debugger installation check (code 05
2 g) f3 b3 p0 D0 J& 06) but very limited because it's only available for Win95/98 (not NT)( H: Z& B" N0 u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 ~" H# M* H" q( H/ d% g
9 K0 ]# z& \1 u% Z push 0000004fh ; function 4fh( V; Q) F h% Q6 e, ^- P( s, Y; [
push 002a002ah ; high word specifies which VxD (VWIN32): S1 r4 g o$ |5 Y3 T& S. u) {
; low word specifies which service7 s; ~4 v6 m: D( c, p* L- _
(VWIN32_Int41Dispatch)
( U% N% L* t2 M4 V call Kernel32!ORD_001 ; VxdCall U3 \* u( M8 K& b/ {& h
cmp ax, 0f386h ; magic number returned by system debuggers6 X6 n& t! ^& N1 Q/ W) o1 m, `
jz SoftICE_detected! F5 w9 A( x; B1 |; C0 X- i
5 ^4 n0 ]+ a5 @: h+ N: I% N
Here again, several ways to detect it:- Y0 [& y. a" p
+ @3 E1 n+ T; ?. n6 s
BPINT 41 if ax==4f! ^% F2 |9 `' O7 q5 d! m& j
8 v: C; M5 i4 `- I- P8 H BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
1 B9 Z6 l/ f0 ^. o q; A E
, o* l) V9 J0 B# a# L- A BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A( ]: c" p4 @2 u: W$ X& M: f
/ z# q0 f" d* @1 i4 c; {* n
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% g9 f, I5 x- A7 D* n' _
' o+ V) t. o& g7 a__________________________________________________________________________% }; S9 P) ^, l
S9 V2 L8 Y ]9 ]. f; M3 YMethod 13
; l! n! n! B. j$ M- t=========
5 s# W+ \# v. C3 |. \( n8 G" L4 Q5 F6 V
Not a real method of detection, but a good way to know if SoftICE is
. E- k& x- ? E0 p; k& ~+ \8 G/ @installed on a computer and to locate its installation directory.
2 r) p( v3 _, V0 ~( @, L* V' K$ pIt is used by few softs which access the following registry keys (usually #2) :3 A$ q8 C: v/ b+ W" |
, w5 g2 w' l: X" B1 i5 R4 s
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion }# q6 E+ F$ H' j0 X! h
\Uninstall\SoftICE6 W* ~. v( X) E. ^4 ^) T. C: P
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 H0 @% K. P8 f# S8 z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; d5 S% S8 F ^" y4 F9 s
\App Paths\Loader32.Exe5 h7 |7 ]2 Q/ [" [: v- y% g
1 I( K$ ~- [% g$ e" \5 p
% T o; ]5 O5 W6 Y' Y! ANote that some nasty apps could then erase all files from SoftICE directory1 Y1 A7 N6 |) A7 a
(I faced that once :-(
; I# a) ^( |8 U- n, a2 x# V& A; R$ y) H
Useful breakpoint to detect it:9 Z* H" R) n9 S( a n) [
$ g7 v5 @% f6 V3 a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 V9 J4 O) \$ V0 h: D. G; P+ D
) g- I; L# B! Y/ q__________________________________________________________________________
1 p c) J. F! I& `" y
' ?+ g1 {2 W% I8 T# G! K( X7 T0 r- e6 W, A7 L/ A! [; R
Method 14
7 z' I6 }/ `, _, m3 v=========1 r/ F0 j6 i" V, ?! m5 V+ N( q0 Z$ t
/ V- O! [; S; G8 B: ~* l/ t% jA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 { Y `7 v. }0 A7 w" P" dis to determines whether a debugger is running on your system (ring0 only).
' t6 O6 I: e6 L2 o* d2 y, I; l# o# s& L# p
VMMCall Test_Debug_Installed, n5 C( [; _/ b# Z2 s# Q: Q3 ]# p# X
je not_installed% i9 w" W% j' G% C" d4 |
( n3 L( b% s# b/ ]' ~9 g" z Z
This service just checks a flag.: Q2 u V* u" X; l' c+ ^
</PRE></TD></TR></TBODY></TABLE> |