<TABLE width=500>, d4 A9 e/ X# W
<TBODY>: e$ Y# O. a W: `- u% k6 Z
<TR>
& q, r6 F- T7 E1 b/ h8 K4 t2 b<TD><PRE>Method 01
: `$ g9 n+ T% p" s$ H, j=========1 s& t$ M" o& j! F9 I3 C, c
( q! A8 b- z) n. j" O6 V' ^This method of detection of SoftICE (as well as the following one) is
2 Y1 s& \4 i0 _! H' q3 \+ fused by the majority of packers/encryptors found on Internet.
6 f/ F0 q, q2 F5 _It seeks the signature of BoundsChecker in SoftICE1 o. `7 l: Q" k9 u% @, [
, c& T+ [' H: m( n; ]; \ mov ebp, 04243484Bh ; 'BCHK'
2 j! B% o6 {" C I- C6 R0 h% t mov ax, 04h9 P! d2 l' i7 [7 t/ p: W
int 3
7 ]4 G8 g; Z5 p- o( k# h# g cmp al,4
' A. u2 r) P+ @2 ~7 r, ~+ W! a jnz SoftICE_Detected/ i! u2 d' ]; I/ m# c# w
- N' i9 y" N' p1 P7 q# {5 x1 S }1 {
___________________________________________________________________________" X4 {+ K( x: l+ W4 z
0 C m7 R' g7 R+ U1 Q
Method 02
0 ?9 Z9 r" Z# U=========
3 Q3 @9 I- }1 w# i/ o) ]
+ t- r0 V p9 T6 O5 @Still a method very much used (perhaps the most frequent one). It is used0 h1 D" r3 o" x7 y2 c: l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; } n4 C- k5 F; ]
or execute SoftICE commands...5 N- [3 n0 V6 {8 p0 T& s! z
It is also used to crash SoftICE and to force it to execute any commands
5 Q0 @# X3 s Z' N7 o' P6 B! a0 T(HBOOT...) :-((
" q" S% G) F* m, v1 n- X R9 ~- x; m1 \' o5 x: s* S9 }
Here is a quick description:0 e# b; u8 g9 p% v; j
-AX = 0910h (Display string in SIce windows); n0 k& m" R9 y
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! ]9 z* H5 W: H/ R$ t
-AX = 0912h (Get breakpoint infos)
) C- k; z" Q2 `3 @8 s0 ]1 e3 Q-AX = 0913h (Set Sice breakpoints)/ X* |, C- a2 C3 h
-AX = 0914h (Remove SIce breakoints)
" r/ X+ g3 H8 M. {; n% K! l% Z6 k, E, j
Each time you'll meet this trick, you'll see:: Y/ p0 i G8 G7 W+ _ U. t, |7 X
-SI = 4647h
) y8 N; _' _1 t- W! v6 X-DI = 4A4Dh5 E* f' s. O" X5 X3 @2 T5 P
Which are the 'magic values' used by SoftIce.$ I8 n7 V t: @) i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: d4 }9 T" `6 B; L, e1 h
( a: _' Q0 a9 g3 J! mHere is one example from the file "Haspinst.exe" which is the dongle HASP
; K$ q8 s- z" j' ~- eEnvelope utility use to protect DOS applications:2 d6 _/ S" x( N- K. q
: V- u5 {1 h9 p- J4 z% s( M" I- T- V" a# x* Y
4C19:0095 MOV AX,0911 ; execute command.
% X' r: S1 Z1 R4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 p. O; i- ?1 J% ?. `- f
4C19:009A MOV SI,4647 ; 1st magic value.
. g6 n( M) {- ?7 K& u4C19:009D MOV DI,4A4D ; 2nd magic value.
! O1 N4 ^, O o4 M4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ ~8 w3 B0 i5 i& F5 U% n8 p: V7 D7 D0 k4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
1 o! W% I: H4 x( B3 A4C19:00A4 INC CX
% d7 A; q* z; W x$ P4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& z8 _: z: U2 `5 W$ o! k2 d4C19:00A8 JB 0095 ; 6 different commands.: l% h6 r# f2 E+ g! N
4C19:00AA JMP 0002 ; Bad_Guy jmp back.# }* S7 \. v& \8 l2 d
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: b8 c& c* Z5 o9 V* ]0 s3 C0 H2 l
The program will execute 6 different SIce commands located at ds:dx, which" h. Z% g. G% o+ E8 p0 b. L7 z
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 Q# v+ O6 r# ?; ^+ o' o' E' _% y
' {0 E/ x" O1 [# Q" G- z6 Y* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- s% S1 V/ T, x2 ?; k/ _& N) H
___________________________________________________________________________
4 A; u+ P8 `, k% y, _5 Q5 [- d6 U
" r- L, l2 X5 w" L, j& j, d) Z- ~: u w
Method 03 E0 f" c: Z" G
=========( |1 s6 P2 [" o3 e
* ~% g: a* M0 F a* Z$ H: ZLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 O" n# Q) @0 K0 S9 V(API Get entry point)/ S% m" r- F8 r: W' e- f0 ^: i
4 W1 t2 ?, p: |. m
9 e3 {, }8 u7 W, T
xor di,di
; f! K% T+ j1 J- O mov es,di( @, [6 y8 ~% l, R! ~* @
mov ax, 1684h
2 g! ~* f, T. v t3 ^. }# z2 n mov bx, 0202h ; VxD ID of winice0 y6 R3 n1 C% \/ u# b& Y. R" T3 l# Z. T
int 2Fh! a9 Q1 _; D) A j5 C/ r6 C+ e
mov ax, es ; ES:DI -> VxD API entry point
U$ }: i- C' g4 |8 [ add ax, di
b& u- S* S( u7 m; g test ax,ax* w& c' J0 J) O7 y6 M H
jnz SoftICE_Detected) f5 n! C6 b. l1 m d: ~. K- k
1 `* K$ Y' f! J, _
___________________________________________________________________________
- F9 V" `4 G' f$ p
+ z- I- N9 m& cMethod 047 P% K; M# m; Q
=========" p r" c' U/ n. F7 S1 M& `
4 C0 x8 Q7 ~( z |8 K; Y
Method identical to the preceding one except that it seeks the ID of SoftICE
]' k' U! v) UGFX VxD.9 Q4 U5 o; a7 q& q" g8 o
; m4 D: ~$ {$ F" X. X xor di,di1 s8 U( b5 V# F& g* c M* A
mov es,di. Y6 Y/ T9 U/ ~8 M4 m7 R! r; E
mov ax, 1684h
1 d; @4 p5 _+ M0 f( j* N* o mov bx, 7a5Fh ; VxD ID of SIWVID
& o! o3 `9 Q; r int 2fh
9 X q9 `# A o, G+ w mov ax, es ; ES:DI -> VxD API entry point
5 }% k0 E3 Q+ A+ Z1 P add ax, di
m3 ?7 p& u$ b3 N test ax,ax$ ]* q! x) ~) Z* U% Y/ o% i
jnz SoftICE_Detected
* A& h* I& y1 d! c$ ]
$ T4 \* |: k2 W__________________________________________________________________________7 s8 ^+ Y1 O! L3 @$ w- w, Q
* B `- }3 v3 E* M( m% F" I {0 s
: d& }+ {, C4 }5 lMethod 05
% f5 }* h' n4 \5 H* i- z% w=========% ?; Q/ t$ Y( z7 l0 i% m0 e
% ]; v2 D: q( }
Method seeking the 'magic number' 0F386h returned (in ax) by all system' d4 m' h! Z& h" a( `
debugger. It calls the int 41h, function 4Fh.# _ J2 C) s& A9 {" w3 A( V- S
There are several alternatives.
$ X: J- S5 `/ P
- s1 h1 A# s8 B. yThe following one is the simplest:
# L/ o5 u- o, W3 |. O* g7 I. n
- V. B* y" k6 i. A, n0 d mov ax,4fh6 @0 a% `$ O. X( B, P( \+ z: M
int 41h
' N, B9 W( T u% V cmp ax, 0F386
7 H$ f/ X. n2 E* e jz SoftICE_detected
6 i7 P5 S: ^& a( t5 P) z4 S- c1 n' r, `$ V6 Y" b/ e( Z3 d- E
! g2 h1 m1 @0 U$ a
Next method as well as the following one are 2 examples from Stone's 0 s! _4 r# @+ A; B6 C- z. @
"stn-wid.zip" (www.cracking.net):
2 c7 H4 _) E+ A, D
# F+ Y% C( ]6 \3 W+ c- W mov bx, cs5 l! v+ Y2 _9 a# ?: B: }5 m
lea dx, int41handler2
6 g+ h0 c. Q% j$ M5 i xchg dx, es:[41h*4]
: o; ?* w" _6 `% ~ xchg bx, es:[41h*4+2]
! ^4 N2 Z4 W$ } mov ax,4fh3 ~$ l4 v7 H- _8 o4 ?
int 41h
: ~$ j# O+ h2 e& i# r# a1 I3 y xchg dx, es:[41h*4]
, U# m$ u6 U* t1 i8 b xchg bx, es:[41h*4+2]
1 f; J5 {3 W) ^: o* p3 k* v9 W2 g cmp ax, 0f386h% \% v/ K. z" A( C {
jz SoftICE_detected
7 h* @3 i+ f/ z; K$ K0 R5 \
, {) p+ R# P) v4 eint41handler2 PROC
5 a3 P- T. i8 B" F- f7 U iret
. V) {: n4 ^- j& W3 sint41handler2 ENDP
1 ~- ^$ D w' K, F: D; s- k9 T( @+ P/ y, h" N9 [1 f
2 J' R+ b4 q2 ?* [8 l' l
_________________________________________________________________________! k, e& x, L7 f1 g" f: `$ b$ q
, }% j' t9 J! X4 G2 a. l+ P! T+ a
J* p& _" x3 l- g. y! TMethod 06
9 R( b/ O& }) q3 s! u) L- j=========2 j- j. ^( w; ?4 S t0 c" t9 f: i
; i m! j; }" D% @+ q8 f2 M9 G
* t! ?1 P' c) }8 e( r9 N. G: Y
2nd method similar to the preceding one but more difficult to detect:1 q$ e/ v$ o/ S$ ]% e4 G
+ P9 f- B+ s+ r) V7 Q; Z; p
5 s, ^' s( T# k/ xint41handler PROC0 `# x# r" [2 g0 `; k, F9 g
mov cl,al
5 k/ J% v0 w) T M( p iret d* J1 x5 a- w1 g! R
int41handler ENDP
! u5 y# b2 {+ W& g3 J1 o9 A3 ]
. b: g2 U2 V. y8 r1 a
9 b) ^9 T4 F' z( l% ^. i) a$ X) W xor ax,ax* G' v& x$ ~' e' m
mov es,ax
4 t. j! ?" D# W; T1 C1 ^ mov bx, cs, ^6 b3 ^. R1 g% `7 [
lea dx, int41handler
6 ]% {4 U4 q/ W' X. t; P xchg dx, es:[41h*4]
+ z& \9 `2 J# x: K" } xchg bx, es:[41h*4+2]* ?3 U; G2 U) R1 y+ E
in al, 40h
4 R% D% z' P2 G xor cx,cx5 ^) Q$ h. P% w2 G( c$ ^+ C6 n: \
int 41h& p. i4 \' b! Y$ v; g$ _
xchg dx, es:[41h*4]" v; d) B) }: B; @
xchg bx, es:[41h*4+2]
2 W" H& b2 y+ ]4 m cmp cl,al4 c' e( p" V. D1 c2 e% s
jnz SoftICE_detected* K6 ^6 Y% E- ?4 T
4 v* O ?8 a+ Z
_________________________________________________________________________
1 k5 J" T) W" w1 I+ h. k7 [. Z, w7 l. s2 m
Method 07
$ y) @( r2 w+ C d6 ?9 p1 ^, o8 Q=========$ [3 y2 U4 p" @6 Q4 n0 m: r
: Q; K1 }0 [$ K% v
Method of detection of the WinICE handler in the int68h (V86)
7 b( x( h& K, o+ [0 V# X5 L! m7 O8 P2 s, S
mov ah,43h% A6 n5 ^6 p% J7 x6 t) F6 r2 x
int 68h
g9 u3 {- U' K x cmp ax,0F386h
+ g& K" S8 H8 O) ?7 U1 ^9 V jz SoftICE_Detected3 f2 M9 t4 D' h2 j8 p% Z9 v: r
# i" C6 F+ Z5 z0 ]% E" e6 U( y/ B: {! \) J. w r/ B
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: C, }- Z: U5 _. v6 i app like this:
: V# G: W. q: y, { J( u9 Q3 ~6 W& ^% N
BPX exec_int if ax==68# p$ S/ F% s4 ~( U6 ]/ T
(function called is located at byte ptr [ebp+1Dh] and client eip is* k3 L, f; c* |( W" i1 n! _1 G2 l
located at [ebp+48h] for 32Bit apps)
8 ?9 r$ Z- S( d__________________________________________________________________________
# m) c) X* Y8 E- H2 f7 N+ l# W/ Q8 O. o; W
, x$ \# t/ t8 @% ~
Method 08
$ ?- `2 q4 J! i2 M- f7 N6 f7 D=========, g2 q8 Z6 Z( B5 q: w& D
" b1 t7 I0 U7 ?/ ?It is not a method of detection of SoftICE but a possibility to crash the
3 _: ^1 H- |- ~. f4 Qsystem by intercepting int 01h and int 03h and redirecting them to another. m- i' f& f! @' `. s
routine.
7 ?' [9 Q/ g8 Z! JIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: w- J% _4 x9 p' {' g& Ito the new routine to execute (hangs computer...)
0 t/ \' O$ ~+ L' O. V! A) c& G0 `7 u3 } G4 |' ^& x
mov ah, 25h
% C# j2 S: B2 ]# [* U mov al, Int_Number (01h or 03h)
: f& \6 h4 A# Q, B( W mov dx, offset New_Int_Routine. a+ m0 K& _' A
int 21h
, M. Z" y5 ]# f+ e& U. w; U& S7 g6 |5 O& T
__________________________________________________________________________# p, {) N) `% N4 D! h0 [$ V( R- A7 \0 @
- F7 s( p$ s$ e9 m, e m& x' g4 TMethod 09
/ b$ s! t- [+ b3 J=========% Z& t$ G& Z% V# {' O
/ Y) M! d+ {2 Q3 s8 J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
: C* z0 u5 M( |* Dperformed in ring0 (VxD or a ring3 app using the VxdCall).
! c3 p+ s* ^, WThe Get_DDB service is used to determine whether or not a VxD is installed
* u0 A7 z4 b9 }6 t$ ]( t0 yfor the specified device and returns a Device Description Block (in ecx) for( @; v4 S3 e( z& z, j
that device if it is installed.2 W* F3 _/ _9 f
" { ~9 K5 B" _. I) w. e* b mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID# c; ?% g/ ?3 F& l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)0 f( W9 R0 Y7 Q7 K# G- H3 k! \( J
VMMCall Get_DDB
, V" m6 G% R3 [: G/ q0 Q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; d/ o' d9 `$ h4 Y x5 ]
; X4 c3 @) l6 }8 ~Note as well that you can easily detect this method with SoftICE:
) V3 k% Y8 I( M bpx Get_DDB if ax==0202 || ax==7a5fh7 M; t7 C2 o. `, r7 O; A
a3 O8 N' j1 f+ z) x# p__________________________________________________________________________
$ p& @% v r5 o$ I7 s' z2 ^4 A5 o: L0 i
Method 103 }% @: V' i- e- u" q
=========
$ D$ B/ _& p* y# K+ p6 m
! I+ z$ E$ o) G1 E( g& T=>Disable or clear breakpoints before using this feature. DO NOT trace with
$ m( E. c: T3 _& z# J+ ? SoftICE while the option is enable!!; L" [* f: }' j
% R8 _: l! e' Y# ]( r: gThis trick is very efficient:
) _& h' G. i/ M$ y5 v$ a5 dby checking the Debug Registers, you can detect if SoftICE is loaded
0 b2 D: y* H6 c0 o7 c7 u7 ?(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 c! F' I5 n( G @9 w6 z
there are some memory breakpoints set (dr0 to dr3) simply by reading their
& C7 z% N( V) _, }# v3 d hvalue (in ring0 only). Values can be manipulated and or changed as well
* d( l0 k3 B2 x5 [5 E3 H7 d(clearing BPMs for instance)( A, d$ M/ ]- Q2 v# q) b5 f0 B
J" ]6 P) i. @6 q4 I6 S6 O2 S__________________________________________________________________________
* D7 {* `, W4 j; {5 v; ?. ^3 W7 C8 t# O f: X& D) @+ Y
Method 117 Z1 b. n5 s& Z7 B! M: \7 X
=========
9 l5 t9 r z# d/ G6 J
1 }% t7 Q/ O8 K0 kThis method is most known as 'MeltICE' because it has been freely distributed; |/ f+ N& T5 G0 z
via www.winfiles.com. However it was first used by NuMega people to allow
/ n3 _4 w$ F0 wSymbol Loader to check if SoftICE was active or not (the code is located
% a* m) N% V3 F: t2 }9 U: K' |8 uinside nmtrans.dll).: I1 M! }% w w1 [" v+ E9 s
8 p, v$ |( J9 Z. d2 SThe way it works is very simple:" T! c( w; @5 P& P9 t! F% F1 g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. z) [- o% T2 \) D1 L9 J0 WWinNT) with the CreateFileA API.' k: P; e) t$ ^; M" ]" v
: b; v$ e) H5 D3 e" T( `Here is a sample (checking for 'SICE'):4 c$ M: Y& D$ [8 E
& d' P& |4 D, \: F! h7 z2 ~BOOL IsSoftIce95Loaded()
2 x3 i* @9 r; w. j2 b{) |) q$ `. N: {7 c8 p. p0 B, `' B
HANDLE hFile; ; k+ a4 X2 @2 k, R# P. @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE," V# i" s" a: y5 j) C/ r
FILE_SHARE_READ | FILE_SHARE_WRITE,
$ B2 A% n. Q6 L5 [" s& l' q7 F NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);% w3 @) o# ^4 C! L8 `
if( hFile != INVALID_HANDLE_VALUE )
' @5 a7 F. {, m: a {
0 {' f7 j) [# q2 g CloseHandle(hFile);
0 d2 j1 R, x& E# H( i4 k" W( ? return TRUE;2 ?( g2 e/ W7 n
}4 P& a( {1 B1 `
return FALSE;
$ n0 k t0 S) L. _$ s, r: n}, L* \6 {' F- v- _8 C, X
* ] J. p0 `) h- k. d2 @0 _2 {
Although this trick calls the CreateFileA function, don't even expect to be8 k1 T& ]. K) c9 L
able to intercept it by installing a IFS hook: it will not work, no way!
9 c0 B. K3 D L# l+ AIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
& Q h+ O2 \3 D1 X0 H. \; yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% J% j8 l7 p$ u3 X1 V( E+ S( z/ O! Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ K8 f, c6 W% J5 b# j Tfield.8 j- S2 [/ f. g3 u+ { n8 Z
In fact, its purpose is not to load/unload VxDs but only to send a
" ~5 B) i- i% IW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; V) [: M/ I5 N# c& uto the VxD Control_Dispatch proc (how the hell a shareware soft could try5 N1 _, K* F( O8 }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 t& ?) e' I0 w$ j+ ]% e5 TIf the VxD is loaded, it will always clear eax and the Carry flag to allow
* c' V+ \, Y! \( Wits handle to be opened and then, will be detected.% N" d( X' |1 H# Q1 X" f9 R' ?
You can check that simply by hooking Winice.exe control proc entry point7 j- E7 r# l4 w4 U2 O) Q- M- `/ Q
while running MeltICE./ Y2 K1 U' A8 b
$ A2 ]' g& p5 q, q1 S, `3 B! B8 k8 A% z' n
00401067: push 00402025 ; \\.\SICE
( A# t7 \/ X# G& ^; R/ A' P 0040106C: call CreateFileA7 I; R; p7 i6 T5 E
00401071: cmp eax,-001
4 A: y8 d; V e s+ m6 s# s3 s 00401074: je 004010919 \" ]' d7 H" v& O% f& F1 I( [
6 ?4 Q7 x- `8 _& u. ?
( n" {6 X, X0 l" ?0 ?. n. Y7 e+ b
There could be hundreds of BPX you could use to detect this trick.
1 i2 f1 K9 y' K/ T% {. L' Q& @-The most classical one is:7 Y: s1 y# i3 v! s1 o
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 M$ X% V% z/ O9 Y! H2 O+ v+ t
*(esp->4+4)=='NTIC'. f, D" n: P6 @0 B
: G' B8 M! |& b3 d( y-The most exotic ones (could be very slooooow :-(+ `& z3 E7 f2 n% X' J1 w) _, T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') . ?1 f& t/ I5 l9 X0 K, A3 w% A
;will break 3 times :-(
3 o! @! a: k r# ]' p2 w- n8 a' ?$ G- _6 P0 U [
-or (a bit) faster: ' X2 u% A6 O" f T* e, {* e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 H: X; \. C# u5 L7 a
- h/ Q0 y: L+ C ~& }6 f BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 @* r5 I* X% K7 w4 |) L/ j2 X ;will break 3 times :-(
) C+ X# x7 x4 o( Y$ _& r- L
) \! G, m- L/ U" C) X6 w-Much faster:
* f+ n: f+ h2 H: \ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 N; `4 } ~7 A
* M, ?8 d' D4 S" f4 q, U. S$ dNote also that some programs (like AZPR3.00) use de old 16-bit _lopen. L1 \- J6 m G {4 p
function to do the same job:$ c2 M! i- D/ u& ^0 ^4 k
9 z3 k: H5 m9 v6 O9 E
push 00 ; OF_READ1 y$ [1 h& D; X" N6 O/ R/ v5 ?. l
mov eax,[00656634] ; '\\.\SICE',0
" m" D( w" p: r push eax2 ~; ?9 H5 ~4 X* f. U# b
call KERNEL32!_lopen: U3 V9 i+ A/ N+ Z D1 G
inc eax( u. I9 m" c) g6 l, O5 K
jnz 00650589 ; detected
6 d1 S3 j% J3 Q: J% N push 00 ; OF_READ
1 {, f9 S g: N" J5 K1 I mov eax,[00656638] ; '\\.\SICE'8 X- n, d5 P1 _; B
push eax! a3 v0 ~ C# }" c" R, U( k
call KERNEL32!_lopen
* t6 ^+ T* a% n V4 h0 a6 K inc eax
9 b+ b7 w& y- }! q3 p jz 006505ae ; not detected
8 b( d$ b8 Q6 v& _9 Q4 X$ V+ D8 t9 w. M
# B+ d% G/ y. s `, ~6 E
__________________________________________________________________________8 H) `% ?/ i5 j) D$ X ]
5 i2 _* U* a. [- jMethod 12
$ x6 w! \, a! b" J0 E1 w/ C* H. Q=========. I; S# ?- K5 c
3 y7 t t; h, z7 e( KThis trick is similar to int41h/4fh Debugger installation check (code 05
$ j l9 [4 Y2 M7 l5 f& 06) but very limited because it's only available for Win95/98 (not NT)
" z" x: v' k, Y" has it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ t" i- e# M R5 [( N& k' b2 m4 j: d L
push 0000004fh ; function 4fh
0 p9 f' P. \1 M9 l( K push 002a002ah ; high word specifies which VxD (VWIN32)+ l+ J8 o3 c0 X, M. a+ A
; low word specifies which service
$ c+ A3 S4 `7 X% J (VWIN32_Int41Dispatch)
, n' l" [9 B' N1 K$ K call Kernel32!ORD_001 ; VxdCall
9 |, W) \) Z& r! b0 j cmp ax, 0f386h ; magic number returned by system debuggers, q2 o$ Q( b5 s1 Z% v" K
jz SoftICE_detected' ]2 e% c( d; I3 Z" X' e
3 j! c4 ]0 ^, `( q! h+ {% Y
Here again, several ways to detect it:
3 j0 ~8 o3 \$ ], P" i% q5 u5 l" `, l: b/ d3 i
BPINT 41 if ax==4f
: p5 i/ w' F/ }- y7 s3 l# B4 b! i" F0 n- z( p
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
, U9 ?0 m/ S! z1 n. T
# F5 Z, s+ X& X2 ^! A BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ n% j3 ~. D5 s6 z/ z9 E
, B# g- Z, t( }0 A. y' E
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! z& c3 x3 W7 D4 ?+ {2 ]( A/ v
% z4 d O$ [; K5 n) b! H
__________________________________________________________________________5 Q0 p, F$ ?/ w$ _# I
* ]* g) P8 C7 a: K% z
Method 13* {) Q4 D; f: O' o
=========
0 W, V! A( t! m2 d% \6 r
$ c! Q3 a {; D1 Y- R; A; M& M, mNot a real method of detection, but a good way to know if SoftICE is
8 L6 p4 E! u" V* z. [; f! p3 Yinstalled on a computer and to locate its installation directory.
, T4 z: W: }5 G$ }It is used by few softs which access the following registry keys (usually #2) :
: f2 f2 q3 _" v1 h) \! D8 L6 F) V9 i' {+ M6 X6 e7 y4 H a7 B. T
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% L" g. r6 F7 t2 ?$ B) w0 ^
\Uninstall\SoftICE3 r$ [* l+ j, ]2 ?0 R s( D
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 F: o! L0 y) H" B# t
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. L) C1 m0 e) B' m! `! o; A2 \\App Paths\Loader32.Exe) Y% s( Z( ` I4 u
' I. r1 d0 X# ?3 Z2 m% e6 r3 N/ `9 ?; g3 E" f* S4 Y
Note that some nasty apps could then erase all files from SoftICE directory( [. F' f- k' p& T6 L
(I faced that once :-(6 G9 P" i' v4 U4 i
0 ^1 ^+ j+ R6 [: `& U- T9 F
Useful breakpoint to detect it:
0 x( Q# a; `5 `0 x# _
. t5 J3 Y9 E/ S4 @ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
) z; M0 x" F2 k7 k" r, x! j2 K5 }9 A9 W
__________________________________________________________________________! @2 d" B* O; N4 s. b
2 h: u9 }* _8 y2 p, H- l
' q5 b, O. _$ t9 O5 LMethod 14
0 Z! w3 V7 ^) u4 ~3 x=========% r* \. [8 q* d, b
/ m4 I. A4 Z- f+ u {A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 M7 ?" X% ]) Q9 {5 h: R
is to determines whether a debugger is running on your system (ring0 only).
7 L( s0 c( M _' f2 s
8 U* `) p: a: F+ `! m VMMCall Test_Debug_Installed
: T% {! @8 w7 @) A) }% k2 d' f je not_installed
' b9 N; s2 I+ t: i) v2 {' K. v; e" l6 a1 Q! L( [/ t
This service just checks a flag.
: Z/ b& u0 [1 d: ~" j/ G; c</PRE></TD></TR></TBODY></TABLE> |