<TABLE width=500>
5 T* o N( }2 y9 _* w% @<TBODY>
0 |0 I. ]# ]3 i* G<TR>
$ K' M, N. }" U<TD><PRE>Method 01 # ]: _; `1 j0 _% d
=========
/ k5 `9 d4 z$ c; ~* z& w& O$ {$ f. \% }; c4 h, P p
This method of detection of SoftICE (as well as the following one) is% r" K6 c! j% G- n$ \
used by the majority of packers/encryptors found on Internet.
& @) p: l q0 A5 g) @It seeks the signature of BoundsChecker in SoftICE* X3 n g$ C# b# Z$ X) n
: g) [. c! i4 q8 K5 U) \6 \ mov ebp, 04243484Bh ; 'BCHK'
7 \0 X" B5 x( A5 Q% S mov ax, 04h% k' ~9 C( p/ c3 U, x
int 3 - W0 \( T' q/ ]+ g9 ^
cmp al,4
) l" c( W- i0 g1 T. e3 G H jnz SoftICE_Detected) p" u! T" ?; F6 [: f8 @
+ E) D: {5 t1 p2 ~ u# b$ @" o( [___________________________________________________________________________! q. Y9 g# ]( C. ~* j0 p' A- d
: p& j* d( ?* {
Method 02
: H/ H' f) n8 Z- G2 m=========
; v7 @, c3 W3 c, g* V; o
' ?2 m) ?: e0 N- P) g: tStill a method very much used (perhaps the most frequent one). It is used: w; i, u8 b3 r
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 l4 R' p0 l9 e3 `$ m/ o, i0 Qor execute SoftICE commands...
' W+ \1 m; P$ Y% @It is also used to crash SoftICE and to force it to execute any commands
5 u: x l1 T; h& N(HBOOT...) :-(( 9 ?# c2 ~8 y4 k4 e0 X& H
2 B+ I5 @5 b2 P8 U- g. J" d
Here is a quick description:
; r5 D0 o2 I+ g( H+ g-AX = 0910h (Display string in SIce windows). E! b+ p$ V* X3 U! q4 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) J% c$ K; v6 T* r9 {7 w-AX = 0912h (Get breakpoint infos)0 R5 i4 _8 h# F
-AX = 0913h (Set Sice breakpoints)
2 i9 c7 O, f3 J( r6 I-AX = 0914h (Remove SIce breakoints)
* L6 C: n( T. O$ i5 {" L0 l7 l; N R+ o3 U& s: O4 R
Each time you'll meet this trick, you'll see:* _9 ~+ ?7 r! e0 A! Y1 J; J# ?
-SI = 4647h
/ } e% X2 W5 g, f+ v-DI = 4A4Dh
, N, Z5 @0 c( m4 p4 sWhich are the 'magic values' used by SoftIce.
6 f5 b0 O# e2 B5 B9 \* v3 }, o1 eFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
I8 l! v2 ]7 R L, u% L4 Y. o ^! J) Z/ _6 x: a
Here is one example from the file "Haspinst.exe" which is the dongle HASP5 ~5 ?8 F) L1 m7 _
Envelope utility use to protect DOS applications:
2 M! A1 I( k* f M+ g" y8 A* R+ D: l
4 J9 t1 ^" d: c4 C6 W: x# P
4C19:0095 MOV AX,0911 ; execute command.
e9 F: q8 L+ @1 ~4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).+ A9 C2 [ E# ^# M( X' ?& J3 x" g1 r1 a1 q
4C19:009A MOV SI,4647 ; 1st magic value.+ d! a& w$ n: w1 V1 U/ c
4C19:009D MOV DI,4A4D ; 2nd magic value.2 Y; b* o$ q4 `
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) n) R- J' t9 t7 C2 V4 \
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute! V; R/ d$ x$ i8 M
4C19:00A4 INC CX2 \* X% y, U E; L
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
$ H! Q; {' _& b4C19:00A8 JB 0095 ; 6 different commands.
. A& l% x R" C& F0 Y0 P- [' c0 k" u4C19:00AA JMP 0002 ; Bad_Guy jmp back." D" |: C# j; X
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
* A) F, A- ^+ ^2 N
5 {6 ^% j p9 A% j2 {The program will execute 6 different SIce commands located at ds:dx, which) C+ ?2 Y% C9 X6 f9 K7 z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! n6 B+ v+ E6 Y# U% m5 q1 e
3 R X% U0 k% Q6 p- J9 Y8 A
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: [- t& F' A# X6 \: A% \" e: z
___________________________________________________________________________9 s1 H9 @' S) h& O( N: r2 k+ f3 I, i
1 }$ N: H2 l7 @* H3 _
! J$ N# _+ s* z- \" UMethod 03% w2 q o" p* F/ ?; r9 M
=========
% r7 e! n7 l+ T1 B/ g5 f) U
" S; ^7 e9 S& j' SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& x! N; ^! f7 g& }8 B; ?, Q& W
(API Get entry point)6 f+ ~! G+ O f9 Z) l, T
6 N- j: Y( @2 Y L3 A" c
8 q: h6 f2 R4 r, V) D xor di,di3 d' o9 n9 C, g2 C+ F" b
mov es,di% z2 `0 ~6 ~% \& w/ B% s
mov ax, 1684h 7 O& o$ x# Q# v& o7 H
mov bx, 0202h ; VxD ID of winice
7 w3 ~7 K2 n2 T7 M9 }# R1 Y int 2Fh
+ Y$ Y% @- ]6 H |. C mov ax, es ; ES:DI -> VxD API entry point
3 z4 q1 D z8 {- F% @ add ax, di3 c% c1 ]: ]& j
test ax,ax
) E# s4 l- F+ k+ `6 ?. S. @ jnz SoftICE_Detected
, L- @! m: I9 j
+ k- @- q8 Q7 M___________________________________________________________________________
/ Q2 C5 G* v' {" _
' D& i; f* [+ p9 @, J( n4 GMethod 04- g L7 n! G+ \- l
=========( {" k" n M" w7 c
5 T! k% \; e2 ]4 n e1 Z6 cMethod identical to the preceding one except that it seeks the ID of SoftICE
# k$ \" Z$ n* V) uGFX VxD.7 T: e/ z; s! M: d! W8 V" H
# |2 n7 J5 l. E I* o* s
xor di,di) W" b, S% r: m: w& o/ |' K
mov es,di3 F8 }5 _( h& @, C. ^& R# Y
mov ax, 1684h
& X, f' S! r0 A( `! x( T mov bx, 7a5Fh ; VxD ID of SIWVID# V) o; J& ]: t
int 2fh
% W/ v7 Y3 j: c0 I2 o; W mov ax, es ; ES:DI -> VxD API entry point
4 O" ?: b3 N) U# V7 ~" W add ax, di
8 C n( p7 {! v6 b/ O# p test ax,ax1 D- t3 B0 O6 L. {. r# g2 H
jnz SoftICE_Detected
/ L/ m. P7 k4 w U# B: e' E7 s: i
__________________________________________________________________________
8 T' r8 h/ O6 Z' j. ]% I. @2 L: A1 Z' w- N/ ~/ m, H4 }5 C
, T, `4 a% M ]1 [/ VMethod 054 H q% f5 t: a# e; K
=========7 M; _ B5 m9 ]" f
/ P: F N/ ~) t9 D5 sMethod seeking the 'magic number' 0F386h returned (in ax) by all system
$ G+ X) A! O/ b7 g- x. J8 \debugger. It calls the int 41h, function 4Fh.( ^; d$ j& t' D
There are several alternatives. & d% u5 }. D( k% e+ E
" b' y- W5 a' Z& s
The following one is the simplest: D* ?% p1 |" M" l3 }9 D2 ?
7 v4 |2 f \; o+ ?5 I+ |# ] Q
mov ax,4fh
- i- O8 B4 _. O/ E8 v int 41h; l( H5 Z4 {: n& s7 m0 k" {% _
cmp ax, 0F386
7 `- x" H b; N0 U jz SoftICE_detected; L/ Q4 y( x G# l( ^7 g
7 k6 o% Q0 m. v- y
. W" f$ g4 H3 [! ^; Z2 ?
Next method as well as the following one are 2 examples from Stone's
& p9 U2 N' ?! D- |. T"stn-wid.zip" (www.cracking.net):( I3 p5 K9 w1 o. s
4 |$ e6 ?. @$ O* T8 Q mov bx, cs
9 k c: T7 t, |+ v) Z8 X# r lea dx, int41handler2
3 `! \0 Q! c/ z& P. Q# z xchg dx, es:[41h*4]% ]% w' S6 Z; {' s8 f# e
xchg bx, es:[41h*4+2]4 r8 M5 D) T9 Q
mov ax,4fh u5 o- }6 A+ D8 V' ?4 s
int 41h7 e. d9 q- j. ]" a
xchg dx, es:[41h*4]
) {# I! d6 V* \, Z+ ] xchg bx, es:[41h*4+2]: X5 z5 [" }( K. }
cmp ax, 0f386h$ p4 O( T# K4 J" S+ G/ W: n
jz SoftICE_detected; f# r N& ^3 a8 g$ k: d
' }3 S7 r5 Y% v; B2 s
int41handler2 PROC, U7 A8 Z7 g' i; M
iret
, U7 S5 Z; A/ I5 fint41handler2 ENDP
# S1 z- d+ o1 t& I
j$ Q. Q, K. `9 X. ]: Q$ D5 i9 B( t; M2 g! N
_________________________________________________________________________
, s2 t4 N( u: |5 _
' d$ O( X2 ], o' C
! ^3 K. f* g" K: P+ Z+ VMethod 06
5 a3 V" k9 s2 n: A- a=========; Z/ F3 Q6 G1 [; z5 b
2 T5 t* Y( i" F* F$ I( r2 ?0 t) c! p, C6 a3 @0 R
2nd method similar to the preceding one but more difficult to detect:! e5 b* G1 z2 Z5 B% G& r
# W$ q/ N: L) t9 {
3 }5 w2 q9 l' B$ {int41handler PROC
+ e& ?- a- v9 [2 [7 N mov cl,al
7 c# W! Y2 \6 |% y iret
$ O' G% e/ k8 E/ Rint41handler ENDP2 e2 g7 F/ ~* q5 J- {( R8 R* h
5 @1 }) m0 U+ }6 [
' d& x8 {! z% M" X/ m, \$ P
xor ax,ax
8 u7 r8 b: A# f- ^( z0 D( R mov es,ax
7 @, }& d- K& r4 l+ `4 ?: Y& k2 z mov bx, cs( X0 y! E4 r/ A
lea dx, int41handler
) V F2 n; s9 h8 }3 Y' v6 A3 n xchg dx, es:[41h*4]
, u/ E) N+ Z/ k' n( {# u xchg bx, es:[41h*4+2]- F3 u- m- K8 ^3 b; \, F6 Z' {- }
in al, 40h
8 j* R. ^) L6 e5 i5 j4 N xor cx,cx
! @" F$ S6 Z1 d3 F7 b/ U int 41h
: n2 E; z5 T- P8 b( q1 I xchg dx, es:[41h*4]- j: b! E& }# X) b; H0 w. n; [
xchg bx, es:[41h*4+2]& v1 {5 y$ J# B$ T. M/ O
cmp cl,al. T9 |9 m: k7 r; L0 N
jnz SoftICE_detected
; d1 v0 J& l. I" y% m( s* z
& I, {, o" ~' y \_________________________________________________________________________
) r; G) j8 I% u8 R( _5 @+ ^+ @
j- L0 v/ t. y1 ~Method 07
# w1 D$ o6 j$ g=========
6 z$ r0 D" T% J5 u
) ^# S/ h$ F( h( y' K. t( V$ [1 t! xMethod of detection of the WinICE handler in the int68h (V86)' J' y3 o; F9 `; y1 z; m4 T# U
: c' L1 A( m6 d mov ah,43h
2 ~4 i' j s4 S7 v4 t8 ~: x int 68h
+ w1 E( }1 S& B5 l) s cmp ax,0F386h
& }; g7 L) p R- e' u jz SoftICE_Detected. m7 [% e; }2 B$ H5 \& p
8 p" c* y2 ]( X5 `% S+ Z
) ?! x* R* p1 h' E, B=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* Q* O$ V, Q# y# B1 Q- ~ { app like this:4 D$ A+ S3 a' C6 |; {1 ?8 z
, f0 J! a1 l" a- _; L2 x0 j
BPX exec_int if ax==68, y5 }0 f1 N+ d2 J* @$ i+ G
(function called is located at byte ptr [ebp+1Dh] and client eip is# s4 R3 ]& F9 ^, Q/ {" W# O
located at [ebp+48h] for 32Bit apps)
; B" k$ m+ e5 R; c! s3 t__________________________________________________________________________& Z. F- l, b; ?: z1 b7 ]
7 a7 m3 P# M+ G& R
! y& O* s3 k; ]9 NMethod 085 a, \2 Y$ L# r9 Q3 W. j6 ~
=========) _; t [, E8 X6 t; i
/ H _3 g2 O" o3 k6 ^, I
It is not a method of detection of SoftICE but a possibility to crash the
# x- B# p( V" s9 k/ m* \system by intercepting int 01h and int 03h and redirecting them to another1 M( a. Q9 k) s0 w' q
routine.
$ U9 w4 B7 g; w$ ^, U! e7 Y) XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# F8 C3 B0 g& \2 l& y; T' c
to the new routine to execute (hangs computer...)
" \3 M% I, \; C" z" T) {& @0 N( S) a1 Z5 D9 N5 ~& U* J
mov ah, 25h
' r, R9 Q% m \# }6 B mov al, Int_Number (01h or 03h), Y7 U( \2 j4 Z5 `/ {) o C
mov dx, offset New_Int_Routine
1 U6 v# R X; w$ k/ o2 T int 21h
9 M( i9 s& j' N. j" k& V+ N( h6 Y: k0 B
__________________________________________________________________________% `2 S& N8 H! X! z' g4 w5 f3 h
: {7 l Y+ J8 a& QMethod 09& H3 W# H6 j& i% Z( j3 T, v8 d/ ~
=========3 g$ e7 n: j( o; @. D9 @) A
/ O; A: D6 n$ l. f% D7 ZThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 M5 F; n9 q, Q* f9 ^/ Z$ _performed in ring0 (VxD or a ring3 app using the VxdCall).
6 y& Y: U) p4 l8 nThe Get_DDB service is used to determine whether or not a VxD is installed& M5 [, `: [ c4 l$ A
for the specified device and returns a Device Description Block (in ecx) for
5 N' `& l0 Z, A. s) o9 U% sthat device if it is installed.
B% Q: O! i6 {* T( }
4 l- m, W1 [+ o1 v' A mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! i0 q( w( I1 P7 o M mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) N2 j. S: J. w VMMCall Get_DDB& l. l' s" C8 ^! s3 m
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 P+ G/ f) k6 A# ~% T
. } v3 j& K" u4 j3 H
Note as well that you can easily detect this method with SoftICE:4 B& N0 [7 w9 Y
bpx Get_DDB if ax==0202 || ax==7a5fh8 U9 T, Y$ o, t: N; x( }6 n
3 k7 A& f6 T5 i: [. [. B; i
__________________________________________________________________________9 L2 N$ S7 s5 Z/ n
# w' S2 X$ @6 ~) AMethod 10
. p K0 J" S, S9 o |, W; T=========& B0 I) \* C1 h! X4 z* a) v8 b
; w: r% q3 h o' P2 R4 V& `$ F=>Disable or clear breakpoints before using this feature. DO NOT trace with
' e' N) X: U( E3 H SoftICE while the option is enable!!
0 E1 U7 X. y) b3 A. `1 y
0 s& ], _ m/ Q5 U VThis trick is very efficient:
7 m5 N: c7 T- \by checking the Debug Registers, you can detect if SoftICE is loaded! ^. N6 t1 ?9 L+ @% l
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
; ?$ Q' f0 a& n1 D; Tthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 W! j I5 S U: D9 K q8 m
value (in ring0 only). Values can be manipulated and or changed as well
, H, f8 z' b$ s- {- \- l( }( n(clearing BPMs for instance)
n% W" n6 g1 z& U, s/ [2 `4 b0 _% [- x7 y% A; V7 ~; T
__________________________________________________________________________' H* H$ ?8 I/ Q0 I7 ~! }
$ D$ p" D$ ^ V7 V9 n, L c) O
Method 116 q( j/ f( O* M' o g7 d0 y7 R8 @( S
=========
+ }( x" A. M* u9 g3 c% G" E& b9 Q% r% {7 @4 S |' h* a8 B p
This method is most known as 'MeltICE' because it has been freely distributed
2 y. g' N) U0 i6 S, Z4 e3 Wvia www.winfiles.com. However it was first used by NuMega people to allow7 k$ ]& c9 Z$ X9 t7 T
Symbol Loader to check if SoftICE was active or not (the code is located
' _7 n1 X2 x6 W: ninside nmtrans.dll).
# O) }4 o1 x% O2 [
_, h% |0 C- q: q* {The way it works is very simple:
: w4 Y/ C* G% l0 c! n$ U4 y) {It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 |7 N0 D% J d9 r, cWinNT) with the CreateFileA API.( j- Z# @* ?7 c: e! r
( ]6 j+ R |" ?* @1 x CHere is a sample (checking for 'SICE'):, M N" O9 e1 T6 p9 F+ j
4 o# n% P2 T& z+ r$ `9 q( DBOOL IsSoftIce95Loaded()' }: N8 X F8 { [- `/ [7 M
{
0 b, d+ E7 A4 y2 @0 Y: v5 j HANDLE hFile; 4 ?# r- G5 ]! t* C0 l+ y% n5 c, @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% S: A$ n2 `2 `7 i1 {6 y FILE_SHARE_READ | FILE_SHARE_WRITE,9 f8 ^# @" i) ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
8 Y$ G! M# H; d/ @- o. O( ~ if( hFile != INVALID_HANDLE_VALUE )6 T) {8 l" w+ x3 H& D
{
3 K8 v4 S; k6 J# }8 e2 X; ^ CloseHandle(hFile);) N& ~8 @/ L9 l( ?
return TRUE;
6 m ^; d/ j% N6 J( h }
% [5 }" D/ X" t9 d+ l( q% X" e7 k1 v return FALSE;+ M+ s$ ]# c& a$ _
}
_. M( u8 R, d, k8 ]+ E1 d) Z; W& S3 N- g1 t% r# B( p7 m$ p
Although this trick calls the CreateFileA function, don't even expect to be
+ j1 U0 `2 Z( t+ D7 B1 H# }8 pable to intercept it by installing a IFS hook: it will not work, no way!: _& u, v1 |; e6 z6 }9 a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 t/ y \ L3 x1 i+ v9 M8 Dservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 J5 L$ Y! Z% [2 d* d( M0 I" f, @1 L/ s
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 y9 Q6 P7 |8 M
field. f* R; R, s& h! ~
In fact, its purpose is not to load/unload VxDs but only to send a ; w/ @ u; b3 @. r; s2 s+ V3 s; Q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ f! T) V8 Z/ h2 gto the VxD Control_Dispatch proc (how the hell a shareware soft could try( y6 J" D0 K- f. a( Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ h5 ]. @$ ~$ d3 yIf the VxD is loaded, it will always clear eax and the Carry flag to allow# o6 N6 @: {5 W9 ^* W$ h
its handle to be opened and then, will be detected.
; _ X$ f5 l" P/ V( }You can check that simply by hooking Winice.exe control proc entry point
+ N4 R F& h% U) K: qwhile running MeltICE.
" ~" { B1 A0 S9 P9 x1 L' E$ Z
! `# J8 g' r* w' t
n/ Y/ F7 k. v2 G- A" j* i 00401067: push 00402025 ; \\.\SICE
$ V& O. U6 w# q H2 m 0040106C: call CreateFileA, A5 D* ~6 e8 r6 @) Q1 l6 V
00401071: cmp eax,-001
( j3 t& R( ]. X4 M( [* j 00401074: je 00401091
! |9 r, J0 U% }3 z1 X
- u; }& r1 e) M$ c) a* t8 Q5 \$ s4 ?, _0 @
There could be hundreds of BPX you could use to detect this trick.4 z- V9 G, ]( t E6 D4 m9 ~
-The most classical one is:
v7 I0 v0 h" P/ b( p: h( O BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
5 L& W6 s W0 d *(esp->4+4)=='NTIC'
6 M. O+ ]- [: k- b* Q! q
/ ?4 f' V' \! [/ @: O4 s-The most exotic ones (could be very slooooow :-(
6 U4 b+ ?( e! r BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( l6 ?$ c( C$ z2 b% R7 h ;will break 3 times :-(
- s( p$ k( t$ h( w& I% J
$ X" r; l$ q4 Y/ Q/ ?" S, m' _-or (a bit) faster:
$ ?; w: e1 h! ?8 h1 Y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 K# E5 ?2 I2 V# t
, H' O8 q: L' ?5 @0 i7 _
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' I% M$ g2 S6 |5 O& W. I
;will break 3 times :-(; q6 q8 y6 F3 {: t8 O
4 I8 N# B( r/ \ [* Z2 A2 W1 p-Much faster:3 D/ j; Y" D6 s& ?: I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
. l$ x2 U* g7 h0 [5 b) \3 B# L6 v4 ~9 p O: @3 f1 G
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' p6 A+ e, c9 ~- K
function to do the same job:
* x: U0 l. b: m; m: R
, ^$ {8 |8 H: c& W) L9 e5 l% N push 00 ; OF_READ
3 d# q& E; j6 n b. D/ o mov eax,[00656634] ; '\\.\SICE',0: B8 I8 i! z( j% Q, P" l2 e
push eax
F3 i* [9 ]: x7 [) s$ z: z" N call KERNEL32!_lopen# \9 B% ~, L- D9 }( Q) m$ y
inc eax
0 U3 `2 k1 k! F. P/ m. V jnz 00650589 ; detected
3 W2 }0 W6 V; w" ^& f push 00 ; OF_READ
n) i T' P0 x/ D& m/ { Q2 d mov eax,[00656638] ; '\\.\SICE'
& a* X9 O' r! y; \0 i push eax( r0 k7 R& |( j, m
call KERNEL32!_lopen; `9 l5 @" { K7 U2 I& y5 q9 Z
inc eax
. a# M- Y5 C& R( R jz 006505ae ; not detected
2 ]! R" u8 v7 B$ K9 V% c/ D" Z: m8 n Y A' S% W& a4 ^& v5 Y
7 i, B; z) `$ F5 `. A__________________________________________________________________________
. D) a* _& W% D9 {$ Y" v+ f: l
( p9 k) t3 g. S! E7 S1 f3 B; bMethod 12
& b& [5 x! h; K s- D! M=========
/ t6 R4 B7 V( I% i0 k, A: G. x% R; w7 v" {5 f- j
This trick is similar to int41h/4fh Debugger installation check (code 05
$ n; q+ R; a3 C7 D6 K* h6 P& 06) but very limited because it's only available for Win95/98 (not NT)
! Z, v X) y% i* Jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! S' S; k, g7 j: b* L$ ~
3 c0 G$ H* Q4 t+ E( l/ T
push 0000004fh ; function 4fh
' b$ }) t" A9 v" [$ k3 O push 002a002ah ; high word specifies which VxD (VWIN32)! G; R: a% q$ r; o) r
; low word specifies which service
# r3 [ k. m: n1 p# D# h& R* b (VWIN32_Int41Dispatch)
2 W; o" q5 S6 a call Kernel32!ORD_001 ; VxdCall7 k* D! i+ `1 }& R" T$ D
cmp ax, 0f386h ; magic number returned by system debuggers
( C- I9 y0 C0 k2 v. B) j jz SoftICE_detected
+ L' }! ]# _: G: Y
1 T, I) C/ }" O/ m2 S- RHere again, several ways to detect it:( \, m( q9 Y) A! H% h
/ R; B; y% E8 K3 M: @ BPINT 41 if ax==4f& R% g; t) C8 {# l
3 [. ^( E( {. Y" O; C5 [ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one- Z7 e. U3 W: o& n! E) E6 b6 K5 }
) { W+ `1 X& U$ e4 ?
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) r' Z7 `6 R9 @5 Q% C
2 O9 N; U3 h+ t1 z4 U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!9 K9 V9 }" B& M7 q7 e6 r
$ Z' A; F2 C6 [# x* b. H
__________________________________________________________________________$ |/ w% x2 [1 W+ X( K; w
0 v+ }0 d( H, m1 K0 g- @1 X5 qMethod 131 d, z) W$ @& x7 c+ ^2 ]
=========7 k9 p* o3 s( }1 n4 @% K- Z* C' [
5 S N6 ?1 K9 R
Not a real method of detection, but a good way to know if SoftICE is& ~, b2 D# c# A- E. d" J
installed on a computer and to locate its installation directory.$ Z) Q& f& B( a# x: p& S; d: B
It is used by few softs which access the following registry keys (usually #2) :/ k; s! X: A/ ^+ a) z& W4 L
0 {# A9 R( L- Y0 h-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 j# I* X, t) M. Y+ i" }% }\Uninstall\SoftICE4 M, g J" b% T5 x3 h4 F, E* Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE X- }' N3 F+ f% r
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 ~. ^ V7 A5 J o4 y* x
\App Paths\Loader32.Exe
[) I+ r' W6 W1 T) V8 F& c7 I4 o `/ K; S# t$ O5 ?
' }1 q* U9 l" m \8 C# b8 \
Note that some nasty apps could then erase all files from SoftICE directory
! n4 m! |0 A \/ K(I faced that once :-(
W+ [* _$ L, {. O4 d/ S) `: q2 E$ z) B. r
Useful breakpoint to detect it:8 H6 O5 o4 I" k) E$ U
* a$ A3 E5 M! g% f# d- `
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 [9 X4 w2 l" V' |6 Z; N7 B+ e6 Y6 Z# n& i9 q I6 `3 q
__________________________________________________________________________
( M% g8 {' k. H. U4 Q4 }$ ~- K1 \0 V/ f* p) X+ `3 E
( R9 P# k" P, ?, u0 N0 `8 }Method 14 " C1 @7 q4 M8 N9 M1 L$ T: |0 P
=========
: v+ i" _5 U2 ^. k
, t+ A# t3 g; z4 }2 N% IA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% x( i9 |" C% S7 E" z! Wis to determines whether a debugger is running on your system (ring0 only).) i/ I d/ n" T8 r
: N9 c; y, `& p' w% P" [ VMMCall Test_Debug_Installed
/ Y5 L+ f7 p+ J: j je not_installed
- N! E. a% Y* p( X" T3 K0 m0 y+ R! u* q1 p4 \2 M! |. {6 M
This service just checks a flag.1 G1 j) t' Y0 k9 v7 u, W
</PRE></TD></TR></TBODY></TABLE> |