<TABLE width=500>- ^% I$ X0 n; {- r3 C. |
<TBODY>' Q. Z8 T4 g6 I- Y
<TR>
- \/ C7 z; O# B/ z2 K<TD><PRE>Method 01
7 G. E- B: f' |1 y, C=========2 r! e9 G4 j0 h f8 s9 P
6 s. e8 b3 f# u: I! f1 k7 ]( g2 ~
This method of detection of SoftICE (as well as the following one) is \( ?( C, U! ?& K* G1 o1 I* _
used by the majority of packers/encryptors found on Internet.
6 P9 u# H5 `' u7 @* [: l: I1 lIt seeks the signature of BoundsChecker in SoftICE
) e5 u. x6 _& E# S: A7 ^5 N1 G4 k
mov ebp, 04243484Bh ; 'BCHK'
: }! Y, T; ?8 q, X! ~9 I6 \ mov ax, 04h4 y/ i' O9 l. p& N$ I9 y2 b9 d
int 3 8 f- P6 v" T9 U
cmp al,4
" _! Z$ e7 x( p& d" |" X% m8 P0 c& _* ] jnz SoftICE_Detected
. L" X. _7 ], X1 \5 v8 o; c0 e6 N
/ `: w% A4 u( E6 P: y$ v___________________________________________________________________________% y9 v6 N8 }$ {" C% o
) z- Y% u; o3 b" v) |- Z
Method 02
! c% {) Z. I" P8 P0 p9 n=========
+ N( R; ]% z( f( ?/ Z' @( ] \ O6 J8 H3 B: R7 J+ N
Still a method very much used (perhaps the most frequent one). It is used7 i( b( C( o+ Z: J8 t( |8 K: ]% |
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,! u' G% k$ \2 l, o: s4 W( e* A- j
or execute SoftICE commands...
- M6 {4 p z- dIt is also used to crash SoftICE and to force it to execute any commands: e& p s3 w- S9 s- x9 t [
(HBOOT...) :-((
/ W; i; P" ^3 {. \' B8 W
6 E+ R! n8 w* D3 QHere is a quick description:
$ K# G; K/ ^$ l+ A0 ^-AX = 0910h (Display string in SIce windows). h3 B7 @/ _/ x) ]( Y' h9 n
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 G5 Y$ R$ D5 o-AX = 0912h (Get breakpoint infos). H6 T$ p5 i. s8 @. J1 i9 g- J+ [( b; B
-AX = 0913h (Set Sice breakpoints)
$ q, I* D7 R- ` h5 g) w+ H" W-AX = 0914h (Remove SIce breakoints)
0 w" B* ^( t* G2 o5 @0 Z# g8 p; |* G0 b! w7 T/ U
Each time you'll meet this trick, you'll see:: a! K' L0 M } ]% a
-SI = 4647h
' r; \3 s9 `) U& x I-DI = 4A4Dh
0 p6 J( Y2 P& ^/ SWhich are the 'magic values' used by SoftIce.- S$ ^9 [% U$ {1 f8 y/ b8 f8 A
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 I' j" r& f* `( c. y8 L
3 U4 f9 x, R- Z; r; g7 {; IHere is one example from the file "Haspinst.exe" which is the dongle HASP
; r, D* l6 ]. i/ |Envelope utility use to protect DOS applications:
1 M; P9 u* L* N
8 D2 h# Y9 D% F+ S6 f# Z" x9 a6 w1 r# l6 z2 R9 w, R& a. q
4C19:0095 MOV AX,0911 ; execute command.: Z( j, l6 ]2 k# P5 k
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
% M% O6 }3 v: }. B1 Z4C19:009A MOV SI,4647 ; 1st magic value.* h) |9 f. R! R/ I
4C19:009D MOV DI,4A4D ; 2nd magic value.
( L S% q$ E0 I+ B* I* v7 W* p4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). k. j% k% c- U5 o6 g
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 p# g* K3 Q- w" q) w) o8 o
4C19:00A4 INC CX9 I9 w5 X5 `. ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
' i& {# w/ b) I Q4C19:00A8 JB 0095 ; 6 different commands.
% x t4 M( \! Q: o4C19:00AA JMP 0002 ; Bad_Guy jmp back.
0 A" w- S3 k- m* b8 T; q$ f4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ ]2 K& D! |- Z5 \1 w! n c& H" B; J- T* V/ @. b
The program will execute 6 different SIce commands located at ds:dx, which1 ? e! D* b. R' U+ y9 J# U
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 l# a7 \7 B2 ~$ v. i% C! q/ F
" |( `# Y' V- S1 a% N' D; z, k
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
6 ]$ A: t. P2 Q) P! l___________________________________________________________________________ M0 q( s* M+ o1 Q6 ^
* C1 q% d @% J+ L4 C: G/ |! b
9 X6 T6 Y% \. a, q& A1 c" S+ }* pMethod 03
2 s/ W. \7 H U0 o' [=========/ _* D$ W& d9 d! p
, i9 e; c) o0 u$ U! e0 p
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 A2 b( u4 e% b7 X$ l; c
(API Get entry point)* n j( s9 s! c6 Z4 l2 P( K, v
9 Y2 a9 {" E: h, R. u
# i4 z v6 q3 q xor di,di
" }+ A9 i3 B# l6 w' w mov es,di
9 A g( D: A+ a) z3 Z. S mov ax, 1684h
k2 Q: v- S: a L mov bx, 0202h ; VxD ID of winice3 n. K8 P' I; X. M2 c1 K M
int 2Fh+ c- m+ ]! O, h3 O
mov ax, es ; ES:DI -> VxD API entry point9 f' l, i3 d* ]& H/ r: _- h
add ax, di
4 O3 j2 Y1 g2 ], r3 l test ax,ax
1 k* c" J; z( f" R* o+ M: R jnz SoftICE_Detected* _) L) s- Q' L% Y5 c( x) ]* t
. t0 T5 E' N2 k9 |3 P) @
___________________________________________________________________________
7 e5 b8 z3 A: y" ~ \9 {! ^ z6 g- ?$ u3 {* D$ A* \1 T" }" S
Method 04% A' ^, \$ p% F4 D# ~6 h& i5 S4 }, }
=========
, C% P; c# J; T' q0 t" v6 s) F: I
4 U$ Y% G* u2 F7 t) ?% K. d: ~1 I0 VMethod identical to the preceding one except that it seeks the ID of SoftICE
% B- R5 ]- r0 n% T' w8 sGFX VxD.& u; s" {3 F: L5 i3 s2 M
! y. z8 b+ U# n6 H( P xor di,di; P% g) J0 `( u9 f5 J
mov es,di {) g1 S1 g' d% F( r
mov ax, 1684h
; k, l$ L* ]8 k4 g( H mov bx, 7a5Fh ; VxD ID of SIWVID' X7 j( M+ D+ W
int 2fh
! I7 t% P+ n% z' O mov ax, es ; ES:DI -> VxD API entry point
; F- C7 v3 |. P: B' ^ add ax, di& A3 ^4 f, Y& V8 `
test ax,ax9 t5 t7 e/ ^" Z3 M' h+ y
jnz SoftICE_Detected
0 }+ q' @" |( u) x+ n+ p Z+ v V7 \0 @9 x2 x
__________________________________________________________________________
( l3 S7 c) H% U
. G! e% a, K, \% E: t1 I% f
. I5 ]+ N1 T# }+ f$ OMethod 05
+ j+ {- A8 @6 C0 X) t) i========= H2 q' E& P9 {6 e5 r! t
) |/ e1 [! L& [9 f4 B3 D9 R! v$ h3 CMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) F5 U4 G* b; t. Jdebugger. It calls the int 41h, function 4Fh." w4 ^4 [5 ^& U* G9 d+ a: K3 b+ C
There are several alternatives. $ C/ |* a" y7 C2 H+ J. V
. p7 I1 {: t. i0 j7 Q' vThe following one is the simplest:
8 y: m; q* A0 f: {+ n
. E0 ^& {( i# f3 W8 y! ]! l mov ax,4fh
q2 w [# I, G$ H: ] int 41h
% J+ F* |; B' m8 e cmp ax, 0F386
i7 W- t! U8 S3 [: ]# I! {2 s2 I jz SoftICE_detected( H) s" X/ r8 Z* }4 `8 r, u
1 S* k/ \5 h. s( ?# ?7 P! W, t- l" u/ i3 I% t( A
Next method as well as the following one are 2 examples from Stone's % @1 W: C" o; D, N2 G& y) @
"stn-wid.zip" (www.cracking.net):
) M0 F' u8 G) c" P' ~
1 o. x# \/ j( ]/ } mov bx, cs
O! o f, V2 t lea dx, int41handler28 ~$ j4 g) N# L1 ?+ u
xchg dx, es:[41h*4]7 s4 e/ G J4 O: K, K' F
xchg bx, es:[41h*4+2]. ]" a: [& Q! V
mov ax,4fh
# E9 A T0 n G2 _1 x# r int 41h
; w" a* g5 K5 e5 T xchg dx, es:[41h*4]. \# I: K6 `8 A5 l' j) @- {% x1 k
xchg bx, es:[41h*4+2]% F2 s+ h. S3 E9 m. {3 A) @0 `. U
cmp ax, 0f386h
* m C; j- d) h5 {/ q/ h L jz SoftICE_detected2 d5 @9 ^1 s% }
+ M- }+ g. `* b' i% Y1 P( B w Zint41handler2 PROC- J2 d" ~6 m( g% U2 N7 c6 e7 I
iret
; b+ K; p* S" @# j6 ]7 D) Jint41handler2 ENDP
2 z7 A0 U5 M7 _% @5 g d0 p. E1 _0 S) }6 U0 I* k! f
6 r1 J5 |2 y5 n% c% i! S_________________________________________________________________________! z, C- n& m2 i# r
/ Q: v. a" N# N0 V4 x4 G
1 n6 a8 O3 Q( ~# `( x$ nMethod 06
! z& Z3 P0 [+ E# B" @=========3 i6 E6 @0 d$ m4 o3 C
/ I9 a& Y5 t1 [& ~ A8 ?
( I# ^4 I, W) Y L% T. R2nd method similar to the preceding one but more difficult to detect:+ V) x8 i; p# V
6 B; U# I; y- W8 K+ l* s, t' w- e! H2 |) j$ L
int41handler PROC" l0 s9 `2 R% Z* g
mov cl,al
3 G& o2 y7 q; k8 R, u5 N3 [ iret+ N2 k3 [& M, ]' ]0 o% Y V
int41handler ENDP( G2 R# K2 Q% D' K" ]7 D
5 U2 y' k5 t" y
5 L e5 p& G& ^6 u xor ax,ax" T& D/ G- i9 r! O7 ~- e0 ^) B
mov es,ax0 p9 @% T1 C9 I% d" [7 _% h
mov bx, cs
: Z" q4 L5 M4 ]8 d# X9 I$ X lea dx, int41handler
7 X# c* o7 r2 p! _; T0 o \% D xchg dx, es:[41h*4]' Y6 s" S* O9 \% v
xchg bx, es:[41h*4+2]1 }- Z) S7 B9 Z# w
in al, 40h' y% L# Q# Z# L/ M C7 q# H0 M# @: v' r2 U
xor cx,cx
) ^% q0 N7 o) x3 @6 t int 41h- R9 u0 } ?4 \/ H9 A3 r1 C _ x
xchg dx, es:[41h*4]/ A: s" F# A7 d' U( p4 J% F8 f: B
xchg bx, es:[41h*4+2]+ j9 ^+ Y0 R# u5 c0 L# G# U
cmp cl,al: r+ z* H0 k: R6 X+ ~
jnz SoftICE_detected
% S/ B( Q3 u; S; ~' Q* s# F# c" ?3 o
_________________________________________________________________________9 g& k% R3 }6 k; L. ]- Q0 l
" z3 J- Y3 C3 mMethod 07$ H2 I" y6 G. W& a# B' |1 J
=========
6 Q5 ^" U& X. N
# o4 b, o0 t. H/ _& d" SMethod of detection of the WinICE handler in the int68h (V86)" U3 Q! S1 T2 j6 k' R$ H3 o+ I+ E+ K
: a% h: n" \- }; o4 T# A# ~ mov ah,43h
$ K9 @4 r. H& { int 68h' n- _& I4 J. |8 `# t: v
cmp ax,0F386h
; Z; p7 c" D5 k+ x! Z jz SoftICE_Detected
: m: G9 u; n d+ S: P7 z( {1 r: g4 {! P+ b4 ^8 m
9 u$ z; Z4 y0 o, ]. ?7 E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit2 ^( x/ ~8 L) e, N% S9 |+ y
app like this:2 r% A, c) T" P+ U# L
5 \% ]) v& q- Y/ M. w BPX exec_int if ax==68# d2 h3 O5 j! [7 u/ q1 ^+ d# F. I5 H
(function called is located at byte ptr [ebp+1Dh] and client eip is
. l0 B# c. t8 B. L located at [ebp+48h] for 32Bit apps)
4 s; U& [$ f) R$ }; o__________________________________________________________________________. V4 p$ R3 y0 y$ n4 x2 N& {
- y: N" e) O1 m5 |
; N0 d7 o; |) I( q G; c0 a' HMethod 08
& }& N2 D e% J2 p* E, h' C=========4 _1 a( n$ q; a7 d. [. ]2 z
$ e0 z6 Q% `1 y( _8 XIt is not a method of detection of SoftICE but a possibility to crash the) x4 O( U$ k9 p& j) D2 D$ B
system by intercepting int 01h and int 03h and redirecting them to another( k0 C7 @! _$ K
routine.
/ R& |' f& \3 p" aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& A* p- t5 x' S" Y- ^+ Mto the new routine to execute (hangs computer...)
' f4 z( y: W8 o+ k4 M' R
# g; _+ R3 d: l mov ah, 25h
1 x, \4 ~. ]% ^+ m2 h$ l mov al, Int_Number (01h or 03h)5 h" ]" ?3 }* z5 [
mov dx, offset New_Int_Routine7 Y7 h, ^9 Q% g& i3 B6 }& U4 S
int 21h
% J f2 G9 ^/ `4 s. h2 t1 {/ ^( T9 t( \" _$ S
__________________________________________________________________________! e1 m0 }& n' n& ~2 `
- n, x" }8 @/ ` f
Method 09
0 } D+ v5 x/ q: C K=========! ?) k3 B; j' y
4 s, H9 g9 @. }7 x3 D% @2 d! `7 i g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
9 X% Y6 I* t9 Q: ~3 uperformed in ring0 (VxD or a ring3 app using the VxdCall).
! A& j; \1 G+ V( KThe Get_DDB service is used to determine whether or not a VxD is installed
7 E$ {$ {. _: u& ~( S4 vfor the specified device and returns a Device Description Block (in ecx) for8 O+ z; j3 c+ R. t5 Y$ g: m
that device if it is installed.
* t" K& a, ?7 a& [% u. w* e" f) o8 a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 F5 ?9 W! H% m mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 U7 z8 u% z! M$ F6 Y* g
VMMCall Get_DDB
6 f. P9 v0 q+ ^ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed% b4 {# k. D g3 x" a/ ]$ G
( ^/ i. P' I. P! y1 [( o4 o: n
Note as well that you can easily detect this method with SoftICE:1 E D, A4 L a% `) L7 f
bpx Get_DDB if ax==0202 || ax==7a5fh( x% q Q( U" X! s" M
0 w- g8 J2 y# P8 K- a7 }
__________________________________________________________________________+ ]4 P; e/ T8 d Z( f+ @
( k; p) c, M* n# E
Method 10
- H0 {/ H* t* ^9 K" z2 H=========
( L4 S+ ]5 k1 D' g
5 T. |0 w# S+ t=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 c3 K" Q0 h3 m SoftICE while the option is enable!!. ^2 S ]* U! Q7 b) j' y N
- L1 h+ \) `8 _9 I7 f, g) [$ FThis trick is very efficient:
3 x+ M3 U: i& Uby checking the Debug Registers, you can detect if SoftICE is loaded9 S* ? p: d0 w
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 {! W' [1 \ j! [1 N
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 o: J- }& R; z5 H0 g
value (in ring0 only). Values can be manipulated and or changed as well1 [3 W: V( j% j# e, ~
(clearing BPMs for instance)
, U" C5 k. z+ g7 v% J5 N0 ~9 s
__________________________________________________________________________# U, K! x6 l) U& }: n4 R6 J
1 I! `6 K) U6 N6 C$ m8 P8 ~Method 11
~/ P9 P8 }! {3 p) Y2 q* C=========3 Y! H5 L, q/ q# O+ P' ^
. m4 y& z1 R$ y# K5 W
This method is most known as 'MeltICE' because it has been freely distributed
; W2 A9 e8 {. }( v4 h4 N: mvia www.winfiles.com. However it was first used by NuMega people to allow
1 |/ B* L. J7 f( f, S$ v8 n2 E8 v: ]( jSymbol Loader to check if SoftICE was active or not (the code is located
; Y& n3 `. W' W! I3 J& m7 v9 {' binside nmtrans.dll).3 q9 C# Q7 r$ F0 n8 s
3 m7 K& S+ x( L7 _
The way it works is very simple:: I* M7 k4 Y, H- j) y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 t l. n/ N0 M) s9 S
WinNT) with the CreateFileA API.; G" v; {* m6 k$ B" n
+ w' c) f( u( R- f
Here is a sample (checking for 'SICE'):
% N# b! z1 T0 J/ y9 P' Y2 i
( d8 Q2 Z# {# }BOOL IsSoftIce95Loaded()3 S9 S& p9 G/ O( |7 e
{
4 p2 D3 o& g" T1 ? HANDLE hFile;
) j+ L+ c8 }2 g; n hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
4 `' h$ T6 ~+ m2 m- H, o$ I. B/ X FILE_SHARE_READ | FILE_SHARE_WRITE,) \0 S) q( ^/ X" X# y' X' a
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
2 A7 a, u) R& A+ O1 i& U/ r- k W7 f if( hFile != INVALID_HANDLE_VALUE )2 _, c$ Q" _0 ?# n8 h4 V& a9 a+ f
{3 m. |) j7 r7 a" L
CloseHandle(hFile);& D4 y* o1 D5 z1 G0 E" Z8 p' h
return TRUE;- S" d& z. B/ h7 F% z
}
$ x) e$ x& O/ o: o return FALSE;
) P4 R1 W' y9 _+ x- j7 D0 _* C}+ z. |1 ~! F' j- t2 i* e- L
) ]0 N" C/ L& ^. S- H$ [% I
Although this trick calls the CreateFileA function, don't even expect to be
) i0 a" X) V- \8 T& qable to intercept it by installing a IFS hook: it will not work, no way!
" T/ j1 r# a- w+ q# k+ _, vIn fact, after the call to CreateFileA it will get through VWIN32 0x001F/ g: O& }& n6 ^# z0 @ P2 Y8 N4 F: Y
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
' K- \1 d% q1 S* ?and then browse the DDB list until it find the VxD and its DDB_Control_Proc+ _) h$ a" j2 I+ O, Z$ Z2 Q
field.. y+ A) A- F9 N+ w- Z' P* Z
In fact, its purpose is not to load/unload VxDs but only to send a 8 _9 m+ d5 U6 x2 o" W
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)( U/ i+ k+ C& o4 _$ `; ~; ]) }) k
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 h. F, i. F7 ^- J9 x+ jto load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ I$ t% S. _' U* X, D" k/ XIf the VxD is loaded, it will always clear eax and the Carry flag to allow: R) T+ {' ~0 |7 Q
its handle to be opened and then, will be detected.
/ S2 N9 ^) @2 _: Q2 [ fYou can check that simply by hooking Winice.exe control proc entry point5 o1 b- p+ [; l5 U5 k. \ ]. C' b
while running MeltICE.
+ j5 X& j8 _' @) M% @. K$ {# O" V" d# P; R% b
/ p _- \# Y' [. W5 W 00401067: push 00402025 ; \\.\SICE
2 n, S6 F8 T( J/ r- b/ m! W( \ 0040106C: call CreateFileA
& t: Y* e4 X; r/ e6 r% [1 J 00401071: cmp eax,-0016 k/ d! N3 [* K7 |0 Z
00401074: je 00401091
+ P: O" H. ^+ E% Q4 r# ~1 { C
$ M+ o Q0 e! u# }7 r0 H3 C5 m- W
There could be hundreds of BPX you could use to detect this trick.
$ j& n1 Q! t a" j, R- J: ?6 ^- i( N-The most classical one is:
2 I2 q3 w8 u9 Z3 m BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 ?' Z8 g* I/ f1 M *(esp->4+4)=='NTIC'
/ N! C7 `8 S! U. P- w
! O( X% x+ {4 `" N7 B) Q6 H- Q-The most exotic ones (could be very slooooow :-(
4 Z! }* g, O# j; B BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: c6 \' ]+ i& {) D: F& w ;will break 3 times :-(
1 C. K: W# n: j5 a) t: Q% f& I7 D# c! W8 c3 X! s% U# E
-or (a bit) faster:
, y1 {0 @ O% m3 u. n BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* Z! j0 n' ^% X. ^
1 p2 H. y- y: W( \5 }
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 o4 V; a$ a$ ^3 a* V3 [% |% e" f! V
;will break 3 times :-(* Q+ M) |& |3 ]7 _$ g$ c1 H1 g
) X4 T( L+ B. g ^- C1 V5 u-Much faster:; ` s1 {+ S; p' [
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ C) C) B- n& L- C7 g7 |' G
! F# z* s# g) l9 ]0 T3 W
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
: A* C% ?% {3 d! v4 m, `$ Kfunction to do the same job:
2 j0 f/ @1 B s6 U
, o7 B/ r4 ?: A! E; D push 00 ; OF_READ
# F1 n% C$ L4 q. ]% C, ~ mov eax,[00656634] ; '\\.\SICE',0
$ A+ X4 a$ q; M' V5 | push eax" q5 w) {- y8 a4 Y
call KERNEL32!_lopen% h. u3 N# O1 R! A& A$ U- `, s
inc eax0 R" I% m3 m) u; H0 ]( A1 f8 I
jnz 00650589 ; detected
: E5 s0 ~; C; H3 Z( D5 W push 00 ; OF_READ! l, I1 F, x: W$ {- h {
mov eax,[00656638] ; '\\.\SICE'- ~- X7 P0 W) q# M
push eax
8 Q" X8 F! v8 l# b' w call KERNEL32!_lopen: d6 f) j4 ~# }
inc eax
* X$ l. S/ ^$ c jz 006505ae ; not detected
! V0 a! g7 a; e* K D! ?1 ?! m" ]' P* n2 b
$ n2 K! E6 x9 h; ]* g8 V7 a
__________________________________________________________________________
; L- ] w$ Q. f% I! s2 g% s8 `
, S1 F# ~; h! ~- SMethod 12$ |/ V0 [$ r& P7 M; E$ O
=========' w1 v* R0 }8 W& K
+ o [2 }# H/ t) ?7 @2 ~This trick is similar to int41h/4fh Debugger installation check (code 05+ ]* |5 D& E% p0 g2 j
& 06) but very limited because it's only available for Win95/98 (not NT)
% O9 }. G4 k2 K; U, Y m# Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
& G: d( `) I, r* q( ?, O5 E1 n
, F8 X8 e T0 C8 p push 0000004fh ; function 4fh8 @9 c, f% @% h
push 002a002ah ; high word specifies which VxD (VWIN32)
1 x9 I: L, t$ O" v5 J0 F ; low word specifies which service- k6 \5 I5 {3 Z) X' ^: s+ N. y8 t
(VWIN32_Int41Dispatch)
* V; n/ q6 n/ O call Kernel32!ORD_001 ; VxdCall: k. W* B: t0 V( q/ K
cmp ax, 0f386h ; magic number returned by system debuggers% ?, B4 k% o' t: q' Y, F5 a u
jz SoftICE_detected
7 a- X+ @0 F+ f) c! U9 ?7 B2 |0 N& H# w7 u* D5 k4 z" u" ~9 W5 a
Here again, several ways to detect it:
: w+ H7 z" |5 S; E& c! ?' ^
# B/ ^. B( S# x, z& `! [ BPINT 41 if ax==4f
/ K; j! {3 p7 S9 b; [3 }1 X. F
/ e. I! [# f; }4 G9 y8 X0 { BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ X" }, S; w7 Y, a4 k+ X$ Q3 Q l( ?2 f# ?3 _( j/ X) T7 T9 s" X
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A: P. i& p) x0 S* g9 E3 f
" E8 A% D. s5 q4 L BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 q7 |" O* t2 }" c+ Q: b5 b6 M2 ~; W/ V* V# @+ E, @2 m
__________________________________________________________________________
: ]: x' S! t2 y, o0 u
( |9 D9 y+ a7 `. \* qMethod 13- q. T) h! D5 Z
=========, O9 D; d$ f; f' Y: f
' c1 U' K. a6 ^# T" Y* f D
Not a real method of detection, but a good way to know if SoftICE is: L5 s. K% O7 X& L+ H
installed on a computer and to locate its installation directory.
% y) a5 `; V8 W1 x! U lIt is used by few softs which access the following registry keys (usually #2) :
& x1 r2 k# m6 i( x3 j, R' ?* O/ G5 ^/ |, g; v6 \7 x
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ O/ x, _' S r$ P' c4 B7 E\Uninstall\SoftICE
9 a" R# a- d8 w! t* T-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
7 X+ o( H9 i! F4 q# o. | [ t-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. _$ N1 |8 ^" P! d\App Paths\Loader32.Exe: U/ Q; b) J2 `5 R+ ?+ ~3 n3 w8 ?
& ^ q1 b* R: D3 O
2 ^9 h1 N7 w2 ?# K; ^1 V1 ?5 eNote that some nasty apps could then erase all files from SoftICE directory8 i1 \9 S( j/ j& S
(I faced that once :-(
! c- q# h/ E! {& n! ~) ~, i/ g" _
+ c( A9 o9 e( w3 S4 ? U+ WUseful breakpoint to detect it:. b4 S( f. H0 P
$ C6 m8 c+ Y& ?: o- z BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
7 P5 h* |/ c& `% a/ I
% P& A* z7 @7 o4 L- e- K__________________________________________________________________________
1 Y7 V% @& M6 W6 x; X }2 Y9 B3 [; V C9 F* f
# D# O9 I- a6 u, xMethod 14 % m& {* b* r6 H# |6 U
=========
+ _5 u4 m9 k1 F' ^, `% D0 h$ o
& r2 o, q* b- P! Z' X. _A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 ~" l c, F( h# Tis to determines whether a debugger is running on your system (ring0 only).
; C8 L1 Y8 V4 Z1 _+ s( P$ ^# E! i
VMMCall Test_Debug_Installed3 q# o+ _8 |6 k1 F+ F. h& f
je not_installed
: C! l( V# j, L& X0 D% {
8 X7 o F8 X' v& g( Y/ oThis service just checks a flag., v, g! H9 u v; e! g) i
</PRE></TD></TR></TBODY></TABLE> |