<TABLE width=500>
3 }: J- u/ _ [5 o% S: A( G. @<TBODY>7 o1 B0 l M) R N
<TR>
2 R7 L% M" ]( W7 S$ Y( G<TD><PRE>Method 01
& D! Y2 j, W. l) u% @/ d=========4 Y! X! }9 L1 i. p6 K* X$ g: b
4 I5 C3 G3 n* \3 b: @This method of detection of SoftICE (as well as the following one) is# }1 B( d( F1 K- e, a6 h4 {
used by the majority of packers/encryptors found on Internet.. K2 g+ {& r1 X0 \- v% h
It seeks the signature of BoundsChecker in SoftICE
( K! p4 a& P E
- h2 v7 ~% P! [ mov ebp, 04243484Bh ; 'BCHK'" R- a. D4 N$ A+ R% ^
mov ax, 04h4 D* G$ P; e( [% j. S; H
int 3
0 ?: F5 E- a8 U t4 N cmp al,49 @9 y3 @! \3 r; S" z7 c
jnz SoftICE_Detected
. \ d9 ^4 y/ R7 u4 q0 V7 J
1 J# R! e# q6 p# @! G7 P___________________________________________________________________________
% ]1 J" |. v, \, w* f4 ^: N& P1 r" r# @
Method 02
+ X+ i) `4 ~+ D. o* U+ [=========
1 D( L& d' C) E6 u6 ~; A! }, x1 G! a5 X( ^7 [: Z; ?! \" d; l: C
Still a method very much used (perhaps the most frequent one). It is used( r* h: H, z" f% x2 U5 I. H
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,: X( @4 V+ h- P
or execute SoftICE commands...6 J! ?/ {6 X! b4 c( n
It is also used to crash SoftICE and to force it to execute any commands: f G6 y% W" a0 ~( H; h
(HBOOT...) :-(( a; X, i/ I! {! g7 l
6 I* { z5 f8 n; w6 @& k
Here is a quick description:
1 P+ A0 h! H! _( j-AX = 0910h (Display string in SIce windows)
3 V5 F" q7 i y5 }0 }-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
) N1 j0 L# @+ I- u* C-AX = 0912h (Get breakpoint infos)
8 {8 C% f! ~ c+ R/ Z. x- `- r% V-AX = 0913h (Set Sice breakpoints)$ M& W' U" N: P+ J4 t
-AX = 0914h (Remove SIce breakoints)
: N" ?8 M) R: K% E2 }0 q" b
! K: \8 a4 p* b. yEach time you'll meet this trick, you'll see:' ]/ {" z; }( u" u) e1 ^; e; u
-SI = 4647h
& ?0 s$ ]9 [0 C( v-DI = 4A4Dh G: _0 G9 ?) |/ X5 X
Which are the 'magic values' used by SoftIce.8 J& I& W8 X3 ]) N" v0 v$ ]
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.8 Z, X4 Y& f R. A% d" j% ~8 M7 Z n
3 _% k% I( ?6 qHere is one example from the file "Haspinst.exe" which is the dongle HASP
( C6 b2 `: `0 PEnvelope utility use to protect DOS applications:
, `9 m3 s& s- }5 n$ N1 x {1 `7 l( `
5 j6 R t. s# W% O' d0 |( |
4C19:0095 MOV AX,0911 ; execute command.
0 r5 a# o: s9 `' R4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# K9 D# [4 Z- V" ?2 K3 I
4C19:009A MOV SI,4647 ; 1st magic value.
6 s, Z% r: r y+ o4C19:009D MOV DI,4A4D ; 2nd magic value.
) g K4 J5 x# [1 T% |9 o4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)+ m3 c* h D) I1 D
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute9 w9 s' Q T+ g+ b) q+ T
4C19:00A4 INC CX
3 Q0 |; n3 K6 U( P v4C19:00A5 CMP CX,06 ; Repeat 6 times to execute( [! W1 e1 E: y' @7 j; l, L0 ~
4C19:00A8 JB 0095 ; 6 different commands.
+ a2 |! v S! x$ }6 U% M% y4C19:00AA JMP 0002 ; Bad_Guy jmp back.9 _$ g" |- t1 x& m
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 l: I) x+ Q+ k! o' v2 \
, k1 o+ ~! b) @% `! \
The program will execute 6 different SIce commands located at ds:dx, which6 b' E( q7 v+ M, o1 S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, G" h `8 d2 A0 H0 ~- x" ?: c0 {+ R4 `& f1 ?& p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
1 ~: k( N& y: V/ d7 R___________________________________________________________________________
, e; `4 I* }8 j( H% V$ i! _7 S" }* A0 b: [! D2 J1 i# Q( O
* {1 G8 t& Q3 b+ h, e0 QMethod 031 D7 _7 s6 M+ m. h7 q2 {! Q
=========
5 E+ ?7 j2 y. z, S
% i. R1 J$ ?! oLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. J7 t5 O1 l5 W& E# j
(API Get entry point)' w7 j/ O/ u: y" y7 W1 Z" n9 z
! r! Y2 [8 P: z* K- M4 g
% z/ m0 ? _( o% |6 ^ xor di,di2 K- l: y+ y) _3 V4 Z
mov es,di
: p4 i. A* C2 x( Q2 z mov ax, 1684h % i4 w: ?' g9 `; L
mov bx, 0202h ; VxD ID of winice9 r4 {4 V; O( {; u% g
int 2Fh- F1 X0 T% |, ]* i
mov ax, es ; ES:DI -> VxD API entry point
1 }) j) E) G3 ^ add ax, di
! @' ~0 |0 L5 D4 _; i5 q! K. w9 F) v test ax,ax4 s( e( t: ?! r/ J+ G4 I
jnz SoftICE_Detected Z( N2 Y4 q5 z7 m
/ Y k! ]2 y) N, L, q. W
___________________________________________________________________________
+ S% D5 Q+ g& ]* r3 f0 L/ k6 p
Method 04
2 m3 N" j$ J$ L! F$ I=========" F: p* f/ l% g1 B6 o. A! h
5 g' P9 {3 h6 h2 JMethod identical to the preceding one except that it seeks the ID of SoftICE
7 s1 J, p4 |. Q. X5 _GFX VxD.5 |9 e0 N/ C& y* {- ~6 |
, c3 f" x: A0 I. I xor di,di
+ P$ v1 T1 q0 K" y5 b mov es,di8 p4 ^% b- {& S: |
mov ax, 1684h : J) F% h3 d+ C2 C' U
mov bx, 7a5Fh ; VxD ID of SIWVID1 e1 D6 s1 B* ^& W
int 2fh
" a8 \) \" T: r: N/ j" F( o5 p7 @ mov ax, es ; ES:DI -> VxD API entry point, y) M- I# x" o) c A. R0 v
add ax, di
8 @* f2 J2 Y6 Q# w test ax,ax. J! O# c& |; ? k0 g
jnz SoftICE_Detected6 R; \! l: [/ l9 K. Z6 y k
" B8 H8 \4 R7 C9 [5 e" }1 }
__________________________________________________________________________
/ j5 r4 v( |0 m* C0 ]# E- e5 o! K0 ]5 n5 ~$ a! H$ N) E9 Z
* f! A4 t3 e( E
Method 05
' P% [4 @' @7 M0 V( A) Y=========2 j) J% R6 j7 x) L" ]
- x) f/ k6 K* SMethod seeking the 'magic number' 0F386h returned (in ax) by all system ^( u; l; [6 x& n$ S# I% f' M9 f
debugger. It calls the int 41h, function 4Fh.
6 n9 n4 w$ R D7 o- f; d4 l% s2 rThere are several alternatives.
; o$ O @% {1 x& @7 V( ^# K+ [+ {7 s& M) \
The following one is the simplest:
! o! ]" w! `2 ]; i1 a& I) D* U6 P
mov ax,4fh
9 a+ ?5 Z% z* d8 W6 Y. \ int 41h; \5 G1 u- q3 h% W1 P
cmp ax, 0F3861 z' [8 d9 [: X4 O2 g1 G4 x% `" H: ]
jz SoftICE_detected' N* ]3 m' Z, z. ]& D- l b5 \
$ T" j% b+ d7 W+ L, A- k
0 ]' P& J9 [- D, Y8 |Next method as well as the following one are 2 examples from Stone's 4 C! f& d% p( V- @7 R: N8 r
"stn-wid.zip" (www.cracking.net):/ p. z3 ]% {) X, L
d: d) _+ b1 L2 L mov bx, cs" z- j- K+ c6 f! A
lea dx, int41handler2
* ~) J' I% D) P) B* l( _1 Y4 p xchg dx, es:[41h*4]
! g6 {$ |$ j+ }4 Y# t* l. O; j xchg bx, es:[41h*4+2]3 Z2 `/ ]0 e }6 F8 d N
mov ax,4fh
6 V8 g7 h, d5 J3 }3 L/ Y int 41h1 D) i7 [: K" {5 o- t7 {3 Z+ i
xchg dx, es:[41h*4]# K% G4 v7 v7 E$ \+ L/ _" o
xchg bx, es:[41h*4+2]) B( I# G& C+ c3 S, ]4 C0 F g
cmp ax, 0f386h
) X* ^ X. G: F6 J5 I jz SoftICE_detected% s$ V# V8 s6 P: Y b8 o: n8 h
$ J. V; G3 ^8 L! z% c! Dint41handler2 PROC3 V- U) E$ @* n9 h
iret- n+ Q4 B; { ^; r' {! x& ]+ @
int41handler2 ENDP
# c# q3 L1 Y- [, t. K+ R" O# A$ q7 o, |5 H9 m, ]: l( u
& N; N5 F# v2 V
_________________________________________________________________________
! B! ` l# m3 j, `( Z2 }. i ?- \' b
3 M, O0 ?: m5 _/ A3 ^: D; o1 [
Method 06
6 `# q; g' I+ c" h [! A. X6 N=========: ^ t: t8 Y6 w
C( K0 p( Y% \( S# y) C% K2 n5 t9 ^# j* c9 f# l
2nd method similar to the preceding one but more difficult to detect:' F5 |: ?4 o! R5 I
6 t) x7 d! H5 h
/ b$ E" [7 D. m* ?- E% N6 Wint41handler PROC! ]' F6 S0 n* V& o8 G' C
mov cl,al
/ |0 _$ K9 h! ^ iret! a$ ^$ s% L1 u: Z$ o% w
int41handler ENDP* f; ~1 r# l1 ]
, D% B4 M) e$ [+ g1 O
' y$ `( n3 I1 d
xor ax,ax
' l+ w1 S: v3 X/ \ mov es,ax
0 K. F& A" ?* {; L3 S mov bx, cs
; M! p, t* p: X( p( c! }3 C lea dx, int41handler
- _9 {# s% ]" B) Z6 ~ xchg dx, es:[41h*4]
5 M F' J6 G. ~ xchg bx, es:[41h*4+2]
4 O; Q' h }7 `/ C+ P" F in al, 40h
0 E, ?8 x8 l1 {1 j! O/ [4 h5 Y' i5 E% d xor cx,cx
4 s5 Y- f0 S: L int 41h( P7 M/ T! ]" ]" w2 b# X8 V
xchg dx, es:[41h*4]& J. P4 `/ I+ {5 B) X; i' G; w+ y
xchg bx, es:[41h*4+2]
- h( m# E0 ]4 i; p' r cmp cl,al
7 l+ R4 r6 Z' r2 W; R4 a5 \: b7 k w jnz SoftICE_detected1 X6 O7 @5 F0 |! Z5 w+ q- x( w1 Q1 r
9 p) Z7 I6 \4 U5 q& ^
_________________________________________________________________________
! v9 H6 F0 }. C8 }9 r% n/ u. t+ j0 d) j2 z
Method 07; E0 [/ F# N1 E3 S- C( E! q
=========+ i8 i7 V0 g0 K5 B" `( \$ R7 g
; Y" n+ V& ^' Z& H' l) l
Method of detection of the WinICE handler in the int68h (V86)
) ~. n4 \: f2 I9 |! ]% a0 p1 v! M1 Z. h9 o7 t
mov ah,43h. ]; x+ U' i3 x6 M% K z+ }% P7 H
int 68h
T. }9 a/ `% f& N/ `( b cmp ax,0F386h2 s+ P I7 i0 G5 f7 y ~
jz SoftICE_Detected4 r9 Q# K; b) J* S
: X- p5 L l; Z/ @; x& D7 m. \5 U
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. ], F) A. p2 v) D, z$ a2 h app like this:) N" ^4 a* R1 k" h+ E8 _: }
* x+ r: t- P3 a/ y4 N BPX exec_int if ax==684 m0 @7 D& k4 c ?. |
(function called is located at byte ptr [ebp+1Dh] and client eip is( e1 p6 `2 r. }; J
located at [ebp+48h] for 32Bit apps): `& p s6 j% y2 W
__________________________________________________________________________; ]! p. G; l/ h! p7 s. n, M: L; E
1 |! i7 s3 }4 E0 {+ D3 V6 A- S& Z7 O7 `( I, G. G; t. ]# y
Method 08+ X/ o2 L2 U% \* k. E$ L5 n
=========
2 `+ E3 X G' \8 a' X6 k
* `: [+ ]( I0 x: A# nIt is not a method of detection of SoftICE but a possibility to crash the0 B* J# k) } c# c% q) P2 Z, {6 s% N
system by intercepting int 01h and int 03h and redirecting them to another
( a! F# f- I0 L1 y9 a9 wroutine." m+ R4 l/ V! N2 ^6 w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points h: O6 o' J: Y
to the new routine to execute (hangs computer...)
4 }5 n. p% A* F8 b9 D6 d$ \
" ~" W. b6 Y) U8 {6 S mov ah, 25h/ \$ q- C# m* a. L6 Q. f
mov al, Int_Number (01h or 03h)0 K- E" s0 [ j! q$ V4 N: w$ n
mov dx, offset New_Int_Routine
- ?8 _9 A/ E# R4 X5 V int 21h! N, e; N+ y7 o5 T2 T
- t+ d& D! x3 `9 F) z, e5 s
__________________________________________________________________________
- ~5 f! r+ n! a5 k. A b2 ]/ j4 Z$ ] [- r% }2 `
Method 095 X2 @8 i, T2 E3 J, p( _
=========
7 R" U8 E: F+ x/ X# J
0 j$ X/ ?9 i2 ^8 N' I4 e/ TThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, l* o$ p, i6 z0 c( operformed in ring0 (VxD or a ring3 app using the VxdCall).0 p, V7 v$ S: Q9 A
The Get_DDB service is used to determine whether or not a VxD is installed
7 S$ E1 E5 `# u8 H* G7 V4 p) ]for the specified device and returns a Device Description Block (in ecx) for. h7 f X; ^% A9 f @: _6 g9 l2 V
that device if it is installed.5 e' F) k, x& T5 s1 B
. v D* T2 q7 L. d
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* Y% Y r4 o7 e: a2 V# | mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& Z+ C6 }1 {! ^+ B VMMCall Get_DDB( T2 l2 O( f' n2 K. K7 t# T- S
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed; ~! [$ g6 e0 g. `
. q; ~6 H1 r* i7 G! `! b8 B
Note as well that you can easily detect this method with SoftICE:
5 Q3 q! |/ J/ [1 j. U" j bpx Get_DDB if ax==0202 || ax==7a5fh# s5 R) b- n5 N* P% a) U b
; {: T7 ~$ s! N# p; m__________________________________________________________________________
: \, \/ K3 k) n+ G$ b( k1 ~/ \+ X. _
$ g- ]- l, H! ^1 mMethod 108 N: u! @; ~3 T; }5 _* t3 C
=========. V; O0 {7 o+ z6 l& D
8 k) `: a) ^$ \$ ~1 @7 n% q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
0 o, G( M* M0 d7 t SoftICE while the option is enable!!
7 N) x* F9 ~3 r+ D9 v! u& ?% f
$ ~, ? f! X3 d/ r& q( M+ bThis trick is very efficient:1 F/ h, @, g; Y. z
by checking the Debug Registers, you can detect if SoftICE is loaded
* X d Z P( t, d+ ~& Q$ v9 \& M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
/ B- L. k- v; ~$ b0 ]1 [$ M0 athere are some memory breakpoints set (dr0 to dr3) simply by reading their$ o1 D2 {/ } H6 I
value (in ring0 only). Values can be manipulated and or changed as well
+ E0 r- |- E4 c0 g7 m. F6 m(clearing BPMs for instance)
( |! S1 |1 M0 U7 r* s+ H
3 k7 N E$ F+ W2 _* k* R__________________________________________________________________________
1 S. j2 j( K0 p( ]/ F0 v8 t" L' F: x
- y8 K* s3 c: r2 DMethod 11
. h. h* u) @ e, D=========7 L3 {+ t2 D; R; `
$ c# [& p. k1 h0 i, O
This method is most known as 'MeltICE' because it has been freely distributed
# f# t# U( u. L% R Z/ T8 evia www.winfiles.com. However it was first used by NuMega people to allow
) ]& Q; F, O3 | {7 f0 qSymbol Loader to check if SoftICE was active or not (the code is located2 h9 e `( b8 q7 f [
inside nmtrans.dll).& U- P L0 W. U! }$ E8 M0 }
. q: D) ?$ D9 q. I: U9 qThe way it works is very simple:
8 r2 L& _ w# T6 y& I8 bIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 j( n2 a8 N1 m4 mWinNT) with the CreateFileA API.( Y. d7 H) e# I& O0 ^5 [4 a( k
" M5 n$ C" t- m4 L
Here is a sample (checking for 'SICE'):5 s5 S& V m7 j5 ?
" l0 i$ \9 D4 v5 u4 N
BOOL IsSoftIce95Loaded()
0 Z3 n9 D" A& [{, _' n, V" S' H( h# @
HANDLE hFile;
! Y8 b# s+ G& u2 A' w$ I i3 ]$ R& J* s& J hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
2 y8 o; I' A, ]* D' r; h( [ FILE_SHARE_READ | FILE_SHARE_WRITE,/ X9 _5 S7 H* O. _# l0 _
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# ~( d# Q9 w% g& B" F if( hFile != INVALID_HANDLE_VALUE )
/ f& z! }% D2 i; h {
T. \6 r+ m" K1 ?8 ?6 \ CloseHandle(hFile);# D- l" X$ I0 k
return TRUE;
# `6 m2 E* N2 s1 v }8 c! N% K) R" F
return FALSE;5 C. x e7 v* R
}
/ n& e! z3 o. v0 J
& d/ g0 G g: j! ^# {& SAlthough this trick calls the CreateFileA function, don't even expect to be" ^+ K1 q& ^, C# h: g. i% [. U2 ^
able to intercept it by installing a IFS hook: it will not work, no way!( a' m) e4 J; F: U, R1 h; D
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 p, q* T* l5 x7 K: D$ B) C8 wservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: o# \: J: f( Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( W- r& T: l6 Z& _( [. Sfield., ~& J k3 z3 u( L: C+ W
In fact, its purpose is not to load/unload VxDs but only to send a
" k& m+ a9 Z% _( E% I1 p1 `W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), V# n( ?2 I# U ~
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 B* O/ r3 b* S& _
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 F3 }; L. U& ^3 D& q9 l& PIf the VxD is loaded, it will always clear eax and the Carry flag to allow
/ z8 @8 X' j- W$ ]- b+ Mits handle to be opened and then, will be detected.
. h! T I2 } B- {You can check that simply by hooking Winice.exe control proc entry point
( ], s) q/ e# `. B4 ?4 |5 Twhile running MeltICE.' J% M( k6 I0 U& F. K, a8 _
6 f) v- g0 J. w0 Q, X+ S
* U- F! t! k* x5 K' w- N 00401067: push 00402025 ; \\.\SICE
# r. C3 d0 H6 c 0040106C: call CreateFileA2 t# _' h& @* a' Y4 _. e" d& X
00401071: cmp eax,-0019 `* r! B9 b! O( L/ i8 L
00401074: je 00401091# c1 e, A# V5 f! s
# X& A ~- u9 c S
- K: ~- l6 F' O, V- P8 m. H
There could be hundreds of BPX you could use to detect this trick.
; D) Z1 [2 [/ i9 y( }; b/ p-The most classical one is:
9 a0 g# V: @) y& o/ i* v% r BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 d- [& a' [7 H( J
*(esp->4+4)=='NTIC'* O1 E! T& y6 ~
- H8 I3 J& s1 @$ v; D! @( ~
-The most exotic ones (could be very slooooow :-(5 E7 B( {1 l) |, s$ v! a: @
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ( L+ b4 |! A6 D# [# C& `( d% A& [. U
;will break 3 times :-(
' |" N# s P* ]9 G* ?8 U3 G ?5 F! p( r0 y: c" [- _ n/ z
-or (a bit) faster:
; |7 u8 U# b: E8 N1 _# ^* l BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 M) h0 u/ t% x4 V1 s8 |$ k& y% _) D) m' j
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
9 u% Q! v9 y" w* E1 [, ]0 K3 b0 L& @ ;will break 3 times :-(
/ c, }) D- s7 M) y- J, `! w& y& G5 R. i5 ]1 B
-Much faster:/ H h8 z9 K- [. r" X o
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'+ K0 j `( q" a+ U9 s9 F5 b$ \
& u( z& E. t0 F, n: q: d# XNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
; U4 k6 P6 r9 b0 {( \# M6 x- @function to do the same job:
( Q6 D+ {' [8 h- l$ ~% @4 J
7 W/ J; z- C: N. n# S9 j push 00 ; OF_READ7 Q' H- u+ v$ G$ o
mov eax,[00656634] ; '\\.\SICE',07 J* z- C M. o! p
push eax3 U: D5 L M5 Z+ x# {
call KERNEL32!_lopen
. B' X9 w+ Y/ h% p' @& y inc eax4 h/ C( S8 W1 E4 T; Y8 ]2 P/ s
jnz 00650589 ; detected
) Y' ]& f. K7 w& j0 j! x push 00 ; OF_READ
3 v# V6 a7 w" V* _" h! Q mov eax,[00656638] ; '\\.\SICE'# a3 y1 } o; `$ d
push eax# [6 o1 k& X" p. Y+ ]
call KERNEL32!_lopen- W+ V- T- H) @# t( m3 G
inc eax0 |& {- k5 d# V1 U: E* E' T
jz 006505ae ; not detected
5 e, q x/ C$ y. v4 r' s+ r, N, T' F1 F
' O9 k z5 S A: P% X. m3 W__________________________________________________________________________% B( v- G; G( P+ ]2 \ c/ {( F
- i+ e2 B }2 Z" r
Method 123 P# Q2 U5 d. `0 t
=========% i/ R2 R7 h* F+ ?( E
( `2 @1 k) @% L/ E/ _( G
This trick is similar to int41h/4fh Debugger installation check (code 05( I; s6 c5 w2 g+ l+ Z5 y
& 06) but very limited because it's only available for Win95/98 (not NT)
/ A Z+ ?) u! f# c9 q" K$ t) A+ G& Nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.. N0 _& E) N/ ~7 r0 T! g
0 @. ^! }# b( U' f% k
push 0000004fh ; function 4fh- ^/ t. m/ ?# `# r8 u0 J
push 002a002ah ; high word specifies which VxD (VWIN32)
" c3 g K* ~0 T1 g- J. p# \ ; low word specifies which service7 m- I. ^5 {& I, T( d
(VWIN32_Int41Dispatch)* e$ v: d; h) o! P6 G
call Kernel32!ORD_001 ; VxdCall0 p; b2 U+ A; m
cmp ax, 0f386h ; magic number returned by system debuggers. {" r6 M4 u% B0 a5 m
jz SoftICE_detected+ v& C# x0 [4 ?* I$ B4 C' q7 D! c
- l. T0 _; z; [ i; `; ~Here again, several ways to detect it:
( q6 @8 g m% q; l0 ~ d! G& [3 \7 G
! r1 L1 \+ A% W( S' I0 B BPINT 41 if ax==4f0 z; K. `" |! l0 j
- |7 _: A3 ?& L9 [7 v4 Z5 s# O: T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 |+ a* p$ [2 |5 u7 x; s
5 J0 f1 f* N& U
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A0 j3 P6 V, M- k* y. |2 E
2 S* R/ z9 a, t3 @1 e4 _0 S& t; A
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' r2 v$ [9 ~' A' n0 K& H J% E5 A$ X. |8 |9 y/ U* J
__________________________________________________________________________4 A' Y0 B6 o) j* P3 v
/ U! N7 c) j0 b( D7 U1 ^' E. I
Method 13
' G* M! I% ]6 ]=========+ ?2 }/ H# @4 c3 ]5 p" k( I
5 [, [: K# V3 `: h" U& S4 r7 _4 S
Not a real method of detection, but a good way to know if SoftICE is
; c/ b/ Z, w v! L( b, k9 Iinstalled on a computer and to locate its installation directory." K; Z- K! X- e3 D: T, X$ [
It is used by few softs which access the following registry keys (usually #2) :
$ x5 K( _0 k, f5 ]% ~; q& o' Z( _+ D L( s
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& @" h9 t- s$ [8 n5 S5 p\Uninstall\SoftICE
( k; c, L+ @+ m3 x-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
% C0 w! b5 K2 d4 N' i1 l( J-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: J2 V N( R4 D5 r
\App Paths\Loader32.Exe
t x4 ]( @+ Y+ y8 f% y8 b6 T+ H4 C& }, @" Y1 V
, }5 {1 B6 k. D1 o9 M- [
Note that some nasty apps could then erase all files from SoftICE directory
; d9 X& q7 ~7 N3 v(I faced that once :-( x# i6 |0 Z* i. ?
8 B1 x$ R5 O" p. e8 @) iUseful breakpoint to detect it:9 j; m" F p/ ^/ |
9 T$ l4 y j* j5 R! _ x J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( m+ e, r9 }* t5 b+ }7 I) f/ G4 O
) G6 ]4 [! F5 B, y8 V
__________________________________________________________________________
/ d! T! u! X+ }9 U
* V' C7 ]# a8 N7 d A% {8 i) q+ c' {
, f8 o( j6 q0 W/ W- AMethod 14 - K6 q- A: m! }/ e
=========, t: R6 R) m% O( K4 [3 r
; m, ?' D% \- QA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 S3 y& d( J- A% I; I& Q6 f M$ Z! A
is to determines whether a debugger is running on your system (ring0 only).
+ U+ ^ J' } G/ h7 r. }1 c0 U4 y: @, F& _1 E8 u6 }
VMMCall Test_Debug_Installed
4 P; J1 ~: v b q je not_installed
, X. |) n9 D, o4 S: U# a- a
7 K2 G* n1 }1 A' v) r% M7 O' o6 }This service just checks a flag.
$ w1 c% o3 Y8 E( i1 K) i0 t</PRE></TD></TR></TBODY></TABLE> |