<TABLE width=500>9 ^6 f3 U0 Q: [& W
<TBODY>
2 R$ t0 j' y! i! L8 i3 |. C<TR>, H! A' c! k0 A( z
<TD><PRE>Method 01 ! F+ R4 K8 j! l6 H7 ?" }
=========( \3 R: ~& R) a$ z4 X1 X$ ?
2 ]& d! f% _" N
This method of detection of SoftICE (as well as the following one) is
$ b9 k+ v, S7 fused by the majority of packers/encryptors found on Internet.# ?1 z D- Q* v' V: X6 g
It seeks the signature of BoundsChecker in SoftICE/ a" ?( c4 L- Q( i. _# \2 x
9 A4 S& d* ?. U% b* T1 B* ?; c- G
mov ebp, 04243484Bh ; 'BCHK'7 |8 v+ [% Y* \# W0 Y
mov ax, 04h
! o/ b) }/ T0 _; u l. V( T/ u9 _ int 3 7 r' p1 r9 ?: x& n
cmp al,4
9 k6 ?5 t8 |3 Y @/ Y' R# m$ @ f jnz SoftICE_Detected6 t `) O. \# s F3 o" v& m# D
+ T$ U7 R, V5 {- Z7 F( \1 L
___________________________________________________________________________7 V) y+ e s5 A; e8 D9 d T
8 P+ V$ s* K5 I7 j
Method 02
( D7 R( N) N3 L1 W7 R# |=========
3 l$ _) F# G* r# h8 ^& E" ?$ k0 L# S* }) N8 | `
Still a method very much used (perhaps the most frequent one). It is used
) b3 L2 _7 J* v1 A" u3 K7 kto get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 ~. k2 K2 U0 ~; i7 K0 Y
or execute SoftICE commands...$ M3 G8 R/ N8 D
It is also used to crash SoftICE and to force it to execute any commands7 y3 f7 A X. I
(HBOOT...) :-(( 6 w# V; }4 p/ ~) e, N- j9 e! N
6 V# i" D( W7 ?. E _* {$ N, }2 CHere is a quick description:
- I8 o7 ~% O6 `9 d4 k) \! F) [5 T) p-AX = 0910h (Display string in SIce windows)7 r7 Z5 z) l" I7 [. \& M$ N8 ^0 h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 b) t$ n+ F6 z- _$ |1 t-AX = 0912h (Get breakpoint infos)
2 m2 U* a# y+ k, N2 K( z7 Q# M* ^-AX = 0913h (Set Sice breakpoints)# o. h& h; s, h0 U5 ]
-AX = 0914h (Remove SIce breakoints)! d7 y; }4 I4 |# M6 E! k0 T) k
$ p. ~/ C% U" l( i3 i$ c" ?
Each time you'll meet this trick, you'll see:
2 s* S+ ]1 N3 _0 @4 G% v-SI = 4647h
$ @+ O8 B$ z+ J6 e! r0 [4 P" a, i& o-DI = 4A4Dh
3 a8 ?% i) i, B- @+ jWhich are the 'magic values' used by SoftIce.
2 ?- J! l. b; R# F* a3 cFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 a4 \" ^7 e! K7 I" A1 s9 Y/ l0 L: f% U2 r, j3 w
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 E- V" I2 k/ W |Envelope utility use to protect DOS applications:
/ E! |) f& N4 D# u$ g, N- O$ U+ L! |3 D( n+ V, \
$ n, A6 k3 T* K% g2 G4C19:0095 MOV AX,0911 ; execute command.# _# ?7 C+ M ?. ?
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 Y% |$ v) T3 b6 X5 F7 r* J
4C19:009A MOV SI,4647 ; 1st magic value.
9 N7 P E0 d' x* w6 D8 [4C19:009D MOV DI,4A4D ; 2nd magic value.
! |/ B, J: P" C, [4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# O/ @5 M) I. R3 i) G4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- Y3 K- B' P+ D3 J' G$ C2 R5 e4C19:00A4 INC CX
1 F: n% P" ~3 h4C19:00A5 CMP CX,06 ; Repeat 6 times to execute* ]' T* Q7 h5 J( c2 O
4C19:00A8 JB 0095 ; 6 different commands.& U' w9 C5 b$ z5 P3 k2 {
4C19:00AA JMP 0002 ; Bad_Guy jmp back.. K9 m! f2 H3 y7 B' e
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, Q2 C# ~( |* N g& T) H" u9 i
& l2 E) v9 g" T' \ [: b1 \The program will execute 6 different SIce commands located at ds:dx, which7 I% t+ Y$ x- _; d
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* K8 j3 ?* G. @4 Y& E* s1 \2 e4 J, g- Z6 a. v
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 x4 t& ~5 g7 D+ p) Q___________________________________________________________________________7 U2 C$ q9 C$ z3 E- f" x w8 }
- `$ q+ M. y& p: e, C% C- U( w# z
' ]. g$ d2 ?% Y9 v* L6 j% JMethod 03
+ i' H) ~" H7 r( d7 R=========
`/ o. i/ _7 `# c; A/ e- h5 G( [, Y9 V @4 T8 E. i% e1 S: e
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' r% O6 q# y, p6 J: B5 j: ]2 g(API Get entry point)
( ^& d8 D# s' Y O8 Q7 Z# \* y3 f
; ~( p! P; @% X. o+ K8 a8 e5 _2 f2 Q
xor di,di
* r6 L/ Q" c3 w' L5 \ mov es,di
( f2 \1 h* I, W4 t: `7 g6 [ ] mov ax, 1684h # B/ @# n1 ~/ N
mov bx, 0202h ; VxD ID of winice
& M' _" z, g" K2 j+ Y; v; I int 2Fh, D( ^$ Z9 e) Y5 W! T9 S9 t
mov ax, es ; ES:DI -> VxD API entry point2 h( d/ @4 F; N& u: [* i& r
add ax, di
$ _1 F2 V: l6 L$ P, N+ I; h- n test ax,ax
) j4 O2 X! T! y' | jnz SoftICE_Detected" m( b% x& D8 a6 Q( g
' R( Y4 |- k8 Q
___________________________________________________________________________
$ Z% B2 j4 \; ^6 c' Q
: h% y4 n$ _* t6 K( D. L8 l2 H9 w1 \Method 04! w! B6 m( `' {( T2 e( T
=========
# Z* \9 U( ]5 {0 l8 a& R: a
* ?$ j- t6 L3 T( _- Q" m& J; W5 S* d6 DMethod identical to the preceding one except that it seeks the ID of SoftICE0 M3 o' ? Q9 @+ s; O+ b
GFX VxD.7 L2 }/ R7 p3 T
! Z( E. q, }- ^9 V xor di,di' S: d4 c6 O+ h5 q# z. m
mov es,di+ a! e3 z4 J8 ^- ^5 R
mov ax, 1684h ) L: l0 x6 B9 s* i
mov bx, 7a5Fh ; VxD ID of SIWVID
8 @0 c* ?1 J! Y' D- Q! @( G( Q2 i( A int 2fh5 z) i# o" v8 m$ c5 W# z' a
mov ax, es ; ES:DI -> VxD API entry point
( s! C8 q2 u0 G( ~1 Q5 H9 H add ax, di
. ^( a9 ?1 k$ q! x9 d test ax,ax
! L( K7 J/ F I$ L) a jnz SoftICE_Detected
% `/ M: S& G) d( P! s
( ^* h+ S, [: f! A7 ]/ g& w__________________________________________________________________________
- ~2 ?/ W, f4 d- Y9 \+ |9 `. S+ s) h( ]' Q% D$ L) ]# R x
* n2 v7 K/ H: e0 ^( Z& F
Method 05
) S2 |% c) |& B' x6 d o" { `9 ?=========! u/ ]. O" G5 U& n9 ^2 \
& f) t* l, |6 _8 G3 I9 g7 g
Method seeking the 'magic number' 0F386h returned (in ax) by all system- O$ o. k. ]& R4 \7 v' F9 e
debugger. It calls the int 41h, function 4Fh.9 J" Y% l$ H' K" l9 f
There are several alternatives.
1 X, p* i8 ~2 L: B' R4 Q# o8 I1 a) `
The following one is the simplest:) X# f6 f: ^/ J/ H
7 D: k( ^0 `$ I/ N% [+ X% t. L5 D
mov ax,4fh
8 R d# J3 {1 a3 K int 41h9 ^( {8 N. N% M) v0 j, b8 p
cmp ax, 0F386. [2 l2 G8 o5 u( g+ l
jz SoftICE_detected3 d$ ]3 u! o9 [4 w7 h2 w# b
0 v+ W: T0 D7 N! [7 k4 o3 s3 j
[, P6 T! _3 H$ [Next method as well as the following one are 2 examples from Stone's
4 t5 l" J* Q7 H$ j"stn-wid.zip" (www.cracking.net):
1 b( Q! N, R8 e: ]" G- F( P* V
7 f# d" {8 x8 S: P" k0 E- [8 \4 i mov bx, cs
- S. r2 e& W$ a1 p; y lea dx, int41handler2
2 ?1 _5 M4 b& j+ X* |: S$ y# O xchg dx, es:[41h*4]
1 C- E8 E1 M, S; i V- u0 G7 G xchg bx, es:[41h*4+2]1 _5 Y% ^# A5 J3 n& V4 j9 I9 h
mov ax,4fh
& a6 M$ _4 K/ P int 41h
d% L* |: E' w# h+ V3 Q: P& ? xchg dx, es:[41h*4]: {# R, W, S" z2 g, ~5 E! E
xchg bx, es:[41h*4+2]
8 W) y3 s9 a. j1 e2 z* U cmp ax, 0f386h
# o: z6 b5 s9 V* r h# _; p4 | jz SoftICE_detected
. O3 d8 {* T/ b, a( H: x: u% f' q$ b* Y- q* f! w6 l
int41handler2 PROC
1 Q2 _ ?4 i/ j' F" F iret
! m7 ]$ I, _4 P$ G6 R( p% Q% sint41handler2 ENDP
, s5 A2 ^, k& U- p) ]# p
$ h- v2 @9 `( `" N7 g6 o4 M# ?" H5 z# C6 b1 Y9 ]
_________________________________________________________________________. r$ ]# S* }# C/ Q5 y" E
& S1 b3 Z) n# n
4 S- E* G9 a- X$ I, T% z7 v4 u0 N
Method 06! q3 |, e/ S2 I* |( d
=========% C. B+ ?& f" c" R( R5 n) B
/ b0 h/ v. `0 Q1 R y
* R4 J% W$ _+ o# K/ n' p
2nd method similar to the preceding one but more difficult to detect:8 e1 G" O* Z' D' t% W6 l
5 C5 B, i$ ~3 _" B$ m/ ?7 u
6 [- F& j$ n( ?" l+ y3 v! B
int41handler PROC) a7 k$ x: }4 }* I0 i) E* K
mov cl,al6 a0 k. o# `2 \# {' Y6 W0 {7 q2 E
iret+ O" u+ V) q9 b" P& q" T
int41handler ENDP# t) u! ?7 L* I7 b
0 }5 [1 i3 k3 K" `
$ Y( A7 B `# O( |" P+ ^7 V4 G- N xor ax,ax& S N$ f0 g4 {+ X" Y9 a3 z
mov es,ax& P0 }' E, Y) ^3 f
mov bx, cs
% C8 m7 F2 p/ I6 w5 v& j! ] lea dx, int41handler
6 }3 c3 f( O+ M9 J3 a$ j1 }+ ] xchg dx, es:[41h*4]4 y- B" w Y. }
xchg bx, es:[41h*4+2]7 n6 `! w) J: V2 H9 C3 {
in al, 40h% a- M2 M2 `. y# U% B0 Z+ s$ Q* F
xor cx,cx; g H& y/ R4 u* j# W* C h
int 41h
% P5 @+ o2 C r2 D+ r/ ?0 \ xchg dx, es:[41h*4]
; I% ^, V( l: v+ c% U xchg bx, es:[41h*4+2]
+ k+ w. E0 Z% U2 E8 w) ?5 y' H6 p cmp cl,al9 f% [+ ?% e" ?+ ?$ y- `2 g
jnz SoftICE_detected1 _! w* i( Z, J* }$ j% V& {0 n) y, o
* ^. m( v. I5 ~
_________________________________________________________________________. U0 A' F0 S* A$ |2 V
/ J7 U2 y) F6 @( _Method 07
% W6 `8 B3 n4 L- n# o=========
1 s- W( h) D7 i. c8 F( Z, W$ ~. m) c( W% w% k8 A- Y
Method of detection of the WinICE handler in the int68h (V86)6 r- Z4 P8 t, u5 J2 {" W
, }/ B$ [! Y7 I9 H mov ah,43h4 Y; h& [, ~* z5 X5 O' x% D5 k3 O
int 68h
( f, E! T% d0 f2 X/ L$ P- k( t cmp ax,0F386h0 e1 A9 q4 h/ e/ \. L% }5 q
jz SoftICE_Detected
2 Z: `4 `# C6 o9 |6 h' n2 A- Q% t" Z5 o" [5 ?: n7 d
G2 E1 a5 X. ]8 ] C
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 ~! N" [& t1 S
app like this:6 m. F$ D( a! x
8 A8 g$ i) z% @" O+ \7 S9 P6 D BPX exec_int if ax==68
8 W0 O. P$ s3 v1 y (function called is located at byte ptr [ebp+1Dh] and client eip is
4 b, Y: r5 [) e v located at [ebp+48h] for 32Bit apps)
* ~1 R4 U: J3 H__________________________________________________________________________
5 G9 v/ @& v, p6 K5 c
( j2 F- H, U/ r( ?( E) ~! e9 O4 u4 L$ z9 u) [9 i
Method 08
/ f$ u; j5 L$ R# w- `=========4 h4 I9 X( T' Z7 V/ ^$ v; N
7 x: I; v* V0 N- z- X
It is not a method of detection of SoftICE but a possibility to crash the: X) M1 P! o: W5 s9 P1 Z
system by intercepting int 01h and int 03h and redirecting them to another
* R9 L) e; S5 Hroutine.
+ j+ U4 N. U1 [! k8 I5 d9 l b; t+ {It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
) s/ K: c4 s) Q+ Q2 s) e0 K( zto the new routine to execute (hangs computer...)
1 H0 e& o1 ?0 j p) P% e$ o& \* E1 v2 K
mov ah, 25h
# z8 R7 t1 R9 S; B mov al, Int_Number (01h or 03h)) I( u( v* y% m* ]9 P
mov dx, offset New_Int_Routine
2 S( m0 S# k. Z& w int 21h' Z7 c- b0 G$ x. i# B0 V: G
$ P; Z3 D3 J; k__________________________________________________________________________! D2 \/ c5 p* N3 D- o6 a# Y' j9 J
9 j2 h; v! N6 z* GMethod 09$ ?& N% i8 u9 l0 N) r& a: ^: Z
=========
" w6 Y+ X7 K1 c8 y( u+ ?3 {! x: t! w. v! v2 m8 ~. j
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; j" N( R% ^0 G8 Yperformed in ring0 (VxD or a ring3 app using the VxdCall).
. g2 k4 m0 [4 o9 N( g1 c; dThe Get_DDB service is used to determine whether or not a VxD is installed
, i2 o) u! j; I, b* lfor the specified device and returns a Device Description Block (in ecx) for
) N! w: _+ g8 y7 ?8 g; G) Ethat device if it is installed.8 f4 _8 s: a2 c
; E4 g: J! @1 G( h" m! l1 _
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' `% M8 [4 y' j
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
) H6 g" X- K; [1 A$ Q1 I- e% A& R VMMCall Get_DDB
- ]& B" P' X# \( B# M mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& f/ B/ W, G" [
# I( d" p0 [3 ] |# ~+ m8 HNote as well that you can easily detect this method with SoftICE:( B' r* U/ ], y H
bpx Get_DDB if ax==0202 || ax==7a5fh& l$ i/ o. D+ S% a1 u n( T( J
8 Q3 a: l6 U3 n3 X3 n9 Q; i( @__________________________________________________________________________
8 |" }3 H9 L: H1 o, K. Y' a" x" E4 k; _' Q1 |+ T+ P3 u
Method 10
# B. F" |) L/ A6 y=========
! G5 T5 u/ }5 `1 d
; c4 U q* z: H& Q+ B3 _9 K# O=>Disable or clear breakpoints before using this feature. DO NOT trace with
1 n, \* V4 Y. c/ x9 l( X' _( f SoftICE while the option is enable!!2 F6 m% J0 l% i. G0 C0 \6 w* O" I
4 b5 E: G& j% Z# X+ F* e9 K
This trick is very efficient:
: ^+ ~0 F% K, X5 J( vby checking the Debug Registers, you can detect if SoftICE is loaded
0 ` Y" }6 |) T" I(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 U* L- P4 o7 q9 b9 J- w
there are some memory breakpoints set (dr0 to dr3) simply by reading their/ V) r4 k0 X9 o1 L, y
value (in ring0 only). Values can be manipulated and or changed as well4 |( h) I* d9 J+ P
(clearing BPMs for instance)/ } B& h6 l3 x/ B2 @1 ~# h
7 ^: x" |. ~5 N( M
__________________________________________________________________________
9 u: X- O' q) B- J
; Z9 a. l7 b$ ]( x8 o% LMethod 11
/ p0 I! V4 z- v8 B i========= \; N/ P6 v' `! S' A4 O+ J
. r, O" f2 ?% k$ T, X$ a. {
This method is most known as 'MeltICE' because it has been freely distributed: c0 \; \+ ~$ P C: j1 U
via www.winfiles.com. However it was first used by NuMega people to allow
! z6 v3 t# h1 O# c- J+ p JSymbol Loader to check if SoftICE was active or not (the code is located0 C2 Z/ A5 d C0 B( F: ]
inside nmtrans.dll).
8 [/ V( T. D4 h; L7 ]# f9 @0 o V7 n# R
The way it works is very simple:1 V: D$ C- w! ]) j" H3 F* X# L
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ V# `! D6 @5 H6 @7 _. ]4 aWinNT) with the CreateFileA API.4 q. Q# P3 T1 G0 o3 I4 x
`; ^' A9 n# }' e2 XHere is a sample (checking for 'SICE'):- Z5 c/ y( R1 p j3 a0 N$ q
2 M! f# d2 `( }! M
BOOL IsSoftIce95Loaded()* p! E( l' e" _/ u$ s
{$ l$ h5 z9 p' m
HANDLE hFile;
2 G& D. t( V: y+ F- { hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* ` j, o$ K2 @ FILE_SHARE_READ | FILE_SHARE_WRITE,
3 ]! X" B( ` V. q0 d' U! F NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" Y' w) b; `: n! W7 x5 `
if( hFile != INVALID_HANDLE_VALUE )
: x8 L( n/ @5 ^- o- ]% ~ {- A X' R; v6 G& q+ [4 l0 ?
CloseHandle(hFile);
l# f" @' v# l, O0 j return TRUE;
# Z' h3 o3 U, e9 w- f5 r }
3 `0 J+ L' C4 w4 n. `6 } return FALSE;
8 B' y9 _: R- K8 W" S7 e}
. _, r+ F3 \1 X" E0 i8 E$ L; K! E0 N! Y8 A5 b v( d
Although this trick calls the CreateFileA function, don't even expect to be
# z7 \( R2 l yable to intercept it by installing a IFS hook: it will not work, no way!
9 ~5 M- B) I5 Y( j# AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ ]% Y5 K6 T1 k% A1 {9 w. {5 \service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: J9 [: J+ I! c1 Uand then browse the DDB list until it find the VxD and its DDB_Control_Proc
% V9 ` M' v$ Tfield.
6 w: U# [: {7 Y! _( A- N# q8 W2 uIn fact, its purpose is not to load/unload VxDs but only to send a 9 p: a. t0 Z$ D" x2 \( u+ Y
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)( c5 ]0 q$ r& f% w3 @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try; D3 q8 P& H) o
to load/unload a non-dynamically loadable driver such as SoftICE ;-).1 P' @ ]7 |2 Q0 ^1 f8 x
If the VxD is loaded, it will always clear eax and the Carry flag to allow |3 T* f: q! k$ w
its handle to be opened and then, will be detected.: `1 \4 Y6 A: d* P8 L$ A; h/ z5 Y
You can check that simply by hooking Winice.exe control proc entry point5 ~- r7 e7 z9 P3 C$ B% ]5 B$ U) K
while running MeltICE.
% |! _$ a3 Y6 N0 c" @2 }" h
" s- N+ m7 `5 y3 b/ Q9 @+ j5 v7 d7 f% b) [* ?/ [2 s1 d
00401067: push 00402025 ; \\.\SICE! d: z4 \$ Y& O$ q/ y
0040106C: call CreateFileA
- w" R6 ?1 A0 h. J5 k 00401071: cmp eax,-0018 ]5 b' }7 B1 r8 ^% @: s4 `
00401074: je 00401091; _# T: f V o: B1 t
. m/ _5 c6 y9 a+ w$ t" B3 ~! P; [# D
R/ |" E: z w0 W0 rThere could be hundreds of BPX you could use to detect this trick.
, W. Z* A n/ y-The most classical one is:
" X, W i3 h" N% N; x" s BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||! }' }" E M5 e( {7 b Y$ a% d
*(esp->4+4)=='NTIC'/ x% j7 p! j4 {7 Q# G
: p; ^: E+ R) D7 W1 B-The most exotic ones (could be very slooooow :-(/ f* o+ E* q" W. }4 ]
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
8 u8 o& l, f m3 G4 W ;will break 3 times :-(
2 @' O' |: [* W$ ]" l6 p
, c' Y8 Y6 x: |" P-or (a bit) faster: " U, O3 \$ p" O8 K8 e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 N; } E4 G6 {. r3 x% a" k- u3 C! N& A6 u* y
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 b/ Q9 J* d$ y3 v
;will break 3 times :-(
, {2 K$ Q0 P, d- e3 L. M8 _4 ^0 Q3 C" `1 D5 O
-Much faster:
! v! I8 y5 j# x BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ _; z# r Z; w' X
+ I+ d! }( D8 H& M# G- I9 A* D3 ~Note also that some programs (like AZPR3.00) use de old 16-bit _lopen* B/ U9 n: _! u. t8 o
function to do the same job:$ _7 @7 A7 R0 b( I& P6 d# c
: q" s% Y; V o$ Y push 00 ; OF_READ
, Y* k- [' }) n& g% _ Y/ J mov eax,[00656634] ; '\\.\SICE',0
' S/ Y( J$ Z& s& ?/ w1 k& x push eax4 p' h. z: B; j4 Q
call KERNEL32!_lopen
) o" Y# |) w( m0 o X' X inc eax7 W5 H% ^' w1 j5 ?3 d
jnz 00650589 ; detected
a) s. S- _; P1 Q push 00 ; OF_READ7 z7 S; u+ h: n7 ^8 q* w# r
mov eax,[00656638] ; '\\.\SICE'
( u% z* @$ U* V4 A* H6 |) ` ` push eax3 W2 H* d6 h! X5 F
call KERNEL32!_lopen0 t: Y# M+ ?( H0 E+ D" x
inc eax4 ?' s- e n( o8 h( u8 ]
jz 006505ae ; not detected
& l: c7 p I# |' {0 j9 ^1 E
v Q0 G% V( m+ s' N* S
' O1 T3 _3 M* p, u, p__________________________________________________________________________* J- O, e. b S4 b
4 V8 Y3 B( m A4 e0 wMethod 12
( v6 \' X, {; `# @=========
- Z1 z- [, L4 e+ D
- k+ u$ X- l \$ ]. HThis trick is similar to int41h/4fh Debugger installation check (code 05
* t2 }6 Y. \- j' U. s9 j& P& o% m& 06) but very limited because it's only available for Win95/98 (not NT)
5 L6 [! J# q+ i& y/ cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 y# i8 S0 _9 p+ {( F7 u6 J
; C( d- I7 v; s: N' H! Q( D push 0000004fh ; function 4fh
2 D1 K3 d: K+ @ push 002a002ah ; high word specifies which VxD (VWIN32)
5 u5 m/ a( b' i' T ; low word specifies which service9 J9 M# c* M7 ^6 C
(VWIN32_Int41Dispatch)! A- t4 v2 I# J6 Y+ z) O* |
call Kernel32!ORD_001 ; VxdCall
/ r$ B" t1 T' k% ?# \ ~) f0 n cmp ax, 0f386h ; magic number returned by system debuggers
5 g* q: Z' Q8 C3 s jz SoftICE_detected
% {" N" @; i9 b; @ ?( n
6 v& U3 q, ?. x. `Here again, several ways to detect it:
5 n0 ]0 `) r( b( x4 l% F% c0 i8 G- J/ z$ Q9 n0 Y
BPINT 41 if ax==4f8 I, v* g3 x- M6 K/ M" C: Y
& h# `: I2 ~3 a+ G, ^
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) t: j `# y* [* I& J- g4 E- [; j2 Y; M$ c- E
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A' o. `0 E' K/ v. d: n* ], A
- z8 ^; V9 j! H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
P1 W( t! z/ }$ p' I: U
' ?1 }7 s$ g7 G/ M# j+ g4 \* I4 m1 r__________________________________________________________________________, H4 X. ^4 ]/ I/ D2 L2 r: U! k, R
% F2 I- U1 ~( X% Y. u' R+ D' I
Method 13! r4 h6 }4 J6 D( l5 Y" Z% b
=========8 G' G+ q, |5 ^; ~) ?5 i
3 s D: d. a6 a; E/ |Not a real method of detection, but a good way to know if SoftICE is
* |7 S3 F B1 l8 Binstalled on a computer and to locate its installation directory.2 |3 S( C& Q8 [+ i8 z
It is used by few softs which access the following registry keys (usually #2) :! v9 z G$ V) q% g) s. s1 s
( k# l$ f+ k; q2 k8 f+ z7 d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. G; e: w5 M6 ]4 {9 A9 ~. l+ v% H
\Uninstall\SoftICE
) r" j) x0 [6 @) t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 W9 e, S" S( C7 o: n4 {-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ |" s6 M2 @* u; D- x/ E\App Paths\Loader32.Exe
9 I, t( r2 r' ?. ]) Y! r# Q# `# D: m' X. `' ]8 v. K5 |! v0 w
" u$ |* I1 l5 g9 W; C5 s. L0 i
Note that some nasty apps could then erase all files from SoftICE directory
7 G; D" Y- X$ u# [5 o* _7 i3 M' f(I faced that once :-(
& n- N, c# ?7 {6 @
2 E5 e; J6 Q2 P c$ \$ {Useful breakpoint to detect it:
/ ]+ U& @% N% t @; C) b5 a" M! b
. K& _* e1 E! [8 ` BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" }: Z2 H! r, z/ a. I! ]! V; M6 g* r
__________________________________________________________________________
. m, L/ Q1 H9 |& U+ @4 v; L+ D, r: Y0 E6 {1 F3 u$ w/ `( j/ w
* _4 C% O# ~1 yMethod 14
% H1 P+ @& J C6 @=========) @0 w, k9 o& m/ n. J7 G r
% c/ @: P. |7 V& BA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
8 N( t2 _6 r' i3 {& Sis to determines whether a debugger is running on your system (ring0 only).) q+ X. s- g7 T
/ F. i7 I1 r, c; K VMMCall Test_Debug_Installed! Z4 A, T+ ^' y* j y) X* G
je not_installed l! ]9 r% d' U. {/ E8 C
8 N# V. L7 h$ I& fThis service just checks a flag./ }! m* ^* j V: l2 p( ^( {
</PRE></TD></TR></TBODY></TABLE> |