<TABLE width=500>7 L5 g% g( N* E
<TBODY>
J# }; D6 g( l T1 G<TR>
! j2 k M5 B2 N<TD><PRE>Method 01 / j( m4 P* z- Z) u; A) P% M
=========
% Z, e5 d2 `% m, J4 y
' ]$ ^# l6 E% d( L0 w% nThis method of detection of SoftICE (as well as the following one) is
4 k- l2 d( r: q2 X4 Wused by the majority of packers/encryptors found on Internet.
! Z# [3 W! d+ T% x: z% F3 }It seeks the signature of BoundsChecker in SoftICE
& c( f* z3 _7 R. _. j p0 E1 Z# P5 C+ F! b3 _4 K' [0 y
mov ebp, 04243484Bh ; 'BCHK'/ j) f4 r! A6 s @8 d: g! b
mov ax, 04h) A3 H9 q' b( D0 t A* u7 l% f0 [1 C
int 3 & Q$ b U* Y% b8 ~( q+ {, p
cmp al,4
+ j6 H' |: V. Z jnz SoftICE_Detected+ G- Z8 T E9 e5 U5 K) f3 a( V. [
- ^4 }$ D4 I$ V___________________________________________________________________________
2 |$ Z: n( v( f9 U, q% O5 F/ b# ]3 F5 Y' D
Method 02
) k8 a+ Z: {6 ~! J/ i9 g=========
3 `* s( r% r. Z% I0 x
( o! {7 ^" @" WStill a method very much used (perhaps the most frequent one). It is used
4 n4 N7 }5 h: k4 B3 Bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,* G# w4 b7 w a8 N- F" }: J2 N
or execute SoftICE commands...) p9 E; p6 W8 M( P t
It is also used to crash SoftICE and to force it to execute any commands
# x2 v( N" F8 s6 h(HBOOT...) :-(( / }# D4 e7 n; m4 o6 }! B6 H
/ o9 g; v- B8 E- c4 s# I7 HHere is a quick description:
% A9 {- K; L H' i: Z5 Q% e- y-AX = 0910h (Display string in SIce windows)( ]% n0 n+ V% Z% Q5 ?/ h
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)' d p; w# }9 {$ {
-AX = 0912h (Get breakpoint infos)# w, V0 }- ]& n7 `* L) _
-AX = 0913h (Set Sice breakpoints)
$ J) i- S* e, q! o/ G-AX = 0914h (Remove SIce breakoints)
4 N5 x& d4 B, y1 B9 z5 I7 t9 T4 f' h t# ]5 M4 ^# ?& D
Each time you'll meet this trick, you'll see:! Z( z' K5 `, B4 J0 G; N
-SI = 4647h
x5 T4 S/ i4 [- p" G; [% t-DI = 4A4Dh
! R! f( ]; h, u5 s) i6 K, f; nWhich are the 'magic values' used by SoftIce.2 b9 C7 J3 ]8 D4 K
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. I- Y& k- ~" _; t
' _$ r3 @8 P) t3 ~Here is one example from the file "Haspinst.exe" which is the dongle HASP
) J1 Z8 ^3 a- D" `. qEnvelope utility use to protect DOS applications:. \) Z3 `8 s7 k# ?1 z2 P% \+ \
- x( c. ^& y& O7 S
3 U! E3 K6 s, P+ G! J4C19:0095 MOV AX,0911 ; execute command. T# c( J+ q1 x. T- w) v
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
4 }# Q# |2 c3 v7 k/ z5 `. p6 d |5 b4C19:009A MOV SI,4647 ; 1st magic value.' V( {+ Z; p1 E7 S
4C19:009D MOV DI,4A4D ; 2nd magic value.. G. J2 H* {' i- s2 c4 r0 G
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
" k5 r1 i% H$ V: f! C( \. K4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute8 r2 B/ F1 I$ k t7 k
4C19:00A4 INC CX6 c$ d9 f) H" @( E; H6 ^/ r
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ O* M+ h( J8 y% R K! x, z
4C19:00A8 JB 0095 ; 6 different commands.
, F0 l7 }2 t" d# q" K4C19:00AA JMP 0002 ; Bad_Guy jmp back.1 X9 {6 b3 V3 d9 d
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& y1 c+ V2 p1 C$ e5 D. K( U9 b( V' K* l$ }& \" {/ f; I
The program will execute 6 different SIce commands located at ds:dx, which, O, @( l. O L: \1 O$ r' p$ R9 ^
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
* L5 f+ z$ D( R% J+ A6 N& s. p9 G1 l( e4 `
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( j* S- g2 I9 b, F3 {( |% i. Q___________________________________________________________________________
- d( y) C, T* k6 e6 Q3 A$ B
5 R$ O; C& E; ]9 c% m' f" H: v% z9 e8 e2 p
Method 03, P; F; Z/ z% \( C+ C! x4 @
=========
) f; P5 i4 `) k. m1 j1 k
1 y9 H( G' O$ D5 J' WLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
7 {: S* u0 ~' F5 E(API Get entry point): [8 A3 J( G1 G! ^0 a, K# B3 B
1 A' g9 d5 o. k$ Q5 H
6 O2 ^& `' e( r* } xor di,di
# o7 E5 d) h/ p/ }5 j2 L h mov es,di& I3 P# R4 r# W% e; T+ m
mov ax, 1684h 5 M7 J1 a: o6 @0 P5 [
mov bx, 0202h ; VxD ID of winice* { y' W" ]6 Z
int 2Fh" n; N r$ U! l& W$ \+ F
mov ax, es ; ES:DI -> VxD API entry point1 w3 p/ X2 c. a
add ax, di
! V- |# M% e, a! K0 Y9 V test ax,ax ~& e: P3 t+ S3 E/ p, l
jnz SoftICE_Detected' x( N" s2 g$ r( V; d
1 A4 Z4 L/ M: Z2 M; O& j4 x$ f3 e
___________________________________________________________________________
0 x" _/ K3 |# U7 i
' j- k0 U% J7 ~ r% I# j) _Method 040 w1 j" h" C$ Q1 I
=========
N9 \+ x3 l% g6 q# y3 N$ J6 _8 z" I" \1 \3 V6 U
Method identical to the preceding one except that it seeks the ID of SoftICE
+ g- I6 p) h+ f- b, b% W7 k9 XGFX VxD.
! P. c1 Z5 u C: k, M5 H3 d. Z" V
xor di,di' x+ @! y. y6 W0 ?
mov es,di, Z! j9 G0 P# A7 H
mov ax, 1684h
$ j* E# {$ k. {" R# U2 w mov bx, 7a5Fh ; VxD ID of SIWVID5 y. ^: |" \ M ?( J0 G" ^
int 2fh
# i' L6 f" H T' U mov ax, es ; ES:DI -> VxD API entry point
1 F% f1 p2 ?4 m add ax, di8 {3 ~4 c2 ^0 o
test ax,ax/ g- E( }3 e% w' G
jnz SoftICE_Detected
3 z4 I! Y7 Y9 J& j, G) S6 A( ]" M$ W2 }8 _- Y0 w8 n7 R6 ]
__________________________________________________________________________" D" Z1 \5 i% y/ V
2 B. \5 X' D! h! _0 }# N6 R
) ]( q5 w- e' l" c8 I0 n" z$ a0 TMethod 05* `0 A0 U) s8 u! ^
=========
- Z6 z/ S, ]/ P0 H2 G$ X4 L7 \9 ?0 N P
Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 `' U& o+ ~5 Idebugger. It calls the int 41h, function 4Fh., H1 @, U* b0 T- R
There are several alternatives.
& N# {- J; O/ c, I" N8 @3 h* H
, N5 F# ~- G6 U/ {9 ?The following one is the simplest:' P' h! [& S, E# u" d4 C+ A+ K- ~
! h3 f* m! \/ z$ j* u; Q/ D
mov ax,4fh
J, y# e7 j! }. d3 ]5 R- V int 41h, v2 U9 G* b3 \+ x
cmp ax, 0F386
7 @- h2 T, ^- u jz SoftICE_detected$ G7 P7 I/ t/ W) [2 T- H
8 y/ P7 C5 i _+ s, p
1 ^# s; \, v0 L; NNext method as well as the following one are 2 examples from Stone's 5 |! ]# Q+ Q" z6 L
"stn-wid.zip" (www.cracking.net):! K3 g% v+ O+ F$ @0 z) M
* j, R3 h1 O; h" _9 X& q, |
mov bx, cs
2 a$ i! N. ~4 u) y lea dx, int41handler2
8 j( u' S, y3 j( ?2 p xchg dx, es:[41h*4]
& d: s. ?; m5 R- S, P xchg bx, es:[41h*4+2]
. G. h! t/ O Y! n' f a# M- n0 X mov ax,4fh
2 x3 v, y r M1 k2 d: c4 ` int 41h/ C4 M; g! \. u3 b7 {# o
xchg dx, es:[41h*4]
) u9 W0 {1 h5 C0 Q- V xchg bx, es:[41h*4+2]
# [1 K( I; Z$ u9 F cmp ax, 0f386h$ m0 K, y# ]- |& s( ^9 H
jz SoftICE_detected; f5 l: h {' j7 q- Y5 S7 F5 e
2 U. J# a7 {! N9 Mint41handler2 PROC
) E$ R+ i, @1 h/ F/ y2 z3 @ iret# U x/ n) \( [5 Z7 o
int41handler2 ENDP3 ]' k2 l1 M/ B, o
5 @% u1 k* J4 V, X
0 B: w L7 |. ?% l7 u1 {3 ^+ U: b* B
_________________________________________________________________________7 K# v a8 r" x
+ ?' y. N! C2 W; R
% Y) p- A9 K) qMethod 06
' N+ F9 J1 Z2 \; C" S+ Q" ~=========% O. b6 f; V' u |1 c0 H0 I
9 R$ ]$ k7 R3 p+ Z. P
6 m6 e1 i0 y/ D5 F) j2nd method similar to the preceding one but more difficult to detect:& @- ]( j* A" S6 @
1 a$ [$ n+ o. J( u4 D) r4 j T( B) l" ^4 \* v
int41handler PROC
4 G7 E* z6 l# u9 O0 i; C G mov cl,al1 A' R* ~7 {" D N3 h6 Q: t
iret# b# u9 _* k3 W2 A4 _9 V4 L
int41handler ENDP9 U1 s2 J, A' B+ W. d1 x4 d
4 Y1 j: A0 o: r5 e4 ^, d# _6 Y5 L w+ H
" Y: U w+ l9 ~0 s- ^* G9 n xor ax,ax
; G% t0 R. n, k/ J6 Q" P mov es,ax% C3 o# I0 r; \' w% w: P
mov bx, cs
+ }5 J/ g7 z& k8 {& _) q lea dx, int41handler& c0 w+ h. S) e+ [9 m
xchg dx, es:[41h*4], V# x# n2 u! Y& S& n _
xchg bx, es:[41h*4+2]- e$ J6 I/ G" G4 @8 ?
in al, 40h
2 P7 _: L. U/ ]7 l, V xor cx,cx5 X0 t6 `! v1 C6 I
int 41h
2 ?" V- K6 O& Q+ e# e9 ]' J1 F! R q xchg dx, es:[41h*4]
9 F, {2 t8 n3 M3 l xchg bx, es:[41h*4+2]
N7 j$ S3 h. C$ p* s cmp cl,al) c: H. E3 g2 ?' N* v7 j. Z
jnz SoftICE_detected
& c0 U: H' j4 m5 |' A: c9 x o5 t0 i) C/ @3 A
_________________________________________________________________________4 C; J/ t( ~6 {
3 Q, A; z- L9 }) [' o5 NMethod 07
; @8 N# z8 K9 k. r# [=========
3 [4 X7 ]( E7 I( e- ~5 a3 W8 {
g8 J. ]) y) g0 J% cMethod of detection of the WinICE handler in the int68h (V86)
% d4 S+ D) w; [
5 A1 v, K+ Z( w% H' C' q, S( ^ mov ah,43h2 ?% y5 M c; e3 A5 C' U
int 68h
8 \5 u% _" Q7 m8 U, e# G5 D1 [ cmp ax,0F386h
3 p7 [% i4 J; _+ w/ ~# A jz SoftICE_Detected
7 s/ A2 ^( W4 c) n7 P3 \0 I B) ?1 ?6 f
0 W$ |8 F8 a- o6 h
) J- c: F/ ]/ J=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
# b% j% O4 `7 ?/ i app like this:
9 l; O* N8 W* \5 u& p- `7 k
. ^7 K7 ]8 \* i! L BPX exec_int if ax==68
2 ?$ J8 [. |2 ? (function called is located at byte ptr [ebp+1Dh] and client eip is
* N/ B# W! s% C: W! ] located at [ebp+48h] for 32Bit apps)
( h" [2 }' h* J E& `__________________________________________________________________________
$ I. ?4 d( s; C0 ^* w! @
{ V8 A, G( v. j
, i. x( p5 z8 Z T! VMethod 08
9 ~4 u# y. j' {# U" }=========! r3 _2 S t: B! E4 V
8 d/ B' K. D. e0 m& I) M; K+ k3 S% Y
It is not a method of detection of SoftICE but a possibility to crash the
$ d2 o$ y: c) v4 b& y8 }+ o7 _! lsystem by intercepting int 01h and int 03h and redirecting them to another# N# d, l- a4 ~1 n+ e
routine.
. L3 y- A: B( W1 kIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points5 r. {3 E; @: ^
to the new routine to execute (hangs computer...)0 ~ i7 p( I" j! a+ c/ I' @
& e0 T+ L7 S" [( v- D9 m mov ah, 25h& T1 r/ N0 _. O3 x
mov al, Int_Number (01h or 03h)
$ ?' O( W6 a; I9 L mov dx, offset New_Int_Routine
+ {4 f( c' f; L0 g3 l+ {) P int 21h
6 K! M$ t9 s2 N E: d# g! p2 z+ q
b- A0 ~4 Y7 L" ?4 a6 g+ s( `: ]__________________________________________________________________________ O4 I9 _7 O0 j; F( |& B. `
7 ^% ?- [% ^& A/ X, ]+ x6 s3 ~Method 095 {& a, _ Y7 \$ b, o F
=========+ A! j r1 W2 I" T0 D
; y* t+ _5 _& L$ n: q- uThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only% I5 o# c0 [ ?. a M
performed in ring0 (VxD or a ring3 app using the VxdCall).3 S+ w" b' o0 | `% {8 @( e
The Get_DDB service is used to determine whether or not a VxD is installed/ |( T6 |1 C. R3 W
for the specified device and returns a Device Description Block (in ecx) for
# _+ _7 O& o+ A' V2 Qthat device if it is installed.. ~+ Q1 I: q2 ~# h
! T. e; s& D' N( [) |! T, L9 `: o mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 q' x' w- }/ t! q3 K* a mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& B5 a" t) }' i9 g+ O% v# v* [ VMMCall Get_DDB
; b6 N O. W5 n4 w: A mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed3 d1 q8 a/ [6 h" V9 F
( @/ O2 I# a; HNote as well that you can easily detect this method with SoftICE:
% p1 |4 E4 @2 u& K+ w( ?7 n$ A e0 b bpx Get_DDB if ax==0202 || ax==7a5fh
! r, S" `$ w) R R
) J: @* \: {% p, z! Q8 u i__________________________________________________________________________) I9 Z( N( a* b; a2 W3 H# l/ @
5 g# } m# i* W7 A. O* r- kMethod 10: u8 _' `3 g1 B( Q/ s# C
=========
6 T `& I _ x; ~
: s7 A' R s o=>Disable or clear breakpoints before using this feature. DO NOT trace with1 X; @+ @: Y4 [
SoftICE while the option is enable!!
5 ]/ W, O! B# f" a1 K6 i* e, a g* I* D& _& l+ S" _
This trick is very efficient:
2 v i/ T( X2 fby checking the Debug Registers, you can detect if SoftICE is loaded
, r/ U4 a& v4 |! [. x5 o( ^(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 G1 B1 \2 ^& u' E8 V: a8 cthere are some memory breakpoints set (dr0 to dr3) simply by reading their; B0 v3 g9 F; B$ A
value (in ring0 only). Values can be manipulated and or changed as well
2 S! ~$ {% y) J7 Y(clearing BPMs for instance)( K, B0 Q7 L4 x& K. v
$ C( F D' V( \/ m$ @) I1 b6 `
__________________________________________________________________________" x$ e, r5 L2 s5 Y, O1 K" h/ Z) k
" m0 ^/ O W5 O3 RMethod 11
0 Z% h7 t8 _* x i=========2 c: K9 N a" W: d" b
, Z6 E+ ]8 W# q2 h0 }
This method is most known as 'MeltICE' because it has been freely distributed
8 z$ X# w. F t; X+ V" Hvia www.winfiles.com. However it was first used by NuMega people to allow" B9 h: u/ x3 }& w. ~9 a
Symbol Loader to check if SoftICE was active or not (the code is located
\# C6 y# i) s* j; |3 cinside nmtrans.dll).. i! @, A# b. n- Q9 K
4 V6 s, I, E5 ]; ^
The way it works is very simple:: N! p# ~6 @; _4 i# q
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
" U/ H; L$ ~* W1 V& I' Z+ N! rWinNT) with the CreateFileA API.
9 x6 R! E; i: ]1 L( |) k7 P
/ r2 r0 P6 |* s. nHere is a sample (checking for 'SICE'):
! A5 E, F0 e* l0 u' _. b+ x0 C* }! @3 G4 a3 j6 L; h. }/ D1 ^: ^7 p
BOOL IsSoftIce95Loaded()/ C4 a L5 m- u, T" r1 @
{$ B. V0 V7 Z7 P: p/ a7 l% m
HANDLE hFile;
* V' h% K8 K% |" l' b( E hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! X( f" Y1 T/ l FILE_SHARE_READ | FILE_SHARE_WRITE,8 w3 B$ g/ D% D" u
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); c( f4 B- u: y# H3 i' d5 ], F
if( hFile != INVALID_HANDLE_VALUE )
9 }# K2 l) g/ C+ L8 T/ V {( B- c2 p, Z3 u! G* p
CloseHandle(hFile);
& a* y6 z! c$ I- ~2 G w6 E return TRUE;- k8 L' D( h B ]
}. T- p! C+ Y2 x
return FALSE;
! F5 d( z8 F: ]% O2 O$ }}
: K# [2 t/ Z5 C: I: ^0 x
! G$ s5 |- g- D- xAlthough this trick calls the CreateFileA function, don't even expect to be. U! ?5 C+ m. d4 y
able to intercept it by installing a IFS hook: it will not work, no way!9 B4 h+ n" V! r. d' L6 }( B
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
6 Y! L$ g. ?) x, s' C" y7 U4 K1 tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* v& M& r) ?2 p' @" R- Q, n4 fand then browse the DDB list until it find the VxD and its DDB_Control_Proc
( X/ u8 m" s5 c* ]% [. J( d: g0 ufield.( M7 ?9 e1 l- P4 R6 F
In fact, its purpose is not to load/unload VxDs but only to send a
. d4 F' R4 M, v! zW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
|# B O5 D+ Gto the VxD Control_Dispatch proc (how the hell a shareware soft could try
; z; a$ ~' {/ l( k7 Ato load/unload a non-dynamically loadable driver such as SoftICE ;-).
+ H* z% M2 j" C' U' j* \1 F% v) LIf the VxD is loaded, it will always clear eax and the Carry flag to allow
, W4 N' b& k' Uits handle to be opened and then, will be detected.
1 O/ h- k, r/ _$ a4 QYou can check that simply by hooking Winice.exe control proc entry point
- g1 A9 ?) H1 U% S% h" E9 zwhile running MeltICE.
$ g1 s8 D$ s) p2 q
: T! B9 t8 s3 {4 D0 W9 A6 B
3 Z3 O6 b+ a( u d0 l0 o( P4 @3 X4 Y 00401067: push 00402025 ; \\.\SICE% F2 q0 ]) x$ z- w, T* \
0040106C: call CreateFileA( i" w2 b' L2 x; Q* k3 A
00401071: cmp eax,-001. N/ Z# J* ?% Y' O- G0 e6 N5 X- h
00401074: je 00401091
+ e) J: `6 x2 I; v* j* b
( d- r; |3 d8 h& ]' F' v6 V# @# S3 V5 M" A& y$ X1 S
There could be hundreds of BPX you could use to detect this trick.4 F" L' F: W1 m+ ?8 `2 h+ _
-The most classical one is:; D( T( H9 T" d, p7 f' X) h
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ W( T4 k0 C9 D( Z6 G4 N- j *(esp->4+4)=='NTIC'8 e' \% }" ~) ~; k1 @
. S9 O8 S/ c# V+ o U! J% S
-The most exotic ones (could be very slooooow :-(; ]% R' A/ s- ~ w% o$ U
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') y" r8 W# _3 g. M' P% }
;will break 3 times :-(
, H# D1 s. W4 ]7 p9 ]( B* t7 D
_2 A( F) S: `) D9 V-or (a bit) faster: - p8 B0 l7 @9 A+ [: a
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% l; z, c9 |7 I5 J: N9 |
# g, n) K3 V- g: A
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' * F/ b1 X n% v z% V$ a: C
;will break 3 times :-(
1 m/ `+ S* J; ?0 c2 \& `) l7 [# N+ s7 N9 Q+ L" j
-Much faster:
' j6 S4 u2 [" ?& z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'9 ]5 ?! Q" \+ h3 G- S; m1 w6 y
6 A% P8 \- f$ Z5 H J3 y
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
$ U. \0 S- |9 l7 Zfunction to do the same job:- `3 }& @8 s2 J4 R5 X, g
9 C- j4 P& w! x0 n6 v8 | push 00 ; OF_READ6 Q" {2 a U" P, ~9 P3 W
mov eax,[00656634] ; '\\.\SICE',08 T# {" X$ G6 J8 S! R' U4 b1 M" c4 D
push eax
' d, ?% F/ L o" \: o call KERNEL32!_lopen
" o) F. ^3 ]- v% N- V) ~7 \) }- P6 r, _ inc eax9 x0 _" N: ^5 ^3 P* c6 m; N1 C
jnz 00650589 ; detected
, j, X7 q/ Z) ^/ H. t9 a push 00 ; OF_READ
" l% G: d7 n+ x. V mov eax,[00656638] ; '\\.\SICE'
, }( P/ r' _6 l! J push eax/ U4 s4 @" z$ m* I% M( O
call KERNEL32!_lopen
+ d# Z. Q3 b- c4 K) X3 T inc eax4 I5 i9 S: b7 W' U% S4 \/ [" p
jz 006505ae ; not detected" I1 h# v' u6 a! }
8 x j& |3 l7 J/ C! o
0 t2 B0 R* ~# @__________________________________________________________________________
, i' Y0 z- o( k) l: W% `
$ \( M/ ^% b% n6 w: R* J& o- M8 `Method 12, [+ Y: R3 D& g# m
=========; Z K& T6 a L g, E+ e6 H0 ` \
' w/ I J0 B: P( @This trick is similar to int41h/4fh Debugger installation check (code 05% m2 @, y5 Q6 `1 Z& Z
& 06) but very limited because it's only available for Win95/98 (not NT)
/ c( l4 }4 S3 m% l3 nas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
" p; k8 r6 x6 U( ^* @0 I8 {
* [5 x2 j- G6 ^6 k% [- [ G push 0000004fh ; function 4fh
, j4 `! g, V" O5 k push 002a002ah ; high word specifies which VxD (VWIN32)
z. |: W/ ]! g' b# X4 I ; low word specifies which service
! [! X; M# g* o% t, h$ ?: A, N (VWIN32_Int41Dispatch)! o% |9 a, Q2 O5 m4 S' W5 Y
call Kernel32!ORD_001 ; VxdCall
7 }# i, J: y% ?2 j1 f2 l$ \; o: u cmp ax, 0f386h ; magic number returned by system debuggers
3 L* u1 c* Z: g! c jz SoftICE_detected
9 v7 i3 A1 K$ ^3 d
+ k5 C" K; S2 \2 U* X5 LHere again, several ways to detect it:
$ U5 O2 u; k4 L6 x. j' z: h
8 B! V8 E' W% w BPINT 41 if ax==4f
+ R8 H ~7 o5 Y( J5 W4 I% u3 ^' } @& n, a5 M5 q5 u0 A) b
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one7 q9 e6 A7 G. g b, C8 t# z7 o
, [8 n) i! S) ]4 p8 ?4 k& C BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 }/ l- H$ |9 H' x4 e% m. {( h; @$ M3 F! B: Y2 c3 o) d( s& `
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
4 G4 `+ {; [) ~2 }* k( ~2 p4 i$ S; @- \" ~3 b- x
__________________________________________________________________________
2 H+ W/ l- e9 `; l9 ^! T( P8 n/ D: v" N3 m& Y: Y4 `
Method 13+ x5 I. }; Y" e8 v. n1 A
=========
" n# l6 @# p+ S! y2 }+ r8 b g; o; E
, E$ y z6 H# v1 R6 GNot a real method of detection, but a good way to know if SoftICE is! l5 {) v* y' Q& N$ d
installed on a computer and to locate its installation directory.
~% m$ D; U. x' ZIt is used by few softs which access the following registry keys (usually #2) :' j9 Y1 h7 \4 c' D0 x+ y% s; K
& m2 R, A6 G+ ^1 r# O8 Y-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% S! r2 b) J" D\Uninstall\SoftICE
9 y; ]5 }3 f9 C: T2 k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% E3 [2 A( n8 t: ^+ Y5 A
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 { y2 q# S( y/ }8 Y
\App Paths\Loader32.Exe, R. a) v; |0 w3 s. d# z0 |
' y7 o8 I) T, \0 Q% _& M z1 i% a$ Z3 n
Note that some nasty apps could then erase all files from SoftICE directory0 M4 e' f2 k. d7 E0 ~
(I faced that once :-(
' X5 Y# c$ E; H3 Q2 e: D* Z$ y
$ L" {, m7 q& X, GUseful breakpoint to detect it:
) Y/ N# w8 S/ Y* k& O
" v/ u) } \1 h* C$ [7 M2 W1 T BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE' D5 r" c( ?8 v, X( B$ B
2 _3 c6 S* G C& U4 V__________________________________________________________________________
1 ^- X& e# v. i3 Q; b0 a1 r
' y6 \, Z L1 ^; H4 M! S
0 m6 [( \& R# q; w; k% y9 sMethod 14
. J! J* R+ p6 F3 [# z=========! a a$ s1 ?& d9 d
T& P2 f8 {; zA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose" `! x+ B F6 N
is to determines whether a debugger is running on your system (ring0 only).
+ v, o1 [0 F$ R- ] O; Y
& ~0 [# E" W$ P) _, ~% _ VMMCall Test_Debug_Installed
; D7 i$ ^- |" i5 P" x* P3 W1 _4 K je not_installed9 ]) s) @2 x; `9 Y
8 K) w- N* F. B$ K2 Q9 S$ Z! i: }# d
This service just checks a flag.( T, h$ P" u8 ?, o7 `) _
</PRE></TD></TR></TBODY></TABLE> |