<TABLE width=500>& a6 E s; o" ^/ r: p$ s3 A
<TBODY> R$ J. w& d2 C. r
<TR>
4 L5 j5 v+ {, h5 }* q; [<TD><PRE>Method 01
1 u& t- p! _; }6 v=========7 R) b9 D! A2 P9 Q2 P
2 I) b/ \8 u3 t3 c% I' dThis method of detection of SoftICE (as well as the following one) is' R7 z( S' _: `
used by the majority of packers/encryptors found on Internet.7 a7 u! O1 P3 Z9 z9 i
It seeks the signature of BoundsChecker in SoftICE) Q7 a3 A9 t0 n( X/ n! M
& X6 P3 }8 o% \' p# F mov ebp, 04243484Bh ; 'BCHK', X5 C# U5 ]$ d) ^ K$ Y" D
mov ax, 04h
$ J8 }- ?# c4 K7 N7 u4 ]4 u2 F int 3
- j, V6 L; j% n7 g `& ^: |3 P" Q* E cmp al,4
# s8 C7 E, V* F5 K. T jnz SoftICE_Detected5 j4 \- q1 z3 T- w2 d1 u
7 ~! n) s4 l- h- \3 p/ W( A
___________________________________________________________________________$ L$ l6 y9 y5 J+ o/ O) q+ n) N
5 `9 O6 k* J7 _9 c
Method 02
8 I4 Y/ r% B3 P# M$ x; k=========
2 ^1 G' m3 k5 ]$ N2 v! \9 ~' U5 o& } P1 _: }% \
Still a method very much used (perhaps the most frequent one). It is used- j- _' V6 F& Q: B+ |* w2 v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* A3 ~7 S) X3 s7 q, n, ~8 }% Bor execute SoftICE commands...
4 c6 }1 X- |5 j8 fIt is also used to crash SoftICE and to force it to execute any commands5 L t, J! X# K0 _; v2 A, M
(HBOOT...) :-((
3 `0 _8 e- v& G+ R+ b% ~% r( `5 W" f3 n9 R5 Z: `, c
Here is a quick description:
( d/ x( }+ U u% \-AX = 0910h (Display string in SIce windows)
/ U+ L8 E4 e9 g/ Q3 h# X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) }) b+ r0 f: g1 v) u4 Y# W2 E-AX = 0912h (Get breakpoint infos) D* L; O% R; a. p( i8 @& ^; n7 T, f
-AX = 0913h (Set Sice breakpoints)7 B4 n# l \4 V
-AX = 0914h (Remove SIce breakoints)
$ I- P: N8 Z0 U) O- F& p' u! \* g) g" S/ B! H, J+ D; o3 ?
Each time you'll meet this trick, you'll see: q# m+ V; j: { ?) x7 {$ K/ O) p
-SI = 4647h
$ T, s3 Q+ s* S: r6 O: |-DI = 4A4Dh
+ M, }0 L9 y, E! mWhich are the 'magic values' used by SoftIce.
1 U# b$ s P6 |4 AFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
7 O* V1 [) T9 j3 v3 `0 Z+ q2 M4 `9 \
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 M. B$ Y& `2 C/ ]: P4 gEnvelope utility use to protect DOS applications:$ d$ E6 f P9 m# y3 z
: R* {; ?- m& Y1 Y/ J" r
. T$ I- e1 f% s4C19:0095 MOV AX,0911 ; execute command.
9 G. h, g, u4 c4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- J! ]9 J4 b6 G7 W9 Y) @7 `
4C19:009A MOV SI,4647 ; 1st magic value.% `: {% O( \! ]( X
4C19:009D MOV DI,4A4D ; 2nd magic value.
, S6 t0 A- T$ l9 `+ f4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 z) o4 I' @/ `: F' {8 I4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute6 s. e: u% i/ g! ^% A8 M, r
4C19:00A4 INC CX
& r) }4 n0 J) H. n* d) K$ b% R6 q; |4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
9 y6 }9 }; G* t& i5 w( E0 l4C19:00A8 JB 0095 ; 6 different commands./ h: c1 Q0 b, {* j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
# e4 @! u8 H: l& C4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( Y( V# p8 g2 e# A2 t6 m. {
9 g) v0 r* d, RThe program will execute 6 different SIce commands located at ds:dx, which5 q' J2 ~; j" h: Y* W. [- j& Q/ m
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 c' H: o% R5 P, @2 q
2 F' x; {4 N1 B0 }! p- n$ n$ i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! L) G' o, ?, B9 {7 @/ \" `
___________________________________________________________________________
. S) {. R& f4 g- e5 ]6 x* U9 s7 Z5 u
: [) k9 P, m& S B$ UMethod 03+ R* z* F3 }6 a0 F9 F) t
=========
6 H& A8 q3 ^: q3 @; C7 Z* Z+ O7 l
( P+ M0 y# B: L/ D8 bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 k4 V0 Q/ i, W(API Get entry point)
8 c4 `: b( n0 v m4 w
! V0 e! N$ e1 j4 J h$ U0 D; ?# j
+ _/ a1 h- W) ~. t xor di,di
! I2 {2 S0 W! A+ `4 E mov es,di( Y4 [& y& w& j$ T3 e4 J& g: }
mov ax, 1684h
3 Z5 S; s. H; t9 r mov bx, 0202h ; VxD ID of winice' ^+ s# F' z1 }/ q# Q2 p5 g
int 2Fh
" K1 Z9 p" ^/ S; u1 C0 x mov ax, es ; ES:DI -> VxD API entry point0 V* v o, i% J! T# q2 t# e
add ax, di
0 t1 U+ \+ i- J* \0 E% O' g, H test ax,ax
# q' |. {! p; f# j& x" y jnz SoftICE_Detected2 ?2 P8 C% f. M6 m5 Q4 B
5 a' [$ f7 y8 C4 _7 `___________________________________________________________________________# M5 j% p& ]4 j
6 T& }1 h) m$ wMethod 04/ R6 O/ {8 l$ }+ t d) @7 d) z
=========8 w1 E M+ l) d; I' f* `1 f7 u
3 ?! E; O+ R8 i' j6 O% aMethod identical to the preceding one except that it seeks the ID of SoftICE' m% n& w3 H4 N7 G9 s- V
GFX VxD.
% B+ B+ Z" L9 v( F0 h) X* {$ p+ @ L- v2 Q. v( | U
xor di,di
4 _) J. }" ~# f; i2 j9 ~1 s mov es,di
; [, E1 C9 K; z+ W/ ^ mov ax, 1684h
/ F5 o& d9 u% _9 j5 z: F mov bx, 7a5Fh ; VxD ID of SIWVID
! c7 G# X9 O5 D' c int 2fh
. G! O8 d* y t* p$ h1 H mov ax, es ; ES:DI -> VxD API entry point
: I" Y0 K9 x5 |' | add ax, di+ e4 i8 A: z2 }; U% b) c
test ax,ax
. @4 b( S6 p4 v+ Q2 L P/ F jnz SoftICE_Detected
3 R+ ~! ~4 L4 U. |* r" u4 ? h/ l& r7 j" `) I
__________________________________________________________________________
- r7 M2 q: C* Z5 m$ s! C* w8 o: G9 G _
; ^8 u5 l1 [2 x, w- b9 v. _6 M6 L
Method 05
6 Y2 }# o! Y* `. K9 e8 | x* H4 B=========
! }2 p! h U, z8 Y7 v, ^! h/ B; }; X4 U5 s* E/ u% |6 l1 h( e Y8 w4 T
Method seeking the 'magic number' 0F386h returned (in ax) by all system7 A0 [/ U$ S# c9 \
debugger. It calls the int 41h, function 4Fh.
. w( j& k0 F5 }$ ?- Q* eThere are several alternatives. 6 Q% d( |/ n) _0 M. Q7 y* c
w! a0 b: W2 z1 l+ l
The following one is the simplest:2 T" c; ?, c5 l( \; @
7 Z2 `. t7 E- J! z7 ~
mov ax,4fh
& f# |; b. j. }2 z int 41h% S9 O* X4 M8 w* t
cmp ax, 0F386
2 ^# q' P$ V" {7 Y4 M jz SoftICE_detected
6 R# W7 A+ j( C( U6 @+ }9 T1 {, |. s$ {
, @* s# L- X2 S' j& N" S% ~
Next method as well as the following one are 2 examples from Stone's $ i3 S. q# Q5 U0 B1 ^
"stn-wid.zip" (www.cracking.net):
$ k' Z; S% ?' l# z( H2 U( T3 {: s! X2 C9 S3 y
mov bx, cs/ G$ ^: N) R3 h8 E, V
lea dx, int41handler2
( [* |% s" ?) ]6 H$ \, S xchg dx, es:[41h*4]
% x& \" e. K+ W0 g6 [$ @2 Y; \$ l xchg bx, es:[41h*4+2]
) h; [' {9 p, k; M' w, w+ l mov ax,4fh" \- f/ Z4 K: d( [
int 41h
' s/ a1 ^) E, f+ d; r xchg dx, es:[41h*4]
/ K! A, N) Z8 o xchg bx, es:[41h*4+2]# @) l2 r* ]3 b' h6 N
cmp ax, 0f386h" C h0 O6 U. m6 `% ?3 Y
jz SoftICE_detected7 ^: u3 ]: a$ |9 d- O r: A
! N# Q& V: j, B$ Y g1 O! O2 nint41handler2 PROC6 R9 X/ N6 x! @2 Z7 o' g' |
iret# D4 A/ Z# ~& }
int41handler2 ENDP
v7 R" x' x' n+ b( Z' A: G: W/ b& Q/ S
+ J$ U8 G+ v* Q( F* s0 B$ Q* v_________________________________________________________________________
3 P) T9 z* U/ @2 S- h! a5 L- ^( p# [- I& X: X9 Y& h5 S
4 f9 }: P' s: U9 L* }( p
Method 067 \4 a+ u3 D+ f: p0 W }
=========
3 q' Q7 Y4 D/ q+ {: B0 ]8 ^% x2 I4 w# `9 s' I$ G& C
0 p1 X4 ~+ |0 `2nd method similar to the preceding one but more difficult to detect:; U, j! y0 R4 }& J
- x! Z8 I" n2 C
% S3 t2 ]; }2 `int41handler PROC
2 F7 [$ F8 ?/ n W7 ] mov cl,al% g8 T6 R1 t! u( n& n4 J& b
iret0 A7 h4 p* N/ J
int41handler ENDP
- [4 l9 s% |# b+ |
: }/ t% g" B5 @9 E" ~4 G7 c. |# X; V' q6 r* U f5 G4 k0 x! i
xor ax,ax0 o( p* D$ L$ G: T5 b# Z7 `: A
mov es,ax4 Q$ R3 R( K# B+ q Z% y
mov bx, cs) e- U4 O" D) E' l. K6 U: C
lea dx, int41handler# k, M% x& ?6 e/ o2 g
xchg dx, es:[41h*4]
1 ~7 W2 L2 z, m2 o4 R7 H* A% ^6 L% n xchg bx, es:[41h*4+2]) d) k& \1 D% d$ Q/ z9 m
in al, 40h) l- o( \2 A+ S* C0 n3 J
xor cx,cx$ U3 t s) B* [# d5 ?7 Z
int 41h, ^6 R9 `2 w& G( [/ n
xchg dx, es:[41h*4]" \. y1 H7 T( E- w
xchg bx, es:[41h*4+2]+ V% E; G1 U$ v( }4 v
cmp cl,al1 d1 r3 Y- C- t/ j
jnz SoftICE_detected
: B: n& `% G$ X# z2 P' K i( }3 }6 Y8 s
_________________________________________________________________________& x5 S( Z K, o2 o5 A
2 W D' @3 G* a* xMethod 07- Z9 e o, c6 M' d
=========+ ?) x3 `, O" H5 i" p7 ?% w
" X4 u: o6 B2 M- F; U( s3 lMethod of detection of the WinICE handler in the int68h (V86)
5 c" `( F7 K* l% M6 q. }3 ^0 q) y: T; w# s( k; a
mov ah,43h' ?& ?% z; I; I
int 68h
3 C Y3 J; B \1 X1 ? cmp ax,0F386h3 L% J* \! j4 x8 Q4 D+ C) l& i9 T
jz SoftICE_Detected+ v- X" ] O" ? m4 R" ?- s
0 ^* ~1 D9 B9 d8 h$ x$ ]
: a) C0 k$ d4 L* n& \5 I, H=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 N w' |' [4 R/ g, V$ C
app like this:
; M9 O7 ]; Z0 ^4 V: V5 w* E8 {- ^3 o$ Z5 j/ f4 \" e; R
BPX exec_int if ax==68( ?- G, I$ s3 l7 N, C
(function called is located at byte ptr [ebp+1Dh] and client eip is o+ S' k: Q( M+ s
located at [ebp+48h] for 32Bit apps)& D- G1 r" B3 z [
__________________________________________________________________________
4 s( F5 J5 G0 m) N1 U. \0 u* t' p" }/ |, S& m; b& v, C
2 \2 I8 Q; ^7 D1 N
Method 08# v' f8 P4 \' j+ R9 b* Q. |3 q
=========
' O4 i5 l( j4 |8 Z8 k$ `4 |; ~/ X1 T B
It is not a method of detection of SoftICE but a possibility to crash the
2 H w# G" N7 f$ H8 W2 C, X$ ^6 Tsystem by intercepting int 01h and int 03h and redirecting them to another
" s; p4 q$ D7 Uroutine.
3 Y/ A3 p$ A2 o" sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
1 P; j+ O b Y! I9 e4 fto the new routine to execute (hangs computer...)5 \ ]# P3 o M- F. m% ~( m
* o( l! N% i! k4 r' ~0 _" S
mov ah, 25h a3 ]% g, c& f6 U- C# h. W
mov al, Int_Number (01h or 03h)
/ E. |; K3 w. p" T( v mov dx, offset New_Int_Routine
6 e- p5 M. ]6 ~ int 21h9 e W, J0 n. |9 Q( f' c# A
* G) E0 v/ F; h( h' s+ I__________________________________________________________________________* q$ O" a8 h# r6 T2 |8 V+ G6 Y4 U+ G. @
1 b9 H9 t" R9 y% ]2 k
Method 09( t9 g1 {+ p: m1 E7 r' P h# |
=========
1 D4 O' G/ f* i, t5 q: C
5 s, Y. z3 o/ x: `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
4 Q* a; w6 n5 M, F& I# Tperformed in ring0 (VxD or a ring3 app using the VxdCall).4 z5 l6 f+ j8 m E% U
The Get_DDB service is used to determine whether or not a VxD is installed
, c6 K8 f' b& v% X8 b% S; \for the specified device and returns a Device Description Block (in ecx) for" ~" H, N k0 |8 J! i" o. j
that device if it is installed.
' y- k7 n0 V w9 t
' n: v& ]" F' l0 ~' r* G) v- } mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- `3 l- Q7 R) K# e+ {8 D# a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
' x% t( i# @; ]. F VMMCall Get_DDB
# A% P/ k! u" T mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 U9 j$ g2 M8 ~4 f1 q0 ]
( c# X Q! p4 x8 @/ Y- }6 ANote as well that you can easily detect this method with SoftICE:
5 Q4 j% x+ E) P: _ bpx Get_DDB if ax==0202 || ax==7a5fh4 v* E( O# Q: ?, T
* w% I% q7 L3 o. \& R8 o& N
__________________________________________________________________________
. N& v: N$ p. d+ e2 K# s; a t0 ] N; n" W* F! \1 Q4 S3 o
Method 10
% l( a6 e6 q1 m+ {: m=========
% L9 F5 \$ I0 B
8 y6 a. ~! a# V; g$ _=>Disable or clear breakpoints before using this feature. DO NOT trace with; \) Q/ H! u! I/ c# p% e7 B9 I& |
SoftICE while the option is enable!!
, S, H' `5 Y- T5 n: Y- ?/ d3 v6 ~8 n5 R
This trick is very efficient:6 i+ q$ v' @" s, j, Q
by checking the Debug Registers, you can detect if SoftICE is loaded
" B# y/ r$ X1 G# z1 Y8 D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: l P1 H8 j) n* F: E+ q
there are some memory breakpoints set (dr0 to dr3) simply by reading their
/ _9 i$ N" H1 {, K4 }# J4 \: Hvalue (in ring0 only). Values can be manipulated and or changed as well- B! q5 }7 w k
(clearing BPMs for instance)
/ ~# E5 S+ t k3 Z) W; E( j9 y" `1 D. F* X7 }) j6 J$ J
__________________________________________________________________________
- h# i' ?/ @8 }( k$ @( ^, h3 K4 }9 i" o& X7 A) x* x
Method 11- I' D ~- |0 M" E
=========
2 U! @+ G1 z% t4 c% z+ Y
6 z2 _) {- h& E' DThis method is most known as 'MeltICE' because it has been freely distributed
8 K% f% f- h" x! q2 U6 jvia www.winfiles.com. However it was first used by NuMega people to allow
# w: J+ s2 K4 L' H7 Q) KSymbol Loader to check if SoftICE was active or not (the code is located$ V2 o/ w, F, \" E. y
inside nmtrans.dll).9 Q$ P8 s3 p s* ^0 p, Z
; J5 }& Q0 A5 t$ i6 | v9 [" a
The way it works is very simple:) h# c( ^( C6 H' [$ j. e
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 K& o8 q1 E9 E5 P
WinNT) with the CreateFileA API.# k& a0 Y& v+ |/ C4 a' _
' ?# m/ Y4 ?1 h+ d% r
Here is a sample (checking for 'SICE'):5 [- v" l; k- Z7 P) D$ p. B
0 q( u0 _$ y' L; e3 P8 M# ^
BOOL IsSoftIce95Loaded()1 C5 J9 H8 f- b+ d r. P/ z
{# I& N9 {: U5 Z+ {/ F1 P; L
HANDLE hFile; $ o3 X5 D# s% a3 o; p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! X& \+ Y" o7 T- P6 ?" `9 r
FILE_SHARE_READ | FILE_SHARE_WRITE,
. F) \; U- \5 ~9 l# D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);. z% R8 A: n r. S: I
if( hFile != INVALID_HANDLE_VALUE )
) c) ?8 N: a# T) v" k {8 M4 r2 G* D" q! _5 X, T3 F- u
CloseHandle(hFile);
. V" l- K a0 x; P I return TRUE;
( v; S. l; E; s }1 I; y3 _0 K8 d& Z/ Z/ |
return FALSE;$ Z: Z+ U: ~3 I1 s( [" ]5 w
}" \7 U; y( c, n8 y! S
6 b' E5 t1 S+ J( a- x6 g5 j& {
Although this trick calls the CreateFileA function, don't even expect to be
" Y2 I x# e8 W$ A2 d2 r& Vable to intercept it by installing a IFS hook: it will not work, no way!
( M, X( Z6 R x8 W2 TIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 p6 l6 j, b8 z5 z9 xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 u% e3 q3 ^* y3 V6 X
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! W1 N1 Z |1 X! V) Wfield.0 g* F( U# S0 Z# x- L+ @ t3 k+ Y
In fact, its purpose is not to load/unload VxDs but only to send a
1 P# x/ v4 G! h' y* d+ }7 FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ O! h9 f2 ^9 x
to the VxD Control_Dispatch proc (how the hell a shareware soft could try) \; D3 x0 Y: S: t3 D8 N
to load/unload a non-dynamically loadable driver such as SoftICE ;-).* }9 X( d/ H# Z' X
If the VxD is loaded, it will always clear eax and the Carry flag to allow
* @4 z/ o! X7 s- k7 Oits handle to be opened and then, will be detected.6 R& r, A/ |/ B/ X" U5 h
You can check that simply by hooking Winice.exe control proc entry point4 y" u* {% y/ t! _7 t/ d
while running MeltICE.: {; M+ ]0 R% l+ k
4 l% Z7 {) K3 a" c1 }
/ ~( y% P+ j7 `. C8 \/ R
00401067: push 00402025 ; \\.\SICE0 E! ^% k8 N7 N8 N; k) X
0040106C: call CreateFileA0 |' U* O& g; I( s7 W1 S
00401071: cmp eax,-001
7 u1 T" e* L( ~0 a- @0 P 00401074: je 00401091
0 B6 a1 \( V$ f' A% x- \! s" ^
2 B! K5 [- L1 ^; U+ n6 L3 T; ^, q' K. S" q! }0 E
There could be hundreds of BPX you could use to detect this trick.
8 C6 f. X+ O; N4 m& b-The most classical one is:. h/ {) s) I* P
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||$ L6 x; y* J2 u- K9 ^) A4 b+ X8 ?
*(esp->4+4)=='NTIC'
6 I! [6 h$ c8 `" \# J, R! D
A2 ]7 I" j* E. o" {$ J-The most exotic ones (could be very slooooow :-(
" G# L# q8 |4 _4 W+ H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ) y- N9 |3 R5 a6 R: ~7 x
;will break 3 times :-( X& I& c' x; D- B9 V
" G5 `: A" F" I& i2 O" c
-or (a bit) faster: 0 t! X+ Q1 M# O6 f/ m
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! f9 T% r! w8 L0 F
1 G9 D. I* K; r( D1 [# J, O BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
p6 C" N" X- ]9 Q6 j, }2 o5 U: \ ;will break 3 times :-() M, Z" e6 G! T$ i7 c! b& s* |, m
# n3 G+ _6 }6 M6 n _. E) ?* Z-Much faster:& |3 p! A/ f: \/ B: L
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV' e% x# r! V. |
0 h$ L% ` z& L4 ]5 E
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
; `7 \% c. q& K+ |3 Pfunction to do the same job:" f# t$ [# K9 Y* D# L+ [
1 Y& G( s4 K- N5 ~
push 00 ; OF_READ' ?+ J' u, J9 l9 z- G! |3 U% D
mov eax,[00656634] ; '\\.\SICE',0
# w% C7 y; J1 c push eax
, p( k, J, |! k$ s( D8 n1 t4 m call KERNEL32!_lopen
7 Q' r( l/ _2 t5 I( o inc eax
1 h' a+ O! d& U9 r9 Y jnz 00650589 ; detected; [+ H+ V+ R X
push 00 ; OF_READ
# _6 K$ e8 Z% p& F( L6 ~2 _. w mov eax,[00656638] ; '\\.\SICE'9 }1 R' k# ?( t
push eax; _7 l+ R V$ d. |
call KERNEL32!_lopen
C) O3 R' d$ o+ F: ^ inc eax
1 T& a0 z5 ^4 _; f% p jz 006505ae ; not detected5 C3 X3 c1 M5 m& P5 Z. g2 ~
( n9 D, [8 ^( e- u
8 P2 ?! A w1 |; H9 G
__________________________________________________________________________
. I8 C7 H2 @( ~6 O' Z r$ C2 G5 _, C
Method 12: i' E) @7 K0 {7 Y$ U- }. I. p
=========$ Y# P% f8 i- `- g! \. E7 y# [( B! F0 B
0 y4 q4 [, @" E1 _* _
This trick is similar to int41h/4fh Debugger installation check (code 05( o& w! _% H. S& F: y0 R7 `$ S
& 06) but very limited because it's only available for Win95/98 (not NT)$ @* ?( Z/ }9 q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 a" \+ \8 m+ [: n0 E9 K
. ?9 c2 U& `: Q$ \4 n
push 0000004fh ; function 4fh
8 }1 \- g9 ^4 C2 Q7 |9 } push 002a002ah ; high word specifies which VxD (VWIN32)2 i0 }* S8 H6 |
; low word specifies which service
H) Q7 v8 t6 {- U4 G( w4 L' z (VWIN32_Int41Dispatch)( t& H. r3 Q4 q; O; Q* \8 Z; t8 u
call Kernel32!ORD_001 ; VxdCall
5 T" R, L7 C: M6 i/ s& C1 T/ e cmp ax, 0f386h ; magic number returned by system debuggers
' ^8 I/ `/ R4 X! L jz SoftICE_detected. } |' u1 h2 e$ B
1 t4 J1 ]4 ^+ @! n e; K9 m
Here again, several ways to detect it:
- {# T+ T7 a7 ]8 b' ]
W6 A# Z% i# Y5 Q$ Q2 C# c BPINT 41 if ax==4f
6 o C. [2 G4 l# I
3 s; i0 ~1 G; ^2 f V8 b BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 W7 b4 o; x4 ^
- X8 ~7 L) s6 e) ?+ c# S BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 w! @+ w( E7 o3 N0 s/ S2 v1 q2 _
U: A" D" V! J: U( L$ K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) V: a5 n q! T
* z- ^; J$ v1 N5 @__________________________________________________________________________& q0 R. K8 d. z6 P' D" o% P# o# p2 A
* X/ E+ |3 Q+ K7 e6 zMethod 139 F1 t# t* _3 e) z6 Y6 c
=========: J" ?6 a+ I& h3 v
# `1 I9 e: j' I+ z% H
Not a real method of detection, but a good way to know if SoftICE is
" q3 N! Q# t5 [! V. p5 Binstalled on a computer and to locate its installation directory.$ y: [! M& A1 S- o: o F+ K3 ^ {
It is used by few softs which access the following registry keys (usually #2) :. b6 }: }6 {, |# L( L
, Y4 d& r- _$ I- s! X- L4 D, M-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! G- x. B8 Z+ y: x\Uninstall\SoftICE' D. J9 n5 K- @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& W7 D" O" }) g( F
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. L) V# J* G3 U3 _- Z- ?$ X
\App Paths\Loader32.Exe( M- X/ x% b, J& m8 T
# m! s& v8 }4 N% n4 K5 `+ u
! {. i& V: |% d: |9 W$ c% b2 x+ dNote that some nasty apps could then erase all files from SoftICE directory
# }! @* F/ h" }8 [6 P(I faced that once :-($ W" b1 X7 {; d' d5 d6 \
2 S8 L- G( t5 I' o: b+ u4 a! C9 sUseful breakpoint to detect it:; T9 t4 Q' o1 W; f3 C# a
$ w' D8 y3 c; c4 v BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 T Y" {5 R' M$ @- s$ K
5 ?2 Y6 D8 s% x: w1 j
__________________________________________________________________________7 H7 g+ B- Y2 k2 t9 R
8 u: M4 n6 o. U
: ^% ^8 }/ n9 K3 }4 }
Method 14 - o3 d: U6 {" V4 ^$ A
=========
- \/ F) x6 s8 B$ }5 w; B6 h0 z4 W( F( x- R5 t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) ~ [& O J0 z1 I# d5 g0 `9 v6 iis to determines whether a debugger is running on your system (ring0 only).! r% \/ z$ e# [2 Z9 v
9 q1 D& n8 r$ O x0 ] VMMCall Test_Debug_Installed
- Y# \* w" j& T: N- U je not_installed) z/ d& {1 G6 E% q& p8 O% Q! _ V
2 L; W% T; B. [/ R% t: C
This service just checks a flag.
0 A1 s7 p+ E3 }9 l# @</PRE></TD></TR></TBODY></TABLE> |