<TABLE width=500>) w$ D- j( T4 f( Y4 Q
<TBODY>5 c- M; j* f6 E! ^
<TR>
7 e" q7 u+ g& j5 z' d: d<TD><PRE>Method 01 ) @) f! u% S# f/ P
=========
! a0 f& U O* D' Z* t$ {
- k3 @% Q9 V! O7 t7 w( M8 {This method of detection of SoftICE (as well as the following one) is
; L7 K7 X; L; i( y+ v* Xused by the majority of packers/encryptors found on Internet.
$ v- I& X' s% |7 E; GIt seeks the signature of BoundsChecker in SoftICE
& K/ k, B; C! D! l3 J/ [; H: M7 ^
mov ebp, 04243484Bh ; 'BCHK'
) J$ b$ b' ^# [, j mov ax, 04h( D# ~8 ?% W$ K7 Z
int 3
8 |. K0 y% u0 p% N7 X cmp al,4
" R7 K+ E/ k5 Y2 a: Q0 w% Z jnz SoftICE_Detected
" b ~% [( L0 R- M p+ ]+ W& I6 G2 v" |# A: w
___________________________________________________________________________8 @% T1 ~# j; R, ]
4 p' Q! Q3 w, \8 Z, P/ [$ [Method 020 ~. ~2 M: V* Y4 f7 l
=========, m' u: x! G- M% {' R. e: t! }
& y+ |5 y) F' ]
Still a method very much used (perhaps the most frequent one). It is used
$ G0 K( g: G- |4 Ato get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" b4 M7 }3 f$ F5 X" h# eor execute SoftICE commands...& W: k% b3 L! X1 ^+ Q* f3 W8 l& A
It is also used to crash SoftICE and to force it to execute any commands$ [( m% ?! ]% j5 ^
(HBOOT...) :-((
% q$ Y' p1 n2 x6 b1 M# ^: _' ^
Here is a quick description:
5 n# U5 P+ N' O6 W7 n" _& I* A-AX = 0910h (Display string in SIce windows)
" V; O' X- s3 ?+ a; O w$ N# ?-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
F: Q4 |2 h! F- B: a: I# s-AX = 0912h (Get breakpoint infos)
9 H! u% R* E' @5 c% ]5 d-AX = 0913h (Set Sice breakpoints)6 W9 ]2 M! ?+ x. @% P
-AX = 0914h (Remove SIce breakoints)
! ^6 H6 m) V" N& D5 |5 m# i
+ U* u+ ?3 u) p I- vEach time you'll meet this trick, you'll see:
8 _ S$ j& c2 M/ E-SI = 4647h
3 W4 L3 o, z# n: m# e5 z2 R-DI = 4A4Dh
; S6 o8 B0 e! O0 ~Which are the 'magic values' used by SoftIce.: t! ]7 z( t# T& u+ P
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ Y- N) H3 T9 v7 l% Z6 X9 u* D& S F0 g. q
Here is one example from the file "Haspinst.exe" which is the dongle HASP4 |4 O6 M( L2 E
Envelope utility use to protect DOS applications:, x7 q1 u8 `5 z' E( Z# y% [
@5 b! v* u; Z* O) }; }: ~9 I& z. a( j
4C19:0095 MOV AX,0911 ; execute command.
& R( M. z) s7 l4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." U b# n8 k$ q; l6 C
4C19:009A MOV SI,4647 ; 1st magic value.) c1 ~5 ]0 N/ T
4C19:009D MOV DI,4A4D ; 2nd magic value.! L$ f. g' T1 M! X
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' n7 U6 M3 _% E& {8 O) g
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 c: v _3 J. l( r4 Q k7 C7 `4C19:00A4 INC CX
6 B2 m7 f* k {" j3 n3 q6 _4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: O2 W; A* [+ v
4C19:00A8 JB 0095 ; 6 different commands.- z0 i/ h/ X7 q' \
4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ A {- E2 l/ A+ x/ a
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 z! k9 h' }: l9 @
1 {8 J5 m1 F0 R; ^5 qThe program will execute 6 different SIce commands located at ds:dx, which* B- o9 \6 B% ~
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ {6 U( w2 y1 P- |
! X' x9 D0 `9 M
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& ?4 f1 [' V' ?7 v/ v) @___________________________________________________________________________5 p! z/ `# T: [8 P9 |
0 d! S: M+ e5 `1 r$ p8 g- l! D
+ q3 k }! g; B* C0 M$ g
Method 03) @, Q, c- h3 |# a* A0 M9 Z
=========* v2 j) L/ {$ T9 p( f
* J4 q5 N- B% m( W0 ZLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 a, J. n7 h2 s( `. j; Q
(API Get entry point)
M. u2 x6 c/ m % l+ y: w, ^8 `& r' }/ F/ v
4 a" `# h" C2 \( n7 ~8 ^
xor di,di' W k! d6 t) _1 k" A
mov es,di- L) Q& c% M2 A7 d4 I; \( Y
mov ax, 1684h
, u8 u% R% |1 T7 w mov bx, 0202h ; VxD ID of winice5 R; E" ~' S: { Q
int 2Fh9 a" U1 d3 x8 o9 i: M8 ~; X0 h' \
mov ax, es ; ES:DI -> VxD API entry point
8 i: {: n5 `+ I5 ` add ax, di
6 {9 g( A. q; L5 K5 n4 R test ax,ax
8 F6 Q8 n2 A1 |, `0 G3 `* U8 Z, q jnz SoftICE_Detected2 `. |; W2 u( y% ?2 D
) }) l9 s. q% r6 M7 p. a1 h___________________________________________________________________________3 i6 I- G) Z& e
3 D) n1 q3 Q( w* j5 Z7 I! L* }& |
Method 04
4 M9 [, i4 N/ }$ I2 I* [, r8 K=========
* I( Y, Y' e1 }% a! m4 r
: v& z) x, U' J/ y6 q5 `2 OMethod identical to the preceding one except that it seeks the ID of SoftICE
% z8 N' [( w1 D7 Z' X3 a- f5 w# }+ |; PGFX VxD.* i% }2 W/ S# Q8 w% E+ p- F. E* y
( p6 c" J5 C7 M$ x/ y
xor di,di( `* b/ d% j3 Q+ c
mov es,di
& w# p: j: S1 {5 c# n, @( u mov ax, 1684h
; ?& a8 U2 Y, } mov bx, 7a5Fh ; VxD ID of SIWVID7 r) c) a% q2 D8 [# W. y
int 2fh
4 a; b' l0 D H$ G, B# `% D6 H$ Y" r* { mov ax, es ; ES:DI -> VxD API entry point
) h8 x, P- X9 t8 } add ax, di
8 u8 j6 {- x+ D$ z' Z test ax,ax5 S$ }0 J: Z6 y# _! k, i
jnz SoftICE_Detected6 m2 g; y# N+ R+ G1 E! H
4 {* v) Y) N/ S' ~) j' N5 A4 F5 T__________________________________________________________________________/ c8 x" e: |1 k+ s. ^3 L y
7 }+ k- i5 B7 ^" X4 \& s# J* M9 {# L# g; P C: B. V
Method 05, m( { F* T: U8 ~" e/ ~1 Z, w2 j; G
=========
+ X+ y2 X6 W: f) Y4 _
3 w( ^$ L* l4 xMethod seeking the 'magic number' 0F386h returned (in ax) by all system
# ~- q# ?5 |+ d% k2 _! |+ }' @debugger. It calls the int 41h, function 4Fh.4 P& F, \7 z$ Z8 N, n8 J. C
There are several alternatives. % K0 p+ r/ {! j" k1 J) A% m! l0 I
" G6 m8 E+ D2 m
The following one is the simplest:5 a- a. W6 D6 k) i. W2 ~- ?( J; e
( X7 ^. [" j/ ]! a
mov ax,4fh
/ q0 J4 h) e+ m9 t( U int 41h
d4 ^ ?, o$ q5 a2 ?& R cmp ax, 0F386
6 E; Q/ W6 l! A# Y8 V0 ~- y$ K: O/ `* F jz SoftICE_detected6 M* U* z& Z3 Z. ~
, m, n) i/ C* R: a) E0 x g v! E$ J
% B c) {0 p. O9 lNext method as well as the following one are 2 examples from Stone's
; ]8 S! |3 V3 x+ ?9 X: x7 f"stn-wid.zip" (www.cracking.net):
4 E3 O% J& v. @4 n( m6 V( {) F
, o6 V4 L6 j; m+ } mov bx, cs
* Y3 i. E# W; n& Q2 C2 g7 L lea dx, int41handler2
4 L3 W7 B) d- E7 H A" U xchg dx, es:[41h*4]* O& H ?+ |% m. F+ ], M) }
xchg bx, es:[41h*4+2]3 Y3 }7 x( M% D
mov ax,4fh
; V+ `+ u5 ]; ~( M' y int 41h! |1 A7 ?8 {/ o3 r, Z, b1 L/ L k
xchg dx, es:[41h*4]
# ]) G5 @0 D6 ~& M4 B xchg bx, es:[41h*4+2], j- @0 m; \, ^$ l6 l9 X
cmp ax, 0f386h3 W& e7 }1 |' e0 h& A+ G1 j; r
jz SoftICE_detected
P5 t$ m! T! i. v
& Y0 ^/ ?3 W4 r# f7 Tint41handler2 PROC6 d; G$ U$ b2 }; b4 t
iret: _$ _: G1 c! ~9 Z, {: w
int41handler2 ENDP
1 Z2 ]) }5 g8 m2 a& c
2 ^6 z. n! ?6 i" [8 E, E8 h$ |- B
_________________________________________________________________________0 X# ~, L; p' H" r ^
" T0 E. w7 R8 h* C3 n
4 N+ J U( W8 SMethod 06, C) m+ ^0 z: n% p/ z8 e
=========: i3 r" H& U8 _
' E. N" W% e! i6 z: Q
% W3 M, N8 t( M$ k) s3 Y6 W/ { K
2nd method similar to the preceding one but more difficult to detect:
# C" c7 N6 A, _6 |. [2 | I' {1 w* _; X3 y1 A- |
: x$ X; L2 J: C& w Jint41handler PROC: u7 z# u: [, G0 M
mov cl,al
# y- i. z3 t& W% }$ r1 y& T2 c4 H iret
9 `% N2 }5 R3 Kint41handler ENDP' w9 G0 l9 q5 L- t! C8 i' m5 x
3 T6 V2 g) u9 D1 D; P) q
' o. N2 F- F9 |, ^* m/ U5 L xor ax,ax
5 b7 b( |* J/ m& t, u1 a6 L# b2 p mov es,ax
7 m9 |' ~ K7 m( \( M mov bx, cs
6 [2 H" s& r9 K5 h4 l lea dx, int41handler
9 R! [5 B: |5 J" u xchg dx, es:[41h*4]* W* S. [: t+ Q3 f1 p* d9 {& |- n1 g
xchg bx, es:[41h*4+2]
* N, b8 [; f5 A4 a. ^2 ^2 C4 m# Y in al, 40h+ ^/ q; w. p7 U( y
xor cx,cx
- E# X: K8 U4 o1 J* @0 e/ L( Z int 41h) j2 ] G/ R( w( R, j) c
xchg dx, es:[41h*4]5 i5 ^5 \9 @( {. g+ D; ^% U) d1 Q
xchg bx, es:[41h*4+2]
. Z8 }4 k# D4 _! d2 n3 G. l4 y4 N cmp cl,al0 b# t- x$ T5 A( T0 L* K( H
jnz SoftICE_detected
+ f/ ]; p! B8 I, ?! x3 o5 ^: x6 d+ Q
_________________________________________________________________________
& ~ h: H0 P& ~9 v. h7 y
3 v/ S4 z" B1 e0 T" Z3 U3 R% BMethod 07, x2 N1 V. I5 H1 w
=========
8 O/ v( ^- ]0 _* b) Q8 w
: k: j1 @# M U9 A/ E9 r6 F8 HMethod of detection of the WinICE handler in the int68h (V86)! L5 B y( I; L7 h: F. g/ W- b
/ J: S4 K9 b+ X# O' d& }
mov ah,43h! e. k8 d5 Z3 m) I
int 68h
0 e4 b. K1 A3 x* P: A cmp ax,0F386h
+ u0 e% j/ C4 Z jz SoftICE_Detected" _# k/ ~& B' K0 U
3 O1 q* x. g" ?9 I9 _6 |( @; Y3 J' f. g2 G0 Z6 E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit k9 ^2 V+ E% e3 Z
app like this:
* n. l3 g( R0 c. h
% m; P$ E; z/ _! v2 \8 I' v" c. F( { BPX exec_int if ax==68% u8 I3 h5 { s1 b3 A/ X
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 L$ L+ f% z: E) }/ p located at [ebp+48h] for 32Bit apps)2 }% t# p/ N7 J5 p' u$ r
__________________________________________________________________________
3 t n) f* ]9 u7 m. {+ b6 k1 M
- A$ ~- X. Y- R; }0 S( b; G: K3 N; J
9 V3 L+ _/ a/ YMethod 08/ z2 K5 B" C6 N4 R1 w
=========
/ ]0 L1 f. P0 k0 ]1 L& m
* O; a" T% }" OIt is not a method of detection of SoftICE but a possibility to crash the4 T+ z) S/ a4 K: U, A
system by intercepting int 01h and int 03h and redirecting them to another$ Q, w) f1 V9 h; Y- E9 |
routine.
5 `9 p3 W* m/ n n1 t+ V. C( f* |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
k7 \% H& v1 f& f2 W- Y3 M4 eto the new routine to execute (hangs computer...)
% G3 {- O s h; x1 R7 X5 A6 e$ y4 b7 o
mov ah, 25h4 }) y; l: w1 w& |
mov al, Int_Number (01h or 03h)
, D* [$ @4 V3 i8 j mov dx, offset New_Int_Routine+ J6 G, [; c$ Y3 e* H# T
int 21h- e3 E8 J3 X% n2 e8 Z
! M# a; e* I2 F p; }
__________________________________________________________________________5 e' _" [4 y( e* W/ r0 z
9 |" S# x3 L) n$ R$ [: Z( d
Method 09
( Q7 {! e% N) w/ E& _=========, n$ e: |- X$ f
$ _# f$ ?4 B! B0 t7 U1 f; P( vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ N( p! I) ^+ N8 g8 l. cperformed in ring0 (VxD or a ring3 app using the VxdCall).) ]7 B/ v5 n* f0 S6 @1 G g
The Get_DDB service is used to determine whether or not a VxD is installed W& J* m( k, ?
for the specified device and returns a Device Description Block (in ecx) for& h' F% h1 [- D. X& Q4 i+ M
that device if it is installed.
$ M% _* E8 C; {6 B" B }* {$ B# C' N- \' s' M# l8 U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
9 S0 p1 W8 H2 |: j1 Q' i- q, h1 F+ N mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)1 T6 }& ^2 U* M) H5 Z, m
VMMCall Get_DDB
8 G; t( o# {* q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
! d$ [) x* Z. T1 i* k
$ E& t) L1 T2 Z7 m/ zNote as well that you can easily detect this method with SoftICE:
+ p! q0 U8 r5 m$ X3 Z bpx Get_DDB if ax==0202 || ax==7a5fh2 d0 e/ i4 [) j9 d S3 a& s
* d3 w1 R2 V" F) a3 j__________________________________________________________________________( [9 n/ X6 W3 s' a b* m+ O! S, b
3 z$ I" f7 `. h8 G1 HMethod 10, O: K0 y% |- H
=========; V9 [0 k; Y* {- Z9 \ u
; w6 n) ~/ x* E1 f! C- G/ M=>Disable or clear breakpoints before using this feature. DO NOT trace with
9 w- w. P3 v% @" h: {3 ~ SoftICE while the option is enable!!8 ~ u# N6 D4 o1 }- v
- e; \( v- W" p' T( t- Q9 ~This trick is very efficient:
5 x8 a. S7 z+ H+ A: Z& @by checking the Debug Registers, you can detect if SoftICE is loaded
' {, t$ p. L4 J: e% D7 q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* `# b- Y* \; s$ |( w) y( ^
there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 z( {- C8 R& ~- Y8 h/ M" Avalue (in ring0 only). Values can be manipulated and or changed as well
" a2 i% n$ n9 a. z(clearing BPMs for instance)) o+ P* j( q0 s2 ~2 [
5 a5 H& h; y ^' ]4 A
__________________________________________________________________________; N! J' Y5 x0 u8 _: i3 y
% \) J" L8 h- n% _& {- Y. sMethod 11
* |" i# Y# g2 d( H. G4 ~=========$ R Z9 ?% [+ ]" n9 W. s1 y p, ^
& i; `- }/ B2 ?5 k
This method is most known as 'MeltICE' because it has been freely distributed/ p5 v. B t. z! @" P
via www.winfiles.com. However it was first used by NuMega people to allow5 o: h# h# o$ l% @" D* L
Symbol Loader to check if SoftICE was active or not (the code is located9 d" U d e7 x
inside nmtrans.dll).
: H( i1 I$ S* Q% ?/ }7 ^6 `; ?% H, k L
The way it works is very simple:
- D6 \9 D0 l; `! HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 c* j, ` U0 L# Z: e+ ]
WinNT) with the CreateFileA API.5 c j0 U4 b; t: v6 D& `' F
5 S( ]' Y8 i) K8 r
Here is a sample (checking for 'SICE'):
3 E3 c5 b! |4 F2 L5 M/ a4 B
. ?$ K( }* N9 ?$ h. X X4 N5 r4 I- D8 fBOOL IsSoftIce95Loaded()" o3 U6 `2 j* M. @, i. X% |# R
{# B5 Z* i' b6 S Z7 V- T
HANDLE hFile; ) `. b4 V; a5 p4 U
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 U, i5 e: w/ R
FILE_SHARE_READ | FILE_SHARE_WRITE,& l' z# T( _8 A" S9 b
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);, |7 B" F" V; W
if( hFile != INVALID_HANDLE_VALUE )" j, b9 t/ R1 h8 n* ~
{% `$ K; f. [* ?& Y4 c H
CloseHandle(hFile);
9 f7 q5 D1 b/ V return TRUE;2 c0 f8 |/ _1 t! G
}7 S* E$ H6 B! {, \' r$ z
return FALSE;6 Y* L* Y( ?6 b% K1 F; d
}
' c2 m$ q8 p0 P( @$ |
/ P7 ? A/ E/ |Although this trick calls the CreateFileA function, don't even expect to be
9 l( `4 o; l2 e8 G8 Y1 e4 Hable to intercept it by installing a IFS hook: it will not work, no way!7 u+ p" Y1 y; h- u3 E
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 X5 u/ i1 t+ qservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ \! J* G& |8 y! y/ `, E0 q; tand then browse the DDB list until it find the VxD and its DDB_Control_Proc( Z S. z: C4 q% L K0 r
field.- [ \. \4 T8 K5 c$ U$ K: E
In fact, its purpose is not to load/unload VxDs but only to send a * F5 l. W" a3 I4 ]
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
& g* O' o5 Z: q6 Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try: m) X8 t: I5 H/ A
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ R3 S- y& |! |9 j. }If the VxD is loaded, it will always clear eax and the Carry flag to allow
; J* `1 G5 k& j* Eits handle to be opened and then, will be detected.
8 N% y3 ~5 `2 C- z) OYou can check that simply by hooking Winice.exe control proc entry point8 x6 L. ]' K6 W1 |/ o% @
while running MeltICE.7 X, i3 v7 Q' Z2 V0 y
% l! H6 g2 R6 o, w
, w/ y3 g/ H+ l( g9 N 00401067: push 00402025 ; \\.\SICE1 O$ r0 ~( y. [) V. r( z
0040106C: call CreateFileA
* y/ F0 P$ S0 H9 E. X 00401071: cmp eax,-001" U3 I& b ?. S$ n4 n) ^
00401074: je 00401091
6 p, {& A" L0 k6 H1 x# V" Z
# ? ?+ c, q' ?) i) v" j
K, f' c# p5 O; b& p# z8 sThere could be hundreds of BPX you could use to detect this trick.* r0 u9 p$ i* C" E& h
-The most classical one is:! U. n/ k6 E2 v: k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ O, B/ h. ^. | *(esp->4+4)=='NTIC'
3 n. r" I! {# ~( o* H
3 K) ?; Q2 R1 U8 @8 l& P: ]-The most exotic ones (could be very slooooow :-(
: L9 B8 _; V. A( g, O' ]& R BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') + [7 A! O7 A( y& ^. x6 M% p( B
;will break 3 times :-(8 ~1 e& t! _4 w6 L! K3 \: [& X0 x7 w) @! r
/ p' V: T* m9 s* ?
-or (a bit) faster:
% N* s- U' Z5 @. n1 a6 Z BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ ]8 ]- u1 {" w1 B4 o' r. |5 |. Y2 h/ l1 Y, y
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
* s' ?- {4 ~# u& g0 _ ;will break 3 times :-($ p, T* S) m8 W$ \ n. E2 f% i
6 H2 i" ?; o. n-Much faster:
7 q( C; u/ v. C+ R% p BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! @' y7 ]9 c% W% ?. e" [8 q2 A& O1 h1 I/ }; j( u( T; l3 F/ w6 j
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) W) K+ K" m( Q$ q& Y8 |function to do the same job:, ~1 {5 O7 B) E. }" v
! J Y. D" l8 M. B2 ^ push 00 ; OF_READ
k5 R1 H W& V$ j8 C+ ^# o( J9 B mov eax,[00656634] ; '\\.\SICE',0
5 ~" j7 B$ C( P2 w push eax5 L' e( Y3 W( e' |5 ?1 s% v
call KERNEL32!_lopen
( S! ?& v7 t1 O, G* O inc eax0 p& q9 E9 A9 T' I
jnz 00650589 ; detected+ o8 C$ r2 s% t D1 ]2 E
push 00 ; OF_READ
( d" v" \- `2 s/ ^7 h4 r mov eax,[00656638] ; '\\.\SICE'
+ h! L2 y: D. w: o) a3 @- E% n' a push eax: \) R5 _) u( \% \' l# X. v, B
call KERNEL32!_lopen: y. F" E, W. X. m2 |
inc eax$ T9 M. H5 y7 Q& h% g, e
jz 006505ae ; not detected
/ O1 ]8 V9 y' L8 N N
4 G: N6 c! G( M* d1 i' ^* [: p, j/ T% T+ x
__________________________________________________________________________
) R8 H: W) h9 t2 H. B- Y, ^; Q) W* X$ S5 J2 i7 k
Method 12% L7 M: c6 u. v( x, l
=========4 W9 d" s' J: `9 ?. `
2 R% g9 ] t/ v& _' `
This trick is similar to int41h/4fh Debugger installation check (code 05
; L, {8 R1 l+ O4 J- L& 06) but very limited because it's only available for Win95/98 (not NT)+ N& d7 `. \9 ]! q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ |1 I2 W5 V; y! \
5 R5 R, B& s( P! S% S( i, a+ h push 0000004fh ; function 4fh6 f2 l. Y. a' |& x
push 002a002ah ; high word specifies which VxD (VWIN32)
" O1 H5 g8 \. ^ ; low word specifies which service
7 Q& F- F1 `. C3 n7 n5 F (VWIN32_Int41Dispatch)7 f, B7 q' E& w8 x% p/ L0 `% d) V
call Kernel32!ORD_001 ; VxdCall( y5 a& C; A, ^: h6 m/ Q: @% c
cmp ax, 0f386h ; magic number returned by system debuggers
0 H3 j. s3 k( c9 l: x# u) q jz SoftICE_detected
. x: h! I$ }+ i1 ^; k# L( F# m
8 }5 {% j! ^$ ]( T7 {+ iHere again, several ways to detect it:
' b2 C- r( }# \# R5 d2 z+ S. a- |! O2 n8 s
BPINT 41 if ax==4f
9 u" x4 r5 i( N
( Z3 r7 s" ]2 Z) C m BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 P3 g- | V# F B* \; O) H" u
* Y3 a8 E. N1 I2 F3 s BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 i/ l7 a/ r: H, e
* p3 p4 d |9 y$ m! B9 P5 m BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! c- u0 ?* c/ Z
6 U: O/ q# U4 |* i
__________________________________________________________________________
: Q( r* X, a. E& p0 t2 | A S, _# w& P
Method 13
% F& U/ E4 m7 W( Y; P=========% l& G1 _* O9 {2 M, \1 E
# Z9 L; Y/ G9 d8 m- a" C
Not a real method of detection, but a good way to know if SoftICE is8 L/ o7 C- r- S5 t0 [2 }% e
installed on a computer and to locate its installation directory.$ V+ Z' i: B7 E" B: {& k
It is used by few softs which access the following registry keys (usually #2) :
8 @' r$ ?. i9 U# V" D6 F! Z
1 l4 X1 v1 u# A; m9 N9 }, ~8 @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& }* O* O$ _9 M' i" [, D\Uninstall\SoftICE
! m& F% x# @3 {, s/ c-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 Q" X; y: [, C1 V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' c2 \% ~/ l/ g, E2 W' p\App Paths\Loader32.Exe
1 j- P. Z/ h2 K0 m6 W6 B7 y
, w3 a8 X) \/ R. u. _/ _! ~1 |/ J0 Z/ E+ z( \2 B
Note that some nasty apps could then erase all files from SoftICE directory
1 d1 K0 D2 ]4 H(I faced that once :-($ f5 I, u2 C# M$ K
/ _& j" V0 d/ V% P( M' w8 C
Useful breakpoint to detect it:
' _) S) ^9 l6 m. U6 T% C+ G. e0 C; t; [# b& \3 K+ M9 D
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 t4 @, ~! u% n5 o5 x# k
8 r' I/ d, C7 j& {, q4 L
__________________________________________________________________________
& L! t+ |! N' w8 G4 [, z( d$ E2 \. g0 |2 Q |: a
, S9 b9 [/ ]. k7 F8 \, f
Method 14 : j/ C# O8 U2 X3 `. Z; i" g
=========' z' M- V ?' l. y
( ?2 w( W! Q* [8 n3 d2 XA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! Y, ^* d; x, R8 y7 c9 G- D0 wis to determines whether a debugger is running on your system (ring0 only).
8 v+ \& \) h! t! M7 m
$ C- P2 ~7 H! D: w- g/ L: z6 j W VMMCall Test_Debug_Installed
7 \6 c+ B# p7 d2 _3 p2 Y je not_installed8 J/ U" ^# L" O. p$ Y1 Z/ X
9 s! i- V8 m2 d* v% \, fThis service just checks a flag.
" g# S7 j) q4 J1 o</PRE></TD></TR></TBODY></TABLE> |