<TABLE width=500>
; ^: y' X; B( G: I) O$ Q" J. j# S<TBODY>
# C4 i4 U- A0 k. Z2 d- |<TR> l9 q) `/ e9 b8 [5 J- c
<TD><PRE>Method 01 1 q/ b. G6 P+ W+ C5 W* Q5 b
=========
2 ~1 `2 `- @9 z% q# m# s! a3 k' ~& l& m3 O
This method of detection of SoftICE (as well as the following one) is) g9 B( q( O; n+ U% S6 f2 X
used by the majority of packers/encryptors found on Internet.
1 R/ |4 l9 N# FIt seeks the signature of BoundsChecker in SoftICE
, Q: C+ W( R4 z4 F! G
7 x; c* ?- X0 g$ Q7 Z- s5 r mov ebp, 04243484Bh ; 'BCHK'
0 J6 ]* F! I1 Q: U mov ax, 04h
' P& j& _2 v" b# p1 v# a5 u1 c7 U2 W' U! X int 3 4 I8 C& } R; D) V1 \% b+ g
cmp al,44 C( j2 }+ {" a/ @1 m3 K: R' E7 _6 m
jnz SoftICE_Detected
- D' ~ n) M7 y1 I% X0 @. r! V6 o3 Q, z1 D9 D
___________________________________________________________________________: B' }' \1 U- y! y
* {% @ w7 }- N! NMethod 02# k$ J# P4 ?+ D2 x8 k
=========
: ]; X/ s5 L: c; E# Z
' v0 u4 x. F* |2 @$ s' |9 ?: ZStill a method very much used (perhaps the most frequent one). It is used
$ M% g/ T+ T) U3 H1 [' ato get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 m1 M# U" L) y
or execute SoftICE commands...
^ ?4 V: N, P. RIt is also used to crash SoftICE and to force it to execute any commands" s: z9 r& B9 x! f3 k& `2 Y4 d- V
(HBOOT...) :-(( , [ L. k4 ~# D1 H) a: {
7 B. Z) M" {+ A) ^
Here is a quick description:4 z' Q* S( e/ U
-AX = 0910h (Display string in SIce windows)
2 I2 c- ?" z5 b8 m2 K" f# [-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, @3 Q5 r6 A' X3 J: m, m# m% |-AX = 0912h (Get breakpoint infos); `: e2 Y. y0 e$ z/ w h- U$ p
-AX = 0913h (Set Sice breakpoints)4 q1 O# g" X% M; e: w* d
-AX = 0914h (Remove SIce breakoints)
% h! ~/ Y# K6 k6 R+ B9 U R/ t+ M
% k6 l6 V; X# l2 K+ O5 }0 HEach time you'll meet this trick, you'll see:
p( | s) x6 Y" w, L" m9 e-SI = 4647h! {5 e9 W. S; s; y3 i
-DI = 4A4Dh& y4 e E4 n$ K* c
Which are the 'magic values' used by SoftIce.$ N L# R! ?" y" D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
% {" e1 A0 K5 w8 k* Y! m& \
9 u# R# h: X- c; DHere is one example from the file "Haspinst.exe" which is the dongle HASP" J1 H$ j$ w' |5 O$ {( O
Envelope utility use to protect DOS applications:
& o# u2 y5 E8 N$ @% P# a" o& J/ t0 F5 _0 K; c
* s2 g" j7 @% G
4C19:0095 MOV AX,0911 ; execute command.
/ m$ c4 U8 G9 \# Y3 Y( S4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
" j2 x) e1 S' y( @) D8 H4C19:009A MOV SI,4647 ; 1st magic value.
. z1 i8 ]# F# q5 m& G4C19:009D MOV DI,4A4D ; 2nd magic value.
, ]7 ^. E- l- c1 G% q) v* u! r4 z4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)3 c8 a0 z# |% _+ \; w" |
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute4 M! _& y! f# A. [* Q+ f0 b
4C19:00A4 INC CX0 B8 B1 l, k2 N) Z
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
1 m: d9 G( y/ E: @4C19:00A8 JB 0095 ; 6 different commands.
2 d- ^2 w' S/ j' }( d; y4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: G- d! P2 W7 _/ B% D; p4C19:00AD MOV BX,SP ; Good_Guy go ahead :)# r0 e& K( |1 n: z% b2 `
y7 F7 T' f; _( M8 E; c, l9 yThe program will execute 6 different SIce commands located at ds:dx, which
2 s9 b/ h5 b- W+ O- R# l$ dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& M8 [7 T8 i" C+ V3 f x* r
+ P' v" B5 g+ h6 S1 F* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.& y1 Q9 D, r( z* z' K1 H% ~
___________________________________________________________________________
; T) j& M3 D0 E& X' U: ]+ O
) o) `. C0 Q5 z; v$ u u" s. i9 u c! R8 Y' T* P# i2 i) [
Method 03$ y. o) F' W4 C j3 n
=========
+ x+ Z$ q% C; }; N! } D+ A% q9 |$ I. P7 K& y; e$ n, m
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 |! V' p& @- J3 p(API Get entry point)
4 I& N5 d% H) f9 O6 d; N
6 k' P4 M2 o9 h4 \4 N, S; Y0 g4 l, A/ s2 e- o- u0 V& _" d( ^$ w
xor di,di+ @- w. V+ _' `" Q5 I
mov es,di
( o4 f9 d2 g2 ~" B t. h mov ax, 1684h , W" S5 r# j; w- {: r# ?
mov bx, 0202h ; VxD ID of winice F9 @% q! _) r9 f( p, t
int 2Fh
8 M# F9 _. E' ], p, [. `+ z6 s mov ax, es ; ES:DI -> VxD API entry point
0 B" E5 B. C/ ]# `7 t/ s; F1 V3 @, E add ax, di
( ^$ Y# Y; o1 u test ax,ax1 W9 U# N9 o7 C' D# o1 g ^
jnz SoftICE_Detected8 J% [& |( D3 N2 [
5 V! V. {& T: G/ l9 z
___________________________________________________________________________
4 M8 E; H* O8 c- }
& i; n. c9 }) M4 uMethod 04% l) e$ R+ e, L- \1 e
=========! P2 ?& c- v3 @$ D0 ^
% z7 R- X8 ~* k
Method identical to the preceding one except that it seeks the ID of SoftICE- E; B3 d( A# p# M. [$ Q% a$ O% e9 |
GFX VxD.
U& N" D7 Y$ [3 G
6 {4 e# p" W8 W( t1 Y" k xor di,di0 p( ]9 n4 {$ d
mov es,di
% X/ A1 b* H0 @' z mov ax, 1684h
* {! ~% k( l+ V/ o( L' M2 E+ b mov bx, 7a5Fh ; VxD ID of SIWVID
_$ i$ K! Q% D* `2 X+ v ?) X int 2fh; B1 M2 V) n* @6 Z3 @
mov ax, es ; ES:DI -> VxD API entry point
( i" M. E2 }3 i; d$ U* S; f% j add ax, di
' F+ ?3 J @' C0 G test ax,ax* \- H" S# p+ k2 r
jnz SoftICE_Detected
/ B4 W# q0 v, r* @! A( H6 X4 j) p v7 d$ I$ { f
__________________________________________________________________________
+ S) ] P( P7 ^- u
& v3 a% j# k. m1 _3 G
; D& p" T) \$ Z# oMethod 05' }" i$ Y1 ?% O i
=========4 T1 s7 a+ w7 k, j& w* t
5 D8 C$ X! r% m' _
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& D! q) P- H) B5 o8 |debugger. It calls the int 41h, function 4Fh.
5 _+ f- G0 a7 e( CThere are several alternatives. ) E. t3 e8 k8 m, t4 n% v* f/ M
/ H8 K' F. o9 u9 z/ F8 A; p5 cThe following one is the simplest:2 i3 W2 }( L, x0 T
- L# m2 w; f6 y0 M# Y' }% M" l
mov ax,4fh
0 D) M' ^$ X9 I# Y: f% h int 41h1 ?( h/ [, j5 e5 g E9 J; j
cmp ax, 0F386# o* S; c3 f0 c% a! ]% `. z
jz SoftICE_detected: W: [* S7 Z; g* q: }) H6 w9 n
\: a7 F7 Y; [# J2 T. |( v0 a6 w$ B9 d) @- D9 z! k: `
Next method as well as the following one are 2 examples from Stone's / O. U3 c' u- c. o0 D$ z' ?
"stn-wid.zip" (www.cracking.net):. S- p/ T9 T/ z% ?/ x2 b( L( x: a; g
& g. n# a2 I; i& V4 d" M8 x mov bx, cs
* T9 w# o5 F% O# z lea dx, int41handler22 d0 z4 K& V/ l6 }+ }9 u! k
xchg dx, es:[41h*4]
# W4 y# i; p6 K- Z: I# ^ xchg bx, es:[41h*4+2]) H+ ~) | I$ y# Q# c
mov ax,4fh
3 d5 W) E! N# n+ Q) ]: B) v9 ^ int 41h& I( s6 m$ {# G( D, c: [( R
xchg dx, es:[41h*4]4 }% N7 P2 X9 {0 U3 d# n1 H! l
xchg bx, es:[41h*4+2]; X0 o+ O Y% r* `
cmp ax, 0f386h0 u! C9 H* t, z! u( ]! H
jz SoftICE_detected5 Y, t; `4 R/ K
V- ^" m- P* F Z( c
int41handler2 PROC
' |8 |1 F8 A* k7 f7 h iret
3 n1 `; G7 `4 X! P; P; n/ [% O% }$ Eint41handler2 ENDP; d6 G) l3 T3 V8 A
, C/ W! n8 [2 _7 H$ d
) U, h w1 i+ o2 F q' Y% ^
_________________________________________________________________________
/ n. p7 ?$ O6 K$ K( W! l. `
& `& R; L* T( M
- }' p/ h0 [4 i1 xMethod 06
! v+ ~3 s% G# U0 c0 M=========& H* i. C! Q& ~( A8 y) V; d& n5 J
. u5 L9 _' ? O7 B! F; G9 N' y, W# |9 y9 g2 O
2nd method similar to the preceding one but more difficult to detect:
l( H1 Q) Q3 c8 [) |+ J8 O1 }8 Q, Q* @/ V1 ?# n
( }3 F7 }: P3 r$ Q
int41handler PROC* U' w1 N" k6 r( z- }+ z0 a: P; ~
mov cl,al
# J& f" k: J3 W8 m+ a4 G iret
6 I8 I9 u- a( g' F1 z& Lint41handler ENDP
W7 C$ q4 A A( _+ M0 G) X
" H& P9 L* R0 {
0 Z; C, f& X. C; T {4 Z xor ax,ax
2 i! q7 _0 H0 \ ?% A' f mov es,ax
# D7 }6 C3 p" b9 ] mov bx, cs
% \9 X0 e( i! Q# c& r lea dx, int41handler
* _6 D& @2 w# E6 R xchg dx, es:[41h*4]; J1 a. V# s2 s9 l9 y5 X
xchg bx, es:[41h*4+2]
: d) }8 \' W7 \9 s* k7 x6 w in al, 40h
0 u. |3 t" ]0 V* M0 V xor cx,cx/ a* j& R2 G l; f7 }2 f* s8 x
int 41h
3 ~3 z+ N4 k. F: ^ K xchg dx, es:[41h*4]
0 q( A( \, ]! Z* P$ J6 |, D$ W xchg bx, es:[41h*4+2]
9 }' l, U) P5 x& F( X cmp cl,al
! `8 _/ t# l$ D8 m" n$ H jnz SoftICE_detected* R! A% ?( |" D" `, c1 O. v( q5 M U
6 L& I: v; [9 i" ]/ N_________________________________________________________________________: j! h% t3 U3 b; r3 u& _+ \
* X5 z' @. Z. U* P) x# d* X
Method 07
% a0 f+ ^6 l- w=========) }+ E m; f; D) i5 w
6 G3 Q7 o: s3 a' z# r" W g2 x
Method of detection of the WinICE handler in the int68h (V86)
1 G% K6 e2 v; X1 s2 x9 j
# [1 l6 l* `0 i( ^! N& B! y# T8 y* R( i4 U mov ah,43h
. y2 |0 T% A7 i# Y int 68h& B: F0 r3 u p! J& I9 t/ H/ R/ q
cmp ax,0F386h
: {( w/ ]1 e- B1 i/ ^: @% C jz SoftICE_Detected
; g$ f9 M* |2 a; t; Z2 f: B K+ W) O$ G: b# C# M5 t+ l
7 T, [* }4 ~$ g3 b, a# z; _6 o7 M
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# Y/ ?) c+ ^& ]6 e8 [3 E
app like this:
4 H; J+ I; G3 y8 Y$ J5 W$ F& C* P* L& k o3 P
BPX exec_int if ax==68
' L0 _! ]5 v: M" n8 K! a (function called is located at byte ptr [ebp+1Dh] and client eip is
4 e( V3 {6 f7 i4 W# Q6 d located at [ebp+48h] for 32Bit apps)* I, t3 ?8 u' p, c( J& |! n
__________________________________________________________________________
' h0 [/ l/ W! T, S% O9 L
; N9 z: f. Q1 M% v' U8 N9 ]( q
' i/ y5 c' Y% b. Y: B% Z4 K6 IMethod 08% f7 ^) M: Y: g
=========
: p- T: T* Q" z7 q1 R# p; U' y
1 l' ?4 F/ U* u' n5 RIt is not a method of detection of SoftICE but a possibility to crash the& d0 y2 T$ H( [# |
system by intercepting int 01h and int 03h and redirecting them to another p5 z0 A7 Z. D6 N7 e( U
routine.0 N0 D! j& o6 \6 M* I, e
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points4 u- a% j/ B8 Y/ A+ X' {' ?) |+ T
to the new routine to execute (hangs computer...)
3 {. j; @# n+ [ r, C
/ r+ R: M# ]1 ]+ T+ }* R mov ah, 25h! X( p$ n" ] ]
mov al, Int_Number (01h or 03h), B1 w& Y3 \" T \; a
mov dx, offset New_Int_Routine% L8 V% F4 e/ }0 @$ L
int 21h
0 B) k) S+ g- t8 A7 L, o/ m8 e& ] u# y r0 `5 ~# k' x
__________________________________________________________________________" S, n4 i5 \6 k/ H9 n0 t
% m2 I5 |# Q& N+ I2 |& s
Method 099 b) p2 H( c. u6 U0 K" n
=========
, h+ |8 c5 h0 S/ I* @/ E) n' g& K" |/ D4 N4 R
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
5 \, g: z+ P; n6 r% O$ `performed in ring0 (VxD or a ring3 app using the VxdCall).
% X. L5 n0 K9 k9 p# EThe Get_DDB service is used to determine whether or not a VxD is installed
# e+ o0 e3 y# K" |0 |5 ifor the specified device and returns a Device Description Block (in ecx) for+ G4 F0 n; [- U2 ^/ D, o8 u
that device if it is installed.
# x8 f7 y0 |- O. s6 i+ a
5 L% j# ^" Q$ y# y' @7 c/ V mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
1 C1 n7 ^! i! d; j4 E. i1 Z4 ?0 A- M mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 q3 ?& f- w" C# { VMMCall Get_DDB
3 d+ a8 ~2 d d/ W5 g mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed9 t- G- [" F" ~3 U+ }! g
& B' t$ i8 G6 S1 i, YNote as well that you can easily detect this method with SoftICE:% E5 ?9 S/ L: e. D; V* S
bpx Get_DDB if ax==0202 || ax==7a5fh
w' k/ m" W/ w: o: @: y8 @5 R, q0 Z
__________________________________________________________________________
4 b: y2 c1 q1 E2 ]7 A0 j; l# X) Q+ x: O7 r
Method 10- V% _3 k! j& [9 A7 q) @# Q) H
=========
z5 o8 D" F+ n' g# A4 z; z: p- h4 G
=>Disable or clear breakpoints before using this feature. DO NOT trace with, a( Z4 F1 B# Q
SoftICE while the option is enable!!
9 E4 t, p3 P" x0 _" Z) X
/ v! |' c: ~& B9 s$ `* KThis trick is very efficient:
( V+ s6 C U# V) C* L( `by checking the Debug Registers, you can detect if SoftICE is loaded
: f0 h3 N1 d7 `' i(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 r) \# \& }" Y: Z: z% ?! m$ j
there are some memory breakpoints set (dr0 to dr3) simply by reading their2 \6 q1 k/ _1 @, o* Y* D
value (in ring0 only). Values can be manipulated and or changed as well
; n+ D. o$ z: Y9 A(clearing BPMs for instance). w0 ^% P+ x% n% t1 W$ h! E! V
@' V9 Q) {+ B* i; \$ X6 S# J
__________________________________________________________________________5 @7 }, K. y( ]. H
2 }3 ]4 y1 o! v% RMethod 11/ J8 b- u5 T: X }
=========
# E, F8 A/ T& N# ?' E& {5 Q& g. B' R, \0 [9 y) ?& A0 `
This method is most known as 'MeltICE' because it has been freely distributed a c- j4 t* h! E& q( W
via www.winfiles.com. However it was first used by NuMega people to allow8 g, F1 M# ~# @; n3 U
Symbol Loader to check if SoftICE was active or not (the code is located5 t k5 E, j1 B3 Y B* M
inside nmtrans.dll).5 M" B% C! P& l
, u" `( H5 I) s1 X) Q
The way it works is very simple:) T0 D! {% T) E8 J
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, n! W2 r( @0 F. }& k W' d+ IWinNT) with the CreateFileA API.
1 T" g1 r% R& Q" k7 q- A
& g( s$ u* M$ u; SHere is a sample (checking for 'SICE'):
K9 x8 U. [% V; e, P# V3 a& M; t$ x
BOOL IsSoftIce95Loaded() q4 Z: x3 y; g3 n1 C
{8 e' \2 ?# n, D$ o
HANDLE hFile; , N" |2 r% }( T! J( G& q3 } O
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 C+ A1 T3 k) K
FILE_SHARE_READ | FILE_SHARE_WRITE,
/ N! Y$ X+ b# Q7 { NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);# }* n4 B) {+ w* m, T; ~
if( hFile != INVALID_HANDLE_VALUE ). }2 Q @3 ?& |8 v$ A
{
/ p; j2 A6 `, l* Y CloseHandle(hFile);
5 L2 Z& z) Y8 J: d- D3 L& m return TRUE;
2 k- b) S& p2 x4 k( ?$ r }
/ O0 f# f3 N( A, w8 j# X( O return FALSE;2 p! e/ x# k# [1 `4 N9 @8 P3 W: i
}
) K5 i* P. Q6 e/ H% Y. m7 e/ w0 w: [
Although this trick calls the CreateFileA function, don't even expect to be
% e4 T* d# Z7 ]" `- jable to intercept it by installing a IFS hook: it will not work, no way! U6 X- q$ U5 a- ?6 k$ n0 k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F/ h5 e1 n" }! S% l* u. r) s6 G. Z
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)# u0 r+ C# w( e+ `2 c
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
! q( ?+ g' k/ S" pfield., P* {& v& \( P% C! Q( E
In fact, its purpose is not to load/unload VxDs but only to send a
0 Q G$ V* [0 Z/ d; GW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' Z6 C" F9 U( W! A+ ^to the VxD Control_Dispatch proc (how the hell a shareware soft could try
; K# [0 G# v: d& @4 fto load/unload a non-dynamically loadable driver such as SoftICE ;-).9 ^; B6 U N" U O, D) \' V
If the VxD is loaded, it will always clear eax and the Carry flag to allow
9 P# Q4 A9 C! r4 J' C- Zits handle to be opened and then, will be detected./ x, S) V+ w* V% n4 D9 G v# B) B3 q
You can check that simply by hooking Winice.exe control proc entry point6 x2 b) ]% t4 b, L1 _" k) m/ X$ ^1 y
while running MeltICE.
* @1 E6 {, r* S) t7 V
/ k7 H( ]# L6 `5 R
, U( w; o3 {& `* B& v 00401067: push 00402025 ; \\.\SICE
' Y) I; J. f/ ]9 z8 G9 h) K+ [ 0040106C: call CreateFileA% m. ? c- x' {1 C
00401071: cmp eax,-001. `1 l9 W7 f/ o8 s+ G9 D
00401074: je 00401091
& N8 {8 a9 U2 Z) Q) i& B" V% e5 U. O" m* v6 ?
3 d# L% ~5 M+ y( N% `7 xThere could be hundreds of BPX you could use to detect this trick.: |8 r% a$ R- J* r V. A
-The most classical one is:
6 f# ?1 `/ z- c$ ^ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||& u9 n4 z& i- [, g2 \0 M
*(esp->4+4)=='NTIC'
, S8 |, Z( m" p, M8 [0 D3 h# g3 i2 H7 {8 y2 Z+ n5 b- ]1 W
-The most exotic ones (could be very slooooow :-(
. ]) q/ {$ C! G5 c BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. @! b" ^* b, C( p# [6 t6 k/ ?4 H ;will break 3 times :-(
9 X, i1 s5 C2 Y( z' a8 c2 `! {' D' `& n3 X! a
-or (a bit) faster:
- l, P- `9 e$ j% P BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
; }. s/ s* f' T( K m" o! Z/ Y4 W3 X H0 s% e) t$ I
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - l: g6 [# T( \/ N
;will break 3 times :-(
/ x" H4 V) X4 P+ b5 d5 }/ i, m. H5 l2 o m9 M) L
-Much faster:
. ^3 |) ]' a8 E" \2 K; q+ I BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! b$ p$ u5 ^6 O6 O
- {( i3 L$ t: @, K- T$ z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen9 j) c8 I3 V" _. f: Y x
function to do the same job:
+ g( Q/ U7 ]& v7 W/ d0 | b/ N/ g) l2 w
push 00 ; OF_READ0 G3 r& A& f; E$ n8 {- n
mov eax,[00656634] ; '\\.\SICE',0) s1 b+ i2 B: i Q$ _# p
push eax
3 g% B2 Z' A) g( S8 D call KERNEL32!_lopen
, K0 s; d8 h, n1 n) e inc eax
! T' {1 X! k& @+ F" D4 ] jnz 00650589 ; detected* T# M1 N7 W8 a6 y& ?; }0 _- T' I
push 00 ; OF_READ0 Q: w5 h- C8 n" H
mov eax,[00656638] ; '\\.\SICE'
7 M4 G3 B! s3 n _# ^1 {8 W push eax9 a, s; B% T4 q. m; M2 i
call KERNEL32!_lopen* R$ E$ x( s1 ~
inc eax2 Y9 U) Z+ }! W( j* B! `/ y
jz 006505ae ; not detected2 e7 G5 S1 w, U
- m! B' U, z6 D0 j/ m
" U9 A, y8 m9 @- L+ S
__________________________________________________________________________
' \+ S7 U, I, i# W8 i: Z: p+ y u8 }/ s, w- o
Method 12: B. D) v( j& O- |- d
=========. F/ \$ f( N7 A
2 i7 _- }5 V# _: ]; M' c {: `$ N
This trick is similar to int41h/4fh Debugger installation check (code 05% `9 E9 b& X+ J* t. H; R
& 06) but very limited because it's only available for Win95/98 (not NT)) f8 E8 [3 f5 E3 P- H& a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ [. k. }8 V+ S- G
$ o! N( r6 ?9 K/ Z* m
push 0000004fh ; function 4fh* B" g) W7 l. T3 x- a* q4 a
push 002a002ah ; high word specifies which VxD (VWIN32)
- H* a+ }. D; C* Z ; low word specifies which service2 ~, Y0 v, A* o% [7 B2 S
(VWIN32_Int41Dispatch)3 R! B+ Y: {7 K3 ?
call Kernel32!ORD_001 ; VxdCall
, w3 v% N2 @; C; k8 \7 z cmp ax, 0f386h ; magic number returned by system debuggers: k) V" D- S5 n/ B" D
jz SoftICE_detected
9 F) A }, X& b5 |
+ l/ Z* H7 x# E* M$ ^6 x+ i0 HHere again, several ways to detect it:
/ B' q. O: q& h0 p4 ]; z8 V" K0 w) h& J0 `
BPINT 41 if ax==4f
: b0 G; \- M0 b" g6 I' D
; \2 x9 u5 v m2 ], P2 @ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one/ K; R" Q' H" B9 f1 z, ~' u# _
, a5 ~- Y7 k3 P1 v BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
1 n: ?# G* O. U) R
p% t, Q5 _$ y" h2 b BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
$ {" A2 N" h' ?! Y/ s* E
* W6 O) W3 @+ q6 Y/ H# o) J& Y9 \__________________________________________________________________________5 e0 w( e0 B9 b9 ? ]$ A
+ Y2 x0 C! G% B- o/ N( M4 ?6 _Method 13
6 U% U$ G0 e7 y9 }* W- h=========
% s7 y' h2 v; }. I$ i; ]
6 ~$ p% Y2 e( |1 {# k0 |1 s" RNot a real method of detection, but a good way to know if SoftICE is7 s; q1 M0 g5 E% Q! m% D
installed on a computer and to locate its installation directory.
- f; `. j# I0 aIt is used by few softs which access the following registry keys (usually #2) :
# q8 r8 P `8 x) w0 v2 q4 D+ ?4 r: F2 ~9 [% s& C' S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; {5 L8 @! K0 S
\Uninstall\SoftICE7 L! U( J3 L& q2 v3 `
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
/ e, X% c4 L, ?; ]: Y-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. m6 W/ G8 G) W# Q\App Paths\Loader32.Exe8 z5 [: e% u# M7 @+ F' @
$ p8 T O7 @! d, o% ^& @+ g- @" `6 [ P! }1 X
Note that some nasty apps could then erase all files from SoftICE directory
! i# g8 @ q, ?+ c% f(I faced that once :-(1 C% T' n# x. ~0 O1 g
$ |5 @0 T9 C: C& ?Useful breakpoint to detect it:
8 G9 u1 \1 Q4 j2 Q! [
! n1 Q5 j% f5 p" E0 b. k) A BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'8 `7 E0 J6 C5 u' b5 m2 g; p
2 F0 }) X6 j" r
__________________________________________________________________________
* p2 O1 t, w* m: b) s9 S
9 h. N1 x; e1 ?& E; P* p: p, s
2 P; L1 {2 V- p; y& K, `& M" YMethod 14 : S( `. ]( L6 u: c! ?* S) C
=========% D- Z. i) s0 m( }
& U# q9 V+ J' ^
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose0 G @) r4 |! I5 E
is to determines whether a debugger is running on your system (ring0 only).) G# m$ C4 y* I
- p$ v7 f" U6 ]6 x VMMCall Test_Debug_Installed
0 j/ F. D% y) O3 L je not_installed; j" O3 G8 S5 _6 H8 |0 y
8 Y5 G9 `; B2 L+ b n& S
This service just checks a flag.
Z# E, }; v# {; D</PRE></TD></TR></TBODY></TABLE> |