<TABLE width=500>
: Y0 o+ X- v/ s7 C- ]: X<TBODY>/ g# ?- }' [; o" ~6 R" v0 M
<TR>; Z0 c" l- i7 z/ \ l, q! o8 |
<TD><PRE>Method 01
8 i% s2 Z! {2 m B0 w=========
7 L8 ~. s# [7 w2 A0 k% q2 G" P5 O6 y+ T, ?1 `
This method of detection of SoftICE (as well as the following one) is
+ i+ g) a2 N7 g; _( V. e, Zused by the majority of packers/encryptors found on Internet.
+ ]% s6 S* d' t; }$ z1 EIt seeks the signature of BoundsChecker in SoftICE4 t/ R |. \% y4 q5 W0 u1 c( h
4 z7 A8 J: F8 _8 \. Q% x, M5 ^ mov ebp, 04243484Bh ; 'BCHK'; o2 V- H! v$ }8 `) L4 a) b# _
mov ax, 04h' P+ d2 g! J! d8 n7 V
int 3
7 L8 Z) T5 w/ M% c4 O: J3 o# V) w cmp al,4
9 `9 m- }/ W+ |9 V ` jnz SoftICE_Detected
( X; v; u/ H: V0 Q8 t" n( I6 `5 @, d7 r/ `0 F4 Q7 z
___________________________________________________________________________/ l1 X: _) w' X# ^. @0 {, |
4 R6 K2 w4 j1 s2 O
Method 02& J0 B1 @9 t; V, T1 H
=========
( t4 P& }$ t$ |7 z, B5 b! l: i1 f: U8 _, B
Still a method very much used (perhaps the most frequent one). It is used( Q# k* S5 v: @" L* Q1 p
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' _" Q9 W8 e3 @: l9 P% r
or execute SoftICE commands...9 i+ Q4 L- M$ ]% r1 V. y
It is also used to crash SoftICE and to force it to execute any commands6 W/ q6 j" t# B! d" N6 }: ]
(HBOOT...) :-(( 7 |" Z9 C* K8 P: L5 N1 |- D3 n
$ T/ ]$ [ o: F: t. z1 R5 m% Q
Here is a quick description:
7 h" D( }' `9 }, y; s-AX = 0910h (Display string in SIce windows)
8 w. F+ V; ~* H0 G8 c$ q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 e7 [0 v5 G: g$ `
-AX = 0912h (Get breakpoint infos)
& y- S1 ^0 f J-AX = 0913h (Set Sice breakpoints)/ \/ O+ H) B8 X6 D* u. H
-AX = 0914h (Remove SIce breakoints)! N. |9 M* k2 H- P |. |
1 N/ Y, L" Q5 ^6 O XEach time you'll meet this trick, you'll see:3 Q0 C6 o. R6 G7 g( v
-SI = 4647h! k& i4 m' O2 m' J& K
-DI = 4A4Dh
7 {. S$ x' s8 \ D2 a8 eWhich are the 'magic values' used by SoftIce.' u. e/ j0 }) O8 |' E! l, p0 G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- x# Y3 ^& h; N9 ]7 I& ^. i
$ m; ?- o* T4 DHere is one example from the file "Haspinst.exe" which is the dongle HASP: n6 O4 f7 ?: D
Envelope utility use to protect DOS applications:% }9 H/ Q2 Y; d. k
w: X* j! d3 @: \' H4 e% p9 R' e5 ]6 R& n$ [: S# N
4C19:0095 MOV AX,0911 ; execute command.! M+ m4 [: l9 a
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: q% N7 S+ Y7 q" X; ^
4C19:009A MOV SI,4647 ; 1st magic value.
# {2 g/ O% E) ^) Z- h4C19:009D MOV DI,4A4D ; 2nd magic value.
1 r, P. n# ]2 J9 C, s# a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
- y2 Z, S- N2 z# `4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
, u8 J/ M# h& T4 d& B+ @4C19:00A4 INC CX
" ]! a @, ^$ L4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 j$ o( z% D+ ]8 I4C19:00A8 JB 0095 ; 6 different commands.5 k6 b S1 v; W: b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
& h1 P m5 c0 q$ L7 C+ l4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ g2 L7 U3 W( A( @# \" D
, k% _3 {& X- t0 X dThe program will execute 6 different SIce commands located at ds:dx, which" J% T8 ]" [6 d0 C3 [ {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.6 }# ]+ \: m; Y9 |% w$ C
) e- ~& Q2 M T1 F& [; m! k
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." U$ M4 c0 R3 m9 r5 d
___________________________________________________________________________# X5 k+ g6 q( l$ M
" q" S7 ]% |6 C2 c
4 T2 u2 I9 T" u. ^' X0 B1 [8 }$ XMethod 03 c" Y3 l/ F5 F% d
=========4 \$ e7 F1 \5 k& U$ k
3 C" K4 c9 ?' {8 |& N3 Y( h
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- \- ?8 L( W, a* i, I* g(API Get entry point)
. O2 l% z% b9 U, s+ r
- z, X! b- X- \* C) z7 R% Z8 |' r3 p( m* J! C) T' N
xor di,di
+ u* `9 K4 k. V* A mov es,di& p' g' I: L0 a7 E* _( v
mov ax, 1684h 0 c! k# p6 |: Q2 R6 t% c6 p
mov bx, 0202h ; VxD ID of winice
" }" E7 h; f4 V# j0 ?$ }% l int 2Fh
0 t7 j* j, }+ [& ~; v' l mov ax, es ; ES:DI -> VxD API entry point6 O9 z% W5 \" F' x6 w. m
add ax, di
* \; ~1 k6 C% l( B s2 D/ H test ax,ax4 v/ G0 U* }# z$ Z. D* g
jnz SoftICE_Detected
, N. r7 A& Y* _) ^$ w7 G! ~8 _
; F4 A* F# I* W R5 B___________________________________________________________________________
7 `0 U4 m6 M v. i8 E
/ _( t( W* Y7 |6 BMethod 04
1 `5 a9 v6 W8 N! g5 ~ R/ |=========( _9 q% l D; p3 l/ C2 S
4 t: H7 D6 _) b7 |& E$ a! k
Method identical to the preceding one except that it seeks the ID of SoftICE _# _, l) X8 j0 i5 V; A4 I, z, E
GFX VxD.0 n1 u7 Z( l: n4 q
# S/ [! q9 C' R: [( r8 V; m xor di,di" m& _7 X* j3 i
mov es,di- |* \& y" e0 R3 L$ E2 j5 z( o. W5 U
mov ax, 1684h 8 e8 h# H" y1 `& g2 W) m- u" O, W9 T
mov bx, 7a5Fh ; VxD ID of SIWVID) u5 X: f( `6 q ?2 z P
int 2fh/ V# K6 H4 b g% k, e8 t2 L
mov ax, es ; ES:DI -> VxD API entry point
$ W; F$ A$ h0 T7 U& S add ax, di/ j# E5 p: I, U
test ax,ax
" P3 _4 u7 z( k& c jnz SoftICE_Detected
( |. `; j+ i: d- R& w- [) t9 x3 [- e' y6 Q1 p) m
__________________________________________________________________________" T! y6 w& U3 B& [& Z! @
3 Y0 o' z' |& K$ i" S0 S
0 \( I$ s/ \4 o8 N+ {Method 05
6 u6 n8 N7 D* H% a=========& {6 J- L4 b) j& u8 Q* ^# x, q
' N' C2 u) s, S7 S& ^Method seeking the 'magic number' 0F386h returned (in ax) by all system
) }: V9 L* M3 e8 j$ K+ m3 O+ hdebugger. It calls the int 41h, function 4Fh.
- O" i3 L9 [$ `* g% o1 f0 i4 ?There are several alternatives. # X' S+ x* t+ o; ?& Z" z* V. p
1 N8 C. k, _' S) z. T3 q7 u' [( h/ W Q
The following one is the simplest:
2 _0 x5 K" E `8 I( ?! V" w8 V5 J* t' x7 D
mov ax,4fh; F0 ]. }, ]' i
int 41h
1 u5 V5 M' a$ w0 v4 E, E cmp ax, 0F386& `. d" ` v( z4 x7 n
jz SoftICE_detected: {& b3 {# i! g2 p f4 S! ~: N
$ d4 w* g8 O3 Z# k
( q5 x) \4 i7 C8 U) h. ?- L) |8 s. E
Next method as well as the following one are 2 examples from Stone's ' C0 [! L, u; A% ^5 A6 Z0 n
"stn-wid.zip" (www.cracking.net):
( }* J/ U% ^8 E3 D* Z3 I1 @# C
$ s, b: t' m( y2 m) P mov bx, cs
5 B3 j) D( C/ P lea dx, int41handler2
) B: _: R) [5 ~2 ~# v xchg dx, es:[41h*4]
, Q3 V( u6 X. y2 t7 M; ]1 d/ ]- }: m xchg bx, es:[41h*4+2]
$ v8 r, K0 [6 u- R mov ax,4fh/ v w: A1 H7 @$ X
int 41h! D! h" y3 Q, l: E. X- f8 J: {
xchg dx, es:[41h*4]$ e& d8 f2 Z, z U! e9 S
xchg bx, es:[41h*4+2]
& G0 q* U$ s1 O6 Z( V) }: E' G cmp ax, 0f386h1 i$ A- |" X. X- Z2 |
jz SoftICE_detected
2 c- C+ f/ E2 I# _
5 _9 p* m* g* r1 w$ q9 E: Y& Mint41handler2 PROC* z; e) a" |( {% m
iret
% q# v/ I2 g4 J2 k+ A. @int41handler2 ENDP" y5 u' E9 M! Y z$ A) _ P
3 {; P; _8 U1 U7 |
# h: L+ h6 |6 ]5 S
_________________________________________________________________________
7 q6 C9 g+ n( ?8 K, A2 N8 b
7 O! y0 i8 y5 H& C3 {" P; s
8 p7 X1 j4 B! w7 H, D X, ~4 J7 oMethod 06
9 Y% d3 o* k( U1 |9 w=========
! @( h! x W7 R, A) Z2 y7 I- ?
+ E; O3 `6 R/ H0 }- h* w) z9 o4 P& Q' w) A! i" l
2nd method similar to the preceding one but more difficult to detect:
& L/ x# l# [8 h7 y+ T* W6 n5 M6 N' n" F. X5 L: f
5 T$ X8 o+ B C. T# w. b# {% Sint41handler PROC5 a! t. ^1 [ C
mov cl,al$ D4 L: H8 P- ^& q! |& x1 k) \
iret
& [5 j6 u, J( i! D3 C: L7 o: dint41handler ENDP
2 [8 [9 f* M, Q6 N( U; t$ D6 X; t
$ y8 }. e7 E. t* ?! p5 t9 Q% G v0 \) h# e5 p8 O" b6 D
xor ax,ax9 |; o! d; p9 Z! a0 B1 x
mov es,ax
& M9 l$ s$ B5 h* o; I mov bx, cs
+ j0 U8 ?5 Q) I/ Y( f" j lea dx, int41handler
X }% q; g8 d5 _! B; [( F9 |- R xchg dx, es:[41h*4]; ?" E1 \& h% c& ]8 j
xchg bx, es:[41h*4+2]4 w9 n0 t1 C3 e6 M' J) E
in al, 40h
5 y, ?8 \+ i, H& A3 |/ T xor cx,cx$ v& {( f ?4 d
int 41h' ?' A# B" B2 f8 o/ t6 g- r0 |! j
xchg dx, es:[41h*4]
6 r9 P: _. d, D% u% ^! a! R xchg bx, es:[41h*4+2]
6 V6 x+ F5 W2 V! R. b, ^ cmp cl,al" V2 y: ?2 B8 i6 I
jnz SoftICE_detected
' u" [; l; V+ @, h# d0 o, z
0 ~6 d2 L0 Y0 K$ \_________________________________________________________________________$ g; f$ k: |5 f k7 Q7 X! u
H( D- ]/ y" H% y
Method 071 m, O h6 N: K: s. |& H
=========
- b* E+ K) c3 l, Q9 ]
/ w6 Y+ {4 D7 _5 a5 aMethod of detection of the WinICE handler in the int68h (V86)
. _0 \: {6 j2 k* W
8 Q) }8 j3 R5 s# m, K- e mov ah,43h, f1 R# P: j$ y
int 68h, R) J* K B% D+ \% f& Q/ B, P3 X
cmp ax,0F386h
: J' x% x/ g8 _$ M8 s jz SoftICE_Detected# x4 O9 \% }* m8 a3 n) ]
+ G0 ]( y# i; S. w- o* d' M
- B- p7 W a- n5 o' c' l) j3 i! F=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* E9 d6 Y; {6 U: X* S8 Z
app like this:
' W4 k# M, a1 k3 ], ]$ C
$ H( B; P% H6 ~: R# u2 O" p BPX exec_int if ax==68) W1 q6 l6 o; I& r8 m2 D
(function called is located at byte ptr [ebp+1Dh] and client eip is* }; N3 J+ k g5 t2 ]
located at [ebp+48h] for 32Bit apps)
) l5 N" ]7 g8 p__________________________________________________________________________, _9 u& T, |& [8 h
1 ?/ {* O1 S" W8 e' ~' r( }
6 q6 e6 b* N. T( ~2 X, R! _
Method 08 s: e7 C6 j L. V& |
=========
0 |* S1 C4 q/ f/ g" A. Y u, K9 f* @% Q: r% U9 g* `, ?
It is not a method of detection of SoftICE but a possibility to crash the
: O. N6 m3 N/ D2 ^system by intercepting int 01h and int 03h and redirecting them to another
7 J+ K0 |9 S8 R5 o/ ~& croutine.
: V7 V" G& }( m0 D4 G2 Y5 D2 }It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points) n) c: A9 b3 c" G0 L- a
to the new routine to execute (hangs computer...)
2 ]" q2 C, C( q' N/ k7 Z, ^2 @$ K2 \" l& H5 c% \
mov ah, 25h
' t9 g. [2 k9 L mov al, Int_Number (01h or 03h)# T7 l" _# c+ i4 A8 V8 j- G+ w
mov dx, offset New_Int_Routine
! ~7 m8 o9 p! u% F6 V0 t, b int 21h6 ]7 B+ f* K% I7 @, |& Q
/ W3 x' h L7 @* Q" M__________________________________________________________________________
% u1 A& |5 Y+ g$ C% k8 v5 I @$ J# X. C; t h
Method 09
1 h0 t9 r; G9 _! Y% [; H0 x0 \=========- {* G/ l/ Z6 T+ d
' A: X8 b( u: F4 I2 `8 H9 jThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 `4 v/ Y2 u O! Z. Wperformed in ring0 (VxD or a ring3 app using the VxdCall).
% u4 A; a/ e2 \+ X+ A9 dThe Get_DDB service is used to determine whether or not a VxD is installed
- k, Z' F2 u' b& [+ k; F5 Y3 \for the specified device and returns a Device Description Block (in ecx) for
) N7 u* m; y2 u1 \2 W. Ethat device if it is installed.
7 W1 W6 c% I" j! B9 O. p" p
3 D# x, g$ Q$ ~7 m7 C mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
( i. S: a$ a# c' d mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 \. H/ A! @) T/ r( {! k
VMMCall Get_DDB+ D/ c% n) y8 x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
; ~' N: B% Z$ w1 C, ]7 f [8 A. o& ?, j5 O& a2 x: F' ~
Note as well that you can easily detect this method with SoftICE:" S9 l7 w L/ d4 k3 {
bpx Get_DDB if ax==0202 || ax==7a5fh# M' @# E6 e8 U# l p
% O5 m3 z. t! t. s' V0 T
__________________________________________________________________________
/ r9 B8 ^$ i( }* X: m0 o( @, |6 |# L0 `7 k
Method 10
2 k7 \2 X6 E5 M* m6 G$ e=========
9 I5 C- c5 L) [& l) s) t# Y2 S8 q3 ^/ B3 ^- b) ?1 h
=>Disable or clear breakpoints before using this feature. DO NOT trace with8 h- o$ h ?4 t, Y2 e1 F- H' q) _8 V
SoftICE while the option is enable!!
3 l9 {5 _7 g- x0 b$ t7 u* t
) A: W8 l7 i, ~0 z& g" KThis trick is very efficient:- L% s+ {, x) Y% T! B% R2 F
by checking the Debug Registers, you can detect if SoftICE is loaded" I0 Q3 ?; Q4 v$ g
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 r8 I# v( Y @' x1 bthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 U* P+ L& U% b j/ p! |) N) R
value (in ring0 only). Values can be manipulated and or changed as well
' Z9 S; _) t* J(clearing BPMs for instance)
$ y; _7 h" {) x- m" n
- {( O3 o" Z: w4 a& v__________________________________________________________________________5 K9 e* B7 q* r& V
& B2 ~# s# Q' K+ x ?5 z* JMethod 111 z3 y, z$ U& W5 y) D, a
=========
! ^4 d& N' H' I9 J0 z: O& I C' ?# P( J7 O: @+ P
This method is most known as 'MeltICE' because it has been freely distributed/ i9 l( w: |% I! M( P
via www.winfiles.com. However it was first used by NuMega people to allow; J" M0 D! }& T. B3 @& v2 z
Symbol Loader to check if SoftICE was active or not (the code is located/ o/ ~# G" Z' ~; c
inside nmtrans.dll).
4 J# B, k! O" h! I" Y1 t* M2 P1 |# h) I
The way it works is very simple:* l- l5 d" m1 T. b8 w) W( h
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for* ~8 ^% k; u, k* ]( _# d
WinNT) with the CreateFileA API.! i I4 T# n1 l7 M
$ X2 _, i, f5 c
Here is a sample (checking for 'SICE'):! K3 W4 H3 {# u1 {# W0 ^
& `; {8 d+ h( B/ D- y2 mBOOL IsSoftIce95Loaded()( e! G$ ]$ S2 w4 i6 r+ _
{, W( Y/ m; x. C, U) ?7 I& m
HANDLE hFile; 7 w) }# M0 B( f% @7 c, Q- J
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* y) [! _, d, F6 J E
FILE_SHARE_READ | FILE_SHARE_WRITE,
) C% M8 s' i( G NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# ~" t; z5 U( P2 B/ K
if( hFile != INVALID_HANDLE_VALUE )0 Z9 K/ q: ~9 N' R8 j$ _( H. \$ u
{
2 U4 k+ j+ Y5 `) I CloseHandle(hFile);. D) b7 F# w A+ n7 I# v# n; G& H
return TRUE;
* r/ F8 x0 u7 e% | X* v2 z! @ }
6 @2 `$ ]* o4 O; Y' X& T+ l+ G return FALSE;
1 D% S3 [: i" }5 s$ @- l- {( \}3 q4 {+ b W% P, S! [" p! g- W
7 @- `/ W. b2 x5 \5 ]0 s5 u9 BAlthough this trick calls the CreateFileA function, don't even expect to be8 H. N4 k! u! X; t' Y
able to intercept it by installing a IFS hook: it will not work, no way!
+ ]) Q$ O) V$ h' \, H `4 P$ PIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 O. \9 P3 J! Kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 P( F5 ^# _8 G( y$ ?$ J. x5 K
and then browse the DDB list until it find the VxD and its DDB_Control_Proc) d- ?3 J7 T/ C$ f% \) Y
field.
, _4 h5 G0 s7 Y4 a ^8 N* MIn fact, its purpose is not to load/unload VxDs but only to send a # h. V1 X2 j% _/ s! M) h2 B$ E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ z9 \$ Q4 Y. W0 K& l: @- Vto the VxD Control_Dispatch proc (how the hell a shareware soft could try- m% c$ j/ [. i+ \$ T4 i
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 L9 X3 A0 x5 h I( }: Y3 @If the VxD is loaded, it will always clear eax and the Carry flag to allow) _4 e9 h0 ]$ K. t+ c2 B4 d
its handle to be opened and then, will be detected.
/ R* R) V" T, y# uYou can check that simply by hooking Winice.exe control proc entry point* y j& ?( w( f* S/ ]# a
while running MeltICE.
. b' ~& N4 {( N9 x9 ]0 |
- N8 n8 C8 d+ Y: A
% g" x- { f3 c: ]) R: W 00401067: push 00402025 ; \\.\SICE) G- @" X% k, \6 L& W6 P
0040106C: call CreateFileA
# s8 E+ Q9 o1 _* d$ t 00401071: cmp eax,-001
4 ?0 F7 S) A7 j z 00401074: je 00401091: I+ o( y8 S( c, K
0 V. I/ h: o: b, h P% }
' d: D( ?' M; i y& N7 wThere could be hundreds of BPX you could use to detect this trick.: w/ W% }. D i% K$ h1 A0 ]& b Y
-The most classical one is:. k8 t! I4 ~0 o& e+ b a% O, ~
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||; g6 C }, ]3 \/ }1 I9 [
*(esp->4+4)=='NTIC'# W& c q! Z! U3 e: W# C
+ G) P: v9 }* t# M( f-The most exotic ones (could be very slooooow :-(1 F. ]( y2 k9 _* Z5 m
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 `! k/ i' \# H
;will break 3 times :-(( ?5 q, k/ K! r+ O8 j5 L/ E
I; m ?; H+ R- k8 N: b- Q-or (a bit) faster:
$ j/ n* o% d! M: O, R" P% p7 o2 e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! |. m7 a( k& x+ _% n f3 w8 l( w! [0 S' t, Q1 G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . Z& y% v; X6 I" t# ?
;will break 3 times :-(
/ M* w2 Z/ B' z, E* g8 M* T, b1 }6 @! `* d9 q6 m# T3 T B7 a
-Much faster:2 Y1 V" r }* A/ o
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ v, [. i8 u$ V# G) O$ c. ^
* ^) |( d @ zNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
, V, c& d* }/ k Efunction to do the same job:
* Z; A- r; q6 i. o, W$ |& U: x" f
push 00 ; OF_READ$ O/ y4 A8 v M4 p7 a9 z5 q: [
mov eax,[00656634] ; '\\.\SICE',0/ h* K# B1 Z& @5 j. O
push eax5 O) J; E6 t: x) H
call KERNEL32!_lopen: g4 s" @8 N6 `; j
inc eax# [- T) Y: U. o+ J8 N, B& H
jnz 00650589 ; detected
" R( D# e6 O# J) y: K7 p push 00 ; OF_READ% k5 s1 F. S- G& L1 k1 C
mov eax,[00656638] ; '\\.\SICE'
1 X& z/ B' [* D# X* f* V8 l- Y) _ push eax5 X! W( S7 {3 q! T8 x
call KERNEL32!_lopen3 P/ ]/ e0 m6 O! q$ s$ d
inc eax* H0 d H7 M& q7 }. k a7 f" Q
jz 006505ae ; not detected
; q$ I5 J/ ^. i# J$ K$ B, v c% A) r, Y
, q& r* S2 V# _4 F- t" ~! `0 D* W6 ^
__________________________________________________________________________- R: v* R& C y& \: n J
$ x j3 V1 N1 X3 XMethod 12
- e* o- `7 _4 t2 B* W n: F7 S=========) I: d$ z; F& b) a- C( n. l
( H! X- z' D/ ?! Q0 L: j9 K+ wThis trick is similar to int41h/4fh Debugger installation check (code 05
. N' e( x& I- `. ?( W3 \& 06) but very limited because it's only available for Win95/98 (not NT)- G) V- e& V2 n6 x* W4 k
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 c2 l* h( j% S% a5 L" A1 A* r
9 u) `+ ?' V" O* y/ |) o' o% H+ g push 0000004fh ; function 4fh
/ b$ C8 P6 \8 S- v7 L0 K push 002a002ah ; high word specifies which VxD (VWIN32), s' ~* K, m2 k" G/ `' E
; low word specifies which service
" D3 \6 v2 _+ z (VWIN32_Int41Dispatch)& H4 `& {) H1 J6 S
call Kernel32!ORD_001 ; VxdCall. N0 N) c5 a9 Z6 V
cmp ax, 0f386h ; magic number returned by system debuggers
2 ^2 Y' o& U" D# u* Y3 Y jz SoftICE_detected( D5 w' ^6 E: j8 Z7 F
0 Q# H+ u8 w! V# j+ W6 @
Here again, several ways to detect it:& {& w/ Z1 w' `
u/ d' z( Y4 t) x: f0 w( K# F
BPINT 41 if ax==4f
4 x9 Y& B2 W. t/ `3 {' R; q; J& y' @ d$ R7 o& j1 D
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* h$ } _" W) D2 v( B
/ g# K! D6 T- a! h A7 W% [! L. w
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" q+ E/ T% ?/ M ~3 p2 J: }2 z
, G, P5 f" z, V( j BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!- W8 ^1 q/ a9 d+ ?6 Q$ ?5 B2 g$ Z5 X
- a' i2 [7 w0 H4 q__________________________________________________________________________
0 Y: ]# q9 P) B$ x. I! w7 r! o: K4 {- o" e4 l5 Z
Method 133 m3 M3 l- _6 w- T& p: B
=========
; k; J% M: v6 l6 ~
) q# K+ o& L- {" E5 m: t* I, o$ l2 I0 xNot a real method of detection, but a good way to know if SoftICE is( ~5 K+ V( @5 o
installed on a computer and to locate its installation directory.
( x3 G$ v' l' N6 K% ]' F% SIt is used by few softs which access the following registry keys (usually #2) :) X9 ^" ? C' o: }( K4 \" ^. }
( {) }4 e% D4 v0 w4 @
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 v+ v) F+ W8 B# X) f; i0 N
\Uninstall\SoftICE& K' o' q( ?* R4 `! v; D
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) g% j3 D* Q/ G4 b-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 {' Y3 Z6 j" r2 E' c+ D
\App Paths\Loader32.Exe& |6 R+ C- _/ X' s/ T4 ?
& o' k4 d3 D$ n& W5 q$ U
7 \- P) w8 M/ C, B% RNote that some nasty apps could then erase all files from SoftICE directory$ t" s: Y: x- r) u
(I faced that once :-(
" |2 |' q5 C6 I# Q" W4 S
* h4 p" g1 z2 l7 {5 CUseful breakpoint to detect it:
; f/ i; D8 p$ r1 S9 T( ?: \: t6 S% w
/ B9 a4 ]0 }0 d BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
; {. G7 s1 Z/ Y/ s3 b8 h& K( }* o1 p$ G6 h* \. W
__________________________________________________________________________ y4 x3 T. {* n2 k
1 K" @( I0 Y" a) y6 ~0 T6 [
8 E: n% q1 _ J6 ~. F
Method 14
0 K9 s" M- Q# x% T1 N9 {7 p" E+ S=========# ^3 n0 F' {$ |6 H- u0 n& T9 z4 Y
. Q! O: d6 k4 g! Y* i, @8 X2 ?7 Q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose: M/ U% E& _- y3 y+ v
is to determines whether a debugger is running on your system (ring0 only).9 y w7 f/ O: M }( ?5 D
7 d; S6 q: }( I* }
VMMCall Test_Debug_Installed( D3 ]+ S& o% M0 s) S- O
je not_installed7 V- U0 K8 q2 x6 f" |
. `4 j3 @$ \9 z) i% P2 b
This service just checks a flag.
( p, @' K% f+ y7 j$ C</PRE></TD></TR></TBODY></TABLE> |