<TABLE width=500>0 |2 s- l3 l- X2 q- S
<TBODY>
1 l; M3 s g2 T<TR>" X# b' G$ K' x4 X1 `7 {# y8 h* I
<TD><PRE>Method 01 9 O& i, G3 s7 q& |0 X
=========4 n9 \, a6 n4 b8 L0 ^+ K
; C2 d3 @; {) w5 x8 o& v6 G
This method of detection of SoftICE (as well as the following one) is
6 m6 c9 R$ x5 f Z, iused by the majority of packers/encryptors found on Internet.
/ ]8 j4 D2 W! ?5 p! VIt seeks the signature of BoundsChecker in SoftICE& i0 b. R3 l2 Q
) A7 k5 T& G$ r: |0 H" e8 ]
mov ebp, 04243484Bh ; 'BCHK'
! r# a7 D% Y" B1 i mov ax, 04h
7 W. A2 @2 c |: `9 I* n( Z6 [8 t int 3 6 C3 K, t/ g; h7 k5 [8 N
cmp al,4
) S! q2 c u( s) c jnz SoftICE_Detected3 c- X# M* P) J, x% |3 M, I
% Y1 [. l. }& q2 F) g8 I
___________________________________________________________________________6 d6 r! W h1 s1 O/ Y1 T8 {$ N
* G& L" Q$ z/ iMethod 02
+ c. i1 Q' H x) E( Z+ C=========
# ? I! u5 E2 R" k) V& Y! c) d1 u1 O8 ^ i& e$ Y# ]3 K% s
Still a method very much used (perhaps the most frequent one). It is used
# M7 l+ j2 E+ C X7 ^1 Nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 O+ S) k: Z: a5 h) `
or execute SoftICE commands...
/ `, [+ \& z. I# q8 @- E' PIt is also used to crash SoftICE and to force it to execute any commands
W! w$ g5 |: c. D6 G$ q(HBOOT...) :-(( $ i H# N: V; `6 `0 z8 C2 x. }
2 {- k( M" }9 h* X
Here is a quick description:
( E; R# O7 d4 ]! b8 I0 I0 J1 I" o-AX = 0910h (Display string in SIce windows)! F! u1 ~( T/ q. n$ H
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
8 V7 n, y* E* B! D4 j& T' u# y-AX = 0912h (Get breakpoint infos)8 @+ r6 m. s; H# w
-AX = 0913h (Set Sice breakpoints)
$ B( O( X" \& ^: F-AX = 0914h (Remove SIce breakoints)4 L$ X5 r9 W( ~: Q( W1 n
8 @# E d% o# E7 X* P( E( w- X
Each time you'll meet this trick, you'll see:
& |+ Q; M9 m8 x3 T. M' M( v4 u-SI = 4647h
! c+ b* |4 x h-DI = 4A4Dh+ N4 C+ a1 D+ O+ {/ k9 c
Which are the 'magic values' used by SoftIce.8 H! g% \5 \6 l. r' |9 l
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.' K; @3 `; Y. t6 ~2 P* q1 k3 x
) E6 R) H' z; BHere is one example from the file "Haspinst.exe" which is the dongle HASP
m9 H1 E. D$ Z BEnvelope utility use to protect DOS applications:. ]& T6 y1 p6 x- q# @7 M
' K& L/ E4 A( G) Y. Q! o+ m
% z1 d; w2 L" J o2 {
4C19:0095 MOV AX,0911 ; execute command.7 X6 X! v4 h* ^; `
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; A6 a) Q1 \5 @: S$ k4C19:009A MOV SI,4647 ; 1st magic value.% L" r k6 `" C* ]
4C19:009D MOV DI,4A4D ; 2nd magic value.
3 t& {( f% n. B2 c4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)0 L& f# Y7 q7 P6 D: I
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! `8 }6 ]. |# @$ C9 I4C19:00A4 INC CX. i6 r' \* c# f
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) F4 e6 W1 Q4 Y8 F R
4C19:00A8 JB 0095 ; 6 different commands.& R2 S! d/ c" _: J7 K
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
# ?" b1 j5 e9 `6 p& F4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( k; W6 P m2 r
6 x2 a5 a& [; b9 I+ ]6 WThe program will execute 6 different SIce commands located at ds:dx, which
( B8 U) R, b* ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ e' r7 J) n( Y5 A: U: R3 H/ S
$ K' X% B" ~5 C D# q& `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.0 W4 _/ |: @3 |: E' Y9 B% ]
___________________________________________________________________________6 j9 ?. c! [; o% C: K
+ {7 A* }& x5 T! W! m
: c$ E/ A4 @6 M/ L; X0 k
Method 03
- Y6 J3 n* Q I9 m _=========
0 \' {* z& r. ]+ A( S3 o, z# V
`6 _: ]4 y, SLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# g: K; A; v- L& H& h2 o# \( P(API Get entry point)
2 K9 R* A+ m- @! I ; D% |& k8 `) G! p, B, @% P/ g2 D
, j5 A& k+ o6 u, z3 i" F6 g
xor di,di
8 {$ j' L* I0 t: {4 ]9 \2 B mov es,di4 ~) N/ G) f$ p0 Y( h* o! I, @4 i
mov ax, 1684h ! W) T6 l g2 s1 \( ^ W
mov bx, 0202h ; VxD ID of winice7 a: N# \& t4 G% t2 P: N# [" z
int 2Fh+ J1 G! j/ ]1 }5 ~. k3 ?' |
mov ax, es ; ES:DI -> VxD API entry point6 U0 m' U1 @0 f
add ax, di
' q3 {+ `* g$ U# l$ n* f* T9 a test ax,ax# Z! } [9 }6 n4 i9 m
jnz SoftICE_Detected' S1 T6 |/ ?) {7 @* v6 K
: S6 H& o1 o9 o: V___________________________________________________________________________
+ H6 n! [5 I3 a; @; y
# ?, D0 W! z4 L; i, j& k0 lMethod 04
2 H2 k7 i, O3 W2 O=========- R6 A( t. r. `% ~; G) q, o
* ^2 O( T( @/ R$ {Method identical to the preceding one except that it seeks the ID of SoftICE
. @6 ?/ D* e9 m$ u2 ?GFX VxD.
4 [( y0 F" G* p0 a! ]* ?! n" L, i
xor di,di
/ l1 j. x. q8 e8 A" ~# z8 ?0 | mov es,di# Z' C: i" X$ B( T
mov ax, 1684h
/ D- P1 ^* b6 l3 D' X! ? mov bx, 7a5Fh ; VxD ID of SIWVID4 ~) w' k% d U7 y) p' j/ g' y
int 2fh" i9 d+ B- l6 G7 g9 u, K
mov ax, es ; ES:DI -> VxD API entry point) `4 j0 Q S( | q- ~
add ax, di
) T6 h; M m5 k; E% V; t& f test ax,ax' O! c$ O$ S: ]! }2 t& G- [. U( n \
jnz SoftICE_Detected) S' ^0 y4 }" g5 l! J7 V6 j# L
9 h r, A5 u) d4 S1 L6 Q4 [__________________________________________________________________________. X, ?; ~+ o" h0 f9 q
9 d7 `1 N0 d3 r* ^1 S9 x
& |0 S6 \9 h& F5 J4 dMethod 05
( }- N" V8 e& l6 s( r=========- P& m R, j/ i. K$ U# N
2 m: [9 H: B4 d0 Z' d# t
Method seeking the 'magic number' 0F386h returned (in ax) by all system
. B2 P( e2 N" g5 l0 \8 a& i) [debugger. It calls the int 41h, function 4Fh.$ d: y6 m, H% F6 e* F
There are several alternatives. $ q& ?" Z0 `3 n4 s/ c
6 z" n+ a5 A" a: S/ b2 r& X/ `The following one is the simplest:
, I+ ^' V, R: D, H* J% |, w8 g2 ], N) A' ~/ @# i; [+ Z
mov ax,4fh! J# z6 `# E5 R8 L0 E+ v
int 41h
3 [5 q4 @4 x }$ j0 B4 Z$ ~ cmp ax, 0F386
! x) f! ~* T4 L" I0 Y3 f* M jz SoftICE_detected! K/ z \) P8 [4 h. i( F
0 b* F5 H9 t) ^! p4 q& X
8 ^& s1 z$ m! s1 ~" DNext method as well as the following one are 2 examples from Stone's i2 a! r/ d) }0 U
"stn-wid.zip" (www.cracking.net):
0 |5 z* s5 O4 J( r
* S7 ?9 k' i- C( d" t% V5 D- q mov bx, cs: M& m a" \, D, c/ ^% e. \8 A3 I
lea dx, int41handler21 ~3 k5 W) D# S. a
xchg dx, es:[41h*4]
. G; v( P( Y: _+ W; y xchg bx, es:[41h*4+2]
$ _5 B/ r* L) l1 J: a. A) A mov ax,4fh
- Q5 c, \$ i7 V% K int 41h, T Z$ `% e l
xchg dx, es:[41h*4]
+ Q1 M2 L1 l0 f# V/ c xchg bx, es:[41h*4+2]& V# V6 M+ o% I9 e3 T" w
cmp ax, 0f386h! J9 a9 _# L0 j* n# D* S
jz SoftICE_detected
. g! O/ D4 o3 m- |+ K% K: Q3 S" z. X; O- [/ o3 F; [" v
int41handler2 PROC. M7 X' K7 J& k! k
iret# S$ J$ }9 ?7 c0 i2 E" J
int41handler2 ENDP
8 k! X' h/ }6 ?3 c" P
0 T- z( T; B' Y5 i' {& j
* i6 w- M4 {, \/ i/ V_________________________________________________________________________ q7 b* u/ l8 p
2 j3 y2 N: a! q! Z
P: m" d6 v$ Q, W9 I2 z+ g7 dMethod 06* z1 V5 B4 u- T2 u0 R1 g) T0 Q3 g
=========
7 d# h# g: a% J5 n- |! g6 i! C# f( V5 ]. b4 o
' o# `7 n. F" K% z2 u( n" f. C/ n; A2 h7 Y
2nd method similar to the preceding one but more difficult to detect:
4 _& u+ U7 f: H/ ^5 h
9 j3 P% P( b/ _6 H' E/ k- E, p; l7 @6 m- `8 l; K8 I6 ^
int41handler PROC4 _/ Q% S. D- z! T' i
mov cl,al) B. k8 o1 A7 m7 }6 z
iret; w# C: s+ h* ^/ O S. U! E8 `
int41handler ENDP% ` K2 N" M- i i. Q( S
8 R, M9 X/ m$ h, p, b3 n& L# Q
0 b% A9 l C; ? @3 p& a xor ax,ax/ n: S, P3 C1 m/ K k6 a: d8 v
mov es,ax
* @/ Q! G2 Y# o: b* R" |' i6 } mov bx, cs
( e4 h7 p/ |1 j lea dx, int41handler
6 n- B2 a: Y" [9 }. q5 E. s xchg dx, es:[41h*4]. ~% Y a$ N5 S+ \% r
xchg bx, es:[41h*4+2]6 R+ `! r% Z; V# e* C
in al, 40h, |4 J$ T0 O4 Q7 j
xor cx,cx
5 s% c6 ]- R! W! P- m, c* J& D int 41h5 \7 u% d6 a" X8 n/ B
xchg dx, es:[41h*4]
! G7 a. }% }+ p8 P& t xchg bx, es:[41h*4+2], p+ o5 u+ k9 T( B
cmp cl,al
- h; f) z( H4 _. } jnz SoftICE_detected
, E. x. ?# d' B# Y" |. |+ i# p/ T! y6 B4 u5 s% q3 T
_________________________________________________________________________$ q# u5 R; w: U Y* r$ n9 r) v
2 ~; T9 ]) _/ VMethod 074 _. i5 F6 u8 J8 W/ I2 K5 Q0 d
=========9 E& @! J( S" Z( s9 B7 |' B( |
# c9 t$ r. K' X( e" C* |; bMethod of detection of the WinICE handler in the int68h (V86)
4 J( K9 G5 ^5 _% K! F+ j6 b' A$ v V. o2 W6 ]6 U }- {* Z$ @& P
mov ah,43h, L8 P# m9 J$ a8 U! o Q
int 68h
+ U- a+ K1 W6 i6 v& Q# X# G cmp ax,0F386h4 o2 w' y4 V$ [! |
jz SoftICE_Detected
) w7 ]; p7 o' n/ i: C. l: h7 M
) D& Q/ _7 X/ w5 W4 _ C }& e6 L6 i% J6 E) K
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 x& U- I( {; z V app like this:8 `# A& z$ z3 d. ~: ~& E+ ]
+ u; l% A: z0 C4 F: p, q* D7 [6 ] BPX exec_int if ax==68+ ?: ]: d! k1 I9 W2 l. e& F7 x
(function called is located at byte ptr [ebp+1Dh] and client eip is% g' G( h8 ]) t8 N% K6 c7 |. j4 H
located at [ebp+48h] for 32Bit apps). n) ?* s2 E9 F9 C% M
__________________________________________________________________________% H7 @$ Q" C$ ^& O j/ x
. ^ ]- L& W. }* }6 X, k0 v3 l
* z1 } t. P: j4 t2 |
Method 083 L- {+ m) T) v! p" e w
=========
; {6 X) ?, r! b- u8 b7 X" T- f0 x+ Z
It is not a method of detection of SoftICE but a possibility to crash the! U# j+ P0 |3 x4 S8 b9 J
system by intercepting int 01h and int 03h and redirecting them to another
( w0 P/ @' @$ aroutine.5 z: D. ?1 R( I: E8 P7 R0 q7 O
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% }" y" [, B# A9 g6 i gto the new routine to execute (hangs computer...)) j/ M! R6 a' r6 W* Y# K( r5 f1 e- D
& c+ X' |. n1 {2 y; P+ G mov ah, 25h
! @4 I# k4 J3 E/ J) M. @, O. v mov al, Int_Number (01h or 03h)+ q& [ [" h2 h9 ]0 C# s; J y
mov dx, offset New_Int_Routine) W/ S1 b3 _- D: G+ t
int 21h6 Z* n2 h. M2 I0 O7 s! }
/ w6 B- |0 Q. s/ _7 U1 _
__________________________________________________________________________9 M4 H' i' @$ w7 [, U
8 q3 S' M4 Y8 x5 u- q$ L. X7 w4 WMethod 09
4 ^" H/ B- N0 g O( P/ s=========
9 v( t4 Z8 e9 ~" c
) C# q; I9 Z7 P4 ~; j, OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; m" P% _; D# C% _0 E9 o
performed in ring0 (VxD or a ring3 app using the VxdCall)./ g3 K+ @8 K- T2 o. }0 B' P2 x: y
The Get_DDB service is used to determine whether or not a VxD is installed
' S1 r2 b( ^5 t7 }/ @% V0 C0 C# B' @for the specified device and returns a Device Description Block (in ecx) for
- ~4 }/ o# G8 M6 Z3 othat device if it is installed.
1 `( s2 U# d& ]* l$ }
/ n$ o9 p/ c# |! z5 }" ] mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 e: E! Q+ q' p( D
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). t" y% x+ K4 G. J: y( q$ \; v
VMMCall Get_DDB9 N7 i% G8 \. U) u
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 R9 E$ M1 e7 N1 q0 Q) l
# L2 }3 W, g% Q1 ZNote as well that you can easily detect this method with SoftICE:; h# V l! v0 X+ q. K$ |
bpx Get_DDB if ax==0202 || ax==7a5fh8 g! \" Q7 Y9 T- }
# `* ^ s* R7 S5 j4 q( T9 n
__________________________________________________________________________
& H+ M ~0 F; c8 {7 N! Q3 @
( m1 _) N' }+ _Method 10
( g t5 Q9 R. K1 w=========
7 k* g v) }' x' O0 w$ S/ B
7 ?% a' b9 L) D/ A=>Disable or clear breakpoints before using this feature. DO NOT trace with( e1 [ B" ?8 C$ G* Z5 a9 j) W; V
SoftICE while the option is enable!!
2 I9 p6 O, y+ x$ X- }& |
6 K4 {6 H) Z2 T: W Q% SThis trick is very efficient:+ ?4 P$ J- T1 r2 }6 ?6 n
by checking the Debug Registers, you can detect if SoftICE is loaded
% z$ j/ b/ q: {! a% ~+ K1 v$ T5 v8 y(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
2 F9 \( w+ j0 ?0 w) j3 qthere are some memory breakpoints set (dr0 to dr3) simply by reading their [. Y( @( z0 w
value (in ring0 only). Values can be manipulated and or changed as well+ z, ?% Q+ ]2 r
(clearing BPMs for instance)
% f# E3 v: V( v( E- _# S% u& x9 |" k3 d. B( ?/ C* u, {
__________________________________________________________________________
/ w7 I2 F z5 Z/ t. A. t# M5 I
; I/ i/ h- q4 Y- b* }Method 11
3 P- H2 {7 f# m2 O; R f=========
/ T- [) E" k& W n4 A/ g6 ~: R) L X
! e2 P* e4 n. @- J* ?) FThis method is most known as 'MeltICE' because it has been freely distributed7 [0 w/ h) r u1 T1 D+ `, g
via www.winfiles.com. However it was first used by NuMega people to allow
4 h3 N7 W* H; j2 dSymbol Loader to check if SoftICE was active or not (the code is located( }: K+ \2 k$ r5 O( t' z
inside nmtrans.dll).& F" W+ r, z. G
- z5 ~, K3 l. t2 p$ \' k0 L
The way it works is very simple:
- N5 N# y A7 z# tIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- a U) w. s1 S% c/ W) r
WinNT) with the CreateFileA API.+ E" X$ v; G# I; S" q# {) ^
& v* b0 |" f3 ?0 d6 l+ P) d
Here is a sample (checking for 'SICE'):, y/ E( p3 ^' `
8 `, @* P- I/ h- C( r' T3 B
BOOL IsSoftIce95Loaded()
' y+ U( p- |- X- G: b{
- e6 q* \; O+ t1 L2 h HANDLE hFile;
- C: ]9 B% {3 O# B5 t/ z9 I hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, e# k* [* C6 ^' S# c; f) |" D FILE_SHARE_READ | FILE_SHARE_WRITE,
$ e; t( v2 N2 [5 T4 H NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 Y y3 L. J; t1 w
if( hFile != INVALID_HANDLE_VALUE )
4 D) y! U1 I, ^% d" L: N {) j" p- `! K a( Q" z
CloseHandle(hFile);$ n# B# _1 i! d$ R7 r1 C
return TRUE;$ q( z7 g8 P0 _ o" Y% Y) Y5 @
}
! X/ L8 Z, ~4 j- C* { return FALSE;
# K- G, `3 {5 n}4 i- K0 Y! Q& W6 M ?: o# Q0 b3 r
" I# N1 m( x# T" M; k
Although this trick calls the CreateFileA function, don't even expect to be
5 q" \8 t1 t" [# \% e: k; L0 r- table to intercept it by installing a IFS hook: it will not work, no way!
, p: ], B; b1 i! g$ }- q: A" pIn fact, after the call to CreateFileA it will get through VWIN32 0x001F o" `# G+ K9 L4 R( G$ h9 P) \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 T. K, @' l* e, f! u( b7 s! E$ g
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
# E; J8 `- j/ B. Cfield.5 m9 x/ a3 S/ H2 e6 u" r
In fact, its purpose is not to load/unload VxDs but only to send a " W1 a5 ^) `8 v J1 p; _ {- R
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
: c" W8 B. Y& \9 ?: |: rto the VxD Control_Dispatch proc (how the hell a shareware soft could try# _) q+ L5 Y4 j. ? D, S$ \% Y, C
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% }" U, v9 i4 a* ^1 ^# N" S$ E
If the VxD is loaded, it will always clear eax and the Carry flag to allow# Y \. z! l) d5 d
its handle to be opened and then, will be detected.
: r" J% l5 Y y! EYou can check that simply by hooking Winice.exe control proc entry point- U$ d. b- `; s" g4 c
while running MeltICE.
+ ~- S4 R# l8 V# }2 I( m
3 i! Y5 q- c- n
5 S: f0 U; H' N- f, H( Z 00401067: push 00402025 ; \\.\SICE
, M- D6 M" D# p/ }! i. N1 t 0040106C: call CreateFileA
1 _; |& i- C( w- j, @8 x 00401071: cmp eax,-001
e* |; P: T! T3 V0 E- ^+ |" \ 00401074: je 004010917 N) z# ~3 @: o; z$ L
1 T0 w* K2 T9 n3 w; b
$ v# W( s" J* t/ T1 U. _: J
There could be hundreds of BPX you could use to detect this trick.
8 m" c) }( k0 j3 q3 x, _-The most classical one is:7 L; `% J( E. t7 J: Z
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
6 r b( B/ u& f" X" ^9 }7 p4 s *(esp->4+4)=='NTIC') O' ]& K( q0 _0 e9 a
1 m$ K* ?/ L- m) I% g9 n-The most exotic ones (could be very slooooow :-(
, L' [1 `1 u, [$ j3 n BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ' Q! H" j. ] ^2 H
;will break 3 times :-(
& X( f+ c2 a$ B/ o9 M% R) ?3 s0 }' F, a* n
-or (a bit) faster: 3 F" Y: |4 D1 [) Q( s; n
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
4 y4 V; A) v9 T; l
- f+ T# S6 J6 w5 [/ Q BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
. v5 s' \: l) Z1 n( I0 R! \ J ;will break 3 times :-(
, _8 m, q3 {0 n/ j9 D* `& k! s* n& I/ h' @- m7 G
-Much faster:7 u& }/ c1 R1 }, j! c
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' |8 J4 _( l; z
8 ` U9 _* z+ ^* P9 R7 r: F- ?* jNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ E/ {& y) s: {: X) [6 z8 xfunction to do the same job:
, t5 _! i! c1 g" ^0 F M6 X9 D
: ]7 J# h7 ~% D push 00 ; OF_READ
6 d5 O' I4 z9 T+ ~6 I! h mov eax,[00656634] ; '\\.\SICE',0
5 V& @! k. S: w1 h' o ? push eax/ {$ ~! b6 a" q2 N7 @ w1 N6 b
call KERNEL32!_lopen( {' _4 m8 x4 b
inc eax2 Q( N8 J, ^- p# s: r# w
jnz 00650589 ; detected# D! f5 a5 x" B3 `
push 00 ; OF_READ; V. v) X! S) O
mov eax,[00656638] ; '\\.\SICE'
2 \' g# w8 M* g \5 |8 q @- Q push eax6 c3 R" D6 v/ P6 q! j7 N& J2 i# I
call KERNEL32!_lopen# z& @ L2 o1 g% q" N
inc eax/ P4 X" [7 j% f* e
jz 006505ae ; not detected" X# \2 @% f, i
+ ^* L) U6 t5 z7 y# b; A3 a
\. o7 g- U% K( v8 P$ e/ M8 `
__________________________________________________________________________" ]0 J6 F% K3 ~( i1 {1 q
+ T2 l! m4 v# _" U. TMethod 12
) q5 {( `3 G" b# F/ Y1 L=========& E: e" C: u. p: i, W
( O* I" ^7 o& L7 S1 D! R* b2 i
This trick is similar to int41h/4fh Debugger installation check (code 05
5 ~ s3 D0 U" d' J7 A! u; A$ q& 06) but very limited because it's only available for Win95/98 (not NT)
8 J% Y0 _; Q& e5 H! P& las it uses the VxDCall backdoor. This detection was found in Bleem Demo.1 Z. b, \. g3 w3 J, j& v
$ b3 J' C( \% _9 j
push 0000004fh ; function 4fh% T: |( \ K+ w9 a" i
push 002a002ah ; high word specifies which VxD (VWIN32)
$ J* Z( s- ` V& i* W2 s4 C ; low word specifies which service' I# Q* ?/ T" Q4 q) j' N8 f5 p
(VWIN32_Int41Dispatch)2 a$ o/ b: z- J& \3 _
call Kernel32!ORD_001 ; VxdCall
1 D/ n+ v4 B7 F cmp ax, 0f386h ; magic number returned by system debuggers
5 n; u' ^6 R# t7 j3 A* I, t, r jz SoftICE_detected/ `$ D* c4 o# n
4 [# s% y5 y/ l: o$ ?) U' FHere again, several ways to detect it:
( _. @8 K: c$ h, J
0 L0 l) C/ ^5 F2 w: v BPINT 41 if ax==4f
# D$ o8 b2 H7 @: U/ a- e; X* X1 ~5 u e7 [8 v! q
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one {8 f/ u( P) b0 v: a" Y% ]
/ P$ A6 D5 n/ e BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 B/ n& {% e1 o r5 f \4 ^1 \( ~6 Z1 p1 T$ k8 P; v! d
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
$ s" h6 b- P8 o8 v6 q+ y, E B7 f8 Z! s$ V2 Z5 ^8 S7 |
__________________________________________________________________________- _! q' h( I+ n* Y4 p c2 M' M) t
+ c: e& x2 [, }1 z9 O mMethod 13
% j1 R" F- M3 X8 o=========9 D5 l. R& c5 q6 u$ O0 ^
" k/ q& D, ~0 Y! i0 S. |Not a real method of detection, but a good way to know if SoftICE is$ E1 \: K; u$ d
installed on a computer and to locate its installation directory. x. S* Z; `/ V4 L9 I) C* H
It is used by few softs which access the following registry keys (usually #2) :
; ]5 H8 B' L5 O, ^6 p% x g/ C' f5 j/ `3 ?, P. ]$ M
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 ~0 Z' D! A9 v& Y
\Uninstall\SoftICE
. F* \7 `1 x* j6 X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 B6 M" M" Z; A7 \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
: n g( g: L+ _# |, o o$ G\App Paths\Loader32.Exe
' X+ N2 w3 a) Q
+ q" P$ j( w$ q4 d; }+ ~4 t; M, E0 y: e6 f' T. F6 Z
Note that some nasty apps could then erase all files from SoftICE directory' ~# D! D w9 Q/ S$ J# L8 m" P
(I faced that once :-(
; a9 Q8 Q; s! _
3 s% }! c- b& \- W; E# UUseful breakpoint to detect it:
* c8 a" `7 w$ e, B- Z
$ ^' O! O- F( J BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE') \+ R- L2 A7 w3 G ]% w2 D. h
+ L: N3 J8 R4 f4 o% b1 g) @
__________________________________________________________________________/ ~" s; Q$ a* ^3 U) p
0 N5 P# O, k* Y% i1 D+ `9 w& L4 `" f7 [$ C8 D% T
Method 14
* a2 d; g* j. @7 v' b' i=========
4 T8 l0 J0 L2 W& ~, x# p& o, z6 {- V" U! M
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose& f/ u3 G, @& L7 V3 I# ?
is to determines whether a debugger is running on your system (ring0 only).3 C; b& O( y L) ^2 R# \/ Q, n
2 x S( W$ P C9 s4 w. R
VMMCall Test_Debug_Installed
- q: u8 k$ r* ?* d$ ~ je not_installed4 ?! F' ?5 C0 t) m. h
" z# f4 W+ ?( r3 w; F: {0 `0 ^
This service just checks a flag.& ^. H, U# |- j8 ~: |2 K
</PRE></TD></TR></TBODY></TABLE> |