<TABLE width=500>7 u* N- x$ h+ r$ w# w& s' W( z
<TBODY>" C1 b- a6 X [# ~+ |3 A' E
<TR>
+ z; A: `+ m2 I2 M N<TD><PRE>Method 01 ) ~0 d7 L7 X( i$ m
=========7 t, n4 x1 L2 T; M5 ^0 d6 e/ V
* O8 R" P: d+ a, R+ {4 W5 l
This method of detection of SoftICE (as well as the following one) is
4 h* ]' v. o1 Vused by the majority of packers/encryptors found on Internet., O8 |9 |, F( {5 f% J
It seeks the signature of BoundsChecker in SoftICE9 w8 P- z, {' J3 ^1 R+ \$ _1 d! J) ^
" ] m% W+ g: j) P mov ebp, 04243484Bh ; 'BCHK'
8 ^, ^; T7 F/ O# d6 [ mov ax, 04h% M2 A' R6 | i$ [7 h
int 3 . E3 V7 m5 E% F+ v% E
cmp al,4- V/ ^# O& X- f! z2 w" \* ~
jnz SoftICE_Detected' T% J, A* N& R% P
' _0 p3 |0 @7 K- s; T ~# I6 G
___________________________________________________________________________' G4 a. ]% q, x" R
8 ~! p* K/ E! G t# G
Method 02
) U3 X2 {2 y" C9 O5 q- l5 Y=========3 {9 Y3 V" C# p, p! q
6 O% _3 _/ c' j4 LStill a method very much used (perhaps the most frequent one). It is used
% f# `: N9 S5 [% E: m- qto get SoftICE 'Back Door commands' which gives infos on Breakpoints,0 L9 V+ F; S6 J
or execute SoftICE commands...
1 I1 @7 D+ L1 f7 t$ o1 mIt is also used to crash SoftICE and to force it to execute any commands
T0 z1 n$ v8 T& q, z) q+ R(HBOOT...) :-(( ; m5 E! y3 V$ a* r2 c
8 b- N- k/ l. n1 x! OHere is a quick description:( H- F6 d6 D+ K7 l# s; a% w
-AX = 0910h (Display string in SIce windows)
8 E; A8 R. n! i: C-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
$ ^" F; Z/ m" y h# j2 u-AX = 0912h (Get breakpoint infos)5 M5 E# ~0 m6 V$ q; L9 d$ o0 w/ ?
-AX = 0913h (Set Sice breakpoints); q0 ^! k: p9 f* R. y S
-AX = 0914h (Remove SIce breakoints): ]4 I# J! B' D8 W5 H1 W
: ~& p: h( R B# v% }$ c& J. vEach time you'll meet this trick, you'll see:& X2 r$ }: P) Q2 @ z
-SI = 4647h
: P. {6 t+ _" _, F5 M-DI = 4A4Dh
, h7 S( X2 p# ?2 z1 [Which are the 'magic values' used by SoftIce.
( M7 ?7 ?# @- L1 {- n: qFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ }( ^7 [2 O7 w3 ]
0 P. g6 G- w' GHere is one example from the file "Haspinst.exe" which is the dongle HASP
2 a9 N$ G3 H( y- d3 o# C$ t& cEnvelope utility use to protect DOS applications:5 T" m2 c/ G/ F6 T- j9 t2 }9 O
2 P5 y+ J/ O5 t e" u. k& `$ u
0 E, r' ?& J+ M0 w0 Q! E t4C19:0095 MOV AX,0911 ; execute command.
1 C0 @/ `5 F1 r' G. w4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ j$ @ o$ e) X% Z4C19:009A MOV SI,4647 ; 1st magic value.
; f8 q: Q4 O( n7 o1 n/ \4C19:009D MOV DI,4A4D ; 2nd magic value.! v/ ^: o @; h2 _) H. }8 Y
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 D. z( Z$ o8 F" u! L2 h
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
* X3 g3 d* C! Q% C( K; b4C19:00A4 INC CX2 {" O/ }) E' V& a, ^
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute) f9 A; R1 z& o; G& E8 u& i1 i
4C19:00A8 JB 0095 ; 6 different commands.6 n% ~, S+ v+ M c9 J% @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
3 ?6 r$ U1 L/ m/ C! A7 q4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
/ h# o- Y1 S/ g q# P
) D: L8 P1 v2 P3 W2 d4 `The program will execute 6 different SIce commands located at ds:dx, which
( Y: M1 P( J7 `are: LDT, IDT, GDT, TSS, RS, and ...HBOOT. C7 U) t3 U8 d- @* Y
' R3 H% |. M- G$ h3 w. G: p
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* t! X% q4 p8 E* H: Y* @___________________________________________________________________________
& Q- a/ x* ?0 X7 J, a0 q& W! E; x0 E! k. T
; z* A! D, e5 _& d' W3 kMethod 03
; Y, S. I+ g+ x8 E, L4 x=========
2 g7 @- J$ {" k
, y7 R4 t1 G# |* F" u0 GLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h- S& G9 M; w5 e3 j
(API Get entry point)
+ T( r$ t. {# l3 E" i8 ?
. [( o5 K1 {( j% L* g7 K$ C8 y
: |5 {) i) |4 E9 `" Z! ?: u xor di,di- o( W" e' G6 J/ F4 q1 G
mov es,di4 P: Z( N! ?9 j
mov ax, 1684h
9 g3 w# E% q0 o/ X mov bx, 0202h ; VxD ID of winice
/ _; ^3 {- R1 q4 }2 b int 2Fh% k- `! \$ M- J6 b* `
mov ax, es ; ES:DI -> VxD API entry point6 H5 _' E; X: y# k+ @
add ax, di
) @3 P) q" M3 X% S0 ]- h J test ax,ax" H* D2 v6 B4 K& L1 E
jnz SoftICE_Detected. M% h. A, X3 C/ n1 K% C
( Z! k5 E e: P' ?___________________________________________________________________________, y. D5 i C* Y f" x# p# U
& o4 A V# P. O* r# U1 m
Method 04- O% k) w$ I4 ^- e+ C
=========8 ~3 [+ }: H$ Q* w- ]3 @" ]- Q
' E; V% ]' P0 K8 {3 n- B/ E5 KMethod identical to the preceding one except that it seeks the ID of SoftICE
+ t8 |2 N- f7 {9 SGFX VxD.
& h( Q V! R( e) w4 W ?4 y+ _- d) q
xor di,di! i7 w# N$ k" T7 d+ L7 |$ E( W
mov es,di
% G# W! G8 a+ R# i/ R mov ax, 1684h
8 O' o" @8 K( G8 \- [ mov bx, 7a5Fh ; VxD ID of SIWVID
! a$ L, X% L+ z5 U4 G g int 2fh/ v+ M" i8 P! m1 O' z5 Z: P
mov ax, es ; ES:DI -> VxD API entry point
5 u% R- D! T8 X5 m8 p* X9 f add ax, di# h6 d+ U! K/ t
test ax,ax" A) W! J. |: {) b* q& V9 N
jnz SoftICE_Detected
5 t# x1 p4 c/ X8 S& v
9 u5 A. g& Y2 F2 v; g__________________________________________________________________________
7 s- B- y2 [ i3 {- j0 r' Q0 W! d* C. T% ?& S/ q R! F" q! |- p
1 \1 g5 C" ~. E/ iMethod 05) K7 c. i7 M& T
=========* g2 l/ j+ X$ `+ V b; c" _
, U. ]. y0 ], I% G9 V* C; T' B7 TMethod seeking the 'magic number' 0F386h returned (in ax) by all system
2 N* S. z8 ?0 s9 Q/ B& e* ?debugger. It calls the int 41h, function 4Fh.
$ @. T, M* w7 M, R, r# O% [) S% DThere are several alternatives.
8 e) ^% V4 d# s! M& B8 f8 N, s3 X6 j9 [ b# V S% z: F3 N- w& G
The following one is the simplest:2 f# \5 ?% b" Y; `' z/ q
3 j/ J) J) v( J7 p) h# l3 o mov ax,4fh
3 A% n. G5 G# q- C5 W int 41h* I/ G1 Z; E8 l$ L P
cmp ax, 0F386% c2 S8 N# Z! C* `* s- E
jz SoftICE_detected
4 `' S# |7 J% E4 k, J J0 ^& W. y5 D& K! C+ r6 |& A
: f, g# U! G) g; BNext method as well as the following one are 2 examples from Stone's [( _$ h0 [$ s8 R* O
"stn-wid.zip" (www.cracking.net):6 q' {9 {1 w( E5 `, f+ {: J
) Y9 O& ^; u! f+ D0 A% Q/ T
mov bx, cs
H' R7 D2 M' c1 H+ j. b$ M lea dx, int41handler2
" f' _0 f; o, q* Q. e/ K3 f! i xchg dx, es:[41h*4]9 W% Q( L0 @3 G) h0 t5 R) V$ _
xchg bx, es:[41h*4+2] _% p3 k' U; ]
mov ax,4fh
' P, V3 J \9 Q% L6 [( d7 N4 w" l int 41h
% U3 x2 T6 W. k% R/ H- s8 p. E xchg dx, es:[41h*4]
8 ~ h/ d% x# O) W8 n+ @, d7 U2 ` xchg bx, es:[41h*4+2]
% y; t: g8 Z, T cmp ax, 0f386h' @/ {6 u* j) N
jz SoftICE_detected! z L( D1 e: Z4 z* @) X
5 |+ d1 `( ^# B5 O) {4 v0 k0 mint41handler2 PROC g- O3 ] W' u, f$ A: n
iret
+ M5 Q( W; P# p4 k8 M/ [; Qint41handler2 ENDP( b6 n7 g f2 e! e
6 U; p0 Z5 k/ W5 z* ]
3 l4 V/ ]/ B# B
_________________________________________________________________________) t. f1 q0 }/ E% @( m( L
7 R3 ~5 }9 V3 c4 S' s* o: {
+ l1 q% U' r0 q. @8 J: xMethod 06, L, X& d% x* Y) @& T5 z
=========
8 r( s5 X5 j9 j/ o* }, `! {- u/ a& g* A: K. z
% w2 `- o+ c$ l$ }" m9 _2nd method similar to the preceding one but more difficult to detect:
8 @* w8 w2 {" k/ i& Y+ B
3 M9 Z- v. U$ D7 w
: A9 k) `: X. D& a0 hint41handler PROC
- Q# j7 A) J+ h# q0 r mov cl,al
/ @2 h3 Q' P' A3 ^ iret
9 {, C( L: p2 n% r' ~! S) Yint41handler ENDP
& [+ T2 q: e1 [! G. F( s5 i/ i/ j, g" Q4 G
+ O9 O3 j' ^0 H, i9 D, q9 M! ^5 x
xor ax,ax
! u6 Y! ]3 \ e. c& @% V mov es,ax: Y1 B& d; Q/ a: E
mov bx, cs4 ]# y4 L) n' Q4 m. }4 Y
lea dx, int41handler
4 [+ k, |5 B! O' Z! Y' { xchg dx, es:[41h*4]- s4 k) m& r+ b) {1 v) F* K" s
xchg bx, es:[41h*4+2]
+ ]8 R- r7 j. J$ K in al, 40h
: z( l2 u- Y" `$ x xor cx,cx1 a6 x5 B" Z1 d- e
int 41h
5 d7 k6 H' \. D+ L& \ xchg dx, es:[41h*4]
& r H( L( S; ] xchg bx, es:[41h*4+2]! `0 [2 Y+ T: N/ F R" q# O
cmp cl,al
3 s5 r3 p' I; W' {& V jnz SoftICE_detected8 d) W( l- }6 Y
Z; K( _) b+ Y
_________________________________________________________________________
- Z5 K4 _. h$ L! H: ~8 f, |( i$ b( ^4 K4 F0 r7 [8 ?
Method 07
% L" Q k5 V" X6 S: D% {+ e* e=========5 p, O. `. ?7 P0 ^4 o
& n0 n+ a) q8 Y2 y8 Y: E& f. @Method of detection of the WinICE handler in the int68h (V86)# {1 E# {+ U6 ~1 l6 u8 @
+ p& E8 f$ u* F# l8 t9 v mov ah,43h
* F0 i9 |+ g, V: z$ R6 x int 68h3 \2 S6 q" f) i- u" v2 u' ]
cmp ax,0F386h8 H3 p( x( b- d6 S
jz SoftICE_Detected
' {; v7 ]% E" Q9 q. c) J% U! n$ R: Q
: T% g! d) I, ~& o=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 H: p1 ~/ |& t' G& K% k1 Q app like this:2 b( e4 d9 y( d+ ]7 K
' D9 L+ e; Y. e- }: h9 T BPX exec_int if ax==68
$ ~$ T6 i4 S) B4 Q (function called is located at byte ptr [ebp+1Dh] and client eip is- c6 Y! o9 ^6 d+ i2 e
located at [ebp+48h] for 32Bit apps)
. {, O9 P4 O, B& o) F__________________________________________________________________________3 V [7 k) a) J* R
% N7 ~% v$ @! Q% z u" c
8 G% _; c. g8 _1 f0 GMethod 08. f, x& u4 g* D- j" n& R1 H% w
=========# t: q- O4 G6 g) o8 R* O6 ^
: l1 V( t& l' e0 ^% L9 j2 A
It is not a method of detection of SoftICE but a possibility to crash the1 ` _; \. G7 I
system by intercepting int 01h and int 03h and redirecting them to another3 Y: f. C+ z: g! q/ G' y* E
routine.& p7 i9 L+ e2 N; t$ ~2 }" T0 [
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points/ M7 q" H9 l$ `. K6 ^$ K# }
to the new routine to execute (hangs computer...)) [& Q( H% X/ Z3 {+ q1 {- @
! J5 p7 I% \! | o2 G7 v( q) G( H1 ^
mov ah, 25h. o8 C8 Q& Z" P8 @
mov al, Int_Number (01h or 03h)5 J4 i: t9 P p- ~4 |: F
mov dx, offset New_Int_Routine1 z6 w: J0 z# c. o# [8 r y+ g
int 21h) A1 r% v* u( k% F" a. ^
( G; f+ ^. t) @. y3 B# H__________________________________________________________________________
$ e1 F9 \5 F% ^. r1 H
, L9 A* I, U- m6 n; E$ h3 hMethod 09+ H! F" t- j/ S* e# b! S* y
=========
* A. w6 `6 ~6 J* X& d1 i* x" A) H" M5 r. T, w; }) ]; s
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only7 p' K9 L7 a6 z( E, j2 d
performed in ring0 (VxD or a ring3 app using the VxdCall).
- x- e! _' d, S7 b1 a; A! _The Get_DDB service is used to determine whether or not a VxD is installed- I. D, {4 I7 t) s- m# L
for the specified device and returns a Device Description Block (in ecx) for
, `* L/ l/ B( h; ethat device if it is installed.
* O; s* r9 K2 s' W, u Q& ~6 Z' s( V$ N% e+ @+ {
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 e1 O& `! y8 g/ o, @8 z O2 J mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)6 d; s# y% W* Q: q% a5 R; J
VMMCall Get_DDB
" P9 k b" l0 A2 E! g: o. a mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
$ `+ g* t( D4 I
% J. H1 q4 i; \9 r3 JNote as well that you can easily detect this method with SoftICE:
: L5 e4 j+ j5 C1 k, v# Q. p bpx Get_DDB if ax==0202 || ax==7a5fh
. m1 B% E: [7 p+ o* M/ l- H+ ] \+ r0 Z: F ?6 b" b2 [
__________________________________________________________________________
6 H( a4 D X; K- @: o# O/ N& T0 z# G; _/ Z' L) ^8 Q7 {, c5 m
Method 10
8 S+ a& q/ l Q' \=========5 A, W1 F$ M3 B Z1 a# N6 d- B
7 [* A! b* O& A
=>Disable or clear breakpoints before using this feature. DO NOT trace with9 w+ P9 H' U M
SoftICE while the option is enable!!
2 L9 f. N; Q% N& O, M7 o0 D/ l+ b1 G" z; ?: N+ M
This trick is very efficient:
( ^. L. b! k. |9 Kby checking the Debug Registers, you can detect if SoftICE is loaded& l% g* b* _/ K! v2 L
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if1 u/ _3 d( f( s& L& x4 q% m' B J
there are some memory breakpoints set (dr0 to dr3) simply by reading their' L; T7 X" |( F% R+ t
value (in ring0 only). Values can be manipulated and or changed as well. \1 @! M9 Q+ r% l1 U8 r
(clearing BPMs for instance)! D/ Q* J* [8 @5 W
% Y0 Z( N: {: G& X1 o+ e1 f" _ d
__________________________________________________________________________
# c% F, q3 b- J( g- Y/ J1 \' J- t+ R! r& u( \5 |# i6 O
Method 11
2 _# u, S, h+ n8 L* R* H( P=========
) D+ g1 T4 v6 o' ]3 C# i& [( ^3 i7 e/ t4 h
This method is most known as 'MeltICE' because it has been freely distributed2 q, k4 B4 f2 Y6 ~0 d/ a. T
via www.winfiles.com. However it was first used by NuMega people to allow
1 D* D1 N+ N! [/ ISymbol Loader to check if SoftICE was active or not (the code is located5 a1 L$ P0 j9 |4 K1 R' ]
inside nmtrans.dll).
3 a; P$ y i3 Q) x- _* |0 q+ B/ X# o3 X Y/ u4 b- j4 m5 X' M
The way it works is very simple:, o3 r. `) ]* W3 i# |! j0 d
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 \9 g( T8 k- H: ?7 bWinNT) with the CreateFileA API.
2 i8 |, W7 P4 ~& c$ b* l! J: z' |+ \+ [: t# c) F$ }, N
Here is a sample (checking for 'SICE'):# P9 C/ k0 ]- ~8 l: b
g5 j5 Z% t* }) s8 @ d) S% d nBOOL IsSoftIce95Loaded()
6 R8 {7 E; A( e' h4 h{1 W, Y+ H0 x. L
HANDLE hFile; 5 j6 G3 q8 |% ~6 @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,5 l3 f* U5 G U: l; E$ f
FILE_SHARE_READ | FILE_SHARE_WRITE,
- Y2 S6 a4 J5 \8 ^* x8 V1 v4 l NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ P A! o9 f- S0 g6 a K
if( hFile != INVALID_HANDLE_VALUE )" ]. {7 [+ Z3 {2 q7 G+ p
{
( J5 S8 V( ], q5 y9 t! V CloseHandle(hFile);
+ [ ?: v1 L, S% Y& p return TRUE;
/ K' z3 W/ b$ l, _ }/ {* t, x7 n* v
return FALSE;
: l# |2 w6 x- N6 ?" }9 Z}, g A, w9 R9 _5 a" D
2 N% _2 K! s7 R( J
Although this trick calls the CreateFileA function, don't even expect to be
: Y0 v/ D9 S" f% E0 R, {# Wable to intercept it by installing a IFS hook: it will not work, no way!# t; k5 b% k- C& @5 S0 k, M
In fact, after the call to CreateFileA it will get through VWIN32 0x001F6 }3 S( v6 u8 H- \
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" C( {& W& z. f7 n; A, N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* h4 J9 C) `" ]field.. ?6 I( C: C0 x$ R
In fact, its purpose is not to load/unload VxDs but only to send a
0 B! ?! W0 @( M+ }W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
2 U6 Y/ v1 y% |( g5 F. Z1 y$ f8 Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try& D8 X9 |" z4 @6 Z
to load/unload a non-dynamically loadable driver such as SoftICE ;-)." V4 ~& F G" s) V8 h2 z8 c
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 z! P3 t! T; J/ d, _its handle to be opened and then, will be detected.
/ i9 R' H5 d3 K! d& [You can check that simply by hooking Winice.exe control proc entry point! \/ R# P. }6 |& }2 O- B2 n
while running MeltICE." E- t3 q" Z8 j, ?' s& V# E
+ X7 [* [6 M7 [, k: q# v3 N5 T: R1 e
+ D3 W9 ?; L# G' x7 _) Z1 p4 b# c 00401067: push 00402025 ; \\.\SICE
3 a, ]# Z4 v- I! z! X 0040106C: call CreateFileA
0 y/ S, ~: @/ a2 L) a+ ^9 J; v! y 00401071: cmp eax,-001, Z# ]1 H5 I, m3 e6 E! [9 T' h
00401074: je 00401091
' x7 \, M9 J# W. V- P$ ^8 s0 p8 @- e: [+ g2 H3 U
# t, K6 M: l3 _$ W) ^ q! p
There could be hundreds of BPX you could use to detect this trick.6 x; A- k V' e; n
-The most classical one is:
7 V/ O8 l# I9 H ^ i2 d- f( L$ ~ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 ~( s6 ]& W* y {( k *(esp->4+4)=='NTIC'; q5 r6 B: X/ p! e" g
* a; g4 k, z j7 V9 M-The most exotic ones (could be very slooooow :-(
2 |5 i) I/ x$ q8 E2 Z" K BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') / k6 }: o# q7 X, s8 P
;will break 3 times :-(
4 N4 i/ Z) E k8 U* L! X
8 J0 C4 F1 s$ t- E" Q$ U, F* i-or (a bit) faster: ! {( e4 i" n6 f
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')2 a1 B! O# o; R3 B* N* u% w
. g+ ~1 I/ V# g: q5 e- K* s/ j BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ W' n/ W( j) q: I, e Y ;will break 3 times :-(5 g8 R. f3 J6 N* m7 `
0 y* s2 w" T, M$ S
-Much faster:( A6 X3 e5 K- a# K7 L5 k( Y, F' a" ^
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) g9 a! _0 t# i$ Y/ I0 U; |; l" Y/ r6 c2 t; s
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen1 b$ z o8 D/ K. V! ]
function to do the same job:+ G% }3 h Z( \8 H7 Y' y% p
9 G+ c1 ^; C1 L# d/ D$ P push 00 ; OF_READ
5 k. S3 x: R2 R- s mov eax,[00656634] ; '\\.\SICE',0
+ T+ C. i W9 d# S- t push eax" P2 |) J9 b7 F( `
call KERNEL32!_lopen
k- v- Y6 g% B c% i: { inc eax
) T% B9 P3 q# g* R5 F( I" j5 L0 ~0 b jnz 00650589 ; detected! F7 l9 H( O2 C
push 00 ; OF_READ' i) u7 F+ l7 [
mov eax,[00656638] ; '\\.\SICE'
, n/ q: |- i6 E# M! U: f5 Y N push eax
* ?- P$ ^' c2 B, _' Q# ~: B: l call KERNEL32!_lopen) e0 r: W3 C1 \% J
inc eax8 f6 W- G" n; N- u" U
jz 006505ae ; not detected2 t" ^4 V8 `! \) Y, {
' r/ W- h( v a: {* p7 ?7 ?4 r
5 Q" @1 D+ ^3 X4 f* H# D
__________________________________________________________________________
. }/ j) ^; R3 @ T- g+ ~/ G
- s% n3 Z# M1 Z0 X; d2 r7 ~Method 124 _, I5 ?# g- H+ l3 Y0 }
=========
6 B6 a* ]& G" d
# A) @' u4 w( r6 I4 LThis trick is similar to int41h/4fh Debugger installation check (code 05) K4 x) }& h4 M/ K
& 06) but very limited because it's only available for Win95/98 (not NT)1 V2 e' I6 n* h
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.) c1 u9 Z8 U; g1 e7 O# c2 c, ]* M
/ R; o1 W* u; Q* S+ g, G push 0000004fh ; function 4fh
1 R5 ?! v' B1 t% `6 x push 002a002ah ; high word specifies which VxD (VWIN32)
7 `% y6 X3 F, O z/ u' `" }" @ ; low word specifies which service; ^. L3 f7 C3 J% d6 k: S
(VWIN32_Int41Dispatch)5 v1 K% x: ? `4 S$ o2 u
call Kernel32!ORD_001 ; VxdCall7 j0 @. _3 J) ~7 W
cmp ax, 0f386h ; magic number returned by system debuggers
$ p; t! L3 M9 m L0 l6 Y jz SoftICE_detected
# ]. `( ~2 ~ L9 }6 J5 c- ^
" M% C' g2 b9 o1 s4 d" v$ zHere again, several ways to detect it:' u3 r9 X2 e% G# N _ S7 P% R. j- W
3 h4 } E1 h4 a0 u1 c
BPINT 41 if ax==4f) E: }1 {6 i- V; r1 Y9 e/ X
5 D" Q ?6 Q0 F U4 H5 U
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one% D5 I) t, e7 A$ k M
7 W) t' F9 N& U/ Y# N* l
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 k* V+ N6 e9 u; E8 n' y
. N6 y' x7 O: k- p BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!, m4 l: c. Z6 P3 a% ^
6 I2 M+ M" N3 c3 N2 X9 ~8 |
__________________________________________________________________________! n1 }) _' k0 d$ X2 L
# B' Y$ N- n* Z( w1 m3 n3 l
Method 13
% |: X0 K& R3 Z+ }=========, ^5 @7 r5 W) m2 k5 z0 w5 P) k
- ?5 n" }: Y0 k2 F
Not a real method of detection, but a good way to know if SoftICE is
( T9 a' {" v8 B4 |1 z+ Ginstalled on a computer and to locate its installation directory.* @/ p$ j/ d: [2 C! n" D3 s, X
It is used by few softs which access the following registry keys (usually #2) :* {: J- E6 }& T) ^
; N! m! K$ c0 P$ y( \' O-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
/ r" a5 ~: y% a\Uninstall\SoftICE7 q; Y! ?3 `" }" F" }0 b) k
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE/ y8 ], @0 `4 ~
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 m4 b) \$ E0 f2 R2 @\App Paths\Loader32.Exe$ s6 R* A$ z# B( W/ P) l, q2 ^
" h" S$ e+ o D. B$ B; I
0 M/ E I/ J; q& tNote that some nasty apps could then erase all files from SoftICE directory- U H. [- c m {
(I faced that once :-(" k1 Q2 Z' g, G5 Z' {
' l- t# M) X( ]7 j2 s
Useful breakpoint to detect it:9 h1 z8 f2 K% N4 r% t4 r
9 r6 }. L8 Y2 k7 m0 h BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
9 b0 o& g- ?: p# l" p0 c2 T* h
__________________________________________________________________________% D5 m! Q, K: i1 c0 g
" I2 j1 Q" U+ ]. w/ F e ?+ T+ k8 Z) E5 U. s
Method 14
; G1 e/ K S } J* @6 K5 a/ }=========
& N; ^7 @2 Z+ Q, {3 h# i8 u6 a6 p# w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- l* h8 E$ w0 P1 `7 X$ g
is to determines whether a debugger is running on your system (ring0 only).: T' W' m- u3 G) C, Z9 a
% \' U2 n& z9 v5 v" G VMMCall Test_Debug_Installed
% U1 L: v+ {0 l! ?- [! p je not_installed
. x5 q% k3 v& S# t" E4 Q* q% D: E& C9 s0 |! T- G. q
This service just checks a flag.5 [ q4 R' T8 v* v9 @
</PRE></TD></TR></TBODY></TABLE> |