<TABLE width=500>
- B! C. k0 H4 ?4 e<TBODY>
2 P4 Y' K; D* `# n% w, Q<TR>
2 T+ t/ W: }* M2 o<TD><PRE>Method 01 " ^/ e# \+ X+ _4 U6 T
=========, G0 C! ~7 L% h" \; M9 J
5 Q1 d& L& U. A/ q( k, {: E5 y) K: sThis method of detection of SoftICE (as well as the following one) is
- F2 U/ P! ^* y1 Vused by the majority of packers/encryptors found on Internet.
0 }# _& v* y( QIt seeks the signature of BoundsChecker in SoftICE! b/ j+ T0 K' R# J* U# N, q
( s2 j; [9 S; U: ~6 W) J
mov ebp, 04243484Bh ; 'BCHK'
, o/ I( s. s3 [& w3 M mov ax, 04h% i- A! B4 W+ \8 B- N& R6 v
int 3
$ q6 A3 z9 k- o4 f cmp al,4. ]9 [6 n+ @8 a. b4 @
jnz SoftICE_Detected5 O9 e: L C* ?
/ ^4 V( Q% X& y4 R' e+ c7 T
___________________________________________________________________________
* C" t( i6 h, U( g5 ]8 R: g6 W
, L. Q) Z( e4 F/ DMethod 02
8 O# }5 s! i/ m0 @4 ?=========
, C3 T' v, }) _5 Q. r# @. a9 ] ~9 ?; @& ^
Still a method very much used (perhaps the most frequent one). It is used
. e7 v5 b: T6 \. Z- i/ q7 \to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ b% V/ y6 ~$ u
or execute SoftICE commands...
' Q1 R9 s* E" k9 n$ n& sIt is also used to crash SoftICE and to force it to execute any commands
& g5 G" G; G5 ?1 H6 |(HBOOT...) :-((
) _ r6 X4 p6 Y2 m$ c7 g
! m$ e) i- k5 ?( U* Q* ]8 @/ fHere is a quick description:
) J: v) O: ^( z, l- E+ g-AX = 0910h (Display string in SIce windows)
# s- O5 Y. M8 P$ J2 ^-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
! J6 [' `& Z1 k0 U1 p9 h-AX = 0912h (Get breakpoint infos)4 g; v1 p0 x+ o, O% ~
-AX = 0913h (Set Sice breakpoints)7 K$ f+ `) ]1 c. Y' F
-AX = 0914h (Remove SIce breakoints)
) _6 }6 b" S# l
" j- ]' x2 o* h1 ] K' VEach time you'll meet this trick, you'll see:
8 \4 @; K# W0 O0 j- F6 \-SI = 4647h
: I8 H2 r# E; j8 I* M-DI = 4A4Dh
/ k% R5 q0 A7 Y8 Z+ PWhich are the 'magic values' used by SoftIce.
8 o6 s6 W2 E4 X. [For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
$ K7 q- Q) ?4 U" b3 S7 N- X. n7 g4 [9 X" c
Here is one example from the file "Haspinst.exe" which is the dongle HASP1 F% ^( l& S2 u; s
Envelope utility use to protect DOS applications:3 s4 l4 H, v e. h! l8 Y0 L' | V
* Y( `" f' L, ]( i0 T7 b
; s; ~/ A+ S6 R/ Y1 G1 S: X4C19:0095 MOV AX,0911 ; execute command.
9 n. z1 q8 d& J& G4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).3 K+ n5 c8 P7 |
4C19:009A MOV SI,4647 ; 1st magic value.' ]# ?+ Y5 `% [9 `3 l* G
4C19:009D MOV DI,4A4D ; 2nd magic value.6 ]) M7 m- O4 d' i' P7 x7 l
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
; c, G) J' c+ d- D4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute+ f+ p& s& z+ a" |1 S
4C19:00A4 INC CX
z3 L2 q6 s7 q1 j A+ [0 p4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ Z( M+ N' [- T; E$ m! J+ U0 ~
4C19:00A8 JB 0095 ; 6 different commands.2 Q4 N# ~9 X. [: _
4C19:00AA JMP 0002 ; Bad_Guy jmp back.$ o& R6 S/ W7 u
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)7 T4 g" r+ C- G3 j
. w& J5 ~5 u: c _8 N& g) H
The program will execute 6 different SIce commands located at ds:dx, which
4 U! T5 x, _# \are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* H W6 V7 c' K3 c+ E7 H, a
7 c" H5 o- B+ P! ?; E' @* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 \( j. P ?/ X% ]___________________________________________________________________________% O1 z; y4 z) t! x
! V% W& j0 u6 L1 t$ O: S7 ]
, p1 N4 u: i; l2 J3 V9 h) j
Method 037 x* d% _6 }7 o$ t, m/ g
=========" ^7 e/ u! {, z7 y1 B0 B* s/ s
7 C0 I/ o( d. \' e+ t
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 J, I( \1 U+ E W! ?(API Get entry point)
0 M2 X4 b% r, B+ F$ x; `$ { I
1 B$ g/ o, u& J, o
$ ] r2 M8 _4 A. T- B, a xor di,di/ h' t v! S; o+ g4 w& k. e
mov es,di
# U2 S. ^: j5 t+ N; O0 h mov ax, 1684h
. `0 i+ m* B1 c, a6 l# f5 S mov bx, 0202h ; VxD ID of winice
! i2 c5 S6 B9 |/ p$ ` int 2Fh
* j1 }% o! Y. y) U% B mov ax, es ; ES:DI -> VxD API entry point
h6 W' Y5 M& d$ D( f) W4 P$ ~ add ax, di
2 N- K1 R3 a! O& r test ax,ax/ y, c$ f$ _: R" @
jnz SoftICE_Detected8 E9 A' a3 f* {8 S" I% l6 O, K( f
) G& b' L+ J6 O! ^! l
___________________________________________________________________________1 M6 t5 G7 B/ E3 ^( w; ]
, z: w9 F; t, z( ~; g C
Method 04
5 r( C9 q! e/ _3 n. ^/ r: y" Z=========
# w; F4 K4 A# Y. G
3 Z6 i7 K6 l9 p) d$ ~3 I. ~( V# i: dMethod identical to the preceding one except that it seeks the ID of SoftICE' J* k" v5 I1 [6 ^0 r! O* Q
GFX VxD.
/ n6 Z1 a1 }# o5 I
6 q7 F" u3 I9 Q+ x xor di,di- ~2 n7 ?" a# s# v
mov es,di2 @* f9 n# c' y5 z0 B
mov ax, 1684h
& Y# ^( C3 q: |6 Y- U mov bx, 7a5Fh ; VxD ID of SIWVID
( ^% t- L4 e; P. Q& w int 2fh3 j3 Q# C% s' i' f) n' p7 x7 ]) S
mov ax, es ; ES:DI -> VxD API entry point
7 s, K, j7 F3 m9 _ add ax, di7 H( q& e* \! X( r' w. A" m
test ax,ax9 M1 _' W: K! \9 T! x' |* e
jnz SoftICE_Detected
( L% Z2 Z& O7 d. l6 {/ L& m
5 ~+ G! h( l2 a! |% o7 a; y3 I$ ~__________________________________________________________________________+ @ O* t) R; z) i! Y1 e
$ J) Y+ H0 t: c! c
; j2 k9 m* Y$ d5 l9 ~Method 05
, D; l9 G" ^# k% t" z) b8 ~=========
/ n+ y m$ }1 Q8 I9 L
7 i) a: ^& n% YMethod seeking the 'magic number' 0F386h returned (in ax) by all system
; g: t' r, F) e6 ydebugger. It calls the int 41h, function 4Fh.# K& V9 \5 A0 p% \ }# b
There are several alternatives. $ B4 I2 ?- P" Q& X9 C6 U" a/ c+ ~
0 b4 |6 M& w }1 z( [The following one is the simplest:
4 h7 _& \5 T; H/ ], d' W* w3 m2 ^" g, U! m2 U6 l/ N
mov ax,4fh
6 |( K3 {% S0 p int 41h
2 Q# k6 [) @) }$ g; X! { cmp ax, 0F386
+ D$ u! |5 U6 x* e; N( d jz SoftICE_detected: I& U& V9 G5 |9 M
$ E: S* {' `: m% P6 f- y
D* J8 N6 D+ `
Next method as well as the following one are 2 examples from Stone's 0 T' U! ~4 G0 i, ]1 W9 Z
"stn-wid.zip" (www.cracking.net):
* G! ^3 {- C4 C0 ]; r, }+ c- }2 d0 V& ~3 E. J" W) b
mov bx, cs* b8 I6 R% L- }' o7 \
lea dx, int41handler22 Z: S! N' N2 U- [! A- L
xchg dx, es:[41h*4]
- z& F) T9 z, C; S4 g1 ~8 k xchg bx, es:[41h*4+2]
7 B/ e4 J$ \2 M: d mov ax,4fh
! S( A- U3 x8 Y4 f9 H int 41h- B5 j$ C8 i) ~1 ~2 G0 h
xchg dx, es:[41h*4]
: G/ A% _$ [. {. j# \# n/ o xchg bx, es:[41h*4+2]
" A( k9 o* }7 K/ v! g9 n cmp ax, 0f386h
. G( ~$ T0 T6 o+ B7 q jz SoftICE_detected
* l+ U0 ~( \7 a) r1 O
) N z. F8 l3 m! J/ A2 _int41handler2 PROC
0 F. G% v1 l6 D: d- s) s iret5 J, M- Y1 `6 V5 C- G! J2 w- j
int41handler2 ENDP) N. h3 z3 e2 [+ e+ I% i
1 X. Z: E: Z4 j/ e! d3 N9 B
; z% B! T, n5 F; F$ M* M+ `_________________________________________________________________________
! ]$ o( E" a" r1 R7 B3 G1 A5 I4 y
6 B. J7 x) Z6 C6 X! {4 D
' |- p' {8 v" ?$ t& ]" dMethod 06
$ T, S" Z/ T1 X# v/ M& ]========= g7 _1 }6 }9 E. b# U: P% m$ I
, @* p: W3 s9 ?( M- a
# H5 m0 @8 A3 o9 u" [2nd method similar to the preceding one but more difficult to detect:
0 v. Z2 p* T; C: j& k) r9 k0 ?) t, f5 R/ u$ o! M, P
/ r* G+ Y! `- v* P* aint41handler PROC
# V, M% G* v# F8 V! u% ] mov cl,al
3 z& P/ q: `3 i0 _9 k; ?. \6 p/ _ iret
- w7 x! f9 C' g& r j* Dint41handler ENDP0 V7 f, O' ]+ S; f4 J
" }) b9 L3 r. t# Q
# R, _8 i6 T8 a/ A) ?3 N' i# t& r6 L xor ax,ax
& q5 V6 m+ m4 b+ G; K$ V2 ^ mov es,ax2 t1 w% l! \; n. D0 p1 K
mov bx, cs
/ p( F+ Y" O. q) e! C; E! p8 n lea dx, int41handler! z( X# J" ?# J: ~# b& T1 L
xchg dx, es:[41h*4]
9 a/ S- V m. i) z6 ^ xchg bx, es:[41h*4+2]- |( G" _3 \3 q3 G/ {$ f
in al, 40h0 }1 T- P" m( F& ^' p7 T
xor cx,cx
) }6 Z& D% Q* [$ V8 q- {5 y/ v- _ int 41h# x$ o7 x, a& e5 F) i
xchg dx, es:[41h*4]3 W8 s8 e6 m' K8 q$ [/ [! t
xchg bx, es:[41h*4+2]% ?! |. D: q* b0 A3 k2 I
cmp cl,al* i1 o& o- W! p7 K
jnz SoftICE_detected
8 I$ N$ q# c. c: l* |& e7 s: h; c$ Y. a" `
_________________________________________________________________________
; _# F/ G( U6 |, H. @, w- P
% q* { g w3 O6 OMethod 07/ d. f3 F" m% L# i
=========
' n. @& a4 g; |* H+ Y2 Q; b$ i: t' S# f( ~0 Y
Method of detection of the WinICE handler in the int68h (V86)
( ]; ?! R5 s+ s3 |$ S5 \, X% \4 N+ H6 ?$ I0 ~
mov ah,43h. Z; S& M( d- Y0 \/ E: G
int 68h6 ?& ?6 E) w% ~) f
cmp ax,0F386h: q6 {2 r9 {9 _$ a0 G
jz SoftICE_Detected$ A( r! x& p$ h/ _
. ^" |% X+ t3 [& y. X1 O: u
$ E% c" A) O/ y( y7 b+ \2 ~ S7 v=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& C* f" t/ V' n7 K: q app like this:- I. ~: V; t9 [- Z0 v v, f
! Q2 |" o' c% @% z: V: Z1 n
BPX exec_int if ax==68
# E8 i" e( t' c3 i (function called is located at byte ptr [ebp+1Dh] and client eip is% @2 [6 ~) r4 h6 Y3 X: @
located at [ebp+48h] for 32Bit apps)8 |# c0 }' u: B" ~' ]
__________________________________________________________________________9 D* J8 N( M6 A' [1 R0 w9 O
" W' n4 z" l2 g5 L9 ~2 n
9 Z" P8 V0 ~* s9 T+ R
Method 08# d1 H9 {) u G, L8 r" k
=========: C, F$ b/ J- F" X C8 d* a
& {* Z4 w, F4 }- AIt is not a method of detection of SoftICE but a possibility to crash the
( c" A& l& d8 s- s( P& v1 ~3 T/ }system by intercepting int 01h and int 03h and redirecting them to another) A% {/ |% O* z( N* t# s, C) O
routine., W# l9 t! n5 b+ V: F, H& ^- L& c
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ p' R& R/ _$ g9 T
to the new routine to execute (hangs computer...)
$ U- |; e9 g9 i* x/ K' E3 y* _
8 K0 a$ w9 [* A mov ah, 25h
6 Q9 F, B; q$ X: z H8 z mov al, Int_Number (01h or 03h)
& l6 E; |* g; k, g, C: @ mov dx, offset New_Int_Routine
# P; P# @! f* Y6 B( z( o9 J5 t3 H int 21h, P7 _5 N* ?. J6 C/ j/ N- K H. F
6 F9 L! ^$ ^- l4 B* N" b: z
__________________________________________________________________________
' }5 Y& Z. b& k
. J& p- z9 I, O. ~% m6 _( I- e. ?3 BMethod 09
: F3 J8 I8 c% g u6 ]) U/ E=========6 @# E. H% P: ^% @/ W
, e' L8 i6 v6 A# D# Q, k" l' j
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, o- `9 @7 d H! x
performed in ring0 (VxD or a ring3 app using the VxdCall).1 s7 p3 k! @1 t
The Get_DDB service is used to determine whether or not a VxD is installed
4 T7 e! A& h- V, H7 C- Y& U. K9 sfor the specified device and returns a Device Description Block (in ecx) for
( K4 n; G3 ~8 h0 ?) D8 Ithat device if it is installed.
/ `/ b6 n# I+ d, R
: U g: F' y2 V' b mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. y. Y# J' ?' b1 j/ s1 ?/ P1 o$ }
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& b/ E7 h( @$ [/ V& d# P! z VMMCall Get_DDB: a( D: l. s% A/ l" {$ w9 x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
: ]) T/ p9 `0 ~; x8 `: a; w. y3 [# ?4 Y
Note as well that you can easily detect this method with SoftICE: z& ?# k1 |3 b3 g9 q$ Z
bpx Get_DDB if ax==0202 || ax==7a5fh
! x3 W( p" k3 W
5 m* C1 y( m& m1 M6 ?4 h# K4 U; p__________________________________________________________________________3 E2 \5 \7 ]# A' _( h6 f% z8 e
9 J- d# K7 K4 h5 fMethod 10, C' w8 P( S4 I# [7 `* M8 v6 s
=========* G4 i: g+ @$ y
9 {* Q3 Q+ H7 r9 `/ r: w
=>Disable or clear breakpoints before using this feature. DO NOT trace with
& H4 v# J% T( D( V0 M$ Y, g/ T SoftICE while the option is enable!!
7 P" b0 x6 q" t, @: p
# M# N, V! B: BThis trick is very efficient:
* y, e' |( a1 u: N6 r6 J a0 mby checking the Debug Registers, you can detect if SoftICE is loaded
& [7 |0 z. b; D* v5 L. ~(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
3 X. v0 K0 G; H3 O8 _& qthere are some memory breakpoints set (dr0 to dr3) simply by reading their6 }& B% _7 k/ j3 H# ^' o& [
value (in ring0 only). Values can be manipulated and or changed as well* @+ z; X& [ J
(clearing BPMs for instance)' V/ W# i0 }* d' B; Z
" ^4 Y) _! i: L y" U
__________________________________________________________________________
m' {- k6 }+ J! t* j
. O% I5 v% b7 x1 p3 _Method 11) R! i/ ?+ {( Q% ^
=========
* y# L5 r% i( S1 L9 a j7 g: D( p4 ^, Q' {% s( e
This method is most known as 'MeltICE' because it has been freely distributed
5 E: t! o9 V/ @" a0 `2 H* h: L4 gvia www.winfiles.com. However it was first used by NuMega people to allow
; y2 F* u+ u; j2 t4 |Symbol Loader to check if SoftICE was active or not (the code is located
; K _1 R; C% V5 J. G) k& M* Winside nmtrans.dll)./ @$ k5 U& P3 @5 y
( ]! a! L$ h. c$ h/ \The way it works is very simple:
! C }* S" Q0 `8 [8 Y: zIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for r9 l& U0 u, K& c
WinNT) with the CreateFileA API.: k, l1 I ~ h. w1 h8 c7 H
% i9 r& } M9 R; U/ V
Here is a sample (checking for 'SICE'):
% M# V" I+ K: Y C) U
9 h4 d2 q/ m! b4 L; _BOOL IsSoftIce95Loaded(), [8 Y+ o/ B6 b; e
{
5 J5 [+ P$ W) M' v6 U HANDLE hFile;
7 @; v9 }% E8 ]) H0 z. f( |6 x6 m hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 ]! }& f6 N9 c2 H Z" H7 K* g FILE_SHARE_READ | FILE_SHARE_WRITE,) C2 z8 S0 q% y% ^% k
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! o# H' M4 g" l0 {. v
if( hFile != INVALID_HANDLE_VALUE )6 i8 M9 d5 z E% J0 Z- t; ~( x4 b" ?( {
{0 j3 D4 y/ G( }1 s! s _/ Y' _
CloseHandle(hFile);
& Q; d' }" n4 W* ]- [ return TRUE;% O5 p( l; A# `1 W) i
}
2 K' F/ _6 e8 a/ l1 o7 m return FALSE;, F7 Q8 Q: Y5 @
}
$ r/ w y& }% n% C- G: u k& \4 ?
Although this trick calls the CreateFileA function, don't even expect to be
- l! A7 @; j5 K% ?7 Sable to intercept it by installing a IFS hook: it will not work, no way!
; l( y& q2 d4 eIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) ^1 \8 D4 | x& D( ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 G: o _* K7 P" h1 Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc
+ i2 w6 I* `% ^9 }2 u/ T* hfield.
& p/ f' w q9 }+ j: L" F9 iIn fact, its purpose is not to load/unload VxDs but only to send a / f9 K$ E- r8 F7 t8 P
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)8 f6 b* U$ X- k. m6 N$ n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 S% f) P% U: m/ R! [6 Y. `& Ato load/unload a non-dynamically loadable driver such as SoftICE ;-).
5 w& M4 A! s% H, T# \/ hIf the VxD is loaded, it will always clear eax and the Carry flag to allow
8 ^4 i, h+ g4 R2 J/ cits handle to be opened and then, will be detected.; w: G z; g2 G7 W+ V# V+ D
You can check that simply by hooking Winice.exe control proc entry point1 J# I! A) j8 i
while running MeltICE.0 f5 @7 i* b$ [6 v4 Q: J& {" A* N% m
; E5 ^; f4 ]/ _
* A3 Y) y7 P8 E% ?2 [
00401067: push 00402025 ; \\.\SICE0 r! T5 c/ h5 L! z) Y3 a9 _
0040106C: call CreateFileA! `5 t- T5 P d+ [: d6 o
00401071: cmp eax,-001
/ o. b0 ?) O' S1 i- } 00401074: je 004010912 v9 R, K+ q1 P& W8 o c% V
) C) Q3 U# h$ M! y* P; w- c# ^, ~
There could be hundreds of BPX you could use to detect this trick.
9 U8 n% F4 a+ }" R: N# a-The most classical one is:
! `+ a$ x- M. w* ?" d BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||: x8 R |& H0 ?
*(esp->4+4)=='NTIC'
. |/ ^3 T+ ~% F3 E9 _
# M3 q' w1 i# }3 ?! o# P-The most exotic ones (could be very slooooow :-(2 w/ `, r' b9 J, I: I7 z5 ?; G! t
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') & K; ^: {9 D i: A( W
;will break 3 times :-(
1 ^+ {. M V- C6 l$ G9 |* T* L3 o; e
9 @% a: N1 B2 x$ T8 R-or (a bit) faster: C" ^, E8 K. n0 t$ x
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( @, T" X+ |2 r+ u* h" j
, i* _+ o( c- q. l BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & p3 u2 k! L# Y& [% Z' Z% g; S1 ]
;will break 3 times :-(
' O+ [$ Z) H7 U: ~; N, d
2 k Z" W$ R4 O, l$ k-Much faster:
3 M: b8 H+ g) D3 n9 Q. b: ` BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
5 B* d- a+ a0 v, K1 \- D9 [4 o7 H0 G4 I
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 ^5 R& l/ g o5 ]) s8 p3 zfunction to do the same job:. ~# S5 o1 I) N. v, G7 J& G
$ e @1 @$ Q4 l/ f# V push 00 ; OF_READ: p/ W, x8 C; ]$ c! i0 P' A4 b
mov eax,[00656634] ; '\\.\SICE',0! @1 K% T0 W1 O. r+ W
push eax8 L& M* _$ {! I- h9 W- A
call KERNEL32!_lopen
9 a4 N9 [8 `& R$ ~7 A. M inc eax* P& ^1 t6 W9 j2 E. `, l
jnz 00650589 ; detected* b$ Y8 D% n, Z: S9 Q0 X
push 00 ; OF_READ& g& \9 r+ N' @
mov eax,[00656638] ; '\\.\SICE'4 X; C$ c" P* `' _& l
push eax" ~$ O, k& D4 u3 `# I
call KERNEL32!_lopen
/ Z) X, a) Q! S7 t) Q inc eax, r3 J3 }, S/ Q: C3 U+ c, Y( d
jz 006505ae ; not detected
( q! u. f2 s6 h) P* b
6 o5 d$ d+ \ i" a( D' r9 o5 h
5 k4 R. w& Z4 j3 r, f/ e- V9 q__________________________________________________________________________8 A" Y# J& P3 A1 K R# ` Z
) B$ U5 J2 q+ n9 e0 I, J4 |
Method 121 o3 Q& F& _, `0 h) ?* K2 B
=========
8 M) ?& d6 U7 O1 \+ i3 f: M2 |* c
7 n2 R9 J! N! q4 D: l1 \' t2 ^- BThis trick is similar to int41h/4fh Debugger installation check (code 05. C/ i5 \0 k" l% |& d
& 06) but very limited because it's only available for Win95/98 (not NT) I% @( j' m) o0 l5 X9 W
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." a7 s1 W7 ~, w5 P( u
1 d z) I7 }1 V' U' L) l push 0000004fh ; function 4fh* B; }& N" E( B3 w/ p4 C# Q
push 002a002ah ; high word specifies which VxD (VWIN32). D9 [ E' n( x2 R& F
; low word specifies which service! S8 x% P, U+ I; s0 i
(VWIN32_Int41Dispatch)' G$ S: F8 R% J |- U0 ~
call Kernel32!ORD_001 ; VxdCall2 W' k$ _( d; e2 M
cmp ax, 0f386h ; magic number returned by system debuggers$ {; e$ G* w% O
jz SoftICE_detected
# y4 h1 _/ b! s5 l: I7 N% E
! E0 g T, f2 Y! A) ^# \Here again, several ways to detect it:
" U. q- x+ r8 e, G0 E0 o! N; r8 \& ^9 ^/ ~
BPINT 41 if ax==4f+ y- Z9 v, w$ M$ ]/ Y
# p, p1 ]: F$ _" j% @ l: Z BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 z+ W! m$ b, ^3 y2 ~, g% g0 E8 {0 }3 D* Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
6 T: L0 F i- ~3 A: k* n# u" @+ q2 o
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 y3 l1 Z6 z w! w. X
0 w: A: s9 e0 j8 E/ M9 U% }
__________________________________________________________________________: @" T) ^& I6 }8 K
1 p h& s) [9 s1 w( b
Method 13
6 {2 B. U7 q- K9 Z5 o/ J=========) a1 _0 z6 h: Y! c% P4 L
4 S% N: a, T" f/ R# Z
Not a real method of detection, but a good way to know if SoftICE is2 g# G, w0 b) b, f+ p
installed on a computer and to locate its installation directory.
+ Z" y! d& {* X/ g6 GIt is used by few softs which access the following registry keys (usually #2) :
& |1 k+ L" m& W% L! H O
" e' y* F/ I* [) [. S6 X9 Q-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
6 }" g* N% [/ l1 S9 A( x( r\Uninstall\SoftICE
. u! ?( }, C3 s8 w, S1 F" `3 [-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 o0 P0 J$ a/ [; B6 q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion6 O+ u( t5 Q& P* q' o B/ @
\App Paths\Loader32.Exe) @& R5 n& B3 Q: k9 y$ U N
9 {: H& p J! f/ i/ U
9 k; c4 U/ h/ U. Q' U9 `
Note that some nasty apps could then erase all files from SoftICE directory& C* a% a7 n) k9 |( f2 J! o- b. X
(I faced that once :-(
1 ^ x% ^+ j* G# c! f
2 K6 s! c& C& t& e; W% M0 u2 |9 BUseful breakpoint to detect it:* x1 i/ [% z+ r$ C5 O5 k- C3 U
) X# l" g' H @- _7 R" M
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
! I! x: f9 i6 g$ ]% K* ?- b! c7 ^+ b$ W* w3 x2 ~. f3 u3 m7 m
__________________________________________________________________________1 s/ ]/ I U4 l, u# L
( U3 f" o9 i }. d1 Q. m1 x+ y3 v
Method 14
# T! N+ R) j% f2 j* V0 J4 G% c=========' P9 o4 U* b6 q C
" F! C- h9 J2 \& [) H
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
# ^ i _4 c, a, ?4 x( Lis to determines whether a debugger is running on your system (ring0 only).
7 b3 |" o1 w) U/ X4 L& j' J: L- y7 I
VMMCall Test_Debug_Installed( j& g% z9 P' z0 H" a; c2 z( @# w
je not_installed
) ]/ l6 X9 n2 ?! Z' B! U8 j
" o4 b% |# R) ~ t6 TThis service just checks a flag.! C2 i: m5 L! @9 w* q$ I
</PRE></TD></TR></TBODY></TABLE> |