<TABLE width=500>3 M8 W- P" v( q& N6 }2 M' x0 t
<TBODY>
9 k; _) N2 j% w/ _<TR>, e* p( f1 K% H% v& Q. `
<TD><PRE>Method 01 / m4 `4 o& X B- ]
=========
7 y$ w1 G4 g8 f/ w* L5 C( N" b( y6 x. S$ r) d1 o
This method of detection of SoftICE (as well as the following one) is8 N8 I4 e! l+ ]. M
used by the majority of packers/encryptors found on Internet.) [5 @. C: O0 D, q
It seeks the signature of BoundsChecker in SoftICE
V% p* ? o9 g4 x# v" P7 B; ?
Y% o& {0 r. z$ N mov ebp, 04243484Bh ; 'BCHK'
$ j B" i4 Q. B: L, b0 z E: ` mov ax, 04h
7 ~3 e; v2 X$ s2 L int 3
% s) N w$ P* n2 w9 |) f cmp al,4
1 c7 @4 h' G) O R' S7 _8 P5 o jnz SoftICE_Detected
7 ~0 M) ?0 p& `% d9 ~& b! c6 M/ N5 V6 }' K# \1 X C
___________________________________________________________________________
5 s( o$ u, c* @' v7 L, g9 F: x' G5 e, u' U
Method 02
, I' W2 \( ~+ i: I: z8 U4 \" Y=========5 ]) Q+ p( l# a. N, [3 [# G
4 ]( m/ {9 T: g0 [6 P; T! J6 [Still a method very much used (perhaps the most frequent one). It is used
) F$ v: A p, h( u1 dto get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 R0 `7 t& k* f3 N, k! S
or execute SoftICE commands...
( H9 c+ T) `/ J% G" o- z# ]It is also used to crash SoftICE and to force it to execute any commands
2 i, _9 N# i7 ?(HBOOT...) :-(( 6 k" q- c" _+ n
5 x* A; }) d* W/ qHere is a quick description:
0 h O. t, `3 K- L7 ^3 j3 r-AX = 0910h (Display string in SIce windows)
0 b8 z3 v; P4 H. a6 r4 r/ @5 I-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 Z1 a% @6 M5 {
-AX = 0912h (Get breakpoint infos)% r- Q1 u) E& E2 q
-AX = 0913h (Set Sice breakpoints)' J* R" a- f3 \$ z
-AX = 0914h (Remove SIce breakoints)
; k# ], V3 r# q
2 ?" u5 Y5 L) W; Q* ^Each time you'll meet this trick, you'll see:
* R4 K, Y- e1 ? ~3 o; i& t-SI = 4647h
1 ~, b ` I4 c) u+ ^! v f3 R-DI = 4A4Dh, ^/ ^ }1 G5 j- s1 D! e5 u3 S
Which are the 'magic values' used by SoftIce.$ o/ Q4 m* j8 v `$ l- h( V
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* Q4 _: ^* q: n1 H- R& y6 D( ]6 b0 e9 w; `% L+ q
Here is one example from the file "Haspinst.exe" which is the dongle HASP
[! O" w, O: q0 W! ]Envelope utility use to protect DOS applications:
: d$ s8 J( m- F# r
0 _5 _ s7 k- n: s# H; C- x# m! f, J2 B" c
4C19:0095 MOV AX,0911 ; execute command.
+ a4 D$ t) K* l% s, b4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 Q4 r- J1 N. }! a4C19:009A MOV SI,4647 ; 1st magic value.
6 z/ [3 J2 N& _4C19:009D MOV DI,4A4D ; 2nd magic value.
7 S$ Y/ @ H% V6 \: |4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)5 F9 m; D9 e+ `
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute% O! K [! |8 w) \, r* H' s8 q9 o
4C19:00A4 INC CX
7 j6 ]6 b- A0 j# i `9 X4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
& i5 F, D( X$ O9 R$ m' x4C19:00A8 JB 0095 ; 6 different commands.
9 p: U& H: L+ v8 ^) t' e4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 l) A6 p3 g5 ~. s! D. D4C19:00AD MOV BX,SP ; Good_Guy go ahead :); m, L3 {% L8 Y5 I2 c+ r& f9 M5 Z- Z
; \4 u& `* z3 ~! Z$ u! LThe program will execute 6 different SIce commands located at ds:dx, which! I: r* [& _$ u; {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.( V4 I1 R1 F3 {: ^ \( X9 Z. i, C/ L
8 p3 ^) @7 X4 p$ z4 n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& \: M' O) w% T
___________________________________________________________________________
0 C0 O' p8 H6 p
P& q8 n* O' A/ _, t0 ~9 a' n
* N5 Z$ A& V2 v* q' dMethod 03
8 R. v# i, t. T G* n* |=========
. s* q$ p& f% m3 g6 ^- H8 z
: L( b! v4 y* o& xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! T+ R: [1 u. G2 k, M" T! i3 D
(API Get entry point)
7 w7 T* `& q- d* ~% `; o Y% M ^- B1 n/ j2 F Y' t) M
* F6 [4 g' G+ G0 h) h) t7 j
xor di,di" u' r+ F5 @2 d- r; \$ r9 L/ S( C
mov es,di. {3 [6 z1 _ y- ~$ @, _8 [
mov ax, 1684h 3 {. s' E6 y# b2 |3 G
mov bx, 0202h ; VxD ID of winice2 Y" r, h4 a. R! w7 Q/ E
int 2Fh
) h q( o& {7 z# R/ {- f mov ax, es ; ES:DI -> VxD API entry point
3 U# k: a& I1 T9 A4 D7 R add ax, di
j$ C4 D6 h7 A9 v) C test ax,ax
# ]. y D" h3 `5 \) W" d jnz SoftICE_Detected
* b' O' n" l2 O! s& d
9 }- v4 l+ u! C4 A$ w8 M' K___________________________________________________________________________
! l3 F6 L5 s; K4 t. O( H! W2 n% H5 a) v2 K
Method 04
# g) X1 F. @7 T/ }- _8 n=========1 ~- ?9 v" w. z
8 k4 I9 q; g3 A
Method identical to the preceding one except that it seeks the ID of SoftICE
5 F/ Q- S1 S* t( C: V( A- zGFX VxD.
6 {# {/ g: \! K* g8 R8 ]2 `2 L& e$ B2 G- o
xor di,di/ }" Q7 T$ z/ J8 ]; m5 ]' [( z
mov es,di
; o) z+ n5 |# q1 M4 f mov ax, 1684h
0 f8 p5 u# O- L: I mov bx, 7a5Fh ; VxD ID of SIWVID0 o% y3 B' O( G4 I+ ^
int 2fh, s+ B! L' m0 {% i$ W) T( h0 |: T
mov ax, es ; ES:DI -> VxD API entry point
" P' n, `& B8 Y( T$ `/ Q; p add ax, di4 ]$ R; `; H6 o; }$ m
test ax,ax$ u @, c* Z& G. z
jnz SoftICE_Detected
?( h( l G6 S, U4 j* n6 h: [ P$ } F& D2 R
__________________________________________________________________________
* L8 t" d0 o* p* v1 v+ E# |* [1 k( A- P/ ~' w8 k4 f M @9 n7 @3 Q
1 w* c: y: v7 U: ~9 z
Method 05
+ g/ b* u$ P0 K8 d=========
$ K; @4 ]6 ?' H/ E; U5 Y4 P' h/ _: n
Method seeking the 'magic number' 0F386h returned (in ax) by all system/ z/ b7 s" E; @' e. ]% O" d1 ` i
debugger. It calls the int 41h, function 4Fh.: T' v" w, _/ |7 V" H
There are several alternatives. . m1 O- Z- S: k" @- D2 a
( P4 o5 ? U& I" `7 o6 n, |
The following one is the simplest:: D* J8 j( F0 Z3 s* r" T1 N+ C
+ {$ ]4 O( v# t" z Z6 A$ ~ mov ax,4fh
# D6 `. L7 Q& q6 `, M int 41h' z% U/ z, z9 |0 u
cmp ax, 0F386
& j( L+ f6 L( C. K jz SoftICE_detected% K+ F. H1 w" t3 X
$ B/ g' K5 i+ Q5 c/ A1 m6 q. B* E. U( k ~% o
Next method as well as the following one are 2 examples from Stone's
0 `- i6 Y c* {, v' R"stn-wid.zip" (www.cracking.net):
( V- T6 J" b' z5 O: \2 `2 K* I9 x
* ]* l2 @4 X/ @/ D mov bx, cs1 k& ~. s9 [6 H4 S& Z9 g6 A# K1 ?, C
lea dx, int41handler20 |. ~' c5 t, f% {. ?) |! e
xchg dx, es:[41h*4]( h9 o! y, l1 V, G) O
xchg bx, es:[41h*4+2], n+ E: A, w+ w9 ~. w4 R% ^2 E% S' r
mov ax,4fh! Y! V0 [$ P, x: i5 b
int 41h- D' ?0 P, G9 @/ C! x
xchg dx, es:[41h*4]
6 N& C$ V+ T% P xchg bx, es:[41h*4+2]
9 Z+ U, J+ Q/ z( X" i7 k; x cmp ax, 0f386h: x" n( C- U. ^
jz SoftICE_detected
9 n) a- S" b; X+ m+ V( t& C
$ A# K3 i/ t' `' |! Q* J# }, F/ R( Xint41handler2 PROC @" v! }- Q a* T+ S# D
iret
& q, g* S. z$ O7 ~6 T7 y5 n; }2 R+ Rint41handler2 ENDP3 w+ ^6 \0 T. F1 P
/ y# x ?5 f# b4 w H ?) Y
3 S O9 I$ R- d* T- h/ o {# \_________________________________________________________________________
" r- h" M I( E9 `& H) O, v" n n8 `$ ~/ |7 v$ M- B- H
! v' f- H6 q s( kMethod 06
# n2 P' h, \7 n7 D8 P+ m=========" |# ?1 G! E9 i# r; J; ~
* o y( i" A% @' W8 y% b2 y3 N& D. R" ^: _/ u
2nd method similar to the preceding one but more difficult to detect:
" Q0 I6 s( X/ g8 X
- R" Q- J2 g) K& Y- A0 w2 K3 z5 W! Z
int41handler PROC
# S! \7 s7 e4 B2 e mov cl,al# q5 o. B5 [$ _; \# `& C* p# Z
iret
5 Y: ?& E* ~* X W7 J% Eint41handler ENDP, y: b' t, S! n% ?9 z
8 E( I7 m( F" L" Y9 c3 [" a9 E4 K! g
0 W- F9 x* ^6 g3 B5 [ xor ax,ax
9 N6 q5 D* l2 i. i- j mov es,ax
% D: n# ]8 z3 ` mov bx, cs" D& ^+ t1 s: z
lea dx, int41handler
' G, d2 l3 J6 L xchg dx, es:[41h*4]
T3 i6 P2 {0 n1 z xchg bx, es:[41h*4+2]
" @- C i' r% p8 @2 t0 i in al, 40h
. M) J- o5 s$ s# F4 v xor cx,cx
) j9 |! o3 h2 ]( H @ int 41h' |/ K; W3 e. w9 a/ |) g
xchg dx, es:[41h*4]
8 p: Q9 \& E; n4 T xchg bx, es:[41h*4+2]
7 \4 U% y$ m* r' E- { cmp cl,al
8 {9 x, B3 v- v# V. _ jnz SoftICE_detected: l1 K N& w/ e
, T1 |: I( e+ Y$ _/ w S7 I_________________________________________________________________________
3 {' Q! J- U1 {" s6 \1 J% @
* v+ i; Y# H3 r8 bMethod 071 v* L9 D5 ?* d
=========
' N! U' y) f' k" `+ J$ Z
0 m' T. @- u9 X6 s# y0 I& `Method of detection of the WinICE handler in the int68h (V86). A/ ~5 f( b# k9 i2 ?
6 ?9 P) v. R; A* b( @! `# } l8 u
mov ah,43h
; L/ S8 p; Z$ ~ int 68h+ `7 ]% ?% C& m; X' N% [; O
cmp ax,0F386h1 J" N0 t3 v' Z0 r
jz SoftICE_Detected4 h- j7 c9 F! S: R; ~& r$ q
5 ~0 _# ~2 Z) D- W& }5 d' k; [/ K- V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit& s( p' z) ^! Z2 U
app like this:9 a/ F S, O Y/ A N- h& Z1 v: ^
' r7 Z* r- b4 k BPX exec_int if ax==68
% s, h- Q( y! x C3 O- M, a (function called is located at byte ptr [ebp+1Dh] and client eip is
$ }1 X/ g4 R3 C1 o! ^" m9 I4 H located at [ebp+48h] for 32Bit apps)
6 {% B% X3 Y1 t; Z__________________________________________________________________________' l' r9 S- S4 T% }3 T
2 x/ C# m5 v% x1 H& ^6 X
: _6 F0 {) t" V* r$ K' P2 JMethod 08
2 Y* c, t4 [7 ~' W=========# e6 I: ^1 h0 ~! e; k [7 S
- h- H+ p& U7 ?, V# @+ pIt is not a method of detection of SoftICE but a possibility to crash the
4 | m( q9 ?8 ]' E/ }system by intercepting int 01h and int 03h and redirecting them to another
# R( g) _% t' ]; [0 a. K- froutine.$ Y ?! O: _0 v, E. _- E. K6 w
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points$ b2 \& H# g4 u2 @0 j+ l3 W2 _' `# x
to the new routine to execute (hangs computer...)# ?$ |+ U% n* k; e2 V5 Q
$ v! w5 C; j3 B: b mov ah, 25h
/ ?: Y& P' ^2 W# `. t% V mov al, Int_Number (01h or 03h)
2 ]3 d% g, H5 K$ q7 Y) z0 X mov dx, offset New_Int_Routine1 r1 M& k* R; y' n+ l* g
int 21h0 I% O1 I0 k x$ F/ t& J5 `+ F) F' e
2 j' P0 P0 v: u) E9 D. g6 A% B; g; y__________________________________________________________________________' j$ ~9 x6 I# T
, ]: \1 Y* s% b: ?2 J3 O& u
Method 09
( C0 T0 Q ]% C- ~( \3 K=========
6 M$ Y& l. n U' k) ^. K
/ {* r8 A7 Y! K+ q2 EThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only0 z- b" s4 C: s
performed in ring0 (VxD or a ring3 app using the VxdCall).: I# p' P% q1 r
The Get_DDB service is used to determine whether or not a VxD is installed
8 h' l/ Z: m7 X3 h6 dfor the specified device and returns a Device Description Block (in ecx) for
3 ?) H3 g' o) X" d/ p3 Zthat device if it is installed.. @3 e) Z' L) B
: |* |. g! t1 A( g5 v4 q7 k o# q mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 o2 b/ e0 ?( c6 z. d8 n- [
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& i- r9 Q7 M1 L1 g4 J1 F
VMMCall Get_DDB
0 S# t. r7 c, |- {7 { mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* x' x- c9 S: ~( ]# B$ j% k2 d" V4 m6 G6 \1 G+ h
Note as well that you can easily detect this method with SoftICE:9 S2 ]/ l2 e; \9 L
bpx Get_DDB if ax==0202 || ax==7a5fh
6 Z/ b# B* x* W& ~
0 I% j. e6 Y" V$ I__________________________________________________________________________ U7 P; n& L1 ~# Y+ x7 f
+ Q0 _) j8 y/ G8 f- r
Method 10
. i+ L% g; P/ i: B8 Q: I=========
! n ?6 n( Y. S, _( K* v" ~# b5 r3 n# k, j2 M
=>Disable or clear breakpoints before using this feature. DO NOT trace with: F! q" @" o2 l- W5 X" S0 C
SoftICE while the option is enable!!
6 m/ T w6 {! f: H0 e. e. p
5 j8 Z* K8 M- eThis trick is very efficient:% N/ P$ h" I; G# O. [
by checking the Debug Registers, you can detect if SoftICE is loaded) d0 _5 v/ E1 n! k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: G8 T& G0 D0 V; F; A
there are some memory breakpoints set (dr0 to dr3) simply by reading their+ s# Q/ z/ v% [7 S4 K) j
value (in ring0 only). Values can be manipulated and or changed as well
% t# N8 U& M" I, b: z(clearing BPMs for instance)( [, S1 f6 a( g) ?: S: F
3 s# y% h. F& C* ^. J
__________________________________________________________________________
, D) L* b2 G$ h/ i& K. G& |/ p8 q0 U$ N' {; ^* C3 b
Method 11
) ^) Y" f0 u, r4 _: Y=========( B+ s! \5 p$ H8 y# k6 E
8 g, C9 l, j+ f" r
This method is most known as 'MeltICE' because it has been freely distributed1 V3 T/ z) ^" v
via www.winfiles.com. However it was first used by NuMega people to allow. D' U/ _# J; [. S
Symbol Loader to check if SoftICE was active or not (the code is located4 V( E& }+ k+ G# T) D0 k1 s
inside nmtrans.dll).
p6 ?, x7 w2 P. s( M- l' ~( b# [, C" g7 J+ j8 |( g2 x2 N
The way it works is very simple:0 L4 s% ^: R8 m! Y: B4 A
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for; I9 L+ ]( _0 Y4 p" }" c
WinNT) with the CreateFileA API.4 h+ ^3 F1 K: C4 m7 u) L& l) N
% c; V2 W: V0 m/ I, }3 t' e$ o
Here is a sample (checking for 'SICE'):
) k0 m( k. {9 H! z- c; j1 w- V+ [/ x5 O
BOOL IsSoftIce95Loaded()
1 k" r6 u5 c! w+ N+ O9 K- X{/ _& U2 J$ H) y1 d% }8 v
HANDLE hFile;
5 Z% c: Q3 @$ P7 a! y hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% U, [1 p7 z& ^5 _6 u- l5 C FILE_SHARE_READ | FILE_SHARE_WRITE,
6 x' y* x" G- Q+ h( o; W% ^' p8 M+ g NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! Q4 I$ _2 y" j! { if( hFile != INVALID_HANDLE_VALUE )8 X9 h4 K5 ?% f& w$ I7 T: {
{5 h n! B5 x X% N
CloseHandle(hFile);
' @6 ]- C8 E" q return TRUE;
9 E! H0 h$ B3 T* G% P; j8 B }
. U& u( ]. [9 _2 D return FALSE;
' N" s& k& O$ q2 D. b6 v% _$ A}9 @5 F z) N3 }4 Z
: Y: Z8 j# E/ l1 uAlthough this trick calls the CreateFileA function, don't even expect to be
" t( J, K' G% a) q" Jable to intercept it by installing a IFS hook: it will not work, no way!
, {5 m9 v. Q1 n$ gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" ^0 \2 n2 X6 |* [ U4 f4 V s
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
+ e! |" A7 ?! ]: K" Eand then browse the DDB list until it find the VxD and its DDB_Control_Proc ?" E2 X) ^5 K4 p3 l9 p( |
field.* Y! o2 Z, ^# \, W( E' `! O
In fact, its purpose is not to load/unload VxDs but only to send a 1 G) P& ^7 @- y/ u! s% r! O; G( K
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
3 w) Z" ]) ^/ o7 @to the VxD Control_Dispatch proc (how the hell a shareware soft could try! e* P/ s' ~' t
to load/unload a non-dynamically loadable driver such as SoftICE ;-).3 ^/ Y/ U; o7 I+ w
If the VxD is loaded, it will always clear eax and the Carry flag to allow
0 ^: A/ V s3 \2 uits handle to be opened and then, will be detected.( \/ d0 f) |( B6 ?$ f% w5 m* t5 O, e
You can check that simply by hooking Winice.exe control proc entry point
$ c- S3 N# F: y" V Lwhile running MeltICE.
4 t( j8 a; X- ]; r( ^8 ?, d* r* r& Y h
! U8 D( \7 S' ^: f. }( n$ @' e0 Z
00401067: push 00402025 ; \\.\SICE- [2 Y1 h- H O% B7 i: E
0040106C: call CreateFileA
/ K6 c2 B2 T( \5 F% c6 t" b, { 00401071: cmp eax,-001
, L1 I0 ?$ M0 d, H. U 00401074: je 00401091
, s3 c* T( x, l: z) i o$ I
5 h6 x) w! z$ Z0 q# n! W
3 L8 h$ j8 S6 S' _. kThere could be hundreds of BPX you could use to detect this trick.
7 d6 w; {- P- M# Y-The most classical one is:
4 h0 p* f7 Q* l+ u7 [" @& m$ D7 ]$ b BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% J( Z y) p9 i- j# q3 s8 S *(esp->4+4)=='NTIC'9 d& M7 P: |- G) d* E+ F9 Q% A
* O9 E; s/ Z' c2 N/ \9 o. W" Z# H8 q% ~-The most exotic ones (could be very slooooow :-(
, J/ { P( O; Z x, \) Y2 h# C$ N! _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
9 w7 P; t0 n# V- {/ S! B ;will break 3 times :-(8 J' h4 \1 g9 b
8 E# J* _+ D3 R3 f-or (a bit) faster:
# m+ v' y& s f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 v9 k0 _; E; x6 [
% h$ U/ ~! w( L6 y( ] J BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 0 G+ ~% \: x' ]
;will break 3 times :-(
$ F$ a9 @7 Y5 a: ^; v: l9 Q! I2 [) v7 }
-Much faster:
+ X6 M, I u7 }3 k BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', S# Z' p5 P5 K; x: x& v& x
" I+ X* A# j) H, R `
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! ~2 r9 M5 c* i6 Zfunction to do the same job:
! C( q1 S8 k1 p- e; b5 S4 }1 v; I0 ]1 a ~' t$ X4 K" b, L
push 00 ; OF_READ4 b: c% M; `* r% P3 [2 |
mov eax,[00656634] ; '\\.\SICE',0& ^; U0 Z' J' C! O
push eax
, f" X# H. J2 [$ g6 ]' ~ call KERNEL32!_lopen
/ V9 V& a$ {. a inc eax
+ V( T4 u/ q, E8 Y jnz 00650589 ; detected3 @$ t2 m6 c( `: O0 f# H* p
push 00 ; OF_READ" A7 E2 k$ c! w& C! u0 c
mov eax,[00656638] ; '\\.\SICE'
$ S/ Q: `6 M: p% a3 j; Z push eax( c& ~: W0 ] m; ~% x: K
call KERNEL32!_lopen
0 l* a) G5 v/ y; f; G inc eax/ ?, T3 L2 @ c a" s* N& A
jz 006505ae ; not detected
- f, E$ i/ J! [) A
- E; i% a& X2 }) ~/ C' O; w$ O. o( u: c
__________________________________________________________________________
8 C$ @: q" @ d( _9 m9 `' q9 ^5 T' }, c
Method 12
+ Z% u- ]: I% y/ h6 h=========
[# Q% c6 I$ M; \3 w
3 e0 ]6 ], Z, S+ y3 C& @7 s" n* T$ b- uThis trick is similar to int41h/4fh Debugger installation check (code 05
; E& {0 |- e( ^% f! [$ m& 06) but very limited because it's only available for Win95/98 (not NT)
; o Z, `4 l$ W' g# n) n9 R* ~as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 J( f$ ~9 Y( x! d& Z7 U" H: d; z) s9 t
push 0000004fh ; function 4fh( i' t: a/ x& R
push 002a002ah ; high word specifies which VxD (VWIN32)
# e, h! D) u0 }9 B ; low word specifies which service* @* R) u2 \9 `4 t- S, q
(VWIN32_Int41Dispatch) L/ U/ D6 S0 o9 r
call Kernel32!ORD_001 ; VxdCall
8 Z; r8 S* V$ M8 m& _1 E cmp ax, 0f386h ; magic number returned by system debuggers
& I8 c% L) C* [' ~9 H& m! r6 z) M3 j' } jz SoftICE_detected$ D' J7 z. R1 z6 t
& S* Q2 U f* B! |3 K
Here again, several ways to detect it:
) t; s5 p8 |/ Q5 O, h: L" x' W! N
BPINT 41 if ax==4f, F5 m7 t$ O: M' O& h7 i
6 O+ ?9 A+ ?! B2 M! c g, P1 }4 w
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
; j `% d# X: S# E2 E/ D0 S% h6 h# x
4 E8 T: g7 m J% |3 h- I" L BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A3 n! x$ d% b+ H, I$ z# \0 b0 C
: U- Q$ D, z9 d& L8 [' O* d! _7 m: E
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
: z- R+ H. W6 s1 ]4 Q# O! a8 d1 n2 B7 K6 i5 e" W
__________________________________________________________________________
7 K4 u& I; S' K. t3 m/ v3 n2 `$ I( ~/ u! a# p2 ]
Method 13) p+ m) h4 E/ N8 j* p1 `+ a
=========
0 K+ |$ J* b; x: h/ t, C% G: u
3 u, T6 k k( x W) V- V6 @Not a real method of detection, but a good way to know if SoftICE is/ B" I4 y3 Z' v: Y( |% s2 l* N
installed on a computer and to locate its installation directory.! W! H" x; A$ Q7 g
It is used by few softs which access the following registry keys (usually #2) :
* S; ], H* |% C1 {" p. u; [! r/ O% E2 `& a
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 E* Z- f3 m( I* ]( o! _\Uninstall\SoftICE
% b/ e2 T' r1 e3 ?% K-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
5 N/ Q ~, M% |0 Y4 ~-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 V. e0 ^7 h: E( Q) H/ m: Q0 q
\App Paths\Loader32.Exe+ @* j. M( n8 k; l
; U2 G: g) v: W( E1 s4 ]1 t
$ z( T: a3 [3 s. p
Note that some nasty apps could then erase all files from SoftICE directory/ F' \1 w$ ?5 x) I8 q8 Y. z1 R
(I faced that once :-(8 R2 c8 ~' P2 V! {( O
$ [& f, g H8 l# e, }Useful breakpoint to detect it:
1 i! Q6 c5 I6 m6 L% E Q/ o# L* @( j. o7 n
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE' W* W3 w5 `, V7 P
+ f$ j6 R# ~' [# Z* n
__________________________________________________________________________) X* o3 K7 t! z7 O' q- n4 \
! Q2 }( I7 w: D1 n, o+ k" c3 X9 ?2 k
Method 14 / A( O2 k0 k/ E- p6 k1 o
=========
& s$ ~7 J' m1 ~3 p/ p5 L& n' E" H, l9 G4 ?( R, ?$ `) _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# o# o& N9 p$ C$ \) U0 u) m N% X3 \is to determines whether a debugger is running on your system (ring0 only).7 {* T7 N# q* l+ c+ ]
: G; o* e# Y' e) G
VMMCall Test_Debug_Installed! ^2 `; x5 j' e8 K- W
je not_installed
$ ]. D8 M9 t6 [' F' N& m8 a9 T
This service just checks a flag.
" [% a4 E) o* a* B) f) o& k</PRE></TD></TR></TBODY></TABLE> |