<TABLE width=500>
( ]0 I i# I" }: V+ l<TBODY>
7 T! ? p& W. N+ j0 i, k/ O<TR>; @/ e1 z, g+ p4 y; [; I* m) t
<TD><PRE>Method 01 3 I" L" e% Z# L8 r+ z
=========
; v7 b% D0 T( `% K9 E- d( u7 ?0 y
9 N: h8 u' N$ F8 v X0 nThis method of detection of SoftICE (as well as the following one) is
0 {" j& {! W. c. O* H; }- cused by the majority of packers/encryptors found on Internet.
2 [0 a0 X& ^9 d3 Q: `( i5 ]1 DIt seeks the signature of BoundsChecker in SoftICE
! |+ Q4 g: w. b. Y- i" J& N' ]+ O2 \3 h
mov ebp, 04243484Bh ; 'BCHK'7 g* ?% A4 U' G, m: W$ g
mov ax, 04h$ b; A% w* C5 M$ Z. a5 ]
int 3
2 v2 Q8 }6 V4 ^, Z. |3 I( l cmp al,4
2 ]5 C! C/ J0 }$ h jnz SoftICE_Detected
9 g+ p; ]0 A& n) i
' r) {( E0 V. q/ ~) ?" m___________________________________________________________________________( M# Z& g( n" y; f
* y3 J; T: \; v( j' K% j% B& ]Method 02$ g; [: V6 z Y9 z
=========
/ I2 ^) x' ]/ ~9 v6 N0 G. N9 S5 @( g l
Still a method very much used (perhaps the most frequent one). It is used2 q, f7 l2 @, Z2 \$ Q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
7 z7 N/ E1 i# Vor execute SoftICE commands...
# O/ }( F0 e" C! D9 e, eIt is also used to crash SoftICE and to force it to execute any commands1 `) q" F: J* ?9 J6 ]' q$ S7 E, @' S1 j
(HBOOT...) :-(( * C8 y3 I; e/ g! p4 r+ U7 k7 t
4 \* k% a; v0 x6 i/ A7 I
Here is a quick description:8 u; j- ^6 L3 k" [4 C* Y x
-AX = 0910h (Display string in SIce windows)$ y! B* G% q F: s7 o3 i* J
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
3 Q/ L, L% A) S1 A4 s-AX = 0912h (Get breakpoint infos), Q; o2 u0 S$ Z3 |3 [
-AX = 0913h (Set Sice breakpoints)2 k0 a- G; |8 L: z
-AX = 0914h (Remove SIce breakoints)0 H$ c+ k( ~+ R t3 X
- q% s2 | U) [! }" |8 QEach time you'll meet this trick, you'll see:+ G0 o3 ]8 A4 I3 U: A) D6 e8 N0 W
-SI = 4647h
( u/ ^+ ]2 d6 [: q' m-DI = 4A4Dh
- ], b# [* I @7 W+ d0 m& _( }Which are the 'magic values' used by SoftIce.
# _! ?9 a# N: d% yFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" J, O3 Z0 g; F8 Z. ~8 Q6 L3 c7 V, T! ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP
; R0 r+ c% y( | V( w5 @; vEnvelope utility use to protect DOS applications:
0 E6 M1 N1 c {7 ^/ X
- w! f; ~3 `- j2 {* y$ S; U6 E+ p" y+ V9 B8 ~; y, V0 }6 X
4C19:0095 MOV AX,0911 ; execute command.7 s0 C! W& {- ?$ x" O/ D' C0 f
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 ? ?7 K# C+ Q& L6 a6 P- r
4C19:009A MOV SI,4647 ; 1st magic value.
, A$ j1 A4 U2 e6 g b4C19:009D MOV DI,4A4D ; 2nd magic value.& H5 i2 \( c% y6 _- E+ R
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 a" d& U% P: J/ H0 V8 n6 Z
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. |5 z% F2 K8 ~# D* I' c4 d4C19:00A4 INC CX, b# V! x( n* j: X: ]
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* u* Q+ O6 \6 B/ m/ A4C19:00A8 JB 0095 ; 6 different commands.
+ A+ f0 g6 {1 x. j, i- l4C19:00AA JMP 0002 ; Bad_Guy jmp back.5 `% _9 Q0 L, ] x6 c$ a4 r
4C19:00AD MOV BX,SP ; Good_Guy go ahead :); [% Z" G- T7 t
, O' s3 \9 c6 k7 T/ ~2 TThe program will execute 6 different SIce commands located at ds:dx, which* |% a7 k) Z( y9 ]
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ @' k) }6 l/ p( E1 Q* ?! [; C
' ?' p$ ~2 a1 x9 q; U
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; G) Q' Y* Y# B! }% v& s___________________________________________________________________________" q; ~7 o$ F$ n2 A: W7 L
6 @2 p" D2 A- ^5 \
) s; e: d( R" d3 r# T- Z% G
Method 03; m; f0 P5 u2 h, [4 q& K' S- |
=========
3 b* ]& h0 H/ K$ O/ A+ N y
7 f. m- s: D) ]: q: a! ]+ w7 b" e! ?Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ ]2 h8 @. K; s a, q3 T" _8 }( h( w0 |(API Get entry point), D0 P7 n* w+ s2 v2 q7 p M) g. V1 p6 G
+ ^! w6 J1 B! s. r3 U$ l1 \3 h/ D& h/ f6 `* v6 H# ]
xor di,di
* {* ]. \& Y/ w# n% Z3 f" B9 N' v mov es,di
& i4 O M; z$ K! x2 i mov ax, 1684h
; }8 S2 C s9 \: M: q5 u } mov bx, 0202h ; VxD ID of winice
; a* h& w* {4 x3 Y! L* N int 2Fh& P2 X$ F* z0 d. k. }+ S0 n6 V
mov ax, es ; ES:DI -> VxD API entry point; g: ~$ t/ c; B& n
add ax, di
- E0 U- `9 l' ?; K( z; I6 N& | test ax,ax1 w* H" A7 B- m
jnz SoftICE_Detected
$ _: z" I% k0 q9 r, u0 j! z- h# V6 D( g/ N- z! B. \
___________________________________________________________________________
; {3 M3 G% C6 q) K' G3 l8 T0 {8 j& Q; z; R8 V. f% _5 h' I
Method 045 [2 n& S9 z7 z9 k5 z% n% @
=========0 v1 v* I: B; Q9 {. |
' S' I. Q1 U6 \Method identical to the preceding one except that it seeks the ID of SoftICE
$ K9 l4 |; ^9 n6 j0 h5 [6 x7 \GFX VxD.
' B" y3 c: l6 V) v- \
0 N1 S0 Z4 J3 h0 Y4 p xor di,di2 Y7 |: c0 M! h2 l
mov es,di. I- Y6 a( }7 k. h6 D
mov ax, 1684h 9 }5 G* y6 D4 b
mov bx, 7a5Fh ; VxD ID of SIWVID7 j% `: ^5 \5 j4 S; H5 ?$ a
int 2fh
3 o8 T# ?; o4 v, ^& K/ ]4 Q mov ax, es ; ES:DI -> VxD API entry point4 J+ s$ m/ O1 A% ]
add ax, di1 W6 w+ l m7 Z3 ]
test ax,ax- i p9 U: b- p: I( h* Z2 }
jnz SoftICE_Detected
7 ^+ w; L8 t. F' s
8 Z/ }3 k* }3 D. K8 _4 s. a6 b0 K__________________________________________________________________________
0 t" i/ c O H3 ?
" s/ ~8 j# A" ^/ Q1 y+ {1 V
+ C+ u* i9 F; EMethod 05
3 o& T2 u4 W9 K7 s# @9 i========= x. q! V$ Y) c j. Z3 E8 x+ J
; A) g3 R* u) u* Z: h! I6 S- F4 x. lMethod seeking the 'magic number' 0F386h returned (in ax) by all system
4 s2 q) x* d" v7 C$ L% Udebugger. It calls the int 41h, function 4Fh.
/ M h( W" C3 ~0 D OThere are several alternatives. 3 ~/ z; ^% P7 M5 v! } l
- Q4 J, Z o# b- U% X, b2 lThe following one is the simplest:4 j$ y& {# G/ l5 Y
* _' M* h; I. s8 z
mov ax,4fh
8 I6 Y# {! D' ]) g1 W int 41h& _3 G* h5 C! k
cmp ax, 0F3867 G5 k6 n3 p$ Z9 Z. Q
jz SoftICE_detected
% w0 O& c# Q3 v8 R" o# m9 j4 H5 x' b$ e- K
' |7 {* a. b+ ANext method as well as the following one are 2 examples from Stone's & u, L' t0 K2 N# V7 _: \
"stn-wid.zip" (www.cracking.net):& }, D: x+ w" S i# T( `7 C0 o
5 }' ~- h: P0 l4 ?0 ?- V
mov bx, cs& [4 ]( D0 e8 k
lea dx, int41handler2
# T3 [ f% _; }! H xchg dx, es:[41h*4]
% k x4 i3 r. e, `7 Y xchg bx, es:[41h*4+2]& \1 J6 q9 k& x6 q1 Q
mov ax,4fh
) x* h8 G c/ n! w7 I int 41h0 }- M' h$ o+ e3 O6 s; M
xchg dx, es:[41h*4]9 a3 ~5 B4 ^5 @% [7 ]/ K
xchg bx, es:[41h*4+2]
) o3 ]6 j$ j( K4 q; S$ j cmp ax, 0f386h) E2 D; ~& }$ c. m7 Y
jz SoftICE_detected8 B+ Z* ?, s% b4 ~: ^
; x# K3 M+ g2 u9 n
int41handler2 PROC$ k- o M* H+ G+ Q$ |
iret+ U7 e' G; c1 m' g6 O# k: g
int41handler2 ENDP/ z" W9 W0 S( H5 V+ ~
3 i# Q9 X ~5 p7 L
1 q& Q e# m3 e& }7 ~2 {_________________________________________________________________________& \7 v o2 L( w+ z3 s6 p4 G+ |. B2 ]/ N
# a! I0 k* D0 E8 d0 |
. o) _3 C1 Z( M
Method 06$ u' p" v1 |, M% \
=========
4 O/ ?/ P) j8 J; J; u/ O
" w/ ?0 Z4 @: D+ T
& f: H. F+ p8 G+ x2nd method similar to the preceding one but more difficult to detect:
- n2 X8 ?9 V" J( R! N' x. N V+ Y2 F% e2 u- I+ b9 e
" z9 ?- d& U9 ]
int41handler PROC4 Q$ q5 t& c5 ?) `5 O! J
mov cl,al
. B9 @( b9 f, o0 W; H+ h% R iret
( \0 e) R; D* L9 \# Pint41handler ENDP
' l0 R6 x# W7 Z2 _9 }4 N+ D" J3 k; a9 }: h
: K5 p, j: O3 e) d xor ax,ax/ x F& Z5 \+ O8 H3 v. S0 O* ^; k
mov es,ax3 f, V0 @# |% R$ A% H" o9 V
mov bx, cs
: c2 V, n* T" h; w9 J* f- L lea dx, int41handler; N' y, W& j4 l8 q, N* E. t$ S* [. t
xchg dx, es:[41h*4]
( P7 s6 q1 |$ W5 |% v8 u xchg bx, es:[41h*4+2] x. b& Z/ t* P3 g' q
in al, 40h5 e# G" p4 E5 T; e* n
xor cx,cx3 f- q* Z/ h- A4 f5 v
int 41h
' r/ ?& k J% i xchg dx, es:[41h*4]
( J0 f: x/ N8 o( U) l xchg bx, es:[41h*4+2]
0 B, ~9 ~7 p) w! U# v1 h6 V/ ~ cmp cl,al
! P6 {4 v C' R, O6 t jnz SoftICE_detected
! F- F" q9 V |6 d: R! g4 q, @( J+ X7 z- S0 N5 ?6 m
_________________________________________________________________________3 t) q. f( G- S0 z
. q6 C6 t- j# Y' y" w! L
Method 073 b: V$ x) a4 j9 E \* c
========= m0 S- i; U1 W; S& f! {0 H
: j+ h7 F+ E/ q1 \+ O& F2 _
Method of detection of the WinICE handler in the int68h (V86)* B8 I7 V& x0 W- i9 ~. X
7 D0 s4 x9 u: y
mov ah,43h7 j9 ^3 T% I/ X8 `8 I
int 68h
' S" B4 c" `1 c, f- ^ cmp ax,0F386h
' q/ ^. B4 e# H+ U jz SoftICE_Detected6 ]! ~8 O0 i% k/ }
: j+ O& l* I" E ^8 b% S- j8 f7 U3 n, z
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
7 M% V* \ K& o6 L9 N# g( b9 ] app like this:
. Q l( y% X/ S+ ~! [ T; g- R M
6 n; c( P; D7 a6 |: ^ BPX exec_int if ax==68
) h6 y! F( m( Z" n (function called is located at byte ptr [ebp+1Dh] and client eip is
: D4 v* s0 z7 n% E; y! q located at [ebp+48h] for 32Bit apps)& ?4 c& C, d1 L& h& t. I2 W5 g
__________________________________________________________________________/ a0 l, ^3 y# |
3 {* h# ^1 ~# f; I4 T
3 N% e6 Y* y. Y$ P' t# s. V
Method 08
* n1 y8 x. L: \: @$ G9 ^ v=========
" M, y5 b7 Y. L3 {! j' S$ p4 V2 d* X* u# _% p
It is not a method of detection of SoftICE but a possibility to crash the
( ^' W. w( [1 C- u/ l$ {# }* x" h: isystem by intercepting int 01h and int 03h and redirecting them to another
# G2 X0 T5 R" iroutine.
' t3 K, f! y- eIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" N! s+ K6 X1 c; N( g3 k, pto the new routine to execute (hangs computer...)( `; o$ c$ S- j+ N$ J$ U% |- n- E/ M
% p8 Z3 Q5 v! x7 P; i3 B! `& p9 Y
mov ah, 25h
/ c4 z* ]4 B4 N! n4 l+ m! k mov al, Int_Number (01h or 03h)4 c3 R; u4 z- C R; c
mov dx, offset New_Int_Routine( }9 Y7 A* s) E3 {* l' ~# e; p
int 21h
8 j- {. x, W. s+ \0 |1 v s1 u3 \
& Q, }- L3 }& c__________________________________________________________________________6 R ~% [' ~; A9 e
1 v# C. [! C1 C7 F3 O1 w" eMethod 096 _; w/ u* y4 N+ o$ h
=========/ ]3 x3 b: a% w/ f. P& K) y9 }; A
/ G/ Y4 r# O9 Z6 j8 t$ s- r6 s# A4 L
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" n3 o+ J b, v# O! {: E- N# U
performed in ring0 (VxD or a ring3 app using the VxdCall).
5 f2 p" p8 H. h5 n; `The Get_DDB service is used to determine whether or not a VxD is installed
" j: _4 g' o9 m4 q+ Mfor the specified device and returns a Device Description Block (in ecx) for- c1 E! U. N7 |" W
that device if it is installed.
0 @: C5 w% f1 ?, S2 H' c9 p1 o1 k( X& i. C. e: w( w' U/ J! {, Z
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. `+ T& S8 _/ O/ N! j2 F
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 l6 k, q w n/ e
VMMCall Get_DDB
2 t9 y, I$ I6 Q0 N* ]# k; T6 g mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 K2 M* j3 ?1 y7 q# E; V3 `
7 s. C; d6 q' f8 g8 E' B' q) c
Note as well that you can easily detect this method with SoftICE:
" g- A# a6 w, Z1 ^ bpx Get_DDB if ax==0202 || ax==7a5fh1 m+ I% u `$ B6 \1 W0 t
3 M5 X+ B$ y% r' N9 V8 T
__________________________________________________________________________8 W1 l$ c; ]7 @* z8 Z3 S- E
( K8 a8 S2 F7 ~) v9 h
Method 103 {: ?. u& G- f) |
=========& f+ D; @0 i% ]$ Z2 }0 y. {) `
0 ~+ G5 U2 u/ ^3 u4 I6 m' w$ ^=>Disable or clear breakpoints before using this feature. DO NOT trace with
; F! ]5 i( y# m5 j SoftICE while the option is enable!!1 o2 h+ d) e- O$ y1 v1 `2 [7 a; m
R: P. k3 B$ dThis trick is very efficient:
; P( I& S% c) A( Gby checking the Debug Registers, you can detect if SoftICE is loaded
4 _4 T9 j9 [& h0 Z. u5 W(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' G$ l7 ^( m& j. z) N* xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
( A3 N# o, s0 f+ a; V" Z$ }value (in ring0 only). Values can be manipulated and or changed as well- e4 g, O( ^0 d" V% {
(clearing BPMs for instance)
( Y. J- q) s- L# o
* e5 c" f7 @9 V% E2 q8 f__________________________________________________________________________- z5 [8 m0 z) f4 [. \
( I- [+ L$ y. T6 R
Method 115 L" D- S, C8 X
=========
6 Q& e; d" \/ O l2 b) P, P( ?5 Y2 k3 Y$ ^
This method is most known as 'MeltICE' because it has been freely distributed
7 ^* A. W- t5 S3 a4 w2 ~via www.winfiles.com. However it was first used by NuMega people to allow
& r' u0 H/ g# P9 Z0 H- v" mSymbol Loader to check if SoftICE was active or not (the code is located X- P1 n# ^* {! y) g/ T4 Y9 r! G
inside nmtrans.dll).! V; g' }' ^! Q8 a% F' h& ?
" @8 m2 a/ ?1 R2 ^, L* [9 E
The way it works is very simple:
6 h9 [! X* A! e; X4 m; DIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- s! ]- e+ U4 bWinNT) with the CreateFileA API.
5 G. H* u/ w- u' ?" ^3 Q7 y
* j) |$ }, s* o( i! }; r5 y2 _Here is a sample (checking for 'SICE'):4 }: d( W4 J. o9 A
0 I0 I8 N+ l& g# k# T$ r8 |
BOOL IsSoftIce95Loaded()
" N2 X( T# e' f" i- M" k% W{, R: U9 J4 w7 Q: {
HANDLE hFile;
`$ F2 }4 T C2 p3 Y ~. I* U hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! j$ h: J" _( a FILE_SHARE_READ | FILE_SHARE_WRITE,6 s, m5 P. X9 O0 a z" I
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
/ ^1 l3 j+ c& [' t, t if( hFile != INVALID_HANDLE_VALUE )
; Y# @7 m4 d' z4 |$ C0 E, L6 \ {& s5 o, w. b1 }$ F
CloseHandle(hFile);
2 Z1 f# }% p* H4 R X return TRUE;
0 j$ ]1 D- d. O2 }3 T9 R }' o* K# j5 V {5 s: y% ^
return FALSE;0 w$ s( @) B9 I) R
} n) S ~% B: `4 J/ F; C' ~
+ s8 z7 B& b1 V' e9 xAlthough this trick calls the CreateFileA function, don't even expect to be
. ^) C* U! ~& O: g4 E: \1 R. n; Sable to intercept it by installing a IFS hook: it will not work, no way!
4 C' t# E/ v" @In fact, after the call to CreateFileA it will get through VWIN32 0x001F7 N" ]9 s9 j: q; t W, U5 N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function); ]% }# N$ g3 ]* {3 J0 F
and then browse the DDB list until it find the VxD and its DDB_Control_Proc5 I3 N: [& S o4 `* J1 U1 g
field.8 P& X8 R6 {9 C4 Y7 j
In fact, its purpose is not to load/unload VxDs but only to send a 5 b F7 R0 Z) p6 n |- O; N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ f$ L6 G" G/ x4 S1 v j1 F2 Y( {to the VxD Control_Dispatch proc (how the hell a shareware soft could try! U3 y/ L! t8 ]' h0 [- q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).8 J1 H. ?8 ?6 U5 @; {
If the VxD is loaded, it will always clear eax and the Carry flag to allow: X1 m8 O' j$ L4 Y4 U) o$ h
its handle to be opened and then, will be detected." d& v1 Z4 B# U. W1 i
You can check that simply by hooking Winice.exe control proc entry point
4 M$ z9 v/ Y7 ~) Ewhile running MeltICE.7 D1 i& T6 d6 _
f- l# J( Z7 h3 p8 O u
. p8 c1 m& E! j) N
00401067: push 00402025 ; \\.\SICE
. j( x1 L0 F; \8 l# L5 W- i Y 0040106C: call CreateFileA' t$ R1 x) B: G5 A* F7 M# m* n9 X
00401071: cmp eax,-001
* N @, F) K) ?* a& U 00401074: je 00401091
6 ? h" V5 @" u! t* Q; g2 r/ W0 r: \9 `1 l
/ Z& B _) X( W3 ?+ [
There could be hundreds of BPX you could use to detect this trick.! K! S2 g& b( Y# d) r+ b
-The most classical one is:3 {: ~; z+ R$ m: O8 [- {4 k5 f
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||' g1 L. e1 i4 D$ l4 |
*(esp->4+4)=='NTIC'6 g6 T1 p! r! o0 z, \. ]
: w1 T# P! B& [& q! H) _-The most exotic ones (could be very slooooow :-(5 L' N1 E+ X6 \' }6 r& U+ I! {
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: T7 r) z$ \2 p9 M5 D ;will break 3 times :-(
& ?5 P( X w4 Q0 F$ ?2 J" V6 j7 F. A
8 d" I. V0 A' {$ P% @# W-or (a bit) faster: ' n/ H0 z E5 K& Z
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 J7 T! ?3 W- j0 r F6 {9 F
3 u3 \! h: T/ h BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
& l1 ~3 N; P2 [+ G9 K* o ;will break 3 times :-(- A8 I! v" }* q" }: L/ v
8 F/ w/ K0 B( t" [3 h, q- t9 N( r) t-Much faster:
/ G4 A* G8 \ j1 g" _* l BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'6 {, z6 a- R& `& ?3 x
# d: [* ]. o0 R4 p6 o* q" E% `+ m
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen7 J2 _ i' m; D; D: p; y
function to do the same job:! e( ~6 w7 K2 X% L B
& v8 C5 e9 \2 U$ S1 r. P
push 00 ; OF_READ
( N8 o' F4 K Z' C6 I% i mov eax,[00656634] ; '\\.\SICE',0
- N9 Y# C [7 c6 V! _8 G8 K push eax: B0 P, v8 H& s/ v( r
call KERNEL32!_lopen
6 d# a* Z- x# p& d inc eax, v. ~8 \% p3 Z/ u: {7 G3 u
jnz 00650589 ; detected
, Q5 Q+ D6 i. W5 B/ I! t$ { push 00 ; OF_READ- G5 o2 h; M4 B0 J1 V$ p
mov eax,[00656638] ; '\\.\SICE'
u+ X+ P' c2 ?' ]1 V push eax- d# \# u) p0 ~: X
call KERNEL32!_lopen! C8 J; }# O" x7 r
inc eax# [$ P" _4 D0 }1 E4 d% N
jz 006505ae ; not detected+ ~. z) v4 Y, ~
! Q; N3 n9 K. K, x( x
. z: H1 d: N- m# L# F__________________________________________________________________________9 @% R2 u7 a7 R2 |# \0 M
9 A# @% G- A# {6 SMethod 12
+ q0 V& F+ c4 p5 _=========
% v. M. h6 r& I3 n, o0 F) z7 q( p( s! q0 w0 ]
This trick is similar to int41h/4fh Debugger installation check (code 05
6 H, i0 M0 t! z9 a1 o& o& 06) but very limited because it's only available for Win95/98 (not NT)
6 B L/ C1 Q1 O, yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 T8 \% e% g. A3 Q# L1 D
- I1 V) r- X. L! ^/ G8 B# E* R push 0000004fh ; function 4fh
: d4 o" s! f) _/ u push 002a002ah ; high word specifies which VxD (VWIN32)
+ \) N% D4 L0 v/ F6 S/ y6 g# v ; low word specifies which service- q/ L# `* p1 a' e4 ^5 s
(VWIN32_Int41Dispatch)* l, r5 N4 y0 X$ r/ X- I+ n2 K
call Kernel32!ORD_001 ; VxdCall5 t) S" r5 q: a# C9 N# l% }
cmp ax, 0f386h ; magic number returned by system debuggers
. |! o/ V4 b0 ` jz SoftICE_detected# K4 H- ^6 L! q( }
+ Z* q1 \* Y& |3 q
Here again, several ways to detect it:6 v: v: ^5 n5 ]) C/ a4 L
9 c$ F) f h% C5 x+ b2 I) Z BPINT 41 if ax==4f
5 Y: [" d3 |8 p. K: n9 g/ r6 A
0 d# t& ]3 B W0 C2 N' J/ k BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 @* z0 z/ {5 Y! |& S2 q
; r8 ^: v- X1 X# u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" {/ I2 `; y T. D
5 }0 c0 D/ T5 F9 l BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 z P" z) W+ B0 z! G7 V+ {( \, [. c5 D3 L
__________________________________________________________________________
$ Q8 w1 @& G6 x% I0 j, ~+ r+ W/ Q: @: W& ]% y
Method 13
8 k& S( f/ q4 E, M O# O=========% `% W! m: m1 N! \
/ J; }! m1 ?; s4 p6 ^5 [) C
Not a real method of detection, but a good way to know if SoftICE is
3 h1 X2 P, |$ Q# P0 Zinstalled on a computer and to locate its installation directory.% ?+ H9 ]% W: ]7 w! e1 h8 i
It is used by few softs which access the following registry keys (usually #2) :
4 M/ C/ x H# o+ i( Q5 w1 T: W, Z+ F" k7 h
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( g: y$ F3 N% l: H# ~! z* R
\Uninstall\SoftICE9 I7 i5 ?' U5 f2 W5 s* \
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 V% \. @: h @7 r" B
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
5 y( b# C% h/ v1 Z3 C, R1 {\App Paths\Loader32.Exe
5 q. n: R4 S+ K, `9 e9 d
" J2 H- j) h% h: p- K+ X6 F+ z* O5 E: |. f9 F( C
Note that some nasty apps could then erase all files from SoftICE directory
) T; r! t( x+ W+ c" ^3 y(I faced that once :-(
& E# ?8 i, {# |3 k9 t2 E! y& b( H
Useful breakpoint to detect it:
% l! X3 @- x) E1 Y- r! b0 R+ C% r4 ^9 `. L8 N/ N6 s1 `
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; o% ]& i) L3 @! a) ]4 O) i
: E5 _. `: J4 y* ^ h__________________________________________________________________________/ c; g# q3 z8 t( V+ G
/ z3 F r, g o- I u8 b. x9 N/ b; }; ?& W
Method 14 " c% Q7 i. F. Z7 R% J% L
========= H% o! X" \/ C3 I
, Q1 p- w3 [/ z' j, B+ U! b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& b- D+ j8 L2 ^
is to determines whether a debugger is running on your system (ring0 only).
9 Z8 J5 K3 J: q" `! n- s1 L, ]" K4 u" z
VMMCall Test_Debug_Installed
8 i8 [ h2 t/ C je not_installed0 \6 T, |* {2 j' {
; l9 ?" m% G9 t: Z7 f2 m/ lThis service just checks a flag.
4 S: T& t0 {; y' U9 m: i- b, g</PRE></TD></TR></TBODY></TABLE> |