<TABLE width=500># P$ ^. L# c! H+ Z3 L/ `9 P
<TBODY>
+ w: h+ o1 y, G w) }/ D<TR>
+ \2 N5 m D7 l+ ~/ T<TD><PRE>Method 01
4 d- _- D5 m3 ]=========
- c' j8 d- L; z; g6 b" G
7 X5 s$ ~+ I9 i, }1 s, UThis method of detection of SoftICE (as well as the following one) is
* [1 R$ J% M9 H" eused by the majority of packers/encryptors found on Internet.
+ p A1 ]( ~: XIt seeks the signature of BoundsChecker in SoftICE
S' g W3 l, p1 t! S& m
; |% i* G2 S; p; \" \; t! d& o+ { mov ebp, 04243484Bh ; 'BCHK'
2 G2 ]) Y- U* K3 }. {" T mov ax, 04h
; g+ j1 P6 e( |' R, }/ u int 3 6 E5 m( r$ R; H/ u2 O/ B
cmp al,4
5 X/ N/ \8 D8 k7 Y; W jnz SoftICE_Detected3 E5 R3 M. @, Z- s4 v! O
# B; M6 B% y; G; v8 g: @ m1 @2 J___________________________________________________________________________
. z2 j9 ^5 K, s9 a
; P; \8 h( u/ ?1 i2 U+ oMethod 02
n" q. K1 X4 [, G' `( o. r=========4 Q8 U7 }$ h. c& ~8 ^& [$ a$ N- R
# ?% k7 B; u# h: M5 q* t* n' x
Still a method very much used (perhaps the most frequent one). It is used
2 v! G' _5 p h1 b0 q& Cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. [7 X' }2 F) [7 q% ]+ {5 \or execute SoftICE commands...
1 s `2 |8 Z4 r/ i [$ eIt is also used to crash SoftICE and to force it to execute any commands
. f* S$ @! Z" s4 {+ G( _(HBOOT...) :-(( 1 s0 F8 m0 h% A
2 q" `& }& J5 kHere is a quick description:
" ~ e% S' r6 s1 K5 Y3 I1 ]; c-AX = 0910h (Display string in SIce windows)3 f3 l: N C: }( Z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ W2 Q* m# h, {! r' d; R-AX = 0912h (Get breakpoint infos)' M2 Y9 g4 Z2 f- l- S
-AX = 0913h (Set Sice breakpoints)
+ m7 h- J- B' _! v( l-AX = 0914h (Remove SIce breakoints)/ H! _3 w0 h5 \; ]1 `4 \6 [
* S+ p6 T, I' \1 G6 {$ h
Each time you'll meet this trick, you'll see:
" {) U |7 y$ W( F% ?! v-SI = 4647h8 |( L% {- i* K0 |$ t
-DI = 4A4Dh' T) C( N+ d2 H \& ?, W0 M ]
Which are the 'magic values' used by SoftIce.9 q9 J# r. k3 W1 Q$ Q2 P! G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- l: C2 T! w8 n2 W% G9 A
+ J0 V4 d' A C0 Q8 GHere is one example from the file "Haspinst.exe" which is the dongle HASP
H1 P/ C1 l$ sEnvelope utility use to protect DOS applications:
+ }/ z9 }0 D B$ C! Y' Z
% C# a8 Q: X" I/ q+ S& i
# m" C. X3 E" V! o5 L6 X+ H4C19:0095 MOV AX,0911 ; execute command.
8 d8 \" o U8 h6 P B! N4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 Q: f! F. m# W# m7 H9 w# y4C19:009A MOV SI,4647 ; 1st magic value.
- F3 Q) N' J1 X! T% Z$ q; Z b. t9 F4C19:009D MOV DI,4A4D ; 2nd magic value.- ^4 p/ r+ P3 N4 P
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 w9 n" U1 B: N* [: h c+ C
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 `; j. U( o# Q
4C19:00A4 INC CX
* W4 r% r* _$ W4C19:00A5 CMP CX,06 ; Repeat 6 times to execute: k3 T$ k3 L- C
4C19:00A8 JB 0095 ; 6 different commands.
0 Y- A/ ]% M$ ~& ]: T4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 k$ s( O0 s! N$ u* L
4C19:00AD MOV BX,SP ; Good_Guy go ahead :): l1 f8 {: F1 V" g
" W$ T7 I5 ~5 c6 g2 ~% @
The program will execute 6 different SIce commands located at ds:dx, which
1 a4 s6 d; \; W, o+ u$ [. ]are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! d: C+ t! }2 E: \% y
) o2 Z3 Y. J: X% h+ j* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded." z- d/ d, v/ M5 g
___________________________________________________________________________# @# j$ ?4 h, }# u9 L8 `5 _: u
+ V' L6 x/ g h6 z% m% x; T+ ]1 B
6 q$ K4 B! O# |! Z1 { O& I' AMethod 03
" T' u' Y+ {! S( ^+ K4 n=========4 I: \4 n; u$ o& Y' P( |& t3 g
" B4 p# ^/ M4 |" {. z, I+ ]
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 m. G! Z8 }( q7 |7 r# K
(API Get entry point)
% L1 t5 T- M [4 E
& A! X& q* Z$ q7 Z& }& Z0 r5 o5 Y8 t2 q
xor di,di- S& l6 d6 L5 K8 W
mov es,di; o3 U8 e; c- v
mov ax, 1684h
V: o# Z' ?% G3 Q# W9 ]5 s mov bx, 0202h ; VxD ID of winice
0 y7 V" b! x; a int 2Fh2 H; e5 L' E$ ?1 B9 i% `
mov ax, es ; ES:DI -> VxD API entry point
5 R/ x3 m1 G3 J9 K2 z; ^- F1 y- Z add ax, di$ v6 J Z6 f H
test ax,ax9 g% z1 u1 i2 B: I" N
jnz SoftICE_Detected* r2 W, n, Y7 L3 g
2 Q1 J0 K4 z t. Z* [: n- h___________________________________________________________________________
9 s, R6 T1 S! @# x1 ]1 b* d: t. w9 T1 @9 ^7 S% A* J
Method 04
! ^3 q1 W" R7 o# S2 z V' k; Y=========( M7 ]" m. ]. U
6 e& G A$ U5 _8 Q: X9 K
Method identical to the preceding one except that it seeks the ID of SoftICE
; q8 N. [, q+ E5 L7 TGFX VxD.
& K% P4 b$ R9 R u' D, K( f% X, d# |% d; M/ q4 A' j' Z
xor di,di
+ x8 O3 S( j0 M) ^: W' S6 n mov es,di
8 s4 v# U4 U5 F) C, y: K7 @" X" H* d mov ax, 1684h
/ X, G: M* q" T/ k. ~ mov bx, 7a5Fh ; VxD ID of SIWVID- I9 a, a" q8 D% z4 P
int 2fh+ r! G. i3 p! {5 Q# s6 a8 J
mov ax, es ; ES:DI -> VxD API entry point
4 ^4 d4 ` g0 u& E. } add ax, di5 Z" I0 Y6 w, E! a( x" K S4 v
test ax,ax
) J6 g0 c! l, R3 g5 ]! ]6 @ jnz SoftICE_Detected
" O5 N5 ]2 {4 f) @+ V1 |" d0 R4 P/ F! Z: `
__________________________________________________________________________
# }0 w& a$ e5 i- I/ |8 W, j
# t$ h7 v0 w$ T
2 o' p E( N& M1 l- i" p# a) K* V/ e1 yMethod 05
2 S$ `* b2 D8 |6 m, ^" w2 T=========$ N9 K% I: F- N* q
9 g, @. w; Z7 }5 `% J$ H3 I5 AMethod seeking the 'magic number' 0F386h returned (in ax) by all system+ Q# I) Y6 j6 z( R
debugger. It calls the int 41h, function 4Fh. d% v/ s- w# d5 R A2 I
There are several alternatives. 3 k* h+ I) u, O- t3 V
6 _' [* c) r5 z! Y, c# Q
The following one is the simplest:
1 g8 a5 Q) W5 x/ X% J' r9 C- d3 p! {
mov ax,4fh
$ o! i+ \* S8 p# m Y int 41h% x0 J4 _+ H8 U8 W& M
cmp ax, 0F386
9 R1 b: j+ T. P" l7 D jz SoftICE_detected
" g2 F! n4 u* t* O0 V+ z; F
1 s: m! @# W. \% \: \& A/ z, }8 C
Next method as well as the following one are 2 examples from Stone's
, c0 P/ j& t0 U0 @"stn-wid.zip" (www.cracking.net):) ^$ U* m7 l: ]( o
3 d* G( ~ _4 `( L" x
mov bx, cs1 l; y! P, C" j$ b5 s
lea dx, int41handler2
. Y1 m+ c) l- ^6 z7 M" ?* Z xchg dx, es:[41h*4]- A% v0 R) ^( _; J5 h
xchg bx, es:[41h*4+2]& b! G P" R' Y! h
mov ax,4fh; ?9 o8 A7 c; h3 {4 }
int 41h
+ X. p j, P! W' } xchg dx, es:[41h*4]
7 m- H$ \2 u& d. y# \( i c* C8 @! r xchg bx, es:[41h*4+2]
) c0 l# w% w: E4 O3 I; g cmp ax, 0f386h4 @* L i ~0 `) i0 `
jz SoftICE_detected
" M& p, _; r. Z. s% r) f- D3 ^5 N; d' ~3 R4 X5 u
int41handler2 PROC/ H/ ~7 P9 L3 {+ J
iret$ m0 E5 `3 u) Z5 P8 G
int41handler2 ENDP) V$ L/ f! l& e, V! _- i
( O; n' A6 x5 y6 h, O( i( P2 [1 |% p5 _# g/ s
_________________________________________________________________________* ^0 [* q" M9 Q$ @8 q. j
( s; q$ s4 g6 Q% [+ V r+ B, y$ c
4 w1 g9 z# c8 P0 ^# J- l2 ?
Method 06" g" B, k+ \! t) c
=========
* a7 N$ I- I3 N( o# X2 O+ `& K$ M3 Y/ @# t7 o
( d8 ?8 l; U$ ?+ q1 T' m
2nd method similar to the preceding one but more difficult to detect:' |7 t/ c9 ^9 o4 e- E
9 x f7 G; S! p: `
- x+ M$ A9 r. ^9 L1 \' m
int41handler PROC" ]& x! P; ~! M7 K
mov cl,al5 L5 o# ~$ S Q$ {6 N& C) X. q
iret
. n6 ]/ a+ P6 @) ]) L7 zint41handler ENDP! I* ^' T( e$ d% J- f* q
: u. ~1 s! E7 M& Z# x/ C/ b) I+ s2 g c! l0 P$ [
xor ax,ax
9 x" a* m" A) {& p1 } [ mov es,ax
7 m1 ]7 s% Z1 {) B |9 L1 x$ B9 B$ n mov bx, cs4 b) a/ m: G; U
lea dx, int41handler6 N$ @* i7 C+ F+ `, k p8 ^) _
xchg dx, es:[41h*4]
- J0 q) b+ r( }4 `9 x0 Z; @ xchg bx, es:[41h*4+2]
[5 T7 h8 H( i5 n in al, 40h n: `6 q: |# w) p: o: t- p9 T
xor cx,cx" C% t% N/ ?* P, i" n
int 41h2 Y0 V: ]' c6 v+ f: O
xchg dx, es:[41h*4]
& l) o' I9 n0 ]4 |: i8 u xchg bx, es:[41h*4+2]
S3 P+ o+ }; k- I( R# K cmp cl,al$ N8 K+ _8 ?4 ?0 B+ n
jnz SoftICE_detected. i7 f, I s; i7 P
- P/ y4 G0 \: l- `_________________________________________________________________________
! F/ Q* L- {7 t3 \+ f
( j6 Y5 z: a% I3 p" O/ \1 iMethod 07% K6 U5 e. j3 A) j" ?
=========
4 F. P& l, i. k% I6 K4 d$ g& J: k5 T$ i% m y$ }0 b( v, O9 W
Method of detection of the WinICE handler in the int68h (V86)* M' r: Q- b7 i z# M& O( q
- H j0 c9 f$ ^ mov ah,43h
/ V# J$ {( v2 H% l0 `0 r7 H int 68h
) I9 j: _; l& ~* z$ Q) y/ B7 ? cmp ax,0F386h
9 I E& G+ r! K jz SoftICE_Detected4 r; U S. i# E
# {# d' j2 {* ], T9 T, [
+ w+ a) K, r- x0 p1 Z$ a& e=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
; u2 J# G, Z/ M1 K% L3 ?- k# B app like this:( }9 q7 V7 Y4 G' m
" V3 k8 ]- ?7 [" ~; B BPX exec_int if ax==68
" Y/ r* j1 p2 z; i/ Q% x1 D# _ (function called is located at byte ptr [ebp+1Dh] and client eip is# ~ f7 k# j6 E- g
located at [ebp+48h] for 32Bit apps)
6 H0 H0 W* {& l6 B& U8 K__________________________________________________________________________+ [2 V* {, L$ ?8 m' |4 _" ]' l+ p4 F
' `* w2 A1 d* n7 y) j& j( Y2 M
7 p) I5 [+ d2 T' p7 `( Z3 |0 L$ `
Method 08, A5 O6 B! m$ U, Z/ b/ P' O
=========7 _6 R2 |9 T4 ~1 G5 U$ i. A* S5 c
4 K* ]" S3 Z6 t& u. m" SIt is not a method of detection of SoftICE but a possibility to crash the- T3 H4 k* K7 `6 X% m$ p
system by intercepting int 01h and int 03h and redirecting them to another
( }8 u. ?- m; H! G3 e, u& Aroutine.6 F# {% d, U: D2 @
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" [9 U9 E' s2 M- F
to the new routine to execute (hangs computer...)
0 T* H( S9 q1 j2 x* u* g# ]- x
# v6 {! c* I9 ~0 t- g+ K. P6 t mov ah, 25h# g9 W2 M, {" S7 M z9 p; I t" s
mov al, Int_Number (01h or 03h)' o+ [# R2 R" [2 L2 Y
mov dx, offset New_Int_Routine3 o7 R3 b& [+ H1 V6 v
int 21h1 L' g( G( x* n# ?" S
, X6 n' t; S+ M9 ~3 G; e, G__________________________________________________________________________5 V! v! Q$ k+ ]5 _8 ~2 A. O( f
1 y3 J d) x9 }% @1 s) ^6 dMethod 095 h7 C9 Q! |6 d, G
=========
' n9 S) X9 _7 M' m3 L" V; j
9 p `& C. d/ ?This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& w. j* \6 n/ Q
performed in ring0 (VxD or a ring3 app using the VxdCall).
9 O% i1 u9 N8 k; @! _7 _$ j1 r* x: jThe Get_DDB service is used to determine whether or not a VxD is installed) D" @/ i$ F/ q
for the specified device and returns a Device Description Block (in ecx) for. B: y) Y9 o% @8 |
that device if it is installed.
7 I! p' \! k& o! ^3 p6 V/ F4 N* M% Z3 x7 o4 c5 N) C/ [
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ K* p; _( P: p. B+ }5 [$ ?/ B3 V+ I mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; ^0 m7 g: B% Y- ]' h VMMCall Get_DDB
7 l: m% [3 q% y3 v- G mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
; i1 z9 e: ~6 T* q1 f6 o' Y ]
0 C2 F* w8 i4 y7 J! z# WNote as well that you can easily detect this method with SoftICE:$ b; F% N/ P) z+ h
bpx Get_DDB if ax==0202 || ax==7a5fh/ G( z' y( H$ t# d. u$ C* b$ R8 |
' H$ }5 v; ]# V: N" c3 G__________________________________________________________________________% c7 J5 o' G$ J. U: m
0 \1 a& N+ T* n2 kMethod 10
8 h2 ]! U/ ^/ H9 z" ` {3 Q' q0 o% j=========: ^ L* K9 ~7 d' H1 i
( h( J7 M/ F D3 s6 D=>Disable or clear breakpoints before using this feature. DO NOT trace with
, Q {, I9 R! w( d3 V; L SoftICE while the option is enable!!( _) a$ x+ J: S
1 d1 J) s1 h! V5 T* _
This trick is very efficient:- P2 z/ x6 H7 Y4 @2 G& N
by checking the Debug Registers, you can detect if SoftICE is loaded6 z! T6 A2 K% m& l) H
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
" N2 }9 O6 X2 L3 b" l8 I9 E3 g4 ethere are some memory breakpoints set (dr0 to dr3) simply by reading their
% ^: e& G9 s8 [! @( G( Wvalue (in ring0 only). Values can be manipulated and or changed as well
2 q" w& V N+ `6 M1 `7 ?5 p, ?(clearing BPMs for instance)
3 c9 s) U. _: Y; C% u# w
4 e: h! L9 f' v+ x! S4 j( ~__________________________________________________________________________) Z# h4 t! }" `( s
, d3 V' L/ u7 AMethod 112 p' g3 @& s+ y/ h+ o8 y
=========
" E G0 I6 k' C# q( |5 C" C4 W
" e2 f# E! f, O( f. |This method is most known as 'MeltICE' because it has been freely distributed
0 F4 W' d/ `$ z8 d' Dvia www.winfiles.com. However it was first used by NuMega people to allow. p7 Z; l7 M+ ]% T5 @) u1 `0 l8 o$ q, d
Symbol Loader to check if SoftICE was active or not (the code is located6 l2 q, A/ C6 l* f2 u+ @$ D/ B
inside nmtrans.dll).* D" ~$ V- O) r4 Y7 l
# v) _4 k: a. u( X; V# gThe way it works is very simple:8 J2 \6 R. n: e3 }2 \
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for$ h% k6 C7 j& q6 l1 }, q2 z! {7 U
WinNT) with the CreateFileA API.
' K4 K3 U z1 e+ w f, \+ e! B4 y q$ p! B8 @
Here is a sample (checking for 'SICE'):( ?+ [" P/ ` s5 _2 p) R- G }
" m/ J" d; H& t" `, h+ s- @
BOOL IsSoftIce95Loaded()
0 S' G3 @* o( b8 E{! z+ e: S0 |6 |( Q( Z7 F0 H
HANDLE hFile; $ ?1 F6 U9 ^$ a9 f
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ o1 N4 Z) k7 T- t9 W9 A
FILE_SHARE_READ | FILE_SHARE_WRITE,
9 c# A; C' ]0 G/ ?, M9 Z NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 G. j5 l5 }) |; C& t% B' ]- S
if( hFile != INVALID_HANDLE_VALUE )
" q$ d: G7 R& i7 u {
& m6 z. [6 J5 y: B" b7 I7 i5 ^ CloseHandle(hFile);: n( g) h6 ]" N- X- [; e' [
return TRUE;' I4 t( S0 L) H% }1 I
}
% V" |! D2 h. j8 s return FALSE;4 ^+ J! N% o, ]) N& c
}
+ s8 ^- _! H7 i. x1 {7 W
6 K! P& R) M0 uAlthough this trick calls the CreateFileA function, don't even expect to be8 t) A' F1 G% N" ^ ?! i1 s
able to intercept it by installing a IFS hook: it will not work, no way!4 p" Y# T: Z* x) l: f
In fact, after the call to CreateFileA it will get through VWIN32 0x001F* S, f) v. q% b3 U- {+ z( j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
4 K/ c( U* M" |% P6 j9 cand then browse the DDB list until it find the VxD and its DDB_Control_Proc
% j$ |2 ~& C [- {9 jfield.8 N5 w2 X# r2 R0 B0 I
In fact, its purpose is not to load/unload VxDs but only to send a
0 [# P$ ^" G' |* l0 u. Q* cW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( L$ q7 l% B. u# @; Y7 `to the VxD Control_Dispatch proc (how the hell a shareware soft could try! V: \2 r! a6 Z1 c; z- k5 Y! e
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ N! S4 o$ ?- F: C# f. C
If the VxD is loaded, it will always clear eax and the Carry flag to allow
0 C, {; V: Q; v" S, U3 H1 ?9 a2 q U% Rits handle to be opened and then, will be detected.( {' X3 ^2 i- t4 G5 v+ m
You can check that simply by hooking Winice.exe control proc entry point
2 Z0 C% Y/ W. Q9 A3 U; H) m3 Dwhile running MeltICE.
1 s( A, w0 t, ]/ D3 L
: F" k( l$ X" ?1 t- O3 I" ^1 ~9 c4 j) t: }8 v" V3 \
00401067: push 00402025 ; \\.\SICE2 x! t) i6 B; ~
0040106C: call CreateFileA
+ Q9 V& p2 B6 Y& C+ ]# d! h 00401071: cmp eax,-001 G7 @; f7 h0 l0 j' |
00401074: je 00401091
) L5 W1 J8 ]2 G4 S1 E' U/ y1 A& k
6 F' R( N0 {7 w
There could be hundreds of BPX you could use to detect this trick.
) @" {, \; Z4 U$ Y-The most classical one is:2 X$ u1 n8 ]7 t( E. K, A
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
9 |6 `% [7 l6 [5 v4 e# G/ k *(esp->4+4)=='NTIC'1 h. D7 J: f& q' a# }3 W
* W# u+ [8 E6 S7 g; [5 D
-The most exotic ones (could be very slooooow :-(
! Q: N2 U) a8 u BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
" c% w+ K( v* F/ c5 o ;will break 3 times :-(1 C; p8 e f2 {1 o) x9 h
8 ^" a9 I+ \2 l. d* z3 Y-or (a bit) faster: `* G6 }1 I/ o0 F7 `- l
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 H5 X. q) W$ V: s5 E) P( ~+ P9 X9 v! L" B# q
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" M! }& n$ |! {/ _ ` @ ;will break 3 times :-(+ c( h' m7 a. T. x
$ z9 r5 a0 Z& [0 w# k-Much faster:
. g' e; Q% x6 X& D BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
4 `# |+ X0 ]6 F; W& @9 n
2 n" j/ y9 k% UNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
' b# h' c* [0 T/ T( j# C, qfunction to do the same job:
6 ]5 K; p8 u/ f) k9 U4 j. A# }
; i7 o3 `; h, ?3 S" n push 00 ; OF_READ
! V5 r! B6 p5 V" } mov eax,[00656634] ; '\\.\SICE',0: l7 w4 O2 Z+ C
push eax
8 H9 _. A, S9 s5 f/ g2 Y9 T0 L# |. ^ call KERNEL32!_lopen I( I/ v X2 @7 l7 o7 ?# b4 D
inc eax4 I/ g- j! T0 t# l' }3 Y! ]+ Z
jnz 00650589 ; detected
# @: M, p0 P: q# `# K; |) V push 00 ; OF_READ
: S8 z) V0 K w; d2 w mov eax,[00656638] ; '\\.\SICE'5 M: N) m0 _3 h( x
push eax
7 ^0 J+ B. J+ L! S' E/ H" F call KERNEL32!_lopen6 N7 O( L' n7 j* f( i" W
inc eax
% a' O, D( M5 B jz 006505ae ; not detected
/ T! a& \8 @2 G1 d
# `1 \* [' \$ x# b" {- n2 W w, c+ [2 @$ Q' C: N
__________________________________________________________________________
& W% `/ C9 A& M1 m
; B( e2 i$ @& Y% I# y3 hMethod 12+ ~! {% P9 a( \7 J4 b9 r
=========$ ]* b) J4 R7 m
5 Y7 M$ m5 W' F: n/ jThis trick is similar to int41h/4fh Debugger installation check (code 05 N( j& Z Y2 S
& 06) but very limited because it's only available for Win95/98 (not NT)* G1 ?! W% Q& K
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: V7 i7 C9 z! p* X1 o' g
2 ^( N# R z* x
push 0000004fh ; function 4fh2 w" \2 U7 E* t& S/ R
push 002a002ah ; high word specifies which VxD (VWIN32)
* D- h6 |5 Z( G1 p; }" G) p ; low word specifies which service- n3 j' J: c& E
(VWIN32_Int41Dispatch)
5 @6 ]5 \( e; e' k" j( K) P/ B. O call Kernel32!ORD_001 ; VxdCall
4 o; ^$ F) c. Q$ H/ Q cmp ax, 0f386h ; magic number returned by system debuggers; a2 \1 L) q7 ~6 Y6 \- P' g
jz SoftICE_detected
! J% i4 { _% ^# q, G4 F: P7 B7 Q- j7 e+ [7 i9 Z
Here again, several ways to detect it:: C- t7 |9 e' {) }' U
- F* f3 C2 E0 z3 j; l2 c BPINT 41 if ax==4f
! J+ b! [/ Y- t) N5 }* Y$ d3 b' N
) H5 X$ d! S5 c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: P! {' g' b/ u' X- Y3 v
+ l# b8 r& n. x' w$ i/ f [1 } BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- L6 B8 ]9 e& L4 b9 M
. G- c- O2 H; D+ U BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!* m: @) {' R+ d7 e# e/ j
~5 h; N+ B; i3 U, C7 \__________________________________________________________________________
. K2 {; j& F c8 y8 l. v# S
4 L# L; O& z, h) Y& I: X5 S0 NMethod 13
+ z- ]' `1 t4 I& x/ L=========
) n- n3 L) u: a1 }. w4 J3 s; @( H- j$ S
Not a real method of detection, but a good way to know if SoftICE is
7 T. x& _# i$ O# c* Pinstalled on a computer and to locate its installation directory.
V( t3 M: V9 ^, @2 L8 vIt is used by few softs which access the following registry keys (usually #2) :
* o+ n. W: J0 M- `1 ^$ f) j# u
; w! F, W* [ a. n5 {9 e- x-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" h& h4 ^1 y6 O% r; Z* B7 I n\Uninstall\SoftICE& j+ x" X. e3 K
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
& f& ^7 o# Q! V9 y* h7 [1 }-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 G* x0 k& o9 w6 Z
\App Paths\Loader32.Exe
- v; ]2 h0 W( O% d4 J) e# m; N% O$ E3 E
$ D2 S- ^0 P; \( lNote that some nasty apps could then erase all files from SoftICE directory
( w$ P' u9 C6 |$ t$ V(I faced that once :-(
: H& _4 e0 k/ |: f, L0 x' s
$ p* j8 e! M3 a3 WUseful breakpoint to detect it:
8 y& S/ W9 ?3 D" a) z r. ?9 m, S9 i
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. H* }# L4 ^# a8 h2 N+ [4 m
$ S) ^/ \. H! \* [8 h! @, F8 M( j__________________________________________________________________________! {' w% t+ l5 j# g
. G" Q& J1 q) y
8 H& {/ |% _2 P) S0 i' s
Method 14 ! F" b1 ~0 f% Y) [* H# `0 X# F
=========
( {( i: J2 W5 s" `, @
( H: T& Q& S# e U/ G- ^" ZA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' M7 b# R4 N1 @: X/ e
is to determines whether a debugger is running on your system (ring0 only).
6 I, E/ Y9 O8 R% v! N1 O6 @% P7 w
5 D; k) G* ]# k4 d8 V, o VMMCall Test_Debug_Installed
/ f/ \' @2 t" V je not_installed
& V' z# a- n" w0 I0 q, L( R" K5 y4 i: p' z; P# \
This service just checks a flag.
, E* E/ s, N3 j v& O</PRE></TD></TR></TBODY></TABLE> |