<TABLE width=500>( F' w2 s$ S, l
<TBODY>- p0 o0 C# S+ @+ v
<TR>: n6 g0 o$ U7 k1 L$ k
<TD><PRE>Method 01 / B% J6 P$ w J. V
=========& Q9 Q$ g! Z9 C- c2 `, ^+ W7 d
2 A# O; E9 g* v0 Z0 @: |
This method of detection of SoftICE (as well as the following one) is
" t) i+ P; k, z9 }. m9 W1 ~used by the majority of packers/encryptors found on Internet., H G0 W) K$ R0 i' a' I
It seeks the signature of BoundsChecker in SoftICE
' v; }3 _, a% M9 U7 E) P8 H9 C2 t" E$ f# M, d4 |6 i
mov ebp, 04243484Bh ; 'BCHK'
; K1 x: g, R8 k, L3 _% `0 F mov ax, 04h
/ e0 R% `! j/ A5 w, N int 3
) F$ j+ v# t9 E3 e8 B* \' @ cmp al,4
( d0 s1 @: c+ `/ L$ M- X jnz SoftICE_Detected4 c$ i1 p- {2 O/ v) U" e" Z; M
5 x( q8 q# ?- x7 R% i: {" `6 R0 H___________________________________________________________________________
7 s& X* M3 w4 M1 r" L: X% _! T- C! r `& c4 Y7 u$ m0 C# H
Method 024 \7 S1 J1 G+ t. f) f0 H: Q
=========
2 ]1 j3 A0 y- L! V& H; ?8 f: f5 o& ~3 d* G) f7 q! U
Still a method very much used (perhaps the most frequent one). It is used* j7 R6 q. E X3 A
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ Z' e9 ?7 ^. i$ f: T4 n
or execute SoftICE commands...( r/ f% r# }9 t
It is also used to crash SoftICE and to force it to execute any commands+ S$ P9 K* h1 ? I
(HBOOT...) :-((
+ B0 T% W8 @: i1 _6 h# k
. J; t" R2 x# X8 aHere is a quick description:
E) _1 A" \4 T, s) X1 I& H6 W-AX = 0910h (Display string in SIce windows)) I- I) ^5 Q$ ~- ~9 l; Q- c/ g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)5 b! J! w0 v, a2 r/ X' H
-AX = 0912h (Get breakpoint infos)
( ?0 \+ H b7 w, `-AX = 0913h (Set Sice breakpoints)+ N1 ^& u: V t; d2 a
-AX = 0914h (Remove SIce breakoints)
+ f) R' t( M8 n3 ?+ H
8 T6 X8 S# w9 r# M WEach time you'll meet this trick, you'll see:
3 G2 Z" ]7 f& e$ X# O! ?-SI = 4647h8 F% L" ~: G; A* j; c
-DI = 4A4Dh
: B6 f" p( I( X$ fWhich are the 'magic values' used by SoftIce.* h) S* c2 D5 a- @: k% F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.+ i) t' y& N% v0 Q. {: c' K
: R! {. K6 _' Z5 b) i; U# [# k
Here is one example from the file "Haspinst.exe" which is the dongle HASP
( T; U* _: P5 F: L! [ MEnvelope utility use to protect DOS applications:/ g; \& t. I* L+ {8 e% V
5 K! z" e$ z5 f2 `
I3 ~! g+ A) G+ {! k
4C19:0095 MOV AX,0911 ; execute command.
- J8 u9 k c( L' X: e N$ Y! y4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).: Q4 G! N# [; h5 g9 O
4C19:009A MOV SI,4647 ; 1st magic value.
8 |$ L: j' X+ ]) d n4C19:009D MOV DI,4A4D ; 2nd magic value.
4 M6 Z* _+ C( ] f; F6 a; f4 B! G4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" E+ u; N2 {* A8 L2 P8 \0 S9 a4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 V! {7 M, w2 n3 L/ {+ B j5 O
4C19:00A4 INC CX; G, M! r4 f4 [# V% O
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
# V# |) R$ t4 |* l) ^4C19:00A8 JB 0095 ; 6 different commands.
# t- a- D, t& @- X0 `4C19:00AA JMP 0002 ; Bad_Guy jmp back.3 T# v/ x3 x8 l
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)' q& e/ h& A) X( [/ h4 g% q5 t
; B! Q" ?/ V) H1 ^
The program will execute 6 different SIce commands located at ds:dx, which* @6 {( |' {! W! B4 [2 ~0 g7 h" ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT. o; Z' o& d9 n3 n8 c' v5 y
, c8 g- |& F- G. R" u2 Z
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
X1 B# |* r$ H" C) @0 C___________________________________________________________________________
1 ^0 b) B# q% S1 e( o
5 e! d% n8 P1 }' N c2 y4 B0 e) @: E, G9 P9 O# m, T
Method 03+ l1 Z: E# o: l" x
=========
: X2 C; Z0 s, |
, o1 b- ~8 Q: Y$ p' \Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& Q b' p$ R. K0 c+ ?6 j1 Y
(API Get entry point)# t: Z k# g7 y9 R
6 _. S7 E/ R% O
% ^. c0 _+ ?# J) x
xor di,di
! r# L1 v" N. `! m mov es,di7 F3 N7 h/ P; E
mov ax, 1684h ( f. ?) p9 i p# v
mov bx, 0202h ; VxD ID of winice
4 B' u4 ^7 F5 X# U* t# W2 b& O int 2Fh2 X- ^# V7 ]" V9 R+ @; S& I8 U
mov ax, es ; ES:DI -> VxD API entry point# j6 A4 B' w$ a
add ax, di
0 A; X, V/ b" o, M, N test ax,ax( d' E' @. d. S5 v
jnz SoftICE_Detected
! \: [3 h6 ?. I2 X, `" p! r, N% u. h$ a; O* m3 o4 P
___________________________________________________________________________2 U3 B6 `5 U: @8 A. E4 I
\; @3 t" V9 ^8 i) x( _! qMethod 04; S f& \: k: j5 t
=========
# j% x* k5 j( G& k9 e8 t9 b9 i" ]) s6 i
Method identical to the preceding one except that it seeks the ID of SoftICE% _$ b2 O9 ]2 D; R0 v
GFX VxD., h5 t" y& g) R; v
. _7 z; n$ w1 L) n2 X xor di,di
5 [; X3 l. p$ b; T1 x- s$ w% W mov es,di' s* Q* ?# a/ l; ~2 U" T7 J& F& M
mov ax, 1684h ' ^ m, s" u* @) C* k ^
mov bx, 7a5Fh ; VxD ID of SIWVID
& y* w, A* n2 p1 V! d+ z4 y int 2fh) h0 ~* h# k( i+ U
mov ax, es ; ES:DI -> VxD API entry point
! @& \' B( C" V) w) K; Z/ n+ t add ax, di
9 t3 t7 m# T$ k' I) G9 M0 y test ax,ax
. \0 ~: u4 q& [ o% F, h6 k jnz SoftICE_Detected# p0 k- ~) U' Z7 Z
6 ]% u. L2 r3 J3 R
__________________________________________________________________________4 y: S7 X' W+ B( X- g
4 ]2 O. y3 \2 L
+ s/ E: r+ ?, F2 YMethod 05
6 r+ @5 w. H) u& G7 ^' p=========+ X1 I4 B4 c4 L6 l
$ E) P/ ~ ?7 Y4 _6 v+ F+ ]
Method seeking the 'magic number' 0F386h returned (in ax) by all system4 [! }5 W3 Q8 Q
debugger. It calls the int 41h, function 4Fh.
0 [6 X( O, C+ [+ n' x) AThere are several alternatives.
s: R8 r* D8 H5 w) w0 t/ u- P1 J1 g7 d- ~$ q T' B
The following one is the simplest:+ t F7 O! A% O K E# {. a+ \. w7 p
- Q6 k- b" d |& [7 M0 C% E mov ax,4fh
* m( h. I3 C6 f6 | h+ O+ ? int 41h
1 N* s" [4 o/ D! F! r7 p& n- B cmp ax, 0F3869 P! ^4 c1 {# C. M( H# F( @8 b
jz SoftICE_detected5 u% f1 c- ~ z& n: b4 X/ ?
, q0 ]. x$ h( r7 h; U; S2 J: w5 ?: p# A- x3 P* ` L8 ?5 e
Next method as well as the following one are 2 examples from Stone's " r7 d1 K, x4 ~2 i* `+ M
"stn-wid.zip" (www.cracking.net):/ Y5 g) W& I. d; V( I5 N* p* g- n
* t' R/ r% X' x/ M+ l mov bx, cs# k8 h! P9 U1 V; f
lea dx, int41handler2
+ ^/ C0 z' k0 E/ [. w9 Y' ~8 \ xchg dx, es:[41h*4]4 }" R/ T8 o: P7 }9 n2 w
xchg bx, es:[41h*4+2]
. I2 K1 U0 r3 c, L( K6 Y% F" B mov ax,4fh' ?6 Y3 D1 |! U, b; V# `; g8 F
int 41h! b+ h: `& X5 u
xchg dx, es:[41h*4]
7 u% K5 X& F- M# L! w xchg bx, es:[41h*4+2]$ u' d: y0 l, D" c2 |2 H
cmp ax, 0f386h
H% g: j: J6 r* j! g jz SoftICE_detected* P: X) X9 r+ q( i2 m( t! J
* Q. l4 E g7 @7 x# k% N# H4 i$ aint41handler2 PROC* @ s+ o3 x7 ~9 B9 C
iret) v5 M/ ~* M7 B/ V( [1 R
int41handler2 ENDP
3 n) ~& l/ @5 h, m6 Q' `0 ~9 O9 }0 P/ p f- g# K9 j* \
% @! a' R, Q( @7 e$ d* |1 c_________________________________________________________________________ \6 {5 r% s4 P- U# w4 e3 a
3 B4 g* G1 B3 H `. w0 Z3 Y
. u0 a/ T6 h+ X9 B1 x# wMethod 06
6 I ^; d# J r8 F. q0 D7 ~7 N=========
" d& `8 x3 q% M, w$ B/ n: v
' ^# ~; b5 y- D- X
) p3 e" h1 i! d6 W- E4 R2nd method similar to the preceding one but more difficult to detect:
. a( c" Q5 p! S0 i% L7 i$ Q* ?& f& S# T3 k, `1 I" b D$ ^& \
( t( w4 p/ q9 u9 u$ Y" W4 pint41handler PROC% J1 |0 \) g' K& ^; o
mov cl,al7 `* o$ `6 o- X( [
iret/ v& H. r# ], @8 N$ h) F' ]! U" u1 k# U
int41handler ENDP' j, h6 S( M$ t% y
4 B2 o' g6 K9 m0 ?/ x) F
, }, d1 x# C' J) m- L; y, b7 ~ xor ax,ax
! p( y# v" N- `7 t& c. C mov es,ax F2 U }; Z' m3 L
mov bx, cs
5 t U. y1 t: X% b$ r lea dx, int41handler
+ }( T5 s' s: _0 { xchg dx, es:[41h*4]' \! v4 k, n7 F* {/ Z# g$ x0 X
xchg bx, es:[41h*4+2]( f7 u7 A6 D) A0 U1 l
in al, 40h
0 c# r& I( V- s' w* h$ R* k5 [ xor cx,cx: r; C) I, ], t# B0 y+ W& ?5 m
int 41h' R0 q* q7 e/ N' B1 f
xchg dx, es:[41h*4]) M, e3 N; o( n% }3 V2 B
xchg bx, es:[41h*4+2]- J) D* Y; E- @
cmp cl,al
7 D% J6 Y* ]3 v& y jnz SoftICE_detected: s7 {6 x" V) ?: ?
% Q$ x* {6 V" r# o/ ^
_________________________________________________________________________
u2 Q% g/ b8 t- s- J: V1 y8 m% c# V+ v6 k
Method 07
, M/ P+ Q) H4 D: r: D5 ]+ F=========" q2 Z0 x* U. ~6 H- l% S) }
+ ^, K% o3 W- [ r
Method of detection of the WinICE handler in the int68h (V86)) E) d9 J/ Y' B# a0 {
; D ~ Y% B X8 ]9 B
mov ah,43h+ Q6 h. A. C) ~/ _/ k7 O+ W
int 68h! @) \) E; F) {4 J
cmp ax,0F386h
+ K E( a# C) I/ a# E7 y jz SoftICE_Detected
+ Z s5 j1 ~; c8 W! `% x/ J: Y7 T4 e7 X% L; R( s" H
/ Q' H0 j' J0 E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit' m. i" R& t3 ^; _! J
app like this:
9 H0 y! a4 @6 u, I+ H
" k/ h2 U! _+ K4 R- u2 U% Z BPX exec_int if ax==68
. x7 w5 _) S$ O2 j* J (function called is located at byte ptr [ebp+1Dh] and client eip is+ Y8 p1 e, C3 D6 E6 q
located at [ebp+48h] for 32Bit apps)( c5 W9 `# D% K# c
__________________________________________________________________________, l$ e$ D$ d2 b6 a5 ~+ E
7 v6 g1 k# n9 N0 O
9 p6 K4 [. x- ?Method 08) K5 V5 Z5 C8 i3 k( F* m4 X
=========8 r' {* F7 N5 `2 M" Y% f
x% P" g% U1 Z3 V3 X! W, j- h9 KIt is not a method of detection of SoftICE but a possibility to crash the
D- k$ O8 n% v, D0 Nsystem by intercepting int 01h and int 03h and redirecting them to another
6 f o2 f$ G$ a6 B3 d$ }8 h( e7 iroutine.
5 k- r% V+ I7 X" [/ q/ k+ t \3 E5 hIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
N! P/ k# ~" jto the new routine to execute (hangs computer...)
5 N" M. a6 k- v4 c4 M$ J6 |/ G0 X t# i& b- P9 d
mov ah, 25h
$ {2 L R! ]: E! Z6 L! n _ mov al, Int_Number (01h or 03h)
' d1 c K# Y9 s4 q mov dx, offset New_Int_Routine: i' \9 o9 l9 Z8 e9 E5 y) {
int 21h7 A, f1 C* w' v/ Y
- B6 S% P0 U5 R
__________________________________________________________________________/ n( @# j% E' ]$ f! }6 _5 K
% r) Y$ v4 _! D' s: `
Method 09
) y/ [9 k* B. O, h6 b& p" C* [7 \' K=========
# u$ v4 s/ B% K* r
) e! U: L% R$ ?3 N- ?- jThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
$ Y# u1 {- N- w; ^- vperformed in ring0 (VxD or a ring3 app using the VxdCall).! ~) @ \! b. r6 l! |
The Get_DDB service is used to determine whether or not a VxD is installed: k, l0 n$ j- V( O* q
for the specified device and returns a Device Description Block (in ecx) for
, E! P T3 s' t; {% ithat device if it is installed., a% g9 X) T3 a& `! w
) v( O3 X- r# l' S* U- [, t mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 A( j# T3 ~( I mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); a, i7 {8 j1 r" w! R+ B9 e) G
VMMCall Get_DDB% p, B" Q. W S1 u
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
# P( W' Q/ I( {; M6 o/ L" z
2 B4 ^8 d' l# |, v8 {Note as well that you can easily detect this method with SoftICE:
5 u; e( I) J. H0 M+ _3 y6 L bpx Get_DDB if ax==0202 || ax==7a5fh0 I2 [7 Q1 c7 W, U- P& W
/ j: S5 |% Z% q6 e- d+ i
__________________________________________________________________________& w6 I/ [4 \1 l' D
( b$ E( l; k' \- Y0 |
Method 10
6 h% e% R: r2 |3 ^& U5 F=========8 o5 W. Y2 x2 }- h& {* n. z6 @
5 e2 ?( C, R0 w* R& a8 F% R# Y: v=>Disable or clear breakpoints before using this feature. DO NOT trace with4 k7 H& E0 B6 l/ b2 U/ S. b& l
SoftICE while the option is enable!!
; U9 {, ?2 S3 T f* c- O
" T. t' j7 D, e2 nThis trick is very efficient:
) e7 h& @1 K+ T5 ~- y3 S Mby checking the Debug Registers, you can detect if SoftICE is loaded
% g& g2 }: b" m+ R) I8 _(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( ]+ U; P+ [, }* b9 R A( i4 sthere are some memory breakpoints set (dr0 to dr3) simply by reading their+ J. g, |2 W! b" G6 `. b; i* a z8 f& P
value (in ring0 only). Values can be manipulated and or changed as well6 @: B1 g9 q2 m7 U2 `; ?! |4 w
(clearing BPMs for instance)
. Q6 E+ v a5 T N: y; ~+ z" T% @! T4 l+ A/ y' b1 ~8 i! |' `' h, @
__________________________________________________________________________
' b0 M( b5 p7 d- _8 O7 W! A7 i/ L: f+ X0 `
Method 11
; g% |* b4 \% i/ ?=========
, L' S+ _! J+ v6 P; x: g/ z6 V2 z4 m8 X1 `' K4 o
This method is most known as 'MeltICE' because it has been freely distributed
/ i7 T8 q* y4 r* |; P a( avia www.winfiles.com. However it was first used by NuMega people to allow9 Z; M0 U: r( u- {: x
Symbol Loader to check if SoftICE was active or not (the code is located
: @4 G: c! o! Jinside nmtrans.dll)." G) u4 P% n- I b3 p9 x: A3 b
3 Y( S1 ^3 d- I# VThe way it works is very simple:5 ?8 b8 @; G4 V" G& |# ]% b
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' ]2 t! ^/ }9 B* Y( AWinNT) with the CreateFileA API./ w% E0 }, b2 v
1 q7 z5 t1 c: h9 T5 p: r
Here is a sample (checking for 'SICE'):" F+ }/ ?: f- c
$ @, d: K) w- g9 y: ABOOL IsSoftIce95Loaded()
3 h( P: w4 W% D$ }" g* }% [{
2 v0 p. V" X. {4 v6 R- c% u: P7 l! J HANDLE hFile; 5 B1 e: C- y7 K" F
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 o9 K- d) _4 L1 B4 ~ FILE_SHARE_READ | FILE_SHARE_WRITE,
, n1 _7 t i+ { NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 F3 W( H& R# J* M& R if( hFile != INVALID_HANDLE_VALUE )' M# d& J4 A W2 d9 D
{
6 w. y2 s% R7 G4 b CloseHandle(hFile);+ C3 O7 O, Q+ j7 P: v* G7 j9 Y, a
return TRUE;+ q3 g$ j# D: G, \
}
+ W( I9 a) y7 K: M; e9 P return FALSE;
( w. r2 B+ X8 z0 `" m i9 N}* p6 x" Z. A3 H g% E
$ a( L' |3 B5 [3 Z+ n' E$ b& ZAlthough this trick calls the CreateFileA function, don't even expect to be6 V D& k4 `( j! ?$ z& t* Q
able to intercept it by installing a IFS hook: it will not work, no way!
- @0 D, L9 M' e( D9 T. Q# @In fact, after the call to CreateFileA it will get through VWIN32 0x001F
h7 f0 T- A/ Q5 i+ K, C% uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 z0 O! G2 W6 j* B$ R2 ^% Oand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& c( K( m- \+ F* Q: R8 afield.
, Y: L8 D5 M" ~In fact, its purpose is not to load/unload VxDs but only to send a - H4 a0 G/ z4 W4 u6 L5 M* A+ Y
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
. g+ ]7 g7 j* u9 Z8 t0 f6 Cto the VxD Control_Dispatch proc (how the hell a shareware soft could try% ^9 o* A0 U; r8 Y& X! {
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! Z/ k2 |5 g) z; E: r8 @If the VxD is loaded, it will always clear eax and the Carry flag to allow, O( M( c) a( E4 D! ]4 E
its handle to be opened and then, will be detected.
/ n, v: m0 a2 J3 m* {$ W. d; wYou can check that simply by hooking Winice.exe control proc entry point( @8 h: [9 V# {. \+ w
while running MeltICE.0 _0 G& _% Z. T4 g. c
4 d/ h R: _9 C( t
. A) }1 \2 x" B3 Z" j4 w& ] 00401067: push 00402025 ; \\.\SICE
, Q5 N7 [: K9 g2 A( F- Z 0040106C: call CreateFileA
4 X% V9 ]+ V9 C 00401071: cmp eax,-001
5 X; ^/ E* m2 V, S 00401074: je 004010917 x2 N; g6 H+ A) R* ^. \, d
}8 ^( z; |$ V5 h# |' L
8 w" v, P) l5 S& ^4 r. a3 M8 wThere could be hundreds of BPX you could use to detect this trick.; C, ^( Y6 r+ W0 r. _) d; r
-The most classical one is:
N$ `- y" _/ k0 e BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) z% f+ L8 T/ r8 x7 ^3 N
*(esp->4+4)=='NTIC'# E, y- @, r; {* Q0 v
% D0 r; J' z" v7 @-The most exotic ones (could be very slooooow :-(
/ ?5 }3 t" o }, | BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
6 U& N3 n5 Y$ t7 S# G% q ;will break 3 times :-(- G0 R$ I% U: S. `1 q8 q+ V- N
' `( ]9 f+ L: _! ~. M% p: K( P-or (a bit) faster: 9 G X: @: M; Y9 h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, r# d( P1 F: t% I; _4 U; j& G2 B( U v; H+ m
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
8 |, q1 L) @: g6 f0 g% l ;will break 3 times :-(7 z7 o. w2 a+ K! Z1 Z
8 L$ r: F3 e$ a! W7 k/ U8 d5 }6 f4 B& T-Much faster:7 D7 r- @9 @) Q3 n6 ?% f, q
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- n) H( P4 V" ?* U' _; x& J' s* }! X) V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen6 E' s% U: J" B5 y! m# r
function to do the same job:* ? n- C8 {& _, @+ Q$ s! P
( j/ ^! E$ M0 K( H8 Q5 H+ k3 n+ u
push 00 ; OF_READ9 H- J. W# V% O) H5 W! P3 D6 ]
mov eax,[00656634] ; '\\.\SICE',0) O: s: W+ J+ Q2 f
push eax
: d' \* G5 h7 u1 J2 B# _/ w! u2 C* n call KERNEL32!_lopen. f/ ~% K8 G' G* }' Z: `" |% s, C
inc eax* e& F$ [' V& Y* l1 J0 J/ s. j
jnz 00650589 ; detected
+ v9 n/ W1 b7 {3 j; f; v/ e- j push 00 ; OF_READ
2 t' @+ z# e4 z* n+ w' `; P mov eax,[00656638] ; '\\.\SICE'# ~- q/ _! [/ F, t( h! N
push eax
2 S5 V& [6 n, K; C: E1 r; a( L9 Z call KERNEL32!_lopen$ V; Y2 m6 k; J) p. Q& K
inc eax
9 \; E) R* P5 T7 Y; ?! a jz 006505ae ; not detected
* ?+ O1 D( Q2 O0 |5 ]- F+ i9 O) {6 i7 A* q0 b* z
! N; a$ e) P9 s; K__________________________________________________________________________6 r7 c# e" E9 c3 `) w# N# Y v
; x" `1 [# N% z+ [/ m/ u4 s
Method 12
& `; I& E- d# o* [) J5 z9 L=========1 c( C# T- i- [+ ?) n. i+ o: Z' l
: n% S/ f) ]/ x1 h6 D, PThis trick is similar to int41h/4fh Debugger installation check (code 05
# f' }/ z3 I$ X& 06) but very limited because it's only available for Win95/98 (not NT)' k5 B5 q4 A' o4 ^1 w+ J$ u0 ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* ]( v3 r$ o+ M7 t; F0 r; i' c
! H$ B. e% g( ? {9 a+ o push 0000004fh ; function 4fh
0 c2 ~& I& C5 Q8 K( I. D push 002a002ah ; high word specifies which VxD (VWIN32)' x5 t; a8 F1 F) G1 M: j
; low word specifies which service! x* i2 c- B+ N8 ~- K$ V
(VWIN32_Int41Dispatch)0 |& u) E1 E+ M. X8 s! C
call Kernel32!ORD_001 ; VxdCall
" D$ z5 v0 K. N, O+ D+ p9 ?# j6 U cmp ax, 0f386h ; magic number returned by system debuggers
& M: @9 b+ Y4 ~. y1 D5 k) @& h jz SoftICE_detected. ?. @8 [$ r+ G% O4 M
3 d9 k4 N# K; h8 V
Here again, several ways to detect it:" S$ N5 L5 S& U
8 g4 x v! T# A5 M3 \
BPINT 41 if ax==4f- ^* U# S1 j% ^6 R/ E1 X4 `1 i
& U' i1 x5 c. O. R' _( c. _
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% @! f" N5 {. z: |
' a9 \( v8 P8 I" D- S* F) x
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A) n1 ^- Z% K% p* n
( k0 C, @' U* X) O- x* E7 ^
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: W9 h. o) k, b5 S, @: ^9 q2 s
' T4 I, M8 _& X__________________________________________________________________________
, n2 i3 F3 b2 _& z& l
4 w% _: s" ^+ C4 T9 @Method 13& ], x" Z8 n8 @2 W5 s* x, N
=========. m6 O3 @" b% J0 q
, M# D0 G; _ Z- c
Not a real method of detection, but a good way to know if SoftICE is: R C" @" N; l2 f, @' R' f2 q
installed on a computer and to locate its installation directory.
! I8 b F* g) K8 `( ?It is used by few softs which access the following registry keys (usually #2) :7 e5 ~7 b, n: M
; ~) [1 e, ?* S( m+ n
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- X. a1 G1 s' U; J% S0 J- k\Uninstall\SoftICE1 N& C5 S, ?- p" l4 v2 k6 Z& M" E, H
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE5 [, t: k6 |7 q- |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- h; h+ f) Z% t7 V1 j& L8 u* Y
\App Paths\Loader32.Exe
1 S: t, a, I" h( `& a' Z$ S$ ]/ l' `! ?$ F" A1 e! h2 ~1 m |
1 h: x2 T0 X2 J* Q
Note that some nasty apps could then erase all files from SoftICE directory
% r- K E* o4 _- g(I faced that once :-(
4 R$ G1 _ L3 U' S/ G% q& ~
) l I) ~8 V, z- t, ?Useful breakpoint to detect it:. ?' H1 P) h @: J" I9 \
5 M# j5 X7 J% G# q
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( {7 n- L* u- u% X- u( F0 B3 m( Z/ C2 ]6 |
__________________________________________________________________________; R1 r/ C$ C, }! ?
4 e4 |1 K( x$ p4 |5 ]6 c( H7 k5 h/ E6 d+ Y
Method 14 H1 {+ p( Z0 I& x5 b, N( l0 Q
=========
4 m8 \1 T" Q* s* K) m5 r
5 h8 E# g8 C7 X7 w- ]$ A, B* IA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' s6 c5 l" I" h: b3 d8 mis to determines whether a debugger is running on your system (ring0 only).4 ]0 ^! |! C2 K _* G% c
: t: j) l, O! H: L
VMMCall Test_Debug_Installed
( z6 t& z7 _3 H+ I7 `, P3 t" I" @ je not_installed9 K- c+ e7 j$ {9 g9 I8 k8 O7 I3 @
( p. ], U# G2 PThis service just checks a flag.9 m. G0 e- i2 P; t4 V3 }
</PRE></TD></TR></TBODY></TABLE> |