<TABLE width=500>0 ]/ V+ X) d, k* B" w) d1 ^$ | h
<TBODY>9 c6 F. |1 b1 E2 b- s
<TR>: ]6 u# x; g! @. x" f. G
<TD><PRE>Method 01 ' K# c7 O5 U3 k
=========
( B" i1 j9 J7 ~# h
# z3 v2 V7 p; ~! m; S" `! M! MThis method of detection of SoftICE (as well as the following one) is
0 V" M/ O: t( p I2 Z1 jused by the majority of packers/encryptors found on Internet.
1 `( H2 F+ b+ ]$ CIt seeks the signature of BoundsChecker in SoftICE) b. i; a0 I4 ?0 g* \5 ~. J i3 N' o$ i6 O
4 _5 v6 B- a; O6 G) Z0 ?
mov ebp, 04243484Bh ; 'BCHK'5 k$ p0 [% h0 T0 M
mov ax, 04h% D) h/ K+ h- L6 y/ i q$ e& E
int 3 * j$ ]7 k: b& p8 j' x6 r9 k
cmp al,49 n5 d3 v1 ]9 n. p' E7 `9 m
jnz SoftICE_Detected0 H: N' v/ ~% Y+ d
8 U- z& j' w2 _
___________________________________________________________________________7 l X+ B6 X8 f+ Q& h/ N
+ x' D5 \/ A' J G+ HMethod 023 J1 O7 ^ _6 J2 w. L9 t
=========0 N! h8 {' f4 j1 n
8 B! p% J, T* M. fStill a method very much used (perhaps the most frequent one). It is used7 c$ X1 d5 Z0 Z/ k
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,* B( b z6 N, k* ?5 h/ q' u7 g% K
or execute SoftICE commands...- @! I5 @: K$ A% O* X# Y
It is also used to crash SoftICE and to force it to execute any commands
6 z, U7 e6 l6 \6 R9 K(HBOOT...) :-((
+ d! @+ z1 f" c/ m$ r0 n9 s. H0 V3 r! I+ n
Here is a quick description:2 ~: q$ b! O) U9 a, r7 p. e& l
-AX = 0910h (Display string in SIce windows)+ q! i) n- x6 e
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
% k9 U: N: D \3 f7 l7 ]1 ?/ }-AX = 0912h (Get breakpoint infos)
9 w6 E5 y5 w2 E! e& D% z* {* F-AX = 0913h (Set Sice breakpoints)1 _/ b& _( t1 O+ o* h/ z
-AX = 0914h (Remove SIce breakoints)
, n( c& m2 J$ \- q x
, l% k8 q! r/ ^/ v+ p+ NEach time you'll meet this trick, you'll see:1 K4 A* L) o- W' `
-SI = 4647h* R h7 C) C7 ~( t
-DI = 4A4Dh4 b# \, t/ b3 ~% u
Which are the 'magic values' used by SoftIce.
1 I Y# ]% y9 ]% a5 y1 iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
6 X1 Y+ P+ C, V$ G
( j8 P2 h; T# J" q7 y) h- [Here is one example from the file "Haspinst.exe" which is the dongle HASP
! V B& B1 z; r& e, |( E$ E c- BEnvelope utility use to protect DOS applications:
6 r" G4 F `) W2 q: N% Y1 _8 w% @. J2 U1 \: ^. F/ }* G
* l5 k2 B( E( _4C19:0095 MOV AX,0911 ; execute command. |: \* r! P+ K, o
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" F) _6 c, ?: f2 n/ E P4C19:009A MOV SI,4647 ; 1st magic value., E4 m# Q2 C( |7 `, Y
4C19:009D MOV DI,4A4D ; 2nd magic value.
$ P$ L% [6 T3 h* ~ Y) i4 t& V4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
) d* L* P# b% G, E4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
7 [( ]$ n/ |: J) o4C19:00A4 INC CX
9 e: W x3 U8 w7 S8 Z! T" H6 \: V4C19:00A5 CMP CX,06 ; Repeat 6 times to execute% o% |2 f/ [9 d8 T: Q: [
4C19:00A8 JB 0095 ; 6 different commands.# l' W2 Q: j8 }/ M Q
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
4 r6 u9 S, j+ i, u4C19:00AD MOV BX,SP ; Good_Guy go ahead :)5 x$ w/ M8 z0 C5 a' b1 b W
7 [( T; Y: S! K: o3 ~2 LThe program will execute 6 different SIce commands located at ds:dx, which
' | V4 F8 S4 \: ware: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& M! f8 s) P8 w" \. N8 X0 u
8 A7 P( [, l# l. M6 r( O: G* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
+ e" ?4 g& q4 k9 p, ~___________________________________________________________________________$ E1 [7 ?5 _8 C) q' X* p
2 d+ G( q, i) S
1 m" r; a& c) }Method 031 V$ U r; A4 j+ M1 q. h; a
=========
; k( s0 A& L5 x+ I% P- @4 c1 ~9 \$ Y2 C/ B C
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
1 H6 H$ N/ t# [: ]7 o(API Get entry point)
7 j; |) U) o9 Y* W- I
& w; R( M# g2 s( A$ }& U; O1 r4 j# @1 p1 Z) i
xor di,di
+ ]5 d& A+ @' v. n0 ^- O+ y mov es,di a) ?$ r8 w. S
mov ax, 1684h
7 a* S; H1 @5 `0 Y mov bx, 0202h ; VxD ID of winice- g/ E: X: ~+ {" L; E s6 @
int 2Fh
) p4 I1 F l! C/ Q4 t mov ax, es ; ES:DI -> VxD API entry point
! F D$ b1 f: i add ax, di4 l+ F/ U# x$ C8 z0 Z
test ax,ax& f. o% ?2 E2 j5 r3 ~) j+ U1 t
jnz SoftICE_Detected |1 ]0 `2 {7 D
0 W; j" ^/ p0 Q. |___________________________________________________________________________
$ V- p) B6 J+ d
* ~3 l+ y% j% G% a5 l, MMethod 042 s& m, _# \% B8 f+ S
=========
+ b" z: H" Z2 }; T
' L; Z) z0 v2 m6 V* f2 E; _5 I% |Method identical to the preceding one except that it seeks the ID of SoftICE
% f) Z4 U/ `" P% \) EGFX VxD.
' y- w0 N9 S" M! A* X6 K, @7 X$ t# W6 O
xor di,di1 v. E! p* Y! }& N3 u
mov es,di6 G! _& q0 k) ?7 p( n' q
mov ax, 1684h 6 V3 W( \4 {. Y4 l; h4 Y6 R
mov bx, 7a5Fh ; VxD ID of SIWVID
, {4 b. N5 u1 n& N int 2fh+ ~% `6 c7 g( X; _" r0 d. E
mov ax, es ; ES:DI -> VxD API entry point# ?' Z3 E7 u, r C7 W) O
add ax, di
0 x% C$ P! [4 m6 ^ test ax,ax
6 ]4 T2 z2 V, f8 m, z* \2 c' V jnz SoftICE_Detected. {. x1 h; p! _+ K+ L
- g7 c! }5 D8 P5 V1 F5 g; H
__________________________________________________________________________
' v7 @9 K3 e c/ q: Z: l# [! }, u* p9 |: u4 l# c' U; X
0 ?/ k9 \# u' l) i% CMethod 05# I g& a' p0 A1 Q6 s. \ T( }
=========
5 S5 _4 G0 l9 b4 P5 w+ w% U9 n+ `5 n4 a2 N
Method seeking the 'magic number' 0F386h returned (in ax) by all system
. a2 b7 `( U/ t6 D' c% j1 \debugger. It calls the int 41h, function 4Fh.
1 m$ N N i4 bThere are several alternatives.
- G9 I# V& P4 Q: u# Y" C( x9 f5 N0 c) g w
The following one is the simplest:
5 r4 P ]& h# z" j$ b/ Z; ` q! I
& W4 I) |$ j7 _ [ mov ax,4fh
! R* t) o4 H" J [, W int 41h# g% C' `! l( ]- L; q2 ^8 B" Q
cmp ax, 0F386
2 q! T- E3 L# B( c6 z5 X jz SoftICE_detected4 T1 L; A+ ` V# i! I( u
, A" Y$ K) D9 T* e7 H
! d0 \' O; A: g' C x" Z( C" e4 {
Next method as well as the following one are 2 examples from Stone's / l! A7 K+ w6 H. d9 j# K
"stn-wid.zip" (www.cracking.net):
2 [6 x6 i- g) \- D) B" L
# @; x$ w- p! S9 A: m9 m mov bx, cs
. o- y( q( } \1 R. K lea dx, int41handler2
1 F9 Z% X. F2 E$ X( ` xchg dx, es:[41h*4], N+ J: S2 A+ ]5 A
xchg bx, es:[41h*4+2]
* i4 @( y4 H) O. u' \6 |8 _2 h mov ax,4fh! h9 X* W* \( g0 B; G5 H; C
int 41h, j. m0 q' s2 k; s- p7 v7 ~
xchg dx, es:[41h*4]
4 F+ {0 l0 E: l# m xchg bx, es:[41h*4+2]
& }3 q- Z7 g( t5 L- z5 z cmp ax, 0f386h
5 R: `, Y3 b; _% U. S jz SoftICE_detected
2 c) s0 }. v6 p+ j$ _8 H4 [0 W% u& B
int41handler2 PROC
3 l. m" s/ M' ^; h8 f% L iret r o$ m& j0 P/ ^
int41handler2 ENDP
. ?1 j0 y3 i0 c8 D" M5 n
# R7 _5 V6 p9 C+ f" K1 r* x+ ?4 H1 z% E% c- ]0 p
_________________________________________________________________________
+ W" {: [$ s( ~0 k* \' b0 C/ S, p& |' f, |
+ I/ o) X9 [0 b& E- ~
Method 06 W6 y O% F8 X& s. }& m( Y
=========
F4 I8 Q. o8 i. s s& S9 E6 P4 g, Z
0 i* @, l0 |4 B% H1 J$ x2nd method similar to the preceding one but more difficult to detect:5 p: @, U! A6 |. r; J# J, e
3 ~( U8 [/ s7 S, I {# c, @ `. J
! D% e, Y1 j9 G. ]9 ?6 B& Bint41handler PROC
2 a* j4 ?, L6 e$ i mov cl,al
/ e: Z, Y3 ?( f% V% h5 T) \+ A iret
% E8 s) S6 W$ c$ Nint41handler ENDP
7 F% H" V% \2 y, A5 J
+ _4 g2 I4 P' c
4 _: x( w& j, K9 M# V0 w9 C0 _. n9 | xor ax,ax3 O$ [5 c0 e6 a* W5 A. a. e
mov es,ax
) i+ h% l; Y; Q: W mov bx, cs
) T; t! G+ g p c$ n& D lea dx, int41handler h4 X- e3 ~3 v
xchg dx, es:[41h*4]
" d1 C: R6 _8 m9 i xchg bx, es:[41h*4+2]& d& s% B" A1 K7 \
in al, 40h! y: s+ x* o! X* s
xor cx,cx
: o+ d6 z/ X: |! O: }# O int 41h3 l7 a8 M/ }, Z: H, w
xchg dx, es:[41h*4]
5 @! M* s' F/ s( |5 m xchg bx, es:[41h*4+2]
7 i5 h- R1 L7 R$ d$ A, I; r cmp cl,al
0 b) q) V( y2 r7 S6 K" ?2 m jnz SoftICE_detected
; S0 q1 h& L6 |& o7 G" c+ g5 x w1 _* M2 m$ o
_________________________________________________________________________
& W, A& J B: l9 ?$ g) B
2 n9 G# a; M) h6 t& e* K4 r) zMethod 07
/ W9 f) f$ @+ R- O7 d) J=========4 [2 J5 q1 }3 p
2 A a, z1 \4 b7 Y5 c: @Method of detection of the WinICE handler in the int68h (V86)1 ?9 ?) `5 p' L% ~
: `1 k) v) t. Y- E' B# J mov ah,43h" y/ [- B D/ h; M0 ?' u
int 68h
7 k0 q& p9 f; z( p% \3 O cmp ax,0F386h2 e( T# Y1 d- X" R- h$ e
jz SoftICE_Detected
& K3 s; ]3 g" V# b; U: \0 `# N+ D0 W3 \5 K, c* k- a
/ S {2 G0 I- [% u2 @' y8 b
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ Z# o$ t1 f7 U; \, [& ?: ~8 g, M app like this:5 Y& D# |1 y* {9 K
- _% B8 p; p7 O, s+ D. x
BPX exec_int if ax==68
% c( K; U7 v- P (function called is located at byte ptr [ebp+1Dh] and client eip is
9 Q1 }9 ?% y! P4 P' _3 a* a' v located at [ebp+48h] for 32Bit apps)
9 A1 c9 v. K1 x7 T i0 o3 N9 `__________________________________________________________________________
' Y/ h4 l- k' _# h0 V; q; I! J1 E# u/ m( T
; e7 k; g7 T" X0 |- c- oMethod 086 Y2 v4 F" K: P1 `1 B1 M; q
=========
/ [& C' Q, ~! e# C& S" R Y+ d0 `
It is not a method of detection of SoftICE but a possibility to crash the
8 \9 l0 ~4 I7 H5 b% Zsystem by intercepting int 01h and int 03h and redirecting them to another
) I+ F8 F8 S0 i" k5 j" Nroutine.
! z, b$ G) V: A E$ r9 ^It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 x" o0 n+ T, y; d# }$ [$ E7 [
to the new routine to execute (hangs computer...)
- Y' A/ i! z3 z# O" F& T' H: P# l5 s/ x- I* s
mov ah, 25h
& t6 v+ ]3 k% D& d) G, _ mov al, Int_Number (01h or 03h)
- L1 _" U% K$ O7 [: Z4 h- V- g mov dx, offset New_Int_Routine3 r+ \9 r/ l! l
int 21h3 Q7 B3 e( G7 K/ ?9 l$ O8 x' Y
( ]+ [3 t5 {6 e& b( a
__________________________________________________________________________
0 P7 k' s$ {/ c8 h7 U0 g2 q/ e( }! G; E8 B2 j
Method 09) S2 s. M! J7 ]7 L
=========
0 Z% r5 H7 F5 s: U$ x$ F
5 W( B' Z, O* IThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. K5 c' D+ W9 |8 c. b, @! a
performed in ring0 (VxD or a ring3 app using the VxdCall).1 [1 h; G8 o1 |
The Get_DDB service is used to determine whether or not a VxD is installed
2 L U. s2 F' M8 R, f- t$ q8 Mfor the specified device and returns a Device Description Block (in ecx) for; w+ Y! R* f k5 S; n& r) _
that device if it is installed.
$ c5 w9 A J4 Y8 F: c
3 C$ _ S& n* G9 K mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
$ l( o" m* B J$ i" R mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% R0 g, X) z \, J. G s! Z: M
VMMCall Get_DDB+ I4 z9 i/ B1 g6 M) R
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
8 F* V4 z+ k7 G9 t v C$ E& V* ~
k1 b' Y: H+ p2 ?& Y- m- f/ INote as well that you can easily detect this method with SoftICE:' @1 L1 W$ p2 V
bpx Get_DDB if ax==0202 || ax==7a5fh
; e0 t- d! \! N/ P1 D% t: n3 n( N
__________________________________________________________________________+ D/ U1 j8 R- V6 g9 O
6 z8 ?: [( c7 P; ]1 P8 o
Method 107 t1 j1 P0 `4 z2 y
=========
) l9 L: j6 [ I& H; m' D: ~% ?. U; }. |$ I# I2 |/ J3 E7 |. n
=>Disable or clear breakpoints before using this feature. DO NOT trace with; v9 e: W) E, y8 m
SoftICE while the option is enable!!" n. ~# q" l! E4 R" w- _
3 W D" v6 E- Y
This trick is very efficient:6 z8 X! O3 y0 p$ F0 o, V, W; ?
by checking the Debug Registers, you can detect if SoftICE is loaded
0 _9 c1 s+ V w# Z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! q$ r; y, C5 _there are some memory breakpoints set (dr0 to dr3) simply by reading their
+ |* [5 k# ~* i. k6 ?5 ~' g6 B5 Ovalue (in ring0 only). Values can be manipulated and or changed as well2 \0 w& h: `; l( x2 {. R: \ s
(clearing BPMs for instance)7 K! z; ~5 s' g. I1 i
$ ?- D3 A+ n# B1 J- f& r
__________________________________________________________________________! z! Q+ I9 D9 w
5 `8 y: i% M1 T5 `% K
Method 11
( W- e Y4 N4 U# h- ^" ]========= E/ L" E; Q; }& o9 { d, g5 x
2 c* |( ?' n1 j
This method is most known as 'MeltICE' because it has been freely distributed0 q0 Y* S& o$ K; W3 B
via www.winfiles.com. However it was first used by NuMega people to allow) }* U; ~ K; s
Symbol Loader to check if SoftICE was active or not (the code is located2 z- q1 [& ]: \% j2 N3 N
inside nmtrans.dll).8 \' K% F0 M. t4 [" _2 G
$ q% a7 f7 @& x) e5 L8 oThe way it works is very simple:
# s( L9 X& R* N( t4 D! t$ \It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. u! ^9 [0 @- N- K
WinNT) with the CreateFileA API.
7 }# \7 I0 ~4 z2 p( p9 I- z% k- N5 @
Here is a sample (checking for 'SICE'):! ]* B) b- \1 i4 Z( k2 r, ]
* \- Z! J; A* A% q; ]3 lBOOL IsSoftIce95Loaded()
( U" N9 L: [$ y8 a2 Y3 Q* ^5 g{
B/ B# {/ f8 ^* M( M' r HANDLE hFile;
4 i' M0 B `; R% Q+ \: s hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
0 t/ T6 b2 \) Z M) A1 D FILE_SHARE_READ | FILE_SHARE_WRITE,0 ]7 z: l* U4 W, Z8 G, n
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
: X" h1 T' b( R' ]( O+ p! Z if( hFile != INVALID_HANDLE_VALUE )
. z/ U6 Z) @2 N {
9 s" W5 k* c7 u& o; l CloseHandle(hFile);$ X- o. C- g9 n! x! c; a; l! D
return TRUE;3 c, L% F0 m1 B
}
+ q( |- Q* Z: j3 O0 \8 z' D return FALSE;5 W1 a8 [# C0 @2 W+ b
}
* Z D2 n( m& N9 u/ r. x) v$ {. P/ j- ^; B- P# S
Although this trick calls the CreateFileA function, don't even expect to be
4 ^% R c$ b/ @& yable to intercept it by installing a IFS hook: it will not work, no way!
3 }0 P: l3 e; Y9 IIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
, L* [; S, P: X# l2 \6 E6 lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
5 T# {8 P/ _; O p, ^. Uand then browse the DDB list until it find the VxD and its DDB_Control_Proc
* V7 O+ q& h* A* Ufield.
2 s+ _" b; N: q0 g0 g! R! x6 HIn fact, its purpose is not to load/unload VxDs but only to send a - Z% y, X3 c: c
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
+ ~* D4 a% K! P1 h' x% V% \to the VxD Control_Dispatch proc (how the hell a shareware soft could try, M8 l/ N I L. E6 J8 b3 i
to load/unload a non-dynamically loadable driver such as SoftICE ;-).( R+ n# q, N. m, j
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 @4 l+ }# L9 s0 f' ]5 Eits handle to be opened and then, will be detected., e& `( {; c" C$ b& E
You can check that simply by hooking Winice.exe control proc entry point
$ R& U* ~7 c- j5 W) ]0 L; Gwhile running MeltICE.
# R* n5 c5 d7 C' ?% e+ `4 \& @8 i- B: v: T; @+ N% n' m
) Y1 W2 {2 s: {& Z. B2 v 00401067: push 00402025 ; \\.\SICE3 s+ Y* E+ ?0 S' P( K2 H4 Z$ Y2 r
0040106C: call CreateFileA( n& k i8 b* d+ F) T+ z! T9 k
00401071: cmp eax,-001 U% C0 x& X9 q, l
00401074: je 00401091
5 A1 f5 e, p$ E6 w' n9 q- I6 n7 F
1 y; i+ ^) v3 B; M% e7 n: b% K. {: `# P2 |: {+ [" ]% `; {
There could be hundreds of BPX you could use to detect this trick.4 B- t$ R3 u6 B/ G5 @
-The most classical one is:
7 {3 U4 ?$ W5 e- |4 W# H1 J BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% y5 L5 ]$ i f8 _0 U U *(esp->4+4)=='NTIC'
+ q$ S8 K$ J# {8 f+ C, E
- _0 O- p) J0 |% h; p8 ]-The most exotic ones (could be very slooooow :-(
: E" t( H: F n4 U" { BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') ! `/ Z0 ~" |0 a8 I! M3 Y0 l
;will break 3 times :-(' W$ z3 `, o9 C$ w, c) Q
; N8 L# v) q# ^0 v0 G-or (a bit) faster: $ z* [# n( z8 G2 B2 Q9 I; Q
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% O4 w, Y1 z& Q' X5 ]! v+ s# a H2 ]* e1 h& Z8 F; y( T
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' 6 ~& Z% ?. T; _! c/ ]/ m# `
;will break 3 times :-(* e* K- F0 ?3 W- H4 E4 E j
7 r" c: y9 \) M* I9 v
-Much faster:" H" I R' E1 p4 `
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'8 p5 U: l4 s& M8 b! x2 }" a
; u* D; v+ t4 [- }, v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen. T7 x* z6 s8 i5 r3 e0 z) x1 L
function to do the same job: d a: i5 O1 f! M. t
W( v' a" @4 h% O) O/ w push 00 ; OF_READ9 P- F9 x# Y/ s, m0 U/ P m
mov eax,[00656634] ; '\\.\SICE',0
) H1 \- p- j6 i( Q push eax( A1 F4 P$ [& z K! ~( z
call KERNEL32!_lopen
& Q, V4 q) ^& R) p3 g inc eax
; F y& e$ t# j/ S r. _ jnz 00650589 ; detected0 y$ ` f4 V4 {
push 00 ; OF_READ
) G5 l- s) H, O& F6 h mov eax,[00656638] ; '\\.\SICE', W1 p( Q0 L4 U
push eax' ?% V$ ^9 s ~# d6 L
call KERNEL32!_lopen: w1 ]7 H9 k1 p$ p: E! Y# o9 D8 ]. m9 c
inc eax
, q+ i8 p: `2 f, @ jz 006505ae ; not detected
' q( t9 Y0 j" H5 f7 _- Q* I2 e' Y! h. l# w# c M
9 ?5 o7 R @7 ~, w9 i: }, f. X
__________________________________________________________________________
2 n: ?: T4 B& k" }. y/ R
+ h6 Y& d9 C7 R" w0 ?3 N2 GMethod 12
8 ?$ G+ T R) V=========
# X8 \3 p3 ~+ K* p9 q7 g9 { J4 N/ }" E s; U; i
This trick is similar to int41h/4fh Debugger installation check (code 05
/ h; O( x o. O8 d% [/ J& 06) but very limited because it's only available for Win95/98 (not NT)
. ]- f6 u, o9 i7 d' ^5 Aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.% P$ K; U+ T5 Z& l
# W7 b/ o6 \, v% F6 L# {! \
push 0000004fh ; function 4fh) [ Q( ?% ?) l$ t; h, i( i. m% d
push 002a002ah ; high word specifies which VxD (VWIN32)
) W9 y2 i; Z8 i4 a( G- q8 u1 ` ; low word specifies which service
) ?1 V7 A% [8 t (VWIN32_Int41Dispatch)4 t/ a6 I) z0 i2 R/ f( z) _
call Kernel32!ORD_001 ; VxdCall$ |0 F6 F: n! m$ n, [9 [8 o3 }
cmp ax, 0f386h ; magic number returned by system debuggers7 d3 C0 s7 w p w
jz SoftICE_detected
7 K. }. D' I) R: g5 D2 I% [
$ T. `. A; h" h: GHere again, several ways to detect it:9 c: K: ~3 |; R' G! r9 g
" Q1 y' u' o) ^8 h; z$ c BPINT 41 if ax==4f
2 e% u- `. |* d* c" ^
3 g; L+ P ^& r: g% B BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one3 P9 F9 F* ]* S! x7 p( x% t
. b' G1 L8 G w& m
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
4 n, g6 s2 s5 S- x- b
* |, P5 o& s3 J% Q" E BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 k+ O' U, @& j2 } r) I$ `
5 e3 k# s" h% R* z8 {__________________________________________________________________________
/ U1 _! M0 A; w* L% q; O) Q9 H0 v- d! D( E- o0 b. H' G
Method 137 A5 G* z4 @* N4 L
=========
' t) J0 i; X6 V& L+ U
' ]+ ^1 O9 M: p. G& q) H4 bNot a real method of detection, but a good way to know if SoftICE is
- Z- x7 V- m) j; B9 T6 E) W, `$ A* zinstalled on a computer and to locate its installation directory.; _1 D5 F* d8 S; \( P9 h1 @3 i0 U |
It is used by few softs which access the following registry keys (usually #2) :
/ o# b- K/ e8 r$ N# I( I) c
% O# b3 A! R4 f: l8 M% v0 u-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% K0 q1 P5 _5 M0 @/ k\Uninstall\SoftICE7 K# R+ ^* V# j3 i0 p8 q; n h! K
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE7 o: r' _9 n. I5 U2 I
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion8 K7 f% Z/ a4 H# m
\App Paths\Loader32.Exe
8 _# R. W J6 s, D3 T
( J' m. ^$ @* s" c/ V @; d& }- I" E1 K# j0 B# F; z( Z! `& U
Note that some nasty apps could then erase all files from SoftICE directory: P# t. W$ r9 t' q& I' x
(I faced that once :-(
^: ~$ x, w! T$ z0 C% n' H' ]( `8 X. E7 e! t- Y
Useful breakpoint to detect it:& U/ A+ |* L/ n$ D* K9 R
* J3 ~. j4 E3 M BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
6 o- }: {+ |- F
: s/ |# {" j9 n__________________________________________________________________________1 M2 q( `$ G0 f8 o
$ G* Z. g& w m( B8 F
. q0 |* a/ W: ?; r9 v- S$ J, ~
Method 14 . _, [ t7 ~, p1 j3 T6 a8 e
=========
: G% i, F+ T6 l0 m
0 r) E& i3 x& \* ~A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ |3 Q8 Q% D9 u3 Sis to determines whether a debugger is running on your system (ring0 only).' h4 }1 ]# h: J# P) f/ B1 I# _
7 K- T; d1 g% r8 s1 ]" z+ ?& Q
VMMCall Test_Debug_Installed3 M6 A+ _4 D9 y# N* C# ~+ ]; G
je not_installed
}! R6 e, g8 i4 c! X2 |" K% e/ w4 j6 q% ?0 Z7 i% K* R
This service just checks a flag.
% C$ @3 d4 I7 ]$ o3 w" ~% s</PRE></TD></TR></TBODY></TABLE> |