<TABLE width=500>
- x& O; y% Z" P7 ^0 `3 _6 ]<TBODY>4 T X6 X% ?' I/ N9 a
<TR>
! E" p" m& q4 k( M# S5 P+ [- R<TD><PRE>Method 01 $ g" j; _! E- V5 N4 S2 Y3 H
=========" n v$ D" J: @/ y* q( O
3 E/ e. l) a6 |
This method of detection of SoftICE (as well as the following one) is8 A, z4 l# |5 x! E' }* E
used by the majority of packers/encryptors found on Internet.7 G& `+ y2 k' @/ M' q
It seeks the signature of BoundsChecker in SoftICE
" q% f% g; s6 {! @% R! c* _9 ^. t3 S
mov ebp, 04243484Bh ; 'BCHK'
J+ t7 v0 Y! j& T mov ax, 04h
- b3 p8 h8 V: ?# J int 3 5 e! u" E- D2 x
cmp al,4
. W- G/ q6 j# j1 } jnz SoftICE_Detected1 F5 {) P) K5 J& h
: H5 {! I8 C V+ H
___________________________________________________________________________
3 r% d' a1 i- Q) j/ P# M5 l5 M, _" z$ d! ^
Method 02
: d8 i8 Q \3 z=========
4 b' r) K# |( R9 }* p% R
) x/ i+ U5 {$ ~9 GStill a method very much used (perhaps the most frequent one). It is used
! q( P1 ^7 W7 q! C$ l6 D$ M; `to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' V" W6 o, ~7 W. L- K. h# H
or execute SoftICE commands...
: Y- ]8 z: s2 { f2 ^ \It is also used to crash SoftICE and to force it to execute any commands
3 M0 h, P, h8 h, _3 }( M6 n/ p(HBOOT...) :-((
8 d$ o( w5 W2 z# Y/ P9 C+ m; Q/ v5 V+ ~& r$ m2 G' H u
Here is a quick description:
( y# N n1 Z, L. _-AX = 0910h (Display string in SIce windows). U+ U @! j" @$ _; p
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: w* i: C* w m-AX = 0912h (Get breakpoint infos) Z8 V9 n7 f; y0 z
-AX = 0913h (Set Sice breakpoints)
, e7 B( P% Y1 F& H% h# m-AX = 0914h (Remove SIce breakoints)% a z/ U- ~5 g! b$ Q
8 f) }( |* ?7 QEach time you'll meet this trick, you'll see:
4 x; }, x- ^. s) Q-SI = 4647h
" W# g. J; u+ [, E$ @-DI = 4A4Dh: x# G1 W) l5 D# h# l7 a4 e
Which are the 'magic values' used by SoftIce.) ^. d5 H0 M7 d: H! X! a' m' ^7 @
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.* E& C3 o6 h# ?, c
& ^: n0 q7 g) Y& K9 KHere is one example from the file "Haspinst.exe" which is the dongle HASP
" U: H7 v, N4 j1 a9 wEnvelope utility use to protect DOS applications:
7 u4 v' s7 O' d0 e* g& {+ O0 {7 x" A' y' y# x/ D7 ]4 ]
7 P0 P0 A3 U# W3 j v" _% _4C19:0095 MOV AX,0911 ; execute command.
/ p, ?$ }! }- A1 O7 u2 O4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 M4 i+ j2 y# j
4C19:009A MOV SI,4647 ; 1st magic value.- q/ [9 {4 e5 i% _5 E9 o' N/ d
4C19:009D MOV DI,4A4D ; 2nd magic value.
' t. }; B' I8 W4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), G1 k7 p; ]* ^% u1 D
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute$ ~, }6 X& M- c: E
4C19:00A4 INC CX
, x/ q! O i1 o: B+ h" |; x- ]4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 L7 ~/ |. B$ a6 w* U' O" J; F
4C19:00A8 JB 0095 ; 6 different commands.0 k) j# f! z0 b# f
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
" {+ Q( g' P) n) ~8 r4 E% y; T4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& t: }1 F0 }, ?1 X6 @, S7 {# X
; i% }/ t, Z1 X# y5 C. }. mThe program will execute 6 different SIce commands located at ds:dx, which8 f/ T: o" |' c M) S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( m0 b. b+ T1 n, x$ l6 z# v" Q2 @0 S: d6 A4 \' m" j) F
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 _6 b0 |9 G4 I% t! q, g2 \___________________________________________________________________________0 q: C: Z% B2 O( e
% L! Y) {+ D; ~! T
5 ~" X' V( @6 S1 b& `! c4 u) mMethod 03. h3 \1 @- t2 p
=========" k0 H+ v0 M$ z
" M/ }- @5 G4 l) Z' v$ v4 t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& x' c6 a7 t- R) }' o(API Get entry point)
3 c! X; i2 y( a+ X( P; v ' k* h3 o$ y0 J( q1 F4 e
- z! ~7 ^5 G; F% k0 F* ?* q( m) i
xor di,di
% M: }/ B# Q) |6 I" t mov es,di
3 A. w. r0 V& w, X mov ax, 1684h ' Q/ G/ q# z% s# Z* ~7 i( @
mov bx, 0202h ; VxD ID of winice
A3 }4 e7 n, g: z: @0 t- p. @ int 2Fh
6 J) ^ R8 |* n" o, C9 f6 q mov ax, es ; ES:DI -> VxD API entry point
4 t, r+ Q+ b7 A* Z- h add ax, di' t/ U$ F5 m1 V) V
test ax,ax! ~- g4 a# {$ O, |- B
jnz SoftICE_Detected
# H' P: Z, o5 _3 I. T
$ m2 n4 _+ p- k___________________________________________________________________________' @. |5 D6 l8 t% X Z6 G! M
/ P1 B; i# z' l( f* Y) AMethod 04
0 \2 b1 {1 P$ T; d9 h) F) H) `/ G) c6 }=========. O* n* q" Q6 j
% c- \) N5 g8 |( PMethod identical to the preceding one except that it seeks the ID of SoftICE; s) T- R7 ]9 I+ l
GFX VxD.
( a6 b: R+ ?" e4 x% V3 X9 U$ R- ~
. \4 d' |! L1 @) ]8 { xor di,di8 O) c2 K( Y/ {& D, ~5 P+ D8 q
mov es,di1 C# ~) z' X, b) C0 O- Z
mov ax, 1684h
4 \* x# A" i9 _3 ~- E4 B9 h! y5 t mov bx, 7a5Fh ; VxD ID of SIWVID
* h5 r: I, m- {/ J. B" c int 2fh m @& K x0 \6 A
mov ax, es ; ES:DI -> VxD API entry point
5 M6 Y- ~: L$ G8 `( ?8 C" t add ax, di5 H& f; E7 v5 D/ _. l
test ax,ax7 }0 w/ T) x+ c0 J) ^2 @ B
jnz SoftICE_Detected4 d6 Z/ h- E0 N3 k7 h
3 H2 b F7 b9 E( Y u! y& p/ V8 C__________________________________________________________________________( {% X5 t+ L7 F, [9 Y
& N# W# S5 P% X! Y
" C c3 c- r# yMethod 05
3 Q' O# A" N5 C=========
8 k# g, L3 _# ~4 g
( W! K3 l% G, J4 g- X. QMethod seeking the 'magic number' 0F386h returned (in ax) by all system2 ^; D9 t7 F) N" [6 R1 x6 {6 B
debugger. It calls the int 41h, function 4Fh.0 p5 Q- N7 D6 P$ C2 b
There are several alternatives.
, |6 I5 k: [3 n" Q( z, p& I4 @, G$ Q5 {- _7 X. J) j/ t. M1 o! Y, e
The following one is the simplest:( ]3 }$ I T! O7 R2 ]
5 p# u4 b2 _% n* k) `
mov ax,4fh8 j0 l4 d p3 `- E& D. \4 O0 z2 Y
int 41h
1 C, s' i% n1 E cmp ax, 0F386$ ]9 R* v" m. g( X$ ]
jz SoftICE_detected1 d) H: L/ u6 k5 A( e
1 r3 K6 ~* {# m' G
# F) n; q! |+ L
Next method as well as the following one are 2 examples from Stone's
1 \; f4 B; n+ X& _"stn-wid.zip" (www.cracking.net):$ ]9 _/ L- V# i, v% B# r0 `
3 `. ?1 h7 ~$ \* q" q
mov bx, cs& R* B2 ?8 X! i# S
lea dx, int41handler2- _( b8 q( [ H5 x8 g/ `! q
xchg dx, es:[41h*4]# ]) F5 ]4 F$ g. S+ q) b
xchg bx, es:[41h*4+2]
# a* x9 o" _ Q; a mov ax,4fh
$ l, c. P/ A% v* M5 f4 O int 41h% p1 F9 {" y2 H) z, B
xchg dx, es:[41h*4]2 E+ ~* j: N6 v3 s, x
xchg bx, es:[41h*4+2]: }( e& V8 c8 K, o0 F/ m) Z9 r, M
cmp ax, 0f386h
7 m: b1 l: i, I jz SoftICE_detected7 n6 O7 B7 x7 t/ w' H( F1 a: {7 n6 `
& ~* ~2 h( ?; c! _# w+ N% L% x" n
int41handler2 PROC5 c0 ^+ r9 h* r( b* O" Q
iret
, ?1 T* x7 G$ V% W% r5 qint41handler2 ENDP
1 a5 U' l8 W R8 h0 l, S7 j/ I d8 v0 U4 |' f; O; p$ V
- s( Z9 f( B) R+ N_________________________________________________________________________# z0 y. @: ?9 J
6 }8 B0 b! r7 a
1 V2 A8 I, ^* X8 g' hMethod 06
# d' A5 ?5 h2 ^3 K' K" N$ Q=========& G) s- }7 Q% s
_ ~* m( \& w; ^, s% m6 [+ J V6 s# L1 o3 _$ z4 M2 V
2nd method similar to the preceding one but more difficult to detect:
8 z2 n' |$ G4 p9 L- c4 n/ M) @; M$ u+ ?. A0 h m& d+ C
* [: C) M' @9 x1 \! Z) S8 Xint41handler PROC- @5 J" m! C c) J; e8 V: Z
mov cl,al @: }1 A* c) k% {" o; i
iret
, T+ |/ K! D% s& vint41handler ENDP/ u" L, i4 c ?0 L1 J
* N" w' i3 a( ^. z6 p+ I' C W$ [! \% \3 r% j, C ?! v
xor ax,ax0 A. h0 m( F! Y3 c. v2 T: |, i
mov es,ax$ {! O8 V. Z# R! p. q/ l) r; P
mov bx, cs
5 q( \* v2 w/ V6 G9 t. c3 x lea dx, int41handler
4 G, `, ?3 k. ?$ m9 v5 { V# u- K4 B xchg dx, es:[41h*4] J+ B9 E4 x: T8 F8 F
xchg bx, es:[41h*4+2]
* x# _4 S% @& I/ ] in al, 40h
, o& X1 o+ _; ^5 t0 I/ g xor cx,cx
& n- c" V4 X# y7 D& g+ x int 41h
F9 z0 d: a, `+ @& [: L1 u5 r1 ~" N xchg dx, es:[41h*4]; r2 Q5 C4 R/ M9 P2 ~, a
xchg bx, es:[41h*4+2]% I3 t3 V5 z0 O
cmp cl,al
. _% l- n* ]$ S* A6 Q jnz SoftICE_detected
1 M5 I& Q5 b& Q) o* w+ }
w- C/ ^$ d9 ]( i/ Z# W0 s_________________________________________________________________________
, S5 @/ l- T) s) \. n% M& J7 e3 W2 r* K, A$ V0 y2 ]& j
Method 079 m3 U( D9 q. B
=========
8 @$ l8 t& X3 B/ Z! g7 z
% O- j3 l( m8 a; kMethod of detection of the WinICE handler in the int68h (V86)8 v: b! g6 y3 }+ s i
. f% D& e7 h( k' m& ^ mov ah,43h
3 d) B- S6 Y- H0 `5 w int 68h. ]/ K& }# b' T7 L
cmp ax,0F386h
$ I& X; n: Q' B I jz SoftICE_Detected# N5 U+ ]$ | T1 H4 }
( I3 E, O+ |" @& M3 Z x" I2 ~0 W; q/ w- `; N0 U& e. m
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" G5 x) h& M$ F
app like this:6 `- s/ z, B- [5 |# {# g8 i$ }. v
$ {! r8 R4 Q+ J
BPX exec_int if ax==68! `9 T @ l) N2 Z; r) h8 ^
(function called is located at byte ptr [ebp+1Dh] and client eip is
4 `# m( ?1 _# ~0 P# r) m4 E+ ` located at [ebp+48h] for 32Bit apps)
' Q$ g" X4 n8 _ P# R__________________________________________________________________________
( B! @/ [0 l, E( t1 a6 G
1 L* T9 H& E$ v* G% M) t/ a, j
: ^* X- i& H! N$ }/ [3 ^Method 08) n& m( N6 x3 i, L: z
=========
# H! i+ D8 f$ o |4 Q+ T% E s6 K( z5 _
. L# c4 D0 }% s! }8 B5 G3 qIt is not a method of detection of SoftICE but a possibility to crash the* n4 m0 {5 o8 m7 Y6 @: v' y
system by intercepting int 01h and int 03h and redirecting them to another5 O8 z# v, v+ g* D3 i
routine.
1 h5 V) C2 B" a E) N6 B8 m$ rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
! [2 J6 o$ T6 Yto the new routine to execute (hangs computer...)
& D: p- ?1 N( y* [+ t$ ^& o. a0 E- P! L0 p3 |" m3 B) a, A
mov ah, 25h
- `4 P& @# G* K' }$ [ mov al, Int_Number (01h or 03h)
5 i6 N$ B, e+ }5 x6 _5 v mov dx, offset New_Int_Routine
- L7 p* ?1 ]' L& U+ ^; d$ S+ D int 21h
7 |+ {$ F& r% P/ y5 P0 B9 w( J' y
9 S! E+ A; `6 S7 h__________________________________________________________________________: ^4 M( Y( J, n. d. b6 S ]0 O6 S: G
4 V8 m# H; Q- R5 S4 M; z2 H% n
Method 09% a/ f7 L% z( S5 r
=========
( j# J9 J4 P! M9 _$ S2 t5 i' x0 M6 `5 w, R/ J3 a( _. @& Z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only& V7 N" e- |- ]. e
performed in ring0 (VxD or a ring3 app using the VxdCall).% a) M3 F4 W* q. [. m
The Get_DDB service is used to determine whether or not a VxD is installed
/ G: w7 o! E9 h6 z; H6 ^1 vfor the specified device and returns a Device Description Block (in ecx) for
9 j! e( F) Q* F& o+ U" s+ |that device if it is installed.
. G5 U; k( W8 P" E. E2 L
i& k5 u0 X# L! \2 c% M3 A) I( }: R3 v mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 f" M& M: `0 R1 m& r0 m
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
( A, K4 J1 [8 d4 j4 z VMMCall Get_DDB1 V! T8 Z9 r# q) Z1 S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
- |+ N d, K. I& c! y
2 r7 S5 G2 B* l; [2 X! G* mNote as well that you can easily detect this method with SoftICE:
4 h* F$ a) q, V! b) d1 ` bpx Get_DDB if ax==0202 || ax==7a5fh
$ y6 f8 h9 T/ ^' O/ t5 \1 X/ L6 V4 A0 }* i. c; {
__________________________________________________________________________- I3 B: H, b5 x0 n: k
n' p& L# w% F: n: S( A
Method 10
+ s7 i$ d. A5 M$ ?, ?7 L& i=========
2 C& q! \8 B. s5 A3 I6 |
1 r) i- W& r/ _* [3 L=>Disable or clear breakpoints before using this feature. DO NOT trace with
- ? P5 l( J: ]" H SoftICE while the option is enable!!' G/ I- q. L7 h! {( {5 M: X8 v
+ j8 y2 b0 w( i/ N+ Y3 RThis trick is very efficient:
+ e$ |7 D# K4 U; r$ ^- E) C1 Dby checking the Debug Registers, you can detect if SoftICE is loaded
+ z6 ` i( ^: ?(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- V3 n! h r6 W5 c/ y5 Jthere are some memory breakpoints set (dr0 to dr3) simply by reading their M& h! M) ]% g V7 e7 z+ r
value (in ring0 only). Values can be manipulated and or changed as well
- W9 \! Y' N- u8 l7 `8 s/ V4 Q(clearing BPMs for instance)6 F" O2 M3 t& l- i% ]/ y$ u
0 }+ A8 H* P! E: W# G' u__________________________________________________________________________5 ? C& D5 o" j1 n- G5 V0 d$ T
" S1 h! W5 c& r$ ? WMethod 11" ` M9 n4 @: |" c
=========) c+ s9 z) L4 }7 G
; y% s$ ?. ?* s) C7 _ v9 N; X9 W/ YThis method is most known as 'MeltICE' because it has been freely distributed
2 I5 h* l# P; S7 mvia www.winfiles.com. However it was first used by NuMega people to allow
8 P( c I% i) Z0 ]; WSymbol Loader to check if SoftICE was active or not (the code is located1 b/ D2 `% Z" z. w# i
inside nmtrans.dll).
, J) W/ R. {0 B& A, L* B6 U. K$ K: e* B8 T' r/ r" ?
The way it works is very simple:- e* \! `1 p% B0 M9 e- [
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 l' U S+ M0 S2 m
WinNT) with the CreateFileA API.- \6 k7 P# G6 D0 m
2 W" V# H; h) E# Q' D9 uHere is a sample (checking for 'SICE'):
9 o4 i- I% U" z
+ o1 e) _' ?5 }" X* `. ]; G7 tBOOL IsSoftIce95Loaded()
% R7 ?$ F6 E1 T6 n2 k4 s' f0 P8 m{
7 e9 F1 {" Q% p7 Q% f; d HANDLE hFile; 0 T) z/ g; o$ M- ~# w& s
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 Y3 `+ U+ \6 E( _& e8 C FILE_SHARE_READ | FILE_SHARE_WRITE,
( A8 U; p% w3 P' N1 N' H, u$ e+ D NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ ]( e& O- i, p5 L if( hFile != INVALID_HANDLE_VALUE ); O1 x$ @- C* K
{
0 y! J W6 @- V& `. y0 a CloseHandle(hFile);' R7 C2 _) e, M& M" z4 e, ^
return TRUE;% C" b) p2 u" @3 z) F
}8 m6 d- e8 b( p/ ]
return FALSE;- y1 y2 v% |$ X9 Q0 ?
}2 F& [- [$ i4 q3 {; u I1 X
7 h* P. w7 }7 q* G) m6 D: l+ t" x& @Although this trick calls the CreateFileA function, don't even expect to be& ?, [& ]; \; Z4 ^& R- L. m
able to intercept it by installing a IFS hook: it will not work, no way!
: t- B8 K8 s' N5 q; oIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 G$ f, z. h2 g5 R; \* Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ t( a' q9 G* ^# K+ Kand then browse the DDB list until it find the VxD and its DDB_Control_Proc6 B3 c& ^& u7 @8 a- I) x
field.+ r+ N6 H4 {0 R
In fact, its purpose is not to load/unload VxDs but only to send a $ n( P( a0 r9 h
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* n- d- ?9 A6 W4 ^) N# Y3 h Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try6 h8 {) d" n' v# Z b: K( s6 [
to load/unload a non-dynamically loadable driver such as SoftICE ;-).8 C( i, N0 W' p) M+ G4 J/ [* c) q
If the VxD is loaded, it will always clear eax and the Carry flag to allow- w/ V L/ A/ s
its handle to be opened and then, will be detected.
% T2 I) C1 v6 G$ f T/ TYou can check that simply by hooking Winice.exe control proc entry point
$ I3 B3 j/ v5 t1 j- Hwhile running MeltICE.
0 r ?! Z; R) `5 E/ T' K$ }8 [ L/ F/ Q5 e
# ]" l: {1 o) r1 c$ T' A$ m 00401067: push 00402025 ; \\.\SICE B; p2 E* }0 T' p' y5 v
0040106C: call CreateFileA
- U& x- `3 A, o8 E- w# i) I4 M" o0 ` 00401071: cmp eax,-0018 c; _! v" r/ j% I2 T9 o
00401074: je 004010917 y2 O* i2 ~# F
3 S4 p3 y8 l5 ^+ x [/ K
! D8 r$ d' n; A4 l1 qThere could be hundreds of BPX you could use to detect this trick.
3 l8 V* h' I, a: o# Q' m) z f-The most classical one is:; m1 c! P( N/ ? v G
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
, y4 t& Y) X+ v3 C6 P0 B *(esp->4+4)=='NTIC': x! z/ G1 Z3 G7 o) W, o) ]
5 ?$ l( A: a! X* Z4 x6 b-The most exotic ones (could be very slooooow :-(/ j* l. d; C; ^* H9 D) K0 r
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 x7 @2 k5 s6 J0 e S# Z) z
;will break 3 times :-(7 [6 j0 P* _, M7 N
% Z& T7 R( p$ g( O! A* c% ~+ ]
-or (a bit) faster:
8 c7 w& T% f: K$ h" V* U BPINT 30 if (*edi=='SICE' || *edi=='SIWV')1 r- r' x# z" V0 K$ J e
. Z. F- Y3 I7 _$ l
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
3 P j1 N' q8 |3 u9 A1 t( |7 G ;will break 3 times :-(. X- j( x* o! h% o4 {) b
% L" G* E* {7 d4 E-Much faster:7 B5 f' X3 v9 B; e2 {
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
* r4 y5 t/ W3 O5 b+ d5 T3 @5 J! L: h$ z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 e: |5 K; _: v0 s1 \9 @, p
function to do the same job:
: k1 Q. w( u! N$ D
9 t$ u) ?5 C' ] push 00 ; OF_READ
5 K% Y& F6 J, h9 c! ] mov eax,[00656634] ; '\\.\SICE',0
* I, B7 `% s0 t9 ^7 B* g push eax1 a# p/ N6 H1 n9 J3 d' \% ~
call KERNEL32!_lopen
6 Y7 N8 s) Q/ f$ N inc eax
) x8 @9 @5 F- @4 _& m' U jnz 00650589 ; detected
, }0 h0 n, z$ u* A" { push 00 ; OF_READ9 \& S0 _" e( a2 c, U. y9 i; F7 ~
mov eax,[00656638] ; '\\.\SICE'
! ^6 Z3 v3 x# P- A3 h% H V push eax5 ]: q; D: q3 l
call KERNEL32!_lopen6 H+ c6 a+ n: J2 M7 p" m6 g
inc eax
4 K8 q( V+ V( n' r; ? jz 006505ae ; not detected, v) S4 W# U g& {# n
: F! u3 G* H2 f
$ ]- f$ a( u3 x__________________________________________________________________________/ M. W' `4 Q! M, j5 _ b
$ I7 c- ?/ G2 j! C
Method 12; R% H- ^* n k# M3 {
=========
8 g' L; b' b. |1 T3 Z+ c
; W2 t4 R: o2 p. T2 {# F8 {This trick is similar to int41h/4fh Debugger installation check (code 055 b9 `/ m& f# A/ @" Y* Z3 j
& 06) but very limited because it's only available for Win95/98 (not NT), j/ f/ O) k7 h! n% g1 |9 U1 s& m
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ Y$ |9 D# C: O" J K; |
, g( X, w+ D z t. ]1 L' |7 `* R3 u
push 0000004fh ; function 4fh
# u6 s7 f- D7 R' G push 002a002ah ; high word specifies which VxD (VWIN32)
6 F& q7 ?) n# L; u, B. Z9 X ; low word specifies which service
+ c% [2 V$ L$ m! j (VWIN32_Int41Dispatch)! p' Z1 Y: o% g) F: X/ L
call Kernel32!ORD_001 ; VxdCall
* R1 Z4 C% w* w cmp ax, 0f386h ; magic number returned by system debuggers* E) Y7 A Z6 k8 q1 F+ i3 c
jz SoftICE_detected
( o/ V4 F+ x. e/ _
; w% E# f2 B8 I/ K6 c' I8 eHere again, several ways to detect it:! a; I1 d- ~; X! `. u, s' R
' D6 k% v/ ~+ g# w
BPINT 41 if ax==4f) w, v* q5 i9 z/ h: ^
5 X7 j6 ^* J$ R& f
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, T+ d3 |' Q, o( w
6 |% i! V- w# U% T0 R% q& Z, O
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" d1 B; d7 L* x% u4 ^2 w
; k( a4 n0 K/ f# `. `( W" Z BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( ^' C. g7 u: l2 O, D$ C9 d
: ~3 v: n) X6 M__________________________________________________________________________
- [! l) s! |! Q8 N& H! ~, h
c5 ^: i2 `3 Y4 z& b4 ~Method 138 p3 q; S3 r ^3 B" H8 ~: b
=========2 M5 q' `/ B% Q% q; e
& F1 K. h. N* w- q
Not a real method of detection, but a good way to know if SoftICE is
5 W1 D4 L! j% J) minstalled on a computer and to locate its installation directory.
2 I" J: R. B; Q) EIt is used by few softs which access the following registry keys (usually #2) :
5 h) T; d4 R' p1 H& O. a, S3 a; g9 Z0 z+ P
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 s0 A' q$ W; s- H5 h7 k9 w
\Uninstall\SoftICE6 L1 l* D9 @) v9 }
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
" ]6 b& P0 H P* G1 G3 i8 P3 a-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
# D" O5 @! \* J- m# c- i. n\App Paths\Loader32.Exe
+ Z7 Z2 i) J' s- d& \ z) g. r( v
; R* j. G: V' l1 S6 m2 ?! ~" E
: k: O) U) X0 }- s7 j8 W' \Note that some nasty apps could then erase all files from SoftICE directory
4 z, [# N. S/ }2 k+ o, t(I faced that once :-(6 h/ N- D8 ~, d# f# F- v5 R# F8 K
/ s; G3 i" ?) q/ K
Useful breakpoint to detect it:
4 c9 I# @4 I. B6 n, n) V' a; b0 B$ [4 I9 f9 P
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'6 N9 R* Z- ~9 j4 l) z
; p& Z: e$ T# ]5 ]. ?
__________________________________________________________________________
, a+ ^7 ]+ d3 u$ R- _# T
* W8 b6 y8 P% _: e2 d7 _! V* \! ~; `" b6 f z4 J& O5 F
Method 14
! X% O6 x) q5 z+ ?' C7 F" m# s1 P' c=========) R3 U, c" V' H: g
& W. z( [% @* h) W0 J) P- _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. z# _# f8 Q* R- C
is to determines whether a debugger is running on your system (ring0 only).5 j+ z5 V9 f; T
( l4 `' M$ e0 f/ P, t+ h, u VMMCall Test_Debug_Installed
% e* v1 s6 H9 k P% E1 I je not_installed8 X/ W [6 X$ C$ t' G
+ K) i% B4 H9 l
This service just checks a flag., L. l/ N5 _( q- h
</PRE></TD></TR></TBODY></TABLE> |