<TABLE width=500>
2 l8 k; D; {' l<TBODY>) i6 a0 V0 m* P6 O' j
<TR>! s/ s. B8 v* e9 h" w1 V. x3 r+ a; G
<TD><PRE>Method 01
/ z1 G4 q9 j1 Z, F/ @=========
; }& D) l, R1 H& t: v( l2 i- u* x% J4 a
This method of detection of SoftICE (as well as the following one) is) u6 F, H6 m K" E: g1 d1 u
used by the majority of packers/encryptors found on Internet.
9 s8 I$ @7 z: m: X+ VIt seeks the signature of BoundsChecker in SoftICE
* a8 X, E9 @; G# U! T: M- B
- }; h! L+ ]. E) n mov ebp, 04243484Bh ; 'BCHK'
. ]& T$ W- C: J0 G5 J h mov ax, 04h. @5 `) C. A8 ^# c- y$ c& N
int 3 ' ~4 S1 P1 j4 ~5 Q
cmp al,48 d4 ]1 H! r4 ~7 a3 a
jnz SoftICE_Detected! I7 Q1 W2 x2 |/ g9 j8 s3 ?
6 I# G! r5 o* n# j___________________________________________________________________________ @ \1 g& n# J& a8 b& ^: [
; z5 k) X. p0 B# p) P' _2 j
Method 02- @; w, m9 {% V3 E/ X0 D; E* h
=========- y' T. Y6 m6 Y( ?2 B7 W
# k J0 V$ m) X
Still a method very much used (perhaps the most frequent one). It is used3 [0 z) j: ?- t% i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' p6 C! M. s+ X7 @. f o$ g# t
or execute SoftICE commands...+ L3 o1 K' }2 G+ p- o& w
It is also used to crash SoftICE and to force it to execute any commands
9 c1 X0 y |* k0 ?3 r7 e* H, x(HBOOT...) :-((
, w% Y3 C6 T' Z$ |! U
# C! [ Q" c4 F% CHere is a quick description:
, Z0 F D/ x$ j' M7 C. ?% M-AX = 0910h (Display string in SIce windows)
* _! X x# s* `: k" n7 ~-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# k/ @$ b q. p- S
-AX = 0912h (Get breakpoint infos)+ q' g. Q) u6 g$ D5 W7 X$ u9 }* W
-AX = 0913h (Set Sice breakpoints)
! e! g2 I/ o' o' f! G u' g! R-AX = 0914h (Remove SIce breakoints)
0 L9 n9 Y* V* v2 M
9 s# V3 r3 A+ t) B/ [, hEach time you'll meet this trick, you'll see:
3 c( G" S: F6 p8 O3 T2 A S-SI = 4647h, v5 t* t, A4 V3 S' l
-DI = 4A4Dh
+ X+ c# P' q) x' x+ R* p bWhich are the 'magic values' used by SoftIce.9 l4 U7 k# i9 K+ u' U
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 q1 I- I( z/ O8 {
1 ]& D2 b( Y; W9 T; I& pHere is one example from the file "Haspinst.exe" which is the dongle HASP
/ {1 T v. g% S! N2 @Envelope utility use to protect DOS applications:
) d! B% z" S! m8 g+ v+ j4 C
1 `( y/ {3 E6 v6 [* T& r* ~3 [
B+ z# F0 A9 y7 M! M4C19:0095 MOV AX,0911 ; execute command.
& D5 _3 q9 f$ D$ ~' M5 y1 d6 N, l4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
; ^" S" P: \3 t4C19:009A MOV SI,4647 ; 1st magic value.
/ _& W7 X4 j _. ~) I/ l& Z* P4C19:009D MOV DI,4A4D ; 2nd magic value.% H9 `6 E# o e- \
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 X' g8 V. V2 _4 `4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute3 y: l8 k# ]7 ]! {6 L
4C19:00A4 INC CX* N4 Z! f# E3 ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
6 F! S& N" A" h! R# @* t4C19:00A8 JB 0095 ; 6 different commands.& F" W9 C4 |% g. r7 F8 b A# V
4C19:00AA JMP 0002 ; Bad_Guy jmp back." t V$ P" j' i! |* r$ y& o
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. c: u1 W0 C2 g) o! ?
! _$ D* d/ H& T2 R l* c$ CThe program will execute 6 different SIce commands located at ds:dx, which0 Q0 v, K! r4 B; i
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 ~" M& _. Y, d( y5 x: ]% U* f' X
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 H! s R9 _/ \' c___________________________________________________________________________
4 c# G% a. \0 M& p( D& @: g+ I: y# [; I
% H- B8 y# G: T h* M3 k; x
Method 03
9 V, c4 X: \; U2 M+ {$ e4 T, y( ?=========% D) B0 F5 x, t$ x q3 b2 F- a
; o5 J9 U- x- I$ XLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 m+ C% K3 ?; h, i" S9 A
(API Get entry point)
/ `# r' S3 w, B6 J% P9 N
- Q5 k! q- B" T2 u; h1 ?7 o. K; `+ L6 g$ ~
xor di,di
- {& o Z) O8 \! O. E1 V9 W c( q mov es,di
4 r$ q; V: y# p3 s" o3 c) q mov ax, 1684h
# ~1 @$ o5 y/ K; I8 ^3 w) O2 F mov bx, 0202h ; VxD ID of winice- H/ o+ W0 Q" }: W* j
int 2Fh
% @% y/ q/ O% }' N# M mov ax, es ; ES:DI -> VxD API entry point
7 P! P6 u' d N' F) L add ax, di
5 e- M6 R+ Z* I; y( X- r test ax,ax3 k/ g9 W- E9 ]
jnz SoftICE_Detected
# f/ e' S6 f4 a% r. X# B+ N
; `& o4 V/ l$ z$ l___________________________________________________________________________
% h& Z$ z, E6 E0 d
* K7 x p8 v: z: R& V- sMethod 04
% w# A7 }8 `& i" B& g! r=========
" a ~% ^9 c- F# S, Z2 A8 a! p4 d
3 \' D+ I0 E" R9 H4 }: hMethod identical to the preceding one except that it seeks the ID of SoftICE" h0 T# J' c2 E
GFX VxD.1 o9 |9 _- b$ n$ g' }% s
7 K' x8 X- ?7 e. Y, M+ C: g$ R6 ]; S
xor di,di
( C9 g$ a1 W9 G d mov es,di
2 j) Z6 C* Q! B# N7 N mov ax, 1684h
) D& E& N$ `7 c. R; y/ u& }) @ mov bx, 7a5Fh ; VxD ID of SIWVID
# D% z. S) j. }; y! X1 ?. ^/ Z( p0 C% z int 2fh
* r$ L/ L$ j- j. S: L3 q mov ax, es ; ES:DI -> VxD API entry point3 v$ s1 \/ y- F! S
add ax, di, b9 Y. ]: z3 @% c
test ax,ax
+ t' C# D8 C& l3 B0 G jnz SoftICE_Detected7 F; K6 R* y1 e& p
/ c( j. ~' S" m& B* `2 S+ s2 c; m, J__________________________________________________________________________! r5 L; ]: H+ a% t; V
" B& Y& w( p' L( a [
6 y {4 K; g6 a9 l, E; w1 K s) @
Method 05 _( o" N, n: A5 e! {( [
=========! |8 Q7 d: C3 g1 t! h" f) X. J$ A
T& r+ W" L8 `3 k
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& v S6 X m7 h- |5 ?debugger. It calls the int 41h, function 4Fh.
) _; e6 |/ L# p; OThere are several alternatives. 6 z8 o3 \6 [ k
+ n+ Q. l6 K5 a8 e' ?# l
The following one is the simplest:; f* z8 x+ F- \6 a3 z: p
% M A2 [! j0 E6 ^# T) ^ mov ax,4fh
" R& z( \. h6 a4 N int 41h
! |5 H7 O5 `+ C8 t$ G cmp ax, 0F386. x( F9 A' ~+ P9 p
jz SoftICE_detected1 k! U8 q" q0 o$ m
- _" P7 L2 x# s. v; g7 q9 n( v
, F& _7 Y9 ~4 K6 gNext method as well as the following one are 2 examples from Stone's
5 b# U f# S4 Y) L6 I; l"stn-wid.zip" (www.cracking.net):
8 Z- C) Q- [3 d% O! X+ J1 E8 Z- V! E
mov bx, cs1 u6 f/ t8 m1 n3 h0 U/ i
lea dx, int41handler2
0 `3 ?! z! y; G+ Z" l% Y, B5 t xchg dx, es:[41h*4]
- J* E d# `) Z$ t xchg bx, es:[41h*4+2]8 R8 P' j$ C9 k4 u! q
mov ax,4fh
/ Z' [2 s; r, x I; w& U8 E$ s int 41h
/ e5 | l" H, l5 T xchg dx, es:[41h*4]
- l+ A. g r) G+ M( b xchg bx, es:[41h*4+2]6 f" Y, y* v1 K. }" ~
cmp ax, 0f386h$ e F2 \3 `6 P
jz SoftICE_detected- U. ^) p3 ?2 R# G6 {
6 y, @' Q- c: l: [+ P! N1 Rint41handler2 PROC! m6 k4 K9 g' H# L9 ~1 S
iret
1 x* H% |/ Y* x- @9 i5 t- i! Oint41handler2 ENDP
) v: c: R& _& W8 j! t6 ]; b
6 Y3 ^: H2 f' ~+ e' k
/ C; e! R4 ?% w/ M8 G_________________________________________________________________________
" m5 P6 w: G. ~
1 s) ?1 B% L, @1 \" P; I
5 g* @' F) i- }+ U& kMethod 06
, k1 T2 c" t' W% Y5 R' w3 L=========( G: X& h" [5 v/ @1 p
0 I% v i4 t1 n3 [" N, K
% X8 P0 [" c; K2nd method similar to the preceding one but more difficult to detect:# S; u2 a/ u3 [% O# G3 h/ V) ^
: d- ^5 L/ \0 L9 R, ^5 U
/ }! D0 O- ?9 e2 sint41handler PROC
* t6 |/ q' g9 T- g! W: t- I; o mov cl,al
% V7 o" O5 P; K& F- D+ Z iret
& F, J/ e# \% m0 z2 l9 h, ?$ kint41handler ENDP
1 n2 w& F8 i+ ^! T* a6 F. g) `2 |9 u A9 I& f7 L$ e
, ~$ H7 f' g8 T2 p
xor ax,ax7 Q& d2 Q! U) I. @9 c3 R( e- W
mov es,ax1 k5 ?% c( k1 g0 [4 k
mov bx, cs
% A2 o2 P: Z2 Y1 E ?1 w6 D9 Y& D! h lea dx, int41handler# @+ Z- u; J& w! i# @1 w5 E
xchg dx, es:[41h*4]
) A5 J6 }# e& X- Z xchg bx, es:[41h*4+2]* N$ t: }! R; z; d, M/ I
in al, 40h
6 C3 w( l0 P0 t+ ?# J xor cx,cx# M6 n1 y4 f- S# G5 T
int 41h" r( j2 N& l6 _5 q: ?( E0 B8 a3 e
xchg dx, es:[41h*4] g6 E) G0 d& t8 I/ o4 H
xchg bx, es:[41h*4+2]
# S! q* l' }6 \, a0 K0 b8 l6 n4 o# { cmp cl,al
8 U4 K& y/ K: L" |( J2 j r! L3 u jnz SoftICE_detected) ?, Z' A {; E) n* z
1 c9 ` _/ `3 f6 Q$ Q5 D: y3 I& j_________________________________________________________________________
: r0 J: e, b( u& G
H: l6 k6 A ?Method 07
$ H& o7 X' Q/ [, i: L% q0 G/ Z6 p; n=========
3 P/ r( P2 f# S, s5 _- W
! [( @4 M+ Z8 AMethod of detection of the WinICE handler in the int68h (V86)3 C& W! e+ x/ H- f) v
& O: \- @* i* z
mov ah,43h. d! |! \( G) n- R, n. P2 R" c
int 68h
5 L4 N+ `$ E q { H2 J cmp ax,0F386h/ K+ G( F' R M+ w
jz SoftICE_Detected" r0 I, l. b: i2 W9 ^
: R5 P8 F6 s9 r; L' d- r
, E. b( g3 x8 W+ A f: v=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
( f6 P2 z- G" F; O# P) @ app like this:3 I, ~+ _8 z% I" @8 U1 W4 |0 Z7 k
9 k. x, K! }/ T' L3 Q5 h' v( V BPX exec_int if ax==68) C! P2 a- U A' q9 C4 B
(function called is located at byte ptr [ebp+1Dh] and client eip is
8 [$ B2 o0 b6 }, B1 F9 o located at [ebp+48h] for 32Bit apps)
& Y @# t/ h& H! X# ?2 ]" D__________________________________________________________________________) E& j f9 z% ?) _/ [3 V4 q
! b: T" c" X: F: k$ J7 Q; f& Y
5 j6 ]# f" ?' J, h% x& P/ u
Method 08
* c' V5 x; D, K% q' i=========
9 I8 e5 H+ e- h# V( C' y$ S* u9 G5 g. c7 s* `
It is not a method of detection of SoftICE but a possibility to crash the
: `, n1 r6 P' I$ h6 \* Y Ssystem by intercepting int 01h and int 03h and redirecting them to another
# B8 ^7 v0 X4 x% Z) proutine.2 o0 A) l( s, p2 n! ]6 g$ \' [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 N1 m- S# o/ A
to the new routine to execute (hangs computer...)( }& c/ R( q( ~7 O* F* m7 g
& d9 b, T( ?$ D6 q# c7 b" Z mov ah, 25h u5 e1 w% `! C$ C- P
mov al, Int_Number (01h or 03h). l. g+ H k. O& N F8 I
mov dx, offset New_Int_Routine: a, C! Q: w1 Y$ S* M2 O
int 21h5 }' E7 i* D1 B7 u
( A( y; }) q( A+ u7 e- L5 W
__________________________________________________________________________
7 {% T0 F; z* s \
, G$ |0 [: m9 n. d0 l' ^4 tMethod 095 i; t4 I' |# R
=========
5 r6 Z: S# T5 [
, u g% \. d& \This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 P6 S8 ~9 y! t6 _0 C1 E9 g5 `8 K! o% Wperformed in ring0 (VxD or a ring3 app using the VxdCall).
7 X) y1 }' l! i z, J) D3 c! @5 WThe Get_DDB service is used to determine whether or not a VxD is installed
1 ?2 \) F9 \. ~. W- ufor the specified device and returns a Device Description Block (in ecx) for. E: s: J8 m- w/ z
that device if it is installed.
/ `7 s* z' u# R$ q* r- q8 [
9 A3 O5 _& i X" {0 p9 H7 ] mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID+ @% _- D/ b3 y& ~! N
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# z8 \* L8 v3 h+ P. E8 I- ]2 v; I VMMCall Get_DDB! z `" Y/ q) c! v' C
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, l: `; i0 |& w& v" n: ?7 [
. \' ]+ @6 D. n7 z! ]! `Note as well that you can easily detect this method with SoftICE:
, O3 |, S% G) S; O* N& } bpx Get_DDB if ax==0202 || ax==7a5fh4 ?1 o5 _, v2 e* z) P
* Y2 f0 W. j7 z0 H5 A& [# v3 N8 k__________________________________________________________________________
5 ]6 c% I0 k; a, j ~3 X2 k- z) v2 ?
Method 10
0 H& M. P* I4 g! Y8 M6 T2 \=========
/ ?4 d6 C+ h+ [) K' Z& x
- {$ x. w4 B5 s! `, S=>Disable or clear breakpoints before using this feature. DO NOT trace with8 h$ Q& L4 i% B. j H% p" W
SoftICE while the option is enable!!" u3 u4 c9 x2 H$ f
5 p. A0 O5 h0 ^1 T% j; X/ n6 mThis trick is very efficient:& Q0 F4 L7 b3 E/ C
by checking the Debug Registers, you can detect if SoftICE is loaded
9 u6 `5 C e* e; e(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
& h& p: M( [, i' ~* x( Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
1 a5 L* n/ H- r% }9 V. ~# }3 fvalue (in ring0 only). Values can be manipulated and or changed as well. g) X7 C7 j$ W3 J( f, y+ u y3 m
(clearing BPMs for instance)
! K! c/ Z+ w7 n" Q% j6 p8 X& _: X8 C. r; H9 F4 b
__________________________________________________________________________, x f; T. m" Z# C! K6 B6 ^5 ?8 z
& k6 {, X5 f- c2 K9 M7 E; |& D- d3 z
Method 116 T( H( J: ~ x- F) T. d& [
=========
6 T, q7 S: b& y+ M2 Q4 K# x7 X3 s! B. v
This method is most known as 'MeltICE' because it has been freely distributed j8 r, N) x$ T2 T/ l; x' D
via www.winfiles.com. However it was first used by NuMega people to allow9 u) a- I+ ]; j% P1 e3 ^
Symbol Loader to check if SoftICE was active or not (the code is located
8 A; m" [1 T0 E- Z. Einside nmtrans.dll).' ~+ F2 Q5 S3 O; @4 q( \& l
* x$ L/ G2 C& ?: L4 _1 B1 j R
The way it works is very simple:
/ r9 g8 o1 t9 K' ?It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# S; r& t$ ~' Y; \2 H% ]* l1 J( `$ IWinNT) with the CreateFileA API.
% n. t. W7 U5 n" r
% O+ x8 |, D2 e% }* ^% A' MHere is a sample (checking for 'SICE'):
- ?1 F0 b! U- u: Y1 {" e- ~2 }- S6 J
BOOL IsSoftIce95Loaded()# H" i1 Z$ ^; T; h! L
{
2 u2 n& w5 G4 S: \" N4 H4 ] HANDLE hFile; % f4 e0 b8 B+ p
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! Y$ _% p. m& i) y
FILE_SHARE_READ | FILE_SHARE_WRITE,. Z+ p _) G( X
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 l3 Y6 c2 e7 g; H9 H( S/ R if( hFile != INVALID_HANDLE_VALUE )
& F( M8 V: \: \; ]; j {; g6 r1 v" k5 P8 o- X! T) y9 ~
CloseHandle(hFile);
$ \/ B$ M! } m# V5 C* k return TRUE;4 V3 @- w& y3 s' N/ {! r
}, _1 G K; n+ `5 v& w' C' A5 i
return FALSE;* M P. A7 s+ P
}
8 L" B V( ~! s9 l( [4 ?) W" ?
' T& ^! e- ^, d: |, B) I* dAlthough this trick calls the CreateFileA function, don't even expect to be
1 x6 a; K% E' @, `7 Q2 T: q* eable to intercept it by installing a IFS hook: it will not work, no way!
; h: K0 N0 D! F) ~( sIn fact, after the call to CreateFileA it will get through VWIN32 0x001F4 M7 \1 |* p2 ^
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 t+ y7 N/ h9 w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc8 r$ h0 t6 d% s/ N3 n E
field.- D% S/ F; d- B# B' I2 t8 `
In fact, its purpose is not to load/unload VxDs but only to send a & G# ^" L! g6 @3 w2 [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). W, L/ q6 u- m5 @
to the VxD Control_Dispatch proc (how the hell a shareware soft could try1 W) m& E" t6 K( O7 D, ^7 Q! b) |5 |6 D
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
1 k9 C# W" z, q! a2 fIf the VxD is loaded, it will always clear eax and the Carry flag to allow" R ]) u( `. v5 M( F9 B1 U! C
its handle to be opened and then, will be detected.: k6 E3 \9 k3 d, R4 f9 M
You can check that simply by hooking Winice.exe control proc entry point
! A$ H6 Q- U$ F3 X2 z2 [while running MeltICE.9 n4 e3 Y0 s( P, ~0 g5 P I
# l# Z# l# |; K( O4 h( I9 B2 h
6 J6 g, Z- i; j/ C. G2 R( h
00401067: push 00402025 ; \\.\SICE4 z6 Y1 e% m8 V! K
0040106C: call CreateFileA
" [; Q# A1 J9 {( j 00401071: cmp eax,-001
% G v \6 m, y2 G1 k 00401074: je 00401091, Y S5 u G n5 x- `
* }1 |+ ?3 b& H8 J ]2 |. A# x# S5 h2 o$ {4 o
There could be hundreds of BPX you could use to detect this trick.# m/ p0 y/ ?; a
-The most classical one is:
3 H( Y: ?$ s1 |& i I' s BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
p, t8 l. @. x; y9 k. U/ f *(esp->4+4)=='NTIC'
3 F, e% E# w1 u. B9 H! ~+ m
3 |- }. n. C; }( u& s1 w1 C-The most exotic ones (could be very slooooow :-(7 M1 }: q$ j) `9 S8 f; p& Q
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
4 ?' P7 j0 ?& x ;will break 3 times :-(* k$ f/ H7 `1 q; l* q9 ?
9 ]1 X3 u. a* Z. B; y' N) `: r
-or (a bit) faster:
# D/ Y& A: Y7 ^1 G% J* N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')' ?" y" p" ~( Q* Q" o$ i
" _& m# m/ @' X* q7 n) C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
- o" A3 Q7 f h7 B K6 j ;will break 3 times :-(8 v. S6 ?$ v: A9 e
0 d' Q/ T+ y$ C; {: Y-Much faster:
4 V4 C8 D' B* G. E- |% m9 t BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 N7 |1 U% Z) [+ J. E7 M. p" G
4 X$ `: V- L% nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 z" M2 d4 n3 l6 }9 O$ A: Hfunction to do the same job:
* B. u) \8 u0 }! i9 P; Y V$ `+ a' |# Y& ~- i, i1 o
push 00 ; OF_READ1 A3 `- L" [- D& s) I
mov eax,[00656634] ; '\\.\SICE',03 Q0 R+ Z5 @; v) l& T
push eax' v6 E7 d# h. Q$ s2 @
call KERNEL32!_lopen
4 l, i8 D: \! b1 v; g inc eax
' k# m; [; B6 Q* o jnz 00650589 ; detected
- O j2 X) ] A$ ~# u: q) m push 00 ; OF_READ- [6 f% }1 p! E" v: x. O8 v$ t
mov eax,[00656638] ; '\\.\SICE'
/ S) t0 Q2 ^7 \, o" v push eax" l# V- u$ X7 B2 |" `
call KERNEL32!_lopen
5 Q- b6 {2 ^4 T: B2 [ inc eax8 O3 ^1 r+ r; n8 G& E! \
jz 006505ae ; not detected
. C' L; V7 B0 z5 |2 C' O. G: G* \6 k: X6 j; v* ?- @& B! O' W
/ i6 K; J* H6 x__________________________________________________________________________
( t' N; x/ L: v8 ]( z! U4 u) U' W
Method 12! _( V U5 U3 m9 Z# z
========= ?: K: w/ P% W% i: T& z* l2 z4 f
( G6 M& h/ E7 b6 W5 \4 }: KThis trick is similar to int41h/4fh Debugger installation check (code 059 a; ]2 L$ R* G" g& P
& 06) but very limited because it's only available for Win95/98 (not NT), M+ [; O# v- ?3 t" e) d% a* e
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
6 I( @# u2 e8 P7 U7 h% z2 b9 s
( d, o' `& S K push 0000004fh ; function 4fh
' z* V8 d! g7 x; Z6 x6 E push 002a002ah ; high word specifies which VxD (VWIN32)4 ?2 w9 y- W! g- J5 }3 p
; low word specifies which service
% z& d2 O1 R' X$ D" G/ } (VWIN32_Int41Dispatch)# |" l2 X) n$ h4 g# }
call Kernel32!ORD_001 ; VxdCall' a' V, O: B: B2 z! s& ]
cmp ax, 0f386h ; magic number returned by system debuggers1 Q& B! ?' J0 C0 u
jz SoftICE_detected9 g, I& L" U T9 v. @. K) O
' I2 Q7 w" _, nHere again, several ways to detect it:
* k1 v. h/ B: X0 K/ w" V
% T, N8 ~ j" v7 Z4 b& g BPINT 41 if ax==4f
8 h# p. ]# C% c$ z# A
. f& X& B, J0 ^% C" I) G6 F BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
`* G+ X3 `' _3 K. [' e6 R
9 N \ z8 c0 F. Q0 E BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A, b0 D% K* p2 b7 z# F' W3 s- q
) G3 ]: ]% m) U v9 L) X
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
/ n$ T1 N4 I( H8 C+ a% N( G+ \# Z4 u- F) H5 v
__________________________________________________________________________
5 {2 S% X; Y; V, j& l9 i( ~& {+ c4 o1 I& L
Method 13
( ~! g. c* i3 a9 X=========
5 O( T9 S. i2 s6 K5 F
: R* |( ?( u! M+ n8 b( N' jNot a real method of detection, but a good way to know if SoftICE is
6 ~) |$ {0 b( N2 @& Hinstalled on a computer and to locate its installation directory.5 L, k" ?0 i$ l9 M& _
It is used by few softs which access the following registry keys (usually #2) :
( H! ?! K, n; |( }) z
, C! ^ s4 K/ J& i0 a5 P" v-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 @; H0 e, H ~. U# N
\Uninstall\SoftICE1 }* P8 ?7 P; M0 J9 @
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 B0 B7 N3 t( X3 Q8 o/ f7 P-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! \ H+ y7 `7 k) u3 z
\App Paths\Loader32.Exe1 a- O/ n/ [+ k8 a W4 X2 q; T( u. t
' Z( s# J" i' G& S: Q# `' |
8 C8 H: g0 t) {( q, y: o: I; _Note that some nasty apps could then erase all files from SoftICE directory8 E) X$ q/ s5 w( m. |4 |# o
(I faced that once :-(
3 P* E4 b& f. b# j
) b+ A5 Y* d& b# l, {" g. U" aUseful breakpoint to detect it:. A& O" v6 \1 e6 }1 ~4 m! U
8 m; |4 y1 J( g* G BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'/ D. H0 q' X7 `' D7 E. P
8 \# j, O5 O% u& ^" S
__________________________________________________________________________; E9 x" K" Y( a9 }
1 O; L2 Y2 }8 i5 P4 ~; u
4 B8 k* ~. d! Y% N- B; DMethod 14
& ]# r" I# h* f4 {6 G=========7 p3 k/ j! J, ^1 C; ~
' s$ B2 S! {6 HA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose2 x8 {- T2 }$ f# T5 I+ Q
is to determines whether a debugger is running on your system (ring0 only).
0 Z3 ~, t6 B; |0 a" M0 m( f0 x) e
VMMCall Test_Debug_Installed% v" \* H3 x6 S" J& E/ o
je not_installed
" B% N3 z4 U1 V( Y; ]5 Y/ V# G$ [# i' {# _1 `4 k
This service just checks a flag.5 D9 f- i8 ]' j9 \( H8 o
</PRE></TD></TR></TBODY></TABLE> |