<TABLE width=500>. D0 M8 h+ d! q' U4 l# y& t0 D: _
<TBODY>
' |$ N0 ]/ s0 a! N- A' S<TR>! D( z8 P# c* P+ i: z+ Y% Y
<TD><PRE>Method 01
7 L3 m! S; J9 Z* I' V=========
( Q7 M/ \. H; M- d& c3 ~* S& f5 Y4 ^4 e) z6 n
This method of detection of SoftICE (as well as the following one) is
8 q: a( D2 `& iused by the majority of packers/encryptors found on Internet.: j% \! S- F0 G. J- t
It seeks the signature of BoundsChecker in SoftICE
6 d: q! X" Z J, \2 U" z
) X2 T/ c8 M: D# o2 e6 v( i mov ebp, 04243484Bh ; 'BCHK' ^+ L' D3 @. }, H0 _
mov ax, 04h
0 f( ?, U5 u; P9 i9 [$ `7 [ int 3 : R: I, ^8 ]' y1 C
cmp al,4' `+ T" N9 F8 k k
jnz SoftICE_Detected
! w0 R; k0 F _; x; @& D! U+ E/ Z4 c% i+ y2 u
___________________________________________________________________________) r* S5 | U4 n; R1 y' B0 B2 B9 ^
; V4 e! b1 V+ `( d. c3 w
Method 02. s9 L3 Z$ J: o/ q' x) Z e# f
=========
- u) u) s' i' y; |" L% ?! F2 g. F
3 o5 R( `' b, B- v2 a8 k3 eStill a method very much used (perhaps the most frequent one). It is used
- G- w2 G& P- ~7 h% qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,: t) h# f7 G9 B0 ~; l0 u
or execute SoftICE commands...
# z9 g* j& c2 B; i/ G- D' RIt is also used to crash SoftICE and to force it to execute any commands7 g* L8 z% r! H
(HBOOT...) :-(( % u# A" M7 n+ [: G
/ F# G' Y" `+ e& i* k1 E5 tHere is a quick description:
. A! S8 a/ v* R-AX = 0910h (Display string in SIce windows)
( O6 Q. y( y! `-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 v. A9 R1 P3 i6 n- b
-AX = 0912h (Get breakpoint infos)4 I0 ?4 n1 U, H: x: w
-AX = 0913h (Set Sice breakpoints)- _7 C1 Z% \- @8 s- v
-AX = 0914h (Remove SIce breakoints)
' x- l; o2 B/ C# g" `: Y
1 x* n( [) B6 @' u, kEach time you'll meet this trick, you'll see:
! r( g6 `' o9 k( }-SI = 4647h
2 Q! L2 S& A+ g5 j& n-DI = 4A4Dh& _; z( G) ~+ H: g: S
Which are the 'magic values' used by SoftIce.
4 A: h1 u5 P# i" r2 _For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" s5 `+ w! f' {
9 E& q2 Q9 x1 I @9 V8 _Here is one example from the file "Haspinst.exe" which is the dongle HASP; F* g0 J# w7 U/ T4 y2 |
Envelope utility use to protect DOS applications:
# `$ h& @1 J0 ~
0 o" P4 c4 Q& D* |# w. D8 H; d3 P, n9 L2 A8 X S
4C19:0095 MOV AX,0911 ; execute command.- P" L9 W( R4 q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
/ V" y# a0 w4 I3 r0 ]4C19:009A MOV SI,4647 ; 1st magic value.
% [4 x2 D* Z: F% G, b3 B4C19:009D MOV DI,4A4D ; 2nd magic value.( a1 I3 T1 n) a9 z% ]7 Q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 B/ c- A4 h: v+ L% A( V$ f
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- S4 {+ t$ [: K- J* h. \
4C19:00A4 INC CX* Q7 x( ^2 c; }+ l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute1 Q8 O W5 j0 L* f. `" F) [( f
4C19:00A8 JB 0095 ; 6 different commands.
3 O$ W$ y# q3 K( l, c' k; N4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* P/ [; R) L1 Y) F9 k; [6 e4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. c. V+ D: ~. J9 D8 d- R& d o H, N0 D; ~" N; r0 E6 {
The program will execute 6 different SIce commands located at ds:dx, which/ |8 J* V/ a* T1 ? g
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' X0 x% _8 O# Z4 a* P2 f U! j5 j+ i- d1 E+ s6 j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" @( O; t. h* o$ ~___________________________________________________________________________+ |8 }8 o) l E4 I- A; l
6 U+ r. E4 F4 T. G( ]
1 C S, c+ D9 A( I5 W# `" @9 n; hMethod 03; i [& ?' O& X
=========! G1 J; A6 Q7 C. l2 L f! s: f5 p
2 @! k4 Q' m5 @1 ?& L$ i
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ b5 ~- ^. ?( \(API Get entry point)1 h0 c0 [' w' V
# f) D4 s# P3 E/ b! L9 X3 ?2 W8 ^( k$ ^8 S$ J! ]4 C5 e
xor di,di+ }) `8 p; r( r
mov es,di. @% U: o+ e+ B/ W: { _5 I
mov ax, 1684h , A$ v J* |% ]8 T. d
mov bx, 0202h ; VxD ID of winice) J, B; y0 ~. @9 S6 c/ e- P% u5 X
int 2Fh. p+ s# k8 s/ M5 t1 b" u9 ?; z7 k
mov ax, es ; ES:DI -> VxD API entry point! J( ]/ w* b+ O: B. i) Q2 Q
add ax, di$ |) a9 o5 x" |8 p( y
test ax,ax a$ X) X, T4 L% X. Y* r4 i5 @
jnz SoftICE_Detected" q2 ? W3 n8 t/ k2 r+ B& W& v& r
- m* G+ \: ~2 H0 r3 S* Y2 n
___________________________________________________________________________
, P* J6 x7 }. c7 O+ b2 C, h2 k) n
Method 04
+ t% u3 s5 G$ Q=========& O$ l2 e% G( P, [! X! ^1 N* R
6 E* h; w" F7 V2 {Method identical to the preceding one except that it seeks the ID of SoftICE5 M% \/ d; f' p$ U6 Z& H' x; E# x
GFX VxD.
: v2 D1 E: o: P/ J' M$ j# Y( F. h7 @0 S# B
xor di,di
' @! ]8 ^: w2 }9 V mov es,di- L7 P; k+ f) ?9 n% x% q* q D" I
mov ax, 1684h
2 h& S$ q l, b: H& R# m mov bx, 7a5Fh ; VxD ID of SIWVID0 |; J; R% t6 D o3 V0 X. D
int 2fh( e" b _, S) E( c2 M) Z+ B& \ b$ }
mov ax, es ; ES:DI -> VxD API entry point
) n" v& W7 d. n& q/ l/ d0 f0 Z( C add ax, di0 |! F3 W; _' c0 |7 ^* t1 J* x! Y
test ax,ax2 k7 j" l$ b- k
jnz SoftICE_Detected) }" ?( V# p# p8 x
6 L2 R% P4 o. I. W1 w/ @
__________________________________________________________________________. K5 k4 c! F, h) I- q8 y
^0 g3 n/ ~& b3 O' R7 m# q
& y/ A# P! _5 X7 Z+ a) g/ \Method 05" D9 I. Z0 \/ L! [+ X
=========
' Y; [# H5 N0 P& V0 g
" Z. d4 L) j& o1 Z2 p# l4 ^Method seeking the 'magic number' 0F386h returned (in ax) by all system
- L" K3 ^% ^# f5 g& gdebugger. It calls the int 41h, function 4Fh.
2 i% Q5 m; l* J( Z1 x. GThere are several alternatives.
3 u( ]3 J+ D$ t8 C
6 S; k* Q6 r! n; \The following one is the simplest:3 J1 I9 c3 s, S7 D
/ C2 ^( s# }+ l+ k. [1 B
mov ax,4fh
& r' n' D9 ]* R" F/ d int 41h; R' s( r* m5 c: m
cmp ax, 0F386# x. K% V( t' y' ~/ Y; m8 o
jz SoftICE_detected
" \% {3 s4 w1 f. Z) N" k; _- S7 L8 h/ m4 V
! `" ]& j& }4 Y- m
Next method as well as the following one are 2 examples from Stone's
9 E/ q+ Y( O. F! C* U2 W"stn-wid.zip" (www.cracking.net):
3 W+ R" w2 I4 F/ p! w
$ ~. Z2 }4 \, Y X! \% j: z; h: H mov bx, cs
/ N( G! a) c( R; @5 z q lea dx, int41handler2! }3 D( [8 _; R. }; |5 S; p5 |
xchg dx, es:[41h*4]( K, K3 r. u2 ]/ }8 W8 X& k
xchg bx, es:[41h*4+2]) X' o! ~% e8 T; J$ ^
mov ax,4fh7 z) A- }) r. L5 n4 \4 b; q
int 41h- W) Y ^* E5 V& L3 k( S9 T+ n
xchg dx, es:[41h*4]8 W4 ^# G: n% P
xchg bx, es:[41h*4+2]
9 U( x4 J& r. Y) d2 `' ` cmp ax, 0f386h
, w* [* c& R2 h; q% F2 w( k. t jz SoftICE_detected
# m5 s3 R1 L# w3 i
8 R3 N7 ]: Z9 n" R) tint41handler2 PROC
- P: `6 T+ F4 Q5 M7 s& g% J* h) i iret8 O* I. b8 G( }
int41handler2 ENDP
* m4 B1 H( z1 U( y! Y4 M5 G' N4 D
o) @' K& a* p_________________________________________________________________________
7 g' ?* {0 W3 P. ?$ b6 i+ |- p$ o {' x$ Q( j, c
; g! j4 P4 C: C" e# j3 SMethod 06
" K2 A5 k5 C: h4 P) r- U9 ?$ R=========6 z- ^4 m+ C `3 g. C( b( \
% B. w0 [3 E! D
+ \0 n, U9 G6 f, E, |' V2nd method similar to the preceding one but more difficult to detect:9 ~. S& B+ L6 L& v5 m1 X
+ ?% c8 {- q' v, i4 U
t* C# m. _9 E1 k8 C7 iint41handler PROC# X. T5 d- E6 D' C1 {. y2 L
mov cl,al5 \, p* A; P* T
iret
% @) [ @7 B3 N. Iint41handler ENDP
+ O0 A J4 X6 \( r1 q# X+ J
& K$ ~/ j5 F# l+ L
" } y1 S! W+ ~, T- K8 T xor ax,ax
/ k% p; m) ^, }4 y' A mov es,ax, e5 `7 I% n3 R
mov bx, cs, l& F4 b" V' k' k# |
lea dx, int41handler8 |7 ?( T j; p
xchg dx, es:[41h*4]
; r* b, U; g% V0 p, _0 {* O h xchg bx, es:[41h*4+2]
1 M; r( L! V q in al, 40h
* ]. C9 L& {: K xor cx,cx
# B( L* s' I, W" S8 Q- `: X int 41h+ f* _/ w9 r( g$ |
xchg dx, es:[41h*4]
' X8 I9 x: V* h! G( M) a/ E* C8 i xchg bx, es:[41h*4+2]4 P9 B& _+ Y" E
cmp cl,al
- h& m ]1 O& q. N jnz SoftICE_detected- t3 n' s0 t8 C/ G
; s3 c1 S) z& G Q/ R6 x_________________________________________________________________________3 k) p/ G+ B3 \% p) {* M
5 a6 F% n/ A* z* OMethod 07( b0 j: {& h' {. h* I
=========
& R4 m+ @3 y$ m3 V6 w5 v1 x
b5 R. m, x6 ~# I! F4 YMethod of detection of the WinICE handler in the int68h (V86)
$ p% `2 h5 X/ R9 X9 s
9 s4 m K1 s5 g5 W mov ah,43h
6 l4 V2 F ` {3 p9 l int 68h
; |' C+ z4 N1 U cmp ax,0F386h
4 b: B: r# d6 a U# k# \$ q4 y jz SoftICE_Detected
' P! B" z/ O& w* r/ j+ D$ s. k- q. Z. I& m5 Y/ y( _9 N
- U- T, z& y. `7 R! {/ V% @=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& y \+ @. c+ D/ ]- L! L app like this:
) K6 }+ M7 ~! [- N# K4 a
0 Q4 a2 }# s, {+ e% t7 b0 o+ S BPX exec_int if ax==682 U4 b3 s( w" I) ]$ m
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 z3 f8 \! h1 J C' l located at [ebp+48h] for 32Bit apps)
5 B4 X, {+ Z% Z6 o__________________________________________________________________________8 Y5 g4 X* c$ V# ~0 j$ T
1 j/ ]& T8 a8 d+ ], ~. B4 T
3 O% g9 A8 U, l# i
Method 08
" J% w7 b- ^4 e( t+ H* x! }& q=========1 ]+ Z( j$ o& t
1 ^- L- v8 t+ w/ A4 w4 C( uIt is not a method of detection of SoftICE but a possibility to crash the
( P' T) `+ l, w% v2 }system by intercepting int 01h and int 03h and redirecting them to another) {; k4 P8 y6 h3 ?8 y) ~6 `
routine.4 a9 ~) a0 S2 P& v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- Y ^. ^8 A( M3 P, _" k+ r
to the new routine to execute (hangs computer...)
5 T8 G0 f, D( d7 I. i4 b
+ W( ?1 S5 ]% P* l7 G# N mov ah, 25h
, `" a9 I) i* T A0 Q' | mov al, Int_Number (01h or 03h)) ~# ~7 D4 d- b$ b
mov dx, offset New_Int_Routine
$ h3 j8 O7 @* Y$ ~ int 21h
4 p# z/ o0 o w
3 D, E+ Y# H! E O__________________________________________________________________________
9 Z( Z) P1 S) ], J q- i& j+ N7 M* S8 n
Method 09# q9 v# h; |& _9 Y0 ~& u* H1 l* U
=========
5 z8 C% t' {) X+ R7 }, c1 F+ G% y9 [6 c) n8 C
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 _' X7 D. p, H; f& G
performed in ring0 (VxD or a ring3 app using the VxdCall).
. `: U* ?3 u' o S' b& Y! H5 vThe Get_DDB service is used to determine whether or not a VxD is installed3 j+ e4 n& x& p7 h" Q O* k7 _. C
for the specified device and returns a Device Description Block (in ecx) for
8 e( Z X i3 f1 d z1 E! |that device if it is installed.6 Q' b: Z! A$ l: k6 S1 X6 f) }& C
4 ~) u, ^4 B+ E* {! h5 i1 a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID; _! b) O* n& z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 k1 d; t W3 W' l3 v3 g VMMCall Get_DDB( d; |" m2 y( F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 O1 ?* I0 x7 c4 _1 V4 ^" N7 `4 y8 A" }3 u
Note as well that you can easily detect this method with SoftICE:
5 P' N8 M) C% V9 q bpx Get_DDB if ax==0202 || ax==7a5fh* k, a; A2 v0 Y
# |+ } H; c5 W- `# u( Q__________________________________________________________________________
1 S+ a' j U4 J8 u" [/ a2 k. |; D" Q& p* r& F
Method 10. g( A7 S3 a9 `$ [' x
=========
) o1 `* ~1 E9 P E1 J
2 }3 l& K& v& C. ~=>Disable or clear breakpoints before using this feature. DO NOT trace with; D1 U+ d @! A) y- {
SoftICE while the option is enable!!. x( W7 ~% z1 ~8 }
0 M/ |1 D* f& Q; v2 XThis trick is very efficient:5 f( j) K# Q! M
by checking the Debug Registers, you can detect if SoftICE is loaded" p/ A1 s* m9 t3 h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) w" C6 F4 {3 t9 pthere are some memory breakpoints set (dr0 to dr3) simply by reading their7 g; D" C( ]. t% b: a
value (in ring0 only). Values can be manipulated and or changed as well F/ N" [0 X5 S, I4 D( ^; U
(clearing BPMs for instance); ^& a0 d1 \+ x. `# Q' ^+ L. U
* ~/ K0 [ \5 F E* _# A__________________________________________________________________________
5 D I$ K+ `# |% P3 V) _- n* V" d9 |* y# _# T8 ?
Method 11
% k0 r4 a8 D% x d========= [: o6 ~" t D& g1 g4 s% ^
- j3 q2 l6 O3 x( S
This method is most known as 'MeltICE' because it has been freely distributed' ^) r/ O7 v/ x9 {/ o) J1 ]# e
via www.winfiles.com. However it was first used by NuMega people to allow2 n3 v9 S. S2 b% l+ t
Symbol Loader to check if SoftICE was active or not (the code is located
* {% P7 A! N' E! h" L2 tinside nmtrans.dll).
- q! J6 L+ i, y( {: ~. B
+ h7 b! Z5 i: k: `1 I% H; R: `The way it works is very simple:
O( [" I: P! T7 ^8 R& K1 ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for2 E" }1 ~+ w8 X" A$ B
WinNT) with the CreateFileA API.) q2 [' U7 l. M5 ?5 Z) }' m }1 k
; K9 }8 n N1 t6 F% x1 z
Here is a sample (checking for 'SICE'):
, z' D4 |9 {$ h$ g* P3 q$ Q
9 O4 b2 H% e6 E. V+ a# ? C7 Y+ F" GBOOL IsSoftIce95Loaded(), a+ e# ~: R& U; C
{
9 J4 G, v1 x2 U HANDLE hFile; ! V( w/ a7 e; A& C
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 n0 D9 ^, k) Z7 R$ ` FILE_SHARE_READ | FILE_SHARE_WRITE,/ K+ S V8 r T/ o
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 t- R1 A' N% m' N if( hFile != INVALID_HANDLE_VALUE )
! H+ Q. B/ ]; y! ^: | {+ { Z6 k I) A8 S" V# E' F
CloseHandle(hFile);1 I" P( g' V( P" F' g
return TRUE;
3 L' q" d" ?& ]3 _% | }
& }$ V0 e5 Q' o9 E0 R return FALSE;
) d% Z7 T. F8 N0 x}
9 l; C1 s4 G9 w# \( \. C5 q+ i9 Y0 d
Although this trick calls the CreateFileA function, don't even expect to be/ q1 Q; ~. a& G. ~
able to intercept it by installing a IFS hook: it will not work, no way!) j5 ^% a' k0 {/ Z" V- h: n
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 Z' y8 u8 X( V ^/ L( Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function): ^1 h" U$ ^8 n, V3 }* g" M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
- `/ o4 `9 \# D p; V1 o/ Vfield.
6 W7 x: x5 v& p( R. C7 q$ uIn fact, its purpose is not to load/unload VxDs but only to send a 9 a6 W0 |. I4 W9 ~2 ?* G* K3 N6 f
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). I1 d2 q" }$ a( N1 z% A6 Z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
: o2 e C0 c. |: S5 ^5 ^to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 ^9 G" h0 s% [4 f- cIf the VxD is loaded, it will always clear eax and the Carry flag to allow6 y% E0 B; v4 x7 f2 q7 O
its handle to be opened and then, will be detected.. O3 z* n( [7 W* w
You can check that simply by hooking Winice.exe control proc entry point/ [0 a: [& g0 \% t, |1 ?
while running MeltICE." @9 k& v2 @1 G( G# Y/ E
3 p# i5 M. a% i# R: Z* N, A
$ D. x% y; U2 _9 V& c2 c# Y 00401067: push 00402025 ; \\.\SICE
: P; L* ^, Y5 \, \ v) a2 W 0040106C: call CreateFileA
7 Q5 ]# J9 P$ o- Q1 G4 c 00401071: cmp eax,-001- ~4 K% ^( n7 R% ?
00401074: je 004010916 g* N# u: v( b: A
: u9 N) q, k2 P* M2 P# l5 ^( g) }0 f- b- f
' t7 g& i5 ?; ]6 `% F. F
There could be hundreds of BPX you could use to detect this trick.9 e$ I4 {' e, f O! E
-The most classical one is:7 m2 Z! ?" o/ c A, q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
8 c# y# b! c+ k, q *(esp->4+4)=='NTIC'
; t$ P9 C/ C$ I7 V& S' \5 a
* h/ S' l4 K# ~ w; F8 S3 |( g5 v-The most exotic ones (could be very slooooow :-(8 Y7 ^1 x w8 F r& X6 W$ t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 @: _: Q# p f) C8 Z
;will break 3 times :-(
2 g3 k2 U1 ^. t) P# J. Q7 f! u o4 \8 D3 z3 c! _
-or (a bit) faster: 6 q8 W8 R% Y# W% F7 q% n
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 g# Z4 g" q9 V" w! A! _; @
2 K: i7 h/ C0 n# T4 Q$ S; L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 R9 w. }7 }: j7 ]7 v
;will break 3 times :-(! g% z2 a+ [' j6 q2 S% V
0 ]5 E: S1 U4 f: X1 `
-Much faster:
* m4 ?; ~6 E4 |. x6 E+ I, M2 x. w7 G& W8 J BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'# L0 q; `% [1 E s
+ W0 M" e* m0 D5 h! a W
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
* h6 a* c. G8 A" ^6 @" W* Q, o5 zfunction to do the same job:
% w( L1 F$ N7 K' T) c R8 p/ a8 S: m
push 00 ; OF_READ8 }) U1 G5 w3 s
mov eax,[00656634] ; '\\.\SICE',0$ y b! A0 H( b& R, A% Y1 s
push eax2 z$ g) k3 b4 \
call KERNEL32!_lopen: o/ ?& h5 q& L! {2 p& I% b) H
inc eax! Y, ]2 e/ L. o% p5 o9 E& Q( e
jnz 00650589 ; detected+ f4 H& U& I% [5 J9 i/ i1 q. W
push 00 ; OF_READ
8 M4 A3 o$ N: I. L, K mov eax,[00656638] ; '\\.\SICE'
1 Q% o2 U7 f2 _& H: B2 J push eax
( c. c) ` i8 T! N/ _& k! U call KERNEL32!_lopen# l! }% _7 i) b) u
inc eax# f, O0 q" u* i% x
jz 006505ae ; not detected
! @* o/ R, N E, q0 E1 }' [2 ~1 M0 T' T0 W. u6 l! u8 T9 P
0 r# o: l* U$ r1 ^# _
__________________________________________________________________________; [ |$ k; t/ G# U3 q# M8 _, F, @" x
+ t6 V0 R3 z8 p* O1 a# \
Method 12
Z$ J' Z: u& J: Z=========
+ K1 b6 u4 F1 l2 v7 ?. |( u* v6 u% i4 d2 M5 q) [' L
This trick is similar to int41h/4fh Debugger installation check (code 05
2 w4 V8 [, t* }$ y& 06) but very limited because it's only available for Win95/98 (not NT)0 |& P: J$ |8 W3 s, B0 o. M, N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 Z% f$ v/ @- Q, G8 V2 x+ k, U
6 n) a1 w, d+ h; \7 C9 X1 F0 V- d9 Z, e push 0000004fh ; function 4fh
5 Z' e# @! |6 I% l! E" g7 c1 E push 002a002ah ; high word specifies which VxD (VWIN32)
: Y7 z- m$ U& V; [7 I: { ; low word specifies which service7 s8 D! F! L5 e3 e Y/ H
(VWIN32_Int41Dispatch)8 @/ Y5 A1 B3 _( ]! ]
call Kernel32!ORD_001 ; VxdCall
! T) X, I8 u/ w: P' k% }- G# k, r cmp ax, 0f386h ; magic number returned by system debuggers O3 Q; Z* B/ h% n. a# _) A
jz SoftICE_detected
6 q; L1 {- \0 p6 b$ v8 t
6 M# ]4 R) B* F2 u$ y$ y. |7 @# UHere again, several ways to detect it:7 s% e8 @' m6 b: y" {
* l" Y; Z! ~" `/ u6 Y2 }, X BPINT 41 if ax==4f
; i( p6 F) N3 X7 Z& U; O5 }; D- f( y$ d' W8 {8 P6 F" |$ H
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 o4 Y; r% Z _ `: g$ S
4 N* V8 n, ~1 |6 N7 \ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( K# p/ Z# W6 N" j. |! \0 C
) z. s4 `) b. Z6 \( C2 t7 r BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# L# B, w- _* u$ P- A: B
3 G: @9 O; x2 G: [/ E; R+ @+ Z1 Z__________________________________________________________________________& q6 ?$ Q t+ G9 {9 i: y# x* U
- ?: t, D7 |$ V9 }4 V& b y
Method 13
( o# B7 N" v/ o6 H/ }=========
+ U" z, e/ X. N) g5 ~( Q, V5 }
Not a real method of detection, but a good way to know if SoftICE is
7 T+ \/ j+ s6 X9 W# Y9 w D4 \installed on a computer and to locate its installation directory./ ?+ D- M) |5 L* x, P
It is used by few softs which access the following registry keys (usually #2) :
8 p* R- r- @9 ]# l( h
a0 p8 j, G- u# A( i$ R-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; o3 N# S( K4 r0 v& A! o2 t
\Uninstall\SoftICE7 Y" W4 ^( Y2 j! r+ ]- p8 M8 w5 X3 q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
2 f, k/ q* Y! L-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion* ?: f$ l2 D4 K+ c8 g4 L
\App Paths\Loader32.Exe7 A: A; v4 ~1 l) |
8 @- m2 m% ^2 s$ |" O" |
& s: W% g ^4 @. ~" ?# c- O1 ~Note that some nasty apps could then erase all files from SoftICE directory
3 e& M- t9 T x, g(I faced that once :-(4 t6 J# m( y$ j. g8 H
/ I2 E; t! h2 Z1 l+ ]0 A3 MUseful breakpoint to detect it:
1 B H/ g" Q Z: T d$ d4 E
4 e# f1 ^" L2 | BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'# `# f: ^7 J/ i
$ {1 Y7 U+ X$ w; @* r( Q# H& ~4 R
__________________________________________________________________________, i* N: f7 L! k0 e
1 p: a/ a: ~3 V& H. ?- P# q
6 W0 J) d4 G J8 P2 w- Y- UMethod 14 2 R; }7 w* X4 X; V$ e4 G% v2 y3 \/ ]5 @
=========
9 v* `& \5 u" u U. a
/ f7 k1 p. Q5 p: t6 d) YA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
7 k& ^( ~( K0 c( R" C; p) {is to determines whether a debugger is running on your system (ring0 only).4 ?. {. v; y1 P/ U1 Y) D
# R( m: v7 o8 u Z# C) [
VMMCall Test_Debug_Installed
: h' R+ m9 V: y5 H' Z/ M je not_installed
$ k. G0 Q2 E& T6 P# [. @( U& |$ G* X* I# R' A
This service just checks a flag.! w8 v/ l8 c8 r F
</PRE></TD></TR></TBODY></TABLE> |