<TABLE width=500>
+ F, k: Q% }, y: B<TBODY>$ A" |- {0 ? L5 l, ^$ \
<TR>) }- h! C2 v4 x! I4 N3 _6 B
<TD><PRE>Method 01
/ U! w. A! H% R=========9 e- D! ^& ]2 o7 w2 Y# k# K/ C
& |9 C# \! c- s7 V7 G7 F
This method of detection of SoftICE (as well as the following one) is
' {; |% X2 {0 Iused by the majority of packers/encryptors found on Internet.
: e: T( r" I& MIt seeks the signature of BoundsChecker in SoftICE/ m. z, a; D6 }6 B2 S( l: k7 U
3 J& K5 L) Z4 c* j. G& w4 {
mov ebp, 04243484Bh ; 'BCHK'0 `4 w, V& ] \7 a' N6 ~
mov ax, 04h
6 |% D! g9 g9 {5 J# O$ A' w) A2 N int 3
! t9 } f+ \% o5 H# s cmp al,4
o; Y3 y6 J" T( D! v jnz SoftICE_Detected1 \3 R4 Q1 {; G% G5 X* `
# ]9 x( ~) ]% Z6 q4 ]3 S9 }
___________________________________________________________________________. Q8 Q& g, s: g. S6 _
; f1 }& t' J }& W+ v. d
Method 02
) O, V, L! g+ @- T% a9 N1 j4 o. b# P=========
1 c- C! v8 I5 j! \ ]7 E* f4 h; L) Y) `# F) n/ R
Still a method very much used (perhaps the most frequent one). It is used7 V1 b0 B# o: F6 {( u- i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,% C+ v$ b! E/ C0 P9 m$ ~+ O
or execute SoftICE commands...% @" @8 K2 k, ?4 u
It is also used to crash SoftICE and to force it to execute any commands* r" M! y" }. F7 D1 S) |4 O$ n
(HBOOT...) :-(( 2 S) {1 V( |6 _ U [
( x4 w: T0 z; h3 f; f3 O& CHere is a quick description:5 r2 U1 ~2 K6 w
-AX = 0910h (Display string in SIce windows)* g: L! [. K a) s0 _* x" z" o2 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)8 U+ M# \, {7 \/ L# b
-AX = 0912h (Get breakpoint infos)
: F7 a4 V( p5 y-AX = 0913h (Set Sice breakpoints)# v. x) @" f# b- t- n
-AX = 0914h (Remove SIce breakoints)
3 _) g' ]( \$ N. ?' Z2 u
1 h7 ~( O/ W4 y: `# tEach time you'll meet this trick, you'll see:$ i8 L. K% |! r' b0 D
-SI = 4647h
- G8 R6 c1 f Z2 g' k% t-DI = 4A4Dh& D- {! [/ F: [1 o9 B. g: S" E8 _
Which are the 'magic values' used by SoftIce.) {7 k) s$ C. C
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( Z) W/ v- H; i8 K M3 p) B6 g" H7 ~: |0 {3 G, E5 m# i6 i' [4 j
Here is one example from the file "Haspinst.exe" which is the dongle HASP
3 I6 I0 [# f- o3 U( PEnvelope utility use to protect DOS applications:
2 Y8 \1 m$ E# @' l0 o
~( V& H, u' g( {" X6 F! }: Y! u0 O4 ?) d2 u$ N
4C19:0095 MOV AX,0911 ; execute command.8 v9 L& o t; ^/ |4 m
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).9 F* z7 t# s7 a" t6 p. D
4C19:009A MOV SI,4647 ; 1st magic value.
/ X4 i* _0 M2 l" _/ W/ i8 H0 H4C19:009D MOV DI,4A4D ; 2nd magic value.
& i# F& u6 b2 A! g; [# `8 x4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)" l- B( I2 M2 a, R8 _- ?. S+ I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute& T9 D; n6 B& p) w$ F
4C19:00A4 INC CX
h7 s: i/ ]* i+ p, V4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: o' \! L( h9 I4C19:00A8 JB 0095 ; 6 different commands.
" w9 x" s# B- `$ Z# j4C19:00AA JMP 0002 ; Bad_Guy jmp back.2 _5 q8 K; t7 l' _
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
# n8 t X, K0 `9 A8 z/ s0 I% [( p; W6 g. P
The program will execute 6 different SIce commands located at ds:dx, which
* d2 D2 I# {, t; y, i$ }; S6 ]are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" g0 [7 ~$ ~& X9 _, o p5 X2 l S$ M% i7 R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
. F0 l8 t. X9 w1 c___________________________________________________________________________2 H) n% O7 m2 N) { X* V! q. q' h
+ K1 E, V4 K. n6 H; t: t5 c
c$ I: m" R( w, ^3 g3 ~Method 03( s/ v, s" `2 t8 O! G# E
=========3 B# _/ }) d& f5 c. b1 y
2 x% q3 g- V, I# B: y- H
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- S0 t R7 Y0 ?; L J! ?7 X
(API Get entry point)
$ N$ u9 j g4 B3 I - v* `9 m1 q! E- k9 b& x
" x4 G1 |* `) q% }- N
xor di,di
4 v% E. h& d9 Q2 D- t, C$ } mov es,di* J) ?+ q$ m% e/ M1 d7 Q
mov ax, 1684h 9 `& L( K& O7 k- |0 I% p
mov bx, 0202h ; VxD ID of winice
4 B& Y3 k* K: r int 2Fh" C$ P4 H u$ `2 s
mov ax, es ; ES:DI -> VxD API entry point9 b4 [/ R/ G3 s
add ax, di+ k# R; E g" o% c
test ax,ax
]! P+ \/ Z8 x5 @ jnz SoftICE_Detected. V) t2 h5 ]3 D( _0 |6 ]" w5 F
m1 ~. G Q9 R" J7 M___________________________________________________________________________6 L, ^/ o- A2 }6 F' Y8 C
( b ]" |/ F& ]' I
Method 04
" G }% l5 ^0 U" x6 `/ ^% I; K" ?7 n=========
& ~2 b7 Z- B6 _# h0 |! H c7 E, ~. [) r: }
Method identical to the preceding one except that it seeks the ID of SoftICE* y4 O% b4 y* u/ N5 I
GFX VxD.
Q! Q1 r1 f5 F( Q: }0 @% X! c2 w+ b4 y. I4 Z
xor di,di
$ R( n$ }! C* O3 Q! |) i mov es,di" {6 l& X i( f2 R& i
mov ax, 1684h # }& o4 i, P, ]' j
mov bx, 7a5Fh ; VxD ID of SIWVID
. X6 \# s6 I1 }/ q3 C int 2fh
2 L, g4 i, r1 n3 } mov ax, es ; ES:DI -> VxD API entry point# k0 @' W0 R& E! r+ r
add ax, di
4 A. b: H. @% j0 ?* M& U6 h* D+ e2 D test ax,ax
3 A7 l, t7 r7 j0 S { jnz SoftICE_Detected
. b, J8 l9 b; x8 R* J1 m* \$ W" @* ^, a: J X6 c8 n
__________________________________________________________________________( O8 \# e6 \* m+ Q5 A
$ F9 \% Z l; l( g8 D( b2 a
$ T$ U1 Q5 s7 X1 E+ d% A
Method 05* j% A8 |1 u; g5 b/ k4 W- h) D `
=========
1 f; {5 k- T% i* D, a6 W0 N
9 _( |) d) y/ C" a8 a. g5 W8 |Method seeking the 'magic number' 0F386h returned (in ax) by all system
! K. `: J) p$ a- {debugger. It calls the int 41h, function 4Fh.5 t2 j5 A: {& X3 Y0 |4 A
There are several alternatives. , n* s4 e3 @6 ~
% ]0 o! |2 T `' n' CThe following one is the simplest:3 {5 s4 M" I* V
' A0 \ k+ V4 r" G
mov ax,4fh
5 |1 \) I& [. G4 t) b+ o int 41h
; p* R X3 I0 d! x5 |& R* b1 s9 g cmp ax, 0F3869 f9 L2 o* L2 ^# Q
jz SoftICE_detected* z+ S1 f. ]# ]7 O
' U4 |/ R1 b2 d! g( ~9 _
' l0 H# p+ ~" R1 a$ q, B7 GNext method as well as the following one are 2 examples from Stone's
. L9 p/ F' S! ]% t" ]3 ]8 @"stn-wid.zip" (www.cracking.net):
/ {/ h) M7 A9 b' O- i4 G
& @- S0 }" ?' o: z. T0 \" G3 L; j mov bx, cs& B' M7 d7 Q% q" _1 W2 Q8 ~5 \
lea dx, int41handler2
h6 Z) X: Q! q3 D% H xchg dx, es:[41h*4]& x, }+ b/ r# q/ o1 w. e" N* {
xchg bx, es:[41h*4+2]
# A) b. v. }: `& i5 ~7 n3 d mov ax,4fh! H) ~+ \* L* `
int 41h' t' o( ?4 j( @
xchg dx, es:[41h*4]
7 U& @* m# r g5 R0 R7 B xchg bx, es:[41h*4+2]
8 X7 F) A) _! w$ L c cmp ax, 0f386h4 N8 w7 i! {1 R' _
jz SoftICE_detected
2 T4 n) q! G4 K, T, U$ e
2 X& i5 {& ?* v2 a" }% a% v" Rint41handler2 PROC1 P% b. g8 g& X5 r
iret
: H" [# H5 i) b1 Eint41handler2 ENDP
( V6 m% H' i. ^& l
5 v4 w+ g% v! V- Q
% K) t4 k$ T) `* G# B_________________________________________________________________________/ t! n# r% j3 a+ h6 I
( c) T' Q% _& s* F" c
/ n2 z& h: \1 J. A' n7 V2 T% yMethod 06
- b8 U2 O3 F1 k# h: K0 j- a=========1 i2 u" M6 h: Q V2 \/ T t
6 }& V" ?' w, E& W
9 y% _4 o. _4 `& x8 g
2nd method similar to the preceding one but more difficult to detect:' W8 C; p% I! V& U4 P6 k$ J6 A' t0 I
/ H7 V; `5 u! f1 Q% N" g! x) J
1 D A8 y: }- O' I4 u( e4 i
int41handler PROC( V- a; Y( [* l& |' y: o# h
mov cl,al
3 X. y/ M( @& X iret
& X- Q8 `! g8 Y P4 Yint41handler ENDP' M; r% z4 Q3 `. N" l
: Y6 H. c4 g: K0 {5 [) b! o3 e8 G. r+ f% V' V
xor ax,ax
) E) ^0 R6 t' q# G/ W mov es,ax' u, L2 ]( O: n3 k
mov bx, cs& s% L# h! c/ I' H' ~* N. d
lea dx, int41handler
3 u& O, _7 L1 s xchg dx, es:[41h*4]
- |) h+ d O) | xchg bx, es:[41h*4+2] m* [2 t! |9 L# k
in al, 40h$ Y* _3 z2 {! E% h3 ]) @% C# s; U/ H
xor cx,cx6 I% y$ M* m4 l- G: P/ P
int 41h
$ S" s2 ^8 C8 X xchg dx, es:[41h*4]
% v7 c/ I1 p' M+ @ xchg bx, es:[41h*4+2]
6 E7 _7 ^& k2 y. t0 u cmp cl,al, b* r% m# P, N; X) T" L1 N/ D
jnz SoftICE_detected0 J$ U/ n/ K/ A w& U
6 p- u2 i8 w( E: Y
_________________________________________________________________________6 I% U; S! f3 T0 Z' V* S0 m
( d1 K4 d' R! K( @1 G7 C
Method 07" S; g0 V" W Y1 a7 Y# m% E9 n
=========" ?" r& d5 b1 Y: _. V0 ?
6 s: g% ^. H, p* f# l# g7 SMethod of detection of the WinICE handler in the int68h (V86)
j3 A8 Q! Q& y3 f: l1 ~9 k1 Y: L& T5 |. ]
mov ah,43h5 q `' Z ^+ f$ i% l. H
int 68h. t. _% W- A/ w8 v9 O
cmp ax,0F386h; b; ~, `4 i6 a/ ^0 w
jz SoftICE_Detected* x+ y6 v3 o+ K% \& p
& j8 v: `, F: F0 V2 H5 a: z9 g0 i2 {: J" F: K* W
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, @* \& E5 c2 C k/ ^! B* [. a
app like this:
6 ~# ^. z" Q( r5 f8 @6 `6 q' R4 o+ M
BPX exec_int if ax==68: w8 ^3 N. |, t
(function called is located at byte ptr [ebp+1Dh] and client eip is. N) K, ^7 e( G
located at [ebp+48h] for 32Bit apps)9 w2 c/ ~& _- P/ U
__________________________________________________________________________, T3 p4 s' [8 y: X2 I j
% K: _; G0 u; v
/ v* x6 a2 H1 L5 u7 CMethod 08
, r6 d+ |' E& ^$ i/ F4 w8 W=========
* s& T ^/ B+ o) ]) } d% e
' I$ t9 M! d% A& Y$ QIt is not a method of detection of SoftICE but a possibility to crash the
" F" Y$ A8 L0 [7 g# K2 a9 d0 X1 Qsystem by intercepting int 01h and int 03h and redirecting them to another$ ~: e4 b- j/ Q+ W: R9 ^& C5 G
routine.' J- R4 D& @- U0 M1 [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 {8 J( W& z! o8 ^; d
to the new routine to execute (hangs computer...)
$ e! e# G% j. D2 _; d' o( z7 b# Y- i8 R! o @' w9 l, _
mov ah, 25h
y- ?: F. ^1 C# _$ u mov al, Int_Number (01h or 03h)
' i( p* {9 J9 _& i6 I; j mov dx, offset New_Int_Routine
% e. v& m& m3 z, U3 y" d/ ?6 }4 [ int 21h R; Z `$ X7 [. M6 T* S. i
6 \0 w1 I% X5 M__________________________________________________________________________
3 f# m. w$ ~7 @7 F# V
# W6 V) |8 c2 I2 r; z) w( [Method 09
" r' b* ^! O3 t- h( W6 ~* j' C=========
& T" w3 o9 S% R+ U. Q0 g. h& M1 w% U8 U- B& U: V. F* u2 @
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% a: a: ~! L, @- i1 G! Hperformed in ring0 (VxD or a ring3 app using the VxdCall).6 i1 o; C1 j7 u& c; E
The Get_DDB service is used to determine whether or not a VxD is installed/ @8 b# @1 z `6 t
for the specified device and returns a Device Description Block (in ecx) for
; x( i: p" [- G4 U9 H7 `6 athat device if it is installed.6 j7 _0 m3 [% t1 ^1 E! i0 S. Q
) D8 S' X* G- V7 z/ B mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. [% G, X7 T- ?, r2 o
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-) s/ s$ Z7 v1 e' ]6 P% {( T2 x
VMMCall Get_DDB' a; T. C( j7 l; Z" `
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed y) Q3 H2 s8 e
$ K3 E0 s7 f4 ^, INote as well that you can easily detect this method with SoftICE:
; N, k+ t: V# F- {: I bpx Get_DDB if ax==0202 || ax==7a5fh5 S/ ]+ j7 J! [
8 ]9 d0 p; Y' k6 X5 |: P
__________________________________________________________________________
& a6 X: u- w7 o& V' N) q, X
4 O7 s( Q. X% t- ~' T3 o U( S2 rMethod 10# J& ~+ Q3 R! E+ C
=========. S* s m0 Y1 n+ k o1 m
2 a. D7 a+ B& Y; O=>Disable or clear breakpoints before using this feature. DO NOT trace with9 H1 g# w- i, D( E$ [0 a, \
SoftICE while the option is enable!!
8 A$ E8 [3 m1 `9 J/ h5 j( w1 Q3 \5 Z* \# C
This trick is very efficient:* E: G+ B" H; e9 R9 u8 g j9 h
by checking the Debug Registers, you can detect if SoftICE is loaded
1 E$ Y/ ]7 l+ u: p! R' |' \2 z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
) r& b8 w4 |, S R2 M4 K! [there are some memory breakpoints set (dr0 to dr3) simply by reading their- D9 b8 }" H& M8 ^8 y5 o
value (in ring0 only). Values can be manipulated and or changed as well. l, L( E4 o* A3 ^+ J% j% T1 @
(clearing BPMs for instance)
, ?; I5 t/ p+ H# ~" g, G7 l+ n6 e2 B, D% X' V
__________________________________________________________________________: o& c# S" Z# n; b+ F
5 q6 x7 O( E) c/ ]; n9 z
Method 11; R& O2 c$ y1 {: L
=========
! d4 h# |4 Q d+ V" A7 A \. L% |9 {0 g4 }
This method is most known as 'MeltICE' because it has been freely distributed( }. b, N+ A* D% N0 {* e- p
via www.winfiles.com. However it was first used by NuMega people to allow5 e& |$ ]7 x' W- Z
Symbol Loader to check if SoftICE was active or not (the code is located
' b" S" [. M% K0 y' v4 y U3 j6 @inside nmtrans.dll).- d) T2 R3 S6 ?. z
) `% G" u" l: |) Z8 ZThe way it works is very simple:9 A' m! r5 s, U) V; L# `' l8 Z
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 z8 c/ m3 g2 O- L/ S, z- ]4 SWinNT) with the CreateFileA API.% W: v6 r( J+ s1 [6 W
$ j) T! u0 @1 u3 C$ L+ {0 ~2 x2 Y7 |Here is a sample (checking for 'SICE'):
6 [* h; X# `! L7 U! C: s; k5 _% ]/ H
BOOL IsSoftIce95Loaded()
6 O: B1 t# K6 L" u{+ V, e" \+ |, r' G
HANDLE hFile; : X/ t2 ?% l6 b5 M7 i/ [$ M% p7 u8 |
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 j. m8 L% }' I3 |) |2 ]4 S- z( i FILE_SHARE_READ | FILE_SHARE_WRITE,& h; b* |' r4 D" S+ s' o1 x4 ~
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 z% c8 A. w' f' u5 s. P ^* S if( hFile != INVALID_HANDLE_VALUE )
# P7 [4 S' |7 s {/ B5 K: H8 }, {( |
CloseHandle(hFile);2 S- j# O1 ]$ \% }, `5 j
return TRUE;0 ?# I- x: [: O$ f5 l
}
" c+ B6 p4 W+ n return FALSE;
4 H' ^& Q1 u- p2 q6 y/ S; A}0 z* A& ^4 W/ r; U; q3 i
% t6 l/ Z5 \) C9 m5 LAlthough this trick calls the CreateFileA function, don't even expect to be$ m" I9 R1 }9 k0 B- G
able to intercept it by installing a IFS hook: it will not work, no way!- {0 R- v$ F* l4 m/ Q& d
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 [& ]& n2 q0 i1 D! P7 rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 Y2 b; O8 m6 [" Q+ \7 a
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ r% W/ y$ _& V8 H1 }6 U$ Zfield.( W$ ?8 ~' R. Q3 M
In fact, its purpose is not to load/unload VxDs but only to send a
+ F& u9 W+ |: z1 L$ X: t9 ]W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)2 S9 |/ M# C# q b. A
to the VxD Control_Dispatch proc (how the hell a shareware soft could try7 ` w. [8 {2 H8 }) h+ I& E1 T
to load/unload a non-dynamically loadable driver such as SoftICE ;-)., W% W( M" f: U( v
If the VxD is loaded, it will always clear eax and the Carry flag to allow8 b; ^: Y- z' a K6 M
its handle to be opened and then, will be detected.
2 W) \0 _" w7 f MYou can check that simply by hooking Winice.exe control proc entry point: D2 y1 d! m$ G! Y$ j+ k/ i
while running MeltICE.
! D! y( M. r( W' c, l6 `) A% u5 B
& {' H p; o" ]/ B( M- ^2 K* [
% S0 Q. ?+ P4 M* ]4 l% y 00401067: push 00402025 ; \\.\SICE
6 @6 `9 n. I3 B% t. `/ ] 0040106C: call CreateFileA
5 |2 m1 c+ }1 A+ V 00401071: cmp eax,-001/ I# f' ]" k* x. I x% v4 h
00401074: je 00401091& n8 Z1 M+ K. C% t0 e
! C9 g- e7 M4 L3 K& E4 Z, B9 f
6 F+ q1 b& i$ n7 _0 x
There could be hundreds of BPX you could use to detect this trick.
. T( \, R7 M2 @-The most classical one is:) P5 L \6 Q7 s7 x* t0 U. }
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 q/ y0 Y+ T9 }4 }
*(esp->4+4)=='NTIC'. C6 I2 P+ ]9 x
5 |; s9 E0 @: p8 i% V" u-The most exotic ones (could be very slooooow :-(
A5 b7 D; H S) w BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% K! K4 o" T9 q ;will break 3 times :-(* o+ U0 b) ?+ p+ U
) U: d! ]& G7 Z7 s5 C0 h
-or (a bit) faster:
3 G9 G, J m# ^7 b: z9 \1 s; E1 f6 d BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 k8 I- }; G7 y" t7 l' k+ g) Y7 j
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
, O3 x9 [% j; d u ;will break 3 times :-(
" q+ D- k( B! V* _) Y/ r
" l. M5 p5 h7 O7 A-Much faster:
/ B7 w' l3 ]* i: y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
$ \$ I: A c$ H( x' [2 d [
/ s- e/ w3 x: Z8 j# i& Z7 kNote also that some programs (like AZPR3.00) use de old 16-bit _lopen& q- D1 P* z7 T& \: W6 h
function to do the same job:
, H; M9 n" Y2 g/ B) \
" c) U: d1 K* Y+ z7 q- P push 00 ; OF_READ- P4 v" Y: x! g4 _& l1 ~
mov eax,[00656634] ; '\\.\SICE',0
9 g. {; e; |8 m push eax3 M* s# K/ v/ k/ p. c: K# d' ]# i4 R- E
call KERNEL32!_lopen
8 d+ o) w& B# D; _3 r% q3 N inc eax# d ~4 S* W; I4 _2 \! Q: J- o8 i
jnz 00650589 ; detected
% G8 V3 U" H5 A& I, t% s. U push 00 ; OF_READ
" x6 F, W8 X- l- z+ \. c9 K4 Q, U mov eax,[00656638] ; '\\.\SICE'
$ s- [8 h9 X' |, A( s- }% N$ l push eax
2 f8 b( _3 F, @# j2 p: x$ x call KERNEL32!_lopen! N4 H$ T& B3 E* S% X) r0 u
inc eax
2 D- c0 k5 V% q* k9 @ jz 006505ae ; not detected9 G' T, g" g5 M9 F5 \4 `
# j6 l1 `' I6 s- o: {8 V4 l$ ?- l \3 c( r! E
__________________________________________________________________________; f! g o( i0 A4 R
+ s* c6 `! F+ ?5 V# L
Method 12
9 u9 H3 _( h$ d/ d) r+ I: C========= F& A8 N& a N9 m
3 n1 g4 Q7 E* m7 n: cThis trick is similar to int41h/4fh Debugger installation check (code 05
1 F" q( b5 i' k ^% @0 o& 06) but very limited because it's only available for Win95/98 (not NT)
- a* ?: B) M% [ T9 g" L' J# L1 Sas it uses the VxDCall backdoor. This detection was found in Bleem Demo.) [+ b5 C8 f+ J3 I* ~
6 m! l/ U2 ?3 K% I6 ~# k3 b/ b6 \# D push 0000004fh ; function 4fh
1 {; }- W! g. ]: M- u' ] push 002a002ah ; high word specifies which VxD (VWIN32)+ t N5 F% g% t# `
; low word specifies which service
# I/ o: [6 w7 m$ _" I) V! N& e (VWIN32_Int41Dispatch)
- B' l: S |4 E! J O9 s call Kernel32!ORD_001 ; VxdCall4 c. [' j) q2 @; s
cmp ax, 0f386h ; magic number returned by system debuggers7 t7 P2 ]8 ~' R( i _ \" g
jz SoftICE_detected
2 j# N/ x6 p8 P7 x3 S6 B: ~5 o' Z5 {7 s, f8 q% X
Here again, several ways to detect it:
7 W* N6 c) H' e- E& @1 o u( r0 \! s5 ?5 I* f h
BPINT 41 if ax==4f
) D7 ]% O. p, q, d# @- i
& ?# t% R3 A% ?4 G& { BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
4 r2 d3 h0 |. v2 [2 u" o& m. q. n
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- z6 r4 A) [8 C4 W8 G s4 v5 l
9 j7 m$ V7 E8 T# m' g BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. C/ I2 E5 I1 r- K' `! \$ Z( {, X
__________________________________________________________________________ g+ E! e, _, K- _
: X) [7 k! C" ^- g. lMethod 133 h, x, q5 a2 s/ s2 O4 Q/ P
=========6 t; R8 V" p# a6 U$ W
2 ~- t2 t2 R' ~( y* L' d% `Not a real method of detection, but a good way to know if SoftICE is- A4 I2 A5 g, @
installed on a computer and to locate its installation directory.$ j- f. d; I* e0 B
It is used by few softs which access the following registry keys (usually #2) :
0 ?, ~8 |2 @$ O6 _' v, a' ?, z, |% G0 W5 g2 w8 m9 c7 P& c2 {4 K
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! {6 S0 y7 E, e u7 @3 h& }\Uninstall\SoftICE
8 Z- N4 [+ ^% m+ N- V3 h0 W- l2 a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 _) p- W+ q( w; H4 g- N4 P. t
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 e' ?4 h3 k, ?) e1 D3 n' Q
\App Paths\Loader32.Exe
9 |4 `+ B* y: T% G( ^
, _( }. l/ s ]
1 O+ N6 N+ X& G' u( N2 pNote that some nasty apps could then erase all files from SoftICE directory& c3 ]& Y: z% m
(I faced that once :-(. g: m2 ?9 K( d& Q. ^
. A+ ~0 u/ u7 i1 g+ T, r6 }Useful breakpoint to detect it:& {5 f5 h& u) \6 F: B& ?
! E6 X4 q9 v1 t% N- O. H BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% w" g O* R# f/ k6 b {4 A6 M5 {
: L M" W( J! J8 w' a6 F
__________________________________________________________________________7 Z% n2 I9 Y! U
" T# U0 N6 ^, n) C
2 H8 D1 G: l, H4 ]Method 14
' [6 \9 [8 B8 R4 z=========
( Q7 y; d- {, F$ g" C1 N$ m7 `% w# z" c0 ^, \. V
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
r5 u# x/ P: v/ D% bis to determines whether a debugger is running on your system (ring0 only).
: y. z* _* D% R
( e, z+ V7 n; E8 R! V# m VMMCall Test_Debug_Installed* r4 s% R6 @6 r2 H+ y* Z% }3 Q
je not_installed- O* J2 E( ?! @
5 K6 @' r D: ~* r7 N( k
This service just checks a flag.2 S! F6 e3 K& m v6 s7 X
</PRE></TD></TR></TBODY></TABLE> |