<TABLE width=500>4 t- I) N) E# Q$ J, t
<TBODY>/ N# X& o* }+ B. V
<TR>
% x, c, y# ^# G4 R n6 O" M<TD><PRE>Method 01
3 c) ~+ e; g7 ]) H; n, e( z=========
3 k6 }# r5 A: s! @7 t# O# v
0 M* a& E# n4 NThis method of detection of SoftICE (as well as the following one) is
7 t1 m) G# ^/ k. y; mused by the majority of packers/encryptors found on Internet.
8 p$ f) }2 ` P& b2 c5 hIt seeks the signature of BoundsChecker in SoftICE
* Z3 Q) G# n& `# f5 V# K+ O* ?; _( u% S
mov ebp, 04243484Bh ; 'BCHK'1 Z) [3 W& p$ i9 B+ i
mov ax, 04h
- b( f' ?, H. Y: D int 3
1 f) K" u9 n# A0 ]9 a Y4 c cmp al,4# D! r8 Q5 j6 T) I. @
jnz SoftICE_Detected
5 t3 T& k: L& w
# t, Q. c. q& F6 e& y___________________________________________________________________________
5 _8 w7 x% @7 x3 |) n3 W
' F( A6 H2 {2 TMethod 02; J9 t8 ]: C& w- _
=========
: C7 E3 B/ j6 B: a7 W. i2 X; Q$ X# D" T' v/ G
Still a method very much used (perhaps the most frequent one). It is used5 o# J- o& k' z0 e6 k4 K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* `- A, i( I% L3 ?8 y' O; eor execute SoftICE commands...
7 E, @8 S* l! r) z5 G# tIt is also used to crash SoftICE and to force it to execute any commands
6 e% J+ ]# H8 A" m(HBOOT...) :-((
( ^' i) Z1 \/ E% _
0 N; \0 O( U0 _+ _+ ]Here is a quick description:
# S/ c5 V: E5 w5 a! [7 E-AX = 0910h (Display string in SIce windows)1 C) |+ N* K9 ?
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
2 D m% ^ V& g( p1 V-AX = 0912h (Get breakpoint infos)$ q* G. w) S1 w" Q' T
-AX = 0913h (Set Sice breakpoints)4 c, o3 V0 T2 J# R
-AX = 0914h (Remove SIce breakoints)) ^' |3 v- ~( i1 ^$ u) F3 O3 c
# X1 X. ]. y4 P+ ?- hEach time you'll meet this trick, you'll see:
) a( ]6 C4 u' r7 |/ x4 B# H% B-SI = 4647h
% }+ z: a* P! @9 y" f-DI = 4A4Dh
. m7 ^4 k" V! w& [4 I- ]" mWhich are the 'magic values' used by SoftIce.! @/ E" [3 _9 R# X [ J- m! j
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: ~! W) ?: S, K- Z/ |9 T, e
/ J9 {: D& t3 L8 J# z+ v9 `8 CHere is one example from the file "Haspinst.exe" which is the dongle HASP
; i+ f+ q H) XEnvelope utility use to protect DOS applications:
2 z3 `& T3 _' q, l ~! v6 n, z/ |
# X3 x4 d w3 k5 U; m1 X6 n9 p0 [" P7 |( ^6 b0 `, I# a5 j
4C19:0095 MOV AX,0911 ; execute command.
3 r0 T5 ?+ O9 f) F8 f: [; u4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
0 ^: X+ ~* X4 B& `& o2 ~4C19:009A MOV SI,4647 ; 1st magic value.2 N" J& c! Y5 t0 X
4C19:009D MOV DI,4A4D ; 2nd magic value.
4 U6 B( Y7 L, m) K- b2 _* W4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 \2 N: ?8 D: ] {5 s6 Y0 ^
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% B9 C4 u5 n4 d
4C19:00A4 INC CX" Q- F" p6 w( w9 N4 y
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, M! L) L$ M' _5 `4 W4C19:00A8 JB 0095 ; 6 different commands.% n5 b6 X( m2 R/ r3 P% j @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 K/ i4 p* r# P5 |; O4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
0 x9 L& J; h, `( o( o& x$ j B# q! t; T
The program will execute 6 different SIce commands located at ds:dx, which
# _( Y1 T l; E- w" a) B. W$ v' eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 F4 L0 e1 s' U+ M6 \
* {6 X. N- \4 U$ k4 ^
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
% L& g) C) v' T/ N+ y. ?. v___________________________________________________________________________# C8 q. k% R' E% r' k% N+ s5 m
1 f7 f a$ q6 Z( W c
* P2 ^$ d3 j- h# a& I# [- |( v* |Method 03
) z- \3 V# D, ?+ t( ?/ r=========: A. F5 y4 u/ R) R
- W0 }. Z& [$ f% E
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# ~6 U1 z9 L4 @5 g, V% s& k(API Get entry point)
_5 B8 o$ \, V ) u) t- C3 F# x8 A& \
' x6 n4 `4 j) y- x( G* f! ~ l8 V xor di,di
. T& x, V9 F3 | mov es,di! K# R2 Q" C- [" P, a3 N: u& s
mov ax, 1684h
+ s7 L+ ^6 W/ ?' r) [ mov bx, 0202h ; VxD ID of winice
, U& ?( }$ q" ^4 z- `1 O" v int 2Fh% F0 {" A7 Z( Z
mov ax, es ; ES:DI -> VxD API entry point
8 L6 Z. V/ @9 B+ z add ax, di
/ p4 i) K3 ^( V" X test ax,ax- f! ~ E I" R S1 F4 j5 E
jnz SoftICE_Detected$ ]+ E/ j$ c& N) p
1 P2 x N, V5 z+ z6 ]___________________________________________________________________________
1 b* ~/ v0 a0 T! | Z
7 N _% k9 q) Y9 a) Y' Z9 x! xMethod 04% y' U9 g( V' t2 B8 L j$ [; X
=========) u- X, x. b" X: M n3 `
& r) F9 _3 P+ T4 A: c5 Z8 G
Method identical to the preceding one except that it seeks the ID of SoftICE
; O7 m! j1 R' A7 s/ sGFX VxD.
* _- U2 X9 `6 y7 i5 ?
. `+ U9 j _5 o& J& C xor di,di3 Y, {) j/ q/ r* S8 s& [
mov es,di
. G3 c8 \1 ~8 X4 {- T' r" n, w mov ax, 1684h
7 n+ K- u$ r0 G- Y9 ]: G u2 K mov bx, 7a5Fh ; VxD ID of SIWVID
6 c2 ~( P' ]- s int 2fh
" K8 c0 t$ w3 J/ Z( a# Q: ^5 c0 ^ Q mov ax, es ; ES:DI -> VxD API entry point6 ]/ }+ @: ~+ Y( i
add ax, di
" d, S1 g A' Z2 H test ax,ax2 Y8 N: R' {5 n! o5 A$ v- t0 x& c
jnz SoftICE_Detected
1 c) N+ }- i( ^# O9 x* N* F0 r; [! z& N
__________________________________________________________________________* f) }! Y& t8 H i5 h. ^
: C) q2 u( L3 G0 O. u
d0 g1 r4 |+ o! mMethod 05
: `) w6 _; J8 l+ T=========
$ E$ n+ f# ~; e* \1 R& f( d# w: P$ T0 h5 v
Method seeking the 'magic number' 0F386h returned (in ax) by all system
! O9 B1 M! P8 kdebugger. It calls the int 41h, function 4Fh., \2 x: |# P+ p' {3 O/ G
There are several alternatives. 6 j- G2 H B- H
/ \' K$ E' o0 N' g+ ~
The following one is the simplest:
0 }+ o+ g; u0 P% d' }) B1 |( W, }$ C! c0 _3 t
mov ax,4fh: z: D/ e4 [& A% M0 x+ X; R
int 41h4 K0 k1 x6 t: m( y
cmp ax, 0F386
+ K$ ]5 t7 O4 a. w7 b M8 M/ L jz SoftICE_detected) }, b- \+ A' K" ^( i- S6 g$ h, ?
. P5 T# b$ U+ ]; t% q* Y
" I( l4 n5 F7 H
Next method as well as the following one are 2 examples from Stone's
3 u" _8 x8 G, H( R0 { D"stn-wid.zip" (www.cracking.net):5 V8 g5 u4 }3 }+ R0 K
! ~! |) \2 {; G' s
mov bx, cs
& U" [" _6 H Y _ lea dx, int41handler2
2 s, M, S/ H7 c& z xchg dx, es:[41h*4]
, n- A" O: N- M1 i2 v7 `* H8 o. D xchg bx, es:[41h*4+2]1 h4 S, ~' d, {1 J* [ ^) e
mov ax,4fh7 n! B! j7 M) S' M2 h; E3 n+ R3 n: W
int 41h
# N& P; a4 e$ G) w xchg dx, es:[41h*4]) u+ ~0 d5 d H4 v8 ~
xchg bx, es:[41h*4+2]$ i$ t6 w) m0 I6 ^
cmp ax, 0f386h* U0 q3 G3 M% r7 ]8 P+ v/ \- m
jz SoftICE_detected
$ ^; u, a% z% j( ]% t! z4 ^
$ O, j5 |# q* V2 R/ wint41handler2 PROC# D# S9 k/ ]0 K1 j( b6 E4 Y
iret1 R# A9 ]. h H. w* o; p
int41handler2 ENDP9 J7 w, ]- q$ Z( L; C' n0 J
1 O x7 U0 W6 o f- Y7 d6 @% ~0 C6 c1 n0 Q; r
_________________________________________________________________________
' f5 J$ R) h1 h. H7 {2 V
) M x# T9 ^: o0 [0 b, v, O! m
' `4 F% C. v0 FMethod 06; w8 E: m# C- T) Z3 }5 t: z: e% o# c
=========
6 @/ L9 F! H) ~% t- ]* U
; x0 n2 o5 V1 N2 C$ u8 e" r C3 T
* S+ s0 }3 ?( D- i6 D2nd method similar to the preceding one but more difficult to detect:
4 g6 {. m% m* h, v$ T Q! S9 M) u, B5 F3 c" }5 C# e
; L, l( T3 ]3 f& tint41handler PROC
/ \8 q* q, t. m+ P0 H, H% Z mov cl,al7 e* x: I- c0 X! C/ y& w+ d. I+ |3 \
iret# F5 t4 B6 `+ W' E2 a
int41handler ENDP
; c& ~6 K* `! u' W; i' ]9 }; T* _& Y. ?. {1 S7 w
! ?* }6 i ^/ u2 H: U xor ax,ax3 M* Y- ]' a* U" w
mov es,ax
# ]' N1 g9 I; ` q% h. y' N8 \6 w+ D mov bx, cs
! M: w. P) l- W* Y lea dx, int41handler
9 V& X, r9 h. T9 V+ C& h) k7 s xchg dx, es:[41h*4]7 s& z$ G* O( ~9 ?
xchg bx, es:[41h*4+2]
1 o0 L6 C: m" D0 S& l in al, 40h; V/ t& |3 C& Q. H% B
xor cx,cx$ k' ~7 a. u. _0 V0 e0 F- k6 {: E
int 41h
$ I: q) ~& Z# U7 e9 E N( Q xchg dx, es:[41h*4]3 B; S/ M, n2 u8 ~, \4 [, p
xchg bx, es:[41h*4+2]
, N7 g+ W7 v3 p" p cmp cl,al
1 A# ~/ w" g3 r$ S1 Z jnz SoftICE_detected g, ?* b0 o$ ]1 y: U( W: n, g
* ` u0 d8 @1 h
_________________________________________________________________________! o3 R. A/ j; |, q1 A4 l6 ^
1 d7 |& Q6 ~7 D) r0 J
Method 075 c( Q- C% e+ q' ^( z
=========, n2 ]/ E% t* L# E
$ z! ^6 P: [: J8 ~" ]/ N/ sMethod of detection of the WinICE handler in the int68h (V86); k! p$ f0 e/ C
0 r4 c. l6 @) B8 @6 p mov ah,43h
, H$ L6 j S( P! e% j int 68h6 V0 o7 U4 @ s V2 H5 i" g
cmp ax,0F386h
% e' H& n9 B* ]+ T. N& ~/ O jz SoftICE_Detected
* }6 y- F, n, g- Q6 r! P& a; z! u& b6 A- R4 X7 d9 D6 P
9 V. S; P' |. S/ P=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, ]" I, {4 G- Z; m" C4 ^* G: m' \ app like this:
5 K! h( v M6 |2 s" T; V" h ^( r3 Z, g) j- q; M8 ~& B" [. {
BPX exec_int if ax==68# I- ?9 @+ G9 i. n/ u
(function called is located at byte ptr [ebp+1Dh] and client eip is
" _0 Y* ] l* V1 K located at [ebp+48h] for 32Bit apps)
5 Q7 x: b& [+ x$ O/ c0 Q3 ]+ s__________________________________________________________________________0 [1 q# C" Q/ ^+ {/ @1 u$ `0 p3 F0 {
) h. ~! U; m. K0 Z& b7 I5 y0 K) x: ~! P% b) ?/ | `
Method 08' H J3 U* o g2 g& }
=========( v$ k, ~' [2 E# y. |5 q
; l8 V& G& P% P$ |0 h/ N$ E
It is not a method of detection of SoftICE but a possibility to crash the7 b Q' o2 Q, g
system by intercepting int 01h and int 03h and redirecting them to another
( i% q9 z7 k! |2 g# D l: vroutine.
* V2 p j# i6 ]% F* B# Y5 pIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points0 L9 V& ]4 Q* V& W4 g! }- G
to the new routine to execute (hangs computer...)0 x0 I. y7 c; d2 L$ w: e5 H1 @* f
# O7 c1 y. i% {3 k mov ah, 25h( ~. H/ C: a6 ^8 Q1 n* U1 j
mov al, Int_Number (01h or 03h)
( o6 u( [, X9 c. ~8 O mov dx, offset New_Int_Routine
B6 `2 V( T) @1 V int 21h
/ Z/ l3 t+ z# {8 A4 O5 r5 l' m' i5 N
__________________________________________________________________________0 k/ R N0 F# |8 R
7 B& C( ~4 J% o) y# J4 G8 _* u
Method 09
$ N* ]; g" V! h' Y+ F=========( }4 b5 K$ D5 T3 T
1 i2 i) x/ p. `5 K6 e* j- F* k
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 L$ |5 J9 x% o: A4 L' Z
performed in ring0 (VxD or a ring3 app using the VxdCall). R3 o: n! a- s$ u
The Get_DDB service is used to determine whether or not a VxD is installed
) F! h8 D! M* B8 ?for the specified device and returns a Device Description Block (in ecx) for, r! m" y! S* I2 U [; c/ w) Z
that device if it is installed.6 N7 n4 x' k$ ?5 Q. c0 W. W
T Y6 L+ q4 I4 K, Q+ j* u2 y5 O mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID) f) k4 C+ l6 B9 M$ b5 Z
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' S! ]5 N# s( ]" g: h7 N
VMMCall Get_DDB7 A) \! X- [' @/ h) A
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
' C) p* x( k' D& H" Z8 E. p' G* b# z+ f/ ]+ C8 R
Note as well that you can easily detect this method with SoftICE:
, T% N% X) f5 A n) A1 Q d. R) z bpx Get_DDB if ax==0202 || ax==7a5fh0 M! y) V! E5 [4 k/ o
$ W/ x& G# K; [& k
__________________________________________________________________________" g2 q% ~8 S! n- S3 f
0 V. k7 D9 ~/ b. K$ ~( }
Method 10
, u- A3 v/ G4 T) h* `% W=========( |4 X; L( z+ V
6 ]3 v6 N, x8 m, U, y+ W. M! x
=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ M. \3 a c5 [, ]+ d6 j+ k4 h" I SoftICE while the option is enable!!
! ?0 S; T) |" u8 b0 o1 F/ J6 p% s9 @& N: l. X! f
This trick is very efficient:4 J, B& a0 G* w
by checking the Debug Registers, you can detect if SoftICE is loaded
, w6 ?# c: U5 w2 N0 e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
' @& f1 l/ |* z& a; X1 mthere are some memory breakpoints set (dr0 to dr3) simply by reading their: f' f+ z/ E7 ~8 e2 k; A
value (in ring0 only). Values can be manipulated and or changed as well- F- [& u4 X5 I, S4 d% a8 z
(clearing BPMs for instance)
2 H- ?- w/ G- M. d) `! C$ I
* v! o! Q% ^5 u0 I: s' R8 O9 G__________________________________________________________________________/ }" q3 ]* u7 E' J- D( [; t o. I
8 R( N9 H, k6 N
Method 11, i9 p0 Z4 J/ T* M
=========
& Q% g) p! c" ~5 d j7 I9 T! p& r- @" e
This method is most known as 'MeltICE' because it has been freely distributed
5 Q% z/ d. t A. ^- u$ x* z' svia www.winfiles.com. However it was first used by NuMega people to allow
. z7 k) a4 S( m" Z4 B! L# b- NSymbol Loader to check if SoftICE was active or not (the code is located
" ?- P) l: O8 `1 t) {5 q2 Kinside nmtrans.dll).' }) V/ S' P- ~5 @' U6 U
7 T( P/ ^' L! z' t3 [8 e* W; O
The way it works is very simple:
1 W: ^! n! V' O3 R5 h2 G u7 {It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. ?, Z9 a7 {2 t2 Y, ^" AWinNT) with the CreateFileA API.
# V; f: P. _9 Y1 w n# k# F# x: N* ]
Here is a sample (checking for 'SICE'):/ q2 D1 G% M( ]/ h& l: Y* B
8 z/ l, ^# `% T( H( T$ FBOOL IsSoftIce95Loaded()
B" Z6 L* c% T{* [# ?1 m8 }6 |$ c9 X
HANDLE hFile; m/ M2 l9 h' f, r3 d/ E3 }6 U
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,$ y1 ~8 J8 u7 m: I' d
FILE_SHARE_READ | FILE_SHARE_WRITE,
6 N. V$ o3 S% T, p0 ~ q) x NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);1 ~! y5 r+ K c5 S2 e* F
if( hFile != INVALID_HANDLE_VALUE )
" [1 e: A$ U" Q5 @) \5 D {
' D; L' S/ C2 Z8 v& E' K CloseHandle(hFile);
1 U; s5 V5 g' k/ {- ^ return TRUE;
7 H" A; Q: I4 v6 z/ g8 ]6 y/ Q" f }) H% [' [7 l- Z" A6 F5 K; c9 |
return FALSE;
! \+ c$ S3 l7 J3 \3 |6 u: |}
& w2 U1 O0 v# l' e9 t6 p3 M
2 e; h" c: ]7 J" A* E& T& vAlthough this trick calls the CreateFileA function, don't even expect to be; t+ f. B+ t* Q2 K; `
able to intercept it by installing a IFS hook: it will not work, no way!
|; A* @8 K& FIn fact, after the call to CreateFileA it will get through VWIN32 0x001F9 @+ D4 }( x% I% v: Z
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
/ V. k+ h7 q+ q/ f9 xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
2 h7 Z+ p9 y( W. h: t( N8 S, Jfield.
+ ^5 q2 P& v4 M& w3 y4 r, b3 FIn fact, its purpose is not to load/unload VxDs but only to send a ) L4 D7 [3 ?" i" r- A, q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
! w5 B5 m# P& j$ E& {to the VxD Control_Dispatch proc (how the hell a shareware soft could try
8 I+ X0 b, X' nto load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ V+ M* E( n9 qIf the VxD is loaded, it will always clear eax and the Carry flag to allow* H$ L% m+ _7 O5 ^# S, {& f
its handle to be opened and then, will be detected.
" z U: [& J# {You can check that simply by hooking Winice.exe control proc entry point# X9 P Q! }5 T6 D
while running MeltICE.2 c' c' V2 L: A
2 v) c4 r# f- [8 a( E% j6 |' J' e8 M" W2 E1 \% e
00401067: push 00402025 ; \\.\SICE
! ~# i7 y) M% | 0040106C: call CreateFileA1 Y" h! b. n/ Q1 @
00401071: cmp eax,-001# W' W B9 J% \ ]% m4 l# I. }2 p* c
00401074: je 00401091
$ W. E. t- V h3 \% K7 Z: l7 J$ [
. b6 `# l5 N# I8 V& u3 LThere could be hundreds of BPX you could use to detect this trick.
, Y5 |( t+ h0 g k-The most classical one is:$ R# m7 Y6 _7 |; W H
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||3 Z0 g" _6 Z( s4 e5 V
*(esp->4+4)=='NTIC': B/ Z+ L! n3 m) O' P; k4 s/ v
4 A* j' c7 B% m1 ~+ c( Q9 M-The most exotic ones (could be very slooooow :-($ M' {" M% ]2 ~/ A7 \6 s
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, a2 x) F4 V; k& ^ ;will break 3 times :-(+ U' o! i2 \4 G5 \# ?7 b
& R1 b& m% s, p+ u: k
-or (a bit) faster:
" l( o) k( o7 h" [ BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
) G- J2 D6 `( n: B; E
3 h/ y; I5 i. y6 @! H; G2 j0 W& V H BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 `7 G, F. E0 c$ D
;will break 3 times :-(' @ K5 {: X$ ^, O
7 H# I, M- @: B5 A, N, Y-Much faster:6 ?+ s" \/ c0 @: s# r: M' q- r
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 a2 m0 A1 w3 A4 K5 x9 H. }9 R r
0 R+ c3 |7 y8 D, V
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen5 P7 R @; M$ s Y5 P1 L, K/ B
function to do the same job:
7 s3 X* w, \0 @' a
' U4 a, R. X6 K$ u push 00 ; OF_READ
M7 p( d9 z2 H9 g Q3 |) Z mov eax,[00656634] ; '\\.\SICE',0
' t: F0 @/ A' I: d push eax
' b* Y* S' K( ~" o call KERNEL32!_lopen8 \' H" q) V% `- [
inc eax4 [( {# }! ~7 ]& j0 N# X m4 e
jnz 00650589 ; detected
4 n- Y# c* H9 k( ^ push 00 ; OF_READ4 \, a2 r( q& r' }
mov eax,[00656638] ; '\\.\SICE'
9 j4 d1 m6 d* ~8 a" e push eax) o/ D5 j( R7 U; {; x
call KERNEL32!_lopen
) ~8 ?: U! }5 N o g. k inc eax
( G- A7 x; x! }. s% _4 I jz 006505ae ; not detected, p: e- F- }9 A
7 p; l& u9 [9 Z) A) i2 q5 S2 K+ F
" h7 \% O$ w3 F4 ]& |4 h
__________________________________________________________________________
, M6 @. M" ~% S% E7 X+ L# x- P
h/ ?: F. g: I7 l5 N& c6 u7 }$ YMethod 12
9 D9 h* d7 G2 n/ m=========" ?- }/ c6 E: d9 q! J
2 [* k/ n4 k7 a* ?$ e1 @This trick is similar to int41h/4fh Debugger installation check (code 05$ S- r$ g4 d* K0 l" ?
& 06) but very limited because it's only available for Win95/98 (not NT)
; r: q! ? M5 b* M+ T0 U0 q+ @as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 s2 b8 v8 {) s% ^: [/ R# I! c6 d2 @3 t2 h
push 0000004fh ; function 4fh
A4 Z$ Y* q6 x, } push 002a002ah ; high word specifies which VxD (VWIN32)0 h6 H) F+ T: M5 @( W
; low word specifies which service! g; G# e1 V& x Z/ D! `
(VWIN32_Int41Dispatch)$ s& Y; b/ A7 ^, ? O
call Kernel32!ORD_001 ; VxdCall) G' |9 ~- Y9 _, U6 X
cmp ax, 0f386h ; magic number returned by system debuggers
) o# Z7 W" [/ F8 m0 ~ jz SoftICE_detected
7 X1 S2 {" ?0 m; z
) i- Z; L F5 uHere again, several ways to detect it:
8 f- e- H; d0 D1 _" Z* R) b. Z! K" y; M; u; G/ w0 J
BPINT 41 if ax==4f
3 u. c; l7 a; M0 G/ E: L( l+ N# E+ l# [ I( x; D* U3 Y9 l
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
( T% e b8 \3 M9 _8 F# z3 i
. s; q7 [* a8 I5 t BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 x- C+ g1 a7 j% |6 \6 ]
: I+ P4 V& u, q( X7 d
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: g1 w8 M. Z+ a8 k0 R! _0 N+ j O
1 c2 e0 ?7 x. _) l3 ]
__________________________________________________________________________
5 K) ]: v- ?# D$ }9 e8 p9 F Q9 r- u, k4 n! b$ J6 F. Y# S4 P
Method 13
6 h/ u1 i6 w# B3 B=========
N* J$ C- E0 Z2 Y1 g
9 i+ b- Y. v S& K3 v4 M: K1 l MNot a real method of detection, but a good way to know if SoftICE is
6 N5 U. L2 a! i* W0 `6 q einstalled on a computer and to locate its installation directory.) `' `8 ~' A* j
It is used by few softs which access the following registry keys (usually #2) :
) t; C" n# F. C" W" g
& N2 E5 K5 G4 o, S-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: r. K7 X) p( n \0 X\Uninstall\SoftICE! w0 r, M. E" m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 r \7 h6 B' v& ]6 h& E& I0 G; {-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* H* V' m1 g4 y/ T7 { i\App Paths\Loader32.Exe
. U" E. W2 b2 {2 o, L4 i9 y7 p# E) V* m2 e$ ]/ P$ w, h8 n
0 y6 j! j- {. h% v8 HNote that some nasty apps could then erase all files from SoftICE directory6 @- F) h, p- v2 L+ L
(I faced that once :-(
7 f! g. e: ]8 x' D( m |
+ U( B' p, F' C; xUseful breakpoint to detect it:' w- ]! M# r: ~4 ]" I! O I/ s
% N6 h6 _: c4 S% U* t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
: n- n6 {$ S2 ~% j; C' }) B9 T0 _; i( k# e
__________________________________________________________________________
+ L; \8 d1 \! } V$ P8 y8 g5 w" r# y7 v% Q; u
9 H$ M8 d O. V9 PMethod 14 7 ^* D: s% \( i) |5 |2 D: b
=========& V- w3 w, C' V8 i/ ^2 p/ H) J
: j$ u" A+ Y9 M7 s9 sA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 ?' g7 w. c$ [# K3 k/ Ris to determines whether a debugger is running on your system (ring0 only). Q% y# } E. p
/ |9 ]7 K* P( @' j VMMCall Test_Debug_Installed
6 c* h0 A1 o' i! D& O je not_installed; T; _% ~) j8 W2 z% w
" x4 T9 g. a& K" sThis service just checks a flag.# f* k. \5 I5 ?; x' W' a8 x [
</PRE></TD></TR></TBODY></TABLE> |