<TABLE width=500>
9 g% l7 _9 j4 d<TBODY>& i( }, V4 \/ R
<TR>
$ z3 P; A0 Y3 {: z: G<TD><PRE>Method 01
9 f5 [0 R+ C! P( h=========
! O- m* u# T& T! o. t; z" u+ T$ e- ~4 i+ t5 _$ p
This method of detection of SoftICE (as well as the following one) is
% {' t- N% [, F0 i7 lused by the majority of packers/encryptors found on Internet.
6 Z2 S# [. w. P* M, c" oIt seeks the signature of BoundsChecker in SoftICE' @+ q8 S) ~6 w' J" @8 G% ~
$ t% q2 U8 S+ G3 V5 X b' a mov ebp, 04243484Bh ; 'BCHK'
$ o' s. F7 ^+ f/ ]7 i6 A mov ax, 04h
0 N6 c, z) a7 y3 C& O! s; k) w! _ int 3
" p. T5 q$ d( s2 l6 y cmp al,46 S$ I3 W5 C8 p4 F* c2 L$ W
jnz SoftICE_Detected
# m2 l3 T+ w* c7 {" U2 m, e7 _' O2 J
___________________________________________________________________________
- {4 P! v6 t, g6 X3 f/ z) @8 ?0 ^- U j0 I( _3 z
Method 02* D D' a& p( J& D# g1 _8 q2 s
=========4 T8 n+ v5 s$ B; n+ C& S
1 {0 |5 c/ G% d( i$ }6 X' S6 \Still a method very much used (perhaps the most frequent one). It is used
/ o" Z* {: v6 wto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
: ?( H- \( Z( c( S" }or execute SoftICE commands...
4 ^8 d; G" z8 y; O& j7 q2 jIt is also used to crash SoftICE and to force it to execute any commands
- [- b" F% D# W# p* R(HBOOT...) :-((
0 g( T+ y+ {/ i2 @6 t9 F( d3 Z7 B F1 P: a
Here is a quick description:# M- s: u8 x: o$ P
-AX = 0910h (Display string in SIce windows)
# C, C/ X# p# G' E) A; ?! h-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& g$ m( R O0 |3 H& m/ v, ^
-AX = 0912h (Get breakpoint infos)
8 f$ L" [; [# C* K5 L-AX = 0913h (Set Sice breakpoints): [# L5 y2 X0 V. _# f
-AX = 0914h (Remove SIce breakoints). G+ \ c/ Z. g8 u4 y% ~- ~8 p
3 g# [! O' J& |* K! _" t0 x# \' x2 S
Each time you'll meet this trick, you'll see:* P( P+ B, S9 s( Z5 F# C% ?
-SI = 4647h
8 \1 a( r3 I6 ~1 ]-DI = 4A4Dh
& S( w; G( F( l1 A4 J- U' BWhich are the 'magic values' used by SoftIce.
. M0 }+ S1 H5 [7 b8 @% {For more informations, see "Ralf Brown Interrupt list" chapter int 03h. g/ U/ f7 J8 }% B/ D) F
& y/ L0 N. t/ W: ^+ c; [
Here is one example from the file "Haspinst.exe" which is the dongle HASP6 O- K1 b3 h( J6 h6 v3 [6 B
Envelope utility use to protect DOS applications:+ D5 c7 f2 O' A1 U4 G
) m% X2 s$ y. k& Z- K" t* j
" U: L8 v1 B I) ~4C19:0095 MOV AX,0911 ; execute command.
9 f' A- E" n; k/ V5 ]4 O- B; A4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; L O9 E9 X- X
4C19:009A MOV SI,4647 ; 1st magic value.3 _1 {6 H8 b+ J6 o/ x- d2 G
4C19:009D MOV DI,4A4D ; 2nd magic value.! X. G% w) B) T
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# l; t# M; X* _! b7 [6 R4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
$ E9 n! X% @; s$ {2 e7 M4C19:00A4 INC CX) E. T1 j4 t2 U5 r6 N
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute0 W( ~3 ~* H$ E
4C19:00A8 JB 0095 ; 6 different commands.
9 }4 S* J2 U: i- K5 H4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 k* [8 m* M1 j. A: Z5 B+ B8 K4 h# S4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 s: [2 g, e) U3 n
8 V, z' t0 I7 MThe program will execute 6 different SIce commands located at ds:dx, which) s4 U9 b% w; u4 H5 A
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.! @3 V+ v) L* C2 X# R* I9 n. x
# N% c- a2 g9 q, g
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.! u0 q1 W) I: Z, @2 @5 ~3 f
___________________________________________________________________________
9 r- _5 n1 e+ r( Q$ B' ?. x! b, v3 i( z' f9 d. A
0 n, _% g6 D E* Q: F, _( pMethod 03
8 n3 I9 E/ D4 n6 o3 G* C=========7 x1 ^3 j2 z# U
2 H( L5 @1 m( j" J/ e% W0 ^, Q
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h1 K7 a& d5 ?7 r8 J( }1 Z
(API Get entry point)
; @" K0 N% u/ h/ | ; E" N; m' i$ c# w3 h; E g( ?
: L3 v! V H- |# B xor di,di% \" { @3 R0 F
mov es,di
% V5 @2 E' f+ C mov ax, 1684h
3 _4 O+ C4 F/ Y: O, I2 C mov bx, 0202h ; VxD ID of winice
. s8 b4 `) J. a) V7 U# A, p int 2Fh) l: G3 z' M! {. q1 }
mov ax, es ; ES:DI -> VxD API entry point; {! v7 s1 n( ?8 u
add ax, di' x, O: E4 h* \1 S2 {3 i- h* |
test ax,ax( v& i: z: h& x, v* |
jnz SoftICE_Detected
* I% |2 s$ |1 J: W5 E. j9 H& g( w9 L/ a3 j
___________________________________________________________________________- w( N* m6 p- J2 @2 G
% r w4 A, |0 Y0 |2 ^ mMethod 042 V' R2 ]+ r- k% ?) [3 A$ ?
=========
+ x* {8 `, Q# @* t( g) c# F5 u, F" G" P0 O! E/ Q3 T
Method identical to the preceding one except that it seeks the ID of SoftICE
* e7 \2 z4 ]4 u4 a/ K8 g! d2 dGFX VxD.2 L6 l; [% o: N9 X4 ]: K1 n6 P! T
0 n, {' N# i+ B+ M, `( m% c, ~% I- q
xor di,di
: [9 T6 D4 [5 V mov es,di
% M U% b2 C6 q( U+ G% |* [ mov ax, 1684h
7 Y3 y: x3 \: W mov bx, 7a5Fh ; VxD ID of SIWVID+ b" v( L* Q1 f% l C0 [
int 2fh0 W4 J4 n6 W) P m) d1 n/ L; L5 V
mov ax, es ; ES:DI -> VxD API entry point
$ f3 K4 T2 Y" T# t/ d add ax, di# ]! P9 M. c$ q: S
test ax,ax
. J2 W9 G+ T9 f jnz SoftICE_Detected
/ x5 V- D" Y, E% q4 m5 R
% C& t- |2 ~$ E8 Q! a; e__________________________________________________________________________# V. [6 x3 L6 X2 w, {
3 E) _) F+ D* G \; g5 i7 x4 Z3 z
: k, A" T$ x1 y5 e, o* M/ I! s& EMethod 059 r/ X: B, i8 b2 U8 X
=========2 l5 a0 p- Q, h
/ i0 e' Z5 I& p8 X1 WMethod seeking the 'magic number' 0F386h returned (in ax) by all system% ]: ]( q- g3 |7 t9 x
debugger. It calls the int 41h, function 4Fh.9 w( B! j3 S8 f( s" w# Z8 n
There are several alternatives. / \$ O3 B/ c; S+ k6 B! ?, c
# S6 n5 k" Y& I% T: n( |6 I) W
The following one is the simplest:
7 l% t$ }7 ]7 K' w# |; _- M* u1 s, n* ~1 w
mov ax,4fh
& T2 K9 \! G# y9 e int 41h5 z( M: d7 W' ~+ J9 e3 Z
cmp ax, 0F386
* c" n/ [1 O; u: D jz SoftICE_detected
: @4 g) s7 k% I9 J% A8 R) q9 d0 \$ b ]
3 s5 V$ Y% m' ?. U
Next method as well as the following one are 2 examples from Stone's ^6 ~% ~3 n- ~0 V5 z3 w
"stn-wid.zip" (www.cracking.net):: e _- F" v$ `9 ]. M* P+ k
: o3 h8 P A. z$ H% i7 f
mov bx, cs1 Z9 \& g5 J3 f5 i+ F: d% Q3 U
lea dx, int41handler2# A# K' f; c1 |
xchg dx, es:[41h*4]7 ~9 d" N& o+ E& j9 }
xchg bx, es:[41h*4+2]
3 m. {! q' J1 q7 _1 W mov ax,4fh
0 |& o7 K( D4 T, {3 [ int 41h
7 @/ L6 i4 [& S. W; b2 E' S" C xchg dx, es:[41h*4]* T; O3 ]7 F4 y; e
xchg bx, es:[41h*4+2]
2 S Z; U' J. e' _: p* n* _ cmp ax, 0f386h" s7 E8 V3 `# @4 }
jz SoftICE_detected% |9 ?; |9 V8 e- s [
* Y1 k5 ]- f' q/ q3 y1 r
int41handler2 PROC3 Q8 e4 a4 e' H
iret
+ @# N9 ^1 J4 O5 p/ G( xint41handler2 ENDP
+ B7 C! n: l- l9 h* v( D E! W- q" G% d& L1 f0 @
$ V6 @( G8 N# C9 _7 D7 h, `3 K_________________________________________________________________________, Q5 \' E8 a( `6 B# A$ F# g
1 b/ n7 G( T/ A e. V
3 K1 t6 ?% \9 RMethod 06
4 m- r9 T& m; l0 o) G+ N/ G7 ?=========
3 `. E: e* X" b* }) F
8 [+ e( Y, k( A8 L7 D
5 F9 ]% {# n& J5 `2nd method similar to the preceding one but more difficult to detect:/ u1 H/ X% `* E; ^8 U; v z! C5 u
; F" | Z: _# a
- s3 P/ }# K# j4 F# l/ r2 qint41handler PROC9 E" W+ b0 w# h% _9 S
mov cl,al
& A3 s- W6 S3 M iret
$ B1 `- X( o+ {! k& W: i1 Xint41handler ENDP
* S7 o; |+ C$ G9 @5 |" R- s" ~, S* u C, d: t; d' O
& j9 e$ h% Q" B$ Z. b* Z5 D: x# r9 V
xor ax,ax
/ K6 y) A8 T. ]6 m mov es,ax! ]6 L$ S: Z- c) a9 ^
mov bx, cs
5 H& C( K$ b. }: U$ N( e lea dx, int41handler
& Y- p7 I b. M' L/ D" ]0 \0 s0 W xchg dx, es:[41h*4]6 O1 {7 C t6 o( `. O( Z+ m
xchg bx, es:[41h*4+2]
& ]2 P) \6 K* ~0 K in al, 40h: a' z- A1 O% q# v
xor cx,cx+ C) s8 H0 E( I7 z0 W- S
int 41h
- H6 m/ }, P' ~/ d xchg dx, es:[41h*4]* u- k I! i9 C: W3 E$ \6 A
xchg bx, es:[41h*4+2]
# A8 k4 W* u+ O% v& J" x, ? cmp cl,al1 q7 ^8 \; L1 u) k' Z
jnz SoftICE_detected( q) F. {1 B. C
0 Y d* g+ z; a_________________________________________________________________________, `. Y8 B) W/ e) X
$ O# E/ }: F& `: TMethod 07' @: j2 _$ z+ i8 i1 G; q
=========9 ]2 |. A# w. n3 y" a2 E
. _- \2 x8 F9 c3 V9 n7 aMethod of detection of the WinICE handler in the int68h (V86)9 e% B: Y- Q* E# _$ U
) f7 i9 F6 a4 e8 Z mov ah,43h) ]( A% S9 V5 G5 J
int 68h
. i" c5 A" s: t2 h cmp ax,0F386h7 E/ r: E; y1 p
jz SoftICE_Detected9 k6 C3 S- @! C, G7 s
/ N! D2 i1 }4 ^2 f
5 i( V6 t0 o! j=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
8 {2 ?7 o' H5 P/ f app like this:
5 j/ m( l% o$ G0 v
) @0 `! L; d2 F7 V# ^+ u BPX exec_int if ax==68
% y; o) u. @+ \! ]. Y& Z" S (function called is located at byte ptr [ebp+1Dh] and client eip is
$ Y# b$ y6 x g+ j located at [ebp+48h] for 32Bit apps)
* J. J# R; |7 M) ~3 T: v# \0 D__________________________________________________________________________
D R% q z3 o! \ E2 l4 |" f0 B% Z2 a. w* N2 a+ q: @
/ ?8 l0 F0 g) l* rMethod 08
. [5 U$ A: w* O1 _5 H1 P=========9 w) Z! q Z/ H6 y5 U0 X
# S7 [# J3 n" A- w+ UIt is not a method of detection of SoftICE but a possibility to crash the; L! s$ I8 h; A$ F* b8 Y3 E
system by intercepting int 01h and int 03h and redirecting them to another' Z: |/ ?$ p; Y7 [- r" A
routine.' U$ a3 {8 H) Q ?% Q5 k- o$ H" ~
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! n0 l4 p( ?) Y" c5 N# r# z
to the new routine to execute (hangs computer...)" K3 G5 V. }1 C2 c* g
$ x: f( j+ H! y* w+ c2 o' ]
mov ah, 25h
3 U* G' x! E9 G# X' P% N/ n l mov al, Int_Number (01h or 03h)
+ R* ?: [9 D6 u6 ]4 N m; D mov dx, offset New_Int_Routine
/ V5 I0 ]2 `# W) X9 T4 e int 21h" k* _1 ?& n' ?. H2 j/ t
, i: r8 e5 y) C' s. w
__________________________________________________________________________
v6 }- Y* s l% y5 q' I2 P
( [2 n( Z1 h( c& r* A* U* b0 ZMethod 09+ r, f+ w0 X; X, ]! u9 F9 @
=========, G# H6 V' Z$ W1 X( }2 E. \
; N9 a* r2 j# j5 i5 H9 uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( d3 ~0 R% n) x8 a& x9 J r% G
performed in ring0 (VxD or a ring3 app using the VxdCall)./ D" i) n* U/ v7 J) v
The Get_DDB service is used to determine whether or not a VxD is installed
* j& E2 w; Q+ m! [3 Pfor the specified device and returns a Device Description Block (in ecx) for
: X- R# Y/ Y% c# Q" ythat device if it is installed.
& F1 I* _9 U* X. \- Q9 v! G$ @' Z; f" e0 q% t
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID% \* M+ f8 P, l& u% g& B
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% U8 S t, }5 X VMMCall Get_DDB
2 N' [* f- G6 p( `9 H/ G mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
" x6 q" r. w' q- m2 y, U2 X' O' ?
% B' l4 V& p8 gNote as well that you can easily detect this method with SoftICE:
6 \5 }1 f4 h6 ]: s; A bpx Get_DDB if ax==0202 || ax==7a5fh
0 s7 H. c) c* A0 G4 T/ z7 J5 i. Q; Y1 @
__________________________________________________________________________
# i0 ?3 s) D+ Q5 D& U5 H+ ^+ ]% A5 b/ n. R& j( C
Method 10
" q" C3 O, W8 K' G$ `1 T( V=========6 t% b7 }7 x( O$ r
# r7 G6 K$ ^* ?# \1 L=>Disable or clear breakpoints before using this feature. DO NOT trace with$ `$ H5 O7 K+ v$ ]4 J
SoftICE while the option is enable!!0 }5 V$ i" N7 U
# o1 W; Q( Q( e. cThis trick is very efficient:$ Q! a, h5 N* m0 S* l( k
by checking the Debug Registers, you can detect if SoftICE is loaded2 v, J! `7 k* R3 t
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) \& [+ D: h2 x/ A8 A M
there are some memory breakpoints set (dr0 to dr3) simply by reading their3 j8 Z2 U5 z0 H2 i1 P* @ W
value (in ring0 only). Values can be manipulated and or changed as well
' E, L5 D( i8 _' L- V0 ]' v(clearing BPMs for instance)
+ W s8 K9 q3 d- u4 b+ m# n/ _. o. `" _1 f1 m* _9 ?5 Q
__________________________________________________________________________
1 O! `1 |7 X$ @+ |
. q- m% d4 t" ]: V8 w2 J* ^% ]; sMethod 11
# [& ?, {" T( T4 \: M# h% v9 Z=========
# ~, W2 p3 q- F a4 z+ m
! k9 w9 G; t0 `9 q' qThis method is most known as 'MeltICE' because it has been freely distributed* C- _1 W9 ^; Z6 @; c6 X6 i
via www.winfiles.com. However it was first used by NuMega people to allow
, U! Y6 T# j. P9 Q' [" J* O+ q0 ^- lSymbol Loader to check if SoftICE was active or not (the code is located
& s$ o2 J0 o; X, k1 |: f8 tinside nmtrans.dll).
, e+ ~) I3 x3 L- x" i: ~7 z. @3 p1 g& [5 \$ R
The way it works is very simple:
3 S. ^ w- F0 mIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" ]" S# V ~1 ^0 hWinNT) with the CreateFileA API.2 g3 n% h' N( S J/ L
, \. f: o6 A/ k5 lHere is a sample (checking for 'SICE'):
' N8 w2 M+ M$ D+ I I W9 W( h! w" o9 K
BOOL IsSoftIce95Loaded()
- e$ H" [- f" e: x+ o{
& y9 }" W8 _8 Y- p3 c1 Z0 k HANDLE hFile;
0 \) U: \* C7 P, K; d% F9 j" J hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 I0 H# B6 V( r& a) C' u/ G FILE_SHARE_READ | FILE_SHARE_WRITE,
- H1 a) W" s% U2 F NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
& M, V& ^8 H; o# Y( @ if( hFile != INVALID_HANDLE_VALUE )6 s" b% q" }+ N, S8 ^6 o1 r B2 @
{
) _" i, Z9 g: \% _6 L# k& n CloseHandle(hFile);
! q1 c3 ]- z1 W, ?& b3 ^ return TRUE;% ~* I& M9 I8 u+ A# b! W9 \! m
}
' Z" p# n8 J3 a3 S- z' m return FALSE;' d+ x x9 j$ g1 B# U0 `9 q% o
}
0 J" c1 s9 W1 ~$ Q
9 |; D/ J( W5 j0 Y1 M5 {9 HAlthough this trick calls the CreateFileA function, don't even expect to be
# q% z; j% x g; sable to intercept it by installing a IFS hook: it will not work, no way!
) c) X: _3 l" \$ qIn fact, after the call to CreateFileA it will get through VWIN32 0x001F$ S$ O5 ` \0 H- T* {
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& R# ?8 n2 W2 m3 h# U# j' @
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 f! v; A9 b$ o- i7 Qfield.
: ]# _4 a1 ?9 ?In fact, its purpose is not to load/unload VxDs but only to send a
7 P, Q. @ y; N* L" lW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
~0 n; L, _3 }5 Q: ]to the VxD Control_Dispatch proc (how the hell a shareware soft could try
s8 M3 x; w( E6 Oto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ j7 {0 T) l" h4 [. y
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 C# n! c( t/ `8 C
its handle to be opened and then, will be detected.
" A' ~1 f' A; E# oYou can check that simply by hooking Winice.exe control proc entry point3 |7 ?* y3 W4 e1 r+ l; `
while running MeltICE.4 \; C- o$ Q, k* v
`0 Y2 @- l( R, g& n8 |, U4 z
/ E, t, t9 G+ x4 ? 00401067: push 00402025 ; \\.\SICE
, H; R/ ?% y x( K$ n; C. ? 0040106C: call CreateFileA% o& X+ K; R9 `5 w- p
00401071: cmp eax,-001% ~2 B7 B: Q% L) Y* A9 l
00401074: je 00401091
2 n+ [" d. l7 p7 s9 D% b: [. D
8 s$ i0 f/ H1 s i% J( A! Y a4 }0 w( z2 C1 h! G2 F, k
There could be hundreds of BPX you could use to detect this trick.2 T/ k V8 @5 h
-The most classical one is:
3 U! H" F+ n( Q6 x' g6 B BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
2 r! d! {6 W+ m0 s# h *(esp->4+4)=='NTIC'
- l% p+ D T+ ~; a1 m. x9 q; _4 k+ ]- n+ \) R* ?
-The most exotic ones (could be very slooooow :-(4 N: c/ Z( o3 R' s K3 G) v( }
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 2 \ Q p" R* R X, Y* E; R! c
;will break 3 times :-(
; k6 @0 G1 {7 f4 t) ^4 W0 t7 K L0 K4 Y( C, n0 P
-or (a bit) faster:
" [$ M2 w( X, a* A" f& _! k BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
}, |( _3 n( I ]( B
) ]* B9 x! q3 G7 y% q' n. z$ m! h& x! P BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 3 d$ `/ f, t$ x
;will break 3 times :-(
7 q; n+ G- P( T, j' M( _
& c7 T% M% ?4 ^9 z; W-Much faster:5 n( C# g) _' e- B" t5 p8 N* \: I
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% K. L7 V$ A4 v4 ?" }: i4 Z1 t8 k+ Y B: _3 D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
* \9 A5 j5 v/ N5 }& b5 X7 W& y% Hfunction to do the same job:3 u. d1 p* [& V) b6 _
- A% ~% }% G& N3 }1 U. M push 00 ; OF_READ
/ I6 c( K' p9 V, J& N mov eax,[00656634] ; '\\.\SICE',0% t9 S% B% D; O& S5 _% y/ q
push eax
9 p- u, D5 ?9 \8 E call KERNEL32!_lopen
* M3 m# v( p; s. R) k8 m3 x inc eax; j6 A* l n6 f9 @6 v9 H! n
jnz 00650589 ; detected+ u m0 ]% m9 @1 i8 K6 e0 s! k
push 00 ; OF_READ
% I4 [/ I" _; D7 \1 d a mov eax,[00656638] ; '\\.\SICE', |& k, K( f* k3 @5 e( `/ }
push eax
2 ]- ?" a2 b8 e call KERNEL32!_lopen1 J) Q' b2 ~6 o4 l
inc eax
9 f9 v' C9 K7 D& ]0 Z0 X jz 006505ae ; not detected
* e0 F2 E' J1 _1 Z5 L M, p
N0 {' m5 S, v
4 Z' o! T8 B- ?. Y/ m7 r; ~% G' f__________________________________________________________________________7 m1 j7 H6 G1 H" k. p
7 N- K3 T! y" z" J2 m2 {
Method 12
1 i- L" R9 B9 [) a% ?- l=========
# E: d/ p8 J# o! G- B2 h
# O0 r' Y" Z( O( B% P w7 xThis trick is similar to int41h/4fh Debugger installation check (code 05% o1 p6 J1 I m5 U8 n/ U
& 06) but very limited because it's only available for Win95/98 (not NT)% h: B! j4 q8 r q; O0 _% A4 H. s
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# M5 d" C2 n' D7 R5 C
. {3 \6 e" |5 }( x* P
push 0000004fh ; function 4fh
9 d; [' d! j0 t+ b6 w push 002a002ah ; high word specifies which VxD (VWIN32). O$ s7 ]3 x& d2 i. J
; low word specifies which service* N/ Q6 Q+ p! j9 r$ t, P* ]$ S
(VWIN32_Int41Dispatch)( s4 |+ E4 q7 V
call Kernel32!ORD_001 ; VxdCall
. p6 F% f- O8 P' o3 W$ ]# [ cmp ax, 0f386h ; magic number returned by system debuggers( k$ l7 N5 O+ R& N8 W
jz SoftICE_detected# a+ O% W3 I# z/ y B8 e% e& H
8 P8 B b5 H4 x7 q* e
Here again, several ways to detect it:
3 I6 W0 Q. I4 V1 v/ a5 v3 S! c* h# r8 b9 l9 ~: A' W: i
BPINT 41 if ax==4f
/ S1 t* o# t! b& X
, E0 m& i4 f6 c T3 | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one! B$ f0 a# R, h5 `( x7 ]" `
5 U0 x' t7 _% X" V2 D6 b
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A& P$ M$ ?, B/ c G1 c y; m
6 Q3 O J/ a& m; t BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
% U* v# G- P0 d% u" @) Q1 q
* R0 h: R( M( X1 `& c1 r J# d__________________________________________________________________________. \' x" G# }7 M
, R7 J& o1 Y4 H5 r( `1 R, H+ LMethod 13. m$ ~# d4 p5 t' U
=========0 S& V. y+ }0 s# i
8 Z3 g) ]) |0 e- T9 ?: o
Not a real method of detection, but a good way to know if SoftICE is
" l8 s( c) `+ Q$ Jinstalled on a computer and to locate its installation directory.
2 @& l" V5 z9 AIt is used by few softs which access the following registry keys (usually #2) :
" U# T: _' |. |! [1 N* h- n/ {% Y3 j) b& e
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 k6 O) `, X1 b. _
\Uninstall\SoftICE
9 R' O0 l4 U$ w6 o-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 E) H2 T/ I1 F5 w
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( Y; C/ d8 q% p. q1 `1 V
\App Paths\Loader32.Exe
8 G3 s/ W! n' T5 e v* g) x! e: C* T
8 x7 D6 t8 a, S
Note that some nasty apps could then erase all files from SoftICE directory- N; t6 z, x! z w
(I faced that once :-(
; b: f7 e* I+ d5 p) s$ |6 T- Y5 w4 E$ p' }: p; `
Useful breakpoint to detect it:+ d! Z, f8 f5 ~. \5 O
& d' J' `+ f+ o. q7 e% F5 i" l BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ w0 n+ ]3 ^( |1 e; ~
/ x/ K* Z+ K0 J__________________________________________________________________________
/ j! c1 z1 Q; B$ I- P& l! D/ S! \. U
/ _( L- S' `# H4 T8 V. c. oMethod 14 - B, \8 @' C) e H5 |. s
=========
& N f! m6 Q+ N3 Q
4 @$ B' o- |* i' p- d; h: p9 iA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose7 a2 u% N S6 ]9 H# H
is to determines whether a debugger is running on your system (ring0 only).! A% Q) q% |- Q, g* ~3 ~: z
H _. M+ c: A6 C" {5 n VMMCall Test_Debug_Installed% Z! q0 @+ X/ a. F8 L! w9 `
je not_installed
$ W* J5 v0 b9 U$ N& |# Q* O5 B; e) m" R
This service just checks a flag.
8 o3 L( }! \/ w# j! _. g( C7 O</PRE></TD></TR></TBODY></TABLE> |