<TABLE width=500>
3 O7 T% G0 I3 I% q<TBODY>
R6 F2 x* W9 f. s<TR>
+ o, D5 ]0 G# Z9 A8 L8 k<TD><PRE>Method 01
. l6 U. w" P( T; i: g( Y# H=========
1 d3 l; M: i3 Q0 m" |5 X. H2 Z! v# X% l# g o J5 K
This method of detection of SoftICE (as well as the following one) is
* e* s) `# l; B& M; `6 ^+ kused by the majority of packers/encryptors found on Internet.
+ C% P. L, I( q( WIt seeks the signature of BoundsChecker in SoftICE4 A$ I5 O m# ^: z# j' p8 ~
) o* K" p5 r' }" j! z# n% D
mov ebp, 04243484Bh ; 'BCHK'. z, X5 C. |& P# b! w! l: }
mov ax, 04h1 h8 B8 B# l. i5 b, X' t
int 3 9 m, r- |! ]' V. I. C
cmp al,4
/ o3 U1 B0 Q* F2 T6 ^1 W2 z6 I jnz SoftICE_Detected
. _3 @! k& ~$ T8 V a# u* ]: [2 [
* N- u9 L$ b7 I___________________________________________________________________________ N' b5 ^1 T/ D% v
2 ^- w. l1 ~+ B$ g- b/ O6 gMethod 02
( V1 h4 U' x5 q, B! Q=========: H9 K+ a! S. p T6 N
1 e I) \# l1 a6 [
Still a method very much used (perhaps the most frequent one). It is used
. L+ W& ^( n& P$ |# z4 i: ]to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% \( t) h$ N# s0 ^2 Z# j
or execute SoftICE commands...
2 ^% a/ c& F; v$ c6 Q% F- [& t5 C8 y% rIt is also used to crash SoftICE and to force it to execute any commands' h* U) g/ I& [$ r$ b! Y
(HBOOT...) :-((
4 a/ ^1 R9 b% Z% B
" k8 i5 c4 ] w5 g; v4 m1 uHere is a quick description:3 v |/ }' b/ r8 L+ n
-AX = 0910h (Display string in SIce windows)
9 t8 P# f8 W: ~7 s( g# X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 A5 w! v- }0 @# t$ A) w-AX = 0912h (Get breakpoint infos)' H: P0 N+ X- d, X) F4 s m
-AX = 0913h (Set Sice breakpoints), H% q* _& ?$ [/ _ w8 j
-AX = 0914h (Remove SIce breakoints)
) ~* A9 I; g( U& P+ R f% e \. k$ d# M' z
Each time you'll meet this trick, you'll see:9 j: j: r6 x2 `" I1 g- N* J2 W
-SI = 4647h
1 S( ]7 |2 x% R, f-DI = 4A4Dh
5 H( `/ L+ o1 [' c+ wWhich are the 'magic values' used by SoftIce.9 V7 ]% _! x }' I# u) m- T
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 @) V) A* |: p+ \* _
# n" A! z: \9 B4 o" k$ O+ b4 j+ b
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! b* c# T4 R" }+ vEnvelope utility use to protect DOS applications:
+ g' d# B# W/ i3 r+ `( w: S) k+ N; I! R3 d$ ?/ _6 L
+ y8 g1 S9 R0 Y) z! X! G; g% n2 ?. m* O
4C19:0095 MOV AX,0911 ; execute command.
2 C/ d; j' |* Q" H- J4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; W% I, Q* n$ K0 x! X
4C19:009A MOV SI,4647 ; 1st magic value.5 q- g2 }- j+ I" w7 I
4C19:009D MOV DI,4A4D ; 2nd magic value.
: i: a% [7 `& ^( `. h- ?: f$ S4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 `- U8 G. N; B+ ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute* X7 e6 T. P5 d' Y6 w8 q5 b6 ?
4C19:00A4 INC CX
) c; ~$ ^4 t7 Q, Y4 y1 G4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; [7 Y5 t# O7 L2 O; S4 {6 }4C19:00A8 JB 0095 ; 6 different commands.
/ T- \+ d0 L3 a6 a5 K1 ]2 Z4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ H3 |) T0 G/ H' B! v" U& I6 s" T4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ C. e3 F) H& [7 h, ^& D! @2 a6 Z5 d$ q; ?6 Q
The program will execute 6 different SIce commands located at ds:dx, which! q- I, ?, ~2 ?2 l, r' y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, L; c! L0 Z! {9 [
1 g8 m( g7 l7 m/ _6 M4 G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 P3 Q. u; `$ r9 d$ B. z+ ____________________________________________________________________________# [% n+ j; g$ x& J. ]
$ ^2 d, G' L1 G; u' H
" a: ^4 I% I, ? z# j, rMethod 034 q( j6 }- e( f% H0 J( g* D* L' `
=========# H1 t0 W+ O( J) F! S
6 V, W9 p# x/ J5 x) V' N. \& p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 |3 a0 h/ o% g s, ?3 ](API Get entry point)* L) T% H- M4 o3 ?; e: B |0 z
- V K- ^, o: C s1 ?
' C* T4 l( m, c& }5 @- W3 ^ xor di,di r9 r+ R* y; E& c- ^
mov es,di
6 [. B# P9 a x% E3 b3 N/ t mov ax, 1684h 1 F N) f9 ]7 h p9 {( k+ |
mov bx, 0202h ; VxD ID of winice/ H# _& Y+ Q& Z- u4 b
int 2Fh5 {: Z( L" n' C3 D' T5 P
mov ax, es ; ES:DI -> VxD API entry point0 A- s+ J0 Z! U9 n: x
add ax, di
$ k* j4 R r% N' G$ [& I test ax,ax
+ n, U) K$ E6 Y% w7 Y$ S jnz SoftICE_Detected f/ d: t/ e8 W1 W1 a8 e7 p2 E9 h
. Y# q, w# P2 L+ R6 W2 T. \( W___________________________________________________________________________; P6 N/ {/ V) G/ D% S
& ~) @% _! _, T0 x5 OMethod 04/ c& j: L3 }2 ]% L0 w' Y% t* A
=========
# o& B- w5 v/ V" A/ i( p3 R& L* j1 A9 s! q# ]( b4 \) [
Method identical to the preceding one except that it seeks the ID of SoftICE) @1 C, ]6 u" g* d4 ^' M
GFX VxD.
# `2 G5 z1 k" S& n( R7 @" u2 u1 w+ j/ {' S4 \/ G* J
xor di,di6 }* w) P- V$ T! @3 g4 ^( R/ S
mov es,di
" r6 C0 Q, P1 g$ C/ T mov ax, 1684h
/ W- X2 b. p! y d$ P mov bx, 7a5Fh ; VxD ID of SIWVID1 i& r/ J: T/ o( a/ f3 D
int 2fh8 ?" Y0 h: j$ z7 Z
mov ax, es ; ES:DI -> VxD API entry point" v& z) G# y5 d. @/ v1 L
add ax, di
" \: z6 b' p; k/ _ test ax,ax$ F% E5 ?6 i' J. j+ }8 B
jnz SoftICE_Detected8 K6 ?( r( j* Z" O& e
2 p: E$ x6 t2 O: z5 I__________________________________________________________________________* J' H S* q! `1 S
8 B* Y9 y; G1 s" r. e# o L
4 B; s1 ~- Y2 ~2 I0 d3 {2 xMethod 05/ x: A0 B$ e; `
=========, D- {) D9 T) v9 m7 S* e& x4 t) t
# W& P, M) Q% _
Method seeking the 'magic number' 0F386h returned (in ax) by all system
% S) J* n3 {, vdebugger. It calls the int 41h, function 4Fh.7 ?# A5 ]. l5 R" p* `, ~
There are several alternatives.
: B/ d0 m/ D. O2 m
3 M, \! Q1 S. I) W2 QThe following one is the simplest:
X0 Q+ I! o& X7 W+ O# ]9 v/ ]1 `& _1 o
mov ax,4fh
: Z& T, M$ @* N* F/ X" T int 41h
9 I0 | |' _( M W9 q! { cmp ax, 0F3868 O) J) ~, r. r
jz SoftICE_detected+ O- Y" i' \4 ?% h( j! I
1 ^8 q1 h. D2 m2 l" T7 S
% j0 L+ F, [. t U2 \, T$ g9 p* E% Y
Next method as well as the following one are 2 examples from Stone's
/ ]; k. R1 ?3 n: F( A"stn-wid.zip" (www.cracking.net):
- y& L( H- s" Z3 h+ x. W6 D5 y- Q
mov bx, cs
! S3 u+ \% ?% O& O, ]' w' Z7 F lea dx, int41handler26 p; M/ F' ~8 ^6 j) h0 K8 S
xchg dx, es:[41h*4]
: [+ D% c3 F3 } xchg bx, es:[41h*4+2]/ L# y$ ~- M2 a- o1 b
mov ax,4fh1 E% q$ V4 L& Y( \) A9 m
int 41h0 _# \ _0 l7 I) S. `( k
xchg dx, es:[41h*4]
0 ?: }4 I4 Q' T3 g7 {9 q0 Q6 |# X xchg bx, es:[41h*4+2]6 ^; e/ `, B; O9 }' t; F9 }( D
cmp ax, 0f386h
1 ^+ R! F# w% Q* w* y4 ?. y jz SoftICE_detected
p' a" [! M- I$ u E
% ^- D) `) d. N4 u+ o0 }& }# rint41handler2 PROC9 z- {0 E& b: P0 Q1 j
iret
+ g4 g5 Y" W+ P8 Z/ Bint41handler2 ENDP" |+ }. r) J# c
) [5 f4 ]4 @! U3 K H7 N0 N
5 j6 D. ^, A7 V_________________________________________________________________________& |7 l7 f9 V! y' l
) `! h- [$ {5 j' U" B/ o4 e
# P6 G) Z1 Z2 {% v5 t k9 f6 oMethod 06& n/ A1 q! x0 h& ?* ~% p0 m6 m
=========
- y/ g- E5 l: }9 z8 z2 V) E0 a% K. e
7 `: s/ w4 \7 V* C7 j1 ]; j2 X3 u: I2nd method similar to the preceding one but more difficult to detect:
" _0 j2 n" q+ N( Q
, p3 F7 @" V8 d' X1 M) R* R
# v( \8 ]4 l4 y9 b( I; f; w- w# `int41handler PROC, `- F/ D, v8 Q5 V
mov cl,al
. q+ h$ c# |3 p3 R5 d9 q" f8 I iret7 _) g% Q( V) ~. v$ e
int41handler ENDP
S& k3 m. ?" J0 B6 ]& @5 a% z+ b* G5 ?5 X. H
+ A) c9 ]. T7 S8 {
xor ax,ax
7 q# x; A6 b% E9 w mov es,ax- ]* x$ U8 x$ X
mov bx, cs3 q* s* B8 t6 H ~0 `
lea dx, int41handler2 _& C9 a1 ^8 `
xchg dx, es:[41h*4]2 S1 h# B$ }0 S! B- H
xchg bx, es:[41h*4+2]
6 F% d( P6 ~4 H" X9 } W in al, 40h
' z3 b, j$ v7 r' E* b+ y xor cx,cx
1 o% s* z: q; J int 41h
! z, I) a2 |0 N xchg dx, es:[41h*4]4 b" @/ G: y$ J s5 x2 Q$ t
xchg bx, es:[41h*4+2]
& o @3 X n0 V/ }; F" \ cmp cl,al H; X! \; X: p3 v* Z! A7 ~
jnz SoftICE_detected3 c" |/ P2 ~3 _/ C/ }
: t- N& Z9 T: M/ O* f( J; M5 l9 E_________________________________________________________________________- B9 ?& _& f" J
2 f% O0 `% i9 t/ h/ c% D. ~- lMethod 07% C5 v" q; u M3 l+ u
=========
: f- f7 ]' t# z0 K, D( N& s1 q
/ L* l; l, i) V' eMethod of detection of the WinICE handler in the int68h (V86)7 C' j6 N" U8 c
7 a$ U3 e/ g% h3 R$ h- |; G mov ah,43h! K# f- }% r# @4 T5 U% |2 w
int 68h
1 L& i/ u* } {1 ~$ D cmp ax,0F386h; F. J7 @8 H: _2 @7 G
jz SoftICE_Detected* z1 `& ]8 w: ^9 j) P T2 t' h
& v, q$ A6 k7 c- w. f2 p* v4 g, ^
8 J% w$ T5 `, c=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. P5 v5 n/ d8 H4 [0 o G app like this:
3 Y; F9 E: ~% g6 L
( h ]& m E, i- K BPX exec_int if ax==68- t$ _) H7 e0 f! `4 S/ I
(function called is located at byte ptr [ebp+1Dh] and client eip is& }% w% k4 E3 k+ y
located at [ebp+48h] for 32Bit apps)/ A% s" {/ @; d! E9 A
__________________________________________________________________________
9 }' I( G' p3 i* g* P8 Q" x; T5 e2 U. x9 u4 H% X7 M
' \' H5 Z0 q; Z
Method 08! ]$ K* f9 t9 j; O* P: R8 J6 Z
=========
1 G6 A9 g7 w+ r$ K7 h
5 X" k7 j+ S! x/ v2 HIt is not a method of detection of SoftICE but a possibility to crash the
6 t7 e/ \" O: ]# ]+ wsystem by intercepting int 01h and int 03h and redirecting them to another! t, n. h' P5 U: J$ Z3 o4 P) h3 u
routine.
% \6 D* e A0 ?8 N3 D! i: IIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points6 D2 h* R; {1 p+ S5 b3 f
to the new routine to execute (hangs computer...). N0 x3 K/ S. ^9 g6 q* ^2 _3 l
9 x- h1 L3 A) f+ u7 n1 [6 P
mov ah, 25h$ c( d+ i/ a) n% E2 o
mov al, Int_Number (01h or 03h)2 O' D8 G' `! ]' S T/ Z" Y. _: K
mov dx, offset New_Int_Routine+ W: |% g H* s4 ` [
int 21h% ^' W3 i# {! v" B/ d
- D& c1 J. a' t# P0 w; N__________________________________________________________________________
' h' `# W1 ^: n% W; @. R
4 H! X9 b2 P8 \. sMethod 098 `3 v3 F" P" R0 ] D
=========6 w: j0 `" J* ]) e
7 ~& D( |( o- g J% J) Z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ H p# L% i! L7 U" Q7 M
performed in ring0 (VxD or a ring3 app using the VxdCall).- H& ~$ x2 f9 A3 W% }% l6 t
The Get_DDB service is used to determine whether or not a VxD is installed3 N( ]( }# U! E+ T+ F9 d5 n+ T
for the specified device and returns a Device Description Block (in ecx) for
5 I6 ~: ]& ~& X' r( z- Ythat device if it is installed.
, c( ^/ r- \1 ]4 V+ @
. _9 W) O# T; m1 [- J) U! o mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% E+ n& k, I& F* N) W( J' K
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)1 \* {) @& A4 ]- u$ B
VMMCall Get_DDB/ K7 H- G3 x9 b9 W- Y. T
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 e8 g6 W) E' w" Z, @$ o; y/ F" t3 D, {* _. [
Note as well that you can easily detect this method with SoftICE:
( ?" ~. M: E' R- \, J! } bpx Get_DDB if ax==0202 || ax==7a5fh" v3 K, C: c r3 M! T( |
: n4 R8 ^5 c3 m q9 @4 Y& j/ M6 f0 r
__________________________________________________________________________' L6 b. y, v0 k% U. T' p0 K6 Q5 K
D* r# j, V3 N4 k X mMethod 10
5 }9 T ^ {& E( |) M+ x=========; B7 t5 S6 n) {4 w- q V1 Y* [
# F5 e' t, K9 {4 Q8 A3 A=>Disable or clear breakpoints before using this feature. DO NOT trace with; o5 T* }! x2 J6 q
SoftICE while the option is enable!!
3 K# t3 m @2 l& d( g1 y5 ~& ^" e9 H/ i
This trick is very efficient:% H3 e. \& T N9 C" E
by checking the Debug Registers, you can detect if SoftICE is loaded+ `: g" W5 x! w
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 T9 v/ G; {/ j- A
there are some memory breakpoints set (dr0 to dr3) simply by reading their: _7 U5 q4 W4 ^9 p4 u& a, _
value (in ring0 only). Values can be manipulated and or changed as well
) D5 J/ K& ]9 N0 M(clearing BPMs for instance)
* \) W1 m1 [% z0 \' R \
! R+ y0 W5 e, M) z__________________________________________________________________________
$ ^" a* [( o4 k0 B
% d+ R" `; i# s8 q0 oMethod 11
/ e' [$ o' Z) B) J" u5 F3 c=========
* ?' F( c$ o/ Z5 e$ [( H* Z/ Y) N
+ e8 s! s# a {3 y( C, [, dThis method is most known as 'MeltICE' because it has been freely distributed- x: t: a* @: V2 f5 H' c
via www.winfiles.com. However it was first used by NuMega people to allow
4 t- y4 h/ M9 b$ E8 V, U9 _Symbol Loader to check if SoftICE was active or not (the code is located9 K- @$ N' N. G2 M3 f, i
inside nmtrans.dll).
1 n$ ^# |1 X4 Y2 h! |5 z% k3 w( ?2 d& h. u8 R7 u2 q8 |
The way it works is very simple:4 \& b# {+ O6 t9 | L; `4 |6 h
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: N$ r# W O5 b; [# {! ? JWinNT) with the CreateFileA API.
* A$ t7 U$ B, p; Z! R1 I
" j: _' R- n, ~8 YHere is a sample (checking for 'SICE'):
% [4 U! v# D) C& G. V. |* W
/ K+ [7 j4 G/ Q/ UBOOL IsSoftIce95Loaded()
% O8 g5 r# ~* K, ?0 t! Y3 `{- a0 o# V" e( }5 j7 O/ a" r \
HANDLE hFile; ( D1 z" d8 t6 w( v2 _. Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% Z, e) l5 S: O6 S FILE_SHARE_READ | FILE_SHARE_WRITE,: t% z9 h0 I0 f& M
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 f( ~. }( h# ~- ^8 _
if( hFile != INVALID_HANDLE_VALUE )
; o0 L( S: @2 T$ c4 K5 I {
6 j$ T I4 m$ | CloseHandle(hFile);
& e0 L7 y# N. x: p- K return TRUE;
* v% O, T; S- m7 [3 Y" S1 x2 g' d/ _ }
8 p- \! v% k9 z3 ]% j7 U0 t3 y return FALSE;
- K5 X2 L! J/ Y8 e}
: T W+ f* \0 |! ~/ {4 s3 O$ \$ h9 O! w6 x( Y2 I
Although this trick calls the CreateFileA function, don't even expect to be- r% S9 R! V& X% J
able to intercept it by installing a IFS hook: it will not work, no way!
3 q+ L4 Z) P" f8 S: }In fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 q" X& V- p. f. ^( Mservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 T+ a% x+ e% J8 r6 O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* x6 M9 h6 g: e6 Jfield.
3 s. V5 X {( f5 X+ T$ S+ j0 ]2 m1 mIn fact, its purpose is not to load/unload VxDs but only to send a
. Y; Y1 U( A3 X9 \, N3 ?W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 [; f- P( x. T( r* y$ `
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 ^/ N6 Z* I+ E T6 p9 ]8 E
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* a* [4 J1 S$ f+ l# I' k) NIf the VxD is loaded, it will always clear eax and the Carry flag to allow" s% v4 g2 E9 |- E6 p$ b+ \0 s
its handle to be opened and then, will be detected.
: ]) B) t4 q R& x% ]9 jYou can check that simply by hooking Winice.exe control proc entry point. w7 D# M3 t" Y1 ~' ~4 H/ L/ I
while running MeltICE.
+ L* d" i" y% ~$ k6 W# Y+ D+ D5 J
+ \5 z. I0 j- J. o 00401067: push 00402025 ; \\.\SICE
9 I z" \' Z: S& o 0040106C: call CreateFileA
$ @$ p/ K) L: v; [# ~ 00401071: cmp eax,-001' J) W1 r$ y# n) m% i X; @% J# Y
00401074: je 00401091' f7 W" o P E0 k/ M% k
$ c: P3 G$ [7 E$ c
% z8 b9 m) X5 K7 I# Y$ G
There could be hundreds of BPX you could use to detect this trick.# G) [9 J3 A5 p) K+ L* ^& ~! _/ q
-The most classical one is:- y' \7 P+ M- ~* r& ?
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ t8 S6 C+ W3 V l& {6 R7 Q2 |! z *(esp->4+4)=='NTIC'
0 D/ S, u" l8 Q0 Z% Y M9 D) ?' H, ^% @" t; L1 e8 j5 I
-The most exotic ones (could be very slooooow :-(
4 P( e, j) I1 ~& o6 l+ j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 W/ E9 _1 A/ [; A$ Y
;will break 3 times :-(* w3 {+ A) _6 a4 x6 w1 K4 g
5 o1 F, o5 T* j. u# T$ {+ j; Z3 I9 c
-or (a bit) faster:
, I( ^: z) I" c+ d* r BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( t& E; e3 n7 r1 x2 R* P% q
( \9 o J- u8 h: @* g& t$ a8 {
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( K- r" h" i& p3 j: A7 g' {; c ;will break 3 times :-(6 f* M( E1 \' e) V
5 l* U) J# Z0 W- J6 p-Much faster:
?5 V, h5 @8 Q& N% X; Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
2 ^: k8 P. \+ I
+ }0 @/ L3 N! H& X. w4 _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: M* a- t: x5 u- A& _! `" x; ?# ]function to do the same job: ?, @6 A) e, j3 g
+ O; J+ @4 x- N! S' D push 00 ; OF_READ5 E2 y' n2 A( O; X. x B9 `' Z1 D
mov eax,[00656634] ; '\\.\SICE',0
. k2 b6 S* @; w push eax) |8 m+ ? ~) } [& c% w
call KERNEL32!_lopen
7 Y6 A+ u2 ~. i1 G; T inc eax6 ~1 s5 |2 _; D; v
jnz 00650589 ; detected2 W& ~* C* e. v
push 00 ; OF_READ
. n- N3 a' t/ z1 i6 X% s- i4 u" J/ f mov eax,[00656638] ; '\\.\SICE'; ~# b; J- p/ f, Y- B+ T
push eax
1 R& [$ t+ T/ S* d. C call KERNEL32!_lopen1 D3 `" `" m; w7 ?4 d
inc eax2 s ?) M- R. M% i
jz 006505ae ; not detected
5 D+ }: t1 N3 c7 w7 X4 s
3 z d# i2 H( b+ U- n" x: L4 L
2 b: P7 s! b4 T# r$ L" D__________________________________________________________________________
1 s; s/ Y7 i! L/ `* o1 B& p+ D
7 h; |1 o0 U, WMethod 12
8 ]: f0 Q+ t2 b2 S; P$ S=========" r% p$ h# s- {! V! X; y! ^$ w5 f
6 k) S" A/ q X2 D# t6 ]2 zThis trick is similar to int41h/4fh Debugger installation check (code 05
6 d1 y% Z% E6 C6 a4 ^- g& 06) but very limited because it's only available for Win95/98 (not NT)# L0 N, }4 ?4 m8 q; J# p
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.- [% c# w3 i' J( {3 j8 j0 k
1 Q* w- s- d! }" v push 0000004fh ; function 4fh
2 c) `$ O. U; V `- b push 002a002ah ; high word specifies which VxD (VWIN32)
/ P/ K j2 \0 Y; \! D3 d* }0 Q( Y ; low word specifies which service
4 D3 y; I, @: I (VWIN32_Int41Dispatch)
; k, U7 }+ Z$ A# v" m call Kernel32!ORD_001 ; VxdCall
2 n( k% m$ d+ n L: } cmp ax, 0f386h ; magic number returned by system debuggers
4 d; K' ?! \7 u z* H8 Y jz SoftICE_detected! B( U5 r. X5 W6 L% Z+ Z
3 C: z. g( e: ]9 B# C; |" b7 a
Here again, several ways to detect it:, Y1 u* A$ V# v: q% y- W% U
. W/ V2 ~# Z/ B" D" ~# s& p$ }/ P
BPINT 41 if ax==4f) m, C, J* {) y' N3 X
4 m3 L( e! g' F6 p& s: X, N3 [# C# I BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* r i7 o! g |4 C1 y
- ]% |7 J7 D& q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% A, B+ i6 L- m, k! w3 N% ~2 X: c
, O5 i- H9 d' P6 T' H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) r, i4 l$ l; N1 e, e) M D) ^
; l. ?% y8 g$ ~, ^( U
__________________________________________________________________________
- Z$ x8 f4 f# }+ a2 S- Y- c
x5 I0 \" ]# j1 mMethod 13* R; [7 N* h! W4 q
=========7 A# e; B; ]0 I( o; N7 A
) j/ E' u: b4 O4 s" jNot a real method of detection, but a good way to know if SoftICE is0 ]/ e% d2 \# k, C0 S* B- c+ z
installed on a computer and to locate its installation directory.. I% i/ ^9 Z0 x
It is used by few softs which access the following registry keys (usually #2) :: |6 H: V( ~- _+ |8 p% j
; A V: U( n$ I6 e" J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 A7 Y- F" p- R# D/ w: e5 s! b' ^\Uninstall\SoftICE, c1 ^( c; u* |. M- t+ w( T( P: o
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. u7 _& x9 Q& p x0 S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" g& |# J" J; G\App Paths\Loader32.Exe
! r; ~; t& ? `0 ?- w$ D' u& l) @# x9 q6 k4 F
# Z8 b- u8 W& O! O/ i" G$ H& PNote that some nasty apps could then erase all files from SoftICE directory
. X# l9 `/ H- ?4 p(I faced that once :-(. k0 F( E3 U+ Q- p8 z! A- v
; j+ w* S& Q7 c% HUseful breakpoint to detect it:7 s9 _! F: z m7 d6 J
4 T' q7 m- a+ Y) E5 F3 w8 P6 f0 t. t BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'3 t% y; r* t( Z4 ^% R
; s, X9 u- k; v7 w: U
__________________________________________________________________________6 Y3 n; \# |+ `# \- E
7 U: j( N4 x I3 ~: \8 o' f% y
* I5 B- p) a: k5 D! I9 V% W" |7 _Method 14 ) W: b5 n+ O9 X% Y# h2 V. [
=========
2 u7 v, b# U# ~# {
7 |9 b$ Z% Q3 W, pA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ g; K2 n8 _0 ~! h4 q& F
is to determines whether a debugger is running on your system (ring0 only).
# ^$ h0 m% T$ n
9 [/ e( Z+ Q" b9 }. k VMMCall Test_Debug_Installed4 c* |( c7 a% G
je not_installed2 B: D5 F2 I! n& q# p
; L- I# {" F# jThis service just checks a flag.1 y: `# U8 a; J- W5 {
</PRE></TD></TR></TBODY></TABLE> |