<TABLE width=500>; x+ O5 f" u9 ]+ O
<TBODY>: E# V- m3 e; C8 u% q8 n
<TR>7 d- J; x4 ~3 ?7 [: l/ ?7 T6 f
<TD><PRE>Method 01
5 X; k3 L! Y" S) M& ]# N2 z# _=========
& M6 D+ P/ V# u
8 I- j+ S. ?1 a& x9 ~This method of detection of SoftICE (as well as the following one) is
) f j8 f( k7 Rused by the majority of packers/encryptors found on Internet. O& _& V @; |4 H
It seeks the signature of BoundsChecker in SoftICE6 F( v3 l6 ?: T0 x0 {. k+ `
, ~/ [4 c& k' B" | mov ebp, 04243484Bh ; 'BCHK'
' v' R1 a7 z; O- ?! M& u mov ax, 04h
3 `- \+ ^" l$ ]/ F0 S. V0 }5 v m" D int 3
$ `$ |5 e- w. R cmp al,4( V5 \2 _3 r* p; o) W- [( r# }
jnz SoftICE_Detected' O* z4 m; I1 T0 y2 d
( Y8 N0 Q6 a' Y- G7 U
___________________________________________________________________________
* U( U, D: E9 }# v; W6 A
1 t) i! `* ?8 S7 w4 YMethod 02
/ q2 l8 N; v2 h" V=========1 ~! s4 j( k3 q4 e7 A% c
5 d! C- l$ y+ g0 S3 @Still a method very much used (perhaps the most frequent one). It is used
; ~+ P3 [ e- Y$ p; O0 T- Ato get SoftICE 'Back Door commands' which gives infos on Breakpoints,
i, ^+ B v+ x% e/ e; eor execute SoftICE commands...8 I, ~: x0 F' H3 L! i- [6 t/ Z/ @7 d
It is also used to crash SoftICE and to force it to execute any commands E0 ^, H5 R0 @8 T' d" ^# h0 i: v% e
(HBOOT...) :-((
4 n; g$ d: {. F I. W3 f7 b' `3 r9 C S( [0 b
Here is a quick description:3 A( J7 N, S. ]8 x2 X) Y" W
-AX = 0910h (Display string in SIce windows)9 S/ \. A/ c$ I# s: ]# _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
& g* t* P7 q% J' Z% v+ y-AX = 0912h (Get breakpoint infos). |+ Q8 P& n1 [) G2 P6 ^' _1 k
-AX = 0913h (Set Sice breakpoints)/ m5 r/ S! ^8 e6 @1 c
-AX = 0914h (Remove SIce breakoints)
9 J7 b2 {5 \0 C( V( U
; l5 F9 E' l, ~" @* B6 f) kEach time you'll meet this trick, you'll see:
. S Z' _0 {. W% Z1 \6 K# z& `9 G-SI = 4647h- q& u6 _' j9 W
-DI = 4A4Dh5 ]8 K% F8 s1 c% g
Which are the 'magic values' used by SoftIce.
b. E# G+ y' sFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.# g# a; o. P, Z/ i: c/ ?
8 I3 ^3 H0 {7 N4 ^$ n1 \3 n) L+ T
Here is one example from the file "Haspinst.exe" which is the dongle HASP8 B' |, I$ v: y2 Y1 z$ u$ \
Envelope utility use to protect DOS applications:! _4 x1 q- C: s$ D7 K* M1 L" n, p
4 B& a H, B( U' g! g
/ ~5 O) @: R4 \9 V9 ?8 w/ L4C19:0095 MOV AX,0911 ; execute command.
! J0 D* M) r6 \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 M9 x' g# _+ a+ N
4C19:009A MOV SI,4647 ; 1st magic value.
1 b0 q2 K! t1 B- X1 r4C19:009D MOV DI,4A4D ; 2nd magic value.
/ K& c% L" x8 y G' ]8 J4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 @: ]$ M% W' F( J( G+ G4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute( j# z! ~! M" ^
4C19:00A4 INC CX
, }0 N( U$ [ G$ Y4 v8 {1 ~4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 w; r* }" Z% |2 ~( N2 p( y1 t
4C19:00A8 JB 0095 ; 6 different commands.
9 ?$ L, l+ T, J1 T- F' ?- F: I6 d- h4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ n2 x. m5 f7 U( f0 O* S/ r2 z J2 O
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 y6 R; h2 I( [ m( D2 A! \4 x# c! H) f! l
The program will execute 6 different SIce commands located at ds:dx, which
7 A: W; p- l0 l, X! care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.+ S3 Q) ]* T! F2 \
# j' q, Y* N+ z) n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* o% i& i+ @7 P# ^___________________________________________________________________________
' t* v9 p! o( O7 H& v0 ~+ _5 L' W* O+ {5 o2 }% @
4 F% s N/ n; s: }/ M/ x Z# }7 ^
Method 03* n( k/ S$ i9 H/ e
=========
! k6 {: O6 W- o' l: d3 l- t# w" \+ J: V
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h0 k( e3 h5 T) u2 F9 f9 t* B
(API Get entry point). d; A& C3 e2 L7 A1 ?! }3 t
f ^# }/ f% x7 N7 G
; c' |. \2 }6 R* {
xor di,di' [7 d! X1 K" S5 N3 V7 j9 S
mov es,di
$ D. L4 `7 v. h- l* J* \3 r mov ax, 1684h r7 Q4 Z/ W3 D8 L \
mov bx, 0202h ; VxD ID of winice
J5 t5 m; i" U, H' D& N int 2Fh2 ]- K8 ]5 A! T8 k; P& W0 A
mov ax, es ; ES:DI -> VxD API entry point& U0 h6 L7 r3 u+ h2 a$ L
add ax, di9 A# s. b! [. h ^; ^8 W
test ax,ax
3 t0 C7 d5 E2 Z! ]. I+ C1 [ jnz SoftICE_Detected
r4 ^# @2 d5 e1 `8 {$ @- g/ m1 W% r0 w) h
___________________________________________________________________________9 I$ [' A5 ~0 b- v' ]3 g X- Z3 _" f
) D2 L" I) [# A! Q
Method 04) v/ H/ E4 O2 u2 l
=========
# E: l5 I- [% Y: w: k, a2 Y& t
% N) e$ m, D: h5 TMethod identical to the preceding one except that it seeks the ID of SoftICE/ U; }! D8 t# P0 p9 h
GFX VxD.
! D2 O; V# v3 _1 h' X8 b% D( l$ H, F4 a8 V+ t' ]4 u$ {/ E
xor di,di: w( t5 D W! r3 i3 \
mov es,di
$ T0 b, I7 d6 x) v3 a ` mov ax, 1684h
- r9 m# ~4 C8 P; f- ]2 `! O/ x( C6 [ mov bx, 7a5Fh ; VxD ID of SIWVID
/ a+ Z7 ~' c0 J$ W$ {- G int 2fh
# v; c- O, P3 z. H- Z/ w% q# N mov ax, es ; ES:DI -> VxD API entry point
/ Y4 U: h# `3 V2 E- | S: m5 y add ax, di, E$ W( t6 R/ ?- v' G- @* G% d& y
test ax,ax1 r3 Y. i% f. R
jnz SoftICE_Detected5 X; ]: Y. A6 g+ I6 k' N1 r0 t9 L
- H! W* m% t" r! [$ z0 z__________________________________________________________________________
9 y+ K; ^: N3 v/ }! F+ K ]9 I, d ^; [+ J3 k8 M
6 `: d8 c; ]+ S ?& d% x% ?" a3 DMethod 05
C7 C( c0 ~: f# u v=========9 c- V1 ~. P1 L
) b0 b" H+ E0 w( m) E6 u
Method seeking the 'magic number' 0F386h returned (in ax) by all system- h" t5 d2 n4 v+ k. _) Z7 G
debugger. It calls the int 41h, function 4Fh.
9 X r9 `; _5 ?: FThere are several alternatives. / c; G0 R0 @5 B' `3 C7 U* Y
, s0 w& H" @. c8 A* R6 o% J2 B
The following one is the simplest:, G2 G$ V% b7 ^4 `# r( |& y
1 G, c# k3 q4 T2 O% E" j
mov ax,4fh
, f- w+ I8 i5 r( l M! g( T4 c int 41h
2 K3 s7 B7 ^5 ]$ f9 x cmp ax, 0F386
- {3 ?( o) C; }$ G: g) p jz SoftICE_detected
2 W( C: T; K, ]/ h% ]! N
; J( F/ ?) F1 |, M! |& P. d0 P6 w: |' b& R$ x0 R8 c6 \8 I
Next method as well as the following one are 2 examples from Stone's $ t6 t5 i, b# J$ t
"stn-wid.zip" (www.cracking.net):
6 F* J( o, z. W$ @! e6 V8 N# t+ A" [
k# x' x/ {* l6 ?6 Q8 v5 r& N mov bx, cs4 h1 U% }! y# P0 q2 W& u: \
lea dx, int41handler20 [/ }$ ~. ^& n0 |
xchg dx, es:[41h*4]
U0 L: a4 G, D# v0 ~# p xchg bx, es:[41h*4+2]7 g. n& Q' B2 c2 Q/ e/ r" p
mov ax,4fh ^, h; ]2 x6 b4 Q* _9 j4 N
int 41h; \0 O$ O; x4 l. a
xchg dx, es:[41h*4]/ X" y7 v8 g! j
xchg bx, es:[41h*4+2]
! z( {8 V/ B) g" ^& i0 a# D cmp ax, 0f386h4 \9 w! j- J+ K" ^( a
jz SoftICE_detected
( s3 t/ h5 C7 X5 R- N) c& f6 i- x% a: m4 g9 U2 D2 K: D
int41handler2 PROC* H3 j" X3 ]8 N) B3 b
iret
" K9 l( \2 H( K) O, j m6 t0 Oint41handler2 ENDP% A# F3 L9 _: ]9 F3 P7 [
3 p: a4 _$ I* D. v3 t9 f6 O5 z+ N( x: ]) J
_________________________________________________________________________
7 q6 P3 @0 k# k. {
, j4 M3 ?9 D2 q* M9 E6 Z0 {: H) |: ^3 `8 H" B
Method 06
9 f0 Q' |4 {) {( h=========
' @! Q# r- N- j6 Y6 M" V8 ^' r
1 p# D6 @4 Y8 |, ?/ Q
8 s9 q3 V" i1 r2nd method similar to the preceding one but more difficult to detect:. i* o$ j- x A( S0 w0 f7 `
' U7 G) [6 C6 x, }1 j1 y/ w4 w: g" v! A |) T4 @1 @
int41handler PROC
. {+ u& A/ I+ Y- U3 f mov cl,al6 P, F& T% W' i% K! J3 v
iret" L. ~/ c! h& s$ ]* d
int41handler ENDP7 a0 Q. `5 X9 k1 M
( e* ?% r: v G- G) j7 T
+ X2 y2 s: P$ O: h" h( _ xor ax,ax# Q" E2 z8 a. K, L, v& e4 N5 I' C
mov es,ax
+ M2 Z; s5 l. | mov bx, cs
# }7 Q$ `" d( [: s: l# X( B$ F lea dx, int41handler: R7 K' H, c0 T6 @& u
xchg dx, es:[41h*4] R& l1 N8 U1 D% J
xchg bx, es:[41h*4+2]
0 \6 Q- a# L% @1 L+ x& m# p3 @ in al, 40h
( f7 y' a6 J, q2 k/ d xor cx,cx& M5 L) S o6 Q3 @
int 41h" |; s2 d9 ]9 Z) q6 K& l2 d* j* T
xchg dx, es:[41h*4]
' R1 B+ u% z5 A# C8 w9 c/ M xchg bx, es:[41h*4+2]9 i$ A8 K9 e) d( Z! T' T. k6 c" D
cmp cl,al M! [1 ~4 _: `- ^: Q% H
jnz SoftICE_detected
& K0 N/ s1 d# |8 T: Y0 Z( E6 l$ o ? U" g, p3 W4 B7 [
_________________________________________________________________________) _, U) b& m F0 ^
1 b J& O. B8 G" Z* RMethod 07" M3 S1 R, C. @7 v
=========
! g4 u1 b; {+ M, H, H
1 q' d. X/ B4 ?Method of detection of the WinICE handler in the int68h (V86)
! s6 U: @5 G+ r. U! E% \% A' J, ?' o4 R1 ?
mov ah,43h
: O; \7 z4 y7 R7 k2 `0 m/ c2 n& S int 68h
% ~4 E+ f: _/ v$ s. W% `# N cmp ax,0F386h3 a, I! T8 u6 c4 d
jz SoftICE_Detected
/ l1 s: k$ X9 K8 Z& G) j/ \7 c! B/ P- k+ ?3 x$ u
- s" T; H$ e! ?
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; g m" |& ]4 X+ |- \
app like this:8 A1 O8 U% ^1 G; x. X" t
3 o! X3 M: a s) K
BPX exec_int if ax==68: f, H# V& s$ n \# r) b9 L; g
(function called is located at byte ptr [ebp+1Dh] and client eip is
5 a7 x V; _" q' H& `8 x/ } located at [ebp+48h] for 32Bit apps)$ k. P+ x( n- u; e) ^7 \& k$ @2 K
__________________________________________________________________________
+ N$ N+ V/ {& A% h
4 ]6 _3 r9 H. V0 s/ ]* N. J
& H. u: Y* o- R$ f: E9 Z! dMethod 089 A" u0 Q+ M7 g* _$ G: {5 e
=========
, q! H$ s4 [4 i* J& l# f& W
. d' e( k: n! \( z0 {0 }It is not a method of detection of SoftICE but a possibility to crash the. s: ? ]! \5 d. I& I
system by intercepting int 01h and int 03h and redirecting them to another' J4 t. k* b+ ~# T1 \0 u! D
routine.) h7 ]$ i9 ]$ ~5 Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points( x/ J! A0 A' z. ?" l9 f
to the new routine to execute (hangs computer...), o8 o* v3 X5 ]5 {' K
' z, a: L' X9 a s. ~1 I% B
mov ah, 25h
% ?' u" \0 h) @ mov al, Int_Number (01h or 03h)* J& y) R( B' c6 U) |
mov dx, offset New_Int_Routine+ z% r9 @/ r; J) j2 \4 n
int 21h
3 {; O( m3 {1 F5 G' Q0 m9 r% T( T3 W: Z6 F0 V# l5 p% `* N+ T
__________________________________________________________________________
" p5 c+ s* Q' q7 D' Y/ \
* Z' x; f* w% dMethod 09
1 z) Q: R9 J0 M& G7 w" d=========5 n' w4 @* Z* }. f
# g4 Q0 W' o/ O
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ Q8 ?6 b h7 }; W
performed in ring0 (VxD or a ring3 app using the VxdCall).6 q) u# u# y6 ?& K
The Get_DDB service is used to determine whether or not a VxD is installed# W3 l/ P+ k/ G/ r( `) l
for the specified device and returns a Device Description Block (in ecx) for4 k+ B- p% K2 `5 X0 J7 G# V1 u
that device if it is installed./ L' M! L$ u" S; P, d
, T$ ~: I+ N0 ?7 j' J R mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
: s- \/ p: o. @: t4 P0 M mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& c* z) O9 L% i0 a VMMCall Get_DDB) S1 p7 j1 a/ }8 {9 y0 }1 e
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# C0 l. b+ T% o/ Q/ T O
( F% a1 S! c6 W" I' H/ y U* R. PNote as well that you can easily detect this method with SoftICE:
3 Q( c1 P1 C @) n4 W; w bpx Get_DDB if ax==0202 || ax==7a5fh
g+ w- w: L9 h/ i1 X% W
0 A8 G8 {- Q. Z5 O: |" P__________________________________________________________________________
) I$ a' e# u; `$ i8 e- y
: L3 p7 C- S) _Method 10' K/ `/ e3 O7 F) y# x& d, N. j
=========7 v( d2 n& V3 e, \# H9 {& j8 Y
! P# D/ T/ ~* V2 G
=>Disable or clear breakpoints before using this feature. DO NOT trace with% K2 H) t; m- |' L1 L% @/ Z
SoftICE while the option is enable!!' {6 U, Q) x6 }
% t# F8 O$ s$ F- x% [
This trick is very efficient:
# x* i$ q( a. A2 V; }! | [! Iby checking the Debug Registers, you can detect if SoftICE is loaded6 c- ?; z9 |1 Y9 L0 Z- l! ~9 i
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 U) ~) o* |. P# v$ Bthere are some memory breakpoints set (dr0 to dr3) simply by reading their: n5 {' }% s2 y- ~/ h
value (in ring0 only). Values can be manipulated and or changed as well
) d3 w% ]5 F" r! S(clearing BPMs for instance): Y7 W- |0 L* @6 u' E1 Y/ n' ~+ e
4 h4 }+ h5 o& I0 U% r
__________________________________________________________________________5 r6 `1 e7 Z4 W
J" ?0 T6 i0 ?Method 11
0 ~& N3 r! X7 K1 `$ K; u=========) \* v* O) ^: h6 n
. z& d0 T2 g( X3 E: ?, `
This method is most known as 'MeltICE' because it has been freely distributed
9 P. K: N: q& c- ^- w3 |1 M5 {via www.winfiles.com. However it was first used by NuMega people to allow
$ i6 a7 c( e/ E5 Z! e) A) rSymbol Loader to check if SoftICE was active or not (the code is located
. M8 [3 Y8 {. @: v. @1 S* qinside nmtrans.dll).7 A" Y) H, i- r) m
( c# B" P4 P$ z: N/ _. TThe way it works is very simple:
4 y: ~7 Q3 \, M# X/ U- ]3 A jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; Z% o5 z( I- r" s. o
WinNT) with the CreateFileA API.5 c7 |2 J- R f- r6 l$ _
+ h6 l. ~$ A9 u, C4 Z3 i% f: b; {
Here is a sample (checking for 'SICE'):& B1 _4 k6 ~ \# V* T! f1 i7 V
/ H) G1 d4 b6 o) m, D+ f) _BOOL IsSoftIce95Loaded()
+ D! ~4 @# M5 R{
1 d0 ]; @( i- n6 [* [! u8 N M HANDLE hFile; 4 Q8 p6 Q# o; |/ `; k; `
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 b4 ?) o5 H; v( W- b: \( j* t( ^ FILE_SHARE_READ | FILE_SHARE_WRITE,% g# n0 O6 Y, ]" w" g
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; d' e5 S5 @4 V7 u
if( hFile != INVALID_HANDLE_VALUE )
# X/ ~$ z3 r2 c$ S7 W {6 m6 \, R3 U/ m% g4 w
CloseHandle(hFile);! N D0 |% Q& X) S- e
return TRUE;! u% S3 d9 {( C6 G% F$ |0 r% l0 P
}% O3 n F$ v$ N7 [) Q) j
return FALSE;
: B2 J8 N5 c2 {& u7 t( W6 B2 U& x}
' a! c: O5 |' {# z, r0 l3 N( D6 t2 h# ~9 s: W! `$ ^
Although this trick calls the CreateFileA function, don't even expect to be
5 V: d+ D' J# i5 H$ V" G5 v' F2 r1 e( zable to intercept it by installing a IFS hook: it will not work, no way!7 @7 z& k8 Z& ]8 m8 D" m
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
! E/ K( z6 T: m% }9 m7 Uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 F1 ]# _9 v* W8 }9 Gand then browse the DDB list until it find the VxD and its DDB_Control_Proc" w/ x6 J+ ?, ^* ~' I. {
field.& v/ A: k" W: r. b; Y
In fact, its purpose is not to load/unload VxDs but only to send a & Q: |0 r6 j- R, _
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 I0 D" l8 S, R' qto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 }* y8 x8 L/ O/ c( bto load/unload a non-dynamically loadable driver such as SoftICE ;-).
: E! |! b' K, i9 d% M# ?0 CIf the VxD is loaded, it will always clear eax and the Carry flag to allow
% |% e% d7 \& oits handle to be opened and then, will be detected.
{$ {8 S6 K! c7 V$ d s: \. bYou can check that simply by hooking Winice.exe control proc entry point
. J5 t4 d1 R/ C# {& t6 W$ b# Hwhile running MeltICE.0 d! Z; X" r( q4 O; {8 g) ]
* `& R7 l7 E! L, }' C# h/ @# }. q- K
00401067: push 00402025 ; \\.\SICE& J" f& z6 G4 q) r# o* q
0040106C: call CreateFileA- E0 \; p l- b" \+ w' J2 ]
00401071: cmp eax,-001
; e" S! K9 ~9 d- K5 u) ]5 ` 00401074: je 00401091; d. \$ j$ x1 E# _! F" w8 d
. E( g% ^/ x7 S
& b8 v, u! F0 E% z( [$ DThere could be hundreds of BPX you could use to detect this trick.9 H) ~6 p4 W2 b; G5 H1 a$ K, J. @
-The most classical one is:
( ]2 h, g7 N" l) g( S BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||/ C: ?) D4 z! ~" j0 _. H/ ]6 l
*(esp->4+4)=='NTIC'
+ H+ l j6 m3 ` T. H. p5 h- v/ J+ O$ Y6 ~: c; G$ g9 N$ o0 H
-The most exotic ones (could be very slooooow :-(
1 p H, j& q0 Q/ z1 @* D- ?: Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 ~$ ` j: I' D5 N# M* t" O
;will break 3 times :-(
+ I1 o6 W1 A4 {1 j
* |- X: s4 p. S4 E2 W-or (a bit) faster: ) Q# M# f$ J; T, N5 x
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! e. ^: K7 c9 R: g N8 s/ D5 q, Q; O0 g ~8 J
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ h: I- Q: N' \; t$ N ;will break 3 times :-(' m0 S' R5 f! V' U
0 |# ]4 x* `5 N. G3 S-Much faster:
) j' H- y6 @- _' X3 N. f BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 |8 _0 `: c* @6 Z/ q) @+ P+ M# g3 K. x. c1 ^7 z7 e+ {) r
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
1 g6 G# U7 f: k8 \$ Nfunction to do the same job:: T' F" p7 ~( }( N. ~0 L! Q
2 |+ s& {* l9 F2 {% n! a2 g8 o
push 00 ; OF_READ" w0 m& e7 y. S2 ?8 q
mov eax,[00656634] ; '\\.\SICE',0$ A! d ?" d c( y! V4 j
push eax
3 u0 C% P3 d" y/ l% F call KERNEL32!_lopen
& ~5 A6 i, T7 M: ?) a* q; L! E inc eax1 q; j/ K% ]6 X Z/ h& }, ^
jnz 00650589 ; detected
7 A3 `% a7 V& A% a) v push 00 ; OF_READ
& ^$ v5 A# J/ S4 ]& I3 o mov eax,[00656638] ; '\\.\SICE'" M, R. M# O+ }
push eax
" t: l6 B& z% w5 u+ H4 Q" [* J1 v call KERNEL32!_lopen+ z- W7 G- V6 s
inc eax+ E$ V4 A2 k" y% w' i. f6 X
jz 006505ae ; not detected
8 D% D- f+ k2 ~. k
1 u" V, O, F. V4 g0 S* p% a! o8 f1 r t
__________________________________________________________________________
6 l; F' ^ w1 [" n* K$ T! I. v0 t. s T3 W
Method 12; E6 i, z1 p$ D5 Q S
=========/ a) l5 ^8 O) i* H5 t
! v8 x3 J8 A9 V cThis trick is similar to int41h/4fh Debugger installation check (code 05
. y9 M8 n) ^. X& 06) but very limited because it's only available for Win95/98 (not NT)
$ O1 G! F8 f9 t+ z& @/ L* H4 `9 p1 qas it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 S8 n' l! [2 D
/ D" z5 |5 {7 Z, I
push 0000004fh ; function 4fh
. L* L" l y1 ]& O: X push 002a002ah ; high word specifies which VxD (VWIN32)
. Q) r' ~! P- x3 r$ Y) L) n ; low word specifies which service
5 V# q* e5 b# S (VWIN32_Int41Dispatch)
, p+ h; b+ E6 t% i call Kernel32!ORD_001 ; VxdCall" Y) h9 o' R2 v; ~
cmp ax, 0f386h ; magic number returned by system debuggers
9 l: Q2 [- i7 g3 |' `1 j3 c jz SoftICE_detected
/ b# V4 ]/ b- F1 K
/ i) i0 e/ _' m6 |1 s# RHere again, several ways to detect it:
; o& ]/ S# V* n& W8 F( x
% r2 q( S% h9 v3 z BPINT 41 if ax==4f$ U. [. }. y8 G/ c9 C: m& ]
4 s8 o1 t- ?0 ?/ ~ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
. l& |! h% i8 `. U) E- l
& G$ R& X4 O1 m' w8 ` BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A# h3 [/ Z" [* w/ Q5 D( s9 K
/ t3 q" m( j: V BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!- M7 J6 G. \. ]7 s' f
' f1 i; `+ I1 J& ^* e- O
__________________________________________________________________________# V5 l0 d4 M, H s) | R$ H
4 }9 x$ F6 |5 Z6 E: d3 G" z
Method 13
+ \* G1 N6 c* f; [7 F; a9 G=========3 a9 F- f$ \- s5 }3 T
: l' W2 a# C. v6 }* M$ x7 c3 g
Not a real method of detection, but a good way to know if SoftICE is! o: A0 D; u) ~& R0 N) z) A
installed on a computer and to locate its installation directory.4 z" G3 o, a# M( I1 U
It is used by few softs which access the following registry keys (usually #2) :' O) q) D% X+ e* s- ^
# x- ?, x& Z7 y2 [-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# Y1 _; {5 n K" I0 z6 b5 O
\Uninstall\SoftICE
/ h; S/ d% {+ z8 ~-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% C6 X# K8 b( z
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 t/ h4 m0 L/ Z6 G- U9 O0 K\App Paths\Loader32.Exe' K; }" r. I6 @* _( F3 u
7 C0 [" @ P3 h$ g! a& `1 u$ W- M: x# J$ W, x8 O% x% k3 C/ \& B6 R N
Note that some nasty apps could then erase all files from SoftICE directory
2 u& K/ \. K: o' S7 I9 G I(I faced that once :-(0 }2 K+ E7 k) n2 C7 |% A
* H6 H- \' S8 a( e+ }0 }6 v
Useful breakpoint to detect it:/ L6 [7 Y3 y; O9 u0 R: D
% ?! e% R" L) o4 Z/ ~' {% ?
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'2 O% i q5 h4 v Y A! o8 \
4 j! K7 d/ u* Z8 p; q& K3 a
__________________________________________________________________________
8 b- d6 f' H, Q9 k" w* w
' n% P6 N* G0 g: T/ T/ o |" R& E3 {: A; A
Method 14 & C. r; M% t4 }) {2 v6 i
=========5 H& t" s9 q* Z) A
" Y: C! g( U: H& ?8 z& O0 e: a
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: ^& ~; R% }- ~
is to determines whether a debugger is running on your system (ring0 only).
! j- Q& ^% u! ?0 p
: z) N* B! w* ^ VMMCall Test_Debug_Installed# w0 Q2 {- U+ G9 G
je not_installed
% i& m! o8 D' p. \/ L% Z. Z5 @1 m- b. r! m! M$ ^; ^, B* w. |. }
This service just checks a flag.- W# C9 d/ f% ? e% k5 e
</PRE></TD></TR></TBODY></TABLE> |