<TABLE width=500># m/ h" @. R# I/ G: _, O% ]1 B
<TBODY>
0 H2 v( h N7 K+ H7 j' t0 Q2 w<TR>, o8 \ F# p2 u$ n5 w: L6 d
<TD><PRE>Method 01
9 o5 u1 v+ t, v% t5 w, \" N=========
3 S: h% l" [9 S1 ]3 ^, h, ~: w: J" R
This method of detection of SoftICE (as well as the following one) is! K2 ^& p7 P" R6 e: Z1 a7 J
used by the majority of packers/encryptors found on Internet.& ~4 ~5 \( @3 D# E# W$ f w. g
It seeks the signature of BoundsChecker in SoftICE
7 A6 [# l4 V: v; K* M# y# P( H. w$ t1 h' Y4 |: w$ v6 W( X
mov ebp, 04243484Bh ; 'BCHK'$ r6 X3 H% D \8 S+ Q+ \' w
mov ax, 04h
, \/ h; O2 o7 O$ Y$ t: e4 \! P- R! C int 3 6 V6 D# G, Y! f0 D
cmp al,42 h- w$ F$ r- o. d
jnz SoftICE_Detected
|* @7 J# d& q; v0 }
5 \2 H q6 o9 I% Y, V3 W |___________________________________________________________________________$ L7 e+ c& x' Q, U9 |6 I# n n
* U2 F2 a' l. r, l; i
Method 02$ p. Y9 ^, k. A) K* Z3 y
=========2 j2 V. n$ t# S6 F2 [- v
* d8 E4 e8 B* Q; e: R8 eStill a method very much used (perhaps the most frequent one). It is used
s, e5 n! f* Z+ z" f) ~/ ?# k1 q! T$ Yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,! k$ o( }7 F8 T: F$ d
or execute SoftICE commands...
: Q. ^ h5 t0 t/ X& IIt is also used to crash SoftICE and to force it to execute any commands2 h0 v* W7 g6 @, d! o
(HBOOT...) :-((
! m; F! {4 x) W" U) t
: p5 f6 U. n: N) HHere is a quick description:' }' ?8 m2 |5 w/ ^& B7 t1 z
-AX = 0910h (Display string in SIce windows)/ ~4 t4 @ h1 c8 `4 j: V
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 p) R1 M% T9 C- n3 v- B% b) ]" @1 C-AX = 0912h (Get breakpoint infos)9 V/ g4 l1 O: [% n W& r
-AX = 0913h (Set Sice breakpoints)
- T% z8 E- n0 [-AX = 0914h (Remove SIce breakoints); V7 v% b N* K+ G4 y0 Y; v
% L( `5 a3 B2 O+ V1 O# aEach time you'll meet this trick, you'll see:
' Y$ E& i [! ]- R6 X5 w-SI = 4647h$ i" J7 d* K' @* |* x8 b! k
-DI = 4A4Dh6 o, V- V5 \* d. g
Which are the 'magic values' used by SoftIce. b0 `9 _9 @! }* R6 t1 f! Z% k
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 P$ ~/ A: t' v- U+ w r5 p3 \: x
+ j5 }. o. E" ?6 F! s; \6 z- LHere is one example from the file "Haspinst.exe" which is the dongle HASP# q) T. k. R j5 t: ^6 r7 f* U" k
Envelope utility use to protect DOS applications:* J- m, l9 A% G9 _: \ z
8 l& B$ X7 C* Q7 O6 U! W- M& O' e' p7 r
4C19:0095 MOV AX,0911 ; execute command.; y! ^! j! A/ \; B* R. C6 U
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
P, f% s$ a3 }' ?; G" U' H9 X4C19:009A MOV SI,4647 ; 1st magic value.
* r6 }& w$ }+ @1 n7 m9 i4C19:009D MOV DI,4A4D ; 2nd magic value.' p# i! N! D% u4 D# ?0 W
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 I& F6 N" J4 l5 v2 e4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& n( n# n7 u0 r! C% e4C19:00A4 INC CX" L2 R9 E3 a+ b k
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# ?. V1 w7 h" q( v4C19:00A8 JB 0095 ; 6 different commands.. E b3 W+ h& o9 L* J& D, ~7 v
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
8 L T- X* N4 y4 N4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# \2 X' k4 L; i
6 s: |; W) A& t. t4 g0 h; b: nThe program will execute 6 different SIce commands located at ds:dx, which8 ^- M3 o) `" M' R% L# r5 h
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
N- y' p$ D9 m; s0 ?
# N4 i7 ~0 F: I5 V* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! C; S k8 r# G- e; a1 A) A$ j___________________________________________________________________________% h* g$ V$ |& f6 @
L( V2 `7 p- j* b* \/ a* c
H7 C2 O; u2 I6 R( eMethod 03
$ U9 H6 t9 E& e9 Z! ?" Y% Y6 i=========
: Y$ P4 x: z- Y1 T5 L2 m8 o* k# e. }6 u. [9 v0 \ C0 y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( d5 S4 j% p6 \8 S; c2 M(API Get entry point)# B& d3 i" x( Y; o) Q
# `4 Q0 W1 b6 v7 S7 B5 l- E1 ?# P, z
, Z. B5 ]9 [7 @+ `/ ~( k# V$ q xor di,di
6 E( @ E( n9 c5 J* z" h mov es,di
: S4 E# M; ^( ] mov ax, 1684h
/ ^6 D7 _0 |# c$ c mov bx, 0202h ; VxD ID of winice
3 Y% }6 T6 V0 m" m! B2 Q int 2Fh
$ [* {6 K4 l0 p- v& \ mov ax, es ; ES:DI -> VxD API entry point
1 l- l8 @4 h+ F7 v9 T1 q/ z* g: l add ax, di
# F, } U# [* R' c1 ~1 d. a! y0 N test ax,ax
' g5 v" @* A. Z; M jnz SoftICE_Detected6 g3 {9 D3 i, n# ~) I
: l- h H4 \+ a4 k- z4 o0 b* {___________________________________________________________________________
# N7 j9 W4 ?; M5 ~7 A+ o4 m
+ ]1 N; N5 p. {" `* ?3 ~Method 04
7 ^( N4 t/ e+ ]0 s=========/ L+ G( |4 j3 U% \
' I/ z8 @7 f+ x6 E/ S, g2 H
Method identical to the preceding one except that it seeks the ID of SoftICE
8 u$ q9 ^' w! k* C& p$ ~GFX VxD.+ g# o, q) s7 ]: z
4 \1 L( J% I4 V7 C- l4 o xor di,di4 H: t% M/ q( ^; U1 d: X& z' g
mov es,di
$ y& K, M; L! \' a3 x mov ax, 1684h
4 e$ P9 G* P- `3 d% x- e6 | mov bx, 7a5Fh ; VxD ID of SIWVID
7 I: R6 {) T/ A# [, n: P int 2fh+ a/ T; g) P* b0 Z8 \: E
mov ax, es ; ES:DI -> VxD API entry point1 o2 B. G3 M; Q0 I l
add ax, di
; C; U' Q) }/ v* v test ax,ax
3 s4 i0 Y; R& @, G: w" N; _+ V jnz SoftICE_Detected
5 t* f: ~4 l5 P* K6 X' E) ]. r1 n7 v% ^# S
__________________________________________________________________________
8 B; ]+ K. q; z& g* z1 K6 g+ c! Q0 |5 Q5 A5 ]6 S' e
4 t0 S. p! p& o) Q/ H) YMethod 05
! B2 |+ v0 @6 P; s. _+ u4 T3 p# d=========
8 _& ?! W9 W( m- x2 f# x6 ~7 c; \* I, s, Q' e; u3 T8 |) I3 H h/ s
Method seeking the 'magic number' 0F386h returned (in ax) by all system5 Y `" p9 \4 c7 l ] b
debugger. It calls the int 41h, function 4Fh.0 _4 y4 a2 T3 F4 U
There are several alternatives.
% S% l% X/ | Z1 X: {- k/ o
$ s8 S1 K- H1 L2 JThe following one is the simplest:. F* U5 q1 |( z: q8 ^# |! e
/ c6 D4 H9 f4 _6 q- e& Q6 v3 z
mov ax,4fh- q h o0 r3 t3 A7 I! o
int 41h
" [# T4 q2 m, z3 L% ~, \; O cmp ax, 0F386
2 B1 j& U8 J8 f2 e jz SoftICE_detected) B4 W) J! r; {) J
9 [, i0 X2 ?; ~7 n
1 r6 \2 {1 I7 g& {# DNext method as well as the following one are 2 examples from Stone's % w0 l8 U! f1 y2 n5 J' ?8 |: }
"stn-wid.zip" (www.cracking.net):/ x2 n( W1 \/ {# d' R# I" Q5 Q5 p
7 F! [& r% }7 C: o h$ I mov bx, cs
% {3 e: m! U1 _' u0 |) n lea dx, int41handler2
. r; q. ?+ ?, F+ { xchg dx, es:[41h*4]
& e8 f G0 ]2 {- e' c, Z xchg bx, es:[41h*4+2]
8 W& l6 X1 u% s; t, C% X! { mov ax,4fh
- A+ K1 @, v9 @* A8 s int 41h
7 f! k1 W* G* l: J. u: F1 J3 { xchg dx, es:[41h*4]% q4 N" k4 @- j: R* Y/ w7 Q& |, `& m
xchg bx, es:[41h*4+2]
- t$ g. k% |* P+ L4 ~5 y cmp ax, 0f386h" l) a* |: E8 F* k- y
jz SoftICE_detected
" E+ [& s1 J$ X
: Q. ?9 m% @% k/ cint41handler2 PROC# Z* ?5 a4 q: g9 Q9 Q
iret) V. V0 Q' N3 y
int41handler2 ENDP# c/ H% w- E& k8 D
! b9 E' b6 H' ^! M1 S9 ^/ v
& H3 x- G: k) s_________________________________________________________________________: x8 U6 I v$ m z
& o ]1 S. W% u! k( z' K
6 X+ N2 T' f, K0 t+ \Method 06. K& Q' L" P& S
=========% _8 e1 o- c. w5 S0 j& o$ s6 x
# g0 T: F. _& G# o9 G8 o
6 t6 B, r( c$ y/ Q2nd method similar to the preceding one but more difficult to detect:
, Y5 {: l F) ^: R. `0 P6 ^ m9 N, @) ]: z. `+ e3 y7 [+ ~
/ C0 V5 u( p& k5 t2 I5 H1 X% G1 C
int41handler PROC
7 L) H. q" f$ o- s mov cl,al
0 w9 W! Z- c5 f3 f% e2 K6 a; q iret2 H) l% H1 ]: o" |, v6 G9 \3 ^& e+ |; q
int41handler ENDP+ z( M" s1 d6 R2 C# `3 o: n
+ f. _: E, k& b- h
5 x7 Z& s1 q, L; U
xor ax,ax& I8 t- i. f# y+ c {0 W' x! T
mov es,ax
5 s+ ^9 _5 \* |+ I, t( G' U mov bx, cs
" ^: T' M/ m2 x+ c# c; X6 @$ m; [ lea dx, int41handler5 k2 \- A( x5 q) M
xchg dx, es:[41h*4]
$ K+ i0 |4 [; v% E: n o$ D, ] xchg bx, es:[41h*4+2]
" l+ _+ m, n; r5 d; o in al, 40h! \( f1 Y; B" p6 B, i |
xor cx,cx4 J! L+ F/ w6 a5 P3 Q9 V- o* V* \
int 41h! a1 j6 c J$ J& A
xchg dx, es:[41h*4]! z/ H( B: }" d( L4 f! W
xchg bx, es:[41h*4+2]7 f2 @: o+ e# a6 K1 {# A/ d
cmp cl,al
' P; W; ?4 k- J jnz SoftICE_detected
( C4 B, j: E' k
/ Y5 a" G& [0 T% S" o0 V$ |_________________________________________________________________________
% c" P: L0 }& ?8 k- \4 t
; O: b! Q9 r- C O5 k+ J9 v+ g- y, aMethod 07
/ d, D3 Z5 n4 x4 D6 b! C) s+ T% ` H=========
+ v+ T8 w3 O3 C- g! q: x2 X3 t, ]4 `% ^8 x$ E
Method of detection of the WinICE handler in the int68h (V86)
2 M% J( F' q& C/ ^# p$ H
9 {. }2 |& Z3 r; ~ mov ah,43h: s9 I8 N$ ]3 P1 {9 ?2 ^7 R
int 68h
' f8 `& _/ n- p* t3 M J cmp ax,0F386h
3 z2 C" \) e+ h! S0 f jz SoftICE_Detected
6 a) L! C; G8 E; C8 d7 A, P( J7 X$ V, f) C% K. @! }2 M# }! w& B1 e
* S; W7 f; L" J. S
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 O8 ]$ P, n5 D" @) y5 O
app like this:6 n1 Y2 G% J5 y
" n. Y# w9 F- l& B2 p" X! ^/ T
BPX exec_int if ax==68" q0 l# z9 n5 b' k
(function called is located at byte ptr [ebp+1Dh] and client eip is
" Z! V/ a/ Q) [1 A4 I1 m: F located at [ebp+48h] for 32Bit apps)
& a4 p5 G3 |) r$ f7 n__________________________________________________________________________
% ?& |. v4 a# E' K% ^6 U5 H0 b" m4 m" ?$ v# [) J- Z) z/ h
7 w+ v6 T) H1 b4 K( qMethod 08
) b O3 D2 B3 g7 {=========
) _; `2 k! ~% ~0 E* [% x, O+ V. Z' A" c0 p0 Y; R! B" t
It is not a method of detection of SoftICE but a possibility to crash the: X1 t+ x* |& I7 S( i
system by intercepting int 01h and int 03h and redirecting them to another
3 z$ ]0 ^% l0 T1 Kroutine.! U$ u2 K7 O _
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) R5 ?6 P8 i2 P3 r
to the new routine to execute (hangs computer...)
3 M/ w+ c& N: y( C
w; p) z1 r4 B- o: z1 s mov ah, 25h
* ]; `& ]' X9 j. b, K( J9 \2 a mov al, Int_Number (01h or 03h)$ @' g( ?- x% F& A, L1 A p
mov dx, offset New_Int_Routine
7 a7 D7 v1 E ]" X* f int 21h
9 M5 F/ ?/ f% A1 v- Y5 Q* ~: i& u" L8 w9 o
__________________________________________________________________________' y* o, p) ^# r9 J
9 G! g* O7 E# N9 \) x% V% OMethod 09' ?( l% a$ \$ _, w/ [" n2 J
=========
1 i5 |" x; @% V% f9 r
6 X, Y2 M4 S: F2 z3 UThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& v, \2 W, V/ C6 F5 B0 i* q0 O
performed in ring0 (VxD or a ring3 app using the VxdCall).
V# H, g; @/ l$ |. G7 X$ d# aThe Get_DDB service is used to determine whether or not a VxD is installed
0 y! q- a7 F: j! V @8 A# V \for the specified device and returns a Device Description Block (in ecx) for3 @7 d# v3 i. J. J
that device if it is installed.
, L0 s( g7 I* B( l% _
0 m1 `7 q( ]) ^0 `* [ s mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 z3 o j: u$ } U# z) L* ? X% `
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)) n, U4 A. Q' J7 q8 }) R: E& l
VMMCall Get_DDB* h! x# d _8 s/ H8 S+ w
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ A2 V2 y' K1 s/ N( \. f
- t. u( h5 M, d8 M
Note as well that you can easily detect this method with SoftICE:
5 `( @9 J g) t s" S, M bpx Get_DDB if ax==0202 || ax==7a5fh
b( a9 j5 _3 f( {
. s9 m# u1 d5 j6 H__________________________________________________________________________
) Y+ i8 u4 `) c0 b
S5 ?/ @ y1 @( N) x0 PMethod 10+ {9 \1 x$ F$ F
=========) g* v1 X; M3 t
8 m& d+ ~! U3 c8 }=>Disable or clear breakpoints before using this feature. DO NOT trace with( u1 w; F0 e7 Y+ K+ a6 _' F7 ~
SoftICE while the option is enable!!
/ L4 @4 D( T; ]- Q6 s1 u/ J8 L w, _$ y6 v
This trick is very efficient:
9 G. Z! q- ~- S% o5 ~. _8 Z2 g) Gby checking the Debug Registers, you can detect if SoftICE is loaded& A8 }; u8 Z1 a" J5 T& K
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 }% Q$ L+ e, N( D2 U! Z- Mthere are some memory breakpoints set (dr0 to dr3) simply by reading their
' |$ L- }7 a: Gvalue (in ring0 only). Values can be manipulated and or changed as well
2 Y( a' b: U3 Z5 T(clearing BPMs for instance)2 n% c+ O9 p# i/ |9 b& P
$ e8 x; R3 p4 [# R/ q" E( p__________________________________________________________________________( X7 G1 ?+ p2 \3 H( Q, ^
+ c" E# _! m' {
Method 11) \+ H8 i- d! w) k: Y
=========
3 ^7 k9 A. c# Y3 ?0 t Z6 z
2 F4 ?- c/ m. KThis method is most known as 'MeltICE' because it has been freely distributed
* s3 ]! t" w& m9 g! r6 l: w& }via www.winfiles.com. However it was first used by NuMega people to allow2 M. D/ ^$ f# m, C7 I+ n; a) ~5 i
Symbol Loader to check if SoftICE was active or not (the code is located( R5 G/ ]) }& N/ {/ c' w: K" H
inside nmtrans.dll).
: a% z$ y' R! Z) F. B0 K+ w2 x: B3 Z$ M
The way it works is very simple:, I1 u7 D0 n" e' g1 g; W2 V0 m
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# z7 p' a0 t( K* `
WinNT) with the CreateFileA API.
3 X; @. O2 m0 `9 q$ l
e1 u! |4 h; O+ o3 ~9 r) IHere is a sample (checking for 'SICE'):2 L( B; C" @+ q& `! S
- C; I4 s! G3 C. f/ GBOOL IsSoftIce95Loaded()8 p: Y( h% S8 f0 \, Y+ |$ @
{
* J2 Z1 v% i# q" o: U3 V HANDLE hFile;
# z' g% d, Z" I0 Q. [ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: f5 }* w( z# b7 J$ S
FILE_SHARE_READ | FILE_SHARE_WRITE,' F8 d5 P& ^5 [$ @
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 G; _) m3 t2 E
if( hFile != INVALID_HANDLE_VALUE )' f4 n& K% E5 t" c5 `& ? Q
{2 e' f L$ P! {; {# L4 \
CloseHandle(hFile);
( }$ U; I3 L" e' n- O return TRUE;, Q9 L: G6 i z, q! e& N( J0 |: i
}0 S$ |- t' \! C" w
return FALSE;
+ S8 T- l) y( F6 Z7 h2 U}2 i& m. \+ j+ u: K5 U5 L; q
- U, L1 l& {+ Y y7 X, Y2 AAlthough this trick calls the CreateFileA function, don't even expect to be3 k2 o# N" k. p% X
able to intercept it by installing a IFS hook: it will not work, no way! I/ k( h( V: v" k5 b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 T3 G- f9 r5 F9 _5 U. x* h& m
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# ?/ t2 C. o% d3 wand then browse the DDB list until it find the VxD and its DDB_Control_Proc) c5 k4 y9 e2 U; O$ u+ Y$ u
field.
& U9 N8 Y% @6 }; |+ j1 y$ k: _' KIn fact, its purpose is not to load/unload VxDs but only to send a
8 f1 m3 P7 t4 V9 C CW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; l: E: X$ l0 _7 t b$ Sto the VxD Control_Dispatch proc (how the hell a shareware soft could try, y; C. s% r+ p0 A: I, w5 D& \6 m
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 T ~3 k! S) z% z! g) ^
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ C8 N" t$ L1 }' P, G; j) r
its handle to be opened and then, will be detected.3 o% u6 n4 Q( f7 B" w2 V
You can check that simply by hooking Winice.exe control proc entry point! L0 P# ^& y8 y' M# m. _- [, \- j
while running MeltICE.3 F- \6 _/ Z; S5 {; @( S c
/ S5 V& r6 _. d9 D1 H
8 `% |4 r7 Q5 }6 n8 ^ 00401067: push 00402025 ; \\.\SICE9 x' o$ h! L4 d: E
0040106C: call CreateFileA$ O- j6 {& T/ t. H9 P: S# R7 [0 S
00401071: cmp eax,-001
2 ]) Q' j8 E6 H" l0 a9 B7 ~ 00401074: je 00401091
, u3 I" p, t+ W+ ~" f
( o' ^& h& s1 W- G% Y" h0 Y0 J; d! [9 {9 @, @) N7 e* |% h
There could be hundreds of BPX you could use to detect this trick.& _6 C- f# Y0 ~4 O+ R ~* d
-The most classical one is:
$ K% s9 H3 g* ^7 S4 w% n0 @ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||+ ~4 l1 c$ P' L" _) N, ?- z
*(esp->4+4)=='NTIC'
! Y' q% t l& ?8 B x e
6 T1 N2 r* I/ ^-The most exotic ones (could be very slooooow :-(
* ^ U3 J; f+ x! m. p, }3 S0 i8 a BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- V. u. b' J: @8 k2 N! `1 Q$ a& ^ ;will break 3 times :-(
1 I" o, w& W3 d9 e; h: ?# F7 Y( e4 R& V( u7 x
-or (a bit) faster:
) |/ C* t8 n# T6 i# Q0 R BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 K) B1 V. [/ H6 y$ {
. `* F$ e+ S. u; Z& W! t
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 4 c1 l& o% I) Z; @
;will break 3 times :-(' q+ L0 v5 f r, N
9 Q/ T3 o3 n6 R) W-Much faster:( \- s3 f* K4 P6 `, |: W6 o1 Q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! c c: ^4 ?( x- s# w: {
* M( {4 n& W6 |Note also that some programs (like AZPR3.00) use de old 16-bit _lopen1 v1 N. ~1 A$ X! r; ?
function to do the same job:: l' {5 l) N& Q5 @! n3 r/ q
. d& _1 Q* U9 O- F$ Z8 k1 C
push 00 ; OF_READ0 x |' T0 x2 k8 r b
mov eax,[00656634] ; '\\.\SICE',0& Q d" u0 p9 B
push eax
- {) \4 b. X- u( e5 u call KERNEL32!_lopen, O% g; o M+ p8 W& Z6 M2 _- h
inc eax. a6 |: i5 b$ S9 w
jnz 00650589 ; detected
( S9 A2 M2 M; i) Y; V) H3 W5 c push 00 ; OF_READ
0 I/ n0 q o3 l% t mov eax,[00656638] ; '\\.\SICE'
; n: q1 i. R; r push eax- W( u, t3 @6 z+ Q8 |0 a( ?
call KERNEL32!_lopen8 B# N: H7 _& [& \: j/ @& A
inc eax( G5 F9 W' X' |( N
jz 006505ae ; not detected3 u: @' e( @# d
( I3 E. f7 c- B5 D% i4 d8 {0 _% ^) Q& e
__________________________________________________________________________
1 E& u( g: M; u! ` v, d. t! `. `3 S" b. {" ~! Z7 S; z
Method 12
; }* h- [1 t) w$ {# `# a=========5 g. w: N8 r0 C( ^( x; c+ A1 j
6 T! S& A6 ~, H9 X
This trick is similar to int41h/4fh Debugger installation check (code 05% a; A& {7 r! j- t) l
& 06) but very limited because it's only available for Win95/98 (not NT). p* W& L7 o- O
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 A# g8 J$ S. s+ R$ j
# p( X* |: g9 Z& F0 j# O1 V9 ] push 0000004fh ; function 4fh
8 y4 a0 u9 f, |( a push 002a002ah ; high word specifies which VxD (VWIN32); W% u( J# J# \+ I- K4 |
; low word specifies which service
# }. q" j. h' Y& x( y+ b (VWIN32_Int41Dispatch)
! d1 k6 R% ~# Z A2 }+ j call Kernel32!ORD_001 ; VxdCall+ q: j5 x* g3 p# d1 }5 i7 _
cmp ax, 0f386h ; magic number returned by system debuggers
1 e, m! S1 M# [7 f" k, u4 X& y jz SoftICE_detected% j2 y( K4 ~* C) z: Q
8 h- o2 Q u7 G" m; DHere again, several ways to detect it:
6 Q( M8 l! f+ t3 g& r" U \! k" z$ k2 m; d% p8 v3 ?
BPINT 41 if ax==4f I; D: y4 Y' Y( v; E2 w
" H# W/ `, ` n5 H" [* s3 o: ]. F/ v
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 C' `- y! w# \! x& r, L# D B X& M* Y" i0 d
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
z3 N' w1 a. L! g9 t
1 u0 F% y7 R2 M# \ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
`& D9 E5 D( A: D
' e0 Q# Y1 ~ o- B) F( B; H1 K__________________________________________________________________________
3 h2 h$ k4 ^9 h- x
+ Y0 B) }+ {* ^! `5 C# n5 W4 D! XMethod 13
) S" M, q# G8 w' @+ I=========' E% z7 {4 y* o, n J8 T1 T
; a' C! R; I+ L' D% kNot a real method of detection, but a good way to know if SoftICE is
4 w$ i$ _) ~) Uinstalled on a computer and to locate its installation directory.
' y' ~, H# w1 MIt is used by few softs which access the following registry keys (usually #2) :( _9 p( Y1 X/ Y8 Y$ o2 B8 t
J' i5 H/ y) ?. v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) L! ?" O+ Q. V/ o2 @\Uninstall\SoftICE3 K' H; U/ @5 _' I' U1 w% x
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- S+ ?1 Q/ h1 M9 _-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) o! V$ f2 k2 v# G4 h- W8 l9 B\App Paths\Loader32.Exe( {3 e" G9 [: P% X) W6 y
) q+ e2 y4 k9 f, r
& L; G Y' t0 |* X1 o3 G: F
Note that some nasty apps could then erase all files from SoftICE directory
5 I9 x: x( G7 M8 O(I faced that once :-(
3 l) F$ X4 X0 \& z9 y
$ @( m5 {! R: c! m, WUseful breakpoint to detect it:
/ P8 c6 _7 J" o) I( k, Y
4 _4 M9 \6 z ]1 P BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE', x: R- ~' o; I9 I8 P! F
$ t* Q9 E( a, \7 e2 P y
__________________________________________________________________________8 a/ w- v4 d" C3 q* ^. X( j) N' M
: \5 a& V& Z' u; w" ?
; k$ W! {% e0 u4 B: N5 e; h+ JMethod 14
. E, u; K' }# Z7 x1 l" f" O7 f=========5 W6 c, @4 C( f+ p$ a9 |; R8 H( p) k
H9 b: Z/ l% T+ { O- M$ W4 x* a
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* J' o! F* A& p
is to determines whether a debugger is running on your system (ring0 only).% M- b( u! }3 ?6 s ?! E" x( z. o
% Y: E" B$ @7 ^0 _# R+ B
VMMCall Test_Debug_Installed& Z0 I' r$ b. j0 i2 R* v
je not_installed
7 h3 I; F% M" k( n+ C5 X; C* O8 |, e
2 G! o6 K5 m" U; [! w }' q0 QThis service just checks a flag.
3 ?! b: X9 B4 C0 H& n& j1 R+ _</PRE></TD></TR></TBODY></TABLE> |