<TABLE width=500>( g5 Q- c) _ ]+ ~) U0 X k* T
<TBODY>7 F% ?. J% L2 I' f
<TR>' [% o$ P# j% J
<TD><PRE>Method 01 5 H: \/ U/ r) \5 ~" j; N- Z5 a
=========1 @1 c% a3 w3 Y4 b0 ^
7 [) G7 {% ^" qThis method of detection of SoftICE (as well as the following one) is
# p5 j7 [4 f% q, R" v3 }used by the majority of packers/encryptors found on Internet.
) L4 K2 x- H2 q( H- {) S) rIt seeks the signature of BoundsChecker in SoftICE' H! A' [% O! u- N3 q5 @! w5 Q g
( ^1 A7 j: Z2 N. X) x( V mov ebp, 04243484Bh ; 'BCHK'# k/ j* f+ E( S. X% S/ g
mov ax, 04h5 L. O! R7 h2 W+ r. r
int 3
$ u" G4 g) G* z cmp al,4: t7 J. d; b; C) X9 N
jnz SoftICE_Detected9 l% @' X( A4 W# o
. }$ ?+ h: u: Q8 F% h% p$ Q( }
___________________________________________________________________________
# C X& X6 }/ }- b( z3 w
: h0 `8 W1 z8 O' nMethod 02
f- y& c( P" r" R6 I! T=========
$ E; d1 b0 {* }* t! h& G0 }
. f8 E" r6 R4 S( l2 Q" PStill a method very much used (perhaps the most frequent one). It is used
5 N0 O& `+ M- e$ m, Eto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
h) D9 t1 H8 Mor execute SoftICE commands...
u& d" \* }7 }2 f9 T4 Z6 w' GIt is also used to crash SoftICE and to force it to execute any commands
2 Z; @1 A) t; g5 b: b, ^7 @(HBOOT...) :-(( ) [( `5 ~; t. {
) g$ V8 [3 q3 \- R- A) ?( mHere is a quick description:8 |, l C: p. u: a
-AX = 0910h (Display string in SIce windows)
' Q3 B/ `# U2 S3 _& m-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), o. m3 e/ P0 w2 _
-AX = 0912h (Get breakpoint infos)0 s4 E* E! s' |8 v
-AX = 0913h (Set Sice breakpoints)9 u$ n/ W2 K) z% `% `
-AX = 0914h (Remove SIce breakoints)
. w. i, F7 ?5 G4 h% h! [1 H) S. \- T
. c f5 w' K( e4 f# Q; LEach time you'll meet this trick, you'll see:
8 |9 V) a+ A+ X, v-SI = 4647h
+ y$ G$ W6 E; l, t3 D& O-DI = 4A4Dh M. t0 ~. X* x
Which are the 'magic values' used by SoftIce.
% \& O/ T! l1 dFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.' [2 C/ Q/ ^, V/ z
" `, |1 E; A) o' j1 b f+ }
Here is one example from the file "Haspinst.exe" which is the dongle HASP1 Y6 b" q) W) ~7 N
Envelope utility use to protect DOS applications:
. p& ?6 \4 d0 \- S, u! Z2 |
* }; T6 y! L8 [1 @$ B2 C) [9 I& b$ X( r( V# }- s$ U
4C19:0095 MOV AX,0911 ; execute command.0 }/ @/ E, }- u c, s
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 Y- t6 y5 {/ n* w- ]* w
4C19:009A MOV SI,4647 ; 1st magic value.& b: p) e) p( E) ^3 |
4C19:009D MOV DI,4A4D ; 2nd magic value.
' o7 V+ p; Q) A; B. G) m4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) d! U0 ~4 u: b
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute/ `& X# I4 _" _& T7 A1 |
4C19:00A4 INC CX& b$ h1 U5 @3 P3 }
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute& p" m D& b3 P+ J0 X8 F8 t" g
4C19:00A8 JB 0095 ; 6 different commands.: m; b) b8 S. F; P6 C
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
m5 }; Z/ W5 X5 m/ B4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& I! S0 Q6 u6 c, o
2 H: B) j% ^+ D7 X; DThe program will execute 6 different SIce commands located at ds:dx, which
' s. M, y. u) e* O& o' e. T( Y& K. iare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" V4 H$ X6 S/ G- C: r8 E; C5 t1 a/ {4 t4 {& x* x, T
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: j# E, s* z$ r& \2 A1 x8 U' j( i___________________________________________________________________________
* }- v& B7 ~/ P9 E2 W- F- P- V2 u& W! W- u" H
% O. A& Y. s. }$ C8 k, A7 w
Method 03
4 e7 B, o8 n, P+ C0 o=========
- ]1 ?* ?8 z0 _
1 i" |5 M- V2 [2 CLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. d( l, L/ i2 B" T* \8 d% l
(API Get entry point)
2 D6 A/ C& @& Q* ]; B" U
& A3 E! n2 {7 L
4 \9 J1 J2 m: E/ Q1 a6 ^3 W7 G xor di,di
' ?! K( ?5 P9 [1 d/ U3 M mov es,di
r, ^) ]- F5 o0 y* m mov ax, 1684h
# z G' a6 u7 Q1 k% F! u; M: `+ G mov bx, 0202h ; VxD ID of winice
+ E- Q1 z# u' ] x int 2Fh6 W& \7 h5 ~* M$ S% i9 c" }
mov ax, es ; ES:DI -> VxD API entry point
2 l2 u8 D6 u$ i8 @* S4 I add ax, di
7 z4 O9 l( q- U# m# m4 f2 } test ax,ax
i* R2 w) S! i' v4 Q5 p7 u jnz SoftICE_Detected
@. m) W8 W* s: ^& Z" \ y* |) Y+ K) e6 M5 ]. A& k
___________________________________________________________________________1 G$ y9 b5 y- D
! ^9 Q+ X+ P9 r
Method 04- s Y! W7 J# ^! y* i: W* h+ I
=========( t4 o) Z8 D' u( w
) K- A" [ k) \* J+ @Method identical to the preceding one except that it seeks the ID of SoftICE
! ~2 s' K* _ ^6 bGFX VxD.
& H% ~/ S m5 Q: Y/ ]; I: Y+ e
" b6 y2 n; P8 }" T% B j xor di,di8 l' V: V# z7 N% L% i' U
mov es,di3 J$ b" X1 f2 Y8 B X/ E
mov ax, 1684h
4 q0 c: N/ d2 p, ?' _5 i; t: h+ w u mov bx, 7a5Fh ; VxD ID of SIWVID* q" b# d# V+ \# _+ l- S8 w# O
int 2fh
; T4 z) m8 I x5 K* k mov ax, es ; ES:DI -> VxD API entry point
2 L3 Z* b1 E1 _ add ax, di
( b+ ~9 q7 {* T7 @, I- _ test ax,ax
$ d, s2 D3 T5 G jnz SoftICE_Detected% v; D- h6 t. V
5 M0 N) W& v3 P7 f0 Y% Q9 d__________________________________________________________________________
# }. v9 \0 M+ j P, V0 `5 U9 T% H" N! T( J% W1 o2 |
0 L/ |' q0 i' k' a9 K) h4 s
Method 058 u9 k! E3 P! v. P" H- e
=========& x' q% A! v1 _1 W0 q8 W4 {9 y
6 t; D) ~7 \; T( [6 K! c
Method seeking the 'magic number' 0F386h returned (in ax) by all system
6 j, z9 [$ r. r' y4 X$ m3 w5 }: gdebugger. It calls the int 41h, function 4Fh.: d+ L' C$ _' F1 _
There are several alternatives.
1 ~9 g7 l4 S! K, R" X- a( m( p* K6 g- t( X9 X" I
The following one is the simplest:
0 e+ d) \" i8 G; i- w6 c4 R+ `) b2 u+ \/ ?7 r4 P6 m- q# S& w
mov ax,4fh: z2 k. Z+ m1 H& h/ [5 h1 G4 @
int 41h
K3 R) h2 S" { cmp ax, 0F386
! G9 K! T( x; k( z5 H& M jz SoftICE_detected, U4 E% B( A% X
( L; g" U6 M. m% K2 a+ G9 v! F
$ \$ T: O9 e7 g; `$ uNext method as well as the following one are 2 examples from Stone's & U6 e$ v. j& h# w$ V3 J# N
"stn-wid.zip" (www.cracking.net):) i' O% ~" O* Q4 f
+ y; n' Q2 V8 M' t% A" R mov bx, cs: Y1 R9 y2 k3 i
lea dx, int41handler2
5 i7 h; h- O* I! X5 d; C: I xchg dx, es:[41h*4]
F/ ^: m; r4 {; y1 }8 c( t+ ]8 x xchg bx, es:[41h*4+2]& q ]/ ~# T' E. Q* S
mov ax,4fh
. v/ t9 \ v, _* P' V$ K I4 w int 41h
& K6 l, b! R5 k% I xchg dx, es:[41h*4]
. F% e- i; f5 Q, }, X xchg bx, es:[41h*4+2]
! k0 I: y% c; `- p Y1 P: z cmp ax, 0f386h
. i: u8 \/ K% _ jz SoftICE_detected B& W2 f4 @) y- T
! L/ R1 Z; X# Y# e& X2 b
int41handler2 PROC
& G; _" U, x4 t- ?7 @) U6 [ iret
3 w ?- i5 U% d; O1 dint41handler2 ENDP+ ~+ M2 ]0 Q8 v1 B/ N# [$ {
) T3 G# q! I1 l4 L2 L4 Q) b) f. V9 L" S7 y) v, ?7 H
_________________________________________________________________________; n6 [5 O; U+ Y, M0 I2 i7 _: I
1 n2 |* \7 K8 q; V! j2 j* ]6 S# b6 o
- C2 w4 S/ \1 k7 V, i+ e& QMethod 06! r* d1 A. w0 b6 Z/ }; u
=========
! C- k7 \$ V3 z N8 O- ` I" [8 S; F. S9 a F
3 a& q3 C8 q( n5 n2 h3 V; ~) I
2nd method similar to the preceding one but more difficult to detect:: ?7 b0 p1 r9 o
5 Q$ u2 j+ ?9 M) s
3 q6 h L4 N6 t( l; L+ {! M7 [int41handler PROC
# x' {: l t2 k mov cl,al
s. S7 }; G' {6 B; H+ N/ x iret- k5 r" e! n5 U8 g% l8 F5 U4 t( t* A
int41handler ENDP3 Z. H: l0 _2 {" p8 S) u! S% b
9 w$ j: S, T7 H( Z" X
, }8 X; Y3 O) ?, @% o xor ax,ax
2 h+ I0 u7 y1 U& R mov es,ax
0 N6 T% n( I' o& } mov bx, cs
" H& q4 U& m# H, ? lea dx, int41handler
1 r( U5 }. i' U) d& p xchg dx, es:[41h*4]
3 w/ B9 m1 m# ?4 B! X xchg bx, es:[41h*4+2]% S2 j! ^" D) c$ K
in al, 40h
1 u" z2 j7 A: c9 M( L0 q9 x xor cx,cx( {" Z, m$ M9 T* z) Y- T
int 41h
~( @) @# T/ _& Y xchg dx, es:[41h*4]
6 [# B5 u; V3 L7 w- H xchg bx, es:[41h*4+2]/ C' }( o2 h/ s) \3 {
cmp cl,al
9 g* o1 J8 E/ `, V( { jnz SoftICE_detected2 ~2 ~3 ^; [, |. N& h& C
7 t$ E/ m# w! v5 I
_________________________________________________________________________( @& Z) J# J1 ~& N+ j
- N1 ?- h7 R6 U/ E4 }" b
Method 07( @4 g) B* e/ ~1 V4 `
=========6 S' x9 j+ h% Q( z' Y3 q
8 T& @; n1 z L) HMethod of detection of the WinICE handler in the int68h (V86)
- _# E! p: D# Y1 P8 N! Z
4 y0 Y: E: V. V/ ? mov ah,43h+ Y! F, @ y, W8 a* C5 q5 X3 B# K/ Q; x: n
int 68h" C7 a& q6 ^6 T: g$ C
cmp ax,0F386h' l- X4 {* A2 f! \" q. S
jz SoftICE_Detected
9 ]; x# N; N# Q
" ]9 D J" V% H
9 d; \+ S! o) e. Z6 ?$ t1 ^8 V7 T: o- O=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. d7 @, q1 e+ A! w
app like this:! Y9 ^# W B" ?2 ]! v
& {/ M* `" O$ w$ L8 n. n; k# Y' \
BPX exec_int if ax==68
/ E' {: {. ]1 {6 Q (function called is located at byte ptr [ebp+1Dh] and client eip is
8 }1 q0 K% | L; W5 v located at [ebp+48h] for 32Bit apps)
, }( {' k) E. @% l$ r__________________________________________________________________________
# p" L+ s% k" r- `& y; c8 u# R8 d3 Q2 L; y: h
% G+ q% [2 }7 o( a' B" @Method 08
8 X9 ~7 w* B! H$ n8 b8 ~3 y=========$ J8 P9 \& F, S8 k2 `
9 R9 w, ?! W2 A' Q/ N% I9 O8 s
It is not a method of detection of SoftICE but a possibility to crash the6 }4 R4 w v Z/ f: n% P/ R
system by intercepting int 01h and int 03h and redirecting them to another
- f( G, Q8 L9 j/ ?' F. c) c4 groutine.
$ H2 p9 }; g" bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ y$ T. J/ l4 L6 K( Y
to the new routine to execute (hangs computer...)
2 I4 V8 Y0 ]% H Q6 L' h2 `. w; \0 Y; ^2 n2 h: E
mov ah, 25h
2 n* Z- b/ l2 n1 d* y( _, ?* w& B mov al, Int_Number (01h or 03h)- y3 T2 h0 R' c
mov dx, offset New_Int_Routine
7 ]( N& c' e0 S/ n1 w int 21h, h& K/ |" F+ q9 s- S7 h
, n9 F6 r" V$ M& n__________________________________________________________________________
# k4 Z c+ ^6 s( Y2 f( W. U
/ Y' ~4 _9 i5 x, ]- z% GMethod 090 v9 X, d. |$ A* E4 R
=========
8 ]7 f$ o+ V& e
, H0 a+ S# P& w( a. _( zThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ t" ?9 F) t& \- cperformed in ring0 (VxD or a ring3 app using the VxdCall).
3 h/ A" s: I1 s: d0 _8 s' iThe Get_DDB service is used to determine whether or not a VxD is installed
4 q9 X7 R/ e7 l; dfor the specified device and returns a Device Description Block (in ecx) for y1 e; E; w& _5 V0 y) U" B- x
that device if it is installed.
# e' O2 ^2 D& H n5 o. e, E# t$ g5 M1 g2 V0 T3 I3 S/ Y7 w2 b. m7 \
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 {) L; x; k1 b- P
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" r* N ^' J7 h VMMCall Get_DDB
- Y% c2 c+ d k1 z8 u- u8 z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 n7 d0 I3 Q* O4 s- v! t; e* ^2 |/ w. R+ M
Note as well that you can easily detect this method with SoftICE:# k8 c, e; }3 l q, z j* P" t
bpx Get_DDB if ax==0202 || ax==7a5fh+ D: M* h" t3 u. u0 b8 a6 g: m; J
. G5 e c. `4 N( I T- x& \) u
__________________________________________________________________________6 x( e# ?1 n( y9 _6 O, n! V% }' Z W
}0 U0 Y+ W4 C" I6 ^: I
Method 103 _3 q4 Y7 o( Z$ I4 s0 A5 v
=========
; T8 N. U) p C) r, k9 b7 Z
1 c' Q8 \7 k/ W% `& P$ \=>Disable or clear breakpoints before using this feature. DO NOT trace with8 u! q. a- z( D" w; r! ^9 I
SoftICE while the option is enable!!
* Z, o! c& R! G5 m# Q1 d# T9 ]4 R( P" `* f! y! C0 W
This trick is very efficient:" h( }: [% a8 d- Y
by checking the Debug Registers, you can detect if SoftICE is loaded7 M; N( q% q& x4 n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 l$ F( j/ a( B2 S# G6 \
there are some memory breakpoints set (dr0 to dr3) simply by reading their, v8 W p+ a7 b5 X' H/ @' |' r
value (in ring0 only). Values can be manipulated and or changed as well
: u* \) H1 A% V9 }5 G(clearing BPMs for instance)
% |6 v7 M9 z* T; d% M L W& K1 U' ?$ B' r% `. w: }
__________________________________________________________________________% a: ~: @; e3 E ?& i
. K, `4 Y% O: q# R8 _0 p+ k+ @5 i" QMethod 11
2 x+ J* R4 K4 ~=========
4 W( P4 h& r9 w M1 y$ O* U/ p# O! @' Y+ j& p
This method is most known as 'MeltICE' because it has been freely distributed
- ]" R6 G0 _$ f# s& lvia www.winfiles.com. However it was first used by NuMega people to allow, h- @6 r, ^2 T% [- G) d6 P
Symbol Loader to check if SoftICE was active or not (the code is located
/ c/ M3 a( j/ N* qinside nmtrans.dll).) Y- D- Y+ s2 J6 U7 l6 U# Y/ G
4 S* e, B% h& k6 o& c) jThe way it works is very simple:3 I/ m: G7 a0 Y2 |+ u) s7 `
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! x" I/ A- o; ?% X5 Y8 Q+ y% _WinNT) with the CreateFileA API.
6 C. ?9 L1 b" }- ?( |. L" |0 _5 }$ ^! t/ U$ `* J* y
Here is a sample (checking for 'SICE'):) [6 p7 b& \/ J$ H* j
9 {6 H" G, \0 f8 hBOOL IsSoftIce95Loaded(), T/ }/ p* _: { q0 U
{1 ^7 D5 {0 |$ {
HANDLE hFile;
/ c- v6 O* b ~4 b/ W hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,; _- n$ I* c/ S) }# ^4 k* }
FILE_SHARE_READ | FILE_SHARE_WRITE,
; o2 k/ Q! `9 x+ s( Z% D% ? NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* f3 a( o& O8 u2 G& w: K/ z
if( hFile != INVALID_HANDLE_VALUE )
" F0 n" u. h' s$ B2 r0 X% j& y {
2 ]3 |2 k0 H% T: t CloseHandle(hFile);
1 ^* ~; A$ ^ o4 P; x# b' i return TRUE;) h' h$ X4 O! n+ \+ c
}3 @" [' b, S* }* ^" S" l+ u. e: Q
return FALSE;: W* \& f* ?$ ]! y* ~
}
: q- ]# O7 D3 H9 T) |9 J; |* ?( E( K3 w0 e
Although this trick calls the CreateFileA function, don't even expect to be
. Y/ U' d3 m, O' L( U, v5 n$ @able to intercept it by installing a IFS hook: it will not work, no way!
- u$ B( w: ? }% a( r' v9 I T- U. UIn fact, after the call to CreateFileA it will get through VWIN32 0x001F* w% K0 y5 a) D7 |, B( N2 T
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)! I5 a: V2 T8 ]7 u' l' J
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ x4 }' K& z- w j" s# O
field.
0 }7 L' C3 }- X4 I3 Q8 tIn fact, its purpose is not to load/unload VxDs but only to send a
0 K( ^2 ?: I+ j' a1 a& I. gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 S' A* ]; E1 w- X1 _, Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try4 R2 V$ M) P1 Y- U' ^' i* Y
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." c# h J i% V, Q
If the VxD is loaded, it will always clear eax and the Carry flag to allow
8 D/ l; n0 q$ ^% H9 e+ Y# Kits handle to be opened and then, will be detected.
0 f- y' V8 z: ~0 ?) P, @You can check that simply by hooking Winice.exe control proc entry point
$ c/ y/ O5 l+ w& J5 owhile running MeltICE.
' p1 D% x8 B9 g# N7 d5 t8 Q, m, ?4 ]- a
% i. t; M. l4 J
00401067: push 00402025 ; \\.\SICE4 J/ B6 W; P5 E, q
0040106C: call CreateFileA
/ `+ A* N( K. Z$ z5 n+ f2 t! \ 00401071: cmp eax,-001: s1 l$ ~" f6 x8 X
00401074: je 00401091- C2 Q; B! b: j z# H
0 R" z, W* N; P8 K; E! i# ?
/ \+ Z# ~# p! [5 J: @2 hThere could be hundreds of BPX you could use to detect this trick.
/ s+ a) h- z6 A7 O3 x8 g% `-The most classical one is:
b( T. _; Q" B' v BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( q6 R* w5 g6 i$ L' I, e
*(esp->4+4)=='NTIC'
1 ^! j7 b% u) z0 R# N
6 \' c5 A7 f: n. @( _$ k4 q-The most exotic ones (could be very slooooow :-(
( o I* C [$ G/ l, u% p$ e5 K BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
7 g" }% T! n; Q9 B* L ;will break 3 times :-(; i& e, Q* ]2 L6 j6 p2 x) y9 H
$ T s5 c$ I: J0 r5 C8 i
-or (a bit) faster:
F1 T/ o: s0 n1 f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& p/ N% w$ m8 _- P8 _7 \" @% @8 Q* o5 `
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) ^! H0 A: h# a( A0 }: |* g
;will break 3 times :-(1 q; n6 {; Z# \6 A& Y; l) ?$ B
4 X/ y. X w. T. R) f1 W1 o" `-Much faster:
" C$ I9 V0 G* ]+ H1 t g3 J9 t1 [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
7 q& P& `) [) J
; v" x) {! A# ?- U% g2 ~Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 a, r. [) Q d# e' D% Gfunction to do the same job:0 Q9 O" ]5 o: K! s
9 g. Y1 Q# c* C# v( Q$ |+ t
push 00 ; OF_READ S+ S8 g. `2 p2 r
mov eax,[00656634] ; '\\.\SICE',0
* Y" G$ W/ A, X1 L5 J" E9 e push eax ]8 T6 s- e8 v
call KERNEL32!_lopen7 u' _: w# N; ^4 a! j
inc eax1 n w4 F$ E8 U8 w5 L' H @2 P
jnz 00650589 ; detected
, @4 D! F# g) c) `6 ? push 00 ; OF_READ( G1 @7 k5 V. J/ `1 ]& ?
mov eax,[00656638] ; '\\.\SICE'
: r% Z4 Y* [) M4 c% m2 \9 g push eax$ x: u9 r5 V7 M( E) \! c3 ?5 p
call KERNEL32!_lopen8 n/ ~' \' S' S& c8 y7 u! J- X
inc eax
+ u: F3 [+ e; w; k jz 006505ae ; not detected% M2 e" M8 F( X2 P, P1 w2 {7 [
/ B0 r" M, v$ H0 j4 k: ~7 y
8 V% b$ ]$ H: R# g6 W
__________________________________________________________________________
g8 R) | S H) D# _
& {: _0 k- W' F' W' t [Method 12
/ B3 G$ a/ j% V3 y' f9 _=========7 k8 n! @! y# g" e
" z( e3 G) H/ Q
This trick is similar to int41h/4fh Debugger installation check (code 05- ?& Y. j$ w' H3 |- y
& 06) but very limited because it's only available for Win95/98 (not NT)& ~, S+ z; S) r; W" @! m$ A
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; n0 N; S/ }) |* m' ?
6 N( y( e; f: n; i( d. n push 0000004fh ; function 4fh1 K* }# Y7 y- |* [9 G1 g9 M
push 002a002ah ; high word specifies which VxD (VWIN32)
4 A7 t G+ t1 ]6 w/ z/ A" b ; low word specifies which service
O0 ?2 {+ a9 j( O d8 b$ P (VWIN32_Int41Dispatch)
o9 u0 Q" s" y) L# p call Kernel32!ORD_001 ; VxdCall4 O$ }. @; {% ~* z
cmp ax, 0f386h ; magic number returned by system debuggers: L+ y3 b) E! ] n7 ]9 ~: u
jz SoftICE_detected" g0 q0 S! }( [; e
! q: H$ G: C4 j) m" Q
Here again, several ways to detect it:
3 X9 G9 ]8 |% ^( J, p# b! ~
; ? z# ~7 g" ~% k( ]: r BPINT 41 if ax==4f
: G" n/ w/ m1 C- h1 }, Z+ M" o& }% D6 C' P1 h
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! B6 P$ W- ~7 g0 P$ ]4 c6 s! D
& k7 S! Q4 B$ z* r; f BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ `1 n$ V; Q% e* w) B& m
4 _- s" k3 |& |$ n# m5 X: P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 [3 A* s* V; s/ D4 `# C; r+ v% N( j K6 X$ j
__________________________________________________________________________
) M7 d5 G, m; o8 |, K/ h) J
: L0 `6 `# W5 wMethod 137 g! q6 v/ W# j
=========
; k' z9 O; c) d. ?5 p- g/ q! V# m7 n( i! _ w' k& T5 [
Not a real method of detection, but a good way to know if SoftICE is0 r4 h. w# W( b1 N9 O/ y
installed on a computer and to locate its installation directory.
, J9 \1 {' I4 E$ u3 v8 lIt is used by few softs which access the following registry keys (usually #2) :6 A: ?: l( l( B4 |# q; q
$ W6 n& x: \: B' V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- Q, V# L9 O8 S, h; U1 r
\Uninstall\SoftICE& i" |' J* ~, S4 @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 q# \5 ?( k0 ]; w5 B: O4 ]-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 S2 h3 m0 D- `1 Y\App Paths\Loader32.Exe
8 Y! }3 s, u7 X/ r
- g8 t8 @1 v8 ?* i' H1 Y7 K" A" |" B$ e% F* S8 n0 e
Note that some nasty apps could then erase all files from SoftICE directory. Z3 n' P/ T2 s+ @( e
(I faced that once :-(' m% l5 `) `2 _6 w1 m, X
; D! C7 z& y, [$ V8 S9 {
Useful breakpoint to detect it:
) A" s7 d7 l. ]# G. t3 V& t* ]4 v2 e6 g L8 v+ Q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; X) l- [, t8 C1 m) r0 f, S1 @- a& S$ N: W; B6 ^' n. p- A
__________________________________________________________________________. ~; x! K+ D$ t
- u2 H# M9 G% s' o* O" r. i, Y
! k2 Q. M; W; Y% fMethod 14
" ` s5 a7 y0 o1 l# p=========
0 y) T, o5 O7 p6 D5 K9 A) m
+ B. j ~1 V) y2 k1 f0 `3 b' dA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 E; E0 E* H2 A8 U; ~
is to determines whether a debugger is running on your system (ring0 only).# P8 y8 i1 @/ Z$ c; {6 m
* k% z, B- |( x7 Z VMMCall Test_Debug_Installed% D5 v. q0 {0 |% R
je not_installed
E: B* ?/ ]6 K8 ~7 N5 d# [4 c$ j/ Z, n' f7 }0 r
This service just checks a flag.( z; z# a0 M: J# t: ]& W9 S
</PRE></TD></TR></TBODY></TABLE> |