<TABLE width=500>: v6 m8 N" v2 Q2 n C0 a2 Q# m
<TBODY>
6 }2 M3 M' m" g8 ^, d<TR>
9 o* v* f4 O5 P6 h; P3 |<TD><PRE>Method 01
- K* S( p+ S+ p& V/ y/ D3 _=========
. ~4 `2 R+ S' y
% K t1 O" f* f' U; C MThis method of detection of SoftICE (as well as the following one) is
' X/ g: ?! t2 A6 p1 q0 Dused by the majority of packers/encryptors found on Internet., T5 v- W. K4 b8 p3 A! S
It seeks the signature of BoundsChecker in SoftICE
$ w4 j6 i4 g3 h5 L( W r# E6 }# e+ V, ]- g( g
mov ebp, 04243484Bh ; 'BCHK', o2 S0 S; Z. q* w
mov ax, 04h
6 v6 n0 i( ], t& L int 3 # D2 D% s; m6 l: i
cmp al,4
$ W. @) A B6 B6 r jnz SoftICE_Detected+ _' D. h7 t" S
# f- d. B5 g1 w1 a___________________________________________________________________________
( w5 ]8 D( u. s: }# }" X9 I
) t5 B6 Q* |* Q6 X D5 ~2 JMethod 026 ^4 w6 c5 P: M$ P. Y0 ~
=========6 |; i: |6 B% y& n
" K( l* c8 Y% A9 Y2 I$ S. [Still a method very much used (perhaps the most frequent one). It is used9 C V. m( Z7 I6 u! |4 v9 s
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,6 z. S9 f9 m8 _( `: i! p! Z
or execute SoftICE commands...# e! N5 m# v3 J
It is also used to crash SoftICE and to force it to execute any commands5 W; M* L# k) {" X4 M4 k/ M2 t
(HBOOT...) :-(( 0 |) r- E. u; M# B
: G4 q0 R) B8 j9 J' w: EHere is a quick description:) N V1 g& Z5 a# a/ O$ ?
-AX = 0910h (Display string in SIce windows)
$ Q m, h* ^, ?; k2 R# D-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)" g2 ?! g7 b, y
-AX = 0912h (Get breakpoint infos). ~( [& F7 c& w3 L
-AX = 0913h (Set Sice breakpoints)* c9 ~/ n& E( T2 w" s
-AX = 0914h (Remove SIce breakoints)6 S1 _) C5 N- x ^9 i+ e/ G0 f
" j( H- P0 l: g5 c. ^+ P% K9 a: C* ?
Each time you'll meet this trick, you'll see:! ` H) Q. D, F8 e
-SI = 4647h
n) v, G! o: o m4 g-DI = 4A4Dh
5 ~$ Y' e: X1 m! k+ AWhich are the 'magic values' used by SoftIce.4 O9 o+ V- w4 h) B
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
) g' \: S* R0 g `2 x
8 Y5 K% q) s# g/ |1 y0 H3 kHere is one example from the file "Haspinst.exe" which is the dongle HASP
; g) e$ a( E# a: WEnvelope utility use to protect DOS applications:, n" Y; J7 B7 L1 e" k, |
$ ^+ K# a; j% m' q4 F1 a" Z$ F) ? \1 T$ o8 p0 f* G
4C19:0095 MOV AX,0911 ; execute command.
' i4 v1 P5 Q ]4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). Y$ W4 w2 [9 \. F
4C19:009A MOV SI,4647 ; 1st magic value.
- V2 [- A3 z/ {2 Q+ E1 P4C19:009D MOV DI,4A4D ; 2nd magic value.$ a3 d, _ X) I5 u
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. R1 B; T+ L v- o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
. v% [, y9 J7 V+ `9 S* H, p4C19:00A4 INC CX
3 O6 [4 o4 I& k* _" x% w4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
0 x3 M8 K( H! Q8 x) p4C19:00A8 JB 0095 ; 6 different commands.
2 x3 \2 }6 p( U8 `% P) }3 x4C19:00AA JMP 0002 ; Bad_Guy jmp back.
/ R8 }' j9 C. w) ]3 l3 V; \4C19:00AD MOV BX,SP ; Good_Guy go ahead :), V! N& d0 ~' G' ^5 z
. n7 S& R, ?% c# ^+ d" k4 A P' @The program will execute 6 different SIce commands located at ds:dx, which. K: \0 U9 d6 B; x4 z% S
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ `3 }) |7 l0 ?- m. ]- {1 D
/ U9 [2 l. P: x! J$ i2 N* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.9 {$ n; k- a$ W+ V2 F
___________________________________________________________________________
$ r( E4 g- X8 S! [
0 Y0 ^" f) P3 m' o* `* x. Q: Q% c
Method 03
" Q5 M% c; W% C/ y=========) \) H2 v- U; S; J
, N& r O/ n& k3 {Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' ]9 R& H# F9 i) o+ G0 _(API Get entry point)* u' H9 N$ Q8 s5 C
}3 Y7 ^+ e/ [- }- E) H- V' T1 [
, Y# y# L: }" ^ xor di,di/ Q: F9 I! X6 @4 s- p
mov es,di
1 n9 ~/ j5 a7 J+ Q9 ]& C# T mov ax, 1684h " V+ c; ^" L/ a3 m2 w% F* O, G
mov bx, 0202h ; VxD ID of winice& U; }3 @- W( _) ~* i
int 2Fh8 F# r4 v0 G- O* P
mov ax, es ; ES:DI -> VxD API entry point
( c8 Q# l; F8 g" f4 B1 | add ax, di
9 [* Q7 z" G' V- H# e+ W0 C test ax,ax: b- X$ F, {0 \# g' E$ L" X
jnz SoftICE_Detected
( O$ K+ g7 [1 u, {' w3 B! Q3 e) D3 \5 m6 R: t9 L" B* A
___________________________________________________________________________* Q$ o" b2 P* R+ ?; [. h# M6 k
+ y: |- q3 M0 D( N9 p
Method 04
7 P H# ?( w5 d' @=========+ w' a% J; r8 q: ~( q
6 R) N- A7 H H( n i y' Y
Method identical to the preceding one except that it seeks the ID of SoftICE
0 n4 i$ _- q; g, a1 AGFX VxD. e, E6 N5 M# @( { z1 k
$ |( W' L! a. q7 h
xor di,di
7 a; f" X) z5 {6 Q mov es,di
1 d+ Y( Z6 q- ~7 L4 y0 U% Q mov ax, 1684h , _! F) }- Y! S9 D Y1 g
mov bx, 7a5Fh ; VxD ID of SIWVID* \. K3 D4 v1 N* W J
int 2fh; J8 f. [# Z* i) B% q7 d0 L
mov ax, es ; ES:DI -> VxD API entry point
, P0 e5 c3 D2 p+ v' `/ b0 m6 X5 g add ax, di
: Q. @5 D( H; _/ B O' e s0 R test ax,ax
+ ~2 o) H" ~+ A0 c5 Q: I5 t jnz SoftICE_Detected4 C+ u$ ^) M' X Q- K
9 z7 u# k9 C/ n8 P+ Y5 \
__________________________________________________________________________
* o1 \- P5 }" y& m
# ~6 G7 S: T l. g/ f2 b4 x$ z! t! B" Y5 X& Q( E+ o
Method 050 C8 G1 S' p- X
=========4 | o& ?6 [+ n0 j, E# p
# o( L1 T3 W- V4 e
Method seeking the 'magic number' 0F386h returned (in ax) by all system, s( A3 N( o4 }& B( {' Q, d% Y/ T
debugger. It calls the int 41h, function 4Fh.
! Z: e9 R/ b5 r, E5 XThere are several alternatives. : u2 b0 m; U0 y! s" p0 |
{9 m% ]& [+ [9 ]The following one is the simplest: N6 j/ J6 n# M
- j! I6 T; i$ R8 D7 K: G5 r
mov ax,4fh
5 ~% I7 J' b) Y4 `" Q& B) F2 A int 41h* \( X4 H) }* D/ {9 m% h0 Z' h& J
cmp ax, 0F3868 g2 T8 g' \: u3 E; }( Y. u) D1 H
jz SoftICE_detected( d$ v) ?6 g$ G& M4 h
9 d# r U" {( D& z, I; j$ o
+ L: p; V' B/ ^/ l# u6 s$ VNext method as well as the following one are 2 examples from Stone's
+ K; m+ {9 B! g, L3 I"stn-wid.zip" (www.cracking.net):
0 p' ?9 a3 m- f- b" D9 a, {# U Z, q' X( v! W& a$ S5 R) n2 Y
mov bx, cs" q8 @8 j' w8 b, U8 y( @/ \
lea dx, int41handler2
9 P6 H. y; q( m xchg dx, es:[41h*4]
M R; a9 K: a; s" G4 o xchg bx, es:[41h*4+2]
& m7 C* \4 x# }& a" J. D mov ax,4fh+ I$ Q) M+ d& z" y8 Y+ c' E
int 41h
7 A# F& D5 }; C) Q: r y$ X xchg dx, es:[41h*4]# a" C9 Z4 c" U7 h0 Q# u6 Q0 L
xchg bx, es:[41h*4+2]
! Y; L# g7 |, ^ cmp ax, 0f386h$ \ b y* |9 v E: P& T8 P
jz SoftICE_detected
- V, Z2 \7 W5 e( G% q2 k) z9 d. c0 V
int41handler2 PROC
( \3 _7 z0 s7 G: }( S5 m9 ? iret+ a8 _2 _/ | G; Z7 {) O$ y5 B
int41handler2 ENDP
5 s: T- {2 i/ T9 P# J$ Q3 J6 o- p v% @, U2 I7 n9 N+ ?
- F9 E' O6 \7 M+ B& \' E
_________________________________________________________________________8 q! K/ \1 l4 y( C- ?9 j! W) d
* O: l5 F) q* \* Z& P8 D* \0 z) z( i$ I4 @ a
Method 06
2 i( E! W$ k* w=========! A2 {) E: x b0 Y. {" `
( I+ B+ O% B4 Z
8 P. \, e: \, j
2nd method similar to the preceding one but more difficult to detect:
7 d- V9 C# c/ Y% \3 S. V
$ q# v7 S, @: l7 g; b/ H& r* G
2 r6 b. r0 U+ Zint41handler PROC- N0 l K9 `" ^" c2 C2 z! x* G
mov cl,al; a7 B. l( a; j* g0 D
iret" t# T3 _0 R% S x2 k$ q# R& J& J
int41handler ENDP' s# G3 l' v+ a8 I5 ~& F
: I$ E, y! ~9 J7 F+ S
2 Y, c5 |/ h( H xor ax,ax
0 ~/ V+ x0 `" j7 K) ~ mov es,ax1 K- O1 S+ t* }9 L" c
mov bx, cs$ j c- B0 }5 n% d* O1 L
lea dx, int41handler0 Z4 o5 e& _$ ?" |# ?
xchg dx, es:[41h*4]/ ~& e- y* c- F7 S0 Q* c
xchg bx, es:[41h*4+2]9 ?8 k" \, {9 ?/ f9 }5 L
in al, 40h
4 M4 R7 ~" K+ j1 k. ^, o xor cx,cx
0 P- C1 _1 L8 j3 A int 41h
5 |7 Q. F2 } z. o4 }) D5 r& @ xchg dx, es:[41h*4]
- }' v7 B/ H7 B6 x7 W xchg bx, es:[41h*4+2]
8 b! P9 Y ]$ E1 e; b# S cmp cl,al& K4 Y: G0 I4 z% t
jnz SoftICE_detected
; y/ k% s1 V- P) j$ D7 t! V( [( F9 |& t+ R) P" I
_________________________________________________________________________
& o1 g5 Y6 C2 T5 _, T3 M I3 B1 j; S1 S( H7 l# F
Method 07' G. j m+ _: T# g5 G; s
=========
: s8 j' @9 M, `: H$ f/ w. n0 u( q8 S' _6 H/ w
Method of detection of the WinICE handler in the int68h (V86)
$ Q9 m/ i" Q' Z+ K- Z+ E7 |; T
9 w" o7 k2 a( ?: g1 n mov ah,43h
/ e1 P3 \+ k, z int 68h
& R; P+ {8 R' L# F2 [ x cmp ax,0F386h
6 R) e' `7 C0 L* \ jz SoftICE_Detected
+ N) d( @5 J9 t8 `' q- b9 C* t) T$ ~& R+ E% S
7 i; f, c ]$ b=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# I( W; X& A) g& @) H
app like this:
' Z6 s- T {( q B
) k8 O9 `+ l0 D: J) j- z9 { BPX exec_int if ax==68
+ t$ z# \& A; O% s! o1 Y) _ (function called is located at byte ptr [ebp+1Dh] and client eip is
; s! A& w& D- f8 b* Q% M# `' M located at [ebp+48h] for 32Bit apps)
* a% S5 D; W2 @ [__________________________________________________________________________, s1 {# ~# m: i6 s0 B
' f2 t' }3 L, N5 A& e. R* O' s- l7 p* \ H
Method 08) G* F' e% ]0 C- }, i4 O
=========) k4 n: i+ z! P1 Z- W* U* ~" x! e
6 F: G8 f# ^- A, T8 [3 W8 G* IIt is not a method of detection of SoftICE but a possibility to crash the
. n3 z- ~, E+ b1 W- `system by intercepting int 01h and int 03h and redirecting them to another
. n. L/ R! B, G0 M. @- _routine.
/ Z/ B) f8 z, t- H* J3 I' SIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
i% x& ~ C {, w5 nto the new routine to execute (hangs computer...)
! F1 B, x0 m, k; o. ]' B+ y
l4 B% L+ F) k, J! o# f# p0 q mov ah, 25h
, m3 |# `4 D: R" f mov al, Int_Number (01h or 03h). {. Y. u! y8 ]6 |5 S( k; Z8 n
mov dx, offset New_Int_Routine- B. G; z: _) v0 D, G& `
int 21h+ D( y3 L8 [. Y/ Z( ]# ^4 F" i3 _6 ~
8 k6 N) c$ k) N. l/ w. ^# P__________________________________________________________________________
+ Q8 ~# n7 a( [' k1 C- V# q" U$ z5 X: k/ A
Method 09
" Q. |/ ^; Z$ N% N! ?$ ]: g=========
+ H; S- W( E+ q3 }) Y5 q& [$ I X+ b) G/ B: v* U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only1 B: S2 _+ D8 I9 c2 C% F: Y
performed in ring0 (VxD or a ring3 app using the VxdCall)., W- }% T+ c/ d- s
The Get_DDB service is used to determine whether or not a VxD is installed
! E, |# ~; d" K( J/ g# Hfor the specified device and returns a Device Description Block (in ecx) for
9 _) K5 P& F- I% ^: q" W+ {9 M6 mthat device if it is installed.
7 s# \, d: W# |5 l% v0 s1 u- I6 c: l4 e
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
! p/ i+ w% h5 ]/ g( j mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
, o4 d* {' ~4 m6 F' o' Y! V' R3 E; M VMMCall Get_DDB- l6 i( j9 q' }8 N! U+ D
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' L. U+ R3 x/ a
: _. ]* Y$ |" v5 a
Note as well that you can easily detect this method with SoftICE:
! U# L% m1 l5 b; ^4 v+ @1 V bpx Get_DDB if ax==0202 || ax==7a5fh
% N& p" h0 C/ W; G1 I8 w
* z. E5 C# A4 k__________________________________________________________________________
7 z2 w9 s; i- t0 M! C6 }$ X
- p; o, `1 M2 \3 o6 lMethod 10
2 M# W. B$ V+ c1 D=========. I9 C% H9 ]& w% Y5 H
/ C( v4 z2 G$ o# z0 }- @+ K! I, A=>Disable or clear breakpoints before using this feature. DO NOT trace with
7 \- e4 T5 R" n( ^4 P( K SoftICE while the option is enable!!
# ~4 {1 H* N9 j# L% l2 y" n+ r
; m3 x; e) i' M$ o" R/ GThis trick is very efficient:
- C) }" {5 p" h+ J, M6 }by checking the Debug Registers, you can detect if SoftICE is loaded
- L* m( P, p. u& P(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( J$ |/ O( |" o3 V' \! B% G
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 b0 X; }, c) E
value (in ring0 only). Values can be manipulated and or changed as well
+ a* G7 P1 T& ~. \9 x(clearing BPMs for instance)9 A; L0 X2 z( K- t' U' d
5 e1 \) B/ F. G. I
__________________________________________________________________________0 m$ [% K3 v. O% f' T
& c% u! }& r& l( e2 O
Method 11
8 T" Z E! Q8 T& W: n0 A3 B=========5 t& _% D% W( O/ d
2 {9 h: i$ R+ qThis method is most known as 'MeltICE' because it has been freely distributed2 J0 E5 x' [* E7 w) `1 s( i
via www.winfiles.com. However it was first used by NuMega people to allow
$ ^, i* V# V- s' U3 X# q' {( k3 |" KSymbol Loader to check if SoftICE was active or not (the code is located X$ ^0 n" G4 s6 `
inside nmtrans.dll).$ l0 h( [ P9 r* L
' }( y" l% L$ H2 o8 `6 mThe way it works is very simple:
8 p' V* {' g3 p) E& YIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 M# C- E, f0 } R" f8 mWinNT) with the CreateFileA API.: ?7 F% ?6 C* ^& ~! K$ g
: ^% K* a5 S. r3 c* X9 \
Here is a sample (checking for 'SICE'):# ?0 ^1 N" T! `' ~
# G5 l1 g3 N) k' y2 S; g
BOOL IsSoftIce95Loaded()& ?& Q7 v! u" V3 }
{
# l4 r8 i2 F" l' P/ s r HANDLE hFile;
+ J. P% z* q& y4 o$ H" {5 c- v hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 T0 a3 K, A. [
FILE_SHARE_READ | FILE_SHARE_WRITE,4 C$ h7 w+ R. a2 V6 k! {
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 S! A7 ^0 Y1 G
if( hFile != INVALID_HANDLE_VALUE )- l1 s n8 p' A$ C" U3 C7 {
{
) h3 t' Z$ | v7 }8 @* D CloseHandle(hFile);
8 H4 s( k* e3 K# L return TRUE;: l. Q2 ^: B* y% n4 Z5 }. F
}# q% I0 e X# R7 N
return FALSE;5 ~. p* U5 A, [' m) k* ~4 t# B+ s
}" L4 }9 x! L! T5 R, \: B
, K3 I, g( E% g( t8 T) KAlthough this trick calls the CreateFileA function, don't even expect to be% d; E7 R8 l# m! |# E
able to intercept it by installing a IFS hook: it will not work, no way!+ z5 z& _! |) n! C
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
# c& e7 c$ p9 y ~# A* o$ Z8 ^) Pservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' f# t3 \. O) }( `2 F. w8 N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc7 x" ]4 t0 B7 U: q
field.; b( i o3 d/ E& a/ \
In fact, its purpose is not to load/unload VxDs but only to send a
3 x [& I% e/ x# Z. D3 d1 eW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) R; o4 C( @# _; T+ Oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
& T/ ]4 A4 m8 K; W4 _' O# _; p9 |to load/unload a non-dynamically loadable driver such as SoftICE ;-)." p1 H+ r+ E, I" \, f
If the VxD is loaded, it will always clear eax and the Carry flag to allow: g' N0 D4 Z# O! J* E3 y
its handle to be opened and then, will be detected.
. L( x% s3 f, _4 B! K CYou can check that simply by hooking Winice.exe control proc entry point+ M% O$ _ X1 c h- x
while running MeltICE.) Y" j& @# K1 z/ K
5 O4 e) W" G9 D6 S9 N8 O. J
, K9 X/ l7 ^) h9 J, i5 B) }& b, p 00401067: push 00402025 ; \\.\SICE
) d0 v1 X3 C3 M$ o; a& d 0040106C: call CreateFileA) o0 S; ~8 w' y$ J2 E e% x. v
00401071: cmp eax,-001 W2 X0 l3 Z: _$ o$ W4 d) ]
00401074: je 00401091* a8 n1 U$ R" f: y r- P+ M3 r3 M
u9 c3 L* t) G4 V$ K/ q5 ?% b
- b. g" ~$ }2 ?% Y: ?1 oThere could be hundreds of BPX you could use to detect this trick.6 A' |' s. S( Q. ~" P
-The most classical one is:0 d% |* _ y2 B- f- b7 N. ~0 U/ r
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||7 }, h" }+ A- Q0 v
*(esp->4+4)=='NTIC'
: _# O2 d, U( o7 I7 x9 m" Z
, }# [4 U i" ^ F% W9 U. x) m-The most exotic ones (could be very slooooow :-(" E0 d, t) K B1 E
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 j( x! B }5 z- b ;will break 3 times :-(
; H g# x, n; o1 s/ g
4 c" Y! x A! u3 C4 Y! S9 ~( [-or (a bit) faster:
* f5 M; v1 i6 T7 b1 v6 B BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): z( \& @2 G4 y/ v' A/ m
^- E/ t) D$ y7 W; b# M" m1 P BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 5 D/ U7 b* d' m" l
;will break 3 times :-(
! }' P7 a2 `! C. X" t/ R) o7 j+ A
: X* z; ]6 q9 ?; q3 [$ f8 k$ w-Much faster:
9 |9 @( a1 Z0 Y+ @' M5 D3 U2 ] BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
- m A; Z- D) l- |2 U, e. G: L# P, p' t" K5 ^! t2 `. w: [+ e
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
4 e8 v/ F% d% l* p8 b2 afunction to do the same job:
6 w" v8 K6 T1 W" q3 o
6 X% B _0 Y U push 00 ; OF_READ
# n$ k6 X( f, O mov eax,[00656634] ; '\\.\SICE',0 p) N D8 l# h; ?( z
push eax
1 Q6 f2 l4 K# f, r( j! } call KERNEL32!_lopen$ L3 n/ I& x9 l5 o
inc eax9 Z: T' ^. _/ [. a' X1 n
jnz 00650589 ; detected0 [8 v+ W& y2 x# _8 _* {" `+ K
push 00 ; OF_READ3 G. v9 H+ L7 F. q
mov eax,[00656638] ; '\\.\SICE'& m- A, U* `' T. G7 s5 B# ~
push eax
9 `; O; ]9 k* ]' O+ ] call KERNEL32!_lopen* z5 p+ Q, t8 ~; i8 A
inc eax
9 n' U( w: U r jz 006505ae ; not detected$ [6 e l- B4 w4 C
4 ^: G! Q& u3 P4 K& o, @
! Q/ Y, R( N# h__________________________________________________________________________
9 w& t; P2 R; u: n; \+ y+ b
2 C6 N* r D6 y; J* @1 ^/ uMethod 12
/ a. N1 m& X7 Q=========
; M, C& A8 D( i: c$ t) E9 A& H# b( B0 w. K: [- L
This trick is similar to int41h/4fh Debugger installation check (code 05
! \* e K9 E; H4 M6 @& 06) but very limited because it's only available for Win95/98 (not NT)
3 J/ ]7 a" I+ l+ ~! c# Vas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
4 y; G6 T% F6 D' a8 L# W* c
: J0 d% V/ I- |% x5 _ push 0000004fh ; function 4fh
7 k/ l( ?. p- @. s4 q push 002a002ah ; high word specifies which VxD (VWIN32), H, j) ?; f0 \ K" S0 E1 e
; low word specifies which service
" @; u* B, W9 x- z( G% C! o (VWIN32_Int41Dispatch)
# Y" [6 O5 }8 h6 {, u2 o call Kernel32!ORD_001 ; VxdCall
7 H7 H! s: w9 `3 r' e, U cmp ax, 0f386h ; magic number returned by system debuggers) ?7 C) ]2 z1 L/ `
jz SoftICE_detected
: B5 S' D! s0 r, f; I* ^8 s. B5 S
Here again, several ways to detect it:
) h! m, p% r! s% n) Q( q
# w9 d' O4 T0 Z* C BPINT 41 if ax==4f
; c% } K4 _/ k( D) |
8 ?4 Q4 V/ Y2 x+ z' Q7 _ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 @! i5 n0 s, J9 Z/ A# I" c; a1 E- Y' W
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A q! j8 ]: y$ h7 F! V! S* s# C% q' t
9 X; ]* O* c0 M! V- T/ H* H+ F0 O
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. p% i; D( O$ D
1 Y2 A+ c! Q, Y; f- y__________________________________________________________________________6 N' i8 K2 N9 S+ ]
$ m- Q6 m: v" f9 O& i' g0 |2 G
Method 13
- _& {# p* I( y- p( ~=========% {; `- Z( g. E4 N' q. I
0 O _% e8 i% M% T: @! @Not a real method of detection, but a good way to know if SoftICE is2 }) C' b' f& ]4 P1 O* k$ P
installed on a computer and to locate its installation directory.1 B- g7 b5 _% w" d/ b
It is used by few softs which access the following registry keys (usually #2) :
& J' m( j( A6 }; X+ P5 e) R3 A T; `+ r1 X5 v0 A" r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) W' `" q) F; h& [) O1 b2 R- l0 V\Uninstall\SoftICE
& c+ x& y8 T/ P4 E- E9 q-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( l2 t: Y5 T& G3 A& q3 o
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ O o) T9 d- w0 O2 v# a\App Paths\Loader32.Exe8 `, h/ `3 {0 f2 w5 N
* E- P+ `9 b+ r
% q5 K$ P: |) A" nNote that some nasty apps could then erase all files from SoftICE directory
( E6 E0 J6 ^! d5 ~. F; j5 i(I faced that once :-(( L& r* Z8 h9 j3 F
@, o; G# r6 P7 a/ s5 U. U& X5 }
Useful breakpoint to detect it:1 M3 u" G3 U4 ]
7 O X+ z ]7 U BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'! \7 F8 y# S3 r; p
" W8 M% w$ U# R3 a__________________________________________________________________________
! R9 e8 U9 V. M1 b+ A0 z6 p9 b+ N f: P- @$ H$ ~: T9 Q# \
, t# V) L) i+ qMethod 14
5 ~* q8 l5 ^; w8 j=========
" k& F* H. G, U% ?% [
# k% D! z0 }* ?' N* `9 ~( {A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ @! g/ ]& h' Q5 D8 Q* y
is to determines whether a debugger is running on your system (ring0 only). _& g. ?# S: Z
. K6 l& W7 U+ }- ~) x
VMMCall Test_Debug_Installed
+ t7 e, X; L9 K0 }% |7 K7 ^ je not_installed6 Y4 M4 g* G' b! U; j
5 V8 |$ y# i* _, E( S: mThis service just checks a flag.
$ R& i' z& ~. r* e" y# F</PRE></TD></TR></TBODY></TABLE> |