<TABLE width=500>! S1 ?; b% p: k/ k) t7 L
<TBODY>8 X% G8 V% X9 {+ Y6 C
<TR>7 ?; x$ I! T O/ k" F$ l
<TD><PRE>Method 01
4 v C0 r5 ~) Z y2 i" K) I=========; t8 Z0 w$ v- m8 F, K! K
; ?7 {; D" ?; y0 w, fThis method of detection of SoftICE (as well as the following one) is
4 ~4 J$ Q" h# p s& xused by the majority of packers/encryptors found on Internet.
: H2 B) p9 X- kIt seeks the signature of BoundsChecker in SoftICE% T7 K5 [' Q* `, O% u. X0 T' ?
3 ~+ Q/ q D0 [' g' l- u' N
mov ebp, 04243484Bh ; 'BCHK'* P; F4 N4 v9 E0 t v: g
mov ax, 04h
0 q* D2 Z3 k: F/ A9 i2 [ int 3
/ ?1 u6 ]5 K7 O/ |0 Q cmp al,4
3 }; r8 o' w. e/ V: k( T: r jnz SoftICE_Detected
$ a, ], i3 C" V9 |8 T- F
1 O$ B& b9 g+ d0 W) a___________________________________________________________________________( }. c3 V+ Q0 h6 p2 w j4 o4 \% k
2 Q% A6 J8 C# j* N7 d) |
Method 02
3 u: H5 @0 `6 P! `) |; @8 g# w/ p=========
5 C5 v4 l d B7 y( H. O( l" m# v- B5 \) X% ?' g! F& l j( c% u
Still a method very much used (perhaps the most frequent one). It is used5 d" B# i6 ]# p' Z! S
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
- G0 r1 A( S! I; B7 [2 For execute SoftICE commands...9 `2 ]9 u) Z, D7 G1 x6 I6 ~
It is also used to crash SoftICE and to force it to execute any commands
2 M3 P7 P% q' U$ S0 B(HBOOT...) :-(( 1 Z8 I% S8 G1 g/ S( f L
/ |- T* y2 R, g8 u6 {1 l
Here is a quick description:
4 B5 E. A+ Q3 H6 O; h, A1 l-AX = 0910h (Display string in SIce windows)* s8 X8 U6 G2 s. n1 m( F
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
# R) h6 Q1 Y6 D- G; p. W! M-AX = 0912h (Get breakpoint infos). Q& \! k, r2 m( W9 u, [
-AX = 0913h (Set Sice breakpoints)
1 o) P$ ?# {3 z7 W' ~% L& z8 m-AX = 0914h (Remove SIce breakoints)
# {: J" y7 `9 k, b$ h. p+ c) r
Each time you'll meet this trick, you'll see:
! H( q4 \& D6 Z7 p8 c6 S" H-SI = 4647h
1 i: ]! |0 s0 r* k. F/ m: ]& V: ^-DI = 4A4Dh9 r+ o2 J' A* v% a
Which are the 'magic values' used by SoftIce.
4 t% p( I7 m, {For more informations, see "Ralf Brown Interrupt list" chapter int 03h.& j& d* u. D, S& w% D) E
4 K+ _$ y- O, E. G
Here is one example from the file "Haspinst.exe" which is the dongle HASP2 n0 j/ k- V j9 |2 g+ [+ F
Envelope utility use to protect DOS applications:# a7 r3 E |. _5 x# o
* ?3 [4 n& w' s/ x
& @# T5 F/ ]# s: @( K$ E/ H4C19:0095 MOV AX,0911 ; execute command.
4 m/ t1 x6 X0 v) n3 g7 h2 `6 [4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 f' E$ y% @4 x& s4C19:009A MOV SI,4647 ; 1st magic value.
+ v m6 ?% Y6 _6 Y3 Q& {, @% i4C19:009D MOV DI,4A4D ; 2nd magic value., s* u# @( b5 u1 d/ y. u
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
4 j$ W! Z" i% l1 ?- O4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 o4 i& v* M* }2 r/ o Q3 ^+ k
4C19:00A4 INC CX( L5 d( S5 k" C/ O. G' B0 G; W' A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" X+ S1 m1 l0 O& @: D
4C19:00A8 JB 0095 ; 6 different commands.
8 B2 `% r0 k; n% ^4C19:00AA JMP 0002 ; Bad_Guy jmp back.# Z0 o/ z& D% m! g* y" `
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)6 [0 s3 K9 n; k7 @- w$ `
1 \; c0 O/ E- k
The program will execute 6 different SIce commands located at ds:dx, which7 C4 m2 O* b" ]! h) @1 I
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ ?6 t: X8 A/ {% x, S' [; C7 \2 Z. W! y2 w
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 @# `, t' _ Y6 F___________________________________________________________________________( y! ~& G& G B5 P7 s& P8 U8 R$ }
+ |6 o# F5 e# `( z) O9 v. [: |$ \! N. E+ U4 G
Method 03, h9 s1 x4 B# S3 a4 M) s
=========
0 o8 c& i" l9 R$ D0 ? d* } j1 p0 H- w+ B. d
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
" |& ]: g/ a1 R(API Get entry point)
) L- \8 j4 F- E& [; T 7 N! B4 I" X) q% V
. u: V8 Z5 K W2 i9 l9 V xor di,di
# I: n {' `- ?7 V% @ mov es,di& ]9 \1 {) S2 p
mov ax, 1684h
/ Q: k e5 S* z4 D/ t2 c mov bx, 0202h ; VxD ID of winice
& w/ i( J" W2 O+ G int 2Fh$ b. c4 O% z( A: f
mov ax, es ; ES:DI -> VxD API entry point7 V6 o" W5 l5 i4 B1 L
add ax, di
5 ~+ d5 ^, V9 M/ b* o* @8 G W1 v test ax,ax
( w9 v- A3 u2 e4 g jnz SoftICE_Detected% |, D" \6 T* G
+ P7 c0 f3 ?4 e" P& l+ V/ Z; H1 ^" W! a___________________________________________________________________________
3 N. D. K9 j6 p9 o3 V
8 x3 C/ {) j z* h; n1 \# GMethod 04
! k6 B3 t) B9 I: o+ K=========* O; c- y% r% L7 _: Y" i# M
9 j+ v9 u) V3 v' O. L
Method identical to the preceding one except that it seeks the ID of SoftICE, c: n( g! A! f" r
GFX VxD.
1 v7 X! `5 @; b5 Y" s) R% E9 [# \4 d8 V. f
xor di,di4 p# P# F/ }/ K0 \. g. r$ |
mov es,di
* m" q4 l( e" ^+ a* y# V mov ax, 1684h
! K0 y# W9 |9 ?# q2 }# ~2 M mov bx, 7a5Fh ; VxD ID of SIWVID
$ g' v2 j5 O. c& q$ V int 2fh2 T2 h2 f; R7 `2 u0 r4 \0 z- U6 }
mov ax, es ; ES:DI -> VxD API entry point, h8 q/ W. T' F' ^; c
add ax, di& H9 S1 Z* L$ K2 I3 t) n
test ax,ax$ ~( Q& f: f4 u( |5 |. n& L
jnz SoftICE_Detected8 {7 I! h6 a. p/ K# j1 Z3 y0 d& p; g
8 z& C' l$ {/ n5 S2 O0 V; T& T__________________________________________________________________________
! C- f* K: l: M @ a9 e5 l
" W% ^" ~8 F" \7 R2 u9 A, e3 }* d7 R2 n" l, d" }7 W
Method 05
3 s( w: C8 ^) @" D6 E; q=========
" Y B. }" J q1 y. E
9 U E4 x+ U% m! h Y7 hMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; s. P) I$ r$ Y4 t% i6 Tdebugger. It calls the int 41h, function 4Fh.# ~5 o( Z% R6 W D* L( g O J8 _; T
There are several alternatives.
7 H+ t! J: w3 j' `+ v9 b, P* Z& ^& O6 T N3 s2 [2 P
The following one is the simplest:7 h: L' P9 o8 w
3 D3 D$ l+ t: [7 K& D6 q) a
mov ax,4fh
' }# [$ g. R" i) z( H) k3 p N+ _ int 41h
% A$ r% E' P; }5 ~% _# A' {9 x cmp ax, 0F386) w' {4 y/ O% x2 D: _
jz SoftICE_detected) D3 w5 p. v8 d2 C. a1 ]
3 @; N r3 j6 m
3 S+ H$ f4 R$ u* [# ^% o4 aNext method as well as the following one are 2 examples from Stone's
2 Z3 A/ `3 N& R' B0 a5 t1 l" P"stn-wid.zip" (www.cracking.net):
% O; | {1 T# _; g; e8 V
, J9 r" H9 m4 n/ b7 }' W mov bx, cs Y; e4 i" f3 l: H, G
lea dx, int41handler24 r2 ^7 @- b1 m' r
xchg dx, es:[41h*4]( y- h0 U" t0 c2 W
xchg bx, es:[41h*4+2]
4 G9 `7 O: C" ?3 B& ] mov ax,4fh
' d- v3 t6 N7 _. [. Q int 41h
! H: p9 p$ H% j2 [; f, ` xchg dx, es:[41h*4]
' x+ A6 H; v4 w* m xchg bx, es:[41h*4+2]
; s0 L. e2 Z* p8 z7 E cmp ax, 0f386h
; k2 V8 p2 Y8 ^, s' s. X jz SoftICE_detected9 i1 n7 \2 O8 v: U+ ]
, j& c4 `: P. h2 ~int41handler2 PROC
; Q4 q" M0 ^3 a0 P% r2 I iret: a, \3 U% a- C `9 c! d ~
int41handler2 ENDP5 d$ d5 ?3 r- |6 Y; G* ^: S9 }
1 r' f) c8 y: v9 Q( F) l+ ^2 m1 k
$ w# K, y' Q4 Y0 G! e_________________________________________________________________________$ e1 b; I6 a' C. |3 ?
/ J3 u/ s* t5 C. y2 Y
8 E$ i# }. I/ S. ^- L. fMethod 06! C# g/ Q9 U$ u0 u
=========
5 o; l5 I& R6 X6 P, n
2 [! J# ^) f9 t8 M: O( D- d. X
b. U9 N, F9 H* A9 ~) `0 J @! [$ [2nd method similar to the preceding one but more difficult to detect:
5 ^' q9 I/ X, D; }- e, U3 p% n6 i7 L3 b
* n# z4 w8 w: `2 d; u( R+ g: t( Q
int41handler PROC
1 D1 Y1 ? S8 [ mov cl,al
( [1 P% S; N M' V iret
5 I% T3 J: Y: \& ?+ W, [int41handler ENDP
1 _+ l) v6 j* U9 X+ M& K- {* g
: R+ z% M4 s' N- x& |
; {# ]2 B" ]) z; d( @4 T3 x xor ax,ax
; t6 K2 x# w; k mov es,ax! ?' K! C: G5 Q+ N q2 O5 U/ ]
mov bx, cs
& ^, z- C* V0 Z8 N; o6 B lea dx, int41handler
2 G+ z6 l3 e; N8 n xchg dx, es:[41h*4]
/ E# K e Q' J' t- T6 T7 J8 G xchg bx, es:[41h*4+2]
+ K' f% v7 a( W: M2 p6 b9 z2 n in al, 40h! f1 ?: v i0 i7 A
xor cx,cx( ~3 R; R8 }5 L
int 41h3 p7 o1 {" l9 n2 K) ?( ?. o
xchg dx, es:[41h*4]" s; o/ k$ R, q ^" P# `
xchg bx, es:[41h*4+2]' G& t0 k4 W5 H5 J& F; A
cmp cl,al
0 W ]$ H! \; r/ P5 O jnz SoftICE_detected: ]+ |: \2 d% x3 X/ k' G0 e
" ]1 w, o, m% t$ i1 _7 |_________________________________________________________________________) {$ c) S( y1 A
& H) T, Y; m. s' N
Method 07
3 q. K4 \0 l J/ h3 K9 p: R( y=========2 U8 \( d/ |' U1 `, H5 H
$ A* B$ p: }( E- m3 `
Method of detection of the WinICE handler in the int68h (V86)7 |( l. T3 y+ A& C
1 ^ ?6 q6 J) }; t! ^1 E' g3 W) J
mov ah,43h
* x' d8 d% G1 d) ~% ? int 68h' W5 f+ y) B: s
cmp ax,0F386h* k$ J2 V1 D) F X9 Y9 M: e3 ]
jz SoftICE_Detected8 k( H$ F E. C
( t& J, c* I( K# x' S; d9 X
" G3 g; x7 {. U7 I- B4 p) J& m# N8 W
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; {) {' e* H `5 }- m: E3 ?
app like this:* W7 ^0 d- ^. [# e1 a, r' e4 g
/ b/ i$ e0 ?/ i! Y+ D8 `
BPX exec_int if ax==686 o& |! `, Z0 i* ?
(function called is located at byte ptr [ebp+1Dh] and client eip is
! i' _ p- M9 Q/ g, [9 `3 K& M located at [ebp+48h] for 32Bit apps), m. o" O( `: e0 e& Z0 U
__________________________________________________________________________
) j. W* _% [# L" f8 P8 B% _
2 P9 x1 h! f2 {3 f
! ~* F! \% K% n, A5 xMethod 08
6 Y! F7 d' q$ X0 n0 [=========+ y( @/ h% h, A' C/ ~7 a! U
) z/ x4 Q8 A4 z$ l# n. g3 _It is not a method of detection of SoftICE but a possibility to crash the& F; p! i! Y! @
system by intercepting int 01h and int 03h and redirecting them to another
, m4 h* }* h* j9 j& Q" h& C, Yroutine.1 ]6 s. Z$ [; J( O( u7 { r8 n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# V+ T7 J9 z) s3 [" M1 Q% }
to the new routine to execute (hangs computer...)
, Y- ]( w( [5 w
, r$ N/ Y- O0 b2 k- i5 A0 S8 { mov ah, 25h* O" a! j) o/ J2 N
mov al, Int_Number (01h or 03h)
- E/ ^% V" M: F. X mov dx, offset New_Int_Routine9 `, a6 u& w) w' d+ ~) K) Z
int 21h
2 r' B5 k4 N& y' P4 E- X* W3 o$ N. N8 s, N
__________________________________________________________________________3 n U- k# h" |! p
4 g, l$ Z5 \! ^( i6 NMethod 09; P W9 g' a5 u
=========
& \- o* F. X) r( E$ [0 b Z( d) t/ v- S4 J
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
6 q3 \( g! g( Gperformed in ring0 (VxD or a ring3 app using the VxdCall).
# Q4 \" w: ]+ x; H: B: t$ K- T5 kThe Get_DDB service is used to determine whether or not a VxD is installed
, {& }% v; e1 I; X% Ofor the specified device and returns a Device Description Block (in ecx) for" r- K( m5 b/ N. e- K& f$ F. }# G
that device if it is installed.! V) M$ I5 f1 _, R2 q, Y. o0 _9 e2 _
8 V. w+ o! L I+ s$ \% {
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" C9 v l/ g! f+ E mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-). M, p1 F* I2 m4 X& Z1 V
VMMCall Get_DDB7 u' R- k% ~/ y% u8 G
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* V. q" ] w9 `
+ x& \3 f/ C+ n8 T$ GNote as well that you can easily detect this method with SoftICE:
9 Z, D8 t2 @5 A7 l) ^! L1 y0 T' Z bpx Get_DDB if ax==0202 || ax==7a5fh1 x# X( V) }/ t! S/ N
8 o4 c+ u4 n: h2 i9 }% u' C# `! |__________________________________________________________________________ u" \5 _% T+ H4 f( ^7 c
9 b1 j& U' b0 H. \Method 10' p& e: P+ G0 n
=========
! Y# F8 d* v/ U0 B2 C) U+ D4 O7 U1 [3 j* `
=>Disable or clear breakpoints before using this feature. DO NOT trace with6 Z3 i+ \% c4 M* }& {
SoftICE while the option is enable!!
6 y7 D) D6 U- H, J1 H& h2 J, c2 ?+ i5 L; I
This trick is very efficient:$ S9 R2 P' e, p, S) o0 Q! v
by checking the Debug Registers, you can detect if SoftICE is loaded# {3 e) Q7 U! `% Z
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ U6 W( k* f# K }. ?/ Y& Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 u( [9 j. s% [value (in ring0 only). Values can be manipulated and or changed as well1 I( J( [+ M- f( c5 q
(clearing BPMs for instance)
h# `! i( x( L# f" ~
* i+ O5 O, M( w7 ]__________________________________________________________________________
9 w4 V n8 y6 k* k6 X- V0 l
) R& V- ` ]) w) a/ w% UMethod 11, J+ Y# g% }8 N& Q% ^4 }
=========4 x, m. U4 Q% r( v. l. D
' b5 r7 `. h0 |5 f/ S
This method is most known as 'MeltICE' because it has been freely distributed
7 Y1 r; v7 y/ [6 T. }" x* U7 ^via www.winfiles.com. However it was first used by NuMega people to allow& J* I. j; t# g, `1 W: g4 R0 X
Symbol Loader to check if SoftICE was active or not (the code is located
Q) x: |. G2 ~0 Linside nmtrans.dll).0 Y$ I1 h& L, S; W* ]
& B% @8 \! ~! Z$ O2 l
The way it works is very simple:
$ F3 I" I4 _2 u# L5 }( cIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
1 Y9 H" }$ S% _/ n% s, l: kWinNT) with the CreateFileA API.
2 Y- M1 t+ B2 L
, w4 h4 p; j) [6 y* qHere is a sample (checking for 'SICE'):
$ d. c" ^% k+ J% n5 K2 U7 B$ y
9 R! b$ U) N3 O. @" m( v7 J8 DBOOL IsSoftIce95Loaded()5 q5 Q# @8 a- A. @+ o* }; `% {, O
{
g# V! _! s& D4 O HANDLE hFile; ! Z: ?1 f0 @: d/ S
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* ] c' L( V# s FILE_SHARE_READ | FILE_SHARE_WRITE,
% m/ C+ u- i$ g' {6 ], d" A9 F NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 C6 W; a: J- x+ ]
if( hFile != INVALID_HANDLE_VALUE )0 E- Y( T# Q8 j ?; U6 C* O
{
' n4 d: y9 c* v& r" g CloseHandle(hFile);
& p1 e( A$ W2 j return TRUE;
- c* k% q, Y5 }; V ]7 ~ }8 P' p6 ?0 m& h! L
return FALSE;
& B) F" X: d4 s8 i7 X$ Q}
8 ~ q1 J! V. l( l! P- @
7 l8 l( S4 j) f9 W/ c2 cAlthough this trick calls the CreateFileA function, don't even expect to be
- \+ M% ?4 ~0 |* t! h* Q+ Iable to intercept it by installing a IFS hook: it will not work, no way!
5 _/ { v0 ^" L7 d' Y( G8 Z4 \8 I- @In fact, after the call to CreateFileA it will get through VWIN32 0x001F, C+ K5 G* _' R* s; U( u& f
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)% O- Y% g& j6 Y7 @/ O }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc3 _. J3 V# ?+ |) B. w* `$ i2 w
field.6 x$ R# X5 s1 \. I0 t
In fact, its purpose is not to load/unload VxDs but only to send a 2 E" j2 a! Z7 R) g
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)& J2 F" {( n6 r Y' X9 \9 X4 i
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
$ \- R* y5 S/ lto load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 v# {+ f" S# [1 EIf the VxD is loaded, it will always clear eax and the Carry flag to allow/ F$ v/ \2 h8 ?% G# n
its handle to be opened and then, will be detected.* t+ g4 w6 z( Y+ q$ E
You can check that simply by hooking Winice.exe control proc entry point
5 R2 d# O% }4 O+ N$ p" bwhile running MeltICE.8 ~1 k3 T! O, u8 t, q
x: D+ N: l6 D1 L( J5 e
& a9 M; T# S2 a: M) u
00401067: push 00402025 ; \\.\SICE
! R8 O ]' C. ]9 ?* _+ G" x 0040106C: call CreateFileA
. f5 \0 J4 r1 ^; U 00401071: cmp eax,-001) d3 L( l, |6 Q6 E z; \' z4 L
00401074: je 00401091
# g" H+ o: R: _5 D) }/ V6 [* I$ e
- L3 h$ ~( b1 [: QThere could be hundreds of BPX you could use to detect this trick.
0 S& G0 K4 y& R-The most classical one is:, s6 X5 q7 p+ E/ O
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
; a5 r, a0 |+ \' M6 F# ` *(esp->4+4)=='NTIC'
# Q! @# h: ]! g+ Z% j
' f3 t: P+ Q: q. C, N( O3 b-The most exotic ones (could be very slooooow :-(
( R8 A* C: V1 {$ H: @" Y+ Q BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ; K$ |( X. i% u5 s! C+ d. K1 C
;will break 3 times :-(
1 \. m6 Z6 I2 [! }3 h ]
5 ]7 E; |, z: M-or (a bit) faster:
k1 |4 N6 p" K BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ z0 k8 X# R! F7 L0 @
7 H# h; E% \' D2 w* m$ V9 ^8 X BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 2 J$ i, E; I6 y. o- u
;will break 3 times :-(
" K) N( Y. Z. R* I7 i1 J7 ]1 t# }4 d' o& @0 T) l
-Much faster:
- |# Z3 N! J# h T, L BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV') t( H' d! W1 g4 u5 W. y/ L4 Z( ~
8 H; U; G% m2 y. l& _% xNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
3 K) J& l" p. B3 o3 j ?( Z6 rfunction to do the same job:% `8 v) N" _0 @# w7 P
4 d( f3 a# V$ F3 E6 w6 ~6 ~' \ push 00 ; OF_READ( ^- L2 \) x# g* X' S6 K& J
mov eax,[00656634] ; '\\.\SICE',0
2 E' l& @0 R1 U% e3 H- h7 W: h push eax' M2 X. _! h! U5 S7 ?+ G; `
call KERNEL32!_lopen
( R, g* a% W: {' F# ^ inc eax
; B9 U$ G( K$ ^. w jnz 00650589 ; detected
I) ^1 W" C+ L7 y- Q push 00 ; OF_READ
- o8 t+ f" ?3 f2 ~! |" @2 `! H mov eax,[00656638] ; '\\.\SICE'
$ r, n" Q) ]( P7 w6 r1 J push eax
. f6 p5 ]7 o+ Z. a H call KERNEL32!_lopen: C4 @6 I+ y4 r' \; o' f% U; A
inc eax( J# z7 N7 c. N5 q; u I4 T( |9 Q* H
jz 006505ae ; not detected
2 c) p: }& D G1 E+ ~
& m3 Y; u2 R v% i+ Q; T' ^
+ q) g% n0 S: w5 \" y" J. t__________________________________________________________________________3 l! H7 x- }1 c0 a+ K
* S1 a- K! x8 P2 _$ t3 k& K. oMethod 122 f5 x/ g* R. D
=========
. l u6 Q/ u+ ]" v t5 ]5 S, [
This trick is similar to int41h/4fh Debugger installation check (code 05, U# Q/ t- O5 |' z# Q7 v
& 06) but very limited because it's only available for Win95/98 (not NT)
+ Z# t) A0 @* ^# ~. kas it uses the VxDCall backdoor. This detection was found in Bleem Demo.. C8 d8 B' u5 }% ?) T7 |
# s2 A2 W4 @. j6 r push 0000004fh ; function 4fh
# i! H% G) Z. r+ D, Y" @% ~ push 002a002ah ; high word specifies which VxD (VWIN32)
# o, K. W; V: [$ D) T# v5 v ; low word specifies which service
9 N) u$ D j) V- T (VWIN32_Int41Dispatch)
4 Q& Q! S& g9 c: R; \9 h: N+ d) R call Kernel32!ORD_001 ; VxdCall
V' C R& X4 u# \+ V! @ cmp ax, 0f386h ; magic number returned by system debuggers
4 l% x" p- i/ f+ e jz SoftICE_detected
& e( y' Q! S* J V9 R" n6 g1 N. z' ~8 n. `$ E
Here again, several ways to detect it:/ Z& Z+ a) `& Q* o) V
% z/ H g0 t0 k: v9 H3 X% W8 u r BPINT 41 if ax==4f2 a) T! T) Y! u k; ~! G
y, J5 w& r" Y
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: e, _+ [, |6 Q1 L
* ~- y% }/ }1 h" o; u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 l' }( V0 p+ i3 b* g0 h
4 F. z' A$ ?4 O BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!$ C0 y5 p9 Z& G: D0 I; @
' K! Y2 X9 j# \) m
__________________________________________________________________________( [, b& R0 s1 ?+ u- N
5 f/ \: l9 d- p5 f. {# U- fMethod 13, y* N$ r+ m! }$ D9 L1 z& m" J1 D2 g
=========
# U3 g. L" h; K/ T! G3 b! f: M0 Z( V" m& i( Q# T1 [
Not a real method of detection, but a good way to know if SoftICE is
* U- }7 H* g4 Z; }8 Sinstalled on a computer and to locate its installation directory.# q( Y9 y; U' q/ G
It is used by few softs which access the following registry keys (usually #2) :+ @2 A+ y2 [5 k: Q) O5 {% P9 L& F7 i; d
6 j; z& @; h7 i% I( {( t
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 `. E7 {: `0 E, [# v, A$ ]: ]+ B
\Uninstall\SoftICE. f2 h5 n5 P0 l
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 L B$ `; I) y. g1 e+ @0 C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
@1 S2 t! J9 ?7 t3 ]\App Paths\Loader32.Exe' Q( _8 o& R6 [9 t
3 e! R8 _% M! c& @% `( f" M2 {) Y
5 }5 C) w* O5 V; f+ y
Note that some nasty apps could then erase all files from SoftICE directory
& r4 I I {7 e& A6 n9 B% [(I faced that once :-(
0 X6 s3 x- I$ W y: j9 E, T+ m+ C# S. V. i/ C# H) n3 T
Useful breakpoint to detect it:- [8 D8 o# F) r
. ~1 X! H$ B1 H5 T4 y1 N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( G b! @3 u2 D: w6 H1 S8 g! g
. d: m" @4 \8 @( F+ z__________________________________________________________________________
! K2 e2 B" F+ L# h3 N7 K. G+ t. [- s( [7 a. A, x
7 A! F1 ?, d9 P
Method 14 * ]6 b, e8 x$ `6 y0 @. x- i1 B/ Q+ b
=========$ x3 G0 U% d) L$ r( B& m& a. [1 ]& k
6 W, w% `9 P. g2 GA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) ]6 {2 K+ y3 v) t
is to determines whether a debugger is running on your system (ring0 only).! Z# V7 T/ ] U" [! U0 h) x
6 B- o6 _) H' r7 n VMMCall Test_Debug_Installed
# O, i, j+ h" _* y8 L8 t# { je not_installed1 {% O" U' A0 }/ G
# D4 f% y# `) m' m1 i+ q/ NThis service just checks a flag./ L3 U/ N, r; U$ i8 P
</PRE></TD></TR></TBODY></TABLE> |