<TABLE width=500>
; i' y# G' n( J7 C6 k# I1 j2 b<TBODY>9 u- `& x9 j' b( Q+ m5 d! G
<TR>
" F/ q) Q( y; `* t; |& ~( O<TD><PRE>Method 01 ; E! n. D% y* M# |# K. j# |* ]
=========! m7 q; d- b/ H3 \: B5 H/ U# n) ]
/ H. d2 c6 h! n4 YThis method of detection of SoftICE (as well as the following one) is' m8 E0 W3 {* t5 l4 l, R$ e
used by the majority of packers/encryptors found on Internet.7 J# C- k( [& E$ a" j% a0 }2 A
It seeks the signature of BoundsChecker in SoftICE9 `4 @& _9 }* M# ]7 V6 E& X6 C/ Q5 i
i; F. D8 e& K4 H0 \9 w" z. p mov ebp, 04243484Bh ; 'BCHK'; Q2 e$ r3 x6 [& U3 Q& [
mov ax, 04h, f1 I. p0 i( l! D! V
int 3
# E9 Z9 t$ B) L cmp al,4
# p: p+ T- Y5 K& q+ q jnz SoftICE_Detected; d' v4 O9 Z0 D% P" @
8 D* ^! t5 o! N% `/ W% |
___________________________________________________________________________
; \- C) a) M4 l7 a3 U @1 m( x/ H$ W/ {
Method 02
7 f- q' Q# b# j( {4 O5 `8 m=========
3 i$ I& c3 Y8 `) ?
0 j/ j' ^5 H4 ]$ d5 P7 M4 w2 xStill a method very much used (perhaps the most frequent one). It is used
% K1 B+ z# s* P- n: F x- qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,: j& _' v# n. }; n
or execute SoftICE commands...
9 H+ G+ k2 I1 s3 a4 H1 ]! ~9 hIt is also used to crash SoftICE and to force it to execute any commands/ ?9 ~2 _$ ^% b; ?1 h! r1 a+ j
(HBOOT...) :-((
" b. G% ~# j. c) y. H ]: h, N& N/ P2 N7 Y: \* j1 v& m d
Here is a quick description:, s* c( {; K" h+ Q7 Z
-AX = 0910h (Display string in SIce windows)2 @3 s6 L2 S9 A- w7 i" M5 R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ a# Y$ u4 S) B4 g* D5 n-AX = 0912h (Get breakpoint infos)# F4 p8 X4 Z* O0 ]9 `
-AX = 0913h (Set Sice breakpoints)
1 i* |9 g( a( C, w) F& Y-AX = 0914h (Remove SIce breakoints)5 ?' n. a( \: F* O
3 E; f5 D- K# e4 G$ ?
Each time you'll meet this trick, you'll see:5 K' ^8 O, d; f9 p j, d# Y
-SI = 4647h
* O' X" R$ \6 m- @0 H0 I-DI = 4A4Dh
" E! o7 F" T. d; A0 O9 xWhich are the 'magic values' used by SoftIce.+ d8 m9 q. B/ ]
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.( t+ {& q# s' I5 T, K0 a
8 G8 Q/ n5 y! m4 L5 C$ E; t% h
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: |& U% d( p$ n7 LEnvelope utility use to protect DOS applications:
% p- b) _1 {% o' _1 S: @. s4 E9 ], y
3 Y/ A0 F8 Y p$ m
4C19:0095 MOV AX,0911 ; execute command.
- `9 E8 n2 C( d) C# A! w( ]* z1 r4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 b4 Q: Y6 J w1 ]4C19:009A MOV SI,4647 ; 1st magic value./ n8 l( T- ^1 C$ b
4C19:009D MOV DI,4A4D ; 2nd magic value.2 S" C- R$ \6 g7 E8 b2 H5 \5 S9 j9 i
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ M% F9 D9 x! C, {
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute" y6 D8 J R) G
4C19:00A4 INC CX
: B* \- A3 A m b- k4 }5 h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" b+ y+ e$ _0 _7 d- n* q+ L
4C19:00A8 JB 0095 ; 6 different commands.- S4 Z4 C5 r9 U, T! Y! |9 J
4C19:00AA JMP 0002 ; Bad_Guy jmp back.) w7 x3 {& |' ]8 Z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( b. d& o5 W5 g" R- L# G
; f3 L; o) ^( c7 L; {The program will execute 6 different SIce commands located at ds:dx, which
. ?: `, m5 [$ Xare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% n9 ~& n' r; g; T: c5 E$ n; L4 l; J
- Y& D: r9 i; T5 ?* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- x( ?' T2 Y/ d% O* T
___________________________________________________________________________, X6 L+ [; y/ Q
; X; I! o" z. j$ Y
8 H$ }$ S% f: s$ {( i- P( T( ]Method 03
/ l8 t/ i0 S. A6 u' i& _( E=========
0 c6 e2 L; U- P" ^+ U
% n. Q1 W( Y5 p; w, `Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- q( p) j2 t" m
(API Get entry point)
?. f P3 E+ ]3 E+ S2 V
9 d! N0 R8 K4 J" c# t
" F+ i1 O5 p) X9 v; Z+ K xor di,di* z, l- [; |. ]
mov es,di
4 U" ?2 F3 R$ R% } mov ax, 1684h 7 U* ~/ G1 y$ {+ m- J( I
mov bx, 0202h ; VxD ID of winice; T: W; h; X( |0 u" {+ ^
int 2Fh/ [! f8 D7 s5 }
mov ax, es ; ES:DI -> VxD API entry point& v3 g. G: J, n; p) h; }- \
add ax, di; c g% ?6 V' u) U& X ~
test ax,ax
( Z( p0 o( i4 L; V; S! d7 P6 b3 g% z jnz SoftICE_Detected
: H6 [" X4 |: Q" q' U: n4 O9 e# r; A; W i1 [2 b& t" z
___________________________________________________________________________
( G+ S$ m6 c6 Q A1 ~2 Y3 u' J! K/ }/ |: i( _2 a
Method 04
* @! @% ~. | _$ I=========! p. i6 j+ E" Z
& \0 d0 E' d6 Q3 iMethod identical to the preceding one except that it seeks the ID of SoftICE
. j! y9 u/ ]9 qGFX VxD.
! X! {/ {: o* x# Q
% c; U# a7 ~( h xor di,di
6 K7 e: `/ G: M _5 j mov es,di
6 U U# v- T' ]. x: w* F mov ax, 1684h 6 ~) S9 U& E) [5 `# S3 z" @* l
mov bx, 7a5Fh ; VxD ID of SIWVID
, r& L/ Y+ m+ _. j: [$ s int 2fh* {: }$ k) w* b0 M% ?
mov ax, es ; ES:DI -> VxD API entry point
4 F, ?3 T' K. g5 L! n: |4 O add ax, di
2 i3 k" I2 n/ X M# ~. z9 u test ax,ax
- y4 h, h3 u8 T3 u: s6 O( ~' p jnz SoftICE_Detected$ d5 {& Q, `4 i* A# }
- t" Q8 m3 M( D# a& `6 a1 u0 @__________________________________________________________________________3 `& T5 N! V% {+ y) t4 S5 p
# e- j$ H+ [6 r0 _6 \: Y
! ~* Z$ f" \" c" dMethod 05 v( R8 |1 I/ c, Z6 v4 b
=========5 S) z' n. \+ J. v
. K0 I. w. a: r8 T
Method seeking the 'magic number' 0F386h returned (in ax) by all system
, N7 N3 J e0 H( Ndebugger. It calls the int 41h, function 4Fh.
: v* Y4 G# R7 t+ l2 o" aThere are several alternatives. , K. N3 P2 ] A" i# x8 [! \2 Y
" `, K) z4 h3 \. W' s
The following one is the simplest:9 g/ l; {" b9 I
9 n1 X" Z5 ?5 l4 `- {3 ^, c mov ax,4fh8 o) t, M0 I; |/ W& O1 ~
int 41h1 a j# t, R& e/ \4 @
cmp ax, 0F386# w- Z/ |+ A# N+ y3 |2 l) ^
jz SoftICE_detected- v& [* v0 E! O3 r
+ g+ X, D3 N( b& G4 ]. n
) p2 ~) |& {+ {, M$ r" R* _. {
Next method as well as the following one are 2 examples from Stone's & Z: z! F! L3 Z/ |) ] z5 ~1 V
"stn-wid.zip" (www.cracking.net):9 A# M4 _6 v3 `2 n: k: C5 U P
" F5 `+ p, a. ^
mov bx, cs; T# K* A* v+ h' d
lea dx, int41handler2
' R W/ e7 @7 f xchg dx, es:[41h*4]* u3 f! t! `' n3 K4 P8 U e
xchg bx, es:[41h*4+2]
6 j4 l/ M! ]# _ mov ax,4fh
0 ^# w/ y; p! \3 P int 41h
' U3 R8 P- l5 s2 _0 m% s xchg dx, es:[41h*4]
% R+ n0 Q( p0 H% M0 |( }4 a- d xchg bx, es:[41h*4+2]% ~: a/ I* P& e0 [- p
cmp ax, 0f386h! G& Y; c- r T: ]" a
jz SoftICE_detected
* Y# ~' s' d6 u) }: c1 |* R: |, v+ a7 f4 K
int41handler2 PROC
" q& G6 d8 H+ Y/ j5 M! M$ n$ | iret# `" l" Z, S0 [) \& E' R) C h: ~
int41handler2 ENDP: N( U o# ~ a: V
5 z0 f& J) j4 q9 b/ L. I9 V/ t0 `/ `9 }8 f$ U3 R, T
_________________________________________________________________________3 W$ W: u$ p8 L* m: p/ I
9 i# e0 t0 Y- A/ l4 b# j! ]8 l
# O& E1 F$ B8 A0 m& }( J* D
Method 06
+ k5 }- X! l! ~=========9 v: j: i* r1 c1 I, B b
4 S) V3 x# G/ o( G+ [5 W) p, a. L2 Q! G. n
2nd method similar to the preceding one but more difficult to detect:2 j8 @; E7 z& t8 T2 o
4 `( B5 b M2 F/ {9 h0 Y! g2 o
' J$ m4 H1 I* O9 Xint41handler PROC) K; F$ {( \9 S6 [
mov cl,al6 f ]0 o9 t% r/ F) e. T% P9 P. j4 ~
iret1 T0 R* s# X' A3 b( ^
int41handler ENDP
u4 M5 I. s" Y+ N7 _) ^) X5 Q. u. M, H
8 \4 [) e8 a( Y [: i- {* Q+ S9 L+ C6 N8 d& W
xor ax,ax$ R; w# T8 q6 ~* Y \" u
mov es,ax* W+ [5 L" ?3 j' Q6 P
mov bx, cs$ z- [; u6 z( [& x) W
lea dx, int41handler
. T* u1 ^' q- ~& @$ ?8 a9 N xchg dx, es:[41h*4]2 c0 H$ f% N) A" ~4 V$ |2 F
xchg bx, es:[41h*4+2]
0 L) Y# `2 J' ~+ M in al, 40h: s3 ^0 T; [# r& u; @, n+ ?
xor cx,cx
; g: \0 n6 \6 S: ^ int 41h
) O# m$ e b: ^" M" k xchg dx, es:[41h*4]& m3 A) u8 _8 i N; g4 X
xchg bx, es:[41h*4+2]4 X4 B/ S4 j7 L9 z) A0 g0 M
cmp cl,al
$ X! D R6 [1 c/ q7 D. a jnz SoftICE_detected& `, ?+ H) P* p& O4 w
9 ]0 O. e7 E; {+ d% k" L
_________________________________________________________________________
! X& |6 E6 s( Q2 j# U( I6 t& ~, s r9 g; F
Method 07/ @" j+ B+ U0 J1 v4 j. P
========= s3 X. R& U; p) K, ?9 ?
+ t0 J+ P4 H3 ~$ G9 f3 H
Method of detection of the WinICE handler in the int68h (V86)! h6 d8 G6 d" ^- Y [( b5 S
: s+ h9 e$ b ?
mov ah,43h
- G. h6 O: L1 M# S) R int 68h0 Z5 U9 Y4 U% C3 N" V( [
cmp ax,0F386h
* M3 \5 H2 D0 |1 S9 r$ ^9 u jz SoftICE_Detected* q2 l8 W5 j- l) H+ H
+ i& l5 l1 m* I# s! O4 e. s% {; J+ H
: n+ h V0 o8 I8 L- h+ K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" m$ c0 ~% R3 t) U0 q( X! b
app like this:1 c6 {5 {, O( R9 I$ m
) a u: ^! H8 M: ` BPX exec_int if ax==68
5 g+ y! p* L! o$ y: n0 M5 N! S (function called is located at byte ptr [ebp+1Dh] and client eip is% b/ w$ K2 A# t J" N1 `+ |
located at [ebp+48h] for 32Bit apps): ?/ j: I/ e3 ? ~' j4 ~
__________________________________________________________________________9 |" F/ p! J2 v" w) U$ E
+ ?% J' L8 L5 }. ~3 c; ^
# `* f3 \# G9 ^ M* ~
Method 087 n2 ?5 z9 H" h8 R6 Y, y
=========$ W: ]( S8 U! v/ x7 W% F( a6 [# d: d
. A9 T" {0 T$ Y# n3 b0 B# |* A4 v X: ^It is not a method of detection of SoftICE but a possibility to crash the
- @0 @3 |" {2 F/ \system by intercepting int 01h and int 03h and redirecting them to another' d8 K& {) U; U3 \
routine.
5 S7 t# h* z" ^7 x: qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 s. E1 d7 ?4 p* B& S! U0 \# C
to the new routine to execute (hangs computer...). }# B# `, ~" J6 Y; I! m: P5 Y
# M5 ^- u: }" l0 U8 k9 B) E$ B mov ah, 25h( I2 G+ I" A' ]: S: P
mov al, Int_Number (01h or 03h)0 @% m2 X9 D1 |) ]. C Q' J9 _
mov dx, offset New_Int_Routine
" k* E+ U m5 ]/ `" w1 R/ h int 21h: Y8 F" c- Z5 W$ @; c& p+ Y
, f" t+ K+ U# l: f, R
__________________________________________________________________________
& V) f9 `1 Z6 Q# D w$ \; g$ g: e$ Y5 [
Method 09: y3 F( a% X9 { n$ p0 V- y
=========
: S! c3 i7 W8 y: t6 l! F7 h5 a9 k- A. K, g1 @; [
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 a% }2 C+ z0 W, K, J
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ X0 w, t8 J5 F$ | o5 A2 x2 {The Get_DDB service is used to determine whether or not a VxD is installed
! `% h U+ ?+ S2 [! Z8 wfor the specified device and returns a Device Description Block (in ecx) for5 k, c2 d! I9 _! Y3 O' V
that device if it is installed.& J$ c; q4 G2 C0 Q( ^3 W1 R
7 ]/ w/ d; |3 S. N
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
. `4 U' M8 N$ ~7 q1 Q B mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)7 {8 l v! U/ H7 ^! U5 s3 z
VMMCall Get_DDB
6 E# g6 {% e9 Y mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 ^7 n% S. n+ _, A: i' q. I/ K6 @! R* j4 M2 {* q+ D6 E% U
Note as well that you can easily detect this method with SoftICE:$ Y8 B m* P t0 D
bpx Get_DDB if ax==0202 || ax==7a5fh
& H8 S) X5 r! z! \1 T0 A7 J2 a% r9 }% \
__________________________________________________________________________
, [5 s5 t. V: G. @* M8 k5 i( x# n4 X' M4 C& e6 g9 w0 }; H5 X
Method 10
8 [2 `: F0 \4 ^- x. o4 k=========0 n: ^" p/ E; t
7 a. i) b+ E" b/ x
=>Disable or clear breakpoints before using this feature. DO NOT trace with
Y# j* y6 c! L, t! V SoftICE while the option is enable!!
8 S' \1 O4 m- K" u8 l
3 @7 E# M4 ]1 M# {' Y2 rThis trick is very efficient:3 g. }) _( I) P9 u( x, ?
by checking the Debug Registers, you can detect if SoftICE is loaded2 z% [+ V/ b7 K, t) X- G8 Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if [) V9 v0 ~ j" S
there are some memory breakpoints set (dr0 to dr3) simply by reading their& S0 v& z/ m1 |$ F+ t
value (in ring0 only). Values can be manipulated and or changed as well2 }3 U/ N2 r7 O4 C9 o; I4 X
(clearing BPMs for instance)
* y' O" F8 t6 f+ H' F2 k* i, [' u
__________________________________________________________________________
( F1 m g& r( Q- Y/ U: V+ ^- p. [' l' s( |" u
Method 11
0 P+ f: I6 |# X=========
7 V8 _( K1 A2 r; \% s8 t) n) Q5 ?* y; S
This method is most known as 'MeltICE' because it has been freely distributed
% L$ p! G! F/ z# n5 Yvia www.winfiles.com. However it was first used by NuMega people to allow$ P% s% l# N" O, u7 Y
Symbol Loader to check if SoftICE was active or not (the code is located
& G" a& o- R9 k4 Qinside nmtrans.dll).( F/ h, A7 W( q
3 t9 X- @& ?" {$ U MThe way it works is very simple:
1 m5 r2 _2 [: H) mIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
( g, `; ~ j7 A& X5 AWinNT) with the CreateFileA API.
8 Q9 e8 N2 ?' q. v# }
. ~# q+ {+ U! H: `' i& `5 t- ?Here is a sample (checking for 'SICE'):7 @2 q+ _! B/ j3 I+ u# L
8 D. v3 i) B' _* ^ G3 G, y' \
BOOL IsSoftIce95Loaded()
: p9 ^8 c& i6 @+ O. R( W: S{
' A( y# K. o8 D# ~1 C, R HANDLE hFile;
5 Z" A! o& U. n% I% e2 e6 f7 D0 f+ F% Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 |% S T C6 e( y# } W/ Z
FILE_SHARE_READ | FILE_SHARE_WRITE,
: x# a; `* w% ~ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);$ l @- {# u+ p9 m8 A/ n6 J
if( hFile != INVALID_HANDLE_VALUE )& e A5 k' d3 K9 ?( y8 m6 D
{3 E- `1 d" H5 H: L" U
CloseHandle(hFile);; O; g4 [: ~! }+ w$ |
return TRUE;
' n! y; g+ e# Q4 V6 u }
9 N9 R: T! A- H4 S) t5 K return FALSE;
' `" B* D+ h/ c9 w6 Z+ Q: `/ H' X r: O}
7 @( h V* `4 ~5 R# t
; R7 `* M# D: i: B, RAlthough this trick calls the CreateFileA function, don't even expect to be" t* H( x7 ~* z6 P; H' x* u
able to intercept it by installing a IFS hook: it will not work, no way!9 K. h1 Q' F! O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& G- x3 D' B# P0 |
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 y5 z% p& I3 e$ }( o+ @
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 h" U+ i- H' N8 \4 Cfield.
7 ?& Q6 O1 U! `4 `+ I: N$ ~2 rIn fact, its purpose is not to load/unload VxDs but only to send a
5 G t; X9 `" G" P" C* l0 [! EW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 z6 y" D8 j- V; W$ K# hto the VxD Control_Dispatch proc (how the hell a shareware soft could try3 M3 {. w5 x& U9 x0 E' o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 S' V$ O; y% D/ O, N9 Q4 {4 {
If the VxD is loaded, it will always clear eax and the Carry flag to allow
2 a( W: n& ]6 a" A* G4 r: oits handle to be opened and then, will be detected.
6 @2 Q3 t3 T6 M6 j$ V5 VYou can check that simply by hooking Winice.exe control proc entry point
+ Z/ Z5 r% X. ]2 x5 L1 ewhile running MeltICE.
' v4 D8 `% c+ W3 U$ }. o7 |( y+ {0 W2 @+ q+ Z: e
/ @4 x. T. _$ K& p. ]+ D
00401067: push 00402025 ; \\.\SICE4 R+ k- F4 A+ |% |0 [ v! l T
0040106C: call CreateFileA' C- f: o8 c6 r: }3 w! y2 M- J6 W
00401071: cmp eax,-001# |! W- P. p! i2 |) I! F3 d
00401074: je 00401091
) m; k- W' o0 L$ r$ c" w# G7 c- I9 C' {) ?
3 G$ w" U& l2 hThere could be hundreds of BPX you could use to detect this trick.
$ L3 f' f! |0 Z# A* Q-The most classical one is:% _, C* i4 m) E1 K* k
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* O# A" U9 o4 e& M* o6 F2 B& f7 Z1 c4 q *(esp->4+4)=='NTIC'
& z# [- J1 H( C4 ]& s
. [8 o! Y. I7 n-The most exotic ones (could be very slooooow :-(7 s: P1 E9 W0 d2 A# v1 i
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
# M4 g- `/ ^8 o$ l4 t ;will break 3 times :-(& h/ d$ B- }* z" b1 w
! L/ o- ~' ]# }3 _/ `8 L7 w
-or (a bit) faster: ! S3 q! x" {$ m. @
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
* N* v- e+ f8 d9 R t8 | J! m; a" N
o- L7 f2 p7 f. F" r* e BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & \: ]; y6 S. X9 d7 ^) e5 C
;will break 3 times :-(4 u% v( T1 v6 Z0 `, E- L$ l
2 K: n+ t9 g7 \/ U ^! B-Much faster:- a& E8 X, F* o) y) ~% F+ m
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" Y: v+ X$ x7 t9 y5 \9 A( ?5 i, a/ Z, d3 F& B5 s& `* H) m' o% Q2 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen4 z9 ^! ?$ K' N- R+ X
function to do the same job:
2 ?& `+ C% n9 {" R" X, A7 y! R! ]' ?. s* {4 D
push 00 ; OF_READ
# ^$ G! S0 S$ Q- A- F. f2 ^+ @ mov eax,[00656634] ; '\\.\SICE',0
@! G5 Z7 | b2 X push eax! p( K/ Q; y5 H
call KERNEL32!_lopen
" W4 p. F2 k/ }( U inc eax
9 A) U4 }: C( a8 R jnz 00650589 ; detected
, k, r; `0 ^1 A( h push 00 ; OF_READ
& r- d; V( _6 j1 |8 e2 S mov eax,[00656638] ; '\\.\SICE'
% f9 Z8 l1 W6 X% l$ } push eax% j i$ n( M; t( Z
call KERNEL32!_lopen
) O' m; R7 q/ Y; T- u inc eax7 j: _. M* F6 S- T& R3 \
jz 006505ae ; not detected
5 ~3 N8 l' x2 E: H2 o' t$ I! _- X0 H: N3 L( D
# P/ _5 I1 r! B' [0 c
__________________________________________________________________________: o W. F% ~! @9 }7 Y; B" H
7 k: [0 L$ V3 Q# q) K. }5 NMethod 12
$ F8 d0 k0 S: _+ n" r! q2 p; q=========
, r9 d- S! j& `( ?- `3 B [1 P: x5 w: I( G
This trick is similar to int41h/4fh Debugger installation check (code 05
$ W: b( T s2 v: N0 x) Q7 Z& 06) but very limited because it's only available for Win95/98 (not NT)" S+ Z* a2 y# e. L4 J' s/ q& d
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ B( d* f, _- O O6 {9 ^* I. L2 \
7 x' s4 x% q5 N x push 0000004fh ; function 4fh! o1 O4 L# Z2 g
push 002a002ah ; high word specifies which VxD (VWIN32)* R0 s4 D8 q/ j& u0 l5 [
; low word specifies which service
$ o% u2 N: q) n' o (VWIN32_Int41Dispatch): r/ d: _; n, j& ?# t; F
call Kernel32!ORD_001 ; VxdCall4 O3 B0 ~9 A+ v! m
cmp ax, 0f386h ; magic number returned by system debuggers
5 N: v% M. n2 v( Y/ K: ~ jz SoftICE_detected
1 f" E' j* `) W3 G) c; `' m. d2 Q
Here again, several ways to detect it:
; e: x" A2 c6 j1 W8 u9 i3 U6 e/ i% z5 M' V" A: i
BPINT 41 if ax==4f
+ s. I: [( G8 Z0 |7 N( G' s4 t8 i! w3 y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
* v8 y, d' z) G" M2 Q
6 w3 J% n. J' W2 r+ O BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' @5 d- s( `8 ]# b7 p) m# T
; R; E* I7 m) D- F BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ a; D r; M/ K/ C$ t9 K! ^
$ u, R) z) N/ q# k) o. P5 ^2 W
__________________________________________________________________________7 G8 m& m) J, ]* M B
; F9 |2 p8 F0 b( _% l- c) BMethod 13
8 `5 l, H3 @# {! O=========
3 q/ s+ L: _' I, D @+ y2 \9 X4 ?! |8 c
Not a real method of detection, but a good way to know if SoftICE is
" R& e: k7 E+ _- |installed on a computer and to locate its installation directory.
8 t. ]: s: j( Z% t) I% b% iIt is used by few softs which access the following registry keys (usually #2) :2 y$ P/ p) c; [9 N) z, T5 x, i: S
g3 b4 i, i e$ N-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ X0 w! X% q: `
\Uninstall\SoftICE
1 z" I. D% ^, E" }-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE3 I6 k1 ]( _1 t6 ~7 Q( Y$ s. _
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 e8 `! O# i$ ^\App Paths\Loader32.Exe
% o ^, o# c |& r1 Q+ G8 m4 Z: u; P9 q; |3 m
' `$ |" o# X! D9 Q
Note that some nasty apps could then erase all files from SoftICE directory
+ c8 a2 [$ x9 F9 U5 k6 x1 k& r(I faced that once :-(" V% F% P, e8 X4 [) Y5 u% k+ y1 B
* z* E! l: {5 L- ^
Useful breakpoint to detect it:: M' m' v7 l7 e4 g `0 n; V4 y
- C. F. I9 |/ X' Q$ _$ j; l
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
f7 g4 D5 r; ?! d" g: S& i( E0 z6 t
__________________________________________________________________________
# [. U T, g. L& M- l* f; ~) {, N
/ q/ a5 D% a: ] U a3 W5 s
0 a3 p3 A5 X9 S* t" k; W+ FMethod 14 $ ^1 Y2 k5 [# w7 M
=========% b: R# \$ L n) y$ e" p0 ]$ S
& G7 K' ?- z( v
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ i4 c% y3 V% l$ o! W. z. J
is to determines whether a debugger is running on your system (ring0 only).! n, O- m8 ]5 k+ y
: t# O+ k1 a; |! K6 L' K
VMMCall Test_Debug_Installed2 ?1 O' u R' k/ p5 r8 v
je not_installed
5 Y4 a* z/ d8 y6 F- f+ K9 T, \! I/ N8 Q: s, g- y) t) }0 ?: o0 `) u2 E1 y
This service just checks a flag.9 v. t, }' _4 r/ B" h! s
</PRE></TD></TR></TBODY></TABLE> |