<TABLE width=500>1 V. l6 R5 Y! n
<TBODY>
5 U2 q$ H$ \ C5 y7 w5 `! V& T<TR>
5 |9 I! k+ M0 l- L7 b, R. A<TD><PRE>Method 01
1 \+ @. E, T( W6 ]; ^/ o=========
" {$ _; o$ P7 @! c$ h, X9 S/ D
1 `, \* ?( P) @* m1 ~: v3 DThis method of detection of SoftICE (as well as the following one) is& T4 K6 l& D% L0 T
used by the majority of packers/encryptors found on Internet.7 Q: Q8 F+ w. j/ a" f
It seeks the signature of BoundsChecker in SoftICE$ u4 d! C6 l# Y: L
$ @7 j' B, F# V* F4 |4 f
mov ebp, 04243484Bh ; 'BCHK'
1 H- G- o" ?+ }; `1 H mov ax, 04h
! E+ i' [) j& w7 g int 3 / T7 x/ e! t& v: d
cmp al,4
( S# d7 P3 d3 y9 s% L2 J jnz SoftICE_Detected
7 _, M- }2 j" K/ p* r4 R! Q: @1 ^' ~
___________________________________________________________________________
0 L; I8 T% k+ k: q. l' i9 C8 o1 w- O( z# c% {
Method 02; x8 Y7 ^. N6 P3 Y6 K2 w
=========
, g I/ U7 U! l" J* k9 H x8 I. i+ B s1 y# G. B& h
Still a method very much used (perhaps the most frequent one). It is used
0 Y: D& G" u5 cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
% s( A2 g: |2 X' ^& B. Y# Gor execute SoftICE commands...& z$ t+ _! R2 R/ L' y% ?) z l
It is also used to crash SoftICE and to force it to execute any commands
* V3 C$ P6 i$ r' z7 I) B! N(HBOOT...) :-((
0 ^9 J, |7 N, v8 [
; y/ Z* W$ I( y& r* y$ T5 |' HHere is a quick description:
! A6 H2 @; s) I- O! C8 G0 z-AX = 0910h (Display string in SIce windows)1 X7 H8 S7 A# L/ e" f" {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)% c8 d9 z+ l k# n: u- i- E
-AX = 0912h (Get breakpoint infos)
" U9 p% t5 M) |-AX = 0913h (Set Sice breakpoints)
4 p+ H* S6 }4 ?; E-AX = 0914h (Remove SIce breakoints)0 L! }- k2 h# h9 n4 i0 n% M
: @" K4 {7 d) ]! [# fEach time you'll meet this trick, you'll see:+ m' @. V% R( E5 S9 T' \% k
-SI = 4647h
. Y" {1 q! h4 ~' S {-DI = 4A4Dh
# ]% Z9 H' g, d6 jWhich are the 'magic values' used by SoftIce.7 {% w6 G' X5 X% b9 A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ \' o8 ^" k. x; H$ b, {5 Y/ {
+ a$ {6 W7 v& G, V0 ZHere is one example from the file "Haspinst.exe" which is the dongle HASP
* n7 r7 Q# f+ S5 _1 ^! h c, REnvelope utility use to protect DOS applications:
7 g3 ~! w3 f, X4 t D7 y
5 @( Y s3 y* S- H1 u* D( t% T2 ^! H! v0 p3 s
4C19:0095 MOV AX,0911 ; execute command.! J% f' P2 f: _
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., H( h/ w+ a' x+ g& h
4C19:009A MOV SI,4647 ; 1st magic value.
5 S0 M+ k3 Q& W- F3 W$ p4C19:009D MOV DI,4A4D ; 2nd magic value.8 p1 j; T+ B, e! m2 {8 R
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 V) y5 M8 p5 X, I0 _5 u2 y6 u4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- f9 N @1 D% \. X @4C19:00A4 INC CX3 R: h3 @' O. _' q4 l3 _2 M! q; v7 Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ L; S Q' E; N2 S" }
4C19:00A8 JB 0095 ; 6 different commands.& i$ l& P. ?% g' C$ ~" C
4C19:00AA JMP 0002 ; Bad_Guy jmp back." h$ ?2 T9 e1 X. U d) J
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
5 ]$ f4 Y/ S5 d1 b6 Y" |3 x/ Z
& n, k' q8 D: l" x5 kThe program will execute 6 different SIce commands located at ds:dx, which3 P$ {! o; i5 G6 U9 [) ~8 k
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ T$ @/ k! @* m3 {. k7 p
+ D% [& I$ _5 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' q1 _0 o- ]' Y___________________________________________________________________________- i+ m. _$ m! `% @
. p/ K" l# x& e! E/ Y3 Q. t' q8 b% O: c
Method 03
, J% h: {% F2 n5 |0 H8 s=========4 b1 @9 Y- r6 v
( ?4 H, Q' I6 Y6 fLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( d5 ~" T' X8 B, a* N$ b b
(API Get entry point)
# i5 Z5 H, O) b8 S% Q : F8 G+ K5 B" l4 r* X _- u
1 O+ g- w& v! M/ Y8 {5 ^7 s4 J4 k2 h, N$ E
xor di,di
L; M5 w5 N' c3 q+ A [' E. e mov es,di
/ d0 y1 s. G# [0 g9 R mov ax, 1684h + [9 o, s4 g2 u) d
mov bx, 0202h ; VxD ID of winice4 A# d6 |2 m, M+ F1 v) r
int 2Fh
! s+ l; w9 o0 j) S4 v7 t mov ax, es ; ES:DI -> VxD API entry point
6 s$ _& C. O& ?4 E* }2 w add ax, di* k4 O+ F4 i8 ]/ V1 G
test ax,ax
: y: f2 K3 @4 c. K jnz SoftICE_Detected' ~0 \/ R2 p% F7 s
3 V" n5 c( l0 i1 ^; y
___________________________________________________________________________
7 v) C2 p0 _, a5 a8 L2 g% J. K, I5 |9 _
Method 04
- s; |+ ^% J' s=========$ M+ M6 c$ b' G! m# I$ }/ v6 j" g: f
' t$ A% v) E) f( F/ }7 z& j* Y
Method identical to the preceding one except that it seeks the ID of SoftICE
5 r8 ]+ ?2 W7 L5 A% M+ _GFX VxD.4 K2 @0 L0 a3 K- h1 t
! h5 t* o. r9 S) F7 ~. b9 o% H
xor di,di
7 \4 m: G1 L; `1 s: k* C0 ` F mov es,di7 K; m" B7 S! `0 c2 T
mov ax, 1684h
; {" U( H7 k. i0 H+ v9 P mov bx, 7a5Fh ; VxD ID of SIWVID& j0 i/ K% V8 [# Z( p$ |$ i) h4 p! ^
int 2fh1 b# Z' j% f3 t' l$ ?( |6 t5 t
mov ax, es ; ES:DI -> VxD API entry point$ s: v9 g6 R& e6 H& ^+ E5 C
add ax, di. f/ u% ^- @1 F. T( J k3 W$ o
test ax,ax
) i* T% r z, l. ~2 e4 F- y5 t jnz SoftICE_Detected
/ o% D- T/ r Q" B( h6 O, ^9 ^- \5 ], v# R
__________________________________________________________________________
2 c9 x- B& f9 d8 `; G' W( C
1 R6 O7 H4 _% N9 ^, [; X
0 o! O6 b8 M- D; ^3 x3 DMethod 05& ~2 m3 T" S6 s! n: ?3 D7 D, W
=========4 P/ ]+ w% s- w a, ]4 u* H0 X: L
. h% G; ^$ u0 l& n/ S/ k2 n1 sMethod seeking the 'magic number' 0F386h returned (in ax) by all system# K0 ?+ c: a: q$ v4 B* i9 v% k
debugger. It calls the int 41h, function 4Fh.( m% K/ n L; ~; q% U
There are several alternatives. J h2 r; n; i# M. f( R+ x' l# {- Q
& K) g% }& @( F0 o/ [- n1 sThe following one is the simplest:
/ \9 g A5 o+ t ?; p9 @3 P p+ S
4 I/ h' U; C7 f/ B mov ax,4fh
0 e/ G! E% |5 m; f3 O8 g+ ~- S int 41h* d' E4 T) R$ _! `9 T( k8 y
cmp ax, 0F386; Y0 Y) m, u0 r( R
jz SoftICE_detected
: v& }+ u: o9 H0 ^* j- j' V, x. i& p/ i: Z' g( L3 r {9 G+ d9 Q
, M+ R1 G2 k+ Y& K
Next method as well as the following one are 2 examples from Stone's
4 s5 f( O$ |; W7 Q% E/ K$ E"stn-wid.zip" (www.cracking.net):1 Z9 ^6 t+ `% f
! p1 H8 Z; l9 G* M mov bx, cs7 W, h' E& l- w) i. @5 l
lea dx, int41handler2( G8 w, Q. `' c( A/ [6 j' Z; m5 }
xchg dx, es:[41h*4]% a9 m6 c' S6 Z3 T9 O. D2 b
xchg bx, es:[41h*4+2]' c( L6 q7 E- v( ?
mov ax,4fh1 B! q6 L: b1 ]3 J; n% S
int 41h
9 ]4 _6 k1 x) C) g. G xchg dx, es:[41h*4]
5 ?4 \- P: @7 j4 |0 n xchg bx, es:[41h*4+2]
; T$ K# R3 n) P$ E6 U cmp ax, 0f386h
) _8 M* j- j" O jz SoftICE_detected
+ U$ e& g3 K3 ]: m, @
0 \/ | x5 b& v3 ^$ I; A6 ~int41handler2 PROC) \- a0 k0 S2 d$ g2 N) Q1 b7 v
iret9 | M5 \- a5 d/ I% G% s
int41handler2 ENDP0 O+ C: x5 [" O7 }- O3 X
+ A: A: m2 C/ A3 g
. _# g* `6 P; {% Q& ^_________________________________________________________________________
1 z" L! w8 U9 t+ P Y; [" q4 w* {4 _" Y$ j: V+ m" S8 `
: L0 m& ^7 O" VMethod 063 \* j3 N' w) Q
=========
/ L- F/ z2 p( |2 F7 Q- n8 ~" [/ w4 Z
' ]! _( [- x7 x! k6 T
$ b, H* S9 ?3 s X6 P2nd method similar to the preceding one but more difficult to detect:
) {6 W; P5 r$ w9 ?
5 D' h0 `$ n& U! S! {
9 J" G4 z9 ?4 V( Q* b$ S- wint41handler PROC% ~7 Z' c, W- a3 G4 B% S& G: n
mov cl,al3 i7 L8 D% m T3 p9 n" Q8 l
iret
, H h# l+ o5 h1 xint41handler ENDP
. W) j& \4 F7 g$ H7 l
$ U# R. x) H0 g% ?0 B; k8 ~0 f( }
3 y, M; D7 V( ` xor ax,ax
; J% m) f, A. u mov es,ax/ w0 y& F+ R, A3 G h) Y6 V( M) P
mov bx, cs Y+ J+ g- x& y
lea dx, int41handler
' u6 [% X! G" K4 p9 ]" J ~ xchg dx, es:[41h*4]1 ]; C- b a: n2 L8 K
xchg bx, es:[41h*4+2]
6 ^! t8 g) O- }+ r# @& G/ J7 [ in al, 40h
* J% h, {3 ?9 ~; l7 A xor cx,cx
Y( X! l4 y1 B, I int 41h* o1 q4 G# q: Q- D8 ?/ L
xchg dx, es:[41h*4]
! C5 P2 T* K# g) S" i9 X8 o xchg bx, es:[41h*4+2]
* f' p9 B3 ^+ b cmp cl,al
' w/ I9 p. \5 f3 _# G0 j7 }* j9 `7 V- } jnz SoftICE_detected
! }5 X& G( [+ z# y0 l* O! Y5 P' t0 }% |0 ?, F0 f+ d7 k2 @
_________________________________________________________________________/ o( {' ]( S9 R7 R6 S- B0 f: }
' z5 v( B9 t; Z s* p( P/ y1 [Method 074 N- c- k# U: ]
=========- r# n5 [9 a- N! A \
, j6 P2 e# t3 |6 B% i9 r
Method of detection of the WinICE handler in the int68h (V86)
- f; L$ N& V- E5 C |! r
8 V' W1 h; o; e7 \6 ] mov ah,43h5 u' Z0 q# l) C2 s+ g
int 68h
4 P% u3 F/ O# R) O3 O) J cmp ax,0F386h
% ?/ v8 A5 \" b5 m H( C# X jz SoftICE_Detected0 V! X+ I/ e: v+ l& }. G
3 F& h3 O5 I0 g& [9 x n- L
5 ^$ }0 Q h3 {6 s! Q=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( f, r% n1 v5 b& I# Z8 }5 a app like this:: `6 U6 h) q- w
l' K. S9 p+ H' ]: m" }, L3 M BPX exec_int if ax==68
) |* z) L1 `9 y (function called is located at byte ptr [ebp+1Dh] and client eip is
/ f8 o: h# S% ~6 ]; n0 M" m% O located at [ebp+48h] for 32Bit apps)
& B2 G* u( ^# Y0 Q o4 p__________________________________________________________________________
0 h5 ]0 w1 m" N- N4 k, f P2 ?+ E+ R# T8 |5 q
9 ]+ N5 W* w5 Q. @0 Z% L
Method 08
( a* j! c3 d$ J( W+ W) F=========
/ G* W) n5 F7 E* L, v1 }0 i4 T! [, g- g e8 r, L9 A+ V6 B4 X
It is not a method of detection of SoftICE but a possibility to crash the; I. _) R3 {; D5 a, d, I
system by intercepting int 01h and int 03h and redirecting them to another
5 u9 U% f$ g3 m8 N& Z& Qroutine.
0 g0 ^ Q% L( f8 k7 s+ zIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points u$ ^' C. j; l+ S" J l
to the new routine to execute (hangs computer...)+ C, l6 @1 q3 @2 Z# A$ V6 |
5 R+ t$ p a" d mov ah, 25h
J E7 K+ p& l+ r mov al, Int_Number (01h or 03h)/ t( N& b9 S7 Q
mov dx, offset New_Int_Routine
0 F$ Y6 x& q) B7 X8 ? int 21h
. A: L, I5 ?. h( t& t$ N8 p& Q1 d; }' Y7 D; P# m
__________________________________________________________________________& e" F; R9 {/ {2 a, y
3 O- F1 K& X4 `$ y A9 Q f: uMethod 098 w1 n% M$ c% ^6 G5 |5 P
=========
7 O$ }4 w1 ^, R# I
& L/ W# Y. k H, R2 ]0 S/ fThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
8 c% l- j! d. P5 K% B9 aperformed in ring0 (VxD or a ring3 app using the VxdCall).8 M9 F9 D) |) |+ v. k! V; I
The Get_DDB service is used to determine whether or not a VxD is installed
/ ]! V' C" ^+ B2 p) D3 m- J. Efor the specified device and returns a Device Description Block (in ecx) for: j9 p0 V1 H5 W
that device if it is installed.* `5 E" g/ r% D* j
# U# ~* e2 q, H( f; R% d- S e4 X
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, H' ]: {. v% _. g
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
$ D: T! P [; B3 I9 q VMMCall Get_DDB0 r- m. x' E+ v% F& h3 M6 g
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed( h# g5 N# ~3 z; a
0 Y5 f, f1 p* K3 q% j) {Note as well that you can easily detect this method with SoftICE:
, X" }2 ^5 F3 v8 c4 W: C bpx Get_DDB if ax==0202 || ax==7a5fh: l! i* d. R* y y r2 w
8 n5 C5 |1 {! L1 f7 r__________________________________________________________________________
$ M) ?6 U$ g! _4 U
+ n! p- b6 l) e- R" d4 wMethod 10
8 M7 s: w$ X6 P9 U3 b# p. c0 l=========7 }5 B0 \; d5 R3 n$ V v
7 ?/ X4 [& k+ _* A9 O/ ^7 ]
=>Disable or clear breakpoints before using this feature. DO NOT trace with0 F% q; Q m+ h' o4 n4 H
SoftICE while the option is enable!!- {7 ~- h ?4 j9 X, i3 F w3 e
, o: g- O8 g3 o& [. F0 `
This trick is very efficient:- K( _/ h& B0 t- {; _! @0 y6 Y' `
by checking the Debug Registers, you can detect if SoftICE is loaded: a ]4 E1 W9 H
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if, n5 G8 G4 J, J5 d! G8 o8 |
there are some memory breakpoints set (dr0 to dr3) simply by reading their) b v7 O$ h7 {
value (in ring0 only). Values can be manipulated and or changed as well
: |4 b! G: v0 M5 K0 f- l(clearing BPMs for instance)9 m/ Z+ ]. {( h# @. F8 q
- i* W+ x( j' u' c, D2 x__________________________________________________________________________# o" C7 Q4 V' Z0 f7 F/ ^
0 L3 J' T" H+ h$ ?. }Method 111 w U6 ] i0 |0 p4 N
=========* }# _7 Q z6 @7 @- w" r
/ o: k# C0 k$ U* |5 T( w
This method is most known as 'MeltICE' because it has been freely distributed, ~* K/ j! j% C5 |" C" f8 ?
via www.winfiles.com. However it was first used by NuMega people to allow$ x; Y1 l4 X+ H4 s2 ^1 w8 F
Symbol Loader to check if SoftICE was active or not (the code is located; i/ G- e* L9 `1 i3 Y+ L
inside nmtrans.dll).( ?) P+ F3 O5 j6 G9 x$ U5 w5 M
- ` h, f! ] u% a' T
The way it works is very simple:/ F% X9 u; k5 r: |
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; V t9 y6 a b8 Z! w& h- jWinNT) with the CreateFileA API.) _& z# @+ i' [0 w0 R% x+ W
, m6 u4 U5 B' Z2 a9 m
Here is a sample (checking for 'SICE'):
, z% f% _# C+ ^1 {) F* n
$ @3 D1 y$ Z, o2 f7 L& H% }BOOL IsSoftIce95Loaded()/ ^! {: y v: J/ e
{
6 @/ b0 b. D$ N4 g% ] HANDLE hFile;
2 W/ d! z) P7 a/ G( t4 Y/ r hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% n; @0 Y- C3 B
FILE_SHARE_READ | FILE_SHARE_WRITE,. I) F% T, L$ F* B
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: ?/ d- b4 o) R6 {$ m6 p7 p0 R if( hFile != INVALID_HANDLE_VALUE )& m8 G r" T# {; A; W; U, k( V
{
) s% O$ j6 Z6 Q/ [8 K& o7 h" q CloseHandle(hFile);3 X- B9 A1 K4 E! w, B. O
return TRUE;+ r9 N; W5 M* W- A
}
/ {: W- m/ o4 j- c- C return FALSE;
) \* Y1 t9 T3 ~0 _}
1 u/ Y+ a" z& j) T3 f* m$ a1 F3 L. I( K3 T
Although this trick calls the CreateFileA function, don't even expect to be d) k) A7 H" s1 X8 A, \$ _
able to intercept it by installing a IFS hook: it will not work, no way!
! }4 m( J! H: M4 @1 gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F! o( b7 z* ?: V; X) v+ o; ^" }0 K- I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 D& x6 \2 [! k) y8 f) Jand then browse the DDB list until it find the VxD and its DDB_Control_Proc: ^' }# L7 ^+ b: j+ I( F
field.( {# z4 `# k! s. E* ]& F
In fact, its purpose is not to load/unload VxDs but only to send a l, Y, q/ ~* s0 p8 d+ T7 J& K
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)) _1 C7 Y" C$ y+ ~& z% ?0 n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try* ^# }6 q3 v- x+ ^. z( o9 z
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 t6 \4 N+ n p6 |; x [: c3 O+ r
If the VxD is loaded, it will always clear eax and the Carry flag to allow
, m3 s' |% V7 Y3 K1 ~its handle to be opened and then, will be detected.6 i7 d- G$ K$ p' g" P
You can check that simply by hooking Winice.exe control proc entry point, p- @2 d! b& A# h1 w( {0 @7 k
while running MeltICE.
9 S4 k8 C9 l; V- F+ z+ v: B0 B. v4 o+ o
/ p5 ]2 Z+ Z# `$ e3 T9 } 00401067: push 00402025 ; \\.\SICE( X8 L- ~- s, ~( K
0040106C: call CreateFileA( N K4 M* c& Q- u! z
00401071: cmp eax,-001& b! b9 Q' O% a$ \- D
00401074: je 00401091
c9 m% Y3 f3 Z7 @
# [# J: o8 e- H# M b; u$ u+ _4 j: \! h- u$ ~: |& L
There could be hundreds of BPX you could use to detect this trick.# e2 b3 v- H% H' L
-The most classical one is:
4 Y5 G/ d% N6 a) p) Y: c. A8 k& | BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||( t4 u) ~* E! J' t: I
*(esp->4+4)=='NTIC'
) z0 |2 L8 v" t/ l: i* ^+ E$ n4 l, u3 Y
! z. m$ p- ~) ]9 \-The most exotic ones (could be very slooooow :-(
+ C: L8 ?5 P0 x: z/ ^6 W BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . E; _( ]1 Q, O% m5 m9 o! s
;will break 3 times :-($ d7 m/ T: r2 r8 K- G
+ k) x; T' @* \) L& a2 G1 y' J
-or (a bit) faster: S* _8 l u9 r0 T
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- M+ |0 r* r1 F, i. G! @" X
' V7 r* g; L! A7 c, W8 M4 \+ g BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
) w/ A& M9 C# _! J9 T2 V! q ;will break 3 times :-(( T: \, ?/ G0 A, I% ~! z g
) i2 r' ~4 ?3 m) f! T2 J-Much faster: U/ |$ O; |' t" G# H
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
# j! d% x3 ~ T" }* g- ^1 n9 ]1 S2 d ` `6 M" _1 @& p; T$ U
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 O' }# z* M6 p5 Ofunction to do the same job:
1 t2 a% i$ v# y o' v1 r6 `5 u' p2 G$ C- h) ^ g2 h6 C$ t
push 00 ; OF_READ
' U) B) N- c+ q9 X& } mov eax,[00656634] ; '\\.\SICE',0
; Z1 k- ~" ^7 q$ ] push eax$ Q a0 t3 u! A( `# Y& I! ^
call KERNEL32!_lopen3 |+ s. I' a+ T H0 @5 L0 P' a' S
inc eax
3 Z- {7 \+ l$ ]( n# x jnz 00650589 ; detected
9 Y3 t) U0 Z( U push 00 ; OF_READ7 e7 l4 d- n. L
mov eax,[00656638] ; '\\.\SICE'
0 Z9 }( _* {% r0 a/ \ push eax
) j1 F* E! _4 e% K call KERNEL32!_lopen0 v: w' _/ n1 Q% k+ t1 a @
inc eax
: d& e% S3 Z+ H9 E( Z- v jz 006505ae ; not detected4 l, i* v+ @6 W8 P* a% F
: Z0 n* ~ p& p/ J4 q1 p5 j1 z g3 J4 c6 w. \* D
__________________________________________________________________________
3 b) ]& n! e0 v8 D- |
4 p, e- C1 G5 ?' b/ sMethod 12% g: s# h, S/ i9 w7 V
=========7 r% e' {7 T7 b' g! ~
- o0 _) a: w$ ~9 g+ g# J
This trick is similar to int41h/4fh Debugger installation check (code 05
3 z; a1 p5 u) ^8 @" ^7 L; w6 g& 06) but very limited because it's only available for Win95/98 (not NT)
6 l$ y) W! [# p7 I/ I5 H' ]! w* Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' `' @# I$ c6 l4 ]1 S* u" N- N# z- `
push 0000004fh ; function 4fh& R. ]5 D6 ~$ x& a. J
push 002a002ah ; high word specifies which VxD (VWIN32)
~; e3 D- L7 S4 x' ?4 s) g ; low word specifies which service
# w+ ^, w* k! C( |2 R (VWIN32_Int41Dispatch)% d r, ?: a% q+ U% @- K y* [
call Kernel32!ORD_001 ; VxdCall9 }* a% v) p# `- g' r) C# L' ~
cmp ax, 0f386h ; magic number returned by system debuggers9 C( V- ^0 `' w2 t5 r5 s
jz SoftICE_detected9 }0 z( Y+ `& O3 r) E: x2 V
" A. b- W g J; z( J5 M, n
Here again, several ways to detect it:* H G1 j, `' ^8 m6 \. u
- y) x3 ], A3 _. d4 D9 f BPINT 41 if ax==4f6 Q" \; Q* ?. U" [0 e
4 X: P3 p- G8 T1 ^. i' p" Z
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
7 h. q/ D" j ^& X, S2 K3 L8 w! W, b8 b9 \. d9 X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% i6 q. m6 i+ F- b, Q6 `+ e z! ~
; J8 g8 M! c' q. T8 H8 C: g4 i3 u' A BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!+ E E$ y- p( k- ~; @* G( I
: ]" Z3 g( [# z; T; N
__________________________________________________________________________
. Q' g+ `" f% u! j5 Y1 A+ g
. [7 B/ V, }6 A6 R( _+ r% TMethod 13
7 m* _% \+ o/ Y, F7 g=========
1 ^& _* `2 E; r7 g/ n4 n8 x% W2 T
Not a real method of detection, but a good way to know if SoftICE is
1 L" C5 ^& c: O [: {) Linstalled on a computer and to locate its installation directory.+ N1 O9 ]0 b; \
It is used by few softs which access the following registry keys (usually #2) :
3 X- S, K2 m5 P/ P) K
3 G3 ]! r, {- d+ M x2 d+ y& T9 L-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
`& m+ o- u1 Y9 n. K! n; }4 I\Uninstall\SoftICE F$ M( |) G1 \4 b5 H" L
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 ^3 y2 X w/ D! O5 A+ l5 n/ e-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& G6 N1 ^( G+ M4 `2 @; _& [' \" _\App Paths\Loader32.Exe ?' Q, \# Q# H
; @/ V' u3 |# _# `* G2 e
! M. J1 r! `# U, R7 B" A. S1 MNote that some nasty apps could then erase all files from SoftICE directory
. m6 A3 f% K# R4 ]% B- B- w8 W(I faced that once :-(
/ |- v. A; V6 W! |3 m) ?- J9 b* | b+ X
Useful breakpoint to detect it:
) g8 ^! h4 m& w1 t+ m
0 n4 @/ q" c5 w, X0 ~ U& l BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 s* }5 c) t& m' g' A( s; d' d2 \2 f& \) {5 Q$ w0 \. W2 t( }' i
__________________________________________________________________________. N# h: v, o8 \: P2 R9 `
1 i6 | z# X* X- |
. P" D: ^1 z' w% U( {- F
Method 14 9 S1 Y2 y( Y, W4 O# `3 C
=========6 P! M& N- y( f
1 w* e3 H% z; ~9 R3 I" XA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- X" r: R+ H2 H1 c1 {! Y: Ris to determines whether a debugger is running on your system (ring0 only).7 V7 i* T" F0 K' f$ P% C$ u, Q
8 ]# L2 `+ l% O c+ U' J: _* T VMMCall Test_Debug_Installed* z4 S$ o& l0 j) Z
je not_installed0 A+ R3 u6 y' O' m& |
) ?, g+ l P' m- ~This service just checks a flag.1 S4 p ]8 V9 m# C3 I1 I+ a
</PRE></TD></TR></TBODY></TABLE> |