<TABLE width=500> }; m- e% J$ _
<TBODY>% u3 n9 u0 U' M7 A0 b
<TR>
% v" R( ?* V8 d) i* N<TD><PRE>Method 01
_$ _' U7 n8 @=========, f4 p6 j# o5 J$ C6 f: o; q1 f
7 a T, N6 s5 [6 K1 t5 e2 x
This method of detection of SoftICE (as well as the following one) is# n, X2 S# e, p
used by the majority of packers/encryptors found on Internet.% b8 o* R. c5 ^- c1 C3 Z
It seeks the signature of BoundsChecker in SoftICE
+ R7 E* f2 e" p2 a! @% }) l" x8 o+ B" O# C) T4 M; q
mov ebp, 04243484Bh ; 'BCHK': i! o4 m7 ~( q% J* R
mov ax, 04h
: H$ x4 ]$ T( L7 E# ` int 3 ! G) f( X* Z% T! t/ l1 U# M
cmp al,4, N, T( c$ C& w% J3 ? j
jnz SoftICE_Detected! o% L1 q. E- E# W
& r" {. V; P6 B, K0 G2 D5 u- a3 x
___________________________________________________________________________0 F# H- l. M9 B; F2 z
' B: ^6 @- U0 D4 S8 W1 RMethod 02
3 V1 ~3 q1 e4 ^" ^=========- y% w% p6 n1 o( \/ O8 \
5 |& T1 V8 V# s1 YStill a method very much used (perhaps the most frequent one). It is used4 ]% s0 V2 \6 S+ {! [
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, ^& ~7 J4 d# b& K7 z2 @2 m9 E/ i- \or execute SoftICE commands..." K$ A' q7 o* _ l; ~, p) \
It is also used to crash SoftICE and to force it to execute any commands" v" T% Z7 R8 e; X8 L
(HBOOT...) :-((
# C7 n3 x5 ?6 d& g
$ {# }6 m4 w0 w9 G% @& H: O* ]Here is a quick description:6 Q5 a6 S6 j# l. H
-AX = 0910h (Display string in SIce windows)) V$ f) |& y7 S" u# D& Y! L7 Q- m
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 x G4 t' i% W l' e-AX = 0912h (Get breakpoint infos)
% O$ x ~& e% S4 u( B4 K+ I1 m-AX = 0913h (Set Sice breakpoints)
" ^8 ]' r$ l& o/ y9 S Y# y% A* c-AX = 0914h (Remove SIce breakoints)/ p7 R- F5 x0 D! v: S& Z9 R3 ]6 _
4 t, U' O* Y5 U
Each time you'll meet this trick, you'll see:
6 C+ @" e7 \3 `5 g8 i) @! G1 ~! n-SI = 4647h* \: J5 T4 R0 Q+ d( }8 q. j
-DI = 4A4Dh
9 f" k& W i) [+ |" U( Q' TWhich are the 'magic values' used by SoftIce.( D1 T6 j D' l x3 c, X* {
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& f' G# W8 U% ]5 G( D
; U; D/ E. G# }; I% e% c
Here is one example from the file "Haspinst.exe" which is the dongle HASP
) n, e3 V. Z5 c$ K% I$ q, OEnvelope utility use to protect DOS applications:
, C7 N1 x( B* X
! f K0 u: ?* l1 i2 {9 l; g3 d( X* I- [
1 ~8 h# T: C! Z$ C. G5 b7 P; i4C19:0095 MOV AX,0911 ; execute command.
7 Q' o' E) f! s' x! K, V4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 E7 ]; F+ e) m2 J# M4C19:009A MOV SI,4647 ; 1st magic value.2 G- V8 n' _! E( ^
4C19:009D MOV DI,4A4D ; 2nd magic value.
# _4 P3 b) p& e- ]4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 a9 k2 _2 z9 x
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ |$ f# t/ B3 ?( ^) o9 q
4C19:00A4 INC CX! J8 k5 S, }# l% u& y5 b7 w0 Y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" h- O7 }, t& Y# `$ Y4C19:00A8 JB 0095 ; 6 different commands.
) w. z; {) b x! ~9 H" [4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 `1 X; j. G9 u8 i0 x
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)8 `% D8 r9 i$ O
% O% ~6 T" \. F: P( e5 |1 [* AThe program will execute 6 different SIce commands located at ds:dx, which: U$ {! t1 E8 J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( q. J, }$ q: _) I1 P1 A E
9 ]. C& ?5 g- ?+ ?$ u6 n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; Z7 ~3 w* N" @- c! X) W. F# h+ d3 a* s
___________________________________________________________________________9 ]3 D* Y# ^, M
# ^1 Z8 T8 x* N" h$ i
: f) N3 @$ l$ ^0 ^/ ~# G: HMethod 03# V9 P1 l" H; d! r- g
=========
, }5 R* Y" `6 W! O! x; x# q% V( W! y; ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- H L% L+ q: i, _* X' w$ u1 \
(API Get entry point)
% Z, o& Q8 _) d
& A4 k% y; C4 J# o) T
1 Z$ Q# X$ H4 ^/ x" Z xor di,di4 D) q: d1 k7 L, r4 d
mov es,di
, t0 u* `- e; o mov ax, 1684h & s1 h- \: P1 g7 m7 H
mov bx, 0202h ; VxD ID of winice! `3 {. r1 e8 ~0 a# i" ?% q
int 2Fh
; s% i/ Q$ A7 U. C mov ax, es ; ES:DI -> VxD API entry point
" h2 B# k! m+ o3 ?0 m# h add ax, di
& u! }8 n- u3 C' K test ax,ax* e1 ]6 H [0 W3 _
jnz SoftICE_Detected
+ R) {8 q. }' U2 w# y. ?: j$ ~% y/ _
___________________________________________________________________________4 s' f8 M# l* m
5 c( v# R& W3 h: V- w9 M, ~
Method 04
) f# n7 R$ r& u) l$ p" x- _' e=========
+ R- {1 {( s' n3 G$ I: p& f5 o! G2 n. H: |
Method identical to the preceding one except that it seeks the ID of SoftICE6 j6 v! c+ L- L
GFX VxD.
, D) R' n+ V- S5 \5 N: H- n {! m S+ p
xor di,di) P! x% O- w2 a
mov es,di
- g' l" w# ]0 a4 b7 t mov ax, 1684h
+ b, e5 t# J0 e8 e! p& U+ ]. Z7 s mov bx, 7a5Fh ; VxD ID of SIWVID; ]. P h) ?; \6 h* ` g5 h$ u1 C
int 2fh
1 E* j) M) k0 ?5 a+ t0 t0 m# q mov ax, es ; ES:DI -> VxD API entry point, S; J, B9 x5 I+ W T& r
add ax, di
. K( K1 [7 W0 h6 l. W4 d) h' q$ p" ~ test ax,ax$ U' Q: `) M0 p6 |/ {! J
jnz SoftICE_Detected
# d' s# l T3 @) r4 j2 o5 p, \) ]- r$ v% j& o0 Z3 ]
__________________________________________________________________________
3 F: b9 e. H3 c" x+ v8 g: ?
/ G+ n8 c) S# x" r4 k: ?8 W3 E
! A, A1 P! [* v( I! dMethod 05
" H" R/ U' f3 c# f=========7 x1 R1 y; M0 s1 E
: h1 k7 O8 y2 t) f. [
Method seeking the 'magic number' 0F386h returned (in ax) by all system$ M/ g# ^2 K! p+ [5 H' m4 ]
debugger. It calls the int 41h, function 4Fh.
$ A4 l1 r" K# i$ f$ t( h% `2 zThere are several alternatives.
" S! f) J1 c) L' i
3 P& `) s$ A' p" r5 L7 R" _+ DThe following one is the simplest:9 ~- ]$ `$ [) n* D8 ?
# C% H/ z1 j+ C/ N" C4 j- ` [ mov ax,4fh
+ ^$ `% [! X$ W# \ int 41h
+ ^0 j8 ^- A6 Q' K% x+ u/ D cmp ax, 0F386/ @! M9 [6 X" D0 d& i
jz SoftICE_detected
" E' j% ^% n* d7 ?# H- A
- F$ q- D4 F+ ]% ]1 x$ \: M$ x; e7 E" d4 o
Next method as well as the following one are 2 examples from Stone's
/ _0 [) q" K: m5 z( o7 x"stn-wid.zip" (www.cracking.net):
2 I2 g+ H; H) k- o; `
! L$ Z) R+ a# b' T4 y$ y mov bx, cs
' e8 U; c2 q" E lea dx, int41handler20 j6 E1 q- `- J6 a
xchg dx, es:[41h*4]
" ~5 e! n- d" m" t) J! k# W0 m xchg bx, es:[41h*4+2]7 D0 v" }; S$ r( o6 _
mov ax,4fh
+ L0 T4 M6 u8 {" l2 u% t, E0 M$ F& E int 41h
# B" S0 C5 S2 V N xchg dx, es:[41h*4]
$ w$ L. C/ u$ y; j2 d xchg bx, es:[41h*4+2]
1 _' j5 X# z, T1 S1 e5 _ cmp ax, 0f386h9 @* g8 ]+ n* w
jz SoftICE_detected0 K- \! h2 ? }7 ^0 N
$ M& |, P% J- W9 iint41handler2 PROC
. P# E1 g% s# y2 Y% ? iret. l+ W6 U, I9 Q' }
int41handler2 ENDP
- y" P8 R' f7 X) n! o, f b3 C, W' u; f3 E7 o
& M% |% n1 s- |* m) x_________________________________________________________________________
8 J4 M" E' |& d, ?; @ V! d
- F# f/ b+ U! j6 g9 h% a' E; u6 _% ?! @: ~) z p' P$ o
Method 068 J- f; U5 H! H1 }5 t
=========1 u' @. Y: t( ^% J+ C/ h6 ^
. C/ y8 s8 g4 x# F2 U, [' C8 R! g
2nd method similar to the preceding one but more difficult to detect:7 t6 B" y2 v$ P+ K! K
4 v7 s8 `' j3 s. o: x/ O" r- k1 s0 c# ]# d3 \! l, _
int41handler PROC2 @: B4 R$ c" x0 }
mov cl,al
; B2 y$ j7 ^, _6 G) u iret
9 K! P. v8 }, r9 _& wint41handler ENDP
1 l) Q+ h1 X( X/ m2 ^
( d7 X. j/ G3 v5 Q8 d" c. X+ \$ x- D( m6 A5 U, H
xor ax,ax5 o8 `7 R6 S6 U# i; _4 F
mov es,ax
0 ?7 v2 b, L' k* b6 x. |( Q+ t mov bx, cs
0 f* s; L( L8 J6 W( v5 }$ L) C5 m lea dx, int41handler
2 F$ @/ B! [+ F) j" ^& |9 M) T xchg dx, es:[41h*4]0 L0 b+ d5 }* Z5 w
xchg bx, es:[41h*4+2]
3 o& `% d2 r( N/ F, \ in al, 40h4 a. d3 Q$ G- B% `. m) d
xor cx,cx* R# {; M- y c. V8 z% z
int 41h
( h1 x" d5 m; \+ g) y xchg dx, es:[41h*4]% h% u# T# ]+ F- u0 y8 `
xchg bx, es:[41h*4+2]' W9 m! M6 X! E+ z
cmp cl,al
4 V r9 B$ K7 A+ d$ `) L5 ]$ f2 { jnz SoftICE_detected& M5 f' ]9 |9 Y# _- {5 H
& ]" Y8 g) k; p
_________________________________________________________________________& l0 i% v8 q! P! g4 R5 |0 Y
% Q9 v1 b- b D1 VMethod 078 ~/ o. @( w5 U
=========0 D$ ]) \. \- }2 d. ~
$ |. \: ^% _. E9 i5 h
Method of detection of the WinICE handler in the int68h (V86)8 w5 E2 P' Y* c" Q+ n! x/ ?& l. H0 V
. y0 ]) [6 N# ?: i6 R; A
mov ah,43h
' h; E9 a4 E2 F int 68h
8 V1 M! z$ A1 t4 F cmp ax,0F386h
3 E% f$ [5 l; G jz SoftICE_Detected4 u# P6 O. V: g) x/ i2 z
5 m- L0 Z1 M9 d2 E
+ g( I5 ^- p$ p* M+ ^% V/ j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. v6 Y+ L) l$ l5 C- B
app like this:
% J( g1 t6 [( d6 O2 N1 f% H8 m
4 t# X* d. f2 m* ^" h BPX exec_int if ax==68) }1 w a! ]9 B8 x. o6 h# a
(function called is located at byte ptr [ebp+1Dh] and client eip is% c1 p9 e9 T6 q8 u4 K# t4 D
located at [ebp+48h] for 32Bit apps): K, p6 d' A7 A
__________________________________________________________________________4 a0 s, d* S: W: b" b$ ^ f
x5 p* {" Q! p% v6 j6 c# W7 }
, g! Z; \* S% DMethod 08
. l2 ^5 G; Y7 l8 `=========4 u! a p6 a' \# g! j1 d
& e* o, @% M5 K8 X n1 }9 ?It is not a method of detection of SoftICE but a possibility to crash the
/ n6 S: v* [7 b8 K4 D! k0 `system by intercepting int 01h and int 03h and redirecting them to another
. w: W* u( A; t% a9 Proutine. ?& c: C+ j/ G$ h; U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! z, o. S8 Q; c, V' g+ Vto the new routine to execute (hangs computer...)6 z, x: W/ w, R' V( n
1 I% O% `; E) Z7 [0 C6 |, d mov ah, 25h
/ t! S7 c; `. D mov al, Int_Number (01h or 03h)
$ ]9 r4 s- ~' w( f; a mov dx, offset New_Int_Routine5 y5 \0 U& @2 {5 {3 _- W
int 21h5 x# D# E/ D/ k+ J+ r. e
8 o% K/ d( g0 h* k, D& L/ B__________________________________________________________________________8 [' _$ ?7 u6 S( ~5 L8 O
; a$ A. r% g! |; R1 iMethod 09
$ [7 o( a/ h+ }=========
$ ^3 b( |) i1 b
" S8 w& ^% e/ q. c8 FThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only R, J. U8 O0 ]% e# Y3 V; Y$ K
performed in ring0 (VxD or a ring3 app using the VxdCall).) u4 L" X5 f2 T/ G
The Get_DDB service is used to determine whether or not a VxD is installed4 N }7 B. w* @0 k5 x1 H
for the specified device and returns a Device Description Block (in ecx) for4 t* }, p" D; x; p
that device if it is installed.
; c3 Z% B. Y+ [2 _+ v7 c8 K
0 q" v' L/ c* f" I/ H, {1 k mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID- n0 v: _" L) U* w: Z# h( @: D' _' ^
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 ]( C4 }( }) V2 l! u. P$ q0 Y
VMMCall Get_DDB0 X2 \: U" z1 D5 w) m0 J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
& N) d$ [1 T8 }+ U! H& k
0 K7 g3 x6 X; F( ]6 a4 ^Note as well that you can easily detect this method with SoftICE:2 H" [+ o* v1 D4 y" H% V! U+ c$ u
bpx Get_DDB if ax==0202 || ax==7a5fh3 ]! P6 w, [3 p
( k/ h$ F8 K3 k4 Y# U* n ]
__________________________________________________________________________
1 f7 h4 i+ w) B2 g* L+ t0 T( q: p, o8 q0 U5 f
Method 10
/ E" x, h0 h* I$ c=========* l7 E. U$ E% c8 m
_* f% k; j, _1 q3 a0 U7 `=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ I5 ], [; C* C- }3 ~( l SoftICE while the option is enable!!" [! V/ v9 A4 ~) U! Y7 `' |' J% G7 O: a
# r) u" |) H5 \This trick is very efficient:/ P* k2 b3 P. l) N) |8 I1 ^
by checking the Debug Registers, you can detect if SoftICE is loaded
: A5 b0 ]' M. Q# ](dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! l+ H( x, |& o+ f2 w' E9 k
there are some memory breakpoints set (dr0 to dr3) simply by reading their+ ^* t& Z. D$ [1 q+ ^
value (in ring0 only). Values can be manipulated and or changed as well, k3 ]+ H+ @" Z3 k0 g) R2 S
(clearing BPMs for instance), u& o m7 r- J; k0 k+ I
7 H* J" X1 A N3 a' ^
__________________________________________________________________________
! \% K, H. W# f0 a; d$ V( [$ s; P( C: Y
Method 11& W+ I$ X9 e. |8 U! E0 B6 [
=========
5 Z" g% q, x) ^- e% S* o1 S- a' x- Q' {2 J7 F$ M
This method is most known as 'MeltICE' because it has been freely distributed
; }# `$ B0 }! {4 fvia www.winfiles.com. However it was first used by NuMega people to allow* A" o4 [/ a* E
Symbol Loader to check if SoftICE was active or not (the code is located
# k0 N2 [, U J* Linside nmtrans.dll).0 O `' D5 i& v/ D; A
- B; h4 `3 g* \; z9 ^+ Q
The way it works is very simple:9 F5 B8 r' o9 T# w9 [: B
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 O4 Q% E3 j$ {WinNT) with the CreateFileA API. k# k6 V: e5 v9 i6 t' b2 ?# G
8 S* X [; l0 Z, T) g/ lHere is a sample (checking for 'SICE'):
. U9 E. l8 E, U6 j) f8 I: y
; z) I; n2 o- b' P/ VBOOL IsSoftIce95Loaded()+ J3 y0 o) t. c! W" E5 x$ P5 j
{
- q2 y. L# F+ V) [/ \ HANDLE hFile; 9 X5 [* c& i9 _- ~7 p- i
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 V: h6 s# m' l3 H FILE_SHARE_READ | FILE_SHARE_WRITE,0 \2 u# W) U( [" H$ w
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
7 Y1 G" ]% Y/ Z0 s. S: d7 ^ M if( hFile != INVALID_HANDLE_VALUE )7 E" W P; O+ u7 i. ^
{% d5 ]' Q1 {9 L- ~, m
CloseHandle(hFile);, {3 Y: J; i. A. n2 ^% s9 n& p
return TRUE;
3 g% E3 h) S. P) v2 L }
f5 |/ T% ^: w+ Q8 L; ] return FALSE;, A1 n& @* r$ s
}3 w% ]) a* i4 e0 f) V
2 x+ N T& P" a6 w+ k% c7 LAlthough this trick calls the CreateFileA function, don't even expect to be
8 i* ^6 O5 l; Qable to intercept it by installing a IFS hook: it will not work, no way!5 e" e4 v8 x- L( |1 }$ K
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ t* O/ @8 T3 I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
& Q' Z o, r2 L6 o: A; }and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 t$ q9 z' r3 D+ g% M: T8 L
field.
7 d9 j, [* U1 C! e* y' VIn fact, its purpose is not to load/unload VxDs but only to send a
$ J t! N6 b( h5 L- IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ g, i# _) Z( K3 mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
% L& `$ s8 ]% kto load/unload a non-dynamically loadable driver such as SoftICE ;-).: Y3 y/ v' a3 [' M
If the VxD is loaded, it will always clear eax and the Carry flag to allow! |: L8 b6 {8 e w
its handle to be opened and then, will be detected.7 v! \2 N' T% t3 V' H
You can check that simply by hooking Winice.exe control proc entry point8 ^4 n3 j) r: B
while running MeltICE.
* E7 v& q7 _! Q& v/ B+ \/ X2 A2 a( z# F8 @4 X% l5 g U
5 n" Y; x" |8 W) z) Y* M$ e2 k
00401067: push 00402025 ; \\.\SICE6 {0 X- T0 T0 C
0040106C: call CreateFileA
m: r/ K, O* D, q( D p 00401071: cmp eax,-001
, e; t& R- P, |' }8 ^/ b) u3 K 00401074: je 00401091) W* R5 Y- ]; s+ c' n+ w/ @/ {. ?
0 v$ S0 m' T4 r; j
. R1 F) _% L. m+ ?9 iThere could be hundreds of BPX you could use to detect this trick.0 Q* ?9 U- v4 H4 W; ~( x
-The most classical one is:
9 g2 ?0 |0 I6 G/ Y! p BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& |7 g. U5 n8 E; f) ~4 {- v *(esp->4+4)=='NTIC'* c' D5 a1 c+ i( F1 `
* l1 o) S; T& g- o-The most exotic ones (could be very slooooow :-(1 ~8 E3 j3 p" G& I6 V
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; K' y# }1 T$ c5 z" U4 a9 g# C3 Z
;will break 3 times :-(! ~4 B6 R' A/ D9 Z. @" j/ `$ k4 x
0 c- G" g4 t$ C2 N0 ^3 y1 Z
-or (a bit) faster: F3 x2 t# i$ Z, G- k2 d
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! X9 n3 D* x' y# g
/ @1 N1 |. p8 W9 A BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 R/ T& A! `$ B: E# J8 b7 Q7 P! g8 y
;will break 3 times :-(5 W+ U0 s9 D& R- N. u. R7 C
( ?4 l, {0 G; K3 l
-Much faster:
8 s/ D# P1 I8 N& M5 n3 \! t BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 m2 \2 I, [" w$ ^: L8 n
6 p1 K8 s8 d5 pNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 j9 y4 g0 V8 S% Q5 Gfunction to do the same job:1 A1 y' {5 Z. c) @* f2 M
+ |+ M6 c: {; D
push 00 ; OF_READ& \1 p4 ]- X4 B6 ?* g
mov eax,[00656634] ; '\\.\SICE',0
' ?2 P0 _8 \# T/ L push eax6 n# B( ^ S5 x9 `( R( s
call KERNEL32!_lopen. p9 D" }7 p" o, R5 H2 R% \
inc eax2 {! h7 J: E) u
jnz 00650589 ; detected
5 K7 G+ H5 ^; r; j+ Z* q* ]8 t push 00 ; OF_READ. S6 a3 ^$ ~6 j" |% X9 X
mov eax,[00656638] ; '\\.\SICE'
, _% C' T; J; e% _, ^* f+ e push eax
7 N6 ~( r. { }# \* S call KERNEL32!_lopen r1 E1 [6 s0 |; a8 h" H: q# S1 p$ q
inc eax9 r# b8 `' m: R- f, |8 ^ c' n
jz 006505ae ; not detected
( K V: Y# `8 [
" t! V& l, X7 X1 A* ?5 l! `
0 x- y8 G; x: R7 N- |+ n1 k__________________________________________________________________________
& }( K `) Q: c4 `7 M0 V) w8 f0 y0 D$ G' G0 u; v7 W) [
Method 12
4 |9 p3 q5 _# D1 }& \6 R=========
* x i- H n! ]5 D% L) w" s3 x" D" S/ e; a
This trick is similar to int41h/4fh Debugger installation check (code 056 z5 C- N6 N' ~0 T, X9 h$ O1 x
& 06) but very limited because it's only available for Win95/98 (not NT)- i8 r7 _+ d! M% n7 P6 D
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. @( e2 A, y- m6 W/ l
& A" l5 o: m, t# A3 }) u5 B push 0000004fh ; function 4fh
; {- z, h7 f Q0 K! a push 002a002ah ; high word specifies which VxD (VWIN32)
4 K6 n$ d/ U5 i/ m0 U9 ]* W1 H ; low word specifies which service; J$ ~ B( ^/ k) w' \
(VWIN32_Int41Dispatch)/ |8 [) n; \1 z0 |# F
call Kernel32!ORD_001 ; VxdCall
) i: [+ b. d" C; e4 F0 x/ L9 u- A' u% Z cmp ax, 0f386h ; magic number returned by system debuggers: E! F9 H$ M6 h/ _' V' }
jz SoftICE_detected+ n( ~" Z* q$ B+ b2 \) A6 d
+ s& {5 Q5 e. \8 t# ~; P- nHere again, several ways to detect it:) y9 P/ q, C3 k% n% d# o
. R8 }! X2 }" P, ^, E BPINT 41 if ax==4f
! }, a: ]2 [6 c/ d/ z6 c f) p* R' a; [
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one; y, w" r1 L3 b
/ {6 R( @- x) d# c6 G# T BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) J' m' z& }1 {* Q6 }6 k8 [% i. z' u# I7 u
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!5 g B1 C; g* n; l9 z6 C
! P, w, H+ H5 ^* G
__________________________________________________________________________
& ?' V$ {0 `, P5 v' b& ]9 j, p- O/ ~( j% I6 `
Method 13' ?6 u+ F% B& ~3 f9 v& u
=========! N1 ^5 v8 P5 W
; f( F5 g1 _+ V$ v/ HNot a real method of detection, but a good way to know if SoftICE is
6 ?" A, B: l) R% D1 H4 W- minstalled on a computer and to locate its installation directory.
, a& v) N% a) w- _+ K" e& [It is used by few softs which access the following registry keys (usually #2) :
$ r: B9 L0 @& N9 o9 \: Y, r% S
0 t; h9 F G& H3 v' _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( S$ _% ?: k7 T/ [ |; ^4 w, Q
\Uninstall\SoftICE" T) r* W* o2 J" z b; R
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" E3 Z3 Y1 Y# ~; v4 s/ j
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! v6 O7 o2 D8 C/ M\App Paths\Loader32.Exe
6 r2 _9 Z$ e' K! d; c2 j2 j
! M; `& d, N% B: l* s
; I. M( a7 A% i# L+ m2 dNote that some nasty apps could then erase all files from SoftICE directory
0 _7 c8 M* g# D9 _5 @0 \- ](I faced that once :-(9 D t. Q# J4 h5 {9 Z, X7 g9 c
8 G% ?, ~% N# [ |3 RUseful breakpoint to detect it:; m8 d$ B5 t3 e0 p/ ]
0 m3 e* E& ?# I9 X( p BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 F2 X Z/ C5 i% Y3 P$ |
3 Y& f1 [' \; P, W+ K# T
__________________________________________________________________________
7 x8 t; R! ^: H# r& b- I; r8 m: @9 s7 I g4 _2 r% ]
; q& N$ }2 n' J* e3 J. |, R8 ?
Method 14 " l) e5 l' S! I4 L" @) V7 d
=========5 Y" x5 @; M! \
( y$ B8 i: q. \$ t2 N( C. E' G6 MA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! J7 q* H1 X) T2 M$ a3 B$ his to determines whether a debugger is running on your system (ring0 only)., [# s5 B% e8 ]1 K
9 P# k3 \$ H4 u, W0 ]; h' X VMMCall Test_Debug_Installed
/ s5 t# N& k* C y+ _ je not_installed) F; `' d: M+ B9 i, I0 R3 [
# \3 R0 B3 B- V |
This service just checks a flag.
' |: h% R0 k. W P, K& e</PRE></TD></TR></TBODY></TABLE> |