<TABLE width=500>: y; |8 m+ V- W+ q
<TBODY>2 O4 G. V* E9 K9 N' M, x
<TR>: I7 Z" b) J3 U3 t" m! h
<TD><PRE>Method 01
( d, D. s7 |& C=========; y% J( a: |1 L4 F o
. Y! d. ?8 {. LThis method of detection of SoftICE (as well as the following one) is
1 h- O2 K. T& p# m$ Kused by the majority of packers/encryptors found on Internet.
2 L2 \/ ]8 u9 y. p/ F zIt seeks the signature of BoundsChecker in SoftICE. p$ o- o0 O c, L& I: k% J
3 D# d: c3 Y1 _/ k
mov ebp, 04243484Bh ; 'BCHK'" x" R3 ~9 ]9 Z' c
mov ax, 04h
5 \7 p8 t" o$ x! E int 3 $ H& A$ a4 w. c; R( L, x- {
cmp al,4
8 [2 D1 r2 @$ R' W* | jnz SoftICE_Detected* C% L! r, z* k
0 k* L* c# }6 [2 w- _) ]
___________________________________________________________________________
r9 {8 w$ d1 T/ [1 T3 ?" U- |7 R( \- z( r6 S7 j
Method 02( t5 v" Y# S9 S% ?" ]9 O$ u1 w
=========4 {# t2 e& b' w/ b1 K& _
' x5 q! V% k/ Y# h" `Still a method very much used (perhaps the most frequent one). It is used- \0 L5 X6 [' [
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 `* z- f6 I) G5 a, Q$ |
or execute SoftICE commands...& q5 u s- L1 Y
It is also used to crash SoftICE and to force it to execute any commands
! C$ W' ^, }4 k; K(HBOOT...) :-((
8 O9 @: I/ X; Q3 p) }% N1 E. z0 n% k) S
Here is a quick description:% o6 h3 [) V% `: T
-AX = 0910h (Display string in SIce windows)
& m0 ?$ Q* t' c, N/ @) Z-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 Q4 y8 g' r( W-AX = 0912h (Get breakpoint infos)/ o2 l X1 V0 m# t ]
-AX = 0913h (Set Sice breakpoints)3 [5 I p& V# s% B
-AX = 0914h (Remove SIce breakoints)
$ `5 b: r+ w7 x2 d) w) G: p/ h8 S# G, l
Each time you'll meet this trick, you'll see:
( J1 }" H" \7 @% K-SI = 4647h
- P& p- k( W& J+ a9 Y8 S% L-DI = 4A4Dh- u2 h3 E! \: r. X% f5 f) Z
Which are the 'magic values' used by SoftIce. j1 I' N+ V9 u5 `
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
4 a! a; c. ]# n* t& g: |. R9 C* \" M8 f
Here is one example from the file "Haspinst.exe" which is the dongle HASP
2 e2 l( w; c' B/ ?3 z& v% r' s9 ^Envelope utility use to protect DOS applications:0 W0 b1 I, s/ W3 s
9 K, G7 P# w$ ?( D* N
+ i" T: i/ ^6 i* Y4 A& m, Q4C19:0095 MOV AX,0911 ; execute command.' t# |/ ~7 ^7 m* w! O$ x
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 a# f7 Q9 S. M3 g+ J
4C19:009A MOV SI,4647 ; 1st magic value./ v0 R+ K8 L& m# C( S
4C19:009D MOV DI,4A4D ; 2nd magic value.
% W$ ^7 ]" j% ^- a5 U* a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)$ P* a' t( V6 r, u5 c5 @
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 l: W. t: H( V7 R* a
4C19:00A4 INC CX0 c( s, o2 ~1 Q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute2 S4 i7 C: L- Q8 ^- G3 g- L
4C19:00A8 JB 0095 ; 6 different commands.4 V- i/ v+ c: {
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: e& l/ T3 _3 ^3 j: s% {8 z$ n4 ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# _8 ^! o4 p' p5 n
( U# D6 K) X; e7 z2 y/ {
The program will execute 6 different SIce commands located at ds:dx, which" c" ~' G+ D& x+ }& Q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: \7 Q. Z+ k2 Q' W" f) _, @
$ ~) c2 [- F1 X& p& D% p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 {" L! n( s. a: d, e. d___________________________________________________________________________
) C4 Q& R, K: [8 Z/ G8 T A: }1 p0 L u7 T4 T! g$ Z/ t! X
c0 y; R6 h! E6 S4 _2 r" o7 lMethod 034 @( y0 ]9 O+ @5 S0 o p8 I- Q. b o
=========* W% d& g; r! ~4 R& V
1 ~& a$ }! @/ I& _/ {
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
7 H9 g! X8 P q% l5 a& K(API Get entry point)5 p' s2 a* ~% [0 f X# T; M" K. d" B
0 i' d5 {7 D# e2 A: B% b/ h
# h' V' K+ y) N# x h xor di,di
( u* N6 Y- Y+ A: A* \ mov es,di2 j* R, F. p/ Y. t2 ^
mov ax, 1684h ) N% i% M9 ~# u) f/ `
mov bx, 0202h ; VxD ID of winice X* u5 }; H) d* o1 r
int 2Fh
1 p7 o5 x( q% _8 E mov ax, es ; ES:DI -> VxD API entry point
) p0 H/ K/ X* S! f7 W add ax, di: Z, g7 r: p( o0 V" J G' S
test ax,ax/ z: T% {+ D$ a" i5 k
jnz SoftICE_Detected
: q& S7 N0 k X# \+ {$ J- Y7 ]
( J/ Z7 N( |8 B. Y___________________________________________________________________________" s: N S6 M+ |
4 D7 C! Y0 Q" F# N7 {- s* c: wMethod 04, b) E% Z" h2 t. X, |& c! ^4 u) a% }
=========
. g( ]1 k' ~$ e
+ Z- ?2 O# d1 S& l+ T0 Z) JMethod identical to the preceding one except that it seeks the ID of SoftICE' y5 u9 l. i% D% a. O
GFX VxD.
$ \( L2 M* f6 p- N ]
. s/ ?- e, _4 t3 I; S- }3 e xor di,di
( g/ X; x' b: q3 w. ]3 f mov es,di
& F0 h; O1 N% X4 _ mov ax, 1684h
! Z) }, E6 i( K" P- K4 y' E+ A8 d mov bx, 7a5Fh ; VxD ID of SIWVID# y% M$ `! F! G
int 2fh7 r! H3 w3 F2 z6 H; l5 w9 c1 }$ v+ r; q
mov ax, es ; ES:DI -> VxD API entry point* ]% s) K1 V% }; ~
add ax, di7 R4 @4 e! I+ E0 H1 r+ Q
test ax,ax
; l# ?: L" s, Q jnz SoftICE_Detected
5 X0 e4 ^5 f m0 N0 y e' X
5 a" k8 a. r) W. h9 u__________________________________________________________________________( y* r' |7 ~7 t0 d, E0 u
( P, ]- t" z/ z) D0 b1 E7 x/ s
- S1 s' [6 Z) r8 IMethod 05
2 F2 I1 t+ d; }' \; o6 \ O$ n=========
4 R7 e4 C' x5 q, T7 Z. V. L) I( F8 |% }4 P& m* W7 f0 ] h
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 N) v ]# N) w0 y/ u3 d5 |
debugger. It calls the int 41h, function 4Fh.
# N, y0 B# Z! U0 j- u2 ^: vThere are several alternatives.
5 W1 L# I. x* K. V" I
* k( i& d) O/ g. r0 L0 m9 q" d% WThe following one is the simplest:; J% A) A% U9 X: T+ x6 s) S
4 L! H" \; p& a4 h
mov ax,4fh
" F' Q+ I( S6 r, l int 41h' ^4 F O' h( {9 T5 L# I8 L5 J
cmp ax, 0F3867 O4 c4 }& v8 s( V* G1 v1 \5 R3 N7 e
jz SoftICE_detected
- d, Q7 ~7 B5 y2 A' x5 f
$ s1 u7 a# c) q
- G2 C2 j+ U" `& q7 f; X2 SNext method as well as the following one are 2 examples from Stone's 3 R8 ?: s/ D) }; G; h7 w
"stn-wid.zip" (www.cracking.net):
- m, w( ~0 x: V1 V; O1 X7 f' G( Y' y1 Y$ A: ^- M( |
mov bx, cs
1 | e" @& D3 ^+ g6 M( V7 p1 r lea dx, int41handler20 o/ \% r# L9 C! k* j& X
xchg dx, es:[41h*4]0 a9 C) C& M- c* y
xchg bx, es:[41h*4+2]
+ J3 e1 Y# }- c! [. ] mov ax,4fh9 x- W0 _0 S8 i
int 41h
; z8 e( ?0 b. ?# S xchg dx, es:[41h*4]' C5 h$ |4 D- ?
xchg bx, es:[41h*4+2]
; ?' O' J; b! B; W& x cmp ax, 0f386h
7 Z9 y# H( X1 D jz SoftICE_detected L! ~5 ?7 y2 M% }% \- R4 n
# \ K R7 i; h5 L3 T! Gint41handler2 PROC
7 C! N: ?8 [5 z- k7 @6 `0 D( o iret, | B/ i0 m: t% Z
int41handler2 ENDP+ R, v+ a, p/ ^$ i" L% w
* B3 W* n& s- r; [% Q; a
/ r h' S0 A3 V+ C9 j
_________________________________________________________________________
' J6 o) `6 |; O4 u, D8 b' a* p. K. v
0 T, \! b- L! ~7 F9 H0 B* z# F% P: S; p& Z0 N
Method 06: v: h- u# `* n# z
=========: c, C! S6 Z0 E. B4 m
' l7 @7 u' A4 t- z0 ^" z
3 ?0 m( K4 e7 r# p! o5 B* Y2nd method similar to the preceding one but more difficult to detect:
/ M: Q- [; T( ~- K3 {; b
* }" x0 q2 K2 h$ c- R6 h# H+ X* z( k8 z9 j
int41handler PROC+ I5 W4 F: K% Z: O% ~/ {
mov cl,al, x ` A/ v K t
iret
9 n( c) B4 [9 N3 R/ J3 ]* Eint41handler ENDP
: Y- a% l' i4 O7 {5 R
6 t5 J! I. Y/ _2 }. r0 ~: T4 Y! h3 @3 I. s: q; \
xor ax,ax/ J! V9 Q4 R4 ]! e7 w
mov es,ax4 q7 d2 f! e1 S7 H2 P2 M
mov bx, cs4 Q1 h# \( z1 Z0 v
lea dx, int41handler
. y D9 l3 f* S9 m3 w xchg dx, es:[41h*4]
' M3 _; r" i7 w$ }/ Y) o xchg bx, es:[41h*4+2]
: J3 J2 ]0 z( L8 T+ N in al, 40h
F, p |) d. d9 o% z xor cx,cx
) D5 _, r, m4 p: g int 41h( d* T# G/ K. G& E0 l$ O
xchg dx, es:[41h*4]% q4 h! R) \8 k3 N; l
xchg bx, es:[41h*4+2]
$ i' X1 Z. h* {' z cmp cl,al3 }8 f$ g. w3 O' ]9 D
jnz SoftICE_detected, O) Q4 j8 {% B, A( i' {
- Q) z- Z0 {5 v_________________________________________________________________________
8 l+ k" o0 J _5 I/ A+ n/ b" \3 E8 H$ y/ M( R# z* ~! r. ^, g6 c$ _
Method 079 K9 r$ Y; P8 _( T
=========; r. W% q" Y, V2 B
' e# ]+ z/ m) o" X v1 b( I* @Method of detection of the WinICE handler in the int68h (V86)8 h% B* h1 o9 k9 S
4 c h: ?: n* `
mov ah,43h+ B# B+ F R9 i" h# d: A
int 68h
3 J" G6 n4 O# [9 y! e cmp ax,0F386h
' Z) `1 y* h% [; @ jz SoftICE_Detected8 |& y; V, w0 U+ t7 t: \) r+ G
7 \' o3 g) _4 e( G+ t9 k& s( T) }8 D Q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& \) ]$ N% b7 @4 R4 Y app like this:
' ^) M+ O% V( g! C; _, g
3 P3 i( a( S6 \- ~ BPX exec_int if ax==68: i0 p4 u4 [: U) n+ t4 s' \7 D
(function called is located at byte ptr [ebp+1Dh] and client eip is
2 i$ Q6 |# G2 p9 @; P located at [ebp+48h] for 32Bit apps)
% y4 r$ A* S9 ^__________________________________________________________________________( @# w0 a9 c% Z
+ x' M: R. Z$ v
4 u3 W' j, |- T4 R5 A( d* ^6 }Method 08
, V. N/ o1 {& ]1 v, w=========
$ ~. K2 M) Y7 P
! ?, U% |- I- B7 z" HIt is not a method of detection of SoftICE but a possibility to crash the+ X7 F1 u1 s4 C- b3 E; c$ K- ^
system by intercepting int 01h and int 03h and redirecting them to another
/ b$ l6 I# @" n- qroutine." S7 |1 v8 X" a% q# Z) f
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 t( U& U7 e# Hto the new routine to execute (hangs computer...)" [7 D" X0 x: |& {$ v0 T$ w
8 |9 @; G* S% F: @5 K0 ]; }, A mov ah, 25h/ r: p3 |) h. ?9 V
mov al, Int_Number (01h or 03h)
7 i" @5 m% F) g6 X- u0 w. m/ ^3 v mov dx, offset New_Int_Routine7 {% W- }3 Z6 J0 M2 G
int 21h3 {6 C8 I$ T0 [& R$ `
& [' {. F1 R2 t& n& l__________________________________________________________________________! L; [- A: T" Y
5 {" c4 Q: V6 RMethod 09
$ \0 K1 D# U8 ~& `, U=========
1 o* j0 @+ |2 {+ q3 B/ N# Q4 ]& Q6 m! O$ o* Q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 w6 F; n. O0 f+ Tperformed in ring0 (VxD or a ring3 app using the VxdCall).
1 d( [+ S" r% f! ~6 g4 l k" SThe Get_DDB service is used to determine whether or not a VxD is installed3 Q, A. ^8 s3 K3 e/ j
for the specified device and returns a Device Description Block (in ecx) for
# u6 _4 Z& ?" U# e$ Q! kthat device if it is installed.! v: w2 N- Z& N5 H+ ~- j) x
. l; w! c; M( {& h, n mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 v2 P0 m8 f) Z% P0 L' z; X h" F0 [ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 a' ~( F$ @8 Q0 \5 \
VMMCall Get_DDB
0 K0 Q6 Z9 ? j4 V4 ^ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* n# Z6 X) g- |( _% U- n) E; \( R6 h
Note as well that you can easily detect this method with SoftICE:
$ v- k2 f& e! s+ j8 G" k2 V- ^ bpx Get_DDB if ax==0202 || ax==7a5fh* F" ~2 X n, ^+ [) ^
3 f# _5 }; x4 d- \__________________________________________________________________________6 [+ Y; I6 u' m, g: j# J d0 }
- z$ M, n$ N" Q$ N$ K5 n0 BMethod 108 d2 o0 A* z/ a% j0 L `1 w6 K7 r
=========
2 r- y: u( {: r7 Y, k' f
) Y) \# o% ^; n5 l x=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 a- _& ^( k- ]( m i SoftICE while the option is enable!!
! v/ ~! g3 w( A! V
* d1 w% x9 d: u! P& g. ~' XThis trick is very efficient:
6 g" o2 e& }( X z! tby checking the Debug Registers, you can detect if SoftICE is loaded
* @( n% `6 D/ l- L4 {(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, t) V2 X! p4 n5 i# Fthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ g4 f% f4 c) ]
value (in ring0 only). Values can be manipulated and or changed as well6 r$ f b/ R. N* l& I
(clearing BPMs for instance)
( P# u# S ]: F$ {5 B v7 s
9 h3 f$ c0 Y1 [# R2 d__________________________________________________________________________
9 R- b( ~) X- u, p3 N' i& ~& F/ K" {
Method 11! A* u* @8 F; R8 {3 y; u
=========& [/ J2 |" q$ |9 J, R
" A1 x5 ^9 X$ H/ F! _
This method is most known as 'MeltICE' because it has been freely distributed
5 m4 H0 f. R9 tvia www.winfiles.com. However it was first used by NuMega people to allow$ v+ o$ @( e2 R; V: d
Symbol Loader to check if SoftICE was active or not (the code is located, r: Y$ ?3 z0 \$ g$ g
inside nmtrans.dll).
& z0 H, K2 z( G3 T, K! Y6 p7 H; v2 u0 ^# Y
The way it works is very simple:
; _9 z% |8 ?/ GIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ a( a, S. y* C9 g7 ^4 |7 @& p ?WinNT) with the CreateFileA API." b9 a4 Q( ^$ P3 t3 f
% N9 r9 M8 f" S& J k0 hHere is a sample (checking for 'SICE'):
. F3 U6 `" B9 L0 H9 _$ c% I3 |4 u3 o: T
BOOL IsSoftIce95Loaded()
# c+ ` ]7 o, C- H! ?4 n{
* O: b8 E* W" H' [. F/ t9 J% Q4 x HANDLE hFile;
4 |2 f8 y' y" j/ ]) e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* b8 v; b; F3 b. J
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ x3 {5 J% Q! L5 k) ~# k NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( o5 I$ E) P5 w( P' S! F7 ]. O if( hFile != INVALID_HANDLE_VALUE )5 l8 `" J0 {$ S
{9 d/ y; M' m7 p9 I% G) u6 B
CloseHandle(hFile);
& E9 d% N& y& v3 r$ D return TRUE;7 S) c2 O3 L5 @
}8 y2 C) H( K, y* W" h; _" Y2 L
return FALSE;
0 Z( d) Z/ ~5 v! K) G% D. J- ?}6 }% {8 Z$ l! `7 D! \
/ Q2 |" O2 A7 [
Although this trick calls the CreateFileA function, don't even expect to be9 e! l! i. L- M
able to intercept it by installing a IFS hook: it will not work, no way!
( m& A2 w9 W5 U2 X- g1 iIn fact, after the call to CreateFileA it will get through VWIN32 0x001F1 U7 I, `) M4 c; u) k5 T
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
% f& u( a+ R* V, h1 yand then browse the DDB list until it find the VxD and its DDB_Control_Proc p# O* @( r5 |7 t$ x w
field.
9 l& G& y% t. c! ]. \/ L. [In fact, its purpose is not to load/unload VxDs but only to send a % f* ?6 O x% |8 E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)% C/ }) x d+ K% J
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 y" M! x9 ?! B K% B/ V% y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ h2 b3 R, C6 T$ k, v2 V7 TIf the VxD is loaded, it will always clear eax and the Carry flag to allow; g1 c, X9 n9 y
its handle to be opened and then, will be detected.
* D! g* ~( ] l; ^- \, MYou can check that simply by hooking Winice.exe control proc entry point
" A; v; k$ G7 s) G! cwhile running MeltICE.
0 d% i0 J$ ]! E. b4 l3 g+ P1 c: Q' C7 Y) \: d) M( }
) ~+ V8 _) R3 h! ]7 I
00401067: push 00402025 ; \\.\SICE
* a9 C; e5 \* {& V& l' r 0040106C: call CreateFileA
) J/ b3 y2 A3 W+ C, {- l% C 00401071: cmp eax,-001
! L$ i8 z5 l; Z1 r1 i* @" N) P4 n- D 00401074: je 00401091# _7 d: x& I& x
- V, s* @, P9 l! t% C3 u9 f$ v7 _3 O8 k1 w
There could be hundreds of BPX you could use to detect this trick., m$ L- H# R* b7 f$ {! N7 h
-The most classical one is:+ t; O6 _0 ^ {. U4 l
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ M! V" g+ w+ ? *(esp->4+4)=='NTIC'9 t6 R% W* [+ }! ?/ l
1 |: f4 S# D, K- O* d-The most exotic ones (could be very slooooow :-(
. C9 c1 y+ ^8 Q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 i& X5 r `; Z& [- f3 t
;will break 3 times :-(
1 F& X+ y0 l6 o- Q5 d( e
5 P! {) Q: ]4 D6 j. F-or (a bit) faster: & S" W. b( O. g& @. W/ l1 g1 ^# M
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& C, I3 P4 z3 ^& Q
" |" c+ H! N' {$ d4 M2 S; t+ f BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
; r2 L2 ]! U+ F% C4 R ;will break 3 times :-(
+ R% h8 x4 z# C! i4 x0 x$ n- D# v
% z. X2 e- Q# x7 X9 f: b$ l-Much faster:
+ D' a$ q0 d U7 o' [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', r& ^- R9 M3 q
9 ]8 Y7 x. |1 m8 L; \! j
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* \+ Y- r2 ~. K" U
function to do the same job:5 Y" h7 k* t- {' v6 \( K
7 t4 T& X# W: V7 C! {1 A* e ` push 00 ; OF_READ
' F2 l, K% m3 o- U mov eax,[00656634] ; '\\.\SICE',09 e" N* ]" @5 e7 w2 x* f
push eax
u* t# D& b Z8 t2 h call KERNEL32!_lopen2 G: ^! p+ x1 N
inc eax1 g! ]8 U! c$ j4 ~) K$ b4 \% L
jnz 00650589 ; detected
D8 ^0 |) \( h# E" y7 H- F* F push 00 ; OF_READ/ D* `" m# g9 ]( K$ F/ {
mov eax,[00656638] ; '\\.\SICE'
/ s: N. B% E' k2 T push eax: p2 L& v9 d% y& H7 j7 i
call KERNEL32!_lopen+ y- L* M' a! r3 e5 O
inc eax
: }# B( J. w' C! F4 L( \ jz 006505ae ; not detected9 S, ^/ Y# m3 Q8 E8 i9 i/ x U
5 @* P# R" H) K+ t* P0 Y8 x& A# v- V
__________________________________________________________________________4 R" x' A, |2 f! C7 h
! b! Z1 T4 I& Y' {9 C+ B6 h. M
Method 12
: E4 `' ^& _! o( I1 O=========2 U( K0 ?5 Y' z) Q) E5 Y
$ g2 N1 P& ?3 Y6 E& d( OThis trick is similar to int41h/4fh Debugger installation check (code 054 F: T4 o5 U( J4 B; _$ X7 X3 Z7 B! L
& 06) but very limited because it's only available for Win95/98 (not NT)
* P: T7 E" o7 L3 G# G& Gas it uses the VxDCall backdoor. This detection was found in Bleem Demo." a5 w: H* ~* T6 n0 i6 q& b5 V
+ u7 H) _+ M# M V% c
push 0000004fh ; function 4fh
' Y0 D; e7 F2 t* C push 002a002ah ; high word specifies which VxD (VWIN32)
" |7 ?% R" S+ F. [ ; low word specifies which service4 m2 Q* @# a l$ C( V
(VWIN32_Int41Dispatch)
1 ?; D S" o# N9 D4 T3 V call Kernel32!ORD_001 ; VxdCall* o, K4 k9 F8 ~5 j
cmp ax, 0f386h ; magic number returned by system debuggers5 x9 A6 Q8 j6 }; x; M6 s
jz SoftICE_detected6 W" M8 s4 \& ]) J v% W6 `+ W
, ]6 M' C0 g8 A" y. C
Here again, several ways to detect it:! r1 Z) Y% E7 M- J4 A4 ~
/ E) s% u m- X) @: G8 ] N
BPINT 41 if ax==4f
4 n3 g5 J" F7 b6 a8 b W. [; ~
. o: _% F0 {4 L4 [( g7 q5 Z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ P1 G* F. q/ G2 E6 F, m7 W1 [. j' I6 P S8 H" e7 {
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A8 X" s/ T9 [! [( W
* \- q2 P' |* _: K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!, @# C- u! W6 e; Q0 W
2 ], `" n% m; W* u, q5 D/ L
__________________________________________________________________________
1 ]) f/ a& `7 z4 `; P, E! B9 q9 S1 q5 b( R" U% a, m
Method 13
6 n* U6 B( `# l2 T0 d+ Y=========# T/ K# W7 ~2 K
, x. i* }/ k, Y) j/ T( c
Not a real method of detection, but a good way to know if SoftICE is
4 f& I& I9 s$ I7 ] }installed on a computer and to locate its installation directory.
; ~' F+ C# W& t& j- i1 ?It is used by few softs which access the following registry keys (usually #2) :8 e& u* d7 g; T$ i
1 h3 q) W+ {& j
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! u+ H8 p" E% W& O1 A5 `5 s$ W\Uninstall\SoftICE
, F7 b# W9 x; i( o. |* L-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! U$ N: H2 Y, q3 r% v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ S9 C7 H0 [) I$ G6 r% l5 z
\App Paths\Loader32.Exe; n$ `8 N* e8 ~3 [
8 v/ [, Y S% I* ?/ ~ J+ I( Z5 ?, `, Y, b
Note that some nasty apps could then erase all files from SoftICE directory
* Q# m/ Z5 A- `; a$ }(I faced that once :-(
& e3 R0 z1 ~; q" |" K, h0 O- w. w* n" o$ Y/ V
Useful breakpoint to detect it:
* d+ T+ Z) J& c0 N+ t% S0 d$ E( b9 n: q4 j0 X% m* W, ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ I( k, t1 M$ O1 V+ {) H$ {1 {" R9 R% [9 F" e9 _8 Z
__________________________________________________________________________5 b. k) o! |. |* T# c: [
! v5 q1 Y# k3 O2 T8 r9 ]2 ~$ O2 R& I5 O
Method 14
! x V" }1 Q; H- i- w=========/ R! E* J9 r3 _8 U7 @( w* \
& i! N# @7 v( M' ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. s. g- O3 i0 H2 k1 p- B
is to determines whether a debugger is running on your system (ring0 only).( b- k2 C+ B( T' `7 y8 k
- |% p8 ^( A4 U VMMCall Test_Debug_Installed5 g: U: o. l3 C4 p# g" O
je not_installed" y9 n( p6 ?; ]0 V$ w) U
0 K7 N. ?& Z6 o! M# q) b& kThis service just checks a flag.
0 D- N' v7 d+ O$ K</PRE></TD></TR></TBODY></TABLE> |