<TABLE width=500>
9 x; |2 U# ^9 h# w<TBODY>
. s5 U: W) T0 ]7 X6 P0 |<TR>
% j* y* w$ X* P2 Y/ x# I<TD><PRE>Method 01
2 D0 @+ ^6 j" ^' m% J, r=========
& d4 D9 B; K4 O8 x3 u
" u f- V3 `" F+ |4 g! G+ d) `This method of detection of SoftICE (as well as the following one) is# b; ^* |( M+ X% x
used by the majority of packers/encryptors found on Internet.
8 Q- V1 ^# _- Y4 R+ A4 IIt seeks the signature of BoundsChecker in SoftICE
8 }) q* t3 M y6 Y9 V A; `" U+ ^9 R# n( r+ z4 Q( \
mov ebp, 04243484Bh ; 'BCHK'5 h) c9 E! R# p1 V" e- l
mov ax, 04h
& U; D' y5 n4 {+ k8 j6 B int 3
9 K- V8 C" u& @% K/ ~( A cmp al,4' B' u# s- h8 m/ i. R z
jnz SoftICE_Detected
' t5 G4 H- e9 X& Z' G/ `
" l" {: v2 L& J' S" O$ F___________________________________________________________________________; g0 W+ }0 e/ k1 M: p* i2 C
7 E9 g" V/ i0 j# F" f
Method 02% A( z P4 _1 w* z
=========& i! S7 @3 O4 c+ r; t/ b# t
) ]: t/ J. p0 U
Still a method very much used (perhaps the most frequent one). It is used
# _9 R0 U; Z, H( G/ u3 t/ Jto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 n1 M2 r9 q/ d
or execute SoftICE commands.../ g4 c i8 @8 K [0 q3 D+ e$ I
It is also used to crash SoftICE and to force it to execute any commands) q4 F. ^/ e) v* b6 K7 p8 M
(HBOOT...) :-(( : d+ K8 O; N7 d- \
% T3 a3 h9 A0 h g) e
Here is a quick description:
+ |, y3 f" h* B! u! b7 F-AX = 0910h (Display string in SIce windows)
. y) r# F: z G; b0 z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 A0 m- a+ R$ c' L h' ^" D-AX = 0912h (Get breakpoint infos)
1 [) e- a, ]+ R+ O7 H-AX = 0913h (Set Sice breakpoints)
0 x6 ^8 H* l5 J+ d; _- j-AX = 0914h (Remove SIce breakoints), p, U1 s8 L' {9 l' A" c" a3 h
' m* v* y) p) a3 [Each time you'll meet this trick, you'll see:
0 R8 F; B9 C( t4 T3 G% x6 l4 k-SI = 4647h( `" W+ A _% x: W- D/ n
-DI = 4A4Dh
8 p$ r' y3 e+ ?! j6 `! {& ~$ T# HWhich are the 'magic values' used by SoftIce.5 r- @5 @/ i9 m) Z* j( h8 } Z
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! I/ }' t$ F+ v7 @7 J% G h% W R6 h D! o1 d: v0 j
Here is one example from the file "Haspinst.exe" which is the dongle HASP7 c) A; q% J, X! G( _" c3 I
Envelope utility use to protect DOS applications:
3 f. g2 O" o1 J% P* C! ~
8 ~2 {- w: G( V2 l
% S+ b7 K% \1 S& D* m4C19:0095 MOV AX,0911 ; execute command.
0 S' {8 b8 `# A( f; \7 c" Y# I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., Z! q5 j: t1 e5 |$ l
4C19:009A MOV SI,4647 ; 1st magic value.
* {/ Q1 g: ~8 G1 p% u7 `( |4C19:009D MOV DI,4A4D ; 2nd magic value.
# a2 P; d9 ?7 t) X$ F4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
' ~' x/ K7 ]* N! |- P4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 |% g _, a/ u; }4C19:00A4 INC CX' a j/ q( G8 s; n
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute5 q+ Q4 f% Z* E/ q' Z/ V) N9 O
4C19:00A8 JB 0095 ; 6 different commands.
: l) w7 [; v1 @5 \5 C2 f) k4C19:00AA JMP 0002 ; Bad_Guy jmp back.
' I( s) t8 S- r& S" t4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# W. Q, x: |: G G4 E1 ]
$ |5 M- K3 `0 f0 ~4 JThe program will execute 6 different SIce commands located at ds:dx, which* n+ L) ]3 j/ @' V1 J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 ?# H* o8 d$ Z1 r" B: ], Y& |8 e" C: [& I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 N; i8 u# m4 P0 m' y+ i1 Q2 l8 d
___________________________________________________________________________
7 k% l. I6 L9 S, K8 l# q" C
; O. q& i! S' g' E
7 F4 `& w" Y1 vMethod 03
2 o& }0 f. N9 t& l9 h+ C9 `=========, `: D+ ^6 j; d6 B5 b# N% K1 Y
! Q* m" t5 Z5 s6 u6 I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& H9 m( p+ `/ F ~8 ^- F(API Get entry point)
, N6 i! m5 {3 m$ M
: y# j+ ^0 C; N* @9 D9 [! q4 J1 l8 M4 G0 V0 S9 K
xor di,di) o. r/ ]0 i% y1 I! k9 ]
mov es,di
# J. s1 D Z, f mov ax, 1684h ! L: w$ Z5 K- O2 _+ ~2 h
mov bx, 0202h ; VxD ID of winice
# d5 G3 v- P4 d' z6 r7 g& I" I int 2Fh
. }9 j3 a' |0 [, o3 } mov ax, es ; ES:DI -> VxD API entry point& s* |0 s7 b: @6 G
add ax, di
+ B8 T6 d2 U- X test ax,ax
6 h* E8 \/ n6 h8 H. v+ U! n5 h, J" K jnz SoftICE_Detected
" S( ]& O) R& Z3 W* E7 p, m0 \- K# |) a! t2 Z, w! g
___________________________________________________________________________) k# r# _! L5 K* c R+ Z
* G* Q+ R7 m! d2 x
Method 044 h' v9 y# y# |' i6 _$ [
=========$ S9 F! n3 f+ ?* I; X% K4 G0 Z" F
9 a1 G" T- @+ u5 J8 {# H. Y xMethod identical to the preceding one except that it seeks the ID of SoftICE1 O, b) v6 a2 }, O1 W5 y4 s
GFX VxD.- D( z, G( _$ Y) h! z( U+ O* L; }+ K% u
2 i x' X" ^3 }2 Z4 G! b# D! S xor di,di+ B7 f9 m4 V9 C+ Q
mov es,di) [% n7 E/ U+ k; V! _$ Q
mov ax, 1684h # w/ K$ m* \, v
mov bx, 7a5Fh ; VxD ID of SIWVID
+ [: L i) Q* m. \ int 2fh
- b) }' f4 T1 e! T) i2 p1 @ mov ax, es ; ES:DI -> VxD API entry point/ k+ O: J0 n1 F& K! t: v, i& _7 c
add ax, di6 i! h) v3 C+ p" s9 H. i
test ax,ax
' h. m) }+ |: X7 b0 d. x# l jnz SoftICE_Detected' j I# A5 \* r* l+ P( Q4 V! x
( d3 j1 Y% Y% t; i, B& @$ I
__________________________________________________________________________
+ b, L% i! r0 F* P
7 x' K( ?, C' g: c7 `
+ c( Q/ j z5 QMethod 05
- |8 R% O2 y, L& }& j8 d=========
0 }6 q" g8 p( |, d1 U8 m$ E9 D4 }7 s+ p3 ?1 G% O" M( F' u# G
Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 m+ b( _1 O- |0 f% Sdebugger. It calls the int 41h, function 4Fh.
" ]/ c0 ~1 B3 v1 n8 y$ vThere are several alternatives. / O- @! M0 A7 U" r3 [% \. `4 V! E
: R( g: Z7 h& b
The following one is the simplest:0 Q, F$ Q! l: {5 d s
, i. O5 R4 Y- T- L/ ~
mov ax,4fh; z. _1 H6 m2 _% s, S# X4 u( D
int 41h U1 I, |+ h; M4 k! W) q
cmp ax, 0F386
& _$ ?! R, m2 X9 z1 B$ `; n% v( w jz SoftICE_detected. k9 O g& J( N) B! x
6 ` M2 J1 ^9 \& ]
' V! s7 [8 _" i" x* mNext method as well as the following one are 2 examples from Stone's " ?5 p. G* w0 _ M; F4 i5 s/ h
"stn-wid.zip" (www.cracking.net):
8 T u ~; x7 ~3 y. R1 g; m$ q
, R+ d M4 J' a' I/ o mov bx, cs2 V/ \' X; z( M: [
lea dx, int41handler2
$ b$ s7 }# s4 i7 C) a xchg dx, es:[41h*4], K5 m, ?: g: n2 I, H
xchg bx, es:[41h*4+2]5 L" U9 i& B& L" b
mov ax,4fh$ S) M( l {. `& d6 s) f7 w
int 41h
N3 N, o# R- { xchg dx, es:[41h*4], Y: P+ ^$ R0 C& a& q% @
xchg bx, es:[41h*4+2]
- K. C3 q" r8 Q5 D1 D7 ^ cmp ax, 0f386h
. w% B% |. f' o0 z3 ^' T jz SoftICE_detected: }! X w0 E& P1 F: E
W/ V7 v0 A7 D2 m* sint41handler2 PROC
+ t B7 O, h7 \) s) j, c/ R! ?" s iret
6 f9 z! H% ]3 d( Y" xint41handler2 ENDP4 W+ y" r7 G! h( L
' O' ?, d8 d# y6 m3 O _) n0 k& X$ q
_________________________________________________________________________
3 Y" B. B! X0 w) l" q
, k; ?( ]4 [. x4 a! c! J* t: Z) r6 P8 a! a
Method 06
7 Q8 M/ b0 n2 l) d" p& f6 v=========
9 s6 z j% b0 H2 K$ ]" U% Y
" Q/ x j* s' B6 s% K5 j8 M) a" K* c: B" C6 g/ |) `5 |! R: g
2nd method similar to the preceding one but more difficult to detect:
( s. Y" X5 X! l$ `4 O$ l
+ s/ ?- L, W5 n( P Y- }; L
& |' \! W) w8 @( I5 @8 \) Yint41handler PROC, a+ _1 ]6 Q* y- z
mov cl,al8 z5 h. n" j2 n) u8 k# x4 ]# u0 X
iret' o8 `6 Z; o3 H# ^* A3 p" O' _5 t
int41handler ENDP
& M' o G+ H$ r( a- m
1 t7 ]( }' l! m5 ~1 `- r# e5 K- t2 I' s
xor ax,ax
2 t$ }' [2 {" M mov es,ax. j0 t+ }6 n/ [' a1 M
mov bx, cs9 ^% n4 F; @4 L# v& m
lea dx, int41handler
$ ^3 _, o9 f' x& m xchg dx, es:[41h*4]
) f9 n6 w1 e) _8 l4 P$ N4 Y xchg bx, es:[41h*4+2]
1 {9 H$ w! t0 [1 m) N# r4 y, R in al, 40h2 u- a$ b4 X5 M: A; c8 V
xor cx,cx
7 X' Y) @6 W. M8 L5 ~5 Q: ?) g int 41h# W, e+ O6 z+ W; p! F Y: u
xchg dx, es:[41h*4]8 L# h1 `9 ^; u/ |
xchg bx, es:[41h*4+2]
7 ~9 w5 D" g Y& o cmp cl,al+ N1 y: V: S* |, p; S- M
jnz SoftICE_detected
_$ q, X: K' R/ q, e; ]1 a' }; e/ O2 Y
_________________________________________________________________________
1 s' T. L% _8 y$ l
& S! f' q. R1 `, \7 wMethod 07
; k4 _/ K; b! j7 V; r2 E=========
" m$ x, k( Q- K% o& n+ i3 z: z! p; S( O3 M' M' L' v4 f
Method of detection of the WinICE handler in the int68h (V86), R, @4 ]( b6 R, Y7 ]
! \, ?8 M4 o1 a/ r% o mov ah,43h6 d H: ]. g5 n! U- A" H- \3 k
int 68h
+ Q) {2 U$ k/ i5 x9 _4 G# G3 W cmp ax,0F386h+ p' H/ M5 t5 R1 a3 u- a) a
jz SoftICE_Detected
) c2 Q2 Y: d X! r" P( y! _4 I) j8 x5 a$ x7 _; [3 [) L- T0 g
9 [) i* @% _4 d, `/ ?
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 F: c" k# e% _& x
app like this:1 y: D6 _0 v0 l+ K: u* t
+ J8 v4 R' V3 F6 Z/ i9 R
BPX exec_int if ax==68) y' p' o: `$ b4 J' J
(function called is located at byte ptr [ebp+1Dh] and client eip is5 y0 Y1 n1 W s- ~9 R1 d
located at [ebp+48h] for 32Bit apps)2 p. {8 t1 e8 c7 j
__________________________________________________________________________6 r3 V9 O; v. {! i L# G9 ^: k7 C
m, I& r3 p0 _+ u% L" t: c: r6 ^! ]
Method 08: g7 C L3 \9 Z
=========
, ^8 c* S4 J' u d4 n, d5 G& R5 |, r) T# X$ M
It is not a method of detection of SoftICE but a possibility to crash the
" a G; \8 F9 Z. Ssystem by intercepting int 01h and int 03h and redirecting them to another2 D2 P- A7 Y1 p% Q' {4 k
routine. y: I2 k* B3 _3 c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 e5 V* L0 D* @' x
to the new routine to execute (hangs computer...)
5 U6 ?3 g: R5 H( [% s0 n) K& D; Y; l/ O; o
mov ah, 25h* y% k& C& f; J0 |
mov al, Int_Number (01h or 03h) i' g B) I" n! u
mov dx, offset New_Int_Routine
3 y5 p4 c9 B3 Z4 M! x! l int 21h
3 ` ^, e* C) j4 g" m
. o8 h: R( P6 h m/ F* Y+ u9 a__________________________________________________________________________2 C* \- \9 o! F1 N. o
8 |! L! d/ R# e# {Method 09
% E& a& S7 y5 q& d/ _- Q9 k% @; X- J+ }=========( ^$ U0 F4 p1 |/ s0 j, I
, ?) Z$ k$ U8 [! |4 z0 wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! n& r5 x# P3 j3 Vperformed in ring0 (VxD or a ring3 app using the VxdCall).
& c4 Z8 M, ^ o$ AThe Get_DDB service is used to determine whether or not a VxD is installed
- Q7 _9 X# o4 }8 ^- y' q" w7 \, vfor the specified device and returns a Device Description Block (in ecx) for0 e& S! Z# Y8 ~6 [3 H# P8 Z$ z: n- ^$ F
that device if it is installed.( {. ~! P$ C3 H
; n( l6 @7 y$ H# d( m7 d% A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 G. `# K; w9 _, U/ h+ [, C' b
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( S9 y" I8 ?/ M VMMCall Get_DDB# U0 z$ A1 C. o9 [( P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 K+ ]1 |. o, Y& f
1 p' T% p# I- L0 t# ]2 x7 T
Note as well that you can easily detect this method with SoftICE:
; `- |7 @- f$ [5 U" @& j bpx Get_DDB if ax==0202 || ax==7a5fh! \. p+ b" n' Q: W* ?8 w7 r0 N
* f9 ^+ ^9 Q6 I* I__________________________________________________________________________
, b2 T3 F, E' F/ Q6 t
$ |2 r5 i" M q" I: SMethod 10% ?, e: X" F/ P7 a5 R g# D0 x
=========
2 O I* ~5 j, H3 j
$ Z7 B% x4 B+ ~; t- m=>Disable or clear breakpoints before using this feature. DO NOT trace with
& `. q& u! i; Q) d/ H! {/ f SoftICE while the option is enable!!
0 }' u% N* \% B- ` X0 f1 c3 x6 t; ~% n& U
This trick is very efficient:
) P6 O( e) ?) O+ x+ h" m+ cby checking the Debug Registers, you can detect if SoftICE is loaded; N) u' @$ j1 K8 _
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. j) E& B7 R! x7 G& Pthere are some memory breakpoints set (dr0 to dr3) simply by reading their( Y) V( @" X, @7 }3 z
value (in ring0 only). Values can be manipulated and or changed as well. X4 w; {2 T; _0 ` y+ E
(clearing BPMs for instance)
5 D1 D" v9 f9 ~( C/ w1 H* a' Q7 C: a
__________________________________________________________________________) x' G. O# v8 x& n% S
0 a) t* y( ]( N& Q, QMethod 11
2 C. {) W2 w7 U. a4 j, s' q=========& W, X0 i7 j' k5 K6 f. t( X
/ V4 Y( S; t' {& g, G n6 n2 E* _This method is most known as 'MeltICE' because it has been freely distributed
& C1 e5 b: u+ \/ Q# b9 x& O; Jvia www.winfiles.com. However it was first used by NuMega people to allow
4 n4 S) Q/ m% K: U L6 H! f; pSymbol Loader to check if SoftICE was active or not (the code is located
v1 _. H4 L( g! i/ _$ r4 zinside nmtrans.dll).
* e8 W! |& F$ H9 m! r7 i7 a/ [; ?) ^
The way it works is very simple:
; R7 v+ z* j) @/ p8 k. x: @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
[- K" y1 y0 X, x, r0 dWinNT) with the CreateFileA API. M! V$ ~# N6 h4 h
5 E: z$ _8 h# G* I
Here is a sample (checking for 'SICE'):
8 u! J* r! Y' v0 Q
, Y) W- G: g1 MBOOL IsSoftIce95Loaded()
4 p3 x2 F# d, S4 P0 i2 X{
2 o+ h% b8 w6 W HANDLE hFile; : p( j* j: g& ^- B
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 Y. D1 K" e) }$ a/ P7 x; o" f
FILE_SHARE_READ | FILE_SHARE_WRITE,
# i% o# v5 P9 K8 f" @ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; I5 g4 Z( v6 ~& R( ^
if( hFile != INVALID_HANDLE_VALUE )
! g0 D2 x6 T4 L0 q( O: A4 h9 z& e" A {& l9 [* Y$ x* q( G
CloseHandle(hFile);
" ?' x4 g8 D3 |1 _ return TRUE;
w; _" @0 e9 q1 m( ^1 v/ m0 [ }. d& u7 ^5 F# I8 }1 e
return FALSE;0 j4 n+ D2 x6 i1 \4 n( O2 l
}
5 @, W, C7 p" k/ [0 `/ j) h# K
$ g4 @" W u) e1 u- U( [Although this trick calls the CreateFileA function, don't even expect to be+ t j) x. \( m' {% \
able to intercept it by installing a IFS hook: it will not work, no way! I! J; |5 ]% P) ~
In fact, after the call to CreateFileA it will get through VWIN32 0x001F) q, }& c& m" f9 V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. L1 c3 |( z4 x/ _- |2 I& jand then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 ?$ F: Z6 b ?# ~& gfield.9 _* s1 R/ i) b, [8 c+ f
In fact, its purpose is not to load/unload VxDs but only to send a ' |( U+ ~9 _6 X* [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ t+ S, P: ~0 Q7 xto the VxD Control_Dispatch proc (how the hell a shareware soft could try" L* s; z- P6 s) ?" d: W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 C3 v9 q/ v& C/ }% ?2 ~
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 q4 R$ d- t f0 B9 Z8 |8 e
its handle to be opened and then, will be detected.( ^7 r7 k _8 }
You can check that simply by hooking Winice.exe control proc entry point, O' ] W, X* q& E# r
while running MeltICE.
% o, i+ }/ I+ E$ f! Z c& k/ k' m3 J: a
M o" b5 D" c, B. u
00401067: push 00402025 ; \\.\SICE
3 d$ L) d0 w- G& s7 m; H 0040106C: call CreateFileA
7 I- k' |$ f3 E( [, ?% v9 \5 T 00401071: cmp eax,-001+ w$ ~& d5 ^# d% C9 R: ^+ X4 m" x% y
00401074: je 00401091: p! a9 r1 |4 ^( G. ^% L$ S
) l8 ]# o& Z% Q0 o9 A: i
7 g5 z b( W+ H* K% x/ g" ?There could be hundreds of BPX you could use to detect this trick.
6 u$ z6 S/ _9 ~( X" W& M; ?-The most classical one is:
- ?8 {0 U& K0 A+ W& ]5 f BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) w& F9 V$ z" A# r. x7 u& F *(esp->4+4)=='NTIC'
4 s" f" I! ~, M6 A! i1 h9 E) ?3 y
-The most exotic ones (could be very slooooow :-($ t( B: ]- e% {! J9 B+ o1 \* `
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') # d; Q+ G3 ^3 j. n0 X% Y, u
;will break 3 times :-(
# b* z) [/ o, T8 i* `3 K' q6 }. C. ^% @
-or (a bit) faster:
) ^7 @2 o0 X, p; H& ?1 F" i' @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), s/ o8 F- \# V! Q2 k5 U. @' L" q; B- i$ |
% I3 l8 m. Q+ V6 s0 O+ @ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) O7 r9 D" Z$ G* m ;will break 3 times :-(0 a4 y# W; O C1 M
7 `( k: @& `# h; T9 \3 o' v-Much faster:$ y7 f. ]+ n, i: J1 n0 b& V+ i
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
/ U s3 n; N! t6 m! w
$ U) k6 J! l* |% c6 K3 lNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 }2 n' W/ O Z4 E. g, Y" l" wfunction to do the same job:
$ [9 [) F, d% ~" a. X( y+ l2 Q/ C1 @6 x' |8 G
push 00 ; OF_READ
0 p+ f0 g) h+ Y mov eax,[00656634] ; '\\.\SICE',0
8 I7 p B# k- @2 ?8 B X push eax
5 \, B! L c; r2 D5 v, i call KERNEL32!_lopen
1 O4 q: k% O y3 g inc eax
1 ~9 U3 V) r' M2 K) B5 s, z jnz 00650589 ; detected' I! J3 x) A2 F
push 00 ; OF_READ/ d7 H8 c5 q$ @& b# \& f! F8 B
mov eax,[00656638] ; '\\.\SICE'
1 t- W' [( v+ @( E, I q push eax
( K% g# A( n0 A& ?$ \) I call KERNEL32!_lopen
. }# r$ C+ I' n% U; ^ inc eax
3 I: m7 b9 @- b7 C- h jz 006505ae ; not detected
3 F" i9 b7 U, c. t6 f0 m1 p( F, |7 g
8 a+ x, f2 f9 ^' ^
__________________________________________________________________________
' x* G; ^2 Q7 m1 j, W p9 F) g
9 e9 y+ p& K) n9 j4 gMethod 125 h' Y0 @7 q# K2 @% [9 m
=========2 u& V) Z9 Q A" k$ n
, l- k5 ?5 W1 U7 L" l
This trick is similar to int41h/4fh Debugger installation check (code 05
0 f4 O- n" S9 n: A, Y |! [3 S& 06) but very limited because it's only available for Win95/98 (not NT)6 i/ o4 y" E( @4 b ^; {" ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 L) G+ o" ~7 g+ i7 @. d5 F* y0 t: Z+ D
push 0000004fh ; function 4fh
! Z% u* R. L9 J, S O push 002a002ah ; high word specifies which VxD (VWIN32)1 L. o' A* w3 M
; low word specifies which service0 B5 P3 J/ U E1 F
(VWIN32_Int41Dispatch) h. i. ?3 ^% D
call Kernel32!ORD_001 ; VxdCall
; K' y5 G: T7 y& w3 m0 B cmp ax, 0f386h ; magic number returned by system debuggers J7 y) F3 `2 n+ s+ s2 Q2 d
jz SoftICE_detected
. `. D2 V& d! z6 u/ K: {' p, }; v r: v+ b6 J* x2 p E% r3 E
Here again, several ways to detect it:
' r# I1 B7 _1 F6 c2 X2 H* D. z3 c! @% ]7 n J" \0 j
BPINT 41 if ax==4f6 p+ F5 C9 E- h5 N
5 t1 m3 b- \' C0 ]9 y+ a4 H! f BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( n! \' L: @& Q9 Y! L4 U! |
2 {# R+ W$ w* j' T% |8 b" e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
8 Q" G2 {7 T& S% ~3 i! E1 l2 c
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" D K" G; D1 ^1 Z* I. @7 N$ ]2 Z! Y% u; n* X1 q/ V
__________________________________________________________________________3 ~* T/ g$ R" V' n
- J" ]! I4 u3 i6 o8 G3 B0 KMethod 139 N# v6 m7 F& j" Z. Q% l
=========
) S/ I& e. Q$ B3 f
) m) P4 Y% s" j8 rNot a real method of detection, but a good way to know if SoftICE is' L3 P0 y: M* n8 k( N( V. E* Q+ N
installed on a computer and to locate its installation directory.1 m( [9 j+ F, i# m
It is used by few softs which access the following registry keys (usually #2) :* J! a" @) d% Y( y2 q( e
0 S: n7 f! q7 x- X, T; E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# j4 ]9 t7 K1 u\Uninstall\SoftICE# e/ z+ B4 i- U' {! N0 D
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE6 [7 L# k: s/ w3 R9 p/ ]
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; g5 E1 Y1 T; q( e. r! }
\App Paths\Loader32.Exe
& X i# }5 S6 D' ?- ] {" Z' I
* F! P7 C; y* |1 b) V( ~; J6 H! W( B8 v, m
Note that some nasty apps could then erase all files from SoftICE directory( s9 v# z$ I9 ~; v1 m$ F
(I faced that once :-(
& i6 q1 W7 M4 U- G
% D0 `4 c9 Z/ O5 h j# b' o( rUseful breakpoint to detect it:
+ g; i% O+ D% I- w8 V+ r
7 d6 L: m! N9 i# ]% r: c0 ~ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
5 R/ N, U: e( [+ [! f7 Z& S% s2 I5 A% ^3 Q& o+ Z3 w: c
__________________________________________________________________________ F( ~( J' @* a4 k4 m$ x
) [7 C) M3 y+ P9 _: ^7 k6 V) n3 _
Method 14 9 { w& ~: C6 m
=========5 A) L! S& K# D
" ~& n3 l) C& j! nA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" z" t( \3 X6 r7 z6 _$ \4 r8 C
is to determines whether a debugger is running on your system (ring0 only).
) ~! M$ p) O$ |, j
. B8 ]8 k5 H- j" B% A VMMCall Test_Debug_Installed
# ?7 {: D" B- z1 o- s9 A; s6 O je not_installed% _2 c. @7 |: e# C( t0 D: ]
% N8 s& S4 y% Y) Y! c3 T4 mThis service just checks a flag.8 N0 i1 h7 P& {6 ^0 L
</PRE></TD></TR></TBODY></TABLE> |