<TABLE width=500> d4 |9 E: [" a
<TBODY>
r: h) k2 M% i) Y<TR>
! b' J" x- z# l) y% ^<TD><PRE>Method 01 + D- k) n$ ]! Y9 o' ^
=========
6 s g: q+ N; n b; [, {' R$ y5 G9 W0 A2 f
This method of detection of SoftICE (as well as the following one) is/ t5 r/ l1 {8 _( ^! \- }% x
used by the majority of packers/encryptors found on Internet., Y5 @# U7 \7 J: v: }7 w+ k R
It seeks the signature of BoundsChecker in SoftICE) d" @+ j1 U: B$ f
9 s$ v1 ? |- Z* Z mov ebp, 04243484Bh ; 'BCHK'
) Y: q/ k3 h/ U6 o2 Z mov ax, 04h0 u6 t7 n) z) _" ]
int 3
0 |0 t( ~! n: K9 Z) d* Q: k y2 P cmp al,4
: B$ e2 _5 Z6 S4 F jnz SoftICE_Detected! l: s" U6 }5 j0 f: U% E. K% y' ?/ r
; G# _, V/ H8 u6 a___________________________________________________________________________' I& R- r6 c9 Z7 a8 T, y. H& J
& {1 D, E# i8 x" q x7 ]; @) NMethod 02
! Z {4 X% o# }$ n3 Q* t3 |; b=========/ s; Q2 y! ~" e( G H: {
! Z! o% q: R Q& L& F( ^% V
Still a method very much used (perhaps the most frequent one). It is used
' Z( n& x1 U" _+ T. }/ oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 P5 S* S/ L+ f* h% o6 {+ A* U7 Oor execute SoftICE commands...
& k4 f! z* g1 G" l. f4 f/ `It is also used to crash SoftICE and to force it to execute any commands% }+ u$ @7 h0 G3 ~& L5 t) G; I
(HBOOT...) :-(( % p* Z2 x8 z; w; P# W
1 h% ^; Z7 Z3 n( C( P5 n1 q
Here is a quick description:& F4 q* n; \* [* f
-AX = 0910h (Display string in SIce windows)
2 ~/ S; c$ f, u* ]-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 m& W' w; m ^) R6 L& o
-AX = 0912h (Get breakpoint infos)
! K+ I' H5 |- B$ Y2 B- X-AX = 0913h (Set Sice breakpoints)7 O6 L1 _2 E3 S2 k: f: ~
-AX = 0914h (Remove SIce breakoints)
N+ }2 \: I( _( `; {2 \
' E7 G f8 [% I8 Y- S1 hEach time you'll meet this trick, you'll see:
6 J- J# y$ q: n( _0 J& l. J-SI = 4647h
$ o+ s4 s2 t: O2 d* o-DI = 4A4Dh
3 n1 h, E7 v+ ~5 ^2 N( R1 Y# UWhich are the 'magic values' used by SoftIce.
* C) Z% K' u" `For more informations, see "Ralf Brown Interrupt list" chapter int 03h.0 r4 N6 j( Y" y0 E4 V3 ^" S$ u
2 f& Q5 r7 L, I# i; BHere is one example from the file "Haspinst.exe" which is the dongle HASP' }" f z" ]. `4 S7 C/ i: @8 H
Envelope utility use to protect DOS applications:
9 }+ Q9 Q9 d! n# D: `3 B1 E$ n, _7 J
7 P1 q$ A8 E6 s* h
4C19:0095 MOV AX,0911 ; execute command.
' X" ], J5 b1 x9 i8 w4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).( o) M) k! g0 S/ C+ b. s6 D* P% ?
4C19:009A MOV SI,4647 ; 1st magic value.
; p) H8 Q) C/ p9 r+ A! B4C19:009D MOV DI,4A4D ; 2nd magic value.
! C+ i+ k( H8 @% X0 g4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
: ?6 S+ s% [4 b" G0 C# Z$ H4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
! C' i( p0 P9 I2 h+ w# T4C19:00A4 INC CX4 _, e& z" W# z9 S( [
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute6 t+ p0 \ E! t; w' q. B0 q
4C19:00A8 JB 0095 ; 6 different commands.
( D+ `) F0 I9 R9 M4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! w6 [$ ]# ?6 t5 E& m w1 }4C19:00AD MOV BX,SP ; Good_Guy go ahead :)- I0 U- S$ I2 m- h8 d0 F- l; R
6 A% D: e) |+ VThe program will execute 6 different SIce commands located at ds:dx, which
$ P0 |* ^8 Z4 [& f `- q. |are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
4 k: \7 X( y7 R$ P1 H
7 {4 f$ z. I) h6 T* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.2 ~ w$ t$ X# n8 O# S+ k5 l9 D
___________________________________________________________________________* w1 r! F$ [2 i, T. u, c
. J1 Y6 `0 q& r+ x+ x
9 n7 m& K1 O; B* x$ |Method 03, n8 L. s2 {0 {2 V5 U9 k2 B8 \
=========; b v4 x G+ Y& m
, R: _1 Q+ y2 ^% T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
4 `# F* o; ?" Y( j6 c0 v( n8 l(API Get entry point)! v2 R, g5 f- l% ]6 T7 u
1 Q- j5 g, H: Z
- g* `( |2 _1 ]* o7 C xor di,di
- z, s, W6 t+ x3 I mov es,di/ F/ B: L, k; P% v" Q+ |. L% `/ j! \
mov ax, 1684h 7 l$ @7 O! c+ n+ r) a, u
mov bx, 0202h ; VxD ID of winice x% k) B4 Y# E
int 2Fh; X' f: s( `2 s Q# L
mov ax, es ; ES:DI -> VxD API entry point' C- ~: \& p' J/ d) }6 n
add ax, di
5 l, g' Z9 D$ p2 w9 g test ax,ax3 L$ n3 x& K. v& Z4 E! w
jnz SoftICE_Detected) } Y+ l% X: K, M5 I
/ M$ D1 p! N6 V) N1 I! O' C5 `
___________________________________________________________________________% ^" _3 M. Y/ c' e/ i( P) R6 d
. c+ E' d, @- m* [' a
Method 04
" e$ B+ M$ L5 X=========' i) w9 W9 w, n
" T# _; N, i% Z0 [
Method identical to the preceding one except that it seeks the ID of SoftICE# P* W3 n+ v: D2 x$ l2 p
GFX VxD.
4 [2 V9 Y9 h& |" S7 I$ U' ]3 R* Q$ E/ S$ I2 @9 ?5 p# e
xor di,di' A* f+ V( g1 U( L
mov es,di
" U2 F) G8 ^. S* n2 e& W mov ax, 1684h
; l& @9 `3 z0 c9 y# M/ h* K mov bx, 7a5Fh ; VxD ID of SIWVID# ?9 Z3 \; d9 [( _; }. h$ M$ x! a
int 2fh, Q) T6 I4 @# M2 k" U' p1 h2 I
mov ax, es ; ES:DI -> VxD API entry point
7 w9 N, P m$ E7 I/ o add ax, di* J/ e R$ E0 T$ O7 o
test ax,ax
; x5 Y# {, c* B; A jnz SoftICE_Detected. H: u6 `6 a/ q* K) b( Q
4 r% X$ L0 q$ |3 A" k" j__________________________________________________________________________
5 J! B( `6 @! i0 k6 x3 O6 y* {
4 u) Q9 P4 _# F' C* a# u X, J4 b7 a- M5 a8 Y9 l. m% i
Method 05
5 d5 \7 ]5 G7 G; H+ i=========
7 \5 s/ g0 b4 W; N+ d* ?, _6 o
) Z4 V( g5 L3 i h4 \ fMethod seeking the 'magic number' 0F386h returned (in ax) by all system: `& K7 E2 r" |, Y9 j3 D
debugger. It calls the int 41h, function 4Fh.
. }9 A- q2 d5 q, u4 n" q- U2 pThere are several alternatives. 3 `) \ ?% l t% R% j' ~( S* z
4 q; p- Q# m V5 ^The following one is the simplest:
: L G% W2 J, K1 r8 e# e( z8 b: a2 T2 J' A
mov ax,4fh
" l! W" p+ Y x+ b- C( Q int 41h
+ E& U! v* h5 K8 B cmp ax, 0F386+ V! K: F8 T$ \2 |4 M, a
jz SoftICE_detected
8 s4 [# V3 k2 S5 Q: s
/ g( X0 B% q# M- ~: V. {
. L5 t" @: I% Y6 v4 D! I! B! k: TNext method as well as the following one are 2 examples from Stone's
- l1 q& P6 o& B; u2 C+ o"stn-wid.zip" (www.cracking.net):2 Q. @5 [1 n: u w, C) Y1 l
8 j6 y3 |% @3 T6 _! }7 f mov bx, cs
$ _# r) t& K& V- G( _ lea dx, int41handler27 U. \: |6 r: h
xchg dx, es:[41h*4]' m3 X+ }( v/ M3 d2 p
xchg bx, es:[41h*4+2]/ F2 e* C* r) n8 Q
mov ax,4fh+ M" u, P+ j! `/ `2 E
int 41h
, c' L. }) G: k3 ]; {6 J xchg dx, es:[41h*4]
' K( }) B' B4 }0 `, s0 v1 d: q2 B xchg bx, es:[41h*4+2]9 l% j* B- y& @& J0 B3 H
cmp ax, 0f386h$ z$ O; I7 G: [* D! R
jz SoftICE_detected7 W% R3 g; I2 R7 a6 x
6 K3 g8 l8 m- X1 n4 `! q2 p% c
int41handler2 PROC
3 Q* k/ S/ g( b# U( c/ l iret
( w( [- F& F8 L1 U0 U/ G! Aint41handler2 ENDP
. u0 O6 ~/ i) E j1 B
7 c, J( m, `9 x! \3 C+ p. {; x- D v$ a
_________________________________________________________________________
& y# f: R- y$ y( O0 Y1 u- t. Q3 f9 y5 i" {# }: I
, e! n; X' j6 }( qMethod 06
2 Q) p6 X5 Z2 e& x) a8 ^5 g=========4 H$ I# A! t! A
: q1 q# L7 y3 g6 u/ }# Y+ n6 i
0 q0 N+ c- _ L1 J6 V2nd method similar to the preceding one but more difficult to detect:
, V. E- d* r5 b6 V$ Y( b9 M+ W3 a7 c+ n0 P' z* O/ R
& X4 P; ^, g- J8 R) c- W
int41handler PROC
; N7 [/ g& E$ k5 x* `5 F f mov cl,al- S- w! e+ x" ?' q( H1 t( s
iret
% H5 J: b$ x! qint41handler ENDP
; C3 R3 r, I y: |4 Z/ V
$ j4 g- y' y+ j! J# e7 q8 u m3 b. N9 u0 K
xor ax,ax
# _* S) B1 L, h7 W; ] mov es,ax
# T% j* C& O. C+ U. O3 r9 Z mov bx, cs
2 H: Q1 C1 V) ]$ g& @/ \ lea dx, int41handler
- y k; w3 `1 g, O xchg dx, es:[41h*4]: r4 h3 S0 n8 M& ^, t( j
xchg bx, es:[41h*4+2]
% ]5 p v. F' E9 l! f1 z in al, 40h
' U/ |9 H3 k j0 {; b xor cx,cx1 w; Z" h. x0 Z0 E4 |! Y
int 41h( L2 _" ]3 L% _0 P
xchg dx, es:[41h*4]5 t8 J& b* [5 i- l& W* c6 W" a
xchg bx, es:[41h*4+2]
! m5 Q D9 C! G8 \7 \# n cmp cl,al8 K- a# |1 v) T5 b5 T
jnz SoftICE_detected
8 n' S& |# y; E& s$ x: ]0 Q# Z0 z" \: t9 @6 z9 g: Q
_________________________________________________________________________
7 N3 i) {: x9 `6 K" L3 K" R
8 f; j* I A1 M" A" DMethod 07
) I4 D& N0 Q4 i=========* P* n7 V: _# C. A; w; _ i
7 \9 I: i k: ?4 t% g6 A0 o. GMethod of detection of the WinICE handler in the int68h (V86)4 M1 ~1 ^% M! g, ?# v
$ ~) {+ U9 p' [ N( [ mov ah,43h
5 y1 ~, g- r0 }8 }; q7 t& g int 68h1 ?# w2 Y; b, F2 a K( m
cmp ax,0F386h
' H M8 ~( { s: d3 f jz SoftICE_Detected2 [ o/ Y4 v! l
" y1 w" p1 o& ^% N; n
/ m1 n& a- ]3 g& k& }! w=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* _4 t5 h' p* Y) g2 y app like this:* v( V4 \: v5 i$ I4 T$ x
8 B" v2 z! V8 p6 K: u1 v6 J5 W BPX exec_int if ax==68
* h2 h' Q5 E: W* }2 Y (function called is located at byte ptr [ebp+1Dh] and client eip is* i% S9 r3 g8 Y# p/ u
located at [ebp+48h] for 32Bit apps)- {! B) X- }9 M* L: r5 n7 Q+ Z
__________________________________________________________________________: A, d! r1 ?( t/ l' ` E
% D. v, ?: f+ ]% @1 c* l; |! p( U9 D5 p
Method 08
4 Z! P: ]! }2 z- }- e=========. B1 H f4 Q9 M( o" u6 H
$ i3 m$ Z( f6 J; E$ W* d( }
It is not a method of detection of SoftICE but a possibility to crash the. O/ T- d; @, @6 E2 O/ o
system by intercepting int 01h and int 03h and redirecting them to another# [' `4 Y- X* I$ _4 ]
routine.3 w1 ^ w! z, [, x$ \
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 k& D- n- q# S3 K3 ?) ato the new routine to execute (hangs computer...)
: @- Z; l1 z; p1 {+ ~& U1 Q5 r1 c+ w- ]. E
' x+ Q+ i8 r2 y2 V mov ah, 25h
8 E. _5 |5 I5 q) n7 ]. B mov al, Int_Number (01h or 03h)( G" [* j- f7 U7 S
mov dx, offset New_Int_Routine
. m# z* t2 [5 w' O% I: I int 21h V9 B, e* S% ^. Y F
: Y/ ]- t5 w8 Z! M__________________________________________________________________________, p4 n0 |+ s# @8 i$ R
& U; k: P1 ]( s1 gMethod 09
7 K1 {* w* {, i$ K+ @: ]=========, u# p2 H; a. l# K' W
: t. J: Y- g; uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only: w4 L/ z3 \5 o& Y* a$ B) B
performed in ring0 (VxD or a ring3 app using the VxdCall).
* u2 z% |- X/ {5 C$ h* sThe Get_DDB service is used to determine whether or not a VxD is installed
( J1 p, g+ W |; A. mfor the specified device and returns a Device Description Block (in ecx) for! x3 C! r5 I5 Y3 {, [
that device if it is installed.
, y& c) j# P4 |7 `) h' ]5 e7 g" ~6 j9 w. k/ S; k
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 E4 R- {2 j: M0 |2 ~, U) o7 w
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 _. W, [0 m4 {* `9 W- P+ m4 i
VMMCall Get_DDB( j) w* F2 Y) ^8 u+ i% s
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
/ f R; i8 ~& [7 U! q/ Z _: d+ p' p# W6 p) S
Note as well that you can easily detect this method with SoftICE:# M$ j7 s8 K, a- F9 j7 f
bpx Get_DDB if ax==0202 || ax==7a5fh. V! x) U: z& p" v* x
4 `0 Q% u2 Q+ \6 p( `__________________________________________________________________________. ^8 l L: K) h3 u7 q0 W7 ]' K
* Y. F' V, p1 V5 D& H) X
Method 102 N0 m* ]$ {# n k3 n
=========7 @' l( z$ U- R1 x
$ E3 x1 f8 f9 [=>Disable or clear breakpoints before using this feature. DO NOT trace with
8 S, R2 Z9 A2 m SoftICE while the option is enable!!
# v( L6 _2 T$ }3 n' _5 L# T" h
) A9 N3 _- \; {1 s7 d# }( TThis trick is very efficient:# a- j+ F: y; S% t! D: k# R
by checking the Debug Registers, you can detect if SoftICE is loaded% z/ d/ R8 b0 x' K; k
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 y; q: x9 q6 O- u2 l3 E2 g2 b
there are some memory breakpoints set (dr0 to dr3) simply by reading their& S, }; T7 l* c5 @
value (in ring0 only). Values can be manipulated and or changed as well1 ]. W+ b6 c4 M2 |% P
(clearing BPMs for instance)
9 s# s( E a# f5 \( x
- l9 u8 O2 P/ `__________________________________________________________________________
: H4 o6 f$ h4 `% q+ ?. |7 _ k7 [
: |7 f3 }& N3 Q/ x3 F- `Method 11
0 Q' R6 s; ^5 N' [0 A, j=========
- y$ A) m2 B" W
5 r. K7 n4 [, w" y! lThis method is most known as 'MeltICE' because it has been freely distributed
- l S8 r- T3 D" ^3 nvia www.winfiles.com. However it was first used by NuMega people to allow
5 V- y, }( l& M; jSymbol Loader to check if SoftICE was active or not (the code is located
6 x- e+ ?5 D4 b7 Ainside nmtrans.dll).6 n; P% l1 m, t: Q/ ]2 U+ ~5 T
1 t7 U% g6 d5 ]! R
The way it works is very simple:/ D: {# i& e2 N( c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
. U8 v& q: V( t5 x% T, |2 K7 M4 nWinNT) with the CreateFileA API.% R! Z; \4 M; f+ V2 d
- s' x, n8 d$ i5 w# m3 L
Here is a sample (checking for 'SICE'):
. P2 f# v5 S% k% d9 K' p/ I5 F, l! E: U* m, ~& l5 W4 b: a7 O
BOOL IsSoftIce95Loaded()7 W$ _4 l8 w: T$ [
{# c3 m! ~ ~# t. Y6 G
HANDLE hFile;
9 V. j* w2 l6 r2 h5 \ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% }! W- F6 x4 h FILE_SHARE_READ | FILE_SHARE_WRITE,
3 }* I. [3 W% m/ j2 D9 t6 [, Y! y NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 e6 l6 w9 b$ t/ Z% w
if( hFile != INVALID_HANDLE_VALUE )
5 ]6 m. X! r, R3 j6 Y: |6 [; L {
9 F) z9 o8 Y+ w* E* R8 u CloseHandle(hFile);$ f- o3 f i* v' e% r* q1 ^( R1 Z
return TRUE;
) T9 f; u# d# o6 l$ o7 J4 S }
; P7 K+ @3 \2 J' A4 o: T return FALSE;9 r6 Q; Z4 o. ?/ I8 b- X, s
}, n; Q: l8 ~% y. c# {: H
2 g% V- |4 r3 m, e2 V; {1 C. n
Although this trick calls the CreateFileA function, don't even expect to be# }; i6 g/ Y0 L+ O0 E
able to intercept it by installing a IFS hook: it will not work, no way!
& D9 S! v+ I/ ~ t3 m, U. b2 Z2 |In fact, after the call to CreateFileA it will get through VWIN32 0x001F
! h- D2 X% f, uservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). U0 o Q4 l6 Y2 }! _8 l- T
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
8 j, ]/ G* y) e V& e6 N* _field.
# E$ t8 x' S- [2 ?/ J1 d; {- r* DIn fact, its purpose is not to load/unload VxDs but only to send a
0 F+ l' m/ U5 d/ F* [8 gW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
0 h0 v" \# Z9 n" o' [to the VxD Control_Dispatch proc (how the hell a shareware soft could try$ ]/ F5 f* \5 A3 c
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ d8 S. l! x/ X* s3 m8 l1 T! P, U& yIf the VxD is loaded, it will always clear eax and the Carry flag to allow! k+ w3 ]. O6 A+ m% H% E
its handle to be opened and then, will be detected.# B2 G" D3 e, ?$ D5 G5 y. g$ s2 Y
You can check that simply by hooking Winice.exe control proc entry point
* Z% V% e* B! R) b" Z+ }; ^while running MeltICE.
& d# E1 c6 K4 _. k8 { N0 n `) ?( ^6 W, l4 F; V: v# C
7 j9 ]( u# `( t 00401067: push 00402025 ; \\.\SICE
8 ?! [+ P' h. m 0040106C: call CreateFileA
4 W( k! D3 `+ ?! Z+ U 00401071: cmp eax,-0012 d& `' p4 A' X. E: B5 Q0 w0 ^
00401074: je 00401091 y. c% X F# i
% a/ M$ O5 ]% b, @. `0 K4 J! c2 K
9 Z7 ?8 D. y3 h" c# ~9 `1 A) G5 XThere could be hundreds of BPX you could use to detect this trick.
; Z7 V7 \( b& t/ a8 p-The most classical one is:
1 }$ m$ ~6 r' H& C9 A! q: a BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||0 K. X1 K$ f9 g
*(esp->4+4)=='NTIC'
9 m% g! \# f# u6 s$ x" j8 j( l( n$ C t/ O7 r
-The most exotic ones (could be very slooooow :-(
& O% E! @& `( ^ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & D8 J" m" ~9 M4 I1 E9 H' P
;will break 3 times :-() X, x8 w: k3 m/ G; f
1 ~- J9 }9 y* I( n4 w% T: o-or (a bit) faster: : U+ Q. }$ m- S: {0 m" M
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')7 N* l8 T; G& E6 e- Y4 Y$ W
, Y; ~/ Y/ g+ w8 \ BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
( r$ @6 v' M( P" q" ?% a ;will break 3 times :-(0 \4 N- s% H" |6 B% @. P* G" \
4 Q5 w: P7 R2 S$ p5 j
-Much faster:, s- {+ R) @# z% d% k" y
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! W1 R9 ~' ~' f; {( q: ^3 |* @0 V9 J4 U6 m9 x7 m: p2 `2 e
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen; Q% O! Y3 C3 } s2 F, R6 p
function to do the same job:! v6 \$ F& I$ C& `
: R/ J. S1 q+ U+ [. m: Y% p push 00 ; OF_READ
) G' n- _# z' r3 h; v mov eax,[00656634] ; '\\.\SICE',07 K o! k" ]. a
push eax( n3 h2 u" M9 i8 w' M
call KERNEL32!_lopen
$ V, c7 z% ~3 y( e! K inc eax
. f9 V5 ]3 b, m Q' {/ o jnz 00650589 ; detected
4 d. }" k$ Q2 Q/ \ push 00 ; OF_READ' @( f: {4 f' G3 x
mov eax,[00656638] ; '\\.\SICE'
7 I1 m6 b* E5 h; b, _$ }- d push eax
; r/ \7 Y) z+ H6 |! } call KERNEL32!_lopen
6 E/ O+ V1 h8 V6 T+ z inc eax
+ u2 \( S7 \' U4 e. Q2 }( s jz 006505ae ; not detected r' m* W/ ]) |. h
6 ~5 I8 n8 ?! H& E
# _0 R; i: _* N9 `" d__________________________________________________________________________
# e' A: O& e$ A; N3 p8 I
- ^8 X- H. k- } p. QMethod 12
: X0 e, ^; X" i8 t5 Y=========. N( x8 X5 m# S6 u. V9 c& ]
$ ? U6 W- s ?. n) {7 O, Y* d
This trick is similar to int41h/4fh Debugger installation check (code 056 r3 o0 v w" ^8 }8 [ X8 u
& 06) but very limited because it's only available for Win95/98 (not NT)
& I( e4 t/ Q9 s/ t& \+ {as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' ?, A# ?" |. U3 m8 c
7 D: S* z# j5 V8 j/ n
push 0000004fh ; function 4fh
" y' E& r/ I, _ push 002a002ah ; high word specifies which VxD (VWIN32)
; r% x% d5 _& P, Z* } ; low word specifies which service+ h( E- v) N6 I+ Y# x8 [5 T" v! j
(VWIN32_Int41Dispatch)
+ y' s) P% V6 N! F$ x6 I( K2 ?8 \ call Kernel32!ORD_001 ; VxdCall
# u& ~( ^, ?6 D3 B1 c cmp ax, 0f386h ; magic number returned by system debuggers
7 a+ J+ E0 }6 Y! J3 {! V9 \ jz SoftICE_detected
* V7 ^1 J: n2 ~, p2 `
" C3 U6 Z- x3 Y& |Here again, several ways to detect it:$ A$ [7 f' w2 f+ k, m, C0 ^5 P
& t0 r" b, Y0 o4 ]; m: |0 w2 w BPINT 41 if ax==4f
5 y. n5 `, W3 E. x: @8 D
' S/ [, V7 T' h: R6 G! o3 j2 p BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
- K$ B( D1 g. R7 L' P$ c( e8 Q( T- J$ Y
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A) B/ f. `9 \' V2 ?- r( O: `4 c
3 d! M) X+ G: F3 Y% v1 ?# P BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* k1 z, |& \* @/ F( b9 N, W: Q; y* E: Q7 x
__________________________________________________________________________5 B( n; Z) c+ k9 r* B) _$ ^$ d
" R/ ]& G+ T8 NMethod 133 n& m3 z$ ^, Z
=========
; q+ e/ j3 q- a; _% B. A1 x1 s* r4 J9 E9 \" J( {9 v- m7 ^% ~* Q
Not a real method of detection, but a good way to know if SoftICE is7 g( m$ z" P/ X3 a& _2 a
installed on a computer and to locate its installation directory.
) o3 |6 o9 X- N) p( K SIt is used by few softs which access the following registry keys (usually #2) :3 r! j8 _2 m. b
; D6 l, L2 g8 z0 W+ \-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 v- Z- w3 a* O4 C\Uninstall\SoftICE0 X. a3 d; N2 [) y- P! \: I
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE# N" H2 K: t1 P+ H
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 [2 L! U* ^& |- G0 P6 L7 L" `
\App Paths\Loader32.Exe4 z' y& b) B* j% r& D1 s
* i' A! Q. [" `3 s% k
2 M, c" |' \2 P. k( e( @. ~: E$ \
Note that some nasty apps could then erase all files from SoftICE directory2 M* u4 c0 A- s% d' V; U3 m* M* E
(I faced that once :-(
" W$ m3 D; l1 C/ N$ |* h9 J
# `+ P' ?2 ~, Y: g* U' yUseful breakpoint to detect it:; \* @) u; T9 {3 A" Z
' X0 k6 }7 ^" G& r: t
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'' c3 P# G( o1 i3 p6 J3 Z
2 E4 T+ \- P0 s! F; `
__________________________________________________________________________9 m8 J6 Z7 U$ m: ~ M: q4 K2 t, Q
* U9 O( n* m& L+ m H
" c6 ~; m; h9 LMethod 14
2 s4 \6 A$ D/ Q- O: B=========, K& S9 v# v2 m4 Z) F5 U
- I3 a- c9 E* _5 b/ ]. [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
6 j) Q# B& k6 V. q) ?# Q' Xis to determines whether a debugger is running on your system (ring0 only).
% \) T+ f/ Y6 s9 P: _ i: e! L) H" Q4 [' }( d- [. H
VMMCall Test_Debug_Installed2 ~$ g0 b2 n7 E, D! ?0 a1 r
je not_installed! K8 ^* t1 o1 x
# M) f; s) Y) F; ]This service just checks a flag.5 t* `! i* C6 D4 _/ D
</PRE></TD></TR></TBODY></TABLE> |