<TABLE width=500>
8 w2 l( C5 n0 m<TBODY>
) s j- B2 @- M<TR>
) l$ w- V8 `* o8 A9 c<TD><PRE>Method 01 . Z0 B* P! ^) Z+ { c2 R
=========
- _4 C+ j# {; W: _% m1 @
) X; v- i, U& s- n3 }This method of detection of SoftICE (as well as the following one) is
" Y, g1 w% x; O2 Y7 K+ I. B& O% qused by the majority of packers/encryptors found on Internet.% `' r" H( J9 K8 |" D6 R8 ?
It seeks the signature of BoundsChecker in SoftICE
1 a9 h5 ]! b4 @
i5 S. L1 k+ x) v+ H mov ebp, 04243484Bh ; 'BCHK': {; _+ K! q# a) s! r
mov ax, 04h
* \ w) `* Z) n' H$ l int 3 : s1 P- Y# h6 {- z4 h' z' s
cmp al,4
( X3 [; A+ m/ Q! F jnz SoftICE_Detected
* ^6 V# ` K3 l& Z( Y, o
: F2 ~; E0 r; y2 w3 S0 \___________________________________________________________________________
$ k, o- f# z6 M1 u' G
W/ I/ l/ c5 AMethod 02
# C1 v8 O- R: [: F" w7 p1 ^9 ^=========
/ O0 v2 l3 \: Y* w4 O- A2 b
1 I7 t4 a U2 b x) vStill a method very much used (perhaps the most frequent one). It is used
1 D" e" r! \6 ]- rto get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 u( i- s' T8 f$ X8 K
or execute SoftICE commands.../ K9 ^7 j# s5 D' l9 |! z* ]% r& R
It is also used to crash SoftICE and to force it to execute any commands: @: M1 s, O) n( x, A, T9 A, |& d4 a
(HBOOT...) :-(( & t) y3 G( i6 D6 Z: R
: X1 Q) p+ Y5 u) W, [Here is a quick description:
, N0 h ^, z4 e& L: K; t4 G-AX = 0910h (Display string in SIce windows)' F' c0 }8 K" r2 [1 K
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
% P1 U6 p" q- F( {0 ]% s, Z-AX = 0912h (Get breakpoint infos) A/ H1 e$ h; m3 Y) ?9 ?% n7 ]
-AX = 0913h (Set Sice breakpoints); A( ]- A. v8 e' a
-AX = 0914h (Remove SIce breakoints)2 F' S& | Y& L
4 U- \ c9 W; O! f; i; \
Each time you'll meet this trick, you'll see:) |$ T+ J j, b' h |. o/ z
-SI = 4647h
9 Q0 D d0 K% N; F+ Z3 d-DI = 4A4Dh
% K. ?& U0 D6 T3 [6 m1 }& ]7 _" NWhich are the 'magic values' used by SoftIce.- Y" _' B% B7 X/ k
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 e" n( c l+ e" p' D
3 U. N, j5 C5 |+ g' [4 C1 U' U9 F8 @Here is one example from the file "Haspinst.exe" which is the dongle HASP+ H D \1 m+ Y9 H4 D6 M$ M" b
Envelope utility use to protect DOS applications:" Z; l [. \4 p! G3 h8 L
5 J1 z4 F3 i( {0 l
5 B2 j( m( p+ Z- g# V2 H' W3 \7 e* T2 V
4C19:0095 MOV AX,0911 ; execute command.
% n% @8 ^1 j# c& ]/ `5 {4 j4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).- r) x0 W- R- l* l# n7 b
4C19:009A MOV SI,4647 ; 1st magic value.
3 S9 l' g. ~) Q) c3 p8 o4C19:009D MOV DI,4A4D ; 2nd magic value.
5 ^ i* S+ a/ D% |4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 P# T7 {& Z0 l' i4 B/ @1 m4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ J; U+ K9 t. x* J1 N' g e& X5 M4C19:00A4 INC CX
: v2 F0 P& g& ^; ?; m; F% o; Y( q4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& Y- B2 }8 t2 R/ z
4C19:00A8 JB 0095 ; 6 different commands.
! @$ Z2 r7 J& s8 \6 L( Z4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 @5 W( e7 [7 K7 ^( Q2 B! m4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
! p; S4 Z9 o; o' ]' A% p
( j6 K1 w: O0 t3 R$ `# UThe program will execute 6 different SIce commands located at ds:dx, which
/ M9 R0 `6 z; F, Z; r* U- Lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 _! ~! _( R4 ?8 B
z2 Y* G O3 s- w: ?2 R* s: Z, F4 I
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.* j }( |- g5 x: K
___________________________________________________________________________
2 x- }( ]* K, q. I" w1 t& {. g* b: P4 S: I4 t/ o
! j" O8 H- h0 n5 d4 p* t4 nMethod 03/ O0 g& u/ q- y1 W
=========
( y( p. i, Y- z4 ~$ c2 |, P* E8 w. H6 ~- K
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 n1 P' t: i/ {8 i1 }" E* d+ ~8 P
(API Get entry point)& P; a N& q8 h9 y) t- N- A1 S
, d" S/ L) ]' |. E0 ?% u& Y! O% X
7 t% ~8 Y, e- P: P7 F* k" j xor di,di
' e4 f' n% v, }3 k mov es,di3 S! p3 ~$ f1 h# \% S+ `
mov ax, 1684h 7 ]. `! M* ]% H i8 N0 r3 X* T5 t
mov bx, 0202h ; VxD ID of winice6 s* b8 E6 s# ^. m
int 2Fh7 l+ ?- j, n0 h, Y, t; N% A: e
mov ax, es ; ES:DI -> VxD API entry point4 E: M( z0 \7 t5 y
add ax, di
& F u+ ~0 F( ]( Y test ax,ax
2 c; [* ^ S6 c! _6 U: \- J9 H jnz SoftICE_Detected3 m0 n) M& o# r# L! ^+ U7 q3 P
) l/ Y- l) ^5 ^9 I; {& Q___________________________________________________________________________
0 k, u% c7 S; L6 L
0 q% _4 v$ n) a3 U% lMethod 04
+ G1 ]$ d% F- _8 v=========
$ z) D- u5 C# w4 C! H
' b. ]/ q7 @6 D0 p6 WMethod identical to the preceding one except that it seeks the ID of SoftICE
) L: Q7 T7 A) L% n4 CGFX VxD.4 w5 v# Q0 R9 s7 F
4 O% d H [7 O1 I: _0 l! z xor di,di
" P4 K/ T7 u2 h/ z a; {) `, b U$ G mov es,di
/ a% V- X6 R) v# i+ G" h mov ax, 1684h
" Q0 |6 ?' B+ J# a6 h7 E mov bx, 7a5Fh ; VxD ID of SIWVID
+ Q7 \1 E. W' E+ n" W- `/ S* Q int 2fh& [) u& p( j/ w* |
mov ax, es ; ES:DI -> VxD API entry point
9 P4 d3 C5 n# k# A) d add ax, di
) m4 A; ^5 @( m) s! ~9 w5 N test ax,ax
) Z* ]9 t8 r3 J6 c9 j jnz SoftICE_Detected
" M7 i: [: o0 H6 }( K: Y2 Y# B6 c5 q' X" r& p! U
__________________________________________________________________________% S) Y' y( p8 T; M
7 V' ^5 I, n- A( m+ o! e# Q5 F
Method 05. y+ }2 x7 d/ z/ R% T
=========
; s1 }8 Y. {/ T4 S% m$ A* r( z* ^7 V/ ~( t0 @
Method seeking the 'magic number' 0F386h returned (in ax) by all system
2 ?6 m; I1 t+ V5 S1 S$ Jdebugger. It calls the int 41h, function 4Fh.
! f' S8 v! u0 O) m# x3 RThere are several alternatives.
- J2 r% j* Q+ c/ _; }0 \& }9 W) n2 ~0 U' S: V; [1 T" V
The following one is the simplest:
% r7 i$ ]0 o9 G4 m' @
4 \+ a; w$ O5 ^9 K; S2 } mov ax,4fh `) c, J2 K' C/ B) L" o" a9 o
int 41h- p# ^7 p- D2 i4 g, c" r
cmp ax, 0F386# q6 W8 G+ I! R' ?
jz SoftICE_detected
9 o. \1 a' S6 A% U& g9 ?- x
9 R, R5 M% P: m3 Q2 b7 H/ J
' Q# |% m5 J* c( n% t ENext method as well as the following one are 2 examples from Stone's + o' z' X0 g1 l4 {) k: l
"stn-wid.zip" (www.cracking.net):
. i7 W: {0 ]! t9 q3 v# @" _" c4 Y$ m: Z1 |7 u# S
mov bx, cs, ^7 \8 J. Y* a6 N& G' o
lea dx, int41handler25 D* p4 x2 D6 u& N$ Q; z
xchg dx, es:[41h*4]
H4 Z" j% g3 X( E, Y9 t xchg bx, es:[41h*4+2]0 ~2 R! C9 N9 h/ w+ I
mov ax,4fh
$ N. J7 l) y5 @# s5 p+ H7 f int 41h
$ q7 `/ l9 K" X l xchg dx, es:[41h*4]. G- h n9 o4 t- w% Y$ X
xchg bx, es:[41h*4+2]* P8 s# D# n$ V) l
cmp ax, 0f386h8 e3 g, n. K" e8 q1 n: z
jz SoftICE_detected
. N+ G+ J% n! c0 Z7 g
" V: H+ P' {( d( uint41handler2 PROC
: q5 r' K" ^1 J, g& l6 s# U/ N iret
3 U% I* x0 X5 u! j5 zint41handler2 ENDP/ i; h. e' @2 H& ]; a( V
4 o$ s: g/ P' }* u. _# M Z4 X* b1 X5 [; C- a- ] x% L) J- Y
_________________________________________________________________________7 Z: s' g8 s/ ]+ e; v% V! O
9 M" s. M! d% ^4 G$ ~
d( j5 K! g9 M4 k- d2 h
Method 06* H0 c4 f, y$ J) {( G5 S
=========
' p3 a$ F# s' g5 K" b8 N4 x& @+ L# K8 | W
4 s6 o( O% l9 b k
2nd method similar to the preceding one but more difficult to detect:
- A7 V4 _ V# q- l6 }
8 `8 G. v3 X3 h% v! x
- n" X6 ]- b7 k* i8 Oint41handler PROC/ \6 T9 H, c7 G5 T J8 r2 W3 h
mov cl,al- b. Y' X* |/ c y8 o7 |
iret# l {* ~* ^1 |, l6 F
int41handler ENDP, y" T Q% ]. o2 E& `
( N4 l1 [* P- N+ k- E( k6 i$ H" w8 f0 i: X! q9 ^
xor ax,ax
1 i+ B4 E, o& T4 ?$ g# k mov es,ax! `$ L+ L$ g- @& P
mov bx, cs2 d( [- x O1 U8 A. b
lea dx, int41handler
* f8 z/ z5 [8 a3 Q% N3 X xchg dx, es:[41h*4]# ` w$ T& ^2 G* J- z& f4 S
xchg bx, es:[41h*4+2]
9 M$ o& u2 }3 D5 q$ H in al, 40h# [- V% Z, I8 k, K
xor cx,cx3 E, I' ]$ y# E0 A3 s; q/ v. K+ D
int 41h- @8 B g7 d5 r& V0 V( T& U" e( v- b
xchg dx, es:[41h*4]
4 W; Q# W, j9 U7 s xchg bx, es:[41h*4+2]: a$ R: m+ _3 U
cmp cl,al
X7 J+ ?1 P1 N# V+ `/ z' c jnz SoftICE_detected% W0 p0 b. [, l- \# \
" b8 T! [0 D7 Y4 `& U_________________________________________________________________________' Y e% S( R( B3 S" T
. \ i5 x& y, Q) K; U+ XMethod 07% Y! ?7 c/ `4 f2 S& V) z
=========( X3 a0 }+ L0 q5 x* I' A
: r; S( g- A- @. a5 [9 t) IMethod of detection of the WinICE handler in the int68h (V86)( q9 w7 V7 L! ~. k, d
" b( x- V' u2 N mov ah,43h
' R0 D2 q. r8 y H7 V3 w int 68h% j' f0 g7 T) o) u/ c
cmp ax,0F386h* N! o! x, D, ^/ D# a- J! {; k
jz SoftICE_Detected
' Z8 Z, j$ W% w1 h* w
# o: m5 b6 d) e4 x! R; B, q
0 |3 L; n) ^, ?& [=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* g* s! q1 E$ B1 L app like this:
' |% X O' C6 q- m' G& j. w- Z7 ]+ F6 T
BPX exec_int if ax==68* Q/ F' H+ o8 g
(function called is located at byte ptr [ebp+1Dh] and client eip is
0 e4 b( H0 D" M2 n located at [ebp+48h] for 32Bit apps)$ x1 ~( D, @2 i( R$ R: [/ a
__________________________________________________________________________
; w4 G: X* @# _3 \
" ?. F( N( {: ]; t: M( ?0 F" W+ V1 p* Q# H4 ?1 q: h) P
Method 088 f( p+ [4 [, M- u2 f3 N
=========
' }* y+ i( l4 F8 `7 U6 {9 @ M+ X* j: b q: W
It is not a method of detection of SoftICE but a possibility to crash the
# L4 S5 ?4 f0 e. |: g, z; }& Zsystem by intercepting int 01h and int 03h and redirecting them to another
3 ]4 }: L, i, iroutine.+ [$ O; [1 B7 A0 F4 i- ]: x" [; Y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 b, _ j+ `" O6 g+ \to the new routine to execute (hangs computer...): y1 j& D% o: U/ z' A0 q3 d& p
/ ~* [- X. L; Y* y% K
mov ah, 25h
' i4 j, X, B( e" e mov al, Int_Number (01h or 03h)
: `" R P, x1 C- `( e& H9 d e mov dx, offset New_Int_Routine+ D7 @$ q" @) k; r6 d: L! I5 x+ R
int 21h
. S5 m' l3 U! V7 P& k
! x# G/ r x. }$ l6 R- g! _: S__________________________________________________________________________ A& L" t" n# I: c& E+ H+ v B7 _8 W- y
5 P, x" `" |/ M6 h3 \Method 09
, S- T1 B/ }) E5 R- U=========7 r! |$ U- O; g* v5 W7 P
* }# r* \* _3 c# `This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- x# C& b* T R1 |1 Eperformed in ring0 (VxD or a ring3 app using the VxdCall).
8 ]0 Y& \0 ]6 g8 KThe Get_DDB service is used to determine whether or not a VxD is installed) a% u( _5 Q# n" ~! P! O: w( ~4 J
for the specified device and returns a Device Description Block (in ecx) for
8 G$ A) e# L$ i/ [( w1 [; Xthat device if it is installed.
0 g |% y& @1 h. R; C- n
9 m2 T2 O' H+ _% b mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID& z* P9 f: _0 X' `! B" T) B7 }! T
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)* D- t* W; n0 x$ h
VMMCall Get_DDB
2 a% A7 c+ }. {5 z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" C8 N, c, Z* q$ [) N8 T
' O& @4 D. {; S) dNote as well that you can easily detect this method with SoftICE:# n+ c; L5 D" x; {' P! D3 c
bpx Get_DDB if ax==0202 || ax==7a5fh
+ a* r) }; z( l" g) |* A5 g
2 m. |8 `& c; H& x' o+ a__________________________________________________________________________/ m+ q2 n% s/ `! C; t5 w
# O* P( ^9 q3 s( {8 y$ Q: ~Method 10
l7 F+ I2 M* Y5 b& q=========
7 v0 K, W$ W8 {# n) E8 N7 r8 f" o7 a; T$ A( b
=>Disable or clear breakpoints before using this feature. DO NOT trace with, E3 i. e I0 u! r1 C3 J
SoftICE while the option is enable!!0 l: F% @7 Q4 E6 R0 f u- M
' [8 |6 h$ h( _; B2 P3 }
This trick is very efficient:2 x0 ~! ?/ ^1 H1 J' `8 y& F
by checking the Debug Registers, you can detect if SoftICE is loaded
, P" @; {! a$ D+ b(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" r0 E& L$ z; V
there are some memory breakpoints set (dr0 to dr3) simply by reading their% f* d8 a# v! `: g) n7 _
value (in ring0 only). Values can be manipulated and or changed as well
/ G# l. l- v* j# \# m(clearing BPMs for instance)
8 s5 D) T* d( @# q8 A4 e8 c8 I5 H" p9 v/ O# K. k) M- Y" W h q
__________________________________________________________________________
4 k! O$ q1 M+ Z) q$ E' u1 V5 r& [3 t* L
Method 11 E" k. B8 _( j4 g9 |& h7 J
=========
1 Y4 r& x5 e& a6 A
3 L5 I$ G1 g+ b0 m* g5 C( M3 }This method is most known as 'MeltICE' because it has been freely distributed
. R! p, l4 S) T) y/ a4 n# C, Z9 d6 svia www.winfiles.com. However it was first used by NuMega people to allow' N$ H, H! v5 N0 P/ O% U m
Symbol Loader to check if SoftICE was active or not (the code is located* t, ^ }2 G. V" n, [- F5 S
inside nmtrans.dll).
7 w0 R; P- l0 `' K% \' ~2 f5 D8 j4 A8 |9 A4 r9 c& d- F) I
The way it works is very simple:
/ D; b2 l( l m( yIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 m6 m- n, i/ ~3 SWinNT) with the CreateFileA API.
: i7 J% T5 y8 s2 E
2 ~0 I, B, z% I1 {Here is a sample (checking for 'SICE'):4 M$ T e ?( _7 w& `
7 u* u4 r0 }" s1 E' N
BOOL IsSoftIce95Loaded()! c& `, J! M, R0 m" B+ L. E
{7 p% s, t' N; U0 \4 l: J6 e
HANDLE hFile;
0 Y) _. N' w+ l( f5 `& W3 f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; [- M: y0 x: A1 t5 G4 {# p" x+ s FILE_SHARE_READ | FILE_SHARE_WRITE,6 q) Y! g6 N0 T
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 V+ W6 r3 f- o3 W- ?% y9 g$ h if( hFile != INVALID_HANDLE_VALUE )
+ ^3 o* [2 R4 s! K# q! A! Z {
. p1 W, q6 h' B6 P; Q+ z# q$ L CloseHandle(hFile);
L- O& x4 w: X: A8 ?% h9 X6 Q" \ return TRUE;
8 q; @% T6 x& x" O" {1 n# J }
% h0 s7 Y4 ^7 ` return FALSE;$ I9 ?1 G) |2 A/ ]: ]
}* L7 a: m5 [, }# g
$ j& |- e0 x3 i& n' W
Although this trick calls the CreateFileA function, don't even expect to be
3 s+ ]. b8 {' D4 N7 `# |# Q" oable to intercept it by installing a IFS hook: it will not work, no way!# B0 y. s. H5 u2 K9 v
In fact, after the call to CreateFileA it will get through VWIN32 0x001F: w U" f2 G+ \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)# s$ s3 G0 k" d6 H
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
6 z6 q9 r+ M! Y. J5 E5 Q4 rfield.
# x/ y8 w" N6 T4 X! o/ mIn fact, its purpose is not to load/unload VxDs but only to send a 2 c) ~0 m- V' I% q V
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 g% b' S0 X" O4 h* I& g7 o; f- d
to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ \, k" T1 ?- Q. l' s4 ~
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
' v( ] h- {# b9 w: O( d3 OIf the VxD is loaded, it will always clear eax and the Carry flag to allow- [- A' C9 Z( `
its handle to be opened and then, will be detected.' g) Q9 Q' o( L
You can check that simply by hooking Winice.exe control proc entry point' G8 d, @5 f9 H3 ?7 C. @3 p
while running MeltICE.
1 {. O) R! y0 M% B( X( P5 r" j$ A7 M0 p" Y+ T2 Z2 V
9 p& h0 `, [; C$ w2 X 00401067: push 00402025 ; \\.\SICE
/ z- y4 W# Y1 c* ^ 0040106C: call CreateFileA
" K* A. X$ N$ x9 l 00401071: cmp eax,-001
* t6 @6 [! G& C2 R9 I* E8 c p( e 00401074: je 00401091
( V: v0 f& l& K5 W7 t F0 s. r" G
: L" Z# s6 m6 x) A
There could be hundreds of BPX you could use to detect this trick., c( [2 y- V$ u
-The most classical one is:
3 F4 _" Y+ t! L: I) p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
" z- X2 m& Y3 } k* n6 C *(esp->4+4)=='NTIC'
% k8 ?* E2 X3 S0 w
& `$ K3 L: o/ R- w1 q-The most exotic ones (could be very slooooow :-(
- [1 ~2 K9 z- s# n+ [) s BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 ^/ G s; R6 u% D: [7 j4 M t
;will break 3 times :-(
# D% T9 `' V J" ?# M% Y9 U! Z' v$ L6 h( Y; K/ B* g
-or (a bit) faster: ( m9 _. u, v; `
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* g/ ^; ]; G; ]0 r* q) t
1 o( ?: m/ h) x g/ [- y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' / L; o8 X% e: G
;will break 3 times :-(4 a. B9 O% ?! J- A
' r- s1 f- j1 g) q9 R& Q( Y9 t
-Much faster:
) \$ J4 }9 j, u: { BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 n* u3 {- W0 f& R
+ E/ x, X2 ^) \/ c& D& R U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& `) {7 L) b8 o8 e; s n! w
function to do the same job:
$ Z1 z% J/ {0 ?8 M( T& K k9 L1 I3 i
push 00 ; OF_READ
/ |7 M8 v: s1 C- u9 e4 V" |2 M2 B mov eax,[00656634] ; '\\.\SICE',0
+ d3 g2 i9 G, g/ K) m" m* x push eax& t/ V- U/ T V2 C; y0 L. r+ X
call KERNEL32!_lopen* D/ C, P1 w$ e( j, j8 G' w$ a' C7 C
inc eax- S/ _7 R( |" }$ P! k% a
jnz 00650589 ; detected9 Q% D# W& F, v, T- Y7 D( Z, z; z: b
push 00 ; OF_READ% y3 @1 D9 ~5 Q$ c; _
mov eax,[00656638] ; '\\.\SICE'
9 h: ~% N6 [4 `& ~9 B push eax
. B* v8 l! \0 e4 p# N call KERNEL32!_lopen8 n1 }+ \' K( P( K, G' s6 P
inc eax
/ K* V3 r, m1 c2 }1 G2 f2 } jz 006505ae ; not detected
' z/ t, W; l5 P$ D% F+ l C3 l- S: Q6 u: m) M- y" ~* h
. U: D! E7 m- G, K3 j4 Y( [+ A
__________________________________________________________________________
* I: {% @. a3 W
6 q5 v2 |* B+ M4 f ~ P9 \Method 12
, l* @1 n2 d6 k1 t1 o \( K=========$ g6 @7 Z# [, g' Z; T: {
, F6 |1 {4 J1 e+ r% X1 L
This trick is similar to int41h/4fh Debugger installation check (code 05. S- Y0 p% d q# r% h2 q$ F) K7 D
& 06) but very limited because it's only available for Win95/98 (not NT)# a! Z2 p+ Z; I e. i/ d6 x/ O
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 j4 Z0 O' P7 A9 I8 c+ `- g
* E7 ?1 ?2 ]7 o0 e push 0000004fh ; function 4fh! L) J' K% {4 q* F( r* a
push 002a002ah ; high word specifies which VxD (VWIN32)
; A0 w, F- Y' n; }" ]+ U1 G$ ?) w ; low word specifies which service
- R5 u, B7 n* y (VWIN32_Int41Dispatch)
" z; J2 ?* n" F6 D, P% L0 h% c call Kernel32!ORD_001 ; VxdCall U6 T1 [1 l) c$ o9 f
cmp ax, 0f386h ; magic number returned by system debuggers
9 T! ? {, L2 \4 s# b! t* Q jz SoftICE_detected" ~% \! l7 e' U) T
% y( Q2 f# H/ D, l5 w4 z' CHere again, several ways to detect it:" E% m! ~+ y* m( D
; u' ]. Z7 D; s BPINT 41 if ax==4f# e& U5 L1 @' i: @% m0 J& m
. r* d9 j6 Y& k# X! ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 w/ w/ b1 D0 I) q+ A$ Y3 J
. |# { X6 @( [- r$ V: f8 T- k! g BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ {5 e' O4 D) `7 _/ |
4 c2 k4 ?+ ?% n- X BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, U2 N) H# Y n9 k
- G. h0 r8 E5 H__________________________________________________________________________
$ W. F) M3 v8 \) ~& h3 r1 e; u( O6 F/ P0 t
Method 13
9 V0 ^9 _5 b2 c7 a+ N0 Q=========
5 Z% V/ H1 A' h: Y1 K0 @+ j% ]0 F- }" A+ ~2 S6 H& ~
Not a real method of detection, but a good way to know if SoftICE is0 u8 X: M2 B; @" B3 w. s% l, v! o h. r
installed on a computer and to locate its installation directory.
0 @9 [3 q. q3 y0 u& j: hIt is used by few softs which access the following registry keys (usually #2) :1 i8 c- K% W" C
! v P. R. z4 q, _1 a- I+ ~& ]-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, r8 F: S* n, u8 c\Uninstall\SoftICE: z, l! Z& q+ N$ P- b; T# r9 @1 ~
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. H6 a# V" x/ o4 o+ ^% ^; _# Q
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ G2 l! I' ]* X6 y/ D l\App Paths\Loader32.Exe
& l8 m+ \; `) [. c: R+ O8 W' h! Z" m' F: G6 W, {
. R: B( W) ~; f" B* L8 P3 q0 yNote that some nasty apps could then erase all files from SoftICE directory5 H- H+ U, X7 k7 L
(I faced that once :-(8 o6 W5 O6 Q- Z9 G2 q, o' O* M
- j" c2 \9 h) c( `/ k& a
Useful breakpoint to detect it:
+ q+ A7 p1 E3 Z* i9 \1 E6 B+ W& b; n- l: r; K5 ?4 v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 h7 n! M+ x- V) s4 L
7 O: a4 J! X( H__________________________________________________________________________
) t* [9 R0 u ^: J; g& X
a4 A; d6 m' Q" \$ |5 k: n9 q3 }8 [1 {# E# D8 i3 K
Method 14 3 p1 h8 |) u% e( k/ ^3 N0 y
=========% q7 }! k' F/ k0 M
" j9 e ?+ O- F6 B* a( RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, L; D$ n- y# ?( b* k( X8 ?8 n2 I/ Y
is to determines whether a debugger is running on your system (ring0 only).
' N, C: m- z! Z- v9 z' l& w! O) o4 ?1 m( h; f, Q
VMMCall Test_Debug_Installed/ A$ w7 y" S) h3 j
je not_installed* P9 M; C Y5 ~( R8 H1 k
% @- ]( @ C, U# t3 k+ h! C+ SThis service just checks a flag.
- n' k- {" l, ^- t& z9 n7 L; X</PRE></TD></TR></TBODY></TABLE> |