<TABLE width=500>' v0 Y4 }. b9 R0 `0 [. M
<TBODY>
- y, H. S* P q! G2 W7 a4 h<TR># Q! F! @+ Z- X( ^- ~8 @9 }
<TD><PRE>Method 01 5 ^2 n5 v5 @; I+ m
=========
; S$ e3 |3 c- ~: F/ r
+ ^$ e" y% z2 nThis method of detection of SoftICE (as well as the following one) is, a* S/ u' x4 X/ h& C. n3 e
used by the majority of packers/encryptors found on Internet.
- v9 |4 J! v" W2 RIt seeks the signature of BoundsChecker in SoftICE
+ J' t* m3 Q0 H: C+ r, V
3 B l0 E8 C$ C: ~; j, m' u( M mov ebp, 04243484Bh ; 'BCHK'
0 m9 K1 H9 v/ ^7 X mov ax, 04h
0 T! k( w8 R5 i8 {; I. r4 v$ A) ]! ~5 L int 3 3 H5 `$ W, @5 P2 g2 o/ ?& _* U O
cmp al,4
0 t/ S9 }2 `" i: n$ Q1 W, B+ b: R. p1 s jnz SoftICE_Detected: V7 E- s+ y7 H; R- ]
8 A* L6 X1 E/ l8 ]4 L5 V! y+ H1 e# W
___________________________________________________________________________- r) Y' b! D3 i0 N# g/ U
, ]; x) H: u9 X$ c, G
Method 02. X+ t" T1 t3 K& a1 u1 q- g
=========
) R& q% I1 E/ f3 X& s- Z* M
6 ]* G2 P6 Q, Q. D8 ^* uStill a method very much used (perhaps the most frequent one). It is used0 K3 \& R; g; O1 }' z; _
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
. B: z, i8 |0 Z) c* Hor execute SoftICE commands...
, H: k# {( A( |# }7 c! ?+ U" i. M: tIt is also used to crash SoftICE and to force it to execute any commands0 D. j6 q& w" t- h
(HBOOT...) :-(( 6 d! n! j& d% A: D0 I! k2 b
( j6 |: o# [( {) `! b5 WHere is a quick description:+ s/ h' _7 I- [, i, B
-AX = 0910h (Display string in SIce windows)* k2 e/ x6 \; C) K
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
/ D0 L- U2 O( G- [5 m' d: b-AX = 0912h (Get breakpoint infos)0 F4 j" W6 R: t6 c: C+ r
-AX = 0913h (Set Sice breakpoints), _/ Q$ a v6 ]" N; u
-AX = 0914h (Remove SIce breakoints)1 e0 A" C8 x' \& b7 H; p; x
1 A0 l8 E& W& N: l0 ?- M q5 [% z7 ?Each time you'll meet this trick, you'll see:2 g8 Z% s* Q& I" W! o. b- d9 J
-SI = 4647h' S7 |2 M( j3 H6 K) E2 ~/ ]; }6 R
-DI = 4A4Dh
3 c* |+ B# }8 I/ l7 HWhich are the 'magic values' used by SoftIce.) i7 @+ U" I7 c z$ T' {+ Q$ b! ^' D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.- z. e9 t& n% ?3 U4 p
* O- T- g( o9 I8 p) Y/ v ]8 G2 AHere is one example from the file "Haspinst.exe" which is the dongle HASP( W5 U! N% m1 B" Y: O1 w5 s
Envelope utility use to protect DOS applications:
3 x$ |' v& X" D/ u) v) `
( x) \% }+ p* j1 z; w+ A& `: f! p0 y7 u
4C19:0095 MOV AX,0911 ; execute command./ e1 Q! }' t/ v: ^
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 K' ^* [% C9 K( ~' ~
4C19:009A MOV SI,4647 ; 1st magic value.7 C+ v0 x- J6 Y, Q( c6 n# M
4C19:009D MOV DI,4A4D ; 2nd magic value.
; m7 [" N! d" S9 Z: X7 k9 c& o# m8 l4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 H/ ]8 _' J' y! A2 Q# @" u' f' n* ^
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
8 B( ~% J4 ~/ T$ X4C19:00A4 INC CX( M: w7 d: ^5 K: {) a
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute {5 W4 D3 q) ?) [
4C19:00A8 JB 0095 ; 6 different commands.
1 p* D5 g4 k+ d- a4C19:00AA JMP 0002 ; Bad_Guy jmp back.
+ w5 O, `) G. A& g4C19:00AD MOV BX,SP ; Good_Guy go ahead :)& M& _9 @+ T+ z7 N2 ^
* |, L5 v! C3 n+ Z8 P8 u3 i! h; x; E
The program will execute 6 different SIce commands located at ds:dx, which7 ^% w, l: M: v: w# Z- o/ G( o O
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) j, [2 x$ Z; D1 @4 P1 s% ^
& M3 I1 i d+ ]! u" D9 c5 ]* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded. p5 @- ]! M4 R9 z, j0 U" ]; _
___________________________________________________________________________9 N$ w! M, P6 k8 A% \2 i
) s+ t* }- E- S
6 @# t b* s- t+ @4 f' T& h# vMethod 03
* k J! V% X2 I8 H, m' E. i=========6 k& U" I$ C: B* R1 O; n1 v
; J X8 z" o/ f8 E/ x$ I% oLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 n& g' }, U) t. C% Z(API Get entry point)- [$ \3 [- V. M- g
2 I& H7 h& a$ ^( E: k
2 Y5 H* V( }) f q2 @ xor di,di
1 F7 O$ c8 [# j! S7 g mov es,di
" E6 e/ |- o5 k- ^4 H& G% B2 {; X( w mov ax, 1684h 6 Q4 B6 j& s9 Z; U L. s
mov bx, 0202h ; VxD ID of winice
1 y' N% T4 }& F3 R y; {% q# J& M int 2Fh$ K% U! {0 D' k8 Q
mov ax, es ; ES:DI -> VxD API entry point
2 h+ @! p' j) U7 m9 Q! g add ax, di
- l9 P3 O8 N" K) a$ H4 |. R test ax,ax' {% m S# i; {0 _; }6 s
jnz SoftICE_Detected- ?5 h9 ^, ]3 l
. [) D o. |* ~* f7 `+ k___________________________________________________________________________
/ |: V: P% _9 Z8 ~* o& X* z
* H5 `* b S$ B+ d7 k/ NMethod 04
( ~# q# |4 j: T4 i=========6 z7 J3 t( k; `/ {. @5 q; ~
- j, r- F; \, H
Method identical to the preceding one except that it seeks the ID of SoftICE* \2 e5 [; I8 t1 f1 V9 Z
GFX VxD.
" m m* A8 {. F2 ?$ d* W* d) J6 _( P( R4 f: v- t3 K
xor di,di# g7 ^' ~- G" M# ~; M
mov es,di% L) f8 D) f! b2 i
mov ax, 1684h ^+ J2 m- |( M3 [2 R
mov bx, 7a5Fh ; VxD ID of SIWVID
0 l, ~% {' n, Y+ t- S int 2fh5 f5 q7 |/ }1 E/ k7 |
mov ax, es ; ES:DI -> VxD API entry point' a1 Q/ z. n) w# N) f0 ]7 W
add ax, di& g9 B3 S1 s0 u8 [! ]
test ax,ax+ a# M' @2 `6 u/ l( B
jnz SoftICE_Detected% y0 l5 p4 y Q2 g3 d. u( t8 M
5 R- X2 r8 _' ~$ I& i# h4 }3 n7 V__________________________________________________________________________
# \ I" J7 c/ }8 |) Q" `3 w( C
! _' W' _- \- M% ]
Method 05
- i& L; x! W4 n! y=========
9 x+ u) A q4 a, \/ M4 |" {
/ h B4 Z( R5 x4 Y2 ^2 aMethod seeking the 'magic number' 0F386h returned (in ax) by all system6 u/ \( Z% k7 E
debugger. It calls the int 41h, function 4Fh.! m: W. ~6 O' e5 D
There are several alternatives.
4 D' ]/ o9 f' \# t1 ?5 U2 C0 U$ w& }
The following one is the simplest:: B, ~: a' U$ K( h4 I! M7 |
9 e5 v& \0 D5 n1 S( Z mov ax,4fh" K/ v5 _+ h$ V
int 41h( M! \0 V3 J- n- b9 w3 E; A
cmp ax, 0F386) _9 [8 j8 [# ^. Z
jz SoftICE_detected
3 m+ `) _& {! ?9 `' O% j9 s+ _, \& {5 M
4 o( ^: ^: V# u. F; G% p, |# |" kNext method as well as the following one are 2 examples from Stone's % s4 ^/ i8 {4 _
"stn-wid.zip" (www.cracking.net):
! i! Q7 \, z5 E$ H) `& k8 h
& `/ K* r- H0 p' c+ O5 x$ `; C mov bx, cs* f7 n1 U% s4 M2 J- W& ], v$ W
lea dx, int41handler2$ _6 W( \# l! A' C) J+ h
xchg dx, es:[41h*4]
7 J6 x' h/ w5 q8 t' X3 M xchg bx, es:[41h*4+2], _$ g. \ ~: H2 C
mov ax,4fh
+ W' \: [: j: k+ ` int 41h
& i- I0 o6 g* M$ P0 [ xchg dx, es:[41h*4]8 U: m: N d; r( G$ V, ^
xchg bx, es:[41h*4+2]5 O; H2 t# b0 t' E, v/ X
cmp ax, 0f386h5 x" Z9 t& N% S+ |$ S
jz SoftICE_detected! |$ r! }7 F+ r+ G* ^" j
5 x9 v% W, u8 n# v' d( v! a% a7 z& iint41handler2 PROC
# j$ A# w T5 Z# l, `# z: X2 N iret4 L! z$ _1 K8 u) F, @0 P5 V6 L: V
int41handler2 ENDP
! j0 S9 r/ c9 Y$ Q6 [( D
6 j4 F5 _0 S. E& E N2 u1 |' Y/ t2 @( I# o$ u, [9 U- u9 g
_________________________________________________________________________0 G8 n6 g( P$ V( A) E% O
" c1 Z9 F! E# ^8 @& @) m
) C" v- V' m9 g! ?Method 06
3 b: n* P" ~4 h# r=========
. u3 O( [$ v4 w1 ~$ c! {
6 {7 f. ?; s( e$ [: |5 v7 ]- W/ r9 V* p5 F
2nd method similar to the preceding one but more difficult to detect:
$ u4 ?0 t7 g6 a/ J- o; d+ |& s
9 W/ i3 y) g8 I* }. H0 G
) [/ p4 p- r$ B3 V4 zint41handler PROC9 |) K( B4 d% R2 A+ l/ S7 K/ P* C
mov cl,al
4 v4 U7 R" ~3 f7 {: r0 {( _5 w iret
& A" p1 N5 I- cint41handler ENDP
. [- \( v: a( j' ^% p* F/ K2 w$ K! _3 a- w& O
9 b t+ C( B# H# W$ o) e xor ax,ax
7 M$ L* p+ n6 r& W' g' ]- ^ mov es,ax
+ B$ b( P8 G5 X mov bx, cs
$ c; p. Z/ P1 V3 f* P+ i lea dx, int41handler
, M/ c) L1 `' D) [ xchg dx, es:[41h*4]8 r3 K* a( R+ [3 x2 V
xchg bx, es:[41h*4+2]* k) M1 F2 f- k2 U9 @7 S
in al, 40h% X9 w3 S) r% I& F: f7 z
xor cx,cx
) g& i) C: j& j6 }" I int 41h
% U3 @2 [: O0 b' \9 a0 Y: B xchg dx, es:[41h*4]. n3 d2 U# Q6 m' [3 K# O' s4 G; P5 r
xchg bx, es:[41h*4+2]
# C! j. }$ J1 V6 c3 l- }/ ` cmp cl,al6 L+ k) v. T# s- Y4 l
jnz SoftICE_detected
- e% m% j* f) V- C0 y9 q: n' k- e& b0 Q. `& q6 q$ \6 J
_________________________________________________________________________
0 y7 J# S/ ]# V2 T# g; F! T0 w6 S2 s
Method 07+ ?5 K5 e, c1 T4 L' f
=========
( G8 g2 m+ ?: {2 t6 `; o2 D
2 h# n; W, e. \4 P% O* ]4 RMethod of detection of the WinICE handler in the int68h (V86)
6 [- ~4 u) Y; u% P
7 D) h+ F8 w2 Q: {4 C mov ah,43h2 E/ L* n1 |3 \! ~$ [% `( N8 b9 J2 I" [
int 68h
6 v' N8 K' i7 A% b1 t cmp ax,0F386h
) R7 x! t$ B% x5 S( {9 P jz SoftICE_Detected; x1 P% Y0 k0 ~ k
* k7 x& j& _9 \" H7 `6 C
9 D8 A2 L) v( {; w, c# A- s
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
9 l) l* c" }) _, p/ { app like this:/ Z" f& ?/ L5 U5 x; I$ q
4 C$ B# F; c7 l) H
BPX exec_int if ax==68
( H0 u) s! A! o' {6 ? ~$ W (function called is located at byte ptr [ebp+1Dh] and client eip is* S3 i( p8 p. I, c! y: R
located at [ebp+48h] for 32Bit apps)
' |; Z8 ?$ \. B# D, |* s__________________________________________________________________________# T( a6 c: f$ O$ b
1 N9 C# [9 H" Z( w: _3 Y, E. b0 e+ H" H$ Y+ \2 t' a
Method 08& E% h, ~& D9 ^% ]0 D5 `# t: h& a
=========
. q: A" B* k2 W: J0 u9 b4 V6 W+ y! |' e( m& M/ P' p( k
It is not a method of detection of SoftICE but a possibility to crash the
! O0 Y. ^) ?6 Z/ Wsystem by intercepting int 01h and int 03h and redirecting them to another
( K1 b3 A* I6 y/ B! k6 }routine.1 t0 [* p& ~ J5 t$ i2 q8 L
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points2 f1 f7 ?% A1 z! o- |5 T8 z# \
to the new routine to execute (hangs computer...)
( u2 T' {) @* c5 z$ n
7 F* A& E+ \1 X, K5 j mov ah, 25h
1 ~ V* `, U- s8 M C mov al, Int_Number (01h or 03h)
$ G' T& g, Y0 n9 E. ~ mov dx, offset New_Int_Routine+ h1 A& M. F, M+ }9 s) k! u! ]
int 21h: x6 L3 t& B$ ^, u& p
7 d( b3 f: |% U( U# R, o7 [__________________________________________________________________________
1 |8 K8 K/ K& J) o4 n5 q# ^' n- F9 u: T# X0 M$ ^ e
Method 09* Z& i* ]" v0 E
=========
+ Q$ C2 b& d O Q% V, {9 O0 Y% J# e
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, p4 M) s t( e) U) ^$ b
performed in ring0 (VxD or a ring3 app using the VxdCall).; g: s0 C. e# H9 g' N
The Get_DDB service is used to determine whether or not a VxD is installed4 C. W. s/ o) `! i
for the specified device and returns a Device Description Block (in ecx) for
5 X; x/ p/ A& E/ m" D( f: E0 |* mthat device if it is installed.
# w% [$ v2 G l6 B; N- p/ V) [* K7 W6 i2 y
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID, A2 q; X1 l# ~# a$ f- m" h
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! k- U4 y! i. i& h/ [
VMMCall Get_DDB
) j& [$ Z% h5 L mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
7 Q+ q: R6 @9 z7 Q3 J* T' b F0 t! R1 ~
Note as well that you can easily detect this method with SoftICE:* u6 V+ [7 |4 b) j: Z
bpx Get_DDB if ax==0202 || ax==7a5fh- w0 @7 H+ m) E0 V6 C
7 k/ a7 I' k1 g( ~__________________________________________________________________________
) [* M ^$ F2 O/ U6 V* e* Q8 ^' A2 ?0 u1 s, T* n
Method 10
3 t! ]6 X$ j! k' V=========7 \2 Q! N' q, V( {: U
! t5 j D% G q
=>Disable or clear breakpoints before using this feature. DO NOT trace with
6 \" R e! I. s% A1 _ SoftICE while the option is enable!!7 i) ?4 U, X) X, j1 h
]0 @ @) F9 Y+ r8 A F8 x4 D |
This trick is very efficient:2 H; T ^$ {( s B2 b9 i
by checking the Debug Registers, you can detect if SoftICE is loaded- S8 r3 }- s/ j$ L9 ~
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
C: p! N& t2 K5 Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their
+ _+ o1 U* q' b9 R6 k2 Mvalue (in ring0 only). Values can be manipulated and or changed as well
0 Q* W1 h9 O5 A, @9 k3 G: A(clearing BPMs for instance); T% T! F0 b5 V! R8 p$ B( I a- ^
- F+ r+ p6 P; f1 }$ v__________________________________________________________________________
! t/ f: Z) [: q" k' o" E$ h; h5 g7 R2 V
Method 11
3 h; [# m1 a# i5 O# r+ X7 ?=========
5 `" {& v- {$ s2 o
6 Q7 ~7 o7 m8 D" a' B' G: lThis method is most known as 'MeltICE' because it has been freely distributed
1 i m1 ?3 z0 e9 k$ Tvia www.winfiles.com. However it was first used by NuMega people to allow# V# _0 n* {" W4 u) W
Symbol Loader to check if SoftICE was active or not (the code is located
. Y8 ?* B2 j. Z# Z* T4 r9 Einside nmtrans.dll).
5 {/ }1 H2 _9 r$ Y* k0 l9 g: }+ v2 k9 d" B9 C2 T2 e, |! l
The way it works is very simple:
* u) R6 R9 Q/ v/ M5 aIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# @/ l0 @& n1 G" n# B
WinNT) with the CreateFileA API.
V1 e! p5 S3 B; v, d" D: S0 l5 V
+ L6 s( l/ B! v& Q: F. Q) s2 m; HHere is a sample (checking for 'SICE'):* `# x& [: T) ]: e/ b0 T
: O7 i) E) d5 ?# Y8 N2 ?
BOOL IsSoftIce95Loaded()
& d8 K( R% _4 T% D" J{
& @0 U9 |6 e* i HANDLE hFile;
3 s: S) m. R' l hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; D$ e& j4 s; d u, \ FILE_SHARE_READ | FILE_SHARE_WRITE,( D0 S7 X8 e) _: u/ n
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" V# Z7 E9 n/ e. g( R
if( hFile != INVALID_HANDLE_VALUE )
( Y& Y( n" [9 X& g6 q {6 f6 g v2 C2 B9 C* A
CloseHandle(hFile);
# Q0 I/ c% Z5 O2 L" O, K return TRUE;
`, [( A V: J }5 F" J7 }% r4 i0 l* O4 w& k
return FALSE;3 Y A& _9 f8 Q
}8 e* j$ ?6 n5 t; q0 u$ V
% {7 V: l+ F, n5 H
Although this trick calls the CreateFileA function, don't even expect to be8 d Y* L, J. p! E7 I, a l
able to intercept it by installing a IFS hook: it will not work, no way!
* g& n# x }4 A, z+ X5 qIn fact, after the call to CreateFileA it will get through VWIN32 0x001F8 q8 v& Q4 v; y9 b+ C
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; C7 @, _) k, r3 V; _and then browse the DDB list until it find the VxD and its DDB_Control_Proc
\9 s( ]. Q" k- T# d6 kfield.
1 [. [$ {2 {( `; RIn fact, its purpose is not to load/unload VxDs but only to send a
9 ^& A; W+ I9 | jW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 C5 W5 k% `7 S+ D7 e# |, V
to the VxD Control_Dispatch proc (how the hell a shareware soft could try: V6 d G& Z% E- c, W
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
2 J( y" [) }8 h! F. r; A2 o7 XIf the VxD is loaded, it will always clear eax and the Carry flag to allow9 L$ H) q, U' n0 t1 I
its handle to be opened and then, will be detected.
% b2 ^% D/ u2 Q" A2 }You can check that simply by hooking Winice.exe control proc entry point4 M& z* j9 @% F) [8 p
while running MeltICE.3 Y. j0 k9 H+ I+ R
& L" M. ^& s3 N8 `, `
+ A0 d; M: h4 P: b9 O2 |/ a 00401067: push 00402025 ; \\.\SICE1 c S# \" @$ o' k- {. s- ~
0040106C: call CreateFileA
! P& Q4 |8 R2 b. k! @5 f8 H 00401071: cmp eax,-001
* F4 h) ]5 Y4 J3 r 00401074: je 00401091
# d+ [0 |# u6 [3 i5 N* @# Y# ^. A5 w! d1 M
; m$ G% W" H. f0 Y. CThere could be hundreds of BPX you could use to detect this trick.3 h$ k, s- |7 k
-The most classical one is:! d4 \9 t& Y: [$ j; T1 |- ^
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
& M- }& q0 }6 u1 S) o, B' } *(esp->4+4)=='NTIC'
2 ^* v8 b2 J2 V* O7 E3 _: C9 e' P# }) o) g9 h' B
-The most exotic ones (could be very slooooow :-(
: R+ i. u. g+ f5 T% H/ d BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
: F% v5 w# `& a7 d/ i" D! @ ;will break 3 times :-(- A- g) L! O" a3 `( `: P
: O' h, h, D2 s. t- s/ F" D" }-or (a bit) faster:
; _2 ~- E' p) {6 u BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 J4 B- ?5 Z2 D* G8 ?' {) }
4 n+ d, N, v" m. d+ [7 p BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 W; |% f, k. O$ Q6 r- _
;will break 3 times :-(
0 j0 p: p: `) C( z1 i: n
5 _, k4 N' v# u3 t! V9 G+ z+ ?-Much faster:5 o& n1 \" F& j. C$ T1 u+ H5 W9 e
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
8 U y+ n3 C0 i! V/ g5 y0 ]# m9 ^; @$ A' L! G$ D/ H6 {
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 C" T1 e* Y4 D0 f
function to do the same job:
. W* I- o9 V' M) o. d& k+ v
+ b# Y4 _7 h2 ?; z B6 _ push 00 ; OF_READ
9 n" Y8 A/ o( v$ |. J mov eax,[00656634] ; '\\.\SICE',0
: Z# p# t5 ^' u' B2 M, C push eax
. d* [: l% Z) ]8 f% ?. b4 V5 H$ Q( Z call KERNEL32!_lopen
, z6 p- L8 |# J$ n$ y1 O; @ inc eax- @0 y' D( v6 e5 b- T0 g
jnz 00650589 ; detected% m+ d A" M. @3 X6 g
push 00 ; OF_READ
! g& }( C9 ?8 T mov eax,[00656638] ; '\\.\SICE'
0 z) G6 ~( h9 k push eax5 E, e; D" d" H
call KERNEL32!_lopen' n& S) A' u8 f
inc eax
% B* }! w8 l3 @, X jz 006505ae ; not detected
( U. R- I g* a$ n: h& _& H( C8 A+ c2 F. O6 e9 }. H" G7 i4 t
) i3 y: b R/ `__________________________________________________________________________
6 O) _+ V+ l+ z0 Y8 W
/ m+ K$ O/ k3 m+ D9 y$ WMethod 127 F9 S3 z$ q L, B
=========
+ p/ u, R3 s9 q- a8 \' j8 @
- {* y& B" d3 F+ F4 iThis trick is similar to int41h/4fh Debugger installation check (code 05
! R$ O9 ]. `" F) I; e8 s$ c& 06) but very limited because it's only available for Win95/98 (not NT)
: |3 n! S. n- \/ F; @2 |0 jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.! N; y" K( q0 a& H( ^ b! z5 I
1 P& l7 X5 e. W+ F) i$ H
push 0000004fh ; function 4fh/ P! y4 }% M6 x- Q
push 002a002ah ; high word specifies which VxD (VWIN32); x5 ^* ?) Q1 v* S
; low word specifies which service
& j- P" [9 B; K( }0 t (VWIN32_Int41Dispatch)
9 a# z. d7 w/ m call Kernel32!ORD_001 ; VxdCall
8 U( S' ^+ r4 J' L! A cmp ax, 0f386h ; magic number returned by system debuggers
8 s6 K# E. l* g+ _/ D4 e9 B. M0 l. v jz SoftICE_detected2 N1 `8 y$ @% N6 [) {& q+ L* B
' k3 m% I- X: H) O; W, f+ \$ V
Here again, several ways to detect it:
" S- |4 J6 ]' U, @" }2 g1 |- e: h
) n) W8 L0 \ ]; W( R BPINT 41 if ax==4f# P3 Z4 l* }! S, L# }6 {; v
( S7 ?% w. ~9 Q6 y5 S D
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
: b4 Q5 s# Q( z& h; Y0 D8 s- A! D' c: {+ a1 c0 Z4 Z
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A7 g8 e9 H$ x! ]1 C: G: D" B
) E/ ?6 L8 ` G; c; Y/ H$ y# r5 g
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 L( C5 X3 O+ a& r; n9 ~! I( l8 R: y' ^, Z. |6 K* M7 X8 Z
__________________________________________________________________________$ w* c. o/ k, A8 X' K6 [" N. I! o
3 T* X5 U1 R" E* jMethod 138 c( W" V6 B+ n
=========
2 k5 h) K" n& V
" |: C. D( j% y) gNot a real method of detection, but a good way to know if SoftICE is
4 G$ T) i0 x' o* s0 F) d. I9 A) d, ainstalled on a computer and to locate its installation directory.
" [( A+ W. }# i) l8 {It is used by few softs which access the following registry keys (usually #2) :
, }/ w4 D7 D$ q! ]; L# u
% A6 w, p# U9 E6 L! z. N-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! s( H k" m9 z8 X' T* h
\Uninstall\SoftICE
& L; [4 e: w0 o-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' M) d. x! G2 }) R, K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. l% n3 U2 A, M9 J, X4 J0 N5 w+ e, N\App Paths\Loader32.Exe
6 k$ I' Y5 _6 N" Y& J# \( [" A) J2 a
3 G2 M" [3 }! Z- l9 L) A0 M
; ^- q( g5 d/ {6 r2 fNote that some nasty apps could then erase all files from SoftICE directory$ `/ s$ W5 S0 J' H& x( ?
(I faced that once :-(
( N& G6 N9 [0 h# _! L* U9 E8 g1 b u
Useful breakpoint to detect it:1 x3 N; A/ u4 o6 M# L
- I& g2 H) j% X4 B* w k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'+ F5 |, h4 L4 M' V7 P& N. ?! s
' v& ]( T1 D! N' c: v* \__________________________________________________________________________# T# U/ S6 R% T
* Q" m% U- {6 V) P# x) S3 L9 K: O! G) ^' a/ a6 G
Method 14 ' a( Z `( C1 M: s7 E# t
=========
" C, L4 ~& x3 N2 m q7 t( M0 Y& D+ B; K3 K& h) t8 Q$ z; w3 C
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ u+ C1 D6 y8 g r% g. H0 O$ E: ~( Jis to determines whether a debugger is running on your system (ring0 only).+ B4 s' C6 ]+ W
# y- u7 H. j8 U+ |. m VMMCall Test_Debug_Installed9 I; H4 K3 W+ x3 N3 w/ f R
je not_installed/ k4 D; p5 f+ ?$ t, _) L3 P
; g' {8 N# J' |, s0 K
This service just checks a flag.
! Z+ t2 }# H' `# r' g p</PRE></TD></TR></TBODY></TABLE> |