<TABLE width=500>- [% r8 n# a/ [1 v% ]. W% P
<TBODY>
- Z( i2 r5 O, N<TR>
1 o3 U: r, V5 K# W* i<TD><PRE>Method 01 ; ]* r2 j% C' S* S1 L/ i
=========
/ r: Z' n8 u1 v5 d$ j( s* G' B) Q$ Y+ x8 p: \2 ~ l8 e9 Z" |: V
This method of detection of SoftICE (as well as the following one) is
6 v0 z! m7 _5 V" ~3 vused by the majority of packers/encryptors found on Internet.
- T$ X6 i' w" Z, BIt seeks the signature of BoundsChecker in SoftICE! X* z% D1 f) L6 R8 d5 w8 |* a
a8 e* W3 {: D' O0 z Q0 c mov ebp, 04243484Bh ; 'BCHK'! x) y, s' Y1 i
mov ax, 04h# N) V# U5 N( t f0 r U% P# ^
int 3
# i, N" S7 Z. G/ g' u' h cmp al,4
! D+ u/ N3 X" } jnz SoftICE_Detected+ G; N5 C7 [3 M; X
5 V6 P% W0 J7 J___________________________________________________________________________
! e8 k$ c0 M2 H5 m- \2 n& u7 O% w
- s1 Q7 n4 t8 p9 o$ I, \1 @Method 02
_# N' a$ O9 T% ]( {1 d=========3 w: P6 G4 n! p" r. ]
# {. o f- y5 G+ D+ aStill a method very much used (perhaps the most frequent one). It is used5 C; @+ N0 Z" K; }
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, H. j$ H" y; A, n' Zor execute SoftICE commands...8 ^! x: f( K0 m0 v, ?
It is also used to crash SoftICE and to force it to execute any commands. h& T/ u. ~3 a2 B* t; v- G
(HBOOT...) :-(( * c' r+ [; J; T5 {
2 r+ k, K, C( Q4 P" D% x0 K
Here is a quick description:; Y4 X4 W6 U& t8 P1 S1 c1 E
-AX = 0910h (Display string in SIce windows)' y9 ]+ e* e! H. L6 a; X
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 z' G3 w8 I9 H! F. ?0 Q) `-AX = 0912h (Get breakpoint infos)
3 u: F! L# v' @* k* f; _7 S-AX = 0913h (Set Sice breakpoints)
. g, y _, D% `+ C5 l$ t8 R) d; ?4 e-AX = 0914h (Remove SIce breakoints) [' B) s" W0 Q) |$ _
# Q; j8 r3 D0 H8 @0 LEach time you'll meet this trick, you'll see:: B1 V I5 ~) g
-SI = 4647h
1 e8 _# x. m& j3 ^+ T-DI = 4A4Dh
2 W5 `- x3 {$ ]/ W, b5 P/ V3 [Which are the 'magic values' used by SoftIce.
- [$ Y6 o% h: x9 I* M3 N HFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 _0 v7 z: g& d" B6 k
! ]1 c$ m4 m. X' w2 a2 IHere is one example from the file "Haspinst.exe" which is the dongle HASP
n, M9 ]1 J4 e2 P5 J% eEnvelope utility use to protect DOS applications:/ T+ k- ]; V; W: E [
+ e! l+ R7 {1 K8 H7 D
6 \ `- T8 s4 G; Z, u' B4C19:0095 MOV AX,0911 ; execute command.: i, r3 b* j; s! Y7 @3 L
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)., t% h" g5 d1 y# E3 D1 u
4C19:009A MOV SI,4647 ; 1st magic value.
& w8 P: e, L# B/ F; e4C19:009D MOV DI,4A4D ; 2nd magic value.
3 r6 f4 i; D. N+ R: T% v& e4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 F! g S8 A) q8 ~* h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
; ]9 A, V- `. j, g E. c! h- e" [4C19:00A4 INC CX) F. k' e- H7 c. M2 O
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
) r$ x: P9 V+ u1 x' f& a; ?4C19:00A8 JB 0095 ; 6 different commands.
% i0 y. H& Z( `+ a; k4C19:00AA JMP 0002 ; Bad_Guy jmp back.
/ z1 \/ \4 ^' j4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: } U- {6 e- ~! `" c: u1 T2 Q& w' |# d9 {% W, c B
The program will execute 6 different SIce commands located at ds:dx, which% o! B0 f2 `0 ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 j! }0 E4 [9 ?7 \: ~
/ v# u. ~) O9 @& ^: f2 E. z. L* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 G# |$ H6 \3 M7 l' `) X___________________________________________________________________________
/ n- L' }! c8 U/ o5 {1 x. r9 I, V- M
5 X9 H% a) U# I2 }
Method 03
% A9 t( L! ~& l=========
3 Z1 l8 t# _# g7 {. q9 u2 Y2 q' A2 f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
: w+ r) }1 [6 N% o( I(API Get entry point)9 D, |; r/ K7 E9 d* A) }
& ]% b& F1 { J/ q
3 l' ~- p) F" @. u m& W+ m' n xor di,di
: O" K& V z- n mov es,di
' B7 v# A# s. A, e0 I mov ax, 1684h
* G) V' x. Q4 O% O( D! o0 B) G# y mov bx, 0202h ; VxD ID of winice
- j" \# u1 c; X int 2Fh+ s. Z' p4 k6 l6 J$ R
mov ax, es ; ES:DI -> VxD API entry point
( i6 n. A* z- {) u add ax, di
4 n" J2 h$ m3 A8 t b& F test ax,ax
# j/ S8 g; N3 _' s jnz SoftICE_Detected
. U/ v5 V8 ~% R z' C4 c, g: x# O9 p/ L6 J' q) j
___________________________________________________________________________
7 c* w- f& f- @& N$ l! H; O. s" J
Method 04+ J0 i8 D- s8 T+ ]- F
=========
5 u# }8 y. T' T$ i: F# j5 c* |& A* |
& t) Q! Y9 ^2 j5 @# N. qMethod identical to the preceding one except that it seeks the ID of SoftICE% w2 L. J* A! m0 l W
GFX VxD.
. J: u8 G7 i6 a0 Q; B
6 u. L: k1 a0 \9 p1 [1 | xor di,di1 E/ D; x3 K2 [( ]7 X
mov es,di3 j' @- f) D) L/ y- b4 z: e
mov ax, 1684h
0 F* N3 i+ m6 h+ J4 I mov bx, 7a5Fh ; VxD ID of SIWVID- w8 B. C& \7 \" L9 m6 t4 ]% n3 D
int 2fh* X! i) k d3 L& Z5 D4 u. {, _
mov ax, es ; ES:DI -> VxD API entry point
! G# b8 Q0 N# V% Q add ax, di4 v- I8 J8 r# q. E; B- |
test ax,ax" Q# F* g5 B. C1 v# B2 ^7 \. J3 O
jnz SoftICE_Detected
6 ^; \" `2 R3 O& K# P" S, h$ f5 T4 X' z5 U5 B6 m: s% v. D
__________________________________________________________________________
* I6 c( l# C3 v' x8 I; u: B0 ~
1 B9 l. e9 z: A' Z8 G' N! c; @
$ C9 |6 M+ y- T, G2 F* XMethod 05
6 ~+ k7 i1 {0 U0 y/ z( \2 P=========
, a5 O8 A6 q- T& J2 N% o$ W$ W" l8 J+ Q$ ?& C
Method seeking the 'magic number' 0F386h returned (in ax) by all system! q: Z! z5 V1 L% L
debugger. It calls the int 41h, function 4Fh.
( r6 ?+ |% }8 R9 o* d' v- RThere are several alternatives.
$ n: n# N0 r$ T( [- v6 H) c* w% `4 W# @/ q( Q& f& X
The following one is the simplest:
' H' H0 Q' T: c: p& }3 Y% j) C X; I" [2 D
mov ax,4fh
" g! Z4 Z' x4 |7 e int 41h$ k% V% C2 h- a( l
cmp ax, 0F386. f/ O( P, v- W1 D- c
jz SoftICE_detected8 K2 Y1 ~# c* o Z
$ _$ a& d# O& l3 G0 s
' t I6 B5 h+ e# dNext method as well as the following one are 2 examples from Stone's
, v n& P$ T+ E! O* Y) p% b"stn-wid.zip" (www.cracking.net):% I4 n7 i( e2 O) {# w, ]$ `2 m1 m' c
4 e- I) Q6 Z1 T mov bx, cs
/ H! W" @0 \; R( V lea dx, int41handler2
2 b, v7 O0 d( V: O8 q. g xchg dx, es:[41h*4]+ Q" @, _6 v, r' y u$ g( F. L
xchg bx, es:[41h*4+2]
; ]3 @$ R: L A; w/ i mov ax,4fh
$ ]$ B) X( p4 Y. R" q int 41h
* C% M/ X7 ~* U9 w$ i xchg dx, es:[41h*4]. M2 {! h8 g1 ~5 _
xchg bx, es:[41h*4+2]7 k# d. q# f0 z
cmp ax, 0f386h
9 _8 c9 h4 J. r& `3 u7 Q" E jz SoftICE_detected! F2 f" i- E. p6 e
8 U! [& B8 t3 c @int41handler2 PROC
$ W, \( \# f4 x7 L9 H iret* q. z# e5 k- {& g/ O4 i7 w% L( O- l
int41handler2 ENDP
/ g6 E+ {. [4 z* p$ F L
6 \. B2 j* B) J/ Z" [8 L9 |4 z, Q- f% P: Q- m7 w/ M9 C& Z
_________________________________________________________________________
* \8 K Y& H [% a L& |7 d; e* q
( |7 W* R0 H0 I8 T5 i9 P4 l
6 R& m3 f+ k2 a5 e; a& MMethod 06/ u- z: o2 C6 d4 b* h
=========' m. m$ D9 C, I# v9 \0 J
# V/ z8 i4 U; j0 B' O7 L: w. ^# d0 T* \
2nd method similar to the preceding one but more difficult to detect:
& p5 b/ ^, k5 T# d2 F* b# W0 q' b$ l" S4 `( v8 t- c }6 [, T
6 D- d- `' o- A7 D3 }- {int41handler PROC/ ]* `7 ?3 a% y5 I
mov cl,al' @0 m0 F# V4 M) B+ O9 f
iret X& N2 x# [1 F7 g6 u
int41handler ENDP
' h0 |4 q: G. O$ E
0 u. j: F) h# T$ }/ O
- B. u' p' D8 N0 A; W1 U, J xor ax,ax
1 L& `) W' k, [2 j: o+ I. d mov es,ax# Y+ r8 \9 u4 j3 m9 d: Y0 w1 z
mov bx, cs
0 l" Z# J8 X' t$ | lea dx, int41handler
3 z+ k2 I) @* u! h+ `. ^ y, t% D: \ xchg dx, es:[41h*4]
( F0 y' U0 V @6 Q$ o- E$ r* P6 s: h- i2 J xchg bx, es:[41h*4+2]
7 a) T' O" l$ C. T9 N: f in al, 40h+ T0 Q% `5 V0 O9 g
xor cx,cx
6 Q7 C& O* c5 T$ a7 M1 z! F( a% H int 41h2 ?8 G) k" p h
xchg dx, es:[41h*4]" }0 P( D0 p8 H. { J
xchg bx, es:[41h*4+2]: T( C$ ]& p- {+ Q. h1 J5 r* h1 O
cmp cl,al
, |, D* A! ~& ~% U* q jnz SoftICE_detected3 u/ s* f6 _ Y# B" J: o
, X5 s8 t! h' F; O. w_________________________________________________________________________
3 k- |- }# j' a, b! e8 C) Y, _8 [* b& h; x
Method 07' j: d$ w! ~' a* B4 ?5 T1 `
=========
2 O" W; q2 ^1 u; Y3 ~
" z$ l8 M4 m3 E) ^- D' F, j. U) S: CMethod of detection of the WinICE handler in the int68h (V86)
% K" g" \; Q% o$ L/ C3 j
* H3 Y, _) C# r: n7 J } mov ah,43h
! r! Y; q: m$ L, n# u2 \% @; c int 68h9 N6 ^ B9 Z/ _/ p g: x' J9 A/ n
cmp ax,0F386h# F5 e; y' Y1 L3 D" M' ?% }
jz SoftICE_Detected
e: B, j0 U# ^) ?, C6 f! G* n5 |
6 ~: h* c# Y. s; y2 [. H$ w
: }+ h4 w: E; i4 X4 j: G, T' a6 K=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ r: Z& g4 v$ G( L' p" R3 J$ ?& I app like this:) R8 j& |8 p7 A2 y
$ d& A- q, L8 ~: }+ g. P
BPX exec_int if ax==68
% ^% ^+ H" W, V D, M( V2 F9 l* _ (function called is located at byte ptr [ebp+1Dh] and client eip is
N- f/ Z6 O- `. ^ located at [ebp+48h] for 32Bit apps)
4 ~6 c* |7 f- U__________________________________________________________________________3 z3 o) Y& L- u0 r
$ t) I( p8 q o0 [% g. g1 a! Y, Z( N3 c! a# p! l* j/ ~- W. ?
Method 08* r' ~; G+ ^- a& A
=========* A/ a. H% A3 t7 g# ]- P. |# I c4 {
+ w1 r" S. g4 H/ e' N* q" a* x
It is not a method of detection of SoftICE but a possibility to crash the `1 [# E7 F+ s: x9 v4 c- F
system by intercepting int 01h and int 03h and redirecting them to another
) |: ]# a; W- v2 j U9 t7 Lroutine.
9 ~4 ^5 B5 Y f9 V" |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points0 D( {, \0 w" ~
to the new routine to execute (hangs computer...)
0 O4 b. P& u: Q, J' F0 _
) F& ~* u3 M! P+ _4 ^8 q( b& _ mov ah, 25h
( j- q/ q0 } M5 ` mov al, Int_Number (01h or 03h)8 u+ o: [2 m1 W- R+ l v/ ]- h2 o
mov dx, offset New_Int_Routine
9 X' G0 t1 G3 _6 ^9 H9 X, W* u! d7 Y% t int 21h9 P) @$ H- M% v7 W1 K. T/ t
! X# f: X. C, A' L/ {
__________________________________________________________________________0 d9 e1 p1 i! Q- H4 b( {0 E) v0 X
: a' @+ |5 ?3 k q4 y
Method 09# m5 O6 Q2 C. ~% `) ^
=========
# s( R7 o8 c, P9 H9 F5 e
! a1 \. |) w( |/ E2 A wThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- Y0 o% |2 a5 yperformed in ring0 (VxD or a ring3 app using the VxdCall).4 f: Z0 K" X2 f {
The Get_DDB service is used to determine whether or not a VxD is installed F( k3 Z+ D( K* y, {; w
for the specified device and returns a Device Description Block (in ecx) for
1 V! t( v G- Y) athat device if it is installed., ~3 J- P: \) ~+ o P! _; Z
$ h2 D2 Y4 `/ N9 B8 t; s* w
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID f* C# _5 Y! T! P
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% C$ e# ]" c. `) e) v# L. R
VMMCall Get_DDB# A: b% P" L H, x7 ]2 e
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: y" Y6 S( b6 I
9 u$ Y7 h3 B& u6 g6 W: }9 W. M
Note as well that you can easily detect this method with SoftICE:8 d& j! j$ O3 f& u [7 U
bpx Get_DDB if ax==0202 || ax==7a5fh
/ Q1 s, k4 r( u, @& s5 r" k
$ Z, J! `- n8 S1 L4 d5 y7 m' @3 E__________________________________________________________________________4 W& h7 d7 Y( r7 e, T7 @' X: v9 @
1 g8 X" e/ `) _; X, D; u1 I tMethod 10! @6 g* ?& h# N% r- M7 z t" _3 }
=========
, ~ C/ L- d2 k( S; _! A* u( E+ ]+ W! Z: E) a0 u
=>Disable or clear breakpoints before using this feature. DO NOT trace with* y" `% b- e& t1 I9 q9 _
SoftICE while the option is enable!!# a4 X$ {" o W0 f; q' `8 N
/ M: m: }( X5 G
This trick is very efficient:
O& U. E/ @( {: G) Q. ^9 Dby checking the Debug Registers, you can detect if SoftICE is loaded
' a* O/ J! G- h; M' K4 h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 g, O5 N' u( [! R) o- k/ X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
: I/ l! n+ o' ~$ O0 C6 ivalue (in ring0 only). Values can be manipulated and or changed as well
2 W/ w: S2 B* S5 T9 m7 ^% F(clearing BPMs for instance)
& R! ~; ~8 c* z# k- M/ t! @% A
0 |/ ~2 z4 ]" y: O__________________________________________________________________________
" R$ S3 Z. z1 a6 w; W6 j. L3 J( z+ Z# G2 W; q9 s& Q
Method 11' O% s! C/ j! ]! A; G
=========
; S, a1 y9 O. {/ v9 [! ?$ K) i$ Q2 m3 ]" U6 n/ U* s
This method is most known as 'MeltICE' because it has been freely distributed
( g4 G% b2 A0 }* T! u& }via www.winfiles.com. However it was first used by NuMega people to allow0 y( K1 z0 m. _. i, J; v. @
Symbol Loader to check if SoftICE was active or not (the code is located
8 F: s) K0 t* F/ s2 Y/ r/ y2 xinside nmtrans.dll).5 j" D) {* a. w+ ~
( v F* O, N( M8 CThe way it works is very simple:# Q& p3 d7 h n& U8 L w
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. E4 ~# N6 h; H
WinNT) with the CreateFileA API.
( x) T$ W$ e5 u+ u, s& H, x1 K7 h
( v6 s" k9 ~; u. ]0 ^( CHere is a sample (checking for 'SICE'):
+ u6 D; y8 k# H f) ?7 A
' U) ~/ c! b) O' ]3 wBOOL IsSoftIce95Loaded()
: z% `# v' C% p/ p; [{
& t: v' v; D+ d, p8 b+ U4 ~ HANDLE hFile; 5 c5 z0 x* m& y6 K3 Q/ @. \; h3 L: `* X) H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 b+ }: w* Z, a* ~+ ? FILE_SHARE_READ | FILE_SHARE_WRITE,0 C4 l# d" D' b) N9 b
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 U- {) G) R+ s if( hFile != INVALID_HANDLE_VALUE )5 j1 P8 _3 `' ^& p. Z% r
{$ z, X: ]8 Z: s
CloseHandle(hFile);
1 r4 n; z+ z' ^; N8 [0 P+ { return TRUE;
9 g1 e' \8 N5 [ }2 I/ F, k, _2 {7 c) z7 G" T
return FALSE;2 k8 t3 i p3 N& {/ G- l
}6 z7 X+ L8 [0 E" S5 g4 m1 O
5 B, H% C0 O% F2 y/ O+ `Although this trick calls the CreateFileA function, don't even expect to be2 O8 P" ?$ r) \4 [6 o/ X
able to intercept it by installing a IFS hook: it will not work, no way!6 J: C$ M5 e5 c5 _, v; p/ k( b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F. q# I- p0 X$ \" ~$ C
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), D1 Y" z. N7 t2 i, L- \! A
and then browse the DDB list until it find the VxD and its DDB_Control_Proc& u! y! V f1 X
field.2 Z1 V* X& r8 v, r# P7 T, c
In fact, its purpose is not to load/unload VxDs but only to send a ' a( Z1 f; U1 r7 j' r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)- T4 E! k% D4 e( K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try4 t$ S o: \* a/ O$ @9 m6 v0 T* ^
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, `" k7 @1 V; d( e1 i# zIf the VxD is loaded, it will always clear eax and the Carry flag to allow! h, U$ [+ G" P4 k! G- l9 z' ~
its handle to be opened and then, will be detected.
8 [* _" |+ {2 l3 ]- \6 qYou can check that simply by hooking Winice.exe control proc entry point+ e/ ~/ C' S Y. u6 F
while running MeltICE.
/ M" c, U. n u0 f. P2 _8 N. w- u% T5 n" E
$ ^' k, q5 G0 {3 |# z$ h+ Z& q
00401067: push 00402025 ; \\.\SICE
: [ y. e$ t. P/ N. @2 |" k 0040106C: call CreateFileA9 L0 d' p* r# p9 O# k
00401071: cmp eax,-0014 R+ o7 c0 N8 r' e* x
00401074: je 00401091+ @1 f% S, X7 G7 k" S5 o
6 @1 H2 I- S& a3 X7 |
2 i+ |8 P: C- h
There could be hundreds of BPX you could use to detect this trick.
9 j" p7 B) d5 q8 u% h-The most classical one is:5 f* p9 _% n# w: S+ I
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
+ Y, P9 i7 v& a7 Q, ^0 z) N- k/ g *(esp->4+4)=='NTIC'
0 P& b+ k3 K- O9 i- f# t9 R: I: u
-The most exotic ones (could be very slooooow :-(
* t) Z3 D: S! h/ B2 f) k4 q) V BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - R% D. ^, I( F( W- i) n
;will break 3 times :-(1 w/ N# _) A. n y/ A- ]
& `6 B4 T5 u" {: {1 _-or (a bit) faster:
+ ~+ K8 C6 A, V9 ^( q3 y9 C BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 r2 F! y% \8 Y! {# N; w" @: }
5 R- G$ `; p7 U2 c% d
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 7 n! s, D6 t' Z5 x8 s$ a: s8 y
;will break 3 times :-(
7 @7 r" T* K" H: y: G8 g
" K+ z J, P; _/ s9 |' K0 @! X3 n6 M-Much faster:2 Z0 z0 d h) [) u
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'. F) a5 ]' A: c1 g8 \4 f
4 c/ H0 S8 c a1 A W* z+ Z+ {! E+ g
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
, N) z" R A [function to do the same job:; V9 P' Z1 M# [4 A7 r, @0 i4 Z' f: i: W
( O% m: E) X: y& V z; l, W, c push 00 ; OF_READ
2 T6 E# M/ M7 w5 i& I, ~ mov eax,[00656634] ; '\\.\SICE',0+ Z) N- g0 V* A, w( l: E" z
push eax+ }/ N+ i5 R7 {. W
call KERNEL32!_lopen
6 _( a4 Z, | x( r+ K inc eax& Z, r, P$ O6 u8 _
jnz 00650589 ; detected, {5 y/ G( c9 x" v
push 00 ; OF_READ; x. f! S H* d5 G. @
mov eax,[00656638] ; '\\.\SICE'
1 x8 \$ m. u: p+ J" S; f1 ^ push eax2 R) A/ z3 `4 q/ S h8 v" ]0 X: B! o
call KERNEL32!_lopen) g! f: C7 H3 \2 [4 j
inc eax
# |- z4 A' A- c) d0 g9 H jz 006505ae ; not detected8 {8 s- ~. C$ D, w( s% X" w8 u
) F( k. @- y0 C+ J, M- \. w; z& t1 W: S; Y# w8 H
__________________________________________________________________________$ l6 p, I0 r' Z1 f l4 X. m
# [# _$ U4 S$ d3 q- w5 y. `; V
Method 122 T, l3 z& S* k" Y0 P: M
=========
8 p5 f& w1 \6 i5 m% e: i
1 d, O: x* ] f5 E; hThis trick is similar to int41h/4fh Debugger installation check (code 052 |( U# U! M7 H$ B7 {. B; ]; g5 a
& 06) but very limited because it's only available for Win95/98 (not NT)0 _% E$ f( A) C- M* R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ M% p- x# k0 j x2 {! @' C
, R. B1 ?& A- l push 0000004fh ; function 4fh
+ ~! W6 S- t/ i8 H push 002a002ah ; high word specifies which VxD (VWIN32)
& N, Y5 H* [1 X9 q0 x2 w ; low word specifies which service
+ P; e4 ^) g: x" ^1 m5 D (VWIN32_Int41Dispatch)! ^& N6 F/ ~/ Y
call Kernel32!ORD_001 ; VxdCall4 F5 S. r$ a6 \
cmp ax, 0f386h ; magic number returned by system debuggers
7 i& {3 @$ x8 J7 h: { jz SoftICE_detected
- _# i, Q9 r& w/ h6 p9 x( E% k
+ ~2 c. o" w' r+ A5 }! H/ {( uHere again, several ways to detect it:2 B# B! y- T& ?. c. f* B
5 l. |7 h4 W: q7 ?5 ? BPINT 41 if ax==4f6 {9 j2 K" ]/ h0 H# ]
" j$ X6 E2 a8 }5 T
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 |7 O3 d: C+ b3 d1 E- ^5 R( t5 |5 ?; r, t" T+ E
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 w5 |- b6 n0 t# t! e, T* f' _' x! b6 @) V# q# X' x/ P
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 b- a I2 s6 m8 l4 v8 B5 L
# r! r) i! s( b; I" @+ e" Y3 ~__________________________________________________________________________/ c( X% e0 G" ]' O) y0 `
/ o4 b$ K! Z0 J3 S% _
Method 13& m& [, e. o P% t+ ~4 t
=========) s& |. @3 `7 t1 f7 J
1 D- N/ d5 l# H6 ]/ J9 P
Not a real method of detection, but a good way to know if SoftICE is
1 ~. G) Y6 u. H q8 Rinstalled on a computer and to locate its installation directory.
- o! E) ~3 N. w {7 ^It is used by few softs which access the following registry keys (usually #2) :
1 [7 N% Q, ]2 W, ]2 O8 F
5 X1 Q o7 v9 \) j; F* O) _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; Y) J* F4 a) Q! J
\Uninstall\SoftICE
0 K3 L( [) f& L9 _# a7 p: P-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 Y% Z* G, E7 ?
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% i, P& h3 Y2 Q
\App Paths\Loader32.Exe$ J1 P. O! y4 m# ?7 `, D$ P
$ M$ C3 Q) ~: W
4 M7 k- G3 q- i8 zNote that some nasty apps could then erase all files from SoftICE directory
, \% ?4 _/ D7 r* F& U! ]9 L) r(I faced that once :-(
$ t2 e2 u8 H0 r8 v3 a0 R% v- I* A6 U
Useful breakpoint to detect it:
( o' K+ |+ D( a! E4 x& N8 R7 D
! F) C% H+ T! L. l0 Z6 E BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 J$ l/ t! d' T# f% D* j% N9 }( I: `/ I* a
__________________________________________________________________________
; j/ P( q2 {8 Q/ H9 C. W3 E0 |0 x, w2 g$ ^ Q3 T
0 i F M& M" _7 xMethod 14 5 R- ?7 t. R. z& {( u
=========! m5 S3 l$ p: J- t' G, |
: ]: m9 }- A$ J5 ]/ Q/ Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 p5 n5 H, t9 A2 p
is to determines whether a debugger is running on your system (ring0 only).
. Y0 u( [" D* O( S o$ q5 L! A9 M/ p+ H
+ J9 b, g3 P! v. t VMMCall Test_Debug_Installed
E. ~5 E/ O+ \/ {& [1 x je not_installed+ ?" O t8 z3 H. ?, c. M3 i
8 ]. v3 l: l( m
This service just checks a flag.. i: @+ w7 Y* `8 I
</PRE></TD></TR></TBODY></TABLE> |