<TABLE width=500>
* L Z9 k8 b2 ~/ h3 Q! D<TBODY>
7 ^" f% J1 b0 R/ l<TR>
% m# K, I0 Z6 @, F/ P, i* P<TD><PRE>Method 01
/ f8 e Q9 B+ _4 I# w* N=========3 d6 e- Q9 S/ O
6 e1 B8 W0 a3 fThis method of detection of SoftICE (as well as the following one) is- X6 j5 t( A' V4 e7 _* N/ g! ~* T
used by the majority of packers/encryptors found on Internet.
( J Y# G7 e" C3 C- }It seeks the signature of BoundsChecker in SoftICE; @4 t/ J1 G4 Y/ z4 @
. P2 e# }9 K/ W- r mov ebp, 04243484Bh ; 'BCHK'
/ C# x, ^ ~, G' R$ y* D mov ax, 04h
5 h8 G; P+ g5 t$ U/ Y int 3 ( @3 V( `! F9 g3 ~
cmp al,4
( x: U" s: d5 v/ u# b jnz SoftICE_Detected
. u; o/ P9 k1 X, k( B8 T4 O- M/ J: l: T. C
___________________________________________________________________________
' e( y% g& L4 ?2 T# t. F; ?
9 H* R0 L0 E7 W# W, mMethod 02
" `# `5 t& j5 J1 ?/ c: E+ j0 e: G=========5 f% t) D: n! {- [% u3 }. U
, G; }: x5 N/ Q# `Still a method very much used (perhaps the most frequent one). It is used
/ m$ {6 J, I8 W8 h, mto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, O# c+ ]! f& n% s" F+ v4 G6 U
or execute SoftICE commands...& t" r/ V: I4 u+ z2 ?; w. [
It is also used to crash SoftICE and to force it to execute any commands
O) _1 R- B3 e; C. z(HBOOT...) :-((
6 V! ]+ p9 S5 H( l2 a; B/ p
$ c/ g ~$ F/ O/ y- v: M! p$ XHere is a quick description:1 g, l2 a$ c# Y* k# c- {9 `% |
-AX = 0910h (Display string in SIce windows)
5 H, K+ L5 r; A7 h. ~& i. ?% f-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 P+ |8 @3 G& w$ h5 S4 r
-AX = 0912h (Get breakpoint infos)
( r* J8 t ]* g-AX = 0913h (Set Sice breakpoints)1 a8 m; U3 G# b6 X( u# h9 I
-AX = 0914h (Remove SIce breakoints)' T- X/ K$ \( w a0 ^- \
4 T6 n& i3 u1 g2 KEach time you'll meet this trick, you'll see:) u2 [1 g# ?8 g$ |# i7 w# t
-SI = 4647h
; J) J' D& y w4 c+ i1 q-DI = 4A4Dh' T1 Y+ Q' R8 \- r8 R, @! T4 G* E( B
Which are the 'magic values' used by SoftIce.
; Q. v& \6 e. L* f) s5 KFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; D( S" f& Y3 {% n* N8 s
, N5 D$ `2 h/ {+ E+ e9 a! CHere is one example from the file "Haspinst.exe" which is the dongle HASP f0 l6 V$ ^5 R! G
Envelope utility use to protect DOS applications:
0 d n3 m6 c- {6 }4 F+ w# M" U4 G/ r! u4 `' {* ^) h- C
0 l s" @5 V/ N# [4C19:0095 MOV AX,0911 ; execute command.
- @0 Q9 }, M+ F) N3 p4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
' \4 Z- T1 P9 @( _9 V3 ]/ \0 f2 T4C19:009A MOV SI,4647 ; 1st magic value. o4 K& y( g, s, r4 H# V
4C19:009D MOV DI,4A4D ; 2nd magic value.' [3 M+ }4 w9 L8 {# O( A# _
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& m9 A6 n; A/ n# B; m4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- d: d, S7 o# W9 f# k4C19:00A4 INC CX# \# D8 [! U; ]6 \, ^4 `: q7 y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# @! C. _' o3 `3 N4 b4C19:00A8 JB 0095 ; 6 different commands.
9 s1 Q. x, l8 h G4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- h" E# @9 p$ F- z4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ n4 w- \( M! G+ F! V$ }
- O- y% G, `8 a8 l' ~1 p& {. `' uThe program will execute 6 different SIce commands located at ds:dx, which/ I9 ]8 T# b& R r, n+ v J) m! M2 b9 E
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! l$ B' H" o! {1 v. x% n" n; S' y) V1 W, F4 u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: ~& t" J$ v' {# g3 X$ K0 V+ J, A___________________________________________________________________________
* A& X) |8 w1 h$ F1 M; I
& B, `% W/ ^3 f2 C5 G# f& B$ P2 G( q3 l1 K
Method 03
" b2 o5 Q3 |8 e! j, U( }=========, l* c4 |* \- X8 t9 ^& h
9 w# e1 K/ A$ g8 q' bLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' u+ j% P- d- l
(API Get entry point)
8 ^, C! f3 o0 F# G- @- L+ C $ h4 I& @. q+ o- e3 f
. F+ Y8 i+ ?( ]7 \" n$ P- `: [7 U& a xor di,di
O& E& R' e1 L/ I! d3 U2 V/ s mov es,di
0 k) M, K& i7 I' C+ u mov ax, 1684h
, e) b0 W# c2 W/ P( Y/ \- \ J mov bx, 0202h ; VxD ID of winice
: D8 V. p t, n; u% @5 T( z# z int 2Fh
7 A8 j4 x0 g. v mov ax, es ; ES:DI -> VxD API entry point1 i1 h- h* a$ Q. Z0 I% R
add ax, di; d7 q6 x5 t5 w- t) u
test ax,ax
0 i6 h, B0 Y+ e3 P! J3 A jnz SoftICE_Detected
! W; p0 T5 s' D+ p9 F% ? a5 d) C( W) s+ v
___________________________________________________________________________
" e8 G) ]5 f# k' q! V! p& p5 ?
8 {* |+ I/ `, l/ l* r5 s- M3 xMethod 04
2 ~# c9 y( j/ e4 Q* q* e( B0 j3 [=========3 x. ^; w- _' ~1 `1 M
$ s# f) K+ o1 H- s* F
Method identical to the preceding one except that it seeks the ID of SoftICE; d4 d* P" O' d" I; I3 N
GFX VxD.
U" G+ m4 S6 V, \4 j( d. D0 B1 H% n; r, f
xor di,di A& Q) \6 J4 \ Z2 G9 {0 d
mov es,di) |) G5 h/ M7 Q8 [ M
mov ax, 1684h
$ F# Z/ K5 b6 r. T. V" P mov bx, 7a5Fh ; VxD ID of SIWVID
5 r- c& l( F) Y1 z int 2fh% a( @! J- }. \
mov ax, es ; ES:DI -> VxD API entry point
3 d8 _- C/ e2 a; L; L' g& B add ax, di$ w! f9 ], j; P; V ?; H. }6 Z1 l
test ax,ax
+ B) z3 O7 s }: W3 t, s jnz SoftICE_Detected
. L V" l `0 |3 |5 g7 q8 i0 g! c8 z H( b, z* j6 c
__________________________________________________________________________& O9 H/ z( o3 f/ F8 t8 @! T2 j! Q% x
8 y6 ^4 P! n, D8 _6 r9 @
7 V3 h4 F* [) r$ TMethod 051 I$ ]& i# }/ q$ Q% w5 d0 } k8 B
=========
" _0 X- a9 Y4 ^" G" Q# c. ~# W- X& u2 m5 B1 R' Z. E
Method seeking the 'magic number' 0F386h returned (in ax) by all system2 c0 f, y, I/ y1 p' l
debugger. It calls the int 41h, function 4Fh.5 j7 Y# j) m8 V( R+ z) T
There are several alternatives. ) c$ w( } ^( B$ @& y3 B7 i5 U
8 }* U- T, c& j/ P. Q
The following one is the simplest:4 {; Z! v0 |/ s% k }3 y" Q7 {
( r9 [5 v6 O+ R$ f( f6 U
mov ax,4fh+ a1 u+ Q! J# @$ ^6 e T) g q
int 41h
: y; G9 c- `; z4 K+ m cmp ax, 0F386
: H5 u2 v# k c( M) {3 P$ q( `5 Q jz SoftICE_detected9 e1 S+ A$ X d' \/ l9 b1 X
6 a- I* o; F6 b5 c7 K3 N0 y* P
* K, G* ^- B! w# r: F" j+ Y7 hNext method as well as the following one are 2 examples from Stone's . E5 H1 M; _3 y* G9 E y0 l
"stn-wid.zip" (www.cracking.net): \! \& Q3 o6 A8 m
% y: F2 r, G0 c8 F mov bx, cs
) Q' i$ B! F( {5 h5 }9 D lea dx, int41handler2
: q8 Y) h- b8 |, [8 E& Q0 X2 ?) N xchg dx, es:[41h*4]; I- g& K5 \0 ~0 |$ E5 W, r
xchg bx, es:[41h*4+2]8 W7 l& n" t7 @, M) Z
mov ax,4fh0 a# {3 V2 `# R5 V
int 41h6 s; F5 y+ n: ^3 B
xchg dx, es:[41h*4]5 z; x# i" A7 n* C x
xchg bx, es:[41h*4+2]( \$ A2 v2 J: m
cmp ax, 0f386h
# V/ D( v; Z; { jz SoftICE_detected9 _" M6 t5 j% }, a' V; K) X/ ^
$ s( }4 a# X+ A% `1 tint41handler2 PROC7 v, K# q/ U+ l. R) q8 D* P0 x% h
iret
( k2 V' R& t; \# o& }8 k+ ?int41handler2 ENDP
+ i( ~. B. L$ l4 h1 l5 ?! J
: S! \" O; i7 E& u
) W: k7 s/ T) M$ p8 w: m- M_________________________________________________________________________
2 H; ~# T; S" i7 o5 _
6 ^5 X$ e# ~" k2 z2 Z5 [# d- k" w8 ~" e6 D, l }1 c
Method 060 R* @; e% P5 g, b( ]% B
=========* z+ j2 f, V0 s4 c- M
9 L% k L; u% i" V2 v
* m" F+ u7 K+ _5 M3 _6 a9 ]" I; }
2nd method similar to the preceding one but more difficult to detect:( Z, ]3 n p$ @3 _, b# G8 G
! `: v- a3 _8 M, } X3 ]% v6 O' `- G) h3 G) b
int41handler PROC
: s' t- m# a: m1 x/ q b mov cl,al6 A" | R; K& M( G- t
iret; _# z, \7 w( ~. V( N9 W) n" U
int41handler ENDP
: A; s ^1 N3 r* V- S
- u( q8 u! q- @/ _0 t X3 n% _# [$ J, v8 Y
xor ax,ax
! V* p" J" c& M mov es,ax
% P1 N3 V6 e$ S mov bx, cs" \9 G: D2 v" b( ~2 z. O2 n
lea dx, int41handler# G( W! }: B; v2 s8 o
xchg dx, es:[41h*4]
, P; p! \; D% @1 o) ^ xchg bx, es:[41h*4+2]
+ N/ ^; A) D6 S6 L5 b4 g" B/ o1 w! x in al, 40h
9 d; E r' y( P3 n8 E# L xor cx,cx8 S2 K/ J# M# n, h9 z
int 41h
6 Z8 Q2 O- o. y* J xchg dx, es:[41h*4]
0 H \) i) u; N8 d xchg bx, es:[41h*4+2]& y" n1 T4 c0 X9 _# w) i# r: M- k
cmp cl,al
5 L& Y- H- h) @6 n jnz SoftICE_detected
$ q0 R& N4 H+ p1 I- C( y' g M4 }' k+ R ^1 y9 |. F, {) A5 |$ w
_________________________________________________________________________9 D7 P( M4 r: A7 c" k+ H4 x: l
5 m1 H" C& M: l# o; `7 ]
Method 07/ _2 R# j0 W" f A7 g
=========
6 `! ]" ~& G+ D$ Q
6 j; ^ Z7 Z$ u8 i! gMethod of detection of the WinICE handler in the int68h (V86)
D) d- M4 K% a2 R2 j, c, {3 [( v
5 V1 s+ V& t7 t( U/ o mov ah,43h- b c/ @, A4 z7 _6 R' b# l2 Z! u
int 68h
, L# K! A4 m, C cmp ax,0F386h* j0 p H7 j; a9 _
jz SoftICE_Detected! p( u$ s0 k1 m/ e, T' ~5 x- P
% N* n, U+ z' Z& ?5 U' O) p
3 A( V j- m7 K7 e4 f& a
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 Q9 @+ }+ P# M% t) K( i app like this:
! K5 K1 X2 G& S1 V7 K
% K) _* ]/ e0 V: ]" C# Z! I L5 A X BPX exec_int if ax==68% O6 A, W6 s) e- X8 I n2 D; k
(function called is located at byte ptr [ebp+1Dh] and client eip is
8 d8 z: j$ y1 f8 R! y# R. b+ V located at [ebp+48h] for 32Bit apps)
$ K( K/ q9 F, S, _" D__________________________________________________________________________ C0 r' I8 g' g* ]) ~4 X! F
6 ^; A! l0 H4 ^4 B( [" Y
6 q2 S+ P6 U2 v g8 h( c% @+ i( EMethod 08* ?/ u3 p1 g q. z
=========
8 B5 k. [7 t+ ~; Z$ H1 _% l4 e! U0 f2 h) [1 \2 k) R
It is not a method of detection of SoftICE but a possibility to crash the
! K* _$ B: Z+ u/ Zsystem by intercepting int 01h and int 03h and redirecting them to another
3 p) u& P# }9 }7 }1 ^ ~$ n) a, z Sroutine.
, q$ D& l+ g' A. ~It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ J7 |" s+ x/ q0 {
to the new routine to execute (hangs computer...)
; O9 g9 i4 n0 H6 N- ]0 [) K- B, K# y- y( m
mov ah, 25h
7 H2 D8 F7 L: A, Y7 L5 b! ? mov al, Int_Number (01h or 03h)
& _7 A) d' f; z Z mov dx, offset New_Int_Routine' I$ p; N* u0 L1 a2 z% U$ W4 r
int 21h% y6 h$ q8 T3 S
: g& n! `/ g \9 s; K6 R0 g
__________________________________________________________________________
' r& j- Z# T1 X) _3 X( n$ c7 g' b/ h
Method 09% _/ T" m6 ^: z/ c: z; [4 z$ l
=========
1 D" y' F$ _! w/ w; K
8 z8 @. B# b/ M$ [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. `4 L) R4 c( I# }1 _
performed in ring0 (VxD or a ring3 app using the VxdCall).7 X. c+ m# D9 C9 C9 l8 f
The Get_DDB service is used to determine whether or not a VxD is installed
0 _0 ?0 X$ Z" | j2 kfor the specified device and returns a Device Description Block (in ecx) for
; @1 r7 ^# w/ l3 `that device if it is installed.
* G7 x/ }' q6 l* J# J; v, w% s/ ]
4 I- C9 @2 [3 w m+ ]2 P mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( @7 f3 `. b3 I. m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' N! J7 I" ^5 Y1 K
VMMCall Get_DDB
- ]- ?; Z/ b1 }+ f/ F7 l6 v& J mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( V$ e' V# c$ ^3 S5 }( i. v; Y, W" X- g# E; U+ A7 q# |
Note as well that you can easily detect this method with SoftICE:
+ Q* G H3 B0 w bpx Get_DDB if ax==0202 || ax==7a5fh& D" n& }2 }5 A" @* z$ C4 X
- |: ^" E% G$ E% ___________________________________________________________________________; b2 T9 }) m6 w) N
6 L8 D0 H: j! m1 \4 r
Method 107 `4 c6 C: n. f2 Z9 ~
=========6 K" d: x, ^7 `9 @
f4 | p2 }4 D4 y4 V
=>Disable or clear breakpoints before using this feature. DO NOT trace with
! \, B7 b9 y6 m# ~ SoftICE while the option is enable!!# W D3 V* V7 @3 a: d4 V) U! v& C
8 h3 [2 E$ w! I9 t. AThis trick is very efficient:; t1 W0 S3 P( ^3 | J% q/ E( _
by checking the Debug Registers, you can detect if SoftICE is loaded
6 n4 l% L' S" p- J(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if+ }3 s' F R! F0 u( K
there are some memory breakpoints set (dr0 to dr3) simply by reading their
4 r9 }; z5 }" x7 E4 F( S1 avalue (in ring0 only). Values can be manipulated and or changed as well5 P5 ^& Q7 Z/ x1 V+ H& r1 Z
(clearing BPMs for instance)
7 z0 _0 ]* X* ~
! v" i! c7 l( L5 y1 k1 `__________________________________________________________________________0 J" S6 {9 P3 h9 p8 u1 w; o/ r
: C2 g- D8 b& N8 x2 a; k9 u+ jMethod 11
9 c* _4 i8 k/ Q, f( o=========* [) ~/ c- m4 S" a- V/ F
) X" i( |0 N* \" M/ z+ g/ k; A
This method is most known as 'MeltICE' because it has been freely distributed
( R9 S/ [" o" h2 j' ^, S; Zvia www.winfiles.com. However it was first used by NuMega people to allow
8 x" V: o( _: d, T; hSymbol Loader to check if SoftICE was active or not (the code is located* i( _1 R' {* Y6 \* n
inside nmtrans.dll).
, d/ m5 I( w8 Z& P7 f" U2 [7 n* s0 [ g" k/ X. X f
The way it works is very simple:
% p' j' e* f8 Z1 HIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' F2 W5 C" A4 G# F) k h
WinNT) with the CreateFileA API.
; z( Z; Q. E: S7 w
. F, k0 ]! L6 q( u" W" GHere is a sample (checking for 'SICE'):
0 S7 T- W0 w9 p
7 _# C) M( Y& ^. O' t" I0 `BOOL IsSoftIce95Loaded()9 K! W( O- p. v$ K+ n# M
{
2 D& R/ g3 Z2 c+ L0 d% M6 ` HANDLE hFile;
/ q4 V4 ^7 J( k J. w" N hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) o8 }1 q% @8 r# `
FILE_SHARE_READ | FILE_SHARE_WRITE,
1 t+ V( S) p; X NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# G; ~" u% L. T6 `& c7 b/ Z$ T
if( hFile != INVALID_HANDLE_VALUE )) e" B: I* C* L2 d1 Y- n
{, ?! ~4 c8 Z* c$ M
CloseHandle(hFile);
+ H9 O, s& M9 w0 K5 l return TRUE;+ U3 X! U5 Q2 u- D& Z1 y
}; F8 w7 S+ |( a" P3 V
return FALSE;
" g1 o6 W% a- l7 M$ y7 j1 V3 t* {}
2 U! y+ w3 |2 }* V$ h
! B, z1 R: }$ d* i4 GAlthough this trick calls the CreateFileA function, don't even expect to be" b- t- ^7 O1 W$ b; n
able to intercept it by installing a IFS hook: it will not work, no way!
% c( z8 Q% ~! |/ w a2 E; ~9 XIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
7 _& F, o/ h6 g, ~$ Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& }0 _! F' v8 O0 R+ [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 k/ [& b2 T* }) a9 d4 F. o3 m( J( qfield.) Y: U# j: P1 j9 ]+ x7 q% y
In fact, its purpose is not to load/unload VxDs but only to send a
" ]/ x, T. Z, c7 k0 t0 VW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 [7 R& Q: w7 L5 X: L- ^5 F) \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# m( l& K. _% e% X6 O* a" Gto load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 |( Y# s0 Z6 c, H# [If the VxD is loaded, it will always clear eax and the Carry flag to allow
7 F' Y6 q2 k w+ ]/ M7 gits handle to be opened and then, will be detected. d& _/ L+ o( w8 m( _; I
You can check that simply by hooking Winice.exe control proc entry point
: i! m7 q' Q; h; J8 R, Qwhile running MeltICE.
e/ d F- W4 M4 K9 f( D9 \ D+ l( Z+ R0 m/ x: K
0 |9 }( @0 ^# _4 I9 a2 V
00401067: push 00402025 ; \\.\SICE' _; X3 R6 o3 l
0040106C: call CreateFileA/ J* n0 Q, ^: R2 k. ?
00401071: cmp eax,-0019 A0 I7 J5 N, E" r8 J
00401074: je 00401091
* O3 g6 H' j+ @/ }' D
* |+ v8 h( }' B) @/ x/ r
4 A; k2 K* A6 AThere could be hundreds of BPX you could use to detect this trick.4 F; g4 G; m% T1 B3 N- r
-The most classical one is:
0 A4 ?9 F) x4 @4 F9 `5 b BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
: H7 p Z, |. h3 K& _% ^* v. n *(esp->4+4)=='NTIC'
6 q9 U; R# I* K4 d9 t& Y9 r$ h# t, l* R
-The most exotic ones (could be very slooooow :-(, v8 }# a5 {5 p$ _$ ?
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 \: J( W3 _, o# N! r* D; t& b. P
;will break 3 times :-(
9 H) L9 I, E0 U% B3 h# ^% ?( a- V) Z C9 p. p5 `
-or (a bit) faster: ; j9 \$ F) k4 d
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 L, a. R$ C: w9 |* D4 [# O- K2 c
) n( F4 \0 h1 g" B' u9 P BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ u6 [0 `9 n. G J. K* C2 T/ w2 {2 G ;will break 3 times :-(
: R+ ]0 ?, H8 M. E: w. F( l
) ~& {/ G7 U, @-Much faster:
) ^( ^' H! b& L; h9 J* i4 _ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* k5 t, g/ }" s
( p# a- T4 q* t4 U' ^$ F5 cNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ S9 p, ~, G2 Y* ~- k/ Vfunction to do the same job:4 _) W, I$ c" D$ ~0 C$ q
' Z: }. f0 g+ c9 @& T) ?0 t( U push 00 ; OF_READ5 v2 R" i! D, }+ h" F7 Q
mov eax,[00656634] ; '\\.\SICE',0
$ p+ C# k0 X3 O& X push eax
& ^0 l9 I7 u, H2 S1 S4 _, a @ call KERNEL32!_lopen
# @1 x, G8 \5 Q% t/ Q+ c) b' M inc eax
: e! u, f0 v* Z+ L" \0 @+ @# P* t. F jnz 00650589 ; detected4 A! K' m( }9 {% \8 G8 \/ N
push 00 ; OF_READ
0 q* f" A9 o { mov eax,[00656638] ; '\\.\SICE'7 V; M: u4 ]: w/ K
push eax/ o& [% l( W1 Y; G: I
call KERNEL32!_lopen
" g% H" w4 _, W; q2 j% t1 r inc eax* R1 H* l( D( J( V& N
jz 006505ae ; not detected
* V- ^/ a1 O5 |9 d
' A* l& v* A# z; n* o' c4 T% L w! r4 D! `4 G
__________________________________________________________________________
1 o4 D( @# \* T+ C7 Z' ~0 S& \: m6 y9 G1 O! B% E5 e2 Q
Method 12
& G0 @8 r: o( k# I" V ~=========
" v' |5 l y/ }1 a8 C {. m2 I, h& ^" ~6 q C( b( i
This trick is similar to int41h/4fh Debugger installation check (code 05
/ | U) w$ }! q' P% w& 06) but very limited because it's only available for Win95/98 (not NT)
! g$ l$ V1 y) O, Pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' t' K' D! `" m! {) ^; k1 S( E9 O$ g2 E( i; ^, D2 J
push 0000004fh ; function 4fh* l z( O$ r. r# u
push 002a002ah ; high word specifies which VxD (VWIN32)9 G5 ?' M( d B5 k
; low word specifies which service
2 }8 ?4 k# ~+ Q, h8 }3 [/ H6 ^* F (VWIN32_Int41Dispatch)9 P9 r) U4 c T9 y
call Kernel32!ORD_001 ; VxdCall- y, c" ]& f- p+ ?/ U1 V0 L+ H
cmp ax, 0f386h ; magic number returned by system debuggers! n& q4 o$ F) n0 ?
jz SoftICE_detected5 s+ w) Z: |) c9 l3 V
1 h. F/ Q# n0 x# f% d. _
Here again, several ways to detect it:
R. L/ E! H3 g4 y: R+ {/ S/ \6 o T
BPINT 41 if ax==4f1 B" v; R$ K' e! m
* P% C- |9 M# [* A
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& e4 x, e. j0 J1 t1 Q! }( @% V" y
* W4 ^1 d3 O8 X$ G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# e; T6 c5 D9 c- u0 v1 z
' b+ p0 a7 d( M5 s* r0 h
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. ^& d6 t: _! G9 O8 |
. J' T3 U: Y; f) U# _: R__________________________________________________________________________
, v0 h6 d# ~8 O% U
" n4 j/ X- |( f# J% ^. x$ oMethod 13
6 r; o! T! U9 J9 h=========+ r9 R! j% N/ N. [' t
+ W+ Y$ z* _) r: Z: VNot a real method of detection, but a good way to know if SoftICE is
?' V/ Q- J! S6 c, F0 Ainstalled on a computer and to locate its installation directory.
- z0 Z3 z9 w! I7 AIt is used by few softs which access the following registry keys (usually #2) :# {$ @5 k9 ]5 f
4 z6 \2 d2 N2 x8 J. O) y& ]* D
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 l2 M1 Y9 l0 }; C& H1 {/ q% s\Uninstall\SoftICE
. f- s1 O( {& g-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ G3 X }3 p, P3 `' O# Z-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 W' ^3 k- \% I8 d/ t8 [6 `$ S5 r
\App Paths\Loader32.Exe1 J d( Q+ R7 o6 c; y$ H6 g% B
& c7 A, g3 g3 K. H# v
* `$ X9 s) L# P8 ?" y
Note that some nasty apps could then erase all files from SoftICE directory
9 e v# Z. b: O(I faced that once :-(7 Z( @0 n2 A2 V$ @0 [
0 M4 B# T$ X, mUseful breakpoint to detect it:" `. d( B1 j6 n& k( J+ o$ D- B
. J7 A, ~' x) i: k6 v* i BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'/ {. J$ l! m/ H" B$ p9 E
4 O2 A# S* _" b7 y6 @# H
__________________________________________________________________________
' U B2 P- r* L
7 F/ U0 U8 D8 P3 b# k: [2 R: [& [1 v6 P* T4 y% {: Y; L% }
Method 14
) u5 m& K* t2 [; N=========
% f1 y4 W4 `/ R$ |
) m( F6 T- e+ b f' [# ^* f R' X/ wA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: @, N- a- k& I' N, H' _+ iis to determines whether a debugger is running on your system (ring0 only).
6 I# g" |9 D" E* j: q, }# d
; ~% H$ _; S( r6 \ VMMCall Test_Debug_Installed
4 Y" r# M* V% [ k! ]2 h je not_installed
) [. ?3 N" }+ U" v. L
& |5 z# O- k4 c" l/ i" v: s* \This service just checks a flag.
5 K/ d$ \9 t' D6 y3 H& L' S+ U! [4 A</PRE></TD></TR></TBODY></TABLE> |