<TABLE width=500>, L; [0 i+ [7 M( p/ v
<TBODY>' y# N( z* g) d- \
<TR>
3 U5 } f2 E( e# [* w7 A<TD><PRE>Method 01
# v# q6 U7 V3 F9 T2 A% `6 p. w=========! w) d: [+ {7 x" F! e' O- g
( d. y. ?. Q7 y1 @5 A+ HThis method of detection of SoftICE (as well as the following one) is* s7 u) C4 M) E7 J% k
used by the majority of packers/encryptors found on Internet.
! c. f- H& o, U. Z* e2 A3 mIt seeks the signature of BoundsChecker in SoftICE* }5 t6 t0 c$ f. @/ f. D. [# I
) F8 ? U. B+ f A8 V mov ebp, 04243484Bh ; 'BCHK'
: d8 b9 j) m$ v, x mov ax, 04h+ u9 G! C, N% d( J0 @! Y
int 3 + }6 W& ~. j6 [6 I2 {' `( B
cmp al,4, ~& B8 c9 C$ A. p, {% H
jnz SoftICE_Detected
. w' S7 C% k" j! ^. ~ z/ P3 O* U9 f
1 C4 H2 J: h8 R7 o___________________________________________________________________________
; @+ a, u. ^; S
0 e) w5 o; V, MMethod 02
: O. l" h) E& C2 |+ N% a" p=========
& k8 X; G( z# l( G0 k. p& j
* l( Q8 w* J* [5 A- M) f9 y$ M6 lStill a method very much used (perhaps the most frequent one). It is used
1 o0 x4 N) h2 o6 w: O8 s8 Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
/ u+ E$ `- | E% X' u1 vor execute SoftICE commands...
. C8 ]8 z2 @) I' {0 [( [" O' ~4 y9 S3 CIt is also used to crash SoftICE and to force it to execute any commands" K8 O7 ^" W- E/ o
(HBOOT...) :-(( ; U0 P2 Z X4 s1 l; ]3 n2 N5 i1 i& a
6 r8 b6 G% o, W$ LHere is a quick description:
& n% f9 P8 M6 y# I4 `-AX = 0910h (Display string in SIce windows)
! S& t i4 C1 U# ~-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) y& o* F* N! e3 N+ T
-AX = 0912h (Get breakpoint infos)& w# d" {! x- H, E2 ^) l
-AX = 0913h (Set Sice breakpoints)
% a) l; w8 y: K0 _- R: ^* z-AX = 0914h (Remove SIce breakoints)
( R( M/ f" Y- y& ~9 W1 ^
" Q' b) Q5 S4 u4 S* V7 p, cEach time you'll meet this trick, you'll see:3 H: ]! `6 d/ P( ^2 |( q
-SI = 4647h z- P) M; d% ]$ S" W2 O. k
-DI = 4A4Dh! `1 q2 U" f- y0 } S, h
Which are the 'magic values' used by SoftIce.. b) p3 C7 ]5 X, }" F- Z% Q/ L: d
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& j% T' Q7 J! R8 P$ x7 M
- c1 R% H8 y) U. w/ P8 I+ ^Here is one example from the file "Haspinst.exe" which is the dongle HASP
/ G6 X9 W; ]0 f& c$ M7 OEnvelope utility use to protect DOS applications:
1 G4 r" R/ A( z6 t) `: {# ~) F* C& d% |0 ]
# r1 l$ j$ x* w+ ]/ K% Q
4C19:0095 MOV AX,0911 ; execute command." @1 m8 ~, j& \3 w! |
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).1 [5 I1 N1 H2 v% J, f0 z1 F7 w
4C19:009A MOV SI,4647 ; 1st magic value.
5 d p) k2 G: Q+ r& |4C19:009D MOV DI,4A4D ; 2nd magic value.
1 D) P0 r) Q8 J( X$ \4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" Z' X& I. H0 M) T4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ j/ I2 l3 V( p- j4C19:00A4 INC CX
) T; @/ q, Z5 e9 X6 ]1 w# P4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
9 R; D3 s; c+ I, Z, X6 p4C19:00A8 JB 0095 ; 6 different commands.
2 F5 t5 r* e) w/ t4C19:00AA JMP 0002 ; Bad_Guy jmp back.* f+ D1 Z$ x2 G6 z' Q
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ U$ a2 S7 ?- V# n3 y/ U7 s) E
+ ~% p. T9 f! }
The program will execute 6 different SIce commands located at ds:dx, which! d; G6 b1 ?' T: q4 ~
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.0 I& L' J, K( ^( l& l
3 g/ C8 Q9 b2 F1 r% }* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' q, k7 e7 H* B5 c4 V" @- P
___________________________________________________________________________. c" K- [. j$ S6 v% r3 c
/ q: M7 V) t- u" M/ x% K; g7 K0 ^! @9 J$ d
Method 03" j* s7 s1 m' i
=========" ?& b! t2 U( { b% U f# p: O$ p
6 `6 O: }4 w+ r, J+ a. u/ C$ u- Q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# C7 \; u' z b
(API Get entry point)* [9 P# v4 v# c6 G: z6 F
- s/ n# ~5 Y9 w) U" M8 W
, A) |) h+ M' Y; Y0 \, O% Z# }( u, U xor di,di
{; @' l( ^/ }$ H! x+ H8 [& d mov es,di
/ @; d2 a# I0 ]7 Y mov ax, 1684h , S9 s- e/ c1 N E$ f
mov bx, 0202h ; VxD ID of winice% [4 p7 Y; F- V* M: H( A3 k8 i
int 2Fh* L3 y, B" E; H; ?) o
mov ax, es ; ES:DI -> VxD API entry point2 m7 M1 z4 A; `% _2 O, F' ^
add ax, di C; U/ e# K' O% x; r* H$ `+ x' B
test ax,ax" y& R& h; j8 {, e! Q, @
jnz SoftICE_Detected5 J: F/ |. ~& b! I2 w* d( J; P7 a
' @3 P) B% f( z7 n( X___________________________________________________________________________4 A; |2 G# D1 A5 ?% D A
) i: V* U% J6 F/ a
Method 044 F T8 s' S) g2 }# b8 C$ r( O) c
=========
; s8 r3 D- `; T4 I& ^* |- y/ B0 L2 T/ B7 X4 U
Method identical to the preceding one except that it seeks the ID of SoftICE' V' p; W1 }6 P
GFX VxD.
' @8 l% L& ^$ p% {2 F& E
( ]9 f& D$ s7 L; J xor di,di' s" K, i: F" L. o; L& }
mov es,di9 x( \# c; h+ p0 y+ j5 q
mov ax, 1684h $ I/ Y% w$ J* L. ^. s. ~5 f
mov bx, 7a5Fh ; VxD ID of SIWVID8 G& S7 x: G5 `# I
int 2fh
% T; v" X/ R8 I" U; w; J: y3 p mov ax, es ; ES:DI -> VxD API entry point- N! g- M% {% V9 P& _/ [
add ax, di w& J$ } Q3 i1 Q
test ax,ax1 w! U, \7 X+ ]2 i* U( `$ g
jnz SoftICE_Detected
: Y' d+ S8 u/ K3 @5 d! f5 R( l7 Y' n& k/ O7 m5 Z/ R
__________________________________________________________________________
4 p, y1 }, v d) v9 ?/ g$ W* a1 l$ Y8 t6 Q. d* Q0 T6 A
) t: q, ?+ T5 F8 a3 p) ~9 ]) ?Method 05# w* J! Y& c8 w! |0 S5 C c
=========
/ q# ~9 ~( {1 ^; s( b+ G& i9 S ^8 e, y0 r1 G
# T1 x$ z7 d% a: cMethod seeking the 'magic number' 0F386h returned (in ax) by all system
/ m1 u- v$ `' A! U7 v3 ~debugger. It calls the int 41h, function 4Fh.
. z1 `1 U/ K2 R# ^; aThere are several alternatives.
; g% q/ x; q D- p6 b! H. w6 \9 G7 Y8 M6 o' d! Q8 s, g w: B. B
The following one is the simplest:& F- b2 R0 F2 l1 k1 P: [0 b* _) y
# T1 |+ U! Q, t7 s$ X
mov ax,4fh- z6 d4 ^: }- Z- I) V; [/ y) L- G
int 41h
4 D( }4 j$ b* x+ n" G/ ?* ^: y cmp ax, 0F386
8 \: r: k8 x( c+ M( L jz SoftICE_detected. n2 r0 E/ k' l Z: p2 }' q
" L9 `4 P5 B; s6 Z0 @# Q% x. _& `. a2 ^, }# I5 q( T
Next method as well as the following one are 2 examples from Stone's : x! C5 N& i' w( W8 C* d
"stn-wid.zip" (www.cracking.net):
9 v( ?# _. i$ e
8 N8 C( W4 G* f+ B/ S* q mov bx, cs
: v7 f' l Z7 `/ ^& ^- {8 Q- g lea dx, int41handler2
& s1 i# _" w( S0 o* n7 d xchg dx, es:[41h*4]
, ]3 r1 G; c( n5 t; V9 Q xchg bx, es:[41h*4+2]/ K9 D1 B, p. T6 R7 P
mov ax,4fh
) f, P- y1 f2 n7 Y) U4 B) k int 41h J% b, u) S0 ?: Q
xchg dx, es:[41h*4]
; |- ^ ]. V$ R! F* q0 o p xchg bx, es:[41h*4+2] l/ ]3 e' s. S% s
cmp ax, 0f386h: P- F) |7 f2 q% [6 [
jz SoftICE_detected, c# c& f) r8 j# u2 L9 v
( l: U2 W* i! D6 \int41handler2 PROC
& L0 }. p, P! q8 P4 T% I7 _. R iret8 M5 d9 {* ]0 d2 Z6 D
int41handler2 ENDP
5 y2 d, @3 l, g$ \( T1 J+ p% d( d7 d
Z, [( o- z/ C u/ I, X) t0 S_________________________________________________________________________
1 J! z/ C2 ^% Y& D+ w- f: T0 B4 R; o. ^! I2 _+ g
0 v/ t: n( F. E# Q' M$ {
Method 06
3 I$ S& v: e2 F=========7 k+ L8 B7 l ~ S/ c' \8 q
1 I) w8 S1 [* |. I+ d
! Z1 w+ T/ K: Y3 S" j i+ {5 U2nd method similar to the preceding one but more difficult to detect:
, u7 d# |7 L1 Q- F' ~5 i' x, A& Q8 q. n8 e
1 B* |9 k5 A* A0 }# Q
int41handler PROC
# \! m" [* e' B+ n mov cl,al
7 d: z% ~5 y% K2 p, O: }, Z iret
, |5 F8 @* x# k6 f) wint41handler ENDP4 U- W L! ~ m7 G8 C$ c
0 G5 p) b) Z2 v" n6 ~. n* y& D
$ b b9 R) p5 U+ E7 T xor ax,ax- B3 ]$ i% I( |& k7 ]
mov es,ax
5 ]0 W8 m. i& E; b { mov bx, cs2 o _3 v3 v7 X. g8 R4 M1 Y& A
lea dx, int41handler
9 m: l! W) V/ q- \ xchg dx, es:[41h*4]# l/ E6 P; m1 v. n% n% f
xchg bx, es:[41h*4+2]
4 ~0 L% g7 M) k- v in al, 40h
5 q1 m5 P) T% r' ~$ M! p' S xor cx,cx
: j: q+ d3 a8 k1 B$ u int 41h
( b6 y; f) a d2 {0 g xchg dx, es:[41h*4]+ ~/ e4 j$ r( k
xchg bx, es:[41h*4+2]9 X) R! P& e8 U
cmp cl,al3 j8 V5 A- O9 Q s( o
jnz SoftICE_detected
/ D; J. j, ~% ~/ i4 l( O$ Q
7 Y4 ?! B6 y- }_________________________________________________________________________% X: e, v" `0 z, F% b: H; y# W
`: G& E. p5 c; Q0 wMethod 07
* _0 l+ z" c4 @* X0 {! k=========- b8 P5 T) R+ e/ _. B) C1 ^
$ [' m7 u: Y- [0 i9 d" s! @Method of detection of the WinICE handler in the int68h (V86)' P" O$ [) ]7 n6 Y
7 z4 Q/ l& \% p5 K; y* \ mov ah,43h
3 |# ~. w* u% e. d. s$ W8 n: @! e int 68h7 k# }8 j& A: z1 M+ ~
cmp ax,0F386h v0 T# h8 ~' F
jz SoftICE_Detected: m+ Y; K: b1 \
! ]& I; M) J; f% ]. \) @
+ Q9 u* S8 U! i* P, D=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 v. q) y1 P U* F. m
app like this:
5 Z( L; y$ v O9 p6 ^
; {; L& t9 h }* V, V8 ] BPX exec_int if ax==68
% e/ ~: P! j) r2 H' W+ j! X (function called is located at byte ptr [ebp+1Dh] and client eip is0 B2 {0 G0 l$ @9 Q1 _: X
located at [ebp+48h] for 32Bit apps)- y2 j/ k! ?2 |" c4 D+ _, T( u
__________________________________________________________________________5 \. K* w+ N' ~7 M4 G" J7 L
/ Y/ x! T" |7 |" `3 J6 l% A" N7 t' @. h O
Method 08, u, e, X! l4 u4 w2 P! k0 b
=========5 g- u) Y- E h3 a3 }6 {
( ^- N7 w" D& N0 F9 K. {It is not a method of detection of SoftICE but a possibility to crash the
' q( y# f+ ]3 y, _system by intercepting int 01h and int 03h and redirecting them to another/ c0 O: g" |: f6 _
routine.0 D; p) G9 Y! M9 P" L. t
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& S' r% h$ g6 }to the new routine to execute (hangs computer...)% b" k `1 I) x3 v7 D2 c" A2 y: @
' A' c; L* n6 O mov ah, 25h/ B3 z" I0 w7 t) c j* ~
mov al, Int_Number (01h or 03h)( R7 I/ V$ Y& i7 P7 k1 z# m3 r% [
mov dx, offset New_Int_Routine
/ M% _7 w4 K) F) X1 x int 21h
7 d3 P% F1 }+ ^: L3 s4 o/ B2 h8 g1 F' \. H: O! T5 ]
__________________________________________________________________________
' C3 ~: r* ]8 T2 z. [6 S$ |& ^$ c7 N( m+ V9 G8 z( ?
Method 09
@% }3 Q- S: \- X/ `=========
0 ]5 I# ?& R* d0 `- x: M
3 I+ c8 ~) Y3 z, B& _7 WThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 ?' L4 r7 u; d
performed in ring0 (VxD or a ring3 app using the VxdCall).
6 C9 O, Q. d6 C& x. G z$ kThe Get_DDB service is used to determine whether or not a VxD is installed$ c2 Q( o) b/ K
for the specified device and returns a Device Description Block (in ecx) for
1 Z8 {9 l0 g6 M, ^ s$ hthat device if it is installed.6 b1 s# W5 J) P7 P
F9 i/ h. P! d; s v4 L9 j6 }# H+ U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 V+ l# ?5 n5 i: y% B" @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ C9 u; q) n+ A1 C( K8 K+ v, t VMMCall Get_DDB
7 S3 m& s2 [4 A c" ^6 z5 m mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 x* s4 X: ?- Q' j- @7 {5 e5 q: L6 |% i$ J8 U3 U( o: v
Note as well that you can easily detect this method with SoftICE:
% i* c$ H+ ]$ s2 I. _ u @ bpx Get_DDB if ax==0202 || ax==7a5fh. t/ ^2 P$ E& k3 @" o
; v2 A* N' f* P ]
__________________________________________________________________________+ u3 }( c6 A& z+ { o" }
4 ?1 {" z' F2 U) IMethod 10+ R5 q+ G8 x5 J- G
=========, {) M; ^7 b$ t, E) x
/ T4 E/ T* B4 \( i# p=>Disable or clear breakpoints before using this feature. DO NOT trace with& d7 K H0 A2 k- Y7 \* a
SoftICE while the option is enable!!5 b, m1 C7 _0 l1 n l% T; v" L
2 J0 t+ X+ D# l8 X0 |- R2 M
This trick is very efficient:
, ]0 x6 s* [! T1 W$ rby checking the Debug Registers, you can detect if SoftICE is loaded' n3 T) ]( C# j* H& |' c$ k) i3 p
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, V4 n: P | N9 l' ]! lthere are some memory breakpoints set (dr0 to dr3) simply by reading their
0 ]% b- M6 T6 e) X3 m7 hvalue (in ring0 only). Values can be manipulated and or changed as well8 \& _6 u, x; N9 J8 f
(clearing BPMs for instance)
6 T- U A) a. S
$ r8 s, N+ Z5 C__________________________________________________________________________
# v; Z/ E5 w1 Q7 N. n5 D6 ]# d9 w: l3 ]) Z
Method 11
( m. a; g0 c4 N. L, v/ A=========
6 g* i( Z! V) z4 A. R9 X' u
- t+ j1 ? J4 ? U; P9 j/ QThis method is most known as 'MeltICE' because it has been freely distributed, ?. [, ^8 m5 A9 }, p4 l- Y7 R! p
via www.winfiles.com. However it was first used by NuMega people to allow# j1 Z; k K! m' B! v6 U
Symbol Loader to check if SoftICE was active or not (the code is located
' q% R- z8 ^: G/ Vinside nmtrans.dll).; V L d, \. Q# X
& I4 Z/ B5 U4 I4 _0 _
The way it works is very simple:; N' s; Q! _0 F3 A
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ a4 E+ O0 w( kWinNT) with the CreateFileA API./ l/ p$ S- G. ]( i }( C$ o7 V
, V1 c; b0 z9 J, }
Here is a sample (checking for 'SICE'):
1 s) E; ] d$ X9 r: [1 ^, H3 o2 E
% J1 o% c* s7 s( K1 w. lBOOL IsSoftIce95Loaded()
* C2 H; F/ p! S' H3 P{4 X2 q9 N$ r# Y( v. J0 n( h, B
HANDLE hFile;
0 v/ R) ]5 N' x$ K$ {! e hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,# _0 q" @6 k2 Q# Q- e y
FILE_SHARE_READ | FILE_SHARE_WRITE,8 G. f; N+ I+ X& \! v" H
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ r, ]5 h5 |7 ~3 b+ K$ t, Z2 R if( hFile != INVALID_HANDLE_VALUE )/ {$ G. x# M7 c* T+ j, x
{
8 I1 j" Q" N8 U- E9 L- O- V) |' C CloseHandle(hFile);
. ?8 d) s9 w* n4 J* Z) o& B/ { return TRUE;- S3 u# V$ f5 H! J
}
! S9 K. `( {" I3 E return FALSE;. K: o5 A' s: [5 ?9 v6 F6 k$ t0 j
}) G0 b9 [6 A! w2 [3 z U
+ X, t+ Y8 \+ i, }6 mAlthough this trick calls the CreateFileA function, don't even expect to be3 Q) M2 }5 h7 F r# k
able to intercept it by installing a IFS hook: it will not work, no way!
1 q" s5 e; \+ [2 P D* d: aIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
- W. M$ `. ^0 f& \3 N0 o: oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function) f5 b, k' M7 ]
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 ?. Q- c/ Z* bfield.
8 g7 f8 B4 i7 M$ X3 n+ P2 F- DIn fact, its purpose is not to load/unload VxDs but only to send a
1 \2 S6 m8 C u3 YW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( t- v: u& T! A( ~) Tto the VxD Control_Dispatch proc (how the hell a shareware soft could try: x- ?1 M9 X. }& F9 ?
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
) m( T) w0 @* ~# f! lIf the VxD is loaded, it will always clear eax and the Carry flag to allow
3 o0 T- P( i" `5 v4 h1 lits handle to be opened and then, will be detected.5 G2 m x/ P9 e. q }. u# ]% S
You can check that simply by hooking Winice.exe control proc entry point4 e/ j" J# D& u1 J2 N+ o4 h
while running MeltICE.
, }1 D! f2 D$ G$ W7 _5 z8 n& b# z3 X" k$ A8 | r: W2 V) K% _2 X
4 A, v, v% u. k; I J' j4 a
00401067: push 00402025 ; \\.\SICE" m% E, {0 `6 t
0040106C: call CreateFileA( U) A/ e- A/ u" N0 o! A
00401071: cmp eax,-001
1 t/ F% l) N7 q9 v9 y8 k; b6 P0 j9 j 00401074: je 00401091# ?6 [' O8 f+ Z, ^' K
8 ]7 z. _3 n0 O4 P; s1 y7 G
$ y# r# v" M( h) @2 i
There could be hundreds of BPX you could use to detect this trick.
3 T l7 j, j( U) P7 \! ?) {-The most classical one is:
2 Q" X. F+ g/ i# \. y/ r$ V3 I BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& ]/ H/ G% `) X$ I5 K; L$ ^ W *(esp->4+4)=='NTIC', I. ~+ u7 J- A6 Z( {* q
( A2 I; S$ [5 t: r/ p-The most exotic ones (could be very slooooow :-(
' s6 t6 l8 y. k) v' h1 u9 a% z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 h* N) z0 W9 u, t
;will break 3 times :-($ N% G1 N: z7 }" G# [! x, k
0 h+ [2 J" F) ~, E; V# T-or (a bit) faster: 1 h5 @& v, B! z9 H0 W! d
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, S% o# B. n8 e7 A+ [) z
4 u% t, _ l& S- g/ B BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & R; R; N: \" _$ _7 u
;will break 3 times :-(
$ M+ i$ D/ n% s- j( X$ a- J) @0 Y) t& A3 A$ ]$ f
-Much faster:
7 L; L6 P" \- t) g( j, v! E BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& j" l8 j/ [+ _ o4 \
! k$ d) t* l" |+ a$ R; [
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 N+ U7 g5 H" U0 ]
function to do the same job:/ A7 ~; g1 _- P# ]) h9 \4 }
6 p! y" t9 B, }0 T- ` push 00 ; OF_READ- C5 R+ l: D+ U) o1 S/ G
mov eax,[00656634] ; '\\.\SICE',0
$ [# n6 L$ c5 V; E8 S push eax7 T) v" Y, |- [1 Q% ^; i. S
call KERNEL32!_lopen
% }( U: k$ y; U# F: _4 s inc eax. y% z$ g( d4 Z9 G' x9 `' [2 t0 |
jnz 00650589 ; detected
! F7 `1 {5 o5 \+ N push 00 ; OF_READ" c: U) ^! P4 M, L4 x
mov eax,[00656638] ; '\\.\SICE') i0 `) \, `: i# q* C9 ^
push eax) b1 Z; ]! C; P; H) j4 S3 |
call KERNEL32!_lopen& D: t4 b' \; \' t
inc eax7 l3 d% F6 h0 V/ I3 M3 W
jz 006505ae ; not detected5 J- t! s% S0 O9 k3 H7 Z+ b: F
; i+ E; _4 |- L* a
Y" D$ S0 f- D__________________________________________________________________________/ o Y/ m5 z" T0 I# s h
% P. O l. O$ g2 ?0 ^. e
Method 12 J5 M; K' Y7 k" h
=========
0 k: C$ v" ~8 o( y3 j; |/ Z: l+ X3 r' ]7 C( G1 q/ g
This trick is similar to int41h/4fh Debugger installation check (code 05
% f- N! B. X0 q! {( g+ X0 [& 06) but very limited because it's only available for Win95/98 (not NT)
/ o8 v$ h0 H, B/ Q; I( O& ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* j0 U) O; w, j. u- _0 r) ]$ q
8 l* P3 A8 Y4 t: E, }: ^- i push 0000004fh ; function 4fh/ W' a/ I& a2 d) }# p% E/ c+ m
push 002a002ah ; high word specifies which VxD (VWIN32)
8 |% v9 }& E8 V [0 h7 y& I% ?. r# o* w ; low word specifies which service
' ~) R I2 `! z S. Q9 E, a (VWIN32_Int41Dispatch) ~% n8 V/ q9 `0 d( `3 l& r
call Kernel32!ORD_001 ; VxdCall2 U5 f! m/ _$ a1 ?( H2 K, }+ M4 l
cmp ax, 0f386h ; magic number returned by system debuggers
; i( l% S) n% g( x- H jz SoftICE_detected
% G- q! Z) {2 c5 @1 S @' p$ V6 S: t9 P1 B0 e' a: W3 T
Here again, several ways to detect it: q' i1 m- c) t7 }5 H( I
) Y9 R4 J, v1 r: H2 w
BPINT 41 if ax==4f
7 o) f) U/ R6 v* m) d0 K- A9 u5 }) ~8 h4 t* Q' y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
$ c7 R8 S" e" p& s# y
1 y0 G3 \( b$ M+ j5 S+ B BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 s, q# R/ e4 \) z B* n
8 I% t( m/ g( |; k6 U- E6 K BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# d) A+ A5 ?1 s! n2 C
5 @% H) i1 x4 ^1 k+ w3 i__________________________________________________________________________4 {7 _( ?2 j6 H1 v$ c) ]
" J& g: N8 d! q0 G& P0 y5 CMethod 13- y& N9 j" r1 p0 [" n+ X
=========: {, W u& s' T% p. R
9 H& @& v6 o! ^$ `
Not a real method of detection, but a good way to know if SoftICE is3 u9 D8 a. y0 o4 c4 v$ l+ u
installed on a computer and to locate its installation directory.! A. ], ~! x* ^( W8 i
It is used by few softs which access the following registry keys (usually #2) :+ m9 k: X i, O* E# t& m$ u
: W, E- g0 I5 k5 K! Y! k1 t% V, O
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 A1 z! M7 p# O% a/ R
\Uninstall\SoftICE
9 z, e3 w% c) o/ C-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" Q) b. e5 F3 G9 n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 h! ^* p- s3 y. D9 ?8 u& c3 |
\App Paths\Loader32.Exe' t1 H- ]2 [$ ]$ O
: {9 w z4 X( ]' y0 I6 d G
3 S" [! u# E& L% z9 }7 ]Note that some nasty apps could then erase all files from SoftICE directory
9 O& E" l2 `3 q/ b3 l, Q7 C7 O) A(I faced that once :-(
4 n* u' D- c3 d: p
Z1 n9 U/ i7 }& vUseful breakpoint to detect it:( w0 Y0 p7 R7 Q; q+ {' |( C/ N
6 [: U5 j, {" N
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 {/ B. J# `, j, V0 Q
0 C, O3 J v! B$ _
__________________________________________________________________________
' q& Q$ A/ D5 L ~" T, i) r- `+ |7 U s: q3 Z& {' r
+ `' [4 k, z3 B5 d( |* ~Method 14 ; v5 x! \# D C# Z9 h* `6 m
=========. h: K' P2 Q- B/ ~6 l9 ?
2 ?% G$ Q4 T1 a- s/ d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ ]$ K- c& Q8 K0 I' q; U! {2 P2 ?is to determines whether a debugger is running on your system (ring0 only).
! M9 m( y: R* ^: e# e$ k/ x! K' u8 ]6 Q. ^$ d, Z" T
VMMCall Test_Debug_Installed/ C" I, B4 e9 n0 P' L l* M8 t' z4 j
je not_installed
6 ?3 k f0 G/ {: q3 a) N0 {& N$ ?0 D) I6 O1 L3 \" e5 o; b
This service just checks a flag., Z: V; Y' l2 r4 K5 `
</PRE></TD></TR></TBODY></TABLE> |