<TABLE width=500>7 B6 p0 V7 z5 H( j- H
<TBODY>
8 H0 ^. W2 M9 H4 a<TR>
1 I n* `- {) z<TD><PRE>Method 01 : m6 ^3 w# G8 I1 ]/ A
=========* H9 ]6 n5 M7 m( h1 o' L
j6 M& [$ ]" [) T& ~
This method of detection of SoftICE (as well as the following one) is
: b0 T# r3 p/ Y8 M% e# [used by the majority of packers/encryptors found on Internet.
1 |1 a {8 t3 x! d0 z% [; S* QIt seeks the signature of BoundsChecker in SoftICE* z$ ^0 s' q. h" P7 E; X
9 u9 X, K6 S, V' Y: K! T mov ebp, 04243484Bh ; 'BCHK'
, a2 S! {! u7 W mov ax, 04h
. k) O# q( g/ k3 [5 s( E+ k int 3
w- @( d" @* K* K: N cmp al,4
6 h' \# A% p5 S, f! @) t jnz SoftICE_Detected
7 }. ]5 Y7 A5 t+ E+ ~6 y
$ M p2 V6 V& \/ i___________________________________________________________________________
6 d2 I9 X- o [, V8 k5 _2 x/ ^0 k' g0 [ ?; J1 B# L
Method 02" h- p* H" w* Z: `+ s7 J
=========
- @# ^) N" s' z) N: a! }
9 p) s) f0 G3 e: H7 [. _( X+ JStill a method very much used (perhaps the most frequent one). It is used( D1 q" N; Z: ]
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 j+ o6 H* }$ E) F; c/ t$ @0 Hor execute SoftICE commands...8 H% o& ]- I9 ^, H0 h9 E& R
It is also used to crash SoftICE and to force it to execute any commands! F$ P( D' }# U* L
(HBOOT...) :-((
* B R$ n } o! Y& ?% B d
2 i$ N$ Z# j8 QHere is a quick description:/ c1 e% j5 i8 [
-AX = 0910h (Display string in SIce windows)
( v' j7 v6 E* x# }% @-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: h+ @# @0 A$ ~* P-AX = 0912h (Get breakpoint infos)" _5 H5 d- v/ y( b$ G: w5 w
-AX = 0913h (Set Sice breakpoints)- B$ ], i. N, K
-AX = 0914h (Remove SIce breakoints)
; \) G- G6 q6 Y6 v: J% |, j
( P1 Y: |, t2 eEach time you'll meet this trick, you'll see:
; ^) A% f3 a9 o) f( Q-SI = 4647h" T& S& X* a; X0 r
-DI = 4A4Dh
0 Y8 J0 x2 K2 ^2 Z7 j$ |Which are the 'magic values' used by SoftIce.0 p6 {% e0 Y G, Q6 J
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* H6 z; w: _$ A& W6 M: e5 \! @6 N! C* M
Here is one example from the file "Haspinst.exe" which is the dongle HASP K' U5 b. t$ I
Envelope utility use to protect DOS applications:
) l- e% Z' D8 A! f- m: j) y6 ^
4 l; Y* l) _' o8 N, @4 [ \/ { Z' L6 q0 w) U% @( u% i( u% h M
4C19:0095 MOV AX,0911 ; execute command.0 V; f# `( ?' `. O
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
2 J& C! Q3 p6 ~4C19:009A MOV SI,4647 ; 1st magic value.
5 H( g2 o! E4 L$ t1 {* G& T' Z; f4C19:009D MOV DI,4A4D ; 2nd magic value.
6 P, }2 ?1 @; S, s* m& |: X8 P4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ F4 n& p0 V3 g, M! c" V4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute# G2 K6 i& f; Y. F4 _: r+ M" a
4C19:00A4 INC CX+ f) b g% B7 I1 i: P
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- t2 o# Q' e# k4C19:00A8 JB 0095 ; 6 different commands.
' s7 B& W' {) V! t. X6 V4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* v# ^1 i6 L6 ^8 A5 b/ i% c5 J4C19:00AD MOV BX,SP ; Good_Guy go ahead :): ^. S' e+ R1 e. c' b) Q
6 O# d9 r, g Z/ A, O# L( c& r
The program will execute 6 different SIce commands located at ds:dx, which( R" J: [7 ?( B5 l/ S& K1 f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
2 h& ^6 Y: E; p* X: X2 {, a) l- D6 j, _$ `
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! c) N7 h% V0 i$ t1 i6 W9 ~
___________________________________________________________________________
5 B( b+ \; P& I* _' ^! k" t
# \5 k8 v2 ]0 r' M7 N
3 n5 u$ d. i( B' Y9 o* J$ eMethod 03* S f- v4 P$ n5 Q+ R0 N5 X& ^ z
=========
* k- N3 }8 E$ o& x( @+ D( _
9 L3 r: Z9 i7 b( U3 wLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ A3 ^7 V9 A2 K8 w( Y- C7 Z' Y
(API Get entry point)5 I" _9 d$ C6 [! C) c+ L
& d% K. @2 U& L. C, T7 N% v0 J! n( ^
* P0 N5 G" z: d+ t! V xor di,di
) J; r3 ~' ~8 A$ |: }* U% b mov es,di
9 H4 r% X! _ o- t4 y& x mov ax, 1684h 2 ~) w- n. M8 ~0 O- C" k
mov bx, 0202h ; VxD ID of winice
$ J8 J3 `% u. m, n4 ?+ { v- S! X6 [ int 2Fh
; [' J+ i5 [& C mov ax, es ; ES:DI -> VxD API entry point, H+ g/ _9 ~3 U% q) \
add ax, di! r# X# W0 O! u' W0 K
test ax,ax. D' D- k1 _% ]9 m, Y) l
jnz SoftICE_Detected- K* @0 f9 `$ X& x+ z8 `
4 p& f( {: p: R6 Y1 w4 y
___________________________________________________________________________
: u) S4 Y5 A$ F, I1 }( H3 E( J9 [2 K) {! V
Method 042 N. J, [; h9 k# A. u
=========+ ]1 L f3 ^5 C9 v3 |6 t) [' v, v
* S' R# Q. N/ j( ^& x9 x& IMethod identical to the preceding one except that it seeks the ID of SoftICE+ S2 u. o. v9 v X
GFX VxD.
( A* J5 e5 `: b1 ^! R' y8 C. P, y- u i; @+ Z% x' v
xor di,di
& b+ v {+ C& q, T, C, U, B9 d6 ~/ w mov es,di
3 K }2 i- i4 { mov ax, 1684h & g/ z9 Y" L7 t) Z9 X( U# G% T
mov bx, 7a5Fh ; VxD ID of SIWVID
& Q: _1 \/ \' T& g9 C: {1 x# P3 m int 2fh# j3 O: g k* j. p
mov ax, es ; ES:DI -> VxD API entry point; t& h4 S$ A8 j6 F9 z D! W
add ax, di
6 _; ?6 ?9 V# X/ \3 d test ax,ax
! b0 l! D+ f( [' S! G; h, f jnz SoftICE_Detected2 v5 Z( r4 ~# d8 k* G
1 Q6 a0 W" y; C' u+ R6 q__________________________________________________________________________# J9 x: C) z& C1 _
: Y/ X4 `2 ` |6 _3 v: v
3 Y4 P/ B/ o& O {0 X/ t% c+ FMethod 05% d) _ A" c0 D7 P) |0 P$ F" h
=========) q% M# S* p0 P3 s; |
) F# {- W; ?2 q$ {) wMethod seeking the 'magic number' 0F386h returned (in ax) by all system
/ k: l/ A" F* Bdebugger. It calls the int 41h, function 4Fh.6 G9 }7 s( \% c+ D" r$ L' r, n
There are several alternatives.
+ ~8 a7 r% M5 N& N" _+ J' h
6 f ^ X) P" \. Y& o* eThe following one is the simplest:
/ q. k* n* ]1 f* C- w2 Z3 r% e) B; ^ |" G! |
mov ax,4fh0 L* O; Z6 l" i0 |0 n
int 41h
e, P) f+ H8 k) ^ cmp ax, 0F386
' M9 R/ l2 Q; t9 n% D0 y jz SoftICE_detected: o; l7 H% M# U* L
* M; y/ {6 q/ p6 A, p# h# H6 W# ?( x8 _
Next method as well as the following one are 2 examples from Stone's
6 M7 F. x% Z7 |8 _"stn-wid.zip" (www.cracking.net):
/ f4 K; ]9 F% o w# W6 e3 Y! n8 F6 u
mov bx, cs
8 R+ {' M m1 c8 F; Z lea dx, int41handler2
! l$ t2 X" o# N7 i, D' ] xchg dx, es:[41h*4]8 r/ _4 ?! p, t8 R
xchg bx, es:[41h*4+2]1 _5 I2 B5 {* `$ s, D5 y
mov ax,4fh# g( [; n# @3 G3 q' m g3 p
int 41h
1 c3 ~2 A4 `7 X xchg dx, es:[41h*4]: F E0 m& o: c: Q1 J- a) ~
xchg bx, es:[41h*4+2]' h* A* |, l4 I
cmp ax, 0f386h* @/ n# [9 p+ x" |
jz SoftICE_detected i+ b! W' ^1 V1 Q% N
' |. p4 ^% j5 ~2 P. qint41handler2 PROC
; i4 G, _/ W5 f" r iret
" g1 ^* L3 f3 R5 k1 L& w2 ?8 Rint41handler2 ENDP
. A4 N+ \- h4 y; I* S* S+ P, w/ M' [
' t( l& [8 ^& I0 @_________________________________________________________________________" q" }2 z' ~$ R) f
. h8 j; l: F; j6 b
. y9 F4 D7 \( j% a# O9 U4 K* aMethod 06. s4 e5 e. ?* Y4 W; c, c* b
=========
+ ]8 f, i# x, b$ U6 B3 F- X) W7 h- z& l3 H& M% {4 s3 B* [" x
9 A7 K* I4 y/ \/ ]9 W
2nd method similar to the preceding one but more difficult to detect:1 Z. @$ ^6 A; Z: x6 c- l
+ _& }1 a# B$ D% N$ c3 V) I J- {+ k' A; F4 j4 o# D$ Y# R- p- P- E# v; S
int41handler PROC
# Y2 d. [/ n' d- `: v0 `2 ?- ~$ L mov cl,al
( \% b0 }# Z9 X& l# F- Y8 x iret7 v' j+ n$ X6 g1 k3 L
int41handler ENDP
/ G, L2 e; c# x4 f+ m0 y1 s# h" E, s6 G+ |) d/ `
% W% r/ S* O" W$ u& K" x J xor ax,ax6 s9 j3 k1 L# p. T2 C& Z& v4 {' L
mov es,ax: n3 i3 Y6 U2 {
mov bx, cs) [4 a% b9 n g/ m% _, N" t
lea dx, int41handler
# M9 W ~) b( J) N9 @# h xchg dx, es:[41h*4]
1 ]* a% J" q3 O- e xchg bx, es:[41h*4+2]
' _; x2 Z/ ]# L8 A, T+ ^ in al, 40h
0 a' k; e. ~* `2 Q# x xor cx,cx$ O% K6 k2 |; K+ M& |, H* }
int 41h! T; F4 w. X& u! S( A3 ^. y4 M
xchg dx, es:[41h*4]1 v' h) h) p; w3 U* i3 X
xchg bx, es:[41h*4+2] o6 K- {9 x4 l3 H j5 x. ?1 n6 L
cmp cl,al' J* g2 ^: c3 q8 e; }* i, d) B
jnz SoftICE_detected( {! ?) N# i8 v) `
' z+ I2 r% C# u9 o_________________________________________________________________________
% g$ x8 o9 P3 R6 K0 n/ c8 }; z+ X7 U$ N3 |; h% |
Method 07
4 y2 ]( u* `& a- a6 F=========$ ~6 [/ z8 H2 R+ b: @
1 r9 Q2 r6 B- M9 f
Method of detection of the WinICE handler in the int68h (V86)) y, S5 `$ N( O- v. F' d2 _
5 ^6 d R8 E7 {' x0 K' D+ u1 L mov ah,43h
+ k/ C: f) T( x8 \! p% Z int 68h
# v) I2 b% B+ W2 h cmp ax,0F386h
9 ^2 q0 b5 N4 w# F jz SoftICE_Detected
# q0 U* P; n, ^: p$ b. o
5 `7 i* G4 l; T; V2 c/ V8 N/ N& S
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 S, d, d; A/ B7 K: r% w
app like this:" B) |4 S7 N, F4 M9 P# g/ O
' E6 u& r1 f5 C3 E; T/ S BPX exec_int if ax==686 Y+ E2 q( a: v) z& L) Y
(function called is located at byte ptr [ebp+1Dh] and client eip is
L7 Y/ m3 i1 D located at [ebp+48h] for 32Bit apps)
) O# r$ |0 T4 s__________________________________________________________________________& q( F4 t2 h u T' }$ t% e
2 y, k: C9 K( l4 d* O) r" \3 U6 r# }3 S0 p. Y6 J
Method 08
' }8 ~% X. d7 [( q* |. [=========. ] v1 p# n8 B6 h# g! ?3 P
+ |# ~, e9 S& a6 dIt is not a method of detection of SoftICE but a possibility to crash the
) O9 U/ s- M6 n7 l6 ssystem by intercepting int 01h and int 03h and redirecting them to another! V4 U. K7 _, n* ^2 `, A$ U
routine.; S% k3 u1 Q6 \4 U
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
$ j n" T1 k$ N; z' Cto the new routine to execute (hangs computer...)
, ~9 S. X g# |. C5 h n0 N5 R
, m$ O' |0 W& j# E( M* w mov ah, 25h
& G( E, V( r' w mov al, Int_Number (01h or 03h)& \3 M5 i3 G3 ]: ?% ~1 j
mov dx, offset New_Int_Routine
. U: T. v2 L5 j& ~4 F; ? K int 21h2 T* k3 W8 i U8 P0 q
! M/ n5 e! |# A6 ^, ___________________________________________________________________________
% Q7 D& v) x7 H6 Q {- `: O: q0 C% w
Method 09
+ T- P% x* W4 B( P& [1 L$ |5 c========= r$ E6 o& M3 B
, m. F3 C2 U7 O, D* z* P4 R8 i: \
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) R# H% }; A/ v1 \( k$ e B
performed in ring0 (VxD or a ring3 app using the VxdCall).
1 D. U- o$ k8 wThe Get_DDB service is used to determine whether or not a VxD is installed. K2 X5 E* }' \3 q* C
for the specified device and returns a Device Description Block (in ecx) for7 k4 k0 u8 [/ d6 A
that device if it is installed.3 X& |2 E2 L& X0 H' q. x% M
* Z" D* b1 c3 U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 c Y+ E3 R8 x. y+ v' x3 m. _, u
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
: K8 D8 E6 F7 a4 N VMMCall Get_DDB: i+ _ z8 n- T x0 |3 y, {
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# B/ z% F: m# V9 J
+ q% }$ _ G2 y( D; c: `
Note as well that you can easily detect this method with SoftICE:, I, ^* M9 d& T1 {. j' G- X
bpx Get_DDB if ax==0202 || ax==7a5fh
- q: @; {* Z, z$ J3 u5 A# Z+ l0 C3 w/ A8 d! s1 Y) N0 _
__________________________________________________________________________! b# U" D9 v. O7 G6 W
5 t8 G3 v* a3 I3 M
Method 10
$ w% e3 |% {, y) K" [5 [& C=========
" N; A! I _" D2 v5 z# z2 r6 e: I
=>Disable or clear breakpoints before using this feature. DO NOT trace with9 h. Y) @ S) `7 X' E0 }9 b( c
SoftICE while the option is enable!!: [) J) f: }- J, V9 e
/ S7 ^ X$ o! j" ?" H
This trick is very efficient: H5 L, w$ L _; }
by checking the Debug Registers, you can detect if SoftICE is loaded
1 [# o4 e% s8 [(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ W# L8 T2 o j3 `: gthere are some memory breakpoints set (dr0 to dr3) simply by reading their
/ w% l8 D; F- {value (in ring0 only). Values can be manipulated and or changed as well
6 b: x* C6 Z# x' w(clearing BPMs for instance)9 ~1 T4 I+ q% v% V' y1 J' |
9 U9 g. D' d! ? j% E" Q+ w__________________________________________________________________________
9 H: V' H1 Z6 o. Q _* G& Q: D/ @5 H/ b! n5 G% N* Q
Method 11( q6 o+ N' Q7 p6 @3 ^3 z' I
=========
* m; b: w1 z- L) \0 G, y9 |4 M& J0 m2 x: b: @/ P
This method is most known as 'MeltICE' because it has been freely distributed0 s) ^+ ~5 I* G$ H) ]7 G: ~7 M% K
via www.winfiles.com. However it was first used by NuMega people to allow( S! Q! ^" G& [3 y
Symbol Loader to check if SoftICE was active or not (the code is located6 g' S2 d8 N4 a" B+ X$ W" `+ _
inside nmtrans.dll).# D2 S' I; o) [) o' h( s j
; N4 {5 j) h; ~The way it works is very simple:
7 T r! D# r5 {( o, s6 Q: \! rIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% n. [* v. P6 D3 @8 p, R
WinNT) with the CreateFileA API.4 v9 @+ ?! G8 a
0 \5 M3 _, m- MHere is a sample (checking for 'SICE'):: q2 u$ J# [9 w' k% `
+ I3 x, X2 B. {5 n2 j6 FBOOL IsSoftIce95Loaded()' C5 x6 x3 r, o
{7 w% E& z/ S& S7 U5 F
HANDLE hFile;
" K; ]- I t; E# A; Y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,( u$ L1 P8 t3 f4 ?
FILE_SHARE_READ | FILE_SHARE_WRITE,
3 J0 ~( A6 E# O6 z1 f NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) I: h, |; C4 p2 I$ }( h1 h) n P& b if( hFile != INVALID_HANDLE_VALUE )
5 H+ W! [% h2 t3 x$ L4 k; } {; n- c. i6 l+ W
CloseHandle(hFile);. z8 D* f) s& M1 [( S- a
return TRUE;
5 U8 l g* k7 b) h- E }
! V( \2 f& ^2 Q# u9 p2 X( Z return FALSE;9 K# v0 T% C7 ^+ L
}8 N5 \# ~6 X; o! s7 C& g* P
" r: X2 n" R) S& A1 K
Although this trick calls the CreateFileA function, don't even expect to be
5 X) [4 T& t% h8 F4 e$ L7 x! Lable to intercept it by installing a IFS hook: it will not work, no way!
: d2 g) C$ x& vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, D, D' j5 ~+ F6 [service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 H: b. I$ y0 ~9 E3 t
and then browse the DDB list until it find the VxD and its DDB_Control_Proc) q4 o+ R, M1 B, ?& V. Z
field.1 | V5 k+ ^* u* E; s1 B
In fact, its purpose is not to load/unload VxDs but only to send a
% g2 y- L1 e4 K9 v7 aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)7 H) D) r; j1 y, b0 }0 [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% z1 R6 n8 W6 b5 mto load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 u* X5 B5 h r1 Q ZIf the VxD is loaded, it will always clear eax and the Carry flag to allow
+ \9 J/ I8 z: {0 }+ iits handle to be opened and then, will be detected.
' K7 L1 _8 |! Z" A l4 rYou can check that simply by hooking Winice.exe control proc entry point! B/ Q: H; r7 h' [
while running MeltICE.
7 ], u3 m: k, S5 [2 ~8 d& _' ^
$ }0 G* Y0 j* u( n! w% l7 U$ _, O: W6 j
00401067: push 00402025 ; \\.\SICE m) b* o1 `+ N* V
0040106C: call CreateFileA" z2 {& E9 t3 f$ P) B
00401071: cmp eax,-001
G% F4 a5 @9 ] 00401074: je 00401091
6 j, ^; ~$ s" Q9 h/ Z3 f" T$ O& S! F
' b6 Z; a1 ?1 I1 X2 [9 S$ g
There could be hundreds of BPX you could use to detect this trick.9 g2 i' F( M* P. y) \' A. {
-The most classical one is:
; P: N# i5 i6 z5 D5 G) y& Q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||$ d8 ~4 i" o! H6 A8 U$ a$ [
*(esp->4+4)=='NTIC'
; a0 N$ q( D5 n; w; Y( h- U* q$ ^5 a6 I
-The most exotic ones (could be very slooooow :-(
- O. P% P+ f# ^$ ?9 R BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 c/ ~/ v: J2 r {& r* a6 w
;will break 3 times :-(# r4 m4 u9 d" V8 K
; P8 M. G8 {- p6 f# U2 ?. n
-or (a bit) faster:
4 y Q5 ]3 r- W, c# a+ y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' h5 n/ m& S" ^ | D) t+ m" h
" S+ w: I0 G* ?9 X- d5 Q& k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 v7 T J# D' g+ m ;will break 3 times :-(" p: p$ e" ?1 y/ q% T
7 W! a. S1 u* B6 f% L
-Much faster:
+ H/ K; V& x4 _9 m$ w6 `: L, R" ~ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'& a* }$ o. C: ]! v% g0 b/ e/ B/ p) z
& [5 L$ c' R4 L' e1 E
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen9 x% u; P# @6 j g, d8 v8 R
function to do the same job:7 \4 l& C% [5 d [9 U9 l1 k
( W% {' Y6 ?! E! H; j& b# t; L
push 00 ; OF_READ: f3 f4 o) p9 P, h4 F- [* k ~
mov eax,[00656634] ; '\\.\SICE',0+ o) {9 V& y! S) Q. l4 c0 i
push eax# |! |, k6 {5 L1 \4 i1 V& I$ p2 P
call KERNEL32!_lopen' y$ v& h2 |" g! M' K
inc eax+ _5 }& e! d. U* q" }
jnz 00650589 ; detected$ Q+ T. m% F3 W( Z& N: c
push 00 ; OF_READ$ u: l! \% G/ G% i" v; n% z2 l
mov eax,[00656638] ; '\\.\SICE'
1 j8 n6 W. f4 X push eax6 _' g; @/ E/ V
call KERNEL32!_lopen% Y/ M/ k! I1 |) L5 @( K
inc eax
2 v5 H9 w& H6 f+ v( ] jz 006505ae ; not detected
) l( J% k0 O) _3 K* z- Y0 E5 S' _8 ]" ]2 _, @% j
7 _ U+ }) s5 Q% m; T__________________________________________________________________________
* ^& r* K- B8 [; @% m1 w+ a! v
" Q8 P% `1 k/ Z+ ]- K3 C ?( SMethod 12
* q2 G9 a l0 ]( _=========, E* X# Q/ _ n& X) ^5 ~
/ J! m- R1 F! w# U4 [This trick is similar to int41h/4fh Debugger installation check (code 05
6 V5 ~9 p5 V4 m9 ^2 W& 06) but very limited because it's only available for Win95/98 (not NT): P4 X6 I% c7 h0 ]1 b& i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 i2 ]9 H& g) ?. V0 U' W# b# E% l# m* |( H- E! \
push 0000004fh ; function 4fh( c0 Y9 E. F4 ~) P* s
push 002a002ah ; high word specifies which VxD (VWIN32)
2 P( v# W" }+ l' e+ `- n ; low word specifies which service3 a; c+ ?9 s; p5 A: V
(VWIN32_Int41Dispatch)$ k0 L8 l5 s+ O* B" G
call Kernel32!ORD_001 ; VxdCall! w4 m: c( K! { b4 W2 f5 s
cmp ax, 0f386h ; magic number returned by system debuggers
) u+ N5 c9 V+ H8 z" Q, e# g2 K jz SoftICE_detected3 R8 [8 P7 o4 K
3 J, a/ {1 w. H6 t( [Here again, several ways to detect it:) t8 D2 \ R3 r. c+ y) I6 B
5 H( u# ]: ~* d
BPINT 41 if ax==4f
& j& K+ |0 v7 F8 Q$ q* X' J/ p6 [
) k& F d( y+ a) I7 o$ ?8 G4 a1 Q; J9 W BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
0 |' k/ {: p' k" F( B/ ]" k. }" X: s5 _ n' Q: ~
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ x( q x$ G7 g: ~* F D. G; `
4 z2 U! l- ?& x
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
# t+ m6 A/ |* v/ N
* \' v) ]$ |, N& f- r__________________________________________________________________________
! S' {( y$ ?1 M I) x* q! s m4 O* E0 \2 t' G. C8 ~+ N% c. F
Method 13
* O" K: f; _, D' O" ^+ _========= z3 f E8 D8 {7 _5 |; d) p
& W7 u/ F$ a' a$ a- [7 {. S; I mNot a real method of detection, but a good way to know if SoftICE is& J$ q1 i, }1 n* m: o6 l! a
installed on a computer and to locate its installation directory.
6 w7 b0 _, L, L4 |: vIt is used by few softs which access the following registry keys (usually #2) :9 p% M4 s2 t+ Y& I
' f0 _; }3 O6 a" |0 E+ |
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 s; g8 Z4 a" ]1 e6 O\Uninstall\SoftICE8 R. [3 F1 S9 J
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 L2 J# U: V* D" E, U0 X' z! l# X- p9 a
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 A L' u/ n1 U1 o2 ?5 t( r4 {\App Paths\Loader32.Exe. q( m2 F' d0 g- ]# e
3 ~- u+ Y0 s' f) {% C0 }; q' x& V
1 N: O: p& L0 o+ GNote that some nasty apps could then erase all files from SoftICE directory
0 C, Y- k: @+ h6 |3 J# ^(I faced that once :-(" Y# ]% f/ O) b0 C* }7 ]
5 s+ d" d6 j: G) [& O! r" yUseful breakpoint to detect it:
y( q* p: c6 N' }2 K# q9 G* }' u2 E1 |( z
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( x' a3 G# \; }
$ r8 J5 U6 o! N$ W__________________________________________________________________________
: i) w; z) I/ E. [2 L5 k+ c" k( T; A7 X5 }
4 W% [1 R; _# jMethod 14 . W& J. c) m7 v' ]0 S- O5 o
=========3 @5 G: H) E! X/ @8 l( c
1 v! J9 `5 c8 u" ^) g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 J1 E* C* L8 B1 O, k6 M# O' `7 c. H
is to determines whether a debugger is running on your system (ring0 only).; i: o$ `* t. P& f. g
% [1 A4 l- ^8 Z/ d9 D2 b2 _ VMMCall Test_Debug_Installed
/ V% J- Z& K* c4 m- q je not_installed5 Y, z& a$ n' b5 F
/ `& i9 H* A6 `+ cThis service just checks a flag.9 Y* T! b0 o9 n p
</PRE></TD></TR></TBODY></TABLE> |