<TABLE width=500> B1 _: _/ b( C
<TBODY>
% |0 J! A" S5 a4 A k. V! b, ?<TR>" F/ O0 v6 ~- e u' b8 X
<TD><PRE>Method 01
% `5 B5 j2 q5 N/ V* V=========
! {- u, `7 y1 g2 j
8 f1 _5 s2 ]4 T3 UThis method of detection of SoftICE (as well as the following one) is$ F6 ~/ A$ ~& G2 S6 h) R
used by the majority of packers/encryptors found on Internet.
" U8 M- W, v6 m% A/ J/ W7 JIt seeks the signature of BoundsChecker in SoftICE
8 e5 c# s$ q3 s- V8 V) R& `0 R5 h: S) ^
mov ebp, 04243484Bh ; 'BCHK'
, X9 g1 X4 N0 E, ` mov ax, 04h# i6 w5 N/ J) Y$ G7 I$ J, D
int 3 3 R: x0 S) j9 W6 Q$ C1 S) S6 H
cmp al,4
, m1 ]7 v; @) P& T! N. x. i jnz SoftICE_Detected+ v& D/ f3 a6 ], @
+ j1 H' L$ l( ?# |- u
___________________________________________________________________________ v, M) a, {' n& K( H2 _
0 h3 M) p3 K# c- @, ?Method 02
5 N8 j9 G. H5 L6 e5 a=========
# C2 g" K. Q& D2 f/ Z5 x- y
* _& P2 a/ {6 o6 s& WStill a method very much used (perhaps the most frequent one). It is used$ h7 r5 {, O" R6 X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! ^1 J$ Z) l3 _; P5 R: Mor execute SoftICE commands...
- g" s: \$ ], {+ FIt is also used to crash SoftICE and to force it to execute any commands
8 H% [4 ^. m2 i* ?) c(HBOOT...) :-((
% d3 K+ u- E, R$ c6 |. \" W7 v* f4 I' w' ~
Here is a quick description:6 Q5 s g! ~- F7 u8 [8 [; [- d
-AX = 0910h (Display string in SIce windows)
4 Z) N/ H7 T- o# E5 K% L-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, G! J! K3 G4 o3 F1 K y( K-AX = 0912h (Get breakpoint infos)8 M! q8 @. o W- k1 a
-AX = 0913h (Set Sice breakpoints)
! S% f1 F. z. [-AX = 0914h (Remove SIce breakoints)
* m- E. E( a" V8 Q
4 E2 K- W l, d1 lEach time you'll meet this trick, you'll see:! c {) _# x' _1 a- S3 r/ m
-SI = 4647h
" @1 c0 ?" {9 w7 j6 y; d# R' _-DI = 4A4Dh
) y* Z4 ]; j7 R; {Which are the 'magic values' used by SoftIce.
& a! B$ b" ` W+ e* R, @& tFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# _( b: `5 V* v" S* |+ r
8 w2 w% }" v8 V5 E
Here is one example from the file "Haspinst.exe" which is the dongle HASP, ~) @; N3 D' d* D) Q6 l
Envelope utility use to protect DOS applications:
* n* I( w8 u7 C/ T9 n3 y6 ?6 r) i$ l
1 u& n% l6 ~6 q e- g0 @& u
! ^1 Z9 |* r5 c1 V3 k/ h7 M4C19:0095 MOV AX,0911 ; execute command.
6 c/ ^& C- l' k; U4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
1 L) k: x4 h) v9 x/ Y: @4C19:009A MOV SI,4647 ; 1st magic value.5 P$ H! J& |! L) s) G) R) s9 n1 M
4C19:009D MOV DI,4A4D ; 2nd magic value.: z# F& s6 `; ~
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 t9 j2 n0 c5 ~! R1 x4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, U1 F& y8 y" ?) j* ]4C19:00A4 INC CX
) ~. t; `/ A( ^3 y/ Z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute8 e' R4 m0 j) G. Q. I( }8 T
4C19:00A8 JB 0095 ; 6 different commands.
% t6 {) J/ ^" Z9 U$ ~6 U4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ m8 w/ o! J, q! R6 m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% y8 \6 f- `' x' m6 |+ y
0 }; V7 L; c! h7 a9 v7 U4 CThe program will execute 6 different SIce commands located at ds:dx, which
0 R h) ~+ i* \6 U9 J) x& jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ \# {( W( d5 h9 R/ p: ^1 k2 A+ g5 Q& N6 ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 \6 H5 B- Z) d___________________________________________________________________________
( z8 a7 g; L$ C# b5 L& }5 Q! N8 k2 z& k. u* x
: s# X1 ~; I1 m5 s; p! A3 M9 nMethod 03# \8 Y7 y" V. ^2 t4 s7 t' ]$ S2 X
=========
: i5 `# ?( B3 Y0 ~/ @1 ?4 x* n; O4 ?2 g. _
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
0 H1 V0 |3 z6 {* F$ V(API Get entry point)
5 g) v; F; T/ w! ^( d8 \
6 \" u- [: k% T. i: l
# L/ J; _( |3 u xor di,di3 l8 `& t9 z9 w
mov es,di, g1 Z( r& c$ s9 L( U
mov ax, 1684h 4 e- c* I) y; l1 Q6 G# k
mov bx, 0202h ; VxD ID of winice
2 D: C0 ?& M) s R U! y" u2 b ` int 2Fh- A# b- K) o; `) z$ F1 a
mov ax, es ; ES:DI -> VxD API entry point
! A, ~/ G( U! B( ^) H0 @6 J8 r: x/ r add ax, di
o+ n: j' h- L* q# G3 Y$ B test ax,ax
( u, v% c( q1 c" H; _. M jnz SoftICE_Detected
; ^ n5 b' L1 P/ h6 [0 D# |1 p8 m4 _% G) p
___________________________________________________________________________! u- f" O$ ?0 a0 H/ m
. i* w1 q3 d9 I ZMethod 04
& @" ^, j3 _9 J4 h=========& A2 K! M3 Q9 W' `! I# i9 e- `& Y
9 |, C/ L8 D* ^8 Q4 yMethod identical to the preceding one except that it seeks the ID of SoftICE
1 J# B1 N& \2 E. gGFX VxD./ _# H& j( A( W; ^* k1 |3 I
- f/ s6 V+ |8 y; n xor di,di
# o& j9 g U! }3 G6 N mov es,di
9 R6 c8 h1 Z6 _3 J" I: b mov ax, 1684h
- @1 ?$ \( J. t0 X! w mov bx, 7a5Fh ; VxD ID of SIWVID
9 p: l; x* I6 h9 k int 2fh" L4 X. ~( l9 C2 ^6 B; t, w, }
mov ax, es ; ES:DI -> VxD API entry point/ `! Q8 E! R ]; X8 J
add ax, di8 V( \# @$ \& v+ y$ k
test ax,ax
2 Y6 x, X! A1 Q; S0 \6 f jnz SoftICE_Detected) `7 A4 f3 j% t
1 S/ o2 ?' Y/ j. z__________________________________________________________________________% s; F- k" W* J2 A6 ?7 w9 h# Q
' T) \$ F @' C/ K' `8 V
8 k$ y& k5 a1 f. uMethod 05
0 O7 n2 A; A+ h=========+ A T t+ V, {$ J4 P
, s+ `1 C; x3 I2 F$ m, o- i: J5 kMethod seeking the 'magic number' 0F386h returned (in ax) by all system
0 a9 X8 U( S$ t4 |: {debugger. It calls the int 41h, function 4Fh.
# H3 o ]( J; y6 QThere are several alternatives.
" ]$ v7 T% l: z9 y" F$ x0 T, r' M# d7 K5 p% ?
The following one is the simplest:
! B- s3 X1 D" O1 s8 X& d9 n7 _+ D% U9 g2 B! j
mov ax,4fh
- w2 M# s5 W# \. { int 41h; T4 S/ \! f+ ]" u
cmp ax, 0F386% m/ |. J+ N* k7 ]0 Y! y2 v) x
jz SoftICE_detected4 n) k* Y! n+ p4 w4 Q! z
; ~4 o/ @: a% x5 M6 `; i4 X
" a; ?$ \; ]& f; {9 h* }0 C3 N; SNext method as well as the following one are 2 examples from Stone's
4 H) e l0 l; X o* ~"stn-wid.zip" (www.cracking.net):4 _& n S! J# s1 M7 D( C: t* Y5 O
/ Q; u; i. G0 E1 {
mov bx, cs
" J6 N( @: ]9 E& @ lea dx, int41handler2
. ?# u# W# ?! E xchg dx, es:[41h*4]
6 u: `- |8 B% M( L+ e* S. A0 ? xchg bx, es:[41h*4+2]
6 z0 l q- _( [9 ^ mov ax,4fh
0 I" L5 Z B4 _( D! K int 41h
! r5 Z3 ?+ B. W4 D5 _% g xchg dx, es:[41h*4]
9 ]4 d, _5 }1 ?$ L+ u4 m xchg bx, es:[41h*4+2]& }3 `& Z1 ?7 O2 E }
cmp ax, 0f386h0 I; C, P' ]) Z4 F
jz SoftICE_detected( S$ ~* m% x, {* C5 |* F
9 i. h: ~" G; [' y+ e8 n3 u
int41handler2 PROC
! T: y" s+ ], ]+ z& Z9 }+ G iret
5 p, z- b, _5 |! tint41handler2 ENDP+ |9 w& ^, m( E: ?% \ \) u
& R1 ?+ d- a# F. z$ w+ w: Y* N% Y
9 D# I. f# q( E: y8 }_________________________________________________________________________. a" C+ o+ o! P% f* ^6 x' S
, [+ v2 w( U3 Y
, W9 }; o* r5 Y% E q* s: r8 c* v
Method 06
5 B; j( ^9 Z; C5 S=========7 d$ P( H/ p6 v5 R
8 p8 A% c H' M4 R" A& }) B
9 c5 P3 N, x8 ` x+ L
2nd method similar to the preceding one but more difficult to detect:5 A! s" j3 f" i+ v+ X4 x
9 E& L' l; k1 w8 E$ H6 Y8 L$ i% K1 s
int41handler PROC; u7 q9 H+ w9 ?8 o! Q. p4 S
mov cl,al
0 k6 m' k# I& \- s2 K iret
w0 h) v D( i6 b2 m0 A: v8 m4 aint41handler ENDP
3 x! p& n* i+ {7 Z$ ~8 k; g3 b: _4 ?% F9 i
" u' f* A# I( K9 L& @
xor ax,ax
* I3 J$ ?) e8 A; |4 y2 y mov es,ax+ Y, y _* T I2 F/ ]" g
mov bx, cs% P6 C: J4 `; o% E
lea dx, int41handler/ a; x& I3 l, _9 _5 C
xchg dx, es:[41h*4]
" B: L% P6 Y: |; ?, Z+ S& H xchg bx, es:[41h*4+2]
. w5 S( _) r1 K5 K4 T' P' t in al, 40h
f3 s- ^/ d5 f! f' |" i xor cx,cx
9 s* C/ i3 N1 g0 C2 r* y; L int 41h
, ?; R7 Z! X4 |! z# x xchg dx, es:[41h*4]
' B, F6 T/ {( r" ^; [ xchg bx, es:[41h*4+2]
$ v5 g, t5 O5 V1 ^ cmp cl,al2 t4 O5 c2 {: l
jnz SoftICE_detected! b1 V0 A: Y( E* m
: ]8 K! \# p: B& ~9 C2 K2 D
_________________________________________________________________________4 B8 z, h$ r; d& ~
) M T# _: K7 D5 S7 v
Method 071 R5 a* F+ @0 Q5 w
=========
* w& O2 D2 @* _1 p0 a4 E& m+ t: Z- |- u; |: F- \4 t0 V
Method of detection of the WinICE handler in the int68h (V86)3 U% u9 z: ^; Z* h* n
4 f3 T" s, x+ S I/ Q) I7 b" q. D
mov ah,43h2 }# f( V; a; E% H/ \
int 68h( e, A$ t% I& _0 n4 O8 f# ]
cmp ax,0F386h' O) ~5 M' N) R& n8 q
jz SoftICE_Detected
^. D9 c* B: ^! H( h/ c a' n4 T6 Q8 I
0 D' J6 z! x0 m( l4 s. }. I
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' p! ]* B# Q2 J, ] ?$ e
app like this: R* N- s" n o: Z
- ^8 X; j. u8 W4 J# ^ BPX exec_int if ax==68
% z9 Z6 o, C9 u* v# Y; c: V0 @ (function called is located at byte ptr [ebp+1Dh] and client eip is; D3 z; A0 D5 t0 T0 E7 r
located at [ebp+48h] for 32Bit apps)
0 n* x) r( ?; j5 Q3 Z; m__________________________________________________________________________! c$ E" M! ^- r- c: ]9 h/ T8 T; A. e
% B: H3 d: Z Q
4 J! ~$ Z; v. U* e2 q! I
Method 08* h. F) R6 d- ?+ a
=========# E0 Q) d; h( H9 L/ H
( B! ^$ M2 {' b# R5 nIt is not a method of detection of SoftICE but a possibility to crash the
. A8 a F& j. E+ _) A- Csystem by intercepting int 01h and int 03h and redirecting them to another( G& J( E ?6 K. G, L3 l* z
routine.
8 L# \7 }/ P3 M5 q+ X" `It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 \& O% R4 G. \) c! ~; i
to the new routine to execute (hangs computer...)9 @6 G: r3 R5 ~6 I/ P
/ r5 X$ ?* A& D1 M7 S6 y
mov ah, 25h
8 X$ ]$ y- I) M; @ mov al, Int_Number (01h or 03h)9 S# y+ K" m7 @* F( o
mov dx, offset New_Int_Routine
# ~4 M) d8 r3 ?3 A, |/ ] int 21h
& r/ w* V7 k3 X" s. W+ y
; g6 O7 Q& n7 `" O* T+ C__________________________________________________________________________& \7 y8 s7 K% k3 ~
. @% F2 ?* d) l8 E
Method 09
% b8 Y0 F) G, q- P=========) f+ @/ J- h2 {6 J2 N5 U# L0 J
+ Q! Q( Z$ K3 f" A( U2 f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. S4 O& f7 x+ ~5 U& J- Z
performed in ring0 (VxD or a ring3 app using the VxdCall).
" q( Q4 x/ U4 D+ [The Get_DDB service is used to determine whether or not a VxD is installed
$ C4 _: _1 d1 z! o Zfor the specified device and returns a Device Description Block (in ecx) for
; h# Y- J3 l Z* \( P% I/ W2 pthat device if it is installed.5 j7 P" z$ T9 {) V& c
" W" L" Y6 F. s. D mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 u$ |* T c6 I4 q
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 |2 h! c. x' D; c/ B* J% H
VMMCall Get_DDB
& U3 p% P1 d8 b5 ~/ p+ n/ ` mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 r& u. g$ A8 e# X$ G* Z
% p( h8 [6 |; P) XNote as well that you can easily detect this method with SoftICE:
P) L2 `) c# v( q6 v* t, Q bpx Get_DDB if ax==0202 || ax==7a5fh
% v( r( R" @/ H" ^2 e
& P: b- F# z# l__________________________________________________________________________
4 {9 v, Z* }+ Y1 @$ g$ e6 H- U1 ?) }* T. l2 N
Method 10
7 @6 o5 R5 ?7 m* g0 ~=========
! Y7 t9 \0 q- I1 O- q' W2 V3 X0 c' L5 \
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 t; U0 h- p# c6 ]
SoftICE while the option is enable!!
. r! ` d8 W X! h
" v8 b( L& {: VThis trick is very efficient:
$ q: v! k) ^( i" Vby checking the Debug Registers, you can detect if SoftICE is loaded
D5 \+ V$ B; _- i# }4 F6 i& d(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 S. b$ q* [' q- l# `there are some memory breakpoints set (dr0 to dr3) simply by reading their1 t+ R4 I" x3 G4 G d) X
value (in ring0 only). Values can be manipulated and or changed as well0 `. ^+ V8 j9 C" i- W3 G8 u8 n, P
(clearing BPMs for instance)
; s! u7 {: g2 _, c" m; `, }0 ]2 F1 S
__________________________________________________________________________
0 H/ n5 Z. S( V! `9 g& L# V# W, q8 ?4 B% B" c
Method 11
5 V7 G/ W) w' q, n=========
0 ~7 }8 L3 U7 N+ [- `8 L6 w$ H4 ~; S/ Y4 V- s" m! m
This method is most known as 'MeltICE' because it has been freely distributed
+ k7 E. H- S- b* o% h2 _6 y% Bvia www.winfiles.com. However it was first used by NuMega people to allow
# `1 t2 A$ S) L7 H' RSymbol Loader to check if SoftICE was active or not (the code is located
9 x! @2 [ u% Z/ d O4 J2 ]inside nmtrans.dll).2 Y( N# _. ?0 V; B7 X
2 B( Y) N% s) v4 x0 Q& vThe way it works is very simple:: X) W1 S8 m, k( C; Y; V" X" }
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 l2 E4 v' l* t
WinNT) with the CreateFileA API.
# g4 q0 e+ V3 _+ j4 a! i! @4 Q3 Q, y7 k6 ^7 u
Here is a sample (checking for 'SICE'):+ K! L3 g- K8 W8 \
7 Q2 H+ m- B P" ^BOOL IsSoftIce95Loaded()
! U! V1 ]7 d7 j{
% _: e. Z$ o5 P4 }. J+ C) q( F+ H/ x5 v HANDLE hFile; 2 q+ V' s. _, h/ x9 D
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,- V/ r8 [* X" }& s; `. ^% z
FILE_SHARE_READ | FILE_SHARE_WRITE,8 n6 u$ B! g |- |5 {) \: C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% w* k0 K% v9 H0 k3 x1 Y3 B* ?; t( q
if( hFile != INVALID_HANDLE_VALUE )
6 x& S) Q9 f, \ {& P. s7 q- T. s- S) m! i
CloseHandle(hFile);
; i/ D8 f# _ P! L return TRUE;
3 [$ v# p+ s8 x }
2 P6 v6 B/ ]4 y- F; `( n5 k4 A' r0 m- c return FALSE;
- b) R" K) T M1 R: k/ f; Z, p}* I8 D* B+ n% I
$ P1 J5 J1 S9 |$ x' D' O4 V
Although this trick calls the CreateFileA function, don't even expect to be
; y8 N2 U) W3 U5 }able to intercept it by installing a IFS hook: it will not work, no way!2 c7 [- D% Y( H" u4 c- G
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 e1 \# w$ I3 y5 c0 E8 T! m$ F- Xservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
# f5 j6 F: E( X9 B! I1 ^- Iand then browse the DDB list until it find the VxD and its DDB_Control_Proc7 j! a; X- ^" {# c$ h; n
field.
# q% _# Z4 g+ uIn fact, its purpose is not to load/unload VxDs but only to send a 0 Q- @4 t5 ?% D/ P. y9 Z4 \# @
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)1 V# v7 A: K! F) u
to the VxD Control_Dispatch proc (how the hell a shareware soft could try3 t8 [8 k/ ?9 a, z' B. C9 X! O
to load/unload a non-dynamically loadable driver such as SoftICE ;-).+ @8 ?2 M8 b/ G* q1 R
If the VxD is loaded, it will always clear eax and the Carry flag to allow# ^% P- m# f% B- X% v
its handle to be opened and then, will be detected.
4 o0 _1 D9 m1 [6 S# F4 ^3 z& LYou can check that simply by hooking Winice.exe control proc entry point
: V8 ]2 b( ?5 u0 S* ]while running MeltICE.5 Q8 G* b) K$ B
; v; t6 @% P+ {3 A+ p" @
7 U5 g9 x, T1 P2 k$ c/ ^ 00401067: push 00402025 ; \\.\SICE
% `, ^- h% P5 F' C4 _. s2 c% ` 0040106C: call CreateFileA
0 u. W# D9 J; R" j 00401071: cmp eax,-001/ {8 X' g n2 L0 Q. z Z+ u: [
00401074: je 004010910 z8 J5 B# E8 U ?1 {) x+ V8 ^
2 _* @8 A& B+ K# z& N/ y, u3 g# h/ M% [5 T& k: D
There could be hundreds of BPX you could use to detect this trick.- `3 @2 p. S5 u) j( z# N
-The most classical one is:
$ f6 O. C/ b* j BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# t0 y: P( m' `: X6 s1 c *(esp->4+4)=='NTIC'# |8 ~, u6 c: J1 o3 p
) [+ F! e$ h- r5 `. X B: q1 U% }
-The most exotic ones (could be very slooooow :-(
. A( D8 k, K* X. |' c8 y! S! g BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 S, p$ s7 m* {2 u1 \' H ;will break 3 times :-(6 O- ]7 \' I3 H4 [6 d, V; d. ?
" w7 Y" N9 ]& k-or (a bit) faster:
1 ^8 W. X5 O6 G7 @ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 L; g! M8 y8 h3 ]% q1 |) h1 T$ M( K
$ m3 Q: E5 p+ E) r' U; s+ Z8 x8 y' t
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' : X! H( [. \3 o
;will break 3 times :-(
3 e& V D* ~1 q1 v: c
4 f$ W, U. e) S-Much faster:- ~7 z( N: T% f, ^! d" ^
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! x( [' c6 k: r! C0 p ~% W- S: t; A @! f5 D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' f3 s! `5 X% ^9 zfunction to do the same job:% M* N2 W! a% S) O7 f) c) b. E- f
6 B. v* G/ r* Q4 Y z9 D
push 00 ; OF_READ/ U' A* d$ i- L: X
mov eax,[00656634] ; '\\.\SICE',0
1 u. F$ |) Q+ I" y. X0 } push eax
0 A9 W+ B3 F- l8 ]/ r call KERNEL32!_lopen5 y' r9 f* M# F- T6 p5 }
inc eax- L% \& L% j% A. A; d3 R& w; Y
jnz 00650589 ; detected `, j9 F+ A9 {; \5 p
push 00 ; OF_READ
0 m$ v1 i( T0 V* H* N* U# L mov eax,[00656638] ; '\\.\SICE'# U6 S( z! p' z& F3 m
push eax) A, R' u; Q& @9 ^1 Y
call KERNEL32!_lopen
; b# ~2 R. u0 n2 s# [1 C9 B inc eax
4 ] V: X. e2 `; Q1 c jz 006505ae ; not detected
$ }: Z; \, }/ Y- [1 S9 Y! I& j0 |* I* N/ S( S: m
* ^7 `" Q1 {4 @__________________________________________________________________________% d5 C- e: Y6 I, r2 p, m- h) y- W
- z) P. u) s. X- p7 r- _
Method 12, u! Q9 l2 c0 O: i
=========
: _$ ~+ y9 r/ u2 o B
8 c3 E$ V$ ^, d& ^This trick is similar to int41h/4fh Debugger installation check (code 05* k4 J+ @. H1 A9 C& Y1 x% v. U
& 06) but very limited because it's only available for Win95/98 (not NT)
: [8 s6 L5 G# @) J- Xas it uses the VxDCall backdoor. This detection was found in Bleem Demo./ h9 e# F. C T5 O4 _
6 T" j8 S) t: M: \- j9 v' [ push 0000004fh ; function 4fh
- H6 P w' Y3 e1 Y push 002a002ah ; high word specifies which VxD (VWIN32)- J. v4 l; n- j* {5 S6 D6 H. Q
; low word specifies which service' J6 ]2 y$ \2 K2 ~! S
(VWIN32_Int41Dispatch)6 R$ i/ O" r8 C0 Q. }5 p
call Kernel32!ORD_001 ; VxdCall
; s: t$ z: i) ~( ` cmp ax, 0f386h ; magic number returned by system debuggers* J' \+ T8 [: ^) U7 I
jz SoftICE_detected
! a% E5 o. j; o0 e; h W9 w8 Z% \$ |* X; f0 Q- ]! k
Here again, several ways to detect it:* I/ j% G: ?$ h/ ~) C
, A4 v |4 i7 l" K+ t# o' U& b BPINT 41 if ax==4f* C, R* l/ Y* L" [3 }
& {# q7 v% ?; u) y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' E( e7 E7 s- a8 u( p& O5 D, j4 k2 I7 c
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A. M" s3 n* w" w) B* k! r, |$ g
3 w$ n+ e& F/ f. k) a BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. u1 K* R# u/ \* `7 `
8 ^# }" F) z3 y. j) L5 x
__________________________________________________________________________
7 H2 x7 }$ V v3 e+ _ {
8 P+ C) e. M, P" r, g! lMethod 132 _4 ]$ }% r/ K' B- [' X! {$ a
=========
7 H. o# Z' Q. f( n: U( N+ e) t/ p$ s5 {+ E" {( W: O! n' d+ H
Not a real method of detection, but a good way to know if SoftICE is \( {2 ~% o( t
installed on a computer and to locate its installation directory.
- L8 a7 U3 ^( L1 c: }5 Y3 [5 }, EIt is used by few softs which access the following registry keys (usually #2) :) U: U4 m1 T( j% \# j- c
% V, B2 W5 t( R* d- n7 e-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 q, e6 T$ `0 g4 o/ s\Uninstall\SoftICE! h; O. w, ~9 k: m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* {, s5 j& y) j
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: p4 F- i6 H9 m0 S3 `\App Paths\Loader32.Exe: A5 s; o$ K( z7 U' w+ k5 o5 R
, b: ^! Z9 k3 N; H/ m
; q& @1 \' ~8 v: Y, PNote that some nasty apps could then erase all files from SoftICE directory, y5 ^: R5 B4 @" j8 g8 w+ u5 ^
(I faced that once :-(. S( } }0 I- E: \4 T
Z( l- [: }8 W5 @1 ~- C' i
Useful breakpoint to detect it:
3 h, M* ^" ?+ i1 C: Z6 c4 p$ R+ k. L: g' ^/ I- M) J
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
# p) b( F( v9 q2 ^- b q& Z; A) f& S& }# R. \9 _
__________________________________________________________________________- m" C* l- n% K+ {" r
# u3 T" K& v+ D9 @; h" c, ]/ Y
$ X6 R ^2 s( B' A5 n9 D
Method 14 ) d" V" y# U' k8 d- u: l. q W3 A
=========
" d$ B1 \# G" A8 ?2 l. \: x5 x6 j4 Q b" ~0 w% O8 e# h* v
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# [8 I% O3 w% D' _is to determines whether a debugger is running on your system (ring0 only)." P! o, z# v/ ]: ?) Z
- d; C& q) l8 C* i C VMMCall Test_Debug_Installed; V1 h" n0 ~9 ]) U" y# [- d
je not_installed
. D' s% T7 O! N- t2 g5 t+ E) l2 t5 l+ N! w
This service just checks a flag.
/ B9 l5 \7 e4 M+ b+ Y# m) j2 ]: C</PRE></TD></TR></TBODY></TABLE> |