<TABLE width=500>
l8 V. ^$ _% k- P, B5 H<TBODY>
* j; s1 |# \: \, k/ f<TR>3 r8 Y9 D+ K) |1 m2 ], q m
<TD><PRE>Method 01 . l3 E* H* r, {, J/ d5 H
=========7 [/ f; [6 I) N7 X7 H5 C+ i, _
T3 _$ S# B4 U, ?+ u
This method of detection of SoftICE (as well as the following one) is
/ ^2 @! @' Z" e* gused by the majority of packers/encryptors found on Internet.
3 a8 f7 h9 Z/ z! a- b! S* VIt seeks the signature of BoundsChecker in SoftICE
6 ?9 a( M- l+ y& l0 \5 e+ w" } k' R3 P$ I* t
mov ebp, 04243484Bh ; 'BCHK'
0 i, U4 J; [* k9 f9 Y6 h- y } mov ax, 04h
$ I+ {. F" d: h& a; R) y* V int 3
5 W8 C: a/ A) b' f$ A1 d cmp al,4
$ K y' l+ [9 l" I4 o jnz SoftICE_Detected4 i+ j1 l' J, k+ R1 U& L
, l, z: q/ n8 I2 \) T4 J5 `0 ~2 V; a
___________________________________________________________________________
) ]6 o9 K; Z3 _9 P( `" k, L8 a9 b
Method 02
1 x0 Q/ V- o0 \=========
& {. z" a3 X& ^9 t% g5 r, c
) ]5 i! `8 f% E3 @$ W! nStill a method very much used (perhaps the most frequent one). It is used* V4 w* n8 t- ?' @: e% ^
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,3 f }$ ?4 o, B
or execute SoftICE commands...1 @- O6 J; p- A9 N* n7 L8 p. T0 U/ A
It is also used to crash SoftICE and to force it to execute any commands* E+ w$ j" u; G) n* N# b) Y, j* X
(HBOOT...) :-((
) Z% T5 q5 w5 a2 e6 }
$ y D# d; @. E. [* ?) W0 X* `Here is a quick description:
4 S- H. n4 x& h9 _6 |- X# q-AX = 0910h (Display string in SIce windows)
& r8 w4 Z$ m( |. `! J6 L! u-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 `) c0 X3 y8 w-AX = 0912h (Get breakpoint infos)4 H5 n; O8 [& _7 E
-AX = 0913h (Set Sice breakpoints)
5 n9 ~1 n' g6 x6 f-AX = 0914h (Remove SIce breakoints), N8 {& c- U. {- ^& p
* O0 [! }& ]5 z. ^. p+ v) ]/ W1 NEach time you'll meet this trick, you'll see:
/ _$ K+ r: `8 S' ~+ ?, f1 e* w-SI = 4647h& j" m I# S! S1 J: O! F; o. S/ }& S
-DI = 4A4Dh5 Z! g* P8 P) x: R2 V7 p+ w
Which are the 'magic values' used by SoftIce.8 @- F- g$ L0 a) g
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.! a- t+ a# K* r* k
3 A' n3 Z6 T6 { l5 L% ?% s# E3 k8 Y
Here is one example from the file "Haspinst.exe" which is the dongle HASP
b0 E: c$ I2 \' w# YEnvelope utility use to protect DOS applications:% Z6 f2 g' G5 |
% H7 [* I6 E2 Q$ U) y, h3 Y, R- S9 A8 a+ H
4C19:0095 MOV AX,0911 ; execute command.
% v2 |$ ^$ x$ J0 h& [$ ^' \' i" {4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
1 U" _9 X5 }" h2 ? H4C19:009A MOV SI,4647 ; 1st magic value." Y/ r3 f1 [. t: ?
4C19:009D MOV DI,4A4D ; 2nd magic value.) p9 K) h+ G2 W" B1 Q' B4 I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. F4 U0 x m" _) `" |, Y/ M: X4 \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ v' ~, e- j/ o
4C19:00A4 INC CX) t& g9 c. E" ?2 |/ p7 p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
3 H' @$ H3 a, ^: `1 l" e5 H4C19:00A8 JB 0095 ; 6 different commands.
. u+ B- P% Z& V3 Z! A7 B) d y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
6 N) Q+ d( V" w/ ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
1 X! ]! P8 b, \6 I( [% p# j) q* s6 D% Y* s% q) G3 y3 Q
The program will execute 6 different SIce commands located at ds:dx, which
8 Q v9 ^3 U5 L, C. ?8 `! ?are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 @$ P7 w" f: h" Z2 L) |( q( o6 Q+ B4 ~: Y% T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
7 o6 n6 v( Q$ D___________________________________________________________________________. R* n! O1 G' x( A. ?
* z" d# Q5 l S# |6 g
( p4 T) Q/ @! x1 ]Method 03$ V2 j( v7 F8 @8 a4 v+ u
========= ?3 a% O0 S8 X
& ~. V" b9 v0 J) g+ \" ~# SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) A* P8 a B) c$ a6 R
(API Get entry point)
5 d1 v, | c- o7 } 0 E( Y6 N; R: m5 r, i
3 l' ?/ q8 w# \- a0 k+ o# M! \% V% b3 E0 N
xor di,di
9 [& ^" I% d2 k5 h; d/ w# z mov es,di( O3 B, Z/ D0 [; Q
mov ax, 1684h 0 s$ V4 @& t$ K
mov bx, 0202h ; VxD ID of winice
u! o+ f: V* |/ U5 S5 V0 H int 2Fh
% L& m* F" H: j; e" C mov ax, es ; ES:DI -> VxD API entry point! X( B' V' p( X
add ax, di, ?' z L4 t+ i
test ax,ax- ~( f% |& N0 M4 E
jnz SoftICE_Detected6 Z2 T" F7 E, z, J7 G) L
5 z3 U& T0 p9 B% Y
___________________________________________________________________________1 T' C) x8 |! X# X" i8 ^9 f
0 Q0 b: g1 i- O. F* nMethod 04- A; b5 W' o7 E& e5 \# w9 A
=========
9 o+ X) w. ^% w0 o3 L" l- k& ?8 m
1 n$ K! y$ G8 U# @# M9 @Method identical to the preceding one except that it seeks the ID of SoftICE5 p- @0 z( G3 K5 d2 v) j2 P+ ~$ m
GFX VxD.0 I# @# v2 N6 {. s1 D k& D5 u
0 U. `. ?9 a3 s+ }% l% N xor di,di
0 \) w# t) h5 P1 E& {; J mov es,di1 f( ]6 v+ S0 i' |/ y& Z
mov ax, 1684h
7 y. d7 x: o8 P q+ ^ mov bx, 7a5Fh ; VxD ID of SIWVID
: s' h- c, w4 |' U int 2fh! r8 o/ W! y; |0 N2 J
mov ax, es ; ES:DI -> VxD API entry point
' m& G8 b2 g& H5 X/ K- q3 x) X add ax, di: V2 Y& n. v/ }7 c
test ax,ax
' H3 t I# A+ R3 \" q jnz SoftICE_Detected
0 U: T# v7 A" w) R# X# ^0 @9 t
, f( B5 k. V9 ?% [$ `__________________________________________________________________________7 e+ x3 h4 y0 C$ v
" ?4 J" y/ @/ n! `" N
* r1 X$ O8 r5 R" z. a& N1 M! i3 p+ |6 [
Method 05
. C& D6 J# C9 g=========* t. ~5 K( s, Z, E' l' @
9 `/ b+ G, b& A6 v& {
Method seeking the 'magic number' 0F386h returned (in ax) by all system- i1 w c% E9 [) Z
debugger. It calls the int 41h, function 4Fh.: Z. ]# g2 e5 d
There are several alternatives. 1 P* u: g" v$ r7 r7 P) @
' i0 r K3 i, O
The following one is the simplest:3 R9 z& J7 ] w/ m* a
, b( A! q0 O# d- _' l
mov ax,4fh
; @. W0 l3 D# k( I( H9 T int 41h& S7 t U5 `) V Q) g
cmp ax, 0F386
" o" G8 w- r; G0 n1 N' t jz SoftICE_detected7 g% e8 j6 \/ P) z) j7 G/ [' ^ ]
& i2 a- ~7 L w4 n
* S2 b1 I/ y3 B9 W4 j! ]: s, Y* {' }, p
Next method as well as the following one are 2 examples from Stone's
8 p, o+ L$ _: B2 }2 Z2 _. g"stn-wid.zip" (www.cracking.net):1 E! h1 v# ?. V S) \3 K
& Q% |, U O1 `' m mov bx, cs
; K) g" K4 v8 z' {' | lea dx, int41handler2
4 J) B( u9 u D. t, q xchg dx, es:[41h*4]3 L1 H* q8 _# \. U
xchg bx, es:[41h*4+2]
' ~- U$ J; y& {6 V1 Q7 b mov ax,4fh
& K2 D. h6 l0 e* [; z9 @: c0 C" m8 H int 41h
9 t% t7 n+ y0 { xchg dx, es:[41h*4]
4 R( r. Y2 Y% H4 l xchg bx, es:[41h*4+2]4 v- V$ }- _6 v+ u: m* W% {
cmp ax, 0f386h; _* X( }1 P H1 [; Y
jz SoftICE_detected
* N0 z8 C2 V7 Z; |4 v& G$ @" V
7 A$ R( U5 ?7 p8 l3 oint41handler2 PROC: C3 e2 ~+ S$ M. c3 [
iret
1 b4 ~$ @9 {! N0 M& j( k, {9 Z, B# u1 iint41handler2 ENDP! n- m7 ^; x6 k
- Q1 [/ D( p) Z. @
) c* u' z; V) J; U: N
_________________________________________________________________________
: F6 i, R/ b" [1 m8 i, I" Q! u& l4 U' S9 `! h
+ f- Q5 B8 }0 u4 ^Method 06
. U, k e( M' [0 K# H) S, T- L3 i=========
" z) Q$ ~ E3 n6 X8 C3 b
u; C2 A- U. ~
! R; X; e' G1 [" ?. V8 _2nd method similar to the preceding one but more difficult to detect:- u3 k4 X) g1 R2 E: G/ v. I' ^- p
4 N1 Y; a0 ?. |- G; n
! @, T( N+ F# v# s" t) a: Z
int41handler PROC- D; ]3 u! o( U: x. B
mov cl,al
5 J% j& O% M0 ]/ S4 V3 [! o& | iret6 w' f$ w6 n4 |3 |9 ?. r
int41handler ENDP u( J" W' z6 A$ u5 n9 k( ^( O
9 N8 M; u# c7 o8 Q: j1 s6 F
- q. e; R h y) F6 X6 j6 T
xor ax,ax1 M- w/ Y7 D) j! U) o
mov es,ax$ l% f' R; B. q* L
mov bx, cs6 [$ n; X& a5 a# f
lea dx, int41handler
, i* |8 C7 F1 o" \2 I+ R# v xchg dx, es:[41h*4]. h0 w/ P& O* d# v2 Z A5 J
xchg bx, es:[41h*4+2]
0 s5 ]- G; R: X: t6 N7 F in al, 40h5 D( }1 J# g% a5 D: s; w8 P8 q
xor cx,cx
[6 i1 G" s. Q int 41h
) b$ S) h7 a* v/ O6 [0 I xchg dx, es:[41h*4]3 X- Y9 W3 M; G8 D) D4 f7 P
xchg bx, es:[41h*4+2]
& G, w( L R; E cmp cl,al6 H. H4 [. t. n& l# e/ G7 r; \/ k
jnz SoftICE_detected9 _$ ^8 N) L# ~7 j! S( Y6 ]
" J5 B. F) M& W, |/ [8 n_________________________________________________________________________
1 N$ y# D! [7 Z* f3 \" ^4 `( e
Method 07
G: ~" A5 q- t+ r2 c( |$ a=========
3 ?# d) P# k8 v4 o: o: Y, B
! p7 B6 ]! q( r% [# M6 dMethod of detection of the WinICE handler in the int68h (V86)
! L' Y! x9 ?9 b4 a p2 U) m' k5 ^+ y+ q. C6 g" x
mov ah,43h8 w2 M; {9 [4 e+ \6 x. ~# F
int 68h8 n7 d! L c% k( W6 ^& u
cmp ax,0F386h
. t; ~( X6 N3 h# @* D/ G/ Q jz SoftICE_Detected
+ V! p: a) u7 @( @4 N% h+ K' }$ t& g( g6 O/ ~& O; {
( p8 h+ V5 _. D$ ?' }. H; n' g
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit G- U. A: U9 A" e6 }5 X
app like this:
' v3 B$ r. U0 ^6 P9 O$ K& v2 a; _& ^/ u$ M3 e
BPX exec_int if ax==68/ ~9 E1 }1 H0 q- K5 t" K
(function called is located at byte ptr [ebp+1Dh] and client eip is
6 h6 [( s* x# A8 z: J1 ] located at [ebp+48h] for 32Bit apps)' ]0 C8 @) C. |$ k8 i
__________________________________________________________________________3 t1 B. X( D4 n& E* ~6 S) H- k
& ]3 r" f/ M$ w
* y* \' C; d8 T5 Z9 |/ RMethod 080 Y; t0 W$ q9 n2 n' P8 ^
=========) x' T' J& D7 {, x' I* ?1 o
7 O0 p% i6 [: p. o8 ~9 p" s; j
It is not a method of detection of SoftICE but a possibility to crash the
; T* g/ \/ e0 c+ Z8 [system by intercepting int 01h and int 03h and redirecting them to another1 E: H. |+ t; {; J, }( |
routine.% f5 @- \8 N) X' {; g! F0 E
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) p0 R6 X7 Z- s7 s
to the new routine to execute (hangs computer...)' x& T" l. W) D
4 d; ^6 U: j/ o+ ?' J. X" x mov ah, 25h
: @3 J1 _; M7 `* S7 f$ H mov al, Int_Number (01h or 03h)
7 v- x1 `; Q' e& U9 F mov dx, offset New_Int_Routine5 j. h8 a9 ?* {) }; a
int 21h* ?- n; J; |# P2 h& p$ u6 F
* E0 P/ g" J, p! H__________________________________________________________________________7 J% u: W2 s( F$ o( A, u
6 B- S$ J8 P7 |Method 093 ?/ @, m% l1 a; D( n
=========8 I9 i) L- S! o. Z& j9 P
" q0 x! ]7 }$ R' M
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& Q8 ]- }& ?, }7 b0 |7 tperformed in ring0 (VxD or a ring3 app using the VxdCall).7 ~; {# u; v7 d( u" ^1 f
The Get_DDB service is used to determine whether or not a VxD is installed4 d& [" d) e7 g, t; _- r
for the specified device and returns a Device Description Block (in ecx) for% i" x$ e! o" T* ^& E
that device if it is installed.
; \" W3 E4 G0 j4 K& j1 F+ Z7 c3 y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ N4 p2 ?! c. h$ N: Q. m/ I+ [
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. h" A- E" p g& b+ w) X2 Y VMMCall Get_DDB I% x: [4 n* |2 y5 h
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( H4 y4 b, g L8 U% E, q( m6 \+ V2 e3 J/ m
Note as well that you can easily detect this method with SoftICE:. ^( P; H; N+ c' c7 ~
bpx Get_DDB if ax==0202 || ax==7a5fh3 p& w. V" p3 g& y
$ {- m/ `* `# o* r" O$ `
__________________________________________________________________________
; o. p4 ^) t, x7 q% G* c& J, U5 y
* \* C2 ~5 ?. e2 rMethod 106 b% J9 Z# s! o E) M2 h7 d6 |7 r6 L
=========
4 X f4 I3 Y' q
! F; M8 O( ?2 i( r, g=>Disable or clear breakpoints before using this feature. DO NOT trace with
8 K" H6 Q, M h8 A! v' U SoftICE while the option is enable!!
: l! q! y+ r4 T1 t7 n
" d' B1 O6 Y& b' l. zThis trick is very efficient:$ o0 p; P6 Z3 [1 `9 P
by checking the Debug Registers, you can detect if SoftICE is loaded8 ]% W( {. ]% I1 D
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
5 p) N- L8 M& Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their
: J, c) g. U8 H' v1 Uvalue (in ring0 only). Values can be manipulated and or changed as well
" J$ E2 d* C3 d3 W( i0 p* ~(clearing BPMs for instance)
6 l2 H! g% y, {& p+ K% Z3 ^/ j4 `, c5 i2 g2 v8 A
__________________________________________________________________________5 @# P& @4 I9 c" P( f
% ~; N8 I, W6 rMethod 11; o' ]; l0 [7 j0 @0 L _9 P( J
=========
1 F& h, w9 b8 v, C) B
1 V z' p0 O3 s) |/ AThis method is most known as 'MeltICE' because it has been freely distributed
9 _& Z& j0 i0 M7 ]& B: jvia www.winfiles.com. However it was first used by NuMega people to allow9 a2 m) G4 m+ b; v+ T0 _9 r6 ?
Symbol Loader to check if SoftICE was active or not (the code is located# e) g8 x4 i- W1 m C$ B8 L. N
inside nmtrans.dll).
) R9 ` _ f5 | }
( r5 f1 j" S5 Q$ S5 I# _, ]/ EThe way it works is very simple:, e4 a3 a& p- A7 S$ v& Y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! Y. `' K4 @: X5 @
WinNT) with the CreateFileA API.# Z% F) D/ S* L* N) K2 J' `2 F1 _4 E
8 Z: z. V6 `5 Y/ D2 s! k: N
Here is a sample (checking for 'SICE'):
% o0 S+ Q' a: d3 E; |
/ Y: s: P+ I6 JBOOL IsSoftIce95Loaded()
* N3 s' a3 |1 _1 X$ p8 I{
% @5 C. {( _% P4 Z N1 _ HANDLE hFile; 4 Z1 g* o, E) f. C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 n. D* o4 n0 H6 t- } FILE_SHARE_READ | FILE_SHARE_WRITE,
$ `: D! k# I) K" c NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 T9 o0 }' X" z6 w; m" N4 q* R4 v if( hFile != INVALID_HANDLE_VALUE )1 z/ p% t; U1 Y
{0 a! o9 U8 C/ \- u
CloseHandle(hFile);
8 M2 _. _# ]5 v, L% I6 `$ n; y return TRUE;+ H; ^$ P( E& ]/ l# @
} U$ H" P# D0 a4 l( T. f
return FALSE;
% b. l) _) l. b6 r8 _: D5 l4 \}
3 Y+ ^$ b* g) g f: q
) V3 P4 q- V9 ?' |1 C& ~. d& ?Although this trick calls the CreateFileA function, don't even expect to be
7 n' M n# Q: T# v# @able to intercept it by installing a IFS hook: it will not work, no way!$ u& L$ @, S2 N: K/ u1 L% |
In fact, after the call to CreateFileA it will get through VWIN32 0x001F- n( O# G# E: R/ d* h
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. s6 A, i5 O& q3 }7 `5 u8 f) vand then browse the DDB list until it find the VxD and its DDB_Control_Proc9 i9 ]1 x1 g4 F; k
field.
! z3 l4 F c3 z# tIn fact, its purpose is not to load/unload VxDs but only to send a * L6 y) z5 Z( V) @/ O9 Z! y, H; \
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, k5 d5 o7 S- c' E3 m& Oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
/ F( o8 Q6 ^( y9 ito load/unload a non-dynamically loadable driver such as SoftICE ;-).# s& f5 Q+ B" e P" w- Z& C
If the VxD is loaded, it will always clear eax and the Carry flag to allow
- m) H4 F8 P9 C/ c. sits handle to be opened and then, will be detected.) \4 j' i* r* J; e- S$ W& m; x
You can check that simply by hooking Winice.exe control proc entry point
2 H3 A: B2 J. |) r4 Rwhile running MeltICE.$ Q" @/ ]1 Y/ u" I9 w
! ^3 h# c( t. R) f7 a* Q1 f% v: Q# c" ~, _) ~9 i. x
00401067: push 00402025 ; \\.\SICE
9 \& }8 {4 a9 [) { 0040106C: call CreateFileA: C: V5 Z8 P( U1 y& I' `
00401071: cmp eax,-001
% R% s* d+ v p V$ j3 m 00401074: je 00401091& A1 ]1 H7 Z( M
' T6 j0 ?7 b; g/ _6 E$ |
! N/ y ]2 N; Q, NThere could be hundreds of BPX you could use to detect this trick.
: R! E: `) G, ?9 T+ f& q-The most classical one is:# Q1 l+ }, i) E, t6 q) O
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 }* p G, P5 m1 r# l X! {, M: t1 c *(esp->4+4)=='NTIC'4 @5 r+ i' J6 R
% q5 Y3 \+ }- @0 }4 ~
-The most exotic ones (could be very slooooow :-(
. d. m4 J1 Y$ A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; r$ T8 `6 ~9 z
;will break 3 times :-(6 q% x3 `* v7 L8 q. y. S3 c2 }0 T
0 O) P8 G* i' X" k
-or (a bit) faster: $ H. g% q- P( Y; x7 S
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 x" `9 y6 h5 f! f, o7 u; G5 ~2 E& j4 e( C; ~5 D3 ?
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 n6 N4 Y, i* b9 U
;will break 3 times :-(- a" |- [# K3 k) `! _
- H* T; {% z3 q H" p-Much faster:
# O$ U6 @3 S5 Q$ J1 \, `# G BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ _6 k/ w- l5 o4 ]5 c( V8 Q- {
' Z) [; ?- ^9 r* G4 ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 P2 f: q j4 g3 T* I" V3 z0 w
function to do the same job:
0 ?4 g) i. _7 E e1 p. k/ \, e- T& y6 F: H' H
push 00 ; OF_READ& A* B# A7 `2 W9 T1 i
mov eax,[00656634] ; '\\.\SICE',0* R. {' i$ W: }, ]) O
push eax
- w' Z9 `2 ]" t3 ~/ D8 g- \ call KERNEL32!_lopen
$ L6 f! a8 x" u* r8 a4 e inc eax1 o' R) D; ?8 p. i/ N& A4 e4 a* j- L) N
jnz 00650589 ; detected8 T9 h$ [. v7 t! j+ `% [$ M3 i; }
push 00 ; OF_READ! `$ _/ P: }8 }
mov eax,[00656638] ; '\\.\SICE'
& N9 w' m7 C, B! A7 h2 S( [9 `7 c push eax
; c7 J5 q( q7 ]: n# g2 J: ^ call KERNEL32!_lopen
/ M/ \, q' t/ C! W! i7 n inc eax1 O3 W: U T: B, p, F
jz 006505ae ; not detected' L2 i8 S( Y; R& z9 a6 S$ t. a
1 O6 F. `3 C* [' O6 R* `
' u$ O% ^* l$ Q# r, R__________________________________________________________________________
* [5 @# ?# g; y8 K7 w, G
; W; `8 N1 ]& B5 P$ p- YMethod 12
3 y) `$ G- K# r s7 c' `=========& t+ E6 ^- @# J7 A
/ ~" {% U# D- h" y5 c0 [This trick is similar to int41h/4fh Debugger installation check (code 05* F+ `5 R# a5 v* Y
& 06) but very limited because it's only available for Win95/98 (not NT); `* I- \# i8 R6 L/ L) x8 q+ l/ ]
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 @ |& G% _0 I+ {2 r
3 b* G4 m; J) q1 H5 H# g! `
push 0000004fh ; function 4fh& t+ q( P( f1 A4 N: n1 M3 f8 K
push 002a002ah ; high word specifies which VxD (VWIN32)4 u! J' p& p9 b z
; low word specifies which service" \- w# d- W# @* {) @
(VWIN32_Int41Dispatch)/ S `( L) T4 P0 }
call Kernel32!ORD_001 ; VxdCall# b9 p- p o; V4 H! P
cmp ax, 0f386h ; magic number returned by system debuggers
& s" W7 D s4 b' v jz SoftICE_detected- e9 V2 f& V+ z. G2 s$ L
a0 A, J, Q; E
Here again, several ways to detect it:1 U' n/ W6 |, }, f% b! l1 n# D3 K: ?
1 ^% k- [0 P+ D: R9 G$ q. U0 V( O9 {
BPINT 41 if ax==4f+ x) c9 {9 v8 t4 \2 S
2 B( O3 F; q. e BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one) ~# l1 \, {7 C. m# m
5 i$ b7 A/ g, s: {0 D BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 |" p3 ~( y' a' e
3 ?, J, r- T2 E% p) @ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) E1 D/ ]+ A. ~; M3 x2 @' |
$ m! ~# V# s4 q+ ]! K" A/ k; G
__________________________________________________________________________8 R6 X; O/ e, o1 U
7 k3 ?" y0 G1 ]1 d1 Z- s9 yMethod 13
2 P' O! B+ h; J' a1 u$ L% M=========
: p2 X% N* v% |9 w" f5 P- U2 G- y% l, I- u; ~5 ~9 F; C1 d
Not a real method of detection, but a good way to know if SoftICE is
, k0 U; D5 k0 Zinstalled on a computer and to locate its installation directory.+ r5 z, e" @0 M
It is used by few softs which access the following registry keys (usually #2) :
9 X* I3 W$ I9 T9 J* K2 R9 u0 ` T d! y) ~1 e. X. m) n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; m8 ?8 u8 w4 q- l
\Uninstall\SoftICE
3 u" B: f4 a" x$ y1 s5 S-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' ~2 B* r1 R* I5 K+ T; `
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- u9 _$ k7 H7 `( P0 e* M- U+ A
\App Paths\Loader32.Exe& a. B* m9 W; Q' N" M
) d! Q' h' ~/ W! g3 o7 Y* H
9 `1 M( ]# o6 ^# iNote that some nasty apps could then erase all files from SoftICE directory+ |+ R3 z2 a+ E5 j9 B
(I faced that once :-(8 z" X! {) z) W$ @ D
2 F/ A( f6 y" a; \% Y$ H. Q, xUseful breakpoint to detect it:. |- V% b0 S, w$ t
* x4 D9 v, [. I" @
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 |; K) ~0 i0 I) h7 N+ v1 |, Q8 d9 \) A# z6 D. D
__________________________________________________________________________, o+ s+ e8 Z$ z( T0 s
3 m0 j# G+ I" k- [2 c% o2 r4 N: @0 u) D( [1 t
Method 14
2 A% O. S3 c1 {=========/ w& M5 |0 f) a) `9 M0 Y
' q8 K L( ]; Q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- E: R! @5 }, H L# z2 c: \" ris to determines whether a debugger is running on your system (ring0 only).
5 u( R1 b$ Q9 x2 B( o! P/ L8 L( A0 {5 d& K1 D
VMMCall Test_Debug_Installed
3 y1 {4 j8 [1 O, P je not_installed
' [0 q( N" e( H; D3 r% U( F! U4 P; t8 f5 T* K6 j
This service just checks a flag.
0 h, M3 F) p0 f% h! t! x</PRE></TD></TR></TBODY></TABLE> |