<TABLE width=500>- H* k2 a4 N! a
<TBODY>. M( I# X0 o, o w0 l$ ?
<TR>0 o0 N- |' A% J% T/ F/ s
<TD><PRE>Method 01
& z! Q6 i) H. s0 a; V( D=========( _# m( v: u- v
: N5 b8 W" Z. f7 F# t
This method of detection of SoftICE (as well as the following one) is- _0 }% m) i8 p8 R1 m t
used by the majority of packers/encryptors found on Internet.
! S3 Z" e$ R4 l" P/ B. u* NIt seeks the signature of BoundsChecker in SoftICE
% x4 q9 x z; ]0 e& B6 z- ~+ F! S0 z. i0 m
mov ebp, 04243484Bh ; 'BCHK'
B% c; r% a- V+ [ mov ax, 04h3 `3 h. ?: F3 G6 S
int 3
- l a1 H L" b5 k$ `) P& R cmp al,40 |7 u8 n0 X' ~( F" R! Z- c
jnz SoftICE_Detected
E. G K4 |. i+ n4 U& ~9 }$ K0 m6 D3 O
___________________________________________________________________________: O, f8 V1 Q6 X+ z" d
2 `3 F" Q7 g7 Y) W! ?Method 02( \, K) W! {" D: k6 }; R
=========
5 M6 r$ ] ?9 U9 K7 b0 R. I, d7 ^
. ]( E* Z% T+ cStill a method very much used (perhaps the most frequent one). It is used
& {; n+ G" M p) X- I& \# E7 S8 Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" V m# @( V( [9 O, h" M! ? vor execute SoftICE commands...
) l* T' z6 S% e n0 m9 QIt is also used to crash SoftICE and to force it to execute any commands
, {/ O+ i0 j2 I! X2 X! {5 ~$ @! q f(HBOOT...) :-(( . P6 t% M& R0 h2 p
" b. x, h' D+ Y* s, \$ QHere is a quick description:
9 m( j0 p) q& U" k-AX = 0910h (Display string in SIce windows)
, N, v+ Y/ J( _; i3 B7 v-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
; W9 ]; C; F8 d) P7 F0 g. H-AX = 0912h (Get breakpoint infos)
: i8 M: g4 e/ ]+ }* o! P-AX = 0913h (Set Sice breakpoints)3 _+ U- B j( L" [! E4 a+ ]
-AX = 0914h (Remove SIce breakoints)
) }0 n$ ]: ~. b5 n1 D. a! t6 O
+ w) |& [1 f4 l+ T' F7 R2 k# DEach time you'll meet this trick, you'll see:2 H1 Y3 j: i. U7 i5 s3 s% r
-SI = 4647h7 l$ i! ^, ]% m, |5 O
-DI = 4A4Dh
+ |5 c; [5 }* e1 t, EWhich are the 'magic values' used by SoftIce.: V- r9 O( s1 Z' S. N2 Q
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 y3 Q" M3 y3 W. r' ~
( W- t* n# u+ H0 t/ P
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 w3 P; n/ S% H0 ?" f
Envelope utility use to protect DOS applications:
0 L* w0 l' \/ ?+ _! T& v' {, N& X' r2 o" w8 \3 D
7 F. Q3 n# v8 I! s+ P- n4C19:0095 MOV AX,0911 ; execute command. a7 t, C* K2 }9 T, `
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 A: @1 L: S+ ^! A" c8 p4C19:009A MOV SI,4647 ; 1st magic value.8 n+ {# F" Y1 D% F: a
4C19:009D MOV DI,4A4D ; 2nd magic value.
6 L2 Q0 x5 M+ \" H- G2 i7 o4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ e; ^9 p( d$ d) H4 r& v+ d4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 }5 X$ r) z3 H7 W1 e; M3 f4C19:00A4 INC CX2 C0 B! r! o9 r4 Z3 E4 \ w
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 ^1 K+ n" I# B3 ~5 L7 M- q5 b; Y/ |
4C19:00A8 JB 0095 ; 6 different commands.$ H& S2 r. @; Q! C/ }3 `- F5 \) e. w
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! u! Y0 D+ Y9 a4 `& ?5 h4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
2 {, Y; D3 N& d: u9 [' |: G
$ O2 z. [% N2 e: NThe program will execute 6 different SIce commands located at ds:dx, which; I1 A8 P* W2 C4 K8 P2 I9 V8 c/ h- K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT., I) z* y0 L ?$ Z, M
x! } S' @ }2 h; X$ c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% t; @7 ~9 z) a) o+ [# G" C
___________________________________________________________________________
- ^5 f) C' h$ J1 T9 S5 l1 |
5 E8 `) ]# e' P) f0 ?, T; y; i/ j( }1 K
Method 03, a6 q8 I( l: y, B. U) r0 x% S( }
=========
5 R* \& Z+ a5 ?1 p& P3 C' c3 ]; `$ h, V! g4 u+ g4 c
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) b: w p$ Q2 ]1 s(API Get entry point)
1 ]# u9 M& D8 c! g. L) R 3 X' N' v( t. u; `9 J* k
+ `) a4 r v, @0 n6 k6 A7 e9 d
xor di,di+ I8 m2 Y) c; M2 R3 t' r& U6 A
mov es,di
/ {/ r! A& A) I X mov ax, 1684h
! } F" k$ W m! q1 ~* Y7 l" c, J8 r mov bx, 0202h ; VxD ID of winice
. I& H5 P" I, A9 n: q! a int 2Fh
) c- E' M+ U( d mov ax, es ; ES:DI -> VxD API entry point
: M2 i( q. {( X" e add ax, di
6 f" D1 r2 k% G: K" I7 G3 h test ax,ax
; o+ N5 ? k# j2 O z! D jnz SoftICE_Detected' D7 O* t$ p/ m) k0 p
& g" p2 ]3 a* A6 y
___________________________________________________________________________
; _- Z. N- L! i% g0 e. P
% z4 B5 h: \, ]! GMethod 04' \! U( C/ @$ B' b& i
=========+ T& A- G# u* z* x9 D' E! p
4 T; J$ W. L) x- i9 @; OMethod identical to the preceding one except that it seeks the ID of SoftICE: ^" \8 m6 E0 Z, M# M. v0 \" g
GFX VxD.
% e6 w8 }" Q2 H5 J z
( N. G# ^" A7 _0 x6 f xor di,di* T+ Y" |3 A' r! f2 H7 ?- k
mov es,di- w V5 d1 C' }
mov ax, 1684h
2 o3 {8 S3 P+ M, ~7 J mov bx, 7a5Fh ; VxD ID of SIWVID
9 P1 V* i9 s6 _4 x7 N+ q7 } int 2fh% Y/ E- d2 I% N8 T3 g
mov ax, es ; ES:DI -> VxD API entry point
3 M* k$ P7 q9 }& i! h add ax, di. M5 T3 S" a' l5 ?2 y
test ax,ax
$ w5 F8 G6 [+ b" m: o0 \- J jnz SoftICE_Detected1 ]' M( A# g# L' {+ \ ?
5 S% k$ K' `/ x& U2 q8 n) P+ v
__________________________________________________________________________
: R' g6 `# k1 `* D2 j7 F9 `" r+ P
& Y5 `, d0 j1 cMethod 05
+ G/ |& c; V8 d=========" L0 ~. i0 o2 H ~
4 T% }- \% C, g
Method seeking the 'magic number' 0F386h returned (in ax) by all system' w7 h8 b, @# Z0 L# I
debugger. It calls the int 41h, function 4Fh.
9 L1 j' A& j6 K6 J% LThere are several alternatives.
5 H8 ?+ _7 m3 W ?) n/ u
. |0 x* u( [6 H8 jThe following one is the simplest:8 t; g4 P( \1 V/ f4 R+ u3 u
. W. R8 r+ N$ D9 f; } mov ax,4fh
( B; l$ j, Y# d0 \* l5 m. {! T. ^ int 41h
; M" H- i5 x% p* E9 x3 o+ T' H: o cmp ax, 0F3865 n; C! Z% W5 O; L& {
jz SoftICE_detected
" i+ i7 p0 O& h; L! ?+ G4 S
+ ^/ |% {) d& S& [5 M2 [4 W! g8 a. r5 ]7 i" p
Next method as well as the following one are 2 examples from Stone's
/ \2 R |4 t0 B3 R" V; m"stn-wid.zip" (www.cracking.net):
9 b/ D3 Y. A, p7 T* ?" A; |
2 e8 F2 E. _& Z mov bx, cs$ I( U: \5 P8 L) t& k) ]" f, g
lea dx, int41handler2
" ?$ R( h3 X6 M# d xchg dx, es:[41h*4]
- U7 {& c' G" M( X4 V. K# w xchg bx, es:[41h*4+2]" y; Q- R: i" }4 H- U
mov ax,4fh9 ?. h+ ?8 Z; |( W( R
int 41h6 d- E2 T% v" \! z) l' g
xchg dx, es:[41h*4]5 P- O* `( u7 P U* y7 ? R
xchg bx, es:[41h*4+2]
% a. F, N! v& M( X3 @3 D% L) w cmp ax, 0f386h
7 _# i. M5 F' E3 s jz SoftICE_detected
" |% o0 C/ l: z+ [; y' ], z6 y& o; R* o# M. D9 Q
int41handler2 PROC
y/ j7 \6 h0 ~, ]$ |, K! R iret; z2 v' b# s# }
int41handler2 ENDP
1 j$ n3 _ W7 L
6 ]4 K7 [4 ]. q6 T" X( g8 u1 ~! ] {$ O
_________________________________________________________________________' B e1 U( F9 a( \
0 J! k) ?5 o _% g+ ?
: c' e! z/ Y6 ~! HMethod 06
* t9 ~9 i( d' A% y2 g+ R=========
. ~. ?9 P, T2 s' a( f% f: ^! T4 s
8 o+ E5 L) A9 I' V }/ r2 O& _% c- |! b0 q8 V# {0 j0 n
2nd method similar to the preceding one but more difficult to detect:: k8 r# N" w8 k& ]5 \, D3 a
H, i( F0 W* g. J6 t- }" t: ?* k p. i
int41handler PROC- b% h* q- {/ ?8 F/ n' T- m
mov cl,al" c4 W% |) j- y$ h
iret& \7 O0 A9 U: ~' P
int41handler ENDP. J" \4 K/ k" V2 {
( n/ P6 k' i. S% ]
9 n3 i1 e4 y- b) z8 j- u xor ax,ax
* [) D6 f% ?$ ^7 p. q. d mov es,ax
! K, j/ f! j) J S! K( I0 i mov bx, cs$ u" G. G* I+ x5 |
lea dx, int41handler
; Q7 B6 A; ?6 g/ n0 ~2 h4 j xchg dx, es:[41h*4]: e' ?2 M& J5 j; C2 c- P
xchg bx, es:[41h*4+2]5 k3 `3 }& S: X
in al, 40h7 i5 O& h2 \/ G; o4 a
xor cx,cx
2 d7 w, q/ x- x: k2 H int 41h% X* f8 ]- H0 l( C% N
xchg dx, es:[41h*4]+ e* U, o% o- I# p1 o" s* g
xchg bx, es:[41h*4+2]
5 ^: U' L6 _, D7 g& e/ c! w P cmp cl,al
# z# ]# B* Y7 l" q' _ jnz SoftICE_detected
' s4 T( T; b) L2 m2 ~4 O
# R1 b. @ M9 W4 v7 \/ v# ]_________________________________________________________________________
, B7 U( D: v1 h5 N
$ l# a! @% N3 N8 L5 HMethod 07
/ M9 C& B$ c7 k7 b6 g# {- H=========/ X3 `6 N" X; A* z( A8 }
* a( Z0 u( W- UMethod of detection of the WinICE handler in the int68h (V86)
; B6 }/ t: B* W
* d/ O5 D" R2 M mov ah,43h7 U1 g( d1 @% Q$ b D0 W
int 68h
5 K* {: J7 V; M) M cmp ax,0F386h
, S- l0 G( c7 K5 ?2 \. p( a jz SoftICE_Detected# a) f5 |: M( ~6 _5 ?* f
0 ~5 |) A @0 M* F" l/ `$ [# B7 f
6 z$ A" G6 J1 V" s6 z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" M; s6 d" z i- k1 e app like this:
( u$ S4 `0 z: Y/ x2 G: R1 M! l( C5 C# [ N& n) z
BPX exec_int if ax==68* A/ m- E' [3 C0 m
(function called is located at byte ptr [ebp+1Dh] and client eip is9 ^( [; z( d( A }3 E( N. z$ C
located at [ebp+48h] for 32Bit apps). B% Z% N4 x% h s0 N
__________________________________________________________________________
1 h5 N i7 B* Q$ r3 x8 a! @/ K$ [
0 A+ G$ B. n A5 Q
2 n* X/ _; i& S& s/ @3 d7 K; U3 `Method 08
C4 R! y: j4 P6 l5 ]4 e/ g! x=========/ n- V% l' n4 ^/ w! E
4 U/ U/ i( ^' e z2 z
It is not a method of detection of SoftICE but a possibility to crash the
( j% e( a+ p5 V3 f4 n6 V( g$ Nsystem by intercepting int 01h and int 03h and redirecting them to another
' t8 K' Q' X2 p6 `3 Aroutine.7 _9 i4 K% |$ Z6 {5 z4 q& f
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" `8 N( E) L; p: f6 F0 N2 z" Mto the new routine to execute (hangs computer...)! G& x: u6 G' C+ S1 R( U
% i* h, e2 n t! f
mov ah, 25h% a1 Q1 p0 Q+ [7 W$ i
mov al, Int_Number (01h or 03h)4 A/ z! M% ] s: b- ?% O
mov dx, offset New_Int_Routine" |" {% ?3 D8 o
int 21h
- m. O6 w( {% Y6 E) p, Q) K
N# [, \# m7 z$ x+ g- a__________________________________________________________________________
4 I6 R% ^0 V( z& `, j6 M
8 j w& _) ]- M7 |+ n6 E" V( VMethod 097 Q2 }5 Q" ~6 M* Q/ p* I# d5 C
=========
( j3 \! ~" @% T R3 ?/ A! \0 _4 S' R) |1 t' ?" s( R) ~! P6 Q0 ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 S) B3 t+ d! s
performed in ring0 (VxD or a ring3 app using the VxdCall).! u' \. |* F/ O1 Y# ^" g+ x) d4 D& n
The Get_DDB service is used to determine whether or not a VxD is installed% b! s. t5 M3 l- \8 g0 n
for the specified device and returns a Device Description Block (in ecx) for
) v- L7 L$ j# }0 _2 C) S8 Tthat device if it is installed.5 W7 d: r5 H* r* `
! K" i4 s0 k) l5 C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: _) u% }4 ~& ?' P3 m6 e! _' s
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! k& p G( j" Z# x, l! Q. o
VMMCall Get_DDB" h. x' J0 }' @ h7 P7 M) d$ J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
n# i' ~' }; P' ]" H3 W/ U! l' r- N
' h' Y+ b* f# SNote as well that you can easily detect this method with SoftICE:* b" ~9 f6 V. j K
bpx Get_DDB if ax==0202 || ax==7a5fh& X- h; r% T/ @" O* J( ]4 H1 z6 g
" E9 ?1 [5 I& L; ^" h/ J! J+ o
__________________________________________________________________________2 X. |# Y0 I: n7 T
) ], n. E1 I6 ~, ]- m' T1 |
Method 10
* W" f& b( Z3 p% m=========0 n8 k* |& _7 [4 j: [/ [
8 c# `6 Z! y% p6 C3 w% R* t=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 h- V$ n' |' u( e% U7 l SoftICE while the option is enable!!7 x: C9 P- L) m1 J0 Z1 \# ^
& ^/ d/ L" X6 d) h6 TThis trick is very efficient:
- V6 {0 n4 S, K6 p) A# n+ Pby checking the Debug Registers, you can detect if SoftICE is loaded2 R; A. K s0 g u- q& ~! d" f8 a
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ z/ j* A) ?6 T6 J3 x. k/ |there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 p3 M& O6 q4 bvalue (in ring0 only). Values can be manipulated and or changed as well! {. t8 y4 M. y) s
(clearing BPMs for instance)
5 M( B4 b+ D) ]. f( d: J& b+ ^$ T3 E$ E* w6 @) }
__________________________________________________________________________1 t! @7 Z0 C' w8 n" z/ s
; a. i4 a5 U! m. OMethod 113 J* f) p0 l9 q( v7 ]$ O
=========9 @- {1 @( U5 b, Y+ I
* r4 p+ L C1 M) A
This method is most known as 'MeltICE' because it has been freely distributed
; @ j; P: |3 l, i& C/ Yvia www.winfiles.com. However it was first used by NuMega people to allow; K8 F7 N% V4 N# G( L9 E
Symbol Loader to check if SoftICE was active or not (the code is located, ]3 k; c3 q7 j
inside nmtrans.dll).) A1 p* B9 W# L' V7 c( `
2 j" ~4 i1 i$ E/ s6 O/ p& tThe way it works is very simple:. w: v l3 N( b V
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% w6 M- |" a4 kWinNT) with the CreateFileA API.
$ X3 I& f, G1 j% F i1 H( P. C$ m6 d% U# S7 y5 c9 S
Here is a sample (checking for 'SICE'): |+ r* O% w. H( e
3 t! |5 A6 h7 ?3 t1 {. Y7 y6 K
BOOL IsSoftIce95Loaded()2 L& _$ t- k+ D2 \
{$ a r8 h9 X0 T. K" A) o L( u
HANDLE hFile; , m% J# J) t: U0 X) S% b
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) A( B7 u) b0 g- C) z FILE_SHARE_READ | FILE_SHARE_WRITE,
/ [- k7 u1 o- O' C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
( q* F! a: v& P3 m1 ^8 H) |# P2 d if( hFile != INVALID_HANDLE_VALUE )4 p+ q/ K7 ~$ S5 W- G5 @
{
$ B2 F# B" o6 V/ K" Q# i CloseHandle(hFile);
. I8 l. w. d1 I. C: M: p( r: m( | return TRUE;5 n8 h* A+ j9 l; M! {
}+ }8 }1 @- x- f' X
return FALSE;) m: ?2 t6 ^( g# Z {
}
3 Y9 ~* {: j, J8 ^, k8 g1 ~' u$ f4 Y5 Q' r3 s/ t
Although this trick calls the CreateFileA function, don't even expect to be5 B+ S1 B3 C% M+ A7 `: w& d
able to intercept it by installing a IFS hook: it will not work, no way!8 A6 r5 c" l! E5 N/ j* E! r# B# Y
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
2 F1 h' a2 f6 i. [! g+ [% kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 g' ~# ~& X6 i* \$ }+ K( }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ R- z. J! ^$ b- H9 A+ a# r* s
field.0 V! H8 g g3 Y2 `$ u
In fact, its purpose is not to load/unload VxDs but only to send a
1 h3 K; \# T5 s) yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 y2 ]) K' S+ o X' Z, Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try7 w# i+ Z( {. H* k2 x( n) H X4 S
to load/unload a non-dynamically loadable driver such as SoftICE ;-)., O$ j. V, x- _( w5 x( |; q* f5 _
If the VxD is loaded, it will always clear eax and the Carry flag to allow
+ j" I6 n' E2 P8 Q# m6 T fits handle to be opened and then, will be detected.
! t- Z) s- @0 i9 }- c0 ~You can check that simply by hooking Winice.exe control proc entry point) o" i/ L* _$ B- K* p- F
while running MeltICE.
& U* g! ~/ B/ h' }8 O3 d8 X- l& j- K; n
" s2 h; q9 m4 i; R, A8 ] 00401067: push 00402025 ; \\.\SICE+ P) ]* u; S1 b# ]3 \5 E1 A8 M5 D9 Z
0040106C: call CreateFileA. T- r' k# r8 d' e4 n4 r& _1 Q/ O
00401071: cmp eax,-0011 m3 i7 c o$ b3 z6 y
00401074: je 00401091
+ P; r+ ~- G7 i! o. H; ~" a; L
9 ^ y+ o0 E% X7 u0 r, V) Z% B
% S" d; [, `+ S; T# j, ^# qThere could be hundreds of BPX you could use to detect this trick.! w9 Q. J( n- A
-The most classical one is:
/ P: `, Q/ P2 K6 D, V0 U BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||* [ [8 u3 I3 \9 Q% ~: p( ]
*(esp->4+4)=='NTIC'# G& G1 g& ]# W! u% @
, M" @8 X7 s/ \
-The most exotic ones (could be very slooooow :-(& A, L3 Y7 W' z0 X+ C8 {8 q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') f, E/ ~+ n, Y" W) s5 J$ F% C
;will break 3 times :-(" U9 p, |7 _, a/ C) e3 R9 k2 |$ e7 @
5 m; N3 Y: v" `: A& r-or (a bit) faster: + p4 Q# Z T; Q @" Y
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')# }- g7 D( w0 Q0 w
# r' N" U) k, a: g* o% C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' , H C3 Z3 N7 u1 U+ X2 F, l
;will break 3 times :-(
2 |6 X9 S) C2 S. ~$ Y" ^4 Y. \/ x+ X- ], C6 S& J
-Much faster:, t5 F0 z* ?6 L. S: q, f" v
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 m& M' {& w+ \" d* I" o% a4 r. |$ o2 H( g! \' z$ ^
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 z6 E# y" j2 z! w- w3 [5 rfunction to do the same job:% O; E' t; e8 e; M: o9 C
$ {: d3 |$ h, o# w: ]& f% Q4 k3 S$ f& M
push 00 ; OF_READ
. `$ L, b! s3 D" Z$ Y mov eax,[00656634] ; '\\.\SICE',0
0 V* p" w. T2 D; D, P' A" p% B push eax- n" z% r0 E# |' ~0 {* u
call KERNEL32!_lopen% W8 u d1 d3 y! v; o
inc eax* ]9 g9 i3 t5 F& @4 V
jnz 00650589 ; detected
6 f7 ?& {! o! G push 00 ; OF_READ$ V7 b: n" ]8 l; a
mov eax,[00656638] ; '\\.\SICE'
: L! k+ p0 k2 B push eax
, X7 {: @2 M9 Z M& N call KERNEL32!_lopen
/ f3 G/ R4 m- E: N6 p$ X( F inc eax
# f) y% |; h ?/ p+ a jz 006505ae ; not detected
( R+ h7 }0 J9 c8 U$ p o' H0 y5 {! W2 f W8 E
- A$ D; [5 {. S% x+ R' h__________________________________________________________________________3 c* l; B* R$ W6 U% k: c$ ]
" h3 y0 F( H8 s4 N6 B7 ?/ t
Method 12
4 ~8 M# j/ [) b- H6 u$ i1 ?=========: W8 w# Y' I' D. P; Q- O7 E
( j$ Z; ?3 B+ ~
This trick is similar to int41h/4fh Debugger installation check (code 052 L( J0 X% ^8 g% M+ O
& 06) but very limited because it's only available for Win95/98 (not NT). L5 t# b1 a2 S- \) l0 R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.4 w0 y0 T) F% P. h. ^+ b, P( w
- j. G- z; B0 A% ^+ J$ m push 0000004fh ; function 4fh
4 c3 k6 H% k0 y$ [8 Y7 g) ~ push 002a002ah ; high word specifies which VxD (VWIN32)
. C3 n# k' f4 D3 a) v ; low word specifies which service
6 C& a& [- V" W* {" X (VWIN32_Int41Dispatch)
; {. t! m2 F7 z2 A5 K( j call Kernel32!ORD_001 ; VxdCall/ N% f8 H' V9 J% s# t
cmp ax, 0f386h ; magic number returned by system debuggers
' m+ H& t9 I: w+ }/ i5 `9 J jz SoftICE_detected1 j; }4 X' c) q$ A/ M W, t
) |5 G( p* j8 x o/ S) r
Here again, several ways to detect it:
: a, a* s- F* e' q1 D4 N6 l: w9 L+ k/ X
BPINT 41 if ax==4f0 J& y, G' a; S8 ]5 C6 \& C
" t; R3 a N" ^5 o1 Q. `
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
+ S- V) T6 V, g$ g6 U$ d6 @! x) F a2 R! {
- ]! g6 J; l* w C$ S6 g: g& e1 L0 R& F5 m6 _ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 h7 z6 A W l( i5 ]
9 L% g/ v6 h$ q, e. ?9 |
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 p( y c) P" ^2 j$ y; k3 F
1 E( i* ?% W5 e__________________________________________________________________________/ P, u0 ?( H6 `
' d9 j; W5 t0 EMethod 13
* \1 o3 k u# ]. c+ p ?# [=========
9 ^8 ]8 G: l0 M) h. `' D& ?
+ _2 m& }- m; c! m1 N! gNot a real method of detection, but a good way to know if SoftICE is! M( Q, V% `) |3 s4 g
installed on a computer and to locate its installation directory.
" T& n) B. h; o5 Z& w0 u xIt is used by few softs which access the following registry keys (usually #2) :
0 R* Z- _5 [( s6 v$ E
2 b3 U/ p3 R0 @6 Y4 u8 P3 |6 G, _5 g-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 |, `/ f; G/ X# \. D) l# H- [\Uninstall\SoftICE
4 t+ }, l$ y' @% r) \# T# n-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) U f5 t1 Z S+ N+ O
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, L! P! Z' v# f6 A7 ]\App Paths\Loader32.Exe8 U6 e m0 T# f! x; v5 c) E
+ x3 N/ [+ x1 j [) f9 K
; m, m2 M$ V& q0 _$ Z+ M
Note that some nasty apps could then erase all files from SoftICE directory) b4 E7 t, p2 S4 a8 y# N
(I faced that once :-(
. v* |# v) V" Y! @/ M1 {6 n2 w4 s0 W* D% c" s9 x* W
Useful breakpoint to detect it:
* e; e `# C2 G/ Y! [
( q( f1 e+ L- y# A# w* N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ Z ]1 Y, V, V* F! w: P
' \ ~/ s q8 _! ~3 S! @) G__________________________________________________________________________
3 _/ t ?6 |; v: l& m0 w% G+ f8 [4 e0 I; S" I4 ?- ^: M2 t4 s
" Z, X) q# p+ \) p
Method 14 & G+ ~1 I4 p M3 R1 J/ W
=========! v) ]8 @" b( G+ r, Q7 q3 _: U
: n( G# R- T' H+ d/ t4 D) p+ t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 c* k9 g t+ z" P+ i
is to determines whether a debugger is running on your system (ring0 only).$ R7 M! U8 {* P, G* U( e2 N
( ?' m# t- W* O: R3 Y; ~6 [
VMMCall Test_Debug_Installed
" p: T) \* Q7 v! ~( m je not_installed. S8 [- _/ E4 b0 K' u
- u$ r$ v5 R$ h6 v- _ q" ?
This service just checks a flag.
' [7 V X, k2 F8 L+ q</PRE></TD></TR></TBODY></TABLE> |