<TABLE width=500>
/ L! H/ H% f( R7 \( n" e3 L<TBODY>
/ E* B( B, A: t$ i. Q4 {<TR>2 j( D7 |+ ^9 Z% E3 H# U8 |0 o; b
<TD><PRE>Method 01 9 N( W% q( E N+ W" n0 x0 w$ Z
=========
1 F9 O" K1 ?4 W5 Q1 d
7 {0 j/ o! g5 {3 r( O6 i0 DThis method of detection of SoftICE (as well as the following one) is
! V# F3 B" h0 a* i4 ^! dused by the majority of packers/encryptors found on Internet.8 a! _: n0 f5 a8 ~
It seeks the signature of BoundsChecker in SoftICE% i6 T d$ E8 N% q
( k. a8 M: [- |1 j* T$ A& d0 q) B. V
mov ebp, 04243484Bh ; 'BCHK'$ l7 y7 K, _4 M R, g3 ~
mov ax, 04h
! ?# \1 P" q5 ]2 X% B! z/ ]' f3 D int 3 - n/ l) h3 q9 D3 q c- ^" ]
cmp al,43 m, a2 N7 B5 B* U
jnz SoftICE_Detected: B5 A8 D& j: l
& V) j. q; k4 c, {8 ____________________________________________________________________________8 O* X# D0 W; \$ Y
2 r+ @+ n; w/ R6 T6 L4 V9 J. Z
Method 02
8 I. ]# E3 f' q: g=========
0 l/ S( I" X/ i- y2 \( |- L! {* `0 ~- k" Z
Still a method very much used (perhaps the most frequent one). It is used$ Y8 b" F [; O9 E2 `- ~, v
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,! }6 L- w; b" r: d2 `& x) j. [) _
or execute SoftICE commands...; a F7 T, Y7 B' L
It is also used to crash SoftICE and to force it to execute any commands
7 A( h& d: E4 k- i; b1 I0 ^(HBOOT...) :-((
, f& I( h. \. R9 Y7 n
5 V0 b+ }9 z7 C$ ?& S/ tHere is a quick description:
4 ?* l- M3 H9 l: Z" E$ b5 ] @-AX = 0910h (Display string in SIce windows); M$ W7 K( R9 ]2 g: Q
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# i2 K& d) z- K+ Q/ A2 P7 W# _
-AX = 0912h (Get breakpoint infos), y4 }! e! e0 _1 b! I
-AX = 0913h (Set Sice breakpoints)2 U2 B+ H5 q' F/ t0 y
-AX = 0914h (Remove SIce breakoints)# Y. a5 v! d/ T
- D: Q' }1 Y r) D; }( M1 s" X1 pEach time you'll meet this trick, you'll see:
4 }& Q" H+ o* Z* m* W7 A-SI = 4647h
% u/ I$ X6 d8 D# p3 J& O-DI = 4A4Dh( o0 q' I% R/ k: p) p
Which are the 'magic values' used by SoftIce.
# r- {2 Z( `/ g" H8 G+ ]- wFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 [: S, y0 b5 y* V+ b. b- o
! w; s) e! ^, M3 I
Here is one example from the file "Haspinst.exe" which is the dongle HASP: _) }, P. [$ h5 x9 I+ n6 n
Envelope utility use to protect DOS applications:
. S. ]+ j S, W' y8 @# @8 f: D; j( Y& q9 ], j. w0 K4 X# _! s
. P/ w( ?" |7 z" ?" Z; b' c( `8 s
4C19:0095 MOV AX,0911 ; execute command.
1 @; E* m: B0 S8 H0 [4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 G! Y1 Y8 ~# q" {8 _# Q4C19:009A MOV SI,4647 ; 1st magic value.
6 q$ }& u" L$ D: z# S q4C19:009D MOV DI,4A4D ; 2nd magic value.6 K' P# |/ A. Y2 F! L" U; J2 F
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)/ o4 B, i* A: r: Z6 G, o
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 s% V' q! r- a0 [# K }4C19:00A4 INC CX8 m% F4 Q: H! H/ B8 B$ n. o, [+ H
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute7 X7 c+ l, b. d, f% m) W7 b" [! z
4C19:00A8 JB 0095 ; 6 different commands.3 g3 _. v5 _, ]% k, D# y, U5 j2 X; t8 X
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 K) W5 d' Z8 W; f* K$ `( E, I3 h
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)! Q$ u' z( A3 q5 @
$ u2 B8 b1 [5 h) u, P g" jThe program will execute 6 different SIce commands located at ds:dx, which
# R& z, ?2 q) n, R2 r6 \, uare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.: i8 v- x( n! C: g- i7 J
7 s7 H! g7 ]3 I3 b% u
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* W1 M5 T8 L" T' y" ^___________________________________________________________________________# y0 ]1 N3 \* O: ]
( t9 o4 |( c z1 x# e
9 H- z& e5 @$ C% O& `4 W9 Q' ^Method 03
9 }, Q1 H: v' v# @! c=========
: u' T# {3 K+ R! W9 ^" u/ W. b# g
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( p+ E! B+ ]0 d(API Get entry point)
3 ^& ~$ E$ B( w/ e5 Y" r
- }8 n) V* {5 c3 B( Q" u/ I9 C0 a p+ b# D+ }# b2 |
xor di,di3 U. C( S# X# u5 y6 b r
mov es,di
" E8 q6 Q8 n, g1 y- z" u mov ax, 1684h 2 y& p [( K2 s; y `) I
mov bx, 0202h ; VxD ID of winice
p" [! w3 i! l" `$ H8 g int 2Fh
" q( x! M0 _. _" {6 |* U4 ? mov ax, es ; ES:DI -> VxD API entry point* G! c! g' c5 p) l5 J1 v" _
add ax, di s, t6 H. z& i# L5 j4 t
test ax,ax1 ~4 T- _; d) I8 i6 b! d, p$ t
jnz SoftICE_Detected% [. d9 F3 }4 R) L( Y
1 L; E& H, K w0 b
___________________________________________________________________________
2 D4 I: V/ Z1 A" H- b; X7 W4 K2 L, z7 T6 H3 n
Method 043 Q8 Y& |! l; a2 _6 I$ _
=========" a$ N. j- X$ s( M, t+ V
l+ k9 g1 k" o$ k; v! h, O
Method identical to the preceding one except that it seeks the ID of SoftICE
. ^! X& d9 N5 r5 R" O$ q* wGFX VxD.4 z5 c/ S5 ~, _
9 s1 E6 P, s4 d( c. k% G% S& P1 f
xor di,di
1 _& m; A0 }. Y+ i& ?, K: z mov es,di; A- e( {0 r( Y+ N2 X
mov ax, 1684h
9 O; V6 @. m, p$ o& j: r1 j$ } mov bx, 7a5Fh ; VxD ID of SIWVID7 R2 J6 M: B, E3 n: B0 X
int 2fh( m F% k, `& F0 r, }5 i* q
mov ax, es ; ES:DI -> VxD API entry point
2 X1 O' d& C0 L( i add ax, di
1 q3 Z# Z& m8 R test ax,ax7 G1 o& P! t; o5 {
jnz SoftICE_Detected" [: \5 \ g& D% v. ?/ K
' I4 J* n" r5 G# V
__________________________________________________________________________1 A3 ^9 M( \( Q% ?
9 ^* }* R: a" \* v% x5 I' n2 W/ b( [* S' ^/ q4 N& `! a
Method 05( m5 Q) y% ` G( @
=========
3 O: W4 L: {$ m- o# J$ {' T
5 ^1 r( H/ W5 c) U2 T/ j* X8 }9 DMethod seeking the 'magic number' 0F386h returned (in ax) by all system
/ Z/ R8 g7 `0 L; z7 c4 _( p, l) udebugger. It calls the int 41h, function 4Fh.: B9 V- {7 Y; {+ N9 s. T8 Q/ @
There are several alternatives.
6 l5 f& r0 H/ S9 |; o3 [2 j% X- L
9 D5 U% u: n, G% V% D" r; `2 n$ MThe following one is the simplest:
4 y3 D4 m4 K: r8 ?
! E) C$ ]: q9 d) ~# b: k5 }+ l mov ax,4fh- w4 c- K/ \( A4 C3 B$ M" D
int 41h8 Z; ]: p3 B. X
cmp ax, 0F386
( P, A/ s, @9 ]0 ^* E jz SoftICE_detected0 R+ v; C2 d, x. @* `
9 y) |7 G2 b* j2 K# d& S2 K; a9 A. p4 h' e
Next method as well as the following one are 2 examples from Stone's
1 x4 `5 B e6 Q0 I6 ]"stn-wid.zip" (www.cracking.net):# n2 I. [ L' D) ]
4 Q0 N- A; [; D/ R
mov bx, cs5 }3 p7 q: E f9 h
lea dx, int41handler2
) J$ u. p5 q( l) n g- N xchg dx, es:[41h*4]. f; O$ T; `. a/ D. \! Z2 Z
xchg bx, es:[41h*4+2]
, E Q* n2 [- V. C" o: r mov ax,4fh* F( a' i3 m1 E6 v, G: z
int 41h
2 Y, Y/ `, D) g( k1 N i xchg dx, es:[41h*4]% u: O4 M0 u4 y7 z- q Q E& i* u
xchg bx, es:[41h*4+2]
( `5 i% q- \4 C cmp ax, 0f386h& s2 q" H/ Z U) P* l0 r7 m/ x
jz SoftICE_detected0 u6 D5 B" B5 s# E1 U8 |
7 N; Y7 V+ `& b7 Y V$ e
int41handler2 PROC
6 M1 k; Z; Y' C# G/ _ iret- [! j9 L: i# r
int41handler2 ENDP
2 k( \6 |1 F' r* v7 ~ y
/ @7 }4 Y9 ^" x% X3 z% m4 ]
: ~5 n; X2 }8 z+ I4 y_________________________________________________________________________9 I5 k9 s" z u9 t$ F- A
6 } d: g: M. z) Q$ |
! L5 A9 @; _% U C, L. H2 O5 LMethod 06, x" f0 B$ B: g) h2 [. _
=========
0 Z4 @0 I3 p- g# t" h
# E* w8 E& Z) t# |7 h7 a
% E* L; x6 p7 P2nd method similar to the preceding one but more difficult to detect:/ v! H+ C5 l# Z% w
3 H. V W4 |, F5 {- ?1 _7 I9 H% R/ {
int41handler PROC
8 G, i3 w, ]+ \0 w+ n mov cl,al J' ?% B( b; e
iret
2 Z: k( e2 s9 W. o* ?int41handler ENDP
) F& R- ^; h8 s' N" A0 H2 q* R' w- o4 C; }
" d0 A, m( o' y5 g$ `& C
xor ax,ax
. H5 x8 Q& ^' |; @6 C- D8 ?9 c mov es,ax
+ O4 G0 o. S0 I4 Y mov bx, cs' I" ~6 T4 ^# a% X( u
lea dx, int41handler
" Q4 Z) o1 _! x( p' ^ xchg dx, es:[41h*4]
- |" u1 p$ h, ^) t- T+ k xchg bx, es:[41h*4+2]
1 w3 g F* h L) E, H in al, 40h
, x' | d* Z! Z7 p1 y# W; v xor cx,cx: ^1 [7 Z# J; h9 t; \
int 41h
, O" z) L |' m+ [ xchg dx, es:[41h*4]
1 Q& d- {9 D- R1 e$ m1 i xchg bx, es:[41h*4+2]5 P# q: Q3 F# T4 q9 v- z
cmp cl,al, Z1 d4 G# n s9 ~7 z& e
jnz SoftICE_detected. B5 M' f- q7 F" C9 h ]
0 z9 ?8 d _9 M$ z- {* \* E2 p5 N
_________________________________________________________________________
4 e8 B9 o+ Z+ G: d% Y( q' c
- s, Y5 ~" w0 ?: @, u. IMethod 07
& @4 ?/ S4 x# q8 M1 J=========8 {" y' m2 e' k! R9 N& A
" ]" ^! |0 Y) u
Method of detection of the WinICE handler in the int68h (V86)1 F% O( H1 S% X, w8 c0 n4 _
' R1 U6 m& O9 g) k2 l1 @- Y" h
mov ah,43h
! T9 T1 V* u) G, @7 { R int 68h
7 r9 c/ v+ P/ r$ t5 U7 w cmp ax,0F386h
: q% g3 V3 s9 a; s$ n( U jz SoftICE_Detected6 o7 p) h. o0 N* O& C- S5 @
, `3 K" ~' U% B
# X4 ]: U2 ]0 I. b( T B
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 v' }# V" N1 \
app like this:
6 t( d/ Y" b$ @, |$ T# g: l6 V. ]$ s0 v) ]+ ]
BPX exec_int if ax==68
- v" i4 v8 O3 Y4 i! J$ S; F" e (function called is located at byte ptr [ebp+1Dh] and client eip is
! K7 _. w" ^- ?7 \ located at [ebp+48h] for 32Bit apps), o6 C* G% y' [2 e/ d
__________________________________________________________________________
O! @- h& }7 b, R3 d5 R) f$ }5 g, l. X& {8 u
8 g! G# d& O) |) F
Method 08
" I2 I4 y: N( t1 t! A6 W7 c; D=========
- A( N7 z8 e/ B7 U7 }* p g
2 Q6 [& u1 u0 f. ~/ F5 J7 d2 V: IIt is not a method of detection of SoftICE but a possibility to crash the; w3 V+ @' [: z9 q @
system by intercepting int 01h and int 03h and redirecting them to another
9 K- q3 t* ?. m, W7 g6 Yroutine.' }3 M3 N" U6 D8 U$ C/ i% {7 m8 @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ `+ P( l \7 j- V& P6 U6 q* sto the new routine to execute (hangs computer...)
9 l7 F& c8 m/ ~/ U# m9 O: R. r3 F
- z5 z: i% s d; g# L4 t mov ah, 25h
5 y+ u* V1 O8 J, b7 W mov al, Int_Number (01h or 03h)
: Z7 P; w( H# Z; R mov dx, offset New_Int_Routine& A( Q" x8 Z6 b8 o X) y! M. D' j
int 21h9 J5 m4 O9 j3 N J% M l
: M9 F; j- M9 K" ]) s1 D; C
__________________________________________________________________________6 U- r" d: W; } Z
& P( G& l2 r& ?" E$ C: O8 ]Method 094 Z; S( z0 X4 @9 C
========= y; o% P( Q, ^6 |
3 K2 Q3 ]6 [: \0 T; R) n5 j0 KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only! ~7 `) @# G j1 V6 p
performed in ring0 (VxD or a ring3 app using the VxdCall).
+ N% Q% \8 [4 ?' O n2 B+ ~9 {The Get_DDB service is used to determine whether or not a VxD is installed/ h k7 K9 g# m( \- D
for the specified device and returns a Device Description Block (in ecx) for
! |* n5 o4 Q5 ~$ Zthat device if it is installed.
1 u) e1 [& z$ @ {) P, K8 [. n6 X
; v2 x- x- D. T- i1 C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( W: M# W6 K2 d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 v7 t; M3 X* W% I0 t2 L VMMCall Get_DDB5 c; ?1 s5 O" i6 m# t
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed- S! y$ M# T: p0 V0 V
1 K& E4 o% p7 i; z8 Q2 yNote as well that you can easily detect this method with SoftICE:. _9 u$ b8 C* C7 }2 d) n! }7 g& S
bpx Get_DDB if ax==0202 || ax==7a5fh
7 V! o L3 J6 Q& M O# l0 Z1 T g9 I0 N- u. r% v
__________________________________________________________________________0 S3 k* h/ ~# l! f" x
7 d9 V" U$ |9 y( h- _- |! gMethod 10) ^2 j! m+ V3 ]% u* u2 v; X. S
=========
+ `8 @$ }; u g7 N* r1 H# J% Z- A( o
=>Disable or clear breakpoints before using this feature. DO NOT trace with$ i0 U7 e! |: F8 _
SoftICE while the option is enable!!
3 S ~1 ?. Z% |, V, ]! H9 E
# u) e3 z$ F7 O5 u2 M, tThis trick is very efficient:' A9 n4 J9 x0 r1 _- k' @3 j
by checking the Debug Registers, you can detect if SoftICE is loaded
+ \. N4 {; ]7 _& D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! n, x1 v' h8 D8 f2 K
there are some memory breakpoints set (dr0 to dr3) simply by reading their5 ~2 n5 G7 H3 ^' t: o
value (in ring0 only). Values can be manipulated and or changed as well3 U n1 ]; M4 Q. ]0 n% x' l& ~
(clearing BPMs for instance)
' P2 U4 Z# W4 I" E5 t; o
; u# M# h/ V% j3 B__________________________________________________________________________( a8 v1 F; F8 ^0 o2 q4 M
) C; J3 F& a, b0 j0 v7 T- i% B& PMethod 11
3 j2 N7 u) l: P ^7 b: A) m8 W: w+ [=========9 n+ _8 k+ e m) U* @
8 @% o* M% c9 {& LThis method is most known as 'MeltICE' because it has been freely distributed# Q# r$ o* c8 C! {
via www.winfiles.com. However it was first used by NuMega people to allow5 C" Q+ Y6 I; E0 Q
Symbol Loader to check if SoftICE was active or not (the code is located6 _3 v/ a5 x: H& ~4 f d
inside nmtrans.dll).# ]/ {1 y4 P. v. s1 f+ I
. W) s- x- r. S9 _! N) d5 Z6 [The way it works is very simple:9 E9 j$ W9 u5 C: |& J0 c, C- \
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ q7 U% }( t$ c& Y9 i0 p! [WinNT) with the CreateFileA API.
. H! Q- l& @$ i+ g% y. E( A5 S. H7 v" i8 }. d5 ?
Here is a sample (checking for 'SICE'):
* a+ ` x7 J5 ^: }5 U- e" r0 E
7 Y \9 x0 r& cBOOL IsSoftIce95Loaded()
7 c8 W" Z$ j- Y# B5 w0 g% c{
b) y) j; J. _ HANDLE hFile; * _$ W' K9 ^) M' W
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,& W4 F; D, [; K
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ b- B, v1 |0 G4 y. d NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 {% T& E/ ], E0 A6 s
if( hFile != INVALID_HANDLE_VALUE )
% A6 {: z4 T! H0 f/ `3 [ {
, c2 y$ P# Y8 A6 K$ Z& A CloseHandle(hFile);
: c( m: b4 B% Y# C! d return TRUE;# r4 G& r3 q4 n( V0 k1 G6 _
}
1 s2 v. p4 \2 F' u" b) | return FALSE;
* M% i9 Q" V) V! U$ t2 C6 `}
4 { |8 R) T+ D! l2 E6 U/ o L% b4 Z0 [5 c- ~
Although this trick calls the CreateFileA function, don't even expect to be' U5 s, t- z; u# I
able to intercept it by installing a IFS hook: it will not work, no way!
" g4 F* q) E2 G8 XIn fact, after the call to CreateFileA it will get through VWIN32 0x001F$ \8 \ X1 w" J7 v" H
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
- A9 q7 S+ O" v& [7 Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc! I2 A1 Y) M) V8 v% q1 ^; w
field.
4 F7 _# O5 e1 w3 H' eIn fact, its purpose is not to load/unload VxDs but only to send a
1 B4 W, K& x7 P- }W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 w$ ^' ], w6 W) Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try# Z" e. B7 `4 Z* }6 ?( j1 v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, d5 N+ H+ F6 h% [# s0 Q( w) A- l/ bIf the VxD is loaded, it will always clear eax and the Carry flag to allow) o a) e. q; c5 V2 B% X: d
its handle to be opened and then, will be detected.0 y% D% s$ ]& H4 ~+ K
You can check that simply by hooking Winice.exe control proc entry point
. `9 H+ ] C: M4 y% _ [0 K5 _( iwhile running MeltICE.6 t. o7 }* [' |. h
, K% {9 }7 j* C# C2 }' a9 _, n( d0 D& ^
00401067: push 00402025 ; \\.\SICE) S: K5 Y6 O* t# Y8 y4 i: X
0040106C: call CreateFileA
' y7 \5 B R1 P, P# {& a# ] 00401071: cmp eax,-001
# o# z6 v. y, a. j* m 00401074: je 00401091
# \+ ]" W, |1 q" E9 y$ r4 \, e& K% U& E8 |# Z: T6 l& k3 L2 H0 ]
9 C+ D& A: l; BThere could be hundreds of BPX you could use to detect this trick.6 |) K' u# t# s. M/ E3 Q7 w1 K! r0 R
-The most classical one is:
g" D, p* k$ o3 q3 J BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 S/ z2 j& D( P8 o; Q6 }- W
*(esp->4+4)=='NTIC'' L) @+ k6 V$ S0 ~
" }2 o8 x( @" H& z9 y6 b9 B% Z
-The most exotic ones (could be very slooooow :-(, c& F6 ?( p2 Q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 b5 |) J4 r0 r3 |2 o* z& s5 S! V" J ;will break 3 times :-(
0 t3 D2 k. x6 K$ h5 L6 O
8 s0 b" R% _$ B. z" b' s4 b2 ?-or (a bit) faster: : N/ S8 Z( C4 S5 E/ Y+ A
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% z( Z9 ^0 ? [6 X% ~0 E9 N1 y
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
0 u% b! I" ] b7 f ;will break 3 times :-(9 Q& T3 d* U4 `! C! A n% N" e3 a
, L% H3 K0 _( E' \7 P) i
-Much faster:" U7 Z. B; Q2 z; G
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 _& _* G3 J8 R H7 p& v9 }6 n
x6 @# n, X8 a& y" I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen( A# E9 q3 K( M6 M7 x9 J7 j* {
function to do the same job:
: s6 j0 U: i- k4 H. C+ j- x
, W- F7 l# Q7 @5 q0 ]3 L. m' H: Q8 R/ Z push 00 ; OF_READ" b. u/ z8 ?& I$ S/ F5 D/ G
mov eax,[00656634] ; '\\.\SICE',0$ k" h: @( z) g& @! h/ Y
push eax) y M P: [# [: f2 |) p, ^
call KERNEL32!_lopen
1 K0 H$ \' v; S inc eax
2 n* |+ n& X$ v9 C jnz 00650589 ; detected; L5 J8 b/ x4 `" n* i- P6 F
push 00 ; OF_READ
5 q+ O* U" v. Y mov eax,[00656638] ; '\\.\SICE'! Q, v6 y1 N1 v) D
push eax
9 W* L9 P6 ~7 j0 m call KERNEL32!_lopen
- k: m) b- v# n, Z1 X inc eax
! A0 d, H* M& I& r$ R9 N0 i- \8 z- I jz 006505ae ; not detected
* ^1 G' R; d; G0 G5 J9 O4 @: {
. g; L: M7 M" d# B& V1 i9 F0 ]
, X4 j) j# w- x/ _" k# T__________________________________________________________________________
9 c% U( H B3 N* v! G- E" W* p0 J) n7 t9 \% S; O
Method 12; S7 D9 T. \) n2 v9 R4 ?. W
=========2 n3 N8 `4 o& B1 R' c" z- j% x
4 ?2 j% o6 s, ]5 x9 ?& \
This trick is similar to int41h/4fh Debugger installation check (code 05
! h" ? O2 ]& H# [2 D9 L5 {/ v, Y. Y( H& 06) but very limited because it's only available for Win95/98 (not NT)
5 @. i" C- K5 ]) N0 f5 G7 T- T$ M, Has it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 Q- i B6 Z% L$ @7 \4 Z! N% ~
: U7 X" q7 j( [3 ^7 y" d/ A/ A+ S push 0000004fh ; function 4fh# [4 t6 ?: Q. ?; x# n
push 002a002ah ; high word specifies which VxD (VWIN32)
) j+ e: g+ Z O5 @* S0 j$ b" w ; low word specifies which service2 R- j; G2 [/ S6 h" u
(VWIN32_Int41Dispatch). k. r6 _7 s o& A2 ?4 W8 N, f
call Kernel32!ORD_001 ; VxdCall k; F4 B/ {) u; ]7 t
cmp ax, 0f386h ; magic number returned by system debuggers9 p/ w! z3 D6 F) s
jz SoftICE_detected
3 u3 g, ?; g: z: i9 p5 J# x8 c; X( E" P
Here again, several ways to detect it:9 z# ^5 x5 ?; y. `3 g: P
8 P2 k( d7 e" k) b( e+ F8 ^" { BPINT 41 if ax==4f
6 b+ g; L' S' B% ~5 V
! E2 Z0 Y: o j* L, d) U S( O$ o3 E BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ J$ x7 K/ W) e& P, _+ Q. Z6 o; N) u, T3 y
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
' e$ O/ i) ?7 ?; x: \% Y( h1 {$ J" I( l
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!+ _7 [ t. n4 e1 m" g O; q6 m
. A E: r T4 |
__________________________________________________________________________
% F* W4 |- _; |: g2 ` S7 W+ M. N- ]
Method 13* |' J/ e; t. A
=========
/ n6 d) a& U2 N1 s! l! h: f: z
# L4 \6 a% d& M2 @- X( kNot a real method of detection, but a good way to know if SoftICE is: U; ^; G# N5 q
installed on a computer and to locate its installation directory.
1 D" }: W3 R w/ L* TIt is used by few softs which access the following registry keys (usually #2) :8 F- s7 v0 ^6 f. K
: W# t) F: D3 F2 B3 O. O; A-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' G0 X, k( w, d3 [! C! E( e; y' A
\Uninstall\SoftICE5 v7 S8 D1 o( ]/ }
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! w. W5 F2 n3 I. g2 L* D, w3 i
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" L9 P6 c e2 m' G5 M5 R) F
\App Paths\Loader32.Exe# {) D' e. n6 |- `8 G
$ `( Y6 x$ {1 K. m6 c1 @
0 {6 J" P" ^0 s8 D p: V! s% pNote that some nasty apps could then erase all files from SoftICE directory N* }- @- A# R
(I faced that once :-(
: `* x9 D# Q! U
6 [1 ?$ m* K# A/ lUseful breakpoint to detect it:$ @9 l5 e! [( L& p0 D) [1 |
! ]8 V5 E7 i+ h, t% W% e, }6 Q BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% n8 e) Q: K) }( q5 E7 D
. B: T6 h2 c- ` L__________________________________________________________________________! s' Z# c. C8 H% b5 G9 U. c. }
- [+ i0 \. s" j
$ j5 `* J# a$ `, M
Method 14
t- e# N! U/ e=========6 G' G0 i9 y! x& ?2 H& E4 U
1 d0 P3 e* Q8 N6 H4 k) s3 g' QA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 `3 O) Q% y yis to determines whether a debugger is running on your system (ring0 only).
- c; S( }6 J6 K' l9 x% E
/ j3 s2 G6 {6 ?+ j" u( e% m VMMCall Test_Debug_Installed0 @' _: r: f! A* y
je not_installed W& b$ P0 w' G) D4 }% w
* x3 q x% ^# w8 c
This service just checks a flag.
0 H/ k# x) k! |: y</PRE></TD></TR></TBODY></TABLE> |