<TABLE width=500>
) A1 \5 I- V! W# n. w" [<TBODY>
( h; c* Z8 d9 o$ C& t I- l$ S/ B<TR>
. `1 T6 m# I$ k; j* q" Q<TD><PRE>Method 01 5 v% T0 b, J) ^2 q7 Q
=========0 ^& x! u0 R* T3 U
# Q z f! n$ ~3 a- O1 ZThis method of detection of SoftICE (as well as the following one) is
) w* b l+ U Fused by the majority of packers/encryptors found on Internet.& O( B7 l5 ?& {* Q: @ H$ [- z( V* y% Y
It seeks the signature of BoundsChecker in SoftICE
) c* N- m# y0 u. C
1 }) D' z) ~: G7 j `' E mov ebp, 04243484Bh ; 'BCHK'/ w5 q5 f7 c1 F# [! \2 I. c' C9 o
mov ax, 04h
$ W# j3 ^6 h0 s int 3
' _* n/ _1 q* D cmp al,4* ?( i% ~4 A" Z( J* [9 N
jnz SoftICE_Detected! S) B8 i2 I" j
" M: o7 C# q5 y! Z! E' t___________________________________________________________________________) S' V2 p# [0 d G7 J8 n" ?4 t
4 P/ A# o" |: z! c2 Z8 v7 L2 [; A
Method 02
* j: P7 Q4 n, `8 U0 I" E$ ?; e; g=========
7 Q( l4 O# C* T9 g! e. F, l8 Y$ r' a+ e* N) O4 O
Still a method very much used (perhaps the most frequent one). It is used
* O- b* h- i f" W3 @to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
; l$ `, d& x' y- q4 o/ ror execute SoftICE commands...# ]: c% P; a- }3 X( s: A# _
It is also used to crash SoftICE and to force it to execute any commands2 D+ `; U& \" M4 j6 V
(HBOOT...) :-((
! C. H9 c1 h6 D0 K4 f( S7 B j% P6 A9 f1 N4 v! d) q# l
Here is a quick description:9 y p2 t( a8 ~: a
-AX = 0910h (Display string in SIce windows)
, l$ X/ e0 X/ X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)3 V0 U5 y4 _: E# m3 ^) `
-AX = 0912h (Get breakpoint infos)1 e% h# g% c% T G% s: Z
-AX = 0913h (Set Sice breakpoints)
9 c/ k* \2 k* U3 U-AX = 0914h (Remove SIce breakoints)4 }0 K0 r# x" ?' q) Q
! a+ R, V ^+ K3 s/ wEach time you'll meet this trick, you'll see:
! g }3 y. n7 B6 _-SI = 4647h$ F8 n' ^" R- M5 V) k
-DI = 4A4Dh5 t8 V0 Y; g; `2 ~3 [7 [
Which are the 'magic values' used by SoftIce./ T$ e0 u9 k2 s" H
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% L3 P2 d$ B P. k" P
: O$ L9 h! t1 R5 ~Here is one example from the file "Haspinst.exe" which is the dongle HASP C2 X+ k; p% S& ~
Envelope utility use to protect DOS applications:' e' D1 X2 s& D
" i* I/ U) `6 J% T" |
& j' q. b ~; ~' t# B4C19:0095 MOV AX,0911 ; execute command.
6 x9 O0 u; g" w) G/ b2 u& o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 ^% n5 P& W1 e' K: X# y" R! u1 `4C19:009A MOV SI,4647 ; 1st magic value.+ F8 r& U) u0 U- h% W' c& A, Q
4C19:009D MOV DI,4A4D ; 2nd magic value.
: S7 J3 |0 l4 z; u4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) ?1 V' l h; ]' @& f
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ e; D7 V- P: N1 |$ D* D4C19:00A4 INC CX
; o% d/ m; W) J) B4C19:00A5 CMP CX,06 ; Repeat 6 times to execute! f2 k5 S7 z) {& c2 Z& `) N
4C19:00A8 JB 0095 ; 6 different commands.9 Y2 Q/ s4 p+ U6 n8 _" G0 Y: y
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 y+ m' S5 a7 j/ J, i4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 R* a* R* V, B5 a8 V5 j
% i7 u$ X( x" z: E8 x% A7 y. a1 o/ J; |The program will execute 6 different SIce commands located at ds:dx, which
2 u& I2 x" K+ z# m" I; {3 [- ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) _6 p- t: h% A/ ?3 C; z& f7 L" g
2 c6 S+ A/ e7 F2 b: C% @* h2 @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 T4 U+ k* E; [4 ]3 P1 ?9 Z___________________________________________________________________________; c# b2 s6 J; ]- ^' p7 _
4 _! L7 U8 C6 n
' I7 d5 `) l; x
Method 03
+ z" i" O/ b) ]& _7 w. o5 g=========5 K% r" d: ]7 n* z
6 E, x% Q6 _) P. d8 L
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- k/ @' d3 u9 g7 o
(API Get entry point)
8 V+ g# }1 U1 y+ I2 j( H4 |( Y( d
# A: s$ c' F7 [( R6 s8 u, D/ p$ y- s. B3 G* I
xor di,di# m& ~3 q' g& a8 u1 `
mov es,di
, {% k6 s2 N# b; j: \. F, H mov ax, 1684h
" J% I+ c) i4 l4 K" R- t9 h mov bx, 0202h ; VxD ID of winice& |4 }/ U% Z9 s5 a9 }# W% E
int 2Fh
4 `) J" W8 _* S/ L mov ax, es ; ES:DI -> VxD API entry point, L7 a7 \( o% u! z
add ax, di J4 ^# _: h. q6 M" I
test ax,ax3 m, Q# z i3 }1 ~7 K
jnz SoftICE_Detected
) ^, @9 u" G5 [+ h
' ^9 d7 g7 D9 ~: E( \. t$ ^ ____________________________________________________________________________
7 V' P/ V. U" y$ _% [' X1 a( ?5 j, X, Y
Method 04
( D: {0 M/ f* _1 |2 {+ S% e' h& V========= V" H9 W( }7 H/ K. }+ a
$ I: L! v! a' H
Method identical to the preceding one except that it seeks the ID of SoftICE+ ?* M5 v% \ A; p- t
GFX VxD.( ~4 w$ e& Y/ r$ S% @
8 r1 n! B( z. I5 L9 S @+ M xor di,di( C& }% ?3 X) |" |
mov es,di5 E! K) P) e1 |! y0 A3 W
mov ax, 1684h
6 x. ?) \: F8 L5 L" M mov bx, 7a5Fh ; VxD ID of SIWVID V! s% f: v; x: i5 B
int 2fh9 g, G. N' H& N
mov ax, es ; ES:DI -> VxD API entry point
, n: Z9 \1 r* B& \ add ax, di& b8 O* D- K! Y7 O
test ax,ax6 S1 ~- l4 s6 s: A8 |
jnz SoftICE_Detected
' v c4 }9 p* J0 d4 U0 C" P
; H1 N; t! F% x2 d+ ?/ W! P' b__________________________________________________________________________
" H6 o: f3 I3 v" Y, B3 ?& x" N# ^( u( C* H
- o, Y$ ?! y1 a
Method 05! Y2 a" ^5 S1 o+ l: p4 v
=========
% z# } y4 D/ L7 N+ O# W" x. i' g- T( q
Method seeking the 'magic number' 0F386h returned (in ax) by all system1 o/ n. {* g& g& K' u5 x( c
debugger. It calls the int 41h, function 4Fh.3 _7 f. Y) j2 U. h' q+ F' e/ `" \
There are several alternatives.
/ ^9 l3 z. }5 _4 m4 s: M$ S4 r6 H# p3 ~6 k1 K2 q
The following one is the simplest:! s; e, C/ o. l$ d5 e* ^
. L2 n4 p9 g! Z8 q: }4 S' i mov ax,4fh
! F% N* i* a: | int 41h% b( k" ?7 Z5 k1 x1 J; \4 K
cmp ax, 0F386
% `& S% ?3 x/ ~ N$ D! [ jz SoftICE_detected
9 l6 f( f: {- G* N4 a) e3 J: s- G
- e6 E: H2 Q* ]/ m" X6 Y6 P3 M+ R% x1 b ~9 a' h+ ^
Next method as well as the following one are 2 examples from Stone's
7 R3 i7 j* J) s1 t O"stn-wid.zip" (www.cracking.net):
5 V% {* r- S2 h7 `* L
; t: G7 |! \8 o2 Q. w, y mov bx, cs
$ o. c" P) W3 v0 [7 Q$ R8 V% a/ u lea dx, int41handler2
d$ u1 @3 n+ s) C9 w1 i xchg dx, es:[41h*4]
/ }- I# w' ~7 d7 u2 D. F xchg bx, es:[41h*4+2]/ H; g0 \) }# M0 H
mov ax,4fh( I9 J! b! S) f8 z8 K# b
int 41h4 u N4 n" N4 Q
xchg dx, es:[41h*4]* w* x! U: @1 f) ]
xchg bx, es:[41h*4+2]
. b4 h: x4 x3 G3 O. c. Z. L cmp ax, 0f386h- J& T# ^ z# h6 v- C, X3 M
jz SoftICE_detected( O, z# e2 ~. R w0 y8 N
! z# {& G ?2 C$ S0 p
int41handler2 PROC
/ j& p5 a) l4 ~7 F# V0 R iret
5 E' j2 f' N n1 Y! Q" uint41handler2 ENDP2 V7 e9 M9 c+ n
5 \$ B4 t& F g$ j5 F6 n- J2 b: Q3 y+ {& {7 u0 ^
_________________________________________________________________________
5 {* c7 I1 ~! O9 L' }- Z4 R8 X: w7 i7 t2 Z7 M, _& X
' U2 K# H! f- L: d" A* o1 \9 g6 t
Method 06, `7 t8 [8 `) Y4 m# }
=========9 v- y" M# S) l/ \; o
3 S8 |1 d8 v9 Q6 {+ A) s/ I% i+ \( m6 w2 S1 ?( a
2nd method similar to the preceding one but more difficult to detect:, ^5 [' o4 x7 S
: [. c* s/ l& E( ]5 u, R1 a
+ E, y' G3 a: _5 N; W! }int41handler PROC; B& M. a* {; V# y7 U+ z9 I
mov cl,al2 @/ T( z: R0 w6 C3 ?9 q
iret
* z: N0 b+ O6 d ]: Vint41handler ENDP
1 O6 \8 e/ P* l$ O# g
2 Y3 R( b2 ?2 f- S5 I
9 [5 ?7 X: _' {+ w- ? xor ax,ax
) B- b# w6 j, u7 S+ v. B/ g' ^: {2 R mov es,ax- v% F$ p7 C" v' L& f
mov bx, cs
& K3 g( @# G0 r; L lea dx, int41handler
; y$ } \; B% B8 o" J' i: r xchg dx, es:[41h*4]
/ G1 [$ r) o$ _6 ?/ P' I xchg bx, es:[41h*4+2]+ F8 q N+ c# G9 ^& J q8 R% y
in al, 40h) j3 S& T6 K% t3 g+ g9 ]) U' G
xor cx,cx
% Q; N& S$ V2 s9 b# u# d int 41h
: C' E5 S. ~3 p8 b8 [# w xchg dx, es:[41h*4]
. I& f2 h' q3 U2 F% K xchg bx, es:[41h*4+2]( g! e' f4 O% i7 A. ?
cmp cl,al
! E" Q, I4 q. b4 X: w$ o* i& t0 i jnz SoftICE_detected5 x! a" `/ C, r! z2 V
: K# z0 f% q7 x2 |1 |0 K
_________________________________________________________________________
; C) l6 x' Q1 w" x. d
8 N0 a. X1 A% Z8 G# s8 |Method 077 g h4 j5 z' W4 ~: |$ ?/ E6 x
=========5 k f% [ D& @9 E' h
6 g; S4 H9 _: ~Method of detection of the WinICE handler in the int68h (V86)
2 `& w) Z4 Z8 d/ ], z# ~9 g
) J* Q9 V' ~6 F, v4 V* Q* U mov ah,43h
) ^4 q# w9 w4 O2 o1 B int 68h; G' ~9 |0 E4 `
cmp ax,0F386h8 w* h2 {8 |* R5 Y4 N
jz SoftICE_Detected
" w" i: S8 A3 E( d4 e/ H% k/ B# o9 J0 O& z0 I; e. ^' v
2 z1 O: N/ @0 Q! L$ r0 I
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
# L! t3 {) \/ y: m app like this:6 k0 _2 i! b d7 e8 d
! j' ]+ t7 Z$ x% l: h5 W
BPX exec_int if ax==687 Z3 f! }" C4 e4 h
(function called is located at byte ptr [ebp+1Dh] and client eip is
V! Z* M5 H8 s2 \- Z; u; o5 } located at [ebp+48h] for 32Bit apps)
2 [. N5 d6 ?/ J$ S" Q# a: X__________________________________________________________________________
% B1 B4 s$ O! X7 ]5 j# s J6 c+ i8 s/ ~0 \4 C9 _
, a" {: K- {5 ?9 G, g; DMethod 08
5 ~( U& N' T1 K+ A8 b=========2 n% w' e( b; `( g! S0 T
5 L ^' |% j5 ?# C: |/ G
It is not a method of detection of SoftICE but a possibility to crash the
0 T( R2 Q4 I" m$ U% Esystem by intercepting int 01h and int 03h and redirecting them to another9 s7 l. ?/ E9 @$ @( c' M
routine.
! D. y1 q9 f7 Z1 q+ K8 IIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! \2 b% P% U2 rto the new routine to execute (hangs computer...)4 b& k2 Y' n' ? V& X/ e2 G
I% t Q' V4 {. p2 N9 y
mov ah, 25h7 m6 t. a# ]" C# `# Y! Y! `/ ?
mov al, Int_Number (01h or 03h)
# m4 E( E/ ~$ ] mov dx, offset New_Int_Routine
7 L% Y! E0 y) p) N* t% _" O int 21h& t' H! n. a l A6 _& H7 i
0 w7 w- v) u6 E L3 F
__________________________________________________________________________
# R6 c' p: V9 I" U% s, B. U: n/ h
Method 09% D" u4 t+ T$ R6 [; P/ C' w+ d$ f* i
=========
( @! s% m# {4 t+ u7 ?* c( ^, n! M" P* P6 ^
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) f6 k5 x1 i% k( `2 `* G/ X
performed in ring0 (VxD or a ring3 app using the VxdCall).% d; e3 z9 N2 ~8 N' R- i
The Get_DDB service is used to determine whether or not a VxD is installed: b" s/ h$ l: K. K
for the specified device and returns a Device Description Block (in ecx) for! a" z2 j) a+ P& K5 X$ K/ H
that device if it is installed.
( m8 ]5 l! _- z, P7 E* I7 ]1 f
; B2 \ t0 D+ N, ]4 J: ~* X mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID! r! p# t# h* P1 D
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ h, f) _9 G/ t! R7 x n
VMMCall Get_DDB
! p" s, S$ q) y& [( B& F mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* R5 I% w( P5 \ i
! e2 S: n+ o0 U1 |; B8 d* F$ }, z- QNote as well that you can easily detect this method with SoftICE:
9 P2 q3 D4 _% C. k bpx Get_DDB if ax==0202 || ax==7a5fh
# [5 d5 Y9 J' A% I
; `8 c8 Z4 F" M& I. L8 S& {__________________________________________________________________________
/ U) m, @8 |7 D7 F+ |6 K& d3 n- B- F1 A
Method 10* j4 ^- f, o: s
=========
- |1 u c3 @* [' N/ a# e9 P2 W& c; x$ X
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ A1 L7 `7 n8 [# y- F
SoftICE while the option is enable!!* `. h0 ?6 q; K2 O( v
8 y( v6 x& L9 V# g0 `2 j
This trick is very efficient:4 X' k: ^! w7 U6 G& S
by checking the Debug Registers, you can detect if SoftICE is loaded A8 s E5 d! R+ E) |2 u$ C
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 {( V$ A* W5 f8 e4 l
there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 H0 O( r" F# N, M2 T( h. ^! ivalue (in ring0 only). Values can be manipulated and or changed as well9 F3 M/ j6 Y: Y2 Z: d
(clearing BPMs for instance)
" O9 w0 s: ]) @6 _
4 X9 p! a. R" @2 D; `" B& z__________________________________________________________________________* J$ K" P+ `6 d+ P
& n# d6 a1 A) U' c7 M- ^, }Method 11( ]$ U E$ i- |9 n& @
=========
t6 q/ W8 w. ~' o
* }( z5 [: s: p# KThis method is most known as 'MeltICE' because it has been freely distributed* X: ^" y# E$ L8 X
via www.winfiles.com. However it was first used by NuMega people to allow
- A% k# K$ f* @% jSymbol Loader to check if SoftICE was active or not (the code is located/ Z2 C% V# o: T$ j( O: a/ R
inside nmtrans.dll).0 M0 F0 j6 Z% b% s% [5 U; X* g. h
! L& U0 q: @) O9 {
The way it works is very simple:
: F: |/ p# |* Y0 r0 ?) wIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 A6 x+ R2 [) C
WinNT) with the CreateFileA API.
7 g7 A; o; H1 t9 n4 C3 w2 m. n: A. q7 g% x
Here is a sample (checking for 'SICE'):* Y8 J6 Y0 Y l4 K5 G- }1 b
! |, }8 a; k l. H0 X/ dBOOL IsSoftIce95Loaded()5 K' ~% C7 e- N; ]# N
{& m* _$ Y$ a4 a9 @+ w7 X/ t
HANDLE hFile; / P" @ F1 _' P% k4 W5 P4 t
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! }3 t5 n2 A# P0 g8 j FILE_SHARE_READ | FILE_SHARE_WRITE,% b& {4 [) V6 h. E. [6 T
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- P* @! v# p. H! u% x. G# b
if( hFile != INVALID_HANDLE_VALUE )
% [0 `$ L$ l: ?: P/ _' ? {
( S% G1 }- H S3 T# M4 j9 k5 ` CloseHandle(hFile); I( a, R2 [$ F: P9 m6 C
return TRUE;! b6 m6 g3 Q" X! q2 M. S
}7 J/ x2 n. n8 ^" f- y' ^" ]
return FALSE;
' k' U F4 [4 `& \6 V! H' v}8 I q2 O- D$ Q
/ r7 ^2 L9 d# i" N& G e
Although this trick calls the CreateFileA function, don't even expect to be+ Y+ d. @, C% _# A
able to intercept it by installing a IFS hook: it will not work, no way!% I# }3 d" d; }/ p
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
Z6 ]6 W Z8 {6 dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 k5 j4 j2 }0 Vand then browse the DDB list until it find the VxD and its DDB_Control_Proc( h3 B# x7 G8 E1 P% n) g
field.. ?6 V7 b# G- x# c5 v8 m
In fact, its purpose is not to load/unload VxDs but only to send a
# g! m% P3 G y- S; t) VW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# _1 B3 ]! C0 f# s. ]: R8 I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try/ P6 S( n/ v: E7 X. K1 B4 H
to load/unload a non-dynamically loadable driver such as SoftICE ;-).6 W0 E. x- D3 O
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 C, J* h: o" ]' _, B: S- V+ f
its handle to be opened and then, will be detected.
8 i+ F$ j, E8 D+ h' |2 wYou can check that simply by hooking Winice.exe control proc entry point; e( @5 E' e$ S7 J
while running MeltICE., H# \, e' B: ] H
/ s3 G3 p# w* `* j F$ B( b2 C" J
P6 F9 A( ^5 k8 m& b 00401067: push 00402025 ; \\.\SICE
& C h- d: q* b1 Q+ {4 B0 U$ a 0040106C: call CreateFileA( B6 Z/ M& w: b9 v$ e* U" V; L
00401071: cmp eax,-001, X" T' G. n' A. h6 E: t
00401074: je 004010916 R7 I% b) m3 _2 L S) w" [' J6 z
6 P5 B* _, I5 i% |" b2 }9 o# h* N; @: b% M
There could be hundreds of BPX you could use to detect this trick./ ?+ T, o, L' m) H
-The most classical one is:
/ e& x1 }# q Y( H) o9 ^. Y BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||+ S, E0 n7 B. ]! a: g
*(esp->4+4)=='NTIC' k; R1 d5 m3 ]9 j9 J! P; I
$ N/ Y2 Z) ?' _ C' ]: f-The most exotic ones (could be very slooooow :-($ ~" A2 q& u/ F+ t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
# [' [: _# c& g3 |) t ;will break 3 times :-(
9 C: I2 ^% i# u, ^
0 n5 L3 k; K' X/ }: ?( _6 Z2 h-or (a bit) faster:
% z5 S2 ~% u e1 A4 }7 ?! O BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ y& Y3 k) Y/ ?! f) @ |% t2 Q% d6 s6 E
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ! S) [4 J% Y- P& x
;will break 3 times :-(# W( K8 q* q% z0 h& F2 J
- a+ N, |3 _, @+ T-Much faster:
7 \( Z4 V9 V, U0 z/ {$ N BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 S. @, T+ O- z& I: S& `
. }6 V# Q9 } B: e# p! p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 h, K* S4 z! ^function to do the same job:+ K# Y2 ?6 E$ S& }/ f; q
& _% u$ s% }( w3 | push 00 ; OF_READ
, V1 T0 L: \! v$ r7 | mov eax,[00656634] ; '\\.\SICE',0/ R5 o. {5 G' U2 X
push eax
' h$ Y( X* N" y8 Z2 d9 q/ J call KERNEL32!_lopen6 T1 m& T' T! o
inc eax$ c4 n$ D: }$ K& n# g" x1 g, J
jnz 00650589 ; detected
$ B% K V5 y2 ]0 k# g. x push 00 ; OF_READ2 s; R% z: l! R% } D
mov eax,[00656638] ; '\\.\SICE'
/ d5 w+ G, S% [8 ^8 [8 F ^( W push eax4 i, y. b M U+ ~/ y
call KERNEL32!_lopen8 T# M8 _, i! j; Q9 y
inc eax0 ~7 f& H4 R$ [8 h. v, X9 C, \
jz 006505ae ; not detected
; J: W$ b' D B( s1 I1 B" y3 D ?# X7 Y0 Q; b, c
2 N4 S7 ^* i! c$ Y3 }* y__________________________________________________________________________
2 D# v4 I- X% i: O' R& y0 r: ]: U4 ?5 \
Method 12
1 F) E& `: g; g8 I8 w+ P=========
9 ?* n* }2 Y) m
: F2 S7 d% s) P8 ^5 BThis trick is similar to int41h/4fh Debugger installation check (code 05
! |- J3 h, C# c& 06) but very limited because it's only available for Win95/98 (not NT)8 ?" j0 s, p% _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 b- e3 s1 b% [& L! V7 i5 b; @! C/ t5 G( |- C5 u+ n
push 0000004fh ; function 4fh
3 V) S* M5 A( F; z" u; D* P push 002a002ah ; high word specifies which VxD (VWIN32)
1 o$ ?; R- K" X" [ c; U8 f" y ; low word specifies which service* x! S/ D7 B% J: @- d
(VWIN32_Int41Dispatch). a! b+ u! m. @
call Kernel32!ORD_001 ; VxdCall) _+ A6 t: W; p9 p+ i
cmp ax, 0f386h ; magic number returned by system debuggers
- R$ Z# m/ v7 H jz SoftICE_detected
) _" l. t+ l! v2 n7 X5 V/ _/ H* y
$ q7 y8 ^/ B) G( BHere again, several ways to detect it:7 X1 S2 C: Z" F8 }/ y, {1 |
6 V% r d. ~! d5 @% G
BPINT 41 if ax==4f
+ |3 ~7 y; \. g) i
7 K! d) J$ {6 C! @) o BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ ?2 g# b% f% l; Y* n* Y1 J6 J$ m7 ]1 a9 G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 H$ G; {' a! P2 D2 Z$ f1 X9 r
( N1 [1 [ {4 X% z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) c2 G/ U: V0 `/ I+ U0 A2 x1 b
6 G3 B' u. ?: k. P# H__________________________________________________________________________" F) ]8 W7 T' }, s/ z" a2 Y
& ?% g) C6 K. _# P1 b4 IMethod 13
2 A* e* o8 P7 D# x1 ]+ v=========
! G- P3 p- o7 W8 H; }3 G( ~/ o b+ x
/ O. o, a$ Z% Q: DNot a real method of detection, but a good way to know if SoftICE is- _9 X5 _- A$ m6 ~
installed on a computer and to locate its installation directory.& K$ z0 c. a; S
It is used by few softs which access the following registry keys (usually #2) :4 M w0 x; t7 S8 g
$ H/ q" |$ {* n! M6 h8 E6 p/ b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# g: k+ e1 L5 Y6 t, a4 h\Uninstall\SoftICE
1 S+ S$ J& _& L8 E-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 X. c1 J/ L+ W9 j6 C# E; d-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# ]2 y7 U7 d* S, S: N
\App Paths\Loader32.Exe0 u* s7 [, ^0 Z5 _" e$ ^* V
" b6 @" l5 Y% \3 q* G( j5 E
" }- f$ O4 \; _$ H5 H" Y' J( T
Note that some nasty apps could then erase all files from SoftICE directory8 h$ `. ~ X y2 b+ O, H( }* p1 Y
(I faced that once :-(/ o! H( ^; H5 U7 k
1 r- a: Z7 t: S) m7 L+ t7 W) A. XUseful breakpoint to detect it:
7 `5 i6 d% e0 n: B" y. z* V- f9 F7 |" T2 ^. k
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 y9 ]# |5 i+ y. V- a
u+ B, y3 w; t4 I/ d2 C
__________________________________________________________________________
+ v6 d ~: L/ z+ F* ?1 W1 j3 Y% t2 L) p) [$ _; g
9 h. ]7 b% t8 e9 z# m* F
Method 14
/ C% i) w. r4 _" O. h! W=========7 {& e+ |* \' q3 n
/ I/ k% O2 b* l5 N
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose5 F5 {* P R4 D2 g2 [9 e
is to determines whether a debugger is running on your system (ring0 only).
( P1 z# Z1 L! u$ a; x( U- Y1 ]
+ f/ c+ g5 f0 X: R( Z& O: v2 f# V7 b VMMCall Test_Debug_Installed2 g$ s7 {2 T/ @' }/ c, H
je not_installed
; g( \8 t8 i; h) K5 P6 h l0 @, f6 }: c7 Q6 {
This service just checks a flag.6 a. C3 E: M, _
</PRE></TD></TR></TBODY></TABLE> |