<TABLE width=500># Z& {1 |$ E6 w. X; ]
<TBODY>
/ l( b; l! X+ h9 _8 c<TR>
4 x: B4 ]( V- t9 R$ V<TD><PRE>Method 01
. l5 n8 T( q; g& m, t7 z=========
) `& |4 s w* \# i3 U- s
2 \* w" ]# H' k! j- I4 I& V. AThis method of detection of SoftICE (as well as the following one) is) p( Y. @$ j: [3 Q) I$ p* A
used by the majority of packers/encryptors found on Internet.$ q( ?# V7 h, e% Y5 ~
It seeks the signature of BoundsChecker in SoftICE/ g' J$ y8 L& G9 z5 Z+ e$ L+ Q
" O0 }$ `, j" R$ ]# _ B E
mov ebp, 04243484Bh ; 'BCHK'
# t% ]$ v* B9 S9 H, [0 y mov ax, 04h
, V3 A+ x" u" e* \( M& ~7 Z8 I/ N: b int 3 + L" l% [! g0 p# |8 v9 b, v8 b
cmp al,4
' x) C2 R3 N: P jnz SoftICE_Detected7 c2 H$ T, n1 Y, W5 [, i- l
& X [7 s2 [* M, H
___________________________________________________________________________
& [* ]' ~; I' S- [8 m: Z3 A
2 [% H1 Z% b3 @. f: ^% PMethod 02, j7 [$ a: Q5 ]
=========
) j- R" h# ^3 `, U) O
" ]- e* R1 j8 u; p) ~" E& C: dStill a method very much used (perhaps the most frequent one). It is used A1 ?/ e2 H2 W$ G9 d( ?- o. m
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
3 a' N/ q6 X7 Lor execute SoftICE commands...; W Z9 W4 T% v3 {; f! i0 ]$ N
It is also used to crash SoftICE and to force it to execute any commands
2 o/ y8 |4 U8 S" s6 w Y Y/ J(HBOOT...) :-(( ) ?/ E7 E& ?. P( a# ~! O3 H
$ a' x( W1 D mHere is a quick description:
" {5 f& |1 _( ^* q& K4 k2 D! o-AX = 0910h (Display string in SIce windows)
$ p! r w+ E7 F-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)2 a. `2 Q1 A+ G$ w
-AX = 0912h (Get breakpoint infos)
& n- p; E9 s y; e$ Z-AX = 0913h (Set Sice breakpoints)
7 I* a! }, f7 U0 x( y8 g% [* f, q-AX = 0914h (Remove SIce breakoints): ]" Z; x6 u4 A1 _6 {
$ H1 b% c, ]" ~& SEach time you'll meet this trick, you'll see:
: P( s% Y( W( x5 p2 x-SI = 4647h
/ p8 B( t; S# O-DI = 4A4Dh; A- Q8 o! P4 c2 D! |& b+ ?4 F
Which are the 'magic values' used by SoftIce.* I; C4 s+ j0 T! h4 o8 p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
1 q# B5 P, d; ^) D z
% L+ r3 Z4 ?1 E6 wHere is one example from the file "Haspinst.exe" which is the dongle HASP8 F' K: D6 t8 |
Envelope utility use to protect DOS applications:
. P2 W0 O% J8 I% f0 W
8 L. m/ r( s$ ^5 q3 a! |+ a+ i& b8 h' \7 n) x$ V+ ?
4C19:0095 MOV AX,0911 ; execute command.4 W4 X/ M7 k0 N' |
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* g+ C1 c# m7 u2 ]8 F4C19:009A MOV SI,4647 ; 1st magic value., n8 z. Z5 I) |
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 h: `* P& Y' q( P% `( R( m! y5 k4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ }+ n3 f5 ~; ~7 C$ ~% O4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
" J0 Q! @2 g7 ^: V& L7 t4C19:00A4 INC CX* @- ~5 {7 [7 V O5 @( r3 T
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ \* u2 z7 y b% m- c7 b
4C19:00A8 JB 0095 ; 6 different commands.9 R( B# R$ i) h3 N- a* @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.# n; q3 ]' V2 Q; ~- g' V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
" J; n8 b q3 V, ]0 p
8 D0 Z; W1 r2 W: i9 U' EThe program will execute 6 different SIce commands located at ds:dx, which
8 Z4 |' e) J) i8 o4 g- ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; c* i3 Y" `1 F
, R5 B3 j1 J8 O$ D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
) h: v$ X, `: I+ F9 u1 s___________________________________________________________________________, o: L0 B: A5 }" {* B( `/ j4 _1 v
7 Y" Q3 {/ y) X0 k& k
1 H. ?7 S6 |0 P7 Q- Q
Method 03
) j; A% g5 J9 ?=========
: Z0 N: l9 k8 M2 \1 F! T2 b8 s* B
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# {" F' E/ V" b/ A6 `( A# R
(API Get entry point) T5 x& L" W1 A* R% ^
4 i# m; K* Z+ ^
; R# F8 H' ~, S2 l* ], x xor di,di
5 o1 j7 x& L8 E mov es,di
7 x4 n% _; Z; L6 V A W mov ax, 1684h " Y# ^# F8 q$ c1 ~0 ]: F
mov bx, 0202h ; VxD ID of winice, N3 A) Z: d9 s/ ~6 @
int 2Fh6 I) v, I9 e6 F o& ]
mov ax, es ; ES:DI -> VxD API entry point
* Y0 ^) F- Y, [; j- C add ax, di
! \+ Y* ]& a+ I( S. {4 ~& [ test ax,ax
M& g* Q# w" v; B: t" N: u jnz SoftICE_Detected
4 k2 b! W1 \ c1 H
0 a3 E3 e/ v. t+ L, h0 [___________________________________________________________________________" M9 n% Z6 `8 m F# U
6 f8 M3 u' I) P5 Q" j) j6 aMethod 048 m7 k+ f( @" T& C0 g4 Z$ O0 ]! H2 d" T
=========
2 `/ K! `& I( E* _
* x4 c& s u' n* h9 V: g6 P9 }Method identical to the preceding one except that it seeks the ID of SoftICE5 F0 y0 r: Z; }- M
GFX VxD.$ d a8 a. Q, [+ X% |5 c
- w2 z; H* a, _" Q7 s xor di,di
' m4 W/ O# F( y mov es,di( T. z% T7 |# z9 I
mov ax, 1684h ! R, r% K* m3 b) F
mov bx, 7a5Fh ; VxD ID of SIWVID; Q1 s7 Y% W! T
int 2fh
$ g2 w4 O/ M4 u5 b: u mov ax, es ; ES:DI -> VxD API entry point
, M# }7 C" z: r5 A9 j' A add ax, di6 |3 O5 j9 D2 D3 g% B" ^
test ax,ax4 T5 U8 e) V$ D1 ^
jnz SoftICE_Detected2 g% a, i/ R( y) Q5 }* q
+ @4 G$ V+ ?! s! l__________________________________________________________________________
$ j( n$ z- K0 T0 k& N: _. J2 d, |9 q8 D8 n$ q/ j# B& p- K
; ~ G: G5 Y: N. w! MMethod 05- A. A7 Z* @. c' b
=========/ _: m- j# R2 |, F% p' r, h
7 z1 K4 g8 c; d5 k0 C6 d) m1 oMethod seeking the 'magic number' 0F386h returned (in ax) by all system% ?2 A4 k( s4 w0 J
debugger. It calls the int 41h, function 4Fh.
3 m) X7 z9 D. b6 iThere are several alternatives. 9 _! @) O' j. S+ c- ^; {7 E( W
8 r4 Q6 W/ d/ v. N* yThe following one is the simplest:
n" ~4 h( @' R" d {/ d
$ L5 q# X4 X& x& H, l mov ax,4fh
- @8 Q+ h! b3 ^1 u) F8 C7 ~5 | int 41h
- z) e% n0 H G: O q4 } cmp ax, 0F3868 X7 p3 v4 ^4 R% E' c8 }4 a+ \+ _
jz SoftICE_detected m$ h( w- s2 v, c
% H2 ^0 z7 t1 }
' e- t7 A4 i7 G* b$ a! _
Next method as well as the following one are 2 examples from Stone's
& i5 D4 J$ R0 _$ R# T6 @"stn-wid.zip" (www.cracking.net):
) w: A' _: f! A9 G: x
1 O# E. p, ^( e. i' M7 J mov bx, cs
/ m( m- N V# X/ h P' x lea dx, int41handler2
% u" z) C8 }4 C& E5 P- y6 i8 N xchg dx, es:[41h*4]
8 U7 d$ y z; [: Y" N xchg bx, es:[41h*4+2]
) k* N$ T/ L4 G2 r1 c0 g6 R mov ax,4fh2 J2 e4 Q) f- O' d# H
int 41h" c- Y5 o4 V3 ~: c) X
xchg dx, es:[41h*4]
2 o4 V; M+ P' i8 u xchg bx, es:[41h*4+2]
7 T7 H$ S. A. e" s2 S- V cmp ax, 0f386h
; u3 w) Z( @: _- F9 A* q jz SoftICE_detected3 e" v2 s4 e& M0 n% c7 I/ a* W0 _
6 l9 D% Z" }) d" Z$ t& Mint41handler2 PROC7 p: w- a2 D& U9 ]6 l
iret
; L% ~' Y3 J4 v4 Z; Wint41handler2 ENDP/ l( y1 M5 Y! \4 r
' @. B8 T& z! |7 ]2 }8 U* `
4 W3 C9 e$ z6 X) Z% [( C" J3 L% j( u_________________________________________________________________________
; q4 Z% [6 G _( J: V# e) ?# b& w {; N4 B
) W4 M; S6 u( h/ ZMethod 06
$ L# p9 P/ U/ Y" z) b=========
( k: Z" d s$ n8 f% e
( ?& t0 W9 c, ?7 n) _) Q* G) J0 h/ p3 E1 ~+ ~/ {
2nd method similar to the preceding one but more difficult to detect:
. M2 F4 Z4 q# S, L& }& i
1 G' O& a+ q0 D
, Z' [5 i: y5 w( m$ Oint41handler PROC) S5 \$ e7 ^4 P$ ^7 m7 b m2 _. T
mov cl,al# w1 ~8 W7 O; Y# X/ t7 L! B2 T
iret& N4 ]+ {- J# f# y1 V
int41handler ENDP
/ a- e5 y3 I$ L E- F7 H5 I. p5 |0 L: a6 }3 V
" }+ P3 w: L( ]# J0 g( o5 j& j, C xor ax,ax ?5 Y3 j; b z- h8 x4 Z. H1 }
mov es,ax9 f0 n- u! ?8 Y9 J( v- `
mov bx, cs. G2 F0 w. Q; Q9 e6 [, s
lea dx, int41handler
+ W/ o8 g$ X. S" A* J. l xchg dx, es:[41h*4] K& e) L& X; v2 q
xchg bx, es:[41h*4+2]$ F3 K' t4 a/ Z9 {. Y
in al, 40h
3 }! i6 L/ U# a9 O W xor cx,cx0 j! r0 n& w# O8 g3 d; [ h
int 41h
) N" F# O: |$ B% a% m9 E2 U: P xchg dx, es:[41h*4]9 Q( t8 G8 x4 E2 _' i4 u- W4 Z4 k6 v
xchg bx, es:[41h*4+2]: |5 Y2 e- f3 R' A. `7 u
cmp cl,al6 ]* _1 A+ ?5 ^
jnz SoftICE_detected
% S8 W C3 r3 F# W! u: o' a+ O+ h
_________________________________________________________________________+ o6 \% A; Y6 G7 O
/ P# S. R* l( w! t3 }Method 07! ?. S# C0 w" n1 {
=========
8 E' g$ p- i* I% o! f) N' X
! \, B# t @0 ]/ S: H- V: n- @; \& ?Method of detection of the WinICE handler in the int68h (V86)
! V' N8 o% n, s& E! z# s+ a t5 g: [. S0 L7 y0 C" V
mov ah,43h0 w" \) A; m& t5 q5 e
int 68h
% Z( f+ c) o3 C0 g- L4 r8 U5 U+ p9 } cmp ax,0F386h
* n9 C) K+ S1 r3 @+ i$ I$ P jz SoftICE_Detected, c$ v6 Y* |/ M8 b) p. Y
6 @# o7 \# S3 t
* M( n1 ~( Q0 y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit6 T9 j7 k4 p) W$ c3 ^
app like this:: ~7 b+ Z; X6 L
- n4 J& e, l& r: t, g+ m$ s# l BPX exec_int if ax==68 g2 r( ]+ l7 A5 L1 d. i
(function called is located at byte ptr [ebp+1Dh] and client eip is
: `$ q" p) e/ `3 o8 y1 g$ m located at [ebp+48h] for 32Bit apps)- p+ f# U o2 o' a* x7 O9 j7 `% O
__________________________________________________________________________
9 E) o* t7 x* Q" f; B/ {) `* p6 S. U. o) i$ e/ t) |7 S4 i2 H% E; T
. A. e: q) e& w, g/ I& ]/ AMethod 082 U8 ~: m3 E, }9 ]& \6 U, ]5 B
=========$ d8 a0 K6 I3 O# _. Z% }
* [7 ~# R% [& ]. i9 CIt is not a method of detection of SoftICE but a possibility to crash the
7 h( R2 ?; W) U1 R/ Isystem by intercepting int 01h and int 03h and redirecting them to another
8 z8 s: b) s( Iroutine.0 T7 W) s4 Y9 h. {! S4 E' t
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% v- P3 B% c- U, [% D# h$ _8 \1 Tto the new routine to execute (hangs computer...)
5 |1 S% |8 ?' }* ] r/ a: m( b/ X5 h$ ^- k1 Q9 W4 J
mov ah, 25h
& o+ a4 O2 P$ L6 `3 d mov al, Int_Number (01h or 03h)
0 _% D+ Y) f) v# m1 l2 A$ O! k0 l mov dx, offset New_Int_Routine
4 j5 E2 R4 j4 m. J: A! y7 A$ k int 21h, |1 r; @& L& T- C4 t$ M" K: D
- L& E) `0 Y! Y. v& c* j2 T
__________________________________________________________________________& l* P. _ p/ ^* r( E9 }
0 D8 Q7 m+ o' f0 O3 ^( H; CMethod 09
- J' ~& h3 J) r: K6 |, D=========
2 i& n# X/ _, r! |" n1 F( q2 K+ \4 U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" i1 D4 n. F7 R% x# B0 A& j( xperformed in ring0 (VxD or a ring3 app using the VxdCall).
+ [( c1 v5 [% L s/ FThe Get_DDB service is used to determine whether or not a VxD is installed* S5 j; {5 o. w8 u, u
for the specified device and returns a Device Description Block (in ecx) for
3 R& ]0 Q1 n, F+ `that device if it is installed.
# S9 @ X0 B0 y* G/ I& a2 L3 s1 d7 S n8 @: t
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID$ d: z4 l2 F1 o$ F) y' E2 O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
; k. J6 V& V/ n6 X0 [ VMMCall Get_DDB7 C" s# D2 ^ J7 G4 U9 i2 g! v
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. {: W6 c, q. E- x- j) C5 A% j/ e/ F4 M: K
Note as well that you can easily detect this method with SoftICE:
2 U% J6 n5 P, M7 J! m; L/ J' r bpx Get_DDB if ax==0202 || ax==7a5fh
. J d6 S7 e2 B& l8 _' C, e
5 [' }- Q: Y9 I' g. N7 A__________________________________________________________________________7 M: Q; e7 u$ X& j$ J
4 ?4 B% b2 |; f8 F5 \Method 10: Q+ C5 T8 d* F9 m/ l
=========2 U; i0 `0 O! n0 Z3 U
A0 M M1 N6 \& {" |8 g# v' S2 y=>Disable or clear breakpoints before using this feature. DO NOT trace with
: z5 M7 [* y- L4 O2 k SoftICE while the option is enable!!' P8 x8 w9 l9 X% l& `
8 d: G1 Q" t/ }
This trick is very efficient:
& R' w" I& G, Q* ]by checking the Debug Registers, you can detect if SoftICE is loaded
! x8 ]7 H' \- `7 \7 L5 X9 ?; A(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if' P# [2 p; O1 ^$ n7 C- i2 s" t
there are some memory breakpoints set (dr0 to dr3) simply by reading their3 n* J/ V& G; ^* Q5 H1 Q( }' j
value (in ring0 only). Values can be manipulated and or changed as well5 J/ n5 ?- r3 n& q/ W
(clearing BPMs for instance)" }+ r5 `; g* S$ L
" N- Y0 j) v3 i* E( g6 U
__________________________________________________________________________( h: w- X( P! o, g$ x
3 C: j/ ]4 y- Y9 s9 r) t
Method 112 f* l3 {2 X; P% {: O$ l; `# r
=========: G) } W) Q; K3 N( }2 N; C& o
1 {" a8 `0 y! f/ x
This method is most known as 'MeltICE' because it has been freely distributed5 Q0 L) S2 |) H: y' h" f* q; @
via www.winfiles.com. However it was first used by NuMega people to allow
, z9 S+ P! x8 w- ESymbol Loader to check if SoftICE was active or not (the code is located3 A+ U N% f3 z& D' J Z# ~
inside nmtrans.dll).
' e, W" F. K3 a" f. C$ g: ^: [) @1 P. z: m' c
The way it works is very simple: I) x6 q T! c O
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 `! W' B! S. P$ o l2 h
WinNT) with the CreateFileA API.- h. k. t1 o/ a9 K. \
! ^% J( V! s/ R3 M0 U; u# CHere is a sample (checking for 'SICE'):' h4 M$ c9 Q) T% t
. |1 ?3 v0 \' g) a/ T
BOOL IsSoftIce95Loaded()
/ v. K' B `" C{
+ \/ ~/ }) }% @7 q; x HANDLE hFile; 9 h5 q+ x$ z, @. L4 d8 ]
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
+ [2 Y* a* Y1 @1 v, Y% \ FILE_SHARE_READ | FILE_SHARE_WRITE, Z' K4 v3 b: O3 u6 B0 b
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
g/ [6 M$ t/ \* F J8 V+ ]$ d if( hFile != INVALID_HANDLE_VALUE )
1 f0 H8 `: Q ^, ^! U {
& c3 H4 }+ y% w/ @0 c9 C' u' w7 T CloseHandle(hFile);/ J: X# Z$ v) A
return TRUE;
( y. x/ i5 ^* A2 x6 m# w$ i }
+ k. O; @" q3 }2 k return FALSE;, C) f/ @9 G% {
}1 I# _$ N; o" U. O/ x
- t" R. w* u; C. l5 zAlthough this trick calls the CreateFileA function, don't even expect to be2 f- | [. ?& z: R+ p
able to intercept it by installing a IFS hook: it will not work, no way!
7 Z8 y; v0 q# M J4 E& ^5 F" tIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' D& C$ e% \2 C- j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
. J) D+ g* y4 E; a4 sand then browse the DDB list until it find the VxD and its DDB_Control_Proc4 \9 F4 T$ x6 W# B8 Y. N0 w3 G! x
field.! O. j9 z/ N9 J6 G9 Z4 v& C
In fact, its purpose is not to load/unload VxDs but only to send a
# t! X9 v/ o0 G& FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)* _5 N5 f m' Q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, T& z! C9 l' u/ Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).( u1 g: F2 Q8 F% K9 s, T9 T$ c& I7 I
If the VxD is loaded, it will always clear eax and the Carry flag to allow
3 q6 x) X' T- D% o9 y3 Gits handle to be opened and then, will be detected.& H5 H2 ?% K, R: l5 ~: X+ Y* W
You can check that simply by hooking Winice.exe control proc entry point
2 Q0 O6 a3 n4 H6 M5 I1 t& Dwhile running MeltICE.; { G7 Q: Z) O. [7 w+ ^# n8 a$ W
9 C% H6 U: u, }: e/ `$ ^# |- V# N
! C; P& B* b2 i! \& D
00401067: push 00402025 ; \\.\SICE4 H% n" [7 k; [4 J# V1 [
0040106C: call CreateFileA
5 I$ S! H1 {2 b/ s; Q) Y( O$ x* H' Q 00401071: cmp eax,-001
& n, ^6 p* m, E 00401074: je 00401091- s; R% Q; {! f% R& s; |
* q6 P$ l8 p! T/ s
5 h0 U! h! Y- zThere could be hundreds of BPX you could use to detect this trick.
$ H. J' C) e0 V# p% d9 E-The most classical one is: u! G+ G3 v. o0 z- D
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 ^3 j b6 s7 S( s4 N: ?# h/ Q, }
*(esp->4+4)=='NTIC'/ ~$ @6 ?; U" h7 Q' x
1 G6 Q0 }+ w0 \) g
-The most exotic ones (could be very slooooow :-(: m w; J. q1 `4 ]3 t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 7 M. m6 a n7 b6 ?( P
;will break 3 times :-(8 \" o4 u7 K& z' {! O
^- ~) I7 S% o-or (a bit) faster:
( W1 J) |9 A. v3 c; ]' M/ A BPINT 30 if (*edi=='SICE' || *edi=='SIWV')5 |; t" T- X0 l" s! p! h
$ b2 V0 a5 p9 t, @9 P* H! f BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + x6 k6 t2 {$ q' r
;will break 3 times :-(
: z z+ F& v8 t* ^4 Y2 J0 f O
R. U" j7 T) ^% \* [" \- `% H-Much faster:
, s0 `! l$ {: d2 N BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( K$ G2 r ~6 G1 ?7 D% `2 a0 B) P p
4 d2 V6 A1 O3 Y' j! MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen! Z0 f ] V& W- g$ ^
function to do the same job:: y3 P5 t0 \, `" g% x- R s- B0 F
, n2 G2 E7 z! E o- \0 ~
push 00 ; OF_READ
6 E `( v3 W, k' U2 B! Y; ? mov eax,[00656634] ; '\\.\SICE',0
u6 P7 ]' }; _, o5 l push eax5 ], E9 S; R( u; U
call KERNEL32!_lopen
6 U* ^ @) g3 `& ?( R3 o8 n inc eax3 ]2 c! j7 u% _3 {3 _( c
jnz 00650589 ; detected
3 Y$ r/ c7 B& p4 Q+ n push 00 ; OF_READ
2 E5 X. j* K/ L) Z+ I! Y mov eax,[00656638] ; '\\.\SICE'
% k: E( @! R. g8 P push eax) E+ c) L0 \: Y7 P' @5 l
call KERNEL32!_lopen0 W3 v- p5 D* a* l
inc eax4 P! _! B5 T1 P* a; Y7 q. w
jz 006505ae ; not detected
8 S) q# z3 v8 n6 b& _" R7 X3 C) }) K) \2 g4 s% p! ]. o
" ^6 Y7 |; r# f6 T* P3 y__________________________________________________________________________- ? q+ ^2 U5 A4 T
8 ^' _1 e3 s; E; a- `
Method 12' @0 C% z& K8 |2 x
=========4 Y/ P& u0 h: [( V, N* t
& K" J/ n8 p1 F% @. b' ]* lThis trick is similar to int41h/4fh Debugger installation check (code 05
4 l% D* f7 F0 @# x& c" ~$ p& 06) but very limited because it's only available for Win95/98 (not NT)
' s2 f; g. e0 }0 u4 _3 X, gas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. P/ w: x c c3 U) R
( b: J5 \ d. m# u9 ? push 0000004fh ; function 4fh4 ]8 R! ~& W4 Y+ k1 X; I5 ^; @: t
push 002a002ah ; high word specifies which VxD (VWIN32)
. _% ~3 b1 L7 \8 s, ` ; low word specifies which service
. ]+ u% |9 C5 u, U! l; c7 w. x. p (VWIN32_Int41Dispatch)& [. }; j k8 F' _3 [4 {) R
call Kernel32!ORD_001 ; VxdCall9 M$ w# a% C* Z
cmp ax, 0f386h ; magic number returned by system debuggers
" f8 g! P. S5 n" K* h jz SoftICE_detected% D# p7 j9 j d: G/ I, e) Y
# o& e) k+ l/ I1 d: g; F2 {Here again, several ways to detect it:4 H# ~$ o4 a! ?8 _$ u
1 @3 Q7 E- m3 o( u1 u9 {& b% ?' s BPINT 41 if ax==4f
+ ^5 n/ p0 D6 a% J1 a: r9 Z
- c' }* q- G+ p N! g BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, }9 R# b& ~, s7 w
' p y% v" k/ a9 O+ J8 t BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 h7 e# t. V& W7 i" v
/ R8 g; D; I9 S/ _ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!% d! ?: {0 D9 R) q: S2 c+ ~1 c
/ A- S' I& N- G5 Z1 B% {- A
__________________________________________________________________________- u. [# f7 \2 J3 c
) F" z% }% h) \( ]! P9 I+ {3 M* VMethod 13
\: ^3 c' v- j; J j% M. M=========" p! v ?. d6 S) j
) k8 H) X5 L' T3 v e
Not a real method of detection, but a good way to know if SoftICE is
1 G. S7 [. W" k' \installed on a computer and to locate its installation directory., t8 u% R8 N5 Y$ F/ Q
It is used by few softs which access the following registry keys (usually #2) :( `3 T9 b- G9 N0 G% N( z
2 s5 B x7 r) _+ `-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ d7 a9 X+ F! L# b\Uninstall\SoftICE
4 ~ x8 l. y3 k( L! }0 D3 U-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ z& r$ F0 W6 m/ D) n% C) F) Q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion3 m3 d7 X4 W$ D. Q* }( Q. }5 N
\App Paths\Loader32.Exe4 Y* N' t. m% y6 p
+ t, F* ?) H7 M& h4 c
) _4 u/ \5 b: q9 M: R0 e& u' INote that some nasty apps could then erase all files from SoftICE directory
/ M: a$ M& a/ l Z( o(I faced that once :-($ u: V. y( l2 v, a
/ c8 \8 n9 d( K1 {2 v) x L+ ^
Useful breakpoint to detect it:
& D. L! i& w. u; N$ j& N5 f5 q# A8 d
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'9 a+ x8 i4 d' G4 k
8 N1 }6 \1 \9 f6 i8 V) b1 M Z
__________________________________________________________________________
- o" \ g$ u/ k! C1 I# W) s, B# F7 j ~. m6 p& m) `
# Z E' P0 V! {7 k- o# Y6 T
Method 14
2 R* v/ I9 y |4 k& N# R=========% K ?- n7 ]; i: v- j8 i2 q
# H+ M( i3 z2 ?
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
X% a/ ~ l" B4 F8 iis to determines whether a debugger is running on your system (ring0 only).. @- s8 ~6 X/ X' n! M
' T( M4 U" }4 V7 I* q$ z VMMCall Test_Debug_Installed
' O" i7 X' q: l, w9 z$ E je not_installed
/ g. ?/ d o7 H4 W3 _/ p
# q* h. v$ h( f) R! ^This service just checks a flag.4 m9 v7 Y7 r/ w9 t4 g4 `
</PRE></TD></TR></TBODY></TABLE> |