<TABLE width=500>5 q8 q, P+ E- A6 A2 e: N0 u
<TBODY>
6 D* b+ F& i* c# r<TR>
( q4 ^4 e, f5 n8 L4 o<TD><PRE>Method 01
9 }6 Y6 j3 u) x+ M$ J$ N5 l=========9 V- U& }# S1 K, J3 G% A- q
% H/ v+ S, j0 }This method of detection of SoftICE (as well as the following one) is
+ l, B: b9 e8 ]6 T$ m( C k" sused by the majority of packers/encryptors found on Internet. L }# K3 q; R2 H" `, Z
It seeks the signature of BoundsChecker in SoftICE4 D: V' Y: u2 y5 k- g
9 G1 t/ i4 t* b( [1 t3 {- o
mov ebp, 04243484Bh ; 'BCHK'
* K$ ?" _% y% F+ y( } mov ax, 04h9 K2 l2 @0 y; |. O0 y& _% Y5 A
int 3
* P3 L: O5 U ?# b3 k5 H cmp al,4; T2 A% M2 y, W; _" W
jnz SoftICE_Detected
; A! U$ F E4 D3 U
7 O" y$ j/ l( j5 R9 q9 l___________________________________________________________________________& s n4 X1 a! d+ c
' r# K% [# _( p/ w% N& {) W0 l1 h
Method 02
1 s& B5 g# S* z/ Q0 f: V/ R: |8 w=========
/ R" v3 ^; O' [+ Z. ^
1 A$ Z& r; Z* \' iStill a method very much used (perhaps the most frequent one). It is used
! B" d+ |* K7 q* Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 p' x4 n1 _& Mor execute SoftICE commands...
* H( w9 y4 [. S' I4 |) QIt is also used to crash SoftICE and to force it to execute any commands
8 Q9 P- Y* L' [( `* v(HBOOT...) :-((
( I+ }, l7 f4 a A# _ P, `
; _& [* Z! u" uHere is a quick description:# P/ v5 b2 [2 A* A" J. N
-AX = 0910h (Display string in SIce windows); V: F+ u5 r: D- a
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! t% l, C) Q" ^/ Q- J7 ~* f-AX = 0912h (Get breakpoint infos)
: L' l( c; q# h-AX = 0913h (Set Sice breakpoints)2 g$ n6 E! ]/ @
-AX = 0914h (Remove SIce breakoints)
) N2 l5 Z& Q8 @8 D9 p
- I7 D6 \! R) Y8 zEach time you'll meet this trick, you'll see:: D+ [# J8 b {0 x# L; P3 I
-SI = 4647h
4 Z/ l$ D+ ]! j( M7 D4 ~-DI = 4A4Dh7 _7 d; a$ t) `) x" |
Which are the 'magic values' used by SoftIce.
* L5 U i* l$ jFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 m [5 f3 R4 E2 {7 s5 X2 y8 u. w% a% g( E, e5 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 X, a. q3 u7 a) REnvelope utility use to protect DOS applications:6 P/ P: g2 x3 u" p+ d
7 H2 s" i$ G6 r' i% v+ n1 r, w
6 O0 p, \* {, j6 |7 c4C19:0095 MOV AX,0911 ; execute command.
9 \; O4 J; z! d: l6 b1 w4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 {! Q; D6 V$ l* X: _4C19:009A MOV SI,4647 ; 1st magic value.
- D' e E8 ?0 Q& x/ K: F6 w/ p. @4C19:009D MOV DI,4A4D ; 2nd magic value.6 r4 c8 ]; Y/ p. [: c
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, _; ^( ] H3 e6 M# F5 G4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; H' m3 o7 I4 \8 c: T' m1 P6 Q/ O
4C19:00A4 INC CX; W7 ^" j' S" e z+ w, X
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
9 P: |- X7 X) [3 {% g" m4C19:00A8 JB 0095 ; 6 different commands.6 b, x" [" v& X6 d2 O5 Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ v! L+ H& j% v4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 n5 Y6 k1 `4 o! I, v; b% c
0 s( o d% u1 A, N$ f0 JThe program will execute 6 different SIce commands located at ds:dx, which( y% b$ }+ k; d6 J* o/ k7 |) a+ Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 _! x! l- I5 j( G
+ G. p3 R- ^% h$ v0 p+ }
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ ?( b( U6 O' o
___________________________________________________________________________
1 ^' l, ^7 h+ v: X( V" h. O5 N7 l2 t+ ~
, w2 }4 X+ \) g/ T5 ^0 _8 N1 ?" @
Method 03
( U! d( L& n5 P% A=========1 C+ o" M4 X9 e* h# L# y* {
; M* J4 G1 I$ \3 I5 O- X" N6 T1 ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 V* g) i& \& V+ @+ G(API Get entry point)
" Z: U5 g+ a/ H" l: J, G0 r 6 O2 t! A% \# i. L" i* M
5 u+ J8 ]$ H8 M" u3 Z& s( l xor di,di
2 ^6 K( S6 @3 \+ l mov es,di( l; S4 t D; G4 w+ A
mov ax, 1684h
; l/ w4 _8 s5 T. H5 H7 T: \ mov bx, 0202h ; VxD ID of winice
, T4 r; N) j) V" j+ {7 { int 2Fh# J: ^( C+ O1 }/ M# [* \3 o) v2 f. _
mov ax, es ; ES:DI -> VxD API entry point# o. q& R3 F7 N2 ~; d. M. Y' {
add ax, di/ v7 y r& s5 d! I3 b
test ax,ax
. n, J4 ?3 C, } jnz SoftICE_Detected
3 @* m$ b& r4 R6 y1 N
5 x* p* N% \. F___________________________________________________________________________- r: a& o$ o$ p
* x2 O% c1 x6 h G& o
Method 04: l% w6 M, n; v9 k1 a9 Y1 S! [
=========1 ]: e6 s8 F D+ e! ^5 f1 a. ~: ?
6 F6 b8 m q8 j/ hMethod identical to the preceding one except that it seeks the ID of SoftICE
- p0 r% R( [+ h8 ^& [GFX VxD.) ?; ^& b2 ~" g( d; k$ p
/ G. L4 x. E' D
xor di,di/ _& E; {6 v- p5 I, D+ u
mov es,di
/ H# Q5 A& { ~3 W: G/ T mov ax, 1684h
5 `+ J7 V9 I: \& \: h( @0 V8 B mov bx, 7a5Fh ; VxD ID of SIWVID
" u! \. S5 |# v$ o" z( |; V int 2fh
8 P& Q* ^; [( j9 N" v& y' [ mov ax, es ; ES:DI -> VxD API entry point0 D5 Z1 m% Q1 T" e
add ax, di
- z: b5 e& U/ w2 e test ax,ax
# [# u O% ]- O jnz SoftICE_Detected
: M5 M ~8 G1 l Z* A& L
' m/ B5 R* T* K" ___________________________________________________________________________
4 d6 v! a6 a' x( U! `0 E0 T
/ M |" o/ t% \
. g0 v/ Y% \! J9 ]% JMethod 05
9 l& e! q0 w G P% u=========
! f$ H" k. U3 s- e5 x4 v& N9 g2 g9 r' ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system
# s- E! P5 S% y/ f% b# P/ e8 H1 Hdebugger. It calls the int 41h, function 4Fh.
3 E6 }9 C6 K+ E. P: t# O1 fThere are several alternatives.
6 m/ G! S* S/ _9 Y% d2 j+ F2 s- t3 F
' ~- Q0 k8 V1 Z4 I; W5 [1 L' k1 ]The following one is the simplest:
7 S) M) b% c; c: G3 a, l+ k) ?8 G3 F
" c/ W9 |6 ?" N3 s, b& Q s5 ] mov ax,4fh- C* R2 e! l" Q1 Q: z
int 41h
8 }( W' A3 M1 z# ` cmp ax, 0F3864 O& d+ f* N; U& \1 D* [% g2 d
jz SoftICE_detected
& E2 W" E" }$ i! m, a) K6 V/ a5 N2 Y( Q, X
3 R5 b. L) Q' t" N; y5 F
Next method as well as the following one are 2 examples from Stone's
/ ~+ m6 ~9 J! b' }/ p( f! t"stn-wid.zip" (www.cracking.net):
% A! t; M4 a, J1 i; S* s0 G' ]3 S2 W/ o* R3 s2 d. i
mov bx, cs- j" I2 ]" U2 z% O0 p. A6 j
lea dx, int41handler2/ p b; j9 i: B* N' x
xchg dx, es:[41h*4]/ r/ q& ` S8 t: l( r
xchg bx, es:[41h*4+2]$ `7 l v4 N% Y" e7 @5 D S8 m
mov ax,4fh
4 k/ K, d6 ^$ V1 Z j! s. i int 41h
& J% y8 U8 h- C& t% b xchg dx, es:[41h*4]
6 U; [* d# m( x/ K7 l xchg bx, es:[41h*4+2]
+ o3 t; V" i3 E2 t- U cmp ax, 0f386h
5 w* ^! W& x, G/ S" i7 F jz SoftICE_detected( Z* l% R4 g4 I7 `. S) O* z
! t+ `1 ~5 z* e; L4 r3 S
int41handler2 PROC
E6 l! @% p/ p- V3 Y9 x) a' A9 p iret
7 ^3 z2 z3 k( f0 @* B3 iint41handler2 ENDP m, e4 r3 J# t: _( D) a6 q& l
# S: a% q8 f. H) A* ~/ V
1 Z5 N# i# |" i1 [; W2 J+ I: L_________________________________________________________________________
0 Z. C8 ~6 h C7 A4 ~
# E$ _5 m1 J) F, m+ n3 `0 Q8 k1 o9 g0 a4 Y) ~
Method 06
N1 [# X7 X" U=========, A, r) Y ^) Q5 b f# x+ i
; K) y0 M7 M' o
( }' i% I/ q# S) D2nd method similar to the preceding one but more difficult to detect:
) f6 b3 q/ j+ N- ]$ T4 D- d# ^- V
: e3 }+ n% B: f% f/ J8 z" N: H0 H3 K
int41handler PROC
" Z, E- i3 n4 F$ T. ^# K3 J8 u mov cl,al! O2 c( ?2 F. K5 H
iret
# q7 k! a$ d& A$ j. P; T& Uint41handler ENDP
( V* X) B2 @0 j- f
! d3 o8 f: Q. ~+ W f' B6 I
( Z: c, f) i* g& d6 o0 P8 n7 G xor ax,ax; N8 O. E% z8 C4 t' ~
mov es,ax
' T2 L8 T% C# t7 q# B" H% d! J mov bx, cs% Q$ q/ @/ F5 V0 X2 Z
lea dx, int41handler
3 f! V% g8 I% @& E! K. u xchg dx, es:[41h*4]
4 C8 I! F& C- P7 N* {$ K$ H xchg bx, es:[41h*4+2]
1 B' ` N5 L7 j in al, 40h5 z) \5 ]7 b- B" Z* s
xor cx,cx
2 f; R9 I: O% K# q8 w int 41h. X! L6 e' U0 D* A* @/ y
xchg dx, es:[41h*4]
- h% C2 T1 _2 ~5 E c' z xchg bx, es:[41h*4+2]# C3 V1 i! a, p4 M; }: L
cmp cl,al8 f O# }9 l% h0 z) n: C2 [, w
jnz SoftICE_detected9 ~0 ?' ?5 W/ ?' i" D2 n
/ G/ X6 \8 ^5 a) \_________________________________________________________________________
# j; H$ c1 ^1 M6 z/ Y' F
% ?- t9 G& o+ ?( l" H2 M: aMethod 07
' h9 y1 N% C+ M8 k+ u=========9 O4 w. I8 ?) S: H8 z+ M, j
" B* o9 t1 v& x( g
Method of detection of the WinICE handler in the int68h (V86)
: }% F: d! V, n2 o" B2 h% q/ E1 }
mov ah,43h- |3 f/ @9 f# Q! n
int 68h/ Z3 @; u5 ?$ E
cmp ax,0F386h: i+ R/ f; I s8 E' C0 r3 `
jz SoftICE_Detected& S( i7 @8 O6 Y
- _: ?& m1 i- w/ }$ o* Q
: Y# Z/ o7 K/ e6 Z- r: B=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- f# D% Q. q2 j( G1 f app like this:& i& k7 d) I& M. c& g, E
& L5 Q* r$ [% Q* [ BPX exec_int if ax==687 g% i: V6 N0 T. h$ T/ s7 ?
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 K, _, A7 e l0 n! u, ^5 h. Q located at [ebp+48h] for 32Bit apps)' G3 ?* l) l3 c) y
__________________________________________________________________________
7 A; L. p' \, a# Y: Z. T" X, Y0 M: |. r0 `
/ b* y/ i" Z) {+ s! ^1 }Method 08
D! g3 y/ M0 |& r' L% m& U& p=========
7 z! K% \- z. M- ]" s' f) G E* [+ b; T: M, d, Y k) @3 O
It is not a method of detection of SoftICE but a possibility to crash the5 `1 m0 m* L- m, j2 G4 \' m7 n
system by intercepting int 01h and int 03h and redirecting them to another- c7 z5 w) D: Z; e) s' B
routine.
/ n+ Q0 D H9 T1 `It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# b1 w0 P1 L. n: dto the new routine to execute (hangs computer...)2 L- z9 V% z8 c- K% y6 C ?, G3 z
J _" x/ \3 }1 r
mov ah, 25h
+ ~; D; ]% x2 \7 n; K! ? mov al, Int_Number (01h or 03h)" Q' d# v1 A! X1 I
mov dx, offset New_Int_Routine5 L6 s0 h# F' @( r$ v5 b% Z
int 21h8 A! g# q4 f* u' u& I
4 X/ J7 [% w% P6 z__________________________________________________________________________# q' C( I9 d, x3 c" s. a
" N' `2 d& e1 T" u: w7 g$ z* lMethod 09
/ A8 w7 ^# V/ W9 }3 `8 U- {5 d9 u$ j=========
! Q! e/ ]+ h. u! K$ h0 a
7 G4 S9 ?! o* f9 O1 F5 _2 nThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ V+ a" J, ]4 Z1 y
performed in ring0 (VxD or a ring3 app using the VxdCall).
8 G9 x5 Y# J9 n }& P2 p1 M5 SThe Get_DDB service is used to determine whether or not a VxD is installed# ~1 I3 Y0 L1 B, t! G
for the specified device and returns a Device Description Block (in ecx) for/ T$ k- f: {; }- j! w8 {6 _! b
that device if it is installed.. p$ n- I% u$ S( ]6 y1 r
# L- x# d; {! I/ C
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 @ C# X% u1 p& ?3 W; x" V
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 k7 N! x8 F* Q$ z/ ]6 g VMMCall Get_DDB
7 p4 a; j* m+ ?+ E: H, W mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, n* o- X3 E; r6 h( q
) `/ s! M* B qNote as well that you can easily detect this method with SoftICE:5 Y1 p6 m S9 M# P
bpx Get_DDB if ax==0202 || ax==7a5fh( I) z3 n. D# K# W/ S" n
/ H* L: w) [' G4 q4 Q__________________________________________________________________________- B+ y+ B$ k0 G
3 j3 Y/ a. x8 r9 [* FMethod 10
8 s4 r. p9 o, }( F. L+ }2 ^=========
, F! T) l- O% Z. b/ W6 } J* b' R" x2 |9 H; f, ~9 R& [
=>Disable or clear breakpoints before using this feature. DO NOT trace with( [9 G. o% W& ^; z0 O2 m* w
SoftICE while the option is enable!!; R* i# y* m9 m8 \/ Q
. F; w' A/ S; M( K% J- VThis trick is very efficient:
6 @: ?, f: e- `9 K1 lby checking the Debug Registers, you can detect if SoftICE is loaded' u! b7 a4 y2 M5 d9 E
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 b1 {& q9 m( x: J( |$ K; W# \. P
there are some memory breakpoints set (dr0 to dr3) simply by reading their, Q- j ^+ N% W
value (in ring0 only). Values can be manipulated and or changed as well
; R8 G @% m3 O/ I$ l(clearing BPMs for instance)- _3 u, g( Q; E i7 `' t% d4 M
( J' [% J" L0 b7 n__________________________________________________________________________
) w; V1 I/ X# ]! F
2 K3 |1 k6 A5 w8 z; j2 tMethod 116 ]8 }6 y( `( @: V+ b2 r
=========% ~: C8 b3 r+ k
, `' p0 `% `1 r9 x. O# ~This method is most known as 'MeltICE' because it has been freely distributed
; o. W. m* D9 \via www.winfiles.com. However it was first used by NuMega people to allow
# i2 V9 F9 i0 I& TSymbol Loader to check if SoftICE was active or not (the code is located
9 ?, e2 x& R4 t5 iinside nmtrans.dll)." E% A$ N1 n/ e' v
& ~: ~- F8 U$ b9 D. y' `
The way it works is very simple:- B1 x2 Y% M( h( R
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 D# i; N2 }- T$ \WinNT) with the CreateFileA API.
* U4 {) [5 U$ d( R/ q* u
! x, Q1 r# f/ C, O6 U' \Here is a sample (checking for 'SICE'):
+ I/ t" e& ~+ V- o6 E% J* \! T/ J2 q# P1 B% u8 L6 {; A
BOOL IsSoftIce95Loaded()
: _) Q7 L# e+ N* B) r5 f{
: Q4 C1 y" h" `; [ HANDLE hFile; " C7 f0 P+ v9 s9 P% o+ r
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
$ [+ h' f; h$ T& ~# g | FILE_SHARE_READ | FILE_SHARE_WRITE,; A, b1 \* F7 M
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);5 r0 E$ H1 }1 c8 u. Z- @. g9 d8 a
if( hFile != INVALID_HANDLE_VALUE )( |/ S! C f; F0 j3 u2 T
{
* y# X6 H. D! ~0 C' H3 C2 X# T CloseHandle(hFile);/ ?( Q1 e7 g, u, G3 u. i( h
return TRUE;
, a$ C: Y) _+ v+ C0 V }4 `& @4 i0 j0 K. ]& x5 a8 z1 T3 y3 w
return FALSE;
6 D9 P& v5 L0 f}. S* V2 H" z, Y$ I" Y: O: b
3 h; f# a/ t' W' Y P5 z- uAlthough this trick calls the CreateFileA function, don't even expect to be% ]6 D( M" r0 k9 |4 E
able to intercept it by installing a IFS hook: it will not work, no way!
7 j q' d( e( y0 X( U2 T) }In fact, after the call to CreateFileA it will get through VWIN32 0x001F% K+ ^- p- F3 z6 g+ k
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# {0 b+ P# ?: k1 W: ~and then browse the DDB list until it find the VxD and its DDB_Control_Proc% ~. Q1 F) p, y+ p2 z" |
field.
{: n# ~8 l/ L8 B8 _In fact, its purpose is not to load/unload VxDs but only to send a ! I; ?4 k. G$ I& t
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)/ }4 J6 E9 ^5 A1 a6 |+ U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 y, G8 j, I+ F! w+ dto load/unload a non-dynamically loadable driver such as SoftICE ;-).! ]: ~1 b5 s, g3 ?) ^+ \, F
If the VxD is loaded, it will always clear eax and the Carry flag to allow0 _# b7 `8 R( W: ?% Q
its handle to be opened and then, will be detected.7 q! z9 k1 `1 O+ a( y1 [
You can check that simply by hooking Winice.exe control proc entry point$ R( s9 Q5 E z
while running MeltICE.6 B+ |5 U/ ]) K0 j* \9 r
! b7 q4 ~* @5 y, p0 D' b4 R( h
9 N% D& [7 C, A! w6 } 00401067: push 00402025 ; \\.\SICE9 x& ]8 x n, y4 w# O
0040106C: call CreateFileA
9 Z& ~2 o5 b; H 00401071: cmp eax,-001
" d, c* t3 c7 t" N 00401074: je 00401091
1 K5 X$ l; d4 [5 r- z9 {1 A
4 w7 f; U* y. w! T( H
9 o, z& e: S, C( `2 J3 RThere could be hundreds of BPX you could use to detect this trick.4 L; e2 |/ ` ]
-The most classical one is:
. I& C9 c) C) s- I* Q: z BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# y0 J% `0 n0 D *(esp->4+4)=='NTIC'
6 k) S. W! K/ O5 g" l9 {1 V$ C' }/ _
-The most exotic ones (could be very slooooow :-(
7 N1 g- C" C4 n M4 Y9 D" ~/ j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 f# t0 k8 _% A1 _# G ;will break 3 times :-(
! u$ h* i0 Z( f9 A8 W
$ I+ G+ ]& J% _8 [0 N-or (a bit) faster:
; s' `" u; {' A3 j4 G BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" H3 y" I3 x3 U- q) C( |# Q7 y
( ~3 A3 b0 W3 m; g
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 a* F! U( h$ J# ]" |
;will break 3 times :-(- }% r: }0 V% z1 E: [* ^
$ _- N( C4 o5 ]5 O, o-Much faster:+ p& X7 M1 H* G% e+ I9 N+ s0 ]
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 z3 k' u) v1 [( @
" a- w% L7 y; R& P$ w4 }) MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen' k/ K' C! O2 N6 ]9 S. Z" Q+ W
function to do the same job:
- d( g# i9 k+ E
$ X' `5 Y' d" i! o7 F push 00 ; OF_READ; a4 q" D& R9 s( m6 u+ M
mov eax,[00656634] ; '\\.\SICE',0) a r* }; ~- ^ X: v) P
push eax
: A$ p) f' n6 _ call KERNEL32!_lopen+ Q4 [; \8 @$ U' y: U$ B
inc eax
+ T) T4 ]' Q$ s4 C- ? jnz 00650589 ; detected
/ C' u3 ?6 v! ]) X, F3 k push 00 ; OF_READ
5 r$ q7 ?0 `+ t$ T1 H mov eax,[00656638] ; '\\.\SICE'" O. \3 v; ^ V% W
push eax
$ ?' t( n" S& o call KERNEL32!_lopen
! V8 ^: T4 J6 w+ S7 a2 }, S3 m: t2 D inc eax9 }' G- x! P2 ?- M- t% y6 l
jz 006505ae ; not detected4 l0 M2 A! i% z* U( i( R8 X1 l
5 a0 B, C& E4 G Y2 K& E. W$ j: X& ~6 ]# P5 m
__________________________________________________________________________9 y5 g& T; w9 r/ b
& V: }* N ?( L& u. ?" S
Method 12 r9 M1 B' ?' a; }4 C
=========7 b" p: u- |3 n( [0 u! Z1 M
) i j- Y) X. d- k) ?This trick is similar to int41h/4fh Debugger installation check (code 05
" @% F* @) }" @4 J& 06) but very limited because it's only available for Win95/98 (not NT)
, N2 N P/ ]/ @# t [' ^& m+ Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- H5 A0 r8 h1 p% Y; x8 \ h
+ J1 a+ O% y. ~) S5 O5 Q2 P: ? push 0000004fh ; function 4fh7 }; e5 o) w* D6 g' w; ]
push 002a002ah ; high word specifies which VxD (VWIN32)0 b; [1 X }$ p5 q9 V: f
; low word specifies which service* E$ [& y$ K- @1 a Z2 j
(VWIN32_Int41Dispatch)
4 L' g* T4 u% V call Kernel32!ORD_001 ; VxdCall: @0 }8 X w' V) O6 C3 p0 i7 U/ P
cmp ax, 0f386h ; magic number returned by system debuggers$ r! \( Y- l$ q9 n+ T( i
jz SoftICE_detected
7 Q' ^6 H3 J2 P
! o- ?+ a$ D7 \# R3 n0 |Here again, several ways to detect it:
; Q: ~9 o e# H2 I" w0 V
. @& O( M N9 \' F. b* p BPINT 41 if ax==4f7 ~3 j) s4 M1 R9 Y9 o% V4 A
7 R1 L/ b( R9 U$ }7 [7 W BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 S" g; S6 ^: e0 k) Y0 @, i# J
5 m5 Q: K3 x+ h9 \ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ G0 d7 i- K4 E* Z( {2 v" w* t
4 N/ |: n0 ?2 E1 c ^0 R BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
1 |) {7 t. y( W4 G$ F
" C4 S# R% |" a5 C__________________________________________________________________________0 B) E" R9 C- g
# N) z* G# C% wMethod 13& h, K6 s% [- e" Q* e
=========- K0 o1 [9 q' y
) M) y q% |6 W; q @8 }
Not a real method of detection, but a good way to know if SoftICE is; `( i# f) p% @3 F/ y5 j
installed on a computer and to locate its installation directory.
8 X. q2 _6 v& R9 L. wIt is used by few softs which access the following registry keys (usually #2) :
) x8 t- ~6 u! K l2 {7 c3 q- K) K o- r( n6 K: v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( S: Y0 z7 ?* K) \\Uninstall\SoftICE' ^3 h" p5 I, r! [6 s
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 ]; O$ D/ h7 \8 ~/ D4 U) ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! A* i; P4 g6 f
\App Paths\Loader32.Exe
5 j# t+ n% e3 {; T4 F% }
/ W7 p; V, \+ l" R0 a3 P/ f5 X' B8 q4 Q2 h
Note that some nasty apps could then erase all files from SoftICE directory! M$ v$ x7 }$ V
(I faced that once :-(2 n, Q0 A+ M, c( ], E
+ n% Y0 n6 C$ u9 SUseful breakpoint to detect it:
, P6 v4 r9 I3 b; _4 ?, d! \4 A% L9 t$ W5 i3 f6 r7 ?/ a
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 x2 N5 b9 |8 ]) n! w$ O
, O6 _" G9 R* U& U* Z$ ~
__________________________________________________________________________
' `7 l, U) h V3 b4 N/ W
, E) R1 ]1 P; P3 X/ [2 l: q M8 U
; E8 |' |+ d. r3 g. `9 R% @Method 14
. o- J% Z& j: \% A& p=========+ { t' {' W6 s( @
# e& Z- R2 N _" B( p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- ^: E' K \- d5 l( m
is to determines whether a debugger is running on your system (ring0 only).) F, t9 P# U- c G
d- U0 o$ G) v: y! M
VMMCall Test_Debug_Installed
9 ?0 B" ?, T, @7 G6 y; }, H je not_installed
/ J" `+ N. O" U; Q! k* Z6 O: R- \ O( T' x# B6 u* F/ S
This service just checks a flag.
& J1 [1 [7 J" E& G3 A0 U</PRE></TD></TR></TBODY></TABLE> |