<TABLE width=500>4 M$ Q, e. j& w' {
<TBODY>" M9 \0 d+ U5 v/ k, c
<TR>
' K3 X H. V& X* w+ [<TD><PRE>Method 01
/ I% s0 v; Y, Y6 z; r& r=========
8 i( ?! R6 F5 N( m4 a5 W. b3 @2 W- ~$ B
This method of detection of SoftICE (as well as the following one) is
% `# A7 P" Y0 I% @' vused by the majority of packers/encryptors found on Internet.
+ s( `3 m1 q/ G, Y5 W& PIt seeks the signature of BoundsChecker in SoftICE
7 t3 Y" v0 c. D/ H# Z4 u7 @9 T
7 W; {8 ?) V5 r) q mov ebp, 04243484Bh ; 'BCHK'
1 _& a2 F5 r2 R9 T! I) X5 | mov ax, 04h
) K W A8 [4 _* P. w int 3 ' x1 ?4 A9 O6 y3 @$ T, m5 p
cmp al,4$ i) H$ f) @% W( D1 G& d
jnz SoftICE_Detected
# H `8 g/ f" h; ]6 K0 J( ^
' r4 C" ]0 r. M___________________________________________________________________________
' i: U' p, O; i& L" Z6 T0 ?. F& s
Method 02
2 |6 \/ ^. W- y! O- b J" W8 L=========
# v" V! y, b4 V# B0 l" o$ H8 D# o- W- d+ f | p$ C! [. W( j- O
Still a method very much used (perhaps the most frequent one). It is used
* l( M1 [5 N9 }to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( S7 f: N H/ x- P0 u% B4 Yor execute SoftICE commands..., f' L u$ G: O& p$ n6 c
It is also used to crash SoftICE and to force it to execute any commands
, W0 n+ f) B4 f8 d7 i0 Z(HBOOT...) :-((
! R0 ]) J' J+ P; O$ q# Y: D8 B, w- |" J3 W2 M- w% A$ Q" Q3 K
Here is a quick description:9 E9 E' U3 U O6 A3 J( O9 k
-AX = 0910h (Display string in SIce windows)4 l! P/ P% O0 }; E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)! h) l4 r: m# S {9 l
-AX = 0912h (Get breakpoint infos). a R8 O z- g7 a+ U2 j! o
-AX = 0913h (Set Sice breakpoints)
* Y0 q* g, s' q2 Z5 O1 B-AX = 0914h (Remove SIce breakoints)* ?& V/ K4 D: g& |# c! }
) ?, \! S$ B6 V" k: @Each time you'll meet this trick, you'll see:( W0 Z9 q- e6 t/ `3 [
-SI = 4647h
8 ` j, u2 N2 ^-DI = 4A4Dh. t5 M, V+ l' l5 }
Which are the 'magic values' used by SoftIce.
: |' I" ^7 M4 d! b7 DFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ i! G; A$ g% j4 K* R$ h# F ^- G/ d0 ]- g: u: l
Here is one example from the file "Haspinst.exe" which is the dongle HASP
% ?8 ?/ d2 `5 m6 }" ?5 K$ \Envelope utility use to protect DOS applications:) n$ A' g& ?1 f# u; Z. G! F
/ n" R0 X2 q- w: O+ [3 ?1 Y L$ s( {) B6 h5 ], Q* U
4C19:0095 MOV AX,0911 ; execute command.1 ~" k, C: C& }) E
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).4 b* w$ w1 n5 y) k
4C19:009A MOV SI,4647 ; 1st magic value.' V. Z1 O* G3 N2 U; B) {& O
4C19:009D MOV DI,4A4D ; 2nd magic value.
$ r" `! M% L$ Y1 p4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 G v9 C+ }9 G; ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% i) A# P$ D: }) T$ K% t3 L# B
4C19:00A4 INC CX
' o! [4 `" Z, _ q \4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
4 l: }- k! p+ L6 F( d; a4C19:00A8 JB 0095 ; 6 different commands.
: V/ P# l# R5 t, H- p& l" C4C19:00AA JMP 0002 ; Bad_Guy jmp back.# x0 c2 {6 Q4 k K" P, K
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 \% w$ c; r4 f6 ~' V1 v
" Y; y! x. D' p$ c& \; E
The program will execute 6 different SIce commands located at ds:dx, which6 m l2 R/ }# s; Y$ O- L8 f# Q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 k6 I( M5 r0 L1 s- r# M+ A! H, X
+ A% @! H8 A( v' h4 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 n) T/ m2 {+ X d$ a___________________________________________________________________________
5 _5 `$ @- |% K6 ]6 |( \# R. ?
3 a4 O6 j# V) o2 H- @, D/ G/ \# P+ |1 n7 j2 w/ `- O2 F
Method 031 b _! {+ _/ B0 r
=========
. G- X% R2 Q! Q2 r3 P
N/ K. J9 R& {( w& x" T8 |* {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
& D# U* J x% _(API Get entry point)
* u# i2 L \% z2 S) y+ m
! S8 `3 ^2 w( n1 z b+ w
9 c j8 O6 C& ] xor di,di" Y+ n- P" z5 ^% L
mov es,di& z' A3 d9 y1 P
mov ax, 1684h + J/ g/ W( o# Q# E( i4 c
mov bx, 0202h ; VxD ID of winice; i4 S+ w* P) v; ^/ r
int 2Fh
/ Y# k4 l: r$ S7 _ ^- b mov ax, es ; ES:DI -> VxD API entry point% ~9 {0 J" G7 q1 R+ E0 `1 h
add ax, di
7 \0 T R1 S1 Y0 N test ax,ax1 i1 l; v: d. Z3 j0 g
jnz SoftICE_Detected3 `6 p6 m" B' _/ z# I- q
# ]. _9 F3 p. Y- U; K, i___________________________________________________________________________: S5 h: P1 M* x6 t/ v, k8 v
) e8 t& ]2 i5 @! _* t3 [# ]3 m: ^Method 04
4 y5 |$ o0 r( j: J=========
2 _8 T7 f7 L9 s9 _1 n& }$ i
, M8 z& P; n, pMethod identical to the preceding one except that it seeks the ID of SoftICE" `) P+ S! U1 q' g
GFX VxD.
: g- f0 S. K0 b4 [' i0 k4 K4 R9 n7 B r# T; J' N9 r
xor di,di
. `* b% v: i+ b# L! N/ x7 c+ E mov es,di
' D* g' D( a- O$ ~ x' g9 Q7 Z mov ax, 1684h
# z2 z# A6 Z+ q$ y# n mov bx, 7a5Fh ; VxD ID of SIWVID
3 \7 r$ h: _- a3 q int 2fh
/ |8 G7 g* J* F) E mov ax, es ; ES:DI -> VxD API entry point0 C5 U' U; @0 r: W1 u+ @7 S) ?" T+ A
add ax, di
/ Q# I# N, }; {$ I/ [ test ax,ax% `8 u' b6 Y6 b* v' x8 R. V& K
jnz SoftICE_Detected. {/ q" L) ~+ r
7 d b5 A0 a% C b# F__________________________________________________________________________- }" u* e; s0 W5 A, g
% {( d- f4 |9 t, @0 i* Y- l5 `
# X; s7 B ~* h4 ^) FMethod 05
0 D+ D8 d' [) T" t9 n4 A=========- Z* l% L3 j2 c; w5 Q
; g! g8 m4 z' J+ }; K! y
Method seeking the 'magic number' 0F386h returned (in ax) by all system; f( |# I8 v5 }" P/ O/ x( A
debugger. It calls the int 41h, function 4Fh.
8 b7 y! V# D8 g" f- zThere are several alternatives. * H) E- c2 ]+ `( E
# P" ^: p: y# X
The following one is the simplest:
: S3 O8 ^2 A4 R) c# r$ I# B& @7 ^! c. \ ]" F% F0 n. t
mov ax,4fh' X( b6 s& P- |
int 41h" I/ d4 f G5 t
cmp ax, 0F386
1 i" @7 A* }' W% ?9 c4 K3 a jz SoftICE_detected
% S/ Z- S5 v4 D3 c- L8 l
+ O: i/ {4 _; v$ H- H& n) i3 ?" }( g
Next method as well as the following one are 2 examples from Stone's
, b R/ ]- c. R9 \: O5 ]- _"stn-wid.zip" (www.cracking.net):: @' B' f. {2 m7 j* `$ X4 B& J+ I
5 O. y& S* o, N5 Q2 U
mov bx, cs3 J1 r- C. ?! b2 R1 q& R% O* }
lea dx, int41handler26 X/ {9 V: `" H* d' Z4 |
xchg dx, es:[41h*4]4 [: E( @- p7 C' `9 |
xchg bx, es:[41h*4+2], g9 M, {/ I8 U* o
mov ax,4fh* n8 |) J' G, S. K, ~
int 41h
+ w/ i7 q" y* s1 Q8 z xchg dx, es:[41h*4]
% m: Z% r( N+ u# `, t xchg bx, es:[41h*4+2]
5 B, o) u1 r! x4 d; V2 i$ B cmp ax, 0f386h+ I8 A6 i! f% m0 f6 W+ h9 C3 Y5 j
jz SoftICE_detected+ X; B3 e9 y/ e, q2 K6 P
8 N4 h/ `7 i3 l# p& R# Fint41handler2 PROC: d5 P3 |0 D9 f' `& L/ b R6 r& Q; U
iret5 ^ Q( j4 c' [) E4 n: ]. J0 C7 i
int41handler2 ENDP
/ ^& _# m% U/ ^/ U7 W) C( h9 z3 F1 u! H8 v% L; H* X: q
7 n/ i! _0 V( U" e( S_________________________________________________________________________
1 {$ V% e' \: A* l9 N: O' K
) q: X+ t' L" m- P0 A3 v8 S z
1 j: ?; Z1 `' p8 c! Z- AMethod 067 M* {" Z u8 T- V, N
=========
6 C' i4 U/ j$ ^+ }) U8 K5 X6 _3 b
* H" m' m, C& ~# m2nd method similar to the preceding one but more difficult to detect:0 L4 r, W# Y7 r0 R9 k/ M
, p' ?+ F# P$ \) b
( f0 O% t; u3 C$ o
int41handler PROC. J- N1 ` l1 u- x' L! ^2 O3 o
mov cl,al
; l9 t5 P" w J! J) E' i) J iret
8 C3 Z- n, k. E% B1 e* k) Pint41handler ENDP
. N) u, }8 H6 P% J* z2 M
: @% S0 L% i! j, e! | L% k
6 K1 `) W# L0 y7 G! \' t8 p; | xor ax,ax
" d0 ?9 V: g8 A S& p) P mov es,ax+ P: X% M7 H8 D( Z o: ^
mov bx, cs% G: Z4 o0 _% b
lea dx, int41handler1 A4 }7 Y/ E# D4 N; V
xchg dx, es:[41h*4] R2 o( U+ r, k0 e4 E+ k
xchg bx, es:[41h*4+2], c& j: l, B% g( |& k
in al, 40h
$ R; ?: ~! f. v9 g# S xor cx,cx
5 ^% j v; B# _4 E; g" n3 j, i int 41h( m" S2 _; `( _, m6 R, J( k
xchg dx, es:[41h*4]; A* Y: i$ ^+ p& a3 z, q% T. z1 f- P
xchg bx, es:[41h*4+2]
% U$ }! _. ]- \ {8 U) E: D cmp cl,al
( [3 ?- Q; s) R3 O1 l% b jnz SoftICE_detected
) N. O' C# ]. t W* G f% N+ M; H- i) i' O6 _! C
_________________________________________________________________________
8 R( y1 Z, n6 h- R% T( a8 H( ~; H3 n2 E) P4 M8 I4 G- {: W
Method 07
; e) `7 j8 h1 f `0 k=========
% n) d1 M! S! b
2 B9 \5 A2 H- q! KMethod of detection of the WinICE handler in the int68h (V86)9 S1 ~! C7 v6 w9 U7 B
0 @2 f) h; D6 n# X! Q! u mov ah,43h1 J! ^3 J0 d" O' o, u
int 68h; P. I+ n1 { j. Z! s
cmp ax,0F386h
2 y8 v7 A; R, b* @- q jz SoftICE_Detected9 G' ~8 K8 B# I F: A7 n
% E; ]. ? J1 ?" @- {) ^( ^' C! ~$ m
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ U- K. b6 X- y _& @) g1 V$ `: h app like this:0 Y# B+ M, q2 e) \
0 l, b, U' C( o3 L; Y) v) [
BPX exec_int if ax==68
2 b+ K4 ~' ~ C# o7 m3 A (function called is located at byte ptr [ebp+1Dh] and client eip is& @; x D ]/ l6 Y/ V3 \7 s
located at [ebp+48h] for 32Bit apps)
* U7 f! X# q! H3 I; ]__________________________________________________________________________
" R# E. O/ {6 K# \7 l% T, U, W
) W6 G( Q* B# X9 J
; C: H' b1 Y( D- tMethod 08
9 a4 a& w$ p( p1 ^5 [% F% _3 M=========' L' Z3 f; L9 p8 n9 W; O
3 }' `) V; V* M r) Y$ T9 XIt is not a method of detection of SoftICE but a possibility to crash the2 p; `5 d- v& R: n* _
system by intercepting int 01h and int 03h and redirecting them to another4 L7 ? D2 |& D/ `7 d9 ~" m6 x
routine.3 h* M$ E/ `4 A$ ?/ u( J
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 Q' g1 d3 h4 oto the new routine to execute (hangs computer...)( ^; v7 D. v9 C& b% \. v
7 N: h; s3 n8 r! k1 ]0 W+ X
mov ah, 25h
5 }2 L% P5 b) E mov al, Int_Number (01h or 03h)
9 ?" Z# Y' W8 M3 @* X+ E7 g mov dx, offset New_Int_Routine
0 i3 H: d1 ?: u int 21h
+ {* W5 d0 n/ X) M2 D
" z+ ~$ g: E- l9 E) S__________________________________________________________________________, R e/ x7 \' G9 E0 t6 r$ ~" l7 Q$ b. q" D
2 t T- J, n$ M* |5 _9 g' OMethod 090 @+ C: Y$ |* ~! i
=========
" E0 T( E2 _9 P' e; ^9 \3 g: _5 [" O6 m( W) y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ V# G" N. M; X+ X9 E: [# C+ tperformed in ring0 (VxD or a ring3 app using the VxdCall).8 M) W8 z. q' V" t& _
The Get_DDB service is used to determine whether or not a VxD is installed
: N9 _# N: U: p7 Nfor the specified device and returns a Device Description Block (in ecx) for/ M x. k" T/ O' r' u% p. E
that device if it is installed.1 L# d1 N& j& b% ]/ O+ _* u/ M9 ~
, P3 n( B9 K0 H* c mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 U) N) @! u+ o! A- @ mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# O: j+ x9 _* A& P9 x2 E* D* a
VMMCall Get_DDB
$ p5 @+ @6 m! S0 _) J N mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ K# F& n: j: J; g" x; w; B' w4 L* G: S, h) D+ p% K: x1 i! {
Note as well that you can easily detect this method with SoftICE:
* e; C, |' J' T6 `0 ] bpx Get_DDB if ax==0202 || ax==7a5fh
% x5 f% z9 W$ l# R# L, W( V. D$ |7 i' U( D, Z
__________________________________________________________________________: m' \1 x* [* [" t- ~( e0 v; ?
y. D0 h/ t/ I! o4 O( |' e; i
Method 10
, Q) Y! ?( ]" @- K5 U=========* h0 V$ T$ Y( D& D+ h3 f; e& T, v
; ]2 k: X1 V8 X) v4 f) r
=>Disable or clear breakpoints before using this feature. DO NOT trace with4 O" L1 q" P" l1 U% p4 f
SoftICE while the option is enable!!
3 F5 ^( x% I2 P% H/ U& V
# C6 q2 A2 I* y) t) M, Q, IThis trick is very efficient:; R" T9 Q& l: ?6 H: A# k
by checking the Debug Registers, you can detect if SoftICE is loaded( \* w* L* U3 x
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
+ q: @7 w2 H& Q: [2 J: Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their" Q2 l* _" [* ?) T+ l7 e: G" y( p
value (in ring0 only). Values can be manipulated and or changed as well. U5 J1 ?3 g0 Y+ h" F! V
(clearing BPMs for instance)0 M( L% E5 M$ S
4 I! d& C0 S) H; u. @__________________________________________________________________________2 j9 W9 j! a1 P" ~
$ A) q! a( C4 |" X( \
Method 11
3 d' |% l: z3 \6 j8 X=========
/ p2 V7 l, _8 ]* f2 a) {
3 D3 W$ W3 u5 g' J- rThis method is most known as 'MeltICE' because it has been freely distributed
/ {, p( E7 d9 Z7 h1 }( rvia www.winfiles.com. However it was first used by NuMega people to allow
F" V: B7 L; M- H) `: r1 hSymbol Loader to check if SoftICE was active or not (the code is located
4 `! B" E1 N' f, [5 Linside nmtrans.dll).
9 L2 k2 }$ R+ o; K. K% [
9 C% S) L' K' j6 O$ ZThe way it works is very simple:9 b, X8 T2 y5 Q) }3 i2 n& y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for8 U1 x& s5 u5 e+ K
WinNT) with the CreateFileA API.
( e( A. p! H' M# M! _* }9 C" b# v( E5 X3 H7 F: t& D) Q# H2 a- O
Here is a sample (checking for 'SICE'):$ Q4 O$ _# B U+ U c0 g
4 {& n u, [5 e
BOOL IsSoftIce95Loaded()" {& g! L) y% y5 q' E. @% [+ ?
{
* y4 \- u* @- ~ HANDLE hFile; # d3 K" B; I( ~9 K$ M
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ V7 J( Z" M( G0 q: Z3 |! v! y
FILE_SHARE_READ | FILE_SHARE_WRITE,
% t2 ]( k1 I9 N7 U NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: R7 A( l4 Z2 K5 l6 h; T. m' @' u
if( hFile != INVALID_HANDLE_VALUE )
: x( K/ ^) X" s, B' | {5 {* O; I7 P* n R i
CloseHandle(hFile);0 d+ }+ |$ O+ _9 f P
return TRUE;- h) l- |+ d9 Z+ f: a9 K- i+ w
}9 D; O, C+ @8 }, z
return FALSE;. G: ]8 n' y# g5 Q" {5 x
}' }5 A9 U% m) M3 O7 @6 T! |& ^1 y
5 y; H- [& Y8 p# M) k* q6 i; SAlthough this trick calls the CreateFileA function, don't even expect to be# g" S; Q5 ~+ t w
able to intercept it by installing a IFS hook: it will not work, no way!2 z! z) l# E' T6 P* x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 d( w9 u) p2 X* b* N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)3 b/ S, P' `! ]7 {$ X
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 T! @% r% W$ ~4 X8 ]
field.
/ [0 g" t' X- i: `, Q: G6 JIn fact, its purpose is not to load/unload VxDs but only to send a & N* x D T8 W. J5 C7 r" m
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' A- {! h% `1 x% Q1 Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try X: ~, c `# g, t1 I+ S
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." t5 I# ]0 v% x. D- K
If the VxD is loaded, it will always clear eax and the Carry flag to allow9 m: i5 C5 n* Q0 u4 g) u/ b l$ J
its handle to be opened and then, will be detected.
, _8 H+ |2 D: ~& D$ {4 A; UYou can check that simply by hooking Winice.exe control proc entry point$ o) a9 g! \! ^1 o- Q) t# k* N
while running MeltICE., i5 G( b* G- l, m1 m8 ?" z( @
( z& I- P* L& J9 t0 L8 \& X/ S. D$ y+ M
: P. a7 J: S" c0 z 00401067: push 00402025 ; \\.\SICE7 i, c/ C! ?. {% k* e7 ^! [4 Q
0040106C: call CreateFileA5 T9 q$ c$ j; r+ B6 z; P2 f, b
00401071: cmp eax,-001
& m9 a4 p0 V6 C$ J1 s& w: V 00401074: je 00401091+ [1 l- B* F* k8 M
S% S0 w$ q* N$ E1 G k" x8 a: I! b. G
4 j; s' v/ c# m U& g+ r3 u' S7 c
There could be hundreds of BPX you could use to detect this trick.
2 A' v, A6 p+ W6 j2 d# d-The most classical one is:
5 ?/ T4 G3 T. P9 ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ r) B8 \. y4 l& B" H *(esp->4+4)=='NTIC'. D. s7 n9 W/ A; L
1 f; S/ J4 B4 e M; P# u-The most exotic ones (could be very slooooow :-(8 J) {( i6 W# p4 P7 f) ~8 s9 T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') * p/ D( @- `) _4 [! J+ v u
;will break 3 times :-(* f1 l9 y5 L+ `# A& L" p' l
% Z$ f; Q4 @8 s2 Y-or (a bit) faster:
) M- [& z3 ~, i3 C. e BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ z( r+ M! p4 y, D
0 W6 o) x6 @; `- n T1 w BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 q6 R5 O3 y$ t6 K1 L/ a ;will break 3 times :-(
$ d# j6 k: S1 |$ X. J+ p4 a5 b5 n- } r
-Much faster:) `5 y0 }8 Z N# o6 E
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' s/ g5 W1 T& V, U% U* j( k; _! ~' r
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen1 j8 y6 `4 ?( y- A! \% X) h8 ]
function to do the same job:
7 ~( {. N! N |" P" ]) h
) d2 f& m- Q$ C+ v, L, W3 { push 00 ; OF_READ& p+ @. |% r1 M: T
mov eax,[00656634] ; '\\.\SICE',0- V8 v [. m- d* @$ a" x
push eax
' R/ B/ C" Y. g, p: [: t call KERNEL32!_lopen
. f& B4 N$ M5 _' y, j8 I5 \ inc eax
4 [1 q' q6 u6 J( L3 g% S3 x jnz 00650589 ; detected" u5 l) H9 n2 K! s H6 L, }- z
push 00 ; OF_READ+ G: W( w+ @, | y
mov eax,[00656638] ; '\\.\SICE'
' Y, [, v/ _4 @+ p6 X2 z. j# w& P push eax
! F6 n; ~" g! R0 v B% |" g call KERNEL32!_lopen
0 n! q' S* l# K7 |2 V& c6 m4 G4 C inc eax% j' w( g( ^ m0 r9 {
jz 006505ae ; not detected. {: \0 @4 I- e, C6 N( h5 O
. n( S' d( T# A% @9 e3 E. b0 w/ D* e' [$ X' K3 T# G
__________________________________________________________________________
6 T! N# ~/ f: Q" L7 h/ d. ]2 n$ Z" z; Z" X
Method 12
$ T8 O" h3 K# I=========$ y% ~; t$ Z. S! c6 p* |
$ E0 _5 v" y& l8 e iThis trick is similar to int41h/4fh Debugger installation check (code 058 N- A5 M" g6 N- r: n1 r ` k! }4 ?
& 06) but very limited because it's only available for Win95/98 (not NT)# H6 G' M1 k; `) u- N& b. g, h/ _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.2 E4 r9 [( |/ n( d
$ T( y/ x. X/ M$ C( c% T
push 0000004fh ; function 4fh5 `! Y3 W0 \7 z! ~
push 002a002ah ; high word specifies which VxD (VWIN32)3 d3 r6 w8 \* F! k/ A' j' G
; low word specifies which service
5 d( H' _# G7 W# c" c1 v (VWIN32_Int41Dispatch); B. e3 T( W4 N# x
call Kernel32!ORD_001 ; VxdCall
# `: N8 T9 @2 D* D9 P& Z cmp ax, 0f386h ; magic number returned by system debuggers& D; s7 R* J0 ^
jz SoftICE_detected5 ]' w! A2 b! d4 m2 }% z, n* W
) O# X+ [7 r- g8 K9 X& }Here again, several ways to detect it:
) Z4 f9 [' v. s7 m
6 p. u/ P: g6 U BPINT 41 if ax==4f
( z/ M1 Z/ s$ ~* ^& C" u1 Q& B$ b- g+ F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 Q( \/ L6 N1 z8 T4 m
- `) H) Q3 c/ f( |) l( ?! k BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A C1 N& z' U4 H+ ]$ B
4 _2 G- o/ e) o/ m. L) x+ _ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
; H3 w( z8 |! Z8 [6 K
5 C) `9 A: O, p) M* c) N/ F2 D__________________________________________________________________________0 q2 C- v8 p% e# ?& k* q
3 Q& Y% ^/ e7 v* i5 T% p# }Method 13& M9 H# P( K4 ~$ K
=========
" ~# ] y1 G, `$ i. v) ?" \' `
5 _1 H0 O' U% ]Not a real method of detection, but a good way to know if SoftICE is
2 B1 R- J# B# X# d! l# R [installed on a computer and to locate its installation directory.' B5 K. k- W4 j, v% I
It is used by few softs which access the following registry keys (usually #2) :9 U" v U2 M& y+ ~! x" M
1 F* C9 n$ Q. v( C: [+ r) K
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 r* x# i* ]: E& {% _7 z& u; t
\Uninstall\SoftICE0 \- m) ]( `$ e% [! |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# H4 K- F7 J4 \2 R5 M-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 Y# B8 U) f2 C7 E: _0 U! m/ H+ E9 m
\App Paths\Loader32.Exe
0 y- a/ X/ O! H; v" A6 Q0 {+ b' S: q8 C5 p2 N% H$ n" I) b
* Q- v0 J3 I" c6 h6 j/ t- ]# H
Note that some nasty apps could then erase all files from SoftICE directory
& x- ^/ N8 J m: p(I faced that once :-( s/ m+ I; Z1 `7 F
4 b; i9 N( Y, x$ d" UUseful breakpoint to detect it:5 n/ U$ R- ~: G: m& y0 z
$ S2 ?9 N7 g: \# V8 L/ P0 a7 z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! ?2 n$ ~5 {- c( [4 h* S9 _4 U( W1 D4 L' A9 K1 M; N
__________________________________________________________________________
, f+ z* z/ C* G
5 i% t) q) {* h% x: }+ o- o/ X' W; d8 ~, V0 x4 k) g
Method 14 7 I5 ~! a8 l0 P. {: x
=========
5 h! b3 J c; K+ L9 ^
! h& A4 z- |3 H' b- Z" R5 n1 RA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. D) ~4 M. \, |6 `
is to determines whether a debugger is running on your system (ring0 only).7 U; u7 ?' A0 B/ C
+ L$ j9 x" l4 |2 `' I% M3 W
VMMCall Test_Debug_Installed7 [) q4 p! c- t6 h9 f) B
je not_installed& a6 I5 v/ _4 M! F3 A; @4 |
, D' k5 s# b! ?5 Q) a4 u* j3 p
This service just checks a flag.8 E% n( d/ s' ]" ?6 o2 v) j+ _
</PRE></TD></TR></TBODY></TABLE> |