<TABLE width=500>9 _2 `4 u' f6 O* C" O3 v) A
<TBODY>0 Y" I& h4 v+ k3 j! B# U) j# p
<TR>
/ j( S1 L9 e: T" l& w6 O<TD><PRE>Method 01 " R3 l w8 ]% v* y6 O7 w
=========
: F" e, P) W: \; ]7 @
7 \- Q1 z5 J: dThis method of detection of SoftICE (as well as the following one) is
7 ^0 N1 |1 v8 ^- x6 c) \7 N" S. ^' Iused by the majority of packers/encryptors found on Internet." [2 f c) ~- v7 J0 o2 U) H2 {
It seeks the signature of BoundsChecker in SoftICE
- ?3 ~; G' ?( ?1 M$ }: D/ Z
* d; v5 s* p# w mov ebp, 04243484Bh ; 'BCHK'
# H3 @8 @1 X+ p* d- K# \ mov ax, 04h6 }( D: i9 X3 A, s
int 3
. I% A' z7 ^* G: C cmp al,4
& n9 F6 ]" m' f; w z jnz SoftICE_Detected: _! b! u; K: x6 t3 z' k1 r
& d' {* W! W% B, n) ]6 D___________________________________________________________________________
$ m& ]: G& Y5 [8 L
3 P, e, e# R- C# N u3 SMethod 02: F; _" q& Y" c2 G6 n! F: ?3 B
=========
: y" q9 u$ A O6 r& q( c
4 i; h6 n) @' n! L8 R4 m5 X6 \Still a method very much used (perhaps the most frequent one). It is used1 m2 Y5 h9 S& `) N0 C" X) K
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 k" S6 C' D# x# U( P! J
or execute SoftICE commands...; ]7 s" a" z5 ~
It is also used to crash SoftICE and to force it to execute any commands! _9 A, b( h4 C# {% f
(HBOOT...) :-(( ; f/ D$ ~: o& O, K# x
0 |( p* w; y3 D3 F) x- m# [Here is a quick description:' n7 o* t2 e. M* h" l+ A
-AX = 0910h (Display string in SIce windows)
+ P1 ~9 x0 R* k" M-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ x% Y+ ^6 @+ _. t6 U& [, _/ `-AX = 0912h (Get breakpoint infos)% m! }4 v# \- H+ R$ T Q& `$ Z( Z
-AX = 0913h (Set Sice breakpoints)
" E% D% k3 v1 w& q9 L' H-AX = 0914h (Remove SIce breakoints)
( `7 k8 i. `7 [) Y) B2 u8 v) {, W6 c* p0 z7 y4 r. z/ W% q
Each time you'll meet this trick, you'll see:% e5 j9 Y% f" U0 q
-SI = 4647h
- f' _3 U0 `9 i-DI = 4A4Dh/ W! U1 {# B* M4 |$ [' M; [
Which are the 'magic values' used by SoftIce.
) h) J2 e4 C7 J# ]( a% r: ~9 MFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.& e4 j- _; j- Z+ e5 v* S7 X2 G
0 _- A! T9 Y8 F9 l
Here is one example from the file "Haspinst.exe" which is the dongle HASP
! m4 X! ^6 _1 Z4 F& h9 T6 X$ e* BEnvelope utility use to protect DOS applications:# i: z. H/ v6 K$ u7 Y! l5 C, e
) L$ f9 V, u u& Z3 }% `0 o7 k' w* }1 A" z4 K1 o c
4C19:0095 MOV AX,0911 ; execute command.
2 r, Y {8 @: p1 n/ _4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." V/ i9 L: ?5 T$ r/ W4 O% D
4C19:009A MOV SI,4647 ; 1st magic value.
5 }( a' a( H# k9 g4C19:009D MOV DI,4A4D ; 2nd magic value.
/ t5 X7 I+ {/ b) Q8 _! g% _6 }4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
& ]% i0 s8 b+ S- C9 W4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 ^6 Z& ^# x. }0 _1 N
4C19:00A4 INC CX
& f: L# ^( o2 k4C19:00A5 CMP CX,06 ; Repeat 6 times to execute4 K% @' V( d. P$ v% W L1 Q1 Y
4C19:00A8 JB 0095 ; 6 different commands./ k+ e8 a) c5 c6 U: O! A) m
4C19:00AA JMP 0002 ; Bad_Guy jmp back.0 V. @5 Y) u/ H0 I+ ]& u
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# I* k. X" P5 A& w! a$ J
G2 b& U, ~6 f1 i$ KThe program will execute 6 different SIce commands located at ds:dx, which
# t5 z8 `) k9 c1 L9 ~! ?6 [are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# z6 C8 X1 a6 F1 {+ h+ z% \4 j8 b' o. D7 s! o- K
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) q: |% V$ m8 O___________________________________________________________________________
( Y" N+ E0 L% k/ i4 C
; l) [; @. g5 J& G/ x& C5 D
$ B8 B' ^3 B9 @% k/ HMethod 03
0 o2 ^# _7 [7 m: j7 t7 c: A========= n' r4 ?; D* _' K( k0 W
; w' c5 |( t- }6 \# m: e
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ J: `( O7 r! l( Y6 o(API Get entry point)+ S+ r# N4 H# C& m: E6 g
6 ` r# F3 b$ Q! C
0 e! Y( [$ m! T8 ?& }$ S0 n H xor di,di( i6 m; X L- y0 `9 E8 r2 D
mov es,di
5 _& Z& L0 v7 I3 c e6 ~) Z mov ax, 1684h - C4 i) t6 m* w5 h6 ^1 i1 J: G
mov bx, 0202h ; VxD ID of winice
4 |3 g0 x3 Q4 M int 2Fh2 U: Q5 S9 _/ m9 z' |: n" i. A
mov ax, es ; ES:DI -> VxD API entry point
1 W; Y9 i. H. ] ]9 w, G add ax, di8 C: i" a: b9 v" ^" I
test ax,ax
7 @# a! _" Z" v/ z) E$ M) y jnz SoftICE_Detected
- C' Y m, v$ f- T0 R; w& d8 U* H9 t1 J* U8 Q4 K
___________________________________________________________________________/ ~& `8 N4 F/ U
4 w* p6 \9 J& g( tMethod 04& @4 J( H4 h1 J6 l: j# r
=========
" |- O2 a3 X+ B* `" R% T
( F1 f# K, I) YMethod identical to the preceding one except that it seeks the ID of SoftICE' ]1 @5 F& G- K+ \( R0 d# t
GFX VxD. D7 h8 u8 ~# R
& J$ s" `1 G. S. A7 G b; v9 E
xor di,di
2 s: C" Y) a1 {$ s mov es,di
. }5 \. N% E7 f+ } mov ax, 1684h + g! [' H& ], `8 g; Q1 V" ?) k
mov bx, 7a5Fh ; VxD ID of SIWVID
. y/ \6 ]4 K( j1 F# G9 X int 2fh9 B$ E7 {3 d G) a! Z/ o
mov ax, es ; ES:DI -> VxD API entry point! X5 `5 h5 `$ }4 b2 Q
add ax, di
' ^: P0 W* _; H- r test ax,ax; j m- J1 {, N# @
jnz SoftICE_Detected( k U, A( T& {( [! R9 f$ f: w/ y
4 P# O4 n7 E. w3 r9 D. w/ F: j__________________________________________________________________________0 m$ O. q+ n, ~7 p( C
6 ~( Z* w. K n( o
& U8 X/ n/ J# ^
Method 05' O4 O' @+ T3 T2 S: W
=========
) {& u. @/ p$ l$ G/ ]4 b2 ?5 a% K9 v, Z
Method seeking the 'magic number' 0F386h returned (in ax) by all system' n6 }, O3 H- D
debugger. It calls the int 41h, function 4Fh.
0 `& z* c {+ s6 Y; U5 h4 gThere are several alternatives.
+ z1 V% M4 s) f# n2 u) z6 T$ S* A
" N3 M9 r! N, h; r |The following one is the simplest:
( R! k; V1 s! G! x6 A }5 i) g& N, E+ k7 C7 M* e, [+ Z
mov ax,4fh
+ l& `* L5 d7 W3 \' j1 { int 41h9 `* l; I: k& z. X: d; e E! O
cmp ax, 0F386( x1 O5 B7 P, j3 [2 _
jz SoftICE_detected
' a( {# I9 _" ]' c: I3 e
1 x# C: E, l+ M! I/ \2 V1 \: z; Y
# c3 A9 n0 Y0 b/ S; K1 mNext method as well as the following one are 2 examples from Stone's # z$ h; |1 r' ?
"stn-wid.zip" (www.cracking.net):
. N- Q8 w) H' U$ |6 I2 {6 h; ]) i1 y7 @ o2 p6 w. I
mov bx, cs
3 n) g5 s1 O2 H8 g* H lea dx, int41handler2
1 r0 h, j" n5 M/ Y7 J xchg dx, es:[41h*4]
$ u0 F2 S4 r& k' i8 n& E xchg bx, es:[41h*4+2]
8 A3 f3 V$ f( c# A mov ax,4fh
( K8 V% f' s: _/ V G% c" g7 L0 Y! Q int 41h% o: l, P% c4 s8 l1 Z5 ~
xchg dx, es:[41h*4]
5 y5 ~* L' t+ O3 A7 E) W xchg bx, es:[41h*4+2]) |' f" y+ R% r& P$ X+ Z
cmp ax, 0f386h3 z3 `( {" J P8 a: @, o
jz SoftICE_detected
h0 _ i! O$ W# g* ?! E. _. d. e* C7 u* Y2 g0 v z
int41handler2 PROC
! {- ~9 S* K+ }! U8 o& X4 k D iret
8 }" m; a" I5 ]4 Y& A+ R* yint41handler2 ENDP
- b; S$ s# E; ?% p# O
9 {: ^0 i& w$ }% T
- Y \3 j6 S8 s1 ]_________________________________________________________________________
% Y/ }: d/ I+ B! N3 O& m6 T- Y
5 x0 b0 X# ~1 u7 t' V! Y9 _9 b. m" M& t# b E* T5 d$ P
Method 06
" {( k9 \, A; e6 a! G+ j, _=========
$ `9 U5 n8 {, D4 {. I) \1 k7 N
6 |$ m( L/ f% y
c* R. H, R! q: k1 |: P- K7 c2nd method similar to the preceding one but more difficult to detect:+ W3 U: r8 W/ @) a" x$ p, @
0 ~; ^' m2 B% H5 h
+ T0 r; e& g$ G' L# wint41handler PROC
% \3 k. [; r& q' Z# j mov cl,al' i$ ]8 C" c9 d. L
iret- C/ w0 E; T# D) Q7 M4 H
int41handler ENDP( f9 X! d2 w) P
& n# e7 {/ I! c: L1 `- \
" V" j3 P, T0 d: ~' ~ xor ax,ax
3 a2 j$ ]0 c5 p mov es,ax7 n" a2 t7 f* y- L' J
mov bx, cs
( O$ w3 k3 R" V' M lea dx, int41handler
3 ]9 n. V' l9 g/ I N1 D xchg dx, es:[41h*4]6 k( Y# M4 B9 q5 @( L: t3 r
xchg bx, es:[41h*4+2]
! I4 `/ D7 _$ r+ _3 c in al, 40h
, m+ f# T2 [$ |2 N; r xor cx,cx
/ x. A( u/ ~1 A- d0 J int 41h
0 o, I$ c0 v6 ~ xchg dx, es:[41h*4]
9 ~$ v* {2 t, |8 D, } xchg bx, es:[41h*4+2]
9 Q4 Y: [: L6 L W: R4 O5 Z0 d6 B cmp cl,al
: {* b. |) Q: C1 J jnz SoftICE_detected- _) `8 X8 a9 X% r# u, V$ O0 T
% X+ D/ F$ \( U
_________________________________________________________________________
* T1 O! J. [8 O8 ]% t- U! l" t7 j+ @* U h& z9 s- P) b- b9 j
Method 070 t" H5 X' \8 s
=========) G# R8 \; a" m3 q5 I
0 @3 N3 u* l" O6 NMethod of detection of the WinICE handler in the int68h (V86)
; C) o% c- |) ^1 C8 S
6 ^( F+ T0 m6 n, M V mov ah,43h
$ B6 o V( l' ^3 y8 A* v) ` int 68h
7 K5 Y2 r2 `, g3 ]4 U cmp ax,0F386h
, t* u8 G7 Q' u4 ~% T6 m jz SoftICE_Detected& z/ I; N }$ h8 s
" v: ]6 h1 h/ B2 @- ?0 I- A* X
0 k) c r, R4 s/ R+ B) N5 u=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 E5 i$ Q7 G; m3 \* b8 {) e" D, k2 x app like this:) U, |9 J' K1 d/ y& X( y1 `8 ?
0 x" _- ]0 Z, S BPX exec_int if ax==68
- I6 n/ q3 L1 Y1 O7 e% W; Y- u (function called is located at byte ptr [ebp+1Dh] and client eip is
' n/ O( `/ D3 ?8 m% J located at [ebp+48h] for 32Bit apps)
' n: K, p* P2 q__________________________________________________________________________* h" E+ I" Z# ~! c; _
& U: Y }& i9 X' w. T% J: j
& k! P1 f3 z, p5 {' {: X0 m
Method 08
* ?3 o$ m# V3 ]1 p2 l=========
9 l2 f0 \' m5 [" K9 n
' `$ |$ t1 f$ x; v6 J: g& @It is not a method of detection of SoftICE but a possibility to crash the
' Q. u$ t% z8 Msystem by intercepting int 01h and int 03h and redirecting them to another2 F" [. E1 Z1 T4 |- Q8 X
routine.
! @; I2 y9 c( Q! wIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
; m9 D9 N0 E. c1 X' \$ s; d0 _( Ato the new routine to execute (hangs computer...)) C. E. @# r+ U7 U
4 g; X$ [: E9 Z4 v6 G0 k: l mov ah, 25h4 B9 H+ E0 X1 u' Z( _
mov al, Int_Number (01h or 03h)
1 p. W! Z+ y4 f6 S- }! ?; o9 P mov dx, offset New_Int_Routine
1 V v Y5 r2 y" R' \; G int 21h
" M' f) a/ U ]5 g. G! z
" k3 z5 l: V% P1 z5 T__________________________________________________________________________
7 Y: E6 o; t4 L. u% N) q+ M' W0 J, I: f6 |* m/ X1 j
Method 09* Y9 h2 X( Y/ D1 W. d$ y
=========
& u: n* M; t, e1 O* X, }7 W8 E% t" ]2 g% {% e2 F
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 @4 ]& W- J1 j) |7 ], bperformed in ring0 (VxD or a ring3 app using the VxdCall).' ^- |$ @& D x3 Z% [4 U0 n' ?6 T
The Get_DDB service is used to determine whether or not a VxD is installed
! e+ j0 A. E, Y8 D2 rfor the specified device and returns a Device Description Block (in ecx) for5 s" o0 R0 W6 H S! _6 P
that device if it is installed.
) _0 }9 b8 v+ L' T
- m# O+ N! H$ r mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. ?$ m2 h- Z& o) L7 v) N5 O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
! n- Z5 w9 L/ O4 F2 ^5 n VMMCall Get_DDB9 M1 B5 ?& l' y3 F
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ Q7 \ q$ K# s. ^8 k# g) G
$ U( p0 M4 o: LNote as well that you can easily detect this method with SoftICE:" ` e! L* y1 \# C
bpx Get_DDB if ax==0202 || ax==7a5fh
; e" \1 q. J3 u
/ W, S" @' N$ t/ J5 ?2 O" Q__________________________________________________________________________: P, [9 X5 T6 n6 Y
+ _ `2 d; z0 N- N+ n2 QMethod 10; Z# v) D4 w8 ]$ a& T. |/ U
=========3 U C# Y; P% \8 @6 f. [% b' G
5 X9 J9 b4 \% p4 I3 W% f=>Disable or clear breakpoints before using this feature. DO NOT trace with7 p: }/ x* m# u8 Z2 ^
SoftICE while the option is enable!!
4 F& y9 d7 a. u% C
2 z+ G8 q5 W" `This trick is very efficient:% J! h0 B/ B/ g! n; K7 ]
by checking the Debug Registers, you can detect if SoftICE is loaded
4 x( s! G; s# `4 E(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! J0 ^, F: k) C$ lthere are some memory breakpoints set (dr0 to dr3) simply by reading their& R7 m6 t! O; U+ @7 M5 ]8 @1 g& R9 Q
value (in ring0 only). Values can be manipulated and or changed as well& a5 A1 C. r7 l! V+ v* v5 q. m
(clearing BPMs for instance)
/ N$ ]: g% H7 h
1 Q" @% q8 I) t1 n) ~1 `__________________________________________________________________________% @1 T- C, t1 m3 W4 @% T
1 T: C$ M) E3 P/ j9 g4 e% Y. x
Method 11: ] l, i4 j1 n% j& I' x! F
=========
5 {/ n T+ E* r7 \
9 {0 c. ]3 c4 RThis method is most known as 'MeltICE' because it has been freely distributed
" ^* G5 F1 j2 ?7 A( Jvia www.winfiles.com. However it was first used by NuMega people to allow
; \' @$ y1 n4 u- O2 a0 eSymbol Loader to check if SoftICE was active or not (the code is located1 i- Q! U7 R6 M9 M) X" V
inside nmtrans.dll).
6 }* ^4 `4 G0 m. I; ? u1 x, c
The way it works is very simple:
2 O9 a5 f5 m9 |It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 W/ v4 t( Z! Q4 H! ^; A$ d
WinNT) with the CreateFileA API.5 [( E5 B0 P2 L" R( j" W4 P
; s0 I% y5 R9 } a
Here is a sample (checking for 'SICE'):5 D& T! i/ q' g: R( Y
: A( R. G1 a K2 U; {( rBOOL IsSoftIce95Loaded()7 ^+ H' `" R1 A8 M9 P4 |
{
9 _( J! e0 L2 Q Z4 b9 _ HANDLE hFile; + Y, i/ Y. d7 w% `& ?, W3 v( \
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,: c, x& K2 u: P" H) m L
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ @, x+ s9 q1 ]1 P: K( R* Y/ } NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 c, w* J+ R9 B& H$ X! E6 @8 R0 ?
if( hFile != INVALID_HANDLE_VALUE )
% t4 G$ V& C# ?, n2 n/ {5 o {6 M/ ]. Y5 d8 w/ O5 i
CloseHandle(hFile);
' ]. M/ _* K; a. {& N9 g( @5 \# R return TRUE;
, Z. |9 h- m0 T/ V; _ }3 K0 e Y2 I! Q# Z9 U7 q1 v
return FALSE;6 v, p: F! L# [0 F9 N5 Z0 v! m
}
[" ^7 ^; M3 [1 D- q0 g+ U/ q y/ J; G% t
Although this trick calls the CreateFileA function, don't even expect to be6 b7 P( H! M, a5 q. ?
able to intercept it by installing a IFS hook: it will not work, no way!9 D) d9 H: X, t5 h& l8 ]4 ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ q" f! K& F- _$ I' J6 W& P3 }service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' _& s: T. u u% L8 Y' S5 Land then browse the DDB list until it find the VxD and its DDB_Control_Proc
* L- I5 }, h M- p$ S, h! Kfield.7 N7 K/ ~) V4 E, \3 V
In fact, its purpose is not to load/unload VxDs but only to send a ' {4 f8 k( Z2 ?' b9 O, \$ B* ]1 K
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ E$ k. K& z2 _3 t$ y) g# X2 O
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- [- \1 n- r% I' ~3 X. B. E! { qto load/unload a non-dynamically loadable driver such as SoftICE ;-).
* W: n' }1 y- V9 VIf the VxD is loaded, it will always clear eax and the Carry flag to allow; Y+ q( q5 P+ M3 j: f$ k7 b9 A
its handle to be opened and then, will be detected./ a; d/ J8 X+ ^( f1 E/ P
You can check that simply by hooking Winice.exe control proc entry point
1 z% D/ p3 A/ d1 d# Q! @while running MeltICE.1 Y1 @, O3 I" F, ?. G
9 c3 a: ^# U: p$ q$ ~, A. |: u A' y6 R Z6 {+ Z y
00401067: push 00402025 ; \\.\SICE; @; q- z4 u5 L0 T% |
0040106C: call CreateFileA
5 K$ d- f& Q' t- M2 ^7 d2 i 00401071: cmp eax,-001 j; b& h, u- \5 Z N" w
00401074: je 00401091
, b6 d8 x: F& Z( A
9 {4 M; L) B: K6 w
/ s( h! Z! P7 ~$ {$ ]There could be hundreds of BPX you could use to detect this trick.4 T+ ?% N* K9 d U
-The most classical one is:
7 [. T* E) {5 B) x BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||) L$ Z/ P' n1 V1 c5 j3 o3 M
*(esp->4+4)=='NTIC'
* m, p* R4 H2 @# K# o' p# d9 P' k1 Y7 i5 R7 e7 J T- B- p) M1 n
-The most exotic ones (could be very slooooow :-(. g$ {7 y. f9 g9 M4 v2 K
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / d( t) B1 h7 Q& e
;will break 3 times :-() M# y& N* k% p* w* |8 I
- x3 N$ Z1 H" O4 W7 ^-or (a bit) faster:
. r3 S4 O8 `9 O, u0 `/ s: E BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
" q; r2 F. D6 p! Q
6 n3 o/ R8 R5 r& ~! D BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 U- j a8 H0 z* t- R' E
;will break 3 times :-(& o+ U; g/ q7 ]# a! w8 B% x
; F4 W/ v, J; F: p$ j; O. G-Much faster:
/ ~! z/ u$ |' C# S% g; { BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
( h& j7 G0 ^; S: g2 w
/ u1 a, u7 A0 d. r' WNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
}0 v8 R- f. }" Y0 hfunction to do the same job:
9 d6 {% E) }9 W
* {. l, q) u6 u3 P# C. `# C push 00 ; OF_READ
; X& K) d6 Z& F8 ^0 j5 o mov eax,[00656634] ; '\\.\SICE',0
/ }# V N) X" E) ]/ j C push eax
- s- r, j m8 g call KERNEL32!_lopen
7 A1 u- ]4 w% k7 e( }+ r inc eax
/ d' h' @" ]5 l# D+ p0 u- r' }" i jnz 00650589 ; detected
2 l- n6 E3 d: [2 T push 00 ; OF_READ
0 l- {* V+ [9 ~2 N8 { mov eax,[00656638] ; '\\.\SICE'
* J& I' G' X3 ?1 ] push eax
. H/ u; a) j- P# I( f3 c' J1 A6 h call KERNEL32!_lopen( Y6 p1 |& C$ u3 n1 n
inc eax1 t8 z% h, w% V0 }' r4 L* d+ O' O
jz 006505ae ; not detected; y: `7 Y6 k' x
, x0 S4 w; E! Z5 G8 V7 \- Y7 R2 J/ b1 N4 J
__________________________________________________________________________, F, N# h; D4 x! F V+ C+ o
7 |, W3 G- U. K+ S1 K& E; X3 @" ~' S, jMethod 12
9 H/ R4 N. }- F) A=========
; }+ G2 h6 g% z0 g: r
% _! U2 c6 i) k& M+ [. j* P) xThis trick is similar to int41h/4fh Debugger installation check (code 05
: h p, [/ a# d4 t7 Z3 K2 O& 06) but very limited because it's only available for Win95/98 (not NT): T' X8 i7 f+ B5 L
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.9 }6 ?: A' z- E& ~5 F( G6 E) x% }
3 {8 k, o* f: n" v, `$ s
push 0000004fh ; function 4fh
$ \- a( `9 k% Y. l! g' u" n4 [0 p push 002a002ah ; high word specifies which VxD (VWIN32)$ u4 R1 p$ B. C+ E+ v& o
; low word specifies which service; a* a; C& e; w/ u( C
(VWIN32_Int41Dispatch)
- m3 J$ b. n: j% z/ d9 g. Y call Kernel32!ORD_001 ; VxdCall0 A( C+ |. f0 E" S- X
cmp ax, 0f386h ; magic number returned by system debuggers/ b) s3 b7 s1 d
jz SoftICE_detected [( p0 e$ h2 o t- }2 f$ \& s
2 G6 Z2 E9 s: }# Y9 e1 W
Here again, several ways to detect it:- X: B: X) u0 C2 C
8 z- Z; @! }% y5 R' D
BPINT 41 if ax==4f
0 a H6 u6 w/ X& B1 [
6 Y- E" y' E4 e! n BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 Q8 O' u% C1 D; l$ O0 \
7 i" F' O% R4 g- L3 o# b
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
+ ^4 i8 _* @ Q- a1 e8 n6 X
$ y! W! v, [2 D) F' y: z2 ^ H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 m% K* ^8 s6 m4 c- u: e1 X
# f# k$ G1 n& O* ]__________________________________________________________________________9 X8 u( V8 ^: F' q4 q% m
; m6 ~8 m" ]$ F/ K- D5 k! j& ^
Method 13& ]( j, q _% x
=========
5 i) @8 ]7 z1 ~- I$ n" X. J2 M4 P4 ~9 `9 e A$ b
Not a real method of detection, but a good way to know if SoftICE is
3 u' J) q, c0 B/ t/ y/ S% Jinstalled on a computer and to locate its installation directory.
. T* [& S; o% X9 iIt is used by few softs which access the following registry keys (usually #2) :
. C+ J* P/ P4 e0 k5 W, o& n8 n* N# w+ }
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. N' ~1 t# v S |( t/ e
\Uninstall\SoftICE
3 S/ I# ^9 P( ^: i-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 z$ \9 J7 b; o-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' d/ f; e& A8 i9 Q9 f- ~6 i
\App Paths\Loader32.Exe
$ F; @4 A. h# ~3 e+ S
5 H9 p9 k, e6 O) I, j/ ]/ |/ w8 w9 s7 \6 d/ u
Note that some nasty apps could then erase all files from SoftICE directory) r9 N" W; M, c- I. ~! \2 Z* ^
(I faced that once :-(
; g$ Z6 ?% f c! F5 C4 C9 X+ r, m5 F+ S1 _) \; A2 E' l
Useful breakpoint to detect it:/ M# ^" i1 t/ B9 O# _1 v! ?/ `( T& k/ R
; {( T& S7 X8 y8 @: ?! ~ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" n3 T- p8 ~6 M% M8 y' l F
- `, [, `3 ~9 _) y2 }* Z__________________________________________________________________________- t' m- X( P6 B2 c" [; ?4 e
5 N6 C! @* \! t% N
' r- Z- w' C6 \) u9 v( T2 G
Method 14
1 C. f! Y2 M6 d; X+ |4 z2 @=========
6 \$ U/ h" t' q0 X* `+ o
' S) u/ X9 v7 }& w, v4 mA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) j* O# J( Q6 A6 G$ B z5 n: E
is to determines whether a debugger is running on your system (ring0 only).
- E/ v- W6 a; c3 ?
- d" u& L! {7 ^0 c/ H/ ^ VMMCall Test_Debug_Installed: \( N8 A4 ?: s7 ^5 x; [
je not_installed
& s' ]& f" d I" h, R( C
# I. S" Y7 m, E( h$ Q$ CThis service just checks a flag.: p- a9 l9 z7 H, g! i
</PRE></TD></TR></TBODY></TABLE> |