<TABLE width=500>4 z1 i6 Y& l! O( Y7 A5 b
<TBODY>' Q+ P6 I) V1 w0 W
<TR>
0 L. F& c( [5 r$ Z& u0 T: U/ P<TD><PRE>Method 01
9 W f+ {% |. v( a$ @/ ~. R=========
0 T% y* o/ a: w9 t0 B6 B: o! h$ O8 G+ M& b5 ^
This method of detection of SoftICE (as well as the following one) is
8 [& }# u& a. g. x/ }" J, E: }1 Xused by the majority of packers/encryptors found on Internet.
& x5 ?7 V2 Z! G& o |* Y& ` hIt seeks the signature of BoundsChecker in SoftICE+ p# r5 J& N; A' f
: x6 }) I0 x5 Z( C$ T mov ebp, 04243484Bh ; 'BCHK'
4 [4 i: ]+ V5 x+ Z8 U+ C; u mov ax, 04h
+ h" v9 l6 s4 C1 y int 3
7 }: D& G4 c" K5 l0 I' q) W cmp al,4; Y) \- Q" s- @# i; A
jnz SoftICE_Detected
* V+ I) S" P+ m* S Y1 j
6 p: I( C' T: Z; k0 v1 m___________________________________________________________________________: [4 ]- ~9 ]. K6 u8 E# r
0 a( M2 e, O3 X7 }
Method 02; v2 t4 A, T3 W6 e8 _: C2 P
=========) n) z: Z& n3 R1 g8 Y
6 V! U2 N0 A- m/ Q7 q' BStill a method very much used (perhaps the most frequent one). It is used
& E5 W# h. z2 R# J4 Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,) U& ?2 y/ W" q) c2 ^, W
or execute SoftICE commands...% z6 [: I5 ]- R" l
It is also used to crash SoftICE and to force it to execute any commands* t/ U% `7 g2 y( O5 V3 c5 k
(HBOOT...) :-((
2 ^- d8 h9 P: J, w3 r7 W8 E+ j6 k, |. M* Y4 ^$ y5 l, E, H
Here is a quick description:
* A& K1 z V* Z. H-AX = 0910h (Display string in SIce windows)1 @. W3 b S2 w- B9 r
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* A* K7 x" R5 ]% Y7 l, Z. l4 [% ~, I-AX = 0912h (Get breakpoint infos)4 B9 F" {# l' v
-AX = 0913h (Set Sice breakpoints)6 d6 Q2 C0 E4 x: e) j0 |. u1 e
-AX = 0914h (Remove SIce breakoints)
: T5 q l: b4 [; [) `" \
1 ]8 c2 T$ N* }$ e3 d4 Z2 d/ HEach time you'll meet this trick, you'll see:+ _- N( x7 A8 s. D
-SI = 4647h' w' I' F$ Q8 v4 [
-DI = 4A4Dh% b4 H+ N- m0 y" b9 M {
Which are the 'magic values' used by SoftIce.3 ?+ B8 x) j; h
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ K. M5 H/ @! q) }
; V* A% L) c/ m% tHere is one example from the file "Haspinst.exe" which is the dongle HASP( F; h' B' d) _! H9 k2 R
Envelope utility use to protect DOS applications:0 a* W ~- l0 m4 N, ?6 h
( p- [5 g4 m1 c7 T0 b: J
, P3 `5 g# C' i+ b
4C19:0095 MOV AX,0911 ; execute command.
# B4 ?: L6 R3 y* K: [! e4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
1 }6 L: b7 \# K9 v4C19:009A MOV SI,4647 ; 1st magic value.
" B/ m' l: b! ~: X" h/ R# z3 N+ V4C19:009D MOV DI,4A4D ; 2nd magic value.
% X, H. q6 n6 k. |# f" P# n/ q' z! K4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)2 E% H, G, H, t3 q& s! J
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. j" @" G, @' h9 Z! o+ M5 i4C19:00A4 INC CX4 p. o0 U$ H# m4 N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
5 ~2 O, u0 K% O4C19:00A8 JB 0095 ; 6 different commands.) {7 c' n8 L3 Z% r6 _6 ^: v- B8 A
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
* q( m" u0 l5 m o* A# H0 h4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
$ |7 }0 N8 q& _; h2 E1 r$ L/ }6 m3 z ~" d3 c
The program will execute 6 different SIce commands located at ds:dx, which+ H3 ?, H- u6 P( n7 A. g- P7 ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
( X( a- Z, G4 V- s: J8 V
' ]) v- x+ p6 s a* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., H3 f, G9 p+ P8 p
___________________________________________________________________________' Q2 h% Z8 ^! ~2 i+ y
8 C; J9 J7 ~+ i$ W% |3 R
/ r! {1 R' v. j q3 P" BMethod 03
+ T" E' {- v% G7 \/ F=========% r$ b# q) R1 @2 h: ^
* P7 q! }9 V9 @- ]! aLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h( I" @ b- U6 K7 t
(API Get entry point)! G2 A" M4 \) ]
4 u0 I* x l2 \3 w# T2 ~+ w5 x8 o5 }! ?' _8 n8 \ x; r! a' c
xor di,di
4 w7 @/ Y; m4 g3 E mov es,di
- |# G! J) G0 a6 b5 C F mov ax, 1684h 2 k5 k+ r9 u/ D4 V* e
mov bx, 0202h ; VxD ID of winice1 c0 |& w, }3 ~$ [9 v6 q/ N
int 2Fh
7 h- N0 H5 c. e, P mov ax, es ; ES:DI -> VxD API entry point( f" b$ m2 f9 B: B( A! |) K8 q
add ax, di# C) ]3 T8 V7 y1 O/ H0 u0 B
test ax,ax
5 D- ?2 S& d: w1 V, v8 y, M3 S1 R8 ]& W jnz SoftICE_Detected! M1 G* w) d. [. C
/ C" C7 X4 B" R; o
___________________________________________________________________________
$ g) k5 V/ H: y1 H! ^
+ P G4 w5 u2 U# S. C0 JMethod 04
3 ^) s' x8 j" V! u& }) r=========( A+ {7 E, E, P+ J; f. L& z/ b4 r
: t, n; M5 {0 [& x( C$ kMethod identical to the preceding one except that it seeks the ID of SoftICE* G/ q- a, ?- n5 x1 I {0 F6 J$ ]- k
GFX VxD./ r0 C$ Q: p7 L
6 K0 a# m6 x. X1 D3 N xor di,di6 @# `8 L/ ] H$ P! K1 u
mov es,di
! D8 O/ y8 X7 |. ~7 H' L% a. t mov ax, 1684h 9 A% Y6 L8 I' d/ p) T
mov bx, 7a5Fh ; VxD ID of SIWVID
# k9 G6 v0 W, g7 h; g int 2fh f* J/ \) h$ l) X* h# t
mov ax, es ; ES:DI -> VxD API entry point4 C- S& X' ?; [5 p" g$ j' M% H
add ax, di
3 x* w+ C! y8 h' G test ax,ax
: Z* M& F0 T5 `0 W+ [9 a+ } jnz SoftICE_Detected
8 R4 L* C3 T- b# A- I# s8 ^* G) B- {! u+ R+ I$ F& V, e
__________________________________________________________________________. {8 f; R1 ^. |# y
$ y# G( @, r- O: A7 b2 D
! N, x9 }& `! M8 V8 MMethod 050 R5 {2 m h: M3 u9 i3 e' l* y
=========# D& z: D: N7 j* [( u. ]) f) S4 k
- B( l5 B" x( X% g4 i
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ r8 o1 n, j! k# x" f B9 _ `
debugger. It calls the int 41h, function 4Fh.
) C& Y, c/ C( }& qThere are several alternatives. ( c0 {. A: ^3 ^3 J1 @) A4 [5 t
0 k3 k% a. |7 e. v2 ^, a! EThe following one is the simplest:
4 R1 h2 ?1 f+ {7 O; e6 z4 V- @* v1 J) N! O& ]
mov ax,4fh
7 N7 O3 H w" t% G int 41h8 ^7 x4 o! o' \5 p/ [& Y* K
cmp ax, 0F386! O( L- R% \& _6 u) G: {
jz SoftICE_detected
- c# J" q; j+ f+ ^3 |6 n7 D" V5 g* S; A3 |7 p0 `
) D7 x# w% C1 b/ C# I5 uNext method as well as the following one are 2 examples from Stone's
! s7 {+ o) v' }" ?/ f) a"stn-wid.zip" (www.cracking.net):, K+ S) A7 t6 V6 A
4 z# ^2 p) F6 o( M
mov bx, cs
0 s/ F; b! k/ u9 v$ P lea dx, int41handler2
( m9 u- W1 A( n- z xchg dx, es:[41h*4]
& J. Z" U* _0 p5 X- r" _* K* V xchg bx, es:[41h*4+2]
_% W. S1 D9 F( @4 g mov ax,4fh, J0 f1 M) f* k, c( R
int 41h; z! @& n' y. g8 @, I% L3 u
xchg dx, es:[41h*4]
7 m1 |2 I+ k# P4 z" V3 f; F y xchg bx, es:[41h*4+2]: M2 h! X. L$ c
cmp ax, 0f386h
0 K8 d7 b/ F! O+ m& {# ^ jz SoftICE_detected
5 U) ~% v* U' B% A" u) s
" Y; t! z$ O# E; i6 Cint41handler2 PROC
" U, ^! o' N9 v4 x8 I6 K iret: v' H* s N& V6 t6 X
int41handler2 ENDP0 |' F+ I, w5 k8 D8 i
* [, k l8 A4 w7 ~% w* A" H9 Z7 ?% C( _' P* B+ V
_________________________________________________________________________2 z+ A+ v' e3 q* C
4 _/ u$ h/ U4 D! }! ^8 d3 r) z9 h( S3 \/ Z
Method 06
4 H5 w3 \4 P2 B! m=========
# M6 O) f2 C: {1 q& R4 d8 M; }7 W- [( \9 I6 ^; }1 W b
) D8 C2 m3 N: ^% z5 [, J2nd method similar to the preceding one but more difficult to detect:, D; d' R# k; U# Q! O$ p v
4 l) P7 N4 M; a0 A, [* o
, B% A) E7 D, r
int41handler PROC
& D# A- W0 _3 }5 k+ Y- t mov cl,al
! }" h& ~& d; b. M; K, D9 i iret
% y! Q9 B6 g1 f+ M2 l$ r# Jint41handler ENDP
5 t$ E& C) ]) g% t( v! W% m: g* p
7 q" n; x6 N1 f xor ax,ax
( y8 A8 H1 C/ n. } mov es,ax: ?- \8 {$ R1 j5 Y( z. b
mov bx, cs
4 }/ q/ E* W; N3 m% x* A lea dx, int41handler
2 u+ ^, c- i6 F6 ~! @! E2 W2 B xchg dx, es:[41h*4]
7 [$ h2 K' P7 l3 v xchg bx, es:[41h*4+2]1 K. i4 x3 U6 s) V
in al, 40h
3 W' P4 y' [+ E, F6 M xor cx,cx. m- ]$ b! w1 R! h2 M9 H/ o
int 41h+ h D0 _6 {7 s' r1 B" K
xchg dx, es:[41h*4]. ^% {3 A/ j, ?6 h
xchg bx, es:[41h*4+2]
0 D' |4 b, Z2 o4 z, C6 ?( E, v cmp cl,al
0 j) e* `/ O0 p+ P% R- n jnz SoftICE_detected
+ N* E$ z( f! k6 _8 V* j: y6 S( M# F4 S. j9 V& H
_________________________________________________________________________
$ T3 ^) ?" a5 ^- k. E/ I9 ~- U" }, G! l
Method 07
& n) ^5 U! t7 r- P=========
4 T7 w! W( D0 q8 G+ n* p3 a, k8 t" J; W( }
Method of detection of the WinICE handler in the int68h (V86)
: T* K* q' W2 t% F% ~2 w
0 p" Z& {8 o& N7 u; T: a6 m! k' M mov ah,43h4 X9 T" s, G& x4 s' k9 L
int 68h
% d3 Q* }# x, }5 r cmp ax,0F386h
# e! b; D" Y, W4 o jz SoftICE_Detected2 s m0 B- P4 j4 b6 F7 c" Z
$ T- @" t. O) Z& e5 [ S
% D. o' B! w2 f3 j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit% e& V. O S( \: }7 r, }
app like this:; i' v7 G: q! d: n4 b7 [6 c
1 ^# U0 u0 N, i, A& }' T BPX exec_int if ax==68: ?& ~9 {# P! B3 ?) o! c5 g F) `. m
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 x6 A& Q$ W6 @% o% ] located at [ebp+48h] for 32Bit apps)& a+ a; p& ]3 Z% o" K* o
__________________________________________________________________________
7 P9 M& ]5 d/ C, B
# O) A& H/ `1 h* V5 `1 v6 S# C2 I' H I3 b1 A; n9 A
Method 080 }1 @3 B' S6 b2 @% t% l
=========
2 K8 F% p$ C+ F8 v6 I2 @( r( j5 z0 d' P. K7 t/ n
It is not a method of detection of SoftICE but a possibility to crash the
( J& S5 }4 Y5 z, n- W* V$ H2 Hsystem by intercepting int 01h and int 03h and redirecting them to another
/ [1 c1 m# ?$ k: a' n+ t$ `( iroutine.2 q+ g7 r+ N, w. I1 ~
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
& M$ [& l% a6 v6 ]to the new routine to execute (hangs computer...)
N! t \4 Z- i3 ^9 H4 q/ t. N9 l$ M' [2 Y
mov ah, 25h
* E7 {( ?. ^) G, H- }4 z mov al, Int_Number (01h or 03h)
% |; S4 e- d! A0 U# x mov dx, offset New_Int_Routine( U+ N( a: A: U( }8 a
int 21h$ T8 O3 h$ d# o
* | ~& s& I8 W5 Y& M. J
__________________________________________________________________________5 z1 ~+ e. E& a) B) x
6 P& n/ E. i0 @6 D; \- v2 iMethod 09
# ^4 K- \, t- O: X0 f, q=========( Q! e3 f& L' {8 _* q
+ L7 U$ s6 a d; u- Q* B& r- qThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only# c4 v, M! q1 f1 W x
performed in ring0 (VxD or a ring3 app using the VxdCall).
: @4 e& w @7 H; |' e+ T. ^The Get_DDB service is used to determine whether or not a VxD is installed
8 n( k$ |. g2 x: Q) Ffor the specified device and returns a Device Description Block (in ecx) for: q% J; x3 J5 G$ Q
that device if it is installed.0 i: q% H( T; h' g* {* B
2 M0 Z+ w9 G) v' V2 R
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, g6 I# ]2 f+ M9 m& ^! x mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
8 Y; @; G0 ?, m, X2 |5 ]# _ VMMCall Get_DDB, `* r. S0 x: s/ g
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, X+ b7 Z3 i1 {9 D* N- X: _; `9 }! f( Q. P; {6 c/ t4 N) l& Y
Note as well that you can easily detect this method with SoftICE:
4 u: N- i: j9 T1 [- ~" ] bpx Get_DDB if ax==0202 || ax==7a5fh, \7 M$ O, `4 U8 Z+ N3 Y9 K
: n6 L$ x. m& m: K: b
__________________________________________________________________________' p8 c" F V" k: B, U+ m- `4 E# l) x
4 m: o6 E- U0 O. `" B: ?$ cMethod 104 t) I' z; F4 z. K
=========
' m# D( t- y& s7 a* L( m* E P R: D3 i8 i/ ?
=>Disable or clear breakpoints before using this feature. DO NOT trace with
. z# X2 \; N( [5 y |; q SoftICE while the option is enable!!9 K3 ^' I9 K: k5 @1 F5 ]$ V. q* h8 W
1 m# x# Y7 g# K6 ?$ I/ fThis trick is very efficient:, l$ ?$ g; C- [1 h& v8 H
by checking the Debug Registers, you can detect if SoftICE is loaded0 e/ B' ?! n6 o0 y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 p# C1 S `' P# ?$ k
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* h( P! W |" Z' A( Hvalue (in ring0 only). Values can be manipulated and or changed as well# `. y2 D l" h5 h
(clearing BPMs for instance). \, j3 N9 F3 N: P b" n% W; I
E ]6 l0 [1 Y; q# [__________________________________________________________________________% G0 d; D5 W8 ] `5 f. `
" e* a6 b n h5 r# ^Method 11
+ _4 O3 z2 c9 H3 j0 K=========
# ^& N) u8 T2 |! g" E# w- _% N' E& @ x' N) X7 N7 s
This method is most known as 'MeltICE' because it has been freely distributed
/ l! Y. Z& {2 z# J) [6 Y! ovia www.winfiles.com. However it was first used by NuMega people to allow4 | u. z. A+ V" O( m# c
Symbol Loader to check if SoftICE was active or not (the code is located
5 k: k d, p4 `% w7 a0 s* i: minside nmtrans.dll).
' p. w% r3 T/ y; P. s, U9 j6 r' k% D2 G) i# B
The way it works is very simple:
Z1 `- j& G l7 k. |+ YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
0 R3 Q5 z, e5 n+ E1 `- |1 OWinNT) with the CreateFileA API./ _2 }4 P( S- Q. |$ P% V" g1 K0 `( G
' ^# B. u0 t9 ]/ _" [( M
Here is a sample (checking for 'SICE'):
9 R* X* H+ F9 O5 c- L
9 C# P" U% Z) O! wBOOL IsSoftIce95Loaded()( [( H" {2 j0 R0 e0 S" A9 F/ W- t! d+ z
{! |" U% t B* {3 z6 f
HANDLE hFile; $ G3 J( @9 |0 D4 s" O$ f- h
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, ]% c I0 `- N7 ]* `6 i5 O FILE_SHARE_READ | FILE_SHARE_WRITE,
% d3 p$ p& S; g0 ~# H* T2 V NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# p5 u: w) U4 t5 W/ d$ l2 S if( hFile != INVALID_HANDLE_VALUE )
O- T. I* ]+ { {1 z* v+ O" F O# A# } B2 C
CloseHandle(hFile);
' Z" r# |3 W) K: J+ {. Y( A return TRUE;
/ |( P4 D. i4 ^. b8 z9 @ }
% H) ^6 [) G+ K% _- p8 R; e1 ^, V return FALSE;
( d$ Y& P, V: y# f4 Q4 K+ y7 p( N}% o! j4 J- s" Y
: P% [& Y! \& Q7 P# cAlthough this trick calls the CreateFileA function, don't even expect to be
; y( d1 k/ [! c% B1 h# Uable to intercept it by installing a IFS hook: it will not work, no way!
/ g+ F3 G+ i0 W& {In fact, after the call to CreateFileA it will get through VWIN32 0x001F
1 ^) H! p$ p' A% ~8 g5 W/ [# h' E' Aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)+ c8 o. f0 l+ T* j( s3 g
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 W; }5 H% o9 R* C
field.
) r! C/ g: i$ D w" H+ U6 a pIn fact, its purpose is not to load/unload VxDs but only to send a . `! K3 `" c3 y0 T
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 j9 w+ a+ L; M- I
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
- E, h' s; Z8 z# W. zto load/unload a non-dynamically loadable driver such as SoftICE ;-).2 Z5 [ r1 H( ~ D: O% O" T4 m1 Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 I) p7 z8 S7 X) W! W& C R2 q" T
its handle to be opened and then, will be detected.
4 q. F) v" d! w, N7 ~6 ]You can check that simply by hooking Winice.exe control proc entry point
4 j( q7 a7 P9 l2 n# x0 c1 pwhile running MeltICE.% J; \" b! Z7 v+ O" r# }
# f# A. T! a8 Z% t2 Y/ S' V$ |4 d- g) b+ C) \; V
00401067: push 00402025 ; \\.\SICE/ @5 O* @, X" {
0040106C: call CreateFileA# k. L8 {, a4 H# t& N# g3 P
00401071: cmp eax,-001
- w% r" {/ N w0 Q- l9 h: K 00401074: je 00401091
! b! @ R' W9 c
9 W" D. q5 x" m r, ~1 m) P
6 G9 V! L5 l/ ]5 \, k- a0 x2 kThere could be hundreds of BPX you could use to detect this trick.; I2 s6 M+ ~6 [, D+ X a. g" F
-The most classical one is:/ ~% Y1 [7 l6 I4 z6 o
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
) G. L0 j+ C; x4 H0 |: m6 {, i* @3 c *(esp->4+4)=='NTIC'
' I( _/ H. G& O: \# \0 G# R% t9 e& [: w: Q- ~
-The most exotic ones (could be very slooooow :-(
5 C( m1 o( z$ Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " z/ G' V6 v: m* p# L; H
;will break 3 times :-(4 W( W6 b0 m" T9 e4 \. H+ E- ?
& [* S8 ^ u9 V- ?-or (a bit) faster:
1 K7 e" L1 _ g& b5 `0 R BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 K- O4 e& ?) e& ~" e8 P! \4 c
9 ^/ S Y0 c, d2 x( @1 U# z BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
' c) E5 ~; ^8 d. y" V+ R ;will break 3 times :-(1 K& J1 {& `9 v5 f% U
" e. G7 w1 }, I/ b
-Much faster:
! y* x2 O: {; K, a9 c& J BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! t% ?" c8 h( ]/ ^" E: q* U6 ^. Q3 J9 |/ l/ V+ F8 S/ i
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( W2 K4 k) V; Q- m* ^9 t$ f( a8 i- Ofunction to do the same job:! }% t! z6 e( b; S
( H$ h. W. e4 @$ L4 @3 w" D push 00 ; OF_READ
0 z- _) j" \1 X. p1 u: D7 Q+ ^; F# H ` mov eax,[00656634] ; '\\.\SICE',0$ T x# x& L) N6 X. k1 ^0 P% _& W
push eax: A) ?; B$ w% A# }$ n S0 ^
call KERNEL32!_lopen" {7 A, Z- \* G5 e7 [7 e
inc eax# D8 W; ~' D: \/ \+ y
jnz 00650589 ; detected
7 d8 M% ~- _% g @4 G, q7 Z push 00 ; OF_READ
& s/ Q$ I9 W o* H; W8 y) A mov eax,[00656638] ; '\\.\SICE'
5 m' a' X1 R. c& k push eax
- D$ {& I* j+ i# N+ T; h& O7 {5 g1 R call KERNEL32!_lopen
% Y: Q7 d% x! }6 m6 b7 P3 |% O inc eax$ C& @5 B& ]2 `3 c7 {4 ^
jz 006505ae ; not detected
& b: }3 I9 s7 i: C& P
Z7 e1 [# B; \9 x5 S' s& `+ @# e+ N9 w2 {3 s- M, `% |% r
__________________________________________________________________________) o4 H' Y8 c8 \
1 ^6 g) J6 w0 {# ], u6 a. l, AMethod 12! {5 R( Z3 S# F+ U6 L4 W* q
=========
- D6 h- B% Q. a+ [
+ r) M, s J2 ^3 h. p) g/ S' E) SThis trick is similar to int41h/4fh Debugger installation check (code 05% [5 M) d+ Q0 m& |, P
& 06) but very limited because it's only available for Win95/98 (not NT), c: K Q2 R# F* v8 w/ Z' p0 X0 |
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 ^, x4 p! ]7 {6 U, E5 u6 b2 P% b8 K
& c" u F, `1 r) F
push 0000004fh ; function 4fh/ O6 R1 l7 }% h( u
push 002a002ah ; high word specifies which VxD (VWIN32)
) I( D0 H% F" t' i. W w% L# l# f9 G E ; low word specifies which service2 h& j5 C7 o, h4 H+ w
(VWIN32_Int41Dispatch)/ R | [2 G6 l4 X) o3 A x2 h1 y- B) h
call Kernel32!ORD_001 ; VxdCall
+ w% ]! o s% \ cmp ax, 0f386h ; magic number returned by system debuggers
: C T- S% ]4 K6 ]7 k, B4 O, X jz SoftICE_detected
- X' i6 |. \% } f
3 n8 r% H) a9 Z. {# s* b0 ]Here again, several ways to detect it:
2 ?; p" }" V5 X5 r9 _: d0 {' C# s. h- X1 n( c
BPINT 41 if ax==4f
5 B0 R9 S% ~; @- R {! X1 \
- s- s0 {, ^# L6 A( `& ~ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one2 [. P% @2 }; p3 l( m
. F& J; y2 ]' H: j4 ^ BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A! T7 ^) e w; z9 b+ ]; r- J8 z
1 }1 W/ w2 |* R) m6 \6 H( N) S BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!) g) v M O7 Z6 t8 s) A/ h
7 R* O) c. D b7 n: s- O
__________________________________________________________________________
- h- {, O. }: `. o
- l" M$ u2 Y7 DMethod 13
4 E' @/ f/ M$ `3 C7 O=========) m( w; ^* a3 Y& n- }
- b& g# a" ^0 I; U) s* k+ dNot a real method of detection, but a good way to know if SoftICE is7 r1 Y+ J6 i6 s6 Z+ L
installed on a computer and to locate its installation directory.( }# a2 }) Z9 J! l4 a5 D
It is used by few softs which access the following registry keys (usually #2) : _( t, J3 x0 d! N3 e
+ V* @7 D7 t; @: m9 I+ W-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 p, R3 d, O+ A- A\Uninstall\SoftICE
5 L" e7 m0 b8 a: G: W-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; Y: G( H/ W* @* l-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 }- R2 Y) D4 F& C! `\App Paths\Loader32.Exe
! D0 [5 Y& K7 v, x/ B
* E( d! P9 g* L, q9 ~0 U; H' v+ z7 ?/ K# _
Note that some nasty apps could then erase all files from SoftICE directory
4 A+ A! B. x& ^- l(I faced that once :-(
) r4 o; @" R3 I! U& E4 v1 ?( a7 M x; p9 q
Useful breakpoint to detect it:* w3 A" B7 ?5 @9 T" k8 H6 J' ~
, B' C3 o# U" @3 t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE' m" c, j4 _: t3 c R7 b
, e- A/ Q+ `) ~9 v. p+ l# b( R
__________________________________________________________________________) O. z* K7 {9 N; _' F7 }
R$ l q- \& W" k, e2 I/ `( M1 J+ c n+ C4 u5 u G; v
Method 14
" T x- i. |8 \=========3 J* e: z* Q/ Q# @+ @' F" }
8 @/ M$ X, f' f
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- _8 `4 g8 w# ~( H: ?) l
is to determines whether a debugger is running on your system (ring0 only).
" c$ f X" A* M' {4 p) G/ q+ N2 |0 R* A
VMMCall Test_Debug_Installed6 H2 H/ v1 I j, s: Y3 b
je not_installed7 H# H4 f5 t" L& u
9 l4 }! C" g" m1 s1 |; G# T
This service just checks a flag.% N9 f, @/ J, S6 R: E
</PRE></TD></TR></TBODY></TABLE> |