<TABLE width=500>
; q: Z) }8 M9 x<TBODY>- `/ o; {+ U/ Q) O0 L, M0 j
<TR># q+ h" t5 ]1 _3 K. j. N3 r, |
<TD><PRE>Method 01 # @! ]* m O, F u5 R. o& U
=========
5 m& b$ J7 c# r$ m. ]. ?/ N! Y/ ?
5 n1 h' E: P+ Q- ]This method of detection of SoftICE (as well as the following one) is
3 V; M# W, M/ Hused by the majority of packers/encryptors found on Internet. B" d- I) }2 B/ p3 e
It seeks the signature of BoundsChecker in SoftICE
9 z, q$ i$ D9 L G p( c
" ^( H) ]6 R0 F" K9 S mov ebp, 04243484Bh ; 'BCHK'
3 \8 i5 N( X( N6 c& Y: e0 g, r mov ax, 04h) S) _6 D2 n: E; b7 ~8 B: r
int 3
9 K3 V6 V* m i" p7 { cmp al,4
8 B. a9 Y% i9 v. ~- L( S jnz SoftICE_Detected
4 I: L# d( U6 g5 u7 Q h5 [. U, r4 n) s' z! b7 l
___________________________________________________________________________& ~! N1 w4 B9 U) ^6 {
8 |# h4 T, \$ C( a8 O' n
Method 02
& P+ |/ u/ i2 p" s=========, Q- a' ^+ c |, Y
' V/ ~( p6 H1 U0 ^3 MStill a method very much used (perhaps the most frequent one). It is used
9 P5 O9 ]! |; ?# }' Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 d9 s7 Y3 M- I. N0 B4 |6 v; H8 |; S
or execute SoftICE commands...
) Q/ u7 o0 U9 A. LIt is also used to crash SoftICE and to force it to execute any commands
4 x$ J- z' U$ _: F1 p(HBOOT...) :-(( & t- x0 P2 W% |2 T8 ]8 ~3 Z
3 u9 y7 y1 } |9 Z* z8 a& g2 m2 @Here is a quick description:! m+ V# ~0 g4 U) n
-AX = 0910h (Display string in SIce windows)
4 f/ P2 `3 d+ ]; A, S( \-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' c! X3 j; l0 m! ^" v0 \5 w-AX = 0912h (Get breakpoint infos)
9 ?/ R4 e$ K o+ X-AX = 0913h (Set Sice breakpoints), }- _; ]' x$ T8 N
-AX = 0914h (Remove SIce breakoints)
5 q. V( |9 w8 D) o& g
+ F- n7 q* Q9 Z- K. P8 tEach time you'll meet this trick, you'll see:6 u2 c& X2 H9 _1 w. S
-SI = 4647h: x* M) P1 b' _; e
-DI = 4A4Dh
) \' o! ]+ p2 G* OWhich are the 'magic values' used by SoftIce." A) s6 ^6 f! ~0 n \, j% x1 {1 s# l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
9 ?" e; y5 M& O+ U4 g
; A: Z* V+ h/ g- O$ lHere is one example from the file "Haspinst.exe" which is the dongle HASP0 k9 c x1 g) [8 s
Envelope utility use to protect DOS applications:2 K S, T) a) P" L, J
$ U/ \9 ]1 ^! }5 }* e3 T
& i, j2 [' [, O# u( n+ W! G( m4C19:0095 MOV AX,0911 ; execute command.- y- T( T0 i. V6 v
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 ]) y, O) x. G# d8 G: D# f# Y
4C19:009A MOV SI,4647 ; 1st magic value.
" W% |# Z: H9 ]' M4C19:009D MOV DI,4A4D ; 2nd magic value.
+ `9 V) d; {- h! K& m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 O. r# N3 E B2 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute' `; [( t7 m: X8 N0 O" w& R1 P
4C19:00A4 INC CX
( d0 |: j8 j. K# q/ F0 h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute7 z7 p3 U4 ]7 p) [
4C19:00A8 JB 0095 ; 6 different commands.
$ ~# _. @4 h7 b7 w) `% E( K4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ r) f& ?9 c) _8 b4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ @2 x: S6 N- h* D! `; N4 ~1 e" ^6 p+ y
The program will execute 6 different SIce commands located at ds:dx, which3 Z) d1 W7 g. Z/ M
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 Z8 @4 N) ~9 l) C* s! w2 E
2 ^8 L/ R: W0 q& i) N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.4 M2 H& L; ^; ^2 N; }+ N9 M( d3 T
___________________________________________________________________________
* e7 S( c; S2 w( _# x: |
/ ^$ \* g; J$ ?; M1 T3 \! ? |/ Z5 C6 K l6 Z
Method 035 K) J+ y, c& U% l- |, z( }5 U
=========
7 ~+ [& z) f' g* [# K4 `7 G" _" _1 J& a2 v- W
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 [0 v+ j" F9 P) j(API Get entry point)
* P- u7 c% I p/ {
; P: [! V: k+ Z' x; a# u) J! A. X. j' i# i
xor di,di
) Y7 A4 N$ c4 U8 m9 u- H mov es,di/ L3 P0 _& ?) m0 N5 B6 T
mov ax, 1684h
1 t" W9 A, U3 k7 F# P( q( X mov bx, 0202h ; VxD ID of winice, l y; ~8 C2 o& t0 r
int 2Fh u, B* X2 d1 _: ]" \
mov ax, es ; ES:DI -> VxD API entry point
/ Z7 Z3 ~4 A/ t; K* \: D' f add ax, di5 G) H$ {+ z$ Q- @8 k* `0 m
test ax,ax
& |) U' I0 T9 h6 V5 z+ v jnz SoftICE_Detected. X* R( R" f1 e9 Y- i$ v# O
% s) a$ t/ l5 [' X, t___________________________________________________________________________7 c3 o5 w/ \9 ^2 [
& t8 A$ ~5 o ^* \9 @Method 04
4 }& b+ V5 U+ h6 h, a O=========! u' j, z; p6 Z
; \4 t S9 n) nMethod identical to the preceding one except that it seeks the ID of SoftICE
- X7 }6 ^6 | O: CGFX VxD.
1 {. O6 {- [0 N6 {3 J( g/ v9 W+ p4 j( v5 m
xor di,di) ^& d4 M6 g! ^" H3 }
mov es,di# u& p+ V& p! g' x
mov ax, 1684h
4 \% L! A+ Y- d' X# w" j mov bx, 7a5Fh ; VxD ID of SIWVID
- y( ` O$ P9 ]# `1 v8 b int 2fh" o; }& X* c5 R' |/ ^6 `8 @
mov ax, es ; ES:DI -> VxD API entry point
& Y& j6 [% f t4 l/ {& j2 a8 s: r add ax, di
6 [* k9 H. V* d test ax,ax
+ t, N' z9 g5 p jnz SoftICE_Detected: C! g+ `/ B% |8 B( H4 U8 t6 a
" Y+ b1 @* S* w) Q4 H: d/ H__________________________________________________________________________
9 U: Q9 c+ \$ B" s3 p2 F. G, ]! u: D" {! V2 I2 L% c$ c [- p
2 [" |' G; Y/ A* w6 IMethod 051 ?! v q; Z K1 a/ T# v' @8 M
=========! i" M8 {3 |- B7 m3 H- _
2 Z& M6 B4 ]6 s3 ]# G6 m% p( EMethod seeking the 'magic number' 0F386h returned (in ax) by all system
% v2 S1 \ v, z% ~$ F/ ^) x, Pdebugger. It calls the int 41h, function 4Fh." ~+ I1 w$ m- D' d1 L
There are several alternatives. ' O- P- b8 t9 t% U+ Y
! ]6 M6 O5 G8 u4 R/ T$ D" M2 l7 P3 d
The following one is the simplest:+ K R$ a3 v4 }; {. x; d% X
9 i4 v, P$ ]' u8 c: x: H mov ax,4fh
$ N( S4 R0 s3 v int 41h( c5 k2 a! a* A9 e- P
cmp ax, 0F386
' G) I, T; Q1 G+ ^+ ?2 u jz SoftICE_detected- u* O* x b" W$ z4 R u3 X A
# _$ D7 _$ f1 p! W
7 b& Q4 q( K5 `5 LNext method as well as the following one are 2 examples from Stone's 7 z D8 B, ?+ j5 I
"stn-wid.zip" (www.cracking.net):! A6 T3 t* L+ o) t1 D, P8 ~- Z' v3 _
3 ?; i' n( F x# X! c5 `+ Q: D1 w mov bx, cs) h! O; J1 S! o) L- s
lea dx, int41handler2
0 H8 t* x( ~ a- E5 K/ V3 d xchg dx, es:[41h*4]
( I Y7 k% S. z* n xchg bx, es:[41h*4+2]
9 |+ p- F# ^1 F# l mov ax,4fh5 M* q+ r2 G6 b; M3 ~+ A- m
int 41h
5 |2 o" W+ C( q. f xchg dx, es:[41h*4]) @8 H( j8 K4 |$ \1 y
xchg bx, es:[41h*4+2]
4 A6 u ^, V0 x! @# n9 g cmp ax, 0f386h+ u2 H9 }' O9 E( g J4 a) R
jz SoftICE_detected
) y7 d- @% Z1 |+ \4 b [$ W8 L7 j5 x% J, c% B) N2 d4 G; B. x" g" O# u
int41handler2 PROC+ }0 {* ]2 W2 _/ Y' V$ r6 |
iret% n, e+ @% `* Z( p5 N- k
int41handler2 ENDP
/ \. u) ~6 |; x- J) K
; f8 }8 \2 e" ^/ i# x3 q' F+ k8 Y$ M s* q
_________________________________________________________________________
9 B) d, A* V# w2 P
% d2 \& H F A3 b7 l: x1 B8 U2 _7 _
Method 06" J( c" }6 a; t( p& {2 `
=========
- e/ m: L% z. b* n& o
& }/ v7 e0 R6 |) v; G- p& p& @7 h' [0 p, h7 `) S
2nd method similar to the preceding one but more difficult to detect:
& H% f* J! x6 x$ N, i/ p. Y1 m* I( D5 h) w
- G* x0 \& _6 z m, ?int41handler PROC, R+ D: U$ h) i- c N" f% T& L
mov cl,al
: [/ K% D! t1 b3 ` iret) M( U( |3 o- h6 M- o/ D
int41handler ENDP
$ R9 Z) R+ \- C A& }; M8 Z$ p5 t$ a' n6 I! L6 ]
7 J0 A5 L. u- _5 A1 M. n
xor ax,ax5 {& c) P# G1 z4 V+ v: [; a- O
mov es,ax4 c" s6 I% Y7 e( V" j7 h# ]
mov bx, cs* {2 F- L, p- B1 Y8 I: t
lea dx, int41handler% h2 j, k0 B; W: @1 c* j% h
xchg dx, es:[41h*4]8 Q, d: a# [. c0 t" k0 h* X* \
xchg bx, es:[41h*4+2]
3 b7 g; V4 n; o# E in al, 40h
2 S. L$ {# X1 H' u) g4 W xor cx,cx
- e; A. M2 G! v' g" q* Q0 W( L% L int 41h- j; o E/ q: z' Z' d: Q2 x
xchg dx, es:[41h*4]
2 o3 F! b; D( W( | N% d! u* p xchg bx, es:[41h*4+2]
4 i) V, l V+ r cmp cl,al; Y p5 Z* `0 g" F" ~3 o Y
jnz SoftICE_detected
; X0 W/ t5 @ k
u4 y9 h. l6 k, f3 o_________________________________________________________________________
, H5 S* f7 w' }: y4 c7 g$ t5 l: u4 Y* u
Method 074 G( E @$ @% y- t
=========
5 I. \2 n. j% L; Z
2 S3 R5 L% F7 | M gMethod of detection of the WinICE handler in the int68h (V86)
# x# |& O7 v( [2 u$ t# t
+ E7 f7 q& F7 t! ^" s9 ~ mov ah,43h |% l& T) C) y0 O2 h
int 68h& R1 i+ Y9 T! R W9 q, i% S
cmp ax,0F386h) ]# I1 p" |& y1 [+ b* ~
jz SoftICE_Detected+ P0 m1 U$ _( r: P
( C: @) p# \& j% j1 u- R z/ f# p" r
+ A. z% [9 U1 R=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, {4 s5 q) @- y) W
app like this:
- c/ H8 @: N2 }2 \& T5 O& T S; v8 q; m7 a
BPX exec_int if ax==68
6 I7 z2 @- X M" _# V; b (function called is located at byte ptr [ebp+1Dh] and client eip is
& r3 `8 A2 D& R& ?/ f7 u( D, C; V2 ` located at [ebp+48h] for 32Bit apps)8 k' M! h1 Y8 I% d8 _
__________________________________________________________________________
8 \7 D1 p+ S0 v0 j' v! G/ e$ ^5 n* X% r) g
$ y; C1 n) X* f; `3 HMethod 083 [) t& h. f+ v1 J. Z# ~
=========
% T$ ^, e- i1 V8 b) p2 O/ y3 z
3 M# G% h! p9 f8 t! U( zIt is not a method of detection of SoftICE but a possibility to crash the$ K. y8 c* V% {% j" H
system by intercepting int 01h and int 03h and redirecting them to another! V! C- O; O# x7 @+ x% `
routine.( Q* r4 K$ m+ f
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, j2 G" f! N1 g! V: g$ @6 Zto the new routine to execute (hangs computer...)
$ j) y" x2 Z/ {, W3 |' x' {7 k- Q! ~4 ]$ z! a' q
mov ah, 25h4 n5 n& n; I. @$ h
mov al, Int_Number (01h or 03h); l. q; M$ M9 n; }! \ n
mov dx, offset New_Int_Routine
% l. M$ C Y, c8 S8 p- n int 21h
( G- U8 Y# O4 P* J/ S' D( h" i! J0 ~3 _ e
__________________________________________________________________________6 w3 Y$ v4 ^* R1 K
, z7 m- i8 `. d1 KMethod 09
% i# i1 S# c! c% K& `6 i=========
8 f7 Y+ v6 ^' a
6 y" ?& b- `7 tThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 r% C; s+ M/ Y/ R9 [# u: z# Tperformed in ring0 (VxD or a ring3 app using the VxdCall).
! _: {, b. ]9 B" i- E! _) f c, E8 G; uThe Get_DDB service is used to determine whether or not a VxD is installed( f% ~/ c3 [& h( s5 \% ]6 @- D+ K
for the specified device and returns a Device Description Block (in ecx) for6 R& ]+ j7 i! ~# o; }* `
that device if it is installed.; P: {+ t4 _9 m$ }
: d) {4 e; O( G0 D mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, K2 Q. {/ n: N% w/ n6 S mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)6 [5 m) ]7 P; i1 ~. L: o3 N- c1 Z0 U
VMMCall Get_DDB# ^6 |5 s3 n& t n
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 Y/ U& T) ?9 b- Y" ?
% U5 _7 S* l2 l+ } ?Note as well that you can easily detect this method with SoftICE:# E5 `7 m4 w: {
bpx Get_DDB if ax==0202 || ax==7a5fh: h7 k9 K; F9 V7 @
3 v7 {* g% C' k& G__________________________________________________________________________$ M6 t# G% j; o/ n: R. g
c6 @+ P1 z) p/ F
Method 10
& ~ b+ t. q( R( B3 K% b=========+ \2 V, }9 y" G4 h n3 z4 j9 S; x0 Q) q, b
) \% _' M3 R" @: b
=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 ~! Q5 w$ _5 V- l% `) M3 P! @ SoftICE while the option is enable!!- i- u+ _1 i9 y1 c- C
5 `. N6 m% T- ]" I" R9 ZThis trick is very efficient:
( p" _/ ` S1 R: Jby checking the Debug Registers, you can detect if SoftICE is loaded
/ A0 w8 ]- T( \(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* a- _- |+ f; u1 F( [3 B1 Jthere are some memory breakpoints set (dr0 to dr3) simply by reading their7 }- Y2 ?( n2 K. Q
value (in ring0 only). Values can be manipulated and or changed as well5 ~+ W8 ~- M. T! d; @* [- U
(clearing BPMs for instance)
# E0 { a6 t. @+ M$ `) ?
/ Y. F" X9 ~# U. Q# H__________________________________________________________________________
& \9 H& a+ z U! a$ O0 F5 g. A( H. Z7 M( {& }+ o0 B: j
Method 11
) F9 x: I" b, v; }9 \6 S% d% d" d========= T8 n" k7 u, f' M% W E
. x( f* H- B% _4 |9 W4 jThis method is most known as 'MeltICE' because it has been freely distributed! O! n" W0 k: q, n3 A* ^; F& u6 h
via www.winfiles.com. However it was first used by NuMega people to allow5 F% Q( X# Y5 Y6 O) y5 ?4 _
Symbol Loader to check if SoftICE was active or not (the code is located
1 n" V3 T3 P# l0 o/ Z" finside nmtrans.dll).
6 Z# ~, }3 o9 Q, I
7 O2 \) d) k$ I/ u+ o/ K, aThe way it works is very simple:
: i1 `4 J% H* o! D9 B+ {It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for" ?9 I+ j8 C3 Z7 {( P0 g, T
WinNT) with the CreateFileA API.
8 o$ R; x4 t' b( R2 h0 n# b% _. q6 j6 v& H0 `3 Y1 M
Here is a sample (checking for 'SICE'):
- g0 i/ C4 h0 ]* V7 C j+ a# C3 l8 `5 }' i w3 {
BOOL IsSoftIce95Loaded()
6 [- m9 \6 U& v( q8 a4 ?- F{
- m8 N1 `, ?& z- N- C/ r7 B HANDLE hFile; 1 u- T: o; q/ n( r! i* p, ~" p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 @- H% r' S- Q7 l9 N& c9 s
FILE_SHARE_READ | FILE_SHARE_WRITE,
7 h- y' ~$ R2 ?& }# H) E. j NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 V, H4 a/ U* P9 j3 Y
if( hFile != INVALID_HANDLE_VALUE )5 ]* v/ ? H) t) e) W3 Z0 U
{5 q$ X- r4 y! S- j0 O( X2 L
CloseHandle(hFile);
) S4 k2 i6 F, x; W8 l return TRUE;1 ~" C/ E* R2 p# j7 E1 M0 N0 x
}$ {1 F X4 p5 s$ s7 ~
return FALSE;7 C9 |( b# ^5 a/ G0 m& j |2 K
}6 e9 a0 u3 ?$ J: ^
/ V7 o! P, B! N1 }/ PAlthough this trick calls the CreateFileA function, don't even expect to be2 G4 h @( Z( {5 T
able to intercept it by installing a IFS hook: it will not work, no way!7 q4 d8 q2 C) o; o; _4 D
In fact, after the call to CreateFileA it will get through VWIN32 0x001F# H7 t/ d- h, @+ ~( b4 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' y% M i- M& \7 Sand then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 A! X( S- @$ f/ ]# {field.+ {, j" ~; _: l+ Y
In fact, its purpose is not to load/unload VxDs but only to send a ; x4 [) F: s5 f8 t7 b1 i& A: n1 i7 f
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
" ^/ \6 P7 y- z# i$ Sto the VxD Control_Dispatch proc (how the hell a shareware soft could try
% Q7 p! U0 l7 e6 lto load/unload a non-dynamically loadable driver such as SoftICE ;-).) Z7 L4 Y, u- k. P G
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 Z' U# f7 d2 P M
its handle to be opened and then, will be detected.
" H- ~1 N% k0 L+ AYou can check that simply by hooking Winice.exe control proc entry point) d1 u u/ M& e# [1 s: X
while running MeltICE.4 I" t" a. g1 A) Q
- E5 ]: r0 F0 W% x- t& L
2 M$ x% `7 j2 }7 r) g% J 00401067: push 00402025 ; \\.\SICE
" w# ]' e a1 L- X% W 0040106C: call CreateFileA, G5 d# d7 X+ k+ l g g; e
00401071: cmp eax,-001/ h: [8 T* z; n3 \
00401074: je 00401091, w$ M# v6 _: a+ F3 r( N
0 n/ X/ K8 p1 H$ _5 F) `) t! x* W0 h) C; v$ v3 i7 R
There could be hundreds of BPX you could use to detect this trick.: L: R6 I7 n/ T( V' m! U- n
-The most classical one is:
. D& e2 ~' a5 w3 E% R5 ]2 S BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" Y, k. h q, j
*(esp->4+4)=='NTIC'
" f/ L9 ?4 L; t% K4 y
' L+ Z; r. d* k' m5 I-The most exotic ones (could be very slooooow :-(6 L+ i' _! m6 j- _" E$ c, o- {& ?
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( ]5 J y* i/ n
;will break 3 times :-(% }7 r2 a- J) [9 q9 B
; @% f3 ]# |; G; y: g" t-or (a bit) faster:
& l; X4 h* [9 J7 E) D X/ a# D+ g9 Z/ N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
/ B2 B2 o8 {" j3 W" P% p+ G- Y
! `. P5 K# v/ Z% G8 d1 ?- d+ p1 T BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 k; o/ A. r' A! G7 m ;will break 3 times :-(; C0 p1 ^+ M" M3 ^' s( J3 S, h) a
2 d4 k& S+ q4 w-Much faster:8 o" D- ?/ @! J2 V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 ?2 C4 u0 P; [2 p( z
) S8 _) o6 h: O* h3 Q7 QNote also that some programs (like AZPR3.00) use de old 16-bit _lopen! Z4 F$ S& g9 j. d$ e2 k
function to do the same job:. P l5 X( h( n1 d% m4 A I8 ~9 @
/ t/ y9 h6 F4 Q! ^& C& _
push 00 ; OF_READ2 i8 O& O+ w. Q' n
mov eax,[00656634] ; '\\.\SICE',0" D r7 `5 n6 o6 Q- \& M+ [
push eax/ W- l5 D1 N6 r2 ]& {7 e' r! X( V
call KERNEL32!_lopen
9 S8 h2 }+ |4 Q/ z inc eax
3 {4 e7 L5 K* Q i1 Y- ?1 h4 k) t jnz 00650589 ; detected
& |# c/ Z, k# T2 }- o) O5 i push 00 ; OF_READ! {" ]6 a2 T) e6 c
mov eax,[00656638] ; '\\.\SICE'
2 C+ L, }4 {" u" n, `7 T8 R push eax, I# @5 Z7 s2 V, I
call KERNEL32!_lopen
2 ]! u! n9 W, a- K inc eax
! T/ X3 E2 H9 o4 ^ jz 006505ae ; not detected
9 [: u( R ]& v. u2 y5 `/ u9 Z! T6 t$ o/ F
7 d2 H/ _# C0 F__________________________________________________________________________1 B. f2 w5 ^0 D; [$ o5 O+ _- M
9 c, \7 X, O$ F7 P# gMethod 12& _/ Z3 E% t" A# C5 H
=========
. n, j* N' U# D% u3 j3 Z/ m8 I4 R
% t5 ~8 s7 } M' lThis trick is similar to int41h/4fh Debugger installation check (code 05- e h# n2 E! q4 M6 y
& 06) but very limited because it's only available for Win95/98 (not NT)
& o& y0 h: v7 sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 @8 ^& w) K( P# K' v
( e1 h3 Y8 F7 k& {0 H8 l
push 0000004fh ; function 4fh! u1 l2 }' ^ \
push 002a002ah ; high word specifies which VxD (VWIN32)% ?: Q% o5 t8 l; t
; low word specifies which service
0 _4 p1 p+ k3 `0 A6 `7 \ (VWIN32_Int41Dispatch)
1 q5 c: Q6 g6 b8 [ call Kernel32!ORD_001 ; VxdCall& A1 X' }+ C" I0 B6 O( p
cmp ax, 0f386h ; magic number returned by system debuggers; \$ @2 z5 u: `* C8 U$ S7 p
jz SoftICE_detected0 _; |8 u$ F! s" x5 w
{3 `- f; _ K- jHere again, several ways to detect it:
; v0 C9 B& l+ g, L& d% j* [$ H5 _: s- l& \- U
BPINT 41 if ax==4f) d% F( o: R0 B9 R8 C6 {% j
6 m6 A' o; `9 I. ^7 z! H
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one5 w8 [6 ]1 u! q0 ]$ E6 U; X
9 e& q9 u1 R3 F& R BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 }- [4 K; m! k& ]1 H7 R
- ]" K+ h; h; G- p% b* }+ q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!5 i( r7 A L7 x- ^/ |& L0 \2 w
^% Y5 w2 F2 ]4 z7 ]8 l
__________________________________________________________________________1 V. W1 U' M! O
3 H) p* H" {8 t! E5 t# f. F
Method 13
; h d. o# z' \' p+ Q/ r/ Z=========5 K* L4 p! {5 b
9 t' O1 p; H; O( N& f
Not a real method of detection, but a good way to know if SoftICE is( u+ W+ G# V1 A8 H& d1 v; O1 G. h
installed on a computer and to locate its installation directory.
1 k1 [+ X- ?8 L9 iIt is used by few softs which access the following registry keys (usually #2) :
( H1 V0 ?: R, W& | h3 `+ {
* H! U1 _) I, O* d0 d Z-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 {2 K( g @/ Y0 s* k2 H* m: I. y
\Uninstall\SoftICE8 Y* I; B, K! }7 v
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE& G C" |, P6 c0 G: E
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' f- W+ j" y# P6 m" V8 f* B; Y\App Paths\Loader32.Exe
. |" E! M& w7 W. K" s6 @5 u# {' c
% G, W+ ]: r5 @0 M. Y! c9 {: v
/ _, Y6 S6 r. P3 I4 D: B2 ~% {Note that some nasty apps could then erase all files from SoftICE directory& z% U. M+ }2 }$ n( ]( H! l
(I faced that once :-(
3 z# ~8 F9 t( R2 Q5 k/ ~; _5 |; }7 b8 T. ?3 f# O) u5 _: D
Useful breakpoint to detect it:
4 O' \1 f( d* Y% E6 M. |; y' U
; O" ^8 u, X$ F* y( | BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( R- E) Z2 q% [7 e6 S8 q: `" C8 s0 P. @3 m
__________________________________________________________________________
0 ]$ C+ B7 J1 \/ b, t
" w* j* s7 L! S. j7 u7 x+ x6 i2 \# {/ Q1 _- \. r* m3 k# Q( h
Method 14
6 y! ]2 L; X0 t; e- S=========! u# q$ g# x* C2 B" C
1 l) ~$ `2 k" a
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
) j5 B+ {: w% {& F. Z/ yis to determines whether a debugger is running on your system (ring0 only).
' P8 {; R% c- {8 Q! ?1 w2 F' t& M2 L
VMMCall Test_Debug_Installed) z+ Q4 a) z; v! U9 x5 f; o) \
je not_installed
4 ~/ p- X1 v/ F, Y5 e2 K$ E/ f: O/ K
This service just checks a flag.
9 c: w; F: D' z8 z( P</PRE></TD></TR></TBODY></TABLE> |