<TABLE width=500>' J8 W. q9 l& i, H0 y* i) t
<TBODY>/ {$ V- y5 _( l4 I5 X- L
<TR>
' B. I5 H' X# ^( V) i; X. u<TD><PRE>Method 01
- M6 F" l4 f1 {=========. j. P0 r- h& H
( v6 ^) m8 d1 p
This method of detection of SoftICE (as well as the following one) is4 c" ?8 B9 B/ k
used by the majority of packers/encryptors found on Internet.5 Z1 b& S. o r% |, |$ e# V3 L5 o
It seeks the signature of BoundsChecker in SoftICE+ E* Z0 P2 @# j. ?8 c
+ F2 R# V1 P6 Z) v
mov ebp, 04243484Bh ; 'BCHK'
" \% ]& H! B: {9 Y mov ax, 04h5 G# b" p/ j8 a) k3 g' {* n' c8 S
int 3
: D$ V) z& v% K4 f* ] cmp al,4* E8 E2 M/ U6 E; M' Z
jnz SoftICE_Detected' z$ j' w4 |" H' t" s
1 S1 S) E. r+ l
___________________________________________________________________________2 W4 h3 T+ f; [* p
- N1 H; {' _! J0 ^$ w1 DMethod 024 D+ R2 j* ]2 H. Z6 k& u
=========
2 M7 H9 W0 l5 h
* x6 f* s" t {0 T6 n ^! _Still a method very much used (perhaps the most frequent one). It is used
" y/ R! a) y; O8 y4 C6 Q3 b2 Jto get SoftICE 'Back Door commands' which gives infos on Breakpoints,# d& ]2 a8 `1 H% s8 k0 f A
or execute SoftICE commands...
# B" ]( ?/ O" S/ U, J, `It is also used to crash SoftICE and to force it to execute any commands
0 X' @3 ]+ B1 c( g, C(HBOOT...) :-(( + z% ~# f1 F9 r0 T& r1 h
6 t; |1 `! Z( Q" L, L- L0 JHere is a quick description:
- `/ u# F, x% S, h* N& G-AX = 0910h (Display string in SIce windows)3 Z$ g3 x( g, u1 i
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- m4 g; K) X. M' k
-AX = 0912h (Get breakpoint infos): x: f" K& ^5 h- L
-AX = 0913h (Set Sice breakpoints)) X1 t" J2 R# ^* X3 @( ? H- Q" B
-AX = 0914h (Remove SIce breakoints)
; H( I6 i3 a! h
' ^0 F! i! U0 ^# ?Each time you'll meet this trick, you'll see:
. m% s( C$ |7 P- v( Q! E: H-SI = 4647h
; u& E0 M$ [( `/ q, v# h7 v8 K-DI = 4A4Dh
' y" F& V! k0 qWhich are the 'magic values' used by SoftIce.4 _, |0 z0 w6 R0 K& f/ `8 @
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., _# |. Y6 R6 Q1 }7 B, S
* Z: w0 S6 E L- R# g4 D! ?Here is one example from the file "Haspinst.exe" which is the dongle HASP
# A0 A, y3 A/ V* SEnvelope utility use to protect DOS applications:& x7 q; \3 P3 E% E1 F
9 c+ Q3 ?; d( f$ B U" Q8 C9 Q% k5 |. p: \5 N# q2 S: i
4C19:0095 MOV AX,0911 ; execute command.# M% P" L! `3 m- H
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' u5 p3 l7 T$ K3 C9 e; R
4C19:009A MOV SI,4647 ; 1st magic value.9 u3 F W# \, J+ K
4C19:009D MOV DI,4A4D ; 2nd magic value.5 M' ]0 A. b8 f' i4 V' H6 b- ~) @
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)6 \- v- I, r/ e& x0 d
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
2 C9 k: @! F9 t& T1 U4 v( i/ N6 M4C19:00A4 INC CX8 z, ~/ z" Q8 A8 W( f# g& w' `
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute# I: B; s- y- B; {' r7 l) D
4C19:00A8 JB 0095 ; 6 different commands.
2 Y6 V. ]5 D, a5 u8 [* K0 g6 d" Q4C19:00AA JMP 0002 ; Bad_Guy jmp back.
2 X; w C" X3 s7 o4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
6 K/ f, x: x' E* B* H8 s1 N$ \' n8 q
The program will execute 6 different SIce commands located at ds:dx, which
2 X$ p" p$ M, h- n4 A! aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 F: C/ w* g! g G0 m. u$ R
3 R1 N& @ s: m8 [6 G$ J* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 X n- [2 i, H6 W0 j0 m8 z2 q) r: ~
___________________________________________________________________________
1 C3 d2 ^2 V% N; M/ p0 k
% S7 u4 Y$ y/ W* I3 X8 s( t
5 M. n3 l& J' a3 a, i, `* |: P4 GMethod 039 v' s4 A+ \ ?3 q
=========
$ q! g+ \( M: P# o3 G
; o- i# e, t" b+ a& e' w3 b4 zLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h/ X- `2 \$ u' d
(API Get entry point): T* O9 b6 h1 _5 T! N8 \ j
4 I, |! Y5 Q* `& j+ |9 Y; _2 p/ |( z; D/ z
xor di,di' r: A, p5 C+ W6 m7 ~4 {- n
mov es,di1 B) B! @* I5 \7 q3 n6 [4 N
mov ax, 1684h : @% {& c2 I4 [) v% }/ q
mov bx, 0202h ; VxD ID of winice
/ @5 Q3 c8 T! ]% s' \ int 2Fh v* x4 F6 S/ T8 M
mov ax, es ; ES:DI -> VxD API entry point5 {- L# k- @+ R5 h
add ax, di
]6 M. Q" O. o. N& d! d4 J test ax,ax
2 i% V8 \' ~1 g# t jnz SoftICE_Detected
& w4 _4 x& M1 S- M5 G6 @* p# I% H# z6 D
___________________________________________________________________________
0 j7 f2 ]: g. e% d: v, ]- H! i! Z. t3 {* S3 H$ ?5 z
Method 04* _! A& ]: M! Y4 e4 U
=========
, \% v( E# P, ]0 h
; T/ H% _" a: k/ x2 ]Method identical to the preceding one except that it seeks the ID of SoftICE2 ?( e( N. N7 Q8 z$ k
GFX VxD.
9 z2 ?- G, S6 N/ _: p9 ?" M% l' A) _& G. Y$ M! b/ a
xor di,di
+ n5 U) q9 z# j8 F9 w3 ?! l mov es,di. u3 d6 J `* t% \8 h4 d
mov ax, 1684h 7 v: Z. j; L" u( U4 W5 X
mov bx, 7a5Fh ; VxD ID of SIWVID
' K* d# y5 \) L6 x$ \! W h int 2fh
$ I/ f4 ] m, F# d mov ax, es ; ES:DI -> VxD API entry point
1 X$ R7 B8 k J; @ add ax, di5 f5 W+ t* d8 L" b0 M2 S
test ax,ax. ]: ` V( e& d) I
jnz SoftICE_Detected! p% P8 E. v, p. ^' }0 P3 z
. A$ I# T" f3 ?( k1 x
__________________________________________________________________________
$ t+ T1 S! @7 N2 c; Y1 J/ |1 ?3 ^* C; ]/ O; q
6 Y- [. G; s# R$ i( `, WMethod 05- r! ?# @# @3 i M) X
=========6 O7 S" O, A& b- C R' Y1 A1 J
9 }; z, a; M# B$ Q2 Z! W/ p+ ~Method seeking the 'magic number' 0F386h returned (in ax) by all system) C* |( `! g- |, @7 ~
debugger. It calls the int 41h, function 4Fh.! F6 a$ N, A# Z% J$ d
There are several alternatives.
6 n& `7 {1 q. N3 x1 z( v- [9 a) O4 E
The following one is the simplest:" Y- U8 y I6 k3 n; H
5 L6 D- C7 n e: N( \0 R
mov ax,4fh
% M* q% k5 Z( \ a/ {) t! ^, F0 J int 41h
* {2 l! R& s* `: _- }8 }- t cmp ax, 0F386
& I, I& V M( G# X( S+ X) l8 G jz SoftICE_detected/ x/ P" i; z% [) x/ H
; g9 r- Z0 b5 M" n7 B; T3 \+ s9 i' k& T* }$ B* @' @' w
Next method as well as the following one are 2 examples from Stone's $ Y0 Y* E3 C) s6 _
"stn-wid.zip" (www.cracking.net):* l. J0 w, h+ s, X
9 B- D" p' M- r* ~ mov bx, cs# _5 ^5 W! W1 R+ D: P
lea dx, int41handler2. b+ b4 [* f; A
xchg dx, es:[41h*4]
0 H$ I/ J T. B+ K% E* r* G9 s- e xchg bx, es:[41h*4+2]
- M7 }/ g+ F2 u) n mov ax,4fh
6 j( `' C( B1 X; S5 W int 41h& ~1 T5 H4 F5 N, D6 R1 {, Q7 v3 q9 D4 Q
xchg dx, es:[41h*4]
1 ^9 j4 U1 j* |6 k/ z) K7 c1 j9 ? xchg bx, es:[41h*4+2]
( L/ t; _4 {2 _ cmp ax, 0f386h. Z! r( z# c; f4 y4 M3 P4 w3 y
jz SoftICE_detected1 S/ W) `7 W+ J
8 b. Y& _, k' h1 f6 j
int41handler2 PROC: M* z0 B$ R; n9 m. r, _
iret! Q& r9 P3 K8 o4 P5 q
int41handler2 ENDP
( j. B0 \, a# w0 V1 |( F
6 @3 A5 m, y/ K: }8 r d6 G3 v
) O0 X: x' Z, ?" l8 ]1 S6 V_________________________________________________________________________
/ K8 R+ f' j2 b4 J
0 x1 ^1 b' ~0 P- d/ i v
* x3 e/ x0 O4 [3 r& X. B" IMethod 06
5 y( V) W& h" W# a/ I=========
! U9 I' C( n8 b& M) z( _+ q- F% D; l
/ y, q u0 ]: q4 n9 _0 [6 Y' |* V
5 R) Z( t N* N- l2nd method similar to the preceding one but more difficult to detect:
8 m p- B0 v/ i6 E5 ^/ j2 x2 t f# h% f, f0 ~! z" y
# g9 |3 ]7 E. I2 W9 I
int41handler PROC
0 A, ]+ l8 |" o& p% b mov cl,al
2 h9 k3 _( Q9 d% n/ \ iret
) T7 g, l. q* P3 C5 vint41handler ENDP5 P- b: o3 [9 h
0 h$ ?: n$ ]$ e3 h+ N0 q8 i; e' E5 _( h% @$ {3 W8 ]
xor ax,ax
5 f8 _' r7 s5 U5 H5 J0 v& p mov es,ax! s6 l: c- |4 b C, }( p
mov bx, cs
q2 y# h3 I u# ^/ `" c+ j( a lea dx, int41handler
: g% N5 h! ?- ` xchg dx, es:[41h*4]; O/ m6 t' t ?1 ~! s9 T$ f
xchg bx, es:[41h*4+2]. `& S: b! H2 p6 O5 W, z: ~
in al, 40h2 @& T2 L* Q: S* G
xor cx,cx* n! }8 ?. w/ p1 o+ u; O2 T" u
int 41h8 ?3 s# m0 H) q8 ^0 b
xchg dx, es:[41h*4]
, S+ n* F- B* c; O. f% j* J! L xchg bx, es:[41h*4+2]1 S7 X" u( w/ V, W9 l; q/ S
cmp cl,al
% R- s2 N: V' }$ b) N+ ~ jnz SoftICE_detected
$ o) I- E& W. |) v" M
$ u" ^( s% Y4 R5 I n# m: V_________________________________________________________________________
4 |* f, e. v. d3 d4 a
5 X/ n& d1 I6 z: @Method 072 ^! H0 X. D' j: V0 Y6 ?: e
=========
7 D& x0 W: d g5 ~. S# Z1 L& O4 ` l0 |2 T( I2 E5 Y8 w
Method of detection of the WinICE handler in the int68h (V86)
" s/ B, v1 W% j% F3 p% x+ N2 M, r, `
mov ah,43h! o" A! \& \4 ^* T: \7 w
int 68h
( b6 q0 X! }$ F3 P2 T. s) i cmp ax,0F386h- P4 d) E4 s% b" z6 K) v. M
jz SoftICE_Detected7 z( r& {, n# }7 |3 s, U
. |- o! V; |" x4 e- l* ^- b
' P4 v1 I9 Q. [& a6 L) t' c6 f
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit* `: r4 \ L6 I0 E$ O. @; w, A1 d5 o
app like this:
4 x$ ~' W* N& Y: ~7 J. P( I7 D) B* A% j8 F/ k2 Q
BPX exec_int if ax==68" D* R9 G2 ]: [) a6 G5 H( Q' x
(function called is located at byte ptr [ebp+1Dh] and client eip is
/ e( ~* l, G5 T8 n F+ b located at [ebp+48h] for 32Bit apps)3 G o, _" I1 m9 @2 d
__________________________________________________________________________
6 \8 A- J% J5 X7 D. d
- ]' d6 S$ r0 L7 R1 u0 r5 _8 J A. D4 |4 M3 Z: a& p& q3 \
Method 08# p P+ @6 ^: D# l% c& X
=========
1 T9 w! c% P- n) E2 C! e+ T4 h" g0 H! R2 @3 }* R9 |, W
It is not a method of detection of SoftICE but a possibility to crash the
% U; x' N, d% ]/ Gsystem by intercepting int 01h and int 03h and redirecting them to another
$ ]/ Y+ P* N, P! t5 ?( |routine.
9 B p& l5 X# S; r5 qIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
% ^* p1 G3 u. S6 \to the new routine to execute (hangs computer...)8 c9 Z: ?* S0 G3 t7 G1 {, R
% t! x4 Z" F) n) b
mov ah, 25h
) b( V, ?9 O7 a9 o+ O mov al, Int_Number (01h or 03h)
, j: { i; h3 l; i' Z/ K, U) h mov dx, offset New_Int_Routine2 {3 U) F- q* O2 S+ H3 L
int 21h. b; F: Z2 C2 H6 ~& c
/ t& E, R, s' {% _" x
__________________________________________________________________________
& o+ z+ {: X( N' H4 v$ }3 j
7 g9 v4 v8 d x5 C) t k% pMethod 09; [* l& d8 G# \3 S: H" B
=========# L% B- q6 j5 g+ U! ?
* z: { `, ~, E. t v8 b/ KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
! W( b: q/ {* G. M7 Lperformed in ring0 (VxD or a ring3 app using the VxdCall).
/ |- o; X: T! C. t! j6 {The Get_DDB service is used to determine whether or not a VxD is installed! h- \- O0 O: v( f
for the specified device and returns a Device Description Block (in ecx) for
4 A* }9 s7 `/ _& G0 c, }that device if it is installed.
2 N8 J) t8 Q( H! P- Q# ~3 J' L g+ s1 _) U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 ?- f! X E9 N+ W. C* e% W H mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 ~. G( p$ z0 q4 {: _8 ` VMMCall Get_DDB) c1 F( P) b( S+ w3 D
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed! o# r9 j. w; A8 Q7 \/ z1 @
- t& E' O8 b ?6 [. B( KNote as well that you can easily detect this method with SoftICE:
" o8 |$ V {' y' d* j/ } bpx Get_DDB if ax==0202 || ax==7a5fh6 H* k' H0 }- A8 K6 u# u4 \" V3 t
8 `$ s& k$ b/ c& z9 p- m8 {$ C$ a
__________________________________________________________________________
& K9 t' L/ E$ q# U2 k, G1 p
; d1 E2 S1 k4 p# tMethod 10
. P2 x N& M2 V- ?=========' Q& d0 r0 @0 v0 v0 D1 ?
+ [/ m& Q# j, |" b9 b, z
=>Disable or clear breakpoints before using this feature. DO NOT trace with7 ~0 [0 l6 i9 J) w* T3 T
SoftICE while the option is enable!!# r- P# V+ P2 p5 `! A, n
, y3 E5 b/ O: K6 VThis trick is very efficient:
; B9 _, \$ b+ r7 e) Pby checking the Debug Registers, you can detect if SoftICE is loaded
. c; H4 T# Y I& }' {4 L7 z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: A, u: `* ~ a) X4 V7 Ethere are some memory breakpoints set (dr0 to dr3) simply by reading their4 V, x/ R m' e: X3 B
value (in ring0 only). Values can be manipulated and or changed as well
1 d) i! Q: {. ?(clearing BPMs for instance), G1 G5 W* C9 o1 {& o# e, G& i
/ C6 b( x9 T% b7 D8 j& M# O__________________________________________________________________________: a. y2 f _0 Q" f3 J9 C& I
N% u" v! f- fMethod 113 g% g& p/ x8 b. g& P
=========
4 {2 q& R( g0 C; ^$ t8 \' T8 O, H- \6 p- q# q! j6 A" `
This method is most known as 'MeltICE' because it has been freely distributed2 g, A+ a E& R3 A$ ^; B, @0 E
via www.winfiles.com. However it was first used by NuMega people to allow+ w$ o' Y g, k- g
Symbol Loader to check if SoftICE was active or not (the code is located4 D) ]' u# ~1 R
inside nmtrans.dll).
0 \ o9 U" P3 z) \6 Z6 E0 u) t7 F0 u1 q7 z! G3 a
The way it works is very simple:
7 M) _* k3 m1 R3 O" N' a( oIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
$ r: b7 L/ x/ |& O+ }) q8 |WinNT) with the CreateFileA API.
. z1 Z7 }7 ~* Z2 c
- b0 x6 o& H# W z1 m( jHere is a sample (checking for 'SICE'):
% ?! d+ `7 C* Z+ ?+ y) |! E+ P2 W" Y* p6 H8 e a
BOOL IsSoftIce95Loaded()6 {1 O( Y1 j& q& s- n
{
1 d5 b, T- q5 \ HANDLE hFile; 0 T9 y- o, l7 Y9 x _) ]4 S
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
, n! ]( h& k7 B& K0 ~1 l FILE_SHARE_READ | FILE_SHARE_WRITE,' y F- z* h1 B( e" I( b: E D& A
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' _% B) u$ i/ A" Z
if( hFile != INVALID_HANDLE_VALUE )
; G) @% g: A& m1 _# D/ q {: W# M4 m- y# Z! Y
CloseHandle(hFile);# E' ?% a# J3 N4 d
return TRUE;
0 f1 R9 B5 ^: {% z2 m) t. I }% L) F5 k) o; `7 _! P, B# y# K
return FALSE;( {% |3 w }4 d4 u) u t& R
}" p/ n$ P, K; I9 O/ k1 }6 T
& m' c$ m. @1 Q2 Y" lAlthough this trick calls the CreateFileA function, don't even expect to be, w8 A4 @8 u; c5 Y$ p1 m }
able to intercept it by installing a IFS hook: it will not work, no way!
, u# D4 p+ ^7 K `0 Y' z# I1 EIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
) ?& a( `6 ?5 Hservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' }4 f9 K$ {3 Y7 }) E
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
, |1 I; e0 G' S. E, z" H" zfield.
* R3 z# F" p6 r6 G- i0 ^In fact, its purpose is not to load/unload VxDs but only to send a
; n/ T' H' t8 K- }8 N. o* xW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
( X9 X# [; v3 ^to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; A7 z) J8 K' {' u" [. yto load/unload a non-dynamically loadable driver such as SoftICE ;-).$ n4 c' @1 q- T- M" A- Z- i: `
If the VxD is loaded, it will always clear eax and the Carry flag to allow
. y% ]' s7 G( y0 W% fits handle to be opened and then, will be detected.
7 m+ l5 T; {7 I; U+ D1 t9 MYou can check that simply by hooking Winice.exe control proc entry point
- t3 I6 k& I% D- g5 a( _, L, uwhile running MeltICE.' e9 F6 x1 h8 Q1 t" N% E$ y: e
! \9 w7 x# q2 ]( F3 W, a' H& b8 \& A9 }4 E* t
00401067: push 00402025 ; \\.\SICE
3 F- W6 W' G0 J+ m 0040106C: call CreateFileA/ k" q7 _# W! d" f' B, k
00401071: cmp eax,-001
/ n4 f9 f0 d3 t, I4 p 00401074: je 00401091" H) d g" X/ h e
# j( l9 \+ X, h9 O6 P% x
. W& M! N# U* ~$ n+ wThere could be hundreds of BPX you could use to detect this trick.
2 t2 q: z4 I+ ~2 H4 O3 v. `# b-The most classical one is:
. [/ y, D: k9 y* ]3 V9 l BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||" @* d6 C7 c7 N8 ^! A9 [$ ?
*(esp->4+4)=='NTIC'1 j1 O: P7 Y: [& `& [. Q
! _. M8 \ h: z6 `2 i/ L-The most exotic ones (could be very slooooow :-(; y) I# n4 r* v* u k
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') # e/ z% I2 E4 c+ o. h3 _
;will break 3 times :-(
3 G6 N7 p1 f: ~ u8 d- d6 u9 O
* N( a$ {# M4 ]; d, e) l) w-or (a bit) faster: $ ^' `0 h0 m! c
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')* k. u* m! w1 ] e* B6 q
' u5 G6 o4 T/ g0 I: i" S% s9 H
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' . N0 _/ [' D% R7 X z" t: C* _
;will break 3 times :-(7 e. ]: o }6 B: E. V" |# O. F) Q
9 u+ L0 ~4 ~* A
-Much faster:
+ x' Q7 ~. \5 G2 ? BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
" z2 B; @& p+ u" c+ P! l. U
a# D+ Y0 `, ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
% H9 ^6 }) P' ^; lfunction to do the same job:
7 I; Q8 D$ i" o% r% R' S! H H. ^6 h( Z
push 00 ; OF_READ' i/ t4 d$ g! S8 D$ F
mov eax,[00656634] ; '\\.\SICE',0
5 D$ U: a8 V/ x3 T) Z7 t push eax0 O" Z- \1 \( C" x4 @ @
call KERNEL32!_lopen) ?5 \" |; v8 b7 V- z$ i
inc eax
. t9 P6 K( B% P jnz 00650589 ; detected, i6 Y9 u) U8 o0 p0 g3 j
push 00 ; OF_READ% R7 o# H' e" v' i- s1 t* z
mov eax,[00656638] ; '\\.\SICE'0 O' Z9 I3 h8 m; |7 g& q% N7 h u. K$ }
push eax
- v8 i1 {" o0 _6 m2 I call KERNEL32!_lopen
' V+ W, |% [0 o inc eax# j* Z* i1 ?' N+ ~* Q8 [
jz 006505ae ; not detected
2 G9 Q$ ` i! o
l4 C( s& u& V9 G8 r$ j7 \6 e$ d. r% k5 ^- ?
__________________________________________________________________________6 ]) s# B' |. {+ h# t: C
6 H4 v9 o9 V7 p( ~$ H1 N: g8 Z- ]7 D
Method 12
( \* q h' m, }% Q1 a=========9 o; \+ B% {6 D. M' R1 O* }& f4 l
' A" s; s% A4 c$ j. L7 s7 jThis trick is similar to int41h/4fh Debugger installation check (code 05
" ?; g3 ?' R' m8 _$ o9 w& 06) but very limited because it's only available for Win95/98 (not NT)) [% a6 ?/ h1 X1 N% Y3 b0 D
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.: Y! u, a" F9 S* Y1 {
g" b$ O+ }( x/ m7 `5 [# y, M! O7 L push 0000004fh ; function 4fh% b! ~" f, m3 i: y- P, s) A% O7 ?* T
push 002a002ah ; high word specifies which VxD (VWIN32)
$ m0 X E, N( w9 }( T ; low word specifies which service
" ^4 O% p7 ^! v5 I (VWIN32_Int41Dispatch)
1 n7 G: a% k i5 e b# Z. ~( A call Kernel32!ORD_001 ; VxdCall
& c2 q0 _! Q! P; i2 p. k: u% z cmp ax, 0f386h ; magic number returned by system debuggers
; C+ l. Z) a" l jz SoftICE_detected/ S2 K5 V% @# o8 p, l" u
" V& O# A# ~9 c6 J4 N$ gHere again, several ways to detect it:0 m- K" m4 C' Q2 O y% W- x
* l N5 X5 X- C) }6 k# L- v
BPINT 41 if ax==4f, Y4 v) X( e, j# o& I/ U# w
; i4 ]# h% S/ \! A+ ~
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one8 D5 X1 N5 g4 f3 } v
7 u$ ?% Q- K# x& J/ D( E BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 x- D* Q& j) J6 }: X3 p: ^$ J6 f0 H
5 V! ?( G& {3 Z7 X- H
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
. o7 }) }( w( H* t$ B+ a! J8 }2 u$ N' D/ }
__________________________________________________________________________' s- {5 e- q N6 y
; E: o8 o8 r) b' E: l0 f7 M& _
Method 136 M+ d% m H: D/ w
=========
7 f g( A: n5 |3 l" C! q* b
- w- r- a2 a( U. d; y" uNot a real method of detection, but a good way to know if SoftICE is
* N3 c: J1 v9 R( Z* c5 d# s- Minstalled on a computer and to locate its installation directory.* l4 R7 F9 I3 |' q u( x
It is used by few softs which access the following registry keys (usually #2) :( o% x& ]# T, L$ p- X( a2 m8 c
6 C. I' L8 n9 c1 i- ~0 T# j-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 j4 ~6 V6 { m- ]. E\Uninstall\SoftICE1 c& B: M: W# d0 f/ e9 j+ ^0 U
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE. g6 H, E% n% H( G
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion9 d2 k8 m8 Q" a. }2 M( O
\App Paths\Loader32.Exe5 L; U+ v4 X; n' |7 {
% ^4 t* o, g" l5 b) U
+ W' _ y3 n' kNote that some nasty apps could then erase all files from SoftICE directory0 k/ R' `: T8 V0 t6 m+ z
(I faced that once :-(( q$ k, @2 W3 Y3 ^# O# n9 Y% ^
5 i5 C4 V: g, V" r9 E" H# |Useful breakpoint to detect it:
D2 o' d0 E" c% @: Q* P$ u. Q/ ]( y$ W! z4 t6 ~% u
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'% r4 E1 O! N3 Q- [0 G
6 R3 [7 D, `9 ]7 h' [0 [__________________________________________________________________________' X" ` n% V7 {9 B/ C
/ c/ G2 K, V! B% ]# u
% S; z; q- ~- c/ `4 DMethod 14
3 h' ]" S' c7 P B6 U- Z% {=========
6 n1 }3 q' {7 Q; A* f W% e+ O. k6 x" v) ]' S2 G5 V* r8 {- \3 {% \
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) H! Y: K- }5 [/ B) r
is to determines whether a debugger is running on your system (ring0 only).# M* h( N o0 i3 e. K' X, |
& K. N6 L$ H5 H2 I
VMMCall Test_Debug_Installed: U& x8 ~9 g0 ]* C- X& }
je not_installed
9 N- z9 A: b" J! J$ b* r6 x i3 Q3 Q; d. [2 C7 I
This service just checks a flag.) G( l0 r' k0 f$ w
</PRE></TD></TR></TBODY></TABLE> |