<TABLE width=500>+ P9 M' \* a7 U; y4 @8 B! l
<TBODY> Y$ V( ?& G* N- D$ ~0 `2 {4 l- X
<TR>
% j% v# m3 O9 s$ V# b: s/ \<TD><PRE>Method 01
7 Y Z8 b0 j2 R! g=========3 s1 O( i( i) t9 [# l* i
1 A$ ~5 Y5 _* a( m' A3 x- V, yThis method of detection of SoftICE (as well as the following one) is
- e+ ^; @0 p# m' s8 @( f8 ?6 hused by the majority of packers/encryptors found on Internet./ x/ A' e- n) M" ?+ X7 V& e8 ]
It seeks the signature of BoundsChecker in SoftICE, ?, v7 C# ^; s- s( _' v# v
8 N7 D/ ^9 \6 R, y: A6 { mov ebp, 04243484Bh ; 'BCHK'- q, q& N- x/ [
mov ax, 04h
' C: u5 v) r4 u. _ i2 e# \+ S# V9 m: { int 3 ; ?# r. N) n% D# y/ J. J$ D
cmp al,4 F! v- c2 x2 h$ G& p/ h
jnz SoftICE_Detected) y0 d+ }: I5 g, [' v& R! j( q$ D
' q/ ?& j/ X9 ^' Q6 I' a# z___________________________________________________________________________
3 ?9 N2 f5 n6 _* G) V# L% ~" Q) y1 C; Z
Method 02
% e! `) w! s% x' ]4 n, f$ T& H=========. ~( T4 X3 D5 @* V8 l) k4 Q9 f) j
! i' I' l F7 v) c- N% }% {
Still a method very much used (perhaps the most frequent one). It is used& A6 z' X+ A) r
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; L* D4 R. `: H
or execute SoftICE commands...( @. w4 g e: J
It is also used to crash SoftICE and to force it to execute any commands
+ r. I, q6 ^ P; I(HBOOT...) :-(( 6 @$ y4 J. E; C" X% K+ M
/ O; z" o5 i/ A$ [
Here is a quick description:7 T/ m4 o$ q& J" K4 Y
-AX = 0910h (Display string in SIce windows)( {+ T4 D- ^: ~/ f% X- Q, i+ N+ E
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
( K! E- }8 g6 `8 K( S-AX = 0912h (Get breakpoint infos)% u g- s- Q2 o1 u
-AX = 0913h (Set Sice breakpoints)& z' [8 f) W+ |9 E, `1 y
-AX = 0914h (Remove SIce breakoints)
4 A" M7 t2 x; W# L( }! x7 k6 M7 T% g) J
Each time you'll meet this trick, you'll see:
! f" P; i9 k4 r/ K-SI = 4647h
6 P# E7 O$ J; \-DI = 4A4Dh
. o! e$ i. M7 c" s6 {& d- XWhich are the 'magic values' used by SoftIce.9 o% F+ s/ n9 V2 f' e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, S! s) Y5 f; ~
" x( N" R* a8 VHere is one example from the file "Haspinst.exe" which is the dongle HASP+ R, r d4 r( s0 ~1 m9 x+ i0 u3 t) M
Envelope utility use to protect DOS applications:
$ r4 D3 Y% o h8 {
( K: r9 H- F4 E" c
+ W& n& w$ ?/ q4 E6 C: @4C19:0095 MOV AX,0911 ; execute command.
; F- u% t h& M" C4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 ~0 i$ L! Y/ f }' `% J
4C19:009A MOV SI,4647 ; 1st magic value.
1 \3 G8 P- o4 \4C19:009D MOV DI,4A4D ; 2nd magic value.
% B- |- ^5 ]; `% p5 r7 f4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 o7 o- z+ s8 {9 ?+ [2 ?4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
( {" t1 |6 S$ t3 M/ S6 |, c8 {, s7 W4C19:00A4 INC CX! Z- F$ J5 v( o/ |' }! h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
% `3 F4 n$ R. N4C19:00A8 JB 0095 ; 6 different commands.
7 j; s6 F: G! `2 d1 l2 Q4C19:00AA JMP 0002 ; Bad_Guy jmp back.
5 L( S; X5 c/ O4C19:00AD MOV BX,SP ; Good_Guy go ahead :): @/ v( U) i9 c2 Z, Z" x/ d8 t
' p/ ?4 v% i: |! `9 sThe program will execute 6 different SIce commands located at ds:dx, which
9 ]9 Y: l9 v; w1 ?" yare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 E9 L+ ~& u! M1 B' z ?+ J
! {& b3 ?. @* C3 c, x: P* k* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.- t6 U5 y% h6 n4 _' `. O
___________________________________________________________________________0 o8 l7 z2 j6 U. d+ L
0 P" `5 _/ L7 S0 {2 ]- G! B
( s8 L0 j0 a/ C, ?+ T6 BMethod 03$ Y6 R' f! {: q3 b% _- u& v
=========6 J2 w" z5 W) ?" {$ }: p( ^
4 @0 v7 t/ W& H# y/ xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
( o: w9 k+ `2 }0 [(API Get entry point)3 n2 E/ x8 F4 e0 v* z
" e" M6 ^8 [4 O) _( Q3 y: B) R+ b$ ^$ p/ v5 R
xor di,di
& @3 ~4 ^: x9 M* ^ f, k! n0 Z% l3 P mov es,di$ w& q; D2 {0 K' ]' g$ u, {2 U
mov ax, 1684h & k/ ^, x2 z" Y
mov bx, 0202h ; VxD ID of winice
2 D6 c8 r: v3 a) G8 k; D9 r/ W2 T$ ] int 2Fh
5 d5 q, s; T6 P! G3 b mov ax, es ; ES:DI -> VxD API entry point
" L- Q2 E8 w' i y# j/ v add ax, di6 F4 [ [8 R: }4 M
test ax,ax6 z1 P7 h1 ?- u; T! E+ z' w, @: \
jnz SoftICE_Detected2 f. J f" x& w% }* `. ]: u
( }( T9 k* h# x___________________________________________________________________________% g* g2 E& B1 |7 J6 {- K! a2 }* g- Z
8 G9 P" l4 L, ` w# l. F2 R9 O6 UMethod 04
! i1 D; j5 h/ L/ b: c$ L=========$ N# c5 q$ ~+ y2 O
" Z4 C' X8 u5 c) wMethod identical to the preceding one except that it seeks the ID of SoftICE1 J8 d6 R4 Z( }0 q
GFX VxD.
9 I8 j- ^4 V' f" I( F. X% z3 X2 e' Y b; X5 k
xor di,di
" f/ h- \$ z, E9 ~ mov es,di
. i# F. L4 Y0 x$ | mov ax, 1684h $ A7 _2 _$ Y f3 h' N
mov bx, 7a5Fh ; VxD ID of SIWVID
' I4 y# e9 y( l0 E! o2 f int 2fh
- [3 p4 S5 P, J2 S! L- X, d4 ]# N mov ax, es ; ES:DI -> VxD API entry point
( n5 a c* O' A9 J- z6 H add ax, di+ W. V" e8 a/ K
test ax,ax
! i+ v2 d2 n- w6 r. u, u- m3 h, N jnz SoftICE_Detected
3 G0 H& \/ x/ @/ P- C# T
$ f1 O$ O, ~* m" T% p4 ]__________________________________________________________________________
* n8 D6 w/ n# F' V
% c# I# x% T$ j% M. r- L( K, J8 _. r0 S# H( Q4 q6 D- f) f
Method 05; w" z4 W- b3 }/ O1 X
=========
2 P2 L: n' u7 _, {/ e
- E2 B) T0 `: d, c, q IMethod seeking the 'magic number' 0F386h returned (in ax) by all system
7 L4 s; G$ q3 K# ]) @5 b5 kdebugger. It calls the int 41h, function 4Fh.8 h; E9 l; f% ]) P" S
There are several alternatives.
' Z# ]/ w. ^4 R9 S
2 P; d3 ]* o- \/ Q1 BThe following one is the simplest:
8 }* \9 P. e# [) V# e4 G
8 j8 Q! O' z+ w0 z8 d7 z mov ax,4fh" u# q& _: q& d2 t4 b
int 41h
- x9 }. t' z+ X, p cmp ax, 0F386
2 f [) J% y$ z( l0 E8 o6 O jz SoftICE_detected, T# _' k" t/ V/ j6 D9 o
" S$ I* O3 I, F4 z
$ A' [7 X9 m- b
Next method as well as the following one are 2 examples from Stone's . N7 _7 c$ b6 [1 F! F+ Q/ H
"stn-wid.zip" (www.cracking.net):' [- T. v9 Q! W- v- K
- s, f6 y4 o# I" l& M5 Q
mov bx, cs
z: C5 V! j/ N lea dx, int41handler2+ Z! ~/ B2 g% V- ?1 Y# r; y, W$ Z: u
xchg dx, es:[41h*4]% S; m0 e/ y* M& \7 w. C2 Y. [
xchg bx, es:[41h*4+2]) V& B, G9 a) ]8 W8 N+ y4 |
mov ax,4fh
3 D% O1 P$ ]/ y* i int 41h5 W! Z- g" c2 z
xchg dx, es:[41h*4]
( [$ V. h% z8 Z# Z. `- t4 a2 D xchg bx, es:[41h*4+2]
8 y* m0 m7 y: b- X cmp ax, 0f386h! g. G) \3 \! N- _1 e8 s; z& T
jz SoftICE_detected/ r6 l0 ^* O. M' k! \
5 L! N0 f- O6 j% p& u- ^int41handler2 PROC
, }+ G( ~- R3 ^/ [+ H iret
: Y, ^5 ?- {$ C/ r) H5 `# Mint41handler2 ENDP
2 ]# {+ ]: p3 f) x
- A1 M8 Q, w. L- R
$ u: @+ s6 s0 |' w$ L; e. Z_________________________________________________________________________4 W1 o: c# v" r( ^* c$ R
! m6 e3 u' G* m2 ]' s
( [, C- d, `) f" _- a
Method 06- m9 @) T' U" J( C) C4 o, ~$ u8 X
=========
- ?: g) O' l% o5 R
) N! j) m n( o$ C! C) x4 `5 t5 V" ^, _9 H
2nd method similar to the preceding one but more difficult to detect:7 x4 q. w7 z# X" R/ E: g1 s
( o1 Z. a/ H& Y& @9 ?; W) b
; {* a' D, c9 Q7 u* z2 Z8 d
int41handler PROC
) b, i' b' i4 C mov cl,al
. X) S( y. Q* N! P2 \ iret
# ^0 A4 Z3 ]7 r! Pint41handler ENDP2 Q, N4 \# Z5 ^2 g6 h) k5 B: M
( ^ e" a/ d$ |3 {% R# \/ y% J4 t8 u
xor ax,ax5 J1 c% _; n& P7 o4 W
mov es,ax; G9 M9 t! k( h* i) E# o* u
mov bx, cs
' B# I, l' l; ~9 n/ c- b lea dx, int41handler
! X0 m6 M( d. t& @ xchg dx, es:[41h*4]; k$ n7 M' D2 x( w! j( h% K6 Y
xchg bx, es:[41h*4+2]
! T: y6 V1 L5 Y+ x/ a( _ in al, 40h# i# I& D' J- X$ w* P
xor cx,cx
' F& r" q c* R# O. I int 41h
& n) x0 f2 ]/ |2 b4 \. N xchg dx, es:[41h*4]
+ g3 ^" `2 n$ D9 }$ W* n, [ xchg bx, es:[41h*4+2]% f9 Q0 n1 V+ }# `
cmp cl,al
1 o; |. V/ M$ C jnz SoftICE_detected
+ M" L& M" \5 f4 s" p* B' a! v
, L* e& S; V+ }- N3 {_________________________________________________________________________% E* Q: T0 M. I4 t4 b/ I' R( A
, z i( n& g+ K
Method 07" i- \2 Z* F8 d0 M& @# o
=========. l, | b1 N& F9 s5 Q
! x2 \- \# a8 B% h; Q1 V
Method of detection of the WinICE handler in the int68h (V86)
5 N1 B. a' |$ ?, b w' d
5 `7 T4 C: V$ h: w: v mov ah,43h7 z; }; ~' P% e% G* r
int 68h! f( }/ s! j1 A. B2 U- @
cmp ax,0F386h3 o0 d, E( V! E- G8 f5 N
jz SoftICE_Detected- S- ~+ z5 Y1 f1 V+ c# J
6 Z) }( X$ t2 @9 ?0 W% E9 R
. l/ A2 u K! Q" f* ^' ?9 d=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* C' T6 T8 L/ c9 c" h app like this:& @; X8 p0 \$ D
4 ?& |4 F1 r& b5 }9 \. |, b& @/ J
BPX exec_int if ax==68. A: R8 R9 H0 K* y; U
(function called is located at byte ptr [ebp+1Dh] and client eip is
6 J: m2 T+ _* i0 | located at [ebp+48h] for 32Bit apps)5 Q( a' c q# T0 h; `
__________________________________________________________________________
& G, C$ \% G& p, {6 {2 `
# W% `) z: x) ?3 ^. r* i2 x5 n
3 p2 G+ x% W; }5 O' gMethod 084 |* v$ s" j7 e2 v5 {. d1 F" p) o
=========/ y) @7 K( P4 b& c
) S% t1 V& p8 I5 \4 X. V1 |- e5 `( v
It is not a method of detection of SoftICE but a possibility to crash the
2 W7 O8 w: d# tsystem by intercepting int 01h and int 03h and redirecting them to another. |" U4 p3 _5 _2 j) {* \
routine.
1 Y' M' G n* `8 |/ `It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 o: W$ ?1 A6 _* h% {! c' _4 p3 |to the new routine to execute (hangs computer...)
0 a2 M1 _/ \* w* u3 @7 W0 Y7 b% `8 m1 m: ~ n: H+ X3 |. E3 \
mov ah, 25h% m) Z9 c6 u4 d9 ?# y
mov al, Int_Number (01h or 03h)
1 [+ [& m, L# O; P: e; }* N+ j+ A mov dx, offset New_Int_Routine
" B* a3 c3 E" T# `& G6 B int 21h# ^8 e* r6 S! q* [/ }
$ m2 W4 s: z4 E7 u9 [8 v. `
__________________________________________________________________________
f: G+ B" p3 u; @
. W6 q* W5 d" v; _, cMethod 09
& T' l& F8 A* L" R1 f d=========
3 S: R# d1 P- r o) Q8 E5 u" x% [3 ?% Z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only9 `# J/ a" U: d2 ~: _$ @
performed in ring0 (VxD or a ring3 app using the VxdCall).
/ ~ g3 l |8 OThe Get_DDB service is used to determine whether or not a VxD is installed4 z! M8 j; }9 O7 U
for the specified device and returns a Device Description Block (in ecx) for
' h; ?+ W0 T! h' Q' `6 R2 tthat device if it is installed.* c* g5 K, S1 c# \2 p4 j M
, J( a) I! h% f: V' k( S+ ^) N6 k# f mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) y4 t A% v; G* e) C) x n mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 _8 {- i" o' j: x! d; s3 o+ i7 ? VMMCall Get_DDB' X0 y5 b) ~9 J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed+ D& X+ q6 J5 p, g
+ I. D8 T( v$ [; x" t) \2 ^; b
Note as well that you can easily detect this method with SoftICE:
# a/ H/ d6 R1 r8 A* `! W3 A7 ` bpx Get_DDB if ax==0202 || ax==7a5fh
4 ~* b; G5 _7 p: J+ x+ t; ^
5 r7 z4 D; _4 z& M3 o+ v+ {# D__________________________________________________________________________1 b; w" _2 n2 _) g/ P9 k
, j1 T$ e6 P3 u+ g2 y6 j8 a6 ]
Method 10
1 B4 L6 V% r: K) g1 b5 ]8 W=========
1 p5 ?, g3 ^6 P
7 q9 z. I' |+ H* g/ V=>Disable or clear breakpoints before using this feature. DO NOT trace with
J7 \: a: M5 u& p+ t- Q( `5 ]' |: ^) r SoftICE while the option is enable!!
: i% z/ C# R1 [5 s! y1 {
- }/ ?6 G( t3 Z4 VThis trick is very efficient:7 ~' k% }2 B* U) s) h0 Z
by checking the Debug Registers, you can detect if SoftICE is loaded
9 g( l% N* [9 {8 I. d! p(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
. l# I2 D$ C" J: L6 {there are some memory breakpoints set (dr0 to dr3) simply by reading their& V" n$ ]+ Q( `) C+ o4 d
value (in ring0 only). Values can be manipulated and or changed as well
' v# Y5 ]* d6 r- G(clearing BPMs for instance)
0 h- C5 f; ^5 H! i5 R) {9 I% E' D. q0 Y! d
__________________________________________________________________________. ^& _4 ~- W5 ~. D. F2 Q
3 w2 b& Z, w- \; l: X1 t# g! DMethod 11* O5 u0 r# \# e6 w: o
=========
- x4 K4 C6 T" U6 b, R0 z( ~( {
This method is most known as 'MeltICE' because it has been freely distributed3 D. G2 q- _! _ @7 z, w
via www.winfiles.com. However it was first used by NuMega people to allow9 O2 k8 Y0 `8 y2 l6 A! m" h
Symbol Loader to check if SoftICE was active or not (the code is located! v; d( G* B+ A
inside nmtrans.dll).( J) W( x% g, A' C4 P3 {: Y# @
; A, O: @! j# `# \
The way it works is very simple:. {0 ~' k2 X. O: Q5 \3 V
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! y4 O2 b* @4 m' }& }WinNT) with the CreateFileA API.
2 Y! ^, H! y& ~/ a4 P( m/ j8 _6 J+ g# D0 q- V
Here is a sample (checking for 'SICE'):
/ q1 u! j, g- m- v& Y' C& g) G4 k* U. k
BOOL IsSoftIce95Loaded()0 F) }+ x1 A8 g& |* H
{
4 `8 D! H$ `0 | E# E3 z HANDLE hFile; ( J% @3 Y) ~; q- a9 A
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
. L* {2 _6 l' D; n5 }1 i0 c, R q FILE_SHARE_READ | FILE_SHARE_WRITE,
3 {/ X6 f+ K' p D% w NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
* o: o6 k8 p. y8 n if( hFile != INVALID_HANDLE_VALUE )
7 K! ]2 j5 }9 [* W, x4 T3 N4 U {
' f" I5 G' P3 W0 d2 a CloseHandle(hFile);, G% N! Z: N, G! c, W
return TRUE;- w) J8 k. c0 Y, _% N% J
}. J5 f8 G; I; E. v( I) n/ C3 l
return FALSE;5 [. A0 m* Q3 {8 Y* P" Y
}
. L0 K4 M, p0 @7 W7 d; _, n9 u4 v: [7 F% I" |
Although this trick calls the CreateFileA function, don't even expect to be
7 U3 s* k$ p! I1 \7 \able to intercept it by installing a IFS hook: it will not work, no way!
3 b* T7 _' r# w5 j/ ?In fact, after the call to CreateFileA it will get through VWIN32 0x001F" N/ ^2 ^* v5 N8 a0 G% F! X
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% x, D# V! v- H" ~5 w1 Q% t& j
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( K: I% A- {6 J6 O: `/ E* z- i
field.' W+ a% K- t1 O" `( `" L
In fact, its purpose is not to load/unload VxDs but only to send a # }7 M' H7 `) H" Q
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)" {% q6 F e3 z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try& `/ n- d5 c6 h; [7 C. B4 t
to load/unload a non-dynamically loadable driver such as SoftICE ;-).% [/ {7 A/ f% o
If the VxD is loaded, it will always clear eax and the Carry flag to allow
* b8 A3 a* G) {) L Q" Pits handle to be opened and then, will be detected.
1 I e: S0 l3 o% lYou can check that simply by hooking Winice.exe control proc entry point. H: C F7 b5 t, ~
while running MeltICE.
2 \; R8 l4 v) L* a2 a) R5 L# S9 o A2 q
% o3 w: ?) W* T } 00401067: push 00402025 ; \\.\SICE
8 ^$ u/ y8 K2 \, m/ M& f2 ?& u 0040106C: call CreateFileA' h0 A( H s; i: f c0 a
00401071: cmp eax,-001
, I7 @& K; A8 [8 ]; o 00401074: je 004010910 @2 m9 p# ]+ G- e0 O. q
$ J9 b4 Y: G9 ^- @/ r9 S) ^1 `
* R' {3 x6 g, DThere could be hundreds of BPX you could use to detect this trick.
. v$ `; @6 I d9 I9 J' t$ P-The most classical one is:: e. U- T% r( C1 p) Z- N9 q% z5 o
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||. A0 E; H7 [5 Y0 U" G
*(esp->4+4)=='NTIC'
; a# t3 D5 P- `$ a4 L3 S$ C) E" }: c8 |
-The most exotic ones (could be very slooooow :-(
! S$ E8 Q- z) d4 }, l- F9 j/ I BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
7 h& V4 B/ X# ]/ z W6 R! f4 R ;will break 3 times :-(/ u0 h4 C; y' U, E+ ?
& ]3 P6 l3 h' a, m! M* c2 z2 I
-or (a bit) faster:
! c( v y! |- |" m/ R0 `6 c1 H# X4 k BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). ?: [( A) ]3 I- Y
# a v- V3 T1 N; `' o! k BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
: j9 u+ Q1 E: Q+ E: u ;will break 3 times :-(/ \# n% i( i O; m) p
6 x* h, z0 ^* i
-Much faster:$ |# I/ _( Z# ~# H' s
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 y8 y8 `& n$ |* C
Y4 N% [: x. t2 FNote also that some programs (like AZPR3.00) use de old 16-bit _lopen* Y) b- D: n* S7 v
function to do the same job:' u; u/ t3 D# `0 S: k
, i' C- {8 k* V. N/ D
push 00 ; OF_READ
( Z3 J6 l& B6 y- ~4 y$ A mov eax,[00656634] ; '\\.\SICE',0
- T) b; p$ S+ X3 K push eax
! e8 U, Q( b" p9 z, I! V call KERNEL32!_lopen. D; `: W2 i0 S7 g+ S1 i K6 n
inc eax) i5 C: e2 U" w, `" d/ Z V
jnz 00650589 ; detected
' G7 ~: |# P4 O% K push 00 ; OF_READ- B9 O: X6 X1 j7 l- l
mov eax,[00656638] ; '\\.\SICE'6 J3 r6 p2 ?% E# o2 A( f5 Y) x
push eax; U5 q. l C& N- O. Z, N5 g8 e ?
call KERNEL32!_lopen; ], N3 O( O _1 }0 b" V
inc eax
: Q- F+ [# V2 y' C+ C1 Q/ C jz 006505ae ; not detected
2 P4 S4 M7 `! s1 W7 C$ o- h0 k
+ F* _ ~* X+ W* G o9 t9 a+ Z `+ y0 @* T9 q
__________________________________________________________________________
. ]0 t. g1 ?2 T* T8 K
& V! a! S. a I" F# cMethod 12$ R% h! m) X+ N, b' }9 X0 `
=========
* V* z0 `' Q0 z$ |* q6 o7 |
$ T5 B6 |: f! v; i) _. S# IThis trick is similar to int41h/4fh Debugger installation check (code 05, ~3 d4 A! v1 C% V! p# L) k
& 06) but very limited because it's only available for Win95/98 (not NT)) J! g. `) ~; _% Q3 \0 m1 _
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.3 L+ K% ]! t5 F4 u m
' V" n* k4 \& c0 S$ o3 F push 0000004fh ; function 4fh
' K2 J8 p, p! i9 T$ @( S push 002a002ah ; high word specifies which VxD (VWIN32)
B$ K9 F0 Z" Y9 ?) d& Z/ k ; low word specifies which service
# e) u: R$ `4 e. b6 O/ j (VWIN32_Int41Dispatch)9 X; {: R- s* }$ A
call Kernel32!ORD_001 ; VxdCall7 j+ F" [9 R5 }6 k+ K
cmp ax, 0f386h ; magic number returned by system debuggers, |" `' O# s; J- u
jz SoftICE_detected
+ X" x8 E5 v5 ?7 ~3 ]* K/ X# Z/ e6 c% W/ d2 |
Here again, several ways to detect it:
$ J; [3 d; f+ M J+ O# M: F/ U/ p M: o% a0 ?% h6 n
BPINT 41 if ax==4f o) c8 d7 I0 t* m; L2 v
+ M3 w! f4 z) w BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
o/ N! O3 ^( |, j4 K1 o# P6 s: m* b! V/ t1 c$ I3 |
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A- \; I; |- ^. D. j) Z& o
9 O2 _* p7 }% }/ V5 m3 v BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( z8 k2 Y! c' u, u! D: O5 P, [
7 V6 z+ g4 x: O+ q# ]/ z; I
__________________________________________________________________________2 x) P% S( A( m
, ]/ u% n/ Z+ h/ |Method 13
- O ^: f3 ?: V* \, l; q# r6 g=========
$ b6 k: h0 k- y6 @) ?
& `5 m2 v3 t2 B7 o2 B$ h1 ?- m! ]Not a real method of detection, but a good way to know if SoftICE is/ d0 _; P5 j8 Y- a! R
installed on a computer and to locate its installation directory.1 m7 V& p& {, Y
It is used by few softs which access the following registry keys (usually #2) :
* n( t+ F8 _9 m: ?* `# J/ v9 `- f: B1 @/ A
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ R! K6 p6 c+ a9 e
\Uninstall\SoftICE" h' ]7 `9 [8 ^
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! U' {9 X3 [- r0 w
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 {% L: b% L |9 F0 W% w\App Paths\Loader32.Exe c" i) o4 {) q/ U0 f0 g
, T& R! Y c+ a2 F% p8 C3 D
7 E8 M& s1 g& n1 ~6 V1 r) `6 X; ANote that some nasty apps could then erase all files from SoftICE directory
4 J/ j" K9 N: A; F: t(I faced that once :-(
) p) P6 F4 l) h% @$ @; m( W; x3 h# d& T, a. v
Useful breakpoint to detect it:( K" T4 a/ d- l! {
4 |$ u0 t4 s9 y, G8 k2 L9 a BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 L3 B" S% Y3 G. ?. x4 T, F+ {
+ B. d# k( Y+ A' H! c4 G( W$ l% l& ^__________________________________________________________________________
9 y6 i: b. e# L
) A2 ~7 y2 Z. N, z7 C3 W! L) _) V% u; i' Y
Method 14 ' y8 ?2 A. W2 D" q. T
=========! W3 X4 ?7 X4 r1 n( A
" Y7 q2 I6 S% H3 Z
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose# Q# v8 b& f. h& G) u; G! }3 z+ {% D
is to determines whether a debugger is running on your system (ring0 only).5 N- o- p1 y/ b( q* {
+ }5 d, g2 T2 @' z
VMMCall Test_Debug_Installed2 }/ r% F( K7 \* |( E1 Y8 }
je not_installed' t& U3 R2 g7 ]2 ?5 C) [ ~ `/ \
4 ?7 X' P9 N/ y1 M+ u. O0 n
This service just checks a flag.
T1 B U! J+ |' y</PRE></TD></TR></TBODY></TABLE> |