<TABLE width=500>8 H5 @, x1 ]; `; D/ z1 F! a% Y
<TBODY>( B1 i. D# [, U: ~( P O1 S
<TR>
9 }' v7 h# |$ q$ p1 d1 c' R<TD><PRE>Method 01
G$ a+ Z$ C; I' E* Y9 p=========
# I- C# }4 c4 j- R# F' {4 D# U0 E g. A5 j
This method of detection of SoftICE (as well as the following one) is
. P- V+ b7 ?0 rused by the majority of packers/encryptors found on Internet.( z. ?7 C/ {4 L' [7 p
It seeks the signature of BoundsChecker in SoftICE
0 v* B% _% p ~5 P0 |; ?
# ~7 _8 q% G) z% x: m mov ebp, 04243484Bh ; 'BCHK'
3 y; D2 n$ e0 a* [ mov ax, 04h
2 e0 `! x* R0 F0 O& ~. X5 O int 3 / y Y& E& P% P0 }# C
cmp al,40 ^4 K! E8 b: |9 w5 \# @) H3 f9 j
jnz SoftICE_Detected. P' y# Q9 @" h! D$ k% {
5 P0 L4 i+ Z8 ~& X0 }/ K4 v7 q
___________________________________________________________________________0 c1 L; q' L. t% o$ r+ c6 H% b
4 U# E! s$ R: }: ]4 e2 V! i2 SMethod 02' ` ^7 m7 f6 z, @4 _$ f
=========. q+ h5 Z9 A8 p4 O! V
, x% Y) F& T) a8 L4 K0 N: O# DStill a method very much used (perhaps the most frequent one). It is used
1 z/ T3 Z, Z7 Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,7 u$ z! H) N1 [8 k- n/ S
or execute SoftICE commands...' j& Z. a& C3 B
It is also used to crash SoftICE and to force it to execute any commands: {4 Z, _0 d6 M7 s3 Z4 y
(HBOOT...) :-(( . ~0 _+ X/ l3 _$ E$ Y, m
' Q% i* Y) X& w
Here is a quick description:
0 c/ ~$ ?2 U$ I" v& Z: {- F4 m% f& K/ B-AX = 0910h (Display string in SIce windows)& w0 L, j% p _/ @- k
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& t9 Q4 a, o7 B; a5 z" G0 b
-AX = 0912h (Get breakpoint infos); |7 K& I' w w) ], z M! Z! H- B2 r
-AX = 0913h (Set Sice breakpoints)& N0 ?' v8 S; Y: w, J
-AX = 0914h (Remove SIce breakoints)2 ]$ C5 Q' u) _
4 s1 G7 Y+ l% }1 j% {Each time you'll meet this trick, you'll see:, n1 H, V; C$ @6 E0 p% C8 V8 G
-SI = 4647h2 n2 h1 L: Y& n0 D
-DI = 4A4Dh0 [8 M9 A# g5 L
Which are the 'magic values' used by SoftIce.
$ J; C6 @7 _1 M: U5 I$ JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ e8 l2 a3 }. a8 k
4 R/ X/ U6 ?0 f: t9 rHere is one example from the file "Haspinst.exe" which is the dongle HASP) W3 Y# b% q6 s& M `) `' R3 _, U
Envelope utility use to protect DOS applications:/ A4 i& i5 D' \
: j; h- B0 J" g# [# k
9 o, ?# t* s1 r- e2 U
4C19:0095 MOV AX,0911 ; execute command.
/ i' a) u" l. T( M+ r! M. g. u- I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. X2 G$ }1 t8 D% w
4C19:009A MOV SI,4647 ; 1st magic value.! {9 C: Q4 t, D7 B+ D) [$ K: X9 ^% g
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 A6 b% a8 g' p2 `1 ~4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)9 A3 ?' \% }& E/ B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. A. d) ]. ?/ A( O2 k: L; ~' u- V3 N4C19:00A4 INC CX
& s+ r3 k7 |' C i2 T- e: s4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' }3 v1 \# {4 Q( j4 P3 c4C19:00A8 JB 0095 ; 6 different commands.
8 u0 X) _2 A* B2 }/ F4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- D! _ ?, b7 m4 {! m9 s9 H4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) j! m3 C/ w* M3 k, \/ w9 k. S4 m, y" J4 ]' w4 y |, Y
The program will execute 6 different SIce commands located at ds:dx, which4 J a/ ], p1 f" F) P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
0 }) Q: \2 c2 i; ^( R7 K4 b( q2 t. x' d3 O0 [$ V1 y# X
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.( V b( X: I# ~* i) Q( |/ d/ ?
___________________________________________________________________________- l5 d- b' n7 f) L2 b7 i' u
0 v9 s& B# y6 w4 M# d2 |% T5 S7 ?8 O, N9 w5 a, M% P* @4 H! T
Method 039 T" d! U' J* T
=========
# Z# Y' @3 ]* Y8 t! [6 v1 N5 k
0 Z2 Z& d* W. _ ?# y6 v0 {, {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# O: e G2 a) O(API Get entry point)- m- Z3 t( ^& F0 E; g; @: K
, N/ R/ E: l/ n! y9 j6 S
5 h% R& b, M! E$ l$ P xor di,di% E E7 B6 d* _' G
mov es,di
7 O' l% F4 C, H7 R- ]! |" v mov ax, 1684h ! c& @, c9 b# T$ ^
mov bx, 0202h ; VxD ID of winice
' a, h4 U+ I! C. O4 u int 2Fh
) B/ {% J) X! v) M mov ax, es ; ES:DI -> VxD API entry point
2 b! M! [# q+ \' d3 a y- x add ax, di) X! X5 m$ @5 r' F2 H% q
test ax,ax
/ r2 z$ r; E s8 b jnz SoftICE_Detected
" s, `/ D2 j: V+ J+ i# N j7 d S) |& ~! x
___________________________________________________________________________6 v- q8 F O- g2 v# K- C
! U/ O5 @: N! k( Y+ g8 M" e$ L
Method 042 a7 S8 q) x, x- Y+ \+ Q2 {1 B6 e+ N$ @" H
=========8 \& j7 }$ v, |/ P+ _8 G7 a
8 L- A; K4 H d: uMethod identical to the preceding one except that it seeks the ID of SoftICE* ~6 P8 L, c* G4 N
GFX VxD.5 f% u1 o* I6 q$ y3 k7 }
. i" y# J+ v) j, h xor di,di# O+ G) Y% @8 u q! F0 a
mov es,di6 k2 M" ~( Y3 Z8 Z' R7 W
mov ax, 1684h
% Y( g: a8 d G6 S$ y4 j/ N mov bx, 7a5Fh ; VxD ID of SIWVID
/ R8 {) B( c- H. V5 l# B int 2fh
! H" ]" T4 \; h9 w8 F3 O( v mov ax, es ; ES:DI -> VxD API entry point( b: M4 Z4 b. W5 K. C# |7 v- E8 f8 Y
add ax, di! Z; ^( v* q' W1 e: m, T, e/ l
test ax,ax- l/ E% B4 c2 x9 ^
jnz SoftICE_Detected
0 m4 z, N* H- E: B: p
' N% @2 K( s% o% c# B% i__________________________________________________________________________+ Y2 b6 f: D6 ^
) X3 x7 l k/ z0 E" S
; L9 v* A/ s3 Y& @
Method 05
7 G% J2 O9 Y$ e7 k% e) y/ C0 d' E=========, ?0 r0 X& s1 v4 A; G B! y
7 n4 F# ^, C# j8 L7 @1 T
Method seeking the 'magic number' 0F386h returned (in ax) by all system4 z( S2 F. Y% @$ [# B& v) T
debugger. It calls the int 41h, function 4Fh.
1 f: B' N* D }$ |There are several alternatives. * I7 J) U* E" }) }) M
. k4 i4 Q; O& @# ]7 k; @
The following one is the simplest:8 }0 }( S+ f5 @, D7 S6 H
1 g/ B2 }, i" G" Q3 X
mov ax,4fh
' v2 ~) y3 s% ?, c9 X6 O int 41h* S( F$ b, X1 H6 U
cmp ax, 0F386
1 P7 @- v; ~" u" c: v jz SoftICE_detected3 a4 h! G0 ?7 v) L; E, [, b
F2 J3 S: D, r9 b- H2 U5 T) H
7 `; u+ _. n( d( B8 o, z
Next method as well as the following one are 2 examples from Stone's
0 w) a {, B1 x) E"stn-wid.zip" (www.cracking.net):
6 u- v9 y- c6 k6 T8 T: X0 }0 i7 G, z L+ @) [
mov bx, cs
" q) U$ U; R* r* o! l% D6 K lea dx, int41handler2
3 R4 Z* o7 n2 S. g* z, s/ i: N, \ xchg dx, es:[41h*4]
8 Q/ _4 x I$ Z8 A" Z# t xchg bx, es:[41h*4+2]9 `2 r4 N N; \: U/ w) l
mov ax,4fh
' ~7 N0 ?) }" G9 j; y% N int 41h
, |" g ?4 X9 D4 i3 p7 C; } P& B$ G xchg dx, es:[41h*4]
' ^) Z& _- n. A: Y6 V. u E xchg bx, es:[41h*4+2] L. I3 k' N1 J- b2 w: J
cmp ax, 0f386h! P. W* A% ?: r: t. Z8 m
jz SoftICE_detected' b# z/ I# d/ K4 D/ L; \' Q2 }
% {$ N" A% }9 _' Pint41handler2 PROC
H# a0 A' z& F( A3 n$ h* F$ \ iret
! X1 G1 w5 g4 Gint41handler2 ENDP' t2 h! H$ }) G# k2 P: z
: M8 h" y" N4 n" l0 |/ u
8 g1 R& s0 W) O* g O$ F_________________________________________________________________________: I1 i1 L p! J* M, `- z/ A% i( { J
# q- q7 k( p1 S) Q% g
; [/ @, v7 q3 ^- c2 N! m
Method 06 y- i e% C; {% P' h6 _
=========
1 x' B6 n2 S& i& P8 s$ K
4 O" X9 m' o, o9 C- u6 r" |, ]
2 w4 r# p: j4 Y- ~2nd method similar to the preceding one but more difficult to detect:% P$ C0 o# C, o
9 j' f* k2 C Q. L5 Q( T; {: o
+ I+ T, y" K& q& @( C* s
int41handler PROC
( W8 w/ N. G( ^" B7 a3 O) e8 {, ] D g mov cl,al, Y; w2 n: J+ k- B6 Q
iret
2 s3 y/ q* }* s5 A, {1 u/ }int41handler ENDP. v+ a, _0 G2 L1 u. H
0 ]; H& W* R( w3 w8 \
' ?5 K( V( M& c9 w6 ^1 {$ S- } xor ax,ax C" C6 e+ A% b% x M
mov es,ax
- l$ M8 y* f9 [ u$ w mov bx, cs$ R5 f. r0 m. S! M
lea dx, int41handler% M( M- k, |% t
xchg dx, es:[41h*4]
0 E7 r8 f' `8 Z$ }8 T xchg bx, es:[41h*4+2]
. ]1 x4 I4 D0 H- G' ^5 Q4 v in al, 40h
& j! @0 v, w" u$ w xor cx,cx8 ^2 w, E0 m' D% t' G! [) Q4 }% m
int 41h
( v! A! i3 l1 y- b xchg dx, es:[41h*4]
# g/ t; ?0 v' y$ W7 L xchg bx, es:[41h*4+2]9 F$ U# Q; c* _* F; ^+ \
cmp cl,al7 I& x$ l9 Q# F
jnz SoftICE_detected: i& E+ a& y5 B1 h* |- H
: n' k- ~) }3 O9 I$ V5 a
_________________________________________________________________________* b' X1 [( g, Y+ f" V- U
' H$ T+ \* N9 P7 p3 L! K% R
Method 07
: l# Y+ d8 _. e( Q5 L9 H: l=========$ Q8 Y+ u5 f8 V4 v: E( k9 W; D
" t8 c; s$ J0 d$ _% K, sMethod of detection of the WinICE handler in the int68h (V86)# N- D( J; b$ s d9 E9 F
* c+ ^/ j0 h0 U0 m- S% v2 h mov ah,43h
+ y2 d; U2 b: M int 68h$ {! y! B+ v: l' V- s: x
cmp ax,0F386h
; U$ a& |4 ?2 j, G; x2 {( I8 `+ q jz SoftICE_Detected
% m. T; {. p6 j5 r1 x# G0 A
' M3 ]2 d! j) l W; l$ {- E
! h7 Y8 `' V/ k3 i0 _6 B# q# T" H=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( q8 c) |8 V! F- \2 E app like this:
( @: Q# ^4 n( Q' G: \
' o* @5 v* R/ M7 l2 \2 c BPX exec_int if ax==68
' t9 r/ U% ?7 t. _* H (function called is located at byte ptr [ebp+1Dh] and client eip is$ R. l! ^" Y) u4 h
located at [ebp+48h] for 32Bit apps)
! B) v1 z" M' c9 H) _7 \7 f__________________________________________________________________________
- s. i8 c& k0 N% v0 Q4 `: A B$ W: z! {
5 G. X) I, v- i1 d2 Y
Method 084 |. Y8 B1 s% E; D* F
=========; x: q% K: f2 p) q$ |9 Q* C
) K$ `+ b% o% w) \: l9 NIt is not a method of detection of SoftICE but a possibility to crash the
) V6 _' C+ R0 V2 e. u1 \system by intercepting int 01h and int 03h and redirecting them to another/ e, V0 X" y& |: p5 {6 M4 B
routine.- ^' ?4 i# \5 u3 i5 u- m) O9 n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points* b5 g9 ^2 p* V+ |; p& [& t
to the new routine to execute (hangs computer...)8 n0 C$ w1 z. M' }/ h4 S
' l \$ v; y: s' i! ? ], Q5 [
mov ah, 25h6 O: F4 s; j& ~/ H
mov al, Int_Number (01h or 03h)4 S# K/ @4 G, H" g
mov dx, offset New_Int_Routine$ W( Q) _* n7 D8 w4 r
int 21h3 d# L7 n5 ^6 w8 V( n8 |
7 x6 ]& S6 M) i* y' n__________________________________________________________________________* p5 K* ~8 @( [! p. I. G
; x/ N: [* M: d1 X2 j M
Method 093 \0 q( f% j' F- u
=========* n3 c/ s6 x2 K
) R5 a8 C& F2 j: M5 N2 S+ J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, r! s( b P% kperformed in ring0 (VxD or a ring3 app using the VxdCall).& U& I- C8 B) H
The Get_DDB service is used to determine whether or not a VxD is installed1 b' }' E& E. t# n3 o
for the specified device and returns a Device Description Block (in ecx) for$ \( {1 O" W, o8 q+ t
that device if it is installed." |; k/ j) K/ \8 A
8 _3 k' k2 p: F$ n3 c, i) H mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ A5 N3 Z1 a- X0 f mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 B+ ~4 S9 f/ L2 H1 E! p, O6 D VMMCall Get_DDB# d+ h' w& {8 {# K4 S* a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed1 S; L+ s% S4 w( O. Z
8 a& w, c! W. r# P7 a% M+ j* O6 J
Note as well that you can easily detect this method with SoftICE:
( n. B# @. g/ a5 \. d bpx Get_DDB if ax==0202 || ax==7a5fh
6 R! \0 C/ ]/ m& ?
3 r. w( C8 X% {) I7 v3 x/ j: q__________________________________________________________________________
, ~: ?- H# l B+ _# I$ a1 r
7 ^% p5 `3 }$ D6 G* \0 WMethod 10
& t+ U7 k4 X, @) c) e% ^=========2 }- k- V" V! z6 b$ X6 V* h' n
" G8 R K( c! t8 i& g
=>Disable or clear breakpoints before using this feature. DO NOT trace with
# A% }1 Z q7 E/ e SoftICE while the option is enable!!
" m/ \; y& d, M" ?2 S+ E! x) ~2 q4 f( s+ ~2 l% X/ k
This trick is very efficient:
! ^3 ^ g: ?# K8 Zby checking the Debug Registers, you can detect if SoftICE is loaded, S7 z4 q r& c' y8 F% o
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if& o% p/ t, l/ C9 L
there are some memory breakpoints set (dr0 to dr3) simply by reading their
# O. o& |: o! g; @/ lvalue (in ring0 only). Values can be manipulated and or changed as well* U1 w* i, O! ~. I0 i% A1 a# b, \4 ~
(clearing BPMs for instance)0 A# F/ l& ~5 W1 I- v
# C8 {0 B b" T3 R4 r
__________________________________________________________________________, w2 e; \; h; A
" `5 ~6 J( [+ ~# V' X" VMethod 11+ h8 F$ f$ ^3 F3 |' C) `
=========9 e+ G# s& O% b9 J
! B/ h. T4 k8 u/ Y. E! k
This method is most known as 'MeltICE' because it has been freely distributed6 b2 v# s& p4 P# V, @6 ~) ^
via www.winfiles.com. However it was first used by NuMega people to allow: d6 w9 _( I7 ]$ W+ S
Symbol Loader to check if SoftICE was active or not (the code is located' ~2 x2 B! E( e; _ e3 @6 D3 P l
inside nmtrans.dll).& ^8 g0 b) K% X$ ~; E( K, e
" j0 a8 q! a1 p& H9 V( wThe way it works is very simple:5 ^1 {0 V. m, D8 U7 f2 F7 \6 [3 r9 ^9 C v
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 l1 ^( i' H4 A) d1 T3 W
WinNT) with the CreateFileA API.
1 ?" P+ F& Q& J0 N( Z3 e: c& z' H- S5 n6 B2 ^. m. x) N
Here is a sample (checking for 'SICE'):& p% E( P L" [; \+ t- s
, {6 D1 ]9 A5 b3 jBOOL IsSoftIce95Loaded()
9 e# V5 N, M6 q( c6 D, Z8 N5 O; E% h# K{
" F6 }9 U- b) U( q$ u/ R. v HANDLE hFile;
6 ~" s7 R- A% Y2 Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ i! e6 @ U S3 @
FILE_SHARE_READ | FILE_SHARE_WRITE,
7 t1 ^; `2 ^0 i N/ r* x NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 t' }7 j8 G* j) m; ^
if( hFile != INVALID_HANDLE_VALUE )' w1 p* S% X* _8 O& W" b" I
{4 T/ ], E- g4 i* e4 F. |
CloseHandle(hFile);
& m5 t) T }0 _$ p8 b1 X' u return TRUE;9 F) C$ z! P7 G& E. M
}
3 N9 n5 Y6 u. m0 }. D8 ? return FALSE;& W; [# y, a1 u5 T* M. e
}; y, L9 X8 w+ x3 l$ T) {
* A% K3 b' s: ^. @* H5 N% Z" m _5 CAlthough this trick calls the CreateFileA function, don't even expect to be
$ h7 q5 f% d1 n, f7 g3 N7 ]able to intercept it by installing a IFS hook: it will not work, no way!
( J5 V) O) C1 y* DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F! J$ O+ ]7 E, f, Q, Z$ Q: E$ L
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ |+ k d) ~1 A# q: f) V; l5 d- M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc# v n2 J. K/ U) U; K+ ? \
field.
. c# |6 ]8 F' BIn fact, its purpose is not to load/unload VxDs but only to send a
! M @; m9 [9 u6 GW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ t6 u& | R9 }. b5 m& J, b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* l# ^9 j* y# R) ~( rto load/unload a non-dynamically loadable driver such as SoftICE ;-).
) f, b# a2 Q5 ?+ ~. e% lIf the VxD is loaded, it will always clear eax and the Carry flag to allow1 X/ P9 A$ }' i" C% W9 u- R
its handle to be opened and then, will be detected.- k2 `8 L6 p0 S: b
You can check that simply by hooking Winice.exe control proc entry point
7 _; ^ c; K( e4 x q& u' r& [; fwhile running MeltICE.
+ A, [! B% e! ~. V+ B! h8 G: s: z% {; Z4 a5 g5 G
: o$ a" R. @- z! ^ s3 _ 00401067: push 00402025 ; \\.\SICE
0 }3 H5 m% Z2 v& s5 o; N& n6 c 0040106C: call CreateFileA+ O* J# d! |* @ `
00401071: cmp eax,-001
6 K! O. k2 r- T. w9 B1 i 00401074: je 00401091
5 U: g( D* a" l( n1 v) h
8 \ Y$ `, k% L' M. z0 z" U2 Q- E! J# n3 d9 Z2 ]4 c% [% p
There could be hundreds of BPX you could use to detect this trick.. |3 t% E! f2 q1 j& e0 x1 r# D
-The most classical one is:
7 e) y0 c+ B ]; M' I4 P+ z" q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# c) M( X# W! M *(esp->4+4)=='NTIC'
9 S- q4 f) ?$ |. a& v4 f4 u5 g: w
7 A2 A# Z9 D) }7 C' z- j-The most exotic ones (could be very slooooow :-(
) e. [3 @3 p7 ~. S/ Q' W9 M6 D" X" j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 F I: H9 d& R# t+ t1 a4 w ;will break 3 times :-(7 R T8 s/ |; ^3 t7 c
" r6 x9 T: G J* W( g
-or (a bit) faster:
0 A& x- W \; T# \6 v" O% u BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 q, p( G9 S% i4 ^$ A- b6 j, J4 ~% o( s! G/ ]4 Y2 v7 S
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! X6 M! D1 l; w: b, g' z ;will break 3 times :-(- H$ F; s, N% t+ f+ D! M
9 x7 b' [9 k0 Z% o-Much faster:/ ~2 ^2 f/ n: S4 Z7 H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'5 V* I4 g" }+ a5 N T9 h
' M. j8 E# Y0 y2 A/ XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 W) t' q4 p& Zfunction to do the same job:) N$ x0 v8 P8 S9 e; ?
- b% c3 V3 b7 ]) s push 00 ; OF_READ q2 ?/ P f. i' M6 }
mov eax,[00656634] ; '\\.\SICE',0
' w8 `, H/ |6 x- e; C; u push eax! ~2 L3 |. p, T% W. Q
call KERNEL32!_lopen; `4 |; A5 l+ W
inc eax7 z) z6 E+ E4 n
jnz 00650589 ; detected# N" L2 j7 E+ Y) L) z
push 00 ; OF_READ
$ c2 L3 |( H6 v5 @( P mov eax,[00656638] ; '\\.\SICE'9 a1 _7 }' U! j: Q/ G0 L
push eax: O, S+ V: \" z9 c( i
call KERNEL32!_lopen) M! }; J t- ^
inc eax
1 U9 v+ ~) O1 Z+ a% O9 i, A' M jz 006505ae ; not detected3 A# c. F4 n8 U5 e7 D
) @7 G, e( A; Y
2 e4 u" b$ M1 X' Y8 x__________________________________________________________________________
# Q- j2 w' z7 d) ?5 M+ y# N4 r8 b2 T/ C; C, j% ?) S% I( r
Method 128 X1 F) f- t! M4 h
=========
: u4 {# W6 d! C# j' m G. ]: T+ F4 k7 I; K
This trick is similar to int41h/4fh Debugger installation check (code 05
8 O$ [9 D; m1 Z8 K6 w6 }; v; [* V" ?* N& 06) but very limited because it's only available for Win95/98 (not NT)& f0 I4 a4 w0 T# l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.% T2 j3 B! d- M; p/ Y
8 P& Y: Y# ` ~3 R) K: W' _
push 0000004fh ; function 4fh! Z; r1 a, B: A9 K* A; A
push 002a002ah ; high word specifies which VxD (VWIN32)5 t' b: M9 I( S0 g
; low word specifies which service% g; a+ u0 f3 D, [9 o) c
(VWIN32_Int41Dispatch)9 o5 J" ~. Y5 N% Y* \# p5 R( `$ v
call Kernel32!ORD_001 ; VxdCall7 V n* h2 H# R/ a3 _+ r/ z/ y2 s
cmp ax, 0f386h ; magic number returned by system debuggers( I+ |5 G. ~ Y. W# d, i2 A
jz SoftICE_detected7 h u& g1 J% ?
4 ~+ M* n6 Z. C: H6 b' w6 P# |8 pHere again, several ways to detect it:
; @* z+ E$ p, v% x8 M/ u; `. G$ h. s1 u1 Q! l$ N! }$ o# r8 z0 M) ~
BPINT 41 if ax==4f
( w8 p$ |, W& T; E$ ?% [. s; F7 G7 o6 E* M
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one' C, x' s5 G8 x6 k2 N) x u ?
* ]" i; I7 s% `0 U+ |& {$ D2 Z BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
, D% r1 Z* {6 x" Z
0 y+ B& F' ]) X. W BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 l$ T" J! V$ Q) u, F/ B4 F" G2 B v( m& v4 _$ |$ f, O; n4 P
__________________________________________________________________________% w/ V. R; e. U
$ s8 i6 ~& `; j t3 pMethod 13
2 P2 {$ c" U3 B# n M% H=========' G7 R- j1 c2 Z: f6 [4 E
) p* m: l( M5 INot a real method of detection, but a good way to know if SoftICE is7 @% ?1 {3 ~# b" M4 D/ g8 T; H
installed on a computer and to locate its installation directory.& F$ A' s1 E$ v7 b5 H8 g% b N( @
It is used by few softs which access the following registry keys (usually #2) :
) a( h, e [) `3 x$ M* _5 Q: Q# _0 J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' j* d2 i& U: p! u5 p; |5 s- S
\Uninstall\SoftICE
: A: Q, }" @* y3 s7 v% Z* v% T-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, |$ `1 A; W0 b. ~5 W4 h) z3 E2 T-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion& N% i; d5 @+ r" u0 d
\App Paths\Loader32.Exe. ]) U+ v% V' G& u6 `) E2 L' A
4 g1 u9 E4 y" [( G( B2 \
& p! l- j( N" R$ h& t( aNote that some nasty apps could then erase all files from SoftICE directory2 i8 n1 d+ `8 _1 x: }
(I faced that once :-(. ?, J3 z7 n$ ~% A
- m& z4 t! }1 {: h' `3 }9 {3 xUseful breakpoint to detect it:
# U* u1 @3 J6 F; o7 v9 g$ s. i! r- e% c! {
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ h/ d5 N: g* {% W4 X0 f
: l$ G; c7 o P+ a' a; v__________________________________________________________________________
$ a2 n# y8 \' Y( m5 @) ?1 Y) @0 N' \( e
9 c. m% P% q' H9 h( I3 D5 p. dMethod 14 9 G+ e3 x) ?- S* C' D6 `5 ^; h
=========2 a4 ^% r+ }( C. n1 g! ~7 Z9 ?
% A7 f2 l6 Z% ^" x d* bA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose( x+ `1 E1 T4 x. l: q" y
is to determines whether a debugger is running on your system (ring0 only).7 @$ t; r& V/ s/ N) Q( u2 j
/ A% G U7 H( m9 O
VMMCall Test_Debug_Installed
9 b: e" W- C* ]$ h# M. ` je not_installed
! Z& i* M. h$ u6 `" j) x, E0 m( F, @4 I
This service just checks a flag.
. T2 f& m7 y/ l: J2 M9 x5 V</PRE></TD></TR></TBODY></TABLE> |