<TABLE width=500>
0 m; I+ c& [- V! W<TBODY>
4 Z0 M0 }( Q2 N/ r! ?1 Q<TR>8 P2 a+ n Z6 f. d
<TD><PRE>Method 01
7 w5 \4 w% k- U5 C% p8 f9 q7 l=========
' K& s; P" {7 q) }2 d! P0 w. t- U( @) P9 I" h
This method of detection of SoftICE (as well as the following one) is. J4 @5 _0 T# l* Q, p& {
used by the majority of packers/encryptors found on Internet.
( z3 Z! A1 \; u' J0 D# HIt seeks the signature of BoundsChecker in SoftICE9 x+ o* q# l# u% v8 O
% ~$ x) v- `& W' P6 \
mov ebp, 04243484Bh ; 'BCHK'
0 y. [( N1 O$ c$ e mov ax, 04h/ A! U; t+ v- n$ E, H' A n
int 3
0 D& Y9 b+ N$ E$ n6 v5 O cmp al,4
; U# l& X$ C2 {# |3 b jnz SoftICE_Detected# g) B, s: e% c% K% v. t
, C% e3 c. d( v
___________________________________________________________________________+ ]) I# W, ^: X* I" T0 ~$ B' a0 v( m
, L5 [% ^ S; a$ r3 \* F
Method 02
" P0 i# [4 r5 e5 v; T# \=========
$ M8 K# F* O1 T% c% ]: f6 J! N8 c% U1 R6 H8 i! f4 C8 a; N" @
Still a method very much used (perhaps the most frequent one). It is used' _$ B* T$ K0 r) q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,( H. Y! _# a( L1 f0 L
or execute SoftICE commands...7 {7 J. A3 V( \( ?; d$ f) J+ I# ^
It is also used to crash SoftICE and to force it to execute any commands' Z- |0 g( Y; b" @5 @
(HBOOT...) :-((
/ {' R5 K$ a x6 F4 i
* Y0 c& f, p2 k3 I9 K% ~( u2 s. e7 FHere is a quick description:! b! I) u( i6 j: K @* B; _
-AX = 0910h (Display string in SIce windows); D7 f& F' n3 u, d2 N" s; U
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- T Y" |4 j0 g2 [ p3 E# \
-AX = 0912h (Get breakpoint infos)
/ h3 X+ y) b' ` J' n-AX = 0913h (Set Sice breakpoints), p1 w1 Q$ O% a) H2 G
-AX = 0914h (Remove SIce breakoints)- g0 I. P2 o* `7 o
6 E5 C. f! k* @( X; I9 g0 v3 ^Each time you'll meet this trick, you'll see:/ Q# ]% J# y# z
-SI = 4647h
( v4 X5 c+ A! n-DI = 4A4Dh6 E1 w$ w/ k( a# ?2 R( H% K
Which are the 'magic values' used by SoftIce.; [. d% c7 J T; R! S
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 S, ]3 ^( j/ D1 K \1 j1 i" h4 F: R: h
Here is one example from the file "Haspinst.exe" which is the dongle HASP; \9 p) l( ]4 R) n7 M! q l
Envelope utility use to protect DOS applications:
5 {0 S2 l+ p \7 g+ d0 ] W: p7 o* P
( S# C; }, m/ B0 `7 S% K4C19:0095 MOV AX,0911 ; execute command.! Y" `5 l& U: K9 A
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* r) F- ~4 V6 y9 W/ Y( Z4C19:009A MOV SI,4647 ; 1st magic value.& Q& N5 e/ @* [7 F- ~
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 t/ q- N* s' \, I4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* Q M, o6 j+ D9 }9 ^$ F1 B( s' N
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute w; N$ \8 N8 r+ M( a9 `" e
4C19:00A4 INC CX7 V: H, R/ I! o6 N* t( k
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
3 ^ C1 ?/ ~! R( w2 B4C19:00A8 JB 0095 ; 6 different commands.
; y9 i. A# L Q) H4C19:00AA JMP 0002 ; Bad_Guy jmp back.' N5 l; g0 p* |3 k" u
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 i" ], O4 C7 B, n6 M ~' Y$ q& }3 z# Q+ e% y
The program will execute 6 different SIce commands located at ds:dx, which
0 p. d5 ]1 V5 J/ qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 o; {; v" ]+ }0 \' y+ p
1 i: a5 X M' n" I# M' P: ~$ R! g7 y m* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." S, g8 Z# o1 [
___________________________________________________________________________0 g8 z9 ~8 P4 D- a6 P
! ~% W2 j- j8 D# a. O
: X; \2 |6 x1 S& wMethod 03
/ d2 o, u# @! [/ j! x& Y' f2 A=========# X4 H' h) K6 w
3 C, K. O+ j; u1 l! N* Q" lLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) C; t5 I5 U" C. W(API Get entry point)
+ C! C' [. F7 u
) r4 e5 ?1 `1 Q* s; Y
9 P# ?# h7 W# x5 d# ] xor di,di
: W4 s5 {2 o/ U- s. D- V mov es,di
+ T( r' N' V' z+ f- D mov ax, 1684h H- O# B5 B2 |3 ?5 D; b
mov bx, 0202h ; VxD ID of winice: V0 b6 X# H% \" m
int 2Fh
* |2 o) f8 I8 K mov ax, es ; ES:DI -> VxD API entry point4 E1 L" s6 @& h5 Z& L3 S5 P
add ax, di
3 {! @8 b# a8 r3 O test ax,ax" Q8 @- ~/ X- |; Q M7 ], G; Q0 }
jnz SoftICE_Detected: h, t* L! E/ h" g* y, s
" t* E. G( R- X& F1 H___________________________________________________________________________4 t, V+ L( i' f7 ]
* `9 u( ?3 @3 h- ?0 @
Method 041 \* Y7 w( L8 f6 Y* y2 L
=========; ~5 s8 S5 _2 e- E* ~
" A) w# Y6 b: N5 \6 P7 @- ^Method identical to the preceding one except that it seeks the ID of SoftICE
- o* ]5 G+ l+ B# j2 y0 ~# F jGFX VxD.' P& }& j3 n! B) k6 E
, ?& l) i1 H( K2 f' b' G
xor di,di
( D8 _, a. J7 H0 Y mov es,di
6 b7 b% v# I+ M# h+ A mov ax, 1684h 1 H2 [- }" _" }& `# w, _7 i
mov bx, 7a5Fh ; VxD ID of SIWVID
& \+ Y) {7 ~5 U. J int 2fh
* Y4 k% o( r* U" R% O' W: s; @ mov ax, es ; ES:DI -> VxD API entry point
4 _1 c3 @; J( e/ e add ax, di; b2 O# X% |4 [& [) V- G8 Q
test ax,ax
# y% ?9 z' c' M' r" H9 P# G jnz SoftICE_Detected
$ ?) S: F4 @) z7 S
# b( }2 ^+ x% k0 P, v" |__________________________________________________________________________" [, }% Z* t9 R! q. N) ~ e
; ], ?. A2 e" f( F# t$ u) U6 X- o( g+ F9 c* I
Method 05
* _6 X0 [- L3 e; g* L( `=========7 z9 G+ Y: l# S6 Y/ v' Z( x
- s/ W# i; _4 `/ } Y9 F$ hMethod seeking the 'magic number' 0F386h returned (in ax) by all system. y6 t: K6 }! f; w7 L6 C* n( i
debugger. It calls the int 41h, function 4Fh.2 V( I. B$ ]0 s4 d
There are several alternatives. ! ]3 T ?6 l5 }! L2 X) q% G j
4 A4 O0 H* c* B9 G3 o$ d
The following one is the simplest:
5 U. [$ R( a2 ^% }" A# I) s
, r' K3 @. M6 ~- t. k& L& ^ mov ax,4fh
& Y& j7 I9 \' U9 N3 ] int 41h7 j; `2 P2 x2 G b5 G* l# l
cmp ax, 0F3861 m* D' K+ I, i" y- p3 }
jz SoftICE_detected' r7 d! f& s. f
, W" e8 g+ j7 I& L, Z1 U
; ]: _& F# X# K: c( m( g- oNext method as well as the following one are 2 examples from Stone's 4 o5 r9 ]0 t6 h7 A9 q h
"stn-wid.zip" (www.cracking.net):
0 |9 e# l( A" J! a* D+ P
. E/ d' E- _ X mov bx, cs. v% u, I, b0 v6 ^0 B! d
lea dx, int41handler2+ c8 n! s( M. ?
xchg dx, es:[41h*4]! Q0 O# O: O2 a8 \
xchg bx, es:[41h*4+2]
& s% d3 Y: U' J) A" c* f mov ax,4fh# H6 d O+ N* }* k6 L
int 41h+ h0 \8 x/ F- i. m7 z
xchg dx, es:[41h*4], f& _' `! O8 l7 {# v
xchg bx, es:[41h*4+2]" K* ~ F1 B1 D# e+ ?8 t
cmp ax, 0f386h0 F" u( p3 R# q
jz SoftICE_detected% ?6 G; K" E* F6 r
/ _4 L$ W, ` F" K! w( m. lint41handler2 PROC
: u: c4 f# P& f- R6 Z iret( T8 u$ R! z2 f# I! T3 G( [5 Z
int41handler2 ENDP
4 K# Z" A2 B8 k; h6 b
+ i2 R5 q; z3 Y* `7 R
( |) H0 w0 u/ G$ D3 E4 g_________________________________________________________________________
& O9 m" K$ K! a: C6 q X# l; m3 p, c C$ q% C2 s0 ?$ @$ L2 F
P6 j3 F: {- n4 G2 {! GMethod 06
' r7 t g- [ x; _=========
, k: c' T; V6 |6 l$ J" t& y3 V
* x" n; v: I5 t! I. ^: P. P, n
! f1 p! F( ^) ?3 C- A1 v2nd method similar to the preceding one but more difficult to detect:
& K% c4 K/ Y5 k! d
, M6 x) n; ^/ s4 A; ~; L; z
7 {" A2 Z9 A8 P) {" dint41handler PROC. g* M& g$ B7 {9 c3 N
mov cl,al! B# r. x6 h. b8 R% P
iret
; ]; \! B( l2 w5 y6 S9 H) _* Xint41handler ENDP) G6 T( E& h N" c
: }9 `% V& v K5 w1 Z5 M
, u# a* H4 s# P0 G xor ax,ax
0 e5 `! Z/ l2 h5 V. j* f& ^' W5 O! { mov es,ax1 ~3 Q/ t, L8 U# M1 q, A* J
mov bx, cs0 l+ T, J! \* `# F& q# h+ B
lea dx, int41handler3 g3 J c/ y" x# L# `
xchg dx, es:[41h*4]9 c+ B' U( v& @( Y( O
xchg bx, es:[41h*4+2]
z/ l& y- d( d in al, 40h
: \: D4 P- `5 O xor cx,cx
5 j. m i2 i2 C4 _3 ^ int 41h3 i- O) @! l5 i1 |
xchg dx, es:[41h*4]
) Q+ i& @. ^' H4 ^! ^8 S( ? xchg bx, es:[41h*4+2]+ h& q: \2 |- v: m- X* X
cmp cl,al
5 A- H% i3 N* b' A jnz SoftICE_detected+ Z2 n- ]& V! Y. _
1 o) z- s9 D! T) v* _: I( T$ d. d; c_________________________________________________________________________
; u. w% O) Y4 d% B0 h9 F/ R( d R( Z" ?( {
Method 07
0 R# T/ n; D: |' Q" X- e4 o( u1 A: N=========4 ^5 R1 o5 U# P; {8 r8 V
& _" ~: q# {/ R; s
Method of detection of the WinICE handler in the int68h (V86)
' ~1 x, L/ E% s# ?# f; {
0 O. L+ D" m U! n. [3 c" w; ? mov ah,43h3 l; P5 I- a3 `# F. a
int 68h. i5 f5 p$ j7 D# t" c5 e; T& d! o
cmp ax,0F386h/ w2 H# k' x4 l: n& o
jz SoftICE_Detected
; L7 Y! N( N! p' u# ^2 d! r+ w8 |, `" u/ R, }
, j, F* S3 [9 Y( O
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" G% J2 V1 ?1 c* b app like this:( o+ H* {' o j2 R9 c1 p& a) c$ R
* S: [7 {3 ^# U# s BPX exec_int if ax==68; w& y* @2 f, B
(function called is located at byte ptr [ebp+1Dh] and client eip is/ W6 u; Q8 c* G4 t: C& e7 C
located at [ebp+48h] for 32Bit apps); J) O; w! J- H8 ^
__________________________________________________________________________
; ~1 x' G- s( } h/ A2 h- y+ o1 }' h& l0 k& v# U
2 F8 b& C& v2 YMethod 08
. c. {/ K# Y% j=========
/ t4 v9 A$ \$ I$ } c4 s/ L7 t( S6 l' [: E2 F, ^
It is not a method of detection of SoftICE but a possibility to crash the3 B6 c1 z) }- N0 I+ K
system by intercepting int 01h and int 03h and redirecting them to another
- V' ~7 p& k/ t. Q1 mroutine.
5 e( p1 L& \$ W! }% M; VIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) o' ]- Y6 Z" ^1 r ?( E
to the new routine to execute (hangs computer...)
l( L ?6 t: O! r
6 ~# ~) Z( s+ _( Z mov ah, 25h: x& U9 s' r, R3 ]
mov al, Int_Number (01h or 03h)
4 |6 c% _& Y- ?: x6 V6 q mov dx, offset New_Int_Routine
1 n n) G7 f8 l3 B& {3 g9 k int 21h
% y; E' z# ]0 d Z" W$ \1 J
% `2 c& [& V* Z3 l$ h. G: X__________________________________________________________________________8 b9 M {6 P1 Q$ [* R- G
: S) }. E; R- U3 h1 A# [" nMethod 092 r. B, ?6 T. V, R, Z
=========
r! \2 d* O3 g
) y4 L1 q* G/ J0 ]( j nThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only q2 d7 Q& l' c3 n; G
performed in ring0 (VxD or a ring3 app using the VxdCall).* v# K+ j# W" f- Q) f+ [ V
The Get_DDB service is used to determine whether or not a VxD is installed
g$ K' D/ o7 {for the specified device and returns a Device Description Block (in ecx) for
+ Z. o8 ?7 E8 Y7 ]that device if it is installed.
3 n& a( t9 }4 [+ W' m
* w: [* a. U& e2 Q mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: A! `- u/ @" e3 ~ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- X; A, E7 W" J& E- o VMMCall Get_DDB
9 d4 K2 U) p8 d mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed7 m0 ? N9 I! | [$ t9 @% @! p
+ J [2 }& E, m2 ^5 r
Note as well that you can easily detect this method with SoftICE:: G0 i( |& J8 k3 M! Q: W" ]. \
bpx Get_DDB if ax==0202 || ax==7a5fh1 A5 c2 G Q( F( i: j2 I
6 U6 e, n$ ]' p8 Y6 q2 B0 e__________________________________________________________________________
8 u7 @. h( L! p
& _ A: x: o* s& O6 M. ^1 \1 WMethod 10! J6 R; D% g+ ]
=========
6 z. l4 X* u( ?5 j* T! G
. o) } f2 f0 T+ P! B" I. X5 {' x=>Disable or clear breakpoints before using this feature. DO NOT trace with" G( x+ R: e$ z
SoftICE while the option is enable!!9 Q2 P l( Y8 k, P$ { x- n
5 R1 B. v; f* Z+ I4 E pThis trick is very efficient:
' R. ^& L& Y! V( Y: I6 D! Dby checking the Debug Registers, you can detect if SoftICE is loaded
( F7 m- v1 A# F; Q# W |$ q(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 k6 }" O q, D. C! othere are some memory breakpoints set (dr0 to dr3) simply by reading their
! U" U2 B! Q# S& d5 w/ X7 Dvalue (in ring0 only). Values can be manipulated and or changed as well! P. F8 q8 J3 ^7 A! _) c5 ^- S
(clearing BPMs for instance)* a7 r; M- I- m) T5 n) f2 x& F
% |. O9 S8 a* N" Z
__________________________________________________________________________- x4 K/ ?( l# h5 X2 [
. y" Q5 {3 q2 g' d1 E
Method 119 Y- {. K! i+ a4 O) X, u
=========
1 W, f$ j' |% o$ x: r6 |; m" {' V/ c$ S8 _
This method is most known as 'MeltICE' because it has been freely distributed5 R7 Q' ^6 j0 N* L! `0 z, t
via www.winfiles.com. However it was first used by NuMega people to allow
: c5 T$ N; k/ sSymbol Loader to check if SoftICE was active or not (the code is located
2 U! ?& h& x6 ^- Cinside nmtrans.dll).
# b( c4 _3 {" ^6 I4 j$ \) d; L4 v. N" w
The way it works is very simple:1 Z/ o4 V- c9 F! T- S+ }2 F
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 S8 I4 b- S7 `( o+ _( m
WinNT) with the CreateFileA API.& _. M E |+ U1 p# s
# j5 t7 Y3 Z2 K. D: y6 F+ h1 Y1 y
Here is a sample (checking for 'SICE'):' |3 v3 f; ?" @6 ^6 U+ a1 k
+ A z" J6 I/ ~3 h3 b% ~
BOOL IsSoftIce95Loaded()
& Y5 n+ ? B2 e/ h* n( M) [{
$ a! n6 e& y) {0 s% g# k- N HANDLE hFile;
2 |6 R0 R& ?' S) E4 _ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ c' Z+ ~! k/ v
FILE_SHARE_READ | FILE_SHARE_WRITE,
, @: E- s' L8 |$ |* i NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
a! P1 F4 [$ G- j8 A& K if( hFile != INVALID_HANDLE_VALUE )
3 E2 Z# R* Z; u/ y4 a {. p+ l* O4 i7 i
CloseHandle(hFile);& w/ ~+ h& `8 T8 I L; W
return TRUE;2 B1 f. }' f7 c7 r0 r w( W k+ l
}
9 m2 \/ E- C4 ^. Q( G! J) r return FALSE;+ u. Z- v7 M4 w. q% ]
}$ N; Z& n1 _7 g
- k% m# h {3 s" g: m( [Although this trick calls the CreateFileA function, don't even expect to be
# Z$ J" L3 M% D6 r7 Xable to intercept it by installing a IFS hook: it will not work, no way!
) e: ~( n: M, V; h6 C6 I. bIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) z+ \7 N0 D( O$ A# Q9 @- j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; p' c2 t+ X0 _and then browse the DDB list until it find the VxD and its DDB_Control_Proc: I/ R, n9 h, f' b, K* A
field.
% Z- R- s8 }0 k: a3 c0 F0 PIn fact, its purpose is not to load/unload VxDs but only to send a ' x) ?7 i. ?% ?* ?6 R
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
5 ]" h3 |3 W* V5 Q4 Z! ^- Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ C5 l) [, D7 W& `: s- |to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ w L h% Q# N+ [" M1 a9 f E) ?7 NIf the VxD is loaded, it will always clear eax and the Carry flag to allow: S( T; o$ \( A0 h: N$ m: @! m! |2 F
its handle to be opened and then, will be detected.
+ p5 m2 D* x" o7 v3 W4 xYou can check that simply by hooking Winice.exe control proc entry point
2 C8 j/ v7 L8 \: C$ _% _while running MeltICE.
) _3 n0 }9 v f0 `& e s
- q6 `2 h% I& W/ g
) c" @1 a2 r/ m3 r. w% b 00401067: push 00402025 ; \\.\SICE$ i: X8 |! `( j" n& x' p5 w
0040106C: call CreateFileA7 x' T; x$ D0 F& g! ~
00401071: cmp eax,-001, J( T% C" n+ R& ]" k1 q& F
00401074: je 00401091
$ Z N# ^3 h5 c! w1 Q2 s0 o' H- Q& `2 A
# [. n0 V$ V) d5 c: V
There could be hundreds of BPX you could use to detect this trick.: P8 r) \/ L. `/ a
-The most classical one is:, w" R5 x q8 `, G4 N6 d
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
. g4 i( Z) j- i" _2 W: l *(esp->4+4)=='NTIC'
7 U" W& f: V7 i0 [7 D9 r. k- C5 F* h7 O* V9 C
-The most exotic ones (could be very slooooow :-(- m0 _! u# X% I6 r7 z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- |' |9 P( T4 B) J- W! V& z7 ` ;will break 3 times :-(! S' j7 ?) ^: z% H
Y+ w0 ^% [/ M4 ^0 v% X-or (a bit) faster:
( L j/ h7 G! h' ~; `3 w BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; o0 Q8 B& q$ E9 x( e/ e3 F- `4 c( @/ M! m6 [
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 V+ }$ a0 o8 |0 v N4 _$ M) ~
;will break 3 times :-(
5 u3 j" \6 y( M Z2 \( J
0 K' K7 o5 n ^7 `5 h-Much faster:
% c9 V: o2 G/ p9 y/ u. a4 ^ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 ~" E2 B4 C7 T7 u5 E q) |4 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen L" r0 z) P4 v
function to do the same job:
1 N; _7 F% l9 o/ ~2 \: G" C! _, x/ O3 T% l# c7 o+ g( z7 x1 E6 j7 T
push 00 ; OF_READ
" H# {& ^: l* q; }# r mov eax,[00656634] ; '\\.\SICE',0/ z& x" z4 L. S+ n; Z" |
push eax, K k) n' z& { y
call KERNEL32!_lopen
# y9 X, Y& o* ~# |: z! s- w- A inc eax, X; y" G; l/ N' n2 z
jnz 00650589 ; detected' k7 M8 u4 G" o' [: o
push 00 ; OF_READ4 D$ r) w2 S6 f) J- U# N% v
mov eax,[00656638] ; '\\.\SICE'
: E: ~+ t$ G2 A9 c: b' L& e/ t push eax1 p; ?& |/ B0 K8 D! z0 r+ U2 R
call KERNEL32!_lopen
9 p Q: W, |; l* s1 s& o% v; S( r inc eax9 t+ H( u9 O' c* \$ [0 r$ u5 v
jz 006505ae ; not detected4 N) c9 j7 ?* }8 h1 F% A6 V5 u
1 |/ ^' A) n' s: ` X
2 }, o) J6 o' N) o# t7 M, [. Q
__________________________________________________________________________
# w+ ]1 W; n/ @) ]" V" y) k( N# H( l- f) o
Method 12
2 ~& T, A" m8 w3 J& Q4 b=========
) m; _# r- ~0 U2 ?! i6 r; r: R" S/ A2 e
This trick is similar to int41h/4fh Debugger installation check (code 05
6 ?; q9 [$ P6 a% K8 B& 06) but very limited because it's only available for Win95/98 (not NT)
4 Z& f6 N# V" S: U! T) Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.% N. A% k) e( z( @4 g o
5 L$ T: N# P1 @7 L, h W: {
push 0000004fh ; function 4fh
8 F8 u. ~; u u8 i! h( K0 j push 002a002ah ; high word specifies which VxD (VWIN32), P( ^# ^# G) m$ ?5 o" ?8 g
; low word specifies which service% n3 y+ S7 z7 h' h, x" W ^3 e1 u
(VWIN32_Int41Dispatch)
$ [5 ?3 P' q$ q! Y7 B call Kernel32!ORD_001 ; VxdCall8 D1 ^* P! B( ^( g2 P
cmp ax, 0f386h ; magic number returned by system debuggers! Q' P4 @9 W+ M A$ m1 U
jz SoftICE_detected# u9 b. @' M0 P; V, Q" P1 N. R
; |- z3 x2 v' b, R0 s( X! A5 U" QHere again, several ways to detect it:
4 I z* \1 E( q- o
' o" _+ L) ~/ M2 ?# n' Q BPINT 41 if ax==4f, f: h) L: `: P( b5 ^8 r8 E
: j' \ d0 S `9 Z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
5 H! D+ N9 w& m, D- e6 g' f; x4 t! F2 m( _
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 J5 s5 V# ]) @3 x* R2 G% t
. c1 T8 _, Z# I4 K3 v0 R8 I
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. b3 A& E f& q, a
; |* S3 ?5 P5 H, h
__________________________________________________________________________4 K- F% P3 V h5 y/ a. _" Z) X
8 j8 R1 J8 h/ |% c) |
Method 13
# G0 g% k- k m1 g=========
5 L M# _ C; n9 E
& s; R& E2 [6 y# \( [: jNot a real method of detection, but a good way to know if SoftICE is+ f& Y3 o- F2 P! d9 C
installed on a computer and to locate its installation directory.
# n2 y4 p9 J1 O1 oIt is used by few softs which access the following registry keys (usually #2) :# {- h( `, b+ P) C
; {, u9 ^$ a0 d' F-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ R' E1 I4 ?# ~; s
\Uninstall\SoftICE( K" h7 T- y# ] Y0 k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' V: I* ?" _9 L. s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( p: [" Z5 r) W
\App Paths\Loader32.Exe3 V" \- n1 [; Q2 m" X
1 M y! Y0 n* ]& Q. U, W
" |$ E' j4 z* k- x* WNote that some nasty apps could then erase all files from SoftICE directory
h$ `: X, @8 x0 L3 A7 I* @(I faced that once :-(3 W# y/ P/ G6 X8 _2 ?
9 m) N [( a! F" F
Useful breakpoint to detect it:/ a. T4 S n; S
. J# H) H5 l8 v' H9 h7 |7 }1 I5 Q( F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' R; A7 j3 h( S( m( h
- H0 G P& H, x: ~__________________________________________________________________________
/ s3 u3 W. F! j" z8 X' t" ~8 N2 O
7 ^8 g# K/ _7 z8 l1 C6 c
7 t& v5 Y+ x! N$ _$ @Method 14
; A; y% o. X/ E) P& V8 q ~/ v0 p=========/ \* T9 Y4 B; N! Z% F0 J
. i% J3 z1 X: Y' N7 V7 uA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 ~% i0 V- t% O4 U; }is to determines whether a debugger is running on your system (ring0 only).
2 j% l$ [0 m3 L. B4 x" P7 e. X2 H# ?- w" T
VMMCall Test_Debug_Installed
( g+ ^' g; w$ U' ?- A0 E# [ je not_installed
0 Y3 T- c0 f5 J/ B) T
# R) _. j4 `, p: w$ iThis service just checks a flag.
7 y0 f4 |8 @) g</PRE></TD></TR></TBODY></TABLE> |