<TABLE width=500>
9 ]- S' j4 L$ c<TBODY>
( q; m B% i3 y, |/ H5 M<TR>
# O, u! `$ S+ D6 p: O! S: R<TD><PRE>Method 01 N# _5 S3 S# D1 Q3 E
=========" c' j: M; F+ n: x& _
5 W- W5 e# A. @& ]* }- B4 D' u% s9 `This method of detection of SoftICE (as well as the following one) is$ f% X c" S$ g2 _( h. E0 R
used by the majority of packers/encryptors found on Internet.
$ _6 ]) I+ n( J) J2 g0 Y3 x( \It seeks the signature of BoundsChecker in SoftICE6 }; _. Y& k4 [' X! b& h D
5 u* k$ H/ u" r: x; D1 [ mov ebp, 04243484Bh ; 'BCHK'
; E& m2 c0 a+ Y( |$ e$ H0 m( k8 \ mov ax, 04h0 ]3 w5 d" T9 Y) J9 k
int 3
+ V0 |: l# O5 p. X- Q5 Y cmp al,4
0 T% v) P+ p6 L- S3 a/ Y jnz SoftICE_Detected
. s8 Q& E: f' n
& M: y- @2 _4 l7 U___________________________________________________________________________, s- r& M6 F3 Y) v8 g4 K: n V" e
8 w8 a* g6 _$ C# C+ v7 RMethod 02
( T! {, S& P! s) u" Q. u' a/ {=========' A a) h7 l: w; X3 R
% d5 m0 D% q5 G9 X- n
Still a method very much used (perhaps the most frequent one). It is used% b( D( ^! F! Q, Y0 W3 i
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,' U5 f" o. }8 i. M4 G$ X
or execute SoftICE commands... [: x8 t9 Z6 ~. l9 ^
It is also used to crash SoftICE and to force it to execute any commands$ S# j7 O3 O; H ~7 j
(HBOOT...) :-(( ) E r2 V5 h4 \0 \6 T
3 k2 j9 ]4 n' Z$ t: G7 r& @
Here is a quick description:
+ L/ E- m7 ?: t5 A5 t2 @, W-AX = 0910h (Display string in SIce windows)( O- r( L+ q7 D1 R+ x5 a. _
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
. H! _7 G5 G2 G: M" w-AX = 0912h (Get breakpoint infos)
, o) b3 K P$ C7 Y-AX = 0913h (Set Sice breakpoints)
; }+ X( K2 E, L0 X% L1 I2 U/ Q, e-AX = 0914h (Remove SIce breakoints)" \7 o0 \% l F% s- a. [
Z) {/ l8 i" p- }5 |3 g) g
Each time you'll meet this trick, you'll see:
9 H& | m0 b0 J* [/ o-SI = 4647h
, j6 S* \4 ^ e: U2 F# o-DI = 4A4Dh. @6 {. y# o- b# h& G! B4 q1 z
Which are the 'magic values' used by SoftIce.
- \8 d' V% J( S9 r, |For more informations, see "Ralf Brown Interrupt list" chapter int 03h.! E: e5 ?0 x G' s9 W' _. ~/ l
0 @+ S5 b7 e2 w3 ?# v" ^Here is one example from the file "Haspinst.exe" which is the dongle HASP5 y2 u1 i" w" m
Envelope utility use to protect DOS applications:$ V% x! @# ^8 F9 I8 a- i5 }
) l7 F" n( b" [2 U* C6 z6 [3 ^. j) ~7 b" e# Z* Z, v/ n9 |( m. M
4C19:0095 MOV AX,0911 ; execute command.1 o# t, h' w' `0 |
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
* @$ D7 e7 t0 F3 T7 S: `% p4C19:009A MOV SI,4647 ; 1st magic value.) i5 Q6 G# k* ~1 E! E- ]
4C19:009D MOV DI,4A4D ; 2nd magic value.) |# G$ t# o4 M/ j3 a( ?( s( y; `3 q
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
8 l+ B G! g/ w% _$ L1 ?& x6 G1 `4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute' |4 R( _' j l# ~4 \6 {
4C19:00A4 INC CX' L @5 i* u7 x0 P' A
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( C2 c% e- `# W( T: y$ K4C19:00A8 JB 0095 ; 6 different commands.8 K5 @0 @8 w @2 g$ Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
( Q) B3 S8 o/ v' i$ h* g% T5 Y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
. P$ ^2 V2 H. w4 J- x: W/ J _, m! u2 O8 h
The program will execute 6 different SIce commands located at ds:dx, which
! o9 n% B9 N& ~8 G/ pare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
8 F$ z1 i1 r) E* [# F- N( \6 [) k" _) i% ?
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ ?. G/ E7 ?/ D# v; V___________________________________________________________________________
; Y Y6 |$ {- u0 Q6 L$ n; h" M0 C# Y* s; t: Q K2 X
3 v! q% D" T3 @% P& a
Method 03
+ e* S- U- c" @& ?=========% f" c% K2 L, m( G0 ?
# R6 ^4 l7 `$ xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ v1 T5 h& a# {! t% a* q1 _6 e
(API Get entry point): C2 B0 @! \, @$ a. P5 ^
& e( `0 Y2 y$ |, |& n
# d% y+ M4 e _, j4 \# h' E xor di,di$ }7 J1 I) \0 S3 X8 Z z1 t
mov es,di
- b9 V* f5 A7 Y% h8 g( i9 P; @ mov ax, 1684h
7 |3 o/ V! Y( X+ N- t" G mov bx, 0202h ; VxD ID of winice8 B+ I/ P% M r/ M, _) f' K
int 2Fh
, U" M P& s* G2 M* P7 i z# E mov ax, es ; ES:DI -> VxD API entry point# e3 C& Y" {) [9 K
add ax, di0 y+ w% R) S6 A2 A8 x& X, m
test ax,ax' M) t1 k' [/ M
jnz SoftICE_Detected
/ K' p2 \; l& N+ f: Q4 A) _" W( }& W1 W4 ?
___________________________________________________________________________9 r3 W. j# K c8 `+ z
% l6 N$ P: z* f+ C. O' NMethod 04% H! G4 k+ D# b$ ~* z. r
=========
u# A: v; e3 [( ` [+ d: s
; z- R, Z7 [( D3 F, tMethod identical to the preceding one except that it seeks the ID of SoftICE
* g+ D" Z# C2 @" RGFX VxD.: g; c% Q' x) R3 a R2 Y
+ ~& b& o+ x* B# w
xor di,di8 N( g: F' U; E' E
mov es,di
! x, A) M9 z* M mov ax, 1684h % N! v8 L f3 e8 M0 f' N
mov bx, 7a5Fh ; VxD ID of SIWVID4 Q6 f3 j( {7 D0 X! Y) v
int 2fh
4 `, `. E" x3 n4 x: u5 Q5 V mov ax, es ; ES:DI -> VxD API entry point
7 n- @4 J8 x8 @; q; a2 Z add ax, di F/ m6 q$ t) M& S& ~
test ax,ax
& p$ h3 t6 @0 o, i9 E( J jnz SoftICE_Detected
; |# ~3 r2 T1 B* u1 b. d, ?
6 z! Q5 Y. Y" {% |5 C__________________________________________________________________________
4 i/ F4 r) Y3 `& ^, W" u' V- @
4 x9 \4 E4 J1 w. E, y. \- q4 c) j R! Q/ [5 a
Method 05
, t$ v( y; X$ u6 [& \. R5 F4 w=========/ ]% K1 E, T/ {
8 w# Q2 ?& [! G, e' ?3 sMethod seeking the 'magic number' 0F386h returned (in ax) by all system! l: `$ [6 R! V4 W% ?
debugger. It calls the int 41h, function 4Fh.
. ~, e$ n- q+ a9 g: MThere are several alternatives.
: k5 r! Y: r0 ]7 F) Y: R% m5 k8 b
The following one is the simplest:' P/ M0 Q! C1 I/ q5 ?
7 T/ S2 M+ B/ j* j' \& w6 e
mov ax,4fh
2 l! L% m! j" a3 _/ x3 R int 41h6 v4 r0 m7 {6 o* m5 r+ @( Z$ W
cmp ax, 0F386
% V% ^% z6 n& ]0 D jz SoftICE_detected
5 e6 i @4 z Z6 Z5 s" X/ c( d: Q: {* O' F
/ J' X/ z1 }7 G! y0 v
Next method as well as the following one are 2 examples from Stone's
6 Z0 V" C2 j0 J# _, ? Z! E"stn-wid.zip" (www.cracking.net):0 G; a. N2 R# { h" J6 }( q
# z, b; e# s4 Q9 @0 k! r9 x mov bx, cs
" H9 y. k: C1 m- P% G lea dx, int41handler2
0 f$ q# G1 S1 c9 I xchg dx, es:[41h*4]$ g: N% I% \3 h, l" B! }
xchg bx, es:[41h*4+2]5 N# D1 n; n( [# c: }* `
mov ax,4fh5 u5 k+ d8 P3 \% Z; Q
int 41h% {3 L3 l+ S# D8 O
xchg dx, es:[41h*4]
8 r& R9 ?6 t2 [, Y xchg bx, es:[41h*4+2]
2 k& ]8 B" I6 S) r8 H6 \! A b cmp ax, 0f386h( U3 u- X5 W' W
jz SoftICE_detected
2 @' ]) i+ K! h" k6 O4 n! }: `% f; q2 T# m ^, b
int41handler2 PROC
* i) |7 K! k! E8 P iret0 Y9 g+ A4 D2 |6 N' O
int41handler2 ENDP
) q: K6 C9 K. V( ~/ X! \* h
) z1 [1 D9 J, T2 j
D# x- J* C& M$ L_________________________________________________________________________
( }0 M- H3 `" A1 {) F9 f. Y2 [& z
/ h: t% x" j# n& p
% |" Q' N9 ~1 L; M1 M% [- VMethod 06. o" D, O7 ?+ Q6 ?
=========! o3 F) m! Y8 l5 e: W
1 G; j$ J/ f. x% b- z' T* b c8 S' j6 d6 D7 }- t% o- ~
2nd method similar to the preceding one but more difficult to detect:
% T) g- b4 U! O6 S8 g
9 C# @: W3 g: J) @
! \& Q; E& R7 jint41handler PROC6 E4 z4 J/ z# u5 M: k# v
mov cl,al9 v" ?- U1 u% x+ l5 O0 h, f
iret T( W. y, W1 l4 y
int41handler ENDP* ^8 F4 Y3 C; @' U. {
% j2 m# u5 u, d3 L8 W
4 G# v9 p' a% `/ D- V2 j; A0 O xor ax,ax
/ J/ C0 X0 W8 k0 }4 V. F mov es,ax. M- f1 Y. F7 S+ k: b7 R% K
mov bx, cs% m4 t" L5 w$ H7 o, a/ ]( I* Q5 C
lea dx, int41handler
+ L$ r5 m: _: E; | xchg dx, es:[41h*4]
$ O* D# H- M% h xchg bx, es:[41h*4+2]
$ J# L! G3 T# g& ~ in al, 40h/ p- t* j' d4 m9 A2 p p( T* l8 }
xor cx,cx* H7 k W/ j: q) t* \% t
int 41h ]% d. q# {( x, p; \2 x! [
xchg dx, es:[41h*4]
% J! i- R) U' h5 C& T( Q( f9 q xchg bx, es:[41h*4+2]
0 `5 p$ ]* h$ z# I' p cmp cl,al) }& D a2 {9 s% @
jnz SoftICE_detected
, B" p1 J% p' a2 T9 R
, ^! a1 `8 E9 F/ }7 v_________________________________________________________________________
, M7 e2 \) s |( h$ D$ H/ y/ }
t0 `; l5 l: e6 V$ t XMethod 07" |" h% x- z/ X! z$ p
=========
1 `2 l+ O( F" a3 p' h5 y
0 O) `% e: _& ]$ `& i8 SMethod of detection of the WinICE handler in the int68h (V86)7 j! T4 ]* C( H* E
* R# z9 c( } t$ q: k! _# I/ ^& S
mov ah,43h
) k% m) T" ` U% K+ G' H: A int 68h5 t5 Y6 U" i) g6 |" w7 E2 Y
cmp ax,0F386h( o+ `/ U' I) S2 Q
jz SoftICE_Detected
1 \5 C o/ c; R/ L
! |4 b: O5 o5 w0 h
, s) `/ [4 W! Q9 }5 m6 ^- \=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ w4 h* a3 E* [ app like this:
* Q. P; D3 S5 K, e8 B
. L' g% I$ g: S2 N% r BPX exec_int if ax==68: w' d& j3 G4 \3 ~2 }2 j
(function called is located at byte ptr [ebp+1Dh] and client eip is
. o& }, Y3 A6 H8 `9 [/ g9 _ located at [ebp+48h] for 32Bit apps)
: k3 V* e( S3 I) V2 I__________________________________________________________________________
9 w* v0 E9 a) k3 v9 n
, ]. ^" e5 }( [/ X
* X. m" j6 p" [Method 08
0 W3 S* [+ |$ y& R* p* @=========' ~( L2 r& A( P$ A$ f0 [
6 x2 h. H6 f* W
It is not a method of detection of SoftICE but a possibility to crash the
% m/ t$ U: [2 e& q) j0 l* t' H6 ]system by intercepting int 01h and int 03h and redirecting them to another# W* d; u3 b _# x( X
routine.
0 p+ N2 `6 J: w- _It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. s U8 n* @7 J6 X2 f
to the new routine to execute (hangs computer...)! z& o+ I( c/ B Y# I
. Y- x0 M/ i9 Z8 M* J
mov ah, 25h# @( D7 ]. \; L
mov al, Int_Number (01h or 03h)
$ q. x5 N+ H" g5 d: [% M mov dx, offset New_Int_Routine
# P' b1 t8 `1 W; j( v int 21h
% @5 W" d4 `- W/ y8 Q6 x) C( a7 Y ]4 f' t% b3 i" ]* \. u
__________________________________________________________________________
% B t2 W0 R G# B: c; e5 S; S+ g0 \7 u& z! }. |; f2 x9 o; R
Method 09, B0 ]5 m3 k! T7 m6 g" ]# c- x
=========" H& u. Z' h/ B1 B; |' ~
6 b: D( E4 P& F& i' T9 L0 P( x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only$ c) w9 e3 b, n% m# m4 O8 I
performed in ring0 (VxD or a ring3 app using the VxdCall).
3 \/ ]2 R4 X Y: {The Get_DDB service is used to determine whether or not a VxD is installed3 W* K" {. ^1 c: T
for the specified device and returns a Device Description Block (in ecx) for
# R# [9 N9 q# u" P3 qthat device if it is installed.: o- b" _) R6 @, e* y
/ h/ @& m- a' Z/ H/ p
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% u' h( B3 m; ~5 y
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ Y7 @9 Z3 _0 m) C
VMMCall Get_DDB3 U B2 i6 e$ t0 c" \% u0 q
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# L0 G9 b! }7 l5 d
0 y u% Y' E8 J: p' ~* ]& }Note as well that you can easily detect this method with SoftICE:5 X4 E1 M- Y. H: s- H/ x
bpx Get_DDB if ax==0202 || ax==7a5fh
l5 \' h w7 R. b0 F% J& C! ~$ L* n- N, f% U7 d' ?
__________________________________________________________________________
2 b9 ?2 Q5 P7 _, I# E
`8 `3 Z9 e$ ]: l/ RMethod 10
/ y; `) e# b; t3 z7 R3 w=========2 E7 `( f! c4 x1 M* M
0 J ], q* K" O
=>Disable or clear breakpoints before using this feature. DO NOT trace with3 @7 v9 s% P6 K5 k: H* x
SoftICE while the option is enable!!% N& z* _ d$ f5 s9 E p6 W% s0 `
8 H4 N0 o: [1 q4 P8 H6 r& EThis trick is very efficient:
) H o1 b* |$ E0 [ L9 q' Dby checking the Debug Registers, you can detect if SoftICE is loaded
5 B5 I7 t6 j, C5 [+ d2 v3 c3 F: j(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 j9 S! u8 x2 u2 G, ]/ Q+ h
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 y- j! d- Q9 Lvalue (in ring0 only). Values can be manipulated and or changed as well7 a5 e8 F+ V7 t" E/ s7 z, ]
(clearing BPMs for instance)
P& ~: T- ?! [* ^
3 Q& e% e: R$ \0 p7 j__________________________________________________________________________( c* R2 z: U7 H8 X7 k' T
: T+ H% \7 ]5 ^/ CMethod 11+ A+ }2 y6 e( y; A- r* E# h( Z5 R
=========
5 }# ?( N) x4 b. \$ h5 R; C/ {3 ]
! i& o0 V7 P; nThis method is most known as 'MeltICE' because it has been freely distributed, a" @, ]2 O2 q1 c5 P3 y v
via www.winfiles.com. However it was first used by NuMega people to allow
4 t& E- l: ?+ g9 m% [0 W( L. ASymbol Loader to check if SoftICE was active or not (the code is located
% b( T/ a/ X' k; Q8 Einside nmtrans.dll).1 j, [4 e1 {- e
% l* C$ ]. ?0 t, M( \/ Y4 HThe way it works is very simple:
# ^. M& x4 K6 g- F% q2 _It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
- ]& R3 O" c: \2 ^$ |5 M8 h6 Z( YWinNT) with the CreateFileA API.8 A3 g" q3 e/ z/ n9 Z7 m4 @, H- a
9 w- Z- J+ m# Y8 [
Here is a sample (checking for 'SICE'):, |0 B. @1 n! J$ X, ^0 S
/ L) _, G; b2 W9 K8 Y/ EBOOL IsSoftIce95Loaded()
d! \( O# l' v5 z, R{, u) D9 i7 ^0 T$ j! A) j! G" G
HANDLE hFile; 4 G0 G7 [6 K- x' B. @& r
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,* a; b9 B S6 C. t, D
FILE_SHARE_READ | FILE_SHARE_WRITE,
( H6 s" n# K7 H. ` NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 V5 r6 A+ h( S, W
if( hFile != INVALID_HANDLE_VALUE )
3 G0 g2 E3 \: X( {* Z# H$ v {
3 Z% P: V" K% b" w2 I! B/ j CloseHandle(hFile);
0 J8 G, h9 h* q return TRUE;% G# R3 l# M" ~" [2 h4 a
}% w3 T, l0 F+ U1 X* W' q# U" C% l
return FALSE;1 i6 W" J! u( }. T1 X
}
8 X q: J% Z& |. O4 X6 ~* z% J- x! F3 x
Although this trick calls the CreateFileA function, don't even expect to be. M. V) ], s" j9 X# z
able to intercept it by installing a IFS hook: it will not work, no way!
& f: j; P6 f3 ]- A9 hIn fact, after the call to CreateFileA it will get through VWIN32 0x001F: Y4 d% E7 b( `5 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)9 I% m+ x2 z9 `! z% {
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 y# {5 F1 g4 m& P8 _field.4 W) j" p! u9 I0 c2 \" |: u1 k/ s
In fact, its purpose is not to load/unload VxDs but only to send a
8 e7 c6 @3 x$ Z1 T4 d/ RW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( ^/ n+ _7 [# y+ q, Yto the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 d7 V; D9 N2 tto load/unload a non-dynamically loadable driver such as SoftICE ;-).0 S2 N. E( `& \0 t; }
If the VxD is loaded, it will always clear eax and the Carry flag to allow2 M9 j7 t1 A1 Z" v$ P0 Q8 f
its handle to be opened and then, will be detected.+ q7 b& W' ?$ n& v
You can check that simply by hooking Winice.exe control proc entry point1 v; B, \; n0 @& m
while running MeltICE.: w$ n9 S! p( q& M* P
# L3 z) C, e. `3 p; I
% x* e% I7 x" I+ Q% O# ` 00401067: push 00402025 ; \\.\SICE
: I ?1 A0 d7 E/ r, F3 T 0040106C: call CreateFileA ~0 e3 ^% }, S1 G( K7 x: I/ x
00401071: cmp eax,-0013 N& ^! ]" s0 R1 p, M
00401074: je 00401091
! N* ^5 v8 @7 ?" F
: _- k G. O; \# s0 m# a: W ?% W: ^% h& X# S! y3 s' a
There could be hundreds of BPX you could use to detect this trick.
6 M4 f/ \7 A1 O1 Y-The most classical one is:' F) e% n, R- j" I
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||5 \( ~# c( F8 d+ @/ B$ x
*(esp->4+4)=='NTIC'
& j/ l" M7 F+ Z5 a. R1 D& Y3 I* P# ^2 ]+ j
-The most exotic ones (could be very slooooow :-(
. T) O( l& X" R7 M7 P, }8 S BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 6 D* L e4 o& Q$ l& Y& z- s
;will break 3 times :-(& j1 Q7 P2 G1 R1 i$ L/ K
$ R2 \* }* `+ ^- |4 S
-or (a bit) faster:
- g2 \. {' r! e BPINT 30 if (*edi=='SICE' || *edi=='SIWV'), U- K" x( E, u" _
& u0 p9 d2 X/ U4 z
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 1 Y2 c- x/ o( G
;will break 3 times :-(
" X1 d: ]6 x3 _) \. p, {2 g# j- H. J, f7 U
-Much faster: i& B( f! L8 S
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV', e* P, ~. K/ Z. W' J X" S& `( \
! I# s# D: m. @0 A( |2 P5 s t5 ?Note also that some programs (like AZPR3.00) use de old 16-bit _lopen1 z$ w' B1 C) {- r
function to do the same job:! v: Y$ W: U0 x1 N: ?( s8 U J
1 ^4 I; T" X& C5 u, t push 00 ; OF_READ
9 l/ _2 b# p/ ?, w' i5 r7 A mov eax,[00656634] ; '\\.\SICE',0
" o2 f: z" l3 P* j: v9 x push eax
* ~) m: N. c. Q' e' e( i+ w" @ call KERNEL32!_lopen. T6 W) W1 \5 K& S ~# j5 O% }
inc eax# c& b' U$ k8 o+ W" f3 V
jnz 00650589 ; detected5 o; W; k6 c+ Q
push 00 ; OF_READ
, M4 M- X' l/ D* ~: h( n) B mov eax,[00656638] ; '\\.\SICE'
) P4 g/ s y2 A: A: X push eax
$ U! n8 R; H8 b; E; C" B3 E% [+ x, x call KERNEL32!_lopen% X7 W- h5 l" E2 h
inc eax* ^9 j, Y0 t& H# S+ c6 o3 y
jz 006505ae ; not detected) N# B4 a/ L0 x f
. u8 r0 D6 f: e
: t a/ O# P9 ___________________________________________________________________________
" ~$ x7 t8 u" n* |2 S3 C
7 y# |3 e* {7 c# YMethod 12* X: i- O4 r/ p: h; ]/ O
=========
* N8 m; K! G& k
, Q* E! q5 e, X- V: BThis trick is similar to int41h/4fh Debugger installation check (code 05
, |1 Y/ f" U9 z3 s; I& 06) but very limited because it's only available for Win95/98 (not NT)
# ~5 i/ \0 z7 l4 ]/ |as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, b9 Q) G8 u/ ~; m" _+ o0 V f
) b7 `3 ^, F$ e" I/ ^+ w push 0000004fh ; function 4fh8 ` h: N* v* e2 \( e( x1 `
push 002a002ah ; high word specifies which VxD (VWIN32)
% Q8 T9 r1 f" K* ] ; low word specifies which service
5 ~3 V2 ^: ?! c$ K (VWIN32_Int41Dispatch)- j$ W ]! ]/ P
call Kernel32!ORD_001 ; VxdCall& A: G o7 a3 a2 e
cmp ax, 0f386h ; magic number returned by system debuggers" M& m* @) H z" [7 ~! t
jz SoftICE_detected0 W# D& [) v: F7 n4 L- k
7 g. O0 a. J: \1 k
Here again, several ways to detect it:
6 ~- X0 h! C) R. l# N, b. d
& t# M* l& b7 o BPINT 41 if ax==4f2 S& e1 Y7 C0 m& g3 M
2 v; j: P. @& k% t0 e3 \ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one* f& q1 d- g5 o, f* G/ R
1 Y3 }; n$ {: Q% m7 y BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) h0 N1 P% t; E$ V. ]! C4 P( J' e, w8 u$ U
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!9 U2 a6 k) ^! y" l/ r! Q# ?% r
: ^' ?' O: o1 I* O0 |' n__________________________________________________________________________
6 v5 z P) n8 g$ J6 B' ~6 F
9 a: R: ]3 V# jMethod 13, s4 u R2 x r5 R" F) e$ q
=========4 q' Q) p% k' L1 z% ?( G) t
# W7 @% p3 w. d% X
Not a real method of detection, but a good way to know if SoftICE is( }4 q# U) K/ \0 g
installed on a computer and to locate its installation directory.! D+ c) E3 {/ Y$ Y2 c
It is used by few softs which access the following registry keys (usually #2) :
7 a* G+ P4 V: Q U
5 [$ K5 z+ M9 k-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, }( O. D3 r* Z" s @% F\Uninstall\SoftICE8 \; h- u% J4 W8 t; G; X" y ?+ V
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 V# S! ?( w) N) b& x% B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion, q8 d4 f2 c: @9 ^7 Z% b
\App Paths\Loader32.Exe
" t! N0 `6 T( i) y, C: ?2 v+ I1 e- F
7 h/ n( ?4 A' t( Z9 P' q0 u
Note that some nasty apps could then erase all files from SoftICE directory4 |8 V) C, P/ B- m6 G. J
(I faced that once :-(" |; J6 u, B2 p+ }
5 A; _7 \' o; \7 I( f% F- F6 OUseful breakpoint to detect it:) H- `# g5 U! \8 b* d- p1 z/ ~
& m4 V" T; P& H+ u$ I" D$ N
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'4 T8 F+ e4 |' ^" I% ]7 J
1 r" D0 W+ y: k1 Q__________________________________________________________________________
, F q7 u7 R3 n; s- e! F6 h: f0 E) O& I
7 v4 k- G! Y& F; T' O
Method 14
) D: l ^8 P7 L; p=========
! _0 C! ?3 V1 y
! L2 N) l& _ f% h& H7 N, i. ~1 NA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 _) y: ?% j$ a! { k0 @ K! H
is to determines whether a debugger is running on your system (ring0 only).
4 w+ Y( x5 O# Z6 B+ B! w# Z! i+ e0 B* p$ u) r) P1 D
VMMCall Test_Debug_Installed1 l8 O/ A9 j. q1 [+ Y* }* _+ o
je not_installed5 z0 U) z$ E* A. n7 p
0 C5 A/ R2 O# p9 E2 w
This service just checks a flag.
4 R+ [7 m- B3 A* A" M! x</PRE></TD></TR></TBODY></TABLE> |