<TABLE width=500>
/ f1 l/ B1 w. R( o. X I<TBODY>& H- m( m9 ]6 p3 N5 {: m) K
<TR>$ m+ ^+ T# M# b8 a3 R `7 S
<TD><PRE>Method 01
. V( P% q$ V7 G* h/ ]=========
& s3 g" w0 e: S# @6 }
4 j: n$ F% y- T0 o7 AThis method of detection of SoftICE (as well as the following one) is- ^8 K' y5 P) v& A6 `, K5 n: e) _
used by the majority of packers/encryptors found on Internet.; S) b- P0 y) O& Z
It seeks the signature of BoundsChecker in SoftICE
" [) e5 M$ H: T2 ~3 j5 ]
5 f: P$ w% z) j- V# [ mov ebp, 04243484Bh ; 'BCHK') ?' n! t2 z: I* J- W9 I0 {! \
mov ax, 04h- H/ T$ m5 Y0 o% \$ m. `3 W
int 3
5 }: j8 Q* l4 B% z# P8 N cmp al,4( v. }: S/ x R& e% r
jnz SoftICE_Detected9 ^8 j: [# B4 i6 d
7 n2 v( b+ Z& i* S8 }7 `+ X! ^* k) J
___________________________________________________________________________) A+ k$ d+ c$ Z% x. p% X
4 ?8 [/ z* f& k1 ]; s' T5 S" t, mMethod 02
* v1 ]0 v B* V3 {. j=========5 n( P: {4 U) d1 Q
; j/ R4 Z# S+ r* R5 H' S. o6 hStill a method very much used (perhaps the most frequent one). It is used% \) x7 |2 V6 ]4 H8 J, l1 B
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' u) d" W# `! j( M: m9 F3 X9 v
or execute SoftICE commands...
[" n/ t( a* }% q$ U" TIt is also used to crash SoftICE and to force it to execute any commands
: `; [( b8 v1 i(HBOOT...) :-((
% L, `" G" ]" G4 a6 ~- F: v, A+ d, u+ P
Here is a quick description:& h+ A: s+ D( v4 A& ]
-AX = 0910h (Display string in SIce windows)) |2 @6 O9 q3 g- B( f+ h+ n
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: B; E* t/ v7 _# W+ `-AX = 0912h (Get breakpoint infos)' Y6 S% n* _! U6 y" ^8 Z3 P7 n
-AX = 0913h (Set Sice breakpoints)
# P3 d+ z. s( ^1 U-AX = 0914h (Remove SIce breakoints)0 L3 u" M, ]0 P, I
; B8 ^5 c; o, r \6 ^
Each time you'll meet this trick, you'll see:- H" L* T. \( x+ H; r" m5 k
-SI = 4647h
/ t$ [0 g! O- `0 J-DI = 4A4Dh1 l6 P1 s) r! W) q
Which are the 'magic values' used by SoftIce.
" P' E6 G6 N' }/ R3 L! J6 l. WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 S% x* e$ m6 G" j3 t5 n* ]. `; O( p! d; g
Here is one example from the file "Haspinst.exe" which is the dongle HASP9 q* P+ i2 m3 r# `4 l
Envelope utility use to protect DOS applications:
4 D }. U6 T1 i
& L( P9 N1 S2 U1 f( t1 ]
% B3 A' J7 \8 e4C19:0095 MOV AX,0911 ; execute command.8 f' e d$ X! B; v3 I# l! n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; k1 a% V1 u, e( S& t% b) z4C19:009A MOV SI,4647 ; 1st magic value.
% `7 s, v j% V0 y5 O# K" ~4C19:009D MOV DI,4A4D ; 2nd magic value.
% `8 C n4 [4 h' G2 ?; Q/ |4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 \1 }1 P# e7 U1 P! X6 O4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& x |+ A" Z' o. J' a4C19:00A4 INC CX7 h0 z4 q, |9 L) f, k6 Y2 a7 ~/ J
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 s2 K# B3 G0 i" I+ z- J4C19:00A8 JB 0095 ; 6 different commands.
, c W* D9 }- c( i9 R$ X4 w4C19:00AA JMP 0002 ; Bad_Guy jmp back.5 x/ D- K% T4 W
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. @$ X3 C I. W0 L; s( t1 u; X+ O
& {% q3 f# R' S7 U* sThe program will execute 6 different SIce commands located at ds:dx, which* a* h2 n4 X& n% L. p, h! ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
1 F' h+ u9 f2 a" \, n
% R) z1 x/ I) E/ q" ]9 v* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) q2 d& U0 W5 C5 q7 b
___________________________________________________________________________8 o0 Y# ]$ s& ]( T3 w' q: U$ Y
& Y$ G$ C) r; e3 N7 `0 Y1 l: ?7 a5 v* _6 R% K
Method 03
! l) c( k2 V) z I+ X# i=========
/ s4 w) U6 R2 {8 h
' Z+ X, P* {: F( bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. v0 s/ @: }) |1 \+ [6 ]$ {0 @(API Get entry point)
* j0 W" H; |3 V5 {7 a+ { Z+ l3 B' q) Y/ l- r7 K( \# {/ o
0 m' o7 u3 C5 n+ j- H xor di,di
( t5 G2 u5 i, N- k( |% }* r- U mov es,di2 X- h/ [! Q+ {& m6 ]8 q" f/ d
mov ax, 1684h
) }* d+ H1 v+ L/ t4 \% [! V mov bx, 0202h ; VxD ID of winice
) j$ \5 M" A% R+ ^- X# I% \ int 2Fh# y. o1 @' [% V& C) L
mov ax, es ; ES:DI -> VxD API entry point
% S- S: x% k0 P Y* r* G add ax, di- p! ~, i) m8 Z8 ~' p( e
test ax,ax, F. y1 c( e1 k6 D
jnz SoftICE_Detected( u" w% V+ H$ t9 y. h6 U5 r( V
7 R. ~8 b$ D5 Z9 m9 p! W
___________________________________________________________________________' b% I# p S+ O& J5 ]6 G; F% K; p
9 v7 k+ B5 U$ A& pMethod 04: i# D1 o& O6 }$ F6 ^' Q
=========
& y1 Z8 ~& [( J% q* M% O6 r# b; h/ e B$ p: p4 r9 N1 ^
Method identical to the preceding one except that it seeks the ID of SoftICE+ g" b8 J2 h% E* n
GFX VxD.
6 _5 I5 v+ ]( s+ d
, E2 k/ ]0 H/ P* j& \ xor di,di) R* e- `+ {1 E! \6 U J- \* M
mov es,di& p, C* y: l- x; j
mov ax, 1684h 5 F- c. v; Q3 z0 I, O2 k
mov bx, 7a5Fh ; VxD ID of SIWVID
/ L+ P) X; O0 ^- ~- s% i int 2fh# ~* Y' s# I# X, o) K
mov ax, es ; ES:DI -> VxD API entry point
6 G" |: d. I$ E add ax, di
! {/ w& U& E6 C1 K+ H- w& ? test ax,ax+ ~4 p) J$ U* i P' u' D$ q
jnz SoftICE_Detected$ Q4 ]; k! E0 b, I, y: X7 i* H
- K/ [3 ?" F- ~" Q3 k
__________________________________________________________________________( ^6 t2 W7 r# o9 j
! R, @3 i. T, x: }. Q/ \7 U
3 j! G: b6 n$ O1 x# S
Method 05$ i! J, Y5 X8 v. s, L: N
=========
( o& G5 c" t! ?6 M
* O4 J8 _; Y, N% {- vMethod seeking the 'magic number' 0F386h returned (in ax) by all system
$ C% t2 @, s( q; Ddebugger. It calls the int 41h, function 4Fh.
6 I+ d9 v+ ?3 B3 X7 SThere are several alternatives. & W" |* H, ?: t' C' |1 `) u" ?
, b. G1 `) ]# I8 p) b) E+ pThe following one is the simplest:+ t! c4 S, L+ }7 Z3 r" R9 V
9 B7 R9 e; W) c1 B8 M
mov ax,4fh
! X$ ]+ |/ y9 Z3 o7 Z int 41h3 ? B# C5 X6 ^$ q
cmp ax, 0F386
4 P, ]0 n1 P- b8 g/ W jz SoftICE_detected
# ]" [+ I" t/ q0 \( ?! Y/ I" v |* K3 U% q
$ M8 n" x6 f, L( |
Next method as well as the following one are 2 examples from Stone's 9 L* R8 h( T% O) G: ~$ H
"stn-wid.zip" (www.cracking.net):" z% H, W4 o; X' S+ S
, j9 C& D* R: J7 j x3 ] mov bx, cs
$ ?. m5 e! X* _& |0 @ lea dx, int41handler2! M: \1 l" a2 m
xchg dx, es:[41h*4], j/ F' f% h+ C
xchg bx, es:[41h*4+2]5 W/ [, _- d6 X: J/ Z4 T
mov ax,4fh
. J1 F6 t6 d5 A+ J Q' ]5 t- d int 41h
) l: P0 {* N$ V4 g" e# X) c- w5 k xchg dx, es:[41h*4]
, g# o4 q8 z6 k* H8 I# k4 K xchg bx, es:[41h*4+2]
8 k9 B# T7 p" C: c) [ cmp ax, 0f386h
) e5 u/ }" i$ y* t+ X# y jz SoftICE_detected
1 u7 `' Y$ [5 v) Z% ~
) T% B' S, x Hint41handler2 PROC! z: P2 j' ~8 V, y% c! p j
iret2 ?% n! {' Z) v* f+ k# e, G9 x/ ]
int41handler2 ENDP
* |( x; l( L" R- H7 F/ G1 _( I# k+ H! u( W, S$ D! Z; H
1 C; s( e4 Q+ }- t_________________________________________________________________________
# ]3 T! G# E2 z, _* h8 t- {/ m `0 |5 |( K3 a% c' K7 q7 a
2 @; u6 |) H2 h M R* p8 w! C3 ~3 vMethod 06: z8 Q% a, n% s( i: v
=========
8 a' V6 V0 y3 g/ O$ F/ h. i6 E8 C+ f- F* U% i! m' T
" M9 a1 k) K7 N- w2nd method similar to the preceding one but more difficult to detect:! v3 a& c+ S( A0 c$ u
& O8 w5 @& g; h9 L8 A" g7 q* L) @4 F' N/ Q! Z' P
int41handler PROC
7 `* L- `7 V0 r8 y mov cl,al
* w( D- x8 N8 ?% O7 I+ ] iret6 N6 A- L8 y9 t! [( T" a( k9 Y
int41handler ENDP3 e% w, F* _. G( I3 U# w
. c2 L0 d9 `6 o x( N% [! t3 [; I
$ V+ l0 l& r6 M7 E% i xor ax,ax/ j! O* D4 R, b2 A: m
mov es,ax
$ a% t% [5 K6 S! v' B' Y, Q' R mov bx, cs
* |( y3 x, A: R7 s: L$ t; u lea dx, int41handler- V0 Y6 e. c$ R) U7 e" F& U& R
xchg dx, es:[41h*4]. ~ I8 A+ Y# C- _% e4 A1 M+ ]
xchg bx, es:[41h*4+2]
7 T1 a2 [! V) U) e* E in al, 40h! Y0 |6 S% g7 E& Y7 }
xor cx,cx1 g% S) T* F: J
int 41h
+ ^1 Q* j6 O: w0 @" R xchg dx, es:[41h*4]
+ f5 q# u# o, E) h0 x7 o, ] xchg bx, es:[41h*4+2]
) w) g2 r1 h* `2 z cmp cl,al6 Q/ v! ~' \7 R
jnz SoftICE_detected
* G. I8 @: H! u n6 I& Y4 j( \( K! R; p! t7 C' U% T S
_________________________________________________________________________2 b5 o* K8 v, R5 R$ C# [( j: X; N! Q
) R% [; p/ s4 \: z. S: I- b
Method 07
! i# J- w0 z# G' p; [) o: e4 c=========; v- ?8 p. c$ f% {$ j
5 b8 ^4 M/ D+ J% d T: fMethod of detection of the WinICE handler in the int68h (V86)
/ C8 X0 a# s; Z. D: |) l
# B# l% b$ ~1 e& s6 t- X mov ah,43h
& A7 Z' @1 O' ?1 i; q% ` int 68h
5 k3 U. N7 |/ j& q cmp ax,0F386h
( T8 x+ u; U9 Q2 L jz SoftICE_Detected
7 C: W% U" Q6 d; m- f- m1 K6 d: h( G; k
/ P ^1 ~$ _$ u=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ I# {: |4 I' R2 G5 B3 H$ w9 g" ` app like this:
8 @( m- H( K6 J) U8 U$ U4 V2 X. l
) [: P7 A, o3 K+ C: z BPX exec_int if ax==68! J2 @4 o% U+ v: M3 Z
(function called is located at byte ptr [ebp+1Dh] and client eip is
3 N% r: X% i: @' _4 a8 e located at [ebp+48h] for 32Bit apps)
# T! f, n" l6 @5 j* e& Q8 a3 t__________________________________________________________________________
7 K$ f. m& W& _( |7 U2 {" a) P$ @* t; ~
$ a& b2 p+ ?+ B6 I4 J
Method 08
" q/ r B2 x8 B/ Q=========9 j, i, n L* ] x& M
7 q3 ?2 i0 W, v, f; F, q- yIt is not a method of detection of SoftICE but a possibility to crash the; x9 N& d M5 P' K; t( B3 f
system by intercepting int 01h and int 03h and redirecting them to another
! x" R/ d- I9 A; m4 V5 g9 G9 }" Droutine.! @. g% X: k4 h2 }$ c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' `; t" U! S) ^; Y- A
to the new routine to execute (hangs computer...)
$ @. i. J0 \4 F0 G( t. N
0 Y' y9 {& v3 z" y7 ^- E/ P/ u8 s mov ah, 25h
( |4 A+ b3 D E7 L% V; G% L mov al, Int_Number (01h or 03h)6 O! l7 _: l3 K+ g4 h
mov dx, offset New_Int_Routine6 v7 c7 V/ {: }# @& G/ u
int 21h
' b; P' l6 U7 m& A" p0 C6 b) f* g, y- |! s+ B
__________________________________________________________________________6 n* M7 I6 w7 ?; \( t8 |
& v n2 r8 F# r7 lMethod 09
2 W5 Z( F$ ~+ n% ^7 m! N( N5 m=========
0 j8 t4 C- Z$ e
- E* m3 p2 z J, n" X5 xThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# I( M$ ^& T5 N; A) Hperformed in ring0 (VxD or a ring3 app using the VxdCall).* L) ]6 M. |7 J" v
The Get_DDB service is used to determine whether or not a VxD is installed& Q9 r M' i+ c3 X1 W
for the specified device and returns a Device Description Block (in ecx) for2 X" q& c% ]1 i8 i {. u
that device if it is installed.
# i) S: d* P M, A/ T9 Y' e7 w
% V) d! b* A& r6 D( c4 k0 e" O mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& `' ^% \5 A* ]( h+ H
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 i5 K9 v8 D% ^% F VMMCall Get_DDB
3 {3 Q7 z# Z: c& l% Q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
) X9 }9 c- l( }3 l+ V8 ^$ S
- f! D) F2 r0 rNote as well that you can easily detect this method with SoftICE:
5 O9 B& O# Z# J6 R/ M' m0 i bpx Get_DDB if ax==0202 || ax==7a5fh9 |- C6 d/ P6 J. [' L* ?
' F+ F& ], H0 Q: b. U6 v+ ]- \
__________________________________________________________________________& b% I& i" _" x
- P' R( ^6 j1 [) p5 C* r# N
Method 10/ A1 Z6 N& E9 ?6 I# B7 Y" ?" o
=========4 _% \$ v2 B+ f
P; n/ b2 D1 _! b/ z
=>Disable or clear breakpoints before using this feature. DO NOT trace with
- O$ x3 ?) V0 l SoftICE while the option is enable!!7 O7 w9 |% m- x7 I" i4 E/ @/ v/ [
; O8 f% ^8 E/ }0 n8 y5 n
This trick is very efficient:9 P }& \$ Q! k7 v
by checking the Debug Registers, you can detect if SoftICE is loaded" J2 V. Y8 X& e/ K% Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 ~. L7 i6 T7 U/ N! Hthere are some memory breakpoints set (dr0 to dr3) simply by reading their
" ~" X1 f; h& u2 [0 j* ]+ ?value (in ring0 only). Values can be manipulated and or changed as well
! i/ {7 f2 ?, K" Y, ](clearing BPMs for instance)
& _( u; C$ O9 S B! q
# R( N8 w" y [5 N2 P__________________________________________________________________________
2 S9 q9 O6 ]( j* U$ i& h8 ]; v4 R4 z7 U% h) z# f
Method 110 E, D: _. F% h3 u W4 u! T, \5 {% m
=========2 }8 V* n# B( L0 e; Z" @/ V# j7 a- c
6 u' Q: m. K/ M1 M( @
This method is most known as 'MeltICE' because it has been freely distributed
4 k: C: o$ o: B; g1 f7 b( Ovia www.winfiles.com. However it was first used by NuMega people to allow! U: U Q6 X- O
Symbol Loader to check if SoftICE was active or not (the code is located
0 [ ~5 z8 {1 w* P0 iinside nmtrans.dll).$ H1 ?' m7 f( a) P# i- K
8 H/ u5 o+ k2 r& C
The way it works is very simple:1 y& O9 W X6 ~
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 l% s+ d `! B. h; JWinNT) with the CreateFileA API.: S* K3 G9 o: d- x# _
9 P3 I$ x9 D& R6 x* j
Here is a sample (checking for 'SICE'):' s5 D; {2 r1 k7 `, m5 @1 i! t
" O) g- a' a* F% e3 x) fBOOL IsSoftIce95Loaded()' f9 R w- U l, w8 L
{
* l" x# k$ Z; y- P( W HANDLE hFile; R- k8 }! F5 L6 R V
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,5 E7 l) L% S1 S4 E1 c o5 h- u
FILE_SHARE_READ | FILE_SHARE_WRITE,
7 w( m+ P/ A# I( z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( u1 U" g" J/ F if( hFile != INVALID_HANDLE_VALUE )
/ F" _! p+ t* @0 } e+ x {
3 J# R( Y+ q- J+ K CloseHandle(hFile);7 R! c1 m1 X+ c" g
return TRUE;
/ B; u/ I. f( H! |& Y# [6 | }" I* }+ ?5 }, e: u! K9 b6 |
return FALSE;) C4 g- C, @0 k2 y+ V
}+ Q0 E# {4 R% N6 S* [; S
0 `7 s( O0 ?+ W+ ?# V7 Z
Although this trick calls the CreateFileA function, don't even expect to be
/ d/ d- U( D5 }able to intercept it by installing a IFS hook: it will not work, no way!8 q) F. X" c7 [- F$ k# A0 m+ h4 I
In fact, after the call to CreateFileA it will get through VWIN32 0x001F' H0 r1 ^" H4 r! a2 s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 ?: _/ E; d5 q$ _and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 y9 u. @8 V9 K1 u n& g
field.
c7 F; x& v7 c0 I" ]5 U5 {In fact, its purpose is not to load/unload VxDs but only to send a
- T4 n5 L; k/ h6 ^' oW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 Q4 N' ]. s- V5 |# D) S
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, [* n( V$ U5 f" Y4 Bto load/unload a non-dynamically loadable driver such as SoftICE ;-).7 Y8 S4 w( ]! E& H! Q8 y) w
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ P6 h8 X$ [1 ]+ ?+ U6 \$ q* K' Aits handle to be opened and then, will be detected.. \: G6 @: k4 \! o/ ?( y
You can check that simply by hooking Winice.exe control proc entry point
! V5 E2 P5 l& U; zwhile running MeltICE.
, V9 q% `! o7 a
& D% c+ H4 X/ r: C; G
% w0 b6 u- X: l1 y a 00401067: push 00402025 ; \\.\SICE3 s; e8 N8 ]- p9 p% k: v
0040106C: call CreateFileA
3 a& ^3 A# ]/ ?$ X8 i 00401071: cmp eax,-0013 d- K! T( b9 C
00401074: je 00401091
- w X% `' N, v9 C' `" \: Y6 \0 A% Q2 k$ A$ g: S& A2 B
+ e. B$ r$ I* g ^; T
There could be hundreds of BPX you could use to detect this trick. D* k9 ~# m; F% s0 e7 k
-The most classical one is:
% R2 X B. |! `9 D' k ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 Y! p/ F& R9 M' x% ~+ q
*(esp->4+4)=='NTIC'( U) T% r9 g2 _% v, ?
8 A/ X( j4 k# G* I
-The most exotic ones (could be very slooooow :-(; U9 a4 o2 r; A6 `/ H6 |5 H
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 |! [% Q0 r6 u. h5 g
;will break 3 times :-(
4 I3 U0 a) ^* i: x F- ?: {2 I+ t8 M1 D5 a8 c6 c7 p
-or (a bit) faster: . O( [. z: z) Z! t7 X$ B9 l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
6 D4 f3 z: [9 T% f% Q9 Q* k4 n6 e2 ]- ?2 L7 {6 T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 X. d7 p" C6 n/ Q
;will break 3 times :-(, C0 {6 d; h3 H' s( X( R* S
' i; P* ^% K8 }+ P* u6 _8 ?( D
-Much faster:
* p% b8 B# G! }! \4 T8 h BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 ]: i/ X9 m0 h3 U4 @ m4 G7 W! p8 |: S) ?% z( a+ m2 V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen( b/ X* s1 v' G& c- A5 ], q
function to do the same job:8 i2 D5 O* o, ~; G2 E1 L; r$ V
; t! {8 c! f# ~* F% e
push 00 ; OF_READ
2 e7 @/ A) |0 \0 r+ u9 g mov eax,[00656634] ; '\\.\SICE',0
# u) s/ C" l+ L: s7 b- @ push eax
5 E+ K, l4 W# ^( ?+ l8 ? call KERNEL32!_lopen
8 J: D0 t }9 k( e( H inc eax' Q2 u/ E) J$ C$ v7 Y. g3 R" g
jnz 00650589 ; detected
' L. Y" H3 a. r g$ i push 00 ; OF_READ' F4 Z, E, V* {8 d7 d5 o
mov eax,[00656638] ; '\\.\SICE'" [/ A/ N7 |0 j5 h5 o( W/ d7 j
push eax
% L# {* I' w5 `8 V. N2 S+ F5 g call KERNEL32!_lopen
$ V. _& Y# C- h, c, J2 W inc eax' `# q3 S3 C6 Y5 `2 ~
jz 006505ae ; not detected' c* c8 J1 R! i0 w8 F
( e. ]( S3 V9 X- {6 P
$ d( c4 A! w( `+ k8 S7 k3 }. a
__________________________________________________________________________
+ z; }0 K" O3 z* V8 k8 |
' r6 y4 ]1 v( Y% d2 xMethod 12
g/ g. b5 K8 C+ Q' |=========
7 w" H: C2 }7 r- y( i& k6 Z9 a- R) g! ^" m7 s' j: W
This trick is similar to int41h/4fh Debugger installation check (code 05
5 \8 u# h% r! D' |& 06) but very limited because it's only available for Win95/98 (not NT)6 j; e e, I$ D% q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.; r2 k E7 b1 H3 v+ \. h+ `4 N
/ `$ E: E1 J8 |: p5 v push 0000004fh ; function 4fh
" `1 c, t0 H. r8 W) ? push 002a002ah ; high word specifies which VxD (VWIN32)( s# g6 F2 ] \3 Q6 @& m
; low word specifies which service4 b! j9 U0 w. o5 I% m7 w9 K9 s! b
(VWIN32_Int41Dispatch)- m( V6 A# P: u7 j& @
call Kernel32!ORD_001 ; VxdCall
s, @+ p `; ~3 \9 E4 g cmp ax, 0f386h ; magic number returned by system debuggers
* L b- r( ?5 h& v: n jz SoftICE_detected3 {; E" R3 g( ]7 b& f! |
/ h) D# _2 `. D. g
Here again, several ways to detect it:
% F1 Z f. `5 v. k2 Y Z: A6 E
1 R' G+ I7 @* |/ i3 P+ @" Q BPINT 41 if ax==4f: H& ?; l3 Y; X7 U
* p1 \. ?! F+ F6 d u% q BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 r$ m# ?; L) n/ z9 L, }
' _- g2 k+ b; c. D0 e/ D
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( ^" N9 c4 |7 U6 g3 l* I
G2 A4 k* d1 C( E3 M9 _' w0 | BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 a" ?3 S0 _, r+ v/ i) e) r+ a8 N( g' N+ m+ V* P6 D
__________________________________________________________________________
# `) ~0 a' y9 T3 w0 Y+ B9 C- l1 W8 Y' n! }
Method 13
, x1 F* v% O/ Y( U9 r=========% \# Q1 A) f. h% \
! H" q* U' G+ R# B5 }
Not a real method of detection, but a good way to know if SoftICE is9 a0 s- l. y i' y% l |1 @
installed on a computer and to locate its installation directory.! p4 C8 ]8 c, P8 @
It is used by few softs which access the following registry keys (usually #2) :9 S% U6 n R9 l
/ H. z5 X+ m2 \: h-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 j' B% S. o9 T2 t& a+ _! H
\Uninstall\SoftICE/ Y+ j& b7 Q! \9 k! v9 t
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 \' v% F" J2 j) @6 n
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& s9 f$ ^5 ~. l Q+ `: P4 M
\App Paths\Loader32.Exe
$ g, _' r6 V- R
* A T$ w8 W& I, i. G/ }6 v9 t0 ` D* D. C
Note that some nasty apps could then erase all files from SoftICE directory3 S: S* h! i! B
(I faced that once :-(
. K2 h4 W6 h! e2 f
5 r. ~1 l4 l$ d, n: DUseful breakpoint to detect it: j' G* m0 g6 q* z& I( Y3 Q
& z( l2 [) s; Q. ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" `5 i) M( q) O- v1 e
* U! o9 |0 h0 S8 I% f& D) G3 h/ ___________________________________________________________________________5 y+ [0 o) G5 @. y v; L. v
0 U- R3 [$ K! W/ p' Z
/ r( L6 g5 n* k7 z/ z( I( ~. f
Method 14 + ]( D9 X; M0 m5 l
=========
) u7 @- B7 Z5 z# h
" d# K/ z- r# zA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" n- H) B) [; ^
is to determines whether a debugger is running on your system (ring0 only).
+ W6 F( P6 \! {% f6 M1 w% n6 Q- i/ r% m
VMMCall Test_Debug_Installed
- y5 {3 p% ]6 f* j& Q je not_installed
/ Q9 E$ ^" d; k: C, Z7 L
. ]$ I& y* U* H" p) FThis service just checks a flag.
# k0 k1 m1 t) b8 [6 {7 f' G</PRE></TD></TR></TBODY></TABLE> |