<TABLE width=500>2 q$ Y3 ~, e+ W, |
<TBODY>5 L& t- ~5 G, Y1 p: l9 f
<TR># s6 W3 W. q1 J" \6 x$ u
<TD><PRE>Method 01
9 d* T" @3 y8 G/ K* R* |=========5 l( d3 E5 Z7 ?3 P+ {0 @- z! [
3 L" \; |) w3 ^0 C; ]6 L- `
This method of detection of SoftICE (as well as the following one) is" s: l1 c% \5 t7 X
used by the majority of packers/encryptors found on Internet.
4 j5 [/ S6 a8 a/ U9 V, o0 ^It seeks the signature of BoundsChecker in SoftICE
' O" a7 a0 x# V: \+ z% N
/ [) O4 o, g* P' G& Z mov ebp, 04243484Bh ; 'BCHK'+ Y1 c) h( a! X! N$ A
mov ax, 04h3 a' u3 K5 m% n/ }* g' k
int 3
0 R7 Y- `; U9 B' q1 U3 | cmp al,4
* a& Y( j2 I( J0 ]7 e9 m4 r jnz SoftICE_Detected
8 b% F6 h* D9 p+ E
, q* ]# I' p+ g1 C___________________________________________________________________________3 S0 x7 F: ~7 `7 @6 ~2 [8 x
! g0 g' Q0 u$ M7 n3 s: Q
Method 021 y! O& I/ I2 E( z& i. G
=========2 A9 S9 \+ O! r# S k
# S# M! a9 Z6 D: QStill a method very much used (perhaps the most frequent one). It is used1 C! T9 ]+ g+ w) O" R% p
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,# V f G( m- }
or execute SoftICE commands...
7 {! J: w4 b" m, H2 E9 GIt is also used to crash SoftICE and to force it to execute any commands
8 P4 ?% X _8 G9 j9 L(HBOOT...) :-(( 2 U0 J! u- l9 J4 [5 q7 j
/ x+ e& l' y2 Z" j- @6 b4 B {Here is a quick description: Q' i7 |/ U b# I7 R- g0 [
-AX = 0910h (Display string in SIce windows)
2 E/ B: c' e/ C) V-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& K# P9 Q. ]/ o. B
-AX = 0912h (Get breakpoint infos)3 @+ _: }0 [& [: O4 ^! S- O* s7 k
-AX = 0913h (Set Sice breakpoints)
6 e5 L' }6 V4 P+ x' S8 @# l& Q9 B-AX = 0914h (Remove SIce breakoints)# U/ U5 k H+ K* A* u1 u' `
5 \, h" j+ G% [7 N' {! D- A7 xEach time you'll meet this trick, you'll see:9 l; u2 y# q( O4 W
-SI = 4647h
1 s! \! m! a/ `-DI = 4A4Dh4 l4 V2 D; c' V$ v X1 z' x% u- l
Which are the 'magic values' used by SoftIce.
: U9 L( g: R/ q. E. H2 J9 R# ^For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- k5 M2 \ J3 I5 e% D% `1 _# v( k4 Y* P
! c" c0 x( ~3 ?9 PHere is one example from the file "Haspinst.exe" which is the dongle HASP
- r4 `* R) G3 CEnvelope utility use to protect DOS applications:- U6 ]. V5 v# r- E9 v3 F
1 r9 P# K5 g/ _! F9 i$ V; Q. b
& f! l/ Q! ]9 u# ^; F* L4C19:0095 MOV AX,0911 ; execute command.
4 `% c7 m) a! ?# y+ J! z6 \4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 V$ W" J% T7 o) x4C19:009A MOV SI,4647 ; 1st magic value.$ ~0 I& P3 d' V' d" B# Z: f4 R
4C19:009D MOV DI,4A4D ; 2nd magic value.7 x# D5 o. l: l' e7 V$ [& u E+ g; n
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): g5 _4 U& N1 ]2 L8 X3 ~' Q
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
9 _4 h4 W* O q- ]8 m5 y8 t4C19:00A4 INC CX$ U5 M0 d0 E S+ z3 B) X8 G2 z2 l
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute. Q& R7 Y0 V P. E* D# ]5 |& U
4C19:00A8 JB 0095 ; 6 different commands.
$ }9 n: e, d% @7 S4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 ~1 A9 ~; p) h0 K1 Y z8 ^2 \
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
: z0 _6 `' `! o% I1 f3 A: G9 h- |8 y C
The program will execute 6 different SIce commands located at ds:dx, which: s9 h p$ E1 s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT. A/ p) e" ] _. l8 v
1 I% k; t7 B& p V. X
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ Y$ E8 J# i; o4 K5 @
___________________________________________________________________________
. B: y" V, d" Q% X& g0 C6 Q3 ~
8 h. y& o+ u5 [3 E2 s" C+ _: K- Q% B; Q9 m
Method 03: W+ E$ \" T1 M* ^
=========
6 F h0 d. M# A
7 P: F: [. `3 Q8 h s$ BLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. R3 S, ]2 N& T, D5 U& f! q3 }% Y
(API Get entry point)7 n- B8 ?) T: L) s5 T- Z+ C4 t, j
4 X- O$ { u' _
# r$ T7 q$ O+ X+ r$ D xor di,di! e5 a2 d+ ?) E0 i9 R X
mov es,di9 ~7 n; S- @6 p5 Z
mov ax, 1684h
2 r* W9 c1 j7 ?2 N5 W mov bx, 0202h ; VxD ID of winice6 E5 {1 W( F5 _1 r. d
int 2Fh
) K# k( b: v" ` mov ax, es ; ES:DI -> VxD API entry point
! L" G8 [$ p, m3 i+ O add ax, di* ]) S$ ?5 D; n/ W1 ~
test ax,ax
" G& b1 i! T* N- Q" [ jnz SoftICE_Detected
/ u. k( g. P+ X; k& @
/ ^6 M# m3 [. z% u! W; G" u! j8 f) n___________________________________________________________________________
( k0 U" x# R) h o: M \9 r
! S& p7 u3 Y; b! ~# E, S* TMethod 04& s; T) z; y) C# L( _9 @3 D, w
=========
( C$ ^" G% [6 B: R" A+ m3 v$ j4 a& d" K1 X
Method identical to the preceding one except that it seeks the ID of SoftICE
/ z9 d6 h( Y9 |( I# }' d! W9 A: O7 ]6 bGFX VxD./ S# @" ]" R8 P* z- v
8 L7 I. t1 b) `' ^% S xor di,di
- ^; a; t; N0 V" g( f3 o7 q0 F mov es,di V, l9 Q* e* c! W3 j. o: ?& C
mov ax, 1684h
4 t n2 U8 j' F. j3 A4 V; Q mov bx, 7a5Fh ; VxD ID of SIWVID, K/ t+ O8 o) P7 g. v+ L$ G& j
int 2fh, D$ N1 f* G" X E8 j, W9 I
mov ax, es ; ES:DI -> VxD API entry point3 h, k, {- I! e5 `0 d& _) u. c$ z
add ax, di; o9 y1 N/ [* \1 K
test ax,ax1 K- W* }( A2 X5 Y# v7 H, F4 L
jnz SoftICE_Detected
: Y7 w& c$ v0 `
0 W4 A9 d- S+ l) o' {) `0 C4 M( r__________________________________________________________________________5 w$ O: j$ d7 B4 ^9 G: T
; t: H* M3 G8 [8 Z9 W1 c) n. @
6 x# e' X8 f9 Q t4 }1 u6 v5 f0 {
Method 05) G+ n# D0 x) A6 \4 v
=========& M8 r2 X5 h. I* W* m' M
/ o: z) {4 Q$ z; V" T. a
Method seeking the 'magic number' 0F386h returned (in ax) by all system
: c# h$ n5 V) }7 L( Hdebugger. It calls the int 41h, function 4Fh., T8 R z F6 i H0 }8 J
There are several alternatives.
5 f& _$ ]5 f& W' S, W6 X1 [
, J u p& x, |* L1 ~/ Q nThe following one is the simplest:* G! v9 v2 U9 q( G% h, |5 z
3 x1 M1 G% H! i! H: l, [ mov ax,4fh
i6 Y- E) H$ c* J" F! C int 41h! y7 k3 r" u5 I' o' E, p$ x" v
cmp ax, 0F386
- `: e6 H3 E( s1 S u jz SoftICE_detected
% N) y: z7 R9 @
; o" u1 L# k! Z/ D `' a
5 H, p, l; \% E+ k9 b+ W8 {Next method as well as the following one are 2 examples from Stone's ' W# n7 Q% a" {# E) Z8 ^
"stn-wid.zip" (www.cracking.net):
, n) j9 d+ z, o+ S% }1 Z
) p/ d. u8 ~6 S% y mov bx, cs! U4 ^5 c! e2 a1 b- p) C% n N
lea dx, int41handler2) P8 x$ V4 i1 E2 k) O( |
xchg dx, es:[41h*4]
% m0 D& r0 ]& y2 |4 Y! O! | xchg bx, es:[41h*4+2]
- K+ F b6 _/ A( v0 A mov ax,4fh' L( e5 L" D4 g9 f* U& q
int 41h
1 r) S! U/ V7 k4 B xchg dx, es:[41h*4]
1 b/ U) v; d) [! u$ G- ` xchg bx, es:[41h*4+2], I# D v6 b6 W$ ?- I+ r: F
cmp ax, 0f386h
4 ]$ \+ C$ v8 j( d jz SoftICE_detected1 F+ z" t# i/ _- k8 A: F+ g6 s
6 N7 l4 m3 |, K. r
int41handler2 PROC
( |% F8 M' _. { iret9 r! v$ s) y7 u6 C
int41handler2 ENDP
3 |- r# [6 _1 \1 ]3 P r$ L# {7 H2 G
# L" L6 O. e7 M9 I% D: U# c$ N. k' E3 J3 |* L3 t! D. i
_________________________________________________________________________
5 B1 X" f$ ^% R0 c( C- z7 b. @$ A; w
0 Z3 I9 ?. V) i7 `
Method 06
; c, O1 I* K0 M( x& I=========& A \' |/ M$ @( F' i
/ ^0 M* j# H% a* _+ ~3 W* [" J# O$ @. n$ i I3 i) y& o
2nd method similar to the preceding one but more difficult to detect:7 C' J: O9 ?1 V* [
7 `9 P$ p S4 A9 N8 _. k( Q
- ~; d U: f' r- a& m) l! Uint41handler PROC
% x$ f) v* e( a mov cl,al
Q0 D- e- m# V2 Z+ n) w iret
& F& Q$ a. G! @# k! oint41handler ENDP0 ]+ {; E) u4 G2 p- `
; i1 C$ T# }3 F. ~
+ B5 c* U2 Q+ ` u1 Y/ c xor ax,ax
: {' a( |4 _3 o Z5 R mov es,ax
2 q, o$ y; x# c+ q1 S- M$ V mov bx, cs
B# G( ~3 B' L8 Z; Y6 { lea dx, int41handler
- o6 q5 k8 F$ ?2 y) k. } xchg dx, es:[41h*4]
, T C. c. B5 a O4 p xchg bx, es:[41h*4+2]
* V; e- C! O% D$ _9 P" h. U4 x in al, 40h
I5 t) Z. K3 D; ^: d2 O xor cx,cx2 k! r' b( m" |# P0 C
int 41h
5 y$ q. ]* ]8 d0 k/ n xchg dx, es:[41h*4]- Y5 G k9 r3 l$ ?
xchg bx, es:[41h*4+2]
7 S7 i/ S( o% ]7 G- D; e cmp cl,al# i/ {0 s: L7 X
jnz SoftICE_detected
) W# m' @: _4 E1 X3 h
- {3 l& X* a& h5 {& I. c( __________________________________________________________________________
, n2 G0 z) d* i! l
4 r4 ?, t( \& ~$ qMethod 07
2 T0 F. _% a9 z) r=========4 w# ^2 I! Q- I% d9 L& X3 u
. G8 w8 Q4 ?. Z( MMethod of detection of the WinICE handler in the int68h (V86)
/ x: Q8 A$ O3 Q1 h. I1 h1 j% O" Q; m2 y; i' N2 U
mov ah,43h! k! r- j+ R" V" l
int 68h" w+ N7 r2 Z4 {; u v
cmp ax,0F386h% }3 i; x( ?# R. U' A' F! W
jz SoftICE_Detected0 P6 O3 o" A; C/ z" \
( {0 Q" i+ d' ^: f0 Q: |; G
0 O+ }/ P# }. J4 `+ B0 L=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit7 |* o* i4 Z5 m3 l" e" g" Q* R
app like this:6 r/ Y u$ E# B$ u, b8 ~
: Q9 g) |" `5 f, H# J! s# q
BPX exec_int if ax==681 m7 Y6 S2 O. @3 R
(function called is located at byte ptr [ebp+1Dh] and client eip is9 e+ O! _# Y3 r) {! @- R& f" k
located at [ebp+48h] for 32Bit apps)% C; l, b' Q9 ]( \- W) C) F. Q
__________________________________________________________________________
. T' c: I* O* U% t" E0 [; I' I) U$ P
: v- c8 Q0 v* fMethod 08
! w; ~" H% R4 g( {1 B=========
# N5 Y3 T$ u* k& B+ ]9 G; a9 Q- G4 p; X: Z% K
It is not a method of detection of SoftICE but a possibility to crash the
. k- `1 p( i" ~7 lsystem by intercepting int 01h and int 03h and redirecting them to another6 {1 \) o% l0 E$ Z
routine.
, m$ R, Y8 V. s WIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
+ I4 Y0 g- k; G0 e2 U; }to the new routine to execute (hangs computer...)
8 j0 O; [" N0 i. r2 r! k0 f2 R5 ?3 C% k8 `+ H
mov ah, 25h# c) o$ K! u& ~9 m3 r! R
mov al, Int_Number (01h or 03h)2 M6 k6 Z2 W. I* m, ?. ~0 G( Y/ ^5 c
mov dx, offset New_Int_Routine
* q( o. x; ]! ^# y. o [ int 21h- J# `- M7 q; o7 T
' ? z1 C- Q5 q__________________________________________________________________________9 E. ~$ V% _$ g: q% P6 H: X% w
5 Z" O7 p# K! v9 l! AMethod 09- K ~6 q e0 p$ C) Z
=========
" F/ r. u3 c; N$ S; p9 D& e: p+ s4 y: B1 ?
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 U) H, n1 [) Q. |8 s/ b7 `performed in ring0 (VxD or a ring3 app using the VxdCall). ], m8 Z5 f3 X8 z
The Get_DDB service is used to determine whether or not a VxD is installed6 ~' o$ @+ ?# ?! R8 }% M
for the specified device and returns a Device Description Block (in ecx) for. M8 {& n' S2 G# ~7 R
that device if it is installed.) T! O0 H4 y# L* _; {8 c% P' G
$ |1 Z% P1 z$ P8 m
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID3 ]* ^. d: p) E( ^4 A2 p
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
/ r- m0 L. t; K* ]% q, J VMMCall Get_DDB
( ?# D, C8 z3 o- I* n% [ mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
* n, x, k; y: y9 a# }* W. L+ l. t( c" I. d7 B
Note as well that you can easily detect this method with SoftICE:
' p: {8 f8 T" @$ {5 {+ s$ Z( y# V bpx Get_DDB if ax==0202 || ax==7a5fh
9 H# u! L" c# C
) f; W3 u; h3 g! [& ___________________________________________________________________________
! ~; ?, v$ m+ @ L8 S
) z6 K8 Z, {% k3 k( H0 OMethod 105 {2 }( S; C$ e! {1 G& A: B C) n' \
=========! J8 ^) h" B, _/ a/ n4 ]' Y" ]
2 d3 u2 g( N6 \) U- G3 l% M7 w
=>Disable or clear breakpoints before using this feature. DO NOT trace with
% ?- W* s) x5 C# A SoftICE while the option is enable!!; l# e$ h/ i" s) r
* y# u: H' G. x
This trick is very efficient:
( Z# j" M2 f. L( P' oby checking the Debug Registers, you can detect if SoftICE is loaded
+ N, i2 W" I$ \# z/ M5 y& ?6 t8 I(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if$ e: X; S/ H( }2 X
there are some memory breakpoints set (dr0 to dr3) simply by reading their# ]# J* ?9 z, Q1 c8 |
value (in ring0 only). Values can be manipulated and or changed as well# ^$ C' U4 e+ d1 ^# i% i/ t) i
(clearing BPMs for instance)' ?' }2 P/ W5 H9 D
C& j9 }* e- r0 A# w__________________________________________________________________________
1 `' q5 A( h" k( v5 D* `
) `; E& w& {7 L7 X) O8 Q4 aMethod 11 {! X# K9 K, a: v, H3 e5 r
=========; B$ G3 n P7 i% L+ A- D1 b
@# z4 ~( u! b2 fThis method is most known as 'MeltICE' because it has been freely distributed
6 Z8 x) ]# D, ?7 b" f, hvia www.winfiles.com. However it was first used by NuMega people to allow0 {! B- ^) u: O7 n3 o/ ]0 _
Symbol Loader to check if SoftICE was active or not (the code is located/ f, j* c% c, L9 @) g3 [
inside nmtrans.dll).
) N. i0 e1 Q6 V; `3 T+ F5 ~% F, m6 N% t$ p( m
The way it works is very simple:! k5 B* ]+ B) e$ n: J7 r' P3 c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
A- Q7 j8 j% G- T. A* }! P8 AWinNT) with the CreateFileA API.% u4 @ c% z8 K/ f2 w2 `
* e" {/ v S3 y5 X4 G, n5 F+ ?Here is a sample (checking for 'SICE'):6 C b1 K! f9 x
, c- Z& r# j: K E' R" B
BOOL IsSoftIce95Loaded() b& d- `" y- a) T* N8 E: v, |
{
; i3 O9 z+ b! K1 S& \ HANDLE hFile; # h8 T5 `7 Q% N% O2 n3 C3 \6 ~
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,/ C0 a) G0 x# V9 x; N; R( u
FILE_SHARE_READ | FILE_SHARE_WRITE,
) F& p/ x5 s( { z6 A NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
" W. ^ {0 `; A. o: O2 I if( hFile != INVALID_HANDLE_VALUE ): G+ N/ x( H: c5 r) L! S+ Z
{4 E) i+ w# j% j6 Y: }
CloseHandle(hFile);
- u- M' ~/ H! o2 O return TRUE; d/ A$ Z. t% J
}
8 ~' l( u+ k6 O# |) P6 |8 R return FALSE;
7 i k' e2 l+ I/ ~% l" [ o}
1 ]: @- r; M3 A: [ r+ ~. W4 M
6 V, g m. _- D2 p) Y t, j' BAlthough this trick calls the CreateFileA function, don't even expect to be' S6 P7 D. S0 n- \1 f
able to intercept it by installing a IFS hook: it will not work, no way!, e! u8 c" n/ p9 O
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ _+ x# ?+ M+ S! u6 H! ]; C% }
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 D2 A+ X! ], i0 o2 f3 oand then browse the DDB list until it find the VxD and its DDB_Control_Proc
3 l. }2 S7 u% \0 O: p& m% n# }field.1 R* L0 D ~6 O6 G4 _6 g4 I
In fact, its purpose is not to load/unload VxDs but only to send a
) w# F) j' ~8 X0 w* o2 k$ G6 JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). {5 i% m! [* o1 @7 ^2 F" ~
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
) ]$ }* n% F2 }; r1 _to load/unload a non-dynamically loadable driver such as SoftICE ;-).: n1 |: `' N* G# z: @" Z9 G. F! V* V9 L
If the VxD is loaded, it will always clear eax and the Carry flag to allow4 Q' \0 }1 Y8 N* b- |
its handle to be opened and then, will be detected.
( W4 r, n" F- z* q3 ^You can check that simply by hooking Winice.exe control proc entry point
4 m$ t; u' V- \: O5 Q& b$ V$ ~, xwhile running MeltICE.- n; g) o$ f% w! s3 e( }6 I, h. p
; q" A5 c# u% |- Z1 X S- |1 G: _' |" B
, N, O* n1 o; x" ~* {5 h+ y
00401067: push 00402025 ; \\.\SICE! l ~5 O; u0 M
0040106C: call CreateFileA, e7 U. @ F0 K/ n
00401071: cmp eax,-001
8 ~7 p, t* \( ?+ E9 R8 {8 `# w 00401074: je 00401091
; s( s1 x6 S; B- s; v
7 o/ {. B3 R% D# y
# l" h8 c& P Z' X e, @There could be hundreds of BPX you could use to detect this trick.6 d& _; u3 D/ l' @! [, o, ~. v
-The most classical one is:3 ]: N# i H! L& f* q
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, E5 q' n8 D y8 v* x
*(esp->4+4)=='NTIC'# s) \* V T4 K* `" n+ X
$ V& N& K0 i2 y2 y
-The most exotic ones (could be very slooooow :-(
* X7 j2 ~. t9 v- r7 ^ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - R* K& o" r0 B9 q& h1 d
;will break 3 times :-(" Y v: c0 d- q! S. q7 ?
2 d5 o L- h/ P; v7 @-or (a bit) faster: 1 v9 l# R# Q; c& D3 O8 ]4 [8 a
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( G) {% o5 d0 o" @2 t$ J: L% s: g2 k# z. M6 X' l) S9 R" d
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 8 L/ T4 T+ k! W& e: W# ~! l
;will break 3 times :-(# i9 i' ^4 U2 V; _) e# w W
5 ^+ q2 w+ j0 K6 s
-Much faster:
" U+ c x. L8 |) M! G- X- Q0 [ BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'' i$ o3 H2 S( x F! d" @. |
. ?9 @3 Z$ s. U) e( O/ T3 uNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 H+ `* ~! a. y: {6 J( i$ g& u' Ufunction to do the same job:
+ Y" E$ S& z0 x, V& U# U4 J0 I8 F
push 00 ; OF_READ
' y' p; R. k2 b) C mov eax,[00656634] ; '\\.\SICE',00 s9 h! V8 S$ m1 a6 c6 Q# s
push eax
6 U+ I9 w3 V U8 f+ C7 v1 O0 W call KERNEL32!_lopen- p* O( ?* r/ h
inc eax
- R } c7 M( v jnz 00650589 ; detected
9 v" g) Q1 I/ h9 T7 n push 00 ; OF_READ
F6 x: L' \4 Q; z2 X" h( g9 G9 o mov eax,[00656638] ; '\\.\SICE'5 h' _# T0 l- A3 _6 P. R6 a4 V# v
push eax3 a9 `) M- G. s$ F% {
call KERNEL32!_lopen
0 F. r4 S( z' ]" j inc eax, I9 p& {- |! T. T$ `
jz 006505ae ; not detected2 x3 x4 ^: x3 H- t, C
+ I# B r6 ^: \; c t, U7 o
2 t% q) X5 e% j5 K__________________________________________________________________________7 p9 _& E% b8 Z- G1 ^9 f0 S4 T/ Y: q
0 v# }9 o9 b8 k7 Y8 ?- NMethod 12+ u) s' h' U% M, V4 U9 ?: m
=========
* Z1 H; K- k! @/ ^5 A. ~8 ]- M/ n$ R, C9 K
This trick is similar to int41h/4fh Debugger installation check (code 05
! V! j+ Y' l3 E, ~+ H, l+ G7 v& 06) but very limited because it's only available for Win95/98 (not NT)8 I+ f* U5 Y4 T7 l& [
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
: v8 k( P( }4 Q" Q% t
1 Z* A: b& k! S: S- c5 r. I push 0000004fh ; function 4fh
% `! U) j9 z8 q6 F push 002a002ah ; high word specifies which VxD (VWIN32)
8 F5 D- n6 Q" [$ @7 H! F ; low word specifies which service1 r3 h" \+ M0 i5 S$ W" j
(VWIN32_Int41Dispatch)$ I6 h/ x8 V; l7 f+ j1 K7 }
call Kernel32!ORD_001 ; VxdCall+ o( E* A7 b% w! R' Q1 K- M) @) c
cmp ax, 0f386h ; magic number returned by system debuggers
- H) V4 ~; o: i# m jz SoftICE_detected" h+ K M" N. | R! r% \) V) v
2 p M: r* Z3 |% z% P% T# ZHere again, several ways to detect it:% x7 u* z+ M# s* H) A
7 i+ }6 r; H0 }9 v( m2 x9 G
BPINT 41 if ax==4f5 C+ x; \& b8 k9 U1 S
1 X: q* Z* U+ t- m- a
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
6 e, B/ o; ]" V* ]& b% d6 M Z3 I1 K, P; N h+ N
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A! _. G* m( h7 ~7 M0 ?( V
# C1 h$ }* k9 _( ~1 ~1 k. r/ ] o8 d
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
5 j$ p( Z$ }7 E" `5 @$ w" v" U
, k! m7 t& b" O__________________________________________________________________________" Q. z( ?6 S' V9 ^% q6 s6 ?9 q
5 c* }. l1 Y$ p( SMethod 13* Q* p+ ]# R A$ G: @5 V
=========
- n8 S: H3 n: B8 |
8 i& Y6 E3 o7 H' i" l' h. YNot a real method of detection, but a good way to know if SoftICE is8 W1 w t( _& {! Y; `$ U( J2 H( c1 P4 J
installed on a computer and to locate its installation directory.
- `. L( m* d5 t+ O/ C# y. x$ z% TIt is used by few softs which access the following registry keys (usually #2) :7 W) J* F7 `* y0 a C8 z
8 [7 Q* k: k; o-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 J+ Q: w/ ]& p. }; @\Uninstall\SoftICE, G0 T( Q7 K5 s" i$ q% X) A
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 Q* L! r2 o/ ~ O: x-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) Q& l6 J$ d( _/ y2 b3 V* z
\App Paths\Loader32.Exe* K7 s2 B$ k3 H4 N( T5 L
8 ^0 y1 N9 e9 g: o$ Y4 v
5 x8 s: e' ~+ l
Note that some nasty apps could then erase all files from SoftICE directory
+ w9 m7 i/ @3 T(I faced that once :-(+ i' u& W8 E6 h1 ]
2 Q) E1 N: N5 D/ Y
Useful breakpoint to detect it:- y0 D8 }& m4 m% N* `1 L j, ^
8 U! F# D9 G% ~( F
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 s- M% G: n) k+ D( C: J6 U
0 o3 [( c/ C, i- d' w0 B__________________________________________________________________________
! H& C7 i& @5 T; k' Q5 ?- V
6 ]4 \% Z: ?9 K- f0 ^5 R$ n, b& U
& q4 C/ O# k* I9 _5 y; \" Y0 b5 YMethod 14 - `" D- G# n* i4 E
=========
$ \& z4 _5 ~, `) W; n, e5 Y
' a" M$ ]6 X O3 \A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ w2 q8 u% t0 K# ~$ ]* r
is to determines whether a debugger is running on your system (ring0 only).
2 u# D5 m( F- n9 Q) E
! x; c9 k# ~& G VMMCall Test_Debug_Installed% s) g, D* }2 `( A3 ^. W
je not_installed
1 z& `/ |" t# _/ ]& q# B0 z3 f" t' [3 j
This service just checks a flag.
( `% `4 ~1 k- U( C9 d3 f</PRE></TD></TR></TBODY></TABLE> |