<TABLE width=500>5 B, c" F% d3 k% }5 c1 h
<TBODY>2 t$ j$ w$ ]% t7 s7 c
<TR>" z. w9 U# A9 _
<TD><PRE>Method 01
+ V. c0 n, S( R; A W! o4 R=========4 ?* K% B& V B+ b8 b/ n
3 |3 g' c! `6 g" {$ Y0 w* ` c; H) N
This method of detection of SoftICE (as well as the following one) is C5 y( \$ |1 F% }
used by the majority of packers/encryptors found on Internet.' U, W: w6 e5 B& w
It seeks the signature of BoundsChecker in SoftICE% ]6 q" u! z7 q( F A S' i2 L
* B% \) j/ N5 F8 H0 c
mov ebp, 04243484Bh ; 'BCHK'3 V3 ?& L/ m* u0 A/ M8 H2 I* l# k3 ^
mov ax, 04h1 q! q' S7 `* G! e
int 3
; \0 n3 y" D0 o3 G7 ~$ g cmp al,4
9 I2 I4 s2 g% b7 v' p ? jnz SoftICE_Detected
% o& g. i# q5 m% |5 ^) Z" i" X1 J7 c6 L Y6 s. |: b' |" z. Z- W3 @/ q
___________________________________________________________________________5 I# N) \8 u/ m* b9 F, ?
. Y1 G9 R# Y8 R
Method 02
3 T7 `, z8 c9 W$ M=========: l5 {' f0 }5 M! Y( m: i. W$ y
! O p# a! }$ f; C5 ]; _& t
Still a method very much used (perhaps the most frequent one). It is used% O F3 Z+ Y" r4 Q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 v$ y$ o2 ~9 B% L- L. Bor execute SoftICE commands...
+ b% e b. Q) v1 a. f; UIt is also used to crash SoftICE and to force it to execute any commands3 B/ `! w( p/ C+ W9 x% t
(HBOOT...) :-(( ! r- t9 q# I! }
k, n9 ^, W/ t( I4 v
Here is a quick description:
0 H- I" z4 r- R- N: S0 E-AX = 0910h (Display string in SIce windows). {3 \0 j$ p# A- E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)* y8 d# Q& R3 n: I: z
-AX = 0912h (Get breakpoint infos)
$ j" ?" w# ~( T8 J2 Q* N-AX = 0913h (Set Sice breakpoints)
, z( M& n( @ W-AX = 0914h (Remove SIce breakoints)
9 J" g* {4 k, n: ]0 W( [- ]1 L% k7 V$ ~) }* q
Each time you'll meet this trick, you'll see:5 P5 q$ G# k l; b. Q' q
-SI = 4647h! S) a3 M$ q$ j
-DI = 4A4Dh1 P8 v0 V* Y2 N6 f# o( {
Which are the 'magic values' used by SoftIce.
* s0 K# i1 n5 |4 T2 |( `For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: j. L2 `' T. ^# B* G
& r4 B* U& d; a# W- CHere is one example from the file "Haspinst.exe" which is the dongle HASP
5 j0 z+ @( C' o" E4 r4 `Envelope utility use to protect DOS applications:
! |4 v p$ p; z2 k0 G; C
1 ]* i5 A: W% n$ q+ z5 {( l1 y+ \2 g N9 z
4C19:0095 MOV AX,0911 ; execute command.: v( i9 j6 {, J9 u+ ]
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
( F/ e; l6 ]5 D4C19:009A MOV SI,4647 ; 1st magic value.
/ _. x+ E! J" u, |" Q6 j4C19:009D MOV DI,4A4D ; 2nd magic value.; M: q) ^0 @/ [! v. j! i2 X5 [
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 o' [2 f% L# z. t4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute$ Z" G1 p8 k$ X
4C19:00A4 INC CX
5 y$ X( u) M9 o$ {4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* K) e) J! s, u0 H6 }
4C19:00A8 JB 0095 ; 6 different commands.
1 H: {8 M7 ~: F5 p) _. o; H8 e4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" X! g9 P, L; T/ }! ~. N4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- n. k+ o) `0 T8 m2 h' O4 T% ~' m
! O0 i% R! R& w) a5 Z' d! \
The program will execute 6 different SIce commands located at ds:dx, which% Q8 K" i7 J3 ~6 x' v* B
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ f" e5 E! Z/ c6 s; X
. Q. q4 _! B) J
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; @# |" z3 b6 E9 H& c4 v, j/ F___________________________________________________________________________
( G% B) ^/ v7 v" b+ K A% {0 \3 j' R0 S
( i! k/ O8 l3 l8 A2 A
Method 03
u. l6 g" _; T. R L; [/ L& K* s# m=========
! p8 Z2 W% @. u1 E4 D. S
/ Q+ u7 z& K a' g; h& aLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 q. x: [3 ]- f
(API Get entry point): N6 r9 W8 Q) e `" g" M( O
2 r6 q( Q) P1 S9 N( c3 d2 m/ Y
! b; V+ L3 s/ y* f! c$ H+ d xor di,di
1 U/ i7 d) S3 d! r mov es,di
, [2 Q5 P! i- O; A+ L; e9 S mov ax, 1684h 8 t" \2 Z5 W$ o- \8 D
mov bx, 0202h ; VxD ID of winice* W/ x# X, E' e; h
int 2Fh
: e' g/ v8 p* y, k! v mov ax, es ; ES:DI -> VxD API entry point/ D6 M1 m6 g# {& {
add ax, di
% ?: a8 g# o3 j" C1 T" Z Y; c test ax,ax1 {- h4 B7 t1 h7 y* m4 W
jnz SoftICE_Detected
0 n6 v1 a& Q: ?# D
# m! v {3 y; w& m2 L; n2 v$ ^___________________________________________________________________________; q; D' R2 ?- D" y$ E
2 D; Q9 \2 i; s! I3 i
Method 047 h" I% w# c& P
=========- i# ]* ^+ H( I2 A4 I& I# V
7 k) O; [8 B) G7 f1 N1 KMethod identical to the preceding one except that it seeks the ID of SoftICE
7 Q$ }2 B+ f! f) E/ B& M$ c8 BGFX VxD.6 N6 r8 N! D8 u: N
5 h3 u& V, T# V: y% S% y3 k( w
xor di,di
+ Q9 c9 N ^$ G+ U. r$ c mov es,di
* Q! I, `4 H, ^0 ?* S3 Z" y" q mov ax, 1684h + E! [- E! ~/ j* L0 o4 x. v
mov bx, 7a5Fh ; VxD ID of SIWVID6 m4 A5 a' T; I
int 2fh
0 n9 X" V, s+ J" e- q mov ax, es ; ES:DI -> VxD API entry point
8 w( P$ N9 y" @' m/ i: }# m add ax, di
- Y; O7 K4 B- G+ l L test ax,ax& u6 T: ?" y5 R+ e5 r: x! {! v
jnz SoftICE_Detected! M& R, l6 Z2 j
2 i/ y4 N5 \9 t! S- F7 X
__________________________________________________________________________6 | D1 H1 G* r0 G
# ~: N3 X9 U( ]6 Z N6 w
6 | ^. Z+ Q W4 X2 N8 X. ]7 zMethod 05
+ K, U& h: ?( A: g3 r! n5 y=========
2 q* p5 ^+ O; m+ A6 j0 f9 d
' l- |$ O, L0 b$ o3 k2 }5 jMethod seeking the 'magic number' 0F386h returned (in ax) by all system
9 E. c/ t' q$ O0 qdebugger. It calls the int 41h, function 4Fh.
/ z6 H( K5 y( A( F- F0 wThere are several alternatives.
2 k+ V2 |7 _! Z* I, u% t
$ P: m. Y; @! q+ _3 wThe following one is the simplest:
0 r3 ^, Q; z5 A/ e g$ ? s6 k( Q0 ]; B8 Z4 w& [' A, M( r
mov ax,4fh
" [' l; l) b$ ?! ` int 41h0 c8 s' `4 a9 v
cmp ax, 0F386+ ?. g0 M. T3 T) k: U/ c; R) ^
jz SoftICE_detected* R3 _) l# X# g; @* I2 c/ I
7 ]; y7 ?8 O* q: @! Z5 a
: k2 w% D; l* g( L0 gNext method as well as the following one are 2 examples from Stone's
9 _7 x3 d2 C! G1 G9 o* x. J3 P"stn-wid.zip" (www.cracking.net):/ T5 G! l( r# f* V9 s2 ]# s7 @9 n
7 A" f' Q" F" T+ v: u3 H4 } J7 ^ mov bx, cs
& X) j1 v9 i. Y! s lea dx, int41handler2
! ?7 Y7 i# _4 P% ] xchg dx, es:[41h*4]
# u* x6 ~8 N- a0 p3 c, Z% \ xchg bx, es:[41h*4+2]4 `2 |" D' [# Q2 I7 z" ?
mov ax,4fh, `, N% w O- s' x; u, W; Q
int 41h
) d1 @: u4 k9 D, H y$ s a xchg dx, es:[41h*4]" ]% y* z) T# a+ u
xchg bx, es:[41h*4+2]$ b& l2 x7 f3 ^1 p6 u' L1 g
cmp ax, 0f386h
- E9 [. \+ {4 \: r! u jz SoftICE_detected, L: J& I2 x! P9 F+ E7 M
% n5 X* W* r8 Q- I% |int41handler2 PROC" F, o: Q5 g& y8 v
iret7 c1 B# h( k& [
int41handler2 ENDP4 X4 k/ j: q" \' x5 F
$ P- ^9 A9 z s
8 D) e6 O2 ~. C$ \" b_________________________________________________________________________5 ?" R5 b& M2 q' z- H6 r$ w' I
( }& G3 i0 @3 ?; Q* M) i
" K, D; b$ v7 }3 X4 b5 @
Method 06
0 X$ {# w. ?8 u( ~# H c8 C, k=========: C! p1 j" s4 G* q. G4 N
' I& V$ C& ?& e2 i F3 X6 t2 R$ |: [( s& F
2nd method similar to the preceding one but more difficult to detect:
. B* x; t& e) l1 n- {9 s7 S6 b3 e
. d0 v6 J, E) l5 h6 m0 ^6 G/ }1 J# t" Z" {% S5 ?/ g
int41handler PROC
# `+ D. k5 R2 K: L% D mov cl,al0 f5 x4 H8 b% \' ^, K
iret2 p. l5 v7 c7 T. Q7 [
int41handler ENDP/ C( F) B3 b2 R o
& F# b2 P: q8 t' P: l* Y
/ d. S4 ]" d2 A, W0 [9 f4 q# ~4 @ xor ax,ax9 @/ N* i$ O+ z1 \* F' i9 p u
mov es,ax
$ J5 N% z$ I/ Q4 @" r mov bx, cs
: S8 S. A! I o+ M. V2 s lea dx, int41handler6 e* t, ^9 {1 }2 I* a* a
xchg dx, es:[41h*4]6 S$ [8 ~9 P( {% p3 J% M) r
xchg bx, es:[41h*4+2]
% F# i1 D& ^1 S+ b in al, 40h
) W8 l; o7 x, h1 s xor cx,cx' o) s. \: {- t( J7 h8 F
int 41h' o7 A( P v, |! A8 o
xchg dx, es:[41h*4]# p8 E) s \" f$ N
xchg bx, es:[41h*4+2]
. E' n; z" m. |: ]. y& e i; @* O cmp cl,al& Q% t8 d, n- l4 V; X
jnz SoftICE_detected9 l5 k R: }' z7 i. |7 X. A9 G
, s) O! T- E! g3 a# O- _+ C2 [8 h1 A6 \_________________________________________________________________________2 N4 o5 G- b8 ?5 ] @
5 S% [6 {' O4 E# c1 E( r) vMethod 07
/ d8 t' Q a0 h5 G. r/ ^* r=========. g/ \: R5 Q3 ~ w
1 w6 S" ?. t" c$ k
Method of detection of the WinICE handler in the int68h (V86)
8 Z; A% T6 K# O4 W6 ~3 e& ^, g, x! [; r% p2 A
mov ah,43h
$ E4 h6 l5 m- D int 68h
! P! s# w. K3 ~ cmp ax,0F386h$ s% u. ^7 j5 p( H# O- N8 q
jz SoftICE_Detected* k! B! }+ G3 P% y( a; [+ @
8 C4 j* V$ k9 m3 v/ K$ ]
9 v4 K5 E6 H( [7 F, U=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit d! ~* {( C, j0 O5 U# j5 H
app like this:
2 U, i1 r3 Y; { Y- i" @+ s% M3 i8 w+ b9 j
BPX exec_int if ax==68& J7 {- N6 S9 C% q
(function called is located at byte ptr [ebp+1Dh] and client eip is
+ ?" w7 S/ G3 L$ X& z8 z3 K located at [ebp+48h] for 32Bit apps)
S+ w. I" q7 s e$ h__________________________________________________________________________& C G5 P8 q- P' P% r# x: n
. F0 n2 q& n" g7 g
G* @' t( T; ^# p$ U0 Z. kMethod 08
1 f' V Y- K1 y c3 `1 F6 U( ^=========
- G1 D; _3 G5 N- a
4 g# @; J2 ]$ p5 RIt is not a method of detection of SoftICE but a possibility to crash the
/ K1 {5 @ o% _6 q( o8 o, usystem by intercepting int 01h and int 03h and redirecting them to another
" Y6 {$ L6 C F' Sroutine.
) A$ T7 B/ }/ M9 u/ YIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# E3 a, ~; f5 U8 Dto the new routine to execute (hangs computer...)- ]+ x8 G% q9 m, o3 y- x5 O6 e
/ V/ l& n2 F( Z3 T0 X1 p3 j mov ah, 25h" H. Q( K: F6 y v+ D0 N' ~5 y
mov al, Int_Number (01h or 03h)
2 H" O5 G, I' B* f mov dx, offset New_Int_Routine
+ f. t2 ]) `) Z4 J* X, t* g int 21h
( P7 e. f+ N* W }" H- d+ V4 [2 g+ q1 f# H
__________________________________________________________________________1 _6 _. z& e* A4 M, z& V. b7 s) k9 C% j
: z d8 B z2 i: `3 I8 C+ i9 y
Method 09
8 S& P8 @* ?$ |0 u; U=========5 t- f( _0 M. U. z+ J, l; w
; Y( n) Z: {) D6 _, z; f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" P+ d! P9 h3 f9 p, P& z9 }performed in ring0 (VxD or a ring3 app using the VxdCall).
]# P3 m- ^, i" I9 j2 FThe Get_DDB service is used to determine whether or not a VxD is installed0 P) c* G5 T* I1 T7 o/ f; K
for the specified device and returns a Device Description Block (in ecx) for. P* J" f$ `( k
that device if it is installed.
' s. k. k6 z* n( l0 B% F( M- I; L) Y6 v# L
- J" p" ~. W3 D mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 y# M' x" O$ J/ F' Y* i mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" x; u% \9 R4 a7 ^ VMMCall Get_DDB: u: J$ s8 Z7 {, F6 N6 R
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 o1 L- P4 A; X) X) k
* M" S& G4 ` {$ t# @0 j, {" h% w! ?Note as well that you can easily detect this method with SoftICE:7 \( k. V) x; H, n T t$ z
bpx Get_DDB if ax==0202 || ax==7a5fh
( ?( g! V6 q7 l/ d* a$ \
; v! X/ \' b# p) L3 q* g! g__________________________________________________________________________% y# J' y$ R% J- W$ Z
6 x7 W, b7 \% d. J+ x; \Method 10' n/ ]) A i5 G; i; x
=========
6 x7 U. z- j# a2 u5 X2 S
, G/ N' y! I8 K0 }6 k4 X=>Disable or clear breakpoints before using this feature. DO NOT trace with9 z2 q. s: n: Y/ }
SoftICE while the option is enable!!
% h6 \' S ]: y. b) ]
" U' W- c O, X7 ^& |This trick is very efficient:
& i/ s! ~, s$ |by checking the Debug Registers, you can detect if SoftICE is loaded
( q0 B6 X9 R4 d8 p4 Q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 E, O& a. g7 \; V5 Fthere are some memory breakpoints set (dr0 to dr3) simply by reading their
3 X3 M" l9 D0 D3 Jvalue (in ring0 only). Values can be manipulated and or changed as well
' {' H4 L( D3 v g+ T(clearing BPMs for instance)
$ \' \0 G- J, a5 D4 f7 S
1 |% K, {' v/ K' A' \% K__________________________________________________________________________
$ x# }6 ~5 N9 u) x% a' P. S) J: {+ s- n8 |, c! Y" ^
Method 11
6 ]& O9 f3 I0 \0 M/ k! c=========
$ E6 h0 G4 w6 r- F A% K: _; U! y% ] l) E" y$ A" f/ e( V
This method is most known as 'MeltICE' because it has been freely distributed
6 n* \$ w9 k4 R0 y( z0 T; |; xvia www.winfiles.com. However it was first used by NuMega people to allow
/ u& Z+ q. d3 N# A" h* ISymbol Loader to check if SoftICE was active or not (the code is located7 Y; y8 I' s- `6 ?7 O& Q
inside nmtrans.dll).
8 ]$ }" p3 K i: t: C+ l. w2 m! U8 j" o
The way it works is very simple:/ x% y4 D J2 Y; `( \8 N6 `
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- z4 y7 y' K& r0 ~7 o9 ?/ VWinNT) with the CreateFileA API.# L6 l# C3 J6 f8 V3 U- J7 z+ F
3 U: R3 J+ W; uHere is a sample (checking for 'SICE'): ~( E% o3 h* ^+ X- i K
4 C: g* [; l. S$ x- m) C
BOOL IsSoftIce95Loaded()3 V5 B, q1 v9 B+ S2 ^& s' S4 M. b
{
- W* r" P& |- Q/ J" w HANDLE hFile; & E- m& H, Q5 H1 T6 o% k
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 t$ B, Y) H, D2 n: M3 | FILE_SHARE_READ | FILE_SHARE_WRITE,+ q/ `+ w. k; E2 f2 Q3 l
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 i' D0 w% e5 f% e& ] V
if( hFile != INVALID_HANDLE_VALUE )' p4 h3 E/ `7 P3 Y1 D8 {
{
% \- s8 M+ O9 x* y2 o( [5 Z- n: j2 K$ [ CloseHandle(hFile);* l* Q& P6 z) N2 ]
return TRUE;
' L$ E5 [4 V. K }' T! r( S- J( W" r2 c/ r) R$ W
return FALSE;0 A, o) O4 @- k, t
}1 A. |' ~& n7 P8 ?
8 f0 C8 O" h" q2 h4 \7 kAlthough this trick calls the CreateFileA function, don't even expect to be$ ]( V4 |( ]. T6 k
able to intercept it by installing a IFS hook: it will not work, no way!
3 W: S. q- L( K* MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F8 Y: T& N' h+ W+ D+ a
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 @$ p& u6 q; L7 \$ C( w/ kand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" |- X. u2 o; g: R7 p0 ^7 U$ Z6 Wfield.! o' P$ N' M8 z) x7 ~" h1 W+ u2 i
In fact, its purpose is not to load/unload VxDs but only to send a
5 J/ R0 _; h: q; B+ `# sW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 {' I5 D3 f, i" O4 y
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 e1 M" P" v# N: ], h( }3 O0 ~) _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).. R* Q" n# Y1 W& v* }+ e7 O
If the VxD is loaded, it will always clear eax and the Carry flag to allow
& B4 V/ _; f+ n0 N# Qits handle to be opened and then, will be detected.6 m* F8 T: Y+ v! ]# q+ x2 J
You can check that simply by hooking Winice.exe control proc entry point! S1 ~/ i$ B$ u0 m+ Q/ Z
while running MeltICE.* k/ Q3 L9 d' {: V/ t; h; L
, r; M2 s& o4 k+ g
1 q! n6 e+ i4 }
00401067: push 00402025 ; \\.\SICE
/ b* L1 @1 a, m' m# _ 0040106C: call CreateFileA
8 m9 ~& Z4 P8 |6 c) C+ K& x 00401071: cmp eax,-001
' _9 [8 S; H& g u 00401074: je 004010918 y# v+ B/ h" E+ ~% j# m; F9 k# b
& N. x( x- k+ t1 S8 M8 I) i3 p* @7 ?8 D- K: j) Y+ H& f: A
There could be hundreds of BPX you could use to detect this trick.. b3 N) K, G( H8 g5 }- m
-The most classical one is:* X4 {& W' [" m2 o$ D1 E& n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, r; Y1 s$ p) M( q) E
*(esp->4+4)=='NTIC'( C! s* n/ K& l0 \
6 E7 @$ K5 O* e. `-The most exotic ones (could be very slooooow :-(( d1 O; K- H# a( e
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " L8 p, _5 ]1 g
;will break 3 times :-(2 B- v1 U3 e# `% u* W
P1 V" ` l& u( y& M; Q-or (a bit) faster: 1 G, n% j+ N I7 a: D6 n
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')0 D7 t. M$ j: h% n; N9 E
6 h- P/ | C6 g8 K8 z3 B& o
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
m+ a8 n& |' \9 ~, ]( r! b ;will break 3 times :-(
' v1 l# O/ H. [/ O" i) E; {. Y' a
-Much faster:, r( C* W2 l9 G) m1 V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" v# R/ ]% @9 a. W) M: i9 i, k' b6 J% `
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! G/ L+ G! o) H0 Ofunction to do the same job:! K$ i, u9 c+ Q
8 C1 k& s7 \! I1 j, R
push 00 ; OF_READ
* d3 R/ l. z% R# S: U: u# K/ H mov eax,[00656634] ; '\\.\SICE',08 C( w! v7 r$ Y! @& }, R7 F
push eax6 }" x% U* k- r' ^; Y$ r
call KERNEL32!_lopen+ _0 j* d; p; y; k; L3 e+ T
inc eax" V! d' u1 h% U1 o
jnz 00650589 ; detected
, c( r$ [% F$ u. o push 00 ; OF_READ
4 Y& R- H" ]. L/ v& e mov eax,[00656638] ; '\\.\SICE'" [" y4 P. R$ @! I5 N. \ D' R
push eax
' M, G% }" K4 L" J$ n% j call KERNEL32!_lopen
2 E- I8 m1 v L" n% a inc eax
/ D7 [! F/ _, Q7 M% @ jz 006505ae ; not detected1 f/ f e, t8 M9 {
" H. B. X0 s4 Q9 G D# Q( T% ^- g* S1 F
__________________________________________________________________________0 c9 N/ V( v0 b
3 A9 b9 l4 K9 m' g9 R3 w: c
Method 12
5 \9 [, C3 {& _. a/ n' B=========7 P( W& z/ F* @! Q) D
K" h# C& F- X$ B' ?8 Z
This trick is similar to int41h/4fh Debugger installation check (code 053 p2 n& H# B2 Z* }
& 06) but very limited because it's only available for Win95/98 (not NT)
3 `8 l E5 M/ F: zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 A: {7 X9 `. |% \: G% `
& o0 b+ d8 @! ^) n: @ push 0000004fh ; function 4fh$ l; X$ w( E, h1 B
push 002a002ah ; high word specifies which VxD (VWIN32)$ R( N: e1 ]( l1 _
; low word specifies which service
7 i2 I2 h; S! L( a% D$ J9 ]7 S (VWIN32_Int41Dispatch)+ Y5 b# m2 @8 w+ s3 y* a- f
call Kernel32!ORD_001 ; VxdCall* D+ t8 I0 r+ S1 K9 Z# U @& s
cmp ax, 0f386h ; magic number returned by system debuggers
# _/ p; D0 C+ k& i r+ w jz SoftICE_detected
; A5 I( ~% c; T9 m7 {5 p' k$ B0 a- g' m! a! P& T' p6 k' w
Here again, several ways to detect it:9 M0 b h5 Z" Y. h' v, `* i! _
+ @& y$ [/ m% u1 w BPINT 41 if ax==4f( s' ?! y7 S) _$ n7 G) u
7 `( L; w+ f0 X, d
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" o. o* r( N/ h4 [) ^2 R9 z2 n( A# _4 n7 M' ^7 |
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
! {5 p" S$ K$ @
8 J3 ^# G% n# B* ~ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# h V+ i+ |) c2 b
( a: V. _" h' |! J: G* b7 \0 [__________________________________________________________________________
' L8 ~& W/ z0 V) W1 K, i' Q. [; U; {. f0 `/ n' B* c0 f3 L4 Q
Method 13
( Z! m, V- U7 G9 N* o" q=========" y3 @. S" g$ p! w5 U. N+ \
/ q5 e4 j1 `8 s, t4 F- A7 s
Not a real method of detection, but a good way to know if SoftICE is
- e. z; {' ~; F7 [# n+ o' x+ yinstalled on a computer and to locate its installation directory.
4 Z' j# e5 X1 O, W& AIt is used by few softs which access the following registry keys (usually #2) :6 p: e' p, }7 z& ^) W
. j; X4 A) P. h- d$ d# T-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion Z; w" v, j. R& f/ e
\Uninstall\SoftICE
' j# P/ f$ \6 _1 t6 `5 {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 Q0 N; t& e5 B
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 W- o) I8 Z( f$ E! y5 x\App Paths\Loader32.Exe
- O3 |9 Q2 n1 {2 p% e" t# k0 j* s4 u! z, O1 I; E* w
, f. v, Z1 p4 G- H
Note that some nasty apps could then erase all files from SoftICE directory$ c: h3 h& T7 \9 o: {
(I faced that once :-(
+ n/ U" e- G2 @+ h
' w5 G8 Z, w$ A, \- z/ ]6 h+ ?Useful breakpoint to detect it:
: D( e3 z; K W' G4 D/ s
# m! L$ [1 ~4 [7 C" A9 E$ V r BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 P( ?/ }5 R k q/ |0 [9 x- R4 Q, @5 v4 D$ O
__________________________________________________________________________4 y5 A2 b: w2 V, A
6 q4 i" K; A3 o* l/ ?5 d7 ?! o7 O$ w- @- g
Method 14 1 N5 x6 G# f$ `1 P W7 c+ z
=========
' v1 h; Y9 M, O& R8 G+ g0 P: T; M/ h
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 x) V; O' \+ r* X: H: Jis to determines whether a debugger is running on your system (ring0 only)./ W% k5 O- B3 N! ^
) e2 c+ Y6 u. Q# ^$ L# O VMMCall Test_Debug_Installed
; q7 m/ P4 I/ u je not_installed
& Y% t8 _1 J8 G& i; _$ S3 I# j7 g4 W J; o, K
This service just checks a flag.3 Y: F7 j0 y0 b2 m0 Y# K! h# }
</PRE></TD></TR></TBODY></TABLE> |