<TABLE width=500>: ^: W$ N2 r7 E7 Z% g6 ]0 ?
<TBODY>
) V! v! I/ {0 _& C! ?<TR>4 v6 S1 d3 B0 m5 I) q7 i
<TD><PRE>Method 01
! |0 K& w& B0 g4 b) m' S# s _" C=========9 I. Z. S+ a7 G) R4 A+ i
/ [! i; W# U7 g5 a: rThis method of detection of SoftICE (as well as the following one) is1 J5 ^( L" b5 ]) F; E- P' p [
used by the majority of packers/encryptors found on Internet.
% L L% p8 M, P AIt seeks the signature of BoundsChecker in SoftICE# D5 N- r% o* T( Y6 Z
( C8 V7 x- l8 u I+ ]7 J1 w# v: j
mov ebp, 04243484Bh ; 'BCHK'- ]) X6 `5 ^* T$ }$ c2 B
mov ax, 04h
% \# ]* l; H2 O* H4 s. y int 3 + `1 O( A: d' n, W- ~2 B- w
cmp al,4
8 H4 c6 D6 r- q% J jnz SoftICE_Detected
1 ^- V: i# h- [( d. {- j* V; q
___________________________________________________________________________
6 E2 D; w+ a+ ~' m# I
' e# ?- o2 g7 k. V) N; o+ \! U1 wMethod 020 l+ ^) ~2 \/ w3 I
=========
; O. Z; S( X4 T8 [4 W* ?
0 E z" m" M( `/ {8 N' oStill a method very much used (perhaps the most frequent one). It is used
+ P) y+ b2 U8 O* Pto get SoftICE 'Back Door commands' which gives infos on Breakpoints,) U; i4 g3 g2 q* Z/ z
or execute SoftICE commands...4 H4 s. {7 l- \ R+ x" y( H( B4 q, b
It is also used to crash SoftICE and to force it to execute any commands+ Y" ]) I# K w$ B& C$ G
(HBOOT...) :-(( 0 [5 `$ ]1 o$ u! X+ X. Q J, C
! z; s; h. A @; j+ v8 j% jHere is a quick description:7 \8 Q6 O$ r0 F- @# [; Y% V
-AX = 0910h (Display string in SIce windows)% i* U8 a" j6 _* h: `
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
' o; _' {! s, c* l6 I) S-AX = 0912h (Get breakpoint infos)3 I8 a9 j6 m5 d
-AX = 0913h (Set Sice breakpoints)! x6 `$ i+ u9 C1 {, D
-AX = 0914h (Remove SIce breakoints)/ f* C- d: P5 a4 ?# C( y5 R- r2 q' M
! y+ U4 t8 M |0 u6 ~( X
Each time you'll meet this trick, you'll see:
1 H4 C. K6 G' ]+ l9 U: z-SI = 4647h
- X0 e" V- V! u) }-DI = 4A4Dh& K; p& Y2 Y) G0 x: d
Which are the 'magic values' used by SoftIce.
3 {# v5 I$ {& k8 t9 ~5 uFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.3 }: u6 i" `% X2 Q; `& D
3 s J5 c, @' o7 OHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 Z0 o0 u$ n/ v" A1 dEnvelope utility use to protect DOS applications:- v4 ?- ]7 E. [6 _
* s) y% }+ `$ q+ k
- c# N' s+ r2 y8 D5 G4C19:0095 MOV AX,0911 ; execute command.1 w. _7 D" X$ G' Y* O4 W) U
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 k5 D T4 T: W* F d" R+ @+ g4C19:009A MOV SI,4647 ; 1st magic value.5 T3 i0 }7 @( x4 ]# \; `
4C19:009D MOV DI,4A4D ; 2nd magic value.
! d# s7 L: L5 v: }; n4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)' o; x0 ^6 J$ z) a% I: ~ k
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
5 i* l0 r6 y" K# A+ D! Z9 {4C19:00A4 INC CX2 P& e4 o! g# {2 A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute! v% s, L* L3 U& L
4C19:00A8 JB 0095 ; 6 different commands.8 Q; `; D* T+ ~ o1 w
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ l$ m5 P# q' F8 Q$ q/ }. h z
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" v/ U, p8 n0 c, C5 X" u
2 C; e" y' ~& z% o. u% F9 TThe program will execute 6 different SIce commands located at ds:dx, which
: r( g; Y% f9 L Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
. P1 |6 J# |; \+ h! \& U; O% f F d( y4 l
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( M% u: q$ N5 z5 m; `( m2 ^ Y- Y) g___________________________________________________________________________& _% a8 h& R3 p- O; ]$ {
* k4 B0 V' h4 n1 m2 \ h" d
3 Q) {! m+ o0 v& r# Z8 ~/ pMethod 03
* g9 |1 v) P4 U$ E=========
1 f p {+ K6 J4 @% x% b, x
! T1 y; N# ~1 ]9 PLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, [, I) a! O0 K2 Z2 T: g) A: B7 D
(API Get entry point)& H) b/ b7 E7 s/ r4 @
$ z& G* f8 \6 E/ H1 o2 M4 R. B
( P3 B; y& f' _6 I+ S4 Q# Y
xor di,di! B4 y# d" U ?- `6 R7 p
mov es,di
% x; L- u- b. }/ m( H0 l2 r' v! B$ C mov ax, 1684h
: ~" g: _2 v P0 L( x mov bx, 0202h ; VxD ID of winice( f) I: w- q3 K1 {! X6 b, D) _
int 2Fh
6 J! h- a9 s( {) f% } mov ax, es ; ES:DI -> VxD API entry point
9 c4 U3 F$ w7 w) I2 [7 T add ax, di
/ a! G7 L9 A h+ ~3 K. h, v0 i7 o test ax,ax" m& f% A# w$ z# o2 k# Y
jnz SoftICE_Detected
9 q x, n; H9 D4 j% D1 { j! m/ Y
9 V% q, Y! D2 W. [3 o* i# C1 [___________________________________________________________________________
* R( L/ c0 E* A& N' \3 ?
) }; n r4 l3 Z/ M4 |& cMethod 04+ N) W7 I4 q& R
=========% b9 u$ t- z' s5 J
. S& J6 k; z) A3 O! A9 v: |- ?
Method identical to the preceding one except that it seeks the ID of SoftICE
! G- {" x0 w- Y- b6 r$ d! mGFX VxD.8 S# b. j T2 {( y: U/ [3 ?
5 s' J5 L9 K) {6 d9 X* L xor di,di2 e6 B; x8 D2 e$ X% J x
mov es,di5 K: g! S) J% Q4 X% y# \
mov ax, 1684h
* O6 V9 k; l @# w0 g# k* f mov bx, 7a5Fh ; VxD ID of SIWVID! B6 c1 E% O! e" k% g: `
int 2fh
% p: k/ g! x5 i, X+ ^2 G mov ax, es ; ES:DI -> VxD API entry point5 t/ A i0 s# l7 x3 b9 R) A
add ax, di+ a' `. s3 H1 O* X
test ax,ax
* X( W: V( n8 i; S jnz SoftICE_Detected
, l, Q+ e- K: r0 g) B- p4 }8 [# Q
__________________________________________________________________________
1 }8 v# V: k" `0 }3 u6 H
, k$ u2 Y; Q5 {! B' o- ^7 n b7 _ n, T: D& ?
Method 05
) e; D9 Q0 p8 y* T+ m, O @3 l=========" U% S' V2 R$ a3 n7 Z7 y5 G
- Z* ^: a; z0 w% e, x2 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system4 f4 g& Z% u: E4 `& S% q, r
debugger. It calls the int 41h, function 4Fh.
* Y4 [4 G5 X6 x8 r! h% {There are several alternatives.
& |5 h' n1 ~8 j$ o$ Y/ J4 z' ^7 X% @1 c. w" P+ \& h
The following one is the simplest:5 u- W2 J7 `* w; c
; m, t5 }& ^: U1 O9 e+ H# c6 e mov ax,4fh
# n3 M# A3 i; M# K# w# X int 41h
8 G* C- {! N9 u* W3 S cmp ax, 0F386
& u9 m+ I" Q+ x0 v" G( \. n# S jz SoftICE_detected) {! z0 b! t/ Q, z3 _
* ^ U; N( _; O/ J# t* z7 O9 u8 j q
Next method as well as the following one are 2 examples from Stone's
# W4 q+ i6 h: L5 m6 Y"stn-wid.zip" (www.cracking.net):9 O1 k+ b( e5 H: D
; c" y! W( G5 k2 y$ {/ W mov bx, cs
8 x% k" l; g# K( ] lea dx, int41handler2
8 ?# t1 \) ^% O( P# `9 g. O- G! f/ M5 S xchg dx, es:[41h*4]
! G Y$ D; c7 J/ W5 v xchg bx, es:[41h*4+2]0 O! E. B+ h; P5 }' t- k! e
mov ax,4fh
7 {/ N5 o, w. A. e( f. N% ^ int 41h. E; A# f( Z: r, g
xchg dx, es:[41h*4]# h& l2 Y$ w; T
xchg bx, es:[41h*4+2]
* F; C8 U3 ?3 h4 M2 d cmp ax, 0f386h# }- d- ]5 w( _# g
jz SoftICE_detected
7 w8 i* H" L; J% w' Y# k$ _9 ^
& I, L9 _( k+ Z: ]0 G O: ^int41handler2 PROC# v% k9 L `. _& i5 b1 h
iret- K) [( O3 ^& x) ~& W
int41handler2 ENDP
, G6 Z3 [6 h, T! z" ?0 o
p- A+ _/ S/ e1 b6 V7 v
8 W I1 t) u' ^5 X_________________________________________________________________________! J- I( L' Z+ g' w+ P
6 a3 ]2 t( z. G0 W* B c1 s6 j
$ u3 T. ~" F) ?! h4 v U# l" uMethod 06! G; E T4 r/ B4 I
=========
~& J* Q3 V% J; Z& W) n
7 L7 Q6 F7 l- z8 J
8 U2 V0 q- a; B" l& v2nd method similar to the preceding one but more difficult to detect:
4 E) L( W2 `' N- n; f
8 [, R3 H: y; [( y; h7 V: p
3 i$ s4 W( z2 \4 j/ Kint41handler PROC
( }, S1 ~" n! h U: _2 [5 h5 D mov cl,al+ @1 E& }# b# {, K$ |8 C D/ d
iret8 f- y+ m d1 I; l# n( L& R# j
int41handler ENDP o, R$ c' B. C$ d& |/ |& G5 }
8 Y& D9 C, k+ {
: n: z. T( Z3 w8 |
xor ax,ax1 _6 b' t& r' z% O4 d! H( {* u+ ?, U
mov es,ax
7 B5 i3 K) Z9 @! L, h7 _$ s mov bx, cs
& a3 Z/ c2 E. u" ?3 R7 R lea dx, int41handler: s% q) w3 P0 d) C& s, f: Y
xchg dx, es:[41h*4]* V! t% P3 h; Z4 o) g
xchg bx, es:[41h*4+2]4 V( O R$ v% y- ?8 }9 \$ i$ N3 G1 P
in al, 40h
& b( m0 X9 @- D xor cx,cx! @0 @6 _- W; b$ C1 F @: F
int 41h
- N8 {+ {' e+ D0 \2 m- h9 i/ D/ \; n xchg dx, es:[41h*4]" n# y# L; c) s5 t0 k4 J+ C1 t0 ]
xchg bx, es:[41h*4+2], @5 t1 N0 q+ j' A! f
cmp cl,al
! {7 k- p/ V3 a$ L jnz SoftICE_detected
/ O" k. O4 _' C- \" X* I: F
; D+ v" h+ D: O_________________________________________________________________________
1 Z7 W0 V8 y+ b$ f/ h$ s: a, B8 o& {7 ?% z0 q
Method 07$ N9 l1 v% T% N$ o4 H
=========
# O$ u$ [1 s% q& I2 v0 E
/ s- q0 p/ P7 B0 d1 J; L6 RMethod of detection of the WinICE handler in the int68h (V86)3 V0 G' O% M- t/ L, E0 B- e& k
% F4 b) B% n: P mov ah,43h
4 C( z% r* L. D int 68h* {) {" W/ {( C8 b
cmp ax,0F386h. I0 y5 F3 G# x5 p1 f" |& u
jz SoftICE_Detected
% O6 F0 t" y( `: ~# F0 U1 z. w- P9 G0 z/ f
- O/ V9 R' y: b' s( {
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, ?# [& j- a; }
app like this:+ G' ^# y& J& c0 @$ Q- I
7 m1 U: d8 k4 s g
BPX exec_int if ax==68
- a) K/ ~# _9 e; h! _ (function called is located at byte ptr [ebp+1Dh] and client eip is( d; u: k: h* _! `: w, w0 d
located at [ebp+48h] for 32Bit apps)0 z- G/ w$ m; K$ a' U3 C9 P
__________________________________________________________________________
/ p" E3 q/ v* C! A+ ?0 e9 X
" J, f5 H& A) x! S$ ~* Y' ^
4 ~2 b) o4 f @. o. Q1 TMethod 08
0 b! i8 W) W+ `! A/ q=========
9 I* O+ m, S6 T2 I4 P
3 w1 j' U* I4 ^" P1 Q. g0 P7 qIt is not a method of detection of SoftICE but a possibility to crash the" Z. ~$ E/ `2 \, ?5 c- M
system by intercepting int 01h and int 03h and redirecting them to another+ E, a% K! e' X
routine.
2 C/ J3 \( L9 ?: FIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. s, l2 X- c$ O Rto the new routine to execute (hangs computer...)
5 T! K6 ^7 z* \+ I* t2 V4 S6 j7 x/ T: G5 C% Z. H7 Z
mov ah, 25h' _! V7 \; J; B; b- ~3 v6 R; J
mov al, Int_Number (01h or 03h)4 V5 E1 d6 H9 |& _ @/ W, a
mov dx, offset New_Int_Routine
5 c' A9 R5 \% R n& G3 l) }/ S int 21h- m& `! i3 S* @, |* h& ?4 j' v% d: O
2 y/ x8 T) t& M
__________________________________________________________________________
1 a& w2 p8 k: s6 E9 j
% r6 ~* J- [7 z2 ^: ^Method 09
: X, ?6 W! a- c# _1 o, b* Y=========- i8 V6 f9 s% u' b) M
% z! N, ]$ ^: u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 ^0 r- J& m& E4 n3 Y \) ?/ `5 T
performed in ring0 (VxD or a ring3 app using the VxdCall).
2 V! P2 W4 Y+ M# r3 R8 x! Y* ~3 x) YThe Get_DDB service is used to determine whether or not a VxD is installed
* q4 o, Z# D! [' ~7 `3 U& {for the specified device and returns a Device Description Block (in ecx) for
; L3 ^; R: O7 a3 [' K: athat device if it is installed.
. e: D! {: d0 S4 ?! g
- i! k+ J9 o2 {2 F! I4 c' ] mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 p# g5 m' P( U+ f% y( r$ `" _' B( z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" k4 R+ P; Y8 v8 s6 H VMMCall Get_DDB
7 E4 y& Q- d6 P, _4 v! Y! J mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ \( v' r4 A4 m$ k7 ~" x! O
% ~/ p6 @) ?7 |8 O
Note as well that you can easily detect this method with SoftICE:
& C' v2 F2 H7 X7 @& k bpx Get_DDB if ax==0202 || ax==7a5fh
2 o$ U6 M/ x8 i0 {' v/ T& [+ E3 z8 t) Q
__________________________________________________________________________
% a! h# L8 U8 ?5 F8 s/ h
) n4 ?+ W2 {0 UMethod 10
8 I8 d# d- T# T1 J3 b. q% r; Y=========
2 S, `" C, C4 a/ l* Z+ j
, e6 P1 \ L" i5 ~=>Disable or clear breakpoints before using this feature. DO NOT trace with
4 A9 `' J, Z. N7 |' Q SoftICE while the option is enable!!; f$ A- J, u# y+ [
0 q) Z" L6 ^, S7 _This trick is very efficient:
! r; b) \$ O+ J' h: d; y' @2 x9 \by checking the Debug Registers, you can detect if SoftICE is loaded" c, g3 S0 K2 h- K n$ }: y% `, A- E; h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 f' `, ?$ e: n) q, c, ]there are some memory breakpoints set (dr0 to dr3) simply by reading their. k2 K. i# l5 ?
value (in ring0 only). Values can be manipulated and or changed as well" V9 H4 ]6 ]6 B- x. K0 C7 o3 Y
(clearing BPMs for instance)& |" d1 V% X1 j
; w H6 n- {( {- l( N__________________________________________________________________________
4 ^4 J7 `0 K! Z1 o0 P6 Q) F' L9 a6 @8 m* H( n5 R
Method 119 n, ]/ c. n! a. n8 ?* _
=========7 B* {8 R$ `% W8 k* T R/ \2 C
0 G: D! P' h% O& U6 jThis method is most known as 'MeltICE' because it has been freely distributed* y* l5 e9 r, Q' f( q
via www.winfiles.com. However it was first used by NuMega people to allow
- m' Y) Z& r! M7 RSymbol Loader to check if SoftICE was active or not (the code is located
D/ x2 o1 F& U2 u9 [inside nmtrans.dll).! g+ T; H" t% _! P2 @+ U! }
7 R2 Z8 L+ K0 r4 W* @0 _# iThe way it works is very simple:
( m1 ?4 d* u! h. \It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
% X! Q; ]- ?7 ^1 N" w8 DWinNT) with the CreateFileA API.
9 h/ X3 C' M$ ]- t5 t( M1 s5 R% J+ @" s# o2 [7 n) V& I7 h# `' \
Here is a sample (checking for 'SICE'):
/ N! J& t% Y! D J1 D6 I! g
8 a$ m5 q- k4 H* o6 b' g& D9 EBOOL IsSoftIce95Loaded()
6 _* e# T3 @5 W) i. e3 w6 i8 j{0 N5 J" K+ V, t* z$ ?
HANDLE hFile; " @; D* a6 p& V3 ^& q1 _
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,5 j6 o; Z6 q& O. K
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 j9 |4 e9 x4 p: k6 w+ s NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ v. U4 S2 L! I0 @# V
if( hFile != INVALID_HANDLE_VALUE )- k. { L- u$ Y6 J6 z$ I! w
{
6 p# U5 T1 V! j& ? CloseHandle(hFile);
! ]+ Q1 y/ a2 C* P9 L return TRUE;
4 `+ f% b5 P. k6 E9 z5 ] }7 g) y$ ^5 W4 f5 H/ w
return FALSE;. {+ p; L7 X' |; S% j+ |: n# _. G# c
}& I6 Y3 ~5 H }1 t7 Z6 m1 q
- V5 Q$ g- \5 W* b' U y$ MAlthough this trick calls the CreateFileA function, don't even expect to be
$ T" V" P4 \7 K3 h b7 s/ o1 gable to intercept it by installing a IFS hook: it will not work, no way!
% K$ {1 W8 u( A9 `4 _$ ^5 xIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
" F+ ?7 `9 q3 F8 c ` r' y G- ^* jservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ \8 a* @1 Z% t: T4 _3 ^- T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
9 ?# _1 j& m- ffield.; o! o( J- R u4 |1 A4 t
In fact, its purpose is not to load/unload VxDs but only to send a
- H, G# z7 s7 n4 u% fW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 B6 X+ ^ b- O, Q' v) d6 Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; `6 _& P4 C: Y5 wto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* w/ u6 ~4 e1 a6 LIf the VxD is loaded, it will always clear eax and the Carry flag to allow2 ^" F7 I U( N, l- {! S$ E9 Q
its handle to be opened and then, will be detected.
1 p, x1 _/ I7 h/ x" Z$ TYou can check that simply by hooking Winice.exe control proc entry point
2 l& M' t2 ~0 V4 ewhile running MeltICE.
9 O! q* |9 t1 [- Q# m" F4 ]. W" Q' V+ T& s
/ H+ y l5 e! D P
00401067: push 00402025 ; \\.\SICE
0 u* a4 z( v( p- f8 M7 x 0040106C: call CreateFileA
: c7 X" | I, ~3 m9 s9 b# R" S 00401071: cmp eax,-001 @! Y; B/ ?: f0 D
00401074: je 00401091
+ Z' J u) @2 u
5 b& p6 {% @1 M- R; h* q; _- S. C' |7 F4 L8 J
There could be hundreds of BPX you could use to detect this trick.
$ z" F8 Z% r3 {- \5 G" P. G3 u-The most classical one is:: C- U& [3 j% B& ?7 d9 n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 Q* e1 z a- E2 g$ u *(esp->4+4)=='NTIC'( x/ l, p2 E. j0 ~1 @
! S9 C4 N9 m5 ~7 k( F1 v-The most exotic ones (could be very slooooow :-(
. O6 \3 v" \# g1 @, _. E BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
) D$ |4 e$ t. }* {- ]) ~ ;will break 3 times :-(
- k& A1 V8 \; p& H: t! ?# A; f+ O, w
% w6 g# ~4 c0 L1 Z, M7 b: c/ Y8 E-or (a bit) faster: 9 s" N! }* \/ `( h, Q
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" w$ T: Q' A6 ^0 L5 Q
+ A+ M3 ]) h& D BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ u% P1 s, i2 A. `, p7 T ;will break 3 times :-(+ B# ~; X5 X; u
' R2 K4 I1 ]/ f3 N$ c+ e. \-Much faster:: y+ @" X% e5 P" Z/ u2 ]" _% V
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'2 Q! L% O9 P/ I0 o
' C& a$ R- s, n: J5 ?/ INote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ t! U; b. x2 B( I; afunction to do the same job:
8 f5 R/ l$ P# N. {6 v/ }; `5 {+ l9 L3 j& T6 Q( w' g% F j( o
push 00 ; OF_READ
; M9 p4 J( x' Z+ D: O2 {/ n mov eax,[00656634] ; '\\.\SICE',0# }3 E4 _* q' o$ k
push eax6 e. N, J8 ^# r) s N- d/ w2 F$ \
call KERNEL32!_lopen0 a' {0 v+ G, F) N6 n$ w
inc eax5 G, M& W4 U) F4 u" \
jnz 00650589 ; detected! M! D8 D: ]3 }- Y) k$ p
push 00 ; OF_READ
2 B- D0 f+ x2 L5 `! C. X mov eax,[00656638] ; '\\.\SICE'
& C3 n5 K4 j' N' ^9 q/ z& o push eax( m: a4 F# b4 L# N
call KERNEL32!_lopen) p, Z) A, ^( T7 j( ?$ V
inc eax
7 U( v0 Q8 o9 _) } jz 006505ae ; not detected9 F, P+ T& z% U8 J8 l1 R( D6 L( v) ?
2 X0 {1 e/ t1 u7 ~* c3 e
$ `( {1 S* c% F% e- }) _+ @# y
__________________________________________________________________________
! Z& N; q5 g2 s/ T% {' v1 g! b/ R) N1 p# s2 t" _7 }
Method 12. O0 P+ u8 c: V. @; W/ p+ M- P W
=========' n$ ]9 l% P. a" O* `5 d0 C
/ ?3 J; r- `+ L$ l1 p' C
This trick is similar to int41h/4fh Debugger installation check (code 05
, u2 i9 t8 O6 i; w, K& 06) but very limited because it's only available for Win95/98 (not NT)( o" Z {: f$ k8 r, ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
7 L8 ]! b# r: y7 R! _2 p- ]' _. `( a% W5 N
push 0000004fh ; function 4fh7 y/ L+ n, n: i4 a: L- N
push 002a002ah ; high word specifies which VxD (VWIN32)0 N& [0 A) C: `# u: {
; low word specifies which service
6 U! a' S; g& C, M' `3 c (VWIN32_Int41Dispatch), o) v3 Y9 k. i: E1 v4 J* L5 L q
call Kernel32!ORD_001 ; VxdCall
+ a% ?1 ~+ o# u: G cmp ax, 0f386h ; magic number returned by system debuggers w0 u5 t" P* [ J- r
jz SoftICE_detected
! `) r; Z4 ^1 G, u2 v }$ [- c, Z" M; C
Here again, several ways to detect it:
0 B' h7 o7 ` c. A
. z+ ~. H4 b& A! N BPINT 41 if ax==4f
& x- M3 G. ]0 l3 @7 q$ E' Q& a7 F! z" J3 y$ P) u
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 `8 A; v+ B9 g' B2 i1 o2 D
& D- q4 ~+ I7 K" S& ? q
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
; t2 E& M8 D8 ^6 n5 a
- Z! E4 G) D3 x) p BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) ~4 y9 h; P9 H+ {
9 i, \- ?& n9 x4 q__________________________________________________________________________
; y( p0 N1 W3 b/ g. `
3 [. j& f2 z) U4 K2 Z8 sMethod 13
4 D O& E3 i9 Y5 A) S# t; v=========
$ \: g2 I( f6 ?9 P6 P7 w) |6 y7 S
Not a real method of detection, but a good way to know if SoftICE is; ?0 G |/ p" y) B# q
installed on a computer and to locate its installation directory." p8 |: F. \; \/ `9 f9 H' U0 D
It is used by few softs which access the following registry keys (usually #2) :0 j% ~, ?8 S" G r# j( k
. ~: e3 E2 f& W
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 B. u5 ~; }/ u% n\Uninstall\SoftICE9 g( B) b, j8 `
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 _8 g) H6 B3 {
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion7 J% X: n) |9 W# g/ ?
\App Paths\Loader32.Exe' ~1 M- u% W9 k& M4 Q# H- g
9 _8 D% ~. P* }# m1 f% x1 n4 r( U8 p! w5 Q) m
Note that some nasty apps could then erase all files from SoftICE directory* h$ J8 q4 P) ?' H7 G+ X
(I faced that once :-(& U- U% ~/ J" j0 ^( h
# q% w9 M" `/ T* ?3 Y1 r0 A! [& G4 NUseful breakpoint to detect it:
3 x$ M. u6 R7 C- M. `: }: j: V% H/ Z+ v8 ?& H8 j. }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( m9 h* _( K! t* q4 y3 k8 T! Z% }8 v: r6 q: c) C d0 B6 h
__________________________________________________________________________
2 N# s- t- B/ I7 T3 I/ n
9 Z" ^; E- U2 k. E- T) x* u5 A7 C- E: c9 m) e
Method 14 # q' ~1 ~* Y" e0 E" K7 ]; {! p
=========
8 \: p: G! W, e6 ]0 f/ T% D9 `/ T# S: q5 R& f# I( S& L( y
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# [6 y! k5 S: d7 tis to determines whether a debugger is running on your system (ring0 only).
% k2 d+ ^# ]! Z& r* N
) Q$ \% |' ^4 S% q' ]0 ~ VMMCall Test_Debug_Installed, d. x3 Q9 m; l9 j
je not_installed* Z1 n# g' ~4 c+ ?9 O
6 x p" h- G4 s- rThis service just checks a flag.
1 \$ B! M- `! S; |3 l. K</PRE></TD></TR></TBODY></TABLE> |