<TABLE width=500>2 O8 G( z# f& p, c" b0 x8 V) P
<TBODY>! o# {6 U J2 q* j: l5 x
<TR>
$ C( V$ w4 y4 k: k @<TD><PRE>Method 01
/ x* w! f# R1 `3 } _3 }) g5 ^=========
! ~# P9 W# B, @8 a2 S' Y! U; ~, j1 O% }
This method of detection of SoftICE (as well as the following one) is
8 ]- A6 U. l! ^$ qused by the majority of packers/encryptors found on Internet.- s' ]& S$ K; {. ~# f, }0 ~7 O
It seeks the signature of BoundsChecker in SoftICE5 M) z9 A5 X7 w8 I
8 \1 }# L1 w4 i4 A! e
mov ebp, 04243484Bh ; 'BCHK'3 l$ z+ e4 k0 P1 E8 A
mov ax, 04h" [5 E. e) i6 m1 s# w, n2 Q
int 3
% o# ?/ d9 d1 e cmp al,45 \- G2 U s4 k( ~
jnz SoftICE_Detected! I6 {# g! P4 _+ k+ b( r
: t, Z6 ~2 P$ h% ?
___________________________________________________________________________7 l! E% M$ }* U: J0 X6 t1 {) N: @
3 {) J/ d* y* E
Method 02
) z8 ~* _- ]& x=========
7 i. g9 N6 o) }' K/ F' G# M. Z1 E2 C. R
Still a method very much used (perhaps the most frequent one). It is used7 X% D, J2 j w. E/ U. N7 j
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
, W. z3 }1 j: [* tor execute SoftICE commands...
& H1 o3 d; G; S, h9 s$ RIt is also used to crash SoftICE and to force it to execute any commands( o# m( \ n8 X% [0 u/ C: b
(HBOOT...) :-((
0 h0 {9 B1 F& j$ T/ B5 o! M G* e7 x' n& P6 U% H0 Q3 M
Here is a quick description:( |. Z. j1 p$ a( M( ^( o
-AX = 0910h (Display string in SIce windows), j5 h7 e6 N% n+ T, `0 s
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx) ?" F2 l H6 ^) V! Y
-AX = 0912h (Get breakpoint infos). S- t, g1 I/ h+ ?
-AX = 0913h (Set Sice breakpoints)* b9 b! V: H3 Y( k! x& ~
-AX = 0914h (Remove SIce breakoints)
# n/ q" t, w9 N" G
2 O2 ^; @: f6 r: XEach time you'll meet this trick, you'll see:
^" l) E/ h) Y8 x$ s+ o0 ]-SI = 4647h6 Y2 `' R% u6 ]; z& H" U" M
-DI = 4A4Dh0 r% S( R; L. E4 k5 q) T
Which are the 'magic values' used by SoftIce.: K3 ^. L6 t( e% H8 y
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 D) l; s" t2 t* H, s, G5 ?+ c# X, o
7 v% J3 d, I* CHere is one example from the file "Haspinst.exe" which is the dongle HASP
- f% o* U4 T2 l" U6 d7 TEnvelope utility use to protect DOS applications:6 d8 S1 x u; u* s8 B E/ i; J
5 Z0 N' ]* x9 L& p$ x3 s# p& K0 |, j( i! V5 b
4C19:0095 MOV AX,0911 ; execute command.: w/ _" N1 o6 {
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
) b0 n' \ }1 T% Y4C19:009A MOV SI,4647 ; 1st magic value.1 X' }6 `& N' p1 z
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 W+ M6 P [5 i4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)1 v# ]4 ~( i) Y. B
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 u1 S& _/ ]2 i7 b4C19:00A4 INC CX4 J" ^! R) M. G% q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( k: b. y6 ?/ X$ a4C19:00A8 JB 0095 ; 6 different commands.- r6 t' m- x/ g. r4 R* V0 c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
$ a$ F$ Z" o+ W! \4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& w& U- u$ p8 {0 M. O9 [5 q2 C2 @6 i+ M* g6 s8 [/ u' N
The program will execute 6 different SIce commands located at ds:dx, which9 t; E2 U$ q+ B$ Q+ G1 |; x/ Z. Y
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; U3 ^( J4 c: b5 v) g2 A
' d4 ]4 M* M, ?9 K* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.% d# T1 O9 s+ {4 Y) E3 o k
___________________________________________________________________________8 K3 J6 J: C# Z! F* k# }
' V( n9 A9 p. y& ^3 ]/ p' Z1 [5 g
Method 03" p, y+ l2 C4 | k
=========
7 X; ?# d+ z6 p8 @4 H: u/ \
+ U) @* K* Z3 s% E1 }Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h4 c. G4 ~3 L" ]5 a2 L7 h
(API Get entry point)
7 k+ Y4 r' a9 J% _ ) i, q& X, n6 x+ K& M2 M
- k, s* F1 F7 ~- V
xor di,di
: v- b7 H2 c8 A& ?- g9 q6 G mov es,di
V! z1 e& ]" T8 A. t$ U3 R) Q4 z B mov ax, 1684h ' h2 Z' w, A9 B" o% |
mov bx, 0202h ; VxD ID of winice" O% U, m% y8 A& N9 L3 o: |( U
int 2Fh
4 M7 }& o4 ^5 N) C mov ax, es ; ES:DI -> VxD API entry point
: ^# ^ l0 B# p% o& d! g add ax, di
+ z& @8 I/ C$ ^ test ax,ax
( Y: h* y7 a6 g. e! S, K) I& Q9 m7 N jnz SoftICE_Detected! q1 [2 {6 @* ?+ k
! H6 t0 M x) l; k& w" P# {0 |___________________________________________________________________________# a" h# |) v7 f0 w* m- L
* U; e/ M M$ w" Z3 p/ W) t/ \
Method 04
2 `7 ]* x1 j; V' P5 Q9 ?$ g=========; O/ q2 w+ w2 }( p
& Z7 c" z3 A' @* `/ D8 z
Method identical to the preceding one except that it seeks the ID of SoftICE
2 Z8 z( }. D* u; l3 PGFX VxD./ X5 y h) I7 @6 ]0 E
m6 k8 v) R5 m/ k xor di,di
, k, K9 e* }: @/ V* S mov es,di+ O, `4 S) e9 e) B$ ^4 ], B/ W
mov ax, 1684h / L3 Q6 s$ I' x, B& l
mov bx, 7a5Fh ; VxD ID of SIWVID+ z5 @+ n# R6 e. m
int 2fh" [: e% J" Y- z* u- G- k
mov ax, es ; ES:DI -> VxD API entry point+ S* G" U2 K% `( }- H: ~ }0 k
add ax, di0 r6 G7 Y: v) G2 L( S7 a
test ax,ax; _+ j+ x9 b% B2 z! \ V
jnz SoftICE_Detected& O' M: V/ J/ s
3 ~5 U' X) _0 l* v% n. a__________________________________________________________________________
) n: L U6 J+ s: `( I2 t, Z+ Y0 P, H0 r2 t' b" S. J
6 [0 L' c# v$ [4 ~, ` mMethod 059 F" b8 q/ T$ X; M# l/ L" H A, b
=========8 g) h7 j& I& I, ?, f. e
& f' Q7 V/ I( `* U1 @Method seeking the 'magic number' 0F386h returned (in ax) by all system
' v8 b, d% Q7 D; ^debugger. It calls the int 41h, function 4Fh. q6 d4 v# q5 D3 g7 F
There are several alternatives.
) R. C. F% O% W3 K9 l4 f/ E. x5 A c- Q$ O5 W* Q
The following one is the simplest:
8 F: b1 G0 E- D, |5 p! }+ F% d3 k( {/ A) g( R# M
mov ax,4fh
7 j8 d9 E3 ?+ h6 g6 M int 41h' U* G, V" _ |
cmp ax, 0F3867 m7 ^4 f; u4 H
jz SoftICE_detected3 E& T( z1 e; A
) G! T, e M* k: j U; X: l
- A5 d8 h0 O; }$ c) D4 J0 i" {Next method as well as the following one are 2 examples from Stone's + ?( f& L* X" N* z; R
"stn-wid.zip" (www.cracking.net):! N8 u; z3 m: A8 [9 S( C5 B) B2 M
' O* `+ Y- l/ F$ R8 m mov bx, cs+ S0 g; V% T- d7 l
lea dx, int41handler2; Z; W# | L; \. |1 ^( L* _7 O
xchg dx, es:[41h*4]
2 Q: M) n1 K7 b8 Q# R xchg bx, es:[41h*4+2]
- X8 E' A, R' L; _9 k/ i% P, p mov ax,4fh: b9 ~0 t) I# r D5 A
int 41h+ h, O Z: H! r" E; C
xchg dx, es:[41h*4]* F( X* N9 k, m/ |, k4 u
xchg bx, es:[41h*4+2]
5 K+ q5 j/ A9 G$ I: j6 D# k cmp ax, 0f386h) {, R; B* t; c1 L+ n! b: R
jz SoftICE_detected
! g9 y8 n, G# S: Y% y( W: M9 Q7 ~) v! o7 d* m5 \
int41handler2 PROC; m* J9 p* }" y6 e
iret' N1 S7 X' b( q) u) J8 C
int41handler2 ENDP
" j2 c: t/ s3 k( N& B/ Y& a+ Y6 w/ B7 |0 _
8 }! R0 c4 O0 N" V% [# m- ^1 v% G_________________________________________________________________________
4 x% ^* Q* W2 q/ | z) O# ]3 Y
% k5 U! H/ p6 r( g
' K4 e( S* Y( d9 f3 PMethod 06
9 T C$ z Z% l8 C=========
! r# H$ y b- k' a: |
; M) o& Y. [( H& C" ^+ G7 \
3 c. k# A$ d7 O. u0 S: W# k2 `2nd method similar to the preceding one but more difficult to detect:4 [8 a# M& M7 R3 o v6 y
) B1 L0 B' y7 w. E/ J* h( N4 B+ @& U5 w+ @! |2 z8 e* o: H
int41handler PROC9 t; B5 V" ?' G3 j0 F; l
mov cl,al
, L) l5 S' \: X iret
' I6 i' B7 f. `6 \8 `int41handler ENDP8 |" R" h1 _2 t6 S. s: B$ B
* K3 E' G- W) p- o
5 V2 l$ \+ S( i0 a9 H xor ax,ax, P, M% U5 b. q' Z$ k
mov es,ax; T7 u6 l" y3 _$ F
mov bx, cs
9 Y" _- \# u# _ lea dx, int41handler- W3 c; t1 g0 ~' b1 {
xchg dx, es:[41h*4]
" L$ P g2 m+ K# j& A xchg bx, es:[41h*4+2]
- g! C; d- H- r' ~2 x: ^ S* Y6 } in al, 40h& |, I! w2 ]( c: k1 M
xor cx,cx
" C- z0 P! F+ F* `! q int 41h
& e8 q. }, d% D0 Q7 `# I xchg dx, es:[41h*4]8 R! J+ w/ y( C: H# d, w5 K0 a$ h- s
xchg bx, es:[41h*4+2]
% l' M- ]$ R% w# u cmp cl,al: X) z2 @5 b1 c2 G/ `' Q
jnz SoftICE_detected
& ?& V9 L+ `% d8 u5 T' Y7 j% P9 n8 X6 J# E$ X. M/ v. q
_________________________________________________________________________
6 |# I% x% s# o
; M- ?; Y" z' p- Y9 LMethod 07) p0 `+ r+ i4 M) N4 E9 s: B
=========
# p/ {* P2 Z3 p6 P% @. m" f# I7 w1 w$ a5 n$ f: f+ W$ Y
Method of detection of the WinICE handler in the int68h (V86). \) V6 _' P: o
+ @0 f, V( J7 \- X mov ah,43h
; F& U6 t+ E2 N' Y8 ^ int 68h8 ^* w& f- Q+ _, H6 G/ c
cmp ax,0F386h
- g3 f: G$ i! Q1 w% T4 y2 | jz SoftICE_Detected
- {3 n0 W/ Y1 I0 ~7 Z4 G ?0 j$ F) c8 \. d
* `1 I' q' M0 w, A
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 a) n1 `' c1 Y; T8 j( p* t
app like this:
( R4 |! ]6 _( R/ B& T
, Y3 X4 p2 j" u BPX exec_int if ax==68
{0 k" h) v @* X (function called is located at byte ptr [ebp+1Dh] and client eip is2 _6 [/ m4 s/ H1 ?, q0 y
located at [ebp+48h] for 32Bit apps)
1 ~# [0 h t8 r$ K: \7 j* o__________________________________________________________________________
* {( X2 {# g1 w0 X- R
1 w( ]0 Z9 R4 b8 g
1 u3 u0 H. u, ]* K, iMethod 08% |" n' U1 {1 P4 D% E
=========% k7 S# p5 g" [
7 h) G9 y9 o5 k" v1 |: R" y& r
It is not a method of detection of SoftICE but a possibility to crash the# N, u8 H' D/ W: ~7 B
system by intercepting int 01h and int 03h and redirecting them to another
3 V. U8 A) ^$ h5 F+ W lroutine.& r# g' K1 x( {/ ?1 a( Z" F
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, A) S8 Z: S. R( jto the new routine to execute (hangs computer...)* E U# j' Z# X5 q" z- b/ x2 Q
1 o# P+ M# |( r$ \; M6 E% A0 Z mov ah, 25h
# X3 N! A6 P2 Z( H& }1 \( E- m9 ]9 u mov al, Int_Number (01h or 03h)9 G; L. `; l" e# B! h7 U4 K- _
mov dx, offset New_Int_Routine
2 }9 Z8 w/ K; n int 21h
7 D; l" u C4 w# L' N1 x3 \) \; q( v) s6 o) c# m
__________________________________________________________________________$ ^, V+ b4 v" x9 \& u# |
& a! v/ |5 e1 C9 W* L( h% D* ^Method 097 Z8 a- L. d: U' F/ ?
=========
0 V- P9 Y$ Q, X5 W/ m, K0 q/ h+ D+ q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
& X" u# Y+ k, J% }+ M; operformed in ring0 (VxD or a ring3 app using the VxdCall).
( z8 P4 Q& {/ wThe Get_DDB service is used to determine whether or not a VxD is installed n+ m& u# X( }9 Q2 f
for the specified device and returns a Device Description Block (in ecx) for
$ j% p: L* c& g2 Kthat device if it is installed.
$ S- f0 x. a; b# V8 E- @* Z0 g3 Y; T8 {/ ]/ s
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
3 y4 q5 I5 R) v, [; K mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
" W6 r5 |7 C, T, |8 Q# K- K6 n VMMCall Get_DDB
2 ]* J) C2 b2 |5 Y" s) P mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
/ [7 [4 r& S9 m% p* v4 V: F# W# ^. S3 B; E
Note as well that you can easily detect this method with SoftICE:
" L, i0 |6 P/ X4 L# f! b bpx Get_DDB if ax==0202 || ax==7a5fh
1 r8 f( A: U6 b4 R
4 W; l' m: ?! e1 t/ \5 H/ M- q- z__________________________________________________________________________ H3 t' ?' m, q1 P( ]1 w5 _6 H* H/ K
2 X, f: r' S, Z8 ]- h/ w
Method 10% I- U) z' ]. R) X. o8 a, Z1 W/ s# x
=========
. G) g" l, o T& r. r
: y8 [8 x; C: B: D8 y+ v- _=>Disable or clear breakpoints before using this feature. DO NOT trace with1 v, f4 K: P/ L6 g1 P4 Y+ x. U6 u
SoftICE while the option is enable!!
% g0 Y. I! H& R1 {$ S3 J7 k; o: d2 N6 r( u7 q
This trick is very efficient:4 e" f: c2 j5 n+ y$ s' ^! G
by checking the Debug Registers, you can detect if SoftICE is loaded
* F7 M- P$ g) D" J/ K, T(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& H# u z1 Q7 c1 u7 {7 ^# ?there are some memory breakpoints set (dr0 to dr3) simply by reading their/ a9 T) {+ l j5 K" i/ { C) z
value (in ring0 only). Values can be manipulated and or changed as well
: I9 |& a# R6 E- ~(clearing BPMs for instance)
' q. k( V* `. g
! ]' \' F! i7 O' {; t. z3 B P# p__________________________________________________________________________
2 a0 Q. m" c$ |) A
, N6 |) Z2 B; z/ K' BMethod 11
+ [! d- s# c# g$ i=========7 Y) F4 s. z. F ^- y
& k# g2 s' }4 W% a; Y9 vThis method is most known as 'MeltICE' because it has been freely distributed
& |: F9 A/ u, z$ E3 [% W% F: Yvia www.winfiles.com. However it was first used by NuMega people to allow
% F2 Q% A$ Q0 tSymbol Loader to check if SoftICE was active or not (the code is located
2 j. J7 s6 m. E0 }/ h; m$ C* qinside nmtrans.dll).# ?; A; S; b1 d7 q/ P
; m: `+ Z" L/ U7 u. kThe way it works is very simple:' i Q5 x- d8 v4 U6 @* e8 T! s
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
; l/ o6 A/ q& K- c/ EWinNT) with the CreateFileA API.
$ I9 V6 R+ o( a3 E+ G8 _8 |. [1 e1 ?0 O
Here is a sample (checking for 'SICE'):
1 b5 s; U2 h+ K: b1 k
% N! t: G* O" m R# uBOOL IsSoftIce95Loaded()2 i, d. }9 e& ~9 k$ v' u/ [
{6 m4 r3 o9 y7 z3 X" {: v! J# t' f
HANDLE hFile;
$ Q K- K$ K' `; a/ W hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
5 i, k9 u! v( {; k% ? FILE_SHARE_READ | FILE_SHARE_WRITE,
+ \8 Z: p' ~3 s/ H, M- }! G7 c NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);8 m0 |0 d7 T5 S7 c, r
if( hFile != INVALID_HANDLE_VALUE )
0 ]0 P" N+ r* v* [( g {0 X# t$ _1 M9 D4 V2 {; F4 ~
CloseHandle(hFile);3 H: H$ j+ N, X6 w
return TRUE;
5 d+ Q- ]9 Z( m5 a8 \& E2 c$ D n: m }
) ^7 [5 ^# P G' m- e9 @ return FALSE;
% h2 c' n6 y. i% ]8 X}, p/ m+ U; K- S s7 [+ a/ m" a
7 S" V. _3 A2 w& c& G% KAlthough this trick calls the CreateFileA function, don't even expect to be a7 X; a# Y5 }$ s* h# }
able to intercept it by installing a IFS hook: it will not work, no way!
% K# U, U9 j k) N4 |5 V$ _In fact, after the call to CreateFileA it will get through VWIN32 0x001F+ Y6 Q6 T3 Y& [$ J1 l5 O1 }
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ S" Q1 I! ~, P% o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
% M, u5 H: y D9 L9 zfield.9 n% l& f1 N. b( ^+ v
In fact, its purpose is not to load/unload VxDs but only to send a
, C* }1 j% \! u: n% P/ O) fW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). z5 \9 W9 t( [0 ~
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ j( T5 h' A& i! ]+ Tto load/unload a non-dynamically loadable driver such as SoftICE ;-).0 e, R- q/ x% Z7 f8 X5 b: P V; P
If the VxD is loaded, it will always clear eax and the Carry flag to allow+ W3 }' G) O9 i' Y# K
its handle to be opened and then, will be detected.* g; m9 A7 A: N; x& P4 P
You can check that simply by hooking Winice.exe control proc entry point
( e. S6 a% l$ rwhile running MeltICE.
' N" m# e+ U7 Z( w' o
) c! Q: s2 p3 T2 X" S* o, n+ y+ W! b- b: Y0 u% ^
00401067: push 00402025 ; \\.\SICE
! K- d& r, D! y( ^- b# ] 0040106C: call CreateFileA1 V3 A. \) d8 _! Z4 {9 Q- K
00401071: cmp eax,-0010 w; d) R, u! a- ^ q; _
00401074: je 00401091' Q$ f( G, B* Y. f2 ]
6 W$ S/ q/ ~/ o" u/ b8 R+ }
$ {7 M- D9 [! M+ \8 l+ ~There could be hundreds of BPX you could use to detect this trick.
% L) F7 ]& j0 Q9 X( y-The most classical one is:; q5 [$ d! c% K
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 |: A) z7 P& c5 a2 \* y *(esp->4+4)=='NTIC'
+ K7 ~5 z" N9 h2 z! |1 V, J) S- z# k4 ?
-The most exotic ones (could be very slooooow :-(6 m+ O+ a; p& N+ |" T
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
0 ?7 O' ^+ F' J ;will break 3 times :-(
' d9 L1 p: ?% Z! }
$ @/ k8 B+ d. s/ j! Y-or (a bit) faster: 1 m8 D4 B$ x2 w& G* }
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
! c$ @% B- t6 |: r+ L6 ], W1 U# H. `7 Y2 d" b
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
& L5 D' l& a$ z7 P6 O ;will break 3 times :-(
( h' d/ I$ V' p w0 i. V k
! C; k; W h( f2 |. G4 ]/ d3 S-Much faster:6 q5 j* L& \: T2 C8 n
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 u9 _# M# j2 `3 C
+ p! x, Q: }$ ]$ ]8 I: G
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen# P. N( y: ?# P- s7 B
function to do the same job:
# E2 f9 N1 b- l1 R) c$ S S' g# w7 D" E) I1 B% A
push 00 ; OF_READ
2 b4 j8 } G2 _9 X mov eax,[00656634] ; '\\.\SICE',0# r# a8 @/ |3 A+ W+ D O
push eax
; H/ J/ u& X# B; C" c call KERNEL32!_lopen! F! V5 @# q8 |' k/ L% h
inc eax
" P/ b/ K+ v# q8 V, g6 Y8 ~ jnz 00650589 ; detected
/ p2 a0 H: Q4 U, ^/ \ push 00 ; OF_READ
1 s, J7 J2 Y# Q/ }7 B mov eax,[00656638] ; '\\.\SICE'! z2 w9 r, ]1 C
push eax
+ ~1 y9 z. f' o call KERNEL32!_lopen: z8 ]) k) ~, S6 X
inc eax& A. S9 Q9 ^! `4 W# L
jz 006505ae ; not detected8 o, m5 s: F% U' I/ B' W
, `+ m% a* p. r; z( S7 p
2 }' m$ B* _' |) o$ ?9 q
__________________________________________________________________________* i5 O+ S4 k" v4 ?
5 G9 |; V9 p) j) cMethod 12
8 K# q+ D- e+ x2 v; S=========0 R Q3 H7 V5 @7 x; I
* p2 i0 I2 J J2 c9 E. t9 aThis trick is similar to int41h/4fh Debugger installation check (code 054 i. Q* W, g1 d4 i$ u
& 06) but very limited because it's only available for Win95/98 (not NT)
2 X; [7 s; M7 D8 W( K- O5 ias it uses the VxDCall backdoor. This detection was found in Bleem Demo.
3 P; S% w8 r' {4 b7 \! X2 H) ~0 c+ ]" t1 R7 F
push 0000004fh ; function 4fh0 k; D& E( x. Y
push 002a002ah ; high word specifies which VxD (VWIN32)6 i/ s4 J _* Z- Q% d l- p/ |2 `' ?
; low word specifies which service$ N9 v2 i' B) |% n: z7 X
(VWIN32_Int41Dispatch)
6 ]6 r9 z5 ]5 ?% h$ C# K call Kernel32!ORD_001 ; VxdCall
z+ b2 m }5 k) R2 T6 U cmp ax, 0f386h ; magic number returned by system debuggers: ]4 ]6 H \8 W
jz SoftICE_detected8 } F& B% t5 D, [0 ~
& b& E9 Q( c$ G9 M+ t- D/ O1 ^Here again, several ways to detect it:
9 x" G, E; w2 U* n
! n. \6 F- L0 B3 K3 n( s3 G BPINT 41 if ax==4f
+ y Q$ p# W6 x- e. G) }$ ~+ Q7 `' q4 z& M# U$ F
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! R# n$ `8 b5 H% H% l! B
, @5 `& X% X0 @; A8 |
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
0 A# w3 t' }5 q. S( U* ]0 ]) S7 x- L( i5 n$ k9 t3 Y; g1 W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!( N, ~4 z( g3 B: w3 e
+ P+ A0 n6 K! K0 p% h6 X__________________________________________________________________________
. _; k8 W& J/ O
+ C8 Q2 d* u. |; N; e, J6 E0 gMethod 13" G% f) o f5 j5 V' x2 M
=========
( h6 d; J+ }; a+ d" f
; b+ [; h. X$ bNot a real method of detection, but a good way to know if SoftICE is
D& J8 f, A0 d: ^( y6 Jinstalled on a computer and to locate its installation directory.2 P3 R5 B5 f+ S
It is used by few softs which access the following registry keys (usually #2) :2 b4 ~3 R) B, b, f
) N% W) P- h; ]4 {* @: u
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' @- q: Y0 p' X& W- K5 j7 h3 d\Uninstall\SoftICE3 H" c+ [* y8 Q- v2 e& W
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
: r3 E. J# a& \-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion \ _9 O" G4 S+ U# O
\App Paths\Loader32.Exe6 k4 I( F/ B5 ~3 L
! @; B0 I* t6 w" t7 [- M) P8 | L
, e2 x" h+ c/ A; ]5 UNote that some nasty apps could then erase all files from SoftICE directory( [( e- E# d; b( r5 h
(I faced that once :-(' x. c+ c! I# N. d8 u- w; p
/ P* S2 l/ k' R7 z7 l7 r2 ^
Useful breakpoint to detect it:
. h" Z7 y) L+ X0 B, ~
4 y6 H0 E0 S/ T* ] BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'; D% `0 P0 n$ c* a& x+ p( k
8 O& w" @1 Q6 h# S7 ~1 |__________________________________________________________________________
3 `( |* r, R: ]( H( T5 J0 Z7 ^1 ?# j- T9 w$ \% |( e
* t" X4 |& D! M! g7 f- D
Method 14
* [9 l6 ]% W, G: G=========( R* ^+ x0 v" I M. l
/ L x8 K' U \ ]5 GA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. n" |' k4 r+ z8 y2 j2 t& c9 u
is to determines whether a debugger is running on your system (ring0 only).
3 M* [3 h- q2 n" d+ Y, U7 X0 l% f8 o/ l% u
VMMCall Test_Debug_Installed
5 K3 l1 Q# T+ l9 H. w7 ^9 P" c3 | je not_installed: _ M& Q- z1 }# y
/ L4 H" T; Z5 T# H- WThis service just checks a flag.
( g* \0 S( R$ c9 V3 x9 k3 E3 F</PRE></TD></TR></TBODY></TABLE> |