<TABLE width=500>
. U# R7 z, W4 w S! i7 D; }7 [<TBODY>
y+ t S" a# A+ v<TR>
, ^: j4 i8 I" D; X1 v( k<TD><PRE>Method 01
1 _! c! o' P5 {$ a$ U=========
$ c$ I$ q- ^* U
$ D; g& }! n3 F# U( l2 fThis method of detection of SoftICE (as well as the following one) is! C T* V/ }% A, ^" v
used by the majority of packers/encryptors found on Internet.' t( J3 D6 T4 R
It seeks the signature of BoundsChecker in SoftICE, ?' r2 I$ f' P! w# {0 S7 q
% s2 _$ S; V7 H8 S- e r
mov ebp, 04243484Bh ; 'BCHK'
+ Z9 v2 G$ g1 b1 B$ S* G+ g mov ax, 04h H; I3 P/ A' ]4 K% r
int 3
/ d, L5 T7 V$ H cmp al,4' i% x9 y9 q7 f" V1 U
jnz SoftICE_Detected
+ f' H; a1 i/ G8 w
& T# I0 x+ ]* ?0 W___________________________________________________________________________$ o, |' ]0 }& x7 t3 t- {9 i" O) t
, `; m/ D' A" T r) [
Method 02. a$ X% T$ q' Q# F! D7 |9 n+ m: X5 E
=========
: |* [9 [1 U$ W' i1 w l3 c- }6 h+ Q( m, y/ d
Still a method very much used (perhaps the most frequent one). It is used+ P0 `/ k. Q4 E/ `* Q3 k2 v2 \
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
) D8 A& X5 u% V( A6 B1 }( V3 {or execute SoftICE commands...+ a8 _7 q4 y) s+ W0 O
It is also used to crash SoftICE and to force it to execute any commands0 Q1 p& D+ L8 K
(HBOOT...) :-(( ! j9 j6 `7 V7 S' m& ?) F/ q/ r( N
! O. V; j4 \+ |Here is a quick description:
& L4 |! L+ w2 o, X-AX = 0910h (Display string in SIce windows)
: a1 C4 r, e1 V( k3 r-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
+ U7 `/ M( \5 z0 n-AX = 0912h (Get breakpoint infos)2 P- U8 t, T; ? E
-AX = 0913h (Set Sice breakpoints)
, u# n7 `4 `/ y+ W-AX = 0914h (Remove SIce breakoints)
' ]: Q, B0 @; H$ E& ^/ g0 i+ `; n" R
$ }3 f" |1 j. [: z2 S7 C! ^Each time you'll meet this trick, you'll see:
& ^1 g3 P; {7 {1 Z+ Y6 t9 m9 E, ^8 S-SI = 4647h# m# x" Q. l1 I* ? ^
-DI = 4A4Dh4 i2 A; z3 g2 l4 u# v
Which are the 'magic values' used by SoftIce.
7 n: L* T+ t) P9 KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ x7 ?; b7 E. n( s9 L5 L! A( ?, h: H8 R" j+ g
Here is one example from the file "Haspinst.exe" which is the dongle HASP. i. ^8 Z, w! \' h
Envelope utility use to protect DOS applications:
' F& T# l# l0 P# g; H. a) M
& Z7 O6 y8 r4 T6 k* ~5 \# F9 k- V( S8 s* i
4C19:0095 MOV AX,0911 ; execute command.
) j# `) ^; F; x4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).5 j" G* {3 ?9 X5 n% E
4C19:009A MOV SI,4647 ; 1st magic value.
- @% X1 ]8 D6 x/ d4C19:009D MOV DI,4A4D ; 2nd magic value.$ `# |, j3 p0 @) `' m4 Q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# _3 b1 n! r1 `+ O/ _- l4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 c) H2 G& o* D% J
4C19:00A4 INC CX
0 x$ ^5 r- R; ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: R! \, W3 s0 F& E! T6 n
4C19:00A8 JB 0095 ; 6 different commands.
6 V- k; r d9 O4 |& O- p& Y4 a8 V- m4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" r1 j! z' l B6 o8 H4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. U; J1 E: A+ T& D' p! R4 @# z6 x) g: q( j" F
The program will execute 6 different SIce commands located at ds:dx, which
, a+ j+ i6 s' [' o# Lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, N# D) {0 W- r ^7 G9 D2 ]8 ?! e$ |1 ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.* v# u; _5 E+ T: x" K
___________________________________________________________________________" v- |, p/ [2 i# O& }0 g2 B0 U
6 f* D& h7 Z: u a
4 O/ q& a7 c, E. R' {" X RMethod 03
& b8 Y+ @2 R0 R/ \6 q6 o" B8 G=========
9 B6 a$ L ?* }2 r. b% t& q. U% _ a: ?, n$ Z3 r8 y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& S5 M- x+ g# u7 z( @(API Get entry point)* j; N: Z* _; K1 k1 r% q: Y
2 I, A3 k8 K( K# s$ ~! _; `- ]
- L z8 b" ]" D; J; M6 A
xor di,di. o- a. m3 M8 Q" L: C1 [
mov es,di2 L7 a$ C: D6 e0 J* q; q9 s
mov ax, 1684h
' j9 w; v9 }! \6 M/ _" y: w mov bx, 0202h ; VxD ID of winice
6 X1 M: } a' g' B; E+ g int 2Fh3 a6 _& P4 Q4 N& c
mov ax, es ; ES:DI -> VxD API entry point& y( h0 {, {: F1 q! z
add ax, di9 q. [8 G/ s$ [; W& j4 O/ ~/ g
test ax,ax
+ f6 b6 C/ s! L: R jnz SoftICE_Detected$ g Z1 y4 L$ _0 ? N( Z
6 O7 I% A6 ]7 s& `0 b$ m& B8 J___________________________________________________________________________6 ^& z2 h& L) j6 n- y3 h" b
/ b7 L: Z7 \) |
Method 04; k n$ d3 k/ g0 o7 Y
=========# k( S9 A; y p3 v
. N: w9 O4 @- z* LMethod identical to the preceding one except that it seeks the ID of SoftICE/ R9 C J- Z# b3 O! U+ g+ M
GFX VxD.! ]" ^8 r+ }3 ~% E$ D
/ b- Y2 `+ J* r# B
xor di,di- N( Z# J* `0 D$ H) H' v9 x
mov es,di
' R0 W% K7 r) N, Z# [ mov ax, 1684h 6 Y* ]1 _. v, v
mov bx, 7a5Fh ; VxD ID of SIWVID* @0 `0 ~2 G! j/ B' }0 \8 @. Q3 ^
int 2fh* x2 N |: J- @/ l; ^) |* L4 Z
mov ax, es ; ES:DI -> VxD API entry point1 f+ O7 g5 p1 U
add ax, di
3 C& W3 v2 H! C2 r) [( j test ax,ax
6 H& `% |5 Q+ O; L jnz SoftICE_Detected; G( g( [4 B4 B
4 b! K% R# A3 K9 h) r% ~__________________________________________________________________________
# x3 G$ Q9 @/ @( Y: b. I/ `5 p! ^$ h. @! |, L+ p
! m7 p; C& M; g
Method 05
0 N! d$ h$ u9 e) T" y! F) G=========8 L. |1 r3 R, L1 x( d
$ S5 k7 ]: _& t( ~Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 H7 S4 E9 x$ [6 W' ], Ndebugger. It calls the int 41h, function 4Fh.
5 y& Y+ ^; T: Q) F U9 HThere are several alternatives. " }% k2 L; p: K# Q0 y
/ a* ^4 S; {) `2 u uThe following one is the simplest:
V) `2 K6 j; Q( r# v
: i& D0 ^2 o; d+ G- k( j% i$ S mov ax,4fh2 X) i5 G1 v6 d% F( `& r0 [
int 41h) p2 F+ F+ V- N
cmp ax, 0F386
; d N- J9 \) R3 G# F' U4 U jz SoftICE_detected9 l5 Y; s# ~7 ~: A
4 D8 m6 j3 k6 w
- A- ]8 A* m/ B' Y- z. b# c
Next method as well as the following one are 2 examples from Stone's
3 h7 s+ F, F ~8 M"stn-wid.zip" (www.cracking.net):
/ y. a* D" ?. E! q1 T$ E- K& d3 d1 c% w
mov bx, cs
0 g$ W) F* Z: ]; `2 y lea dx, int41handler2+ f) F2 t7 h( L6 x: G
xchg dx, es:[41h*4]: w: z/ Q( @1 V" [ X( q# ~( b
xchg bx, es:[41h*4+2]
& x" X) f6 C& l3 E% p3 E mov ax,4fh
$ {) U* W/ Z) c int 41h
) {, P0 q6 d3 A% I6 f/ _5 a% P xchg dx, es:[41h*4]
- W# f. v6 w y+ T, y% F xchg bx, es:[41h*4+2]
5 l3 N' q0 F Y5 Y cmp ax, 0f386h7 D4 ^+ F. G/ L; d* o3 e6 r' F
jz SoftICE_detected
5 v; R! M' ^3 \. _2 m8 A7 A! u' e
8 g4 c; D$ `( X1 zint41handler2 PROC7 G# `6 \ o I
iret. q9 a+ i" G& e$ ^ S3 `
int41handler2 ENDP+ B L$ |$ R6 h. m% M$ v
, U3 q! I! `. P. `" Q0 s/ R' y: ]# g- V! G
_________________________________________________________________________1 I, F. W8 A7 S2 ^7 a% K
, X0 t$ I4 u( h. ?% M' y" j/ n
2 l: z2 m7 e y! v8 O. rMethod 061 q5 P$ J( h0 ?
=========, M6 ?, T7 u; b( ?+ s% k
2 O/ G8 o& G& i3 D" G2 X! S: z+ f" d0 R* A7 Y* f3 h& `4 M
2nd method similar to the preceding one but more difficult to detect:1 L& Q; h4 `. t) N+ M: {, G4 R) m
4 F: f$ P5 _/ C
+ { w' f% t8 Eint41handler PROC. _- s7 k# u4 X) t" o% ~, Y
mov cl,al' ?" `# B9 j# k+ |+ O! b2 K
iret
) W/ c4 ]/ {6 H9 E/ d( q3 j- g* lint41handler ENDP, i( H( w5 u; q S
8 T% j# r8 s& U) a4 t% `. m0 }) S v
6 } ?- w% i* ~9 T3 s, J xor ax,ax
; ~" q( M* g. c2 i9 ^ Q7 q6 t mov es,ax
( A; y; j% @' E# P( M$ i; | mov bx, cs
3 i+ x2 Q9 @1 F! D! I, o lea dx, int41handler0 [, b. T* C& |
xchg dx, es:[41h*4]$ t( V) n6 M5 _, v m Q
xchg bx, es:[41h*4+2]0 o L5 n( P+ U* _
in al, 40h
' W9 i' B' J y3 |. D( }# f) ] xor cx,cx5 j4 b5 F+ R/ z
int 41h
' N: }1 v3 w3 ?& V9 ~ xchg dx, es:[41h*4]
7 m: j+ W, ^, Y xchg bx, es:[41h*4+2]. c$ f7 g& i/ N" J! `7 C6 i
cmp cl,al
9 y! r0 l) u" j+ L$ F5 E jnz SoftICE_detected
) }, j O! J- w# r8 I5 ]! Z" L3 N" d/ m: Y1 H1 x$ |
_________________________________________________________________________$ {1 N+ W* ]9 H( Y" R6 C- q
; w8 p) F6 t! v, h. ]+ A9 a) UMethod 07
. S2 M$ ?4 A: O3 ^=========7 \! s8 `6 l! d9 [/ x; |4 N6 X
) I K0 n) D# z5 N% o" {. ? YMethod of detection of the WinICE handler in the int68h (V86)7 s3 u! B1 |1 c/ W6 s8 [
1 G X) k3 ^# D5 A6 p mov ah,43h+ q5 O ]" H& ^1 |+ \, C+ D4 c& }
int 68h- I' Z3 _& c+ b$ r
cmp ax,0F386h
7 m) @2 ]7 o3 s jz SoftICE_Detected5 l Q$ d! q( m8 I7 I% s, D
% m) F- X: T) p" `' q+ w6 I4 R$ R& M/ M4 [: t) B4 |; t/ \5 j& y
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit9 @* r7 _" @4 k* v6 F/ b
app like this:# j1 p; c: U |9 F0 q
+ p; o" l0 U0 A+ c/ m0 p Q
BPX exec_int if ax==68
% { }# E4 I, D) Y f% Q (function called is located at byte ptr [ebp+1Dh] and client eip is
; K8 l1 T3 \/ z5 |& m7 t located at [ebp+48h] for 32Bit apps)
& \/ E' d/ x8 m8 V__________________________________________________________________________& h2 C. `# |7 F1 p/ Y/ e( ], n) S
7 M- d9 t! G. E" M1 K7 y2 J
( D" F. [- [: f3 O! HMethod 08
2 K- T d% X5 R* ?; x5 i=========* z3 w! k) q6 g2 z9 J6 Q
. d3 L& e3 o3 ^& K; q' j4 F
It is not a method of detection of SoftICE but a possibility to crash the
7 l$ X0 ^: Q( s# Y1 |system by intercepting int 01h and int 03h and redirecting them to another
1 ^+ M3 |; r9 g _1 s9 M, vroutine.
4 n) D; j- Z6 ?% q: z" D2 sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( J3 b3 J. z6 f2 i
to the new routine to execute (hangs computer...): `( e, e q$ e
) G/ \: ~! g) A4 ^2 ?
mov ah, 25h6 P7 T! O0 r( q
mov al, Int_Number (01h or 03h)0 a( s; s/ b2 s4 G7 t. n9 C& A; G
mov dx, offset New_Int_Routine
' f; U1 b3 Q* y int 21h% S6 G$ I! n& d* Z
7 B; R% `7 d2 w. [
__________________________________________________________________________
5 P( C- I8 j' s- W+ ]% c& B6 I- p ~ B
Method 09
) p, \6 J) N$ o$ y- u3 C- X=========
% X V- L2 B1 z0 @. _- l3 L/ W# J; G6 |0 z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
) r! R* P% F6 Q! O1 ]performed in ring0 (VxD or a ring3 app using the VxdCall).8 A( G! O6 E. x3 n
The Get_DDB service is used to determine whether or not a VxD is installed
& J: I0 Z1 a0 N2 d+ T$ X; ?for the specified device and returns a Device Description Block (in ecx) for. z0 a# y3 o+ z$ G. A
that device if it is installed.( R4 Z5 P" ?9 d
% o; t& V# V, n: T+ y' ^! a mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' ~" e4 k& ?* p6 E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 g; y/ v% j @4 K7 E
VMMCall Get_DDB! P5 n6 `5 s: v
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
2 F7 r8 Q; K( z0 d$ Z
9 U. ?! ?2 [5 j2 \Note as well that you can easily detect this method with SoftICE:
, [9 }" g) L! M$ O; L( f bpx Get_DDB if ax==0202 || ax==7a5fh
e: Q) D! ^* S c' U: u# u$ c
' a" ?6 y& O4 V__________________________________________________________________________
: }# z. f# T: ]; t# ~8 @
) Q9 g8 v u" `* c( `Method 10 ?0 h: W$ T @0 {5 b
=========
6 U! [ R1 s/ v$ I0 R6 ], \* b- [1 u* e9 t5 o
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 Z: r3 I3 O) z8 t& L- \1 q: A- d! u
SoftICE while the option is enable!!
* m; F2 } T" ^3 J8 Y/ }) R8 ]- H; `( o3 \
This trick is very efficient:, K# ~; K, F; X
by checking the Debug Registers, you can detect if SoftICE is loaded
# ^9 c3 ]. S. G0 n% a& V. ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
u, v6 Z$ a* C% U, H/ n( {there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 T/ ]5 ~- U3 L8 F7 L/ dvalue (in ring0 only). Values can be manipulated and or changed as well0 E& e4 i- [6 f; `
(clearing BPMs for instance)+ {3 J; O9 W) s/ {$ r% Y" \7 Q% n
& `' p3 o) X+ R$ U2 O8 B" z
__________________________________________________________________________
& B& c7 ^8 n# G. K! d2 u
% X0 d5 f4 I d- }5 Y+ kMethod 11
1 N8 s7 W( r. _) D# d=========+ v2 a7 G5 h5 Y) H7 b; k; N
8 g7 y6 {' S. E* r) _7 xThis method is most known as 'MeltICE' because it has been freely distributed
- U6 {, Y& Y) r, U& ivia www.winfiles.com. However it was first used by NuMega people to allow
L" j' f, ^( lSymbol Loader to check if SoftICE was active or not (the code is located
& G5 J: h; ^' w& @% k" `inside nmtrans.dll).+ U+ I, R4 O# T
- g. |% Q" h Y3 A' Q+ G( \
The way it works is very simple:3 ]5 d4 S- f: A
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( a6 r6 W# g/ Q: w9 s) l H3 ]WinNT) with the CreateFileA API.! ~0 |: x, P6 c/ c/ t
2 X- y% ]! z! [' P$ u7 j5 E
Here is a sample (checking for 'SICE'):
' L ~9 p/ D3 v9 f4 Y9 N: A% n0 D7 r, x+ a' T
BOOL IsSoftIce95Loaded()
& B: l6 _6 u: v$ O% i{
1 _, l; }. u7 T5 V& O3 {5 f HANDLE hFile; ' B5 j6 R: R# Y3 H: O/ B2 y/ I
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- E5 Y6 i* v( g% v7 v* b6 ?% E: @+ _
FILE_SHARE_READ | FILE_SHARE_WRITE,
# ?) F( X# F' ^7 f% R NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 P1 P1 S: R) [! B1 D! {2 m if( hFile != INVALID_HANDLE_VALUE ) K* M9 S/ C: ?" Q
{+ |: a4 T V* s3 u
CloseHandle(hFile);8 i5 y1 G' F2 K7 o
return TRUE;
$ r6 V) _# K# v& v4 v }
# x: b& H& i5 B) `4 x/ q; d( x& h' v return FALSE;. y; Y! ]/ ^/ v1 \$ c6 \ _; w
}' [+ v1 a$ O5 @
' Y$ A, I5 Y" r) s. F0 I# m- _Although this trick calls the CreateFileA function, don't even expect to be
" {& N4 H/ Q& \* R/ table to intercept it by installing a IFS hook: it will not work, no way!
m) b; J. a4 R- J9 T9 oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F$ l; |' G6 r5 y8 K
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# P0 ~5 X& @% \) z1 o/ M% @and then browse the DDB list until it find the VxD and its DDB_Control_Proc& q* G$ {& e/ d& r1 ]
field.. ^: {4 n! O x, g q" H
In fact, its purpose is not to load/unload VxDs but only to send a
3 O6 {- a' ^5 D+ RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
A; y% w/ O* S- m7 V9 H J% j; cto the VxD Control_Dispatch proc (how the hell a shareware soft could try
' y& P6 m8 a- R3 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
: t' Y2 e* K; @+ X5 tIf the VxD is loaded, it will always clear eax and the Carry flag to allow
- }' u& ?5 W) Z' \+ d1 Mits handle to be opened and then, will be detected.9 d9 Y8 M! j. y) p8 Z p
You can check that simply by hooking Winice.exe control proc entry point
( g9 `6 b) W9 Cwhile running MeltICE.) R# d8 o$ D. c
" U2 D6 H8 O. I4 ^7 n
* N9 C2 ~5 m0 H: s% ]' L; D$ Z 00401067: push 00402025 ; \\.\SICE! O) b9 @! u5 n' [. t, K% o- Q) A8 m
0040106C: call CreateFileA4 ?6 ~# K' a, m
00401071: cmp eax,-001
4 V$ o2 K' i, D' u! I+ ? 00401074: je 00401091
5 d) B, [6 g7 @. ~
0 a' ]" e, c" t; P
( E2 }! E6 r( @- S7 AThere could be hundreds of BPX you could use to detect this trick.! q/ e& }: Q3 [
-The most classical one is:
$ Q$ z2 r$ J/ M) \1 r/ A- D BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( q g8 ?% T" f4 a# F4 v: u
*(esp->4+4)=='NTIC'
# g- @& j/ a: b! E* X5 j1 i) A' m7 d8 n- {
-The most exotic ones (could be very slooooow :-($ _3 h9 r; { g# `! A) P" m
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 Y6 n! n. S7 P' {9 p, |9 W4 @ ;will break 3 times :-(
N2 j1 s0 l; C0 ~" r4 `# m% \( X% S
-or (a bit) faster:
2 B Z! z z/ P' S BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 ]+ m7 k, _- M5 `9 F
$ q! s' A$ ~& I) v5 k( c BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) H4 L& p- c) Y. O# M3 l. D
;will break 3 times :-(% _( F8 u( P! ?& U! s
2 c6 x( T. W8 a% d' U8 b-Much faster:$ R$ j4 W9 C. H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& h* g5 @$ T; Z0 a
8 D; p( H% m9 s+ o- D8 Q
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' P* A8 x7 J9 m: F& u0 ofunction to do the same job:
) V: M$ j3 t5 G( I4 b2 f8 s. |' d8 l- i) |& F
push 00 ; OF_READ0 S& Y) X, V" f' a
mov eax,[00656634] ; '\\.\SICE',0
6 B& h# C: c" }: d, [ d; L push eax' Y+ R( n3 i* N
call KERNEL32!_lopen/ I( ^/ X ? ^' @# s3 [* e' y: b
inc eax' U/ \: m- I, k( z0 [& ?( q
jnz 00650589 ; detected/ a; Y: i" S- N, m+ Q
push 00 ; OF_READ. i. E8 i3 e! M1 t$ K
mov eax,[00656638] ; '\\.\SICE'
- u, N2 Z$ s) V* \; N) O push eax
* B' s; G+ ^( s call KERNEL32!_lopen+ u+ q q o& H% l
inc eax
+ B9 x5 K6 e0 }" Q, d% r jz 006505ae ; not detected. E' G3 M' [+ p
' T+ o5 F) q* X! t' {3 [
+ c2 t6 }- h: b4 U1 `1 h__________________________________________________________________________$ K, J$ E' P( M% I- }% H; ^
, e3 b- z# D3 P2 Z5 P
Method 12
. ^* P9 O% ~' K=========
" ]8 Q1 q8 l: V" D) E8 b/ }6 \$ r K2 Z
This trick is similar to int41h/4fh Debugger installation check (code 05" E! j( y+ J" ?9 q# l8 r: y
& 06) but very limited because it's only available for Win95/98 (not NT)' ^: k. B4 M3 q6 h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* N* N5 @2 Q! ^! i' b
2 M* h1 F, w! k+ L8 D. |
push 0000004fh ; function 4fh7 e0 O: ], B! n7 K- ~# {
push 002a002ah ; high word specifies which VxD (VWIN32)
4 O" |% A" b+ |1 ~# P) m$ X, b/ [ ; low word specifies which service
; }) \- A2 V: d% z (VWIN32_Int41Dispatch)
3 X! O" ^' H& F$ o+ C6 ] call Kernel32!ORD_001 ; VxdCall [2 y( G9 s. v5 }6 B" {
cmp ax, 0f386h ; magic number returned by system debuggers
# k2 D8 {6 r( R$ T2 K$ r# m jz SoftICE_detected4 _: [ `3 l+ ]/ Y# g; y! M& s5 s
5 J& A" i1 X% a5 c3 ?7 Z
Here again, several ways to detect it:
2 P8 Z* O2 ?# f& R7 k6 Y7 C, a* c C, [1 O9 M" F* ?% o! p$ T, v
BPINT 41 if ax==4f
7 f" D0 w2 `* u* h! `: s
& V! p4 b6 V) a/ Q7 s. B BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" P* r8 x' H3 X8 Q, }: i7 s4 z, i0 w& v B& m: }2 ^4 a! ?' v* v2 m1 |. S
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% K$ a; ]1 _/ ]! S4 g
4 p. H5 W; K6 K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
% J; l) C6 m9 p' y* L! }7 k! `; o" k
__________________________________________________________________________
* ^" E) r* d- F+ m' z9 b, B
% ]. x! Y2 P# s* H$ E3 SMethod 13
# z" _' }1 R2 U/ b0 m=========( f! l2 p; ]( T% T2 Q* t* j# k9 l
. R: ?/ o7 Q# g, {% S g( g! JNot a real method of detection, but a good way to know if SoftICE is
5 b/ s! g8 h6 b9 N/ j! ~1 Finstalled on a computer and to locate its installation directory.
! W5 R2 j3 ~7 B8 K4 }' h; r6 h* ]It is used by few softs which access the following registry keys (usually #2) :0 {) |7 E& R* M, ` w
+ Y& \% w; T' i$ c: F' I-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& f9 a" O9 n4 x) L$ W
\Uninstall\SoftICE
7 Z0 d5 b4 I- x, a, h-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ c g3 c6 I( v4 y% }; {-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, u% b I. w2 j6 z8 ]$ ], D: i\App Paths\Loader32.Exe- u# A: p$ J# ]. c$ h; G* d
* G' L- c- O' U9 g. z! Y$ {. ^" }) R5 ?( `0 X: y# F8 x4 |
Note that some nasty apps could then erase all files from SoftICE directory I. N" w6 r# [! j6 k
(I faced that once :-(( x0 O0 x. G. @1 x3 P6 A- j
1 U/ s: u- u* d5 C
Useful breakpoint to detect it:& \* Y5 |- Q- V3 w5 ^
6 W# p$ ~% c- S- b! e& u
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE', X0 `6 u4 N% H; d
; _+ `* q. |$ P0 A- b4 s' G( X__________________________________________________________________________
7 ^1 s- O' }2 S# J# d f; R- ^9 j3 f' S+ ?$ {' W U. t# b
' w; |2 y/ ^$ `. G) X0 D2 b/ ]
Method 14 ' ^% M; v" r' E
=========
$ z# P# `& `: k! ?( d$ l: w2 E7 k) b F; m
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 ^! z* Y( e: E; y$ H+ n
is to determines whether a debugger is running on your system (ring0 only).0 |- A& Q% t ~" E0 ~1 L, y& Y+ B
5 o! Y. A `7 p2 w, u
VMMCall Test_Debug_Installed
- r4 p( J- `* L% V je not_installed w! c/ ~6 d3 `7 @$ a# D
$ ^0 p( R5 @6 V( D; U' O% BThis service just checks a flag.
: B7 X8 E$ `9 O$ m4 z</PRE></TD></TR></TBODY></TABLE> |