<TABLE width=500>% @, R# |% X8 M
<TBODY>: \0 I* w6 \. y* ?2 U
<TR>' b% Z' ~% y+ O: ^: @6 O
<TD><PRE>Method 01
( N; a1 V9 g& y4 W" a=========# i! o: b9 R1 K: Q1 |
- w4 O# t4 d3 a1 _# g; i
This method of detection of SoftICE (as well as the following one) is2 S' _/ b% I n2 M! x
used by the majority of packers/encryptors found on Internet.- c! a& _8 y. k$ P0 f
It seeks the signature of BoundsChecker in SoftICE
( G9 ~! Z- D" q! s, R3 p$ W. ?
8 O+ B2 c0 B9 h! j9 z mov ebp, 04243484Bh ; 'BCHK'
1 |% O- B- \$ N6 M. @3 m mov ax, 04h( d i9 b% n0 \% }7 G, ?0 l
int 3 ! m/ }3 A$ q2 c/ f5 x. }
cmp al,4
8 O& K$ }8 z" c. F# l jnz SoftICE_Detected2 H/ w X0 X; `/ q! Q4 K1 ~
* P5 g, K# o/ s
___________________________________________________________________________9 K" F( ?! u# M w5 l
! ?4 ~ W( i' f, v/ R
Method 02
3 C6 z/ }# z2 s( Y/ o3 ~=========
& b, p, g {& O4 \* K: n- p8 o' N+ D; o
Still a method very much used (perhaps the most frequent one). It is used
5 r5 s5 Y) ?+ ]8 f- {# nto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
6 j- X0 E6 ]! D1 For execute SoftICE commands...2 C v! y# t1 K' F
It is also used to crash SoftICE and to force it to execute any commands; M t! U: E3 d2 w3 R
(HBOOT...) :-(( # Q. K+ _% O. g6 `4 g- e L
* L- F/ M3 v: k. D Z$ R9 zHere is a quick description:
3 c2 R+ q! T: [: G0 ^* M+ C& V i-AX = 0910h (Display string in SIce windows)6 g5 P; _2 A* M u1 n' O
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)6 y' A* }# | s+ d/ |
-AX = 0912h (Get breakpoint infos), F+ S/ m2 @8 K6 l5 j
-AX = 0913h (Set Sice breakpoints)5 a/ i0 \, D/ f2 s
-AX = 0914h (Remove SIce breakoints); }* S4 [- q- U y: x3 E1 z6 x
: a3 I6 }' m9 w, a: r
Each time you'll meet this trick, you'll see:# Q. [8 Y7 V, D* Y) l( ]4 {
-SI = 4647h: q8 f4 i$ U: m5 L. X X
-DI = 4A4Dh
8 k2 }4 V) A9 kWhich are the 'magic values' used by SoftIce.+ }3 T% S' S, K/ A* w5 [7 e
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
- a, o. `5 Q1 B f& t- M
6 B W. r7 ]* C3 i7 p1 qHere is one example from the file "Haspinst.exe" which is the dongle HASP
, ?9 J4 S& Y' y$ |Envelope utility use to protect DOS applications:
) d5 ?( A4 Y+ O( h0 U- e1 j5 K5 x4 H- v' b* u! n
6 {: ^' \5 J% B2 K/ q# ~4C19:0095 MOV AX,0911 ; execute command.
% Y0 r4 h8 C* J, N4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).7 n) k! D. q1 }* `( }0 V: X
4C19:009A MOV SI,4647 ; 1st magic value.6 V) \ C% k7 D( r* l/ j$ w
4C19:009D MOV DI,4A4D ; 2nd magic value.
/ T- O( z+ }; {( b4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 l& e7 K' B+ w" w W
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
/ w& y$ n7 E5 @3 [; X4C19:00A4 INC CX# W V& `: ^3 w8 h
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
, H# C# d# p( c f! K' h4C19:00A8 JB 0095 ; 6 different commands.
1 L; F0 y5 |+ [! A0 C4C19:00AA JMP 0002 ; Bad_Guy jmp back.* u Z1 i* n1 T0 R" ^, V
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)0 H0 s5 r6 R9 }
2 [7 a% H+ O6 M$ p* z( tThe program will execute 6 different SIce commands located at ds:dx, which, s+ x5 e* B) V' j4 e: |
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
, f, B* e& U, j" b5 o4 d* c$ y& Y- l; n- I" R! v* u5 e
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 E( c2 T9 r: e' S/ r___________________________________________________________________________
}% b7 a5 _) b( Z
& [! R5 p3 ^5 H" A6 |) A: n
9 G4 C1 K9 y$ S2 o; Y: }" dMethod 037 m! U3 g9 `# S# x: c/ L6 C: a
=========
% }: Q; F1 i! A d2 X2 i/ J9 P" U. {) m
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h9 n+ M, G L. L, D ?5 f
(API Get entry point)7 t* S3 ^8 Y: q6 a0 J
% n2 U4 n+ O! P1 ~5 l; `
" z& s0 q0 E! _( {# Q
xor di,di- y" q f, Y7 ^& E
mov es,di
4 ?# u, D& d% V: ~ mov ax, 1684h
/ b4 d6 j- y4 Z8 V0 W, \# |& X: H% S mov bx, 0202h ; VxD ID of winice3 f! M; {# u( G: z+ E* V4 t" c
int 2Fh7 v2 d6 ?8 H2 G$ j8 M' L& L
mov ax, es ; ES:DI -> VxD API entry point
- F4 c3 D' l/ g+ n) |+ d add ax, di/ ^+ x# w5 K( A3 g/ ]) Y
test ax,ax
- y: f* x; ~8 V/ X; n8 q( T6 w jnz SoftICE_Detected5 y6 _- e; @$ s6 A3 r
! ~8 N- ~3 v" j: R6 h# s
___________________________________________________________________________( w I. z+ I2 p' D1 P! Y7 v+ ~2 Y
7 V% v. Z* h3 O3 F
Method 04 h# F/ i, O. ~$ x
=========$ W7 z0 W u7 j H8 M1 r
, |8 Y- J& Z" w2 T ]/ v5 _
Method identical to the preceding one except that it seeks the ID of SoftICE$ h: a' X5 t; n: L/ M$ x+ g
GFX VxD.
' K# Z1 Q* g# b5 |
9 [6 X9 n0 c4 u4 V& j/ s xor di,di* J! ~7 n! _+ g3 y
mov es,di
- f2 T( `" x8 X8 _. j mov ax, 1684h % V- S& f* J& C
mov bx, 7a5Fh ; VxD ID of SIWVID
4 U$ P$ Q/ P6 `6 K7 ?1 v9 R0 \; S& t int 2fh0 ^+ s( i+ {8 W! z$ q% A
mov ax, es ; ES:DI -> VxD API entry point i5 U3 ` g2 ? G- X3 ]
add ax, di' h+ w9 l- T$ [5 a# A/ t* \
test ax,ax
& F. f/ d4 s0 n$ y2 A$ Y jnz SoftICE_Detected- A) w4 M* S' }6 [
; E% X/ R& L& B! o& A F. Z. ^+ C6 q
__________________________________________________________________________
1 \$ j8 j u6 Z$ v& C! e j" Z b) f3 M2 @% q, D
; P2 n3 Y( h* C/ g; l
Method 05
! G/ b( e# W6 [% m: l& @: H' o8 k=========
, v n: H6 ^7 j; r" ?! c3 T( c8 ?% n8 }; l* j/ ^9 J! y6 V* ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system% @; q3 G2 k+ U+ f/ \
debugger. It calls the int 41h, function 4Fh.6 j1 r9 k- A# ?5 ?
There are several alternatives. 5 _( n! u, p$ p) }2 s6 c
\% a' w4 P& l8 s; i1 u* g2 ^The following one is the simplest:
! ~. s! Q' f E( r z
3 c1 J6 C2 }; ]9 j3 Y9 I% U mov ax,4fh
9 n# W! d4 ?% `3 f+ `1 t( c int 41h. [) q& h. w7 R; u9 A
cmp ax, 0F386
1 W+ g, i( l6 j9 j/ n jz SoftICE_detected
; P2 M7 X3 _2 J9 B" I
5 s: }# L D! |! `8 T2 F X; J, {& s( S+ X
Next method as well as the following one are 2 examples from Stone's
9 [( K! {+ y2 c* M"stn-wid.zip" (www.cracking.net):0 b1 `: l1 c" D v L2 d
, d, x$ m% s2 q: o mov bx, cs0 ~1 W# M" X! t
lea dx, int41handler2
6 Z! Y3 d( Z1 I" k; y- [: u; _ xchg dx, es:[41h*4]
3 Q( C8 z$ C8 V( D* s% `( V xchg bx, es:[41h*4+2]8 p2 n# H0 L6 D5 w
mov ax,4fh
' k4 a6 D/ P Z1 } Y f int 41h
$ G0 C$ [8 ?! _+ M xchg dx, es:[41h*4]
5 H6 ^/ ]1 W# [" i xchg bx, es:[41h*4+2]
% S8 y+ E6 \7 W- W/ M4 U cmp ax, 0f386h8 S, V! P: @/ k3 Z* b7 q( g# j
jz SoftICE_detected) q, W+ L% P% G, g7 J0 E! f
3 Z! E! t/ {) F# w( }) M; n: `int41handler2 PROC
8 W( ]7 i' z. k4 [ iret" I1 A5 T7 s L5 j3 ]6 h
int41handler2 ENDP8 P' I/ J) @* T! p4 P5 G
( M5 ^, k0 \" v& T1 M! U& m& c: y2 u9 K2 ~) a. |+ k9 D7 \# |
_________________________________________________________________________- J4 L% N0 z& x! n8 T" ~! C; _
9 J8 m- h1 B0 k
3 N* x6 s6 L% U, S2 FMethod 06
3 J4 _) t+ P( V( ]3 g* m7 f, s& h=========
8 T. K% q4 p1 R- i+ }
/ S9 F; E: r7 }4 e/ y, f
) B5 s. q$ \* N* s0 ? x2nd method similar to the preceding one but more difficult to detect:
S% T# `0 C3 P- \) \% r& W
5 K" C; D$ } s0 e
- b1 h6 R8 r( C6 Dint41handler PROC
5 t0 f& r/ p3 t2 Q& ], S9 K mov cl,al# L6 h" V! p+ X: R
iret9 e! r. f* _; M& P! k3 I
int41handler ENDP
2 k+ c7 u3 T+ x6 @5 {
: L8 u6 y/ y; y+ H7 J1 Z. ^, F& G/ }# }& }" r$ Y/ p
xor ax,ax
* K5 r( s, G/ {2 ~+ X6 ~ mov es,ax1 g# {: l2 Y3 Z+ _; m( T
mov bx, cs" s1 V3 [4 B3 v) Q' m J# @
lea dx, int41handler( o9 B. k6 q5 G$ K' N
xchg dx, es:[41h*4]5 h! O" X: E( M# ~" G! |: i/ K
xchg bx, es:[41h*4+2]
( D, ^% N) j9 C" P in al, 40h
5 S# [2 D* w3 p/ S5 ^) ?# f) Q. I xor cx,cx' T+ N, c0 v+ \2 X; K
int 41h
8 v3 _3 i. A2 a# F5 O: N. P xchg dx, es:[41h*4]
) z) z- R7 d! V. _, L xchg bx, es:[41h*4+2]. G4 S+ I- K4 K# b( D v6 ?
cmp cl,al- Y; j* W: z1 O, L" F
jnz SoftICE_detected9 ?. V; c; s2 ~. @" ]- e
5 B# Z- x d; Z0 e
_________________________________________________________________________' z) K/ O9 l- S/ n, x8 ?$ [0 U& e& O
5 _( z& }* Y7 x- l2 `, h. OMethod 079 S# t3 D1 z0 u+ _0 k
=========1 N; L- P" a8 H
% ?* ^; C, z) U+ v0 v7 }Method of detection of the WinICE handler in the int68h (V86)
% D% M" }8 ]4 L0 k% L6 u
( O9 a6 j& P5 f" D) a2 z$ N mov ah,43h" v F* B# ] i B, j
int 68h
# _4 s Y# O1 d$ B1 ? cmp ax,0F386h2 p @# o e8 I% h0 B3 ~ c
jz SoftICE_Detected4 x }' w: Z2 o- B# P9 K) z
+ C; _* i+ ^" q" ?0 `7 O( Z
+ y N* U0 H: V: A=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 E( P( K( E' l" d
app like this:/ N8 z! Y) k6 I
1 R+ e$ q4 Z U- o1 \
BPX exec_int if ax==68
) }" D# n2 T. L4 u6 j$ r (function called is located at byte ptr [ebp+1Dh] and client eip is4 @, V- H! L# I4 ^- c9 v4 M2 c
located at [ebp+48h] for 32Bit apps)
. P6 M& s( a$ g# ^$ ]__________________________________________________________________________% n( H+ Y$ ^" ?: x' d9 a
4 a( I0 z9 n* I$ K0 \" J$ R8 h4 \2 I# _" ~8 G
Method 08
) L; ]% r! W# W- n=========: }1 |! K) f! i- F
$ v$ m! P/ R7 \! J6 u- f. C
It is not a method of detection of SoftICE but a possibility to crash the, H7 O3 D1 G% u5 A% G1 M' Q
system by intercepting int 01h and int 03h and redirecting them to another
0 i: H8 z+ K- I Y+ o6 ]" i+ Vroutine.4 I, y5 @1 d6 D3 E0 g/ s
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( `9 K( V) O) T5 w( I$ M% zto the new routine to execute (hangs computer...)
* ~. R" c' d% K' u9 v
* N& w1 z1 N; _2 j mov ah, 25h
9 C# e' V2 {6 o1 k' F# O; F# X, H mov al, Int_Number (01h or 03h)
# d2 K7 s3 [5 i/ r$ G mov dx, offset New_Int_Routine& a& J9 I0 K$ m- e( B1 l
int 21h
* g0 F" `9 W0 g- b% ~- y
g! e X U7 F' P__________________________________________________________________________6 t3 C2 p ^: {, f7 l
) a2 S+ S5 I% @$ V
Method 091 l; T N% @; R
=========
* L+ E" U$ ^( Q/ F- r5 V6 z9 h3 @$ T* R; O8 n" g- b
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only( }) ^1 Z2 n# V; x# W: e
performed in ring0 (VxD or a ring3 app using the VxdCall).
7 U9 b3 v: ? C- e8 SThe Get_DDB service is used to determine whether or not a VxD is installed) d2 A: m5 K. O; @" L
for the specified device and returns a Device Description Block (in ecx) for4 G. T) L5 ~1 o9 o# Q" @
that device if it is installed.8 e O. S y$ x( z
5 |0 ?1 R2 _- ?$ r+ E
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID8 H: q C1 k4 S) P- q7 n
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
3 s/ a$ j6 H4 I, W# B VMMCall Get_DDB I! b7 q9 k) I$ A+ V: H% `0 d
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed8 }# W. Z$ I5 t2 i j
* ^0 E1 C: H! q
Note as well that you can easily detect this method with SoftICE:6 O" {# f+ _0 c) Y$ q# ]9 o3 e7 [
bpx Get_DDB if ax==0202 || ax==7a5fh j, V* y j/ H+ j6 w7 y0 _- h
% w; y/ f# |6 `9 s3 U2 K; k
__________________________________________________________________________
1 {3 |2 p* @" p D P3 F5 ]3 m! H$ E2 S3 U4 N) ~4 r$ O8 k
Method 10
`5 n) v" O: o=========' |0 w* }5 N% b# y/ f: k3 E
( c7 Z; _' e" A: V0 Q: O- n
=>Disable or clear breakpoints before using this feature. DO NOT trace with/ x# M" M. R8 C
SoftICE while the option is enable!!3 [$ f# C+ j# i1 Y( p+ j
% {# F6 m: K$ {5 c7 sThis trick is very efficient:
" Y: [# b( ]7 Cby checking the Debug Registers, you can detect if SoftICE is loaded) R' p5 q1 ^+ M4 W6 L8 Y- A/ X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! h3 [0 |: M6 K
there are some memory breakpoints set (dr0 to dr3) simply by reading their
0 v1 m, Q; v( R# S/ Bvalue (in ring0 only). Values can be manipulated and or changed as well( j) e" N \+ X5 J. S3 L$ G0 R! T# C
(clearing BPMs for instance): t. e) v& L z0 g7 n
- |0 S$ `4 [5 L6 j9 E1 d__________________________________________________________________________6 X1 G7 y8 |. E% N& w+ f. b$ }% u
; T6 _; W9 i, ^/ X9 G/ [' H; U# f
Method 11+ A ?7 m* c3 n# }% d* T
=========8 Q, `# c8 {' N+ b. O- U/ p
! b7 `) h* h" n% {3 K. U+ t& F# OThis method is most known as 'MeltICE' because it has been freely distributed3 a$ Q3 W2 b$ y j
via www.winfiles.com. However it was first used by NuMega people to allow
) |- N. p1 }. {' B n5 w' a7 p' ?$ w* a& mSymbol Loader to check if SoftICE was active or not (the code is located
; v7 Z* u* E% W5 e, W/ dinside nmtrans.dll).9 A; _3 b8 b* s! `+ w }3 r0 z# \+ @) U
8 ?5 G( l# G) K" |: L4 \( QThe way it works is very simple:
. D5 B/ y9 y3 U0 \It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) ~. t0 O v3 D7 d. D& G
WinNT) with the CreateFileA API.
! m- q" F% l. m/ S: I- K. m8 ~) c% W, m/ l+ J* R: `7 x! y9 C
Here is a sample (checking for 'SICE'):9 w, Y& H4 v) B( l5 M& ?
) r; v6 W+ F aBOOL IsSoftIce95Loaded()3 h* R6 B4 h' u: s1 W$ ~7 n6 V
{6 [' R) _7 p$ f @" l% g" y
HANDLE hFile; 6 w, \! l. D% e1 y3 w
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- t$ s, H) y+ W" _ FILE_SHARE_READ | FILE_SHARE_WRITE,
; c3 c# D" y' N9 m NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- C2 w' l: j% G0 x
if( hFile != INVALID_HANDLE_VALUE )
" M' i' i; L, {# H3 C {6 e+ m1 ]+ ~4 U) B3 n7 x
CloseHandle(hFile);% `$ W! h, A5 q8 \" ^
return TRUE;! W# d2 e4 D# w) [/ F( \! a
}
. h; q _5 Y5 P; T return FALSE;
8 M F5 [0 b: g5 M) g}
0 L. S& g, O/ m% m! e- @
8 h+ c! h5 b$ R2 \) fAlthough this trick calls the CreateFileA function, don't even expect to be! [ V8 z% M; j/ F
able to intercept it by installing a IFS hook: it will not work, no way!
( a8 A& f% ]0 W7 d8 ?3 J9 zIn fact, after the call to CreateFileA it will get through VWIN32 0x001F- A. l( p+ {) u2 p* B8 \* @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)& y2 j- R6 H; \0 g/ R
and then browse the DDB list until it find the VxD and its DDB_Control_Proc/ r: j5 t. T# F- p) l
field.
3 E4 E3 i% }6 R( @, U/ r, ~In fact, its purpose is not to load/unload VxDs but only to send a
) Y! ] } s) b+ [: l% Q. ?W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)3 w8 d* b5 v0 W3 p" a' S% E! K6 j
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! [5 ^9 W* e3 s2 |* cto load/unload a non-dynamically loadable driver such as SoftICE ;-).7 [( ?# r' Q; G1 j+ ?8 h2 v
If the VxD is loaded, it will always clear eax and the Carry flag to allow
' R8 S6 Y" y0 @/ c0 Zits handle to be opened and then, will be detected.# T) |: }, b& H# `3 y7 c( H! |) h1 V
You can check that simply by hooking Winice.exe control proc entry point
3 O, j) I/ E" ^2 u, s6 [while running MeltICE.
: B/ }- | r3 A5 }, I
$ H/ ]; [) X y; [8 ^6 n. N
7 ?6 \" ^' ?" o. j; E$ Y, V! Q 00401067: push 00402025 ; \\.\SICE1 E: R4 Z# d l. t4 H$ g
0040106C: call CreateFileA
3 L8 a* t5 x" D& L 00401071: cmp eax,-001
; q! r( C8 ]; C/ {1 @5 T5 M 00401074: je 004010912 y" B0 Q3 [# B7 m
7 L: `* F4 e. ]8 O5 I5 X5 Q
; [+ p8 v" }4 |% gThere could be hundreds of BPX you could use to detect this trick.
9 V d% N) B/ t- N5 d& ?-The most classical one is:% l. b+ n2 W+ e$ s: v- b. ?! t
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
/ n% f# i0 X4 N3 t2 ]- ` *(esp->4+4)=='NTIC'9 P J8 V+ n" j
; ~9 n& f+ H/ K8 ]$ d
-The most exotic ones (could be very slooooow :-(6 }- ?6 k/ S5 J
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
! A: s' T4 \; @ ;will break 3 times :-(
/ `/ n8 A7 W6 ^3 |6 W+ p
4 h6 F( P7 Q; M, n-or (a bit) faster:
9 H7 n7 b1 m. E) N BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( `, R+ `& `; L% z" N) U/ Z! T$ ~# a* f3 ?; E ]
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
7 p$ b- {8 r2 b! a, k* A5 f/ H ;will break 3 times :-(0 L. s+ O4 K' n5 s# b- D" c$ k
s% e% \& Q- \( l2 L6 W K" Z-Much faster:
6 y' s& e. G. P4 Z* G) Z BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'0 d2 A b* F2 [# y- D4 @" k! e- T" y
# d T) d6 X$ J0 {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ }; r, t& H9 i! ^3 ~8 s- c+ yfunction to do the same job:
5 b7 T+ W$ w. K
/ h- ^, D! R" Q1 H" _6 H8 d push 00 ; OF_READ1 T* `- d5 s7 _% h! d
mov eax,[00656634] ; '\\.\SICE',0% O+ W2 F; K4 _* j
push eax
, I8 @0 H1 k" _4 C call KERNEL32!_lopen" c7 | R% Z' t
inc eax" ^" r3 b) b; B4 @% ?8 h
jnz 00650589 ; detected+ j T& X! [9 r6 T* R Y' s: @
push 00 ; OF_READ
: L- G$ R' `6 a# w% u- C( w* P mov eax,[00656638] ; '\\.\SICE'3 N3 X$ M/ Z! R$ O6 ? a
push eax
" t( `$ t |) x( b1 T8 Q8 z, s call KERNEL32!_lopen
* B+ q _# A5 v9 ^5 t& z" n2 P inc eax
0 C' o) m( A X& N jz 006505ae ; not detected& Q5 b+ r! M& [5 j3 v' H1 t& S) t
8 E' r3 x$ b6 K( Z. _
# f, s. g0 j8 P# R5 o
__________________________________________________________________________* `5 i8 x0 ?) ]) b* n! B
' `. n0 p5 q. Y+ w: T: y
Method 12% q( X" f! E3 R5 O
=========# d+ e2 I* B5 ?- V
0 V- |/ r5 o+ _5 F
This trick is similar to int41h/4fh Debugger installation check (code 059 S/ Z" W$ w: I
& 06) but very limited because it's only available for Win95/98 (not NT): X2 o. w2 ?7 J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ S, |! b% A8 |. H. a* ~; r
# e& G& t# \% b# \6 }( A
push 0000004fh ; function 4fh* o- H5 E/ E# R2 g
push 002a002ah ; high word specifies which VxD (VWIN32)! _$ T2 ~: k* m
; low word specifies which service0 F) ?% G* B8 @& v. z, a
(VWIN32_Int41Dispatch)" {1 k) v$ |' I% H
call Kernel32!ORD_001 ; VxdCall
9 ^, w& }4 b# w E cmp ax, 0f386h ; magic number returned by system debuggers6 d1 n9 z" V; s9 p4 d5 u6 @
jz SoftICE_detected
& \5 w7 k q6 F: P+ a8 R4 D
`2 {9 G: y: x+ [* HHere again, several ways to detect it:
( ~$ d0 s$ `% Q7 v& @9 I1 H
2 l3 ]# |( r/ X$ j& D2 }2 o BPINT 41 if ax==4f2 k& y3 F) o9 w& z; g! n9 U
( r# L1 h6 H4 c5 P" K BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one0 h- k% q3 t- r! R$ C+ t" D
0 R7 p& j7 Y- X- d6 }; p* _( c
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A! g' H! g# C! e1 h5 U9 Z0 b: x$ I
/ _/ y; ^2 S) M G: r5 e7 I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!: m1 g( S0 o. K/ e9 T) _9 y
% O) Q7 g+ m2 Y' k* Q. O
__________________________________________________________________________* E/ S- v: `/ P1 j f! z
0 |/ u/ s! O. E" [Method 13* e$ K Z ?( I. K1 u! k* `
=========
7 |$ `$ E# [1 u; u8 x1 D# b5 E7 v" x1 e
Not a real method of detection, but a good way to know if SoftICE is! A- p. N6 j M' \$ z
installed on a computer and to locate its installation directory.8 Q9 o5 S& [ y# B5 X j
It is used by few softs which access the following registry keys (usually #2) :
2 F* O* m4 I/ H W1 h& m
4 y6 R4 [2 I$ M8 y" c2 X$ E-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) |4 ?$ y' o: m2 K1 [& w\Uninstall\SoftICE
+ h1 @1 }% Q) t P0 Y' R6 ^4 s-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE+ o# Q) d: p& q+ ?6 v j0 e
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
d; `6 F* p+ b2 n+ e- Y6 {# V\App Paths\Loader32.Exe2 t: B/ v8 z* f8 C. ?
# `9 K+ _; ^2 x- ?- [0 N5 A1 W7 N/ H8 V1 \' U, v2 C
Note that some nasty apps could then erase all files from SoftICE directory
/ b3 K( y4 ]+ s I& }(I faced that once :-(
4 O. m! w% X" H2 P" u
" A7 I+ _0 A6 P' C, g+ H4 J4 FUseful breakpoint to detect it:
2 h* U! C1 c: h) D
: l- G# U% t: ~ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
" `7 E# P# G2 z9 D7 R" T+ e9 a
__________________________________________________________________________
+ e% e' m3 S7 o6 A1 }9 e# f- q M! c6 M& J' M/ c+ D1 ]% w
, p) m% {2 O! v1 y$ l4 n, W& F
Method 14 ) g- ]3 v. i8 ^( L- ]
=========) f, \( \$ }9 ?* @2 `; c) j
1 ?# `; E' T7 Z$ G
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
+ m; \" V) f/ v0 X/ i5 V0 nis to determines whether a debugger is running on your system (ring0 only).
% Q8 f: b5 \3 T5 P5 A1 ?6 j0 M r* G% u% \+ x. x% [, E4 T1 j0 {5 }! _& {4 e
VMMCall Test_Debug_Installed( V0 p7 j5 ]+ p; F* k2 K
je not_installed
' h- n. a; ?' t) B/ i0 `
* x' Z; y! k' }0 ^This service just checks a flag.
+ Z: o+ O0 b; }. J3 c</PRE></TD></TR></TBODY></TABLE> |