<TABLE width=500>
8 T- f- P! M+ ~& [1 e<TBODY>
# I9 I0 G7 f* f" z<TR>
3 s6 q% N" q- P0 F. X; ~<TD><PRE>Method 01
1 P* o% c7 Z" R* j=========$ o6 G2 a' w' }; O
' j9 i! f( k( v1 Y9 C8 {2 P
This method of detection of SoftICE (as well as the following one) is
& [8 {* t* \6 J5 g5 h9 V1 hused by the majority of packers/encryptors found on Internet.
0 F/ J2 P" q qIt seeks the signature of BoundsChecker in SoftICE1 m5 J. |3 b) w1 b. L
3 s& q- t, k9 v3 V mov ebp, 04243484Bh ; 'BCHK'. _, S" t0 @- o( Y
mov ax, 04h' u: i) \& w0 D. ]" |
int 3
1 G s) \& R& O% N; R3 a+ M5 ^ cmp al,4
( y6 z# D' |% ] jnz SoftICE_Detected7 P" [+ G" m, b' }! k3 Q
) r( D3 u9 e [9 y! X0 ?4 Z' r___________________________________________________________________________
5 ~( D! y$ E- e8 e
. n, d0 T9 [9 a, N* IMethod 02: T8 @" {9 s4 q
=========
! u! G2 y+ _1 H: \/ r8 [" f
. K( b6 T& Y+ |- xStill a method very much used (perhaps the most frequent one). It is used: v$ G ]8 S" s9 E1 [3 B
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 {+ \% e' P% J- _+ b/ n9 d
or execute SoftICE commands...
+ m; b/ ]7 i, j: gIt is also used to crash SoftICE and to force it to execute any commands6 M3 n1 P8 k1 i7 X* K" N& c8 K
(HBOOT...) :-(( ; o% H4 J9 O! W4 `: H# l! r* \
1 J. G; J$ ~+ E2 b5 E4 k
Here is a quick description:, [0 ? \- A4 h+ O6 \8 C
-AX = 0910h (Display string in SIce windows)6 g3 j. V; w. N* x
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
+ a9 h; ^5 _$ s: T-AX = 0912h (Get breakpoint infos); N% j- \7 j' T* W5 L t
-AX = 0913h (Set Sice breakpoints)$ [# J p I) v! W' J3 m
-AX = 0914h (Remove SIce breakoints)- B" o7 x6 ^" |, V
}. ?0 |" E9 b1 B
Each time you'll meet this trick, you'll see:: B( U) \1 t% |1 X7 Q
-SI = 4647h% H9 ^# n7 a; [
-DI = 4A4Dh
* e! z5 p- [2 J) M& f5 B& s1 DWhich are the 'magic values' used by SoftIce./ m, _% T+ ~: n! }" Z: O
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% ^$ B X$ Q! N/ L
9 }4 W! W c) \8 h7 bHere is one example from the file "Haspinst.exe" which is the dongle HASP
5 p3 i. p% P' w5 `Envelope utility use to protect DOS applications:) u2 `" M& A5 b I1 Z; |
$ s9 D2 h$ t; P/ Q/ z; d) g/ ^
, ~2 @' w0 e$ ]4 [- D# r) h/ A4C19:0095 MOV AX,0911 ; execute command.
9 H- ]2 Y% P4 f4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).. C% z6 t$ z" \% h7 ?- R
4C19:009A MOV SI,4647 ; 1st magic value.3 J9 H$ r1 f* d
4C19:009D MOV DI,4A4D ; 2nd magic value., p# Y; M8 j* w2 v! L% ?
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: X& `( n: H' @# l( \4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute H5 t0 J- x" ^/ Y' \
4C19:00A4 INC CX. W5 W" J4 W+ l2 F$ ^# J+ V3 ~- c
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 V# C5 b) v! G5 k) T o, O
4C19:00A8 JB 0095 ; 6 different commands.
, y5 E# g+ w5 D2 N! \: P4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 Z+ _! s* J |. L: W1 V3 E4 h: [4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 j# w( {' Y2 u
4 Q/ K" U. A: V" ~" O% e% pThe program will execute 6 different SIce commands located at ds:dx, which
' `6 `3 A; m: S+ Mare: LDT, IDT, GDT, TSS, RS, and ...HBOOT." P# n2 b/ m8 U6 L: o6 y. S
# y' u4 g$ e! _: {* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ N( s7 e3 g7 `3 o. N% t
___________________________________________________________________________# E& H" P2 M) P0 x8 t9 w9 J
1 r/ v9 N/ v: N5 U* I& L
/ K5 R7 t0 ~* W; C
Method 03
2 p2 L! j2 K8 L* r=========
) m) I* G0 r1 l3 }
5 X% v2 ~7 g" |3 }' R& ]Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 c+ _- j/ c% s# H. r
(API Get entry point)
) ?) H" T5 H; {! j0 ^4 b4 d8 A" s * p% c5 H4 Y$ X. D) O& x0 N
2 v1 R Z/ a- D7 G8 T7 i+ p- K
xor di,di6 z7 s2 H1 P# C; I+ u0 C6 q( \
mov es,di& V) G$ a& i2 e( \/ G9 Q4 N7 Y
mov ax, 1684h
- O. H2 f2 ?5 T4 } mov bx, 0202h ; VxD ID of winice
+ {4 D {) B8 c+ _$ t. ?! ? int 2Fh
* D+ x; j/ g. ]9 X2 ]# n mov ax, es ; ES:DI -> VxD API entry point1 y* {! B" x3 D/ G% N* V! W
add ax, di
, t# q+ @& c$ R3 X4 k; t. @* f test ax,ax
& B: [8 b9 C8 D; E jnz SoftICE_Detected
X5 M: u; ?& L+ S. H2 Q
; g" P: j& G; a$ K" U1 @ N___________________________________________________________________________
- O" R+ |7 x, x) a& `/ v' z* l+ p# O& `# i; U
Method 04$ j) p$ \9 s& t: s3 ^- M
=========
' }! Y/ V* g3 j" B" a, V3 P- K5 h! q7 w8 u
Method identical to the preceding one except that it seeks the ID of SoftICE
- E/ n3 W: b' U+ O& I; n: C/ ZGFX VxD.1 {( R2 R4 C) y5 [% A' |0 \
( C( w0 E# E' ^# h( Y
xor di,di
( Z( k1 j; [9 M, r; m! L mov es,di
4 a9 I; g4 U! V; A* ~; T mov ax, 1684h
m8 h( K* P/ [6 V mov bx, 7a5Fh ; VxD ID of SIWVID
4 g7 c: G5 R! n) G' l$ [ t int 2fh8 @) ^( ~- [; ~% a. b3 w7 d3 T
mov ax, es ; ES:DI -> VxD API entry point
/ \: b5 d8 u8 I7 k add ax, di
# I4 p3 R& }/ n! f test ax,ax! E9 S0 R* S* a8 g# A! P5 I2 f: [+ x( N
jnz SoftICE_Detected
! J6 N5 U8 m% i7 ^
3 w) S) ]3 `8 R( y1 N__________________________________________________________________________
. h1 _4 G o. B7 S& U) s! {. @& Z: ]" J, _6 A- M/ K
2 D1 u: u( \: ^" s% u! @8 |Method 05
$ q2 F/ W1 w9 a( d1 P+ ~1 {" }=========
1 f* W. P; a8 j: G S# ^
1 {, V1 e& ~/ i+ N3 PMethod seeking the 'magic number' 0F386h returned (in ax) by all system
" z- h' P# N% G; l" R; jdebugger. It calls the int 41h, function 4Fh.
2 @5 ?/ n7 Q( s' }- q* l1 ]3 pThere are several alternatives. 7 j$ S& m' g, U; T
r, K3 Q# F0 |( |! _: p D' W
The following one is the simplest:! a9 p; U( n2 d
. K) V4 q3 Y X7 b, Z4 }
mov ax,4fh
/ m8 \8 K4 f% `3 F int 41h
! Q ~9 l* ]& i, v cmp ax, 0F386
, S: m$ U7 x: u; u# o" t1 R' n1 ]: a jz SoftICE_detected
6 {; F9 Y7 U6 A8 W3 E. B+ N6 K! F9 L2 P* @6 e
7 N2 v/ H# o" s& r- W8 KNext method as well as the following one are 2 examples from Stone's
4 A+ d4 n# j) M/ D! z"stn-wid.zip" (www.cracking.net):4 x# u5 V; f$ Q/ ~+ E- E8 b
0 d5 F s2 p, ^0 p mov bx, cs! { W% h% n6 V9 i
lea dx, int41handler20 h' b: x, W' u: f0 F
xchg dx, es:[41h*4]
" ]6 d! s8 d& I; w/ Q4 B3 r xchg bx, es:[41h*4+2]
6 k2 G0 S) f* M mov ax,4fh
% R" R( R$ z6 F" y7 B' v int 41h( h$ v" H/ i7 b$ O4 M
xchg dx, es:[41h*4]" w; t: j8 c3 V
xchg bx, es:[41h*4+2]
2 Z/ K7 X; z* J5 G: x cmp ax, 0f386h5 i. m4 G5 h; L3 j" j) B
jz SoftICE_detected
- _ c1 I0 i! R6 h
2 b8 [2 ]4 D* i1 j G! Eint41handler2 PROC
7 R- `! t) g$ T' W' h9 d- u$ B iret1 {# C2 ~; y* h+ G' _! Y5 x3 a
int41handler2 ENDP
5 H- n5 m& p4 ?+ m0 A/ R# j' Y; B5 z/ R: m" w U. o) M
1 |' y$ h$ T5 _$ ]0 |! i0 G_________________________________________________________________________
& G8 O; Y) x1 b1 t4 Z+ f8 ^% U9 s2 J
# \* l9 L7 X8 u- K* O( b6 ^Method 06
* c3 g/ n; o- }6 N* X6 [=========
- C. n+ g# ^0 X* H
6 r" b# q' ?" d+ T5 Y2 i4 X! j
& ?5 f. I4 [6 n" T2 o5 r2nd method similar to the preceding one but more difficult to detect:9 G. `+ p8 j/ G5 b# {$ q
8 n2 c% t8 g! L& Q3 s1 n
2 Q k! v, l& D8 ^2 wint41handler PROC
# x4 v6 ^0 |3 e/ |8 D7 {/ a2 w mov cl,al4 ]& z; `' E* x0 h* f( j
iret
0 e+ ?/ g) ]4 D4 Y2 uint41handler ENDP& C8 G$ z# N; o) T
" u& c, C, M) H* g! w8 f/ Q5 z
% N+ ?2 {9 @& v# v) `) Z# g; G xor ax,ax
, w0 S1 D; M/ z0 s mov es,ax1 q' G7 c7 I; A. U
mov bx, cs
" ]) }1 q+ t+ ^& [1 p$ x3 u lea dx, int41handler
- C: p6 q+ _, d xchg dx, es:[41h*4]
( _; H7 \' v: {, z- ?$ m xchg bx, es:[41h*4+2]/ Y/ ~( I( ` G9 A0 K7 o4 G& g
in al, 40h1 n. W3 g, d1 T" c# F/ c, C
xor cx,cx
6 ^% A: \3 S5 @/ I int 41h x& H' K( [ P% F* P$ n. v
xchg dx, es:[41h*4]
) Y4 i8 Y; F+ | xchg bx, es:[41h*4+2]. c+ @2 t( ~4 P# _9 V
cmp cl,al
K' x# z0 L( w, a( O1 q D jnz SoftICE_detected) N: E) b3 x3 A7 r1 j6 \
- f9 S/ C2 c6 c$ N( ?3 ^; d_________________________________________________________________________7 h& B3 X `% H+ c: o7 d$ ^9 F
3 M# D. a1 s9 w9 }7 F) H+ H4 lMethod 079 C, ?) u; y; E# V/ U
=========
/ i1 r) R% W6 |3 X, H: u
& _" M, C* S& ^Method of detection of the WinICE handler in the int68h (V86)
: e; \. U2 i- U1 _* n
4 H# F: N7 c% \5 W* \" w/ r+ V mov ah,43h. p6 [% z( o. \" C" ~! D5 `8 f
int 68h
, B9 K2 [3 f! h; Z4 D6 r2 m i cmp ax,0F386h
' x5 F3 F2 g. u l- I jz SoftICE_Detected
9 A8 S3 ]" D8 t" W# s m
/ S* `/ S- z, S) U5 ~
( ^3 G- x9 J$ {9 `=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit) U5 K @, x, E6 {7 |
app like this:& f& z, T o0 H$ G3 D+ B$ c$ b
" }, e" N! t, [+ k# i' J; H
BPX exec_int if ax==68
1 G( P) L4 f" o (function called is located at byte ptr [ebp+1Dh] and client eip is% t5 i ], [5 Q3 k
located at [ebp+48h] for 32Bit apps)
9 M1 p2 ~# W6 ?4 v( E; F' W__________________________________________________________________________
9 e/ ?$ D) W& [* R G+ a4 e! }+ c4 U/ p1 o
' o3 J& l- |9 s" s0 e( z/ `2 u* H
Method 08
9 _5 R5 x2 @2 H# ^7 J- \2 Z=========
4 U* {" Q" z+ C; P {7 x& |
; k8 {. t1 n( i4 ?) YIt is not a method of detection of SoftICE but a possibility to crash the* ~+ S9 \; j* z# }( I( J
system by intercepting int 01h and int 03h and redirecting them to another
) a( J$ o+ S+ M" aroutine.5 ^( u' k* V% {( y; }1 X* C3 N
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, {7 g0 r! d/ H8 {3 sto the new routine to execute (hangs computer...)7 c; Z. s) t0 n( ^
! t3 v1 b4 a6 g+ q. D! n$ j
mov ah, 25h
6 D! F+ ~7 U5 n mov al, Int_Number (01h or 03h)
9 q! @; U1 W) v x& O, N* [! V7 n h- ` mov dx, offset New_Int_Routine: C \$ c# ~7 V, ~: G# e* T
int 21h- U# J; l1 G$ w0 W
6 Y) H6 L+ g; k: \- k5 u__________________________________________________________________________
$ m* t6 {- @& L; y% h- ]
+ V+ m2 E/ u+ h% Z# d: P/ YMethod 09
5 }5 S2 ~! B+ O% R+ h& G0 a=========9 F6 w# J$ G, P
; V' |: |/ P1 v/ x, W* XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& N; W" p2 ^' f3 x6 R' L# jperformed in ring0 (VxD or a ring3 app using the VxdCall).
1 ?" P6 b+ ]0 h4 d w% C/ v0 v. GThe Get_DDB service is used to determine whether or not a VxD is installed g5 I5 E2 i) w4 h9 J. f" J7 F
for the specified device and returns a Device Description Block (in ecx) for! E2 m6 p" A5 i0 ]3 p* z9 X
that device if it is installed./ t6 D4 ?5 }* R; `' J
. e A" `% ]- ^$ N! z) o" T: m2 P
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 }$ k; ]! J. x2 |7 R7 W2 W mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* n* v4 A1 e5 {# ]9 b Y3 m7 d VMMCall Get_DDB
0 h* @7 p. J: `% u& x mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: ^0 w3 T" D; i5 c( x
# _& `. `( o5 J- ^: w5 INote as well that you can easily detect this method with SoftICE:
G3 u# L. z; X" u1 U bpx Get_DDB if ax==0202 || ax==7a5fh1 f& j n8 k' y; W2 m, A4 Y1 F- J
5 h! O, E) m4 I% Z
__________________________________________________________________________. w5 V' v& V3 I* A5 ~- Y
6 E6 |. U/ a! j; L/ B. j! `Method 10
$ f; ~0 `) v' W6 ^# x5 K=========
% m- X1 _7 S6 V: p: T0 A6 f" B4 Y% y' y( {! u6 Y3 P* W6 X/ i/ }
=>Disable or clear breakpoints before using this feature. DO NOT trace with8 P; H' Z. e0 o* L! i, E. l
SoftICE while the option is enable!!
0 j' l! x i/ S6 A. R. E
& a6 U% l$ ~# MThis trick is very efficient:
`# G2 @. }2 U3 Y! w1 Hby checking the Debug Registers, you can detect if SoftICE is loaded
; H* U8 V5 f" h, m(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 M1 ~- O6 ~ |6 c
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! W' i! I9 ?& n* [! H) g9 _' ivalue (in ring0 only). Values can be manipulated and or changed as well) T2 }/ c9 Z1 I0 `# o/ V5 Y2 F
(clearing BPMs for instance)0 q& [0 M0 ?+ @: \% H+ f0 s; Q
2 a8 J7 L( e( t3 J* ?__________________________________________________________________________) M& k+ X( \0 e7 n- D$ M1 Q3 C
' g6 {: [, {4 ~3 z3 F' I5 a: a& VMethod 11, J6 ]$ T; A. `& G7 w
=========+ |' P0 k! B) k
% e% i# Q- V- C$ ^; j4 P" LThis method is most known as 'MeltICE' because it has been freely distributed
- z" ^7 R; Q/ }- tvia www.winfiles.com. However it was first used by NuMega people to allow
! F" q* g( W0 @+ lSymbol Loader to check if SoftICE was active or not (the code is located7 y* c: \8 Y$ M; X7 p; ]
inside nmtrans.dll).
9 r: X! V5 m2 D4 K/ x; Q5 s' C: A! |
The way it works is very simple:
7 v- C0 p$ o5 ]6 VIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 D+ M+ p* H5 o& |7 k( j" k) YWinNT) with the CreateFileA API.! N/ a1 ?! e) i# S2 L
# ]+ y2 C4 q6 b3 |: o
Here is a sample (checking for 'SICE'):
# ^$ X" x e. `+ q! r. X; T- W; C: G8 P7 V2 {& P/ ]: ^) I# l
BOOL IsSoftIce95Loaded()
6 M9 Y9 U7 D: H, f" E9 y4 L- b{
5 P5 z y. G$ s" C0 S+ w; F+ O HANDLE hFile; . ?% \8 O1 R, i2 N: _+ i3 R
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
8 D9 e" H! x! b; X8 v$ p; g* T FILE_SHARE_READ | FILE_SHARE_WRITE,1 E5 Z8 `8 n# F) y e. h
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! E2 q5 ^2 i7 _9 `% X4 _8 X3 E if( hFile != INVALID_HANDLE_VALUE )- n; d: I: v- k+ S# H6 G4 E0 _& N7 Y
{2 N! i9 Q# b# Z6 e9 w) F: K
CloseHandle(hFile);! j$ j0 u- m& v* R
return TRUE;9 h. r2 a* D4 l( }1 h6 T
}
O$ l/ p2 T$ j# s' D, ^ i return FALSE;4 I3 J9 m0 ~; x0 G r" P( O p- B
}
; l- K$ z! d) i6 R$ P7 l
$ v% G1 `- F0 B+ sAlthough this trick calls the CreateFileA function, don't even expect to be$ _( |0 j* n: q2 t0 n8 \" n9 v
able to intercept it by installing a IFS hook: it will not work, no way!
$ h0 D- z" C* c% Y9 Q+ ^In fact, after the call to CreateFileA it will get through VWIN32 0x001F% U) L# k- K! ], n" W
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)0 O/ J6 M( m% ]+ x/ ?6 H. B: Q
and then browse the DDB list until it find the VxD and its DDB_Control_Proc9 N3 f( Y5 z/ |
field.
1 ] P' L. m7 k) g0 lIn fact, its purpose is not to load/unload VxDs but only to send a
, s& n: v8 \0 x: ]4 j. aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
$ G: ^& B! m, v4 Hto the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 d5 f1 M& r( fto load/unload a non-dynamically loadable driver such as SoftICE ;-).3 g9 ^+ S+ a4 {1 p. o! Q9 f+ Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ K/ |/ a0 U# V5 x( C ]
its handle to be opened and then, will be detected.( L6 B7 _. J/ d2 _
You can check that simply by hooking Winice.exe control proc entry point
& t! X _. N7 C1 zwhile running MeltICE.
7 |) ]# g8 o V; W4 b6 T" {, y! Y% W& E0 P+ D6 s
, k5 _: {, y3 [, u, C9 `1 I! R: W
00401067: push 00402025 ; \\.\SICE
$ Z& U' u- x) i- S2 V 0040106C: call CreateFileA- Q& G. N& F% x5 u
00401071: cmp eax,-001$ y) q4 V6 D9 d
00401074: je 00401091
8 a! s6 k2 h& [! _. c$ [
( c7 S2 `3 G/ @7 R' R
1 E' L- l- `, ^( {2 DThere could be hundreds of BPX you could use to detect this trick.8 {+ @1 L3 d- i% V1 `( |
-The most classical one is:
4 }) V' F, e d& M; ~ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||2 W: Z! p2 w3 P- i) ]( f) B
*(esp->4+4)=='NTIC'/ ` X$ Q4 r$ T0 c2 W9 e
# s4 M; G1 O0 {! H
-The most exotic ones (could be very slooooow :-(: N' i, W- z+ I# H0 x D( L% J7 X' G
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
( u; j, i; _( w& S# ^6 v ;will break 3 times :-(+ s, b* ^+ S/ M! c7 U
1 Q: J) j# r! s/ `* w9 ?
-or (a bit) faster:
+ J; x+ |/ i2 h9 A8 n! U+ r BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ w0 j5 H% ^/ t2 o6 M0 L7 V( W) B. [. Q! e5 s. p
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + k. {- x1 p& N' g$ Q
;will break 3 times :-(8 |5 m) ]5 P- w- S
! W: ^8 L/ ?+ ^; M+ C X* I& i-Much faster:
6 @, [ g. Y1 v) e" |( h3 ]3 Q BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
0 c) s0 Z: l1 z/ v0 ~6 ^9 a% _$ v4 H. d# u2 l- B
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" Q# s! q! {8 [) K, w2 d$ t7 _0 Pfunction to do the same job:. w/ x3 _. y8 j) V
5 c Z v3 R. U- B
push 00 ; OF_READ
" c$ ~) i. s: o# W% f X* x( j$ J mov eax,[00656634] ; '\\.\SICE',08 u( e8 {- H) y# `( I! L
push eax9 h6 o' G' n" j( D; j7 d6 q
call KERNEL32!_lopen
) N9 R. m2 O F, v& C& a inc eax; I& V7 Z5 O: W7 k4 @" c6 L& D
jnz 00650589 ; detected2 l! Z$ f/ T/ g4 z' S
push 00 ; OF_READ$ M# ]* j K" G
mov eax,[00656638] ; '\\.\SICE'
/ h3 L( V3 z W H" w7 {; h push eax/ S5 V0 ]7 K3 _3 C# D
call KERNEL32!_lopen4 y, O2 o, P: i0 @
inc eax
- g& \' X( a O3 R; z jz 006505ae ; not detected# d2 q% l4 C4 a/ ?
8 Z1 r9 T/ s. D$ W& h/ ~2 P
: L0 Z* V; g5 \; T) N2 G: c__________________________________________________________________________
! H* a/ w1 k/ e. f( @. O& |% X' B2 K, q, _! V4 P9 y, g6 C0 F1 N
Method 12
. S% H7 ?8 e! ], Q( s=========: w' U/ f- G2 m7 k# x8 _9 o* o
7 W; P, P; a8 e$ E, N3 L3 MThis trick is similar to int41h/4fh Debugger installation check (code 05
& P' F) L6 U6 T2 h0 J+ Z/ S& l& 06) but very limited because it's only available for Win95/98 (not NT)
4 I+ E* Z P8 P4 W8 N3 aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
( i; G. Z& t8 C! p+ e1 Q7 c# l; ~" T4 k; x4 ?- S) s1 U4 \
push 0000004fh ; function 4fh
1 x' ^: I! v" g8 Z( O6 z2 z. ?* Z push 002a002ah ; high word specifies which VxD (VWIN32)
+ z9 p- `7 ^. J. C ; low word specifies which service
$ n3 D2 J+ f' B" _ N (VWIN32_Int41Dispatch)' S# N& |4 Z4 `5 W1 N4 x3 g/ Y
call Kernel32!ORD_001 ; VxdCall* M3 u: V" O7 T. t+ L
cmp ax, 0f386h ; magic number returned by system debuggers2 x5 \+ p% g) n3 u# R& z
jz SoftICE_detected) r: _7 Q4 P+ H! F6 L
' ~4 s' I( k$ Y, F9 p
Here again, several ways to detect it:1 z# [; o5 w* e
p, ^3 S, s) ?
BPINT 41 if ax==4f
7 N# s' a- d& y h% @
9 u( ]9 t' [, V% a5 W' q7 g7 u BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
' t w0 s; S+ |# K1 j8 R8 w9 C5 e2 k+ g! o( A) [: T
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
3 m5 e3 P& e- X! x* \* Z7 I, ^% Y% m" G) }: ^$ J
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
3 n" i! [& W/ k' M" Q6 ~! E3 A# N; B. j3 P
__________________________________________________________________________, H3 l2 K/ o6 A% O
/ K" t; ^7 r0 j3 ]# rMethod 13# a% D Y6 Y% R" n M N
=========5 M! Q( `& C3 Q$ u2 o
& o. Z; A6 ~0 w( mNot a real method of detection, but a good way to know if SoftICE is
d9 E9 T3 g3 Cinstalled on a computer and to locate its installation directory.+ ?+ y3 |6 J" [9 O' h* {# _
It is used by few softs which access the following registry keys (usually #2) :
6 S( A! V$ W4 A4 o) Y* p! f3 z& h! N3 ~- w# e/ t; i' i$ D
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ p& \1 C' b* P I& ?8 i: ]4 K" p
\Uninstall\SoftICE
0 a+ Q6 B" O9 \" {-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 ?( m) Y* x; m. V
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- R: a x6 T6 Z\App Paths\Loader32.Exe8 Y5 ]2 Y$ M) t! U+ L$ l0 I3 w, }& {
/ p6 M) B( u7 D5 [# C$ G! y$ `
: L$ f3 q7 ~+ V/ W- y3 q- F, g ZNote that some nasty apps could then erase all files from SoftICE directory
! L6 c3 m4 w$ O$ g5 D# X( q# Z(I faced that once :-(2 X A7 D, @" r$ s
5 i5 H: ?* E+ ~, C5 F
Useful breakpoint to detect it:/ D. @" s6 N0 ~% c$ R+ P
8 V G, b0 J: n# A BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( V/ M: \! V% G. Z9 L8 v
5 V, P# ]' H* q# f% I+ ^__________________________________________________________________________
5 F5 _0 N6 w: t5 U' S6 \ x6 F* B: c7 z" U
3 @: {: ^. W2 j0 U4 ]( w
Method 14 5 ~, L# f+ }$ i0 ]$ U1 j( p
=========
- g, W/ }. I7 ?1 ^( q6 G; Y. m9 ~7 Q
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ ?2 F* g P6 Q0 D8 x
is to determines whether a debugger is running on your system (ring0 only).
1 |6 O* Q. E/ C0 q; S9 M4 v2 ^8 u) s5 _# G* z
VMMCall Test_Debug_Installed
, d( Q& f0 X5 M' R5 f" X* M je not_installed2 b' w7 I, p4 O& T, i- I: n9 z
7 f1 z. Y2 R1 D# ~/ ]- k! t* DThis service just checks a flag.4 F0 x. [2 t0 O2 s
</PRE></TD></TR></TBODY></TABLE> |