<TABLE width=500>
9 R- w! I' ^. j1 I<TBODY>
" T0 R. t% z. p. d) j# B/ C<TR>
# y# {* E& n" ]<TD><PRE>Method 01
/ R/ t" D g! |=========# U) ?. P2 S( N2 h* p6 f3 t4 n
7 Y5 Q, U3 c# O8 I/ g
This method of detection of SoftICE (as well as the following one) is/ ^" p4 B& E8 q' W- _
used by the majority of packers/encryptors found on Internet.
0 w( L% I7 A5 C6 A# U; O- i* vIt seeks the signature of BoundsChecker in SoftICE1 P, X; p/ d' t; [- s9 b3 Z
$ L; `$ u* }3 O5 v9 ]. v: F
mov ebp, 04243484Bh ; 'BCHK'
/ F) U! M3 P# ], _. y5 U% n3 b& @ mov ax, 04h7 o O+ w/ i7 d4 o8 K
int 3 ! I9 D9 p9 \2 J
cmp al,4. @( h: r2 \ x/ X& F
jnz SoftICE_Detected
6 c+ f, @1 R3 e) Y! i# ]2 V8 a& c
! n/ q5 ]0 W3 B# M: M7 A, ~; D___________________________________________________________________________) g1 x. Z9 L: a( A4 ]: l
3 p# H k* n: C I( A7 ^
Method 02
+ r+ b5 @6 P- a/ ~6 e=========5 C, ?" j, i6 ?7 B R4 n
4 ?2 g3 M! D8 hStill a method very much used (perhaps the most frequent one). It is used
# S2 p5 t* g( ?! |! y, Xto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
1 K6 l: U* O g! C4 r7 A# mor execute SoftICE commands...
0 d6 n1 @$ i W- k* RIt is also used to crash SoftICE and to force it to execute any commands4 Y1 p# H3 p+ U# K
(HBOOT...) :-((
6 W% C. i2 M# X2 t2 D: s- O) F3 M& y' ^5 a% h# N2 l
Here is a quick description:- |4 G& C, ]! T( j3 o% \
-AX = 0910h (Display string in SIce windows)
$ ]5 l% Y) Y; b-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)" N# Q8 {8 ?/ b* ], C: ~
-AX = 0912h (Get breakpoint infos)
& K* c* q, y8 `9 h-AX = 0913h (Set Sice breakpoints)
; U: p- A/ s9 }7 L/ u3 Q6 T% F-AX = 0914h (Remove SIce breakoints)
3 I% |, \% \" t n0 h$ }9 a1 r# }+ O# U
Each time you'll meet this trick, you'll see:0 L- t5 j5 n9 o0 S2 E
-SI = 4647h
# x# f+ n- c4 l% V-DI = 4A4Dh, Y: \. M9 g6 V
Which are the 'magic values' used by SoftIce.6 k" A8 [- ~6 Y8 p
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
7 B( u9 k" y* ^$ U3 i! n- }( y
2 g* T5 `7 {. L2 ~Here is one example from the file "Haspinst.exe" which is the dongle HASP
7 X% C0 p5 C/ N6 a7 @* S! lEnvelope utility use to protect DOS applications:
+ d8 p: n, W+ M6 [) F) s; a
% [, S3 M2 I9 }! m3 P K% d( E; W. K. }
1 t9 C& [; t5 ]4C19:0095 MOV AX,0911 ; execute command.3 q* o! |- g6 E8 U# O9 S* b
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).% T: A# D6 g' m4 A: y3 @- w! @5 B
4C19:009A MOV SI,4647 ; 1st magic value.- A4 [. N. ^" w9 w
4C19:009D MOV DI,4A4D ; 2nd magic value.
- \3 ^: b6 P& ^( \3 l* Y" k. Z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 f. O+ Q( l8 ]# f$ Y0 `4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute @) ?" `* H2 v8 O9 c' G
4C19:00A4 INC CX) j: r5 j, [% I, \6 b5 t5 @# K
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute3 T1 R! v3 ?; X" M' i3 }8 a8 S
4C19:00A8 JB 0095 ; 6 different commands.
6 |/ ^/ ^( S6 ~- v; P2 m4C19:00AA JMP 0002 ; Bad_Guy jmp back.
; j3 O( @' m- B- l2 [: Y4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
3 Z: o4 ^, j, _. W
; \+ x/ D1 \3 W/ ]The program will execute 6 different SIce commands located at ds:dx, which E7 F- Q2 o i# r
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! u- r( {1 V9 F7 B. X7 e/ R- K
" x) d2 b2 r3 W! b* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# X7 R- Y# L& K9 _, a" @' y1 m7 `
___________________________________________________________________________: `1 n9 c3 L5 t% i+ j# u7 }
/ q& [% f8 F K+ Z' X
/ T' H' t5 k4 |" m& U
Method 03
7 x/ P/ x/ Q( z5 ? c$ i: w* H=========" Q. J. F$ t: O7 @
. S! }4 F0 P- N9 F
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h. Y j& o- V( `4 ]( o" n
(API Get entry point)$ [/ Y' h4 q) N
: U$ n) |% f4 ?; Q' r/ t
: u. d$ U6 G: Y. u5 x4 Z$ c4 N
xor di,di8 j* V. i$ l! J0 o: w: F& G4 h
mov es,di9 d) N( {8 n% u _
mov ax, 1684h 7 j/ N2 ?* @8 J) G
mov bx, 0202h ; VxD ID of winice
; O" N# p# ]2 G7 ?; R( A8 | int 2Fh
" \# _6 a) x+ @% C4 A3 j# I6 [6 l mov ax, es ; ES:DI -> VxD API entry point
# G: @8 O, {% E7 N; O7 ?9 m5 ` add ax, di
3 f7 M3 q) [. c4 h: Q' o8 F' V test ax,ax; |' `+ E1 ^# l9 M4 L. _3 F
jnz SoftICE_Detected- p$ g1 ~ c2 Q- s4 L& p. g( X) t
3 I/ u. K3 z/ R7 j; H I
___________________________________________________________________________) V- ?* {) J; r+ S
3 [+ A% _7 E t% ]* n$ Q
Method 046 R( N8 }8 R9 c3 h6 W! C- ]
=========1 G( J3 C' ]/ Z9 s; v1 F
' m, K7 l; V( H8 P1 xMethod identical to the preceding one except that it seeks the ID of SoftICE
- q# x# c/ A6 l( O5 J2 W% [4 Z+ U/ x8 \GFX VxD.
2 \( D0 h# l! }" Y. m6 y3 O
; w0 ]! I- V e xor di,di
* e2 M, A4 i" | mov es,di
1 I! U; e5 k; o8 {( T mov ax, 1684h
, X; G* K N C mov bx, 7a5Fh ; VxD ID of SIWVID
- G- @4 x2 c& P" |0 G4 M& i2 R int 2fh$ G8 I/ o: D+ I1 F$ }" X
mov ax, es ; ES:DI -> VxD API entry point
* V8 h, W7 ]1 }5 [- o% D add ax, di8 M$ h5 z/ l: P1 {) Y/ A
test ax,ax0 i( N5 e6 ]2 R+ B! F: q- k4 v! R
jnz SoftICE_Detected
. v. ~6 r1 a4 E: S W$ ]+ G
; D! y4 M9 O0 h% d% K1 ?__________________________________________________________________________
5 P5 n" {9 R# U+ f
4 i4 O' U$ _& z, Y. S- t* _
( C5 U& x! o, a- RMethod 05
, b4 w2 R, P! X5 R, t4 S=========: O6 i' Y2 n: Z' B
X$ A7 L: |% ~, v! m* _5 O$ B
Method seeking the 'magic number' 0F386h returned (in ax) by all system. c3 T9 N& h. y+ {1 j
debugger. It calls the int 41h, function 4Fh.6 U/ x+ s0 J# f# Q
There are several alternatives. / V; y K$ k0 X
! S2 D$ ?9 ~% o6 v4 DThe following one is the simplest:
. O1 o- Z" K$ _% q! C' b8 Y. M/ p! k7 y1 l' X
mov ax,4fh2 z% G& I* q; p |5 t
int 41h0 f) z: {! u- o% s
cmp ax, 0F386
& j w# y: {% x1 }- [. D, T+ n jz SoftICE_detected+ d" x, [% t$ M2 `, M
1 J7 N) J* _; X
4 P2 ?( Q& k* Q" F" g1 a3 D9 ~Next method as well as the following one are 2 examples from Stone's F0 g5 q4 a- W0 T! P9 ?8 K+ ^
"stn-wid.zip" (www.cracking.net):
+ I- [# j7 G( t1 f3 g1 h1 G H4 g+ S8 {; S7 b! l, _8 a
mov bx, cs
3 M6 C/ t+ A& O6 Z1 y lea dx, int41handler2) Y% } [- o4 N0 _. e& u
xchg dx, es:[41h*4]
* c: v/ Y9 Y" K9 [& y xchg bx, es:[41h*4+2]7 t, k9 `. p1 u: R. y3 A* i9 V/ N. {
mov ax,4fh
9 \7 e; A0 Y. U3 t( I0 ]* s int 41h
! t2 _# J6 S( e9 V xchg dx, es:[41h*4]% i5 C9 T" X' @
xchg bx, es:[41h*4+2]
* }! T( f; G8 ~* w/ |( V* P cmp ax, 0f386h& D) w+ `* e: L, v; G( p G
jz SoftICE_detected
- j; @. L$ \$ S- ~ |! z! }7 o7 S3 K9 G
int41handler2 PROC
% B& u# a. Z6 ~& L$ ^) |, w iret Q; {& f* k- K
int41handler2 ENDP, }: D5 L! K3 M; i5 j% g
2 j. {, N( [. G, \* T( z, y
2 H. R* r( X- G. M$ a1 A `* }8 T_________________________________________________________________________
! u3 `. o6 ?5 G. X6 C& T: V T3 N. d# ^( Q: u
- b4 Y4 x/ _0 U$ z9 ^1 g
Method 06) ~% D, @" l- T `
=========
) Z; e3 T( I0 e2 B6 F- d5 Q# Q( R j, k' P! n @
7 L F2 C. h' M% X% d0 U
2nd method similar to the preceding one but more difficult to detect:
. Y) ~% ]6 P% Y: B6 @; F
2 R8 v# a5 n: k2 G
0 \4 J" J* w. E, Lint41handler PROC+ q" m3 F. g" H+ H0 @8 _
mov cl,al
3 E. ]: S3 g. T/ S iret" X6 T- }- N: K
int41handler ENDP' B6 C) p0 r' N" G1 Z2 P
# l! n M+ |$ V! q+ l. @" ?- e
' q, s7 K9 e: y1 y3 N: K
xor ax,ax3 }$ m" @, f6 F
mov es,ax d4 v; f1 d# I2 ?: \) A2 T: @
mov bx, cs0 S3 x2 E( J# l
lea dx, int41handler4 C/ f- j/ l' S' [/ n+ @& e
xchg dx, es:[41h*4]7 t+ e0 i( V4 K" @1 ~3 t
xchg bx, es:[41h*4+2]
1 ~8 h; N5 ]) t6 S* m& ]* p in al, 40h5 C1 }% i# c3 m$ m1 b) R5 ~
xor cx,cx
& ]) _9 ?* i- I' v9 c1 Z; h int 41h
; Z) G2 r+ {$ f2 ?4 x xchg dx, es:[41h*4]
, L5 O# k r- N6 b2 n xchg bx, es:[41h*4+2]( \( a z P. Y8 n/ f
cmp cl,al+ j; S( J3 n' E% _
jnz SoftICE_detected
- c4 s$ H& e: h+ k. r/ b$ k7 r) D/ }( x6 g* {8 k
_________________________________________________________________________
' w* C4 l5 _7 O% R* |& q6 Y" Z$ D$ N8 f# o f) h4 G' B& Z ~1 f) \+ \* |
Method 07
5 f* u. I- c7 w# ?- n% @) D$ `6 h=========' U( z% [! f5 O5 f7 }+ x2 a/ N
R6 e/ Q! j$ `$ Q6 e
Method of detection of the WinICE handler in the int68h (V86)2 c6 a5 W1 T$ ~: D! L+ |
5 {7 N" m; C# m" y mov ah,43h) Q) R' Q: P! t: ~5 P0 u
int 68h0 }% E+ U& L6 d3 ]3 ]( w
cmp ax,0F386h4 E4 U1 Z5 Y8 A% y: N
jz SoftICE_Detected
3 C; B3 y- e# Q" Q0 J" Z1 A+ I
! |& n5 ^% O% ?: r8 ?2 t8 T. N$ v* u+ _. ?! P
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
& b. |/ ~# I1 \$ P- r app like this:1 Z. M9 G: t3 h, r% A9 u
% Z) M/ \0 L3 |# ]) V8 }) ^: v: A, ` g
BPX exec_int if ax==68
& z" \* z0 O* x, n) Z/ S3 Y (function called is located at byte ptr [ebp+1Dh] and client eip is! D; A, R- C$ a. _, g
located at [ebp+48h] for 32Bit apps)
9 W- w% ]" l8 N/ F! z1 u__________________________________________________________________________
# J$ @8 V, {: G/ B! o, \: ?1 P m: A |% _
& P; b/ J. a# s: E% H/ U6 @
Method 089 d ^9 ? r) z! X" N. ]
=========
" _1 r; m) U5 r6 f, P! l2 t8 r* f% w( X* a$ G% e( O1 f2 w
It is not a method of detection of SoftICE but a possibility to crash the" I8 Y$ R( [6 b; U; x& f# R
system by intercepting int 01h and int 03h and redirecting them to another
; g5 N3 E8 b* N* }' ~- F: a5 Droutine.9 }% {" _6 ?6 M
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points3 A1 ^! {0 A0 Q0 Q% N! \
to the new routine to execute (hangs computer...)3 X9 ]: {; S% s: S% N
/ U6 m5 k) Q* h, T mov ah, 25h% |0 F" g; b7 A9 o
mov al, Int_Number (01h or 03h)4 }! `# p) K& |9 K
mov dx, offset New_Int_Routine
4 ~0 S( C9 f1 h; x int 21h% K3 L' ^/ E: l" ~: x( a
4 T8 C' L4 g/ s: F__________________________________________________________________________* O6 J, K7 q$ j8 x* ~1 \7 l
6 p9 C6 [! P4 C& ?
Method 09
0 {) k# _( F) O=========
$ b2 {" |1 z) }3 `2 ]6 m/ {! B0 u& u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
7 K. q0 B* ^. jperformed in ring0 (VxD or a ring3 app using the VxdCall).
+ K+ {+ b [3 m$ IThe Get_DDB service is used to determine whether or not a VxD is installed
' K$ b. I& d; V8 Q, D Mfor the specified device and returns a Device Description Block (in ecx) for+ \& \: l5 D& A, H" g5 X0 o8 s
that device if it is installed.4 `) ?4 B. {; a$ `/ K
3 {' p5 C* N" Y+ Z& L
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) `! Z9 y3 E! h# f0 w mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( Q' y# n! y( G- t d
VMMCall Get_DDB) B3 y0 }0 T3 S* f
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 `, I y! {, E( U. t
* M4 X5 H1 T0 C# n
Note as well that you can easily detect this method with SoftICE:* n0 M0 {' n" q6 j& ^
bpx Get_DDB if ax==0202 || ax==7a5fh
* d* O5 |. `) ?. V5 Z
. O- o: ]& Z, u7 H+ j. F__________________________________________________________________________
$ U# I( K% p* C. F' S5 z- R1 g' u/ w6 c, z+ v, W S- d, Y3 F
Method 10
% l7 ?; L w d& e, }- Q=========
! {+ o8 Y6 S3 Z: R1 G, I0 d* b* ~; {6 g2 n
=>Disable or clear breakpoints before using this feature. DO NOT trace with
2 I& r( C2 P. `3 a6 i @ SoftICE while the option is enable!!
! \9 Y% W7 ]2 N% l+ I3 m# x
: j( U, ~3 j/ V8 lThis trick is very efficient:" N3 ]) j* z! J; y* R, z ]6 Y/ {% A2 W
by checking the Debug Registers, you can detect if SoftICE is loaded
# M+ p' _8 P* m! s& g(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if" y# k+ I; D8 ]5 }' \& ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 f1 V. h, j- [2 x3 e- o# N+ _
value (in ring0 only). Values can be manipulated and or changed as well- G$ l4 r3 n9 \4 Y
(clearing BPMs for instance)* E0 Q' f5 e" K! T4 D+ p( k* \( v4 f/ c
4 P& z& B$ @* a. E$ E: ^9 Y
__________________________________________________________________________3 }8 q9 ]* A% V7 V* `" U; R% I. a
6 G2 O( j- U8 P% _ N
Method 11$ v; M9 Y! h) G+ k3 @9 K r, J( N
=========$ b& A: Z( J1 }6 v" r
& D7 [& u8 `# T5 j9 w7 g2 `This method is most known as 'MeltICE' because it has been freely distributed# i$ T' u5 N. O
via www.winfiles.com. However it was first used by NuMega people to allow
- p2 A& q; W8 L- K# G& }Symbol Loader to check if SoftICE was active or not (the code is located+ ~6 y9 M. ` j/ F* `( A l
inside nmtrans.dll).
& [& v7 E+ r, h1 N/ M% T* O/ @5 r# ~2 ~
The way it works is very simple:) Q; O2 a" q7 l* v) W, r& X% u
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: R$ X K( i% r- }0 d/ d2 d, IWinNT) with the CreateFileA API.
+ B. a1 n( i9 ~- e5 M( C0 G- O G6 w7 `2 [3 j4 Q9 u" H
Here is a sample (checking for 'SICE'):( Q+ S0 `7 Z) M1 s ]" _$ ?$ e
0 [/ @ P- x" @) MBOOL IsSoftIce95Loaded()
- \# p8 |: A8 Y7 b8 Q, `5 f7 z{7 \0 t& _5 _: y/ u
HANDLE hFile;
( ?! ]4 i3 b- f hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,! D/ _7 |2 o: b" _% F
FILE_SHARE_READ | FILE_SHARE_WRITE,( e. E0 b! n5 f' @
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 c- _2 g# \5 n, F
if( hFile != INVALID_HANDLE_VALUE )9 _9 u3 w) v; A
{
) a, b5 d2 j" `3 P0 V U; \9 J% e CloseHandle(hFile);
' r, d! r7 {& T Q return TRUE;
. _9 d3 V) C0 Z+ S( n }
& R5 _$ k/ l3 n( q/ X return FALSE;
# F0 q! M) }& N}+ X4 b: |3 x0 d% W& A
Q9 G) f$ _( M+ ~: O6 jAlthough this trick calls the CreateFileA function, don't even expect to be# e) O6 D5 c X' P% M
able to intercept it by installing a IFS hook: it will not work, no way!, c! g: p3 S. X1 a
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 |( C& D* }1 d8 Q# e
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)) _3 G) X' E9 |+ |% d: c- i6 r
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. Q8 M8 y, |) |9 [6 Cfield.; U* V" j* U1 T
In fact, its purpose is not to load/unload VxDs but only to send a 8 `/ d$ c; i0 \* c1 \( o
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) l1 f8 P+ s) b0 D2 q( mto the VxD Control_Dispatch proc (how the hell a shareware soft could try
5 Z) M& w) i% P Bto load/unload a non-dynamically loadable driver such as SoftICE ;-).
0 P4 h' V: m* ZIf the VxD is loaded, it will always clear eax and the Carry flag to allow
2 L# @* l8 p$ x4 G% Jits handle to be opened and then, will be detected.$ ?8 H. S+ Z/ J/ i0 f' Z, ^
You can check that simply by hooking Winice.exe control proc entry point; A0 l/ Z! X& N, c
while running MeltICE.; X" a% V5 a% E) ~# B1 |- i
: x; N* v5 c& @8 w& w/ h% I) n' l3 I+ p! E: u
00401067: push 00402025 ; \\.\SICE3 k0 B2 t% ^6 v/ ~
0040106C: call CreateFileA
1 j3 O/ h( ~5 p' d+ E 00401071: cmp eax,-001
9 w- q$ }( X% t3 _ 00401074: je 00401091: K$ e+ C! a: i
9 S4 F: n4 Z* A6 k7 x' @
+ a/ P$ V* N) \7 dThere could be hundreds of BPX you could use to detect this trick.5 g: E, b( Y) c* A' ~6 `
-The most classical one is:
1 `& P3 w L8 i' P l; d5 P BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
$ D2 f* t$ ]1 W! M+ D0 W& J/ A *(esp->4+4)=='NTIC'' p) G5 D, Y" C+ y: D/ w1 j% U6 {
7 X6 k" B6 W6 f
-The most exotic ones (could be very slooooow :-(
1 `4 p5 ]1 J' i& ^$ E4 |2 E BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 y) p. e' ^4 o" C( S. R8 \ ;will break 3 times :-(
" t1 V8 R* \9 a) l$ k4 v( u% L8 {$ M' k: K/ t+ [ W) S2 m- e# |
-or (a bit) faster: ( n: y+ X5 u' [. H
BPINT 30 if (*edi=='SICE' || *edi=='SIWV'): X- p G7 Q+ Q4 L" o# E5 g4 w
; _8 B t9 g5 P& U' J" U BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' + i8 {5 h9 G! L) W
;will break 3 times :-(
( M, C7 F- L: z5 N
) a2 A- d; y7 t, K) d-Much faster:
( k: B- Y! k8 M O BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( ^1 Y. p8 s7 e; G0 W
+ d# K ^" E; _4 Y! y8 p* nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen: M8 _- g* i9 ]$ q) X* X
function to do the same job:% W+ O* j0 K! ~; p+ C' M+ @
+ L1 h' v2 X# d9 O6 F9 R- H push 00 ; OF_READ' \7 b1 S; ], O( E
mov eax,[00656634] ; '\\.\SICE',0
& H& f* J u0 I* L% i push eax7 E( T, H/ W% ]% ^. Q
call KERNEL32!_lopen
4 r' \" }0 x* }7 b; w inc eax# g# o1 x( h' o. X) U
jnz 00650589 ; detected+ M& J, o; @0 L( F- X- [! E+ d
push 00 ; OF_READ' U' x u4 y/ u4 c( @9 Y% M
mov eax,[00656638] ; '\\.\SICE'
: t; ]7 ^( y5 G, u push eax
& g3 b3 w& V! i& e call KERNEL32!_lopen
$ F# l' K! M! E% { E inc eax
6 H3 \% Y7 l: l& P8 _: D* A7 j" H jz 006505ae ; not detected
+ p k, S( s E% N) @. n3 [5 [$ c" M9 W$ Q' R/ e" x. j5 }
& S1 ^! o; Z. S: C+ ^
__________________________________________________________________________5 Q* v) T0 L4 w
2 v) \4 o+ f) e! t0 ^Method 12
. D& N, y \# R: O8 ]=========
; J6 b/ P3 N3 ? h. Q" k; {4 y6 O4 C9 O% u% _1 |* p6 W
This trick is similar to int41h/4fh Debugger installation check (code 057 e: E5 G1 L3 R7 l8 \" O
& 06) but very limited because it's only available for Win95/98 (not NT). z) L K0 \4 j2 c. D0 q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 p) S% p$ M, Z, v2 C
$ e e1 E! i- C3 G$ r, Z* Q
push 0000004fh ; function 4fh
0 T4 O" q+ ?7 n" g9 A push 002a002ah ; high word specifies which VxD (VWIN32)
* n" ]( V! n7 y' c ; low word specifies which service
8 G5 Z! c8 b' O7 I9 ~& H (VWIN32_Int41Dispatch)
k1 H& q5 W- e8 D5 S3 U- I' Q. Z call Kernel32!ORD_001 ; VxdCall
4 Y) P0 Z* b- I+ D cmp ax, 0f386h ; magic number returned by system debuggers
; C7 P+ v4 C$ M) v2 f. d jz SoftICE_detected8 u; [9 n" A& j* H
6 k+ G2 ?* ~: | g& ~' k" F, C, n1 N
Here again, several ways to detect it:
) `2 o$ M: b* X8 o
% x7 W' \) T2 \( R9 [- v BPINT 41 if ax==4f
% i( B8 g& N% B" L& T: P' P+ C
) i/ S: U2 X; m7 V6 p0 | BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
) h& s2 y8 ?! \5 F, _7 P
- J: B5 B, p0 n' U5 I9 i BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
" b7 M B8 \- a' ~2 M
& p: F! X9 ^! U7 b4 [ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
, v: h: w7 N" a# X
+ T) q& T1 q q- {__________________________________________________________________________$ m0 D' N; m6 G0 \8 x" T9 k# ~
+ {+ w' ?1 q0 VMethod 135 q; |: _" {" S8 |6 z$ L
=========
+ C/ Q+ X! j/ y; N7 g0 k
# z5 ]1 x! H6 U& D/ i7 |. e' Q8 P0 xNot a real method of detection, but a good way to know if SoftICE is
: D e7 y+ \: oinstalled on a computer and to locate its installation directory.
2 {# S9 B. f( [% L) ]' p5 C8 d& DIt is used by few softs which access the following registry keys (usually #2) :! q5 N, y* d/ U
9 u3 P2 z: R# O+ z
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
2 Z7 l5 V0 Z2 O\Uninstall\SoftICE6 O& f2 Q* ?, n- P4 s2 ]
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
6 o" g0 w* N. p6 \+ r-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! J v8 B: Q( d; p: d& \0 N
\App Paths\Loader32.Exe
$ _7 w3 k9 ]/ o g6 |* r8 Y; b- j# B. K7 @' Y& n
$ f+ [$ ^6 a; n6 sNote that some nasty apps could then erase all files from SoftICE directory
1 g7 \% M6 t/ H \6 W' P9 Y(I faced that once :-(
/ x1 t2 l3 T8 C' Y- s% ^* z& W/ o, R8 H, T" L4 G
Useful breakpoint to detect it:, A \' S% X) O
- O9 c8 [* V e* q1 ~
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
0 V6 w; f+ L k8 c. G* A& G8 J4 n! r) ~: _
__________________________________________________________________________
. S/ }. i' S( ^/ p# G. x! V7 V2 e+ z9 i( _ V, B8 V& g+ x* _
8 I, Q& u4 @+ b j! t3 D( wMethod 14 ! E2 u4 P8 V. r$ h2 R) ^8 x
=========
3 T' w2 J1 k8 o% {( t, {/ R) [. z4 `+ [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' _( m! i4 ` L& p1 O2 S
is to determines whether a debugger is running on your system (ring0 only).
, d/ O3 Z( v& L2 H! H/ Z! q ~ v- a
VMMCall Test_Debug_Installed
9 {+ |/ M, I* r% R! p je not_installed- W3 }& Y) m7 P) P' U' p7 h
2 h5 E8 q! T2 s3 L7 m
This service just checks a flag.
8 f* q# o6 y& [/ f7 m5 ~% O</PRE></TD></TR></TBODY></TABLE> |