<TABLE width=500>
. T0 F3 V- `" v8 B<TBODY>/ L8 D" P4 ]: q
<TR>3 _- @, p% x/ C1 w( t$ j6 }/ _2 D5 K
<TD><PRE>Method 01 7 k9 \( |. z) j8 l# H' l! s" H; r/ y
=========
8 U, J$ p: z- L, l, z7 d5 `
- s& a ~1 z w/ d. b* BThis method of detection of SoftICE (as well as the following one) is, }& q0 J; t4 M% _; r# g, E
used by the majority of packers/encryptors found on Internet.
4 m# Z! U6 c( h6 UIt seeks the signature of BoundsChecker in SoftICE
, U9 L7 A: Q5 Z2 O2 b9 T L4 q- W0 p- |3 b5 {
mov ebp, 04243484Bh ; 'BCHK'; @) ^4 Q! K1 F$ k: P
mov ax, 04h
5 n- c3 ]$ n: p; @- R! { int 3
/ r4 P3 y( A& T cmp al,4; ]$ l; A; A/ F, Z/ \+ \
jnz SoftICE_Detected
3 X# p3 U! p B* ~/ H2 L) H. K. h( a
* j! p6 `* [) ?" L! C. O C___________________________________________________________________________8 L& P( P' Q" t% C
@& | P* `7 b+ u# k4 TMethod 02
, p: f2 M5 W& [& y=========
; V% c/ L! ^9 J7 f
/ I: y4 h3 R: w" a6 [. r8 y; iStill a method very much used (perhaps the most frequent one). It is used
2 c" d1 S. x; dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 f/ I$ Q6 D/ t( j* C
or execute SoftICE commands...* } x5 p9 \9 b) o. k! x
It is also used to crash SoftICE and to force it to execute any commands
" v7 E. m9 M. n7 T7 B2 q; Q1 f2 o(HBOOT...) :-(( ( L$ I! l5 R+ C' V+ j6 E* O2 V
@; _/ Q- x, \1 z0 i5 qHere is a quick description:
% h+ V( u* ?* D$ q. a8 ]-AX = 0910h (Display string in SIce windows)
+ ~3 J* G! o) ]! T1 M-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
+ [; C! e6 u5 e2 H o9 t$ ?3 A-AX = 0912h (Get breakpoint infos)& N( i! k. U2 g9 o; J! n7 Q0 M6 i
-AX = 0913h (Set Sice breakpoints)
2 {7 ?0 `' \% r7 Y. G-AX = 0914h (Remove SIce breakoints)
* ?/ l! P' g \9 P5 }
0 j; Y: V1 T% x7 Y8 dEach time you'll meet this trick, you'll see:
6 S, G. `8 g' j3 B/ f-SI = 4647h
* l# r* y @. @5 q7 W-DI = 4A4Dh
' b* ^$ e1 {5 i+ u; s8 Q1 wWhich are the 'magic values' used by SoftIce.* B3 r |$ ^/ r( F( K) V, k
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; c9 p* K+ w% ?3 v3 ?( j" W5 w E3 B5 z
Here is one example from the file "Haspinst.exe" which is the dongle HASP# D; V, U+ t) K
Envelope utility use to protect DOS applications:
4 ^4 P" G6 M* _# N3 {1 k0 C" U8 v/ ?' h7 u: h+ e$ U) O0 \
# E: s6 _# w1 S. l4C19:0095 MOV AX,0911 ; execute command.
$ ~) O6 ]# n$ L0 z3 W) X4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).* v. p! n$ e8 ]/ ], I" B, l, D" t! U
4C19:009A MOV SI,4647 ; 1st magic value.
: R8 J2 Z. D! y5 P$ o4C19:009D MOV DI,4A4D ; 2nd magic value.
3 x$ a a% u3 E6 ~4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*) \- l% ^# i5 b- H
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute; m t5 n( j6 {; W$ d4 {: ^
4C19:00A4 INC CX
3 e0 E1 g+ K# D- _) r4 I- X4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# y1 s4 G( q* w P: }& |4C19:00A8 JB 0095 ; 6 different commands./ g: |6 l# x1 H
4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 q2 N8 I& o( ?% D
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: D* L2 u' d0 x" f) V. b
* A5 _$ L7 ]! k" xThe program will execute 6 different SIce commands located at ds:dx, which
) k* i9 n d0 A" a/ O1 Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 r; a% E5 |( F) P5 H: o5 \+ \! R4 ^3 u4 R4 ~5 Q; l# [* {
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
0 B4 ^- a- x, w; C" P: u___________________________________________________________________________
- [4 B& o4 \+ W. x, a1 Y% C3 O
z( V- X: i+ w4 v3 S; ]+ T4 @- Q* t- l l2 r5 G$ h- `
Method 03- [) t. x1 {+ w L0 W6 f9 y
=========8 \ b$ U/ Q; n1 E7 y& ]
4 r1 j' {% f1 _0 m2 `- I
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
h, S' r0 W: s(API Get entry point)
1 L3 [: X- K3 R& \( S0 _ X9 M: [9 ]8 C3 D* n/ A; v
/ L% P9 \" f3 ^3 ]# l8 W
xor di,di O% B9 u1 ^) b* O
mov es,di
1 h: m% \4 H0 } mov ax, 1684h
$ N, o, L# |* Y mov bx, 0202h ; VxD ID of winice
7 \! S! r0 v7 ~. h) z- }1 Y6 ` int 2Fh- M( p4 x" B! N0 e
mov ax, es ; ES:DI -> VxD API entry point& D4 Z9 u7 Y w3 e
add ax, di' m8 U" B: e" e. K$ N
test ax,ax, M' i7 {9 n1 H) i6 y( o; ?
jnz SoftICE_Detected3 W# p! ^3 y( l. A, }5 R
" D( _2 ~9 M# A___________________________________________________________________________% l( H1 e. q- P# z! `0 \
$ W0 |! e9 {) e$ v+ y0 {
Method 04
& r# ?- h1 M# D=========
4 B' {8 [3 t: b! q2 R3 l+ n
6 z, e/ T. [! fMethod identical to the preceding one except that it seeks the ID of SoftICE
* D9 f" B0 P. IGFX VxD.! }5 C6 ?/ V3 W
- H- T$ ~* \7 `1 F, S7 [% W
xor di,di! X7 K6 }. m3 ~8 S4 u9 N; b
mov es,di* D5 {% Q8 R' V7 [/ t; J
mov ax, 1684h
* i1 J* X9 ^& _) t* j A mov bx, 7a5Fh ; VxD ID of SIWVID' E! n( ^# ^; T2 ?6 f& m" k& n
int 2fh3 f" ^/ N: m- u" c( ]
mov ax, es ; ES:DI -> VxD API entry point' ]0 N8 u3 }, |2 r
add ax, di2 j: q2 C7 ~% U/ _1 T
test ax,ax
3 O4 z& u% ]! Z ]' j$ x jnz SoftICE_Detected( F# W1 n! t8 s
7 `0 h" X6 z! y$ r4 e7 L__________________________________________________________________________
$ c, r0 @& S( U: U, {, g9 s+ X9 a0 S4 y z) f9 L( _9 D
' `6 p o7 `: ?
Method 05' [+ s/ T/ z" Q% e1 R) b
=========
% y0 f- ^4 c A7 a5 g1 G3 a) N- M
Method seeking the 'magic number' 0F386h returned (in ax) by all system
' S+ c6 H5 H$ ^& Ldebugger. It calls the int 41h, function 4Fh.3 s/ P: u1 q, i/ ^
There are several alternatives. 2 r1 [3 y/ h$ ?' T. b5 L# L
+ H; A6 _" i+ T$ V* t& l
The following one is the simplest:4 m. N" z% I6 c3 ?3 c+ F+ m. A8 z) B( O8 j
7 k) u8 ~1 J, N- F mov ax,4fh6 w h+ B$ u5 D$ d) z7 ~( d
int 41h T) |! ?- `4 J; j/ c
cmp ax, 0F386! G! L5 i) f( u+ p6 L
jz SoftICE_detected. q. w! K" ^: o9 b" m) V, f" f7 `
9 w g9 g1 k/ s8 C& Y+ Q7 s! q
3 `+ o5 @" H1 K+ t5 l
Next method as well as the following one are 2 examples from Stone's ; Q( {" `/ J7 E' Z
"stn-wid.zip" (www.cracking.net):
6 y- l; p+ X5 L" I' R( ]. z6 V
% e* O% R& m* x% {) w9 A mov bx, cs- z+ u4 l; ~* x6 [2 Z5 L
lea dx, int41handler2+ u g- V! E; e$ Y2 R
xchg dx, es:[41h*4]) k& K& L' `4 |# v. M3 `& r4 m6 S6 k
xchg bx, es:[41h*4+2]
+ h6 Q$ s8 s$ \/ U% |! p2 T( G+ C mov ax,4fh% }% y+ ]* c; t1 o" G
int 41h4 U! Q: o1 \+ y" [5 S
xchg dx, es:[41h*4]9 n2 W' X5 L) e& V* w+ r
xchg bx, es:[41h*4+2]: n* v4 u8 K N: y# Y
cmp ax, 0f386h- y$ B* l7 y$ i: W) ^9 C
jz SoftICE_detected0 e* E2 U1 C& h/ W' F4 W
+ N" I: R# U, W' t" C3 qint41handler2 PROC
- s' L7 F* |& Q* Q iret
1 ]* I$ T& Y) r4 `int41handler2 ENDP
; B- ]( v5 R. r' Y4 R8 m K- r
) u# h& O, B5 T4 {
4 ]- M1 _' U+ |1 __________________________________________________________________________
; ~# ~! l4 X1 |$ U9 O; J. A
% f& O2 ]$ S* @1 R. x0 D7 X! A. _6 s2 A' r4 n
Method 06( r" |5 `; C3 B; d
=========' t7 `8 Q4 F3 [! v
$ ]9 J" A( l' i- J; V0 q+ M4 c
m( M! ?; @* |2nd method similar to the preceding one but more difficult to detect:2 L: F. o0 V/ g6 o+ f2 \2 a3 B
) A& m; K) z% ^& t2 ^, J8 @
# w* K. r- Z: _* v8 C# T& A# ?int41handler PROC" N( Z% T$ g3 {4 `2 [* B0 A5 z! R' r
mov cl,al" p9 d$ l0 D. W: v2 h3 x/ _. A
iret( q3 h- ^5 j/ \- A
int41handler ENDP
p9 s5 m/ p8 ^+ m7 h) @& j# y( j' U: h: p
4 W! K, z3 S+ [ xor ax,ax
/ K, q; S4 Z6 l* W mov es,ax# Q- T. Z% Z- { a3 R
mov bx, cs/ n( U; { z# C/ M/ \
lea dx, int41handler
6 k0 B$ N' M6 K xchg dx, es:[41h*4]5 a1 j Y" W5 A" i: b9 h, R: S+ u e
xchg bx, es:[41h*4+2]
+ }6 ]: A! ?5 ~6 |. J in al, 40h
5 }2 d' T z o" n/ I" y) O xor cx,cx
4 `! t/ N; f: r9 Q$ s/ [ int 41h
) o- N/ W" F$ o xchg dx, es:[41h*4]0 p# Q3 h; m2 O3 U3 c& ?# K
xchg bx, es:[41h*4+2]
, b& e* z) }3 i; I6 \ cmp cl,al
+ p. h8 y0 c. h$ p( o5 | jnz SoftICE_detected$ X2 r C; r8 V4 x5 ~& E
6 j& J8 g3 W, W# ?
_________________________________________________________________________
/ l- F5 x8 P. e6 W1 y$ [! l
$ t1 J& ~; Q! BMethod 076 e3 m7 ?1 Z: e" k; @( ]
=========
7 r3 v5 J6 d9 [% o5 s7 t6 R* q+ ?6 B7 G+ a2 v4 I1 a9 D% f3 M! _
Method of detection of the WinICE handler in the int68h (V86)" m) O* q/ o" d
* T6 G' f( r$ O9 r; `4 M mov ah,43h
b5 g" q3 n3 ` int 68h
+ a9 a7 |% H0 m+ l" a cmp ax,0F386h+ n$ D' v" e! y& D z& E
jz SoftICE_Detected1 U! C5 [; F0 K6 B# q$ U
, U# z) Z% N6 B9 n! B: ^
5 c8 ]9 _6 ^7 A- n=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- |/ ]; x0 t- W3 x/ X+ T/ f" V! L app like this:; ?- \% I! p! A, Z' {
8 [9 S# c6 j8 y BPX exec_int if ax==682 Z% u% X& G; G
(function called is located at byte ptr [ebp+1Dh] and client eip is
/ g. V# {, t0 x0 ]2 D' H4 ? located at [ebp+48h] for 32Bit apps)
3 c- z5 v. B0 {6 G+ h__________________________________________________________________________/ w; j) _3 d3 p7 } {1 G
, \$ T4 h! W Y) i
( P ]5 a0 j1 u$ H6 jMethod 08
; e* h4 l9 ^2 P+ t=========6 U+ A0 {: F* [* Y# T
$ W m# p/ [ O+ @& C3 C3 d
It is not a method of detection of SoftICE but a possibility to crash the, ?/ L4 i8 s# m- K, ]9 [3 o
system by intercepting int 01h and int 03h and redirecting them to another
4 t% E' t& i2 l6 V6 u$ R! proutine.) m! Y* Z2 e! |+ ^
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 F" p( y1 y, K! p3 g _to the new routine to execute (hangs computer...)
. Y7 c2 z/ P' z+ P5 \! H- z M& I- c4 C0 q# J" h+ P3 ^8 F
mov ah, 25h
0 R" z8 `$ M6 P8 A: N( c mov al, Int_Number (01h or 03h)- F6 F. a+ G& @6 d* j. }/ F$ X2 _1 [
mov dx, offset New_Int_Routine
- F0 b- _; d {( R* I( J: U int 21h
* @1 D' {3 n9 U$ \# E' o& v0 x3 O9 }" G3 Y6 G. I5 O
__________________________________________________________________________
2 ]$ @' m) k0 \$ p7 n* @
0 _" p4 Y. Q1 I1 M5 |Method 09
- A. {- o' x8 i* h* k0 X+ _=========3 c) U" P5 E8 G/ V; K- O4 O
- a2 u+ P9 n% S% ^: ?This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- E R$ U9 T* D4 U. y
performed in ring0 (VxD or a ring3 app using the VxdCall).
& o7 S l a( yThe Get_DDB service is used to determine whether or not a VxD is installed+ a$ ]: R4 [3 T, K" V/ T) N
for the specified device and returns a Device Description Block (in ecx) for
2 U; p; O6 P, A" Z9 S2 Dthat device if it is installed." U* p' f) J) \
7 d2 z4 T3 \) a' U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 L8 a6 o$ [. C3 ]0 z9 l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ C2 e b$ w- H' s4 |/ v VMMCall Get_DDB8 S5 T5 s5 S: F0 N3 T, u
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ g' D/ b* r$ t3 e7 f. X L+ Y* w
- Z+ p4 {: E) W1 } rNote as well that you can easily detect this method with SoftICE:
' t3 |& `( c7 v$ I4 c* B( j bpx Get_DDB if ax==0202 || ax==7a5fh. H' C+ Z2 k- B& S
v3 P2 U( R7 ^( w! L: B) J__________________________________________________________________________
2 i( J/ l- a: B
, Q" X1 f& k6 c- F# PMethod 10
" Q- `: ?4 v& P+ b( U: Z$ @5 `2 ~=========& e' A$ e9 E7 g( {) E& x
* I" ]8 _+ w2 O5 H( F=>Disable or clear breakpoints before using this feature. DO NOT trace with
' X% {( }+ L- k& r( ? SoftICE while the option is enable!!$ q- H1 \% o1 T7 Z4 s1 I
% f* C) s1 o+ i6 @( GThis trick is very efficient:( d6 S+ T6 X" a3 m) a! w
by checking the Debug Registers, you can detect if SoftICE is loaded
# d$ @1 U' u/ o# y1 x' s8 X(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" E+ X6 X% g5 t/ o, j: d- ?
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 T# ^; b1 a( |9 G; e: {3 X5 W
value (in ring0 only). Values can be manipulated and or changed as well
* a8 P' W! c: l& V(clearing BPMs for instance)$ O: H+ @9 {9 b) F
3 }$ }! C; {0 r, `: h$ `9 R
__________________________________________________________________________+ v! R& V# g- W) Q3 [1 F
+ c( } O( |4 a' e3 xMethod 11- Q! [$ t/ G6 s1 R/ M8 f) d. C
=========5 o% J. ]& ~; _. m
# C" D: ]+ {, @9 T" X( r5 C4 K
This method is most known as 'MeltICE' because it has been freely distributed: J( F& m" b/ x& F9 [
via www.winfiles.com. However it was first used by NuMega people to allow
1 I" C: K0 F+ C* h. \1 CSymbol Loader to check if SoftICE was active or not (the code is located. w% C! s# w1 D6 v, H8 X. F" S
inside nmtrans.dll).! S- b. S5 ]9 ?" ]7 K8 G9 m+ Y
/ f9 Z! Q% {6 C+ b$ w4 M
The way it works is very simple:
5 \, A% b; j$ P$ [. UIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 G3 C( {$ L3 ^0 O" g' O( d
WinNT) with the CreateFileA API.5 K* ~7 A- y/ q/ Z5 {4 K! ?
" K' m) v/ t7 e5 i- V7 v
Here is a sample (checking for 'SICE'):2 k: u+ i% _5 ]: C3 v4 Q e7 o0 g
$ c7 V. W4 i; ^/ U- ?* z- M, pBOOL IsSoftIce95Loaded()
' C. e$ Y! ]; r3 u8 N$ p+ ]{5 g) o1 u* H# A, v
HANDLE hFile;
& M7 \6 I' {+ d5 ` hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 U1 |$ ^4 g# g$ K5 k/ `
FILE_SHARE_READ | FILE_SHARE_WRITE,
* S" J0 m9 G& S3 F NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- c) E+ H9 ?: j2 V& h! O- B
if( hFile != INVALID_HANDLE_VALUE )& O7 Q$ @5 j! C f" E
{
; t1 _$ C- d1 r, d; K' A$ d' ]8 j CloseHandle(hFile);
5 L U2 Z% _4 j7 [8 O: e0 T return TRUE;2 I/ |& V8 R& T
}
2 Z5 L8 {7 J& p9 N( n3 d# z0 [4 F return FALSE;
+ H1 `. y/ `! k: c/ m# C}" s) R$ w7 @- K2 c
" v6 S* @0 \! h1 U3 \0 R5 V
Although this trick calls the CreateFileA function, don't even expect to be- ]. G9 M# F" H1 ?/ w1 j* n* _
able to intercept it by installing a IFS hook: it will not work, no way!
V+ Z- A9 }# |1 D( YIn fact, after the call to CreateFileA it will get through VWIN32 0x001F, t; z1 T0 F2 d$ u' X7 i, A
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ g9 K9 p2 D* c, Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" X) h; H! | M) o4 L, j5 i/ Ifield.
V, b! J2 h& {0 T2 jIn fact, its purpose is not to load/unload VxDs but only to send a
, \- c+ J+ B& T8 k: XW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- b: Q c! ^3 S* n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try, ^9 t4 K- H3 X( o$ z- k
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 G/ T$ g8 W6 F N/ Q. c, LIf the VxD is loaded, it will always clear eax and the Carry flag to allow6 c7 J: W' g7 \. H# Z
its handle to be opened and then, will be detected.
" Q( N3 Z; n( qYou can check that simply by hooking Winice.exe control proc entry point
4 w, e" G+ o7 [7 A4 h8 Zwhile running MeltICE.
' z ~5 X9 E; X6 x2 m. T+ R) I/ o
) v: ]1 e k- @0 X% G
2 j0 B9 r& K3 n. ~ 00401067: push 00402025 ; \\.\SICE
$ O& R2 F% W4 r9 f# i. x) B 0040106C: call CreateFileA
1 }( ]9 M0 S" [; e5 @! d* M' @+ |/ A0 X 00401071: cmp eax,-001
2 {7 \. V8 W* D+ N/ B2 O 00401074: je 004010917 ~) v# t2 G! K" C- k) ?8 s8 }8 G
; p) G7 x$ l, d5 e
, K2 v2 L' @8 x: p3 K/ F: LThere could be hundreds of BPX you could use to detect this trick.
! N' ^: l5 A8 A: \+ v-The most classical one is:
7 z# B, D: @' a0 y$ D1 ~9 M- Y# T BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||- J) K. R8 `# `! L2 H! Z1 u
*(esp->4+4)=='NTIC'. h9 X! V1 ?5 G7 {5 n
# z7 g7 |5 L+ Y) `: k+ v3 ~, ^9 |! f-The most exotic ones (could be very slooooow :-(
) u/ W4 u+ @) l* h' Z$ P/ a) t/ v" Y& T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; w @2 ^3 q$ l C
;will break 3 times :-(
, O" b/ B. {$ p1 F$ f* o- J9 M
! Y, Y( x' Q1 Y2 j K- z, T-or (a bit) faster: ' p4 y* M# M, c
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 t* p& Y; g, U: `2 ~+ J# `8 J
0 q5 g, n. n' I }# B4 \ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( _# s1 P8 e2 ~. y7 ? ;will break 3 times :-(
* G) d6 ?- Y5 W6 P' H6 ^3 k' z
1 j) W; L0 s8 j% W! N& z' [-Much faster:: ~6 c: z z3 a
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
& `, k$ |. E0 O {2 Z( x2 T' ]
/ L9 B% a5 k. Z4 E1 m; ]- f# ZNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
" B9 P, F8 |9 H5 _4 w3 ]2 rfunction to do the same job:
0 x7 N" Q/ P& P7 s
3 a2 y7 v# k- C9 Z push 00 ; OF_READ
( J* M3 e& z% p/ o mov eax,[00656634] ; '\\.\SICE',0
/ \ t) A( D; v: `* U* w push eax
" c& D) M; }4 N1 Z; ] call KERNEL32!_lopen
1 W( |3 G% y: ~* t! A5 H! y inc eax
6 _1 k) P' s# N5 l jnz 00650589 ; detected
2 V, P; z- J+ n) ]6 { push 00 ; OF_READ. W* O( n& k7 y6 G
mov eax,[00656638] ; '\\.\SICE'2 w. h7 \$ `# v% _& ^" V- P0 b
push eax
& }) _3 R T( ?; ` call KERNEL32!_lopen
+ @' f8 e. E4 E! E2 }' i% @ inc eax
2 Q; z% G5 z- }, p1 z; t( n jz 006505ae ; not detected$ d8 D- E; C z
^. I. f, j/ [4 ~# W& _' G
: |8 i# l0 W0 g7 U- T1 o/ D; z
__________________________________________________________________________- y8 T8 x* T, F0 x- @7 t7 Z
+ Q( w& Q$ |4 K# O, mMethod 127 t0 S; q8 u' N: Q/ C/ y" [
=========
" j' p! ^" S+ Q9 _
% h& z6 ]1 {0 t( N x" q' J3 }; }5 PThis trick is similar to int41h/4fh Debugger installation check (code 05+ P s# }* p1 q6 y [7 N$ W
& 06) but very limited because it's only available for Win95/98 (not NT)
! P/ C5 Z" {0 o" l! V% t+ x1 |as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
$ A1 ^5 d" C7 E# ]+ Q
8 l9 {8 Q Q2 o8 o push 0000004fh ; function 4fh6 Q7 s* R% J- R
push 002a002ah ; high word specifies which VxD (VWIN32)
2 d/ A3 o; K# ?3 [! B ; low word specifies which service
0 |$ G" l: ?5 c0 s1 e (VWIN32_Int41Dispatch)
. K5 L( r- \5 y! O4 O9 R call Kernel32!ORD_001 ; VxdCall
2 t0 J) ?6 Q# X cmp ax, 0f386h ; magic number returned by system debuggers
+ x( |1 f; s5 C ~( S7 t& k jz SoftICE_detected& W7 `; [, i4 O1 K. M$ ]$ l
8 Z6 z2 j$ n4 @+ g7 S `Here again, several ways to detect it:
' u1 B$ j5 N' v5 |0 t" Y( _; ^! f9 Q* U
BPINT 41 if ax==4f
" z6 X9 }2 \4 P- I1 N! z' s
" Q8 X* O) A) L7 l: g0 ~, o/ D BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' H8 Y8 j( n% K4 X! r# C& Z4 q6 j! \- U8 Y+ j2 B+ m: e0 R5 G
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% \8 f" t {8 I8 U, s
" x" c$ W+ w+ \; B) y# U: S$ C
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!7 J( E$ n. ?8 N% v$ T. L! L
# z, q# E" R( a! |% y/ x- U6 d6 w2 {
__________________________________________________________________________
; P9 o% f1 V* L; b/ U; Z+ z2 [4 Q$ l, }% C; h
Method 13
. S+ J! o! u$ t! j=========
3 e$ s# b* C. H6 B. H1 p/ p* L! J2 R5 {3 {* A: R R! `- E# K
Not a real method of detection, but a good way to know if SoftICE is5 n) `" ?8 y4 G' j
installed on a computer and to locate its installation directory.
2 A" r( X& N7 w2 y* j# A' M- j2 YIt is used by few softs which access the following registry keys (usually #2) :* C" F- z9 x8 ~# M* b2 ]3 l
4 j5 h7 g! S% T- k! Y9 n7 q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; ?) K/ p1 s( e! I9 F: ]
\Uninstall\SoftICE
! V! V; H" o! ~5 w0 b-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' C2 {+ Y% S( ~, f/ B1 t-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
^" K2 F [/ M' j( c\App Paths\Loader32.Exe
# A* b* t! }6 k
! }( {1 A* F" S5 G v1 b- e4 O6 [0 e. N8 \" r
Note that some nasty apps could then erase all files from SoftICE directory
. i: X& n- V9 Q9 s3 i i(I faced that once :-(' ~5 E& Y; X/ p$ E8 v
$ h6 J- u$ n; _: eUseful breakpoint to detect it:- L( E- S8 n/ |
7 M' R! w; ?2 B W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! J) R p( P$ v; f/ S3 t. Q. F/ j' Z5 x1 k% b# J' ~# b5 {, `( i
__________________________________________________________________________
; ^8 w$ V7 B" z b/ n$ @. c& U8 x/ I% _' S4 p- V3 Q5 V$ _/ v
' }* ~- s) r- |& E$ c. p7 AMethod 14
u; `* o& `& t( q4 X3 `% N=========
5 g) c, p6 @ q2 I7 K, |/ g) n, z0 @$ t4 h, ]- y
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 _* R G2 ^, t/ ^0 q0 q& x
is to determines whether a debugger is running on your system (ring0 only).' k3 x; o- d E1 ]1 q6 l+ }( V
. w( A3 s! U- [4 V8 M V. Q VMMCall Test_Debug_Installed1 e4 A) S4 I8 ?& S
je not_installed4 k# o$ _1 c( ]; H- a0 f& }7 W
+ _6 |$ A9 \) [& u4 O" g% RThis service just checks a flag.
& ^! g* |) j" r. s5 q1 D8 X</PRE></TD></TR></TBODY></TABLE> |