<TABLE width=500>/ F1 \) E! c) C6 L( p- ~( j1 F
<TBODY>
% H, V+ T) [. N+ M7 M<TR>
2 a- e& C$ v* T<TD><PRE>Method 01
) T, g: F$ j7 ]3 E8 ^) F( }=========
* G8 n F' C6 b1 {; S3 a/ S% M$ L3 ~- i9 l' c
This method of detection of SoftICE (as well as the following one) is
9 ]6 C! z+ Y; y; |used by the majority of packers/encryptors found on Internet.
) A/ V: @" P- ~8 J; q; W/ aIt seeks the signature of BoundsChecker in SoftICE0 z) E4 D4 E( [( E! B/ u# u6 w
9 |: [ I5 ]% [3 ^9 _; j
mov ebp, 04243484Bh ; 'BCHK'
' U3 A; n" E# F1 H8 w! u mov ax, 04h. M+ C- ?/ d' C. I$ G; d
int 3 0 Z/ r) R* `/ t1 Z* M
cmp al,4
/ g- f; `/ M5 \ m/ m4 C* M jnz SoftICE_Detected" o, { {% |. r' W/ y+ Z/ F" |( x
' Z4 T. r) ]. `' \8 U5 u4 L___________________________________________________________________________/ F* u& c! e/ q& W Y' m' B
. _ m6 t2 I* U {$ g% b {& e
Method 02
# p) H3 s6 P) i9 l( u) I6 I=========4 Q) B- d1 h [7 L
9 ^" i& d" x* P" K
Still a method very much used (perhaps the most frequent one). It is used
# P$ D7 V$ c3 B) |" V6 f9 q Hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ x: C. |+ @! p: \" I H
or execute SoftICE commands...; d: l! }8 g8 J C' x& x- d2 ^
It is also used to crash SoftICE and to force it to execute any commands4 a) S0 Z3 {9 m, Q X
(HBOOT...) :-(( ! P. q9 L8 ~3 u) m
_$ t8 o1 ~/ U# f. x
Here is a quick description:; a" Z+ I' w v8 o8 U. _
-AX = 0910h (Display string in SIce windows)
( t- r8 j3 y/ S) F/ r* X-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)4 }) ^; y2 w) ^' f, Q2 ^/ ]
-AX = 0912h (Get breakpoint infos)
) o* C& l' }# R- t2 e-AX = 0913h (Set Sice breakpoints)6 T) b! T# g9 c! i
-AX = 0914h (Remove SIce breakoints)- ^- ?. Q: W) S# ]; X! U: Y( k
; k* W8 O B7 l; W+ OEach time you'll meet this trick, you'll see:- }* H/ O9 x0 f4 o
-SI = 4647h+ M( Z7 w6 Z" }5 t# c
-DI = 4A4Dh+ p, q4 a/ N: D" p3 E! W
Which are the 'magic values' used by SoftIce.
0 T2 t2 ?. d; g- J4 z4 ] yFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
/ t% M8 J( h; W" d: w1 W/ y: P# x6 U" I- [6 D
Here is one example from the file "Haspinst.exe" which is the dongle HASP3 l" q5 C6 f4 {
Envelope utility use to protect DOS applications:2 T$ o8 O) W% w( \9 m2 `8 K$ t
2 e+ ]; j! s& v8 `7 g0 Y/ f
- S3 i/ d. b7 _" G& e4C19:0095 MOV AX,0911 ; execute command.. j% g, R9 M. v# P- t! K
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
& C8 y; {' q# s( q N2 O; L4C19:009A MOV SI,4647 ; 1st magic value.$ i$ P. S [/ |# {
4C19:009D MOV DI,4A4D ; 2nd magic value.2 N3 [/ I) Y( |- J8 I* X
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% k% f4 E% _& H1 _' w4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& K: G; W5 k6 _6 r5 f4C19:00A4 INC CX9 z+ I$ v! f5 I' A) G/ N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 y' i) f: z& |. i( w4C19:00A8 JB 0095 ; 6 different commands.1 r) r' o: E. \6 M: _
4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 n Y: R$ \ C
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
4 |3 t4 S9 B: v" x, r5 n, @1 f/ T; [ F9 _/ b3 s1 {/ i
The program will execute 6 different SIce commands located at ds:dx, which
7 j$ Y* `- {- @9 r: Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 ~7 S! I4 E$ R* S, G
/ n. R5 |0 O8 d ~, q+ q7 R* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., L' q" l3 g6 R" E0 d
___________________________________________________________________________# R; r) z# Y5 r. S3 b4 z
% A: @( O( H" a9 G! e( A/ x g. J$ v+ o6 L- F2 y
Method 03
$ p5 o+ Q2 V7 r. D/ a=========7 x" `, `$ ]# X' N
8 F- S/ U, x5 y9 D1 r# q( eLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. S/ P. n: S+ b- h/ S3 b! U& [! a' t
(API Get entry point)
2 G/ \7 r: p. E$ D
% _( ~/ E/ w3 z( M9 q
0 i4 x2 t9 y2 J2 k! c5 b- n xor di,di
% z8 B$ p7 @8 K/ z9 p6 ^ J) y mov es,di( ^' s# J$ I4 y+ C$ ^0 t
mov ax, 1684h 0 L. e' Q% ^' t. L9 L
mov bx, 0202h ; VxD ID of winice
8 q: d/ ~( S2 d9 @3 B int 2Fh
' @$ S6 E, o& `9 G( \" L mov ax, es ; ES:DI -> VxD API entry point: T9 l s- K( y
add ax, di) o+ t8 p# }" P3 P! [3 k
test ax,ax
, K3 I* Q/ V2 [' L7 ]" D* T/ F jnz SoftICE_Detected
/ k6 n3 o5 r* S
7 m& I: h! a6 ~0 }, A6 r___________________________________________________________________________
+ o" c- V4 ^; [% g I' m) P$ { Y, H" X7 [2 L5 S/ ~. c
Method 04
/ c4 O8 s# H" z P0 F: j========= g | q. ^! ]" I( \2 p7 I3 V0 U6 I- ~
+ ~1 ?7 G' `) y4 b! [) V/ |
Method identical to the preceding one except that it seeks the ID of SoftICE
% X( k& B8 K* E, r: L2 {GFX VxD.
7 p9 | O2 M+ n m; b E5 ~4 |5 A1 M u
xor di,di
* A& l" Q: X% K6 N% D" g mov es,di4 l' U# X4 C1 F5 e+ @
mov ax, 1684h ) c k4 |- ?3 K# ?$ q( Q7 M% j
mov bx, 7a5Fh ; VxD ID of SIWVID
- N* I0 P7 n$ k9 F6 F* [ int 2fh
2 |/ b( n( |- ~! t2 Y mov ax, es ; ES:DI -> VxD API entry point
* U9 q/ D- M* {- ~1 u! K8 ?( w add ax, di
1 c: d" Q. t- @+ @ test ax,ax
5 c+ F, X& ~' ]+ q+ y jnz SoftICE_Detected
% Y& r5 @, v& ]9 L( t8 s9 K) k1 F8 e8 b5 g. P7 l& A
__________________________________________________________________________ r4 z# p8 o' D& a- m5 G
. _) _4 V( Q% G X- b
. E$ \3 A2 i" {8 [4 c3 hMethod 05
* V& y5 G9 ^: |8 ], u) }=========4 H5 c+ R. X& D! v
- r& A( J9 x+ ]! n. yMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ G: h$ d+ `4 r4 I
debugger. It calls the int 41h, function 4Fh.. t" h! A( T. a9 A
There are several alternatives.
% a; g3 l1 T1 M+ F' b* v
) v' i, A3 K; MThe following one is the simplest:9 K% y5 g4 G2 |5 _9 j2 n* E
! o! d. I/ h# F+ k! C) a0 n$ P
mov ax,4fh
: v+ y$ E2 b' v3 N) l. V% M int 41h# O1 O) D% P6 T0 I9 S1 S( U
cmp ax, 0F3864 @# { J4 l2 J
jz SoftICE_detected4 \; G* b0 }% }3 f7 @ n
" J6 @0 S% j5 Y: a/ T
; z; B @% S/ @7 [- ?' I0 eNext method as well as the following one are 2 examples from Stone's
6 }5 j. J9 o, z' Q"stn-wid.zip" (www.cracking.net):
( E/ A$ Y+ O& H1 \/ U
7 j' Z0 G) A8 O+ H& u! T mov bx, cs
. Q4 j: g1 a3 L y lea dx, int41handler23 ]$ v5 S4 v0 F( B* W, D
xchg dx, es:[41h*4]5 b3 P$ @ K2 m. M1 [$ ]3 F: S$ q
xchg bx, es:[41h*4+2]
1 q+ V# U3 ?: x/ _" p) U$ l. _6 W: n mov ax,4fh4 I' S' E& G2 i: c+ U1 ~; E& D; S
int 41h; Q* G; X7 L: [% Z
xchg dx, es:[41h*4]4 e8 r1 A3 Y) A- D5 V8 H
xchg bx, es:[41h*4+2]) A: X: k: y9 a$ S
cmp ax, 0f386h* a3 j3 K( L4 @
jz SoftICE_detected' m1 N0 _$ [" G+ r0 [8 p9 [
+ A4 S6 r" l1 Z2 U
int41handler2 PROC; W9 B% f0 e* M) H: t1 i
iret
4 m! y, B2 a/ Xint41handler2 ENDP1 j2 J" B& E2 O
% l. S) B7 v% A3 u3 Z/ j
; x7 K8 n0 ]# D+ D* E9 c_________________________________________________________________________
" c% T8 J/ `! w7 Y, ?/ i9 X6 c- W
, [6 x1 H5 ]" x: p8 z; M
Method 06. F ?' M C* L& i, r
=========4 R% \" N j0 F* Q% e* L
+ P4 E1 K3 T) Y/ p) d4 q
3 t! z: Q# q' x, F
2nd method similar to the preceding one but more difficult to detect:9 i3 l! K* l: x' A. j0 a& R
7 n" i5 v" D1 |9 f- v, J# ]
5 {# J3 K" a/ | W6 ^5 j! Nint41handler PROC6 M6 {. ]3 d: G/ n
mov cl,al' n+ y4 U4 S L# X/ t
iret2 Z7 H5 U( m. c2 Y: ^$ Q7 P
int41handler ENDP
7 B: Y o0 q6 Y4 g O% ~4 a$ C+ a6 e- w5 w4 n6 d; S! O+ C X; U$ Y) l
8 {+ @! U& |" U& q5 J
xor ax,ax0 d) Y, H- }- e2 w, B
mov es,ax
* {7 Q' Z( t& I* R- j% x: P, h mov bx, cs0 Q; Z1 [4 U; g; x9 M- }; \! i! D
lea dx, int41handler
1 Q, L/ ?1 N" ] xchg dx, es:[41h*4]/ ^$ b( |5 Z4 R9 {
xchg bx, es:[41h*4+2]
! [; u2 V, h. S6 m& D in al, 40h2 e6 N: z y; B) O5 G3 ?* V+ m
xor cx,cx
/ p4 R# {7 ]; @; e7 M& \. h int 41h
0 R7 B& I0 [9 B/ M xchg dx, es:[41h*4]/ T) u/ m3 m+ d8 k/ F; @; g
xchg bx, es:[41h*4+2]4 r* Z& N) k1 o b9 U
cmp cl,al! f9 r; g! w: a9 }8 z/ u
jnz SoftICE_detected
/ u$ {# C# D1 a4 X" U/ a: v# @+ M T9 i+ b$ ^ b9 y
_________________________________________________________________________& l) q# k: ^2 H8 d
9 i( t/ e$ H6 v5 p5 f2 N1 O
Method 07) L% P7 l- O3 N7 k) S: O
=========
2 b7 t. I+ g# A. ~: X% _1 Z: V2 o8 J, @. _
Method of detection of the WinICE handler in the int68h (V86)
( d9 z- a. j. T
1 E) {7 Q2 i' \; M mov ah,43h, O& f& D+ W* \9 P
int 68h
5 r- F" g2 t$ Z+ Q. S( H# {2 A/ V9 ] cmp ax,0F386h/ @/ b- g1 E2 q, S J
jz SoftICE_Detected( ]# y5 z. |: e$ `3 x
& F! j* M# z" V
5 ?( a3 O( s" E=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit, C( u" @+ L) H
app like this:
- r! w0 a' A, M. b+ E* |- k; R( b; }. r; a
BPX exec_int if ax==68
, I0 z1 p. Q0 i/ l' H* b: f" w (function called is located at byte ptr [ebp+1Dh] and client eip is! ]; N$ [! v. j/ {7 B. d3 D
located at [ebp+48h] for 32Bit apps)
7 ?( A6 |- W% y+ R5 F& Q__________________________________________________________________________
@9 Y- B; L) \! B; c$ D% V
q& c6 C( |+ j* b B- v2 a
/ R+ }7 o( q2 w! x( Y" N5 UMethod 08( G+ N; K, R$ P" @6 J
=========
# |( y" o: ^ I: s# [
) {. b6 L( m4 v2 v' ~/ HIt is not a method of detection of SoftICE but a possibility to crash the
! L3 R9 o/ `4 l0 w7 z4 usystem by intercepting int 01h and int 03h and redirecting them to another8 j1 n: H: u; _* q4 c- e+ k& v$ c
routine.+ k4 c G) a) S# E6 T7 x; W0 ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
" }6 T @. G- w% H# vto the new routine to execute (hangs computer...)
+ Y9 }6 @4 \: E3 n2 S
+ A, v! L Q1 U- N" d F& [ mov ah, 25h
2 S- d% k g; B3 ^6 x+ w$ R mov al, Int_Number (01h or 03h)
A$ @) u I P8 U" d; x# ^7 j mov dx, offset New_Int_Routine. k3 U' G6 d* N! Z- f( w
int 21h0 [, u! O; ~7 x; W* i* U0 m
. X f' L* q& z
__________________________________________________________________________
4 n2 Z7 @+ J, \- D! l' E7 k5 \4 T! H9 B0 q4 \/ [2 a7 `
Method 09# a0 L/ W" Z& N& l
=========
8 P. k9 u1 P& l0 h9 K! M" I1 o+ T$ y5 Q) ]
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' X) L+ m0 T4 c5 V6 [5 l7 k
performed in ring0 (VxD or a ring3 app using the VxdCall).
& l8 ~# K8 H: W2 M- k8 iThe Get_DDB service is used to determine whether or not a VxD is installed
7 e. |5 y) [/ e+ p! cfor the specified device and returns a Device Description Block (in ecx) for
( D! p5 A- C) j* |that device if it is installed.
, k/ s2 a7 G7 D1 W, I
. r( D1 ?- ]6 {, B" o( G mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
& g2 P V$ j1 x* g mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& S$ |! X0 R% ~) b3 T5 R
VMMCall Get_DDB
& x. l+ k4 k I/ p mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
/ X$ S2 N9 U& |. s8 @. l( l
/ W9 Q2 l6 w4 LNote as well that you can easily detect this method with SoftICE: m8 U" u: _+ i
bpx Get_DDB if ax==0202 || ax==7a5fh
' X1 I& u5 C8 e+ r
3 ]4 t) p# M5 ^3 z/ K) Y" |: l__________________________________________________________________________ j9 l9 o5 O u/ s% I& \0 H
. i `6 o9 x4 X# oMethod 10
6 v! b, x' `8 l, N: p=========4 _" f0 E9 v0 T- l
% h% i! ] a6 M" r! C' H& w=>Disable or clear breakpoints before using this feature. DO NOT trace with
( D; A; I5 P2 N. g1 ?9 {+ a SoftICE while the option is enable!!$ X8 s e& B( f7 s
8 g+ ` x0 L! b1 F! e: m
This trick is very efficient:
/ K0 l/ G# m* `2 S' d/ s# W8 Wby checking the Debug Registers, you can detect if SoftICE is loaded
9 e y9 [8 E/ s$ r5 r0 S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ D5 n+ G; Z" O" ^' Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their
1 `/ A0 ^7 D) U& qvalue (in ring0 only). Values can be manipulated and or changed as well
: I1 d+ q6 N. P5 N- b5 M' N/ t(clearing BPMs for instance)
; ?# S& h- a b- S- f% [3 q6 Z/ l: \
__________________________________________________________________________
& ?9 D* E$ a( z; D9 `) l, l s
, y! I" z% k1 `- MMethod 11 R# k7 L( J3 w, x, c
=========' B, N) i9 F$ F; _) c
5 u: v/ I( a {- L7 t
This method is most known as 'MeltICE' because it has been freely distributed! W- W+ w" t7 B1 z4 B5 ?
via www.winfiles.com. However it was first used by NuMega people to allow6 i( L# Z8 x& H6 u% o
Symbol Loader to check if SoftICE was active or not (the code is located
6 H) d2 ~5 J2 Zinside nmtrans.dll).
9 d/ h, L5 |& J" d
. W8 f- T4 X) U% VThe way it works is very simple:2 l" Q: |: Z2 C! K1 Z, i
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 |* q8 I( c$ ~3 |, D- {, D
WinNT) with the CreateFileA API.; p) s" G9 P5 a
3 M+ E w" N$ M( D* @' A
Here is a sample (checking for 'SICE'):
" i5 X" \0 N7 ]1 E: T5 e2 j4 \; W7 h
BOOL IsSoftIce95Loaded()
# Y# a5 U3 x1 I6 V: ^: Q{
2 ^$ R7 r: q3 n6 C' B- d HANDLE hFile;
C& P& R6 O4 p7 O R2 G/ ^+ Z1 I# |7 Q hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, }, X0 u5 T% ]( \$ ^8 W FILE_SHARE_READ | FILE_SHARE_WRITE,
* }, o3 v1 x+ i4 A" c NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 N' v& m, L0 R- w
if( hFile != INVALID_HANDLE_VALUE )
0 E& J4 K5 L/ W0 U8 v {& x) t* a0 \; k9 w4 g
CloseHandle(hFile);" s2 F6 A8 ?+ |2 c; @2 ]) g& V# k( y
return TRUE;3 i; F( U$ n0 N( o2 h
}
2 J7 `* l" }2 j return FALSE;
4 L& o, l3 m$ e: i& k6 a' a}
6 K5 E8 E* I( n: h1 b/ }; k9 u& R0 }! P" P0 G
Although this trick calls the CreateFileA function, don't even expect to be
; o& ?! N0 ?; k2 Yable to intercept it by installing a IFS hook: it will not work, no way!6 U: `' [: s3 y+ f1 H) B
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 H- \ V' N: W9 `$ u* a$ ?service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)( _7 z5 k1 l% x- _- {/ l9 h
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 x5 h; \! u4 x* E) @2 Kfield.
) Z. k- `$ D9 VIn fact, its purpose is not to load/unload VxDs but only to send a
* L3 k: A4 Q8 y+ j" u& hW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
/ m( V! ~ y X% d' |to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# w2 K6 J' l6 ~; m# uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
6 i9 k1 |+ ^* B/ uIf the VxD is loaded, it will always clear eax and the Carry flag to allow
& l# c$ W! m3 `/ z- a8 g) Tits handle to be opened and then, will be detected.
4 c( P6 y8 O0 A+ QYou can check that simply by hooking Winice.exe control proc entry point
# z5 H7 c) L8 }4 O0 d1 bwhile running MeltICE.1 e' g& L) n8 a; i7 K; s
# Q/ Z+ |0 r$ T! }# d# Y( d' ^% r4 V3 p8 o: d7 I% P* k
00401067: push 00402025 ; \\.\SICE7 t- [* N) T/ M
0040106C: call CreateFileA
/ e' G1 F5 ] Q 00401071: cmp eax,-001, O/ I# O9 V7 ^/ V9 L( x# d
00401074: je 00401091& s) O2 K7 ~4 g4 |* [% p
& W/ t$ y3 m4 ?6 ?$ I" d0 i
$ `) u% {9 K9 \3 r6 j
There could be hundreds of BPX you could use to detect this trick.3 \$ s% i0 i( c8 c4 A0 e* ~
-The most classical one is:" x2 ?$ R4 ~9 W" n
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
! p# u) K: u& ? @* T7 X *(esp->4+4)=='NTIC'' F) L" z* Y3 o7 q
[. v$ {0 ?% a- o
-The most exotic ones (could be very slooooow :-(2 V4 Y% W2 X1 e7 ]7 d
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 9 e( } d9 r! c% Q. |; G
;will break 3 times :-(
; \, H% N" V/ O k$ P0 a) z( A( z" [$ T7 g' J
-or (a bit) faster: w$ s( x. s. ]; t( o5 i3 y! w
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& g1 X$ f& e5 ?# t2 Q) U# M' x# y! {% s& C1 e5 H1 h( E3 L
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 K- l& F* P4 Z" k. y ;will break 3 times :-(
; ~: ]3 @) s" r3 F8 ^2 @2 i, B' p+ Q3 w( h8 D- w& |, ^- c `
-Much faster:
* ]/ A) \: c% P) F$ G$ a BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
7 ~7 ? L5 U8 e( H% j" T2 ?
( {0 t X6 w. k5 jNote also that some programs (like AZPR3.00) use de old 16-bit _lopen- g# O1 D. r+ l& U: _6 r q) X% i" C
function to do the same job:# x2 Y9 w2 S1 K, f8 h
* }8 m/ d9 G9 a5 H6 O8 v3 \# r; ?* f push 00 ; OF_READ& p. q! r6 S' Z( {4 |
mov eax,[00656634] ; '\\.\SICE',0
7 G& `1 _5 p, G6 x6 D5 y- I push eax
" f6 w4 v4 ^3 h6 O; J5 d5 s call KERNEL32!_lopen! T _0 ?1 T2 X
inc eax% M0 s. ?6 E: d6 J, G
jnz 00650589 ; detected
1 ~" Y: `- J: O7 y4 L2 O6 b0 f1 _% B push 00 ; OF_READ
1 I; w2 K) F9 h+ m mov eax,[00656638] ; '\\.\SICE'# |0 J1 p1 c, z8 ^' ]
push eax
" d0 T* \5 ?. ~; k- G call KERNEL32!_lopen
5 K8 Z3 o9 H8 h1 {/ y, I) Z5 h inc eax" p$ h9 R6 ~9 f0 Z" g F
jz 006505ae ; not detected/ z( t% z3 T* P- I+ _( L
. ^ \; [: }" T# |7 G- N
& P. U! b1 ^; e- V
__________________________________________________________________________
3 R$ R: N" r% r0 `5 e( ]
+ z. `. B6 ^& p+ J( g5 m- O& B: ?Method 128 o) v* g0 i& s
=========1 E0 n2 i% F& z: n0 J+ q* o
0 E5 K' p- @ d# ]
This trick is similar to int41h/4fh Debugger installation check (code 05$ C' u& C9 ^% c& z* m
& 06) but very limited because it's only available for Win95/98 (not NT)
: d k. _# v5 a$ ?as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
+ W: h" z# `& n* O9 D7 N9 `8 _8 Y1 p5 B
push 0000004fh ; function 4fh; d; ]0 z2 [, Y- I( e
push 002a002ah ; high word specifies which VxD (VWIN32)
1 n' x) g0 l8 [3 L$ t6 c* v ; low word specifies which service
1 {6 E" \3 ?; B; I (VWIN32_Int41Dispatch)9 r" z6 s% U9 p' g9 O
call Kernel32!ORD_001 ; VxdCall
- p5 J, W# R4 D$ ~& ^' I4 q cmp ax, 0f386h ; magic number returned by system debuggers# I$ V' c. I! J+ ]( y4 D* b
jz SoftICE_detected
+ A5 o* |4 i% R2 i" p4 E4 R* Z( q- ]1 l
Here again, several ways to detect it:
$ x' W, w/ d% ?; @0 h: _) w
. X1 {* I, t4 W, }* ?, ^ BPINT 41 if ax==4f
$ ^# C1 ]: ^+ D' d5 G( O+ W; J4 P- ]6 k7 I4 _2 f8 }6 Y7 s
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: v) F* s9 j+ i" N& n/ `& y+ k
' e/ a+ {- J3 K; B; ?! u5 R! U4 G BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A% P* t; C1 j; @( V9 q
8 w" G8 T6 J' L. r! ~1 k7 Z7 v BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
* h( Q8 r, o$ _3 {2 o- c
; W. w9 i* W4 a1 V6 ]3 T__________________________________________________________________________
- c& L; a3 s5 v7 }) P, T
& Y; j g5 P3 P: e) [8 WMethod 13
4 v- e4 Y8 ^! V' w+ l& C! N1 r' j=========# K; n" `/ Q$ O$ N7 v0 G; Z
& N/ I3 G! {$ UNot a real method of detection, but a good way to know if SoftICE is
, a5 V6 m: a6 G" j0 [# U+ {installed on a computer and to locate its installation directory.$ C6 `# S0 ? V
It is used by few softs which access the following registry keys (usually #2) :) L- P2 O; L Y7 s
# @4 O' D% ]- j# W! q
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion: P. o7 W+ B" X0 c$ V1 D1 A
\Uninstall\SoftICE
& t# ]& l1 v; E( X0 \* a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) _/ q0 r# `$ c( z, Q) I* p-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ B B: ~1 T I7 A' n9 a- T
\App Paths\Loader32.Exe
6 u( X) h& s0 o3 w6 {1 b
) R* m7 L6 j3 ~/ C" L3 E+ {! _ M/ ?; k* L% _$ | b3 S# P
Note that some nasty apps could then erase all files from SoftICE directory6 O: g; A, q2 {' Y3 a! b
(I faced that once :-(
! _ C/ H$ t, z
1 @2 V) D$ r5 s5 ]Useful breakpoint to detect it:: b" c( U. M& a8 j0 n# Z7 ^
3 u# T/ ~+ [- L- j BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
1 ~# P# o. n3 `' n4 T6 _8 \; k4 d# q1 O# k- W% h8 @# b
__________________________________________________________________________
3 J( G7 w+ `; x) R7 q, F, u d( z! i( L: x/ U
' {: E1 y% `' gMethod 14 ; Q4 o$ D) _- I- r2 d7 \, i" J
=========
2 a4 d7 ?3 \9 c0 ?; |
4 p$ l8 q/ p( fA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
/ k) a# N" W4 G) Ais to determines whether a debugger is running on your system (ring0 only).
4 {( ^# {4 l' Q* m- O) t+ v8 E8 |( c. q9 ~3 v
VMMCall Test_Debug_Installed
9 L" C; ?9 q: q2 G5 G4 O9 c4 c je not_installed
6 F6 y; Y3 x. b3 O3 E. j" N5 J4 m& x! p3 T$ m1 y, o- S o
This service just checks a flag.$ V* }! O0 F4 p8 o5 \+ L
</PRE></TD></TR></TBODY></TABLE> |