<TABLE width=500>
& n* M5 V7 b# X% x* A<TBODY>
/ l. H$ R/ f: a9 r+ c5 D% l4 }, X<TR>
) S* d/ S: E5 x! K0 c$ }<TD><PRE>Method 01 + b$ n N1 J9 a- D, u
=========
( j6 J. P! a" f: y3 z0 v
4 N: c: X: v1 j7 O, g8 V0 I# W/ wThis method of detection of SoftICE (as well as the following one) is
- V; V% R! h9 u1 Jused by the majority of packers/encryptors found on Internet.) |& l- |) j- ~: N. g0 ]& Q" F6 x
It seeks the signature of BoundsChecker in SoftICE$ t `$ Z" p/ }' O# h
; }6 l: G& u! o y/ S2 L, x; o mov ebp, 04243484Bh ; 'BCHK'2 v# s4 s0 i2 g% D4 g0 z+ q% b6 v+ v
mov ax, 04h% ^6 @8 {! Q, N; r3 A0 k6 @0 w
int 3
- n* T; X4 f% A' p, p cmp al,4
; V0 \) J" s& ?, A& o jnz SoftICE_Detected* }& h1 S; w$ t9 @0 a' L
3 } W+ s/ U, [( Z
___________________________________________________________________________
% f6 d2 n$ [( b9 v l( N _3 A- G/ p7 L3 C( V3 O
Method 02" j# b& L! t3 \, c& y; ^
=========% z- z( X+ o/ h$ |; R
6 }) i4 o3 e! T/ jStill a method very much used (perhaps the most frequent one). It is used
% G, A/ C7 F3 r5 \/ n$ Ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 K! S, Q$ v3 ~9 F' N6 s% k# E/ aor execute SoftICE commands...
' c- ^! q: G8 ?1 }# N1 OIt is also used to crash SoftICE and to force it to execute any commands* a9 v) P! ]" b- F' ~ t' S
(HBOOT...) :-(( 6 s* t# z m) G5 T
8 ~ N" |9 u8 y6 ^; mHere is a quick description:5 Q8 c+ i# L) d% m( `: U
-AX = 0910h (Display string in SIce windows)
/ r/ S5 E% t1 I0 b: v4 \2 ]/ s-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)# g2 g4 J5 T4 r$ ]$ R6 G; L0 q
-AX = 0912h (Get breakpoint infos)2 W- v/ `5 o8 O
-AX = 0913h (Set Sice breakpoints); r8 h+ C2 F9 s$ N
-AX = 0914h (Remove SIce breakoints)
% Z8 ]& W0 C! E
# b5 U& v8 m+ PEach time you'll meet this trick, you'll see:+ Z) r s% e, U/ W
-SI = 4647h
1 {1 i: D" ]# u$ g6 [0 C/ q6 `-DI = 4A4Dh/ I7 g1 J6 Q& E+ @! e4 |
Which are the 'magic values' used by SoftIce.
4 i6 h+ N4 `+ j* q+ Z, \For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% q6 s0 h; w1 |6 L8 ]! ^0 o7 v+ E, r4 Y7 B, o
Here is one example from the file "Haspinst.exe" which is the dongle HASP
) H" o" _! b$ S5 w+ zEnvelope utility use to protect DOS applications:1 ?/ s* V5 h. T J/ ~
% [( { N+ J! R) ~+ \
6 c& ~: C' B+ p! I) k4C19:0095 MOV AX,0911 ; execute command.
: i9 U! |+ \. m. e" A1 @& u4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
8 C% ^7 e' K& _. C2 W" L4C19:009A MOV SI,4647 ; 1st magic value., |6 |, s- Y: I/ q" J
4C19:009D MOV DI,4A4D ; 2nd magic value.! n0 N/ a$ W: T3 p' E# n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)# q1 i7 Z, h: h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
& @3 A+ R* c8 |) g" s4C19:00A4 INC CX
4 d1 b( L% i3 _+ |- {! i7 P. \4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
: T/ b' T* o! J1 ~6 o* `( q4C19:00A8 JB 0095 ; 6 different commands.
% c5 X( O$ \- N. E3 y/ k( `4C19:00AA JMP 0002 ; Bad_Guy jmp back., q# r/ R S+ \% w t3 B' l
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
' H# A' z" Q+ {% `" E1 s" @/ x2 K5 @" e& i" o* s8 a; h
The program will execute 6 different SIce commands located at ds:dx, which, f% x' d; \* u5 f0 _
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
: e$ L" h( m2 U, T. Y* I$ D( R
6 V1 L. j9 V9 z# o3 l' M* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
: T& k& F6 }3 e4 q: N___________________________________________________________________________8 Y5 v% o% o" M: g' l; A
; i* e9 T% ?7 N
7 Q3 S0 |( L7 ^
Method 03
" b7 d) s" B6 v* z9 t0 ~=========9 ]# c6 x0 w2 v- Q) G
/ ^" F7 \# x/ B! jLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ f8 q, d6 G) B0 v
(API Get entry point)1 h+ a' j/ E, k8 x" o% j8 Q5 c8 b
- W4 x3 `. |" q4 [" ?/ K& v* ~6 d5 V/ U
/ F$ t, u8 x k( o( h0 Y" ? xor di,di
7 g K K; d9 j- s% _ mov es,di! J3 N. c( A2 {. }" |# H
mov ax, 1684h
' X% P7 a$ I+ L; v! ~2 m mov bx, 0202h ; VxD ID of winice8 B! s9 S7 u% x# M
int 2Fh
$ P$ H0 B4 E% g6 m4 j mov ax, es ; ES:DI -> VxD API entry point z5 N3 q4 b$ z/ Y7 j
add ax, di
0 W/ k( u7 ?% [) C test ax,ax
- u- }. x1 q- O jnz SoftICE_Detected
- o5 @* _2 R% K: b1 d7 p
& j7 y/ ^+ O/ ?# a___________________________________________________________________________
: B' v: Q) C P" ~/ k1 S2 K( t" n
Method 04) Q( G; P* T/ l$ ?* B6 `
=========
) r2 M3 `; r. d, M. z# D5 E4 U) I
Method identical to the preceding one except that it seeks the ID of SoftICE/ A& H1 a6 k+ B+ w: \. G4 @
GFX VxD.& j n; r# x ]+ `. `) F
6 w* N: `" i( e1 q9 |0 S1 q6 ~! N; e xor di,di
( ~6 h: o5 F4 \9 V+ q: m mov es,di( ~) } f; r" y7 s# l E3 P& R+ P
mov ax, 1684h
5 K+ p/ e" V) } mov bx, 7a5Fh ; VxD ID of SIWVID
& }2 }7 J( r* k0 x2 K( N8 c/ q int 2fh& h7 h1 [* g; e) E, i$ k
mov ax, es ; ES:DI -> VxD API entry point! B0 W0 }; z9 y* b6 K' G1 h
add ax, di
1 ?4 |6 X$ P9 ]7 R& p test ax,ax" j2 y2 _0 ]) M7 g& A
jnz SoftICE_Detected
* ~- v; a5 G4 N( s7 w/ Q: z
& q+ r8 Z @9 l8 U1 C8 q1 s! W__________________________________________________________________________; s3 L# P9 X3 P) O
0 ]2 u# Z4 p$ W& u l. x1 k
3 d7 Y) t0 F6 x% V. W" X$ h6 {# y4 I, E
Method 051 f! T: F& Q% |5 F
=========, Y) Q9 m8 k6 c$ s o' @. }
5 @, k4 _3 a" iMethod seeking the 'magic number' 0F386h returned (in ax) by all system
+ }$ \8 Z, [6 idebugger. It calls the int 41h, function 4Fh.
F) j6 }6 x o! l4 x+ IThere are several alternatives. 7 z- k" h* L8 Z8 E) [' y0 r
3 @3 P- L# c5 |% v/ w* }
The following one is the simplest:, S: o1 N8 r3 C. d& I( k
% k- ?% ?; Z5 G9 n" W) @
mov ax,4fh
: o% X3 v, g2 l int 41h
1 ~0 K" }1 ?; S' _+ @ o cmp ax, 0F386
7 n& `1 y; L$ j: o: { jz SoftICE_detected
; W" Z( M& G, r$ ^' L% Q% }* g
* G3 u9 K* M/ K
8 u9 {, L8 e5 p( y" INext method as well as the following one are 2 examples from Stone's
) G. a/ ~! D! u9 C! W1 f"stn-wid.zip" (www.cracking.net):
0 T: U6 h/ N+ K' J; D1 N; K* l' M' l( J( w( G4 c! ^7 E
mov bx, cs
2 }( Y8 C7 D$ ^5 a lea dx, int41handler2
6 M, a4 e2 \1 T+ ]" e( s- T3 B xchg dx, es:[41h*4]
: \& ], e8 u# U2 M5 f( b$ L! J xchg bx, es:[41h*4+2]
, d k2 y0 o. O, j% p% h: J mov ax,4fh
- C3 N& Z! a7 G6 i! ^ int 41h) r% G @8 x, _. ^" f7 D: a9 M
xchg dx, es:[41h*4]
/ B% N+ D, I: i$ y xchg bx, es:[41h*4+2], ^6 D, I7 A0 u. Q9 k
cmp ax, 0f386h0 U. H" _* r" i; d9 y4 S
jz SoftICE_detected5 z/ y0 p6 n% a( ^0 e
6 r* f+ W- g! E; ?* H
int41handler2 PROC
- ?' G+ H$ e& Z! ` iret( \9 D' [. n/ b$ [( c0 F: S- f
int41handler2 ENDP4 F( V. K# M* V$ y
" } z4 v3 C3 }6 V. J
! {9 k! X! S% A! f4 b. W, S_________________________________________________________________________ }4 v/ I# o6 E# i( U
- T% u- h: o9 k, Y& t) K C. S" @8 e+ j y4 q4 G
Method 06% G0 k- L, ~+ T% n
=========
& j4 {7 ^, o5 t: a/ o0 B) z1 f6 S# D" q( ?# t* `
' M S! I8 x8 B/ a7 @2nd method similar to the preceding one but more difficult to detect:) L. H! Q9 j5 i8 }" ]; n4 I
! l- M1 f+ x; {0 m- r7 o2 ~
$ V/ j9 g7 I( }2 J2 Lint41handler PROC! t1 F. j5 o- n* q% `
mov cl,al+ H1 [3 D9 q+ |2 O/ l) y9 P- H
iret* J+ f \9 U1 K! _
int41handler ENDP5 R( g2 R# @! R7 ?& X, o4 }
; T* h3 L* x- _; X6 ^: b
9 L* c4 p# g2 U: c: n1 }. \0 R. S( f xor ax,ax8 X; q% G- ^0 c+ X
mov es,ax
{/ v+ p9 I5 K' e! w mov bx, cs
0 _$ w+ D3 K+ q' M; c lea dx, int41handler
5 H' P, k3 T0 d6 M9 G; p! X xchg dx, es:[41h*4]! _$ D8 @3 A8 u5 j* d0 ]1 |4 `7 m
xchg bx, es:[41h*4+2]
$ r) K- R1 W" D2 A: [ in al, 40h: _# l" M3 Z/ W; i4 }6 x
xor cx,cx
8 R% E2 v9 k2 z! M' j2 H& J r int 41h
2 P/ r: q& w" ~ } xchg dx, es:[41h*4]8 F' y+ T% K2 V+ O! t1 [- q
xchg bx, es:[41h*4+2]. T c: k; m9 c5 g$ L
cmp cl,al
+ j! U* e5 i# b# N jnz SoftICE_detected
R% z7 d) d( j9 a" [2 b4 F8 ~: Z2 o& T+ _2 p. v0 t
_________________________________________________________________________0 y8 U2 ^4 Y5 ~, @) I& ]
; o. \# C% _1 i4 z H
Method 072 r6 ~6 E3 N/ {4 i
=========
9 \* }) _6 s/ p( \% i5 C1 m
: k/ X8 d( R+ o8 c6 y# z, \8 @, q* yMethod of detection of the WinICE handler in the int68h (V86)
( j3 ^5 |) F- g0 M# ^, o- `! M4 Q' q, a. F
mov ah,43h
' @6 E& R& p# {% ^$ Y; I# a* g int 68h
3 \2 f( E3 B; a9 D; k- |2 X4 a cmp ax,0F386h# Q% A. P' D8 N
jz SoftICE_Detected: z8 N% N% G# K& g" B3 X( f. s
& A! p+ j% D/ `% ~& v
. E' g2 j1 E [( r* S6 q6 x=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
; O' y; X7 f8 r8 W. d5 x app like this:
: m; v6 r" P$ @
0 r# Z* l3 v( Z) c: s( ~. [ BPX exec_int if ax==68+ ~5 I ?$ N E1 o1 |$ J$ _* r0 J e
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 {% J: K8 K4 j9 B! d) \5 m located at [ebp+48h] for 32Bit apps)
& O0 L* P1 n6 s; {__________________________________________________________________________
/ D( [. H* C* X* e# S- S
) Y8 D5 w- a' t* J. d6 E
B2 k, l" _5 C& l" y0 ~2 BMethod 08/ @5 X6 N, j7 N
=========, o' J0 ?) _* @
$ ~' B9 x! N9 h0 s# fIt is not a method of detection of SoftICE but a possibility to crash the
0 {0 L- o5 v4 {& z" j3 s" O: Msystem by intercepting int 01h and int 03h and redirecting them to another) R" W. e5 ]$ f# S" c# ^" Q2 i
routine.6 e+ S) f- r! R x6 `
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
M6 W4 L. L3 w* ito the new routine to execute (hangs computer...); k9 e8 b% ~6 W2 {$ @5 N
9 l* N1 ~7 p) d) q) e
mov ah, 25h. K" j' c% L/ q/ [
mov al, Int_Number (01h or 03h)
( P) U* f( @2 k+ _; Y mov dx, offset New_Int_Routine0 M) s1 c1 G6 I% o7 R5 g
int 21h0 r- }! h* G& B5 ]
5 }4 Z. {/ o/ k$ |. C" o- r/ `) ^+ f__________________________________________________________________________
! ^# Y/ S! ]& M2 i3 B
* c6 `& P7 g9 Q' W W; aMethod 09
& ?0 m/ p3 @7 _1 P=========% P% {1 {: d4 } c7 W
7 w' Y5 X+ T8 q% l! z
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( {! T& T. W1 q* D
performed in ring0 (VxD or a ring3 app using the VxdCall).
! T$ R0 ?( n; l1 e* d" X eThe Get_DDB service is used to determine whether or not a VxD is installed6 k, L- q+ H: t2 H3 v- a
for the specified device and returns a Device Description Block (in ecx) for
4 x5 j% ?$ b; [. Y3 k/ E' s% I) [that device if it is installed.! i* K0 _1 r& v d( t/ b
|7 B3 M0 O# X. [ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID6 o+ k# M" H/ L& W6 V' r2 L/ ?
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 U; `: N6 d' g% b
VMMCall Get_DDB
1 Y, r/ S; l: X V" ? mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
, m4 D! g% ], F* n/ X6 H. k: K: f) c% K& r) J
Note as well that you can easily detect this method with SoftICE:) t3 m: n/ y; T' x3 `/ `7 d
bpx Get_DDB if ax==0202 || ax==7a5fh
3 k5 y s! ]4 g
: y4 {' E9 _. c9 }& P__________________________________________________________________________
; B! I* F2 J( u. I3 @7 r8 j6 j' V* O! ?' [
Method 10
1 r( A% R* U1 O) W; r9 i! A=========
' z# x9 g: h* W( ]1 ]) I) B& m7 n* [, `/ [: h
=>Disable or clear breakpoints before using this feature. DO NOT trace with! e2 H$ @# f8 t O2 n
SoftICE while the option is enable!!
+ _( \7 [/ O) ]/ a9 O4 ^
4 O0 A$ V/ e8 o3 y- aThis trick is very efficient:3 r- N$ M' E, M
by checking the Debug Registers, you can detect if SoftICE is loaded6 W4 B0 [; a' w8 a% k3 A+ {: V- G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 o7 E' s+ e# |3 o6 V3 P: [% j5 d. D8 Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their ^6 y6 c! W" r; {. T8 ~# R f# ?
value (in ring0 only). Values can be manipulated and or changed as well
8 M+ a! X3 J7 q8 `. ?* p(clearing BPMs for instance)
- b/ ^" k! t$ k: N, ]2 c; K6 z6 f8 e& H! r7 x* ~" I
__________________________________________________________________________& d+ ?- @- d% f/ P3 p9 C) T p
5 O2 F, p! i E2 b
Method 11
6 ^% U* I; m! Z& O9 }5 I: D=========1 C( t0 n4 F: `6 q2 t9 o
. h: ^ H+ y2 Z ~0 kThis method is most known as 'MeltICE' because it has been freely distributed
' r% u/ ` A; X5 ?via www.winfiles.com. However it was first used by NuMega people to allow) I' E- ]1 b& Q: t0 y
Symbol Loader to check if SoftICE was active or not (the code is located. I$ p. r1 i& O4 K) V/ _7 `
inside nmtrans.dll). B. r9 _, ?2 { r
' z9 r% ~9 j% {6 h# i: G* qThe way it works is very simple:# x8 K0 j2 W2 q0 t' m& f1 R4 v
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
* ]6 l* Z/ X4 F& a) u) C. W) ZWinNT) with the CreateFileA API./ j2 u. J2 c* { [
7 E4 Z3 L8 a8 ~0 G* I
Here is a sample (checking for 'SICE'):0 I' ?& c0 L1 N% a
* L$ `% U/ `! vBOOL IsSoftIce95Loaded()
* t+ }/ N3 d+ C" ]{
% L4 m# F$ [& c6 y' k$ R- m HANDLE hFile;
+ [; ~8 }7 T% r# R V2 F/ K) ^ hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* I$ p2 ^. K6 o/ W8 V8 { FILE_SHARE_READ | FILE_SHARE_WRITE,$ g4 M# b7 b) \, d
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# g# f) N. K3 W, `: E/ F if( hFile != INVALID_HANDLE_VALUE )
: ]) V2 T9 j3 V' B7 E! Z: { {
. _* P; c( |- p T CloseHandle(hFile);
- v& d& Q3 u) {: P7 y return TRUE;
6 j: V# Q2 u" y' W }" O; M: l3 \: u- @( E$ ^# | k$ x
return FALSE;
) a) l" ^4 w& ^9 U; j}
+ h1 m! x% E/ o1 Z; w8 x/ R! C4 g& U- k& e: _- |8 k
Although this trick calls the CreateFileA function, don't even expect to be
9 S9 a9 V4 r+ }3 ~$ a1 K y" \able to intercept it by installing a IFS hook: it will not work, no way!
- p7 }; i- L) t. K, H* v! sIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
0 W) `4 q( C ?/ H$ B1 ]- E2 rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 c) F3 X5 W! R. l( j; Aand then browse the DDB list until it find the VxD and its DDB_Control_Proc
& k6 K9 |7 {1 t6 ^' ]8 Gfield.- m! _. J9 [" o, Q6 t w5 l0 @
In fact, its purpose is not to load/unload VxDs but only to send a # W" `$ D! }" i+ `
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 [8 a' K) D: ]7 r
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
4 s$ {0 H0 f1 Tto load/unload a non-dynamically loadable driver such as SoftICE ;-)., a$ @- P5 Z( n
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) ?& C! A8 D& e9 A- M3 Qits handle to be opened and then, will be detected.) Q" O) r9 f" V
You can check that simply by hooking Winice.exe control proc entry point
) G( I$ ?; G# r1 D# ~: w4 c& [! Awhile running MeltICE.
9 b' f" H( d2 g5 a, L
`, C, e9 g! I' N1 ?* s/ \1 w9 z- ?
00401067: push 00402025 ; \\.\SICE& T, G# b3 l+ F2 y# ]: c/ C
0040106C: call CreateFileA$ G8 U2 h- \2 w& U5 D0 U! t/ z
00401071: cmp eax,-001
/ k0 S( W( n0 [- N! L 00401074: je 004010911 X# y( x6 S5 Y5 T" u% A
, |! d/ C* O1 x% m, j/ h5 T, y& P- g$ ^
There could be hundreds of BPX you could use to detect this trick.
/ `9 Y) V) h& U: v8 `6 T-The most classical one is:
8 K. w& k0 h6 [/ g& G" h BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, |# x: h: Z$ e) B% H
*(esp->4+4)=='NTIC') B4 j8 X W3 H. v( s5 b u
) p6 R; ~- k( V* S5 Q! d. [
-The most exotic ones (could be very slooooow :-(& P6 ?9 a9 C- M# c# K, B
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
$ |% i! z: v% z( X ;will break 3 times :-(8 E3 Q' Y) }* G
" U M3 y' ~3 Q# T0 l% i, z' @5 o-or (a bit) faster:
+ y0 Y# x9 y# E. S+ j BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
0 \! h1 j6 j T: r: y F# |" L- M+ d2 m8 n
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
% }" F1 M* g& e* g ;will break 3 times :-(
% Y& d. r2 v9 E1 S+ S) m6 `4 I; a
; u9 F" c1 u0 x3 r-Much faster:
* O* ^$ T2 R0 d4 } BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
% K$ {5 u6 Y K$ T4 ^5 `
0 h: \9 c* _5 T) g7 LNote also that some programs (like AZPR3.00) use de old 16-bit _lopen2 P S/ N: |6 `2 o
function to do the same job:
* D' W; O# Z5 ?& u
* E; e1 c& P( d, }, i. Z$ \' u push 00 ; OF_READ
2 G: Z2 E; ?8 F# ^ mov eax,[00656634] ; '\\.\SICE',0
% C/ u! ?/ }& @ push eax- f) T5 j# a- c& b0 V8 e
call KERNEL32!_lopen; `& H9 x0 l: j( S1 w% J, b* c
inc eax$ n" m3 o3 [' l2 m5 I7 x+ D
jnz 00650589 ; detected
, ^' O. @3 j. H/ P push 00 ; OF_READ
4 S! {/ w/ {3 e, B: q mov eax,[00656638] ; '\\.\SICE'
) A6 N& A/ }% ^- B- C5 c push eax
$ Z8 _" C: O' d' N1 C call KERNEL32!_lopen
6 y0 P) P( \7 \7 F+ o* ^/ Z: z inc eax
$ W a/ B5 h# g* w; E' q: F jz 006505ae ; not detected3 r4 k" n. P3 i$ t7 s7 W7 M6 R
( W- j% B, E5 n- |5 R: x% d- u& g0 s6 [' m) q$ J* }
__________________________________________________________________________
: X, w# E) J# P; |5 l5 N
: m2 Y) v" q, i. AMethod 12
- k( ]; P% g1 |% Q: {) i========= J W( h9 m1 d5 C, V: x1 P8 h
+ z& l7 o% W: z `+ j$ @7 v; sThis trick is similar to int41h/4fh Debugger installation check (code 052 D- G; W- [: k7 D9 V) v, K. F
& 06) but very limited because it's only available for Win95/98 (not NT) B9 k1 E/ R) F" }( ^
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: X) t: R N9 [) `" T+ j
, e, ~$ Q% Z: y push 0000004fh ; function 4fh% Q/ U, P) s0 }/ m/ \. _
push 002a002ah ; high word specifies which VxD (VWIN32)
* N! q9 u7 ?, U ; low word specifies which service
! r0 t, o3 f5 j% \ (VWIN32_Int41Dispatch)
; q. g D( E0 U( m0 S call Kernel32!ORD_001 ; VxdCall$ z& |' z9 g( @8 P% w
cmp ax, 0f386h ; magic number returned by system debuggers( l: t. [4 d/ h, ]( d4 t9 s
jz SoftICE_detected
+ b7 p$ `9 x9 z$ V8 P( [3 q& w" G; X( i! V
Here again, several ways to detect it:
8 p! r7 G- Z7 {+ r. ?" ~# S3 t
9 r& |0 o% ?3 ]' t1 O# ~4 Q BPINT 41 if ax==4f: V. e. l. I0 |3 \( k5 s$ e
f. Y0 K- J$ [0 Q2 D+ d% k# _1 y BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one# `7 ~( J* j8 U2 h% Y' a+ A
: [/ m- |0 E- o
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A/ ?9 p! h, z$ y, E
& V* k- P: B7 z- k, o
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
' ]0 U) q, f0 q1 k3 D3 K
0 G/ M: Q8 E% R__________________________________________________________________________' Y' Q2 X9 G/ V! R
5 Q" `* ~1 ^. ~" ]5 l
Method 13
' m! g' L3 y" a* P# T1 @! }2 k2 P( y=========) A F1 v* `1 w) c. x
1 @/ o7 m: F% v% p7 L0 F3 @Not a real method of detection, but a good way to know if SoftICE is( ^3 G8 T% S3 q- i
installed on a computer and to locate its installation directory.1 ^8 L4 H8 k0 _& D
It is used by few softs which access the following registry keys (usually #2) :
" ~& w/ _5 x _
8 M6 V f& I/ D- R. w% R+ W6 d-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 K9 k& O$ b) c( y3 N0 T6 Z\Uninstall\SoftICE5 e: P9 y. E) c W9 `
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) k% o5 ?7 y" o" M
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- Z" m& Y/ Y; M! i# e
\App Paths\Loader32.Exe
' N, j% }6 h7 j$ k# g! Z; A6 [* _% d A) `
. z. {; U9 h7 D0 O- g& O# ~
Note that some nasty apps could then erase all files from SoftICE directory
@% O- Y9 V" n* \(I faced that once :-(" Z5 G: Y/ ?6 f* r" P# ]$ A
- S' B! _3 j: [( M5 wUseful breakpoint to detect it:
. D& Q+ B6 L8 U
) I3 T- C* A u9 _ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE' M$ C( A" ?6 f4 k k; r( Z& T
( t+ S' E+ l9 I__________________________________________________________________________4 O9 a+ X8 v: T
3 d4 t: J5 J6 V7 X, ?: ]" d
0 S5 h4 V$ v' d$ P8 x: r
Method 14
6 I% b, b8 T# c=========
/ c! V3 K! K6 C7 o$ N, [! z
5 e- W% j; u( o) c$ e8 c$ fA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose1 Z( e. o9 V, q) U/ U# g/ s
is to determines whether a debugger is running on your system (ring0 only)., _ s5 \( U9 L- B# F
% W. }, f3 I- l5 J; Y6 `( \
VMMCall Test_Debug_Installed; e Y& e2 G1 X# L) l' e
je not_installed
2 v3 Q8 U+ _7 q7 r
9 O/ Y( s, h7 v% `& q9 z% ^- YThis service just checks a flag.! z/ t9 P' s/ s( a) e
</PRE></TD></TR></TBODY></TABLE> |