<TABLE width=500>
, m4 u7 V! r# r9 Y+ B' c<TBODY>
8 H3 H# t2 ?9 K& X) {/ S0 G<TR>
. I! K- n8 E( s<TD><PRE>Method 01
2 y5 b, J7 g! \=========
1 ]) C7 k1 }' C- R
+ X9 l8 i8 P2 z9 N; l1 d2 J& a$ `6 u% UThis method of detection of SoftICE (as well as the following one) is0 n1 r) f, D7 i+ U
used by the majority of packers/encryptors found on Internet.: ?/ n" k& H* A r2 n
It seeks the signature of BoundsChecker in SoftICE6 F Z0 a9 m/ X& M% m
0 [* ?( z+ o u6 F' k* w" b7 W1 z mov ebp, 04243484Bh ; 'BCHK'
* g" U) D' L. X7 ^! ]' U' U; T mov ax, 04h3 X+ X3 y8 ~( ]
int 3 ( O% t8 k; f( j+ C+ [
cmp al,4" S1 P5 \7 l2 ^# y1 Y- Q9 I
jnz SoftICE_Detected& @0 Z; f4 F/ ~7 y# R
/ J8 f( t! b0 N6 R
___________________________________________________________________________* ^5 K, V- p/ N; q [3 M1 M2 a' A' \
3 U0 W& ?! B- L; Q: `
Method 02
* B3 C) `+ l) p6 @9 T=========( D9 C r" W6 l
' `8 l/ P) e: F! _' y" KStill a method very much used (perhaps the most frequent one). It is used$ y1 Y# m- {1 Z3 a/ v# N. @- i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ C* P3 n& C: E# ~" U$ Q4 g2 H
or execute SoftICE commands...% T5 @8 M) j4 S; [4 @' w
It is also used to crash SoftICE and to force it to execute any commands3 d# l+ f2 Z: L5 m- {/ |
(HBOOT...) :-(( & Q0 A! F& [0 _* a8 n5 s: K
% m5 @/ C. ~ K+ s n0 F2 lHere is a quick description:
* C* O- k! R* ^8 R, j-AX = 0910h (Display string in SIce windows)
+ _; Q( E# W: s# {8 X4 I-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 {$ _% {3 p/ q. x; D# a$ r-AX = 0912h (Get breakpoint infos)4 i& R0 R2 m$ ]: M% E, r; P9 w. `
-AX = 0913h (Set Sice breakpoints)! E' i2 C9 o, ]# w
-AX = 0914h (Remove SIce breakoints)% h5 B8 B+ h+ b! ~, c6 r
1 i5 ~3 i; W. T) R' @7 y& a( M2 kEach time you'll meet this trick, you'll see:
9 X9 U0 m% e9 q) b/ J-SI = 4647h* Q. ^, T4 u7 H( U- O; b; {
-DI = 4A4Dh8 s. e0 b5 q* s0 m6 n
Which are the 'magic values' used by SoftIce.
8 s. u' t2 `, f# @! G) ^For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' d1 @( d- r6 B+ O3 H" s
9 d5 A5 f) R! o9 l9 ~7 j {Here is one example from the file "Haspinst.exe" which is the dongle HASP
* L1 B, z: L( p+ v- y! H4 M. WEnvelope utility use to protect DOS applications:
; Y7 B" x4 z4 v& x7 f% e, f) |3 R/ G
5 D5 ]* ]2 \4 w. C' p
4 G3 `( d! b$ `6 o, ?* O8 E3 F4C19:0095 MOV AX,0911 ; execute command.
( U" g% D0 i/ t4 p: y4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
! r6 @9 o( C. I$ C+ E0 s8 b4C19:009A MOV SI,4647 ; 1st magic value.
4 l) k7 u' c0 k2 R3 a3 k4C19:009D MOV DI,4A4D ; 2nd magic value.( j. X$ V+ h- f8 G% M9 ^$ Q* S
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* H0 X. ~1 S) c
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) ], r6 F* U% h8 {( v& Y) P4C19:00A4 INC CX
d) D4 X& l5 \4 b4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
; I2 x9 k3 J2 a* C H. m0 ]' a4C19:00A8 JB 0095 ; 6 different commands.
( b6 W; M* B( u R4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ W$ h2 y& a- ]: u! ]4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 r; V8 S/ \( b: Q6 r* T% [6 y" {
5 C8 a$ j9 A' m$ t* {* Q% CThe program will execute 6 different SIce commands located at ds:dx, which$ U. V0 \. u O; l' l5 |( Y# p
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ d7 t: N9 C/ V4 F& u# ?6 A9 p/ @0 _% D
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% b* F) F! E6 m/ x
___________________________________________________________________________
2 S9 ]) _% G$ t# U2 K+ D, ~$ d9 Z; g& O. s
$ {- N% s1 n* U4 gMethod 03% h2 T3 r# G5 d* D; E
=========2 f" p% a& ^' ]1 b& R
6 i5 x; H3 Q8 _
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 E9 G4 p; S! \9 _6 I+ m4 ^6 h
(API Get entry point)
& A+ `, r/ I4 q$ p( {" @ : H( m0 _4 u# U* J( x* L' s$ V( {+ b
j$ b1 [1 B5 G5 p' G( p* |& W. P xor di,di
) s: V2 |) _0 Z: I3 b mov es,di
% U) g" k# c, t mov ax, 1684h
8 q) P/ W+ A* s) D+ v mov bx, 0202h ; VxD ID of winice
7 v# S. [, w) X3 v) k5 P# G1 k6 M int 2Fh0 y, L, f( q4 L$ Y4 @; d* h
mov ax, es ; ES:DI -> VxD API entry point
+ O1 y' B. X8 B: R" I add ax, di" d6 W) e3 `$ |5 R r. n# [
test ax,ax1 n/ J1 T' w! C; m% y1 y
jnz SoftICE_Detected+ X8 O; k5 y+ c' Q% e
* d* ^/ I/ q- ]___________________________________________________________________________' ?" E# |& ?5 X" |/ N+ V
, i) h. {! Y) N; a/ |' \. N+ q$ r NMethod 04
2 U1 J1 c! p8 E9 d( {& ^/ ]=========
( p* G! {0 u* o, q& T( c" S& W( y& B# Z/ m
Method identical to the preceding one except that it seeks the ID of SoftICE* R$ e- M& n q2 V @
GFX VxD.
+ _% s( U$ M3 D3 v' G2 T- r+ v4 b$ J
xor di,di
4 X$ |; a$ m# u' S" K mov es,di0 E+ c( D4 @: m4 O$ l$ E
mov ax, 1684h
* \ l( i7 ^( ?. @" m mov bx, 7a5Fh ; VxD ID of SIWVID! g# M( o+ Q; a
int 2fh7 h: }9 ~8 j0 t" i" X
mov ax, es ; ES:DI -> VxD API entry point2 l; u. _# L1 o% f) b& d
add ax, di. U; J) { ?6 [6 b1 q7 s
test ax,ax* `( c+ i3 X9 A
jnz SoftICE_Detected
7 }6 J" }2 v4 n' F3 B0 T. Q" z( R& C+ C
__________________________________________________________________________
/ T) L4 k3 g) y& M* {, O- f
+ ^ f7 Y3 `1 ^8 P$ a1 [" h0 |3 P+ p5 `! E) h
Method 05! ~2 v- J) h, P" S) h6 E
=========
3 {; I" R& L+ |0 Z: I& u7 p, `4 z8 f
Method seeking the 'magic number' 0F386h returned (in ax) by all system
! g+ M8 i& [+ r4 @( h! n$ M; \4 Sdebugger. It calls the int 41h, function 4Fh.
, I- h" f: \& J& ~There are several alternatives. ( ~) a$ F3 B( w: @5 o
$ @4 g4 B% X. @1 p2 K& d1 hThe following one is the simplest:
3 X+ \. E- g2 i; Y0 |& }0 x, B
1 D- v0 p; N- C) w/ {! W1 ~4 g. | mov ax,4fh, J7 n, @1 W( Z* v' A! m6 x; r
int 41h% Y+ y5 n+ F Q
cmp ax, 0F3860 }. \. Q h( u4 D7 L; m u
jz SoftICE_detected
& d9 _* h+ h+ H1 T; R" J+ z& w" V8 j6 b M
C3 h6 ?6 U0 c2 E WNext method as well as the following one are 2 examples from Stone's s5 R1 }- s( w) a- l
"stn-wid.zip" (www.cracking.net):
5 P1 i) g" t5 Q3 F+ c$ q2 x
0 P/ @" `0 R+ ^; Y$ X* t mov bx, cs
5 P+ |5 p7 Y8 ]: g! i* \; P4 f lea dx, int41handler2( w) X' v2 Q9 H2 y E- t( z
xchg dx, es:[41h*4]
+ D/ C% K5 B7 W4 P9 V$ y xchg bx, es:[41h*4+2]! S) s& v- _5 O3 D
mov ax,4fh
0 L$ N' N! [7 M* T( g9 [ int 41h
/ N3 D+ a( n/ |- y6 { xchg dx, es:[41h*4]
4 i6 q& W; \$ R! r7 P* R# j. | xchg bx, es:[41h*4+2]
1 V( v1 ]3 O, q" D( K( ]5 i cmp ax, 0f386h: V1 o+ f# Y0 q6 {# v" W
jz SoftICE_detected
' \7 U6 O* O& d4 k2 r) J5 X$ \% h: u R+ v
int41handler2 PROC
* \ k/ o+ a o1 f7 t" Z) E2 ~4 H iret0 l) s6 {% f( o0 u6 p* o+ t1 \2 d
int41handler2 ENDP
- n$ o) W/ {0 a6 a A# _3 R( E6 K
C( T* O% j) @$ n+ f0 i$ }" ~; C: X# B
_________________________________________________________________________
; X# k' x" ?0 X. I+ L' G! O0 G: r; Y. @4 V
& a5 H! j4 \0 Q! l6 X
Method 06
; O) x' B d _* [/ [=========
! q. d1 V5 d4 X
5 k! @; `6 D8 P9 [! e. ^! h( E8 ~) t
2nd method similar to the preceding one but more difficult to detect:
9 a* ]6 @5 V, @8 n
; W" s* w+ c, ]# ^" g% ?5 l0 P5 w5 N. A: X. z) \( T7 c$ g+ x
int41handler PROC
8 I, P! }1 u6 T, j( C1 y1 _6 J3 L mov cl,al$ j9 F g( c' B6 n, Z, u2 i$ S
iret
" O( X7 U& b6 Y% o5 @* J; rint41handler ENDP
( n+ s; j' N) e8 f7 x
$ v; d0 ~. i' l( r
N* k" h4 i( y* x/ P+ Q: \ xor ax,ax S: _# [' H7 Y9 ~! D+ |/ r' X
mov es,ax
2 M C( I' ]# G: \+ w mov bx, cs
4 f. g2 @" U' Z* j0 y# ^4 ]2 G lea dx, int41handler% V$ F; c7 W- G, H0 R3 u
xchg dx, es:[41h*4]4 W* ^9 r- i# v# e
xchg bx, es:[41h*4+2]
. N. T$ ]$ C, K9 D: a in al, 40h
: V( q8 k" u5 x8 ^5 d5 v0 X* { xor cx,cx( z0 N) }5 R6 \* Q
int 41h# g$ E8 _& V; u" C) X
xchg dx, es:[41h*4]: M1 Z: p6 |4 P) E
xchg bx, es:[41h*4+2]
# x( A, @( ?' I9 t C! j cmp cl,al
7 l; f0 z" v. o2 q2 R: z; Y+ h0 l% a jnz SoftICE_detected
; K* s$ S+ [3 V' h1 P- f. k0 x$ ~# S& `. @
_________________________________________________________________________
/ L/ h' Y0 @+ E' r E f8 R
5 Y+ w7 D2 k) k( x9 V' `/ }8 WMethod 07
* B4 q+ V7 E. _$ I7 ~# S=========: b8 S5 f! {8 I% y& L
6 U: X% N4 j' h9 s$ R8 p, C( G- Q- FMethod of detection of the WinICE handler in the int68h (V86)$ l* H: a; o% H! {5 ^
% @9 t+ [* O8 P; o mov ah,43h* Y, {/ n$ ^% \& S: p6 u
int 68h
, k5 y9 j0 D/ Q& d6 k cmp ax,0F386h# v/ t* @7 a$ c( C, _7 S# w
jz SoftICE_Detected- j4 n- S9 [, h; x! J3 n
" p( p: P8 d7 x- G6 u7 f/ d' A
6 g) ~. ^* Z! d' E2 X. N2 F8 }=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% L/ f! \$ O% c" n
app like this:: [3 d) @$ L7 p2 S$ L4 y+ F, e
* I% E9 q2 H @/ R0 l BPX exec_int if ax==684 j4 a; q# ?6 F) Q
(function called is located at byte ptr [ebp+1Dh] and client eip is
4 Y- }. f7 d9 Z located at [ebp+48h] for 32Bit apps). u% @4 t1 J, b* f$ d; ]# L+ W, H' O
__________________________________________________________________________+ G7 C: j3 X) y; h* e9 g/ M2 O
& Y8 a: l* r+ T8 G9 ~
) t/ Y2 Z; |( j, y" U( x4 HMethod 08% o5 E. Y/ K& Z$ K: a0 t+ S
=========
0 L: _3 h% ]- J7 M
% R7 v5 M- Q8 J" gIt is not a method of detection of SoftICE but a possibility to crash the3 b2 ~! W% D8 i! I1 o
system by intercepting int 01h and int 03h and redirecting them to another
0 N! Y4 l3 K: o& i$ d: l, G- [routine.
& i S4 i0 e( p5 LIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' v# Y% N+ ]# V2 d
to the new routine to execute (hangs computer...)2 C1 _6 b9 o" M
: h, s( m+ D8 K5 F5 S mov ah, 25h/ g8 c. e2 D1 l
mov al, Int_Number (01h or 03h)4 j1 Z$ r7 s1 V
mov dx, offset New_Int_Routine7 C; { W+ g) _+ e1 f9 D
int 21h
. D v: i3 |# c; P& c3 ]0 Q: X( X3 Q$ m9 V) p* u1 N
__________________________________________________________________________+ ?/ d, ~1 U H" j- V! ?
# l( o, ^! M4 t( p9 U: W5 ^2 ]Method 09) M* o, o" l( X0 K0 }
=========
8 L- _* n' o" q" \3 p- G/ ~: a6 U$ F( d+ V; c3 J b8 S4 D% P; s
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' [4 @& P+ D3 W; C$ p
performed in ring0 (VxD or a ring3 app using the VxdCall).$ Q2 k+ e' ?3 W2 Q2 W. K
The Get_DDB service is used to determine whether or not a VxD is installed q) N5 d0 n t# N% ~
for the specified device and returns a Device Description Block (in ecx) for
% e1 j' q1 N ?! Y9 u/ Dthat device if it is installed.
w" o& {# E/ C1 e6 @/ A+ u! p# H, g
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! b- z2 G3 c* l7 J3 l2 I t6 n mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
- w6 F% c* L9 y, A VMMCall Get_DDB1 F% z/ ^" m# G- w
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
( U( B6 E7 L# t* u
( m& U4 ?* u9 W. m1 _Note as well that you can easily detect this method with SoftICE:
6 p4 c1 ^7 o! m; v% A bpx Get_DDB if ax==0202 || ax==7a5fh
2 T: f0 k8 o+ E1 x& l. o1 B, ?: P5 [ Q' [8 ?
__________________________________________________________________________
: F; T& O ~/ ], |+ C$ a m
3 J$ s* }5 j6 |( y9 O b. iMethod 10
8 F0 P( c" M6 r& b=========
0 b4 ?7 ^, U. r4 _
2 y' O3 E: \& T: g+ h5 k/ H# w=>Disable or clear breakpoints before using this feature. DO NOT trace with
' N8 \" P9 _4 J8 F, g0 D. Q SoftICE while the option is enable!!3 z' W! t' |! F! p; z- a7 @
7 n |& ?( I1 e6 @5 L3 [( vThis trick is very efficient:# k- ]. L+ n; i' K! W/ _ @
by checking the Debug Registers, you can detect if SoftICE is loaded
7 p1 P4 O/ W3 g' y$ B6 E. z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 C8 p O! }: N" q8 V- M1 b. \
there are some memory breakpoints set (dr0 to dr3) simply by reading their
z/ H# e5 J: V9 L$ h- Mvalue (in ring0 only). Values can be manipulated and or changed as well8 v3 m. S' i2 `. m5 { f( ~$ h9 A
(clearing BPMs for instance)& r# h4 T5 D: s) V$ U- j
( X1 k& J# G6 ^! Z% `
__________________________________________________________________________) g* y& M' y" U' U3 e& U* C
; M0 w7 S2 o) p' ~Method 11# [; J, Y; u/ Q( M% [: m
=========" _5 M7 n3 [3 Z! G- A( H& @
$ M9 R0 z3 V: t. j9 y/ |! q
This method is most known as 'MeltICE' because it has been freely distributed. W, g( U! P$ N/ I+ u$ j
via www.winfiles.com. However it was first used by NuMega people to allow
M! S3 [/ q, u1 t. B* I9 r* iSymbol Loader to check if SoftICE was active or not (the code is located3 l+ j: W! u0 `% X$ X+ g9 k
inside nmtrans.dll).9 t% Z7 a' T6 u- u" \
8 K0 \5 W- V, y6 BThe way it works is very simple:
! X8 o# G# _- W3 t8 cIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 J! z; L7 V6 y% XWinNT) with the CreateFileA API., K1 `' s# R4 b! a9 Q" H
' q; r: f( K, R, j$ s
Here is a sample (checking for 'SICE'):% w6 x4 q0 R& p
, P& ], r G- {5 |BOOL IsSoftIce95Loaded()
! J' ~! w8 H) o0 |( |( Q{
& ]( c0 x! B* f# w/ Y0 M) \ HANDLE hFile; ) R( ~! Z7 _$ }2 z& J
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 i- }" Y0 l5 Y: J$ G2 a' d FILE_SHARE_READ | FILE_SHARE_WRITE,; Z' C8 T/ }, m5 w& g
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# o5 i* H1 L3 D
if( hFile != INVALID_HANDLE_VALUE )/ f# s3 q$ `5 J( C6 S$ \" C2 ^
{
- N0 u9 m- ~6 c% b2 }8 k CloseHandle(hFile);1 x) H# G7 [( b" p) E# W) d4 z0 @
return TRUE;
/ e) N8 E6 U3 F( C" d( M }
8 F& a: C y% ~6 D return FALSE;
2 U$ q t I0 U: Z}
7 {3 }$ P, [) y8 f$ W% ^! b* P$ S7 f. M. a& k% d( P
Although this trick calls the CreateFileA function, don't even expect to be/ b6 J8 Q% V+ Y/ }1 s' i& l& }
able to intercept it by installing a IFS hook: it will not work, no way!
% F5 k& A/ [5 OIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) N% S- q0 m: t6 R( r' Sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' \2 B1 D9 @( s- ?* I( G0 `
and then browse the DDB list until it find the VxD and its DDB_Control_Proc1 X4 ^ y% P# T+ q( ]- e- b
field.# v p* t6 Z3 V5 ~, n" v
In fact, its purpose is not to load/unload VxDs but only to send a
* d; n: j/ S3 p# ? `W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) J1 v7 |& Y$ Z4 k* Mto the VxD Control_Dispatch proc (how the hell a shareware soft could try- }0 f' F/ C, F
to load/unload a non-dynamically loadable driver such as SoftICE ;-).' ^% @; A! n. y7 s( V8 \
If the VxD is loaded, it will always clear eax and the Carry flag to allow7 ?! n. `9 P* ~' Q6 T6 [! k
its handle to be opened and then, will be detected.
; P, T$ y: c0 oYou can check that simply by hooking Winice.exe control proc entry point
% W& @' c2 I7 ?, Fwhile running MeltICE.
4 q1 d( l8 C! B. Z
9 a! \! @7 l; o' @9 c9 V B$ ^( f8 E+ \6 p, Z4 y, [
00401067: push 00402025 ; \\.\SICE
+ y6 O3 Z, {' A* G: M 0040106C: call CreateFileA
* I) [1 c2 [2 Z! g5 N7 k' a 00401071: cmp eax,-0010 r8 P) {3 q# @
00401074: je 00401091! i7 H. u3 g0 `2 k: S
" v; ?) A% c% |
" |* x& t$ x2 s2 j/ n
There could be hundreds of BPX you could use to detect this trick.2 t, c1 C7 o: }& L: s
-The most classical one is:
4 G5 y# r5 n; j/ r _, @ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 ^/ I1 a$ h1 y *(esp->4+4)=='NTIC': u, v/ R1 `( y9 a. P
# P: ]3 K, q4 Q( O& p-The most exotic ones (could be very slooooow :-(
0 U/ M- r+ x# @# s x. H/ n- D1 t BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') $ m% ~$ _) F* q" j
;will break 3 times :-(/ F( E! e1 ], n0 A$ O
- Y9 g3 Y, K7 H1 ^+ W5 V-or (a bit) faster:
7 i& J* B! _, @" s BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
' K' V: E) L) f5 \( c) e; K& {6 t4 z
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' $ ~2 D3 F- w9 D K% E8 V# E2 \
;will break 3 times :-(
" ?8 H( a) m6 x& u( e
8 m' h; Z4 S" M, l* @-Much faster:* C6 G% C( ^; [, p
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
; [$ \$ t; C+ n2 V6 O ]$ Q" y* X8 d# V8 c2 z* T/ v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( N9 K; i! H7 P8 e! qfunction to do the same job:2 f- F0 z: o( Q1 f4 m
0 A! z/ b( |6 z! b6 y
push 00 ; OF_READ
, u: w8 b @: |/ g [ mov eax,[00656634] ; '\\.\SICE',0
6 G" T8 X" v8 F5 n2 ` push eax
/ L2 u: e) B: t call KERNEL32!_lopen
/ p7 I/ {# Y$ X, y/ i( M% G' f inc eax, V, M. c' N: w. y: E3 i
jnz 00650589 ; detected* T6 C, S! V0 w X4 [: T( p2 v
push 00 ; OF_READ/ q8 k* C0 l/ g6 O& A
mov eax,[00656638] ; '\\.\SICE'4 r7 Y# k) T; k' @/ O
push eax
, V7 |! H0 C# F4 l call KERNEL32!_lopen' A, _, J7 o4 h# o, N J
inc eax, N) `) i0 ]) J2 A2 L; t- s6 t
jz 006505ae ; not detected/ Y' ~6 v, k0 t8 O5 J" q
& d$ d' @+ p5 Z1 R& H1 ]1 K! A1 c8 C+ w' T- Y1 }
__________________________________________________________________________
% [5 w- d' @- ?8 i9 b; \
. i' z7 N4 W$ a7 ]) ~Method 12
9 z1 `' g" H$ ]/ ]9 e i/ b=========
& M- [& W# a( _0 ?
& Y, u. r, u N1 N! E LThis trick is similar to int41h/4fh Debugger installation check (code 05 S0 H m& J& _9 s
& 06) but very limited because it's only available for Win95/98 (not NT)
/ P% _( U! q" R0 b3 O# ~) I6 Ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: z" f! N( s; x0 m3 ?: J9 \8 l @8 N& C' w
push 0000004fh ; function 4fh) [, E+ |5 f8 g$ ~
push 002a002ah ; high word specifies which VxD (VWIN32)
8 A f. u- F8 B; f; f8 O3 A1 M ; low word specifies which service( ^2 _$ p: n; `
(VWIN32_Int41Dispatch)
! V" v, b, F1 s! k" e call Kernel32!ORD_001 ; VxdCall
4 J8 J2 X; ?- s cmp ax, 0f386h ; magic number returned by system debuggers6 p9 [4 s/ L4 w& i0 Z9 k
jz SoftICE_detected
& O% q" W2 h3 h9 ?6 T" R2 R
. Y* o9 c# F" y; D" {+ KHere again, several ways to detect it:
/ N8 A' u: s1 |: R9 E9 x I6 v7 K N1 v* P/ a
BPINT 41 if ax==4f
+ @: Z5 L) t8 C: X$ e6 p. i3 f4 g) A: p; |5 K- M$ e
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 F0 @0 j# J0 K1 n/ ^4 A
/ { G4 k# L) K( Y/ @* {$ T O! p BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A; i& n& L$ a5 ^
3 ]+ s9 c- U' I6 x! R5 T: O3 b9 I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
" g- U2 H6 z9 ]5 W+ J9 q
3 g9 O7 [7 X$ {__________________________________________________________________________7 j2 T9 j4 U" P: I2 U7 F
2 X6 a/ p1 U* ?5 T) `; P# e
Method 13
3 s7 L1 k( G( h=========
- \" |! q+ g) ^2 ^6 B4 \
/ D3 s4 U( d6 PNot a real method of detection, but a good way to know if SoftICE is8 z0 F0 { ^. E
installed on a computer and to locate its installation directory.
, E7 S( I- }) ^It is used by few softs which access the following registry keys (usually #2) :
5 \, m q s, i( }8 L
) D' E; [, g! W# i9 P( [3 }' M-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" a3 |$ Y. n8 M8 z" ], E
\Uninstall\SoftICE+ I, y5 e, z! k9 C# H& a
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
+ T* D0 N5 f6 d# G" {: E0 Q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 M+ V" T; K: [3 S( J- X' H( C5 u
\App Paths\Loader32.Exe
( m2 T* J8 t6 b& x: n t: s/ \! L t7 G% T
4 O: I+ A1 ? XNote that some nasty apps could then erase all files from SoftICE directory
3 {. E L3 L* Q& J, t0 c(I faced that once :-(: C4 ^. T% \5 |" m" T" \3 ^) L& V
! z b$ q( E: |! ~9 W
Useful breakpoint to detect it:
+ k0 p6 v- D9 e" {7 Q8 i+ W) c2 f5 B: k0 E9 r
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
5 [9 @2 ]' n9 K. b' r& s- k0 f6 n% t) n, Z, `/ S3 B
__________________________________________________________________________
1 T: r& o5 ]8 M" `3 \8 L" ?' m
! t3 |# e. I' f7 |" R8 N3 x/ ^: t" P# T
Method 14 # x: M5 I4 U% T' O
=========
x6 Z ~0 u4 _6 w1 G! c4 W: r5 o# F$ w$ c- x/ e
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: q. S0 b2 ], o2 G: v+ yis to determines whether a debugger is running on your system (ring0 only).% h0 e+ e9 X9 g5 a( A
8 X% z! r9 l D: z( B: H; {5 i
VMMCall Test_Debug_Installed+ m/ O* l; S8 n/ r% u( P
je not_installed
' c3 {. w% C) A( }( [; K( u, M* [& o: U! f$ _, p, U
This service just checks a flag.
! c7 Q" R s6 G% M4 T</PRE></TD></TR></TBODY></TABLE> |