<TABLE width=500>0 b0 P5 l; B5 \5 K/ {. K7 B' \
<TBODY>
3 I5 h4 d8 `8 m# j) J- G<TR>0 v" s+ }* e; d) y5 ^$ {
<TD><PRE>Method 01
& P8 a( [2 h; a( L7 {=========4 E1 L3 n/ s4 b. _5 |, A" o
1 _* s5 G( I1 G9 D3 Z% L' F+ ~This method of detection of SoftICE (as well as the following one) is
; G; |' P# Y. t! @used by the majority of packers/encryptors found on Internet.3 }8 Y5 b- u- J0 j# H7 g9 Y) M
It seeks the signature of BoundsChecker in SoftICE
8 r, M2 c: N9 S6 N& |" g$ q: p- d: L
mov ebp, 04243484Bh ; 'BCHK'
: I' c0 Q# |* s2 W v a5 l mov ax, 04h
. Q: Y! T! [; ~( O" a6 \) m int 3 1 J5 t; J7 i1 w
cmp al,4
3 e* c& i+ y( B6 ~3 B7 ?9 x7 ? jnz SoftICE_Detected$ ]; t# ?: A. A, K2 v; L$ D% e
7 j- i5 y7 Q- h9 l! C' W# [, V
___________________________________________________________________________
1 w& Y$ ?6 }2 f. s3 p; u& ?: a! k; I$ o: l% g/ @, k
Method 02+ K7 i$ d7 M b7 d4 D1 x
=========. v! x/ h7 U& Q4 H0 x6 s8 R
, z4 A- \3 i0 e% M4 Q' w; i3 M
Still a method very much used (perhaps the most frequent one). It is used
$ w; C! @* m0 [, N6 hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,( ]& i1 B9 w7 M$ ]* P; _# W1 E
or execute SoftICE commands..." [8 A# N0 Z M$ R
It is also used to crash SoftICE and to force it to execute any commands
1 v# \( @ V. @6 V. G( R(HBOOT...) :-(( / x O4 y% H7 ?( B; S9 r
6 E3 _: O5 o* O& V% N5 {4 q2 kHere is a quick description:
) f4 H. W4 Y4 ~& D; ]/ }, q-AX = 0910h (Display string in SIce windows)) w, P7 X4 F2 i+ B# E5 R+ z. B! l
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
+ y" p8 i. S) S# Z3 P$ Z* [-AX = 0912h (Get breakpoint infos)5 A9 C& G. ^& V7 r4 y
-AX = 0913h (Set Sice breakpoints)
8 ^- |3 s. Z2 J-AX = 0914h (Remove SIce breakoints)& n5 j; ~0 Q' g! e4 S
; J$ f* h# X6 O3 b6 ~6 G8 ]- y9 |+ `Each time you'll meet this trick, you'll see:
! r5 ^: M0 ]* z0 Q! {/ Z- x# G-SI = 4647h) T( Y# Y4 f( ]; O$ U
-DI = 4A4Dh. w& D* @9 C5 }1 W* o w9 j
Which are the 'magic values' used by SoftIce." X3 C5 w- g A) a' J. ]
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ D7 z0 o. P8 R/ d3 l* T( _( f
" D9 I% z9 l. u" J. S( x" h' W; ]+ D
Here is one example from the file "Haspinst.exe" which is the dongle HASP
' e+ x6 w9 x" N0 b. {- Q) lEnvelope utility use to protect DOS applications:
% ~: b9 G1 L' b8 c! ^+ ~& a# |
9 J2 V: z# y* d( l0 o
, m0 p- i+ j5 k' d* c4C19:0095 MOV AX,0911 ; execute command.
1 v1 g4 Z2 m! @( V' K) v5 x# n4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 o, Q% z3 K: E7 ]2 w4 C
4C19:009A MOV SI,4647 ; 1st magic value.! `+ @% e9 N. w: {9 s' O' W5 T
4C19:009D MOV DI,4A4D ; 2nd magic value.
& S, H* q5 A' s) Y4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' H; t$ u5 G$ M" t4 P
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute" D1 h& T$ b, u' a
4C19:00A4 INC CX
1 P, m$ r. |8 Z t* Q, }4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. n7 S2 G8 V" @7 x' C i* {
4C19:00A8 JB 0095 ; 6 different commands.
6 h0 G6 o( C' I& v' U4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 ]3 w6 V, ~! l2 p) d, B* M5 K& h
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 p, m9 z( F5 Z" _; E: g
6 k% W3 C8 N: p4 hThe program will execute 6 different SIce commands located at ds:dx, which
6 N5 C5 s7 k% D7 i% Lare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( V( b/ \) R% V& ?
3 s5 _! O! f7 X) n4 c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! D% i# P4 N1 {2 w. J7 }
___________________________________________________________________________
: p* D2 W, t3 f1 ^: D( v' B# X) s/ c1 {8 F- n* s) @
9 G2 \! y# f! [: Q" G! o
Method 03# I8 ?- k6 [. N5 r: d
=========$ K1 m! `9 h. D9 R- f
; x+ e. k5 ~' C( b: f3 VLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. m8 R0 j8 k! B" U- k! Y3 _' ](API Get entry point)
% L( F; A& e/ h" [! J& }3 U+ O 7 o' ^ L! ]9 G3 V: O
) u5 v5 H, ^, r5 K0 `' }
xor di,di, V% J7 H2 X6 i7 O" S7 \
mov es,di1 c9 ]8 v5 X# g5 o
mov ax, 1684h
$ y6 }4 @& n& k/ h2 u- f mov bx, 0202h ; VxD ID of winice
5 o$ w' x( t. S) A# T int 2Fh
) c8 F: T M p) c9 |2 a mov ax, es ; ES:DI -> VxD API entry point
' f# M, Z3 \+ c% g2 o: p0 F add ax, di
& Q+ N3 v. g C7 h# | W9 \ test ax,ax
8 j; M+ G, M+ G, j jnz SoftICE_Detected8 L8 f/ T7 h1 o8 @+ N
7 x: [( n; L; v6 O' i5 E- m___________________________________________________________________________' \- T9 y _% [
# K4 r; @1 [2 F+ V/ w5 I5 K
Method 04: {6 z2 p W5 T3 @4 u
=========# k N t0 x7 n$ e- O) d' {# |8 |
9 \5 V! J( `( ^Method identical to the preceding one except that it seeks the ID of SoftICE, j' Q+ C4 k6 P7 g1 U
GFX VxD.5 a, e( O+ S- i( N7 T% O7 e
( y. I% ^$ c. u$ ~3 m8 \$ o6 R# C xor di,di
+ y5 V$ K' P( Y3 G* d mov es,di
# y8 N6 i% z h) L$ u0 L mov ax, 1684h * w4 ]/ s8 |( d' ]1 X* R! Y1 q
mov bx, 7a5Fh ; VxD ID of SIWVID( T( B" g- H6 V9 |/ D8 l6 e
int 2fh# W7 \: e# Z3 N! j
mov ax, es ; ES:DI -> VxD API entry point
1 K# k% R- q# b add ax, di% p% Z& A/ m& W- X6 ]3 C
test ax,ax4 v0 t4 X: }; u
jnz SoftICE_Detected+ f; L/ N* Z& l$ p3 g& a& q- @$ S
3 n' {0 D! W* V+ [
__________________________________________________________________________
. h* S6 c* V( N4 D+ M# Z! ^! `0 \' b/ H
; {% Q# }! L+ h2 XMethod 05
! u/ G: C2 F4 N; ]: a0 {( e=========0 A9 _: N& z8 p3 I
; w* l6 g" _. ]6 E& f/ F
Method seeking the 'magic number' 0F386h returned (in ax) by all system, {* N s6 `* r" N' h: H( G
debugger. It calls the int 41h, function 4Fh.
) ~0 O+ h1 Z# r0 k' wThere are several alternatives.
" m/ j+ R4 s+ k. y. |# X8 x( i. \8 Q! ?; N; K( l; \9 t) ?7 n
The following one is the simplest:
/ ]$ z0 q. j! R2 u+ y4 i+ P$ |7 e4 \ r! @. o; C9 _& X2 {
mov ax,4fh$ H; R' p( ^3 \# j: _! q
int 41h
+ i, O4 r. U2 T- J% I+ A' {. K% p/ N cmp ax, 0F386) Q! V' i( u2 L' v5 e. n
jz SoftICE_detected2 n7 Q: ^% W: ~( Z5 v) ~
7 e" t% P9 ]: M9 D
4 {& j# T$ I c0 J+ Y+ ?Next method as well as the following one are 2 examples from Stone's
- `' x7 l, t6 o' J! S2 k2 u) A' T"stn-wid.zip" (www.cracking.net): I9 M* r% k& v4 L3 `2 ?" ]
1 j- Q( L! o5 V; U
mov bx, cs
6 D) S9 S4 l4 a& ?" o9 F( k, @ lea dx, int41handler2
* ^) x' t$ s [2 l, P xchg dx, es:[41h*4]
. ~! B0 @ v$ O1 f5 H xchg bx, es:[41h*4+2]3 J; s0 S8 }5 x- a( l
mov ax,4fh/ F9 ]( U$ s7 U3 e4 K" W9 t' }
int 41h
) T* k1 b& R9 I/ v& W5 j' L# Y xchg dx, es:[41h*4]
# I) C& Y- k+ N. V4 T* s xchg bx, es:[41h*4+2]0 v' M! _* c7 c2 N. f0 S
cmp ax, 0f386h
! L+ \6 d2 F( N- R* ? j! V jz SoftICE_detected4 m7 O' F* G. m
. n6 H; V* D& Oint41handler2 PROC
' G' I$ @0 m" o iret
3 F7 c4 i5 U1 K6 Pint41handler2 ENDP, N K0 t# B5 g. y) X" U
L/ r* q/ O0 o) p& A, J, Q8 O
# n" h9 t7 d. a, ]7 r_________________________________________________________________________$ \% B; }. K) e# V4 B
3 ~( [0 H# J- r+ t* }% w
. V$ C" T: ^) R5 N+ C3 F3 M% ^Method 066 A; ?3 ^. `. F; J$ J0 b6 k$ S
=========
" ~4 Z1 Q! ^& k) t) p& N
' s4 q" Q2 k+ ~' D. L
; @0 ~* d* S( Y% e6 D2nd method similar to the preceding one but more difficult to detect:
% ~8 L+ |, U0 p/ U" s: H4 Y
" x+ d) E& I- @1 s: w0 j- J6 W# E& _
int41handler PROC6 h6 |& n7 P Z# g
mov cl,al
8 S3 w K6 e6 w0 h8 G& ~3 O1 x iret/ V8 m: S6 }, y; V
int41handler ENDP
' T. I7 N, x1 I# K& f
( n; o6 K% ]7 A0 D# V) }/ l- S" p/ `% P' ^- t8 y1 v* Q5 S$ |( ]
xor ax,ax* M5 g: ^: s% d* o! Z( D" Q" @* r
mov es,ax9 S7 O3 O# C9 Y
mov bx, cs
5 i, e" @8 P4 Q& }$ d& M h lea dx, int41handler
4 ` C& y* \# `1 u; T xchg dx, es:[41h*4]+ e5 F; o$ i& f
xchg bx, es:[41h*4+2]" B% s/ {- q' K( _9 T4 r$ W
in al, 40h
+ m$ a7 B5 e; k+ D4 G* ?( D xor cx,cx M: p3 m! ]% X! i. S# @* [0 p7 s
int 41h; J; U* |2 J7 z0 J* F( M2 z O
xchg dx, es:[41h*4]- V; s) d* P' N [& z
xchg bx, es:[41h*4+2]
# t& u0 G9 Z2 H& z9 M cmp cl,al) f+ x$ z; |) e/ c1 x
jnz SoftICE_detected
& U8 `+ M: @1 S. C P6 M% g
! l" r$ R4 e" @# @5 o5 T_________________________________________________________________________) z2 x' @; T+ U( B& ^2 n4 P8 K* l) B
1 Q7 ?& g5 V( x8 U7 m: j- `8 q. w
Method 078 Q6 w$ N2 N& z5 h
=========) N! u+ R+ j& N& a+ _
5 L Q) n5 ~7 J4 J* Y2 Q7 }* x5 lMethod of detection of the WinICE handler in the int68h (V86)
o# V2 T( |% K! b/ C
, u. Q1 i9 `" r! Q mov ah,43h
6 k5 i; M9 F' N8 u, n6 Z6 O) { int 68h
) [* A# N; j% l; ~; e cmp ax,0F386h
7 M4 { Q! H( A- `- k jz SoftICE_Detected) w: F+ ]! \9 i
+ b% f) W+ |& }0 @2 V
0 M" h3 S5 w) V/ ]=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 R8 Y0 ~# e* F9 t% B
app like this:
; c1 k( ~- x: l. |% T7 Q& ^! d) _& v8 X
BPX exec_int if ax==68
9 ~- E, M& @ f) j (function called is located at byte ptr [ebp+1Dh] and client eip is
$ L D( I" M9 z. V* r" B located at [ebp+48h] for 32Bit apps)
1 S7 I, o$ Z# v5 \; K__________________________________________________________________________
. X+ f% w$ g# x9 i/ D! f- r
% t! G, w7 L; M+ i: X7 B/ b* L% P
& k Y$ L ~/ J5 z0 c0 E. X2 @4 s" PMethod 08$ y% g( p& r7 f
=========
3 _2 E# E3 I) e6 H6 J5 P$ S& Q$ k! U4 S( H: T, m, B& S
It is not a method of detection of SoftICE but a possibility to crash the
- e1 X6 X; P0 A4 i6 bsystem by intercepting int 01h and int 03h and redirecting them to another+ Q R* S" K) \
routine.+ x' }; g& M0 x* j/ c' W
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: m$ x: z ]8 x. U7 W: L) Z$ \4 Dto the new routine to execute (hangs computer...)9 h! @- G* q$ F' K" {% O8 q0 }
5 K4 V% E* j; U; M0 L' } mov ah, 25h; J. V" ?) V2 z
mov al, Int_Number (01h or 03h)
( W# G. N2 X; x7 w; u; K mov dx, offset New_Int_Routine
@& k& d; ]: y1 M! L' m4 c int 21h
6 h5 A$ r3 M" A$ J- L
, J( [: {) _0 g/ P/ O$ w! N+ u3 q__________________________________________________________________________9 B! T. Q( D' {! b* k1 A
0 e! ]" [$ L3 f" D/ DMethod 091 A1 m$ R4 g/ Z1 p: d5 J
=========7 `# b, K' _! J8 }' B
1 { _2 B, j, u/ R0 f) C( Z {
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! A" E. c" z( J) F/ \* ]% J7 G4 Uperformed in ring0 (VxD or a ring3 app using the VxdCall).
! h- k, v5 i) e' \; EThe Get_DDB service is used to determine whether or not a VxD is installed+ f) C; Z3 J3 q+ g0 {7 N! A
for the specified device and returns a Device Description Block (in ecx) for
& b' t! v5 t- f2 Jthat device if it is installed. h& a% l9 J# r# [1 M$ e
8 b) w3 H) k: r% p$ X5 S. H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. ? V& v& x- ~2 ?
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 L. Z3 H5 y! q VMMCall Get_DDB
7 V3 }" b) `" Z) i* z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
+ Z y. h: E; A8 W) s' r/ B6 l `, S" H2 A
Note as well that you can easily detect this method with SoftICE:
, a0 h* k1 b: T7 E bpx Get_DDB if ax==0202 || ax==7a5fh
! a! V* I) x) T! j7 j# f- k+ D5 L: h- z, v
__________________________________________________________________________0 g6 x% b! Q/ P+ N- a. n. ?
5 y( t. D r2 b5 pMethod 10
5 D5 E. E, v# u=========
+ g( ~! P6 ^! z7 A6 B2 Z/ T* U' U/ E6 l1 L/ H
=>Disable or clear breakpoints before using this feature. DO NOT trace with' e% v* D0 z! `) ~* h" p1 m
SoftICE while the option is enable!!
3 P3 @. R9 O. Q$ a0 c) q% U$ v; ~/ J& u
This trick is very efficient:
* T% @. h! m2 R! l$ i) H6 {by checking the Debug Registers, you can detect if SoftICE is loaded
& x6 u( o+ Z8 v3 k) d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" I/ f6 x5 U. ~% P( k& L/ ]( d# zthere are some memory breakpoints set (dr0 to dr3) simply by reading their
7 C. L& M1 i* s5 B$ nvalue (in ring0 only). Values can be manipulated and or changed as well! ^% E5 d4 t6 F
(clearing BPMs for instance)# i. x) r8 k* T% P6 n8 q: F2 Z9 s
$ g" L+ V. d+ `9 p
__________________________________________________________________________
( A0 p% U8 g: m. p
& l% r' N) d( x9 uMethod 11
) Q' c& I" Z9 d4 G6 |$ z4 Q=========# L5 B# k& g- c$ z( i- h
2 d) p" X/ m9 s, N9 x
This method is most known as 'MeltICE' because it has been freely distributed$ `& y- q$ C4 ^" u/ j% a
via www.winfiles.com. However it was first used by NuMega people to allow+ _% J- N3 f1 b* I5 w. H
Symbol Loader to check if SoftICE was active or not (the code is located
7 `& w0 a p& s* s" iinside nmtrans.dll).
# S! p. A/ t4 i- K5 Q+ q7 L3 i' E8 h+ k* B2 t0 `: o9 j
The way it works is very simple:
9 J' E# F- ?% F6 ]6 rIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# l0 v( t } ~! E/ ~8 XWinNT) with the CreateFileA API.. g$ h8 f% }* }7 ~' s: I" g1 p
8 Z! X6 N3 G4 \' l+ g, {8 KHere is a sample (checking for 'SICE'):
6 B; b# ]$ `( R2 p7 v' U- R* f$ q' e7 W
BOOL IsSoftIce95Loaded()& _) B: Z3 L3 K* y2 Z( i2 d$ ~
{
! g; a; v9 \- b T; } HANDLE hFile;
; t2 f5 B( ]- ~4 v2 u hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* f) R* x0 L8 R& ^1 M FILE_SHARE_READ | FILE_SHARE_WRITE,
! A& n- b( a: l8 ]7 n" a/ p NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 Z8 d8 J4 T- ]8 Q8 {, Z if( hFile != INVALID_HANDLE_VALUE )
7 e9 p: Y" R8 y! \% W1 }6 B, o {) _- K) M/ n& H- E' W
CloseHandle(hFile);
& y, D) M1 l6 C& \4 O return TRUE;& l8 J, r# t' M8 g8 c' o( u
}, _2 ~5 b0 f" c4 U
return FALSE;: a, }$ |- X& X/ t g0 E9 ]# q, Q
}
# b7 l5 t/ b0 a* o5 y% R# t0 _
/ b5 x% d9 N3 kAlthough this trick calls the CreateFileA function, don't even expect to be2 f: V1 C8 w- M7 _: L
able to intercept it by installing a IFS hook: it will not work, no way!/ }4 v7 W5 @- \, D1 \" E
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; I- E+ H w l: e4 G v$ M
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- l/ u$ u U5 T( f
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
# I% X3 k5 H* e$ j, B2 O1 Jfield.2 W/ ~. k2 k8 W6 O2 O# Q' ]
In fact, its purpose is not to load/unload VxDs but only to send a
7 B1 ^0 q% i' p5 G0 [' D CW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 r; f }7 M* e
to the VxD Control_Dispatch proc (how the hell a shareware soft could try" j% u9 D$ M0 O3 y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 t2 N3 G6 X% W+ I% h5 A' t
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ U% |8 u5 o5 {- _# X' T
its handle to be opened and then, will be detected.
8 s2 { X$ H! W( o f6 D( f4 X' e# q& S- bYou can check that simply by hooking Winice.exe control proc entry point
7 }2 `4 |; u( y5 Z3 {9 l2 R. y5 y) y5 awhile running MeltICE.7 O8 }/ a1 |/ D
% E v& ?9 t3 L) @1 J& U& B" x
6 F( a. C, M' s7 d- O
00401067: push 00402025 ; \\.\SICE
8 r. _) e: \+ F0 O: h: H 0040106C: call CreateFileA
l8 q7 O+ n* y' W0 E$ X 00401071: cmp eax,-001, k, L @. k% |+ l$ G: N _
00401074: je 00401091
% c; r9 p) M: E! x* I# ^; Q- s: e" t& H+ z- p* u
6 H6 d* {0 x/ m, e1 l" c1 [6 x
There could be hundreds of BPX you could use to detect this trick.
/ n6 q+ n6 `& C: z7 u/ ]-The most classical one is:! @4 s8 q. W' B p
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* g7 u( a# H9 M1 m *(esp->4+4)=='NTIC'
7 b: J+ R7 h0 r+ u+ h& K+ T0 Q( W+ y) G% `- R# u# H
-The most exotic ones (could be very slooooow :-(
2 Z) e2 R. t7 h- h BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') : H" W1 u1 A; _* N5 s6 h4 R7 X" v
;will break 3 times :-(* V3 B* P3 E; `! ^: U
5 d8 Q: o. m1 Z' R-or (a bit) faster:
1 h: h- X1 n+ _) z0 l; y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* o3 V& H+ t! m& W' z4 [2 h. R2 Z; K
( O+ g& d8 U% ~1 X* `
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 w! A- V. O, V3 `. e ;will break 3 times :-($ p9 ]% N8 F& [7 D4 K/ H' O% V- M
1 w7 ?$ \) \ r1 G2 U( e7 Q-Much faster:
2 L$ D% ?% D' a; [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. }6 m- L4 \% E9 }* i9 z! A g
# t8 z5 c( i. `3 V/ I1 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 Y2 ~' W9 s) [ b hfunction to do the same job:# @3 @* a& O+ u# w+ V
1 r6 X: A- @2 k4 l
push 00 ; OF_READ' { T7 O$ u1 i
mov eax,[00656634] ; '\\.\SICE',0; b5 L1 T0 C' L; }1 \
push eax
0 f2 T9 `6 k' ]8 E call KERNEL32!_lopen i* ^# N6 k9 ~5 S. f/ I
inc eax" S. `. p b9 v4 t
jnz 00650589 ; detected
! H D' y* U: t$ ?! \ push 00 ; OF_READ: m% b& u7 \3 [0 h/ t% p" r
mov eax,[00656638] ; '\\.\SICE': T6 Y' _. C5 M. s" }+ p
push eax4 W3 _) ~2 I# Z/ L6 \% v/ r) ?
call KERNEL32!_lopen
+ y5 I5 K2 ]% [ inc eax% ], i! J9 G1 P$ L5 h2 [: Y. H& s# B U
jz 006505ae ; not detected
7 i: U4 W2 ^- r2 r
& a% I) [ Y; X a7 M
' S+ u3 K ^4 `9 B5 b @( ___________________________________________________________________________
" I' X/ @' D$ E! P) h1 z- Z) t8 z* x. z- q+ _; e5 |$ n
Method 12
% q2 {: U7 X. w" s' a$ w5 \& s=========2 V E9 {; l, d, r+ {3 @( f! Q
% K1 g; A6 R( e( i2 x: Q
This trick is similar to int41h/4fh Debugger installation check (code 05# A! o" f7 z# q3 c2 t/ I+ a& x* s
& 06) but very limited because it's only available for Win95/98 (not NT)9 P0 n' @+ h4 k, ?' ]4 |$ y$ o
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
1 A; r# ^7 _- J& {6 x
# d, t7 \" B* k f5 T" N push 0000004fh ; function 4fh7 k4 I6 K/ x( f7 M5 r- b( W
push 002a002ah ; high word specifies which VxD (VWIN32)
3 g2 i" G( g8 K V ; low word specifies which service/ G; F) o. V' S0 v7 u! f# c7 I
(VWIN32_Int41Dispatch)
* B2 _0 x4 O; h0 ~ call Kernel32!ORD_001 ; VxdCall
6 \; I1 w* t: r2 _3 k cmp ax, 0f386h ; magic number returned by system debuggers6 B6 W8 y3 x9 e2 p* J0 Q) i$ a
jz SoftICE_detected
' @4 M; j; V, ?+ T8 r8 V r% A. b% q, L8 S4 n
Here again, several ways to detect it:3 R G" @0 F9 h. I0 _. \ e
# P* I: I$ K/ g6 f' t% S7 ? BPINT 41 if ax==4f* J! w1 E$ o+ m( s* C' h
' p ]4 p! Q! [4 Z9 B; W) F0 \3 ? BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one6 N* s9 N. }% e4 r6 B- A
$ v) a! ~* _- A: X' v; [
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) I; F4 W) d: d5 S. Q z
9 e1 T2 F3 v& O BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
% B: b' U) m; v2 a L8 G: w* r) ?* J4 E( M! K# I/ n
__________________________________________________________________________4 W* N) A. K, \: |
( b2 p8 I4 p0 s1 X/ h/ |' a
Method 13( R, ~( c5 f6 O. z7 W3 q
=========
* @/ _& }2 {/ a* v, h7 ^5 X- }6 V
! |) ]; Z5 P5 Q* |& XNot a real method of detection, but a good way to know if SoftICE is) X$ W: K- ^/ m. C n9 s0 z9 K
installed on a computer and to locate its installation directory.9 @3 K9 D; K Z: d& D8 x) e
It is used by few softs which access the following registry keys (usually #2) :4 Z1 W$ `2 R9 L9 k+ m1 R8 c
4 y2 ^8 l6 c- Y8 Y" ^2 C
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 _- D6 P2 s$ T1 v% d6 e
\Uninstall\SoftICE/ i/ j6 h; z3 T) ?' I- b3 ?4 \
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ z5 R: l4 Z5 i1 s4 r3 T-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) N/ B: v3 o% d- J$ a\App Paths\Loader32.Exe, t; f! v# Z2 A9 U M
9 G( I, s3 F! i' y/ b$ w& f: P. ^; t) T5 B* a$ \7 M3 b' g
Note that some nasty apps could then erase all files from SoftICE directory
2 R7 {4 c2 M: ^; i x(I faced that once :-(
: Y# n: M Y# I; k! n- `6 g) t$ s3 D
Useful breakpoint to detect it:3 r! C" B2 R0 N3 H7 R
" L( r- ^" [$ I BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 G. _& h. d `4 D
" Y; @# x: f" P% V__________________________________________________________________________
5 M z- o& r1 K1 Y
1 x% `: U2 p1 F' Y# r0 o: N* v$ W# U8 V- P/ Z" b
Method 14 & Q" h9 Z3 w* b( e
=========, v* @( L6 m7 e# H- n$ }5 v) O
+ r' e5 Z, S: \. A3 J$ S' T
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
`: [$ n! W* dis to determines whether a debugger is running on your system (ring0 only).
' {+ `! |2 v. ]3 K
( @8 I$ v" V G8 u/ U; ~- V; F VMMCall Test_Debug_Installed
9 `& c) g- R6 U# c je not_installed
7 A2 z5 F7 ~& l& K4 B3 c+ w4 q2 O3 k2 E; [8 o( Q4 z+ ?
This service just checks a flag." x' j7 l" O# p. R) D! O
</PRE></TD></TR></TBODY></TABLE> |