<TABLE width=500>
! Y/ @) T# C3 S0 V- A6 r- o0 V% J<TBODY>
+ n, G! s$ K z<TR>8 B4 S6 v& z! C$ _
<TD><PRE>Method 01
: f0 G6 r) d' `: @& v=========- Q+ o6 z: ]7 a! d2 N
' [6 ^% w* w4 v+ i6 O
This method of detection of SoftICE (as well as the following one) is
% x9 n0 q! N- r2 ?. o: s# S6 _used by the majority of packers/encryptors found on Internet.
1 b' v8 Q- q1 f) DIt seeks the signature of BoundsChecker in SoftICE& P( p% I- X- ^7 C5 K
4 w3 E& N* F, G; y/ F _
mov ebp, 04243484Bh ; 'BCHK'
4 \& V& R1 j2 P" |# ~ mov ax, 04h
" F% m4 R! q" f0 f/ k' `$ \ int 3
( @! I* H4 y% Q3 \* R cmp al,47 y, x8 F2 ~, _- O: K4 l: S
jnz SoftICE_Detected
% b1 S4 m" @! A L# }9 j5 a# Y' A; m7 P3 o9 Z' t/ A* M
___________________________________________________________________________: b* U7 d) e4 h8 ?
5 H9 [8 C7 e' |$ N, P- [% k* w& B! _0 eMethod 02
& @) v7 n5 T, S7 Y/ P1 k=========
( m' z7 e* m+ v9 P' W8 ]* _
. Y: p- d2 g' v- T) iStill a method very much used (perhaps the most frequent one). It is used2 b" L+ ~, _ j1 M1 s4 h# G
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, e+ j7 r7 r/ ]" t
or execute SoftICE commands...
9 Y, m/ Q( p9 |0 ^; s/ c/ T' ?It is also used to crash SoftICE and to force it to execute any commands+ f6 {0 B% v, u7 q5 q- c
(HBOOT...) :-((
4 e5 O$ g% i0 ]7 N0 x- _, J$ h0 A) R4 T- _! X4 Q
Here is a quick description:5 a% p, y$ _- h$ A+ y; I3 @$ b5 y% b% R; |
-AX = 0910h (Display string in SIce windows)
$ ]' g- b3 L+ }- G$ p. V! v-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
- `4 m+ J4 E* H1 y-AX = 0912h (Get breakpoint infos)7 Q& t4 }+ ?5 n& O7 G5 f
-AX = 0913h (Set Sice breakpoints)
0 u7 e. Q( {- U/ W-AX = 0914h (Remove SIce breakoints)0 X* d+ e0 R6 q# P9 N% C# p
% G1 e3 C3 }" ^% p* H+ j& kEach time you'll meet this trick, you'll see:
0 k6 E- o- u s+ z/ k, k2 S( s; ~-SI = 4647h* m4 S, J X0 D1 V, V. B# \0 {
-DI = 4A4Dh
# ?% ^( a/ B9 l4 Y* o; `; ]6 VWhich are the 'magic values' used by SoftIce.
G& I4 E8 J+ Q4 J; J3 o8 ZFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 `# m" T" h% M7 p) i* _" m
5 Z% c( b/ L- N4 s- e; i" `Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 m6 e% K' T. Q4 c9 dEnvelope utility use to protect DOS applications:$ {- w, Q+ D3 n4 m9 \
A7 ]; X( {- Q1 Y0 ?2 R9 Z6 K7 L( t
4C19:0095 MOV AX,0911 ; execute command.7 b* S: `8 P# W7 m2 n
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
9 x) O* D' f! f6 R5 t* H% Q* X. P4C19:009A MOV SI,4647 ; 1st magic value.; f& D! Z9 k$ R. z! }
4C19:009D MOV DI,4A4D ; 2nd magic value.8 P4 ^! Z9 a' H' T3 w2 x& s
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), N5 t0 F3 c6 v8 _3 v7 M8 U$ q) J; q7 z
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute5 Y7 }4 D9 Q+ t
4C19:00A4 INC CX
0 k- P- u7 o4 Z9 ~: o4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% q8 Q' u* B0 k' B
4C19:00A8 JB 0095 ; 6 different commands.2 a$ _7 r* o0 g* n$ W1 i
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ ]9 H/ V6 \0 Q- L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- W' O' ~7 h; Z. M/ D
6 o* k& I" u( ZThe program will execute 6 different SIce commands located at ds:dx, which
4 x8 e3 k7 C1 c7 h7 Y" S& Sare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. T" Z5 ?6 s3 ^ q8 J; ] w0 \0 x) I" M
" Q- M; O& @" ]! J0 j! Q* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 E2 v% j' A: ~1 \. V___________________________________________________________________________
" J* u: t/ I$ ]+ G
; }" l) ]5 J& O3 ^$ Y: A% s
. R, V4 f* ` tMethod 03" B/ E# M5 Z. R7 {- w
=========! S" Y* }1 F$ y. f
* w s1 U- a# ^3 XLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
6 Z+ h" F' k9 D3 O% O6 L(API Get entry point)+ S7 r) |: ~. Z
% M0 H1 c3 H# D- k
: V& _0 h5 {; Y7 P xor di,di
( b$ w8 ^& g5 w% R mov es,di
9 y- X% ?: a: }. @ mov ax, 1684h
9 I) x# N+ D4 ?0 I" W mov bx, 0202h ; VxD ID of winice
# @/ v3 w2 x. }4 K( }5 w int 2Fh+ V! M V, p o4 g" n" l% L- ?
mov ax, es ; ES:DI -> VxD API entry point
, i% l! L2 R: W: d9 b# [& o add ax, di8 C* J P8 d& Q8 y1 u
test ax,ax- {" j- w1 [ H) {
jnz SoftICE_Detected
S" u+ X0 a- D2 @
" v4 d- u$ I) Z# H___________________________________________________________________________; U8 Z+ ?; L2 h6 {6 P* z
5 ]6 _- W1 s6 h0 i5 aMethod 04) ^# | N: j" {$ r2 g
=========
; `6 y$ A g( L) D5 i. M& E: [5 A* B1 Q7 ]4 h8 T
Method identical to the preceding one except that it seeks the ID of SoftICE
# T9 \+ ^1 Y5 d: Q' T) M) ?( lGFX VxD.8 G: C; C& `) C: p0 V9 C2 @
' z9 f# h! q z' ]( A6 y
xor di,di
) m/ t' ]& B+ k" O; n( P mov es,di# D7 O# Z" O5 [9 m3 g
mov ax, 1684h $ g7 y0 I- p$ h7 ]. A/ q4 _
mov bx, 7a5Fh ; VxD ID of SIWVID% o0 ~$ I3 C) \% ~
int 2fh
7 X+ X$ m, _7 L$ C5 z! C% K3 n0 Q mov ax, es ; ES:DI -> VxD API entry point! W g3 {- r/ n( y/ o
add ax, di6 n) H* o- f: B" J' E# Q
test ax,ax% x! j: j& u2 r, p5 F+ r
jnz SoftICE_Detected* L' p! n% Z! V6 L8 N2 _1 P8 D
% e) q; `2 ~( C/ C* g__________________________________________________________________________7 f' p1 e+ G% {" r
+ i) L$ v/ ^/ V4 i+ [
! `7 c5 ~+ R% W; G& O; l/ C3 u0 N) q
Method 05. ?& V+ E- ~8 Q0 U
=========
2 J; Y0 ]% Y8 n* G6 K* F7 D
, M) T1 |0 h, O0 uMethod seeking the 'magic number' 0F386h returned (in ax) by all system
4 n2 {8 q- p/ M- Y2 i- C" Rdebugger. It calls the int 41h, function 4Fh.8 x, F! f" k; O( \' i
There are several alternatives. & i/ g, A# @( Q$ F' d
' s i. ]* A2 _# q mThe following one is the simplest:( z9 X* k; ]0 l! ?0 c
' R& j1 G' y4 {, F) T mov ax,4fh
0 x/ w& x$ y* w. D/ I int 41h
" C' ]* E/ d# K3 T. p! y0 } cmp ax, 0F3866 x( T: z7 n: _* ^+ v1 \ b3 i
jz SoftICE_detected" m4 S! S2 z$ l% J
# Z5 H4 g9 D- `7 K; E
/ h3 c( I% a" w" p9 q/ p
Next method as well as the following one are 2 examples from Stone's + `! t4 ^. {3 U
"stn-wid.zip" (www.cracking.net):5 _- ?% N5 [/ G! y9 k
x. a: N# t, ] mov bx, cs4 s5 G4 H7 [$ n2 l* [3 F
lea dx, int41handler2. j6 I* T' ~2 s4 d
xchg dx, es:[41h*4]6 g8 s8 t4 p' o- `2 `# M0 d
xchg bx, es:[41h*4+2]
" P3 f( Q) v$ x9 C mov ax,4fh
, x$ c8 V) t4 u: r, z int 41h* H- a) q3 k; |/ p4 r
xchg dx, es:[41h*4]
$ d0 w: i# v2 \. ` xchg bx, es:[41h*4+2]
. o- A4 z" B0 X" ^ cmp ax, 0f386h
+ }: `$ M: D0 L jz SoftICE_detected1 _' l8 s7 K" n( b" _' I
1 T9 s1 \ Q U, r$ Xint41handler2 PROC
* u- C) z! H9 z- j7 Q( Z( L4 J0 D iret8 i7 C6 d1 N( d& G
int41handler2 ENDP
/ g+ A9 _4 T1 ]# M7 P8 w* c% U: p' k: Z
; O/ m" `- T1 a: G- ~. q% P4 @5 ^ g9 t0 Y8 Z
_________________________________________________________________________
: R' u. ?' m2 v, R% S) v/ a: Q( t. G+ a N. V5 K4 ]
. d( I* U+ s5 Y2 v
Method 06' Z' |- U( @2 X! G
=========* C; f4 Q8 r2 g6 ?0 B& y+ B% O- r
9 w8 j$ J! D8 w" |: B
3 U$ @' N: _- X1 n" u2 g2nd method similar to the preceding one but more difficult to detect:
+ h5 U$ o2 W6 a2 ]' ?9 ?( Z9 z) B# y0 ]- r
/ r4 s# N! H2 K9 q, ]int41handler PROC* s- G3 v9 k& q8 V- V3 N4 I/ t
mov cl,al
3 W9 j# h5 h7 x" j. d" \/ g iret
( J0 d% ]' [& o, @, a1 Pint41handler ENDP
. S. B9 \: d- w
3 p! ]1 ]' y0 p# G6 |: Q/ ]% P0 p
xor ax,ax
, p. T& A4 O/ B: | mov es,ax7 j6 V+ ?: q2 J3 R6 z$ [. \
mov bx, cs
5 P/ o" a- x! S* V' [; K lea dx, int41handler- r; e, ]/ F3 ^0 d7 h! {7 O' F
xchg dx, es:[41h*4]
! G D. y+ E4 `* J* P" K. w xchg bx, es:[41h*4+2]2 M! q) u/ H u, I. P" _
in al, 40h
4 M; D$ i! X# B& A. l* m xor cx,cx
% A3 I1 ]& M ? int 41h
" W: a- i% N( u% G# y7 P; @ xchg dx, es:[41h*4]
* T# a$ H3 b9 c& e xchg bx, es:[41h*4+2]2 w; b5 r" B6 o1 S8 F$ T g; ^+ J5 C; I, q
cmp cl,al
7 L* d* D/ T O$ M1 ?* N; y$ E jnz SoftICE_detected7 d& A( ?3 C; y6 @% E! R) e `
! ^2 N- c$ V4 X
_________________________________________________________________________
; X, {! r& d! c: B" Y* I6 c' W8 ]$ q& O/ M# p) q' M% E
Method 075 ]6 O5 I- K: \; ?& W' Y. p6 f
=========
9 d. ]3 a) r' c- E/ I2 C* @9 O
" N+ J$ R3 u3 r- N; q9 H8 rMethod of detection of the WinICE handler in the int68h (V86)
3 G7 p/ O- J( Q' f7 W% c& f) w9 u7 \" A
mov ah,43h+ x2 R0 N. |" B% y
int 68h' Y0 B, j! l4 V7 ~, K, y x
cmp ax,0F386h
{; Y/ Q3 X2 h, B9 k jz SoftICE_Detected4 t6 Y+ }( }9 i" e& H
& y0 V7 Y x6 _, x- H3 N6 n" A0 V
8 n, r) Y5 X. h) X3 [ f=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( P) B5 m" t* O1 N y. v, Z9 @1 h app like this:& G7 q2 x- Y# e. f% `" _4 F2 [4 b
( v" ^! b6 F$ [) M BPX exec_int if ax==68 y' r. l5 `5 W8 J2 M# l3 I9 n
(function called is located at byte ptr [ebp+1Dh] and client eip is& Q8 |/ d2 t+ E
located at [ebp+48h] for 32Bit apps)
5 ~7 v# l; x, x- K__________________________________________________________________________- Q3 H/ Q W! }) o+ W" k
4 U, a! e% D. L' k5 v/ u
1 J4 {1 l6 q1 E' O( Z( NMethod 08
' A! Z# D+ t; t& P* s* G8 S1 t=========5 o* c- }! f8 c% J- N ~3 O
' s7 H. R. M& l. t5 ]# zIt is not a method of detection of SoftICE but a possibility to crash the/ n0 r4 ]* O8 O: B& R
system by intercepting int 01h and int 03h and redirecting them to another$ W+ {$ H3 P" T* F- z' ?
routine.. n) b; Q! }2 c Z# K
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points D1 z. d7 I' J2 `: u5 L
to the new routine to execute (hangs computer...)2 x: x6 c2 u/ ]$ R
$ s S! Z5 B) r, m2 C& P, } mov ah, 25h/ G- c, U+ u( K# m3 Y4 l$ X
mov al, Int_Number (01h or 03h)9 x. U+ ~% n: X
mov dx, offset New_Int_Routine
. K$ {" I" x0 X$ f9 ` int 21h2 o% W. C8 L" {& S- g6 ? j u8 A
% }$ g) C u2 C, n__________________________________________________________________________, y/ j4 c+ o; Q1 ~8 V4 l# p& O! }! h8 R
5 x f8 @4 v* b) b5 I: T
Method 09
- U% u9 Y W* C' i# D=========$ \8 a1 B/ H3 x
8 L6 I# P3 g- P1 y' @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- e7 s; s6 a# Q: d( d ]) Q5 ]
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ j# U1 \- w$ x7 \The Get_DDB service is used to determine whether or not a VxD is installed7 x: G2 D2 ^: d' M( R
for the specified device and returns a Device Description Block (in ecx) for
3 P1 O6 v; D& c3 ^that device if it is installed.3 \8 F% x- T+ h0 `$ j2 o0 n
1 E5 a& u' b. ]& r1 K. J4 H% _7 S a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' H! a) D# e) V mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: r! ?/ H$ a [- I VMMCall Get_DDB/ I# E7 N: R( H& G
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 C) r. C" }& _6 }* m9 b; \3 p4 `+ j& h9 t5 k5 @$ M9 L, G- c
Note as well that you can easily detect this method with SoftICE:
6 H& c9 p- v0 w0 ^6 x" C" \ bpx Get_DDB if ax==0202 || ax==7a5fh8 A+ K; Z+ A6 h' b; a1 \
: d$ D( w5 S& |6 m__________________________________________________________________________
: m* m: z6 x% y
4 H2 L6 B0 @" g1 W) ?Method 108 }. Z: N2 f1 b+ [
=========+ p4 T! x4 r/ k5 d
) y6 H# p5 W4 c; D+ q2 {: V. b
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ j5 L9 j* J' N E. [5 P$ \
SoftICE while the option is enable!!
* \, g) z$ q6 ^# C
% H" a+ z! Q. W! Z1 o# ZThis trick is very efficient:
, K2 {4 r/ B4 c( L6 k( X! j! bby checking the Debug Registers, you can detect if SoftICE is loaded
( ^4 V5 ?1 K& o, `(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! m9 q8 d& Z; S! a+ B5 v) Ithere are some memory breakpoints set (dr0 to dr3) simply by reading their
9 N- n0 g. B: x: X% {. u* s- ~value (in ring0 only). Values can be manipulated and or changed as well( L1 @ T2 N2 M' |1 m# o
(clearing BPMs for instance)8 p( t6 w# Q" H# [
8 J! S' p: w. b' l* o__________________________________________________________________________
$ [2 e1 i$ D. I% d* ^. x1 y& z: l7 c9 X
Method 11
% s8 F$ e0 f" H/ K7 \. X=========
* u$ T0 @' P- Q* t1 T7 x6 Z2 F( s- A0 J' f$ B- o% F7 ?
This method is most known as 'MeltICE' because it has been freely distributed+ i2 |3 x) t7 t" @& T
via www.winfiles.com. However it was first used by NuMega people to allow" y; K& t# y5 ?5 w1 v! J
Symbol Loader to check if SoftICE was active or not (the code is located
2 O# i% M* ^* O6 f) l2 Vinside nmtrans.dll).
/ o: _, d2 X# N' T; |% e) |' v
+ @' F( P9 T( {0 LThe way it works is very simple:" {- Q6 v6 Q; D+ s- O. V, B/ z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 E- y7 M+ ~' }! A4 ~7 s. y
WinNT) with the CreateFileA API.
0 L1 b& s( v1 N
* G8 E* D! j1 d3 c( q$ o% F" ?* IHere is a sample (checking for 'SICE'):
/ ]7 \1 g8 S& a! C6 Z& a( x4 X2 {5 R
BOOL IsSoftIce95Loaded()5 T j9 n z. I$ k+ O
{
, J" {; c, g" r5 }- o) d0 e3 e HANDLE hFile; 5 ^8 y/ C3 Z4 a+ h% }
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 x. r- y) O# B6 \* I: \9 T$ y4 ? FILE_SHARE_READ | FILE_SHARE_WRITE,
7 E, Y5 M2 X O2 p _7 v NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( x( R; p% ]* e4 |5 h if( hFile != INVALID_HANDLE_VALUE )2 c* u, I* h# a2 o* V8 ]1 c8 [
{
' W3 R" g3 `3 l# t CloseHandle(hFile);) [- |0 m( h# P
return TRUE;+ `! w. f/ Y8 ?! z& @1 Z
}* u" _2 {+ u8 E( ~+ @$ ~
return FALSE;% }' w0 m, r+ y: f" m7 I
}6 i/ d% n7 J/ Q5 l* |' Q* m+ ]
7 i% B7 q0 ^5 r* ]9 i
Although this trick calls the CreateFileA function, don't even expect to be
7 h( q, M& [! [* A' k$ Kable to intercept it by installing a IFS hook: it will not work, no way!2 _1 P0 ?. [$ e, L: Q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 h5 z d4 U z. hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 K+ N( z. l) R# ^) @6 {) Y
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
& m+ X+ g6 _2 efield.
2 G, }" j0 \( f d9 v PIn fact, its purpose is not to load/unload VxDs but only to send a 7 R1 [% {& l7 l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 ]+ h: ?3 l4 a" M* y$ t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 S; C" A9 w( u5 i5 r) A% K) Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 K, ~" q8 v, [$ N9 g- K
If the VxD is loaded, it will always clear eax and the Carry flag to allow; K; R% [+ D A% |5 o; K
its handle to be opened and then, will be detected.1 f/ S) L! k8 U! @+ M/ V' ?
You can check that simply by hooking Winice.exe control proc entry point
: S$ W+ }2 ~* ~: cwhile running MeltICE.& ?: S1 Z) g% e* P9 S! Z
, T. o. h* d O. B- W
' f8 c( t! b4 T# k" v' A+ }
00401067: push 00402025 ; \\.\SICE
2 N8 ^8 U1 X& h+ ]' { 0040106C: call CreateFileA
' g) o4 |; e) A3 S! d5 D9 X 00401071: cmp eax,-001
- W$ E+ o# X( i4 K 00401074: je 004010915 d5 Y1 ^0 Z- Q: H
) J3 v- ~; R" V3 _+ |, I4 ?0 r' F8 D, S4 O7 z
There could be hundreds of BPX you could use to detect this trick.
6 t& V! z1 H2 A1 H( d2 _7 {-The most classical one is:
4 m5 V5 l/ e9 h9 B* Y% @5 ?; \+ O BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||# Z3 B2 u' m$ ?
*(esp->4+4)=='NTIC'1 R6 }" Y4 O# o0 m# L$ f# Q
2 m6 U0 j; T# ~# \, O-The most exotic ones (could be very slooooow :-($ b6 T" N* p+ E/ J1 Q V+ O
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & n- T" k; e% J+ r
;will break 3 times :-(
/ _' n4 l0 c) T9 w/ A l) [+ O8 l; g$ o5 q$ a8 L
-or (a bit) faster: 5 x3 I" {( h/ |. x+ [( Y3 Y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ K. R2 z2 H5 [4 E2 @3 N7 P N, [
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ `2 a1 R1 J9 U5 i+ G0 G# [( M: N( F' _
;will break 3 times :-(
5 E* |, a8 |6 M, N# q8 _
9 X, C5 K$ `; I9 U/ ?% d-Much faster:
" g. i. j$ X7 |$ @ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 ~* b9 ?* U" I$ k/ G7 j
( q8 A }8 H% V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen; ?% ?( e) ?5 T0 X% R- q
function to do the same job:
A+ m p, r4 l# I' a6 C2 k4 d; b: r3 }/ j/ F! J" b4 @- l; p* l, ^" V
push 00 ; OF_READ
. Z- A! X" `+ Z, Y1 \ mov eax,[00656634] ; '\\.\SICE',0
9 ^( e' g# v0 F. O6 | push eax0 k% X' n8 a- b) }
call KERNEL32!_lopen
& c9 {6 f3 |: I$ [/ | L. z inc eax
, {6 N2 W t5 a: ]! C& @# M5 b( ` jnz 00650589 ; detected
5 A) D# ]& Y3 K( g, S; \ push 00 ; OF_READ
! ]9 R1 v! w/ h) G mov eax,[00656638] ; '\\.\SICE'& H( B' r; @# e% ~6 N
push eax+ V0 W4 u2 x+ l. i; c0 Y2 O
call KERNEL32!_lopen6 s* N# k# K& j9 \ Y
inc eax4 q7 y7 U) \# X# u3 S2 s( K
jz 006505ae ; not detected
$ E/ E' S5 C! y8 E
$ y2 J( f" M- J, j J" W1 Q: }
8 M0 ^! S! v3 \" c! ___________________________________________________________________________9 T4 Q' ^' _& `4 B
: I" t1 c @, b# JMethod 12 d z% M0 D1 Q4 L9 S8 g; G
=========6 Y" X2 R! e+ H/ i1 C
V H# D6 o# g3 x; uThis trick is similar to int41h/4fh Debugger installation check (code 05
p0 n, k: E7 _* x% @7 ^" f& 06) but very limited because it's only available for Win95/98 (not NT)
% H" W5 }" r4 t+ Q. N9 Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, N' v9 z2 G) V+ v1 c
! V. J* j, k% w Y% h* q1 n push 0000004fh ; function 4fh+ L* c5 M! O/ R
push 002a002ah ; high word specifies which VxD (VWIN32)
+ R. d; Z# }. o1 \ ; low word specifies which service
3 D4 v* H% G- W (VWIN32_Int41Dispatch)4 y8 D+ E. k! v/ d+ {/ R2 Y9 l
call Kernel32!ORD_001 ; VxdCall
0 p3 ~! x* N9 ~# d) x9 F cmp ax, 0f386h ; magic number returned by system debuggers
9 p, q/ F' Y4 m: E jz SoftICE_detected+ l8 Y( G' f; o
, x3 S$ \/ R0 {5 t8 m4 Z) P" T7 bHere again, several ways to detect it:
8 b! m( Z1 P0 |8 Q4 a4 Q5 N# q1 _
BPINT 41 if ax==4f" B# k5 O' U3 ^0 B! ^+ w
9 M, P1 S" a8 Y2 S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* q- y+ Y" \" B' |
8 t3 B; @6 A% U: {. c" S% X$ N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( {1 v$ T- n% a2 L. w }1 j) \6 s" o
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!' d3 y: [; i+ s: P7 q% c' R4 d
) D' V- J1 X6 Q0 w0 u; ]__________________________________________________________________________% F2 U3 |$ d& V; h
4 h Z. x0 Q" {! M% L# |! ~% qMethod 13" }3 |$ d/ f& A& F$ i3 g* @% u# `
=========
4 ? j; |% J; q2 n! F7 `/ x/ `! P
Not a real method of detection, but a good way to know if SoftICE is
4 Q* u3 v4 _7 B4 d, N jinstalled on a computer and to locate its installation directory.1 M/ q5 H4 P2 g2 O9 U* S
It is used by few softs which access the following registry keys (usually #2) :" j+ d) m7 ]. y# E" l
6 T' }+ W2 y* \8 s. V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- U. h8 i, @8 ]+ s- n\Uninstall\SoftICE
; o* j a& p8 m, w; N# R0 {0 L: k: S-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 ]9 [" W% g5 M* T: r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 `, [( h" a# e# ]\App Paths\Loader32.Exe7 x, p2 O& Y/ x
) i S+ k+ T/ X+ |
( H8 G- e+ H2 l+ |1 p- T7 g) T( P YNote that some nasty apps could then erase all files from SoftICE directory/ U5 h+ Z' F+ N7 B0 T
(I faced that once :-(# r* o# G# @" e" e0 d; q* V
D8 @* f* J& G ?) ]( J' ?
Useful breakpoint to detect it:/ D* H6 q5 N, N- n- s4 _* F' I
9 T: l1 [* p* M+ o+ G BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
$ ~! s' ~- b3 X) T: t# O+ q# W8 m- b" j0 K
__________________________________________________________________________8 v% Q" ~1 _: D% @. d' Z
! o, a) |' E6 P! C0 \- T& [; Z. k/ d' ]1 |7 n
Method 14 % d/ t1 j' G& j+ B+ ^1 z% z9 E
=========/ w8 Y! Y8 P. c {) R, G
& Z- a7 `. @8 N3 t6 ?/ p; j. K
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 Z/ s$ {% p+ n8 N
is to determines whether a debugger is running on your system (ring0 only).2 T! [0 k" s' g8 ?9 H+ ~! W. M
4 p6 T g; H4 s4 G; D% Q7 N VMMCall Test_Debug_Installed, ^ q6 h$ r4 \; @
je not_installed! v8 U. k V3 {* P q# G
! a, \; z1 O& S5 d/ q
This service just checks a flag.1 ]! F3 f( p' y g( a
</PRE></TD></TR></TBODY></TABLE> |