<TABLE width=500>. f7 `6 j. Y B) v6 C( R
<TBODY>; M* |: A2 T5 H
<TR>
9 [# D1 j5 z$ o& u8 I8 s<TD><PRE>Method 01
4 ~( } \" p& L1 Y- H+ p1 R=========
! e$ } K. w: ]+ m( C C- [. d4 N' T6 X* a' Q" ~* Y, d
This method of detection of SoftICE (as well as the following one) is, x3 D! A( a# X4 E/ _7 ?& B
used by the majority of packers/encryptors found on Internet.
1 }2 U3 u0 B. y7 Q( [1 ?It seeks the signature of BoundsChecker in SoftICE
; J, F! m# d3 z+ c5 v* C& o
1 q6 z) I; u; ?: j# [0 e- V mov ebp, 04243484Bh ; 'BCHK'
! s4 A" [, b& P mov ax, 04h* f! Z" K1 f0 B) V) T/ g2 R
int 3 9 U# ^3 S) [2 r) M+ m. q# u
cmp al,40 z* C1 @- O" i6 I: O, F
jnz SoftICE_Detected
' s$ x! z+ P" G+ P
3 G' p( A9 l8 T0 ]9 m# }3 d4 W' j1 q6 e___________________________________________________________________________9 }. B' Q$ q* V6 L* n
. K$ J& ]/ ]9 ~( h! H3 A
Method 02
3 X) R' H. Q1 e1 m=========5 g% q2 n0 C- n
6 l6 o8 h" [# A7 P( m
Still a method very much used (perhaps the most frequent one). It is used8 X+ T& j7 r, Z. c; M
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 P$ v! R, A* k/ C$ ^$ o) Kor execute SoftICE commands...- h' _; J4 F- H, ^
It is also used to crash SoftICE and to force it to execute any commands
- m9 I* X& ]3 g) |0 Z(HBOOT...) :-((
3 F/ J; l" L7 h5 L2 Q# C* z0 W# @3 a
' S+ D1 y1 O" n# nHere is a quick description:% s& L" O+ E$ t: v
-AX = 0910h (Display string in SIce windows)
' Y$ U( |/ m# M, S. c; D-AX = 0911h (Execute SIce commands -command is displayed is ds:dx): Y2 I4 G6 ]/ B f" P0 K$ r4 {
-AX = 0912h (Get breakpoint infos)- s/ F3 _2 H( d8 B6 D% D
-AX = 0913h (Set Sice breakpoints)0 _5 k: C9 D% Y- h5 j2 v) e
-AX = 0914h (Remove SIce breakoints)$ W9 e' C0 L% c+ r" C0 k
" F. |3 k% `, E8 O+ U
Each time you'll meet this trick, you'll see:0 Y1 l c* f7 W! Z! x* U8 t
-SI = 4647h
" [& t- a* L* x! m) G7 s-DI = 4A4Dh6 A4 D, [$ }8 N7 [6 O' f, Z
Which are the 'magic values' used by SoftIce.5 s3 u2 A6 j' u
For more informations, see "Ralf Brown Interrupt list" chapter int 03h. x8 F! w& k. P7 J
% K7 J \( Y: F& e9 e4 O' f! w9 ?. X7 {
Here is one example from the file "Haspinst.exe" which is the dongle HASP3 q9 u0 v) q$ B) Y% H. ^1 r j1 B( D a
Envelope utility use to protect DOS applications:
3 Y& _+ x: m: I L, v0 T- q1 x* K' H6 h9 I. [
* A% f, ?; ?; Y6 g p5 v4C19:0095 MOV AX,0911 ; execute command.
+ U, Z# [& ?4 G& \- w/ l* V; a* |4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 w' ]- [$ U3 s/ v
4C19:009A MOV SI,4647 ; 1st magic value.
: z- U2 L5 v' O- a) Z' K4C19:009D MOV DI,4A4D ; 2nd magic value.
/ e" ]1 E* o9 t4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 k4 u( D2 |5 [0 U8 ] v3 r- |" ~$ ~4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% j/ k1 h7 V. ~4 B
4C19:00A4 INC CX
) ^$ A7 F& }$ @1 f4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- A* D* l7 w( \' h! S8 q/ h4C19:00A8 JB 0095 ; 6 different commands.7 ?; `8 N4 H/ R c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: T. M: M' A% ^ h" W8 K4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ s6 I5 W& p: \+ Z; d
" l' p. a P! [) }: ^8 GThe program will execute 6 different SIce commands located at ds:dx, which( X' u1 E0 ^# \( S) }$ `
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
; D7 T$ y0 {% a2 h0 T5 O) u V$ n' s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* D' N" ?& _( g9 f___________________________________________________________________________1 b1 D- m/ S l2 d I
9 y" a# }( ]6 M
3 k* N y5 j/ u0 i( rMethod 03
$ Y# i1 \% R, }, T, t=========' H# v; d$ M8 r
& d$ g: S& P7 d) [/ FLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& Z- _3 Y1 f% d n+ X) i4 p: |2 V, }
(API Get entry point)
" q7 T* y/ H5 T0 R f3 s9 j' b$ X; t$ `; o
* t5 m- h! w: v" D1 C% Y' v/ B0 N
xor di,di
0 K9 h7 B2 x" s$ V; s mov es,di! H# e8 a8 l0 G7 {( ^4 e2 g& Z/ i0 m
mov ax, 1684h
- o8 |- S% g& Z" r+ K2 k mov bx, 0202h ; VxD ID of winice
9 c4 \2 h& y/ `6 {6 ~+ J int 2Fh7 ~' w, _2 d* J4 N
mov ax, es ; ES:DI -> VxD API entry point- j+ z) u/ E: X6 d
add ax, di# }. U4 _5 e6 A" \
test ax,ax
1 i( a3 V0 u( Y: \' w0 \# S) z jnz SoftICE_Detected' \- |, V4 E6 ^
" c4 f; h, J- j" J4 R___________________________________________________________________________
: I- a7 n' `) R5 h8 t
* B* ]5 z0 m) q6 t6 N* wMethod 04
9 D5 J* ]( u$ ~3 X7 o=========% z$ r3 j: A9 D% N7 Q
6 m6 H, K& U. {( ]
Method identical to the preceding one except that it seeks the ID of SoftICE& |5 I' z" F* Q1 M0 z+ f
GFX VxD.) I) E+ I; I) W) k4 `2 o' w& B
! \' i( y" S: N9 c7 ?6 g
xor di,di! K/ M9 ]3 ~0 [# U! X) t( Z+ M1 y
mov es,di0 x2 |3 R2 B1 ]8 R6 q
mov ax, 1684h
( c4 d: x5 Y1 L% B mov bx, 7a5Fh ; VxD ID of SIWVID
2 [+ D5 f2 _4 C1 w* l( K; I int 2fh
9 Q1 n1 i9 i" P B% ? H/ C1 v mov ax, es ; ES:DI -> VxD API entry point
& ?: k% U) f5 n4 x add ax, di( I6 G' _8 Q) \/ c/ {
test ax,ax
- b% Y$ C9 F, [ jnz SoftICE_Detected
& l$ S' M5 I/ d {, h' {8 m. ?. x" m
__________________________________________________________________________& q- x9 A6 E5 e
7 l- _9 O# g. n1 X7 M/ b. `
% }% K* r6 E; u+ K5 R0 x. S+ x
Method 05( O( h6 n: ~. P/ ~& i4 d, f+ w6 ^
=========
# n: _* Z8 q: _
% j! O+ }; \' @Method seeking the 'magic number' 0F386h returned (in ax) by all system
, m2 K# ~' p, |! f% F# f; Edebugger. It calls the int 41h, function 4Fh.. q& P. ?! F1 N4 d0 u' F
There are several alternatives. ( O/ d q9 C$ P$ y/ R( n0 a# M
: w5 ^) {, o2 E" @The following one is the simplest:% |1 m( V4 S1 B& \9 y4 T; Q x/ C' W
3 W* p2 g6 B0 s: j* F! G
mov ax,4fh
6 A8 L2 {/ b* k! }0 f int 41h' o ?9 ]4 L. L8 I4 Y# V1 Y' N
cmp ax, 0F386
# W- {, M$ u6 \7 D jz SoftICE_detected( Y1 R) F R `: x: r/ N9 i9 `
# t% S8 A2 d) s
1 ?% ?8 \+ k& d% A; L7 z( {
Next method as well as the following one are 2 examples from Stone's ( d" I" O7 S | t( K2 `% K' O1 p
"stn-wid.zip" (www.cracking.net):. h3 Q, _) P6 C
^3 @' U# F& L
mov bx, cs8 v. U, c6 c5 P) I. [
lea dx, int41handler21 f2 s3 a# T0 l$ s, B
xchg dx, es:[41h*4]; s* ]" r7 j* j9 f9 T4 D: z4 I0 V2 ~+ [8 j
xchg bx, es:[41h*4+2]
3 ^: G) q: w4 \2 O2 q0 \" ?8 q mov ax,4fh6 H8 x+ x! Y6 a, Y. n& V4 l L
int 41h
- o. |; B4 m1 `8 Q$ K2 Z2 h xchg dx, es:[41h*4]4 M. W* O5 u1 ]2 Q9 ]8 k7 Q9 C) C8 U
xchg bx, es:[41h*4+2]
$ O D5 R6 N6 `+ ~4 I6 i6 ~# H3 C cmp ax, 0f386h
+ \' _ L2 `& d* f: V jz SoftICE_detected
2 ^$ s5 a7 o A; J- {9 A
) ]6 u& C$ i/ q8 A7 M/ c8 _int41handler2 PROC. h2 |. P9 a& _3 J3 g" L' e1 o- K
iret
7 h8 c, g1 S8 `# ]" H6 \; J0 cint41handler2 ENDP: i2 O( }% h z e8 M
7 e! D# j, N& C. I: E ], S+ {" v& M, t# j; o
_________________________________________________________________________
# G+ ?5 _# {2 @5 `
" H: [+ O2 P5 `& q* n/ Z0 B, H' d1 |3 C, S' N
Method 06
& ^4 \+ Y( _ i=========
) P: Z4 S8 B. A3 \) _ {3 r% w( U6 N4 z M- A
7 l% {" t+ M- Q# f8 W$ }
2nd method similar to the preceding one but more difficult to detect:
( O) r: {; O6 ]8 e4 {6 X8 s' L* Z3 S4 o" r$ ~
* N# y, J. X/ W" {+ i! f: T# E. b8 t" V
int41handler PROC% T1 [9 K" c: Z9 M1 c
mov cl,al8 V# |7 B5 j" w; Q' a
iret$ J. @6 `0 n# ?. T8 i0 g3 e
int41handler ENDP
# z! F3 S. c2 U2 F( I- |/ p; N n1 K! R( D. t
+ p, w6 ~5 S( p
xor ax,ax
0 k8 d# q) ?# F7 j1 k mov es,ax
$ u% d- A Y- j2 j. l mov bx, cs
9 `3 E' ?/ c4 {$ t1 |! ~/ t: T- P lea dx, int41handler& O- {+ S- ]6 q' {: D5 x9 e
xchg dx, es:[41h*4]
7 n1 S9 J' t* s3 w( p& \ xchg bx, es:[41h*4+2]4 `+ w) |# C1 |9 _3 [ a$ m
in al, 40h( r& X2 n7 c8 u4 N2 z' {* L' c
xor cx,cx( o# E) _! ]/ Z* M4 K, s0 u
int 41h
7 F$ m* N( O' m& k- S xchg dx, es:[41h*4]
. ?( N5 m3 K- ?6 Y& A xchg bx, es:[41h*4+2]' F( f( J# Q7 D/ }; D$ J8 h
cmp cl,al$ m/ B. J5 w. {+ \7 Z- E) z
jnz SoftICE_detected
. Y y6 s$ C2 B4 q/ q! u8 O
# l- M( X3 q1 E0 ^_________________________________________________________________________
- S* a& Y- R) q7 k
8 R4 G7 p# X; n! [6 g) ^% tMethod 073 Y5 `6 K4 o% Q% ?2 O
=========5 F6 U- ]0 K# T& V& q
5 u4 p8 q8 V5 K# y3 |# ~
Method of detection of the WinICE handler in the int68h (V86)
7 t% n& L7 V1 q* N( t3 B& x% [7 _: f0 k, Y& p* F
mov ah,43h
- ?% u$ {% e' i3 R2 D) X int 68h
% p9 ^9 }9 `& T0 A; X. D( o9 x cmp ax,0F386h
; t6 k0 d s5 {2 y; [1 r" r3 x jz SoftICE_Detected
z( g" C7 M! G; S: c. e9 k) {" P& n3 Y; E( ]2 r& M* ?3 s
9 ]/ M! h3 V. Z6 X=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
5 v v$ ^: i1 K/ E5 U. q app like this:. W+ V+ d' q% |
9 U) Z* v& _$ ~0 q. O
BPX exec_int if ax==68
0 m3 l% h; s2 W& L9 M. _+ L& C% E (function called is located at byte ptr [ebp+1Dh] and client eip is7 W2 b. U- B& W' @
located at [ebp+48h] for 32Bit apps)
) F9 b. q( |5 _3 r+ D' @__________________________________________________________________________
9 V1 L, }8 |" v) v+ e9 n6 b$ c! ]' T6 | c4 a5 ^* |. b
8 w. n3 @5 a2 g/ R2 p5 X
Method 089 o7 q( U6 k) ]# g! e% M1 u$ {, h
=========) {8 p- w7 W- |' x
: O+ e$ b4 L6 ]# U G0 C$ C# |9 SIt is not a method of detection of SoftICE but a possibility to crash the
! R" M2 [: V# w2 Y' ?, B) i& ksystem by intercepting int 01h and int 03h and redirecting them to another
. B- r* P9 c L' f& T: { H+ broutine.
# i3 K' n# B' M. W, w- _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
# Y: v$ l4 P* L4 eto the new routine to execute (hangs computer...)! t R% Q U( m& K/ i6 Y* Y0 A* m' Q
! @; g$ [% |* M2 ?
mov ah, 25h$ h8 H) Z3 R; o- s# j
mov al, Int_Number (01h or 03h), D- d: z7 R( c
mov dx, offset New_Int_Routine
/ \$ i2 H* J: U' ~! J- Z8 \7 ] int 21h5 O; P6 I) t5 ^# S0 `% [, V5 g' \
+ d. k. i* R2 }1 o7 N0 o__________________________________________________________________________
& S2 u# r$ J4 `5 O' O
- }. n/ W. T1 ~( s/ x1 |9 X+ FMethod 09
& `# z4 f% G1 T. o& j) e7 @=========/ T. V% U" s$ p" V# L, D7 S
* g( q5 T) t# a8 H; F2 sThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ Q$ L; m" ]- e* ^( [& F/ Operformed in ring0 (VxD or a ring3 app using the VxdCall).
9 F7 M- k( H8 \( t- a& g9 zThe Get_DDB service is used to determine whether or not a VxD is installed
, K5 ^( G$ O/ t0 h2 lfor the specified device and returns a Device Description Block (in ecx) for
9 V( _5 ^3 M9 m7 a8 H9 ~that device if it is installed.) N" u9 j* H: i! f
& l3 t# v; D: x) y' z+ X5 ?
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ }" {0 x$ U. o: ^; _
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 ~/ u+ z" ~, i/ R U4 c VMMCall Get_DDB" F1 w- X: l3 O# H- e
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: I$ |$ T& u# W
: n0 M; u' G7 Z; T5 |Note as well that you can easily detect this method with SoftICE:
5 X7 S( S/ W ~ A- h# K bpx Get_DDB if ax==0202 || ax==7a5fh
0 x& ?+ W8 _$ D
4 Q! i$ O. I+ Z4 |6 X__________________________________________________________________________3 K" V- T5 c) t6 m# k. [1 u
+ p1 ~$ c. v) ]
Method 10% K2 D$ o+ O' Q; }
=========
- l0 t. N# Q c6 C) D7 o
/ i9 w+ ?0 L0 ^' |' @=>Disable or clear breakpoints before using this feature. DO NOT trace with' R. W% d+ ?8 G8 |& K# s6 ~
SoftICE while the option is enable!!
s j: |6 h3 m+ m& J+ Y) k$ W# r4 l, r5 k. a0 Y! J
This trick is very efficient:% b4 z$ u4 w" x# N% u
by checking the Debug Registers, you can detect if SoftICE is loaded+ w& s& o6 r3 y& Y" ~) t& C
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if/ G, s# r* o. Y$ W( Y( O5 z7 _
there are some memory breakpoints set (dr0 to dr3) simply by reading their& j! `2 ^- b7 U( l T* A
value (in ring0 only). Values can be manipulated and or changed as well
5 j' a: {+ a7 r% q' w! l h& \(clearing BPMs for instance)
' p D7 W+ M; t- {" T* p+ L& s3 T% U# _% g0 v
__________________________________________________________________________2 ~$ L/ S& n! n$ h6 l7 {5 W6 L2 o4 ]+ Y
: t, x( ^& B+ N2 [+ N
Method 11# J$ c- M) `6 a! f) q8 D
=========
& D, ^# q2 u: i i. W
: D8 D& R# k* qThis method is most known as 'MeltICE' because it has been freely distributed7 }. T; _$ `! o5 z2 g, h- n9 ?+ T
via www.winfiles.com. However it was first used by NuMega people to allow
' p5 v. [/ W" @/ fSymbol Loader to check if SoftICE was active or not (the code is located
2 w5 [: ^) s U$ _2 u v: Kinside nmtrans.dll).) b/ b- u. |$ G- `5 q6 `
) H g) e( u* \The way it works is very simple:) _+ P L! j* o* \
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for n* V. f. u% \4 R, C3 o+ ~
WinNT) with the CreateFileA API.
: u2 U8 K/ M( j( X, q
3 x. }5 j5 \& Y: |# RHere is a sample (checking for 'SICE'):1 C, L! S! L0 F8 b- m( x2 J
1 p) p9 T; w; t# q9 D; ?% ?+ aBOOL IsSoftIce95Loaded() M6 e9 {! R: m& Q3 E+ C3 [: ^
{9 {3 F3 s6 w2 u
HANDLE hFile; % X. z% X1 X# W5 b
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. a% v2 m& K' j( p" M' V4 T. l% Q8 m
FILE_SHARE_READ | FILE_SHARE_WRITE,- ^5 @% |8 ^. \6 \4 o
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 t% J; s2 m" b! Y8 U
if( hFile != INVALID_HANDLE_VALUE )
7 H: N, b: m, {' u: a, M {
& c4 q( u+ w- ~; V+ f CloseHandle(hFile);
% c% D2 ?8 n; P return TRUE;/ U& |* o! y- C4 i3 [! }" I
}2 O/ d9 [1 z# D8 \7 y3 y Y! b
return FALSE;
& [( q8 i4 D. ]# h}, J S4 o: f; ]! q
, Q, H$ k) E7 G+ d' H
Although this trick calls the CreateFileA function, don't even expect to be
+ G8 \9 A7 ~; _/ i5 _: zable to intercept it by installing a IFS hook: it will not work, no way!
, B/ @$ n/ ?+ l3 `, o9 a* `5 q- ~2 ~1 tIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
+ g& S/ |+ {, w; e( kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' f& a. _8 a& [" }. W4 N" Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc: G6 q$ |" f* U* h/ ]7 ]! [* T
field.8 G$ ~# V, X1 b1 Q& m( r/ n
In fact, its purpose is not to load/unload VxDs but only to send a
8 p; Q8 o7 F5 QW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) \3 |2 i. T M6 k6 {5 z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; p2 b& [: g7 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 J1 y% B# C, J# q+ k! g
If the VxD is loaded, it will always clear eax and the Carry flag to allow& h( ?/ T3 J* r2 @" U
its handle to be opened and then, will be detected.- ^7 C2 q6 R* y: b1 b& F# z
You can check that simply by hooking Winice.exe control proc entry point, R7 q, o* f/ b$ Z. C+ Y
while running MeltICE.) o5 V- x$ z2 V1 a" V- h
+ u# E0 ^, L5 [0 i7 Z
& o8 r; V0 x, @! K# l* R1 D; [ 00401067: push 00402025 ; \\.\SICE
$ `2 f1 H; B8 d! I0 W i 0040106C: call CreateFileA" ~7 U9 F) M: z, C
00401071: cmp eax,-001
8 M* U k6 W5 ^- w( V7 I( h 00401074: je 00401091
N- y6 i0 [ k \# F# y8 u# h1 l5 ?) z8 C6 z6 o
* Q5 \; s6 W+ \( b* T
There could be hundreds of BPX you could use to detect this trick.
; P0 B8 f6 d: | z( f. P7 O-The most classical one is:
- g" |( U- ?- D, ^4 {- T, k BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
4 m6 a5 _, u: [% b" x0 K) _ *(esp->4+4)=='NTIC'
) a% D. e6 h' x! Y; u
( C5 i9 ?. p$ I g& g; [+ w-The most exotic ones (could be very slooooow :-(
; e) O6 U4 m* @; S* H+ ~ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 p+ q% | T8 w" @. Z, | ;will break 3 times :-() w" }$ O8 I2 j+ q7 _- s* \
2 w' v4 h m; `6 C) ?, T
-or (a bit) faster: 8 I6 @- t- Q8 {8 K
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). f {% L! d- a& I3 R2 x$ W
( P9 h# r5 j" G% y+ g! A A BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
# W+ h: Z# {! y, J( G0 D1 b7 o$ f ;will break 3 times :-(9 K" O# C' ?- V8 k) p. |
$ q" ^* {1 n* b3 b3 }
-Much faster:, k8 M7 v3 a' x' o2 J& A8 T
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 g5 f( r) T' z a3 U/ J3 N
9 a# V2 U% X7 k& `. \; v: sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen8 \& y7 K0 }/ a. B6 S% X
function to do the same job:8 K1 f( e6 u5 i
/ k5 q4 {6 ], L* t
push 00 ; OF_READ6 u) `3 H# ~8 y' |' ?
mov eax,[00656634] ; '\\.\SICE',0
7 Q% g/ A2 S" l J: t push eax
; R" \& Q3 V' D call KERNEL32!_lopen$ [$ F& k+ J4 h1 b$ B
inc eax
$ g& C9 N! V: I, e7 n. b; e5 W jnz 00650589 ; detected
- W6 i1 T- n3 F3 J push 00 ; OF_READ
3 \* ~) V5 _4 N/ B8 L4 \ mov eax,[00656638] ; '\\.\SICE') R$ Y ]& H3 Y: C
push eax
2 [& o( e1 P4 U2 K/ b; v call KERNEL32!_lopen, ?5 h) E, p5 X+ K- A" A4 }1 m
inc eax
, Z: p/ T6 v1 U: ^+ x8 ]1 r% ]! @ jz 006505ae ; not detected
2 n7 ^ ?! _+ ?) x G( k& n, S
7 `8 ?& _: W$ u8 c2 ~__________________________________________________________________________
( n" a R, w# G @% p9 m+ q {2 F
Method 12
2 t1 S C- u Q, r- H! V v=========% z( e5 T0 }' k7 b2 Z7 z& A6 ]; z+ ]
5 \6 j |( U( o" mThis trick is similar to int41h/4fh Debugger installation check (code 05/ `3 r& Q( E" T& q4 A" I i8 j
& 06) but very limited because it's only available for Win95/98 (not NT)
% T: z8 Z. Z( y2 h G8 c# mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 X7 D% ~" ?9 h- D+ D/ M6 Q# e! g0 T% P" Y- I% Q
push 0000004fh ; function 4fh9 h* E- p2 y+ J
push 002a002ah ; high word specifies which VxD (VWIN32)
/ x9 v. N! M# Z) m- V9 k ; low word specifies which service
3 @; a9 | T3 X2 y+ I- @ (VWIN32_Int41Dispatch)# x, a l: ~% _$ r
call Kernel32!ORD_001 ; VxdCall
K) H" U6 B N cmp ax, 0f386h ; magic number returned by system debuggers/ R* C+ O0 g2 o; l2 Y J
jz SoftICE_detected$ G5 r7 _1 j# P. u
9 G$ G: [) y! rHere again, several ways to detect it:
: D, k( O' A3 B( _* l& j+ S8 L
" g2 h [0 B" q* U BPINT 41 if ax==4f
+ k7 ?0 X& o" d9 A/ N/ N
f( x( i# `9 G% b, x e BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- f& I7 y& {, G
- a; J% {7 S7 X' x. l BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
5 u7 p( d- i, m4 H* l: E$ H) s% V
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% N( F% K7 y2 x8 v' A- M7 b* j% G
5 o) f4 q8 M7 J
__________________________________________________________________________2 Q$ u2 \* W* y* N6 V) ]
: V0 C$ u9 `8 F5 @
Method 13
6 v2 N* y6 C: @( i! t; H2 `=========
( i1 A2 h( `$ ]3 q( V( v1 V: P' ? v* D$ }6 O
Not a real method of detection, but a good way to know if SoftICE is
4 o& L: [& a) Oinstalled on a computer and to locate its installation directory.
% O) z v/ _. T/ B: hIt is used by few softs which access the following registry keys (usually #2) :' r3 ~. H7 g3 e o' k7 h0 d
, _" Y+ t5 B: ~0 F5 r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; t- C1 B3 \# D9 Y3 B' E
\Uninstall\SoftICE- P+ z$ f2 ~2 G- I: i; H; K/ s1 K
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 I, G0 G) Y! j. f7 S
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 D5 G3 M: o* `. ]% ?, N! @\App Paths\Loader32.Exe0 k1 |, p: T. ?1 T/ R
1 t. X# ~# q6 Z3 ?- M
( ~- W' D; F/ j! a* ^' Y+ X& ]Note that some nasty apps could then erase all files from SoftICE directory8 f9 D0 j" ^# p' z- b- I3 M* c
(I faced that once :-(- D" W. W& J1 a" @ e. S, X
2 w( L' Y$ ]7 ?2 e8 T- yUseful breakpoint to detect it:
0 @1 G. B, \+ N7 o8 j' o5 M% R! X2 c- E5 f9 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 m4 ?( D& G7 C9 c, t, x! j2 R
2 C3 |5 E; P+ d) V__________________________________________________________________________7 b- A7 H# m! n9 g
# d. m1 Y: J9 N% i
2 \4 l S* H. e O
Method 14
- f0 |: m0 N+ O' s5 v) x. I" I/ h% z. U N=========
: m$ T% |* S S" v
2 @, f+ h2 k3 W( EA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ }/ l# Y+ D1 G% B3 ~: c
is to determines whether a debugger is running on your system (ring0 only).6 t! _2 }! q5 Q% a
- {/ X" X0 [0 d8 ?2 a. n VMMCall Test_Debug_Installed+ v) {* X E# B- m
je not_installed2 o- l/ X5 v! A- D, j* D
% l6 A1 s& m( k- _( W! `: l9 PThis service just checks a flag." [# T0 T& A" c: ]2 B R
</PRE></TD></TR></TBODY></TABLE> |