<TABLE width=500>
+ V- v* ~2 b- a5 V( @<TBODY>
! b( D9 n* Q6 m q6 \<TR>- z X$ E$ G4 n! M u2 Z2 {" V# C
<TD><PRE>Method 01 + v5 ^* y$ l3 ^8 r! N5 E
=========
' a) ]% a, r. ^6 z2 g. Y5 @3 ^. l% H O; r: R; i
This method of detection of SoftICE (as well as the following one) is
) p7 |6 P0 _' Yused by the majority of packers/encryptors found on Internet., h, n0 e, [* Q
It seeks the signature of BoundsChecker in SoftICE$ a: q4 r2 m. v6 ]2 w$ C
; S8 |+ M. U3 j; k1 X' y' ?, T mov ebp, 04243484Bh ; 'BCHK'; I* M: U6 H+ \" g/ j9 a
mov ax, 04h! g- C) M N$ V' F" j4 T
int 3
, {+ y! d$ B8 E- ^, V! K cmp al,4
4 x' u, X' C+ @! Q jnz SoftICE_Detected, s- H8 z$ d; |( u6 ?; t
7 [. _% z' Z! D- o, D5 q
___________________________________________________________________________
8 l. l5 J! _& u# L. W% q6 { A2 \( F) X: I
Method 02
) |( f+ m. \ L=========2 l7 o/ @/ V8 q7 e
. x% W2 t, s7 T. V9 \: T
Still a method very much used (perhaps the most frequent one). It is used
" V/ m% Y$ a2 I$ J$ nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" j2 [' W0 a5 c; x1 @or execute SoftICE commands...: D# Z$ ?, @; {
It is also used to crash SoftICE and to force it to execute any commands1 z7 w* n9 |) ]# e# G3 l
(HBOOT...) :-((
$ ~, B0 i: n: p7 w5 R
% U9 n; [# Z K$ p% T! v. vHere is a quick description: w: ?, [" E. [0 c8 y2 J
-AX = 0910h (Display string in SIce windows)
, E3 o2 y5 U Z* z. i* Q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 s o1 g" n2 @! [. B% U6 F
-AX = 0912h (Get breakpoint infos)/ C% N! w& j! X+ R, @+ E# K8 x
-AX = 0913h (Set Sice breakpoints)+ @9 a0 Y; R$ Z9 j) W6 W" C
-AX = 0914h (Remove SIce breakoints)
: _9 y+ Q9 T3 Q# [5 r8 j
0 l) k+ M9 P' K1 |9 k V, F3 FEach time you'll meet this trick, you'll see:
' \# j) y0 u6 Q-SI = 4647h
9 T4 \; b+ _* K: }) M U5 d; Q4 x-DI = 4A4Dh
1 L; x+ B9 }$ @4 cWhich are the 'magic values' used by SoftIce.2 u3 ?+ N4 N. U: b/ Q( c' r
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
0 N3 y( ?, Y# Q; \
, x* @8 E, }4 b+ XHere is one example from the file "Haspinst.exe" which is the dongle HASP
% m6 a' L4 Q" G2 J4 B& T( g9 O8 y SEnvelope utility use to protect DOS applications:& m2 |- X) p) T
1 r# F% a) I: e; H1 g0 v
' x6 D# N5 S- B8 `4 ^4C19:0095 MOV AX,0911 ; execute command.! c* {( p' Z, z( A1 l1 d
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ N! U3 m6 G+ ^/ u% z, ` L/ ?4C19:009A MOV SI,4647 ; 1st magic value.
l7 D/ ~# f2 \7 }3 p4C19:009D MOV DI,4A4D ; 2nd magic value.
6 o( w, J+ X W, D) L% v/ Z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)" A* B/ d8 {9 j% @8 u
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute: o/ J N1 u: ]
4C19:00A4 INC CX- R0 h& D* t( b, A6 F
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' K, s3 l, E: K; [6 o. x' h
4C19:00A8 JB 0095 ; 6 different commands.
- R Z# }: D$ d8 ^% D3 F, `4C19:00AA JMP 0002 ; Bad_Guy jmp back.5 n2 f% C5 r2 ?7 p7 G
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
) k6 x0 i- m: d0 W" P! G" K/ g# K5 c# ^3 ^6 C% L
The program will execute 6 different SIce commands located at ds:dx, which; _: H3 t7 s! L! ]. P9 Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' V/ T- @) l, M. D1 q9 u/ y8 D$ Z
' n+ [1 w; m5 x6 g) W* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% h P; a3 V; L; ?' w: D6 P; z0 c0 p4 i
___________________________________________________________________________
' q6 e1 o% p9 ~6 r l0 ]; X; ?! O# g2 Z7 x
' ^% z( `. Z' s$ C7 L# c! r
Method 03
5 s C$ R) W G! t. n=========- Z E" M( f3 [; v7 j( D
q% S3 [' O$ `: q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) L7 K/ r p- a
(API Get entry point)
! Z2 H" o, H" l, a6 G + G: ]+ t9 A& `6 \: L" ^1 U( C5 D7 I
$ m$ x( M+ ` N: o6 q4 [, p8 U% _
xor di,di
# w' Z' h5 B$ b. Q+ s$ ^: [ mov es,di! O" N0 i, u: |7 S, ]# x- B- {
mov ax, 1684h
Q& w @* S. q, _; G2 D mov bx, 0202h ; VxD ID of winice
1 S% J& v+ I4 {9 {4 J int 2Fh
8 I* |" S, ~* J2 O1 W) a) J& p mov ax, es ; ES:DI -> VxD API entry point$ c* S9 U! q6 _5 ~- M
add ax, di U/ e- d) l1 Q8 F0 @+ K
test ax,ax. P2 C& s+ ^$ d, E! M2 {
jnz SoftICE_Detected0 i. e/ M2 O9 K1 V2 E
( o/ S6 s; G2 b7 H& R
___________________________________________________________________________
6 u" |- p. O2 J( F0 z# a6 Y8 T9 X9 b1 ]& W9 q$ I% H1 Z
Method 04
) ?2 `$ w( `1 F. P=========! ?. o, H; h: T# H* t- J, V$ x% F6 x
5 V; r$ o+ [$ }3 O
Method identical to the preceding one except that it seeks the ID of SoftICE
( W0 h; L6 w" R- r# Z" FGFX VxD.7 R9 V- M+ {3 H6 m( k
8 v5 J) | u$ p+ A0 `. W
xor di,di
; w/ w! l0 R8 @- Q/ [ mov es,di
. D8 L5 V6 {/ H3 H) z1 P# b mov ax, 1684h
9 s& O9 u; @$ r: M mov bx, 7a5Fh ; VxD ID of SIWVID/ c: g }0 I$ y' F5 V3 S$ R+ I
int 2fh2 d$ d3 D$ c/ e! x
mov ax, es ; ES:DI -> VxD API entry point8 t% q$ Y, Y. r1 ]6 m1 @2 h
add ax, di* |0 A& u6 {. ~
test ax,ax- A6 d, b ]# v/ f8 Q
jnz SoftICE_Detected
2 @8 ^" Q# |7 n" x6 ?
6 n2 d, b) H1 M' J$ r__________________________________________________________________________% t+ u- g9 f/ V u, s
( D) ^7 |- ^5 F
) W2 Q- i$ ^0 K3 w5 Y; D$ iMethod 05
+ O" e! g0 C: D5 G7 O' _8 v- T=========
1 M) }+ Q- R8 E" @/ v9 `9 F5 i: v) y6 m) O& T1 X. c9 q
Method seeking the 'magic number' 0F386h returned (in ax) by all system* X5 m$ Y1 k8 q8 A& O
debugger. It calls the int 41h, function 4Fh.
1 f; ]! q6 A. J; H7 h/ C( J3 kThere are several alternatives. : s4 Y( z$ k! V! C) L
" k% v5 [6 ~6 H, OThe following one is the simplest:
& ?5 _. r* n/ ~
8 E0 `# F& W; f" a mov ax,4fh
- R/ }. `, N1 r int 41h3 C9 J' k% \5 D7 m6 B
cmp ax, 0F3861 x5 i9 y8 d- c2 u3 }/ ~
jz SoftICE_detected
3 C8 F: e/ U+ N8 H) ]
7 f2 }6 l R0 q- H
C( M* }7 c5 ?& ~$ P! e$ n bNext method as well as the following one are 2 examples from Stone's ; z) e4 s* N2 h' M/ j* Z" w
"stn-wid.zip" (www.cracking.net):
) Q0 s9 d- |! c9 j1 ~1 E$ }" i0 \) c1 m& ?- a2 l) i: c7 n
mov bx, cs+ u1 I0 w/ P) K8 M
lea dx, int41handler2% J+ V. t0 q7 V; k$ G+ \1 ]
xchg dx, es:[41h*4]
% I% o7 r( q7 @) b9 L2 ]0 C xchg bx, es:[41h*4+2]
6 w: w) B/ d% X- {1 r* h0 I( Y; n mov ax,4fh
6 R. {/ U; a! C. }1 b int 41h3 [, x. k% E1 z. e9 b4 y" K# o
xchg dx, es:[41h*4]
( k5 t( i$ n1 ?; n2 u% r/ y8 O xchg bx, es:[41h*4+2]
+ E; Z: m) y$ ` cmp ax, 0f386h
* D3 r* g1 O( R3 r8 {9 n& f& V, v, O) u, } jz SoftICE_detected
0 T5 \3 b3 V9 j9 v1 ~- K- u% \+ ^% P/ e9 u: W8 E# M6 r2 x
int41handler2 PROC
; V5 d$ [$ m7 K/ g8 t+ F' ^. r iret0 X# L; q, y: f) ~
int41handler2 ENDP
8 v( h3 p& p% J' v3 v$ D; _
6 ~7 b; K9 Y: h9 \6 i+ H5 t
* O/ b0 U+ o# D% p f/ w_________________________________________________________________________4 F7 k, i; ~, n2 d; ^
! E4 _/ E) `0 ^+ m% s, w
& X3 `8 V* n8 r+ lMethod 06
# D7 r: B* n" Z5 C! @) n=========
8 U8 N e+ c! F& Z
7 {- k% J, n/ x, g
7 Y% v* @4 N4 O3 P% H8 m2nd method similar to the preceding one but more difficult to detect:- Y& M9 F/ G- s
5 B# ]: @7 F' g
9 ?" ^, H) R. b9 I7 Pint41handler PROC
; W) g; Z6 y S+ Z( n mov cl,al: K! t" J% [& B8 ?8 j; u
iret7 k0 ?' t9 d; ]2 J# E% n _
int41handler ENDP
( A* f1 ?0 _$ ?4 R. P$ v0 [! P
& f( s1 z9 ]6 f* w# P* f3 Z, z9 _; T" q' ]9 R5 n
xor ax,ax% M$ W$ t% E3 c* c2 A! |2 o: ]3 B
mov es,ax
6 g4 j! V/ H" V* Z$ m mov bx, cs1 C+ d; |" m+ P
lea dx, int41handler f4 K% c+ K) U% G( V+ d
xchg dx, es:[41h*4]+ m8 ?+ ^: ^. C" |! O1 i6 M. x7 f
xchg bx, es:[41h*4+2]* }/ ~' l. G4 h# W6 c' n
in al, 40h! \3 _% U* ]5 G
xor cx,cx
" E: P$ y, A9 O8 { K1 m+ m int 41h7 C5 |3 ]- p$ ? H+ D, P8 n
xchg dx, es:[41h*4]
2 ]) a. |. o% C* B6 Q( A& L. D, } xchg bx, es:[41h*4+2] u5 H! A8 N0 a! D4 q9 r
cmp cl,al4 W7 o$ s$ F& _/ i$ f6 C2 d
jnz SoftICE_detected
( K! g/ ~$ O) x( g# h' q9 f% f$ L4 R1 G* ^5 A
_________________________________________________________________________$ |& a# N/ Q, }/ B
) @0 ?+ w0 v' e7 }) g$ sMethod 07
7 [! k. a0 ?1 S2 c3 P7 m=========
3 u& B, b* S+ T( c/ h+ t' s9 b# m U* p* A5 \4 {, ^: l
Method of detection of the WinICE handler in the int68h (V86)0 O9 v% [6 `# L, T# H
! {% S4 I7 \4 |+ j, b
mov ah,43h* O5 l: D, C0 R5 z g
int 68h
& S2 j$ \" a, x cmp ax,0F386h2 V$ W5 B2 Q {. s& [" x. h
jz SoftICE_Detected2 K. ~! O: I1 F. W0 }3 d+ l0 j) t
- z- {& M9 j9 J5 @
# i5 }, h2 Z: O=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
: ~% i" o; _% | app like this:
2 ^ f" q+ `" F! \/ W! I
$ D7 w6 {! B" z- m8 F BPX exec_int if ax==68! _. Q, u% u1 \4 V9 \
(function called is located at byte ptr [ebp+1Dh] and client eip is
8 J' ?$ ^/ ]+ ~! Q located at [ebp+48h] for 32Bit apps)
, E) v* J2 ?& [" I1 h5 g__________________________________________________________________________
; F# Y6 n! g9 G
9 ?& Q: P% H/ q, B5 P4 r; z4 W& ]" H) d7 B
Method 08
! V3 F8 h5 s+ P$ v, c=========# e; B* b* L$ e; D# a, h
! h+ a+ O4 M) E& y- \/ K1 L. i4 x4 s
It is not a method of detection of SoftICE but a possibility to crash the! L p' u. \# q9 u7 R
system by intercepting int 01h and int 03h and redirecting them to another: A$ L9 v" ?) k
routine.* M, [2 c9 {6 I0 Q
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 @5 Z- K" [& u1 `to the new routine to execute (hangs computer...)
* o: H: E. K% p5 n& E8 a# u3 g3 p( |- Q/ _; H2 i. b* N1 b
mov ah, 25h
3 h0 o0 A, S2 t' ^$ R s) W mov al, Int_Number (01h or 03h)6 H7 B2 K+ h) t
mov dx, offset New_Int_Routine
0 {2 S) A) [" x- | int 21h9 J" Z" D- a1 t4 Q/ p- q, T
% J j/ ]7 M5 R, p L
__________________________________________________________________________( R Q; Z/ R% B0 |
# ^3 `! y% T' X: _! F% o: m! iMethod 09
0 o9 j' ]- r! L: r, J6 V=========' ~, i# W" G8 Q# u
" G) u" f) N4 s' ^1 N! C dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; N8 d0 {! n2 e2 H( I" O5 b, m
performed in ring0 (VxD or a ring3 app using the VxdCall).* z' J: m6 E! ?7 r
The Get_DDB service is used to determine whether or not a VxD is installed! ~. J- E/ e- M- e# a
for the specified device and returns a Device Description Block (in ecx) for1 M8 v8 V( w* F* N* k; m
that device if it is installed.7 _4 |5 Z$ l. V
$ t7 \% g6 C! W8 `
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& \" b) v# P3 z6 z5 _ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% h# L5 b0 Q8 }) O G, `
VMMCall Get_DDB' c3 N A2 b! M7 P
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed$ v, m# z2 P; _, V8 ]
0 I; {+ S5 _2 S, O) n
Note as well that you can easily detect this method with SoftICE:. E8 g. P! Q! f
bpx Get_DDB if ax==0202 || ax==7a5fh& J5 X8 J" R8 C
! I2 x* g) X% Z1 ]9 @, e
__________________________________________________________________________+ N6 r7 ]# E0 e0 h" m5 T
% f$ O1 M3 _5 [9 o$ eMethod 10
7 Y k; |. I* `0 l6 D0 q=========
5 a w* |( |; ?2 Y, K- N1 w
/ n, r% g& J- c R B+ V1 w=>Disable or clear breakpoints before using this feature. DO NOT trace with% ` _- j Y% r7 K) i: o3 Q8 v
SoftICE while the option is enable!!4 N F, b7 v1 ^5 J! p' O
: _; e4 a5 }/ Q9 M6 c/ \
This trick is very efficient:0 L; j" o0 W& L6 @5 T+ V
by checking the Debug Registers, you can detect if SoftICE is loaded$ ]1 w* @2 a% Y4 X1 ]5 K$ `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 r: I; q6 E1 P- o: r5 ] d
there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 L/ g# @; o5 g$ |, X* `* f; Bvalue (in ring0 only). Values can be manipulated and or changed as well0 W/ i$ M' E7 e) w" H5 K
(clearing BPMs for instance)
4 ?3 F, R9 ~) y0 i/ J) w2 J: ^- {( O$ Q$ P
__________________________________________________________________________
3 d2 H! D- h4 q9 {1 i
) C% n0 q5 j1 X; xMethod 11
' k( f0 H4 _$ S2 I=========
1 p% T6 X1 V6 p6 \7 h' Z' P# V6 n/ A2 R* K
This method is most known as 'MeltICE' because it has been freely distributed! j( m! f" T8 z& ^ h
via www.winfiles.com. However it was first used by NuMega people to allow
1 l9 ]& K. w' d7 @$ j$ jSymbol Loader to check if SoftICE was active or not (the code is located3 N) T% E& ~/ M8 y7 c0 f. J
inside nmtrans.dll).
, Z9 {% q# [ D5 Y9 A8 f
; J0 P$ o6 p4 u" q9 v6 c! @The way it works is very simple:
- a1 b3 E( _6 g. u% G& t5 @It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& ~5 I. h J! K5 \' K$ y
WinNT) with the CreateFileA API.4 p% P8 F- B0 E/ v. D
# D: Y9 i+ d- E6 c& E3 p) I' RHere is a sample (checking for 'SICE'):
2 x8 t* b0 @/ i2 x
5 [0 [; W' w5 v' Y( ?8 h! P' vBOOL IsSoftIce95Loaded()
" _( c% A4 h" y$ ^{
8 Y4 B- a6 S1 S# t9 @: J HANDLE hFile;
1 q" r7 L) d* U, F6 s; a hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( A* e/ d- O, S+ K/ E$ p7 ]& _' Q( h FILE_SHARE_READ | FILE_SHARE_WRITE,6 w3 j0 i2 c8 o7 g* }! i
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" ]3 P6 J# L& C: N/ S- F% v9 y- J! d t
if( hFile != INVALID_HANDLE_VALUE )
% R7 }# C" T9 X* U) O- C {5 k5 e4 \* a( m
CloseHandle(hFile);
2 G' B( d+ W4 g2 L; n* I return TRUE;( a) X% l6 A3 A0 w: D
}
0 w1 z9 R/ x' ?' v ` return FALSE;) E5 Y$ i1 ?: p# p3 P2 X
}: ], O- `- ~9 n! [& s
+ o# p! W, N8 X \3 j* g
Although this trick calls the CreateFileA function, don't even expect to be
" ~1 O9 Y2 c u% Y1 o d% C1 uable to intercept it by installing a IFS hook: it will not work, no way!
/ Z2 o }: j2 b6 ?! S4 QIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" M7 b$ R# x v7 `& H s I
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ `+ `, n g. s7 uand then browse the DDB list until it find the VxD and its DDB_Control_Proc% {; `/ k$ I) B8 E3 L7 M v
field.
4 J# _ l `% @8 g" l. b! d `/ j3 IIn fact, its purpose is not to load/unload VxDs but only to send a
: Q3 n" t K3 J& g3 K0 LW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ C9 n7 C7 R. X' ^
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 t; Q: g: t8 a
to load/unload a non-dynamically loadable driver such as SoftICE ;-).0 [3 \. V) a, D- x( X+ k1 Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow) R! G/ l8 T0 P2 c$ Y. `0 E
its handle to be opened and then, will be detected.8 T! g: w$ \7 q( X, X4 u* z
You can check that simply by hooking Winice.exe control proc entry point5 O1 o. W% h/ J/ e" h* B/ F$ H
while running MeltICE.
5 _' Z; A' ?/ A8 A# Q
# e2 f$ n _, |3 |- ~3 K8 K6 a3 X7 s( C: t O
00401067: push 00402025 ; \\.\SICE
& N7 [( c2 Y) {% P. K3 Q3 L 0040106C: call CreateFileA
7 P8 s' F% [- P( z+ v 00401071: cmp eax,-0012 W% d9 ~6 E. U4 ~
00401074: je 00401091' F2 n2 ?9 T' K
! I( p, P* u+ J. Z! a7 i( \8 S, @1 \8 o
There could be hundreds of BPX you could use to detect this trick.
: M" f0 r9 v6 m3 \- Z-The most classical one is:
1 A+ \+ j7 J: {5 L$ \ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 g" O1 |4 B1 F+ b
*(esp->4+4)=='NTIC'
: @; M% r; u7 ] n( d0 r
7 L' `% t) w$ I4 `-The most exotic ones (could be very slooooow :-(9 A3 x' j6 k' b. S2 V# S
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
- W& n9 ]7 i- }% w L ;will break 3 times :-(, Z* o' h9 ?* n( T# M0 ?
3 ^/ S! s* b' ^-or (a bit) faster:
* s7 z/ X. p) R BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); m( K1 [, F/ g9 J% m
2 `" M8 M! \0 d9 l7 N% B+ a
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 d7 Y/ T1 a2 `! i
;will break 3 times :-(3 ~: }5 Q5 B6 K; v- N+ K$ @
2 \* v8 K: I# a5 J x, V-Much faster:3 q) `8 v0 F$ [" R
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 D7 A7 T% \8 e; E4 `
- @: D" _0 [" p) O+ K5 L) U! @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
0 T6 ?/ ]/ o3 g" K- [% F0 qfunction to do the same job:
" q {3 q% |: m9 X* q
+ e$ c& h) `3 I# b/ B push 00 ; OF_READ
% _% C& n1 \- A7 J7 q1 K" y mov eax,[00656634] ; '\\.\SICE',0
% Z! M6 m- c( H& E0 R% h4 G push eax
- U+ z# E0 Z( Q call KERNEL32!_lopen$ B6 F$ |- K S' [
inc eax0 f( o! `% v+ X. ]: t7 v' s# _
jnz 00650589 ; detected, t. l8 o) P- F1 T8 F3 N
push 00 ; OF_READ4 [5 t" u7 `. e, d) I) N1 a# F
mov eax,[00656638] ; '\\.\SICE'
, `2 _# [+ U3 f( L; I push eax
C7 I a/ l" b# z call KERNEL32!_lopen
) P" S: [9 _% y! P inc eax
' J* W! C' R) i* S! R$ \$ i- \ jz 006505ae ; not detected, _, @5 C$ g# O# f* ]
& M! H# d* [4 ?, s. ]/ Z/ @) b. s7 k0 f
2 k4 K( v, I: j) T: w$ {" u__________________________________________________________________________4 x2 V+ w" ?1 M1 x# S* }& g
5 s1 N+ ?" _) E/ F$ b
Method 12
: ^: t" u" D( J% l=========
2 U' @3 c: I2 V" H( v x# @- @% i, w3 V8 P$ u5 Y9 o7 m
This trick is similar to int41h/4fh Debugger installation check (code 05
5 | o: ~0 {1 m; e/ e- S/ f5 k& 06) but very limited because it's only available for Win95/98 (not NT)& C1 _* k' W; M; Z& r
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ j4 P7 z/ T/ [
3 G0 i! c5 V1 u# |1 s$ ]; _! y8 G
push 0000004fh ; function 4fh9 e# w2 v$ k3 e( S: g F
push 002a002ah ; high word specifies which VxD (VWIN32)) c; _8 J2 J3 O0 A0 G$ K" G: j
; low word specifies which service% A$ \7 ?1 \8 @: N3 t
(VWIN32_Int41Dispatch)
+ g F; A; V8 q- e call Kernel32!ORD_001 ; VxdCall
6 p r _% N |6 J. H cmp ax, 0f386h ; magic number returned by system debuggers
4 F7 l% i! l) X jz SoftICE_detected
3 a" ~5 b0 S# ]: q* e2 I
4 y2 S# ? o( C9 w: @8 F: @4 OHere again, several ways to detect it:
! }" h' a( X$ x F) p- ^5 e4 V! ^2 u/ e9 M
BPINT 41 if ax==4f9 e9 q' w7 E- \7 V9 q5 m; J
* b: R( Z- l: u& v5 S5 G" Y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; _+ V6 h0 a, U) I
3 U; {2 j* M1 l+ S BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ D- B* g6 a/ i! U
* h! {9 d7 q5 _; P6 D8 H1 Y BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# y7 _4 h/ I5 M0 j, I
$ K* |9 C3 B8 @/ M__________________________________________________________________________6 N* g8 }7 E6 ?6 D
- @0 e$ ]; |: ~" jMethod 13
! J$ t! P' @* ^=========3 i- Y# r1 W; G: ]
( ^6 d% M. f* ?( W9 G' _/ SNot a real method of detection, but a good way to know if SoftICE is( \. A9 g/ S0 @% C0 t
installed on a computer and to locate its installation directory.! u4 Y8 [3 k. ?. E
It is used by few softs which access the following registry keys (usually #2) :" Y% V; Q3 x/ K# G6 b9 _& h: Y4 V+ A9 @& v
9 ?! ?6 E5 Q4 k1 @* {5 g( z/ ~, H$ L
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 v5 r9 h4 o/ [* t+ L3 r) E, k\Uninstall\SoftICE( ?& W- l! q, E/ ?! Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
! y& W2 P7 v& p7 L/ V-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 [! M- ?% S0 r7 o0 G\App Paths\Loader32.Exe
3 `% a1 K; S& S" g) C$ q) h! q- A& l. s8 j" N& z% _6 I$ w
# _! y0 q" H0 [* YNote that some nasty apps could then erase all files from SoftICE directory7 o+ n$ O2 @1 b4 i3 m6 `$ m# r- @/ ]
(I faced that once :-(2 h5 @0 m5 l2 m( K) v7 \& B" F6 @
# S" H& Q3 l9 V0 IUseful breakpoint to detect it:# U; ]6 |) s) K3 y( z& s
6 |' V! \' H- e. p1 T
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ w$ ?) F) R& A' A1 a2 o# n& a: `
__________________________________________________________________________- c# x8 w4 W3 v7 n ]; z; m- T6 }
" [; x! @+ k0 _+ r
: B/ @) q2 y% Y
Method 14
0 n, p5 ?8 L6 {5 z=========
& p$ @; r* ]2 a+ I
4 h5 |) j. ?! R4 Q5 RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" n% S0 W5 V( `4 V: ]. a
is to determines whether a debugger is running on your system (ring0 only).
0 g, w* F' n+ V2 p, A4 g5 r
0 A# L6 n* n# L VMMCall Test_Debug_Installed
! j& }; v0 ~ H2 W, y je not_installed: s: f' }' F4 F8 q7 ~% n# d
* A, V- }5 U, P/ S0 H9 k- m4 Y1 t& BThis service just checks a flag.
a9 s2 G$ l) G: o2 ?) Q& n</PRE></TD></TR></TBODY></TABLE> |