<TABLE width=500>
, W+ u8 U3 T5 g+ y; b<TBODY>
# s, @" e7 _% f+ [) v5 H<TR>, b" b* [% K& e( U
<TD><PRE>Method 01 $ k& G. A8 E3 P% t$ F
=========
+ F( B$ a. ?; k2 ]! g0 P# `+ d1 W' R0 B- m. D h
This method of detection of SoftICE (as well as the following one) is8 i: E4 g8 p( g6 K7 ^
used by the majority of packers/encryptors found on Internet.
5 i* l6 n* k% o, T% xIt seeks the signature of BoundsChecker in SoftICE
7 }/ X/ x, E. l. t/ w4 z+ @' u* ?5 _/ f
mov ebp, 04243484Bh ; 'BCHK'
3 p2 A3 B& Z# j1 `- u, k8 R: | mov ax, 04h
) G7 L. g% S3 M" @$ O& m int 3
$ K" n; ~! j& S% p# C& J cmp al,4- J+ O$ K7 T; U9 B
jnz SoftICE_Detected& u. e3 X: x0 s0 b
7 \! B( ^, o( A$ m___________________________________________________________________________
/ n) D6 g0 {0 C5 ]5 O" P' A5 `1 n8 w R% C7 @
Method 02
) ^/ J' Z: l# f( V: w7 C# K- f6 A=========1 M* ?/ p6 Z" s! J; d
d; f3 A9 f" [! ]( U( a/ DStill a method very much used (perhaps the most frequent one). It is used
# V: s$ l9 O' `& c8 @0 p7 g: h0 sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
( Y% h, u/ S0 C: u9 d' p9 ior execute SoftICE commands...) F3 t7 S& j3 c; I$ R& q% Q
It is also used to crash SoftICE and to force it to execute any commands
- g* b3 U; Q6 V/ `. |4 d(HBOOT...) :-((
1 l2 r' H$ g- `* g6 U) ]' C* |- Y" }9 a% G( W6 O
Here is a quick description:
( ^* s3 c" F- B, \) D! w$ d-AX = 0910h (Display string in SIce windows)
0 r% j8 d& r p6 M+ P# m+ d$ F-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)0 ]/ p3 ]5 \& M' B- X9 g( |
-AX = 0912h (Get breakpoint infos)
( G4 T$ R1 x& X9 h-AX = 0913h (Set Sice breakpoints)3 K6 j2 T3 u5 G7 K( i i5 @, ~- W
-AX = 0914h (Remove SIce breakoints)3 H: H6 ]! g6 z( n
/ c! }( v' L9 s( {: PEach time you'll meet this trick, you'll see:
: C; G# G8 [! C# R-SI = 4647h
+ A) ~) Z: b/ g-DI = 4A4Dh
( @. M5 z1 {% \+ b4 S5 n9 d" OWhich are the 'magic values' used by SoftIce.! R7 q2 @0 {5 e8 w
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.6 k3 R3 x3 ~& f4 Z U$ N( [
/ V3 ]) p ~! g& O! n$ x
Here is one example from the file "Haspinst.exe" which is the dongle HASP
6 R$ X7 R0 F8 M- kEnvelope utility use to protect DOS applications:/ y9 i! ^6 u7 W5 Z7 B
% \! u/ [5 o; @. d; B; p4 d
" b* \1 s. O' P/ K1 U( A4C19:0095 MOV AX,0911 ; execute command.* {; C4 D3 n% I3 [1 M
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).# ^! Z J2 x5 [- E- m5 q
4C19:009A MOV SI,4647 ; 1st magic value.4 q* y4 A4 v) L' P
4C19:009D MOV DI,4A4D ; 2nd magic value.
8 D2 ?: e& \& E( M4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*): l* @+ t4 H9 J# ~6 u' n3 D/ J' C
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 j' R* f+ Z% h: l4 l( a3 \
4C19:00A4 INC CX9 O8 D- I2 l% e- t+ [* V& Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
" ~9 R9 w$ D, j# X0 x1 U" d6 S$ [1 P& G4C19:00A8 JB 0095 ; 6 different commands.
2 y/ V, q; n+ R, n4C19:00AA JMP 0002 ; Bad_Guy jmp back.( U7 C3 | \, g, N. g
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 D {$ w6 d% g( O2 Z$ e0 s w6 M& n1 m2 l: [
The program will execute 6 different SIce commands located at ds:dx, which
1 G! a0 K( a% j0 qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.' F, h7 d" f& z, k, o* A
8 T1 S& `: Q; h" I; N2 n& C& a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.' ^+ l* D1 }. Y& ]& W. l7 z
___________________________________________________________________________% f( {+ K' V: N) e+ {$ h
7 u7 d) d( M! S; H" F! p+ E) a9 ^: G' B4 i9 C
Method 03
@# Z7 p$ e8 V* V& M=========% t$ f* J) j- r/ V. ^: \' N
0 X6 s7 e, u; XLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! Y5 u% V" M5 R% a0 C5 G" o( |(API Get entry point)
+ o$ n8 h1 \. U ; q/ U! M/ X" b( _) i8 b$ ~
0 M9 I- |( c1 T1 m' }" f V& s9 m xor di,di6 B. U+ e' o) v. V0 o' @: E
mov es,di
, d4 v& [+ Q* B( |$ J: W mov ax, 1684h # t1 n& t- A+ p: e7 f
mov bx, 0202h ; VxD ID of winice
' |* T9 ^, D! Q7 S( g d$ t int 2Fh
; M' K: c+ o' t8 \' c1 X' X mov ax, es ; ES:DI -> VxD API entry point
# ] k% `8 K: x$ z% P: i, O- u add ax, di/ I4 e8 h+ B' o# u9 d2 e
test ax,ax$ ]% h. n( F9 v
jnz SoftICE_Detected0 f2 a d e; u4 l0 o! S4 M
3 Q" W1 B5 N: J' y- V___________________________________________________________________________$ X/ V% m* J# K# I% s
9 C/ X0 O- ~5 A$ I1 ]. HMethod 04 P, y c* a* g
=========5 p- f- Y8 o$ m1 Q L
, J& j1 U1 W2 ~5 `& T7 x
Method identical to the preceding one except that it seeks the ID of SoftICE' E2 Y/ e. K, e2 y
GFX VxD.% H+ z5 A1 q1 D5 H4 @: \" J+ a: V
) c' ?( c7 _. j4 | xor di,di
2 D/ w& y) V& @! _, T8 v$ D- S& v0 C mov es,di! {8 C1 e, r8 Z8 n
mov ax, 1684h
2 G& B s) h% \1 h4 e9 G4 l9 y9 w. G mov bx, 7a5Fh ; VxD ID of SIWVID# o4 t) R/ t3 r$ @* f' M5 l
int 2fh
( x) j3 l8 }& l0 l( y mov ax, es ; ES:DI -> VxD API entry point# \1 J$ q7 ]/ h5 K& a! w* i' d
add ax, di
7 G' u# j! b$ }8 q/ b/ J" ]: H { test ax,ax
9 U5 h7 I( o2 H: O jnz SoftICE_Detected
. c Y6 e- t7 L! }; B2 G6 [) N$ J! r$ Z" l! Z6 c
__________________________________________________________________________
8 m5 I7 `9 t3 r
* Q! h) n2 ?3 \- I( v, m0 ~
4 [1 E+ }- d. iMethod 05 j7 B/ u! L# P& } A$ ?
=========
! |' e3 Z" w3 y' g1 Z9 N6 I c; y/ T" U, i
Method seeking the 'magic number' 0F386h returned (in ax) by all system
7 ?: O+ ^9 h7 r' Fdebugger. It calls the int 41h, function 4Fh.
j+ Q* K# x4 C) u* [There are several alternatives.
1 W! j) n% w; ^( I# j& a' ^+ {' n$ T4 w8 r7 t
The following one is the simplest:8 s) ~6 Z" E; E0 [* y
. u3 T: g, @ P mov ax,4fh" f R' V- E W: p8 \* C5 [( b
int 41h
2 `0 {: Z, o, S! Y }& c cmp ax, 0F386
" n* z: M8 X2 k jz SoftICE_detected3 i ?- x% K+ O% C
8 M4 F7 j* K# M# h' o8 D: c% W. i3 e9 e# d) K6 j* _
Next method as well as the following one are 2 examples from Stone's ( M" E; t8 `7 L2 ^7 n: `
"stn-wid.zip" (www.cracking.net):
+ Q% p$ Q0 y4 J% i1 R9 @$ }# r
( g* L( n+ g9 \* L mov bx, cs% l0 A! r& v, e$ F. g
lea dx, int41handler2
9 D5 e/ f. a' D- c i$ B) L xchg dx, es:[41h*4]- r7 c; ~: `+ C2 ?
xchg bx, es:[41h*4+2]
! U' c# J% v! T) C6 f mov ax,4fh
* C- u Y9 q: n7 X# t6 j7 g3 g int 41h: W. {# Y9 w% ?' \$ c1 |8 B" @ Q
xchg dx, es:[41h*4]1 \2 ^5 i% z& W- Y9 P! c
xchg bx, es:[41h*4+2]
% A7 n/ {, z' F& j$ e cmp ax, 0f386h+ H5 p. `) p) I
jz SoftICE_detected: B9 w+ \- w) f/ }
s0 i( @! ]& s5 c- Q6 r$ Y
int41handler2 PROC7 A( k" ~8 F& _" B7 Q
iret+ O' v. o- `# D0 M& e1 x9 Z
int41handler2 ENDP
8 ?) s: ]( l+ w5 M
4 V* L( C& @# t# E3 W. o
: B. P* y! ?: {8 M_________________________________________________________________________- W( E2 Q# h: F. a+ x
. C8 R8 m, M b# \, I' ?6 W6 G+ n" k+ _4 t
Method 06
- J6 Z a: {$ f) w=========! z- X7 p6 o7 h
0 u8 F) X' v S! z% N ~( H
$ C7 Q4 s( l1 C0 W$ m" u5 @
2nd method similar to the preceding one but more difficult to detect:
) ^% |) J |* @; a5 T4 u# D0 C6 V8 o& w- C8 `& w6 S9 n4 g1 I3 S
: E7 I& r$ ]1 g" F! t O( Pint41handler PROC$ a% m# D( E( p u" ~
mov cl,al
* Z# s1 M, I2 x$ m0 z iret
8 h" Q1 t7 H9 U5 W: Y" Rint41handler ENDP
9 ^! @! e! J( T1 ^ X6 a- E& g
: U6 m8 v4 Y, G1 e! [% k8 H/ U+ z4 G4 _% C) ]! m, j& C
xor ax,ax* g3 Q" j4 F+ M
mov es,ax. g \& w; }& b* F* V2 U2 `
mov bx, cs9 {! [! `( A* Q) o+ a- m" t% ]
lea dx, int41handler
' z! M2 }! Y% S6 C& A* K xchg dx, es:[41h*4]" _1 d w2 `7 t4 {. v3 ?; ]' Z
xchg bx, es:[41h*4+2]7 o7 Z: \; v* z. b" O* L$ }" _9 g
in al, 40h8 Z+ S. E& G0 O" B
xor cx,cx
1 }' l6 a7 v5 e& A2 l% P int 41h
& \+ t; m2 Q, ~& K6 m P xchg dx, es:[41h*4]
1 v3 x O( J ?3 b% j" c xchg bx, es:[41h*4+2]
2 P8 r5 ^ d" {% K cmp cl,al/ b! b4 ]& {+ u2 m L* W
jnz SoftICE_detected" U( [) N5 S9 z d7 Y7 [% P
$ y+ [6 f! |$ s: [( ~+ [
_________________________________________________________________________( V8 m) E* \6 ~
+ Q. X i$ U8 j& X; I; D+ v! N4 E" F
Method 07
9 i5 u6 j( F" ]9 _" x=========, ?' m7 l1 P* G: D d2 K
/ A# l; S: V' N2 H, N' S4 _( D
Method of detection of the WinICE handler in the int68h (V86)/ A; P4 m; f }3 k* `4 B
6 A# V9 w o( r, k9 x( s+ R mov ah,43h
5 ]( z" s3 k! o; A4 } int 68h
: {$ Y/ Z U7 K cmp ax,0F386h% F) N) b0 n& I# s6 X- T
jz SoftICE_Detected, ~/ t% z2 K5 ?
) H+ T" S( A% E" `! H) ?
6 W, ?/ m3 f' j6 ^# W& e9 O# r+ e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" m* F" `0 D5 j# a app like this:0 n: Y1 B1 Y& x Y- \! w
& @6 L8 ` Y b8 i% k: p2 D BPX exec_int if ax==68/ k2 }0 L8 |6 j1 K
(function called is located at byte ptr [ebp+1Dh] and client eip is8 r. h. I6 k# Z) P
located at [ebp+48h] for 32Bit apps)
$ c! t. d- H" I__________________________________________________________________________
. f/ }! {7 V% }) x- a1 y$ F E+ h t4 h2 E) V4 R( u
p# C3 G& _& V' G1 o, P" {9 ZMethod 08
1 o3 F& ^ X, k& q4 J9 A=========* `, `/ Y) L9 U# B M" P; D
% L7 a- U" N: t" k$ Z
It is not a method of detection of SoftICE but a possibility to crash the- v5 Y: a; W+ q2 H( F! p
system by intercepting int 01h and int 03h and redirecting them to another2 Z$ `, N- _5 Z- R6 S1 h
routine.
! t" m/ n1 f8 {- {6 sIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
, m6 f( e1 |% m# @9 k {! l0 I/ ]to the new routine to execute (hangs computer...). g6 m! r4 q5 f5 W8 J" F9 ^* r4 p/ t
6 x. v+ I$ e9 m
mov ah, 25h8 O: Z9 b+ @; v. }8 Z* w) J
mov al, Int_Number (01h or 03h)9 I- a% N" G9 l0 |6 p
mov dx, offset New_Int_Routine
- X) d% k+ _, Y# c5 Q; T) C int 21h" U, r3 [% R' ]+ B4 [: W: z
$ w* X6 G( u, a' x
__________________________________________________________________________$ t" D2 H b: l
* o! A1 p) U" u/ w7 b. x
Method 09
2 s" }; {0 T) G% k9 w" c=========
6 h. D& V X1 m* q/ o
: Q( U! p+ C6 o' }% `. _% _) A- ~This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% F$ X6 @# | p/ L# g( \2 Bperformed in ring0 (VxD or a ring3 app using the VxdCall).
K* B9 d+ t% r4 b" u# y' L3 |- P0 YThe Get_DDB service is used to determine whether or not a VxD is installed
% r2 C1 a, p" C+ M' kfor the specified device and returns a Device Description Block (in ecx) for* |! l8 x( l2 J. v
that device if it is installed.2 E2 Z: J( L- T, r& p8 z( Y% J
3 m/ P; M" `5 g. S, ~- ^
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ n9 a8 J- A, S% _2 [* f! Y- F mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)5 X- o4 z; h; N A+ b6 c
VMMCall Get_DDB) v1 a9 k0 f9 x z) a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed4 R7 w$ H+ Z2 Y
% X% u( C2 V2 H' [" K% h
Note as well that you can easily detect this method with SoftICE:' r/ h6 u* M O3 @: R- V( I
bpx Get_DDB if ax==0202 || ax==7a5fh1 X3 H: ]" Y0 z' P# ^% S' i
$ O+ `8 _9 X9 k* E8 D1 f. P/ R& E$ z
__________________________________________________________________________8 P/ a$ C+ K% B4 O
: ~+ ?( T$ ~3 ^/ }
Method 10& r& u' F! n& r8 `
=========
i& p% D0 N% K$ E5 ~: u& R3 @0 C$ a h
=>Disable or clear breakpoints before using this feature. DO NOT trace with; \( b- I7 O9 [
SoftICE while the option is enable!!0 e3 q3 J: }$ u; v4 D
( s- y1 ^: U; g' |9 M! `. n3 z1 ~$ b
This trick is very efficient:
/ l2 m0 H7 d% m* E0 H8 `8 Lby checking the Debug Registers, you can detect if SoftICE is loaded
2 D6 t! K& T1 F" C(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 G+ t6 I& P2 Y9 W/ p3 k" A, ethere are some memory breakpoints set (dr0 to dr3) simply by reading their4 Q2 h. z S: [0 A! t5 k
value (in ring0 only). Values can be manipulated and or changed as well! [: y) N( L' g; u$ f* T
(clearing BPMs for instance)% K: {1 E* z: F- u O8 K+ f
/ F) O, z% H$ M* L9 N% P( v__________________________________________________________________________
/ x) }, r; k+ _# y' D6 ?4 l& M* D; _( W, _
Method 11" v9 @4 c1 W K
=========! V8 b% K+ {4 u5 x
' s) o* w6 k1 T6 Y% X& _This method is most known as 'MeltICE' because it has been freely distributed
y; N1 k" p4 d/ {$ Hvia www.winfiles.com. However it was first used by NuMega people to allow
8 u/ l% y7 X3 a) s# j- Z7 QSymbol Loader to check if SoftICE was active or not (the code is located
) @( s$ Z4 p/ x. b: ^& a( C! {inside nmtrans.dll).
2 a9 B! C+ q0 H- h2 z" F) }
! G4 ?; }: { A! m% w$ oThe way it works is very simple:6 n% m$ {3 H1 G* @7 e* y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 _2 H8 n" c, D' s; k
WinNT) with the CreateFileA API.2 P* V0 w' e: r3 Y" e! }, A4 g% k9 h
8 L t: Z( o5 `7 I# a5 `& `Here is a sample (checking for 'SICE'):" J+ ^+ I7 t0 j" _- V. l2 h. Q; Y
0 x& e5 b7 b; o) D6 u
BOOL IsSoftIce95Loaded()) h- q+ J1 `+ [5 K5 ~
{7 c/ Q% Y) s, ?6 |. o1 x( e
HANDLE hFile; " U9 ?5 _8 v. U, }: C" {1 F
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,% Q, \/ I1 k. L1 a
FILE_SHARE_READ | FILE_SHARE_WRITE,
4 n- L6 _7 r# `. D I NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
) k& w! _/ F( Z5 M6 }2 y if( hFile != INVALID_HANDLE_VALUE )) ~& |# r6 o- ~5 R9 }. E
{
# X8 T w9 J- E CloseHandle(hFile);
" @& A+ P2 v) }* I return TRUE;/ c' u2 w" u+ r8 _, r6 W7 @
}1 f' H7 c8 N/ {
return FALSE;3 Z( P1 ~( J9 _
}) B+ Y5 U" I3 ]: C9 G
) r. ^6 h# L1 Q* E1 s
Although this trick calls the CreateFileA function, don't even expect to be! }6 S+ P$ {5 ]- T8 p
able to intercept it by installing a IFS hook: it will not work, no way!$ a/ _0 P8 b P4 @( \
In fact, after the call to CreateFileA it will get through VWIN32 0x001F0 r6 N& o/ \ b9 c7 \! Q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)6 J3 j. t: m e- ]- x& ?; |) L
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
. X% e3 x' Y0 I) |- T9 ~* Efield.0 F' N0 c3 x" M4 v
In fact, its purpose is not to load/unload VxDs but only to send a 5 |0 _. O5 l2 Y2 k9 ^& d
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! J& `! X8 B0 `( [3 M- K
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
. G8 D: p# |" q: x/ p+ N2 ^6 Wto load/unload a non-dynamically loadable driver such as SoftICE ;-). _- Y% r) f; q* Q! D
If the VxD is loaded, it will always clear eax and the Carry flag to allow' I2 V% W$ E5 U
its handle to be opened and then, will be detected.
' L1 }: L5 ] n- n& ^9 @5 v, q# tYou can check that simply by hooking Winice.exe control proc entry point
7 s" z1 B9 G: Z' f& B% Z8 [" Rwhile running MeltICE., F9 W9 F6 o- \9 I- c( ]
. Z2 B+ d4 C5 f5 z
2 @2 [ Y4 f4 V, t9 M( Q 00401067: push 00402025 ; \\.\SICE
6 V* C$ m, k2 N5 s$ f 0040106C: call CreateFileA
, \2 J- C2 X6 d& l6 i; `0 ? 00401071: cmp eax,-001 Q3 i) L( w" n0 N6 P( l0 l
00401074: je 00401091
4 t+ a# G, @! E; D* v' U! T7 | |- K w9 Y, V" M3 N
# U9 p, e/ p8 H/ f
There could be hundreds of BPX you could use to detect this trick.
" ~5 n! P& j5 U! C8 w! d9 q9 R, H; z-The most classical one is:
9 G' r0 m" e, o, | BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 y2 e3 e( \: L' L *(esp->4+4)=='NTIC'& D# O) Y/ t9 [ b K8 r. J0 l
9 p6 m# C1 Y8 c8 W-The most exotic ones (could be very slooooow :-(, J1 ?- {! U( g. o0 n J, R4 R1 Z
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') % A$ c9 |# T% Y( |/ h' L7 b/ U
;will break 3 times :-(% W$ m2 s; m1 o# ?: Z- g6 ?
, W8 @* W6 v4 X# @-or (a bit) faster:
; }3 F3 M" B, G8 i t( E* u BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
. I) `* ^) M& R/ W. M1 x/ N- Y& Q' [- W: G
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
- f& r p0 Z& {; g( F' h ;will break 3 times :-(& W( {3 U1 e" {( p4 f1 }
" ~+ X. Q+ z6 K9 ^5 J2 d-Much faster:, j3 t. {# W9 ~5 U6 O+ d0 c
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'/ I. q. k6 T2 n; |+ r$ H
" u6 A+ V: \: H7 Y( s- c
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen3 I# _0 ], U- y W; s) a4 ^% Q
function to do the same job:* p3 _# V6 c( w! q
% R& [1 P' j. h+ \1 ]- n
push 00 ; OF_READ
9 B* `9 I. A$ W* s mov eax,[00656634] ; '\\.\SICE',0" l5 l+ n) F+ O2 M; h1 I
push eax
9 s" ]. h% v+ r" o! M call KERNEL32!_lopen9 S4 C5 f$ }/ B, u9 t9 \
inc eax0 }% w- l8 F% E5 z
jnz 00650589 ; detected
; z! G4 U& K; `: B3 I6 \/ N push 00 ; OF_READ* U' T* q) v- E6 S8 Y3 j% \" r
mov eax,[00656638] ; '\\.\SICE'% [; a4 \' a; E X2 n0 @' W
push eax1 q% D, }' h! S" m1 z. t# V4 s0 H
call KERNEL32!_lopen& A2 [$ k3 S$ P- O7 p
inc eax+ I6 W r& {$ u# t
jz 006505ae ; not detected
% s% X5 `, ?' c4 M& M6 i* w& x8 \1 L2 }
' D0 Z; h/ K( @$ u: m__________________________________________________________________________
1 n. o+ ~: ^7 u% l" f5 k0 i
4 j8 r2 ^; O5 u% z/ N' {. oMethod 12, B8 e$ A2 s0 [+ A6 x" n9 j. ]3 {9 ~. y
=========
7 i+ H# O0 R' o9 E; s# B
! j& c& H. h0 w: z$ ^This trick is similar to int41h/4fh Debugger installation check (code 050 ^2 l3 W* Y) Z3 `8 T$ P o3 x. Y! L
& 06) but very limited because it's only available for Win95/98 (not NT)
& O2 C5 X# J* H/ a* Tas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. Y6 G, w2 P u* q+ N; ]2 o* A& P# h* z6 P' W/ W: ?+ ~! w3 y
push 0000004fh ; function 4fh- n) G7 C1 C2 U H2 h2 [
push 002a002ah ; high word specifies which VxD (VWIN32)
4 W. p1 L0 M& p' k. M6 ~ ; low word specifies which service
5 Y/ u! h* C; {3 { (VWIN32_Int41Dispatch)
( o2 Y9 ~0 {! o1 b call Kernel32!ORD_001 ; VxdCall: S# J4 Z. \8 i- i+ F, V
cmp ax, 0f386h ; magic number returned by system debuggers3 u( n' G7 l0 x3 ]; D5 ~& `; B1 [
jz SoftICE_detected& k" }$ S! r9 E
. M5 ]6 a; u2 QHere again, several ways to detect it:9 q8 I G# _# A0 S
, {9 m6 t6 b* C; ]" Y% y BPINT 41 if ax==4f
$ V6 G9 l8 {1 C2 o* ]0 `* s
0 ~% b u8 X$ ~4 m BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, e) R1 f$ I) X; m# V
7 e- e3 i8 ]7 L: c- K1 ? BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
* Z$ E4 X; G7 Z5 d
F' s- q# y7 K! K( c/ m BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. K! _; p# ^1 @$ X( U1 J
( K i1 \: j6 w ]# W/ U__________________________________________________________________________
7 ~8 r' D! d, S; M- P; S1 _8 M9 ^0 V
" X) C; ^7 t. p. C9 a) xMethod 13- ]1 g& M' l% u) B
=========
( c- @' u* P$ h4 r, N3 G
0 E' E0 `. x5 l' kNot a real method of detection, but a good way to know if SoftICE is$ O# l) @: y+ L- J+ V
installed on a computer and to locate its installation directory.& |) o. B- d5 E& `/ X% ^
It is used by few softs which access the following registry keys (usually #2) :
9 O F! M1 D& f4 o. a& h4 C) U, w+ n/ p) y( N& \; C# M" f
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ {" m! N+ l" k, ?! f& c+ `
\Uninstall\SoftICE
9 p+ d4 M$ g2 D& g9 ?* X-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
8 @) L2 H V; m# ]0 R9 H-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* m9 Z+ J& ]# d& j) G' W7 Y6 Z\App Paths\Loader32.Exe
0 ~ _0 e! x9 ]8 E
/ n1 w1 @7 k% B4 l
3 T- b c% J+ iNote that some nasty apps could then erase all files from SoftICE directory F$ r" j7 C* G4 Z* O) k
(I faced that once :-(4 n* \; H* T* u5 `9 ^- n
8 ^8 x/ w1 r1 ]1 }. H, w7 G) v) O
Useful breakpoint to detect it:
5 N6 y$ j! H# A/ W7 l) n' \' j" o! [
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'( _2 B5 H) c6 ^, w) L* Y) R
5 R% M5 n- |% }5 z# `1 m__________________________________________________________________________" {& b" s/ w1 }- C$ N
/ G5 N! M' @: F! _* V: L
* \+ M f3 A) c. e2 y; yMethod 14 " X% p ^: o/ i, ]- p. L6 H
=========$ ?# r( Q' f+ |. f5 ~2 X
0 S$ Y' c2 Y6 q3 g$ ~3 I+ R2 N0 l
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 M2 |5 a: m9 q0 `; a& Vis to determines whether a debugger is running on your system (ring0 only).7 |2 {8 B$ s2 Z; p( `! z
6 ] z4 g3 _( h; m0 ?( w+ L( w
VMMCall Test_Debug_Installed, ?) \/ `9 k& f8 A( o) C0 X
je not_installed
2 n# j7 m3 l. l2 t$ l* G* m) h: M( L
( f1 o2 f/ c9 K0 o6 SThis service just checks a flag.* n$ A8 I) P& X% r
</PRE></TD></TR></TBODY></TABLE> |