<TABLE width=500> I3 ~& ?; ^- C
<TBODY>0 w/ [$ O) z$ e& _5 r, i$ Q5 a
<TR>
* ?5 N- t' X# Y<TD><PRE>Method 01 1 n5 w) B; R/ q. ^8 p
=========
A* {( @8 r3 \- o0 y. x# X+ I( R9 \
This method of detection of SoftICE (as well as the following one) is
( g, m) I& X- W6 t/ p4 i3 o9 gused by the majority of packers/encryptors found on Internet.
% ^" a) m7 x: U( X& PIt seeks the signature of BoundsChecker in SoftICE. M# P) I" {# P! o p. }- r
4 j( k; S+ y8 S3 K mov ebp, 04243484Bh ; 'BCHK'' a9 U( }! _# r" M
mov ax, 04h6 i0 I9 _ d$ e# c) G. E9 |: g& s
int 3 6 j8 P, @; V1 ~
cmp al,4. _! O2 u& P3 L3 t
jnz SoftICE_Detected B+ {% N! `. {9 H; |7 {9 J8 ~
! t" s3 k) f3 E8 T, A: H- u% M
___________________________________________________________________________9 X7 j2 _6 i/ g9 O2 J
& l$ V& Z/ c; B" U' i' D! T) mMethod 02
. f& N4 C" Y5 O& ~$ i0 o=========3 H! b& Z- I' w7 q. g
0 }) u! P: Y7 U, B& @, ]Still a method very much used (perhaps the most frequent one). It is used
6 e$ T5 Q7 U8 }% v- P8 tto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& Q8 |/ K: _8 aor execute SoftICE commands...4 d& ?; Y/ ?( m Y R
It is also used to crash SoftICE and to force it to execute any commands' n. j" T- A; h5 S5 X U( e
(HBOOT...) :-(( / S" q* @1 z' W0 B/ u& I
/ Y- x" h I0 I5 H2 SHere is a quick description:. Q5 W8 N! o- R/ @
-AX = 0910h (Display string in SIce windows)5 d( Z" W8 ^* X2 {) h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
* f1 A n6 G8 r4 [9 \! V5 G-AX = 0912h (Get breakpoint infos)
& u- q9 U' K/ {: B) q-AX = 0913h (Set Sice breakpoints)
6 @3 U; r, e0 U0 ?-AX = 0914h (Remove SIce breakoints)! {1 G g c2 c; d
/ E$ u3 v9 M% `- MEach time you'll meet this trick, you'll see:! A+ Q# J1 l( L, {
-SI = 4647h% i/ R. \3 f( [6 M) a+ {
-DI = 4A4Dh( R$ S3 t6 w: A- ?) j
Which are the 'magic values' used by SoftIce.8 u1 C2 |! P& ^ z. K
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
* @3 S, [' A: j4 W
/ G. `* [# p, XHere is one example from the file "Haspinst.exe" which is the dongle HASP6 d' V. K% _$ ]! D0 r/ N. Y
Envelope utility use to protect DOS applications:
( M+ h5 y) x- o2 X. Q: \# x% e# O! U* ~
$ G: J% U" W0 m- ~- z6 `
4C19:0095 MOV AX,0911 ; execute command.) s2 R q, m, }* P! C6 R
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 u5 y5 u; U T8 A- W. z% H) n4C19:009A MOV SI,4647 ; 1st magic value.
9 |% X, M- }+ r3 E7 i4C19:009D MOV DI,4A4D ; 2nd magic value.* x9 D3 u+ x. i( n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 H$ g" h* w( F6 j3 u% Q. E4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 y3 B' Q$ {1 U, C" @2 k4C19:00A4 INC CX3 C0 i' e, f; |8 I1 v& G
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ I1 ], p& \" H/ R! n& r3 c4C19:00A8 JB 0095 ; 6 different commands.
. [6 S( k& r9 }! H2 ~: E$ j5 Y/ I4C19:00AA JMP 0002 ; Bad_Guy jmp back.' u; m% @; q; @6 p# T
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
+ n) j) u$ v2 m* ~. \% W9 s) K# e2 `7 a$ ]! i
The program will execute 6 different SIce commands located at ds:dx, which
, Y; }! Q6 i( ^; k" _, U5 Hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.$ X# h _: R' I/ @9 q
6 z+ ?, i5 [0 S8 c2 L& [5 }* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
' {, _: t: D' c___________________________________________________________________________6 V5 r. j; |+ Y5 Y( _/ t$ D. I% G, F X
' P: r$ [- v. j
3 U. y( r, w7 T% Z4 ]1 g1 qMethod 037 t8 j& {9 p. T1 t5 D. l
=========
# n% @3 k" ^1 K) r# E# T: {- h
* b3 u3 ], M. Y0 zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ @8 A a( g! G3 z3 {1 |
(API Get entry point)
" g; |. p5 x) j9 N, p: ]
: S$ p: _# p/ F3 g! w# P
# W9 X2 J5 a* s, ` j xor di,di$ W+ P" ]9 B$ ?$ ^) e% I% A) E
mov es,di
. M" Q g; q, @, ^, {5 Z mov ax, 1684h
, Q- @. v- H1 c' R mov bx, 0202h ; VxD ID of winice
. f8 T* F& d( y2 i int 2Fh4 b6 W4 t2 v; P; Q
mov ax, es ; ES:DI -> VxD API entry point' w( K# I9 m+ I# A8 _. t
add ax, di
# O6 r; H7 n B3 |! K% J' b test ax,ax9 F7 S) F& T1 }: J; v4 }( O
jnz SoftICE_Detected9 a- R! a @: w) u2 Q
% X5 e Q v1 `- q# T3 M$ e: J
___________________________________________________________________________
L! [4 f4 a2 i8 V+ |4 K; b c
, A2 ]% w. P1 Y- A. x0 FMethod 04
+ _0 F, l: U+ E: e& D5 I=========! {; k* H, r* l
) K+ l3 H" f& B
Method identical to the preceding one except that it seeks the ID of SoftICE
7 k; t1 G' D6 C+ |GFX VxD.9 ~9 t6 \$ \& x, V4 M
6 H5 |" D. s2 c: R2 f9 d) ?& j, e xor di,di
6 V0 I* {2 B* w0 M$ E3 a% E mov es,di, q: F$ M1 |" ^9 Z' E% Y: a
mov ax, 1684h % ]6 v) @6 s: v4 ~
mov bx, 7a5Fh ; VxD ID of SIWVID* Z5 ?3 d* E( y y7 K
int 2fh0 E' }) A, b7 B# L
mov ax, es ; ES:DI -> VxD API entry point
( q2 N7 c0 G5 i4 V5 j& j add ax, di( p/ {. `! r$ ]# f2 L' z
test ax,ax! X6 Z5 K' p7 _
jnz SoftICE_Detected
, \, c/ B0 T$ }9 I, V: O: K7 ^$ S4 M: w2 [! k
__________________________________________________________________________
; d$ q% I8 s7 x7 D( O8 d7 c4 z, s! w7 h$ U
5 U& a! A3 G) U- k& Q! A; o* ^Method 053 Q* u% `. T! y9 v0 A
=========+ F$ R, S# O, w2 c L
$ B/ l6 M! ^6 m. ^! w, [
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& J# r& B5 E3 h" R' ?2 w. wdebugger. It calls the int 41h, function 4Fh.3 E( S7 J3 v! k" E6 U J9 E
There are several alternatives.
: R6 E" n3 I, I3 r! I# B) d/ W( j+ t H" z8 h. n
The following one is the simplest:
, y( ~" j, `9 v9 b6 Y
9 u! M# ~6 ?. [# t, G+ o6 M. Z mov ax,4fh
# F/ S Q# T! b! N/ v( i" o int 41h, x7 } \: V7 o, M
cmp ax, 0F386
0 e& f/ }* C2 [8 r3 [! U" @ jz SoftICE_detected- Y( }. v+ {5 w- { A. N
# _7 G' h& p: s( u' m* m' q
/ ^& f' i. h& |9 Z# @% X, ]Next method as well as the following one are 2 examples from Stone's
4 _# K, [, }. m8 O5 P"stn-wid.zip" (www.cracking.net):1 {& _ r8 @, S7 }; E: y2 l
7 H) }. }: U' X, g/ @) z mov bx, cs
2 }$ e2 L+ o- W7 J lea dx, int41handler2. F9 G t5 {8 X
xchg dx, es:[41h*4]
( P+ @& Z, H! j9 S: z+ [' D: p# o xchg bx, es:[41h*4+2]6 k* i. e1 R, c. ]2 G' U, S
mov ax,4fh
# a2 ^" \1 p. @ C3 `( W% e int 41h
. s+ v. P, T" u: _# \ s$ B1 ` xchg dx, es:[41h*4]
( F. T# s1 H: e: v# P xchg bx, es:[41h*4+2]
$ u0 b! y4 K/ Q* |9 m/ [+ m cmp ax, 0f386h! |( g. q3 \& ~: C& Z1 s' A
jz SoftICE_detected# }. q% p$ a" D! ~
. b/ f {- ^% Q6 F% o5 I u7 Kint41handler2 PROC. {! K0 T+ n. F
iret
& r9 ~" k5 A* aint41handler2 ENDP
2 E* |" L- R% ~' _- t% V
( ?# e; w4 {5 p, ~9 {1 [. @6 b
: ]6 ^' |8 T6 ]; v_________________________________________________________________________4 e2 Q1 F6 ~& M, C* N
, q1 \( F4 R0 t$ p0 a* C
" K/ s! O: M0 l/ JMethod 06# A5 D* [. N Y: t \! G
=========, \6 x% {! ?1 c1 M% q: ?
# c* N* x7 b; J. G1 g; x7 `* z" i7 ?( [! n$ v: ?! S8 ?* H7 F/ |
2nd method similar to the preceding one but more difficult to detect:
1 r5 Z0 b! a4 W. S7 z( W4 \: p2 X1 ]: b+ \6 `: t d3 V+ }
( L0 V9 K1 j5 |! q6 `; D
int41handler PROC1 ~9 v; x+ E, V+ R& D
mov cl,al
! f# F0 ]- I; M7 W iret
' o4 |$ c4 |4 L* ^) mint41handler ENDP
E, f; ?' n5 f! G; e
6 z& V6 ?) n/ ?& M# z% s7 D2 T
. u1 ?/ b+ V$ B* y1 d xor ax,ax
- o" b% X5 E ~: m w mov es,ax
' ^' q( D; S! l9 J7 h" ]" k+ [ mov bx, cs
- p; ]6 e5 j0 }- [ lea dx, int41handler- C$ R! ]' P- h2 E7 v5 X
xchg dx, es:[41h*4], L8 v; N: s6 W- O9 l
xchg bx, es:[41h*4+2]
3 ?* i; {) s3 @1 Z, P5 r in al, 40h
( [2 N6 N ^( \) y3 g3 W xor cx,cx
; N4 x& H! ^' B- U+ q int 41h
% ^3 [5 e& }5 j) k+ K: ^ H: E xchg dx, es:[41h*4]. h) H, h4 q. b
xchg bx, es:[41h*4+2]
0 e3 k# v5 `" \: K cmp cl,al! [0 R# t- I+ r/ q: n5 t
jnz SoftICE_detected3 I* f! `; b! P/ X( r6 J5 ]! c+ ^
Q( r3 j- M$ a- k
_________________________________________________________________________. _# S; G' g* E3 H! F5 r' o
# ]( \0 ?- N7 \( G+ j# R2 SMethod 07
# Y$ N' f) J: V( n- m7 O$ ?6 e=========0 S2 d+ \% g* @- U7 m' n
5 G) k/ B( p( t! H; \0 ]
Method of detection of the WinICE handler in the int68h (V86)+ W. w$ z0 ^' i9 W* `
6 t; G2 x+ }+ [7 R4 }) O' e6 R, X mov ah,43h' {1 ~* L+ ^* E
int 68h
# F# ^5 d- V/ i1 d& {3 p! J/ m. [ cmp ax,0F386h. ?# C q- M7 g6 h% o
jz SoftICE_Detected
# z: z" B. D( G: M" y: [
& x. d6 R- ^8 D$ n0 c7 L6 K0 B
# D2 h; I6 ]8 A. T% j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& j% s% `" `, b8 _ app like this:8 F$ T) z2 l% w- z& G
y/ I) o: Z; E5 o
BPX exec_int if ax==68
1 F7 S7 c9 Q; L6 O* @( q (function called is located at byte ptr [ebp+1Dh] and client eip is4 c T2 E" T4 k
located at [ebp+48h] for 32Bit apps)5 K$ B" ~6 E/ C0 u2 Y
__________________________________________________________________________. g; ^% K- E' }$ q9 v' M5 A$ p
! C% s- P: y, w& t0 a( A# d
. J/ [3 D# F$ G0 C+ ^" ?Method 08+ Y6 }# v8 j4 q o4 c$ A. F
=========
. r% Z# j; B3 k; S- {7 Y- q
8 D; }& o0 w$ \' u. d2 AIt is not a method of detection of SoftICE but a possibility to crash the T& f7 r7 X7 D
system by intercepting int 01h and int 03h and redirecting them to another: l' c0 i" R: l" L5 i* R& v
routine.
5 c3 }# v% I% }: aIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 d! o3 a: t! d- M( ^5 E
to the new routine to execute (hangs computer...)
0 i* a2 `4 K4 |- `" w& u+ p6 u1 L5 ^' P% |1 E7 u6 F. T/ w
mov ah, 25h/ q9 w: n* a0 J9 c
mov al, Int_Number (01h or 03h)
3 ~6 j8 u7 s: q8 }* m1 i# L mov dx, offset New_Int_Routine
- r0 F# y# E( ], B. Z1 k int 21h
H' C- {3 a7 w2 g6 y3 k: g" ~+ `. @6 F9 k+ X
__________________________________________________________________________; }4 V$ ?+ H* P9 e/ y
* w% @" a7 C5 j1 l3 O6 OMethod 099 Y/ o0 I/ ?$ E
=========% I, {2 b6 j) w. I* u h
$ y) {, G7 Q8 O/ y
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 R8 X; G3 a; ]* B3 gperformed in ring0 (VxD or a ring3 app using the VxdCall).
: }7 B( S4 y' T# c' kThe Get_DDB service is used to determine whether or not a VxD is installed5 _% @+ C: p |0 x! J- R
for the specified device and returns a Device Description Block (in ecx) for
7 H. x5 u- `8 _# ], x- ]that device if it is installed.
y4 M: a) K! s
+ e* x, z$ `( z8 n mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 {( v$ Q, o# e6 a% ]3 v# G% |
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-); N8 i6 g/ a/ M0 S
VMMCall Get_DDB% q+ u/ E( R' b
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed9 H. F8 |8 J% v+ M$ a: z
) w6 G; U5 E# T: h+ z8 e0 _Note as well that you can easily detect this method with SoftICE:
% X% ?3 } A/ C: s# B bpx Get_DDB if ax==0202 || ax==7a5fh$ \' H2 H q& \) i/ q
$ X) u9 W8 P% w# H% R__________________________________________________________________________
2 {; J6 {3 a" D5 I6 H/ z4 R4 G
8 }# O) w2 @* D; P" }% P1 fMethod 104 X6 g5 S/ ~1 W3 f# C
=========, A6 j" S+ Q# H- A; S% l8 k' m1 n; \
9 ~* c4 w5 j5 l H5 k% J=>Disable or clear breakpoints before using this feature. DO NOT trace with. @. \' X2 M& U
SoftICE while the option is enable!!/ H1 L/ T6 M3 t" J5 z
; V& Q8 _% _ V. |( [4 v* kThis trick is very efficient:
. s9 ^* o' _0 }by checking the Debug Registers, you can detect if SoftICE is loaded
, ?( A3 k ]- ^! d4 `(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
* F& T; ~6 ]8 d/ Q: {there are some memory breakpoints set (dr0 to dr3) simply by reading their) l( @7 o! z+ ~5 w/ l
value (in ring0 only). Values can be manipulated and or changed as well
* C$ i; p/ w! t/ J2 E(clearing BPMs for instance)7 d8 g9 L; z& m
: w' c* s( P8 {# S( m% H
__________________________________________________________________________
9 X4 q8 V' U: n1 d$ V( y+ N
( T& Z @1 ~! y% @Method 115 r; {, _( E0 ?, F: m
=========" s3 j7 T8 L. D+ |: G
* W- ?7 Z: w9 k l! X9 A) c
This method is most known as 'MeltICE' because it has been freely distributed# w& G+ n* B/ V, E4 U
via www.winfiles.com. However it was first used by NuMega people to allow
% P8 X' e& c. e* f* \4 }7 B! hSymbol Loader to check if SoftICE was active or not (the code is located( B# @$ B3 P$ S0 f o! Q7 z5 M! Z
inside nmtrans.dll).
" M' M$ t8 Z# W; T5 h) H8 ]$ H; v
The way it works is very simple:; l6 o0 o4 U7 a; j! a
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
' \7 C! V) F4 Y" e g! W3 B2 a+ zWinNT) with the CreateFileA API.
' ]0 F6 c. l' s. L1 i; S0 a
3 f0 z6 @3 B- `5 [- s( eHere is a sample (checking for 'SICE'):7 B! Q: F- d1 e1 w g# _0 s
, K/ F! |9 E9 |/ i
BOOL IsSoftIce95Loaded()
3 x; L. S) b7 [" Y+ t{* x, Y9 n- D8 t/ T, F4 m A6 K
HANDLE hFile;
9 {) n- U- {0 { hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
' m t5 f. O$ H' m2 [2 D FILE_SHARE_READ | FILE_SHARE_WRITE,- G6 U% l. l7 E* Q+ \
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ C, g1 X5 Y9 _5 g! r
if( hFile != INVALID_HANDLE_VALUE )2 R4 b# c3 g; X/ s
{
# N; T5 D, ^1 J* z. i8 ? CloseHandle(hFile);
- x1 ~( a' n, r3 w/ } return TRUE;3 ~$ p) K( f/ x/ C' Z
}2 q% j$ Y# a# R) [! r
return FALSE;
+ B7 P+ E* O) B" a- M; D, u) L} A: d( K; \ Z/ ~
% m& Q7 Z, @# I2 H2 U8 Y* H! P% Y
Although this trick calls the CreateFileA function, don't even expect to be
# o1 J( T& P% G1 S: aable to intercept it by installing a IFS hook: it will not work, no way!: X& C. g1 S* h: i0 i; u
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; W. n$ X6 D+ A1 v( z
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
9 Z1 x- J. x% a- ~9 \ Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc, @" G0 D2 |* n7 b% X, K
field.& H0 b( G1 d+ S4 n
In fact, its purpose is not to load/unload VxDs but only to send a
a# [$ ]5 `. H% F1 ]8 @W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 R( J, j! T' z) D/ P. y; s
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
# j7 G, ?% m: s) [& F& fto load/unload a non-dynamically loadable driver such as SoftICE ;-).
1 n1 x0 ?% i N( O5 D+ NIf the VxD is loaded, it will always clear eax and the Carry flag to allow2 k+ s, g# w" F/ \8 P- \
its handle to be opened and then, will be detected.
8 e2 A) {) H& Z1 q) R% j0 ~/ O( YYou can check that simply by hooking Winice.exe control proc entry point
, i& f, U! d7 Z: E, V1 Wwhile running MeltICE.3 v" c6 W' N6 V/ D
' F, |8 g; b. @% x$ J5 m& T
* ~) `0 s- `% f V- k' x 00401067: push 00402025 ; \\.\SICE2 |( u! O' e# o- q$ l' ]( c
0040106C: call CreateFileA$ Q' ?/ l1 V' l; a/ y v
00401071: cmp eax,-001* @4 \6 n' A. d
00401074: je 00401091
: u" \/ X; g0 D: l* b* P5 j# w* _" {; S
% p3 p% f; O( V% lThere could be hundreds of BPX you could use to detect this trick.0 U7 {" { W V
-The most classical one is:5 E* `! ^8 g$ F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
' q' I$ m* r, d5 a *(esp->4+4)=='NTIC'
0 X4 |! Y5 U8 O, ?( k$ C& f7 K& [, D! f6 T$ j0 n s/ ~/ x
-The most exotic ones (could be very slooooow :-(
& M7 u Z0 }# V/ q3 k BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 A( P# y3 f3 R
;will break 3 times :-(. ~' z; e0 X2 y! v& ?1 q, M) H
$ F% Y3 b4 F. Q; y& l-or (a bit) faster:
5 M8 r9 a1 J9 G0 H5 c# Z BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! U+ Y; @* `/ L3 A# C
6 ^% }3 n4 y$ x3 f( k6 I* [0 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 9 T1 A% |) D/ O$ V
;will break 3 times :-(
7 z$ u8 `% F% a, {# x0 h$ I( }' H% c
-Much faster:
. ]% m' s( I( d- r: y BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'4 y' n( c7 m) J
6 y! K) h: m1 `
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 G3 j4 ~& {6 C6 bfunction to do the same job:% j8 }, \" l" C! t' s
1 Q4 e8 u# `1 J+ B* n _
push 00 ; OF_READ0 ?; A: f0 I6 G( j' Q& Q" o& A
mov eax,[00656634] ; '\\.\SICE',0
3 {5 a; ^" g/ ?% C, C4 b push eax
7 N O2 J( p5 y! X/ I3 P% s2 P1 i call KERNEL32!_lopen
2 V' o: q+ ~) N0 Z7 L inc eax9 i: O! V' {9 f/ }7 i
jnz 00650589 ; detected
9 r0 g! \- R m2 S: d push 00 ; OF_READ
; X! w) a( h/ e/ v mov eax,[00656638] ; '\\.\SICE'+ f+ ?* R( Q. q6 `
push eax
$ A! s8 w' |( o, U& I2 w9 l$ e1 H& E; K call KERNEL32!_lopen
1 F9 N, o: T3 M9 o$ a+ B2 u0 d inc eax
: V9 k9 n8 m+ ~8 s/ i% c, a- P jz 006505ae ; not detected/ q, W1 @5 h4 u5 c7 N) h( g) b
; g) d K# h0 _1 k7 Q
- d D W% \: [, _+ W# u. I__________________________________________________________________________" L" ]) G- h1 x! m# A6 Y7 c
9 ?; J4 p9 _, W6 F) g) M0 D. H/ @7 I
Method 12
' ~, A* u, M$ i# R6 V# a=========! ^4 N* h! `* S& r7 M6 E3 i# g
" _! |% B* B) [7 Z5 wThis trick is similar to int41h/4fh Debugger installation check (code 05
$ h9 Z6 J7 k$ R r/ B& 06) but very limited because it's only available for Win95/98 (not NT)
, u9 R& y6 g* M) pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
/ G' D; G0 a2 X6 y, h
' t8 b0 f1 }6 j$ u7 l push 0000004fh ; function 4fh
) n0 @, u S, ?% J push 002a002ah ; high word specifies which VxD (VWIN32)) J) u( W: c- s# m
; low word specifies which service
$ k# p* [/ v5 N, ?- H (VWIN32_Int41Dispatch)
3 B, p& e A0 n ]- n6 _ h" R7 W call Kernel32!ORD_001 ; VxdCall
$ K4 J! D; A" h. [, z P cmp ax, 0f386h ; magic number returned by system debuggers/ b* L2 Y+ X( T$ V
jz SoftICE_detected( l+ s+ L! O7 [
$ s9 k7 F( u5 x- w7 {6 _& A) ], i
Here again, several ways to detect it:8 |8 K* v% _ K$ y
+ L" y/ m1 `" k" ]# [7 z8 F
BPINT 41 if ax==4f7 s6 h! D. _% p( p* t4 s) h) ]- [
$ v/ {/ o+ Y* D( y9 r* `! l
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( R- ~( ~ T5 u' S
2 e; |; `4 w1 k1 a! T$ ?4 x" W
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) T2 v( U3 d- a( i: u$ D d
: r9 E% g! i( X7 R BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
v) U. x( S3 x* H+ F
3 a1 w; G& Q+ V& U2 ?8 m& Q" k' [__________________________________________________________________________
5 w/ S; g. p0 M' ^: H. N3 v- v" v [
Method 13
; [& s2 d# O; q. D6 a' C J. ]=========) }6 Y: J) \9 z
7 r6 V5 Q0 T' V9 o$ e% @& |
Not a real method of detection, but a good way to know if SoftICE is
! n# ^( W9 x0 N# E; v4 linstalled on a computer and to locate its installation directory.
7 m. H& j1 f2 J$ sIt is used by few softs which access the following registry keys (usually #2) :3 `1 D9 f$ \6 g X- W* Y
0 q7 l- C' O2 j7 {; n+ _-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion' V6 f8 K# u8 ~ h
\Uninstall\SoftICE8 C- _3 p& n+ A9 S+ m
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE4 B4 Y0 q' ^$ ~2 l" ^ n9 s
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ o' K% |# t) f\App Paths\Loader32.Exe
: Q: i5 _. u& Q6 T" w; r2 Z- R
! ]! o1 g T2 P T" n2 ]! {) k( F& N( l" Q c [ T
Note that some nasty apps could then erase all files from SoftICE directory
' J' u( n4 b4 E$ _& y9 K! \(I faced that once :-(
. Q4 Y) C! U$ j3 Q; p" b* Z2 X" B+ d- h- T- E' @" E2 j
Useful breakpoint to detect it:
& U/ J! u5 s- c( H9 f/ p* n) U
0 C2 X9 P2 H: h% e `5 |& s BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( B Q& U. w. M5 a
' Y0 t* p' t4 P
__________________________________________________________________________
. M+ b* }- ]% |& x
4 K r, t) K& e6 ~
% E* b& N9 n3 O+ y/ l) GMethod 14 6 I0 E$ c/ q( Z0 J9 M% A | I r* d
=========* ?/ V0 T3 `7 l$ X/ R
) q8 Q1 S3 h! N: {5 |
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose4 D5 q" C5 P( t6 W, f
is to determines whether a debugger is running on your system (ring0 only).: b* ?' z: M4 H/ \ y7 d1 N3 \
8 ^0 t: ?3 X& x8 \" ~' O
VMMCall Test_Debug_Installed h: g5 m0 o# y+ I. }, h
je not_installed
" v7 P& m0 r0 x
. F$ X Q( S8 B; l( a1 `" cThis service just checks a flag.
J3 [( d$ P0 X7 m0 W8 M) S</PRE></TD></TR></TBODY></TABLE> |