<TABLE width=500>+ v K2 Q9 y0 C; Z9 M5 a
<TBODY>
/ l; j/ l, v1 X% E. k u<TR>
/ m8 C* N. d+ ` x<TD><PRE>Method 01 3 d7 m0 p9 {) z% W0 h- [
=========
* G- r8 m4 D. T
% d& A- n% Z$ o) NThis method of detection of SoftICE (as well as the following one) is
( c" ^: M h5 u2 lused by the majority of packers/encryptors found on Internet.
+ N- D: d Q/ w1 Y9 t( N) F* DIt seeks the signature of BoundsChecker in SoftICE
* r# h/ f2 o {3 n
$ _$ p9 n7 m9 H/ i mov ebp, 04243484Bh ; 'BCHK'
3 P5 d- m& `* W' b9 w. x mov ax, 04h, V1 P: r) r6 ]: O( l/ X# L
int 3
0 S& c4 G, e5 [7 K/ E: } cmp al,41 a4 k0 \3 B) o% O3 a$ B' F2 s
jnz SoftICE_Detected
+ L- ?0 _) s" o% m. _+ V" C; A1 X! V6 d5 k! V. w. t
___________________________________________________________________________" u* b) i, P; F% a0 x+ T
" |- T! R! K* P* U" {( l2 E# JMethod 02% o9 g; V0 M, [# e, Y
=========
; ]( v6 X! L; u( E. E, t& R
: q4 ?( B5 ?8 R, Z4 Y1 _6 M( iStill a method very much used (perhaps the most frequent one). It is used" [9 S# ?! s, o e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,& c: j4 D& N1 G8 I- z- U- H/ Q
or execute SoftICE commands...0 |; o: G0 _* ~$ M# o# A7 j
It is also used to crash SoftICE and to force it to execute any commands
( Q5 }$ E+ r- m8 }(HBOOT...) :-(( ]+ Q E$ A7 @# g+ ]9 F) n
2 s' y; C7 l1 ?* wHere is a quick description:6 a8 F' [( g. T; I/ Y
-AX = 0910h (Display string in SIce windows)9 Y$ x& Q2 S* g( a* W1 a% |
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( r8 n; Z8 P8 L5 T* w! i& Y-AX = 0912h (Get breakpoint infos)
, e& ?+ S7 n/ y5 B8 M. Y; T-AX = 0913h (Set Sice breakpoints)" i E4 ?" N" E
-AX = 0914h (Remove SIce breakoints)
) a: d" M! F! F$ K1 u2 m* g$ K) s' n. z
Each time you'll meet this trick, you'll see:
' m( h4 K; W5 m6 y-SI = 4647h
0 R3 I3 Y- }7 \5 Y* A9 k-DI = 4A4Dh7 v% N) G+ |$ t; L
Which are the 'magic values' used by SoftIce.4 k: D% @5 \6 h( @/ f) h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.. d; b9 x" r+ @
{9 X4 o2 Q* F5 @% H* F0 U
Here is one example from the file "Haspinst.exe" which is the dongle HASP; N- D6 F3 Z5 \7 j+ T9 Y3 y
Envelope utility use to protect DOS applications:4 M0 r' R' i! S& Q2 D
! m! `( W- ] t0 w8 n C
: L b |; P# Q. R C, U( H4 B4C19:0095 MOV AX,0911 ; execute command.
4 R- d* U; Q/ L4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).& @, b) x* n$ T1 a% `0 T5 ?# }
4C19:009A MOV SI,4647 ; 1st magic value.# F' d1 R- p+ x K5 F" L$ d }
4C19:009D MOV DI,4A4D ; 2nd magic value.
. G( \( I' d1 Y4 o1 D+ f4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ h- o+ `% `- W$ m. {
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
- T) ^ ~) A1 N& h, q2 a4C19:00A4 INC CX
* f* L5 N1 R; U+ X4 o4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- a' i& R+ k+ w4C19:00A8 JB 0095 ; 6 different commands.; A+ J6 Z+ C! q: v7 V0 i* ] H; M& m
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
9 ~: Q6 t) S4 P- d' |5 a$ h2 d% F4C19:00AD MOV BX,SP ; Good_Guy go ahead :)% m2 d( D$ ^% \+ D
6 d ]1 ~! ^( W& U- m! ~/ Q
The program will execute 6 different SIce commands located at ds:dx, which; {* E' ?! [+ Z2 S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; K( L9 R' C. y3 B: r. x
/ f4 V, \8 V/ h. y# G; e4 p* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 F6 N6 j" W, p3 W2 R6 |9 _4 }# b# m
___________________________________________________________________________, x* I7 |; x4 Y8 R8 U
1 ]; x0 a7 g1 i+ P; K' ] F2 m+ e' q/ G
Method 03: A: W% C4 h" e* ^$ a6 d
=========* `# l- \: y; X" u" _
- T- h& K' O* F9 J( ^7 c
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 Q2 f1 Z6 H' x' R: w(API Get entry point)
9 m) f4 D8 D# F G i" S; r0 | 3 k: z6 K2 R0 a- }
+ Y: I' j0 P7 \9 p) T
xor di,di
! e6 p8 H' {* ]7 {9 Y mov es,di
6 F4 v2 H0 f- ~5 e! Z+ n- Z mov ax, 1684h
4 v7 H; R; q; Q$ E, } mov bx, 0202h ; VxD ID of winice& V; n j% P) H* N( O* c6 G2 X
int 2Fh/ H2 `1 n( o9 Z9 ~! U
mov ax, es ; ES:DI -> VxD API entry point
( T. {- h7 @" f' s6 M5 d add ax, di
8 c/ F* O, ^% j, g0 J test ax,ax
! I& a! ?' _4 A! B8 V1 h8 a jnz SoftICE_Detected8 R; [; V% m0 b6 | {5 j" U
) Z) S% S+ T4 {+ {
___________________________________________________________________________- S4 o. M4 o$ E$ c$ G3 n
! q/ Q: U2 d. ?7 m3 GMethod 04) ^. Y3 j. P: {5 R/ X5 {
=========
4 g# y7 ^. m* l/ y- C! k- ~0 O. ^; O% l& @5 v5 m
Method identical to the preceding one except that it seeks the ID of SoftICE5 }/ E: k; N) g D$ _& y$ m8 G
GFX VxD.: ~$ S( `. x5 N# C
3 Z9 T5 S$ o( x4 `( M
xor di,di
" S4 F$ l' j# G mov es,di( w: y* d6 c1 O
mov ax, 1684h
- j6 @0 D* `- N* a- \3 @ mov bx, 7a5Fh ; VxD ID of SIWVID2 p% y/ c6 q: i$ t
int 2fh1 U- R! w% i5 Q3 }: t0 `
mov ax, es ; ES:DI -> VxD API entry point9 o Q6 A Y8 J) C" E9 s5 @
add ax, di3 ]; A! T6 S- W- R# _6 \' j
test ax,ax
; }% w& u6 A9 _; ]+ p5 \$ B% E jnz SoftICE_Detected' H7 E8 Z5 \2 N7 H0 v; k
7 G) ~" L- m9 G8 ___________________________________________________________________________
# R# W! S, h- q+ k8 ?2 P' |$ O) |/ V v
( X; R' x. \5 r% S( TMethod 05
h4 n$ R( r! C& Y" I2 x$ I=========6 V4 s& q' ^( B* Z7 ], S7 l
% i' o0 w6 }4 P! v# U7 C+ G1 T, UMethod seeking the 'magic number' 0F386h returned (in ax) by all system
4 }) M; h: I3 e% L. D* f9 Hdebugger. It calls the int 41h, function 4Fh.
% d) A& j7 D: t8 AThere are several alternatives. ( r- r; t8 c2 e! `
! w, {* r; e' k! t. P6 p
The following one is the simplest:! v3 ]' s5 s. v; n. B6 o
+ a/ ?9 d* c1 R8 o9 [6 f3 n& i- K mov ax,4fh$ ^* t/ G5 a7 L5 d# s, P( L
int 41h
" I d' V: T- S, m0 p% R cmp ax, 0F386
- X; n8 R* S/ u; ?1 ^ jz SoftICE_detected
7 [, n: T5 W }1 _5 \& R5 p! |. V) Y3 E
, d0 p4 _3 @- n2 ^9 u% p' A }Next method as well as the following one are 2 examples from Stone's 6 \; x# @! S7 L, z/ H- t& ~: z& ^
"stn-wid.zip" (www.cracking.net):, e4 j$ T# e" K
! \' y7 L' k J: o3 a( E, }
mov bx, cs
( q+ g9 P1 a; m6 S" F lea dx, int41handler2
3 f6 {5 F2 \2 Q, u! f3 D: R xchg dx, es:[41h*4]
# G4 P0 i) M/ U r" F# Q" X9 J xchg bx, es:[41h*4+2]
3 _) R9 P: g# x, w1 X mov ax,4fh' a2 N. J) F' k$ d" G/ o) Q$ Y; K
int 41h
8 c& a* g. u5 h% v xchg dx, es:[41h*4]7 u R; a8 M4 T# Y' @
xchg bx, es:[41h*4+2]
2 a9 f* e3 B9 @5 M6 j: { cmp ax, 0f386h9 u% c4 p+ t) H! C. }* Y
jz SoftICE_detected. c) E( ^$ t) ^5 E
. a1 \" }( F$ {! [7 Aint41handler2 PROC& t7 j! ^9 }5 i( s
iret
) S0 q9 g n! qint41handler2 ENDP4 l) z, ?, M3 P
8 {1 n( X$ S- H; K& d. g
6 Y! ]' N" j( A' n! T6 L: h/ y_________________________________________________________________________, @8 T4 ?' z. u
D0 I; A, Z; p# _- i
0 i. c% S1 C5 I3 s; `6 ZMethod 06+ S. s( m( W# ~3 C
=========
+ S3 ^3 U) b! ]0 N M! e# |% S
, i; y+ i# \# C7 q3 v) d/ u! [$ @# C. E
2nd method similar to the preceding one but more difficult to detect:' G4 Z) Y- C9 N8 p1 L% N
) \. [* o2 h: w2 S7 Z3 ] z+ t+ J" g
8 T5 R/ Y% I9 c+ q( k
int41handler PROC# Y4 }6 E( f- U' \
mov cl,al- @ N# y' i ?6 a# H+ e
iret
1 M; s6 l* O" y/ r( Q! g( i" qint41handler ENDP
5 _$ O: @" i5 C( C( g
2 b: x4 Z( j& i
. S# \# @: x0 n: C* A$ G" k( f2 g xor ax,ax
9 }# x2 w& b- ^* L: I+ i) b: R8 k4 N mov es,ax8 m; Z; |$ o ^7 o j; p/ ~
mov bx, cs. g" n6 _8 o+ p1 j" \- s& T- i$ [
lea dx, int41handler
8 j$ P' R' Z+ s- O, L% r# y xchg dx, es:[41h*4]+ _- k, j8 r" F1 ]- B! m4 {
xchg bx, es:[41h*4+2]# b: R1 _. i* b. y. A0 O9 G5 |
in al, 40h! [7 C- \' `) b$ n* d
xor cx,cx9 I8 T; r; A/ q, ?' b5 g
int 41h/ J3 \) ]+ R2 G2 O9 T0 {
xchg dx, es:[41h*4], y' w9 ^9 j- P, P8 i
xchg bx, es:[41h*4+2]
9 {) t/ N! |9 k- t, S( G2 d cmp cl,al
! c8 W9 X8 [# g jnz SoftICE_detected
( t8 o+ ]/ Q' ~9 d- b
- x4 q0 u3 X- Z& U_________________________________________________________________________
/ H* g- e" V0 I9 W! f: o7 j
, @5 l, t' c4 i9 z7 HMethod 077 W+ d$ |8 g5 L9 R# j
=========' A% P A$ E/ E8 V3 ^4 R
4 v! T' l) Y2 h, c; X2 V
Method of detection of the WinICE handler in the int68h (V86). H+ f, T8 f5 h, J3 X( E
+ [1 n! E5 }, F+ I7 [ mov ah,43h
7 j# z7 c% V) B* w. ]) B int 68h
9 O" ]# F% ~; O" g+ H cmp ax,0F386h
( K, [! Y/ g* ?, G. \+ i jz SoftICE_Detected
& r5 Q' o: [0 q1 b5 ?; v
v$ K. }+ ?0 p' X5 i; O% I; |' e8 x1 O9 a* ^9 W( Q/ ?+ y* c
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; M: s8 ], L$ {! w
app like this:& g: u. A7 _4 i3 ^ R2 ~, y
! Z# B; f: W! W1 o% \' Q4 @; O BPX exec_int if ax==687 }. K0 e, g7 b6 l2 K5 G
(function called is located at byte ptr [ebp+1Dh] and client eip is* i+ ]; n: |, B) c& J$ R6 f
located at [ebp+48h] for 32Bit apps)* A0 t. g2 N/ n% Z5 w
__________________________________________________________________________0 [# R0 h+ s: w1 d" o
) ^5 @8 @& a3 R: X7 r4 F) h4 n
Method 086 ^0 p4 \8 R8 |5 S& q8 }
=========
t# d8 W/ k3 ]5 k& g
& z/ k9 c* F& W5 ~, Z0 u( RIt is not a method of detection of SoftICE but a possibility to crash the: ^% L$ [; j! e# B9 x6 Q1 q' m! `
system by intercepting int 01h and int 03h and redirecting them to another" w9 l% e9 ]- D) ~& R4 ^
routine.
: a3 z7 l2 W; M! I: kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 t _# w, p2 M; i0 W- M! k5 r `to the new routine to execute (hangs computer...)5 z) C, i: T$ N; O, A3 }. n% u% z
4 o) f: w6 X* [& ^1 s9 ~) k mov ah, 25h( x1 }5 w- P) z* C- B9 x: }: q' J
mov al, Int_Number (01h or 03h): n* m& C0 C! K' \, f: F2 v9 X
mov dx, offset New_Int_Routine. y3 H+ q' s: r" h" W
int 21h
3 L" _! [6 J8 l2 ]' u/ Y/ k
j; q+ c; t& M+ o( v/ A J( p__________________________________________________________________________
) R7 E3 ~+ _0 N% { \6 R3 c; s$ b
; m' q$ @# |( ]8 Z, l# n! cMethod 09) o8 c5 t1 y) Z. ?# [( P6 t
=========
3 z6 h. @% G$ s9 @3 E! c' ^8 K4 u0 C% g4 J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only r1 W2 o: M" b2 G1 }
performed in ring0 (VxD or a ring3 app using the VxdCall).; S3 U) I7 J, s) T) P
The Get_DDB service is used to determine whether or not a VxD is installed
8 u0 n6 H9 z% `; ?, n ^* Lfor the specified device and returns a Device Description Block (in ecx) for
$ _$ F1 [% v c% kthat device if it is installed.
9 Z1 L w; E+ ^' h5 C$ F
6 d/ h8 p, k9 D' _6 d mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
@; |) U0 ~( J- Q7 k& A mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 C c3 A. u5 [2 e7 J% x5 N VMMCall Get_DDB
) L! l# K0 Q* }2 T- b0 a7 Z' N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
2 I7 H* S/ k7 u4 H# J1 F$ ?% y8 i) d
Note as well that you can easily detect this method with SoftICE:
. v- |! C2 z7 _) A+ u bpx Get_DDB if ax==0202 || ax==7a5fh7 u* N& \9 t7 L5 A) F2 P
$ _9 n1 @0 h9 f0 K__________________________________________________________________________
! O8 ^5 z J( [) x, R1 K8 K L ?0 v7 p' O$ {& P
Method 10" R7 R! x" G) A! o+ G% t
=========
; H( t/ B+ b6 i2 }$ m8 k5 ] L- {+ s# O$ j( |$ c, X* \; ~9 p, |- l
=>Disable or clear breakpoints before using this feature. DO NOT trace with D* Z4 u- J; I5 ]: F
SoftICE while the option is enable!!
' a6 ~, C: R6 J4 {1 q, p5 {# I
4 |- D/ W# f* U# c$ `This trick is very efficient:
; P% o1 B% M u/ m& fby checking the Debug Registers, you can detect if SoftICE is loaded
T& e1 O( U- V0 }6 Y" G& `: `(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ J; Z* o, ^) q0 J# Gthere are some memory breakpoints set (dr0 to dr3) simply by reading their
6 M7 j& L* l @0 p* Y- B6 Ovalue (in ring0 only). Values can be manipulated and or changed as well
+ B$ x- y4 Y2 }+ D4 e) m+ R% p(clearing BPMs for instance)
; F1 f" o3 I& a! Z$ z3 `0 h9 j
* v# x1 {% V# e \6 t' }* B- M6 U__________________________________________________________________________( W0 E% o# N: i9 Z: W
' v4 D8 j0 Y6 O$ Q4 V; A* fMethod 11
# I4 V0 G+ h- M% o, w2 D=========1 ^/ ^+ {5 T7 r/ {, l
- j7 U2 F- ~/ F9 ]
This method is most known as 'MeltICE' because it has been freely distributed
% X: [* d$ i6 n( v( J& q" evia www.winfiles.com. However it was first used by NuMega people to allow
1 y W ]" K2 E* GSymbol Loader to check if SoftICE was active or not (the code is located, k- t+ n& l; K
inside nmtrans.dll).8 o. b6 [7 T' L. S& B) D
) u: j4 N9 {; w) F6 l+ @. [The way it works is very simple:
: \! Y( z+ c; pIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
5 A0 r( z1 c7 y) C$ DWinNT) with the CreateFileA API.3 x* _/ P& S4 d+ P& |8 u1 i
0 D& X( R I8 P; V) ^( `, D
Here is a sample (checking for 'SICE'):! D( s& z$ z+ E4 D' b5 o6 C! f) i% f
& l, n0 ~$ H2 N0 m3 X+ ^( nBOOL IsSoftIce95Loaded()' G5 d7 U0 l* a3 e
{& n& t5 A( b# w0 X) u
HANDLE hFile; ) F" d6 d- [' c. b" a1 W
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 s' I% M0 g K, b- p0 w
FILE_SHARE_READ | FILE_SHARE_WRITE,
* d+ }* S# F$ h/ p( ]$ } NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
G" s& l3 \0 K6 G if( hFile != INVALID_HANDLE_VALUE )/ S; w, i% `% R/ H' i; c2 m
{5 e: i5 f4 h. B6 w; q$ f
CloseHandle(hFile);! D. j+ j, ^% l' @! h. M* r0 U
return TRUE;& m1 P& g5 M$ i1 L5 b! G! ]+ x8 q
}
" j& W# R6 o& V return FALSE; _7 \, w" \7 _# ?) l! y
}. q* J: ~/ I2 K% z
: j t- p5 Q( ]Although this trick calls the CreateFileA function, don't even expect to be) n3 |* ]& t+ n
able to intercept it by installing a IFS hook: it will not work, no way!# l; ?3 ^7 G/ P
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 h; X- z! ]( n* a) [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)$ w/ I ~, |' a& U2 i2 R8 [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc2 H/ k& \+ Y) b0 |( v
field.
3 ?0 L5 e) V7 e9 y6 Z* F, lIn fact, its purpose is not to load/unload VxDs but only to send a 8 A" j k* H% I$ g$ ?, p" N
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 {2 v3 O5 H! L: uto the VxD Control_Dispatch proc (how the hell a shareware soft could try; C. w4 _* B4 g8 N% p
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
& K& L4 R# h5 ~+ m+ d! \ y8 @If the VxD is loaded, it will always clear eax and the Carry flag to allow: |- u6 U7 x6 d' n% ?' D: o. w
its handle to be opened and then, will be detected.
, V5 f+ L$ \- {. }8 l9 ^, lYou can check that simply by hooking Winice.exe control proc entry point
1 q; i8 m! b6 jwhile running MeltICE.( k# u" M- \8 n
; G V+ Y8 w+ S* O- `
/ [5 X. }( `2 I: J
00401067: push 00402025 ; \\.\SICE( K8 L' _! p6 Y( a' A, }! T N2 P9 v
0040106C: call CreateFileA! w" U- {6 a% {! ~2 {' j1 E3 Z2 r
00401071: cmp eax,-001
3 b5 Y; ^! f3 b0 C9 d# t9 F! {$ g A 00401074: je 00401091! z U3 d: c0 ~% I7 s/ Z
6 q' h) P! X9 Y/ K3 l1 R* N9 k0 N. Z2 n# ^+ M) M% X. ]
There could be hundreds of BPX you could use to detect this trick.
( G( t4 z2 x: R+ W-The most classical one is:3 F. j# y$ r7 n( M q, F8 k( p( i
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 O, m2 g" ~6 U( d& d X
*(esp->4+4)=='NTIC'
: Q3 K9 B* R9 W2 ^8 L2 C' l- a; O+ \0 _7 N7 v% M
-The most exotic ones (could be very slooooow :-(0 B. }8 {6 ~8 E3 J+ L+ i+ i+ ^9 S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
_9 ^( @) I1 E) X: @4 } ;will break 3 times :-(
$ G5 Y5 s0 ~8 Y- m& e1 Z5 _4 \) a( Q% r5 Z# i; A' G
-or (a bit) faster: 0 {# [- ]: k3 T6 d9 `
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')) U) c, a6 L# I8 Q; I* y7 c
- [9 K% o6 |0 F/ r) d BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% {* }3 X" d: f9 M3 s ;will break 3 times :-() G$ ?, n3 y8 H4 N1 |! T8 }
4 F& Q6 m- H- i* X, U, O) K-Much faster:
+ ]6 s) n6 s9 v) y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( a; q$ l2 R+ Q6 ^' m
! w; a8 S8 Z J) m, y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen, Y* O7 y( Z& \6 x9 {2 C
function to do the same job:
* S1 T% d1 t9 O Z* q) I6 p1 r* C! i
push 00 ; OF_READ, R+ d: F+ O' f k; ?
mov eax,[00656634] ; '\\.\SICE',00 A) Y+ X3 Y- r/ h0 ]) B4 Y
push eax
, @8 _# T6 E' U" E# E- H! m call KERNEL32!_lopen4 O) i5 x. ?2 C0 a2 L
inc eax) t; G! E7 r% [5 H% Z# ~ _
jnz 00650589 ; detected7 k- c7 l+ R9 z ?' J4 m8 w
push 00 ; OF_READ* ?8 T7 ]" ?9 H
mov eax,[00656638] ; '\\.\SICE'5 _, J! J0 N' Y% x' r
push eax2 }: Q/ q9 Y9 j9 F0 m0 y/ A
call KERNEL32!_lopen8 T: M9 Y8 n$ r5 t. V
inc eax8 K# n/ c3 Y2 c0 W3 e
jz 006505ae ; not detected
4 {0 p" {$ T9 h0 A+ F4 M3 L$ Q- ^, J
1 G, e G4 e8 d- C
__________________________________________________________________________
P& L1 U/ y# s$ ] j2 T
V' U5 {- F" ?* M" _8 kMethod 12
* f# `( ~1 P+ c1 y2 R=========
7 n2 F, p9 P1 i( d
4 l) G: G- N% _. ?# A, _2 U3 z# PThis trick is similar to int41h/4fh Debugger installation check (code 05
1 i9 f) W9 \1 m" ~: F& 06) but very limited because it's only available for Win95/98 (not NT)% M( Y3 ?: A2 Z0 k
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( _# i! q0 k( v4 N( U3 s0 h6 R+ S
0 }1 p/ _# n F; K% ~6 m, C push 0000004fh ; function 4fh6 k$ x$ h- D m4 A3 o: A. j
push 002a002ah ; high word specifies which VxD (VWIN32)
* a# S# D( r, l/ b. Q4 ` ; low word specifies which service
* X( m4 } D) R. }& e8 L6 W: c# { (VWIN32_Int41Dispatch)1 T& R! a$ }4 _- B' R- p4 k
call Kernel32!ORD_001 ; VxdCall
" _, q/ g( u$ }+ U cmp ax, 0f386h ; magic number returned by system debuggers
& \5 `/ c3 w7 ?' z4 W jz SoftICE_detected
0 b9 B8 m; s% V% V4 t! q" H
8 y; y! U3 Z8 l l% t, nHere again, several ways to detect it:
1 v/ e! k9 B$ b) ?1 h
' E0 ^, F; I( X5 ~" M7 l; d) E( ` BPINT 41 if ax==4f2 p# K& x( p+ A$ l1 m$ ~
8 f) v3 t. X2 `2 I8 ^: p6 A c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! W# Y0 d/ ~ M
4 V! j1 Z$ U+ B, l/ J9 b BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 }- W2 y$ @7 r. z8 H: D) t# t
3 y( i; l0 y( q! \0 U6 L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!2 A9 \1 Y3 `* b, N
; j4 K8 Y) _0 p; y
__________________________________________________________________________! n& f1 H3 k7 `" W
8 @- B' d* A$ z$ ~( B1 f" LMethod 136 L) |# F8 g( R
========= B8 F1 ]* P& w( Q! N
) D& R3 r; p2 i7 s/ FNot a real method of detection, but a good way to know if SoftICE is
- c; V7 J+ Y* e: g6 Ginstalled on a computer and to locate its installation directory.
( K$ u9 w _4 h S3 h) UIt is used by few softs which access the following registry keys (usually #2) :! B! v" q" _8 c- O2 a( t9 K( Z
5 _. @, v# T i, s1 r# ?( U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- _' f' Z0 V3 P! w/ w/ ?6 I4 [
\Uninstall\SoftICE
/ m3 g# |. @3 G0 j* s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE, v( X9 _$ Y" T" G6 l! n, L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" ^1 \0 Z% \ @- I4 M
\App Paths\Loader32.Exe9 H% z! h; C7 E% X
c+ o" T2 Q t# t1 X B9 Z
: l$ W% q/ h2 `& ]3 s# ?3 zNote that some nasty apps could then erase all files from SoftICE directory
2 i: w0 M) g7 W, k. g5 W(I faced that once :-(
" q. L, x" I6 W, L. q6 s; G' |% k; f3 w+ j0 d5 P$ W; j p1 _
Useful breakpoint to detect it:
9 ]! W% G$ G! |/ i/ j: {* b1 H8 K4 T9 u
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
- t# q& ?/ ?; l0 F% K
- Y0 a* s, Q7 G8 l. _, z! |0 a8 A__________________________________________________________________________1 H7 w/ p- m( m- x% h
% ~% O- T' M8 S- v
7 W2 r4 K$ E6 z3 ~ YMethod 14 - @) \0 P7 x9 g. D! z( H
=========
: y2 ?5 k' h* m6 G; s7 B7 g/ c+ f
; V/ C: J: n. e- S, aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
( A% e1 `2 Y9 N. ~is to determines whether a debugger is running on your system (ring0 only).
7 \8 I5 y& r3 G) f
6 H9 N: z2 d# U. }8 F; K; h7 l VMMCall Test_Debug_Installed
7 M3 m3 w' {0 J7 S je not_installed
# y0 c) O" G: p, f
8 P" {: M5 [" g, i! AThis service just checks a flag.# ]: Y2 q8 }0 w! M; B
</PRE></TD></TR></TBODY></TABLE> |