<TABLE width=500>
* A: }; ?$ `0 O" T8 s7 J7 N% I<TBODY>1 F7 l4 [7 F# x! f7 V* p- U
<TR>
' X- M* u) }; P) K<TD><PRE>Method 01
2 ~1 j6 D: E1 @2 Y5 ]=========$ w n2 T$ `( g/ e/ U
* Y, R8 P! j3 t# Y2 W5 p: e
This method of detection of SoftICE (as well as the following one) is7 `/ P) p* A! A8 o
used by the majority of packers/encryptors found on Internet.& O! |9 @$ R% W y5 @6 [: T& |
It seeks the signature of BoundsChecker in SoftICE2 V2 n) r6 C" ]$ N
7 |, m8 e" y7 ^+ o
mov ebp, 04243484Bh ; 'BCHK'
/ a6 K- ~" V* B s$ v4 H8 O mov ax, 04h t6 g- f8 j4 c4 k/ p
int 3
2 t. ]" m& Z) I3 h b' Q( [ cmp al,4) Z" _' T# U4 Q* o- q6 I
jnz SoftICE_Detected
* Z# d6 c* C# v1 N: F' L. v
0 ^6 p2 [3 ~1 p+ x5 y) \( \___________________________________________________________________________
& o! u" @. f' z% C( [: b! N6 \2 N8 Y j
Method 022 S( l2 G2 V0 B+ }9 g2 h' p/ ~
=========
4 G2 C; Z+ A0 y) J! }4 l3 A# K& U- Q8 L, C/ G% K6 C
Still a method very much used (perhaps the most frequent one). It is used
$ D3 A& T' E3 d( u$ ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" ^ K' l$ u. @2 A; l* a/ Mor execute SoftICE commands...
0 k8 k# t: ` k/ Z }* ^It is also used to crash SoftICE and to force it to execute any commands
9 l5 g2 K; n1 q k. t* }; s$ _(HBOOT...) :-(( 1 {: v) c% p" K1 T
( d0 {2 N x0 `0 N5 QHere is a quick description: y, V5 X4 ?, F' A
-AX = 0910h (Display string in SIce windows)' p8 `- w2 n2 L
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 g) ?5 t3 ~8 `5 N7 j$ `' S
-AX = 0912h (Get breakpoint infos)2 o/ d1 H6 [2 k
-AX = 0913h (Set Sice breakpoints)# A' p7 p# ?7 d! ^
-AX = 0914h (Remove SIce breakoints); E( z' B5 X$ G5 f. V6 @+ y
7 X; f8 Y4 ]% \
Each time you'll meet this trick, you'll see:' ~' n7 b' J, \6 y, q
-SI = 4647h
& ]0 `* t) { J3 e, B$ E5 y-DI = 4A4Dh
`8 k. J6 t3 t, A+ g& f/ E( g8 oWhich are the 'magic values' used by SoftIce.2 ^& v# F, r: K6 ]7 r( [% t
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' w& Y8 g* u8 \8 B' ?( b4 Z
" k. D) F |, B4 E+ }/ }
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 q/ C6 s* A! ?. g$ [8 B
Envelope utility use to protect DOS applications:
K; i0 e Y \# P# i3 D% @
( g. d8 J4 G8 { |, {" R- m$ R3 v0 m2 F) v; `! H, P
4C19:0095 MOV AX,0911 ; execute command.0 I! e' z/ F U3 Q# z7 i
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; Y% e- N3 \, @4C19:009A MOV SI,4647 ; 1st magic value.4 B' }( T7 h0 p
4C19:009D MOV DI,4A4D ; 2nd magic value.6 p, A* p1 ?8 x! J) n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)& G+ c3 W' C: Y9 y
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) Q$ R7 Q! A/ R, g4C19:00A4 INC CX3 r- H. F, ?# |* _0 H/ W. @% u
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
! H& w3 O+ V7 V4C19:00A8 JB 0095 ; 6 different commands.) {6 y8 i. N2 h; J8 d; Y
4C19:00AA JMP 0002 ; Bad_Guy jmp back./ ~+ @/ G; S9 a
4C19:00AD MOV BX,SP ; Good_Guy go ahead :): `# V7 e+ I1 F: A; a
+ D1 \& Y# K* F' [, e; H9 E# H. bThe program will execute 6 different SIce commands located at ds:dx, which
" I4 X3 U+ H$ |are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' {2 {: v+ L- ^) M1 O- {
( D3 C4 `, |4 Y* Z) `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ G) Z0 I0 ?; p9 \ ^___________________________________________________________________________# ~5 O7 V' f; @2 ^7 d6 F- j
7 ~/ x5 h( k: b' @ v; O$ k7 A' _& s+ _/ ]1 S
Method 03
K: d7 c/ F$ o( |. F& f=========
& T; C+ \; O N$ B' z, U4 o2 o5 S6 M+ h( k: C" f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ O) S, a9 E; Z/ q2 a7 w# x(API Get entry point)
( ~+ p" L, `1 w v- N+ H3 N! ?0 ` ' j% @& |) _" S& l% z) O
0 `9 f2 _; I* c, W1 _, V xor di,di' U6 A5 W0 z+ y# ~
mov es,di
, |+ \8 p4 }( d; E4 B mov ax, 1684h & W8 M6 `% E7 e% Y& q% ?5 p
mov bx, 0202h ; VxD ID of winice
8 Q% M5 D% E6 P/ J: U' @8 \ int 2Fh
+ U1 H& u, p: K S# B6 R& v mov ax, es ; ES:DI -> VxD API entry point
6 q r. k% B t8 v8 E- v! w add ax, di
2 G( X' `( h$ k9 q test ax,ax1 b5 z! W$ v, D/ h% s% t) P8 Y
jnz SoftICE_Detected6 p, W' _ d6 {0 v! o0 r" k
5 F4 y1 m, V% v {7 f5 @' H___________________________________________________________________________
# C+ ?4 _2 l9 ^' c! C9 g2 |; o4 z: m9 G* |. O# u* k
Method 04
# I4 `+ L- h& V a* T=========. C4 H7 S- c7 m% Z: j- O
/ {* S2 v8 d0 P( t
Method identical to the preceding one except that it seeks the ID of SoftICE
+ i' Q6 _9 V/ U# u8 R* r6 u) EGFX VxD.5 A, Q s% v7 c+ i$ E! t3 H
! N4 Q9 V U+ z* n4 n6 Q xor di,di
y: A7 _' Y- t, l7 p3 \0 V mov es,di
A/ x" ^0 ^. V' x) k9 x" ]' n$ H mov ax, 1684h
! s: B6 n& B& j& b3 _ mov bx, 7a5Fh ; VxD ID of SIWVID
' l: g! w; y0 X) M! ~! P3 U int 2fh4 y/ L2 v& N9 ~ y5 b( _ W4 N
mov ax, es ; ES:DI -> VxD API entry point% B+ a% z* F6 b
add ax, di$ j& D; s3 }0 F7 X- _" S3 n
test ax,ax
- d! O. j0 D; P# ~0 j jnz SoftICE_Detected* ?- R0 I( I$ s; T, L( j9 c
4 q* W" e0 U, f5 y
__________________________________________________________________________) S& e f! z( k, }% q1 \
3 @5 z" L& z$ p) e* _! |. d' a# v5 A, A6 l3 k& |& T+ u" n
Method 05- r# u3 Y& _- t9 Q. Q
=========$ ?' ^+ \, X j+ Q
: \5 J9 f0 k z* a; Q& T: W2 T5 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ o* Z* l: E& F, b# a, q# H
debugger. It calls the int 41h, function 4Fh.
N" B/ \- r! M8 ]" r% h- fThere are several alternatives.
" }3 Q5 h$ ^! L& ]6 F
8 m9 e0 B2 L) [The following one is the simplest:1 Z& h% ], |5 y
- S9 m9 }4 L( z4 V! z mov ax,4fh
% D& d7 \0 s' H( R, v0 N& z% } int 41h- W- ?7 ? V* h6 w$ h7 W# s
cmp ax, 0F386. Z$ I8 y* b5 w- y/ b) O# J5 Q
jz SoftICE_detected* X9 B$ o- v* n; h
* s6 B0 R8 b; J$ M, A3 k
! Y9 M" L; Z) b: E' _& o" A. I
Next method as well as the following one are 2 examples from Stone's 2 U8 K8 G2 T d8 e8 `5 K1 ]
"stn-wid.zip" (www.cracking.net):" B2 Y3 O( V& N" V
. J9 A: X. T$ r" k% {: J
mov bx, cs" m* {6 `! o& S3 u- r
lea dx, int41handler2
% g3 ~4 a( f. `5 w, u3 i! K6 \5 Q xchg dx, es:[41h*4]& R5 W8 h5 ]5 ]) m+ k7 T& L
xchg bx, es:[41h*4+2]
# y# ~- o A, M+ h0 D5 Z" O! ]6 Q mov ax,4fh
! F9 N' d% C8 F' G int 41h
& B. k; \1 s- J- V xchg dx, es:[41h*4]
: h& @3 p) Z: h xchg bx, es:[41h*4+2]
( D! |7 t% A4 Y9 h5 ?6 \2 d$ \2 R# { cmp ax, 0f386h
- A5 w5 A4 N6 d0 a jz SoftICE_detected
( P3 e$ k- p0 c( y/ E- I+ ^
3 G$ l. H; E9 U1 h: ]4 R, Tint41handler2 PROC* m( v; e- ^3 R) A& V
iret
- n5 ~. c* F- q* [7 kint41handler2 ENDP& Q. R5 o/ p5 X2 S! f& _
! O% D0 N# G O! E1 `+ W9 n4 P7 v8 W
_________________________________________________________________________! V" b# g: \5 r9 t5 g
* V3 ?* k1 ]) U! j0 h
3 k& c. k# s* B! M
Method 06( Q: L1 m' c% t
=========4 n; ] e' o: e( [, E6 d* t
6 v+ J9 H) X7 ]1 m& j+ p# R
9 P, X9 J- u! Y5 a) ]. s: [6 E2nd method similar to the preceding one but more difficult to detect:
" V1 `+ l& J Y
7 [ h/ \ Y6 c8 v& r
% Q2 l, d+ Y- ?, wint41handler PROC
3 i0 _: }, m2 Q- x" U mov cl,al
! g {8 `1 T) _6 j" k2 C; P iret
3 E* H6 O0 e0 J5 O2 K) Vint41handler ENDP
+ h6 ~' j- ^, R8 s+ j. B* d" U8 n, M. w: h3 Y; |
. l' e- ~+ l% g, `1 K xor ax,ax* e6 N$ ^/ D, v7 r( i
mov es,ax
) C0 s+ t" H* O" U3 E6 ^ mov bx, cs
6 I( p, C/ Z8 D+ r y" V* R3 C: B lea dx, int41handler
% F# P( C3 [6 y/ G xchg dx, es:[41h*4]5 |2 J; ?4 M! H+ h0 A2 _ O
xchg bx, es:[41h*4+2]
/ V& G% L) t0 m2 J% h in al, 40h
6 |8 |! ]* U5 ]1 e d% b5 J& A3 a xor cx,cx9 [% k% C @/ R9 @' p3 N
int 41h
) b& X6 ?2 j. c0 ?; O% h xchg dx, es:[41h*4]' E& q2 j6 d# ^3 u }' O
xchg bx, es:[41h*4+2]
' k; K0 I3 h c& i$ t cmp cl,al
) J# f2 D7 r/ a: Y0 }; x q3 m jnz SoftICE_detected
2 D8 n" l6 g! j1 m. M8 ^9 I) H( ?2 ]$ e3 x& F
_________________________________________________________________________2 M6 _% n$ ?- P3 s X3 g
' J9 v- S% c3 f& O1 _" T+ OMethod 07! \$ f1 Y- l" v/ E
=========+ U5 r* k: X f W
/ _* `# @9 w% Z! z! ]1 B
Method of detection of the WinICE handler in the int68h (V86)
2 {( w2 y! u x: K1 G! Z# g% v+ I; b+ H7 l) y( n
mov ah,43h
3 C6 R0 q+ N! Q int 68h. {* ?2 k+ J6 D/ E$ y( ~5 A
cmp ax,0F386h
! V4 i, j$ z+ [' T- d/ @ jz SoftICE_Detected
% F) T* d# e" r4 V+ H: c. P& k, @! u
8 a' V! Y# H1 o9 ?+ N6 G=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 p/ R7 S; }) V3 s
app like this:1 w- I2 ~: Y7 X: n3 B4 m' \% s
* [( L, g2 @) K. D2 ]# h; b
BPX exec_int if ax==686 \6 u8 \; l6 v4 _, L
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 {% @7 ], f3 z2 n) b% l" I located at [ebp+48h] for 32Bit apps)
$ j+ s! I m: T0 T! S8 x__________________________________________________________________________' I( r. T' ^, _6 V
; k- A6 s1 U) j- L
1 r2 _5 W2 e+ \6 H/ MMethod 08, }; V5 X z1 d
=========2 w1 C' ?' |: i% ~
, t$ ^; p: \* w
It is not a method of detection of SoftICE but a possibility to crash the
" e ^, t, E7 l; X1 Zsystem by intercepting int 01h and int 03h and redirecting them to another
- i7 T. @* ^! n; Droutine.
6 f5 C# w* v" f2 k CIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 |) F0 D6 F' j( U; [
to the new routine to execute (hangs computer...)
1 z2 [& i$ K& H: o A( y, a9 {3 ~5 s4 Y( `, }! p
mov ah, 25h
7 Z; h) ]0 O* B% [: Z" i mov al, Int_Number (01h or 03h)
1 i0 h; J/ l% O c( K: U" k mov dx, offset New_Int_Routine5 S9 q& B& {! B# t; n- B$ F
int 21h. V3 }" E+ o/ E! R( ]4 Y
( Q: k, [. |* a__________________________________________________________________________
- H( A8 A6 k" r- V3 w: O6 B1 |* ]3 Y* a4 |+ n3 N/ ]8 {* F5 M5 l
Method 09
& k! F, H, u8 c=========' h# X& z' A5 @- t5 v
: L# D$ L- z. lThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only8 {9 ~% X$ w, K2 T
performed in ring0 (VxD or a ring3 app using the VxdCall)., N/ Y4 X1 l9 ^; \8 \( F; u
The Get_DDB service is used to determine whether or not a VxD is installed
3 ~8 e Y& b4 @! ?7 t; Ufor the specified device and returns a Device Description Block (in ecx) for
9 T; V) y3 b" Mthat device if it is installed.- `6 u1 o0 C$ R1 q b4 h
3 T( I" E8 b/ D+ x7 O) {
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
% P' ], V! _4 l/ e, U% ] mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% I! w* I% ]7 B7 O2 p: q$ x VMMCall Get_DDB' Y2 Q" O8 k7 c5 q: L
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 O7 l- w7 o+ G" e. a7 B/ P8 C* T: ]" U% D6 h
Note as well that you can easily detect this method with SoftICE:
' G( t# B1 o9 s+ p' j6 {. O bpx Get_DDB if ax==0202 || ax==7a5fh
5 q% L+ E$ p- P# w& A8 V" g7 Y2 {' O! W' k
__________________________________________________________________________
2 m8 l/ ^6 D# P9 B. O% Y1 S+ j8 W
% x. v; s+ K. n% W' zMethod 10
. d# c0 f! j) E=========! K g: }( M* `& z, ?
+ x4 _9 O9 a/ D/ Y0 r6 g! r=>Disable or clear breakpoints before using this feature. DO NOT trace with$ }7 C. Z* T8 G4 n+ L. T* d
SoftICE while the option is enable!!6 m% p" U$ |# {3 M' k' W8 I) r' R' Y
% c$ k6 v: I" n8 \( m
This trick is very efficient:
7 n2 I8 A6 n2 {, x4 _by checking the Debug Registers, you can detect if SoftICE is loaded
! v1 J! b& F+ D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 Z% E4 L+ B$ u3 [, v% Pthere are some memory breakpoints set (dr0 to dr3) simply by reading their2 M6 r# H) Z4 y0 \" a
value (in ring0 only). Values can be manipulated and or changed as well
2 { u) P" i, h; ~+ L1 R0 \(clearing BPMs for instance)% L/ s2 V( g% R* o
0 E7 ^/ b I$ d8 `__________________________________________________________________________
! B/ z3 O# K8 a7 b# @
6 z6 B% E V$ c( RMethod 117 U5 T1 q% E6 e1 d- M% e1 {
=========( k( l0 W9 @* [ i& e* Q
: D7 h3 _+ K% e N; [ i8 nThis method is most known as 'MeltICE' because it has been freely distributed
) K1 E1 \: q1 \0 _" ~4 \7 I8 Nvia www.winfiles.com. However it was first used by NuMega people to allow4 Z8 b* {. U- f
Symbol Loader to check if SoftICE was active or not (the code is located4 j u* O0 I( [' O7 p- N
inside nmtrans.dll).
3 D+ {6 L- p h1 v) K B" v% f0 g" k- O1 w2 f- M' m
The way it works is very simple:' P; F" C% t1 q! S& B1 K
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 T: @! b1 E4 _' h* H/ Z1 ^0 h
WinNT) with the CreateFileA API. x& j6 p, |* {" O
9 N" Y) n' _2 q" AHere is a sample (checking for 'SICE'):
5 }0 l3 Z; F( B- o: a( L9 h/ p# M0 r/ ^5 w
BOOL IsSoftIce95Loaded()6 v2 b& _7 ?# O9 }
{
: d R/ G) g* f n HANDLE hFile; $ e0 Y- ?, \$ r/ _
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. E6 @$ J. }4 P3 C t& R
FILE_SHARE_READ | FILE_SHARE_WRITE,
0 C1 C l4 J; }' V7 k7 B0 q' U NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 s* r5 b8 D! O9 A if( hFile != INVALID_HANDLE_VALUE )
; T; r; Y2 R' t9 U$ [ {5 Q7 w2 o% M# T7 X6 u! R
CloseHandle(hFile);+ m {6 y0 {1 }1 k4 F
return TRUE;
. O2 i6 n1 N! x; K* z9 J7 s }
3 S& k; w$ R: E* R5 U return FALSE;
" h. F$ [6 d& ~}" S$ C$ y7 t& [: U% r, o: V
. a7 u9 O" U5 ^; l/ EAlthough this trick calls the CreateFileA function, don't even expect to be
* K4 x. m( B: V7 @ X% l0 aable to intercept it by installing a IFS hook: it will not work, no way!
+ f& w+ g- k4 o$ vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; a+ C( u: x: M* I6 o
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! z" G0 ~" V$ N! `* Z2 `
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 Y* o2 o" z9 `% j! ^5 l% j' yfield." H$ l0 u& R6 a+ c! `4 o" G2 w
In fact, its purpose is not to load/unload VxDs but only to send a
' _# [) f# {: N2 a8 } jW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' O+ t9 J$ j$ h
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( N3 L- z# s, Z8 F# fto load/unload a non-dynamically loadable driver such as SoftICE ;-).. b( ^$ o# z' ]' c/ D" B
If the VxD is loaded, it will always clear eax and the Carry flag to allow* U1 s) A# n8 w# L( f+ W1 ~
its handle to be opened and then, will be detected.( i7 a$ A, X2 b: o$ |
You can check that simply by hooking Winice.exe control proc entry point
9 |' Y; Q! K' P! Dwhile running MeltICE.
/ r' f# m3 x* D( y l H
6 ^- Q k" |3 `: h! c" t4 I5 Z$ N1 ^& f! W( d
00401067: push 00402025 ; \\.\SICE
% F/ I/ i9 q7 }. z* h% s 0040106C: call CreateFileA4 N' F. k0 }' j5 \0 J9 G! Y
00401071: cmp eax,-001
- {8 }2 C% [1 \* H7 h9 e 00401074: je 00401091
1 I8 W8 P6 g. Y( f2 ?9 c8 _. a/ g$ r" P# v% N2 c
2 C! b q" j3 N4 o
There could be hundreds of BPX you could use to detect this trick.
( @% q1 n+ O8 m8 N% A0 H-The most classical one is:
! o( `* ^, t ?+ A9 F& m6 [ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) v* m6 M& \ Z+ `1 X# w) L* E
*(esp->4+4)=='NTIC'9 ^7 Z. }1 Y/ r' l7 p
2 |4 f& f7 S5 H
-The most exotic ones (could be very slooooow :-(
6 m2 t; F: o) o4 P. h. g6 m' C BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & v4 S, x2 o' B% ?4 ~ h7 d U
;will break 3 times :-(& B. m$ p* l: \# O
* K9 G* E! D( `! }1 k* h-or (a bit) faster:
) }- i+ @+ k9 r3 T* |1 B8 R* \ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ ?- W" ~+ X( }7 W
2 {+ `4 G7 l: l+ h3 j BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ m' J9 w/ J: Q
;will break 3 times :-(
: }4 f/ z4 f8 k! O( \. J3 x7 B# e- I" E c6 m& T( b0 C M" V1 C
-Much faster:; m/ N) X0 q8 t( f7 G4 P# _
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'* t0 ?( o9 Y1 Y' }& T' G4 G$ t8 W
& [- X5 h6 @5 V. F/ |5 i) G1 kNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
' ]% @) u7 r) i3 p- X3 Gfunction to do the same job:# `3 p" h8 D0 j# N% x# N) k1 k Y* H& T
# j5 k# I8 B2 O' x& u4 S& E# |3 ]4 ^7 g4 R
push 00 ; OF_READ
: T- \9 A; S4 e) ^+ {4 K5 d3 m! B mov eax,[00656634] ; '\\.\SICE',0, Y: i) N; a9 H9 f6 R6 U6 R
push eax
$ Y8 Q/ F9 h- d7 ` call KERNEL32!_lopen2 f' I. a1 d5 M7 r6 A+ t
inc eax5 s' _2 z& ]* {
jnz 00650589 ; detected
8 R+ Y G* h& L# Z5 s push 00 ; OF_READ. U2 P7 G" V3 z/ u
mov eax,[00656638] ; '\\.\SICE'1 Q' f0 E* ?! d) B
push eax2 q; [8 ~! a4 {3 {
call KERNEL32!_lopen/ X4 q' ]# H |- d+ E u/ \% g
inc eax, |7 D- e' j) Z( C3 i
jz 006505ae ; not detected
9 ^1 P% ~! J% r" M$ N. W8 I! r4 P* P8 @ k H, z6 b
3 U2 ]0 m5 _5 v- ^% [__________________________________________________________________________
' {5 r" p: `3 @/ X9 \* j3 c+ d# s$ X$ N. u$ i) s
Method 12
4 f% }# Y2 w/ H2 i2 z4 t) t=========
% ` P0 I3 O: o9 t& v/ G: v8 C( k* N4 B2 U* `
This trick is similar to int41h/4fh Debugger installation check (code 05
0 g6 d/ U; l$ v8 t$ m& 06) but very limited because it's only available for Win95/98 (not NT)
1 t4 j6 }% |1 z, [# ]! was it uses the VxDCall backdoor. This detection was found in Bleem Demo.& Y5 r' s% v0 z5 W2 T- e
) _$ }% |/ G9 v% X7 v push 0000004fh ; function 4fh$ a' x- h% V4 A' Z% d& L q
push 002a002ah ; high word specifies which VxD (VWIN32)
0 y% j7 M3 s: m2 [$ U P: H) H; t q ; low word specifies which service( G" \1 X+ l( K
(VWIN32_Int41Dispatch)4 K' ]. C i; M/ B
call Kernel32!ORD_001 ; VxdCall
' J k0 n' T! a6 r, Y cmp ax, 0f386h ; magic number returned by system debuggers4 x% c; w7 M1 W) }
jz SoftICE_detected
, |: a: a( h( F4 h! D% q1 n, O T( t5 d7 [- c
Here again, several ways to detect it:* I6 }0 h) r) e
6 Z" M, R g( n; p; \% h. k
BPINT 41 if ax==4f: E1 f. j1 y% y5 b
# ?( ~2 n9 j& C( W' L5 y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ H* y4 M% ^2 w/ r9 q
$ |; O5 q8 w1 V) k" w6 @3 p5 \: R/ k BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A- @2 F0 ^( P* J; d8 Q
9 C2 R& K/ H' B9 O. q7 k+ ?
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! Z! l3 `4 x- x
! V7 E7 |( L- N9 }' E# m+ R; Z
__________________________________________________________________________( x; m8 q* q7 F( k
5 b" w* l6 ^$ J a6 w
Method 13
) b$ f; h7 }& e$ t) ?=========7 J( f* S/ K" |. b" o6 W& m" I. x
+ f- o: I2 H1 \" ANot a real method of detection, but a good way to know if SoftICE is2 E1 D, i) j& z5 s
installed on a computer and to locate its installation directory.
: }2 w/ u; r' \: c5 L/ RIt is used by few softs which access the following registry keys (usually #2) :
' {) i- i5 q! v3 ]' m0 G$ V2 G
6 ?3 u# Q, J2 \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ F7 ~+ e2 V& W7 \4 Q
\Uninstall\SoftICE
* T& z2 ^& R q7 \- Y! H-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 T/ s- H- [* A! _$ ~
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' I. a# J2 U( m% ~' c
\App Paths\Loader32.Exe L9 Y& q: ^6 ]/ `
( _0 ~, ]) p7 n. _, N7 c1 F6 V+ \( k' q
Note that some nasty apps could then erase all files from SoftICE directory
! r, g$ U5 j- ~# Q(I faced that once :-(
3 n% k8 f K. b4 O7 v/ F. ^% A' o* A# x9 n
Useful breakpoint to detect it:
3 N% y- K5 o7 d, [; K& o. }
5 t0 i% u& [3 z. t' I/ j* R BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# g4 E- \7 P% e; C3 O
! _: ]. ?0 X L& z
__________________________________________________________________________7 p) m9 C/ Z2 O- e" K
+ J3 [( ?* ^) N& Y
4 u- t$ S; X: C( J2 U
Method 14 2 t1 E) n( K5 O6 s2 M( u
=========
0 `& C# e- i" r8 ~1 c% q
: w9 T5 M, v6 s! z: ?/ a- r( ?A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) x8 x; T3 S4 r/ ~- l1 Bis to determines whether a debugger is running on your system (ring0 only).* j" w0 ~* Q* m- @# Q X, v" O$ u
9 w# U( [ X* L
VMMCall Test_Debug_Installed; G f* ~' N% \/ |, X; X, Z0 A6 O4 |
je not_installed' ^: b& W" i/ W1 p. J# U* u
7 U. ~0 w- i& H8 k3 e3 z, pThis service just checks a flag.
* D: G* E- i8 l( T. }</PRE></TD></TR></TBODY></TABLE> |