<TABLE width=500>
. ^( r. i' k' _; J: s<TBODY>
& C/ l0 b9 b5 {- A: s<TR>+ N* ?7 n2 \7 X+ T) a
<TD><PRE>Method 01 + n. X/ Q- @! }' ]; W* a" N( T
=========
; d2 ^ u6 Q0 R' t% X3 R/ X( H: w
- Y3 O9 m& I) iThis method of detection of SoftICE (as well as the following one) is
5 \" B2 p$ g) p# F8 xused by the majority of packers/encryptors found on Internet.
# G7 H" U, N, n; F! `3 \It seeks the signature of BoundsChecker in SoftICE4 G D* o& ~0 S% t
) f8 T; J# Z$ U4 e0 i
mov ebp, 04243484Bh ; 'BCHK'
7 g& T3 n( r7 F9 b mov ax, 04h
m) p% J& r( z; P; j" g int 3
5 u* O: d# f- y/ c. _ cmp al,4% [% {* y4 z- b) r
jnz SoftICE_Detected
0 Z1 c" ]; G& V) z
( ]8 Z1 Q; l9 o& B___________________________________________________________________________& D" ?# d2 q8 o8 M2 F5 l/ R A( x
8 I: a! B7 q4 N4 X6 K) z& SMethod 02
/ N6 I7 _( G& |+ U- q=========: j2 M3 O* `& h7 D, @
9 b3 e, T0 j9 w2 d5 fStill a method very much used (perhaps the most frequent one). It is used4 T8 J/ u5 T' \4 [. P
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ P: T8 D" F) ?* F% q. c% C, S
or execute SoftICE commands...
& A5 m$ x3 W$ N5 x! i7 dIt is also used to crash SoftICE and to force it to execute any commands
5 ~8 O% N0 {" P- C6 v(HBOOT...) :-((
+ Y( N1 a" R0 U0 k2 W. |
0 H' M$ z$ z/ e" {- ~7 AHere is a quick description:' h" N" v- N/ S4 v/ U* j
-AX = 0910h (Display string in SIce windows)
( T$ }" ^8 x/ W; M9 |: F, t-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
P; ~. ~- }4 Z/ I h: P: u9 X) p-AX = 0912h (Get breakpoint infos)
* a7 q: T& T" h-AX = 0913h (Set Sice breakpoints)
6 o5 U9 K6 J8 \. `-AX = 0914h (Remove SIce breakoints), V# A6 T9 U* ?/ A
3 ~( j( r( f# \- |3 H9 I! |Each time you'll meet this trick, you'll see:
: L u# T" Z. n4 H) B-SI = 4647h; H4 x1 J9 L3 }# ?9 @2 N+ R
-DI = 4A4Dh
9 `3 c) d k. i6 [Which are the 'magic values' used by SoftIce.
/ A4 i- `9 r1 m* ], g9 n5 S1 [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.! m X2 _9 b* d$ h1 r4 G3 g
+ P3 B5 g& S E6 `1 ^- Y
Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 d! F5 k7 j/ L/ hEnvelope utility use to protect DOS applications:
# D: L. M! Q i& x/ o) ~* B3 ?3 [
; k7 M8 W7 r7 F8 A* E
" z. q1 [' n- Z% I& m% j5 Z4C19:0095 MOV AX,0911 ; execute command.
& I8 [ q4 D" d. v: T4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).2 @" b N/ F! J) u6 o
4C19:009A MOV SI,4647 ; 1st magic value.3 N. L& n* |# I9 \4 @
4C19:009D MOV DI,4A4D ; 2nd magic value.# h$ B/ E: o, w) P) @: A- n2 J
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% U4 s8 \; F" b3 N; y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
3 s! I3 ~. z9 M) @( _4 ~4C19:00A4 INC CX
, d; O" Z0 s4 q; o& ~$ ^" O4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 }- i7 j7 A$ y9 w
4C19:00A8 JB 0095 ; 6 different commands.
$ s I. w3 s, s5 L" U$ h# Y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
; v7 O. I& T9 k. q3 B; d4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ k' o# q) T9 r4 i6 z( Q
% P4 g$ u" @6 B" n5 K7 H* NThe program will execute 6 different SIce commands located at ds:dx, which/ v) d! G! C0 X5 X
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 B9 b4 \3 q5 F& h
9 Z8 W" T6 w* V( J, {5 \' x( H9 o* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- R* r; O8 j0 w; j1 N
___________________________________________________________________________
- C, f ?* }) F* l% h+ D2 a: _3 O; W
( _! J& U' u/ F+ ]! |
Method 038 d4 g0 d: N% A U
=========
0 j i6 x6 h+ e6 B& ^) L7 `4 B7 N% S) l/ h( Z( U
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 f! R9 t% D% }3 }# R: g) a; e
(API Get entry point)
: ? _ ~6 m! w! t k1 D+ M X( W
( x! s0 m* T: S3 Q$ V5 m1 P x: Z+ ~. }
xor di,di
- F3 |$ r7 A7 E' J mov es,di
8 }+ t- e3 Z# c* ~ mov ax, 1684h
4 f: v6 y$ B; p" s, R* ]4 |1 D mov bx, 0202h ; VxD ID of winice: N k8 d% y; Q7 o
int 2Fh
( f8 z. U S) c" H9 d mov ax, es ; ES:DI -> VxD API entry point
% e0 ^7 k9 P: t0 p! }# M add ax, di
$ ]/ E8 r; P: j# p1 ^6 w test ax,ax
+ H7 b- I9 V' z4 d% W" c9 i _ jnz SoftICE_Detected
! F) J3 W9 q0 O/ ~( T
" x$ |# G# m* w. b___________________________________________________________________________
8 l! \! u. a" C8 x/ Q
2 f' e4 q `1 ~# ?$ w& _0 w; MMethod 04
6 S. Y& G2 y" A=========! S" y# N4 i, v4 T
) k# V# H7 y1 f, _0 D' nMethod identical to the preceding one except that it seeks the ID of SoftICE
9 P% s$ ^8 T6 M" U5 C9 l7 j. AGFX VxD.* y. J& m2 L/ O& b$ |
$ M e. C7 P% h xor di,di Q l0 j& J6 v
mov es,di
# Y7 u2 m+ e/ m! x mov ax, 1684h 0 C9 s7 h3 W: z$ b) S0 D
mov bx, 7a5Fh ; VxD ID of SIWVID
# k, E' B. ^" F5 e# J int 2fh
5 z( @' K) a G mov ax, es ; ES:DI -> VxD API entry point( R# J7 n2 v) ~ I4 m. y
add ax, di
, U5 a5 H" }: z1 W& V test ax,ax
, Z" ^5 ~; J& w& o- F jnz SoftICE_Detected1 t! O0 q$ G7 ~" g
f& d& k8 U0 t7 L( H! f
__________________________________________________________________________
( I& @0 A- Y: @" J5 t* N
0 P- @ q% ^0 V/ q
- o) O4 H+ i, Q& P5 O, NMethod 05
% e9 i( E- i {: i- A! o=========5 X% }- P- F& C# W: x1 a1 J/ ~
0 k v* `. e* R \# {& n5 Q1 l
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 N* ~- e0 r- _; z0 H
debugger. It calls the int 41h, function 4Fh.% ^8 c; N! F9 @. |3 O; S0 X5 j
There are several alternatives. 7 v0 ^# E/ L2 j. ?$ w L
) D( C" Z" r5 d: @( ^$ H$ S
The following one is the simplest:
+ O: c- u: _) V! }6 u4 _
0 ? [* j+ s+ b- C$ J/ n mov ax,4fh# P3 Y% R" H3 F& j9 u/ X3 A+ f/ m; s# w
int 41h; p* h! I8 o7 H: k4 Y( d
cmp ax, 0F386- o" p6 h( |, |$ o4 Z* U! X/ k
jz SoftICE_detected9 k. q. h* ^8 ^4 R+ b! `' g
! [( P, i3 f9 t2 [, M! s& r$ Y b
. J7 F. k. z/ b- V) ?Next method as well as the following one are 2 examples from Stone's 8 y: Y# C5 W2 [$ ~- v
"stn-wid.zip" (www.cracking.net):7 b' g% Y. h, B! `( K
: C+ [3 p# g( n+ J. G6 J; e. H
mov bx, cs
' x8 t4 K- ^. z# y4 u8 o lea dx, int41handler2
_4 `& ~7 M5 _5 Z4 y, i; a xchg dx, es:[41h*4]
7 d6 W+ ]5 G" k7 u xchg bx, es:[41h*4+2]* ~* {5 q: F0 N* }9 d9 O
mov ax,4fh
+ U" `+ ]7 r, d) B3 ~' C! q ]. l( x int 41h
) b/ F- Z5 A, x0 z3 ]5 L9 H9 _+ t { xchg dx, es:[41h*4]- B# d. X4 B, P! z/ R; D
xchg bx, es:[41h*4+2]6 Z1 D* B& ~! w# l7 a2 n x
cmp ax, 0f386h
5 [" b/ s! l" o$ C& m) a* n jz SoftICE_detected
* K+ q. d+ M, a5 c4 e; q+ [
$ C1 X8 f/ [$ [" z' r+ z! Z% ~ `int41handler2 PROC
/ n) n: j$ J6 y" J& i" F5 X iret
4 R/ s7 {8 n- ~4 Z8 t+ Kint41handler2 ENDP
( z" _( [ i# y' b# R4 F# Q& H4 H$ ~
) J1 N# ]6 T+ r' a% H_________________________________________________________________________
6 k# J0 k& Z% u) O0 }8 @( |0 [' b6 L
, e i5 u" u% Q# f5 m. e/ a2 G. p8 a( L1 `5 Q3 n
Method 06! T4 |+ h2 d/ i
=========0 ^; C* l7 ]2 O0 w! ~
, w2 h4 Z/ K: C5 A: Y/ X6 [' n3 X
# Q T" P( {' O6 @) d" T8 q2 d" q1 |2nd method similar to the preceding one but more difficult to detect:
/ h& o) c2 P, X: x1 x6 [
( m' p7 c5 O# u1 Y9 L! L# I5 Q& C% z( S, x: P
int41handler PROC5 t8 p2 w7 h7 V2 {( @2 q
mov cl,al
& E% Z: `" }/ L2 ]7 q iret
- t; T( ]- _# Wint41handler ENDP
% L, }4 z/ i( K5 q5 g5 @
$ ]" Y' [9 _, @& S. Z6 p. K- l
) J& M2 |1 C2 v& L4 S! h/ ^ xor ax,ax
* D- i& y/ n7 {# W N mov es,ax
" L7 z- o0 f$ B" z2 x mov bx, cs' f4 u/ v7 X5 \% z- }
lea dx, int41handler
6 {3 {$ G6 R; B3 ^8 P9 P& R xchg dx, es:[41h*4]
6 [* L; s; x: X1 q; c7 ?; ~* w xchg bx, es:[41h*4+2]! M: G7 U+ V; J4 T# @# t7 K
in al, 40h
; y& \8 h1 s- m" I% h `8 s xor cx,cx2 E9 d* |$ m e7 F h. h0 N
int 41h+ \ X5 V0 a! m! W( e
xchg dx, es:[41h*4]7 O' d) @5 Y5 A+ x! A
xchg bx, es:[41h*4+2]
) Y& W: {6 x1 Z+ r1 b/ p4 C cmp cl,al
5 X& x1 J# ?- c( Y' v jnz SoftICE_detected- N; n; I0 {/ N- @, J( J
5 ], Z- h; q, [" p( T: ^4 C_________________________________________________________________________& u3 x5 Z! W* N! i) D
- _6 Q) g% }& b( U" ~Method 074 g8 H% e6 z& y2 q( z G d3 I
=========
# x4 I" ?! m- a; g, R! G
; N2 b) s- C0 [1 S5 x, mMethod of detection of the WinICE handler in the int68h (V86)# v( O+ L4 F( L
7 x9 K/ e, V5 M/ A1 [
mov ah,43h' g2 Y* g* ^" K/ ~. ^
int 68h
: d' X( O+ g( b1 z2 \' |4 m cmp ax,0F386h
" |/ ]( k" k; w, |+ s- P jz SoftICE_Detected ~$ d8 ?' R* @6 b! S2 d
4 @7 l. C* R$ i3 k+ r9 x
/ m2 N- ^. C$ L1 m=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; \& Z* A+ \6 i
app like this:% P: I: x/ ?' n$ t3 I
% L, \* o6 S& R5 q/ c) ]7 W2 s
BPX exec_int if ax==68; V$ n# F1 K v: s
(function called is located at byte ptr [ebp+1Dh] and client eip is
: Z* U! q2 k* V7 U5 f located at [ebp+48h] for 32Bit apps)) J7 t8 ^- ~- P- }7 T
__________________________________________________________________________
0 |) ~% i8 Q8 q7 }7 Q# x1 b- |7 e B I; C
& F9 }- c7 C2 V; W$ N+ E" h
Method 08
+ b3 m: `1 g! Q=========
: S+ u8 ] U! D% m
' d6 q2 p( F6 m, VIt is not a method of detection of SoftICE but a possibility to crash the
$ w" ^2 C+ I/ i/ c! O$ A3 usystem by intercepting int 01h and int 03h and redirecting them to another, {3 I. b+ A3 D7 s6 S5 b: b
routine.
& T: k W- v4 W3 [( x3 V' kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; D7 m: @8 N. j- z( T6 n' n: sto the new routine to execute (hangs computer...)7 L- Q7 I( L1 D1 e2 p5 g$ Z
; L: z# g7 G- J/ r mov ah, 25h
& \" }: T$ L& M3 q mov al, Int_Number (01h or 03h)( n' t- b3 r, j7 E: B! U9 t( Q
mov dx, offset New_Int_Routine+ Q6 }7 D. k; h: H3 W' @: i
int 21h' t' F* z/ p: ]9 w* l' G
5 j& N: N" [$ U" k' K__________________________________________________________________________
6 Q. i4 W! S; g3 e8 F, o8 x( F: E- \/ p- U" b- i2 P
Method 09
( H2 u: }4 K9 \0 z=========: a% W6 {& N. L
" g7 }- \) d' D
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ ~! p r2 J7 i6 nperformed in ring0 (VxD or a ring3 app using the VxdCall).
# K" ?+ j6 l2 a, v% [* o6 u) ?5 OThe Get_DDB service is used to determine whether or not a VxD is installed
. i9 P; P8 L9 i! G! k% {! I$ l$ ]for the specified device and returns a Device Description Block (in ecx) for
0 v5 J1 {+ l! U. v& k8 Jthat device if it is installed.4 T4 A& [1 w. `! `4 |
' ]. N. }5 F L* I/ r) Z' t
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 _% C# Q3 b) d+ \' w1 ] mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& L2 _8 z" j: U o- s, y+ D7 ?2 B W# q
VMMCall Get_DDB1 y N3 f9 i) f" [" R3 p0 F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 f" g/ q1 {; D: N0 _ U2 O2 k
2 a: s( C8 w: g; X1 S8 B' ^+ lNote as well that you can easily detect this method with SoftICE:8 p! @; l s( f! P5 G) S
bpx Get_DDB if ax==0202 || ax==7a5fh
' {3 u# ]0 p/ }( |- ]# e1 e2 D* l+ U! |; I
__________________________________________________________________________
: |, ~- s( e, ]& I3 G! c3 i" N6 e# o
Method 10
) a+ a# U1 l/ S=========
) ^9 q; Y8 J* V/ [ m0 [9 z- x; _" m- G; n. b N' m& Z" _ W) q
=>Disable or clear breakpoints before using this feature. DO NOT trace with0 m6 j Q4 g9 A
SoftICE while the option is enable!!8 t4 l7 Y/ \. d) V' U' p2 w
( d& d9 k" o p, ]2 b+ p
This trick is very efficient:. P) p8 t9 c) l- G Z9 x6 R% T
by checking the Debug Registers, you can detect if SoftICE is loaded
: ]5 \- K: i% l3 h' d. `7 g$ q5 X) e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
i8 u! L5 K1 I! E1 vthere are some memory breakpoints set (dr0 to dr3) simply by reading their" n3 ^ s4 @+ \
value (in ring0 only). Values can be manipulated and or changed as well3 G$ L! ` O" e; [0 n! y7 T
(clearing BPMs for instance)
5 D9 j9 V( G) i; O+ Y/ D
9 A/ M: o( P1 [) t__________________________________________________________________________
: X b' T* c8 _& Y W( t$ F
8 ~- ^& H; Q' H& v: E: fMethod 11
; w7 J: j% s4 a! A& d=========8 S- H/ [% b0 H- i7 R) c: m! _
$ t5 |/ d5 `7 x# Q/ d$ j
This method is most known as 'MeltICE' because it has been freely distributed
+ `0 }/ m; ~. Ovia www.winfiles.com. However it was first used by NuMega people to allow" k! S* m7 Y! o
Symbol Loader to check if SoftICE was active or not (the code is located5 v- }$ Z# y# o- N7 D; ? `$ e
inside nmtrans.dll).9 C( U, C$ f% Y$ j
! u' G, Q9 \- t2 F0 T0 v( QThe way it works is very simple:
8 n1 H1 x" h! z( O0 w: C* NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
/ S' P7 ? e6 v, B/ ]6 N$ {. rWinNT) with the CreateFileA API.( o& c7 j# a5 {0 D7 Y! K/ _6 c7 A
9 w% ?+ N% O6 o, @
Here is a sample (checking for 'SICE'):' m1 e2 y2 f1 o* Y% Z
7 |, H+ ~. G7 \6 {& C; O5 @BOOL IsSoftIce95Loaded()& V' ?1 v0 |! V/ |3 Z5 F) {
{
( o7 {6 [8 c) q6 w; W$ [ HANDLE hFile; 5 ^1 L" F9 y0 {8 d/ p! h6 M P
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. ^3 X" P9 p: ]- F* b8 `2 g
FILE_SHARE_READ | FILE_SHARE_WRITE,8 L6 c+ O' n J: e, Z; t4 f
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);( }0 A* u: B+ J& S- Y( H" ~
if( hFile != INVALID_HANDLE_VALUE )3 d! r1 l s) S6 O, V
{
+ P- b1 L$ K# Q. d CloseHandle(hFile);7 T# G! r! T8 B$ s7 T
return TRUE;! I" V% G9 J1 b. W# e5 E7 t
}
" f! A6 V4 m; x# o* K4 }5 q return FALSE;( m+ v7 W3 L; @: M( G
}. t" S' C: D$ g( Z R! Z+ I
7 T4 H& F' Y* m$ L1 f
Although this trick calls the CreateFileA function, don't even expect to be
9 b# u4 d. V" u& _0 fable to intercept it by installing a IFS hook: it will not work, no way!
3 i/ W- W/ b0 L. m% n! A& e% RIn fact, after the call to CreateFileA it will get through VWIN32 0x001F+ n6 U/ Z# u0 B h# p+ `
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- @! S+ N1 c( O( H; A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
' [8 c! W9 p! b5 B! Q4 sfield.1 y/ n7 ~; P4 N# {
In fact, its purpose is not to load/unload VxDs but only to send a ! C' D" A0 p& `; E4 j& z- i( G+ ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 ^9 c! a2 |, _* e+ m dto the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 J4 y) J0 u* T D6 Ito load/unload a non-dynamically loadable driver such as SoftICE ;-)., {: [# c1 L" X2 D
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. `6 J X E8 N8 [its handle to be opened and then, will be detected.
5 k. S* }! L" HYou can check that simply by hooking Winice.exe control proc entry point
$ b; G' H I6 A* W2 _. X1 nwhile running MeltICE.7 W' `, N6 F- g0 d0 x
. m0 Q. I8 A X+ h/ n
/ _) H g, h/ o) Q& g2 G( l8 K: F
00401067: push 00402025 ; \\.\SICE
& Z0 S$ {2 \+ f& T) V+ k 0040106C: call CreateFileA9 t3 V% H/ M7 F. P3 i. f8 e- b
00401071: cmp eax,-001/ d8 q9 q& E; ~& e" e( @+ @
00401074: je 00401091/ w8 _* U( b. `8 p/ y" S
) \9 a# g/ t: F2 U" K( v' s% f4 c4 e2 H6 Y8 \
There could be hundreds of BPX you could use to detect this trick.
( O7 T6 r. _0 F-The most classical one is:
* r% f9 K/ t8 r' v7 t. a BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 [6 h7 Z, n J' ~
*(esp->4+4)=='NTIC'4 {" b0 ^: r* m! A
4 u6 J4 E% O% k3 K/ G, `-The most exotic ones (could be very slooooow :-(
4 C; m* A! H, m6 {/ }, o1 A BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, e0 w- c' ~ h: D. R9 W2 v ;will break 3 times :-(
' \2 T4 P: W- g
+ b% M1 ~+ L, G E; i x-or (a bit) faster:
, Z5 h* s- f6 E2 W2 s# a( H BPINT 30 if (*edi=='SICE' || *edi=='SIWV')3 N6 O) y9 B1 B
) P5 k+ c% D8 t5 p! H m0 g BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
8 T7 ?0 @( L/ ^ ;will break 3 times :-(
5 ?- G9 A( J" S/ c& n
! t6 T2 J6 W& V( m9 ]-Much faster:
( O" n1 z, l _( P& z+ L BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'$ X( H: x g4 o& `' R
0 t8 n: m U! T% l2 P ~9 p" VNote also that some programs (like AZPR3.00) use de old 16-bit _lopen. }9 q4 t/ Q2 b" ^
function to do the same job:, b, I; w. i8 N" H
' B) ?4 N" i. a2 U# J' S, ?0 E# v push 00 ; OF_READ( O, b, C, `/ h
mov eax,[00656634] ; '\\.\SICE',0" |: l+ t0 H6 n3 _5 z+ C
push eax5 T, L- R! [ X* A: L" x
call KERNEL32!_lopen6 C8 U- n1 R& F# |: Z
inc eax2 s0 R6 B o/ T# ^6 I# \, }: {0 B g0 x
jnz 00650589 ; detected& u! A( L% d* {9 }
push 00 ; OF_READ
4 a) L' P ?" V9 b mov eax,[00656638] ; '\\.\SICE'0 y6 q1 i1 |, l! i0 m3 K
push eax
# g. m C& Y1 v2 s+ h call KERNEL32!_lopen& H$ S0 z ]: Y& `" N
inc eax9 G, f, P0 T7 k; P `
jz 006505ae ; not detected* b; p/ Z- H# I0 a# o
7 f# C5 L8 q* ?& C) u9 W) d8 e2 ~
( ^- U- Y) k, y& V! t/ Z& q2 k
__________________________________________________________________________
6 Z, J. b* O$ E( N( V, D% h6 q; ]7 _. c$ ]3 ~! j" T4 z
Method 12
3 b) ^2 M7 w9 m=========. }" ?2 c& c. |2 S+ v
D; l' v: s$ |0 {! M
This trick is similar to int41h/4fh Debugger installation check (code 05
Q! ~& }5 O) `4 n/ m& 06) but very limited because it's only available for Win95/98 (not NT)
5 Z7 `) B- u6 F0 V( q& pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# z* U% \+ _% I* T. C7 b9 S. g) V5 a0 V8 k
push 0000004fh ; function 4fh& L% E& a Z, s0 P
push 002a002ah ; high word specifies which VxD (VWIN32)8 [) T! |' V/ O6 s% g& [( [3 ^. i
; low word specifies which service( z( V$ Z: h# _, ], P3 v& J$ R* s
(VWIN32_Int41Dispatch)
t) J; F' Q2 }9 H3 o4 n% G call Kernel32!ORD_001 ; VxdCall
6 p+ E. m+ d/ ?. }& n cmp ax, 0f386h ; magic number returned by system debuggers% u2 |& H+ D- i
jz SoftICE_detected
8 G2 o S, ~5 o& u9 g+ h4 `1 ^) O5 N2 U/ u4 v6 q. t' o( K
Here again, several ways to detect it:: R3 t6 k9 U) `3 A+ x. p
1 Z8 R Q2 y x* H BPINT 41 if ax==4f; d% U5 x4 m( y ?& G' F
4 i- j7 T/ c" y3 d% p9 y- T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 _ E: y! ]$ N# J' K, J
2 P& j+ S" g; ]3 o1 x: S BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 U+ M7 m' C0 e* E6 w Q6 z1 f% x, h
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! Z6 h1 I7 s/ r1 b
; \9 ]( J- o3 s1 V0 n: J__________________________________________________________________________
6 k* C$ M9 q7 H. h( A% K9 k9 ^! i; N6 s7 Q1 B. N) |
Method 13( P# J! W2 `+ i6 y' F
=========
c- n( x* v3 Z4 H# q, z: q7 E) {% q. W, g1 w& m: |
Not a real method of detection, but a good way to know if SoftICE is
1 t% ~* G) f! ninstalled on a computer and to locate its installation directory., j: {" u G. Z" v7 v5 p
It is used by few softs which access the following registry keys (usually #2) :
% T7 ~- b" C( I- U- T3 F8 `) A$ \: c3 X& M5 o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ R8 s* v7 y( U: q/ v
\Uninstall\SoftICE
1 U2 r: z7 _: p-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ W, a; |' J, N ~. P4 p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
l5 L. a& c! Q: j- ~0 {1 R\App Paths\Loader32.Exe! l' M6 C7 A" s% {: {
! Q9 W9 s# T# M
) q3 J1 D# n) B0 Y; q" z9 f bNote that some nasty apps could then erase all files from SoftICE directory
+ \& U4 N" t5 J5 u(I faced that once :-(
; C7 A+ ~; ?, i
" ?; {7 ~) I5 uUseful breakpoint to detect it:* [" X/ d7 B- @5 q) e% n
$ {4 v- ^0 X* x: M2 k& y
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. x5 T J3 \& e/ c9 F0 }0 U2 C5 ^" H3 h) O+ B9 f M, Z4 a2 I$ r9 C) Q" k( |
__________________________________________________________________________0 F4 G9 {* R9 a7 z! e. w- j0 a
3 y I/ y% T/ u* t, e- b3 p
! {) j4 r. C+ Q3 o
Method 14 4 t c# o$ N# u: p& E" P0 _: O8 L
=========
) i# s. ^ O, r3 ^1 H- S: m6 S5 E8 k9 B. V+ b; u. p8 c
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ Y3 |8 ]& _0 }# y
is to determines whether a debugger is running on your system (ring0 only).
s. {+ W9 n) \1 v$ i
: \4 C, \( l7 \) D VMMCall Test_Debug_Installed
* w: {5 \! R# Q je not_installed
$ ^; Z/ T5 k. G+ O+ Z$ E* S/ U9 Y- w* c
This service just checks a flag.
: y" U6 j# l% e q</PRE></TD></TR></TBODY></TABLE> |