<TABLE width=500>
6 Z5 u* X( A( a% E* B4 Z<TBODY>
H1 Z- U! v' a6 V7 v' C<TR> T0 X2 [; f( o1 }7 X! ~
<TD><PRE>Method 01
& W# d9 \. I' ]=========
9 M. d( j" {) o5 ?: ^
. h+ y' Z* ]3 c- _This method of detection of SoftICE (as well as the following one) is
5 ?) f0 A# Q. @% a' M2 qused by the majority of packers/encryptors found on Internet.
7 N9 C/ Q, y0 {2 \) B; B: kIt seeks the signature of BoundsChecker in SoftICE
) P3 O0 Y8 ^' t7 |; |4 ~) ^" v; d6 r6 ~8 e( B; h
mov ebp, 04243484Bh ; 'BCHK'4 {. c/ X. D7 _2 Q' W7 H3 [, x# f5 m
mov ax, 04h
6 L8 d( e1 M2 n: q1 ?# z# T int 3 7 `# G7 m/ |: p
cmp al,46 z' ?# n7 H* ]' B1 F% [% p& u
jnz SoftICE_Detected
0 N" y) L8 M2 n0 d5 H
2 o: w' h1 q; h2 W7 O4 o% t/ \6 g___________________________________________________________________________, p; p4 z( W- t2 @
, h, ` ]# K* N G" Z: k
Method 02
0 Q( K1 ~7 w- ?" j$ @=========8 x" G* J; P7 I' C
& C" S# [3 n, z) k, o! H j8 AStill a method very much used (perhaps the most frequent one). It is used7 T9 `/ H* \! p/ A2 P- M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 k; Q# a- @( i/ u
or execute SoftICE commands...
$ p, X( V+ e$ ^: ZIt is also used to crash SoftICE and to force it to execute any commands. O% \( A5 J0 u, `
(HBOOT...) :-((
% v8 S8 a$ A/ l9 B. Q) z$ d9 k
( y8 r! F y* UHere is a quick description:
* m; s. e2 k7 X% H8 ~2 m% [3 v-AX = 0910h (Display string in SIce windows)
+ b7 F4 H. q# `1 V- I-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# Y+ N, O: D: |: ]) l
-AX = 0912h (Get breakpoint infos). P( C) ?4 ?3 \1 E) E; G& X
-AX = 0913h (Set Sice breakpoints)
0 \; m0 o8 f t-AX = 0914h (Remove SIce breakoints)
6 F$ F; V: c/ [$ {: i+ b5 Q" @' R8 i5 t& P8 @, f
Each time you'll meet this trick, you'll see:
( T: e# R: F: d! z% s% E-SI = 4647h+ C5 o( h n% P$ s5 V/ B! k. N
-DI = 4A4Dh
9 ~* `3 v& a5 [& n- Q4 NWhich are the 'magic values' used by SoftIce.
, H) d) M7 c: X, L. ^For more informations, see "Ralf Brown Interrupt list" chapter int 03h.2 g* D* H* ]( u4 x1 Y0 _
6 V8 N1 i/ \% ^9 |4 E4 a, j
Here is one example from the file "Haspinst.exe" which is the dongle HASP$ m3 t- g9 q o T2 c
Envelope utility use to protect DOS applications:
; w9 G* x' P# ]" o! `) N' M$ [6 X% V. ~7 a
3 |$ ]$ ~' k5 [0 |* W2 e/ d7 D
4C19:0095 MOV AX,0911 ; execute command.
& B9 ?( @* a% b' m" f& u+ x4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* X6 T+ `4 r. g0 b
4C19:009A MOV SI,4647 ; 1st magic value.& ]" q- |1 L1 @5 [" j
4C19:009D MOV DI,4A4D ; 2nd magic value.
& w. P1 u; s" j4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), J" |- M: _ g6 e0 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 i6 B& {7 i; M$ J7 {1 x9 y4C19:00A4 INC CX% o9 |( K* r5 j* Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# H8 K6 Q. d0 ?1 H3 n% ^; C4C19:00A8 JB 0095 ; 6 different commands.
5 T9 d) l3 ] N; G& j7 l( O4C19:00AA JMP 0002 ; Bad_Guy jmp back.- {8 o; A/ _0 ^# V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :); C$ q8 M! g1 ~. Z" n- }
5 M- a( x8 b# t
The program will execute 6 different SIce commands located at ds:dx, which8 S7 \% Q, ?& F V7 J! C3 d
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* w% \9 n6 k3 i* r7 }! D7 |# j8 X) m, B u8 B' A
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' y: h0 c, t0 \. W! a2 U" b( Q___________________________________________________________________________" ?9 S) Q+ h% z b
- a) b2 N. j9 v- p+ x4 r
+ o2 x3 u0 X( n% [# I8 ?5 A7 AMethod 03
Y+ [1 B0 j \6 |( M' o4 U; U( J! x0 n=========# ^. H& @6 l3 X1 i. f- E% p
9 t; K) p2 y1 X0 E2 b* J5 u8 i: B
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" W# }# v% ~ D! p3 o% T% B(API Get entry point)
4 h& K% L( U" {4 x# \, H" `/ a: T 9 Y. ?5 s) p" N, ?7 c: F F7 @
8 K C2 s( w) c% ^9 G8 g
xor di,di
1 W9 e. r# W& _9 C8 k3 z mov es,di0 n! r$ I1 S% N6 w8 d' e" X
mov ax, 1684h 6 W) _3 q; P7 @' U; S4 r. l- h1 o
mov bx, 0202h ; VxD ID of winice
7 x6 f1 `0 g! q& o; o" c# N int 2Fh7 }6 F1 c3 p) i2 X! w1 x+ c
mov ax, es ; ES:DI -> VxD API entry point; w1 _2 k: Q# ?/ t
add ax, di6 B) e& ]$ u! B# w% S
test ax,ax
; g+ b- v5 A2 ]5 n- \. \ jnz SoftICE_Detected
4 N. O$ R$ m8 E% N8 g
( p u; P& T! `. R, u8 S___________________________________________________________________________) w" h$ C& r- \! a
' F) m; S4 o; { ^; h [( C
Method 04
z1 f0 W; i6 ]) ?=========2 [/ U2 |) k+ z
/ _" Y3 v' D% ?0 B" R& ~8 q R& wMethod identical to the preceding one except that it seeks the ID of SoftICE+ S+ h7 {: O' \2 {2 w6 W
GFX VxD.1 ]0 {1 e5 Q8 Q% ~# E! q
1 K4 B1 Y/ k+ k* o! }3 d" ? xor di,di
v% S! P9 k7 M% X$ k mov es,di# N: \% H& H1 Q9 {; o
mov ax, 1684h : W; R+ X. {9 x& x1 X7 l7 R0 v
mov bx, 7a5Fh ; VxD ID of SIWVID2 S1 Y3 F/ Z z2 a% l2 H8 V/ h
int 2fh7 e6 _4 ~: @ _; D/ e; w
mov ax, es ; ES:DI -> VxD API entry point5 Z& W* z& J% c$ B# X
add ax, di
- @1 r D1 o/ U5 \ test ax,ax
9 G8 h: C- c7 ]/ i/ y! D jnz SoftICE_Detected
) l% X' m! J Z" c0 z
. g% R8 |# o" M$ Y% o8 N__________________________________________________________________________
6 G5 Z4 q+ `( ]; c6 s1 r/ d
! @& ]8 s0 O5 V. E' U; x
@7 }4 S, ]- xMethod 05
1 P' J; O$ a& i# K( F" c=========( @$ Q- _; B. |$ n! s. p
5 C: C) {6 G7 {
Method seeking the 'magic number' 0F386h returned (in ax) by all system
- P' i% S1 e z6 R5 rdebugger. It calls the int 41h, function 4Fh.
' Q7 Q; U4 h8 Z! gThere are several alternatives. , l0 }3 T# u% V. t7 x* W2 P
4 G' B8 @. A- c8 {# D" c
The following one is the simplest:9 \/ f5 R# m6 x# d
6 {) ~. k& t$ E) h9 n# W2 I$ u mov ax,4fh$ g0 |8 ?! w* U0 {
int 41h
1 |2 `) `/ j3 m E; p) a( ] Z cmp ax, 0F386. Y6 |0 v0 }7 W3 }% s" E3 A5 Z
jz SoftICE_detected
% J1 B- `$ u8 r5 e% j% h. M, p. g' F2 R0 j( S5 H# z! O
2 k% F% I& A, ^% x0 z
Next method as well as the following one are 2 examples from Stone's
/ Z' z1 e. C+ d: B"stn-wid.zip" (www.cracking.net):4 S9 S3 x. J) V! b; R6 A
- r( U+ |8 m- v4 b4 R9 N
mov bx, cs
% p8 {6 v( h% p1 K6 J! P lea dx, int41handler28 G+ k) M1 f' i* u7 M
xchg dx, es:[41h*4]5 M, Q8 l- Z$ s/ W5 X
xchg bx, es:[41h*4+2] T8 x; k0 [9 N) ~
mov ax,4fh
: Q% r+ P, G: ^' D B0 E4 t' d: U int 41h" C& M2 s" ^+ D' B/ R' x
xchg dx, es:[41h*4]
9 ]8 ~# o( i' k xchg bx, es:[41h*4+2]
4 \8 }+ \) M; J cmp ax, 0f386h! b5 ?/ r7 [/ @( f! ~
jz SoftICE_detected$ G! V" R, y3 y8 \3 w0 f0 ?
4 S" b5 P/ [7 R) mint41handler2 PROC9 b8 P$ Z; N7 p
iret
- J! `9 U. K( h, K) G) dint41handler2 ENDP& N2 y' P5 d- p; G: V7 t
$ r4 K' i7 b0 u7 l5 P, a
* z! K5 }0 g* }! C
_________________________________________________________________________2 Z* E& o% p+ S/ Q7 s+ E
2 a. P; I" ]1 g! l/ K
& d1 D J8 t" \' [
Method 063 c4 \) O) n9 _) w& V* n; Y
=========
3 t0 q6 q) j. |3 m, R! J0 R$ B# c2 \- {0 z* H/ y
( Z7 u2 N' S3 l+ c9 Q+ W
2nd method similar to the preceding one but more difficult to detect:- o" d5 |) @, e3 x4 M3 k
8 [" |6 G5 g1 \" l$ k" j Z& w& j
7 K A1 J* V) s `* Y. bint41handler PROC
Q3 l( \7 n C: P5 K; H1 v* \ mov cl,al' |7 P" h" Z0 L& J, Y: u
iret+ L0 E, V3 B4 Z
int41handler ENDP
# o# B- P, f8 S3 _/ `0 T
/ c! Z* y3 C8 w& m1 C4 r3 i. d8 a( Q( }, Y
xor ax,ax8 [. T: c4 g# P' h O1 F, q d' |
mov es,ax
+ U! Y1 a4 O+ H+ g+ r. r mov bx, cs
# F/ u( T" ^- d" @: y* ]9 R( i lea dx, int41handler" m/ h9 g) G7 Q% k' C
xchg dx, es:[41h*4]) K9 a2 d$ M# _4 L8 o
xchg bx, es:[41h*4+2]
0 O; T- }+ \) m/ Q) Y% T. i9 ? in al, 40h
# r* }: z8 d& T xor cx,cx
2 s- u: b, p$ J `# ~: |, L+ a6 \ int 41h
+ r1 x% I l9 _* U# I, i; T xchg dx, es:[41h*4]
7 a, y4 S7 d& P3 q xchg bx, es:[41h*4+2]# @. i3 b8 Y7 D$ T2 F2 x0 C
cmp cl,al
( m$ F( I# \! E jnz SoftICE_detected
8 R6 B- j) x( m5 c" H- j! F( c; @. p3 M9 S% a) J9 q) L: L3 x
_________________________________________________________________________
# \' h6 ~3 [0 k1 i# l/ _% U! O0 s: r* Y- m: r. N
Method 07
. T, _5 i8 a2 O9 [5 [* g6 W3 B=========" ~+ L! d: H2 l, u* Q: U3 E2 B4 d+ L
, T g5 j/ N0 y% f6 L
Method of detection of the WinICE handler in the int68h (V86)
. [ C [4 P' [( Q
+ w+ Z3 h% K$ b6 H! t' F: x mov ah,43h
( e. {/ w0 T3 Z: ^9 a int 68h4 [& c( G$ [) ]% u3 w, A
cmp ax,0F386h( v9 o7 J% \( \" p& b' j5 I
jz SoftICE_Detected
/ E4 K* O# A" G* {/ H; t" N
' `* P4 G+ Q7 J+ F2 V3 h' V: D8 V7 X3 _
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 ~. r0 G- ^, G4 d t3 l
app like this:
' H ^- r* B1 ]: u }) D: w/ {# }9 P/ T) v: c# [4 i& |
BPX exec_int if ax==68
& ^% E. i6 a2 n( n1 f6 h (function called is located at byte ptr [ebp+1Dh] and client eip is7 M1 Y, [7 @( g$ B4 x
located at [ebp+48h] for 32Bit apps)
& a& _& M& H1 z/ H4 h__________________________________________________________________________7 W5 g3 r& d0 [9 ]$ b8 s+ s
4 @% Q3 N- s0 b7 R6 u& W% c# A8 f5 }
Method 089 U: S: S8 _( P, ^* @+ J/ R$ K
=========
- a* e g" o; e- j' H$ {9 j- N0 B. ]+ b) w# e
It is not a method of detection of SoftICE but a possibility to crash the( F1 \1 \$ s& G$ J) V- P
system by intercepting int 01h and int 03h and redirecting them to another
) a' z: G; S0 C$ E, I/ Froutine.3 h/ w, ]- {9 J% I! ^
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; _5 |* i& s2 A9 ^to the new routine to execute (hangs computer...): Q5 d% ^* p6 v
3 ]/ S* T; C* r5 f
mov ah, 25h
! Y; q; [- m7 w6 C% b4 H! m mov al, Int_Number (01h or 03h)
* h1 u5 s$ x5 c f7 _; S mov dx, offset New_Int_Routine4 \0 Z W0 |' T
int 21h. r7 Z( j" ~% e
4 a( W9 y1 m, b% F8 v% O% o; f
__________________________________________________________________________
) h, Q9 [. z/ B$ e/ A9 y! K
8 |8 E/ e$ w, P- qMethod 09! k2 ]2 Q$ c; y) n2 R# a
=========
( Y0 i4 z9 }7 {* m: E: F/ O
`. [( ~, E. F% IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" l6 g5 ?1 b R- E mperformed in ring0 (VxD or a ring3 app using the VxdCall).
: a* }( o7 l* }7 n/ t1 tThe Get_DDB service is used to determine whether or not a VxD is installed
, K. s1 n$ k# yfor the specified device and returns a Device Description Block (in ecx) for9 {2 m! K1 j. z" e' x/ u
that device if it is installed.
: ~3 j* P! E0 k& F1 x4 Q. a) l5 s( ]/ `
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 N6 C* D @ g/ t, q) B
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) N! {8 l+ O- U9 ? T" j% a( k
VMMCall Get_DDB0 [2 ? {2 g- k, I6 [, m6 h( p
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed) h X/ R% y9 U6 M/ S0 E y
( }* O% z# B: h: v; }
Note as well that you can easily detect this method with SoftICE:6 z) |) ~) Z( f
bpx Get_DDB if ax==0202 || ax==7a5fh
9 |/ F" @& k) k: @& H5 C2 [( |! B2 W* Q! T- G; @1 q
__________________________________________________________________________
" z: V# X# f. {( W; U; K# ?. q2 j+ y/ h. E3 f2 {, _8 ^
Method 10
9 {' z6 D+ B3 O2 j9 n% k7 k=========/ O4 K: B7 s" I/ r6 H
; Y1 q! v- ^4 {8 W=>Disable or clear breakpoints before using this feature. DO NOT trace with
& r5 ]% i+ [1 R' E2 D+ W SoftICE while the option is enable!!, W$ Z5 k1 { X' L) U* Q( c) s4 S
! }' v( E- f- m- K4 fThis trick is very efficient:. n# u% W" b' k* G* Y8 c4 h& |
by checking the Debug Registers, you can detect if SoftICE is loaded2 O3 p$ t; Y: m
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" }9 d0 a/ @! Y. tthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 n$ }- M& N3 N9 _* _1 ~
value (in ring0 only). Values can be manipulated and or changed as well2 {9 j) `! }. ^0 _
(clearing BPMs for instance)5 u! J& ]. e$ R9 K4 X9 }( l1 E! \
- D. u2 u$ d4 m! j- [- I__________________________________________________________________________) x: x; W. K- S. F- T; x% e) m
4 o9 V) s1 L; h. N( o& U# a( d4 VMethod 11/ u/ F4 d& h1 B E
=========
7 d8 B- ~1 l6 h; _' k/ {' g* v( C5 o3 {* Z7 {3 i8 K+ h
This method is most known as 'MeltICE' because it has been freely distributed7 R- d4 V/ u0 c7 v9 g; O
via www.winfiles.com. However it was first used by NuMega people to allow
0 _! _) ^( ?3 A5 WSymbol Loader to check if SoftICE was active or not (the code is located- c9 b- ^3 ^7 s+ s8 ?- f! E# Z
inside nmtrans.dll).$ @) N% K- z: s: D
7 \- Q0 g' E$ fThe way it works is very simple:
% \- W# z9 \7 Z- y g, KIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
9 ]* a* m3 H- J; gWinNT) with the CreateFileA API.4 x* h: X$ n& Y+ P# d# X
+ {8 F+ e( \6 a0 U' f! s0 \
Here is a sample (checking for 'SICE'):
7 z9 f' Z+ V1 a8 ~- [1 [* V# g: S0 Y! D
BOOL IsSoftIce95Loaded()" D( `# j, X8 c! b
{
& T. `/ D' w; c' y3 P U HANDLE hFile;
+ G2 I7 l5 Z5 K4 g: c hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ w- }4 g3 r' U; k5 h" l: O/ U
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 i m3 w l9 d NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" n3 U+ E( o" X
if( hFile != INVALID_HANDLE_VALUE )" U5 I4 A6 d' c7 Y/ A7 B
{
T# z, c; T4 p" j7 n5 } CloseHandle(hFile);4 G2 v0 `7 b! j. G6 F
return TRUE;
- j7 C2 a! y0 ~& f% ^$ T' p/ Q }
/ I" V# v' u8 d$ P; g8 s' N+ J; t return FALSE;8 a* g$ B% m+ S1 o2 b2 x
}
" P4 [' J) j1 J; k' l1 F7 `- G6 i$ W7 p- f8 E3 V ^' T
Although this trick calls the CreateFileA function, don't even expect to be0 D5 l6 `: I7 [7 b% B
able to intercept it by installing a IFS hook: it will not work, no way!
% g' _, W" s* }" m: s& NIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" F9 d+ `' _- O1 p0 a
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 l4 q- O: K. Z- Cand then browse the DDB list until it find the VxD and its DDB_Control_Proc
. ~' @ m" Y% G. J5 J5 jfield.! _& m6 ^; T: p3 R
In fact, its purpose is not to load/unload VxDs but only to send a + o" m* f% e {
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); _( ^9 }' `$ c" z b0 J2 n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
( k! N' ~8 E: ?( s2 U% c3 ito load/unload a non-dynamically loadable driver such as SoftICE ;-)., X2 [4 Z( j' p* X
If the VxD is loaded, it will always clear eax and the Carry flag to allow- B) [. r# b" @, W- O' y
its handle to be opened and then, will be detected.$ F" m3 j- o' R ]. V X
You can check that simply by hooking Winice.exe control proc entry point
. q& Z" t7 N4 l6 T; q3 Zwhile running MeltICE.
3 j% L( e- O1 S6 a9 Y, \
$ `; L" I5 N* t1 ^& B( d) e2 I' V0 H6 u+ ?
00401067: push 00402025 ; \\.\SICE- a$ p0 ?2 s# a, J5 @3 b8 h: G2 m
0040106C: call CreateFileA8 Z& z# x5 s; N7 }! {% [) l5 B2 a4 o* X
00401071: cmp eax,-001! \& d+ U$ x- ~: K, q3 b0 e3 ] F
00401074: je 00401091" F- D4 D# R# H9 x* M
) j3 ~* H. m/ _ s: p) x" q2 `2 M( Y% V5 l& A) R, B/ ^( A
There could be hundreds of BPX you could use to detect this trick.. x7 }3 d6 U( q. o/ m
-The most classical one is:$ Y6 x9 S' f; a k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( b: v5 x o6 p# U! y7 l
*(esp->4+4)=='NTIC'
7 f! E0 Q* k' g. k5 y4 B% Q( i. R: n9 \) R* H3 A1 C y
-The most exotic ones (could be very slooooow :-(/ @5 Z4 `8 I- b1 f& g/ A
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 N$ A( B, `! n$ B
;will break 3 times :-(
3 S4 @5 l0 d0 X2 J: T
7 H; K1 k5 ^0 \- j4 P/ P" x-or (a bit) faster: 5 O, ]/ G) @) N$ M; i
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 v# t# x0 ]3 v! ^& {: Q0 q: c6 T- Q7 b% ~9 [ g
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! d$ k3 F5 m7 m# b, L2 S ;will break 3 times :-(
. e( D3 ]( X8 S4 C, U
. r. j# n( b- [7 ?: }* o-Much faster:' M1 S- B5 ?7 f) ~ x
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'% K3 E0 l! ^ D9 z9 r
5 c) J$ E% C: S& }5 S
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: R/ Y6 V; w/ P6 Q. Ufunction to do the same job:8 C4 m# F5 @8 E- C3 f
( h% B+ |$ ^9 \' B1 D1 j) E4 y
push 00 ; OF_READ- I7 U/ o9 D5 Y8 [; H9 h
mov eax,[00656634] ; '\\.\SICE',0
% G9 [9 y4 L( z+ Z, T' ]! ~% m+ A push eax# E5 x- C7 J; S+ }" |
call KERNEL32!_lopen( ^- k/ G& f! Y% F. t' i$ e
inc eax1 I8 O, _! Q7 z- P
jnz 00650589 ; detected, R) o, ]3 a( G( ?' P. b
push 00 ; OF_READ
7 O; R! k* I0 c3 T. ~. ], C: | mov eax,[00656638] ; '\\.\SICE'
+ f) ^1 V( i6 O2 B1 ] push eax
2 z4 a* N& _6 f4 O& F* O7 V call KERNEL32!_lopen
+ V5 l# u( r/ ] inc eax7 ^9 ^7 y+ U4 h! K) k+ f4 ~
jz 006505ae ; not detected
, _8 r/ M7 d3 K1 x+ S/ ]/ s c
$ L W7 d" s9 h1 S; e$ `
; y1 B9 O% H3 p# p__________________________________________________________________________
, t( w! N1 N0 r: v* [6 d4 o9 D( F) v- V$ A5 H
Method 12; S# ~2 i/ O) l# {, x
=========
/ s6 U) y5 q) g: L. r( `5 A2 W5 O# U7 s) P5 [) \4 x1 \! Q8 i
This trick is similar to int41h/4fh Debugger installation check (code 05
% c' ?$ B; m0 m2 |: r- s& 06) but very limited because it's only available for Win95/98 (not NT)
/ t O' U8 i7 I2 X# w- ^1 qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 c# R# s2 v$ E5 }& f
1 [- e- g# S* S W; G( s$ z$ ~
push 0000004fh ; function 4fh
6 O& A- a! J* }# V g( J! W push 002a002ah ; high word specifies which VxD (VWIN32)
# E9 T' x4 }* ?) |! ~9 o" V* i# j. o ; low word specifies which service
; t2 U2 y* [( \$ n9 h' w( t# e+ r (VWIN32_Int41Dispatch)$ F2 N% b7 C# ^: J3 \0 K T
call Kernel32!ORD_001 ; VxdCall! l4 {& q" e6 H5 `# Y
cmp ax, 0f386h ; magic number returned by system debuggers- E, Z' z" l% v5 M1 ~
jz SoftICE_detected9 M) p& n. b4 l* @* W
# I0 L8 U( D9 y S/ c9 w( F+ N9 N
Here again, several ways to detect it:
* H- d$ b; R: N7 @( Y2 {9 t7 B* A* a4 r% w0 {8 u7 g3 Y9 v' W
BPINT 41 if ax==4f0 e$ A3 c$ H8 ]5 b3 Y6 s ?
4 T' S( B$ L( w4 X BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 B2 v- H" p+ _3 v) ?) A
0 h# z! ~5 @- D2 o8 D v! V BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 |: c3 y: E% Q. V
! F: Z4 O. l1 `. Q0 E( ` BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 z ~: }% D. l& J; N, D7 m$ [
+ F0 ^( V' w& J; B+ w3 v0 ~8 I$ }
__________________________________________________________________________9 B( o) e$ v/ B: u* j
' T3 ]! I% [; F; x
Method 131 g+ j' t+ ]+ P
=========
# l" I7 {8 N- E, i
$ @6 d, C* t9 G. M- ]) m0 g7 L1 O, GNot a real method of detection, but a good way to know if SoftICE is
# z6 S) ~( Z, M4 a) k# N. Vinstalled on a computer and to locate its installation directory.1 M; A6 m0 t+ I- w. [) O5 }
It is used by few softs which access the following registry keys (usually #2) :( g( l' s2 Y0 u0 C7 t, i8 C3 x
0 x: q. h: q0 w-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; q* g* N$ |& M. J$ ^3 C; `\Uninstall\SoftICE2 t. b; z$ ^+ u. W7 Z$ ]
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 w h( p. u5 ^" v) ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 _- G9 G4 i( {\App Paths\Loader32.Exe
5 W( U5 D0 E. e6 t+ F3 _6 ~* v) _/ J& F, t8 X! M
! O: v' H& I3 U
Note that some nasty apps could then erase all files from SoftICE directory* P: s+ G. M4 ?% |
(I faced that once :-(
) m! K$ F1 q) e; W$ r# q) u) k/ J: K' K1 f
Useful breakpoint to detect it:* \4 z9 L( q7 I( {# N' V: }7 v! j
9 n' o) s4 O& n* x5 X% g
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 @6 ~/ u! S+ A6 A7 w" j# e+ D h. o, Z) Z
__________________________________________________________________________
3 D! m( I( e0 x) R1 J5 H1 ?1 }& w4 c2 K* _
+ I$ P% O+ W) Z7 r, U
Method 14 % K7 [6 D" ]/ t# G" G
=========
; n0 w3 g8 T" E' y4 s3 x1 _# V0 H$ m! U: ?* v9 U
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose3 S$ [- u% o5 f6 I4 p
is to determines whether a debugger is running on your system (ring0 only).
2 @& n1 u( @( I& v e" V5 O6 ]; Y, u7 z' D, {" v4 T3 p
VMMCall Test_Debug_Installed; F8 \/ e8 ^& |9 T
je not_installed3 ?% c2 g( o$ V5 q6 y
+ ]& I) t2 w* d: C2 j! ]# `This service just checks a flag.
% @* @5 `0 r3 i0 y) ~( ?7 n6 J# J* c</PRE></TD></TR></TBODY></TABLE> |