<TABLE width=500>
; f- r0 u9 ]) L7 o<TBODY>7 d# H: \$ x; [
<TR>
/ y4 e/ ^2 p5 X* Q<TD><PRE>Method 01 0 P! b" s, K3 D+ h6 {5 x2 y8 P* u
=========0 A+ O2 W5 \5 Y, {9 k
; ]0 b# g4 L* \% {4 J' f$ T* H7 E! V
This method of detection of SoftICE (as well as the following one) is
* c& @# n1 L' u0 n% qused by the majority of packers/encryptors found on Internet.# j+ k6 l, E* o$ O4 K3 w& D
It seeks the signature of BoundsChecker in SoftICE
. r# Y: e% C+ O+ a8 D- Y) u0 ^
. |- R* A. o9 _4 O, W mov ebp, 04243484Bh ; 'BCHK'$ G# Y, v1 S. Z1 h# a$ e3 H0 Q5 N
mov ax, 04h
, s* u, h D4 C, P p y' h7 z int 3 , f1 p. Y* N1 [" |
cmp al,4
/ q8 Q6 \( M8 U M+ T2 H jnz SoftICE_Detected
, d/ X3 F- w& q' s' R1 D0 Z4 t6 P! i8 ]0 r4 K
___________________________________________________________________________! \0 ]0 D5 U6 h9 J! N4 u( i
/ |) m0 ~: e0 v1 F1 ~. Z7 |
Method 02
, y, i5 X9 e8 I N=========
. O: }5 [# Q5 L; s5 k2 a& ?8 t$ N0 S, r. a
Still a method very much used (perhaps the most frequent one). It is used" j/ K6 o4 f4 ^
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,5 T# Q4 z; ?! S" Y
or execute SoftICE commands...
$ S8 |* w( d; K) }6 yIt is also used to crash SoftICE and to force it to execute any commands
& u' y! o' N9 r$ W1 @7 c7 T(HBOOT...) :-((
6 D8 t6 j; r. q2 l" r4 |6 C1 z* ?) e+ }7 Y
Here is a quick description:
: d% N% ~( M6 S" c-AX = 0910h (Display string in SIce windows)
/ W" F& p% N! D8 t0 `-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ F* d) q5 {* f! n
-AX = 0912h (Get breakpoint infos)- l5 }6 J7 ^6 H W# a- J( f: ]/ X
-AX = 0913h (Set Sice breakpoints)
7 W& s2 ~6 ]0 X3 r-AX = 0914h (Remove SIce breakoints)
; `- u3 v4 p# x. ]3 o+ Q
2 m9 o. O8 x/ I# ~ qEach time you'll meet this trick, you'll see:
9 a$ s# S# q$ ]* |8 X1 O-SI = 4647h
- D( K4 w, X0 G/ X) P5 h5 @-DI = 4A4Dh
+ [, u2 O3 o5 U o0 YWhich are the 'magic values' used by SoftIce.
0 b& |- r# w: T# H# w5 Q0 vFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
2 q: H* E5 D. W& o4 l/ G* w* f. _2 W. C G; G8 S b8 }
Here is one example from the file "Haspinst.exe" which is the dongle HASP
& @6 a# M. R ^, \4 `1 dEnvelope utility use to protect DOS applications:
) l2 p( r9 [ q5 D+ T2 P, n l
6 Y' h& n; Y: O- \# x( d; O( i2 ]. v: i( \
4C19:0095 MOV AX,0911 ; execute command.
' m% U: w- N9 \! Q& t: k4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).0 x) J* e+ K1 S( d3 ^5 A, _) \
4C19:009A MOV SI,4647 ; 1st magic value.
; I9 x/ k i: S: t% }4C19:009D MOV DI,4A4D ; 2nd magic value. ] {+ X' Y% b1 C) w
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)7 g2 w3 d, n) n: ^( [7 J
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
) `& N7 X1 l4 N" H& w" b% i4 F4C19:00A4 INC CX7 E, V Y: L7 p
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute' {- x8 c! B$ f, Q: i% \0 }
4C19:00A8 JB 0095 ; 6 different commands.6 E( M% W/ g- ~
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
! L5 G8 `& Q! J* m. e u4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
( J1 _3 n3 g% F9 f* ~* X6 I0 b! i6 E) o( f& R7 z8 u
The program will execute 6 different SIce commands located at ds:dx, which
; {5 v: m% ?- aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% F4 b0 S5 z5 h. K& m/ O2 D3 \6 K6 A
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' L# A( [( z; d4 @' o1 s. B; T
___________________________________________________________________________
! j7 a% Q' T& v. w( u- B0 C0 B7 i3 S+ l) J
. j& V; s; G8 M9 J6 j0 V# YMethod 03
5 K( M# |) C4 ?& Q+ C8 z+ I=========6 t5 N7 h, M+ N0 s' N
1 U7 ^$ Z3 K# B6 y& m3 Y
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! _/ H U, h: Z(API Get entry point)
: h. |- t( R2 Q* f ' y& J) w+ C6 z1 M0 M* m( n
. d4 t; Q' y* u7 q U xor di,di7 J* C/ [1 j) C
mov es,di
5 m: M( S/ m) k/ l0 f. j! F( B mov ax, 1684h
# p/ ]0 u3 b/ K: j mov bx, 0202h ; VxD ID of winice& N6 o2 B$ [% b6 I5 o4 x) x. f# h
int 2Fh
7 X0 c# s* R* a1 D mov ax, es ; ES:DI -> VxD API entry point
: \7 A/ S/ b+ M+ `2 I$ k add ax, di
N. w; q+ v" U test ax,ax
% M) P# O4 g9 P4 t, M3 h. }3 f jnz SoftICE_Detected' ]. m6 v0 }- Q- a6 f! O# {
, ?0 e9 m# ?5 Q
___________________________________________________________________________3 L3 Q9 h) j' y1 u
% W; L0 V' T" a: m* V+ U$ gMethod 04
1 t$ q# O' j- q0 L" R( [0 f2 Y! p' c=========' n2 O9 W0 y2 m, Q0 E4 t
, o* U, V$ P8 }4 i, h2 P
Method identical to the preceding one except that it seeks the ID of SoftICE; R1 [) W. V$ }1 O
GFX VxD.
! |: j( B ^2 m/ B" E0 T9 Y, h7 |2 }4 e# b2 F& Q
xor di,di. U+ [$ ^" w: R l+ R: {
mov es,di* z1 ?( }- K/ Y. ?; ]6 Q
mov ax, 1684h # u( K1 S6 ?. l) i7 q0 ?3 U
mov bx, 7a5Fh ; VxD ID of SIWVID6 t1 M$ Q+ `. T/ P
int 2fh/ K$ e2 S1 r2 G' y& _7 Q
mov ax, es ; ES:DI -> VxD API entry point: Y0 }3 {5 Q. W; } x; g. j9 v
add ax, di( g# k2 g% W2 q& f( S
test ax,ax$ l# q# @9 s2 S
jnz SoftICE_Detected
$ S4 Z: `9 f2 v' n0 C
& c1 J3 C4 v/ P, R2 F0 y__________________________________________________________________________
9 \# k& x7 i1 z, t* E! a9 t; F& L% }9 K# q' |; X; @, o( b" n4 {
! q: L/ s' U$ E2 t& nMethod 05: L! G8 b! d# \3 A# P
=========& Z$ W% v& ] A1 n( _2 n1 k3 L9 b
M; v- X7 e5 N3 V) cMethod seeking the 'magic number' 0F386h returned (in ax) by all system
- c6 M1 K9 Y9 K$ r" F7 L/ i, F9 Tdebugger. It calls the int 41h, function 4Fh.
: P/ ]' u2 ]1 L2 n. EThere are several alternatives. ' [5 ]' U/ Q& i9 @/ D
* ^) I+ t3 T) I# K( T8 g
The following one is the simplest:% W% y- g4 p' ]* o8 d1 ?5 v1 h$ \+ f
+ q! X. r6 M$ F5 |
mov ax,4fh
8 ~4 H8 {( Y Z int 41h4 u. Z {1 J& }) W+ x0 p
cmp ax, 0F386! V0 P4 @- |3 u* S7 l' P1 t
jz SoftICE_detected
1 [! l9 [( F3 M6 x. i& O0 e
9 ^$ o3 ]' d0 L% Y4 D
: v+ S5 U7 p2 _. ?/ UNext method as well as the following one are 2 examples from Stone's
; f5 @8 y M% v- a* E9 `! z"stn-wid.zip" (www.cracking.net):& _! f9 G* L1 @
& y5 ~% h% \2 G; P1 M% l6 J
mov bx, cs
C" \9 M" W7 W1 }6 X8 y, C lea dx, int41handler2
- U1 H% o, f" `8 i s" R/ U xchg dx, es:[41h*4]
) ?# q8 T9 l5 R' q0 ~ xchg bx, es:[41h*4+2]
% @, ]' ^- c, u# `0 n9 H9 \0 j mov ax,4fh
# l6 a3 Y3 |" ]. _ K" W int 41h
0 I. ]) v8 \8 \ xchg dx, es:[41h*4]: K2 Y, Q3 v% k: K C2 {
xchg bx, es:[41h*4+2]
7 _/ p( S+ o4 y0 H5 u cmp ax, 0f386h
# O I( x9 M0 Y0 b; K jz SoftICE_detected
2 i' I8 ? D6 j) o! v- q: T4 ~& I& Y. W& C1 P
int41handler2 PROC
1 T8 U9 A) O6 A iret
5 u3 h" g7 I( G% i5 sint41handler2 ENDP
) J5 ?0 v0 M! Y, m! ]% I8 e' r2 {" Z5 N0 _6 L6 U6 Y
z+ v2 [) V6 L, @1 V( S
_________________________________________________________________________
; @) d' D) N: v$ K* w
0 Z. v! V* ~9 b+ i9 z7 _' c. J5 I$ H2 E/ X5 H& u
Method 06
* q! {. M- }& r/ S=========( M7 y' N& G) j9 f% }" W& G0 p
; ?1 S- {% |6 w% m2 h, z
% v/ P5 y$ B/ r/ L% |$ u; @
2nd method similar to the preceding one but more difficult to detect:% @1 n% }7 I8 n6 \! K2 Z; Q6 y& e
! y$ O. \9 k' [; r% T, |) ^
( G6 f! b6 d) Z' K3 Lint41handler PROC
" X6 [8 |3 W) Y+ } ]* q9 w mov cl,al! b% P! k( |- y& C- g% a$ j5 B
iret
, m! m, f0 w7 [- aint41handler ENDP
/ D% |* K+ R6 v* l I" w) g# R, a! t! C# I9 @! a
' e/ R! ]% g+ X xor ax,ax
+ J1 l' `2 D* ]) |! p6 V mov es,ax: l5 t8 s# @& @
mov bx, cs7 t p! t9 T5 N% Z Y2 y
lea dx, int41handler
+ T2 c4 e. {! s xchg dx, es:[41h*4]- {6 d8 T0 t% t4 @- O
xchg bx, es:[41h*4+2]
. ^, V8 w1 G. y/ b5 z2 r in al, 40h
& B } P* x- O; d' X xor cx,cx! r, w8 P3 v3 j" a; _
int 41h
9 x* M' j, K5 {* T2 ~+ [- `/ T xchg dx, es:[41h*4]
; J% I$ D4 d; ~% r N2 L" ] xchg bx, es:[41h*4+2]
( y& W! \+ N5 w L$ {* i9 Q& w cmp cl,al
6 j5 U C4 @5 ` jnz SoftICE_detected
1 v( M Y" H0 j4 `+ m* B/ j$ Z( x# V" p) P+ ~
_________________________________________________________________________! U& {- [# \+ d1 Y9 i; B
/ |. e5 y0 E7 e" I7 UMethod 07
0 O) n$ V3 Y3 C=========: W2 |" [! c$ i2 q: F% y
! M9 f. y! A7 v8 F& o8 QMethod of detection of the WinICE handler in the int68h (V86). c" R# ^+ p( I/ b& E
) [: |0 e8 C( j7 y5 t: n, y: h
mov ah,43h% x, r u( G& L! h& n; F% e- h
int 68h" i9 U# W0 ~6 q
cmp ax,0F386h/ h4 ]5 S1 R( z6 Z8 N# _; ^
jz SoftICE_Detected+ w+ d) v: P/ g* p; T
$ q$ Z l$ L W; c4 ^, y' v
" M$ e* s6 \0 k6 }7 f7 i: z: t=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* U5 L, }$ M& c8 k+ } app like this:& b/ r9 S4 [7 S! z
" b( K$ U$ }5 B- A! Y0 Y BPX exec_int if ax==68
3 A" p0 V" Q3 g1 G (function called is located at byte ptr [ebp+1Dh] and client eip is1 s" m b' R. v9 u' l* m0 Z
located at [ebp+48h] for 32Bit apps)+ y3 A# Q' V, d Z
__________________________________________________________________________) Y# E L1 K( `" _
4 w: L2 U' P0 g$ z
4 P. J' l! Z3 L2 }Method 08
. m8 R) X- G& ]' V- y) K/ g=========9 S+ Q) A1 _. V3 o
4 v$ l. t! I. G; f
It is not a method of detection of SoftICE but a possibility to crash the
, q0 ~2 [% u& u2 y# j% Osystem by intercepting int 01h and int 03h and redirecting them to another4 H5 T# D* j1 a. q* t
routine.! Q7 k# ]( ?- s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ O. \3 N1 \. D H8 A
to the new routine to execute (hangs computer...)/ r/ L. C4 E+ i* ~
# P( A- D o+ `; I8 ~% n# d8 C* G$ Q. ]
mov ah, 25h: J; p/ g$ B/ d! p, P
mov al, Int_Number (01h or 03h)# U/ j" ]2 l6 q
mov dx, offset New_Int_Routine
* z1 V# r) |9 L7 P int 21h: J% x; h n4 u
, `: t6 Q: S" Z
__________________________________________________________________________
" D( \0 R! \9 c. a
7 f* X% U, s6 c' S! XMethod 09
9 e- U9 J' {9 W2 b8 J7 U=========$ i4 u7 G5 W9 M5 G, i
& H, X i! P) z, s! J3 X1 ~
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
; Z* c3 E0 d9 qperformed in ring0 (VxD or a ring3 app using the VxdCall).
( E% J' a$ h% ?8 _( D: _The Get_DDB service is used to determine whether or not a VxD is installed
/ j! Q+ J- t. u& E+ ^- `( ^for the specified device and returns a Device Description Block (in ecx) for
+ v0 i+ c: Y8 o. f/ A& othat device if it is installed. U& ?' W& q# L1 P
. }/ u& i+ @; ?+ j3 M2 }2 ` mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- w X- L0 {. E6 t) E+ F( a9 { mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- v9 v, s( P+ F2 G5 m
VMMCall Get_DDB7 O4 l3 r% o2 `: X/ [5 p# R; B
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed: M) ]9 v: l) f H0 J, i% E
( K8 S8 F) W1 r, \Note as well that you can easily detect this method with SoftICE:
0 m6 ~& W |! H2 y7 A bpx Get_DDB if ax==0202 || ax==7a5fh0 u) q9 y0 A/ w& T# F$ r* Z
# y `9 w7 J( x__________________________________________________________________________5 U1 r! {0 Q# {
) h) m$ y2 ?$ K, j: `5 r
Method 10
' O! i1 K2 D" s! W! o P6 \) f=========/ T* {( `& }' P N3 v
& C; i- ^$ c p) b
=>Disable or clear breakpoints before using this feature. DO NOT trace with" w( S; c; W+ \; l
SoftICE while the option is enable!!
3 F8 J1 v- Q% p
! e& `4 e4 a$ T: `/ p; u, @This trick is very efficient:
# J F; |1 K7 b8 Uby checking the Debug Registers, you can detect if SoftICE is loaded7 U. y1 T- Z1 I4 |3 {4 F; P
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* s8 x& y. e# U! c. f O% C
there are some memory breakpoints set (dr0 to dr3) simply by reading their9 n8 M8 J! t% B+ }8 {. D' m
value (in ring0 only). Values can be manipulated and or changed as well
6 n* X- f8 {$ G8 q(clearing BPMs for instance)0 k+ b& Q8 b9 m3 V
! Y# L/ f! s6 K$ y+ q7 D7 u
__________________________________________________________________________9 |# ^5 D0 [! M- y( G
" G( B ?; ]5 s2 l# B" OMethod 115 v V1 X$ a( x \ `
=========
" m6 s4 L, d6 B) z; v j
$ U: n Z0 ?) |! W3 x8 H% d7 {* \This method is most known as 'MeltICE' because it has been freely distributed% n6 g( j3 G. w8 o' a1 t, p
via www.winfiles.com. However it was first used by NuMega people to allow
! F w1 P d2 G C+ X1 a3 Z6 VSymbol Loader to check if SoftICE was active or not (the code is located
: Y, S p+ B" b& ?inside nmtrans.dll).( j4 ^ h5 \8 o
8 ?' L5 O( ]! @* h
The way it works is very simple:
& g- M, a' P+ A7 }. i0 kIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# ^' u4 H0 ^. F! _( n2 f2 T
WinNT) with the CreateFileA API.0 l$ [* A P! d$ f
- [4 L" p' K* k& LHere is a sample (checking for 'SICE'):
w8 [- a- k; F6 n0 J) b3 f( d; c: u& x1 O9 n
BOOL IsSoftIce95Loaded()7 o6 f% d2 l/ ?; M% v; S# m
{( L# E; C/ W1 J, o
HANDLE hFile; * N& }$ V5 z5 ~* y% ]2 H
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 W+ q E* K. r/ C [ FILE_SHARE_READ | FILE_SHARE_WRITE,
6 D. K' C- l) ~+ s3 R* E6 L NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);/ C3 [1 v1 r, G6 ?) o
if( hFile != INVALID_HANDLE_VALUE ), m2 V2 ^2 f$ z% w7 o9 T) m# L
{
, ]& \: i `5 \+ k; u W2 \ CloseHandle(hFile);7 f( t3 u+ R F7 ]
return TRUE;
/ x# |4 v2 r+ b5 t }
! L* ?$ a4 J( {6 R. g return FALSE;2 a) j9 V4 g2 y& Y, p
}
$ w5 \( D M/ m0 f& i: d$ l$ G" s
Although this trick calls the CreateFileA function, don't even expect to be) x3 m. [% W" R" q& ~ J. D
able to intercept it by installing a IFS hook: it will not work, no way!6 ~! _, U6 Q0 g* B% _$ O( R
In fact, after the call to CreateFileA it will get through VWIN32 0x001F+ c. t3 U% M, @: B- d8 T! F7 b; g' T
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; a9 g8 g' l. A! vand then browse the DDB list until it find the VxD and its DDB_Control_Proc) b |; }" d3 M q% x5 O
field.
, K7 s: `' L: k' J' V. x6 n. ~7 WIn fact, its purpose is not to load/unload VxDs but only to send a
[+ o p8 n$ E2 Y: x* PW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)$ Z4 V: L; M7 \
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 G/ m0 h4 q, Q9 m7 T
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." _, G% n, f- l$ ~% p2 O- Y5 t$ [
If the VxD is loaded, it will always clear eax and the Carry flag to allow
; h* V* T3 A- K$ k5 a8 l" l4 Iits handle to be opened and then, will be detected.
) j) P7 q3 ^% g% SYou can check that simply by hooking Winice.exe control proc entry point
8 o) ]' D; k4 p; E0 T$ x6 _7 |9 }while running MeltICE.
- w: v, d5 S% u& Y2 n, d0 \9 m- n; n! p; _
: V+ [% A" i( `& }
00401067: push 00402025 ; \\.\SICE
2 @7 S/ u. z. g. O2 u 0040106C: call CreateFileA
5 Z& i U/ w& J# Y5 B 00401071: cmp eax,-001& c5 p7 i% i$ W: B; k
00401074: je 00401091
- ]# c; _1 ~ S) P; T
" W8 X& K4 b! i) ^% d3 c* i, I+ g( [, A; O9 B7 Q* P) |8 y5 F
There could be hundreds of BPX you could use to detect this trick.9 S: ]; F& m8 u- c, |
-The most classical one is:+ L3 V% s# d9 a; A" b0 i1 y4 C
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
# n* q' X4 t5 `5 m2 n *(esp->4+4)=='NTIC', [( P ^4 O ?' y, V: G
2 Y. U! p5 O# h" q% E8 P-The most exotic ones (could be very slooooow :-(" y, H1 g; ?: |
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 F0 T% x$ m4 S+ ^) X$ R# d' s. [
;will break 3 times :-(
; Z# A8 b: q5 T. i# U/ W2 N
3 Y2 q. `& y. Q-or (a bit) faster: % P1 ]" z# h9 D
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- g. g, u* t% B* w
) V% j* K6 G& ~. v- k
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
! n/ i; \ H* K% \ ;will break 3 times :-(+ ?7 ~. D. `* m/ [
& C$ K8 O5 Z. k% ^; r
-Much faster:
% ` q( ]4 Z1 ? BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
! H/ I8 S; q" Z% b) z1 k
7 D) ?7 M# ?9 U8 S: G6 [9 LNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
( i+ N& U, `# s: |: v0 Ufunction to do the same job:
; A: G5 k$ M. ^( q" r+ T% J; V
7 P- h2 k+ Y! O/ U. o5 f push 00 ; OF_READ
" c& F: `% E) r. G! {& }- U# R mov eax,[00656634] ; '\\.\SICE',0" N: T# j s" [- y. {; X! o3 L
push eax6 b! X! X0 C+ T2 x4 {, D
call KERNEL32!_lopen; v2 j2 f# r& e: @: ?
inc eax, O5 {+ f. F* b% R/ \0 j9 M
jnz 00650589 ; detected
9 `* V' P2 [; F; o) Y push 00 ; OF_READ& L- x7 V) O- M9 H8 ^/ @
mov eax,[00656638] ; '\\.\SICE'
: c% V0 `5 R: J5 a! H0 m push eax
3 A6 d) C N# w. w1 G call KERNEL32!_lopen5 K6 M" N: T* `( Z" |
inc eax
I0 Y4 @% q( C+ [ jz 006505ae ; not detected0 O3 v. x @$ ^4 F& w. Z
" v0 ^, {7 m# i! u# H5 w$ o
" b& e6 s* e5 T; ?8 R3 n7 s1 c1 r
__________________________________________________________________________( m. B3 [' c% X" h
% d' y- C; I3 H2 Q* s
Method 12
1 [; x- U1 h8 X: S, J=========. y" Z; g: V1 t" S' i) S! a) [
9 C0 `$ Q; t: a+ @" G# o6 c2 hThis trick is similar to int41h/4fh Debugger installation check (code 05! D3 ]& j/ n" p- i
& 06) but very limited because it's only available for Win95/98 (not NT)
$ X7 R( r* p# |4 }- Cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 `# P; A; X& T/ a9 t& B: u& L/ d3 k: Q
push 0000004fh ; function 4fh
) ^6 d% g0 ?! a! n& c push 002a002ah ; high word specifies which VxD (VWIN32)
5 q. p- e: D- W/ }- b: H K# \2 G8 o ; low word specifies which service
/ q$ C% W0 \& g5 j9 ~: h5 C% W (VWIN32_Int41Dispatch)* k( [, O3 U5 @2 s
call Kernel32!ORD_001 ; VxdCall
, i9 w7 q1 K; r1 C ^, B6 H, w cmp ax, 0f386h ; magic number returned by system debuggers/ ~$ p1 l9 Q# o6 b' \
jz SoftICE_detected8 K; X0 ~+ y# R1 Q
$ X% E1 O: x/ P" t" W! K
Here again, several ways to detect it:
% K; N, b5 M5 q4 I+ {& a' X7 ?
- J* E2 ~! C |1 P BPINT 41 if ax==4f& d% G7 X! D$ {% p) `& I
! a: S5 O- p& i a; \! ~2 T BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
! m+ t; ~" F) s4 C
# h, [, H. ^6 H- Y0 \! T BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A$ G0 o6 @; y) E5 j
& H* a% s' s$ H BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 T _( U1 \# k# a: L
" d; X/ {' l; b1 z2 X/ t__________________________________________________________________________
, G, S; L/ t y) |& E$ {" A' n7 h: q" [6 \7 S0 y! s- ~
Method 13
! [ e4 r$ C! p7 D=========
j8 }7 `4 t7 B2 V& R- L- d- M" {1 |+ {1 X
Not a real method of detection, but a good way to know if SoftICE is
3 f: P. R5 y3 G/ _& minstalled on a computer and to locate its installation directory.+ u- n7 Y+ |; ?+ M/ B
It is used by few softs which access the following registry keys (usually #2) :
: {+ B# i f* E5 n- m
$ T! s( `# ~6 C* s: A-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion# P) {5 Y# n8 m+ _! f5 E* {; ]
\Uninstall\SoftICE+ e" e5 j) Q+ p& b6 @6 \& ^# Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE- y) P/ G g8 K; R
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 R) B3 ~; j! w" u! f# W
\App Paths\Loader32.Exe
- Q* T/ I V5 q- K0 Y% [8 e: j: Q( k5 x# D1 m- F7 n
$ ~ u: E7 _+ `) X' S0 b+ iNote that some nasty apps could then erase all files from SoftICE directory
1 |: u6 D0 g. v7 ^2 b8 \3 r% V9 I(I faced that once :-(
) ^( k: m! u2 ~% o
; ]2 {- B! I" ^* _; J5 n8 d& PUseful breakpoint to detect it:- C" K$ t" ]( ]* R w( J
9 w/ A, B1 ^3 L BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'* \* Q+ E1 K8 Q- U9 r
/ _4 j, S1 L0 o0 {" q, n+ r8 h
__________________________________________________________________________3 `8 [' T5 S# P& {0 ~% `
0 c, g5 K$ r( u# \
5 o* D% c! r" {6 C0 I; ]Method 14
+ r }6 q1 Z; x3 s# y5 G+ U=========# L! K0 |+ u- O" q, f( l; ^: Q1 i2 E
# {$ i7 K, C2 i6 [0 N9 N8 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose/ l0 j' B7 O. E5 _$ t
is to determines whether a debugger is running on your system (ring0 only).0 S# d3 a5 ]" f% ~; m
) s& K- M. ]# [ VMMCall Test_Debug_Installed
! i% N/ i5 t `5 I: b4 R$ R je not_installed6 z9 C) {6 O% d k# s; y: |! t4 Z
5 p0 w0 Z" j" n) E0 l$ I4 oThis service just checks a flag.
' n+ l* _8 B! D8 b, y& T2 E</PRE></TD></TR></TBODY></TABLE> |