<TABLE width=500>( P; Q. l( g" D5 E; f# L5 T1 K
<TBODY>& r2 b0 D/ |7 w2 w; @' A. i/ p" X
<TR>
0 G, C, R0 k% B! Z$ w/ a<TD><PRE>Method 01 & f( R5 |0 J8 t% C( x
=========
~7 w b3 Y& u2 A0 K7 O& P6 p! `* {0 z7 E4 Y
This method of detection of SoftICE (as well as the following one) is
- \7 k/ \ {$ m9 x$ ^- Vused by the majority of packers/encryptors found on Internet.
( b1 x2 ?" a; v& A" ] {6 b0 EIt seeks the signature of BoundsChecker in SoftICE
- d2 p0 z: {+ {! f3 m& ]3 D, T
/ U+ \2 |7 W8 Q! U/ A$ [ mov ebp, 04243484Bh ; 'BCHK'
4 t+ Q9 o. b2 u4 p' e( @ mov ax, 04h5 P' o( B0 o5 J" K
int 3
* Z9 O u, F& y( \" l9 a% X cmp al,4
/ m0 ~# j' a- E9 k% }4 | jnz SoftICE_Detected
. K7 l. Z" |8 v r' D, F8 ^. {3 v* x
___________________________________________________________________________8 h+ I" L4 j8 @: n2 A
( M. e. S3 n8 W6 b
Method 02
* X3 {$ R6 ? G=========- u( V# K' {+ T: T9 D
. x; v; |) ? }* b% i
Still a method very much used (perhaps the most frequent one). It is used
% X6 ?, T+ r% O" S0 ?# p; zto get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 N( D( j% {: X; e
or execute SoftICE commands...
5 ]$ m- {9 B3 k1 A, w- V1 vIt is also used to crash SoftICE and to force it to execute any commands
0 c/ o9 |( c% X5 r(HBOOT...) :-(( ; n7 L. m7 a; |. j! a: K& w
/ W) Z8 \$ e0 ^Here is a quick description:
! g8 u& \0 r% H ?$ ^$ i0 M- V-AX = 0910h (Display string in SIce windows)! H# {& k* h( K7 }' w0 I' l
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
6 T m/ m5 i- V3 ^$ Y-AX = 0912h (Get breakpoint infos)
4 a9 G/ s% Z/ s( g-AX = 0913h (Set Sice breakpoints)
1 q: v3 S% N/ e) n7 i-AX = 0914h (Remove SIce breakoints)
. [0 L& A5 O+ i; j( B+ Z9 C% H, U9 U6 R. \+ H
Each time you'll meet this trick, you'll see:3 {, Z% V T% G/ Z
-SI = 4647h% _+ N' p) U8 x7 l
-DI = 4A4Dh
) T* i2 F4 L. |. r/ RWhich are the 'magic values' used by SoftIce.) H. Y) B0 {: b- I/ a' {
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.. {' K: [) x1 a O/ Y4 ~6 Z
- m7 E. Q, V* ?8 \, h; Y* p3 R2 m
Here is one example from the file "Haspinst.exe" which is the dongle HASP
/ O3 X* }" v) _/ L) f: cEnvelope utility use to protect DOS applications:' q- [1 ]* c) R; V3 o' U# |
5 X2 \5 w! m* u d# n) q7 V. l! S/ }1 }$ |2 ^
4C19:0095 MOV AX,0911 ; execute command.8 C' w6 q1 D W" v3 [* ~+ g
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" e' A5 B5 k. n. F5 X; T4C19:009A MOV SI,4647 ; 1st magic value.
3 p8 {# X# x% \4C19:009D MOV DI,4A4D ; 2nd magic value.& m7 w* }- Q5 F/ h9 C. N# E
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
, c. ^5 E% ~4 B7 S: c( h- x0 y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute) O: K; \+ I, k# J
4C19:00A4 INC CX
$ m; m+ I9 ^: F) z4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
2 e6 T) A& m, y/ }8 b' O4C19:00A8 JB 0095 ; 6 different commands.
" Q0 c6 J( A: J8 ]1 a4C19:00AA JMP 0002 ; Bad_Guy jmp back.
- c* Z7 N+ S j1 h3 _. U4C19:00AD MOV BX,SP ; Good_Guy go ahead :)( \% n1 e7 P3 h$ \% ?
8 \# v+ R# k" f
The program will execute 6 different SIce commands located at ds:dx, which# p, C& D- Z* ?. s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 t. \# P. ^7 A) M+ s0 r( w
* f ~. R7 H& D) j$ D8 K% W- K( m* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; S" F6 R8 L! \$ v+ a; z9 i
___________________________________________________________________________2 m) L( N0 P, d4 ~4 e/ ]
& u D/ T. ~5 o$ t- \
* ]* ?# R( s4 q$ P, z ?Method 034 P5 V+ b# Z; p# m
=========6 N7 [- h" Q" o$ x c
+ G# g' x7 c+ P9 x& a0 ]! E4 j
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! A5 G5 \1 s4 |9 J9 ]
(API Get entry point); o# e8 Y) [. c4 V5 I; D) _
# b4 X5 }# q v" ~4 d" @& R
* x3 d1 k% I0 N& ]$ J: `7 Q. ?9 `# T
xor di,di2 V, P5 j" K p) T2 s# K
mov es,di+ ]3 C; S) S8 }0 |2 s
mov ax, 1684h " W" U- Z3 _0 _$ c m8 u0 R; ]. B
mov bx, 0202h ; VxD ID of winice, d1 R. y; J: c/ `' u! c, a6 c
int 2Fh
0 v% K0 r$ G! h# W; a mov ax, es ; ES:DI -> VxD API entry point5 L1 x( Z; H$ f& u$ e ^) O9 d% E
add ax, di" ^9 J4 ~; l; F& D
test ax,ax' V1 ^1 [$ R) x' }0 E `
jnz SoftICE_Detected
9 d- G: @! s/ w, @* w) F5 a
3 T3 O& h- ?1 S___________________________________________________________________________7 f3 Y) {* N+ c$ C
; j1 Z- C& @! p1 C
Method 04
3 c5 U1 n, { w! K" d& U=========/ i- k! _; u/ \) T; X) }( M
, C9 E D$ m8 F: @1 r) K$ P6 X8 MMethod identical to the preceding one except that it seeks the ID of SoftICE
; N# A& K0 r9 h0 T6 r0 sGFX VxD.
! y4 v, d* f. o; f6 I+ S0 U. P3 @8 ^0 m
xor di,di
7 }0 j% \. B+ w- V( X/ \ mov es,di" v7 F. B2 {7 ~, U
mov ax, 1684h
# @/ w. f8 Y+ n mov bx, 7a5Fh ; VxD ID of SIWVID0 W+ w6 |1 X' s1 I8 |% k+ A
int 2fh& M; |$ U, Y* Y& d1 Q
mov ax, es ; ES:DI -> VxD API entry point$ B. k" P8 r1 z7 V/ j. E* r- h/ y# O
add ax, di
+ s) i2 U& y( X3 I( y' n1 U test ax,ax
6 Z# P I0 x& a0 u jnz SoftICE_Detected) d! W3 b1 s5 p; o
. ?1 d7 s7 C. ~( B8 O* C
__________________________________________________________________________" |$ F N: _: M" a
& W' E/ x4 h8 d$ H" o
+ O/ X* O% D6 U$ H# u0 O8 e0 y
Method 05" X& i; |* e. [3 L4 N
=========
. c* G) U2 o. |9 [' ]
; A2 R) P! L! \2 P" K1 jMethod seeking the 'magic number' 0F386h returned (in ax) by all system2 {1 q! m- e1 H8 B( G6 G
debugger. It calls the int 41h, function 4Fh.
/ a! V" P6 p" h8 ~There are several alternatives. F! a5 n& H) U) O1 L- A4 O* t
- `; O8 k9 b+ C) VThe following one is the simplest:
! J6 D L. m% g# w7 t3 z( K1 ]5 x* P) m8 M2 K2 A$ A
mov ax,4fh
! S% X' O; {: W3 ?- Y int 41h
$ r, _! x, M. v- Y0 L( I0 e cmp ax, 0F3867 _+ b( p8 u9 S2 q
jz SoftICE_detected
9 X. n* W+ H/ ` X( o
! R/ ~) F. k) G: F) Y- I* [% A# @( K" |* L# N( R" s- o) p
Next method as well as the following one are 2 examples from Stone's
8 u# e( e2 D4 C9 T, ]) c# \"stn-wid.zip" (www.cracking.net):. @ Z% I O( U @6 A* ^
! T# ]% P0 K- `) Q/ l# c- e mov bx, cs8 S' r9 J$ E% d v
lea dx, int41handler2, z# h) D, \( |* ?8 s1 N% b" u& l% X
xchg dx, es:[41h*4]
# A" z+ t% e+ `) ~; Q( e2 D0 t% B5 H xchg bx, es:[41h*4+2]2 @7 a, e7 w. f" [) V
mov ax,4fh4 n& I2 R$ D1 Z) u+ r$ }
int 41h/ Q) v8 H' f, `" D2 K. g# v
xchg dx, es:[41h*4]. c8 c5 ~" t& y" Y" p
xchg bx, es:[41h*4+2]" l5 P0 ?1 ]3 c
cmp ax, 0f386h& a4 z4 F. c" N3 L& @6 M0 S0 G9 C( J9 G
jz SoftICE_detected3 {: y m; M$ \4 e& }
7 i' D4 x3 w: Y, \3 y
int41handler2 PROC
9 ^( ]2 I* Y; B' {( E iret
. i: x5 w+ T( Iint41handler2 ENDP
" N6 i; k* d# z" X# U$ ~7 d2 ]$ t K; E
% {5 O0 b/ N" S
_________________________________________________________________________
! W ^* A# [" h0 Z" h& K0 u1 B% F: Y! [* v. ?) x0 D( ~
2 G6 o( m, |( |3 Z7 \7 d O
Method 06
% Z& e+ U) }- }: `! j=========5 D: `4 i# ?0 W# W
9 ~8 h- W( [+ I3 B+ }) q! n/ \
- o9 O, Z& w4 A! ?7 h3 p2nd method similar to the preceding one but more difficult to detect:, a0 V6 X0 }- U( {( I( K# o1 o, g* v
' L% Q' w# |" l3 u1 r% R; g7 O
X7 D2 v. E7 X& U
int41handler PROC
$ w8 q* a6 ~+ P5 a5 X- t( q mov cl,al5 C* v1 B. ~& d5 l7 }
iret$ w5 M% _0 E7 r, [5 @6 x- Z
int41handler ENDP
# X& m, l, n( q* ]' E' ~) g1 n l1 y- ^9 n9 H2 V t$ q& n6 f
" D/ Q* K- A0 |0 S xor ax,ax
3 Y1 E, G3 E! X# c* B mov es,ax; `7 e7 q2 y. E2 g# ]+ y6 G
mov bx, cs
5 J% c. U1 M8 D! p. s" F lea dx, int41handler
9 }$ r e; j( A" M: c& h5 z# x, B xchg dx, es:[41h*4]
( r& m/ i7 W+ a! B1 `" T2 c& b9 c xchg bx, es:[41h*4+2]$ S$ f# j/ X5 w( b5 P/ x' h
in al, 40h
4 a6 q4 @ w* n, m7 s xor cx,cx! ? |5 F# Q/ q/ T' E
int 41h
/ s8 t9 w* y8 ~) l( U xchg dx, es:[41h*4]* ~6 t# A, m& x E
xchg bx, es:[41h*4+2]
K6 n. [" @" [9 M cmp cl,al
! |6 _4 g) z+ K+ @ jnz SoftICE_detected6 H6 T, g: j# S: W
" \( ?+ [. K, F% P" _$ r- P_________________________________________________________________________
. \2 c' \! ~% m, r! H- _7 C9 M4 M) g" e( ^% ^
Method 07) p* r' X) h. u9 v
=========8 I" u: G+ L4 K( }9 a+ Z# L
' a0 l9 f" u4 ~9 B. M, V# v" K
Method of detection of the WinICE handler in the int68h (V86)
1 v) i. k* S1 l0 E# o& k" `* h6 h
/ a" X8 | ^) n, L mov ah,43h- Y' k3 Q7 h+ h- a% O) G1 }9 e
int 68h
2 }8 l' B9 ?% u/ a cmp ax,0F386h
4 S. ]6 e& C4 [! S I' c: t/ A jz SoftICE_Detected
: @$ }/ t9 \+ D
5 s% s' j, N2 i x; `9 j/ B# O$ n
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- H3 e- h# f& ~ l3 }) C: a0 N app like this:% | T0 c& N1 ^$ Z! M$ u- A
8 `* ^, q4 V8 G BPX exec_int if ax==684 }0 q) D3 [3 ~3 B8 A: ~3 m
(function called is located at byte ptr [ebp+1Dh] and client eip is
7 N& A9 K5 N; U4 F located at [ebp+48h] for 32Bit apps)8 s }) ]8 R& \
__________________________________________________________________________
" z. S5 Q2 W# V. u6 V! N V( B+ q% O7 b: A5 F8 r
8 C* G0 w. J% h; m4 h4 UMethod 08' o0 ^% ^. {# l3 U& ^! U9 V
=========9 n9 s P* x) X% F7 K7 c
; \0 z* E6 H: t% q
It is not a method of detection of SoftICE but a possibility to crash the
d+ N6 b6 q, A" {9 Vsystem by intercepting int 01h and int 03h and redirecting them to another
( e8 n5 b# K' U3 o) Y2 b' k0 jroutine.1 Q" }1 _: `3 E: g
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- j- o7 a( E+ C. p! y
to the new routine to execute (hangs computer...)
( e$ \( x3 V" B, v u2 r W
' T/ F5 ~/ f+ b# A1 \ mov ah, 25h0 K' v$ [" p" x0 e! z( x0 h
mov al, Int_Number (01h or 03h)
& n! Z7 ^* U0 E" K1 ?5 k mov dx, offset New_Int_Routine
2 E+ j0 h0 ~1 I. k0 D* e& I* P int 21h
2 f9 L4 I! ^1 C/ [& f) I
) d" [3 {& {. x" x) {__________________________________________________________________________
# x* {7 ^2 k* [6 Z( B/ o3 k/ ^4 T' X& P9 i; ]! L
Method 09# V& w3 t, e5 g
=========! f+ E& _0 @* E8 m5 e
3 Y# g1 W6 A6 ?" SThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only; K5 L: h* _4 s$ k9 O4 E0 c8 b
performed in ring0 (VxD or a ring3 app using the VxdCall).8 X% f3 {# A4 W2 b, e5 e
The Get_DDB service is used to determine whether or not a VxD is installed
7 F( x% ~, x& i7 i; xfor the specified device and returns a Device Description Block (in ecx) for
9 X' k& W8 T. b' T+ H" U! Tthat device if it is installed.
& D3 w* V7 Q, v- }1 R" u" D0 Z1 \$ C7 I9 J: a
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 r; |3 T6 X3 _) _( _
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
7 b" i$ j7 c9 O4 R+ ^1 Y9 ]3 k& i1 L VMMCall Get_DDB
3 ^( R) i7 T6 d4 v2 G |/ W2 }% P mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ K- j& X' K b+ M
- X1 p' ]$ r/ S' N4 u& y' BNote as well that you can easily detect this method with SoftICE:
; T# o# C& l5 Q2 f9 w9 D6 U bpx Get_DDB if ax==0202 || ax==7a5fh
9 w, h M. p9 c
) g- G, \' W( C* Y__________________________________________________________________________+ x1 l3 y: F# Q+ J* |
' M2 v$ s- X, q( m& qMethod 10/ j; u% H+ a1 m5 b+ ~6 t
=========. s. K, D- D! E& d# {" S h
/ @' E) J8 {% L
=>Disable or clear breakpoints before using this feature. DO NOT trace with
5 n4 J) H ]% S SoftICE while the option is enable!!
5 S: G5 S8 l: a- K4 |& [' O1 M; y# J; d" b
This trick is very efficient:
: s9 y) w0 g1 T* Vby checking the Debug Registers, you can detect if SoftICE is loaded+ e, h' H2 D* Y# i( {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 c1 C" q" \; R% g: Z6 y8 N
there are some memory breakpoints set (dr0 to dr3) simply by reading their
$ J0 s5 e, Z/ f ovalue (in ring0 only). Values can be manipulated and or changed as well
4 G- f. w g3 x7 i(clearing BPMs for instance)
) G9 M/ Y5 r+ J% A! j1 l6 {% N6 o2 e/ @/ T& s& J
__________________________________________________________________________
1 D7 v8 r% x% R7 K8 e" g% T' c8 Z7 N9 I3 K
Method 11
, T0 F) {* B' d=========
9 L8 v7 u7 M/ Y; h! H. I) h9 }' [2 j; X% R0 ]
This method is most known as 'MeltICE' because it has been freely distributed' _" X1 W" g; q& m: Z
via www.winfiles.com. However it was first used by NuMega people to allow
5 a% Q7 ?* N6 a, ?0 g' ESymbol Loader to check if SoftICE was active or not (the code is located) \# r8 T/ S( S6 C0 c; Q8 m
inside nmtrans.dll).9 @8 s/ |7 @0 g2 I I
}! p" r/ P( ^9 \- J. A; D! L! G
The way it works is very simple:6 a3 n3 Y: N8 K- x" t7 q8 u( V9 y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: b4 ]" d' ~# f& FWinNT) with the CreateFileA API.( G( f0 G, ?' j0 G5 u4 U
8 V; w+ z3 e) x' w; r6 T; P4 G
Here is a sample (checking for 'SICE'):! @( A0 G$ M. }: X
& S0 E. c" m1 r C! LBOOL IsSoftIce95Loaded()
4 `* v0 O# w X( p{* P) i) E/ L0 b3 m: H
HANDLE hFile;
4 P5 W: R' M5 T' B7 ~9 H' m4 X5 a hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) W5 N* ^$ D. e; H5 f
FILE_SHARE_READ | FILE_SHARE_WRITE,
5 f5 V! K! k# z0 I$ F0 q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3 c# F2 B. g& X) D7 P+ |, ` if( hFile != INVALID_HANDLE_VALUE ), i8 G9 w" L: c" `" r! e& {
{
, t1 S+ \- Y3 f' V' S CloseHandle(hFile);0 _; [) U- m5 S/ k( L* {
return TRUE;2 G$ V9 R: j' i; R" I0 A( S m
}
e& m2 f, A8 | return FALSE;' H b* Y( @; X3 R) q
}2 J+ Z7 r( p9 G, y/ s+ ^- \- {
0 T% a9 @# f2 D0 `4 h: sAlthough this trick calls the CreateFileA function, don't even expect to be
; T1 _' p* g( Dable to intercept it by installing a IFS hook: it will not work, no way!
# ~9 I1 A" Y0 W1 kIn fact, after the call to CreateFileA it will get through VWIN32 0x001F/ S* j, u0 |! f5 w$ s4 G
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! Z4 x* t! x! g& rand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 S, k" n0 b* N
field.6 b$ ]2 I, E1 f2 c. H# b
In fact, its purpose is not to load/unload VxDs but only to send a 9 v6 B) o. w" f# }3 l
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 d7 O) @2 N9 N5 n8 w( H3 k- t: r# w) uto the VxD Control_Dispatch proc (how the hell a shareware soft could try- i M2 q' g* u# W% E: o5 Q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ A5 j6 I, ^5 C% G7 kIf the VxD is loaded, it will always clear eax and the Carry flag to allow) C# P# o8 w) v {( o" x
its handle to be opened and then, will be detected." I, r+ I; d% u: K$ _, ]7 O; W
You can check that simply by hooking Winice.exe control proc entry point% q9 \: v5 t+ C8 O6 ^; b
while running MeltICE.
; `0 j5 T8 n" w4 `5 I3 Y" i# |% |' ^$ \8 j. X# _
, `( C+ z( K1 ~0 F3 i! @! E 00401067: push 00402025 ; \\.\SICE
8 ], [' f3 J; r: W 0040106C: call CreateFileA
" X! ?4 Y# h+ Z, \ 00401071: cmp eax,-001! C. X: }' V- ]
00401074: je 00401091! y: g+ ?# C1 l M/ o
7 n6 n4 G2 f. [/ M [( e9 m) Y: L
# Q m# v! p+ n6 b4 `4 b
There could be hundreds of BPX you could use to detect this trick.9 S0 l' N% o0 ]2 H4 W$ t. C
-The most classical one is:
. f; K" ~* t7 v* Y2 T! d BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 W+ W# G8 r8 c, s6 f) e+ ?
*(esp->4+4)=='NTIC'+ n, q* \ E* V' b3 a; L! }
; y* | t/ S# e& t# L7 e: V-The most exotic ones (could be very slooooow :-(9 _( U% N* R- G1 v
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') + q$ [" o+ T$ T# S- C
;will break 3 times :-(
: r4 c" r/ x( r; G4 B6 e6 H4 k' z6 o, f6 }7 ^* M2 h+ ^
-or (a bit) faster:
i2 P+ k, t9 r) M0 y1 Z5 m6 ~& b8 @: w BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- M4 x& {+ w# y8 ]! P- i( E; N- u/ c3 ?0 v% n: k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' " j) k( ^* T6 ]) u
;will break 3 times :-(
2 W/ T2 h3 G! \2 K1 g% ]
4 d/ s; x: ^9 h c4 U, y! b-Much faster:4 U( g; v" P- C, d" S, g n% i+ d
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 i6 q. C$ V0 N8 U" g; K8 O) J" Y
3 o# Y" Y7 O- f3 h
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) K1 l9 z0 C4 I# s6 w, s% J6 w
function to do the same job:6 Y- \+ D( w* M" D, y j
% x' D- B0 W8 r& ^. t$ k% b
push 00 ; OF_READ! j5 v4 r9 ?5 J4 d, @2 o
mov eax,[00656634] ; '\\.\SICE',0# ?5 r! I0 e7 a. a0 |* M5 o8 u6 a
push eax
) f, R8 b; m' V6 ~* i* g, p! { call KERNEL32!_lopen
0 T- \4 g O! l0 X8 Z5 d inc eax
* J/ ~. ?! C; s/ U& k) T jnz 00650589 ; detected
9 i% _6 B, ~. \ push 00 ; OF_READ
+ ]# q! h ~0 U/ _; b; z mov eax,[00656638] ; '\\.\SICE': N8 n" E. B }' k
push eax
0 w' B) v0 ?' _ call KERNEL32!_lopen6 R8 B- {5 g b7 ^4 c
inc eax4 p9 T) w5 E, S4 J& V! [
jz 006505ae ; not detected
7 s, ^- m8 e" p. s) s4 F! }
* G% [! r# c* ^" z) c8 ~5 v) I
__________________________________________________________________________
* [0 F9 v8 c' f- ~3 W5 Z% Y% R2 F6 M" F1 V$ Y7 {1 L
Method 124 N& Z1 Q: ]/ _' K, d
=========8 O6 U( X0 ?9 B( F* @
9 y. m5 H/ E& m5 T- g- \This trick is similar to int41h/4fh Debugger installation check (code 05
" o' U/ A1 e& e( X! |' d$ f) Z2 i& 06) but very limited because it's only available for Win95/98 (not NT)
/ z6 E% ]% T+ {5 D1 D* M& h8 T/ }- ~as it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 S2 a1 q! v G: U$ a: P" |
4 x& K5 a" |( X* A/ i push 0000004fh ; function 4fh) Y" C0 X4 A+ _; D! X9 w
push 002a002ah ; high word specifies which VxD (VWIN32)
( t6 u3 Z! M( V+ u0 t ; low word specifies which service& R6 F U4 q# |; w% n2 k9 I
(VWIN32_Int41Dispatch)
* t5 Z$ |2 {. \7 Y' N call Kernel32!ORD_001 ; VxdCall
- Q! M/ B( ~0 y* g cmp ax, 0f386h ; magic number returned by system debuggers
1 S+ E: G) L' w9 b, P jz SoftICE_detected
% G4 ^5 _5 n7 ^! D* h; E+ i7 V+ i# k0 J8 `1 h3 u
Here again, several ways to detect it:2 N/ n7 V9 U- O7 O9 w) z
. R$ Q. S" W! a' f- ]1 W
BPINT 41 if ax==4f% t5 O8 o. B5 l
. `; {. l% N4 G! c BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one9 Y: S, C- @5 w7 S; i1 L) W
) R. ^) e/ Y7 `. H9 r4 E BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
$ x/ Z. |- D$ m3 |: Z6 Z$ l1 ^9 [. K0 I
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
$ b/ F3 w+ A% W
$ `9 R5 m0 ~" D8 p8 D* k__________________________________________________________________________
4 D: K5 q7 ]9 I4 Y9 Z
K ^0 J# }/ J! p" z3 IMethod 13
0 @6 l* g( k# Q A5 \$ Q; k# G' Z=========
& a& [) c3 D5 t6 U6 S7 J. r, n& c" W! t/ y/ X9 Y- F |- i' }6 [( ?- D
Not a real method of detection, but a good way to know if SoftICE is6 k* X) b4 j2 }1 Z
installed on a computer and to locate its installation directory.6 a; H6 Z# @5 F; S
It is used by few softs which access the following registry keys (usually #2) :; q5 s% |/ g ]" k
o5 j! E1 O, y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ S% q5 G3 @ U
\Uninstall\SoftICE+ w1 `: Z. U" F* `4 Y+ e
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% X; J0 j$ m+ R8 I
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! L3 _3 F) E0 F/ W* U5 P4 Z
\App Paths\Loader32.Exe) d: Y9 [( \$ v9 l# N+ W4 b
9 M" F, T& L; M4 `2 o
" f+ r+ m1 a! X4 r7 eNote that some nasty apps could then erase all files from SoftICE directory
2 R2 i" A1 t) W9 ]$ P& u(I faced that once :-(9 H( |* E9 A- z v
+ {" H4 g$ s! Y
Useful breakpoint to detect it:- S5 n) X- ?" N' J6 N
, F+ r8 C" m3 R8 n
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
* Y1 G- `! K, Y! K
' i; |& Q9 C: w) t6 b5 X: U__________________________________________________________________________
2 |* ^2 W, y7 I8 d2 ?/ _+ l- s8 E. z/ `
R$ i8 b# x( G* zMethod 14 , w6 q/ J9 K! k' g; L
=========
, w- Y2 M8 s4 E& _9 u: Y1 P: H$ S1 i2 L+ l: ?! d
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* M: Y5 q8 Z. w2 \! E. Q6 Xis to determines whether a debugger is running on your system (ring0 only).
$ n0 ^( O* v" w1 a( ~8 W1 T' j: d) H4 e$ d7 E* f% b, h+ \
VMMCall Test_Debug_Installed5 [( n0 }6 ]2 s9 u2 w4 m
je not_installed2 L' e5 V3 k7 n( w- d2 R$ U
3 t9 ^( h6 V3 s YThis service just checks a flag./ i$ K% I7 w! V! K" o3 m
</PRE></TD></TR></TBODY></TABLE> |