<TABLE width=500>% S, h9 q9 }; O( J5 N6 z9 z
<TBODY>' T- a; Z% [7 D$ A. L
<TR>: H- v3 c5 H! C5 b h; ?( j
<TD><PRE>Method 01
% I2 k4 u, B6 T# J8 t6 j=========5 S; ?( J! o9 x$ X0 m$ f/ I
% z2 \/ o: P! d/ R6 G, K
This method of detection of SoftICE (as well as the following one) is9 q# A6 K) B! s
used by the majority of packers/encryptors found on Internet.
' J2 O2 ^4 s3 G% Q/ X+ vIt seeks the signature of BoundsChecker in SoftICE1 U, H( N w& \+ b& |8 c) ?
3 ?$ M( U, r# p) w" z9 Q- ^) s mov ebp, 04243484Bh ; 'BCHK'& T( t, D4 `1 M- w1 ~
mov ax, 04h) W1 X8 Y" B* B1 g
int 3 ) o# ?! G. v/ l3 Y$ z( V
cmp al,43 K4 x+ F1 Q: o/ w+ k$ K
jnz SoftICE_Detected1 N# S" D! E; c7 k! T) S- C0 d! v3 k
& b! I' M2 }9 T4 _% N" d7 i___________________________________________________________________________' T; o" f( E* }/ R6 h
, f* ~* C& R5 S$ [; f; @/ X/ V
Method 025 M$ o/ o" R6 M! c4 ?; b
=========" K# Q+ @) J- j/ b2 {. M8 l4 x
# j* n3 v* E* T1 o+ e2 _Still a method very much used (perhaps the most frequent one). It is used
" ]( F6 d$ _' Q5 m% V Gto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, M! s& z" E, j3 V0 s& d1 n' ?
or execute SoftICE commands...3 R$ @" h" ^8 |6 C
It is also used to crash SoftICE and to force it to execute any commands
4 u1 O* y( e) I' \/ C0 K. K(HBOOT...) :-((
1 N$ P/ |3 N0 ~2 n8 @' a- i
" e& C- O5 D% z2 {! {: E6 [0 X, D; CHere is a quick description:
3 F3 u1 t. Z: p$ E$ M-AX = 0910h (Display string in SIce windows)3 o$ L5 p) l) F9 g( m, c7 R
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 ~% W# `; U( P* K
-AX = 0912h (Get breakpoint infos)
8 d) R. i8 ~* c3 D! \ `* J-AX = 0913h (Set Sice breakpoints)
6 s/ ~& w7 Z+ A! K* n# x-AX = 0914h (Remove SIce breakoints)/ O+ K& ~. x1 ~2 Z
, a& X1 I& p. }4 t2 A8 n6 \& G
Each time you'll meet this trick, you'll see:4 _9 k4 W1 c( B
-SI = 4647h* y3 w* i- _) @' S6 U
-DI = 4A4Dh2 W! @3 \7 N, m: R4 w5 P1 h$ C% M- k
Which are the 'magic values' used by SoftIce.) z1 \+ R4 |# w D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( E, w: s; I" U/ x5 n
: i7 R2 _! `& I, \5 X- L; _Here is one example from the file "Haspinst.exe" which is the dongle HASP
. u3 w; p' q4 p1 n1 DEnvelope utility use to protect DOS applications:3 @& Q( C- ], H5 b0 L) d
' V2 F& p* r9 d! v7 H* ^! |1 _% g( @" H. R% B
4C19:0095 MOV AX,0911 ; execute command.% V" r( E M7 @) E; z3 _$ _
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). t1 @- |8 M1 \. y5 e+ |# e
4C19:009A MOV SI,4647 ; 1st magic value.& o @, J s9 G' {6 g K3 W
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 F; N: V, e+ c' w+ O4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 p, h" D* y2 x7 @/ A0 q# D6 a4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
4 J$ }1 l, D- m8 d: v1 r4C19:00A4 INC CX: {" }: Q' {$ l; H& h7 W
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# A! b! z& _7 f$ ?7 ~, J0 k, ~
4C19:00A8 JB 0095 ; 6 different commands.
% w' o8 ` Z4 G6 |- q4 ^4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ l) K. N% D/ @ D. P \
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 p: z4 _9 C' m; S* F3 e6 f% I s2 w" m9 s' I5 U
The program will execute 6 different SIce commands located at ds:dx, which7 O6 \ T9 t/ h3 r- v: I4 O
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! i+ O2 L7 i0 j$ e) _" |9 ]
1 c! A. t$ C- E' H s8 r+ G0 d+ e* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 V0 u1 w7 Q9 @5 |6 U) o9 V___________________________________________________________________________
* e) f3 [9 a! z6 C0 ~* S3 f
$ y! d: U {' x X& C6 u0 B1 |: k( [6 w. r% k1 C
Method 03
5 ]* q7 Z- q) ^=========) H- F$ k0 s8 P/ X+ y% B
- S# e1 e& c1 F; u2 I9 `# TLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h* w7 v( G. W( H& [ m1 j
(API Get entry point)
7 M5 P% Y2 f% ^
( c* G/ z8 [2 E& i
% n, P& V. h% [( w# h xor di,di6 ^ t4 e3 J8 I& `# B
mov es,di
8 u5 I$ h7 \5 d mov ax, 1684h
1 @# N2 m# r2 ?/ m ]! [+ D( r p9 | mov bx, 0202h ; VxD ID of winice
# Q1 }0 S, c/ o- c: K. u5 Y; D$ V int 2Fh* w# g7 ?0 G$ d1 k
mov ax, es ; ES:DI -> VxD API entry point
7 r6 X$ q2 }% }8 y1 N3 A add ax, di$ g# T1 E; ^% R" p
test ax,ax
# \: S+ N; e7 I; y, _: O jnz SoftICE_Detected: K- m: D: P, t3 o9 u9 T
2 G; C, j9 |% k& W# L& M+ x___________________________________________________________________________
7 e& i7 Y5 e7 e: S
% d \0 z w2 w" J' ?1 {! zMethod 04& E4 W D5 Q0 l+ O1 G. F
=========% V, ^: A) {1 v
, Q" S4 x7 n& k& k/ B( p
Method identical to the preceding one except that it seeks the ID of SoftICE* a6 {$ k0 `+ J
GFX VxD.9 {; K, Y: \6 y6 u) s
, {" X& X; ~/ I" @& F) h9 ] xor di,di: {2 g9 g9 {3 G' u8 g: j z% j1 G1 V
mov es,di9 b) k/ K( T" ^8 l
mov ax, 1684h 7 Y" Z+ u$ J( t% S
mov bx, 7a5Fh ; VxD ID of SIWVID! N, u# T% o+ N8 ]9 R, @( h \
int 2fh9 Q) k6 ^: t! ~6 P- i( U
mov ax, es ; ES:DI -> VxD API entry point! n2 W% C. d' u4 n
add ax, di7 m# |6 p1 h i& ^% I+ @, D
test ax,ax
2 X* b! Y ~* z0 a9 t jnz SoftICE_Detected
4 ]& {* z- c5 y$ _3 _7 Z5 v5 C$ [/ U+ @9 P/ ]. s8 E
__________________________________________________________________________8 Y* g+ N" ?) B. k/ Z1 k4 L
) f1 V: `& ^" q7 ~1 s- n& s! ?& B0 H5 J s+ U5 c: Q# a% H8 g$ Y
Method 059 b9 [9 M8 {$ i" z+ a
=========0 L9 a5 U2 r' R0 W% v: O
/ |5 i M2 \ e4 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
6 F/ d n1 y! u2 f# l' udebugger. It calls the int 41h, function 4Fh.
; A, M. w% @5 K+ q. G% M; n- rThere are several alternatives.
- J( b+ O9 w; i6 V2 _5 R* |
8 v9 H1 w# m, x& UThe following one is the simplest:
" g# H6 h: n: o7 f' T3 ]& v
5 @( U! ~3 `" D( p4 o mov ax,4fh% B; U6 C* A9 x @$ |
int 41h" ~6 x c4 v: A7 H" g
cmp ax, 0F386, c9 G8 C% G% u0 r" U* ~7 Q% ^ K
jz SoftICE_detected% E& [+ v8 J7 G: j% ~7 U7 K
0 x l ? l% h
9 k1 L6 C! b2 k5 X" _ m! W1 bNext method as well as the following one are 2 examples from Stone's / w Q! d# ~. p3 ]
"stn-wid.zip" (www.cracking.net):
6 l' t: V# \: h4 h2 D2 @- G1 b4 U( }. c0 {" ~
mov bx, cs
9 F" J) U+ f4 T; W lea dx, int41handler2
0 l* ?3 C; k; U# S7 Z8 t& W' Z xchg dx, es:[41h*4]$ m) ]8 X' c# I5 [# g
xchg bx, es:[41h*4+2]
- V) ~) s) x. n: u. F6 {, Y- R$ v mov ax,4fh
$ `/ i; A; C9 I% }- a. Z: K int 41h
3 {' s2 T' I! V9 S5 C( N" W xchg dx, es:[41h*4]* n: `# k+ z$ v! j
xchg bx, es:[41h*4+2]5 W+ @8 l" X! \4 e
cmp ax, 0f386h: z @1 D! C, Q
jz SoftICE_detected
1 z+ k; q, [6 |7 I- {' [' r- i! f' O2 @. h# i
int41handler2 PROC
* L$ r( ^9 ^& d1 E% |9 d$ T: X iret
# a0 v; b3 N6 o1 U2 Y1 @( i. cint41handler2 ENDP
4 V, i* L% A* W0 @, m2 s& Q1 r: M* A/ {9 ?8 Z. { y
7 i9 p% w4 n4 X/ T4 j4 Z1 R; x
_________________________________________________________________________
8 K) }# Q% _0 V( e5 j# K* w j, C( ]+ v! Q
* n$ p! C9 k3 @ m0 f% ?Method 06% l9 U- Z2 P. T
=========" H7 U* b) n8 r
8 l7 t7 o6 K( b/ V4 B; t5 }
& ^9 X' L9 C- }% t' B. W2nd method similar to the preceding one but more difficult to detect:
, E, Z( ~7 P" \4 J1 y* l+ P+ ?0 @* k6 G u. w. _
, w% i1 x1 e$ A, b% F! ~, m
int41handler PROC: C% s6 b+ s1 X* w* b
mov cl,al( @0 O# T( t9 B/ f
iret O; x- T8 a3 y+ B* H
int41handler ENDP5 f# I. R0 ?. n6 E
% A: S, o1 Z" b- E
$ M+ M# ]( W X- \
xor ax,ax) l. B+ y. N, z( z
mov es,ax2 r, @3 u' N1 m, W' x# z/ j/ n
mov bx, cs5 f8 k+ b' Z* b1 f+ S$ x; Q+ T
lea dx, int41handler
7 p1 s# k1 O, d$ k, y! D" f xchg dx, es:[41h*4]
/ K0 D3 l2 t& r! B' G xchg bx, es:[41h*4+2]
! ]8 w1 r' x3 f: v- U7 t+ e in al, 40h
! j v0 j- O- x. b, \ xor cx,cx
3 P. F1 N: }8 A& u: I int 41h8 K7 f" Y9 ^2 h& A/ r% n9 l
xchg dx, es:[41h*4]
, v0 }6 W1 Z+ _" y4 H: s) f xchg bx, es:[41h*4+2]3 ~9 C+ }3 h# b5 e
cmp cl,al
7 L- n a& b7 Z1 c1 B" g; I( n jnz SoftICE_detected
! i% O6 I: r' ~$ u7 y, ?8 I7 L G6 L+ n. X) c- i: Y$ E1 k
_________________________________________________________________________
8 _. _% ~1 X' M3 o- A- \6 j1 m6 o1 H
Method 07
& R% L4 t& I1 [$ k- U$ @ |, J=========
. t7 b9 l, e T( ?+ J6 x- Y4 u1 \. t8 ?' N/ p B
Method of detection of the WinICE handler in the int68h (V86)
7 h% X0 `) k. `) ]- Z% @3 P, c O+ x! L. u% y# P- r
mov ah,43h
0 v& ~8 M! o, g, T- T) W int 68h5 K) X! }( a3 G+ J8 X' Q/ B1 R7 I+ x7 w
cmp ax,0F386h
2 H/ z1 R/ ]. t# B7 ?+ p& L: z! U jz SoftICE_Detected
$ q4 ^5 L- S9 P% C/ ^2 }
# h' Q6 ]8 L# [# Q H1 L. t! o: S/ v: g7 Q
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
2 G3 a: Z7 K" ?% `5 ? app like this:
: k" a5 ^' j1 L) R0 `: j2 T1 K% `* g$ B7 t1 R( n s7 m0 I# u. M* k
BPX exec_int if ax==68
0 k3 V, ?, F2 } (function called is located at byte ptr [ebp+1Dh] and client eip is
/ R4 a, J5 R' `+ o located at [ebp+48h] for 32Bit apps)8 e [0 x7 ]6 o9 d/ s
__________________________________________________________________________
4 Z* f/ \1 `' a. \# |- r
+ k6 b E$ A' s i
* Y9 e! v; ]% R) O5 V+ C0 ]) j, ZMethod 087 Y4 L# C. k7 H
=========" a7 ^& i- G' a
! R6 j& {* b! v( s
It is not a method of detection of SoftICE but a possibility to crash the
' {1 ?1 T1 h2 B) J% g2 o% U8 |! s% B9 fsystem by intercepting int 01h and int 03h and redirecting them to another* U5 i5 N5 `( M6 J3 y* a
routine.
$ b# _( f0 _& ^' j+ oIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! k. o3 F: T* p& h* \0 U
to the new routine to execute (hangs computer...)
`) {& d! r, r# W- y- k" l, \" t) j# e% y3 S, T. _! b* Q, t
mov ah, 25h/ m m* R! o5 j, {# _9 s$ D" f
mov al, Int_Number (01h or 03h)
7 z' @3 w) s8 j6 {, K" |! \ mov dx, offset New_Int_Routine
1 _5 |1 V5 z( j2 |3 h! M3 `3 v; K5 l int 21h
; M, y$ Z% X: X$ n' E1 Y- ?& _1 o8 E% T4 }4 l
__________________________________________________________________________
0 |8 Z; \; k' }* b/ v7 t" C& [
$ v, u, v3 M3 ^- e' ^Method 09
8 x% @0 J' ?" g$ K, w, |% P=========; ~8 P( H: L1 t7 U# P6 E
% @; H9 L6 G' w) ^* v9 z) [This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; H1 N% z6 Q0 p; t7 @1 vperformed in ring0 (VxD or a ring3 app using the VxdCall).
: E4 _4 t3 x% d5 QThe Get_DDB service is used to determine whether or not a VxD is installed
5 F- @7 T3 x3 C7 U" a" _" ~1 C( dfor the specified device and returns a Device Description Block (in ecx) for
# f& n/ i! @" ~that device if it is installed.
0 i p. M. [7 V$ }7 Q7 _' d: W, W2 g0 ~7 u0 d u9 l
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) @! _$ ~% s1 Y; K0 Q mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( E- A5 u$ e+ A4 P( N7 ?6 K VMMCall Get_DDB
; V" `6 K. o$ z mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed9 f8 F( s) C, d5 h, z& @; M
: p/ a1 z! R% I0 r! \3 P8 e
Note as well that you can easily detect this method with SoftICE:
3 c7 h, U; Z' v% P1 | bpx Get_DDB if ax==0202 || ax==7a5fh
, G0 w+ }- J: K% w5 V
6 _3 \- M) Z/ U__________________________________________________________________________' O" t% L% ?* k; Z
, Y6 r2 L3 `$ c3 A) ~Method 10- S9 x) e0 Y1 c( [8 e' Z9 |0 z
=========
: i7 ]0 s7 e) J& N+ S4 f* D! c' d* N3 B. L: |8 k4 W* [- x% l E) S3 l
=>Disable or clear breakpoints before using this feature. DO NOT trace with& h* W# |# w# e5 H
SoftICE while the option is enable!!" m. S; F' _) L/ [' n# D8 v
. e! s+ T0 B) d: a2 n' dThis trick is very efficient:, y$ ^) {2 O9 Y8 ~
by checking the Debug Registers, you can detect if SoftICE is loaded
% T/ Q" @' h! G: ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! Z) x& _' i, |
there are some memory breakpoints set (dr0 to dr3) simply by reading their$ e3 y) Z9 c& J0 e
value (in ring0 only). Values can be manipulated and or changed as well
" o/ I! b. O& A/ u7 y: }4 J(clearing BPMs for instance)
* K4 L* l1 n& M0 A. z0 `: {1 |) l
__________________________________________________________________________
% I4 ~9 A7 p$ f
6 {; w: A' J! T4 {# j5 g0 |Method 113 Y6 J2 ?+ N' K% l' ?) ]5 s2 ^; P' r
=========
' U4 \6 c0 m7 z$ s0 d& D& o( J
1 H- T- G5 j2 ]0 ~: t- vThis method is most known as 'MeltICE' because it has been freely distributed9 b+ x2 J6 O, h* o
via www.winfiles.com. However it was first used by NuMega people to allow$ d1 k: i! l# ^7 V7 }
Symbol Loader to check if SoftICE was active or not (the code is located% m! L% b: U* ?# O
inside nmtrans.dll).7 @, z3 X5 J* }3 G" H+ A
' S$ r) P' v" B, k. HThe way it works is very simple:0 p' {" p5 K, i3 r4 X" E
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 A5 V5 j) p7 w- b& v% Q6 `
WinNT) with the CreateFileA API.
2 {7 K3 @/ a3 f+ y' a7 i% n/ m8 q* Z+ |
Here is a sample (checking for 'SICE'):8 d2 o6 Y/ m1 V( `% [
5 t7 X) ?) H& W6 c
BOOL IsSoftIce95Loaded()
1 c1 @* j! s" A }+ P6 W% i) O{3 c5 ?3 f0 B1 ]- _7 b% q- t1 J2 h
HANDLE hFile; + b; S8 |+ R0 H# g, |
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 V; h i" D) q, _2 U
FILE_SHARE_READ | FILE_SHARE_WRITE,
: N# k% a8 u- } NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. Z, e) ?( |$ r' m, E8 D* I if( hFile != INVALID_HANDLE_VALUE )
& x9 d/ Y* n$ r4 D; H {
& ?/ j) H8 [: S CloseHandle(hFile);
8 }4 q& w& @- u5 j! T return TRUE;
- x7 d6 x& g8 A' V" U }
- z3 a& Y0 Z" v6 B return FALSE;$ d+ U. Q2 ?+ z4 y6 q6 T1 q
}
# i% E3 j \! j4 o
4 X" M5 g+ D# a% ^. A" O. l" d' i3 UAlthough this trick calls the CreateFileA function, don't even expect to be
4 J( _: E# z1 ^' I. B& P9 _1 Cable to intercept it by installing a IFS hook: it will not work, no way!3 z# e$ M0 i; T: H6 z, b) A: C5 v, U
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
8 x# G b& Y' y$ `3 h3 vservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' o3 O% i. r5 `' _' h& V1 @and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 N: H; f% C3 W' F8 } O6 vfield." @" _, K. ` Y0 s7 N
In fact, its purpose is not to load/unload VxDs but only to send a
# ^# k, k0 m: D1 d) gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)( e$ e5 V/ |& z' R- m, Z q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try8 Q" Y+ |- y d" y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 x! X$ ~2 g9 N* j x2 r
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. t. y0 g5 K9 Sits handle to be opened and then, will be detected.
. @- H6 ]1 x! O' X jYou can check that simply by hooking Winice.exe control proc entry point: v, x3 v* c5 k1 x: B! B& X
while running MeltICE.4 m0 [" d. @) r9 Y) {
- p) z( }( W7 R- R) {* ^8 D
H2 c) K# l/ w) Q8 {, r' v- Q
00401067: push 00402025 ; \\.\SICE
1 N2 q- {0 ` V% j0 J 0040106C: call CreateFileA
( Q$ h! x" T7 Z( s 00401071: cmp eax,-001) q- @7 Z: s1 u
00401074: je 00401091
, u0 @! g' W; o- d2 i8 f$ ^! x4 N
8 f+ f1 {7 ` {0 c, y! ^
/ ^+ z( s4 c2 v/ {2 N6 W: Z4 `There could be hundreds of BPX you could use to detect this trick.
' f. l4 @, N* Z4 ^6 Z& l- k) y-The most classical one is:
% C& Y0 Z- F( ^1 l BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* M* x( q1 a" `& a *(esp->4+4)=='NTIC'- M# b8 Z9 o/ Y# ^% r
, [8 J7 f* T+ Z# p1 N-The most exotic ones (could be very slooooow :-(
3 Y5 K5 }' U, Y& F5 M8 H: H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 a6 A- w. a9 t& O5 { ;will break 3 times :-(, O2 }! G- ^8 {" C+ B, L4 m
- O) j' d$ v; e; n6 z* a0 [% y
-or (a bit) faster: 6 i; b9 w! u7 I! D
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')( r! g9 T5 [9 l, t4 z+ b7 T
5 e D' F( j! k/ z BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: P2 f ^4 a& ~* o: ]& k ;will break 3 times :-(
6 q3 G( s( k6 T$ y9 b- f' G1 [* c" M
-Much faster:0 s* c% ~8 T" Q" l
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 o3 `. p; o2 h$ h- J4 p" X* P( y% q+ S, ]/ `
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" F9 t) ?% N0 S! d5 Ufunction to do the same job:0 [+ E9 I* `! k# Z
5 V) T0 \) |: g. t y" |" _
push 00 ; OF_READ
2 |6 `: e. T, S: L4 S mov eax,[00656634] ; '\\.\SICE',0# |: O0 u! f3 u* @' K
push eax
* i: v* q0 x) O' X call KERNEL32!_lopen
8 l2 C1 S' Y5 c5 L- Z inc eax
- c; [. o! O* r/ F jnz 00650589 ; detected+ o7 a& s; H' M& I9 C
push 00 ; OF_READ/ p4 b4 M. z' D) j! t9 S( R7 d
mov eax,[00656638] ; '\\.\SICE'
# a& s2 \" e" ?6 L4 ?+ j push eax
* n0 A j2 O( F V0 Q0 t! Y call KERNEL32!_lopen
6 ]2 a8 a6 G4 K inc eax
1 ]. ?2 F% \7 t1 S6 d jz 006505ae ; not detected
# |# I6 P5 m6 Q; D+ e: n. g( K( {
! _+ z1 u, E6 U3 x% U( y" [. I2 v# \+ ?
__________________________________________________________________________
# X1 S5 e% \# }) M/ a
2 k& q! D. f4 ?- s" J! WMethod 12) H; x- B& u$ F
=========
1 B, W' A; N% W) q4 h. V* m* [
& E9 d: ~: E7 U* U- ^5 iThis trick is similar to int41h/4fh Debugger installation check (code 05, y, S0 L( B6 a9 E" e
& 06) but very limited because it's only available for Win95/98 (not NT)0 a6 k( c3 Q' \5 u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." B- \. S- L5 g* d1 X4 k: l
! X! S( z8 ?4 N* X, ]6 k push 0000004fh ; function 4fh
+ Z! b' G' [; Y$ i# ]5 J: [( e2 [' n push 002a002ah ; high word specifies which VxD (VWIN32)* P" K! v- u- l+ B3 d8 V, h; |
; low word specifies which service- b3 Z, \ q& ]5 ]
(VWIN32_Int41Dispatch)- n# D, {3 p# \. j" c9 v
call Kernel32!ORD_001 ; VxdCall
2 t/ ]0 R: B+ z cmp ax, 0f386h ; magic number returned by system debuggers* q8 |$ U0 S, U' T
jz SoftICE_detected0 Q% c, }8 a, z, ~4 O' L- c
! a! A7 @; m& `) ]6 ?% C0 y. FHere again, several ways to detect it:! B& d4 n" n( b, ] }* x5 n
3 ~+ j" |$ f- w4 E BPINT 41 if ax==4f$ G1 M* e' Z- F& V. s* N' x* W0 I$ w- n
% C5 c* e* E' j7 q4 ]! ]3 s BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, n- G, l B! I" L. \9 D
, W5 }4 K8 c, i4 @5 i
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 G, V8 v8 R$ Y' N0 c% n e
( K$ Y+ r4 j; q0 ]& S T BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" ~# o% Z2 R, t, z/ J' H+ C0 ?9 Z
( Q; c1 [4 G) J) r8 |! t' x& m" S7 d__________________________________________________________________________0 v5 S1 k X" K4 a& L! n0 I
y0 c2 [8 j7 B1 ?7 m
Method 13: V5 [) x8 t/ U& F' V( F v
=========
& [+ ?8 L( Q1 K3 J1 i0 y9 j) u! c, j9 @5 @
Not a real method of detection, but a good way to know if SoftICE is7 e0 e" f! w+ Y3 q) N) I0 P
installed on a computer and to locate its installation directory.1 f& W8 K- R$ R) u
It is used by few softs which access the following registry keys (usually #2) :
; n6 n& `. f+ d ~" ^4 z* h% z3 E- K K& P. F9 e+ v
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' n2 g6 O; i" ^' J# R6 X" `. R
\Uninstall\SoftICE& u# i& {/ r Z ]6 [* a9 T
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 L/ {. O _8 F# l) l0 m: H3 ^
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& Y5 t" |$ p b: @$ ]9 h, G" V\App Paths\Loader32.Exe
. m a9 Q- t. @" R% Q8 Y9 h X
6 }) x. k; U2 U3 z# z
6 T( K2 ]! Z4 Y# `1 c: Z4 ANote that some nasty apps could then erase all files from SoftICE directory) T) L* I! C; ^: f" C5 D6 Q4 v
(I faced that once :-(- G0 G2 x1 n$ R+ f. C
; Y0 }4 \/ ^1 [ EUseful breakpoint to detect it:
1 Y d1 `1 `- z9 b& q4 o5 {1 `. `7 y+ o
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( _" v6 ^: M: Y4 A. E
, `. G6 y& R/ ]8 {- }7 ^. B__________________________________________________________________________
$ `* \5 b3 {& t. x9 }0 k9 V$ G6 G* w7 M! d6 C9 X" u
- t; {- n' D7 g( [
Method 14
2 J/ i# D I/ U. O) X* i=========
9 [* N. [# b3 @& Y* o2 K- j& N5 k8 y. |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; }% z8 O' b1 h
is to determines whether a debugger is running on your system (ring0 only).
9 P2 e1 H; x: t: Y4 g3 b+ u) z; ^; P
VMMCall Test_Debug_Installed9 b2 L$ ?( k. r! R0 P! K& r
je not_installed" f/ E# @' I- f7 x
- Z5 w/ Q1 n1 r8 e
This service just checks a flag.3 B- a" S% g7 U
</PRE></TD></TR></TBODY></TABLE> |