<TABLE width=500>
9 Q' Q9 B3 q5 C& o8 z<TBODY>
4 E! t1 {6 R; e<TR>+ r' A0 m5 V0 u2 \: Q& @
<TD><PRE>Method 01
( i; c% o j& f% _# R2 P t% v=========
8 `2 O/ g. B# G! L; R: e
1 e3 Z5 Z) Q3 a+ M4 K8 _! `This method of detection of SoftICE (as well as the following one) is( \* S# i! F0 j5 x& G, y
used by the majority of packers/encryptors found on Internet.
3 W- s0 G* }+ z/ bIt seeks the signature of BoundsChecker in SoftICE( M% u) X2 n/ [+ z' i4 h. B2 r) n
( e5 e7 b4 Q( i9 B% E; [ mov ebp, 04243484Bh ; 'BCHK'& p; C- f7 ]6 l& b0 C) q4 d
mov ax, 04h- J/ x! ?& A& W$ y5 [( y% r0 z
int 3
" T4 {! z. d& S5 b! X cmp al,47 ^3 w4 v% n* }
jnz SoftICE_Detected
! ^* e* W! q# r0 W$ F0 A1 Y2 T: `) R$ z4 J! ^; W5 E
___________________________________________________________________________$ Q' K& h7 z# Q+ G o! X
7 }+ C3 C" q Q
Method 02
7 |) Y3 f. Z0 a9 I$ f& I' {=========7 o0 Y) w: n& n- |
7 s7 Q# v& F: W# h+ o7 ]; [
Still a method very much used (perhaps the most frequent one). It is used: |+ z! q! G! `! @5 ]: t
to get SoftICE 'Back Door commands' which gives infos on Breakpoints," Z) O, J6 f# B6 }7 }3 b
or execute SoftICE commands...2 k) N! S$ f% q
It is also used to crash SoftICE and to force it to execute any commands* b& C; O" f+ i9 \" ~2 c0 S
(HBOOT...) :-((
/ w# j, M6 W5 p: H5 f. a
) P- r) g4 t; s4 q$ CHere is a quick description:1 H- p# o9 e& M/ U7 E
-AX = 0910h (Display string in SIce windows), \# m: N, z% K6 l1 K
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 ?6 D% n' {7 ^3 l-AX = 0912h (Get breakpoint infos)% E! Q0 B0 R+ C% k9 A. Q
-AX = 0913h (Set Sice breakpoints)- e6 l& q6 H H9 G( x% E
-AX = 0914h (Remove SIce breakoints)2 ?/ }5 Y' y9 K* s! ?# U2 X
. j; @0 R, K$ ~
Each time you'll meet this trick, you'll see:
3 e' e! s v g( w! w% [5 N; V! F-SI = 4647h( Y1 f9 f% T9 \1 P1 T+ M# m
-DI = 4A4Dh
1 S7 P( L& c# FWhich are the 'magic values' used by SoftIce.
" |$ ^" A# b% j" l- m; zFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- \9 Y$ N8 F2 v( Z* R! A% S( p: b. v/ ~* p- o8 z/ z) z# }
Here is one example from the file "Haspinst.exe" which is the dongle HASP- P* Z& R, H( k
Envelope utility use to protect DOS applications:. j6 }; s2 N: \$ H: x ^
- c) Q, b! ? P+ _. S% R% p) m* T% I6 E
4C19:0095 MOV AX,0911 ; execute command.: X# k8 m- Y& g$ L
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
6 g* e) K7 }( w4C19:009A MOV SI,4647 ; 1st magic value.# e4 J. z% o+ Q
4C19:009D MOV DI,4A4D ; 2nd magic value.
. }5 v8 ]9 a3 w& ?4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)) Y$ L: W5 D( ~* _# s
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 E K! {/ U1 K7 g* H; H1 S0 D) `
4C19:00A4 INC CX
' C( p4 o( D) ~2 ?+ y' _3 [1 s% _: |4C19:00A5 CMP CX,06 ; Repeat 6 times to execute, [& @- p$ y0 D
4C19:00A8 JB 0095 ; 6 different commands.9 J ?9 p* u. _" j
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 \# T- H- g% B8 o/ _1 }4C19:00AD MOV BX,SP ; Good_Guy go ahead :)" s7 L3 P7 g1 f4 j( w) ~6 y
- {7 Z0 O, k" j% p
The program will execute 6 different SIce commands located at ds:dx, which
1 |7 N, i$ m) y- m+ {& f- ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ n# y/ ~0 R: W( }% _: f
, r) V' N+ _& y: X g7 `& l' W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
X& i7 j$ x$ a- a___________________________________________________________________________' l6 Q2 @0 _/ T, w1 o3 w D
! R. ]; J+ c1 d! x& b* S+ @' e9 R4 b
# H; l7 A6 Y8 x* a6 K. v
Method 03
) ?7 C2 w1 M% b! U- R- O+ B=========
9 D7 H7 p- c9 N5 q# E! e7 J* T( g
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 a9 [; V: [! g5 d2 h
(API Get entry point)
' Q# y( x; T% I7 Z 0 y: b$ {, J1 p' N/ Z& w
+ C3 m8 f# n. a0 V xor di,di. `# I* X! ]- H7 D) H5 M, Z
mov es,di+ \- h7 T" R' M5 C2 w9 f4 |
mov ax, 1684h % _8 s. L, F1 X9 p6 n: X/ A
mov bx, 0202h ; VxD ID of winice1 j/ u+ m+ ]+ Q% ~* Y) j1 {1 x* ?
int 2Fh, y; E" o+ L2 r$ a
mov ax, es ; ES:DI -> VxD API entry point
' u4 z Q/ d! o0 Q add ax, di: a/ g2 e; s5 j q! E6 N
test ax,ax
5 j) ` L6 `* s% L jnz SoftICE_Detected
/ x5 l9 @ `1 v3 J. W4 X- j
5 b; L+ R. e- D2 U. A___________________________________________________________________________
9 t0 B1 x( e2 ^: W7 A. Y; |: |$ r2 X N0 \- c4 j/ P
Method 048 R* c8 d; T2 h: s6 s" r
=========
3 ^5 ~1 x6 B! H; S% b/ e: w, d8 a: I" W% d; M3 \
Method identical to the preceding one except that it seeks the ID of SoftICE3 l1 J6 e3 ]5 X, X {; p1 z
GFX VxD.4 O% P+ j9 ?* }0 q& o4 ^
0 b# g+ H& J0 @( _
xor di,di
8 l, V. _3 g! ?" q4 w mov es,di
: J' A8 T5 [9 j0 _( a1 W# r mov ax, 1684h * S/ \% u' t0 \3 f
mov bx, 7a5Fh ; VxD ID of SIWVID
' E& z2 E; a5 {/ H/ _$ g int 2fh
( X k! r" P2 E mov ax, es ; ES:DI -> VxD API entry point- k2 }- R: T' ?8 q+ F
add ax, di: m4 A6 W0 p9 ]7 |. ]( A
test ax,ax
% @+ F# t& l$ F! O" z! M jnz SoftICE_Detected. q; H; X, u2 D" C/ L; U* n
3 T$ I4 _ `1 I9 q
__________________________________________________________________________
4 y$ A1 {5 G( U% o* Y4 ^- L
& b0 S$ [3 D3 t9 Q
% C* x# F$ P5 J( P$ E3 h$ zMethod 05
4 K' |! {( k" U, J2 v! b0 h1 f1 ]=========3 t" W. f3 V! L5 S
9 ~: Q& a+ W" n: @2 b- n1 ~Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ ]5 N2 H. @# m. l7 Sdebugger. It calls the int 41h, function 4Fh.: j0 F8 w7 r* u1 ~
There are several alternatives. - p3 L/ N: F$ E9 h# J K* w
: A, H0 W9 S" a% ^4 @
The following one is the simplest:2 @' x) z9 C7 p5 F+ K
; _3 }9 e9 m8 p
mov ax,4fh
) C! { d5 U) K( S/ c* n3 b! `& U% n int 41h
' |( v! G/ i/ [( j: I5 A3 r cmp ax, 0F386% Q* H0 A/ B! N1 A) A7 F6 ^/ V
jz SoftICE_detected
0 z! ^. ^! [& l: z: t
9 p' E! C4 R2 h- ~) K0 Y3 L. U5 h' E4 z7 y# H2 C# Z$ k
Next method as well as the following one are 2 examples from Stone's
2 y; Q8 X' E6 _2 t6 y5 U"stn-wid.zip" (www.cracking.net):
' Y! }) Q) {( C1 B6 Q* ]. M: [# W9 f$ n. ]1 e$ p% }
mov bx, cs- [& v, F1 p; r) m% k+ c
lea dx, int41handler20 H& @0 f# m/ l
xchg dx, es:[41h*4]
: ?% `0 w+ {6 Q6 z" b xchg bx, es:[41h*4+2]
+ u4 [1 A/ A1 Y) ~9 @3 W7 f mov ax,4fh0 F1 {& y; V* w6 u
int 41h
3 c9 ^0 v2 k& w7 ^# x- t xchg dx, es:[41h*4]
2 g/ U) @! d1 ~$ F5 } xchg bx, es:[41h*4+2]
. k6 E( T0 F: P$ @: L n* @ cmp ax, 0f386h" |" s0 e4 q- ~
jz SoftICE_detected4 ], V8 C6 m8 B9 Y
5 U6 G4 g7 ^! }' F; F2 f% O
int41handler2 PROC6 r3 [! ^' W% g
iret
! d) z8 ^* p: sint41handler2 ENDP
* i4 o" x, J( n. Z: M, R$ q; k$ A+ r' a! O. t
9 X( k: u) u& o( t4 U
_________________________________________________________________________- O1 {4 _( d) X( [
* u& } s( t. h) W. S- `1 R/ {
2 L$ G3 W _; y
Method 063 z" X7 d/ z& ?! q2 |
=========- F, z3 b6 y8 @# l6 f" `
& n2 @, c+ P- ^7 j5 O
6 b+ n4 Q1 ^* s! U4 \# K; } k* S6 x0 l
2nd method similar to the preceding one but more difficult to detect:
1 S7 X; J! b; [) N% ?8 D& _
# ?2 A1 c, u2 [& V5 x. B
) }7 N5 e, P& Q" W! h! C8 Xint41handler PROC
. y5 G* d* _' j/ L) J mov cl,al5 e1 G1 e2 }5 J" t5 V4 W6 S9 l- B! Q1 i* _
iret- l: k7 Z) L& y" m6 J+ \
int41handler ENDP
0 K( q5 ^/ {0 Z ^1 I0 L; b( p8 T5 T& t9 c, t
# X% }5 u+ g$ q0 N! u. y
xor ax,ax7 D1 ^7 M0 p& r) Z- I- i+ S4 m
mov es,ax
6 L/ V' W# i* V& E1 N& A mov bx, cs
2 L3 p4 L# m0 e' O lea dx, int41handler
, M8 f S9 ~4 I5 b |6 e xchg dx, es:[41h*4]2 [2 R- Q& y% \
xchg bx, es:[41h*4+2]
! L6 k1 L- K: t; g. S in al, 40h' X3 [7 t( A4 V1 C4 H3 ?
xor cx,cx) V" _1 j5 I# h: `: g; |- h
int 41h: b! a* f: f' A: f( @; e9 \; ?; H" R
xchg dx, es:[41h*4]
9 O; m2 l" }% \4 R- A4 Z& t) y/ G xchg bx, es:[41h*4+2]; V$ u' Y! B9 {7 a5 L- o0 U
cmp cl,al
1 h% `( N0 M. V2 b6 N4 |* Z jnz SoftICE_detected
0 \" \( h- a c3 P8 \) y! @5 C& P4 w+ K5 X" H" u! v3 y
_________________________________________________________________________
4 j3 r+ C7 T# ~* K. Z: M& D7 [7 a" U, N0 z
Method 07
$ R4 S1 G8 F: Z1 z; C/ E=========
" i D3 {' k& O5 b1 y5 x
2 K, v( Q5 u2 ` K5 O) U$ m4 J, }Method of detection of the WinICE handler in the int68h (V86)" w2 n& B, N1 a6 E" k( X3 b
" X, y s# w! g4 l' _( p$ h
mov ah,43h5 V* E5 o A" k) D* Y' h) e5 V( M
int 68h
+ U, H9 A- [ I) S cmp ax,0F386h
" B) B$ ] s# M2 q2 |5 \; O jz SoftICE_Detected
, i- @4 g2 B2 n! e% M* D# y9 Q& Q
9 w* A' ~+ @) l, ~6 U
7 Z B L/ y5 U2 H=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit. t0 w- I! p! z7 t
app like this:
) N' a& \) r9 [) Q0 g: D; U1 x/ B% C$ k& X+ g! K |* n
BPX exec_int if ax==689 h3 r5 T, g& p q
(function called is located at byte ptr [ebp+1Dh] and client eip is# F3 G5 q9 S% ?6 u
located at [ebp+48h] for 32Bit apps)% [, y$ ?# R2 Y% y, B
__________________________________________________________________________( H+ U1 u A* [7 t( S& X9 ~* X4 t
4 x* T; p0 l4 n* S
S, U F0 Q' ]) N# z4 x XMethod 08
2 E+ n& i( h/ ?7 Z=========2 I c: I9 S* b- R/ X% I4 E' M
; J6 }/ c! Q( C6 Z5 }2 [8 Q0 g
It is not a method of detection of SoftICE but a possibility to crash the
% D1 I+ R% o, J. f3 C7 esystem by intercepting int 01h and int 03h and redirecting them to another
) B$ W2 @' Z" vroutine.
) N+ y: w8 |* \7 E6 L/ J( HIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ P9 x" F6 R/ J5 ito the new routine to execute (hangs computer...)" P& q7 |, `1 t4 l! L
" m j% A8 e; y. b mov ah, 25h
) p. l' w8 R/ y! R6 v$ s mov al, Int_Number (01h or 03h)" L$ H) e( x1 T& k
mov dx, offset New_Int_Routine
2 R1 T( X2 \* G) S) x" q int 21h7 V: _7 L2 C$ u, ~4 f5 q
z+ Q$ P( K, @0 X
__________________________________________________________________________
: O$ O+ c' W+ T& \2 |1 Q. b* Z L) r! a" E* U8 S% ~ [" R! u4 j9 z3 w
Method 09
+ k* \. ]( Q$ [/ \" k6 w$ D=========
6 ]; J) ?1 M0 o2 r" E2 H3 ]
0 s: @& Q3 ?8 _7 x5 kThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' ]% s. g2 u K5 Xperformed in ring0 (VxD or a ring3 app using the VxdCall).7 W- y$ C: z K- P; j! o5 j
The Get_DDB service is used to determine whether or not a VxD is installed0 }! Y6 r4 H% T
for the specified device and returns a Device Description Block (in ecx) for
" a/ o# v# i% A* S( G8 N" Dthat device if it is installed.
4 Z0 S# M; m# l! W- b0 ~7 z) \2 R) c( z, ^/ a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID; T' L3 s3 I9 f: A: e
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- u# B6 @& ]* M) l- D VMMCall Get_DDB
, Y* ?+ ~9 T3 Z. Q5 I+ R mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* M* m5 T8 w1 g& a
! ~- }2 I9 X* M5 v, ~7 D" g) YNote as well that you can easily detect this method with SoftICE:
( C7 O3 x* e# n bpx Get_DDB if ax==0202 || ax==7a5fh! o9 n4 F8 R0 C0 ?5 b
% {+ P( W; F, ]. }9 s2 u! x__________________________________________________________________________
) M4 Y8 {. }) B2 Q& u; u
1 k7 d" [& H! }3 z. gMethod 10
: }1 v) \- i: T1 E4 d9 h8 [; [=========( U$ I) Q: q- [
4 z! {- G& ?$ S. d5 l0 r, M/ R( P3 W=>Disable or clear breakpoints before using this feature. DO NOT trace with; N, R8 _5 t0 b& Z' K
SoftICE while the option is enable!!
5 m1 F) F4 l' {6 u! w X( P% ~* P- @# e Q
This trick is very efficient:! G! t/ U* {1 K
by checking the Debug Registers, you can detect if SoftICE is loaded9 j" b* H. P2 H( ]0 }( X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' ?) ^# r, Q3 L1 dthere are some memory breakpoints set (dr0 to dr3) simply by reading their
7 S6 g8 o. P- \8 Kvalue (in ring0 only). Values can be manipulated and or changed as well
2 Z0 U1 u4 D0 o6 X1 z! J(clearing BPMs for instance)
4 K0 v& Z- A3 G& H ]
& F8 ] ~7 |5 t6 f' a! o3 d__________________________________________________________________________
6 x+ d1 K" E0 v
$ V% a- }0 x; t7 g4 p: `Method 11
8 J( s7 f; z4 @' L; G" ^4 k1 m=========
! J. J7 L4 I) m3 r$ M# Z! N4 U
) Y, O* W" _, H: X8 ^This method is most known as 'MeltICE' because it has been freely distributed
6 x9 O4 q7 t7 e4 Z; ^' hvia www.winfiles.com. However it was first used by NuMega people to allow2 ^9 s8 l. j! ?9 R0 n" p) _) _- l
Symbol Loader to check if SoftICE was active or not (the code is located
. \& m+ r) n3 g# E! \1 Zinside nmtrans.dll).
7 P- z- Y) h4 i l% N# M! x. | A' s6 w1 d9 a# t2 \! r1 @& y$ \
The way it works is very simple:
$ f3 |$ O6 K0 X+ b& UIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. F6 ?6 [6 {5 p( W' lWinNT) with the CreateFileA API.: d( Z. o! x9 r# l
9 M( |8 X+ ]% `+ R
Here is a sample (checking for 'SICE'):
8 G) @) f- S+ v5 r( w/ ?3 B/ q* F N) v. [1 M- O2 K0 ]/ B
BOOL IsSoftIce95Loaded()2 P3 g( }: G* V. O1 P4 F
{
2 f9 e1 j! R- {8 L/ N HANDLE hFile;
7 H; Y: y2 a/ X+ L) ? H: L hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. h8 m1 a% C6 G" d- u) k- q FILE_SHARE_READ | FILE_SHARE_WRITE,
0 J8 q/ r9 C* n1 f6 x" C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: X# X$ H1 d1 C0 @8 ~# G
if( hFile != INVALID_HANDLE_VALUE )
& [: u4 C* P1 Y: c# _ {
' w" c, H, O; S$ A+ z, s& C CloseHandle(hFile);7 b6 q7 \9 t8 b' `* z5 y
return TRUE;
$ B- S- J$ d# N# A6 D" Z; L }
7 F8 l0 x" V; M/ ~9 { return FALSE;
. F/ k! d" M/ t5 m}
2 d$ n: L! a$ K, H! z% }# o! b
3 H0 \# A. s% y6 R. JAlthough this trick calls the CreateFileA function, don't even expect to be& p: V3 w$ g# c0 R, {; U5 U7 e. J
able to intercept it by installing a IFS hook: it will not work, no way!
8 o7 z% b5 |/ G" p2 TIn fact, after the call to CreateFileA it will get through VWIN32 0x001F# Z$ p4 |% O% R; v( R' h
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 N. ]) S0 R7 N1 J& O
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
; Z+ n e; }% x+ g+ }& j# Yfield.$ T- y( i: J2 J* I, ?; Z/ | i
In fact, its purpose is not to load/unload VxDs but only to send a
/ P2 D9 |3 u7 u2 A9 W3 oW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 W3 l) X1 k; E; \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& s* @ v' L( q: tto load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 ]$ [( ^0 N* @6 w, rIf the VxD is loaded, it will always clear eax and the Carry flag to allow% N- @7 K0 M7 ~8 S' F6 M
its handle to be opened and then, will be detected.
0 W/ q: |: F. m" d( g- D8 g) v/ bYou can check that simply by hooking Winice.exe control proc entry point5 ^' ~, j _ f: `3 f# B, ?0 ~
while running MeltICE." N5 u. M0 s8 ~2 q& c& D2 \
# |% w0 ?) ?$ c6 R$ U1 l- y
' y/ p, [( W) \$ B/ [% i* S 00401067: push 00402025 ; \\.\SICE9 m( H6 x9 O- @0 y U
0040106C: call CreateFileA
# \$ E7 X3 ^- H) c ~' p6 u/ } 00401071: cmp eax,-001
0 F% o {4 {9 D% g 00401074: je 004010919 \! V0 w" @+ [0 h; d
H6 _* q, N/ ^" y
9 ]# W/ M/ R" g' N- J5 ]" wThere could be hundreds of BPX you could use to detect this trick." k! F! l ] `+ i
-The most classical one is:
# H0 r3 n1 {- B& ~ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- L/ q% j! y/ ] Q/ r; q *(esp->4+4)=='NTIC'4 L5 e0 p+ j# F9 K4 M$ n1 F
; K3 p& m* `5 r# ]* \9 o1 _
-The most exotic ones (could be very slooooow :-(
' V" c8 H+ D* e2 H BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 X( M% C. } {/ L" M0 s0 }. S D( W3 D
;will break 3 times :-(
( Q* M$ e/ k" z# X0 x
! b9 [( s1 e# @- x6 x-or (a bit) faster:
% H0 Z+ K" {4 B0 x. l: L0 B BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 a! u$ c. G: `0 d/ w$ l2 a
3 v& ]- x+ K4 Q9 W# B, v5 Y BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 E8 R/ ^9 r4 c& ]3 y ;will break 3 times :-(
3 Q( e Z! Q2 |) p4 ]3 E
2 E, @+ Y! @. O, _* f; m2 O5 Z-Much faster:
7 W- n% _: Q s! @3 d BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( c& n, S, I# d" P' d' m
+ r* X% @6 `# w9 r1 w0 Q. c+ mNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 r+ y; O! j( T6 lfunction to do the same job:
1 M! n& N2 ^. y% G3 w& u) D/ c7 s; ^$ S, a m0 ~, g# u9 F
push 00 ; OF_READ) r, R* M+ }) n1 v/ E
mov eax,[00656634] ; '\\.\SICE',0
S1 U; h# I0 E push eax
# d0 n. _7 t+ j. g" V call KERNEL32!_lopen- w1 V) N8 g- r) a. N
inc eax' }* F `, T" D& Y
jnz 00650589 ; detected1 }1 v! M4 H* I& Z. x" u" n
push 00 ; OF_READ
" y4 \3 m" ?) y! A! L4 O mov eax,[00656638] ; '\\.\SICE'- }0 t2 d( R! Y2 b1 U# G; n
push eax
) s% C: ~ B/ {& ]' J/ g$ r. @8 i call KERNEL32!_lopen
) T' D# u0 C$ m. }/ b% ]( O# K inc eax, |0 ?+ n4 @* n
jz 006505ae ; not detected! a6 `% e9 t+ ~8 X5 m
# Y, ^# o, Y+ q& R
3 W$ x0 e2 J( o4 k$ ^__________________________________________________________________________) C0 H7 q$ L6 c! G" G" [( ?& ^" H
& D0 w+ l1 s, k
Method 12
% S; D$ y1 A9 ]/ w0 B=========# i2 M3 [3 |4 Y1 E, D! y5 R# ?
# ^+ H: t4 r$ {1 u% ~: ?6 b
This trick is similar to int41h/4fh Debugger installation check (code 05 R6 ]* D2 k; G# h
& 06) but very limited because it's only available for Win95/98 (not NT)8 R/ o/ u: k3 k1 j z9 b9 b
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
2 P ]7 W5 j: x2 l; g: ^
) P" K/ r0 [. ]3 }7 \; O push 0000004fh ; function 4fh# E( W9 `( a. u' ~) B# q( b
push 002a002ah ; high word specifies which VxD (VWIN32)
0 `" r7 I5 a6 [ d$ o ; low word specifies which service
, _. c" \9 {$ P' u" g: e (VWIN32_Int41Dispatch)
* b' a& r: r h$ h call Kernel32!ORD_001 ; VxdCall, j/ y7 h" a. n, T+ `( z
cmp ax, 0f386h ; magic number returned by system debuggers
% h; Y U+ M7 |2 i' V jz SoftICE_detected6 p. d) G$ T! |' n$ A
' `# z+ b. U' n: ^: |( \
Here again, several ways to detect it:0 H$ f; \1 M2 Q$ c# `! S
. y7 H$ l8 h% _, R BPINT 41 if ax==4f
2 a2 w- S: B8 ], Y+ g6 U" N5 L7 w: ^
7 H) [5 M' y7 e& _ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
8 ^% n5 `; x% o
+ t% h7 c! Z- [6 H BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A5 V( O) A: U1 t$ ]+ x$ {
& @$ B/ b( i6 y2 @8 B: x BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
7 O! `/ H8 e* @ w7 g
! \* g1 K! N* W, Z( l8 `% Y0 @+ m& T: E__________________________________________________________________________! ]+ p! Z6 n( j- t* K- b6 x
* e4 D$ q) C" l4 w/ ?8 e& }
Method 13
5 w$ ?) s2 w0 V- {* C9 B5 V6 r2 @=========. X1 g3 j! Q: w7 f+ f* h! D7 b
' P' a" W3 c3 s
Not a real method of detection, but a good way to know if SoftICE is
" `8 j$ s5 T- D: Yinstalled on a computer and to locate its installation directory.1 M# b. ]5 z; l* B8 A* h$ ~
It is used by few softs which access the following registry keys (usually #2) :, l6 P- @, T' q% y
! _- H) Q6 i: Q+ J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 q5 Q, N7 c7 L4 L
\Uninstall\SoftICE
- \. S4 \" q/ O" X+ `) R# ^-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! W: x% t8 n) A: b6 [4 u. i-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 x9 g9 F; B4 {6 Q\App Paths\Loader32.Exe0 R9 e: M X" T
( b3 Z n( l! z6 z: ]% o: l9 w4 L% M" x" E" W
Note that some nasty apps could then erase all files from SoftICE directory$ S$ v6 m3 Q- |% O. P; e {
(I faced that once :-(( U+ m# f0 p8 Y P1 M5 F
% T) N& ]# R) d1 P
Useful breakpoint to detect it:
% V4 d! C1 m8 s/ [ f/ A% M8 Q$ ~6 }5 {' v2 I9 D
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
2 C) X5 N/ v9 [6 S) M/ ] w( ?" E4 m* J( ^; {6 l3 j8 J0 u
__________________________________________________________________________9 |- m" Z# S. L! [
/ A5 |, y/ y2 U$ D. }. r: T
4 J! |& g9 h, F. Z3 w% nMethod 14 7 p5 s$ o) P5 s1 P* [
=========) E3 N D' D. f/ B. t; c$ N, Y
# h) i; q6 z4 x1 s7 S. G2 eA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* l! b0 q8 y; X- k' G# q
is to determines whether a debugger is running on your system (ring0 only).. f7 h3 O+ k. w% P* E5 |$ Q/ B
0 _( U9 e- a" {, |
VMMCall Test_Debug_Installed
; Q5 i, e) ^# k' ^" { je not_installed0 X+ D! W- S7 D% _/ l0 v$ X% _ c
1 D$ n( Z4 M8 M" y
This service just checks a flag.- R2 s; a4 {2 L4 k
</PRE></TD></TR></TBODY></TABLE> |