<TABLE width=500>
. U( W# @0 l7 P7 X! h: `<TBODY>
% E( i ^' |% Z, M5 {) u<TR>+ `/ T7 \& i) [% ?
<TD><PRE>Method 01 * m2 v! z: H. J _% S
=========3 x) |, h8 y0 D
$ }3 `* K9 F$ o4 b
This method of detection of SoftICE (as well as the following one) is' p6 R7 a; I9 O' x1 C) o2 H
used by the majority of packers/encryptors found on Internet.
3 Y7 {" w* E( _7 ~9 k/ a0 l; QIt seeks the signature of BoundsChecker in SoftICE7 d! }3 Y! m5 d
% }: {- n# ]5 G' v w
mov ebp, 04243484Bh ; 'BCHK': N0 W/ a! P# k7 `+ r/ Z" Q* ?# i
mov ax, 04h! l L8 W1 j+ }: o" v, f/ j
int 3
2 }3 p ^) O4 i" t3 K cmp al,4* ^) j! W O/ C& r
jnz SoftICE_Detected/ V) s7 K- @% u1 D6 Z
. f ?* R O/ f6 D; E% o, E___________________________________________________________________________% h# l+ W2 E, v8 R) B$ _ }+ N
$ i/ J% e- Y& B( B3 v5 I+ eMethod 02
. n6 x7 z" V" Q4 f2 Q! x6 H=========
" i' N# v- `) l% v1 V5 F5 y/ b# L2 L/ c9 `
Still a method very much used (perhaps the most frequent one). It is used
3 ^+ F6 f* l. M1 a9 x5 j7 yto get SoftICE 'Back Door commands' which gives infos on Breakpoints,& K9 E Q. o5 H! z) ^9 t, ]
or execute SoftICE commands...
0 T# U9 B/ @7 F+ O* kIt is also used to crash SoftICE and to force it to execute any commands9 p4 {6 \ H/ `
(HBOOT...) :-((
7 I; I8 Q! z* |
" q8 o1 G4 k0 o, O+ H8 mHere is a quick description:
; R5 ?3 P/ p4 @* M# c-AX = 0910h (Display string in SIce windows), f, O, S+ r8 @
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- l, q% c4 K8 k% L; i8 @( J m
-AX = 0912h (Get breakpoint infos): T9 z7 [) U6 j, T. ^- x
-AX = 0913h (Set Sice breakpoints)
# M* H) ?2 n4 D8 N- E- w-AX = 0914h (Remove SIce breakoints); q: {4 M3 R+ c0 ^4 p$ R
) s, K/ E! u, A6 Z
Each time you'll meet this trick, you'll see:
- [! [6 e2 t# d2 F) z& N" C-SI = 4647h
m) `: A- k+ a8 A2 S3 N" O-DI = 4A4Dh5 @: X# O' x- v' ?" Q6 F" a( d4 u
Which are the 'magic values' used by SoftIce.
. F- n1 R. n$ y% z2 n4 D2 fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
; L, {; u2 Y, ?0 U
, m b! v% F$ E- j7 h, DHere is one example from the file "Haspinst.exe" which is the dongle HASP x+ W1 p8 z$ [* y$ G2 v& w$ L
Envelope utility use to protect DOS applications:
% N5 e6 w, G0 y* h( T+ z, g7 o, {/ n7 z; |2 j
; h$ j- n; j! |* V" a4C19:0095 MOV AX,0911 ; execute command.
4 W1 ^+ m, l: G4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 u" i) u$ \. Y4 u- r4C19:009A MOV SI,4647 ; 1st magic value.# X p. H) k6 Z$ C5 p" D: m
4C19:009D MOV DI,4A4D ; 2nd magic value.
- a- ? h9 ]0 F7 V; {4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
# d5 @4 Y8 j2 w8 c- l4 J4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
P3 {# L$ Y6 {% l/ e8 Q4C19:00A4 INC CX
5 n) w( {1 E5 e6 c4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
D% U6 S5 Y; J. S1 a4C19:00A8 JB 0095 ; 6 different commands.$ v f4 O6 J3 C% b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, D8 g, @) t8 a7 b+ s4C19:00AD MOV BX,SP ; Good_Guy go ahead :)4 Z/ b8 G: ~% @# U
0 a. |' q( K/ ~, a/ f: S2 W4 hThe program will execute 6 different SIce commands located at ds:dx, which5 w8 {; g9 y: ~' I: q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! M- x/ O, r6 |% m$ I
0 b8 | G2 @* [& v- I* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ i1 y, {- F9 Q& V6 ^" ]
___________________________________________________________________________, R/ W7 C6 J: R0 j
2 V; `/ C; R$ w% a; W6 a" m
& Z, T$ S- S# v* q) f1 V4 P$ @
Method 03, G9 J- @$ G2 x
=========5 j4 l0 G) Y. G" ~" j+ h! J
! {: ~( f) W8 L3 c! h
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h# u6 N+ U8 o# b; g( E% @
(API Get entry point)3 L# E" q" N. x1 C$ h0 B
0 _; e! B. s/ n$ @2 i4 \ w9 D7 ~- R1 T- P ^/ I4 B
xor di,di0 Y/ c9 o4 t9 d; `% [
mov es,di
3 |4 o0 R9 f8 b" \7 ]& b mov ax, 1684h
' U2 r- U! K8 b0 p" ] mov bx, 0202h ; VxD ID of winice
# H6 e: q* A. ~ e int 2Fh
" u# }! `4 r+ F1 I mov ax, es ; ES:DI -> VxD API entry point
- y- Q& K/ y0 ^7 Y) G; M- w add ax, di7 a# M$ [1 U/ V7 N) K/ G
test ax,ax
, G8 ]: n( t$ J1 D jnz SoftICE_Detected4 W d. ]& e$ j' @- p) [
, Z; G8 y( D8 v7 v
___________________________________________________________________________( q4 ]/ ?8 k0 H1 c5 q6 T, K" ]' J
5 |2 T' ?7 f. ?) C, O, }Method 04
9 R: ? m4 t( k$ [=========
. e/ t$ N: g* n: o4 s+ A" ^
/ c2 l- Q+ v4 E6 xMethod identical to the preceding one except that it seeks the ID of SoftICE
2 X; S( t9 l. }' r! }( HGFX VxD.7 G1 w$ u$ B0 o- d4 T
# w. e3 Y6 e) X' F8 M6 T2 D xor di,di% H; I d7 R$ S* j
mov es,di0 J2 ?' S2 @! E# f& y
mov ax, 1684h
* R. g) A0 Z+ D mov bx, 7a5Fh ; VxD ID of SIWVID) a. Z. \" c* ]; n4 T
int 2fh
( t: z p& g |. i; d/ J4 n mov ax, es ; ES:DI -> VxD API entry point: [$ ^) L' [* t8 o
add ax, di5 y) q# b" n2 u: Y, C% O
test ax,ax
! I6 {' i4 ~/ y2 S jnz SoftICE_Detected" o- y L! `8 Z! I- `
, o4 L& G+ [9 C# E$ c
__________________________________________________________________________7 U, e+ q* ?1 j q8 [# g6 n
( O& ]% ]7 p8 w9 Q5 f: ^2 z. t; S5 k0 }! K# ^/ p8 M( p
Method 05+ [) ~. M2 X! n5 h, R
=========
/ V1 y% O6 o' S8 K& O% c# n" n, e% J. ^/ f
Method seeking the 'magic number' 0F386h returned (in ax) by all system7 S" h2 b& A5 o) [
debugger. It calls the int 41h, function 4Fh.7 w1 I6 |' q9 i. ?9 j Y/ T9 n
There are several alternatives.
: L: q/ _* G6 |% [6 A0 M Q: b
- W! W1 m3 w$ x) q5 }7 eThe following one is the simplest:- U1 x7 b: _* t% z# |
2 `' E3 ?2 L8 c- _
mov ax,4fh: D$ s) [) ^, {$ I" X+ j5 f, D+ y: n
int 41h
4 _1 z/ [: r1 a; {$ x# u+ i% c cmp ax, 0F3866 w9 _2 h/ V8 Y0 W! w
jz SoftICE_detected
. z; N$ u8 N! ^
* S. Z) J9 q8 `0 t* ~+ G
& _( I! u( J2 X3 r* n; KNext method as well as the following one are 2 examples from Stone's + e% j7 ~% e& D2 H* _) w$ G
"stn-wid.zip" (www.cracking.net):2 U& V9 g/ i. Z. K! G6 u2 k
( e$ o! I; L* v& s. Y' {
mov bx, cs. k+ D; e% X2 j7 K4 c7 I0 }
lea dx, int41handler2
9 F/ [* e; C; `, {1 C N xchg dx, es:[41h*4]2 a: P. e- g: F! o8 T8 }2 ?
xchg bx, es:[41h*4+2]- y. P+ z9 P; c0 }$ B8 j a
mov ax,4fh
/ ]% B" E# G1 j7 F' k; M6 M' A" m int 41h
( O# v; e- F% F/ J+ {$ g" R xchg dx, es:[41h*4]
9 _9 n5 `; o& y |8 | xchg bx, es:[41h*4+2]- ], @- m* f( w9 @- _
cmp ax, 0f386h
4 l; o$ e3 ?7 h' h0 m. H$ B+ y' P _2 | jz SoftICE_detected
! Z G. g) T2 y! {( S7 K4 f4 Q2 @
, W* v5 ~: q$ Gint41handler2 PROC
5 y% a5 E8 Q5 k/ t iret: u* P" W1 }- M9 z4 x: {8 T
int41handler2 ENDP8 b' j/ T' s6 v" r
3 M+ k% \2 q# q% t$ U5 J( V- H* u. N
& [2 v/ A6 z g_________________________________________________________________________1 k2 A& ]$ K" @' I+ ~* W) @
7 U% \- r1 S9 x) M
$ t% x, x% O. J; j% CMethod 06
" D" `4 q- T# e7 P: u1 _7 X=========
1 A9 B% Y$ Y2 f; w) p/ z9 q! V N/ s4 y w' f
9 B( ?* v, J2 o z4 H5 A; L
2nd method similar to the preceding one but more difficult to detect:2 h. a3 u; L9 j" @0 y* e
0 @; O R1 a8 d, H2 s7 l0 u; M
+ ?1 q$ `( q& uint41handler PROC
+ q, N/ P7 L1 t$ g mov cl,al
/ O0 c/ r; ?9 y! c6 z iret+ t3 d2 Z! @$ K/ v- {
int41handler ENDP
- b: Z) k O4 {- j! n$ m# r* j0 @# }5 \2 r' D2 M4 @
7 E7 {' L( Z% G' C3 ?$ y( A; V
xor ax,ax: ? z# y" O) p2 O2 J
mov es,ax
8 j) w. t1 ?" ~# x! D! S+ m+ l' {* ? mov bx, cs( Q' k! \: U h! n0 v/ u; {2 o* F
lea dx, int41handler* S) i# o9 k, e/ `
xchg dx, es:[41h*4]0 a, U8 x* i. j+ q* |" G
xchg bx, es:[41h*4+2]. R# r7 }/ K0 Q
in al, 40h3 i# |3 S: m2 { ]( b
xor cx,cx6 r$ u/ Z5 w8 k+ Q1 V
int 41h$ z" W$ j& }4 U8 A( R' ]
xchg dx, es:[41h*4]! x# U2 h/ B1 a$ j0 L
xchg bx, es:[41h*4+2]- B6 N! |& ?0 t0 F! H7 {1 {# N
cmp cl,al
) {- A3 S, p3 {" Z4 I* s% V jnz SoftICE_detected8 V0 i' ^# J0 C' T: K& O& S
* X Q% z6 e- y9 R' x2 J- U. y_________________________________________________________________________
: O0 s, O: X# w6 g4 t4 L( {
6 y4 b# n$ N, hMethod 072 s M. Q) Y# I, k- w( Y
=========
7 w/ c0 H; R6 }7 f6 A5 O- M/ I2 ~+ V4 Z' |+ H" K
Method of detection of the WinICE handler in the int68h (V86)
& u" [7 u0 P+ j' m( A/ g/ p4 Y
1 ~6 k# L0 H Q* |% \ mov ah,43h
/ W4 X, p, V# d8 t8 U# C int 68h" L' r/ X: z0 \9 N
cmp ax,0F386h4 |# L: J. `+ v4 I
jz SoftICE_Detected
( s# I* D* ?5 O; `# {+ s) v% L' S @; b* M- K
x0 n$ X; T& A c: s( g' V
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" f# J4 W' V! q% T) U7 _, Q" g app like this:" h% h6 N# a* c' ^% ^$ m5 n" o
V- n, x" `+ ~ BPX exec_int if ax==68
& }4 U9 r* U, Y# c (function called is located at byte ptr [ebp+1Dh] and client eip is
2 s- g$ h8 a- C0 f- e w$ H0 A, V) C located at [ebp+48h] for 32Bit apps)
- G; B7 ~/ ^; W" e__________________________________________________________________________' w: Y9 W& a. v1 M8 I! X# Z: W2 b
& J. t r5 F! K+ d1 n4 z' I+ x2 W) E% s6 s
Method 08
* z5 _6 g: t5 i, f. z% L8 R=========
, V4 U* Q2 C7 M: A3 P" N7 F- x! ^( R i8 J# q, k
It is not a method of detection of SoftICE but a possibility to crash the) F% `2 e9 c/ N$ K) K+ K
system by intercepting int 01h and int 03h and redirecting them to another5 f9 G6 {1 U3 n p' @
routine.2 s' [/ E: `- ?8 M0 c# n
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 ~2 }- V0 \0 ?% n7 s7 v$ D: ?/ D
to the new routine to execute (hangs computer...)& t. d( `, W! |9 ^5 Y' e) F; T
0 {$ x G# ~6 n& M mov ah, 25h' z# |" z$ G! `- e
mov al, Int_Number (01h or 03h)
$ P+ z* Y6 \# [# q- C mov dx, offset New_Int_Routine6 j. O0 ^1 B, W# H& H
int 21h. h f! s! _1 m- h& z
* C* Q4 d) |( r: ?8 _
__________________________________________________________________________
; P* ]: [; H2 G9 T
0 {! l) G6 ^2 q" Z: S+ Z2 z8 vMethod 099 x3 q/ j. s6 y, B
=========
Y' u* b% @" c/ s: u
; o3 w# I" B* o- N5 H* w# AThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- _9 F( C! G4 K' a' z _
performed in ring0 (VxD or a ring3 app using the VxdCall).
" S3 t3 }! w9 JThe Get_DDB service is used to determine whether or not a VxD is installed# M# C& E8 S5 d% m
for the specified device and returns a Device Description Block (in ecx) for
) y* {# h, K5 x0 H1 W( S! J" Xthat device if it is installed.! ]8 d) _. l: v$ Q& W5 m
1 ~) o1 s& d% y& L6 l7 g mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: o7 Z5 C$ _# L% L& C5 J' \
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
% u4 W2 I7 L+ \7 m& u$ y, L VMMCall Get_DDB2 V* r1 N H8 C0 D; d. t$ k7 Z* `
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed' l8 c1 B: v) v P7 a
) F2 q9 ]8 ]3 x1 ]$ K9 h8 C
Note as well that you can easily detect this method with SoftICE:, H' E$ w+ F, ~$ C
bpx Get_DDB if ax==0202 || ax==7a5fh8 g( S* ]/ i, W& i
: Q% b7 ?3 q) z3 P+ R
__________________________________________________________________________5 g4 [" K. t# H8 k1 d2 H# N
7 [; q+ m9 y7 ]1 H" B6 |& c, \# v0 D
Method 10! k/ B3 J' O1 V' Z
=========9 o1 i$ x+ o, b6 {/ A
& w6 B f' Q w, O4 h=>Disable or clear breakpoints before using this feature. DO NOT trace with6 Q' i9 L G( m6 T
SoftICE while the option is enable!!7 J/ {( |' M# L Z9 r, i5 g
8 D3 R6 x1 N9 x/ G% r* {, e7 b! D+ IThis trick is very efficient: ?2 H' ?0 Z' }$ O
by checking the Debug Registers, you can detect if SoftICE is loaded
) ?7 ~2 ^* e" ?( e' D(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 Z4 i5 ^( A, N* X
there are some memory breakpoints set (dr0 to dr3) simply by reading their
9 ?0 r+ J6 F0 O8 o4 h% {value (in ring0 only). Values can be manipulated and or changed as well% P( { Y9 @7 T& S
(clearing BPMs for instance)3 N7 n6 z/ u' m+ o
q/ Z0 Y0 Y4 w- B__________________________________________________________________________
1 }5 L$ C% R5 n8 ~0 F3 X+ Z1 G3 R. B! ?# b
Method 11, b. N1 O6 S. ]: _0 J
=========
$ K% M. S+ B6 r: y3 m$ Y- H2 d$ I
, \& c. b" z0 s4 m) iThis method is most known as 'MeltICE' because it has been freely distributed& R- X: C0 O& p1 j6 ]( w; X! r
via www.winfiles.com. However it was first used by NuMega people to allow6 M$ }, }4 f4 s9 Q2 y+ \; m0 A$ h
Symbol Loader to check if SoftICE was active or not (the code is located
8 d3 f! _% {8 R5 n7 |inside nmtrans.dll).. B0 H, W* [ ]9 e- |
& ~+ W! Q3 A- u ]! s+ ]9 wThe way it works is very simple:$ T- U$ w/ |: f+ T1 ?9 B
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' |7 A! o6 s1 _ u
WinNT) with the CreateFileA API.6 {$ L; x6 O" z' ]% ~
* A! s% a9 [" d1 g( |* y- Z
Here is a sample (checking for 'SICE'):5 Q" M7 s: Y0 \9 f. @6 z+ m0 E+ H: c3 R
- c) y& Z. Y/ B7 _0 u$ O$ Y! t" A) QBOOL IsSoftIce95Loaded()
, i/ j& K) X: {/ S9 c4 r) k{
1 Y. j3 }: p8 H: X3 _: g HANDLE hFile; - Z2 Y5 ]+ x8 |* R" \
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 {9 X/ E7 f! r FILE_SHARE_READ | FILE_SHARE_WRITE,5 }2 P3 J+ B" c, | t
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 H) O% E2 x- g y7 }3 K
if( hFile != INVALID_HANDLE_VALUE )
6 c, A& h b' M {2 B6 U& @* p2 e3 y+ ^' P
CloseHandle(hFile);
% N+ C; z$ [+ k! i3 Q5 z return TRUE;
8 Z$ B7 S7 G5 B4 }) e0 z6 e' B" z }. f' ^0 W8 L# e
return FALSE;8 ^. }2 i9 [! k& H" ~$ z
}
) v; u9 }3 |( K) m2 D
& t- |( V$ m" I8 m" i7 X* [Although this trick calls the CreateFileA function, don't even expect to be! d& q2 P+ C! s& h6 t
able to intercept it by installing a IFS hook: it will not work, no way!5 [4 R% ~9 A; \/ k. x
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
' F J4 |5 E) k) @* C! ^9 E6 U. oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 y5 o5 \3 z7 p7 N0 e' r# o
and then browse the DDB list until it find the VxD and its DDB_Control_Proc$ e$ y9 K M/ z% {5 Q
field.
3 J8 A1 a m6 B; t) RIn fact, its purpose is not to load/unload VxDs but only to send a ! D* |5 Y/ O9 s
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
; n0 g* \# G7 @- cto the VxD Control_Dispatch proc (how the hell a shareware soft could try
. w3 V/ H8 q9 W# Uto load/unload a non-dynamically loadable driver such as SoftICE ;-).: ]! X- B& o R# c/ Q" _
If the VxD is loaded, it will always clear eax and the Carry flag to allow
$ C: ~ H/ K! g, f% i8 P) Eits handle to be opened and then, will be detected.* y m1 u2 n5 J. D* _& F
You can check that simply by hooking Winice.exe control proc entry point6 A* S$ t# b s9 K8 T2 Z+ [! C& C
while running MeltICE.; a' t% D. g1 j ~) P. m' w; x
. w; X6 Q, ^+ i' m6 A
5 D! N8 c, }: X9 n; I! m' i# t$ Y 00401067: push 00402025 ; \\.\SICE
3 T. |( H" t6 O* e- g 0040106C: call CreateFileA
( t- \8 R# ~4 d' ^2 F1 I4 z 00401071: cmp eax,-001: Z+ W& S5 T) X5 s+ _, C2 H# Z
00401074: je 00401091
* t6 ]' b" h( q; s2 u
2 w/ B# A: S* i# f# z/ F' D/ M5 C* A9 I! ?' w- ^
There could be hundreds of BPX you could use to detect this trick.
0 m- ~( w% g) b5 k. R& i8 H$ W-The most classical one is:
! w8 n: z6 D" \" | B BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
* m7 M* s; r# `! P *(esp->4+4)=='NTIC'; |* ~, `! `3 @( E& C. h; v
& v- V) Y6 x3 v2 k! R
-The most exotic ones (could be very slooooow :-(7 @% T9 T( J8 B' O& I$ c
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 4 _- K/ L% E4 C5 ]7 H8 B* n
;will break 3 times :-(
$ h) ?. i/ z9 V+ u( i# b @* v1 Y/ V1 i. r$ T7 \+ `- r# a
-or (a bit) faster: - w! w3 e) T6 @3 ?( L
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')/ c5 ?6 S" K# P7 V
# V0 o/ T/ k( `' V( e/ P9 t1 b7 e
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' & ^$ o( C0 y) j* C; o5 Z& t0 O4 a: F
;will break 3 times :-(
t2 o" o9 N7 t& ?/ t7 H- d+ n! `* D! l. s& O0 c8 ~4 U0 d$ `3 @
-Much faster:3 b3 Z0 f9 T7 Y; x
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'3 u2 Z/ L J6 e
6 c- ^ f; C- b2 h# _Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! I$ [$ d+ \9 J0 Nfunction to do the same job:3 ]/ D% U" \; G! g
- T" E2 |0 u8 G' n) F push 00 ; OF_READ L- V: l9 U2 ]3 W* L
mov eax,[00656634] ; '\\.\SICE',01 W8 y4 n+ U6 z8 E- X- j
push eax& {. l* i2 E' N# Y# z
call KERNEL32!_lopen. X1 K1 o+ ]" _ M
inc eax
2 D2 P% a' J g jnz 00650589 ; detected* r1 w# _9 m: q. l
push 00 ; OF_READ/ `1 d9 I: E4 s2 `6 ~$ q" w% x: ~0 a
mov eax,[00656638] ; '\\.\SICE'
# A1 b" S/ A+ C; m' V push eax
% m8 d. ]5 F: `0 S( j0 X% K! i( I call KERNEL32!_lopen
) [. D( k0 `" g+ b- e inc eax
+ S# Z+ A( n. n* j6 ? jz 006505ae ; not detected
& B6 T6 b" \2 n! t1 }$ C$ n
c' E- N" Y6 _3 n4 K$ Q7 X$ p; U4 M: i/ F
__________________________________________________________________________
1 A1 V* n! I( p7 v5 Z6 d+ \2 W; q& S$ o* ]& W7 m, F
Method 129 e' w/ \+ q: L8 c* x" {9 U& y! h9 B
=========
! U" w2 J. J# S/ x. C
" \5 C: K V& h. bThis trick is similar to int41h/4fh Debugger installation check (code 05' D4 S" ]! H+ p& M" J4 q4 x9 y" @& _' W
& 06) but very limited because it's only available for Win95/98 (not NT)+ a: g5 Y8 `. W% S# e4 |, H
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 R& w1 c# H# c+ D% Z) X* x
# G q# N* Z6 a% W* X push 0000004fh ; function 4fh
8 p! r4 D( P% C- t/ ^ push 002a002ah ; high word specifies which VxD (VWIN32)
2 j( {# V$ R1 n+ p7 w; ]& Q ; low word specifies which service) w G% b5 p _' d
(VWIN32_Int41Dispatch)
8 E2 D9 K, g% t& L# b call Kernel32!ORD_001 ; VxdCall. P8 E* z* d4 y3 o( R7 R9 W
cmp ax, 0f386h ; magic number returned by system debuggers* J3 t- B; h" B3 E8 [
jz SoftICE_detected
0 T* D3 |: |0 G `* I8 C9 \& d& |7 K) A4 y) k" m
Here again, several ways to detect it:
' J) c/ F/ t8 L. |2 r2 i3 N2 a R- i7 P& |. q( O% Z3 @
BPINT 41 if ax==4f
( u5 t/ h* ?+ V) Z* ]* ? c( E- M3 q+ l* Q+ x
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( |5 g( @3 A# c+ h7 p
, E7 k% B2 Z9 `8 P r! Y! o BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
( t, [: l2 S. x: O+ [* f1 I' m y$ k& t {) K
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. E4 a# l y4 D/ L+ B3 J0 d2 T. [8 W0 Z* Y
__________________________________________________________________________
$ V3 S: I$ E2 e" ^; V0 i: V% b' ~7 {# _
Method 13
$ m" Q2 j# l8 k+ w& a6 X% d=========0 p" v9 a8 \' f* q w- ^0 W" \
: U) [$ ?6 e6 j, K) WNot a real method of detection, but a good way to know if SoftICE is4 d' d' Q. y/ F
installed on a computer and to locate its installation directory. o8 u2 Z8 f: N' I. C/ I/ F8 q
It is used by few softs which access the following registry keys (usually #2) :
m7 x' E- F$ Q# v0 M/ Q9 b4 v
" c5 E2 T* C1 n% z$ B+ D-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 {3 n; v2 H6 D. n
\Uninstall\SoftICE
' R% P" v9 B" A$ B9 y6 ]1 M# C ~* `/ P-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 p! R4 } n @% |/ p, a-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 ]4 i. U5 O4 R( t0 V2 s* W( ]* |\App Paths\Loader32.Exe
/ I$ a- V% x. O; |- d
. L& n% |. q6 o' g7 S% s) G
3 N2 N' e2 G( ~5 L5 ]2 eNote that some nasty apps could then erase all files from SoftICE directory
! c8 U4 [* C/ [* g, v( y$ b5 @( ~(I faced that once :-(! E1 w$ S: P, X: S' b0 A
7 `) Q. F( J# X t* oUseful breakpoint to detect it:9 O7 V0 Q& E4 r! a5 N1 A
/ ] W* [( D3 W4 L' b
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" t# F0 v [; d l$ h
1 Q# `. q Q% u# N__________________________________________________________________________
^# u" r4 p' Y* p) d: B2 x" ~2 [& c* m( [
+ e; j" U. d; A2 VMethod 14
) N. _. W1 s: V6 j=========* N; W& U, n, R/ |
! y* c8 b+ {- V3 g
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) K9 [+ B# ]$ ?; _3 \# u
is to determines whether a debugger is running on your system (ring0 only).
8 y8 V" T" q o7 Z4 s" l4 @- O& T ]* r1 E( W0 k4 b
VMMCall Test_Debug_Installed
/ p/ l( r/ X0 C$ L je not_installed
) k! O( @2 Q$ T& a+ {: u$ _7 B8 A q* ]. b: T
This service just checks a flag.6 \/ z% D1 I8 S7 T% U$ K' `
</PRE></TD></TR></TBODY></TABLE> |