<TABLE width=500>
1 } T1 L$ h3 S |( B1 C<TBODY>1 [; }+ w! k3 l9 i9 o
<TR>0 B. i/ J8 I9 B) {' C
<TD><PRE>Method 01 # n+ _$ |% R/ \' _+ g
========= a; \$ P* y( k. l9 F% c5 W
' Q1 g/ H! I6 m: ?5 b# u; RThis method of detection of SoftICE (as well as the following one) is
+ p1 V: f! U ?7 \9 U: @' I- kused by the majority of packers/encryptors found on Internet.
: V2 p4 L" w g8 V( u2 b( ~It seeks the signature of BoundsChecker in SoftICE5 w* Z- J: H f5 _$ G
$ ~2 G, E' N1 c
mov ebp, 04243484Bh ; 'BCHK'
0 R' } ?. K" @ h mov ax, 04h
* E- N$ F: y1 x: V7 L int 3 # j- I2 U# j' u. b& h- P
cmp al,43 T+ ~9 P Y' o- N3 Z# _! J& \' |9 F
jnz SoftICE_Detected$ \0 x4 @% `( F* t/ @* p' y
4 a) z9 {; g7 t# l8 @9 l2 y___________________________________________________________________________
; c# Z8 Q/ ?% V( s
8 J8 p1 I4 @7 o% c) ]: PMethod 02! f" K. I% ~- _3 [ n
=========. \( k- k0 g# B- V1 k
/ Z! H' x2 C I% H _7 o+ k
Still a method very much used (perhaps the most frequent one). It is used
) b' p, U0 {/ U2 Y' ~' `to get SoftICE 'Back Door commands' which gives infos on Breakpoints,) O" a/ e2 i* _
or execute SoftICE commands..." w2 ^# y9 L0 x0 Z0 z: f- D5 a
It is also used to crash SoftICE and to force it to execute any commands
7 |- {" d8 t( c0 g4 D# U! p' j, v(HBOOT...) :-(( c% u ?* Z$ j7 v# } i2 }
' S8 l L9 E1 Q: m1 WHere is a quick description:2 ^+ n5 t0 v1 T
-AX = 0910h (Display string in SIce windows)$ q- c# H' j; q* g
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
0 t- S- r% q8 v" @& ^-AX = 0912h (Get breakpoint infos)/ I& Q2 d3 |/ r$ V3 s
-AX = 0913h (Set Sice breakpoints)
+ w7 m! e) ] [! o, v' e-AX = 0914h (Remove SIce breakoints)
) a9 g7 Z+ [5 f+ R' z
8 c; W2 R. L! |" nEach time you'll meet this trick, you'll see:
3 D" D; f( J9 D( R8 E-SI = 4647h
' e5 y* {9 M$ l-DI = 4A4Dh
5 s" n. j% u% uWhich are the 'magic values' used by SoftIce.
' I7 W) M& k/ {8 WFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
& z S0 j# Q. h3 n+ }* y3 @
- s1 Z7 p) |+ v# [$ S" u7 K/ x. V7 ]. VHere is one example from the file "Haspinst.exe" which is the dongle HASP6 O# W1 v! y6 ?9 w& z+ w
Envelope utility use to protect DOS applications:
: s0 a" w& a& W0 ]- N# K
$ h9 K% i, O4 X2 q1 {5 Q
Y! C* h3 Y0 g G8 c1 {: T L- {4C19:0095 MOV AX,0911 ; execute command.
2 F2 L! C0 {; B4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
3 m& R" c2 d2 j4C19:009A MOV SI,4647 ; 1st magic value.
+ m2 [: t8 o+ L4C19:009D MOV DI,4A4D ; 2nd magic value.
: D: d3 U8 a; L; @5 ?6 p6 F2 @6 D4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 ]3 r2 m' m3 K2 p
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 R7 I& D! S/ R( y: A. I! y
4C19:00A4 INC CX* p/ |4 I* X% V2 [5 F
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
l- R( ?( h$ f; S/ x8 K4C19:00A8 JB 0095 ; 6 different commands.! U% ~" p8 F4 G' L
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 i0 u7 o; h ? ?+ L$ ~4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& n5 R# o% a' N3 S9 r( o- ~5 z2 V- S) O6 K2 A( e
The program will execute 6 different SIce commands located at ds:dx, which1 M( Y1 ~, e6 G$ Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 a' C9 X& v/ B, i G
% \1 O; l% c8 m5 f! l3 d
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: C% k8 |5 l, U6 N% `4 E: q___________________________________________________________________________
! ^: e2 v, ^7 ~6 F5 w. q, K$ L6 z1 m) \# L1 A# O9 c
$ E5 `2 v+ n, N1 E/ K& T2 b! G+ f9 P
Method 03
. y) {7 E `, H=========
5 R6 j+ d! _) t5 r, j- J* Z9 R* q4 C6 f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h: g) ^- J( e& S2 v2 R! s# e
(API Get entry point)
1 I: [7 D$ Q2 Q, L% u: A6 ~
) c( E0 q h' J, W. r
3 a& S; K) W2 Y2 u: b/ S4 D xor di,di6 a& H% p, W7 _7 k9 o* W
mov es,di
" @7 i1 v; I; D M mov ax, 1684h
' { u% P8 k2 Y3 \; f mov bx, 0202h ; VxD ID of winice
( A6 R; {: m2 m( }: D int 2Fh
/ [# |+ S, t$ [: {6 D6 [& f3 i8 y mov ax, es ; ES:DI -> VxD API entry point
2 e' E- y; i2 V. F4 m4 q add ax, di# t3 X* f1 F" O1 w. D' M( n4 ~
test ax,ax
0 c2 ?! b9 w! v" ]& M7 y' I jnz SoftICE_Detected: B* ^' R* n9 F2 d& P
7 d C7 J1 [3 s) u___________________________________________________________________________
1 E" b) {9 M( W( x* @2 t) q' C. O" Z9 L3 D3 b0 h1 ^6 c6 O
Method 043 Q+ O5 n$ {* Z% P6 U* ^" P
=========2 L$ ]& E2 E2 `$ d T
/ o4 W# E8 ?2 l) WMethod identical to the preceding one except that it seeks the ID of SoftICE
8 c& t0 g/ `- \- X: x- f' `GFX VxD.
3 W* c' m# } N. U r5 E; c; [8 h3 y
xor di,di
' w% [: O. |* h" f. l mov es,di Z# d& B3 ]1 A2 F$ G; }$ D
mov ax, 1684h ) @+ z, J" [4 ?6 b, S1 X' }
mov bx, 7a5Fh ; VxD ID of SIWVID
% r N8 I8 @" M/ m u1 j+ Z5 F int 2fh) E+ A* d* [7 M* |- G8 c: n
mov ax, es ; ES:DI -> VxD API entry point
7 |8 H! C9 N: m! L! V i add ax, di: p p2 U% a* ~( G. w% U8 S
test ax,ax, A: |- s5 O2 R* s) N6 k. s
jnz SoftICE_Detected7 i* M0 v; t" w1 |3 n1 |% w5 b
4 f$ i' v- S* [1 |: J+ ^ {5 |__________________________________________________________________________9 T M6 z$ q' M& z, G
0 G; s" r. L d9 i: \9 r
) a* k9 c, v. L
Method 05# h3 v P7 z; ^6 q/ W4 |8 ]4 C
=========
& g6 v4 x0 x. R/ g# n0 ^9 X2 [* e5 X
Method seeking the 'magic number' 0F386h returned (in ax) by all system# Y$ R* S/ k/ c
debugger. It calls the int 41h, function 4Fh.
$ m R9 n+ V |4 NThere are several alternatives.
/ [; \+ y8 V: ~6 w" |- e) ]7 F1 d; g' @" t; T g% J6 l
The following one is the simplest:
2 j* N, E) Z1 r
: K x5 I0 K: j9 @, G9 d0 v* f mov ax,4fh
, S" A' C: ~- O; l int 41h4 O& K; s8 F; y6 z' @- p9 y: f
cmp ax, 0F386
7 n* S# {% o. `6 _# P& M jz SoftICE_detected8 D- r5 x" b7 V( R9 g1 a* D1 {9 s
9 T# ]8 `1 R5 ~
' P' k8 ]( w, E; O" |- jNext method as well as the following one are 2 examples from Stone's ( R. ?, \' O& ] ^/ z6 v/ T/ K
"stn-wid.zip" (www.cracking.net):
- F% R; K9 R1 y
5 P! P* C; ]* B: Z mov bx, cs8 s6 q9 |3 l9 p! k% [# n7 v
lea dx, int41handler2- a/ w3 \% p1 h
xchg dx, es:[41h*4]# O- v& ]9 n* l; g3 z
xchg bx, es:[41h*4+2]; j( ^; q/ N! W& e3 V
mov ax,4fh
9 _) z" m2 \+ r$ J. K( I int 41h
$ }5 ^7 G9 Z- E xchg dx, es:[41h*4], R6 {: @! {9 `! U& e; m
xchg bx, es:[41h*4+2]
/ Q6 a$ o. C! h; Z, ] cmp ax, 0f386h
* p3 e) A2 j2 o/ e2 P- `7 f jz SoftICE_detected ?! i" Y7 |: S# Y- f
7 E# U2 B( @, F! {+ i2 F" K7 Q; ~
int41handler2 PROC2 \( v* P4 |0 z! p7 K
iret
' T% |5 [6 T$ a( X5 Bint41handler2 ENDP
; {3 l7 F( d, [( a3 S/ T
- i- p4 f; p2 {* R; _! Q
@7 z6 V" y1 o7 m_________________________________________________________________________
6 I) z; C& }# z5 L' x8 w v* \! p7 j. @0 Y
! k: @3 C8 f7 x$ cMethod 06
4 \! c H# a( Y, e5 ]=========
0 E! M. v( E5 n6 @6 @3 Y9 _' z8 D4 `( r7 I" S g
, h. B- m6 b. Y% L, V( a, z
2nd method similar to the preceding one but more difficult to detect:
6 p2 ~" g4 D' `& |) J1 A4 Z1 R9 G" d! F; y2 l7 I
9 K* d J! v7 u1 z- Z, }/ Q* U
int41handler PROC
/ a- |* j" M1 d3 O5 k mov cl,al7 T: n. m2 g; k7 y$ W
iret
- K- y ~+ ~' B" vint41handler ENDP3 q8 e' l9 |$ Q$ b) m6 ~* |( H
* f8 w6 i; A" M: _/ L# L
4 L! J6 K( v8 q- G1 ?3 i4 M xor ax,ax+ s5 D K0 |! g2 S
mov es,ax
5 y5 F) M+ [. T+ B8 {1 d i% Q mov bx, cs
X! H( ^: z% ?3 O0 c9 {4 \ lea dx, int41handler. i% I/ F; l e
xchg dx, es:[41h*4]( ?$ ]2 m" F! {6 S7 {# _
xchg bx, es:[41h*4+2]/ y" z, D# C3 I
in al, 40h# e" B3 @6 ~5 u+ _- q/ }
xor cx,cx7 `) [; K# C) W6 W- J
int 41h9 F' J" F; k2 v' \* B
xchg dx, es:[41h*4]
- o" F3 |4 B* \ xchg bx, es:[41h*4+2]
/ b1 ~8 X* {. L& u' q# Y cmp cl,al: Y4 \8 _$ Q6 F0 K; }
jnz SoftICE_detected
" m b0 h' f+ C& i9 B. U! d" u
7 c3 g7 {& ~2 _0 r_________________________________________________________________________
6 r2 U% {& S! F r) f1 S6 H1 Y7 d8 y6 Z" B: n- U8 e
Method 079 M( d$ ]) D+ ~/ s$ ^ ^$ s- t
=========
# F2 [. [1 v% P a8 j* k: ^) W- ~4 B# J3 w m A4 D
Method of detection of the WinICE handler in the int68h (V86)
/ v- v& X: ?, J6 \$ m5 i$ ?3 K4 j+ a; L0 _9 s
mov ah,43h% B6 P1 R, U* c% g# h
int 68h
: v1 j6 n4 R. U, ~4 M I% j6 e cmp ax,0F386h
+ n! n2 d I. A3 r+ k: F P jz SoftICE_Detected
: u4 I e! a6 W3 F3 V" t" A }! @3 f; H s) C' N
$ \4 L6 `4 Q3 T; ?* ]2 x
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( c2 S3 s% L& J! {7 E: g2 W app like this:
* p8 I/ g/ y. ]" _0 _. U _/ D1 I& _
6 d- \4 a/ ]% z BPX exec_int if ax==689 n! e% Z- T7 m& l
(function called is located at byte ptr [ebp+1Dh] and client eip is
& j# a7 }+ a3 L0 F6 Z$ e/ Y# ]; r located at [ebp+48h] for 32Bit apps)
/ }* Q# j& c8 o3 P- ?1 ^__________________________________________________________________________
+ ~5 m u o9 r' V$ ^) O4 ?, d! M- H2 p0 ~& _
4 A4 u! Z% [' Z! ]5 VMethod 08
y& N# i1 q! V$ M* s3 ~=========
$ ^- t6 z% K0 j4 {0 k1 s
6 I* Y% ]5 V' U6 i/ oIt is not a method of detection of SoftICE but a possibility to crash the
8 @- L8 K. Q( ^5 n8 Qsystem by intercepting int 01h and int 03h and redirecting them to another' b3 A$ p* g/ E. {5 [
routine.5 e0 ~8 [, U: Z0 w% [# g
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
- r! |( `- v, K/ i& ~% e$ Q5 nto the new routine to execute (hangs computer...)2 q. |1 ~0 W) u; l; U
/ Z Z5 ]3 K" A! p mov ah, 25h' \2 T2 Z) f3 E
mov al, Int_Number (01h or 03h)
* L9 A8 @# f0 \# Y- n mov dx, offset New_Int_Routine
5 r9 J8 A/ {7 r5 r6 v) O int 21h
3 d8 H$ I/ Z' C9 F6 u. ?+ K! ]4 z3 U) P% h
__________________________________________________________________________3 k- h) S+ |9 f9 A0 t5 P2 H
; y1 S! J+ l- Z+ n' ?0 H
Method 09
2 x. ? w2 O4 q9 P! A* F0 B=========: G* ~) H; f4 D0 C0 t
$ e) k6 t& H# o& w) r2 z. {6 e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 x1 ?1 v0 X n
performed in ring0 (VxD or a ring3 app using the VxdCall).
. _- c" E h' _The Get_DDB service is used to determine whether or not a VxD is installed7 {. q" G4 q* \& E
for the specified device and returns a Device Description Block (in ecx) for/ x( W A7 K& _# p6 u
that device if it is installed.
n0 v" m8 _- c0 L5 Y" n/ j3 ?" C1 Q2 N5 F* H
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 V4 S& E, q8 a; n! ^
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 ~' h7 k: S9 F5 A% r- R: `( o
VMMCall Get_DDB/ W5 V D& S) p5 d5 [
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* P8 y: d4 t8 x/ H& l
. R! H* o" \1 x4 lNote as well that you can easily detect this method with SoftICE:! H( U u6 m$ g7 j" |3 h
bpx Get_DDB if ax==0202 || ax==7a5fh
1 u8 _5 E' x5 i {: S: ]
- f x+ W2 R7 G. u" M* A__________________________________________________________________________5 k4 h& U& X+ h% e8 A5 O
" b* ]) ]; t% {& q2 ?( SMethod 10
5 |- n4 W& G& m( z6 I* h$ e5 [=========0 \. R1 b* l6 K9 `; |1 {/ j
5 b$ c. M! X6 y* l( }" {2 }=>Disable or clear breakpoints before using this feature. DO NOT trace with
( @" a% `9 z0 r& ~: L SoftICE while the option is enable!!
* a8 ?/ L3 x' ~' \* z0 d! \+ u" v$ C) S. D6 b% z( S
This trick is very efficient:! v3 a$ A' _# P* P! k. D, ?7 s6 b* U
by checking the Debug Registers, you can detect if SoftICE is loaded* d9 o _$ a! h9 C! ]
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ x5 e8 }/ j, R9 othere are some memory breakpoints set (dr0 to dr3) simply by reading their t0 [/ @$ R2 p) @
value (in ring0 only). Values can be manipulated and or changed as well% x) N4 {$ g5 h$ z D3 K1 f/ o% }
(clearing BPMs for instance)( f, j" o# i- a7 Q1 A& g( U. ^6 r3 s# Q
' e$ d) F$ b3 z6 W! B: s ^" v__________________________________________________________________________
3 l# ?7 N: q* N7 F: \% s3 K8 M- Z7 M( r6 @% @$ u9 U1 N, v
Method 11
9 A5 p% ?: I( L=========$ s6 ], @6 W# w& F+ U- h
# A% l8 g' c2 t
This method is most known as 'MeltICE' because it has been freely distributed5 i' R! R3 Z% o
via www.winfiles.com. However it was first used by NuMega people to allow
+ }9 Y( A3 E* t% VSymbol Loader to check if SoftICE was active or not (the code is located; R6 d- J9 B9 P! s% [
inside nmtrans.dll).5 f0 X. R. `& N5 I% a/ E, s a
1 Q9 e$ b- ]5 w/ q& hThe way it works is very simple:
/ i) R1 _1 [* t& x; z. k2 D" L. NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 ?. R' G3 c* M( n9 ~7 h
WinNT) with the CreateFileA API.
* ~3 c+ {' t3 @/ J
. U) ], {# x; X/ y+ Z) r' PHere is a sample (checking for 'SICE'):
- q4 u; Q2 C# I# M* E* h ^+ O& Y3 T; M# s: |% l
BOOL IsSoftIce95Loaded(), E9 S6 ?1 A) E9 H$ _% x; `( T
{
1 ^+ z8 w" ]4 k) o3 k4 a HANDLE hFile;
) Q: K& ], S% J4 J; N hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. F+ d- b% P* e FILE_SHARE_READ | FILE_SHARE_WRITE,
. D& r: U0 J/ [" ^' _: C NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 `) y: k6 h2 L) D! B
if( hFile != INVALID_HANDLE_VALUE )2 [$ u1 Q. K# k* q u5 v
{/ l/ v# b M) n, V
CloseHandle(hFile);- }# C& f( J: O6 i$ N' a/ j
return TRUE;1 f; L3 c4 [1 j9 k. |
}
+ k& l: C+ ]) S3 U( c6 ] return FALSE;( o1 }- O( n& y( i4 K2 r9 {! a
}
+ @; z8 o `# C' W; P% V. H/ O8 v5 H
0 {. `; A x. h4 G" ]- uAlthough this trick calls the CreateFileA function, don't even expect to be
4 I9 Y; R% _' C" _! Eable to intercept it by installing a IFS hook: it will not work, no way!
2 Y7 ~: g. P* z5 d iIn fact, after the call to CreateFileA it will get through VWIN32 0x001F; D s& [4 f3 x; Z0 V7 N# b
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
6 D! b, B% n& i% wand then browse the DDB list until it find the VxD and its DDB_Control_Proc
# n2 }9 Q1 l+ i7 y& E) gfield.4 h9 Q8 I! y1 K) T7 j' |' ^
In fact, its purpose is not to load/unload VxDs but only to send a % w1 {% H6 S+ x, J
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); U4 L) F; {9 ?0 l2 I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ D$ J6 T7 z5 fto load/unload a non-dynamically loadable driver such as SoftICE ;-).+ l' t4 J4 _$ j1 W, b# U
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 R0 a8 Q7 |3 W* S1 z
its handle to be opened and then, will be detected.1 ^% E- m1 n$ `" f
You can check that simply by hooking Winice.exe control proc entry point& ]& q! G% Y2 @$ e4 K1 Y+ W, A
while running MeltICE.3 S; Q8 h6 g6 j( n; U8 L
: A- J+ W# D) f& o% M1 d" ^
- i0 Y0 K1 q# C5 P 00401067: push 00402025 ; \\.\SICE6 W, z: N6 G! H$ p# O" k" Q
0040106C: call CreateFileA: D2 @# U6 ^ Z; C
00401071: cmp eax,-001
" |7 r E2 U2 n( F/ c/ x$ I6 Q a* F 00401074: je 004010914 I$ G+ o1 l& J
9 [ t, o% G# N" W, @: k* f( [; h0 s& R. T! t
There could be hundreds of BPX you could use to detect this trick.
6 I2 x' K# l- n5 D& O- a' o-The most classical one is:
+ R9 L0 P$ N! H/ s& z. |( c, l1 ? BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" p" X0 N- k% V
*(esp->4+4)=='NTIC'6 `- I/ r9 g! t3 F4 A
/ ~" v5 a1 l2 E0 l" D-The most exotic ones (could be very slooooow :-(- U/ R2 e" {0 I) ^5 m% c: K, N
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 1 _- q8 N! p1 ?
;will break 3 times :-(
9 B* C8 e1 f- F, Z' S5 A7 N
, Q/ A4 ^1 {* Y2 q-or (a bit) faster:
9 J: a; S. Q* f2 { BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 d H( C9 b3 i7 a P& {
7 B) ]: i1 h: Z) k: Q7 x4 d+ y% m BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 T; N4 h) q6 M3 `! ?* {. j ]
;will break 3 times :-(, c8 t' e0 X6 M) p5 F6 \& J% q
# }9 y- ?: u# [( R
-Much faster:9 g0 q+ P, a: }, K
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
; w& j1 i: q& f# F/ c& n) u0 s+ ?# b$ z# t
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 S. k+ b2 ]7 U3 }1 ]1 ^
function to do the same job:
: |/ C# D; \8 s' o: Z) p4 ^6 \2 z& \, q S, L, Z: s
push 00 ; OF_READ
. n- E" `' N2 Z& I9 g( I( P mov eax,[00656634] ; '\\.\SICE',0' o, y+ \+ l% J' y/ N
push eax+ r% f6 W3 Q! X3 {7 a& [
call KERNEL32!_lopen6 _( ?$ E4 ^4 h ]8 Y& ?0 e( o
inc eax$ M; @2 f' F0 T2 [! B
jnz 00650589 ; detected z% b/ v' b/ K/ d \* C$ u
push 00 ; OF_READ9 _) ^' s1 ` a. s; E7 ]6 }
mov eax,[00656638] ; '\\.\SICE'- u$ b2 A }3 z
push eax
* A) g x7 E& u6 T& ?% U call KERNEL32!_lopen
6 v) I1 F$ L% t inc eax. b% Z8 {5 {- a) u0 u) Y, s
jz 006505ae ; not detected+ X: r* D6 h0 x8 L; F+ U- y
" q" i/ ?" [, l" ]
$ o3 X) {' b7 |8 U* M t; z' q
__________________________________________________________________________
6 s- L4 J- h6 F/ Y/ _* |
, e% d* [3 k! |Method 12
% I( B5 o2 U. |/ y6 y' @=========# |$ |# U! { b8 P! H- O/ e
1 [0 W' k+ p) ^This trick is similar to int41h/4fh Debugger installation check (code 052 W* r2 B' @) B$ E, T
& 06) but very limited because it's only available for Win95/98 (not NT)+ e- L' Y ~. \& X% W$ p
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. V6 Y4 \& g( W, \
$ w _) z( t0 [2 K! q
push 0000004fh ; function 4fh
. K2 Y4 m; f* V' ^# m push 002a002ah ; high word specifies which VxD (VWIN32)) H6 j" l6 q% H
; low word specifies which service
% C# j, ]8 \0 T$ @+ j, y (VWIN32_Int41Dispatch)
) b% a. j' s6 t/ h9 D8 ?1 H call Kernel32!ORD_001 ; VxdCall- D) p( x( M! U: h' Q! t- `! c
cmp ax, 0f386h ; magic number returned by system debuggers
5 y2 w1 U. y1 U$ Z jz SoftICE_detected, n* o0 [) d3 T
) W X3 t, y, ]+ V5 T2 VHere again, several ways to detect it:
8 [! b, n6 H) X q; a0 i6 \, ?
- v1 _# s! g% Q2 k BPINT 41 if ax==4f
& m1 [, B, h1 r. A8 C* z( W/ L! R& a" `4 `8 k) A
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! n, k3 X7 L+ o% ^1 |
! X' @4 O/ B" z! U% J8 n BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* O9 c& Y$ ]) }/ J- r' Z; ~7 w2 g/ ]
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 X. O; I0 ~* D% \- C. l& O- A" O3 f6 Y, ~# d8 |. O8 ~! k
__________________________________________________________________________
6 C/ Z( H( v0 y/ W7 C3 l) u5 J$ ?* z0 p$ L) D
Method 135 E8 e! [: n( k0 o3 o
=========6 R1 N7 a0 y. g5 S3 i) X+ z _& w. b6 ?
7 Q, @/ Q8 Z1 vNot a real method of detection, but a good way to know if SoftICE is
D% t5 j5 o" ^: a$ ^installed on a computer and to locate its installation directory.
F0 P- [6 k) s* U* [It is used by few softs which access the following registry keys (usually #2) :
0 q3 O/ r' \9 r# W: K1 |- P9 H' U, X$ F( @% ~( `. J
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 J8 f4 \2 _& T
\Uninstall\SoftICE
5 k2 O% B: O/ z/ _-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ ^# R3 a- ]# u0 L
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" @; r7 f4 V3 |$ v
\App Paths\Loader32.Exe0 y, }+ w8 m( d D) `7 g0 p \
. G# y, U3 i, Q. o& O
3 W/ {9 K+ d6 ^2 ~2 H. C# WNote that some nasty apps could then erase all files from SoftICE directory4 s6 w2 d4 s- W, s4 S+ L
(I faced that once :-(, d. J1 _5 {3 o6 i2 @2 A) A7 }' I& z
3 k! W" g( }& R. X g+ ~Useful breakpoint to detect it:0 g- B" [3 V0 v! j
+ i6 @" V0 Y( l: L- V# z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
. E+ w7 w5 a1 X0 r" j
) ^$ E' k( c X* |0 ^) O: [% T__________________________________________________________________________0 b. u* A& u; o3 h r/ t5 n. I
1 N: ]7 N( ^! k3 e4 z( y9 ~) q
9 k4 {9 z' c) D# @' ~3 Y$ E2 O# p
Method 14 9 F' H4 i8 i, p
=========
$ A; ]( Y1 \5 O* N6 Q8 z* D, U& h q! {: m* @ E
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* C0 \+ N/ n C, [5 ?# Wis to determines whether a debugger is running on your system (ring0 only)., _) u0 C( P' {6 F- Q
$ d7 C! p9 Y" f; t7 ~3 ~* } VMMCall Test_Debug_Installed7 R$ u6 L; d2 z5 h3 ^
je not_installed) p* q z2 c' D, C4 v% J6 X
, o8 z: r: d rThis service just checks a flag.
7 f9 S1 c7 ?- n% ~+ \- X</PRE></TD></TR></TBODY></TABLE> |