<TABLE width=500>
( `( s5 \3 v7 v7 l* j4 K<TBODY>
$ L5 w* ?) E& |+ i* S<TR>0 f$ \5 m& ^ K9 F- }3 B
<TD><PRE>Method 01
, S$ D3 {) H$ Z! O/ A( F6 n ~1 q& N1 y=========. I: V9 M5 V, }0 a) z( t0 |0 V( U
% Y- z& E1 j6 N! R; O. i
This method of detection of SoftICE (as well as the following one) is, S t; i4 c2 ]1 _( F
used by the majority of packers/encryptors found on Internet.3 q0 G+ L' p% E
It seeks the signature of BoundsChecker in SoftICE
8 C0 A# E8 k, I) n2 s# W: ~4 |$ N1 j* W1 q1 W; Q, T5 ~
mov ebp, 04243484Bh ; 'BCHK'3 j- o; t3 T( z2 J
mov ax, 04h
4 c7 k, I) |3 u, w' v# q5 _ int 3 & b/ x! G- F9 q9 [
cmp al,44 x8 O) a" ~/ J4 e
jnz SoftICE_Detected
/ b! ]& t" j$ b: V/ n. X, i
& E( V- W6 @" X+ R___________________________________________________________________________- H; r, v0 Q! z) F3 m1 Q) e
- a3 t7 m! W+ {7 `; q" Z
Method 02
# J# B& u. e1 y3 s/ j=========9 G: D- m6 J6 [* @
S- u- H6 {, p/ ^0 b7 T' XStill a method very much used (perhaps the most frequent one). It is used" c4 t' {6 H1 U5 _' i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 S9 z( C Z5 N9 t. Z) G* K; Bor execute SoftICE commands...% l" O+ n) f1 O$ f$ l* l0 O
It is also used to crash SoftICE and to force it to execute any commands
7 K8 I. r) M5 T, W* {+ l2 {(HBOOT...) :-((
# |* h4 o" U9 |8 o
; H& o! z( k) P$ t8 F: C! l [- N% XHere is a quick description:
4 ~, a8 N' h& ]( q* a-AX = 0910h (Display string in SIce windows)
' Z8 u3 x9 R6 P6 L& X6 e/ b! U! M-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! [: U1 O4 x* d+ M. F* H; p( Z
-AX = 0912h (Get breakpoint infos)) U4 ?8 ^/ N3 g' l7 M
-AX = 0913h (Set Sice breakpoints)& F' r/ d+ V. @2 g( t
-AX = 0914h (Remove SIce breakoints)! K: N6 W0 O% j) y$ V. j7 s
3 C7 b, e# o- i6 I. S+ EEach time you'll meet this trick, you'll see:
! A" y9 x0 @0 z3 p-SI = 4647h
& @) R1 y8 @2 D& Y) D-DI = 4A4Dh C- x. a; `) A+ g' X4 S
Which are the 'magic values' used by SoftIce.
+ U+ R; }* F3 \5 @( V6 w6 I! FFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# v$ { R5 ?: u) S+ M" l+ \1 j+ f
; U1 c/ s/ x1 W- U3 uHere is one example from the file "Haspinst.exe" which is the dongle HASP
. D, r& o! u" x, e& { l/ TEnvelope utility use to protect DOS applications:* {; _1 H9 D1 e" J" ^/ j
, l1 l" p8 e4 x8 _# e2 d( X, _
4 h# o! B' r# ^0 g
4C19:0095 MOV AX,0911 ; execute command.
R+ z8 _. ?& v7 b+ A4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 Y2 @0 h$ h' q# Y; g4C19:009A MOV SI,4647 ; 1st magic value.# Q+ v8 u( z& ^; j$ X( p, w
4C19:009D MOV DI,4A4D ; 2nd magic value.) {2 P' t ~# j+ r; ]# |
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
/ D0 J* \( e! f4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- F; e5 L- F- e& {/ f) d( E) ]/ o
4C19:00A4 INC CX
) K4 T6 R' H2 |0 \9 l% i6 F. D4C19:00A5 CMP CX,06 ; Repeat 6 times to execute; R$ ] m" ?$ @4 v5 ^: a
4C19:00A8 JB 0095 ; 6 different commands.
/ O6 g; R- w- E8 e4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" B) j4 Y* ?+ q3 c e6 j4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 C9 r5 l* U) {) P
& S: m* v6 `0 [( n$ O( _
The program will execute 6 different SIce commands located at ds:dx, which4 D, C# `8 \8 p0 J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* i! V+ b# d, R7 z) s M, n
% B; n' n& A4 j @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 f8 L3 ~7 _4 G' H/ l7 q8 c
___________________________________________________________________________
, @' b' {- {& P5 t9 d
) N( F0 z; S) v& N$ p0 I! b% c$ N, x7 Q7 A+ J% }
Method 03; i. ]2 T5 E0 Q1 ]7 j: G
=========
1 w! f4 H+ |2 x1 y8 u; x# j9 l# t0 I( k' v
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ W4 C/ H* H8 p8 T3 Q* m# u" p(API Get entry point)
7 ?5 C. V: o: s6 L- q1 l' N* m- ^ # i+ V: ~, U' x! ~* C
2 I$ Q, n0 B8 T$ a! } xor di,di3 \- ]6 _% G* i9 R5 F% m
mov es,di: j/ q+ n3 f/ ^8 L' H
mov ax, 1684h # t8 E; J( n% b% A. K' I& ]# b/ ^
mov bx, 0202h ; VxD ID of winice0 M* z$ T7 I6 h8 L6 K# O. R
int 2Fh
6 r0 s, o# l8 O% w; b+ E3 s mov ax, es ; ES:DI -> VxD API entry point
: E9 A; B9 x* l" B, _ g/ o5 p0 I add ax, di2 T; |. j% m6 h. f9 O/ j2 g
test ax,ax' B ?, \0 M8 R0 F. a
jnz SoftICE_Detected6 \- W* w$ A P9 W- D" Q S) k
o& {. N. P4 e) m! z5 ~) K___________________________________________________________________________$ g( |$ I! [6 i" D g' q/ G
4 H+ D5 V. O" c7 e) j7 PMethod 04
, { I+ ^8 Q4 n# J7 ^! p5 p=========( X9 d) h- |: K, o9 w8 m
% R' D) k/ w' ~, z% I/ J& DMethod identical to the preceding one except that it seeks the ID of SoftICE- K, @7 P* n8 _: d$ N
GFX VxD.3 M6 i3 ]( e. } t4 t z- L
) A7 e, a$ c M# ~. l xor di,di2 |$ R d3 v% P1 K+ p
mov es,di
- G6 O" _$ A2 c: h, a- j mov ax, 1684h
( z% z& l; f+ F- n/ ^ mov bx, 7a5Fh ; VxD ID of SIWVID4 |, V9 M/ c# m) U6 P2 l( c0 K
int 2fh: N9 K- d$ \- i% ~2 x/ r
mov ax, es ; ES:DI -> VxD API entry point
& K, {6 o: n/ U8 b9 ? add ax, di/ x/ e$ \; j6 T5 J. Q1 v& B
test ax,ax
6 H5 k& e X+ h jnz SoftICE_Detected
1 X& P' }; z, R) H# W. f1 G! t$ D# t. N+ j
__________________________________________________________________________
3 f' o6 ]: A: p& N9 X$ j4 K
* O$ _+ ?" X3 ?" C3 J$ |" a. [: {. C
Method 05# l F0 A3 U# R& F" y- y
=========+ A, B7 w. x- [3 _1 s- H7 ~1 w
8 X; W$ I8 Y5 D
Method seeking the 'magic number' 0F386h returned (in ax) by all system( h5 z x. ]0 a+ a9 k1 j
debugger. It calls the int 41h, function 4Fh.+ s; i( r I7 P
There are several alternatives. # c. D) L n, I. t' y/ _
8 `# P+ e' T0 `+ ~The following one is the simplest:% J% _4 l9 j h
! u7 z0 Z) \: l, F- Q mov ax,4fh9 m( j" v/ y" p% K: y
int 41h s6 z) e1 ^3 h/ p
cmp ax, 0F386' u/ I( Q" c$ l& U- {. h
jz SoftICE_detected
: a9 j$ i2 @& g$ d" s0 E8 \9 V9 R- ^: w r9 w1 E U
7 J7 r) R0 R; Q8 a- ?7 N
Next method as well as the following one are 2 examples from Stone's % M, s' r# I2 s1 b- t7 J6 b" z. f
"stn-wid.zip" (www.cracking.net):
; H" w6 p) ~! k: E" p5 m( ~. j0 n: F( a( b h& _9 l
mov bx, cs! K, \( }" U( m* n+ [. B
lea dx, int41handler21 N0 o* S/ v5 L' E
xchg dx, es:[41h*4]
! e- M$ |" d. e! m6 z% n xchg bx, es:[41h*4+2]- N$ z7 k; I7 d/ k. I+ @- C _
mov ax,4fh& `! q p0 q1 }# C: H
int 41h% H" p4 P, {2 G+ v/ @
xchg dx, es:[41h*4]
) T" b7 Z' Q& n0 s xchg bx, es:[41h*4+2]
" \9 E( K, C; [$ x; y6 Q cmp ax, 0f386h& D4 o: t9 X' o/ @ E
jz SoftICE_detected
8 g2 l7 a: N1 T7 n) A8 ~
: p$ ~/ |4 B3 ~; m6 l. eint41handler2 PROC
4 t% L8 A% `% }; j iret
' q% _/ F2 E( g( U& Zint41handler2 ENDP
) y* O* F4 @1 E4 |9 E6 u: q6 h' k" @+ m! M* q
# Y; P2 n5 |! P$ ]# s
_________________________________________________________________________9 L/ Z' |; t/ C
" ?- }2 d+ Y3 @+ z I- h+ [! F
. S% }+ B1 O; _ V; X
Method 06+ I: f9 C3 u8 a. {: ?& u
=========2 v/ F+ I; V2 G
, e7 {+ b/ U! I! Y# V7 t& X1 F7 N6 b
" i8 v O0 e' t* R% h2nd method similar to the preceding one but more difficult to detect:
; D4 p) Z; \$ r; R8 n/ h6 v- p, b5 R
* M) I ]) f8 D; t3 T/ V$ x
int41handler PROC- {0 j+ R0 S. D) r2 s8 N' ^
mov cl,al& B6 b- g& u# t
iret
6 Z* }% [; [0 p. g: Z; Qint41handler ENDP
7 [4 a9 c: T! X0 K7 x- ~8 y; _( A+ D9 w7 s, O
4 ~" ]! o0 Q. y1 B; H
xor ax,ax3 R1 R+ {# ^9 v X' @
mov es,ax: W* q' O; Z" ~- ?
mov bx, cs
- ]0 P. K0 O+ C+ D! K2 w1 ? lea dx, int41handler( h u2 `. I9 ?# H
xchg dx, es:[41h*4]
$ T5 ?0 o- _0 o xchg bx, es:[41h*4+2]; `, ?8 L5 E# i9 ^/ z
in al, 40h
+ Q, ]( {2 H3 g; Q4 A4 C" z xor cx,cx4 |* N! S0 z. f; g
int 41h
6 |% D6 ~" c5 N xchg dx, es:[41h*4]0 w4 J* w2 x) }: \% `4 V' g
xchg bx, es:[41h*4+2] H( l3 V3 G# f+ @5 x( B) O9 h
cmp cl,al& s& h6 t5 R3 k. t1 e
jnz SoftICE_detected7 l1 u" P0 a5 F8 v5 J6 ?
9 S4 O' }& o" m: C& y# E_________________________________________________________________________
$ p0 s3 T- l( A: a
! Z p1 Q4 O7 N/ s5 sMethod 07
0 t" m. l; S6 F [: P1 J A=========& l6 q f- y; L9 L8 V
1 F# ~" @# r5 L( D
Method of detection of the WinICE handler in the int68h (V86)
9 ~) M, W$ M6 B$ Y8 s* P; T+ D& C, @7 O: o1 _% N4 j
mov ah,43h- a* D7 ^6 \9 ~+ Q) A0 c, J
int 68h
8 q7 T+ o$ C2 L- P- A- H& U cmp ax,0F386h- m+ _& n% p. D- j" K
jz SoftICE_Detected
" K: K* X. D" W3 w
, u0 D! w; d2 @9 F5 y& }+ e: {2 o& ]6 H# i7 P; Q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 x9 b- g9 ~6 h6 o$ t" {8 b& m app like this:! j. l6 `$ K6 y9 ?9 O2 N
5 `; g+ x' y! U) u( O% N6 k' i BPX exec_int if ax==68$ N. z0 ]& g* t4 P& t1 v! O
(function called is located at byte ptr [ebp+1Dh] and client eip is0 H; j( U y+ r. N1 J
located at [ebp+48h] for 32Bit apps)
3 v2 X# Z+ P3 {__________________________________________________________________________
; U6 y/ Q$ u( s. a: f
" [3 m8 b# T: b; O
8 ]9 z; K5 W, {# ?Method 08
& K7 d5 D0 A T7 t4 j) o0 W) I; I' k=========
' L7 h6 }; p% }+ J2 g+ O% e; M! {( A# J: {0 n
It is not a method of detection of SoftICE but a possibility to crash the: k# F9 l* C2 \( F! Q& i
system by intercepting int 01h and int 03h and redirecting them to another
) j0 P6 g, m' y: W7 o% P/ Hroutine.* p# x: {3 y/ B0 `+ n l: A7 y
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 j. J- J2 T( a4 @; G5 k" e/ s8 ~
to the new routine to execute (hangs computer...)3 @$ ^ `, l5 i4 V! U; T _' q) U5 Q' s! V
! Q" i4 n: A* j1 c
mov ah, 25h
0 u& W* Q z+ }4 I mov al, Int_Number (01h or 03h)
" z1 W, s N9 g! X% s* }( o mov dx, offset New_Int_Routine+ c. s' U9 @+ j( z
int 21h- @$ a+ b7 s1 @# z6 N
* ?, v+ m* v& ]$ }% T__________________________________________________________________________" B! X5 |6 O u1 s0 r* @6 @% m2 T
/ K- ? r/ Y, l- N1 m3 P
Method 09
0 E1 A( }& Q6 c=========
2 v. a, p0 D M( P7 u( A' V# }! d( C# O4 l
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only i% J R4 ]4 U* \9 c
performed in ring0 (VxD or a ring3 app using the VxdCall).! G/ m# v9 y: j3 |
The Get_DDB service is used to determine whether or not a VxD is installed0 v8 p# g9 B3 D5 K2 e; u
for the specified device and returns a Device Description Block (in ecx) for
- `. X+ r5 G# O @# Ethat device if it is installed.; Y. X2 R4 O) Y+ J: s, S( ?
/ T& p, f7 ~- P1 M7 l/ |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: y& ] z8 p( B f6 s. l: b6 e' v mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- ~% \: C# ^ j P0 d
VMMCall Get_DDB8 s+ V5 w$ ]; z
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- ^5 b6 j: [$ m( l# K2 U- z
/ R5 _1 Z+ }# B* G4 V# w6 cNote as well that you can easily detect this method with SoftICE:1 [8 |" O8 C3 p5 Y5 f
bpx Get_DDB if ax==0202 || ax==7a5fh
; H8 x) Z" b9 O! I. c2 C1 c
/ A$ t( K+ r$ ^4 @8 C0 ?* ___________________________________________________________________________
, c) R4 O+ Z4 f3 y4 E' Z
% h% L* z; I$ M0 r ~Method 10
( U" k+ N1 N3 G- K$ R6 s=========( X0 b0 o& k4 S
+ W. S+ W; {7 b& |7 O1 P! I, y
=>Disable or clear breakpoints before using this feature. DO NOT trace with8 u }. x& z) R
SoftICE while the option is enable!!
; z0 d# _' c8 \7 ]
- y. t6 w' v7 Z5 [, XThis trick is very efficient:& z$ a8 N4 p, A0 e
by checking the Debug Registers, you can detect if SoftICE is loaded! g# R" ^4 ^0 Z. E$ ^
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
# v3 @5 g _! |6 zthere are some memory breakpoints set (dr0 to dr3) simply by reading their/ u; h+ q. ~5 W4 [( B
value (in ring0 only). Values can be manipulated and or changed as well0 F# |: l5 _2 T/ x& H
(clearing BPMs for instance)
0 c* ?' B2 O; @# o
7 o; g& @2 }4 [. s. u8 E6 [1 I__________________________________________________________________________1 Z8 ]5 J# q. j
8 I9 w' X" l8 ]+ ]; e3 @Method 11
) L/ Q; m W( u% f% |=========& S# c z' \' n' G' D2 I) y
1 r, f) l6 Y; d9 EThis method is most known as 'MeltICE' because it has been freely distributed
1 [ p, O3 L7 X0 {; z0 I5 w( |via www.winfiles.com. However it was first used by NuMega people to allow; ?/ _' K) _* {9 h3 {
Symbol Loader to check if SoftICE was active or not (the code is located& F: K8 ^' X1 A s% J
inside nmtrans.dll).
( F7 C9 b; P" g* V [+ }5 C# `+ `0 p# \4 l+ B+ U
The way it works is very simple:- D4 q ?" S: W. ~6 i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ M4 N! f8 x! ^! h% {8 @0 iWinNT) with the CreateFileA API., ~6 T6 z8 T0 A3 L
9 E u2 k: h0 @
Here is a sample (checking for 'SICE'):, {" q4 L! Y6 l1 K
* g S8 M+ d0 T; T6 QBOOL IsSoftIce95Loaded()
7 x- j8 K# p, S{+ |+ D7 d5 F- P% r
HANDLE hFile;
2 o5 ~3 g) t7 p7 e2 m2 x* ]8 ~ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,# k- N1 d3 s5 g) \% x* `4 e
FILE_SHARE_READ | FILE_SHARE_WRITE,1 J- [" _2 p* q1 J+ j/ F& ?
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); [0 `9 B. F# ~2 L6 ^0 n9 H+ Q
if( hFile != INVALID_HANDLE_VALUE ), g0 R" h. ~# p9 A. g: ]
{
. B h. S, B+ K CloseHandle(hFile);
- Q* h* a- u. m8 X return TRUE;& i/ {+ i' P) Y- P
}1 X0 q: H2 z5 \
return FALSE;
4 d8 k6 U5 d5 a$ P3 D}
- j" P, F/ l3 w6 M5 |+ R: x1 {! b2 [6 F
Although this trick calls the CreateFileA function, don't even expect to be: I! a! u O7 @* Y
able to intercept it by installing a IFS hook: it will not work, no way!: ~& O" Z ~5 E7 H- O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 q" t1 m8 B5 Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* S" t: m; n7 C9 Y5 S& Wand then browse the DDB list until it find the VxD and its DDB_Control_Proc0 y! E C- M8 V
field.
6 N; R1 l2 z" dIn fact, its purpose is not to load/unload VxDs but only to send a 9 e- L. f+ L' c# z6 s' ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ \8 m- }0 l' ?# [" k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
/ L# y! C' P& G% R, ~; Yto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 e; J, }4 n% {2 `; ~( `
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 y9 a6 N, b; L+ ]$ |) I7 z; U
its handle to be opened and then, will be detected.
' @4 ~7 \( p2 ~0 s. `& K! M# a$ ?You can check that simply by hooking Winice.exe control proc entry point
* T5 K7 K3 m% c" Uwhile running MeltICE./ G+ T, N2 x. n. D
$ T" s5 O+ g- W. T- b: v: R9 ]4 z* K
2 u# c& w0 ? V0 B
00401067: push 00402025 ; \\.\SICE. J: z8 q" P5 g8 ^; X3 x6 @
0040106C: call CreateFileA
3 e8 M) ~5 t `$ a' g 00401071: cmp eax,-001
- |! f# j! n, ]4 C! L7 E: V 00401074: je 00401091; ]2 ?. D. ?5 ~8 C
' d- f4 X% Z9 `0 O# m6 C
: j m. y2 s+ K
There could be hundreds of BPX you could use to detect this trick.
h# U* E* Q" V: o-The most classical one is:2 T4 R0 ?& N7 @+ A6 T
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' `* [9 f! Z4 c' e+ |+ Q# D *(esp->4+4)=='NTIC'7 c) ]( U! b8 g2 T5 X, Q" { b( o
- v/ W) g! U: H-The most exotic ones (could be very slooooow :-(
) v$ a& A4 H) x* i7 i BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - o0 M0 A0 Q6 b' u) Y+ x
;will break 3 times :-(0 u8 a0 U9 c/ F& u8 q) d
5 a% O* R1 l2 @/ ^7 i1 S: ]& M# J-or (a bit) faster: 5 u1 Y# J2 `5 z0 }& c
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ t V% d" B( U" f8 i; M/ n! t ^$ I, }" F0 w! \
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: Q9 V* w% S. Z" P/ W0 K ;will break 3 times :-(
- C! a* S0 G: ?) ^ V f% G6 [, P' o
0 Z: ~$ l4 `9 ?7 N& M/ s-Much faster:
' Z3 r G; s' d8 P8 u% A. N/ k BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 R4 F% x3 M* k" S; x! y) r. _
4 h/ Y$ K; I) [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 r5 V6 w# l8 G! X
function to do the same job:# b N# {( p! y: |) M5 R: Y" `
q0 v) {) M) E8 E
push 00 ; OF_READ
( z7 [: }6 m# \, h+ M: f mov eax,[00656634] ; '\\.\SICE',03 a- o+ I! v4 f0 p
push eax \/ c* E3 j2 [6 |
call KERNEL32!_lopen
+ i! B% E V' e6 P, G9 { inc eax8 o' @3 c1 M$ |( q, l
jnz 00650589 ; detected
/ j i7 Z1 s2 A: t/ S# B* S- n' y push 00 ; OF_READ6 X( t3 o2 k9 E; K* e, G! O
mov eax,[00656638] ; '\\.\SICE'3 R4 N) R8 X& A
push eax! X2 a. O/ U% s6 o: ]! v2 @; N
call KERNEL32!_lopen
" D, X1 G1 d+ ?' i O% Y inc eax& R& M7 z# p% O; q& L# @) H" W
jz 006505ae ; not detected
$ C2 i* Z0 C o0 W0 k, ~/ |1 }. N8 b C
% C5 m, L5 y! s$ d
__________________________________________________________________________( C ^1 M* x+ Q; [0 G: G/ w# `$ @
3 w) t0 I$ S' M+ m
Method 12
1 h" V! a4 j" r1 C=========
2 P w3 t9 z, d' W+ k5 M3 S
0 R* Q R" O" N/ I- D) G3 GThis trick is similar to int41h/4fh Debugger installation check (code 05
6 `8 X6 @7 e& k4 k2 K& 06) but very limited because it's only available for Win95/98 (not NT)
% Q. L) @; T/ v* A k2 I d+ sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! {6 w& M3 Q: y: p9 f1 z
2 D2 D. P" J- N3 M6 u' C- e8 D5 ^ push 0000004fh ; function 4fh
x9 K: t k* q3 m push 002a002ah ; high word specifies which VxD (VWIN32)
1 t# g1 o/ c0 b7 I. M2 ~ ; low word specifies which service. ~1 A p- Q8 c, ~- h; |
(VWIN32_Int41Dispatch)* ^- C ?' _5 J4 r) ~( N1 ^5 Q' @# M( T
call Kernel32!ORD_001 ; VxdCall* I5 ^# Q8 ]/ \8 l- D
cmp ax, 0f386h ; magic number returned by system debuggers" i' N) l( V1 Y9 X$ j. U
jz SoftICE_detected) v8 A) _' T7 R p) ^5 ~* `
! T7 @$ d$ J! t F5 Q. ?
Here again, several ways to detect it:
/ H7 {4 j3 @% ~( _5 i
6 X% g" _5 u1 } n V$ c4 h BPINT 41 if ax==4f
- C# z: N4 P+ i! x, t* m" q! G+ g
& \3 F" A M% M j8 G" p$ q: \# R BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) Z+ e, Z n' ~+ I& L# ?
' d9 ?. G6 P' F4 C5 h& R
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A! R% ]! C- X/ Z/ W* j& f; ?. m$ [
0 ~, l( _# ^1 I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: {2 C3 x9 h' E2 e0 W% B& e" C$ c: A4 M4 O0 v$ J( `( d
__________________________________________________________________________5 Q. M1 \4 [+ {! _ b
) ^8 [/ M/ U* |$ Q1 g2 ]
Method 13
3 ~4 w5 `/ K8 T, l' P=========3 Z9 b1 U) C/ {- _! h
; {8 H* e2 q X BNot a real method of detection, but a good way to know if SoftICE is6 \4 m( D8 Y# A. j' E1 W
installed on a computer and to locate its installation directory.2 w5 ?6 E+ e& p3 T
It is used by few softs which access the following registry keys (usually #2) :) l6 M9 u" Z5 |
: C3 @: m5 A; j5 R: `-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 F" V) E; { ?
\Uninstall\SoftICE
3 x* y+ Y E) R- v- ^6 H6 s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( X* x2 G6 e* H; {: X
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion m+ G& ^# |- H- W6 i3 \% B! G
\App Paths\Loader32.Exe# ]( W8 a9 h: Q3 C& v" c5 Q
7 w: M0 E; ]" J9 S C8 t# \' \% g J' d2 C T
Note that some nasty apps could then erase all files from SoftICE directory
. g9 ^* J- n1 Z P* h(I faced that once :-(
: W& s n* V+ \3 N" _/ Z
( Q( X+ n& n8 R( M# ^" Y+ G1 }Useful breakpoint to detect it:
- w& ]2 c( {6 Z5 Z8 P9 o& k9 T& F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 ], U' @6 T2 H2 C
$ Z9 g8 U/ a0 h__________________________________________________________________________
^/ f/ K, B7 ~8 b
" g) } c; Q* y6 Z, R& R' O) ~# _3 Y2 J, m
Method 14 + Y& ~/ k. M# W9 Q ?
=========/ g- R1 p2 r+ O5 r
$ q9 W2 W5 \/ W' l }& h) g' a% N+ V2 nA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose, q7 I; F A4 ~! H1 I9 V$ t/ I
is to determines whether a debugger is running on your system (ring0 only).
( `2 y' ^' ~6 ^) B; _, Z+ I# v# J9 | m! W. t5 y8 ^& ^) g0 B
VMMCall Test_Debug_Installed
3 d8 Q9 O; r" Z, U je not_installed: E h! X% C% D: C& O
$ G, X0 G; _6 n; f9 X8 S. n
This service just checks a flag.0 N' s* p t9 \& F( R' t" d
</PRE></TD></TR></TBODY></TABLE> |