<TABLE width=500>8 f1 [0 W" A9 i1 L) L8 o, I* \% I
<TBODY>
}9 ^; Y) Y/ `- z<TR>
# x! }( K E/ r<TD><PRE>Method 01
: z$ n L+ y* D=========/ H7 h4 l! j! w* }* d" A* i
( H7 n1 g' u$ p+ S
This method of detection of SoftICE (as well as the following one) is! J3 E$ t3 y) l1 I) K$ k* L& b
used by the majority of packers/encryptors found on Internet.6 o: L8 U T" L- I( Q# @
It seeks the signature of BoundsChecker in SoftICE: i5 O1 O3 x! h1 d
9 r/ P; ]2 d& C, {
mov ebp, 04243484Bh ; 'BCHK'
" e" {+ k' r6 O- u8 { mov ax, 04h
5 `6 F8 S: M6 Z% C- c$ }- D! F { int 3
7 {' @/ v3 O$ U cmp al,4
( e3 }9 A! F# v: K# S3 ] jnz SoftICE_Detected
# E- S% o$ e( ]. ]6 t# \
) z. Z/ H3 h7 P% V& m6 J5 Y___________________________________________________________________________1 B' ~$ Q& z3 o
" w3 X' }* ~4 _) G* K/ zMethod 02
" }# V0 x5 a8 v2 b- j9 O& Q/ r=========
6 K* ^# I1 _3 R6 ~: w; x# \' B; R/ l2 U: `* W Z Q; j; I) z
Still a method very much used (perhaps the most frequent one). It is used
" M% U2 l8 g: b! p" W5 hto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' x( M8 y/ W5 j- d4 B5 D5 cor execute SoftICE commands...
& Q g* a# b3 N& s j9 f! b- b8 {It is also used to crash SoftICE and to force it to execute any commands
H$ N X% u' ~7 V4 }/ D/ O! g(HBOOT...) :-((
( I* j. U; @3 G9 z( {8 b% X; ^( I6 j8 N; ]1 b5 q0 T, ^/ n1 }
Here is a quick description:4 ?) z4 c- `, {5 @3 c! V
-AX = 0910h (Display string in SIce windows)* e" q7 x+ V3 L$ A z/ t3 ?
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
5 ~+ u; C; y: W3 w3 T. q. {-AX = 0912h (Get breakpoint infos)
! ?$ ]+ T) N/ ~; ?: B1 o* ^: _! U-AX = 0913h (Set Sice breakpoints)
6 N& D* n5 {9 F+ r. L3 E3 x q-AX = 0914h (Remove SIce breakoints): w) L0 f# A$ ^. f, c* X: B; p D
" t {5 i& x8 @- y( ]2 E. [Each time you'll meet this trick, you'll see:
0 \. [$ V- J, A1 |+ R& g6 D-SI = 4647h8 _8 N; S$ Y& m, E6 A* U( R
-DI = 4A4Dh
; R6 V: L+ j) b. }- GWhich are the 'magic values' used by SoftIce.
a0 t+ C% U4 v! B2 r3 C5 NFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
3 t! W/ b8 t: |" J. F! M1 ?5 U5 F5 g$ j# p4 n% e1 N1 [( T
Here is one example from the file "Haspinst.exe" which is the dongle HASP4 B5 F- i7 M0 c- e' A, X) @2 b
Envelope utility use to protect DOS applications:
# e# q" E5 i+ y: O& c! ^' d0 B# L0 k' M O+ q, s
) M4 j* P4 W1 y/ a% F2 E4C19:0095 MOV AX,0911 ; execute command.
e% y+ _& x9 k z4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." j: F7 {; a4 u2 v
4C19:009A MOV SI,4647 ; 1st magic value.9 x d/ r* `1 t, d4 \) p2 G
4C19:009D MOV DI,4A4D ; 2nd magic value.
5 `9 V. T% A$ b4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 w( @, V* R( {8 B. x/ \- q4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
0 d" P/ i( Q* C6 q% I0 e' [) |4C19:00A4 INC CX
0 b8 I$ i' h# H4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
- ?& H: E) n5 s! O% {5 `6 o4C19:00A8 JB 0095 ; 6 different commands.
# o) Y9 N: p& R+ v& Q6 O) u4C19:00AA JMP 0002 ; Bad_Guy jmp back.8 @& j p( J" l
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)9 k, [' ?; c# r8 f l0 k x
[6 g& r! b) ^& g% }The program will execute 6 different SIce commands located at ds:dx, which% V9 B6 h m0 k0 V7 n
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.- g1 J( `% H4 h3 H, w, f# B X
_% `7 a4 J& s# r0 h* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
$ h/ C- [+ b6 V: r___________________________________________________________________________
+ r. |& E G3 Z4 Z+ O1 c4 t4 v% u4 C0 }& E
9 D% T6 N1 O" y1 jMethod 03+ V$ I x" w P: Z! o$ {$ Q
=========
, V( f: Z% a0 i
7 X. j& C- ?2 u% e# qLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 c. s/ Y5 `$ J8 ]0 u; D' I
(API Get entry point) z8 O/ \- @7 t2 T6 N
: Q* k' z7 i3 M5 X
+ q% I1 V: p# I. q1 {" b& T xor di,di9 x' |7 N* B7 h, W8 e
mov es,di; b* b8 A( s1 x/ Q- P
mov ax, 1684h
% Q$ R- Y t% c4 k- G" d) R" \ mov bx, 0202h ; VxD ID of winice
* V) {- `6 K H _; w2 Z int 2Fh
1 e* h! {3 l L% z! ^6 r+ u mov ax, es ; ES:DI -> VxD API entry point
Q0 W7 Y+ i; h7 o7 A3 i6 U: x9 ? add ax, di
% ~% \( ^! }1 a; y test ax,ax
, R5 | |, B; @+ N jnz SoftICE_Detected. p/ I: V) l, g. ^, S( b {
2 K& H( \8 L, P* B" h# K
___________________________________________________________________________
" M6 q$ h* n: i: |) A5 q! w1 m
Method 04+ g! S! f- B$ G! e; Q
=========4 |7 l3 L8 Q2 ?/ \" ~/ @
) e/ ~/ u, [' _5 F7 Z2 h
Method identical to the preceding one except that it seeks the ID of SoftICE8 k' y$ ~1 Z- a6 ^
GFX VxD.! @! y4 h$ d! ^! @* C, Z y- T
2 b; ]5 x8 c+ S- v4 i
xor di,di
+ C) [1 z$ Y6 Z& v6 }( ~1 A! l/ s mov es,di4 g4 W" _( B; C1 U" D$ j( o* S
mov ax, 1684h
! [+ j8 [4 P% i mov bx, 7a5Fh ; VxD ID of SIWVID4 c+ J1 g7 i2 f
int 2fh
6 ]5 L& ^" c$ o mov ax, es ; ES:DI -> VxD API entry point7 ]& b# N5 q4 B
add ax, di
5 t9 t4 B% E0 y) O3 Z6 [& X* X; G" i& r test ax,ax
( q. x1 s: d/ g2 S+ `2 C+ Y* E9 f& I jnz SoftICE_Detected
9 p Y3 c9 ~3 W( k4 |2 S* v C7 M4 b
__________________________________________________________________________5 v l3 Q$ }4 }0 o" e2 `
% G8 F9 f! t; j3 r; A e/ i1 A3 C2 h" w; M# }
Method 05 L! a( ^9 ]5 ^0 I$ H# H% d
=========
& [& k- N' J7 i( R
, H q( v0 X! @6 R: |( fMethod seeking the 'magic number' 0F386h returned (in ax) by all system% }- H+ d n; ]' s, k7 t4 i7 C
debugger. It calls the int 41h, function 4Fh.2 U1 Q0 [) F2 C* U9 `1 }5 d; k
There are several alternatives. % d1 P4 a J, \% g
- a1 |1 |& G% u3 w2 E, [The following one is the simplest:+ {; h9 N, ], R& i; l7 Z
9 D) _. d: m$ {# M" i
mov ax,4fh
5 l3 u" g# g9 v4 a' M* w int 41h
0 P7 i+ \& E' G# x% _ cmp ax, 0F3861 r; n' Z6 I V7 Z" Q3 Q
jz SoftICE_detected7 R- [% V" t" W
" z* P p( R8 [+ H9 Z
9 S8 ]+ k& w/ d3 a* M5 a+ \Next method as well as the following one are 2 examples from Stone's ' S) B" }( w9 P$ S# @4 x* L. F
"stn-wid.zip" (www.cracking.net):
4 G) B% J( H/ M
$ n2 o) {" G& H* O" @ mov bx, cs" V5 C0 T4 I) {' B3 R3 l
lea dx, int41handler2: M; k7 C/ x* }% N% n+ y% V3 {
xchg dx, es:[41h*4]! a+ u0 W( f+ W
xchg bx, es:[41h*4+2]6 b3 t! n0 L! c
mov ax,4fh
. K: Q4 ?- d& o* u int 41h
& _) B9 Q! u/ e0 g6 | xchg dx, es:[41h*4]
5 J6 I& Z, v; n( G: l. j xchg bx, es:[41h*4+2]
1 v4 H0 |! ?7 ^* p( e+ [ cmp ax, 0f386h
% U- J9 ~* d( ~. k$ M' { jz SoftICE_detected }4 _: C6 y* y
, J: S1 n+ S# d) K% i" T" B
int41handler2 PROC* j) x, V0 M) }; i* G7 t
iret
: X u0 b. N; D! u8 wint41handler2 ENDP; M3 M, M: r: P$ l( n
! k) X3 o& P. [" n6 S3 |- M$ O6 `% e
2 X y" u! S1 ?' I- I# n
_________________________________________________________________________ V1 k4 X& |3 N( ^, N, ]3 _6 _( D
- H. S5 U: G$ x* y2 {
3 k+ x! _) {+ W" a/ f* B3 d9 VMethod 06
5 m8 J( E! a) }, H/ Q9 Q9 w=========8 J1 M0 a# X: p$ ^. I2 K; C# Q
$ h6 o. @0 g2 K( k( p
- G; z! K* u5 G5 K2nd method similar to the preceding one but more difficult to detect:" V; E# s+ Y! X
2 \+ A; R: b1 m# z( ?/ v' w
4 W+ }( t. Z2 bint41handler PROC* V) y+ j; M! o$ n
mov cl,al* A& x+ d0 c+ j; _
iret5 P; I$ `; A# [
int41handler ENDP! h [, j8 V1 I6 f
: u' P. ^8 G, a8 Q
8 Z3 L& Q' J5 H+ G, d; u" Z xor ax,ax; e7 T8 N9 C" d; g% D
mov es,ax8 y" Q2 l/ E$ {) k
mov bx, cs
. j* F7 e) P0 j0 ?5 B1 I, x! b lea dx, int41handler
2 t/ _4 z6 W3 K7 z6 a xchg dx, es:[41h*4]$ F0 s% A: S& r% h* s/ k0 v
xchg bx, es:[41h*4+2]: @/ e2 k, I% T1 O; I1 k2 z% c" j& P
in al, 40h H4 @3 m- ^! M; W2 j I" O( x2 G
xor cx,cx
+ n, R8 Z8 |* Q- s) Y; i3 W* L int 41h" b0 p" F8 V6 e9 H: M6 p
xchg dx, es:[41h*4]0 V0 h6 b c$ ?( ]! Z' m- Q# L. k, X
xchg bx, es:[41h*4+2]
& J' g; o1 D: E" @. _) C* ] cmp cl,al- K2 k: C0 y& {: q) J8 z
jnz SoftICE_detected
( W% N) h4 l) _1 l3 Q' z3 E, g O% g% j! s4 z: i
_________________________________________________________________________
/ K% M" _ E' E5 g- w& M: }& G& W
Method 07
% d% g2 P p( {7 ^. f2 V- n& ?=========
9 q; Q0 |" D8 T. c" j
! x+ c( t- w' q6 f" V mMethod of detection of the WinICE handler in the int68h (V86)
9 H7 `; x0 S( q0 }" j( _
: m- g1 y, @5 ~" C e6 t# `' Y6 Q mov ah,43h2 l7 e( P0 r7 f( I- |; v
int 68h2 l. Q* e9 {, O3 O
cmp ax,0F386h
6 v$ @, T$ x+ A m$ E6 j8 d jz SoftICE_Detected
( l- y" z, J7 f& z" `3 c( I& f% q7 R; U9 k$ P& E
) |0 D, X7 w: l$ E5 s
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* X) d: u6 \) g; i1 z" d app like this:
: h; b/ M( O5 i. R1 b2 G% |' q8 c0 p! Q9 g- ~6 b6 L
BPX exec_int if ax==68
3 k5 j" w h" }+ Y (function called is located at byte ptr [ebp+1Dh] and client eip is) R0 U5 j z( T& A
located at [ebp+48h] for 32Bit apps)) s0 X9 g& r" S
__________________________________________________________________________
( |3 [! T# C# l" A- B- v; a/ F7 J
p! X0 c5 ^& b p
: f) m, ]( v& bMethod 08
& o: D5 ]/ O7 i ^' ]- V8 }=========
|5 W% r7 D0 u& s9 k3 `3 ~ F: u0 P) @8 p6 x# H9 R3 H
It is not a method of detection of SoftICE but a possibility to crash the
' @' D3 u& M" ]( ? z) e- A% Msystem by intercepting int 01h and int 03h and redirecting them to another
; B; D# v" a# @# }routine.
* x: W `- H. B" r! G( RIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
( L4 v. J) A# G, H7 X2 ]- _: A- Hto the new routine to execute (hangs computer...)
1 o9 u) j* Y7 a' L1 s4 P, x# l5 K, ], e! T
mov ah, 25h7 ?+ e& I' i5 H0 ]
mov al, Int_Number (01h or 03h)
4 ?$ B$ L" a3 {$ w" Q( L \# p mov dx, offset New_Int_Routine
* D% l; c; [/ o6 H8 u/ E' x1 c int 21h
+ V0 q# N V/ b' q6 D; r$ s
. v8 O. w# E% Y* n3 K, X__________________________________________________________________________
: l' X' P5 U8 Y( H2 f) O8 u3 Q: r# f
Method 09
# o. }; [. C/ L5 `$ r: {& N9 s' W=========3 Y+ L: t4 |' F% p8 e- a
, O( F Y6 ?5 V+ t. _, e0 vThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" k' u4 ~* i2 L* s% n
performed in ring0 (VxD or a ring3 app using the VxdCall).
5 \( a4 n; ]& g' }+ u" w1 TThe Get_DDB service is used to determine whether or not a VxD is installed9 p b1 r K3 ? Z+ G/ {
for the specified device and returns a Device Description Block (in ecx) for
- y" _: o0 R& e/ R- Q+ Rthat device if it is installed.5 B# M# Y. ^# z7 y
& _3 ?( k" Q2 T8 K3 ~
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 i1 E) F' u3 u% R1 H mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
1 P+ Z) J R. B c/ X3 _/ @ VMMCall Get_DDB
7 s |8 X! v5 P& m mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 S- d; l# S% s5 u$ @) y1 a5 O' L! B3 E* k
Note as well that you can easily detect this method with SoftICE:; E: l$ V# k6 V
bpx Get_DDB if ax==0202 || ax==7a5fh; d. l$ Q! y& S' A
4 B/ g' g7 S9 D3 }0 D' E! r3 }
__________________________________________________________________________
* R; r6 C% x; h _2 {! }$ y. b; w* p) H$ h
Method 10
+ H a! _" e& `8 c; `. ?; }=========
' u; l% E1 r5 ?" ]; j) U
. j6 x; P/ Q. l- v=>Disable or clear breakpoints before using this feature. DO NOT trace with1 f$ l: C+ {' J
SoftICE while the option is enable!!3 Z! K' F6 O( @ T
; d+ @6 Q( z' ^- U* ~
This trick is very efficient:
$ H: }' p* v9 |by checking the Debug Registers, you can detect if SoftICE is loaded
0 l( O; z9 b% M(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if3 e- }+ i9 R8 y3 O% A
there are some memory breakpoints set (dr0 to dr3) simply by reading their' k. o1 {1 j( } {; }
value (in ring0 only). Values can be manipulated and or changed as well
( Z7 m7 j/ \5 g4 G(clearing BPMs for instance)
. G8 \$ Z# l9 `. P& G0 s$ p, `) p; k: w; A* a5 o
__________________________________________________________________________
+ H% N' t) N/ D+ I! S0 n3 y
, V2 \5 V; Q, Z3 `; A# r7 b5 BMethod 116 _/ F6 }- H/ M' M
=========. l1 {: u0 c$ b& Z
! b, T; F5 O4 H7 l$ X. KThis method is most known as 'MeltICE' because it has been freely distributed# J5 Y2 h3 \8 U1 A# K7 a: L
via www.winfiles.com. However it was first used by NuMega people to allow
0 g( ^' d. c5 rSymbol Loader to check if SoftICE was active or not (the code is located
* a% o4 T' n& w: Sinside nmtrans.dll).
% H3 |$ W! U5 u% F* n1 S& f: g* ~; o
The way it works is very simple:
5 Q* R9 P+ [6 PIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for ~6 m" V4 A3 e
WinNT) with the CreateFileA API.% B1 |4 ]0 r; x" l$ s. n- |
2 O5 Z V! z- V6 I0 v- Q# @Here is a sample (checking for 'SICE'):, ?" S; X; F) F
+ @* ^9 Y) N3 QBOOL IsSoftIce95Loaded()8 I" h3 g& X7 r& V( C
{
9 m- a0 N& t# e$ J3 I0 m. n) }* Y) w HANDLE hFile; , K" N/ |5 U U' Z$ ?
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 i! k0 P# ~ T. a0 ^) T4 s9 P
FILE_SHARE_READ | FILE_SHARE_WRITE,
2 L- l& |; v, K, k NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 |. u5 r( y( a6 h! p9 F# N2 w
if( hFile != INVALID_HANDLE_VALUE )2 D" j% D7 ~9 |5 l, |2 D& c
{
' m- \9 x8 G& C+ u: |; F CloseHandle(hFile);$ ^( l( q. H/ _, J9 m9 e( A7 ]
return TRUE;# {& m9 s2 j" @9 W
}
$ A' O; V5 s5 r" s return FALSE;
, v" x: v# i% ]% L0 d0 ]}7 N7 f, D. }4 q9 K6 _
, @9 l8 }7 J h% o( e, [
Although this trick calls the CreateFileA function, don't even expect to be- W& r4 ~' U& }
able to intercept it by installing a IFS hook: it will not work, no way!8 i4 m+ [% ]+ s* f+ Q$ U* @! v
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ Q* z1 j: R- |: R: k3 p
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
8 B$ T* U- _3 z0 q' a) @7 S& Mand then browse the DDB list until it find the VxD and its DDB_Control_Proc+ Q7 M/ s5 I9 z" G9 ^% s& |
field.5 Z, ?4 e3 F9 i2 [- e
In fact, its purpose is not to load/unload VxDs but only to send a
+ e( g" R1 O1 Y. n$ z) xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 U" z/ _! m8 v2 c/ wto the VxD Control_Dispatch proc (how the hell a shareware soft could try* V& p/ X+ k; U' }
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
! h; ]' X9 A" F2 S% YIf the VxD is loaded, it will always clear eax and the Carry flag to allow
; Y: n4 k' I0 m: z tits handle to be opened and then, will be detected.2 A& c/ \; B% }
You can check that simply by hooking Winice.exe control proc entry point
' ]- V! S) @2 [2 S" q! owhile running MeltICE.
- l D% b) P' w$ W) s5 G* j- q: Z! T+ D6 n
h. r" d; ^+ i3 w& X1 s4 o 00401067: push 00402025 ; \\.\SICE
2 K7 K4 U& ~% M8 m 0040106C: call CreateFileA: J( T, J5 c; E0 r6 c
00401071: cmp eax,-001
! d1 v" Y _* o- x) e 00401074: je 00401091
+ O' j9 C) x- P2 H$ E( Q. n
' _! [" ]4 v- ]6 ~) o. E4 v8 ]7 S4 r0 ]' M! u+ Y9 ^3 X
There could be hundreds of BPX you could use to detect this trick.! I1 W. q! f3 z% _
-The most classical one is:6 V6 W6 v+ g- i! }9 |, C# F
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||9 ]0 @# R0 V5 t+ \" S* [/ I2 G6 O
*(esp->4+4)=='NTIC'
: {( `/ H4 L# o4 o b
! S7 b/ y! F" Q/ Y-The most exotic ones (could be very slooooow :-(
, g, w2 v4 @3 k% n) t: B; f BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') " f/ b! T9 y4 Z, n4 o) m5 e
;will break 3 times :-(; x, @; S. U' s* r, D! G9 M
; q, m, Y1 O0 Z5 h' D-or (a bit) faster:
: ]$ i0 p3 k2 x# f BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 y3 x! K) `, ?' P n* ^# _$ h1 `# D
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
+ F( p: F8 a; J& j W ;will break 3 times :-(
0 e; E" I- n9 h: V* I0 e9 }! O- Y! V6 G, a
-Much faster:+ g. r$ y& W `# A! t7 ^$ o
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
+ D5 n$ p4 z% [* j- t' a% V7 I9 t+ ~. e8 F" x+ J: o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
6 P [! s0 k, C( N6 o2 Hfunction to do the same job:7 w2 ]; {' J0 r* O! y2 [) G
$ ] D2 S. J- r: e3 [
push 00 ; OF_READ
5 k. i, G$ I* f7 `# S1 g mov eax,[00656634] ; '\\.\SICE',0
/ L& y* B) H( _! ^% | push eax
) w# t9 ]" U7 x1 } Y call KERNEL32!_lopen2 R, L( ? C$ E2 s) H; U
inc eax
i# X# Q) t. j2 Z, P jnz 00650589 ; detected0 s% O) }4 g+ a1 Y$ K
push 00 ; OF_READ
- q& S2 B1 B1 A @5 u: r mov eax,[00656638] ; '\\.\SICE'7 T/ E P! m: W9 f, J: ~. a1 ]3 \; Y
push eax
, L# ~1 P6 X p) @5 D& ~ call KERNEL32!_lopen0 L6 e/ @0 s) [% b4 a& l. L2 t
inc eax2 M9 V" x, a& T! t6 X8 L& @+ l9 @
jz 006505ae ; not detected
3 @8 {# M6 @) z7 W! R3 r1 a/ z* |" z! \3 O) B" T
+ V" N1 d# f6 Z
__________________________________________________________________________# g* r/ ]& P5 R) k1 j
6 W% ]6 p0 A, h0 j
Method 12
. i1 c- n4 b: Y7 o=========, M6 s/ o& V$ }
& K9 z, p+ R/ Z9 O2 \' SThis trick is similar to int41h/4fh Debugger installation check (code 05/ z) q( [2 K! c/ W
& 06) but very limited because it's only available for Win95/98 (not NT)
5 I6 W* k+ r& A3 ?0 x9 p ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.: ^" w' X/ T) V$ |4 t- M- U4 s8 {
& Z- F6 l' _( I1 ?5 K4 y3 r push 0000004fh ; function 4fh, l8 F+ v2 }/ R: v: v
push 002a002ah ; high word specifies which VxD (VWIN32)
. g; u( S$ W6 Y8 ^ ; low word specifies which service% b; r% U# A2 E8 ]
(VWIN32_Int41Dispatch)4 q2 b* r& T6 _
call Kernel32!ORD_001 ; VxdCall
" }7 T2 \% W* s" @4 z8 f2 Q+ G cmp ax, 0f386h ; magic number returned by system debuggers+ F* v9 x& Z2 b: v/ Y" D+ f! o
jz SoftICE_detected
1 q4 \8 V, e* H8 M6 e
+ _; n5 a. Y* `, a0 @$ PHere again, several ways to detect it:
, c9 ]5 t& X' [1 I7 T6 F0 M
! B$ i, I4 s( n' R BPINT 41 if ax==4f9 A" C* ^- V7 u$ N
# P) n# _! T! P3 U+ o, n
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
. r K+ G7 F; \/ }. V; e- A0 p' M; I7 ~& t6 N! g, Z8 V) @
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
- i) `1 X/ `2 F& I% p% B1 `
' {5 E& A0 [0 z7 f4 [$ V* O% W BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!+ [# L4 |' Z" w. A
" O; h% u' P- F: L
__________________________________________________________________________7 Z; b: h; c5 _$ r0 o5 o
' r) z* n+ F5 ]$ M! E
Method 13, }& F! e/ M8 f7 ]* c$ W
=========
- B$ {3 P# E# @; S# U3 ]
6 R! d' U# }- c7 d# i. NNot a real method of detection, but a good way to know if SoftICE is( l. q. a1 L/ y0 w
installed on a computer and to locate its installation directory.$ k; I; N2 L$ d4 P# l) Q
It is used by few softs which access the following registry keys (usually #2) :
1 u2 n! t. D5 n. {5 V3 `* N6 z; @' Q: D9 m, N
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
( R6 R6 [+ C: [2 z9 p( q& ~+ K\Uninstall\SoftICE
! y! p9 f2 ^5 o0 R; C# x+ b! b-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE+ G' ~# u2 U$ a- r. p+ k
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
7 W" _. `* O+ ]\App Paths\Loader32.Exe
- v. o; w2 V( v8 _) j$ J% T, c* }% H; C0 ?# t% n& v. @8 F+ P
' v# X9 _/ H0 U$ W' f
Note that some nasty apps could then erase all files from SoftICE directory
0 w0 ?$ x" K+ O+ @' H. O' Q- X(I faced that once :-(. a9 `$ ^" a2 i, h/ w, Y6 b
$ }/ ]5 v; f* ?' c: t* [; p5 t- d
Useful breakpoint to detect it:4 q& I% J( U' }, `& ~7 J: I6 o; t4 D
% R" ?; F5 X$ N BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'0 t4 m3 q1 E* S5 f% U1 ~
5 \1 j* c$ ^2 ^* @8 Y" N
__________________________________________________________________________
8 D! T+ [9 w6 D' X( n* J. B6 [) T0 j+ U: [. y
+ @+ ~$ G/ g. @) H9 i8 R
Method 14
( R% v2 ]( c% ^4 E; m, m4 `=========
' v0 U# S5 |8 Q7 p) V1 J Q
# L, {: v/ d/ L) d' JA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 d. H( T& V/ Y7 u0 L0 ~% }
is to determines whether a debugger is running on your system (ring0 only).; |% m6 C& S) f+ w! T4 y
. v, N0 Y, F ~6 t2 n1 _$ ~: \8 w
VMMCall Test_Debug_Installed
) W; Z$ u) E& b) J" Q) \ je not_installed, x, j @5 D' W/ H. K0 {/ K1 @: o
% L) N) u* a* Z3 Y; F7 E' o5 q
This service just checks a flag." y, w1 V: }% Y: E, A; G8 ]: `
</PRE></TD></TR></TBODY></TABLE> |