<TABLE width=500>
& P& H6 |4 @5 b<TBODY>: W: y2 r0 G2 \& V- r O0 l
<TR>
( m! W' p# V# k( Q4 r# g3 O<TD><PRE>Method 01 ' |5 @+ N& ]# t+ L2 U$ ~9 {
=========+ J( x$ x$ d5 y9 }
& S: H6 b- F( ]5 P# [' SThis method of detection of SoftICE (as well as the following one) is
. X0 l- l0 X2 }used by the majority of packers/encryptors found on Internet.+ M& M, K/ h, y- Y; N% v$ G0 Y1 ]
It seeks the signature of BoundsChecker in SoftICE- F* C/ I* {# S
* N; x3 g# j' d- E+ ? mov ebp, 04243484Bh ; 'BCHK'
/ }" Z7 J9 v0 i+ G; ~. w7 | mov ax, 04h0 y1 o7 b, P _$ B( d
int 3 # Z3 _8 c$ j, g
cmp al,4' g: w( _/ @) x
jnz SoftICE_Detected# R7 ?4 K" Q+ y" W1 Q* \- O# j. P
! u' c* H% r+ A2 \* U3 n* Q
___________________________________________________________________________# f' C5 V$ G N/ |+ V6 S1 `$ ]
& L6 Y& v/ W( i+ _1 ^( d! o
Method 02) H4 l e, t, L0 Q% G
=========
7 N+ v/ C* a% C: ]' |0 b! K( e. a- ~. k4 F
Still a method very much used (perhaps the most frequent one). It is used
: t7 T( p5 d( s" r4 k; Q3 Xto get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ ~* ^5 X7 I* ~# O3 ]: B
or execute SoftICE commands...
4 c m5 r9 A( s; R/ R' c3 XIt is also used to crash SoftICE and to force it to execute any commands
3 ]: s) U3 I E/ d! g4 T; B, a(HBOOT...) :-(( " L/ x# z1 `- j0 A$ r; `
) S' G: M7 C- @8 cHere is a quick description:5 y9 f2 w. ]. Y3 N
-AX = 0910h (Display string in SIce windows)
2 S# g5 A' O9 k8 U* q-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)+ R9 X. o7 Z4 P: q
-AX = 0912h (Get breakpoint infos), e. d5 J; K5 ~; t' B# Y* {/ y, O* D
-AX = 0913h (Set Sice breakpoints)
6 W+ S* V4 g) q# }-AX = 0914h (Remove SIce breakoints)
( o# r: {1 A% y, E8 S& w% L2 ~4 T+ w0 y% ?; ]+ }, A6 r' \+ Y3 x. _7 x
Each time you'll meet this trick, you'll see:8 k# b( f% |/ ]) U6 W" [0 E& X
-SI = 4647h3 B0 q" A9 i* L1 D- N
-DI = 4A4Dh
9 r' @' ^. M% [. I1 K+ G" V: g( c) _Which are the 'magic values' used by SoftIce.' X' A5 @2 z" F' u
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
! Z+ O& @) P+ v; z8 F$ {" L5 o: j a) x! f9 p o
Here is one example from the file "Haspinst.exe" which is the dongle HASP
* s: l5 Y& o2 D4 q% i: K( p8 V! eEnvelope utility use to protect DOS applications:
: i0 w& G6 t$ \+ t2 v0 |3 M3 i1 N! Y3 d: Y* Q( j' |* C
& O& ^' h5 {" I; U
4C19:0095 MOV AX,0911 ; execute command.$ R' ]& ^% H4 t% d6 ]/ \: Q
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below)." C" n( }9 q& h% ?% y, A1 s
4C19:009A MOV SI,4647 ; 1st magic value.% Z: r2 L Q6 v" v6 H2 L2 }, N
4C19:009D MOV DI,4A4D ; 2nd magic value.
( \: R$ y4 n: X1 u6 j' J7 \2 S4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*), U% ?% o! B) _' \$ u: e- _! R
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute2 M1 Z& s5 M2 Q- ^5 x+ h8 s2 l
4C19:00A4 INC CX2 }2 ~2 R N, p9 D/ b! s
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
+ d1 u3 }% R4 C9 M1 U4C19:00A8 JB 0095 ; 6 different commands.% c6 H1 |7 ^6 D; q+ r7 c
4C19:00AA JMP 0002 ; Bad_Guy jmp back.7 b9 P& U" f5 X1 R O$ _
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)+ h6 c* F- f% q1 ?, y
& f& D" G9 n+ b/ L" z
The program will execute 6 different SIce commands located at ds:dx, which, ] G" C' I% Z: f
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
# l3 ?' i& N3 H. s7 q1 A' `
: I4 W- r0 w' h* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
5 L# l4 M' y j; G( [___________________________________________________________________________% I/ a+ L v$ M+ [3 e
% f7 T% \- S6 a4 t& d. Y# }9 R' A* x+ S) X. }- K9 j
Method 03( u5 \# K% D/ w }7 Q' a
=========4 u$ P# v8 Y3 t4 O p. P
5 r0 { E) ~5 s P) yLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h" \9 ~5 o+ Q6 k- H
(API Get entry point)* F* S, u: p5 [/ k- z, o
# o9 n% f9 E, o$ u! `0 L3 O& }
5 X# M4 {+ F+ c5 f/ N- C/ D xor di,di/ ]& w# V5 {) t* e/ a! q
mov es,di
4 N( A1 [8 Y8 ]- n) I0 q' p5 U6 ? mov ax, 1684h
! f3 ]' L1 s" C0 O. A( L/ U mov bx, 0202h ; VxD ID of winice
! k; _4 j6 s. X, P6 f7 F% V7 h5 j- o int 2Fh
& `6 R: p1 T, o6 T$ P; H& @5 L mov ax, es ; ES:DI -> VxD API entry point1 P- z! M, y' q* l3 p2 k
add ax, di
4 g7 {/ j% g/ m& N6 u test ax,ax' z* e; G* b# Z8 {5 W% b. w
jnz SoftICE_Detected3 k+ T* E6 L2 d7 { T% C
' ]; L# W6 y* d, W3 n3 [___________________________________________________________________________
; D; N( t0 j2 w; e" K- w
) A6 y5 o" r) r8 M' k/ ~( L- dMethod 04
! m. M. @8 e3 n7 \% I6 N7 w=========* A& E3 u# a8 t$ T% ?6 B" R8 u
& f W9 U2 Z. a4 J% [/ l
Method identical to the preceding one except that it seeks the ID of SoftICE
+ d) n0 w6 _; L) z! ]GFX VxD.
8 F+ O7 f" R0 S* e2 L
V6 `4 r/ B* [ xor di,di5 U# t0 x0 A, P1 Q3 ]
mov es,di+ B3 J2 {8 R- u* x% ]
mov ax, 1684h * R& k9 L8 y% t9 @/ X8 O" \
mov bx, 7a5Fh ; VxD ID of SIWVID
% A. L/ F0 i# C \! f" s int 2fh! M! K* B0 r. x+ V( j
mov ax, es ; ES:DI -> VxD API entry point
) T) T! G/ [# h$ c5 N add ax, di$ @& q- ?* T: f& g7 ]/ c! m) d& O- f) R
test ax,ax' t n* i8 A6 U9 e$ |2 O
jnz SoftICE_Detected& d3 I) B4 m; J, l7 F. ]
/ ], j8 _" l# p+ W, B7 u- s0 A6 ?
__________________________________________________________________________
$ d$ P" M) A) }& m+ l( J: C
4 e7 H: x- z! N7 G$ K6 T: I
3 i- Z# e( Z5 j# k" ~4 ^Method 059 p3 |) x: ], H+ C
=========
* q( y q% H' i% {7 N2 t. o5 }* X5 o) f3 W0 w$ P
Method seeking the 'magic number' 0F386h returned (in ax) by all system: U; m7 N' u9 J( n \
debugger. It calls the int 41h, function 4Fh.
3 C0 k( f9 t8 h5 D$ l {There are several alternatives. , G; @* A; O g R
) ~2 q% A. d% K2 y5 X2 B' hThe following one is the simplest:
. m4 w: E% |; g1 D- O5 a# E, S; l9 z& }) ]
mov ax,4fh) L5 f! R' F( n! m% w# M4 {7 [
int 41h6 z0 n" P& O# K! V' B' S- }7 e1 n
cmp ax, 0F3861 O+ _+ I9 c+ ?" \+ d) O8 N' N
jz SoftICE_detected
/ l! M3 w! [3 [- S5 [4 W3 H) L4 Q, ]
@, G0 u! \3 Y; oNext method as well as the following one are 2 examples from Stone's
, S1 p3 p* N" a# s"stn-wid.zip" (www.cracking.net):
3 G; R! M( N# R) `
6 C7 i8 W. z* W+ h; P" g mov bx, cs
$ ]$ v" y& Z: ]$ ]* O9 ^9 s M lea dx, int41handler2
3 g1 @$ h, o2 {; D xchg dx, es:[41h*4]
5 V+ b, Y8 x- B0 }6 Y xchg bx, es:[41h*4+2]
: Q U. \" q+ q6 t m; E+ u6 Y- O mov ax,4fh, }* s5 K! n h+ C4 g g" V# B" Z
int 41h
3 g" ?* P1 h# m2 L; z* T xchg dx, es:[41h*4]
# o: F' ]4 R5 @( e$ X! G6 ? xchg bx, es:[41h*4+2]
: _, B) p" _ p cmp ax, 0f386h
* s! }% ~/ K% ^3 \ jz SoftICE_detected
8 |+ [8 F2 H z2 N/ }" E6 ?
5 t: {% U( i* F8 l& w. G k% Iint41handler2 PROC; e( k6 l' {+ c# p8 A
iret
! b* m9 Q7 e# g* v! P2 tint41handler2 ENDP7 @* {1 m f& \6 s
1 h& j8 t- F' N
9 _; M _- }: h; j4 X
_________________________________________________________________________
6 h) k. ^% P; G+ b
, B0 Z5 u" W8 n! n5 H
3 ?9 r5 S7 x6 W( L' k3 O, L H# H6 OMethod 06
4 m, P+ j. b, p1 ` r; H. q' H M=========
y+ b$ |' w& P. k* j x' C& a$ d# G# W. l
- n0 s0 d) n1 W N* u
2nd method similar to the preceding one but more difficult to detect:* C! Q+ R$ r5 U2 }
2 {. B: y$ W. B# ]
2 Z9 D/ d% z- |int41handler PROC2 |% B7 U8 M4 V+ ]: k1 }) a
mov cl,al
, m$ @, N& M2 K. t( Z iret
# \* d7 ?5 {" Q0 [, |$ b' pint41handler ENDP! @+ X: E1 }& Y9 ?; ?
) X/ q a2 d1 o
# P% S( }- U7 _+ x% b xor ax,ax1 w/ ~+ e; K5 B+ T- ?9 K
mov es,ax
7 Y( W, H. x8 s! H) ^ mov bx, cs5 }) H9 n# y6 N8 ?% r, L4 @6 q
lea dx, int41handler3 u0 E, ]5 S6 ?3 l8 N
xchg dx, es:[41h*4]+ o5 w j: ~( Q! \5 j' G
xchg bx, es:[41h*4+2]
; J& W: e% v' r in al, 40h
1 y- K! v) I9 I0 e$ a% W xor cx,cx# J* [9 M1 v9 V7 U9 H5 C0 V, F( d
int 41h
* L* H: l- G5 S8 Z xchg dx, es:[41h*4]; o# E, B) Y4 x6 Q/ l1 a
xchg bx, es:[41h*4+2]3 E' z f! ~0 j
cmp cl,al
; S; T% w) x x) u; ~- F$ Z) w2 {1 G jnz SoftICE_detected; A. u) X9 Z- E: p: D2 S
t! a7 b v! D3 j# J: {_________________________________________________________________________
! p8 }1 G9 J" l$ v* p
7 m2 }1 a2 h% H. L/ Q6 D" ZMethod 070 c7 T* L; ~6 z, a/ q
=========
1 T1 G+ M n& \, `) I
5 `( m' L6 W6 B. [6 q7 tMethod of detection of the WinICE handler in the int68h (V86)& @0 m. j; g0 S+ X+ j9 [ ]$ L/ n* v- e
* S: v( _/ I: U0 A. [2 c
mov ah,43h
5 @4 Z7 T% U- l! T6 X int 68h
2 C+ ?7 b5 k; M& w cmp ax,0F386h
6 w6 p% K* |2 j- b( b) @3 b$ r* G jz SoftICE_Detected7 H. ~. k3 V8 q3 e
; f4 y: c0 ^, J- N
0 z W' Y; h! Y" y: H+ h. y
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
- o9 g# `. [: W app like this:: C& s6 V1 K: d
8 l, L# |# f, W
BPX exec_int if ax==681 P- @* _ J: h, x* W
(function called is located at byte ptr [ebp+1Dh] and client eip is
: b3 y$ y( j4 Z) X+ e located at [ebp+48h] for 32Bit apps)( i, Z8 p6 P- f. p1 }$ @4 {
__________________________________________________________________________% g# T8 E. O9 b8 z5 l
2 W* i) r# a: _6 h+ B2 s4 X- ~- @5 G
; O& c' |4 n2 Z3 O1 @! D3 BMethod 08
9 J H: I$ X B2 j3 P! y9 X=========
" V" B; _& x" B; z# Q" s
. I# J5 s( d3 OIt is not a method of detection of SoftICE but a possibility to crash the9 e" |9 U2 C% t. j/ y
system by intercepting int 01h and int 03h and redirecting them to another
; o% s$ J U: rroutine.
1 K8 `7 ?' H* RIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 s4 f; ^9 R- d1 a4 ]' \! e
to the new routine to execute (hangs computer...)& f; f- A1 f8 H- F; f6 `, |% d
' E6 T: ^& P7 U" P
mov ah, 25h5 J+ q6 {5 R o
mov al, Int_Number (01h or 03h)
0 w& o, [" J( T3 M mov dx, offset New_Int_Routine$ U7 P% t4 i) l
int 21h: W6 z+ Z6 P) i$ b" e a
. g/ p' t/ o9 u6 q% _% j
__________________________________________________________________________
3 f8 b- v1 Z4 f$ n' k+ T3 b4 G6 ^( U$ B! |% X! e1 ~
Method 09& C1 b- e6 r; x; \; t3 h$ V
=========1 _0 ]6 a$ |1 U9 u: [2 O
9 K1 m. o- m0 r+ Z2 j+ ^4 C
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only) t7 P; {2 w9 I) Z) m8 i( f
performed in ring0 (VxD or a ring3 app using the VxdCall).
* ^ ~. g8 F' S3 f8 q, p' hThe Get_DDB service is used to determine whether or not a VxD is installed' J, i6 f$ J0 ]4 v
for the specified device and returns a Device Description Block (in ecx) for
F! `: L3 {4 N* j& q) V$ l6 I. P5 P. \: Ethat device if it is installed.
f$ }% f2 Z" _* t2 v9 N/ P4 O5 V4 a' N- F
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID1 y- N. U) r$ ~4 p* O
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)( s% K( R/ V& i
VMMCall Get_DDB
. d6 i3 ]% j* X& H mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed# m) e0 z/ \# [, r7 k2 k
& k$ T" f5 ], P. K4 O+ @Note as well that you can easily detect this method with SoftICE:" ~" L+ N% {4 a" g# }, U
bpx Get_DDB if ax==0202 || ax==7a5fh" t4 j. J# W9 F# f
! N. g% Z) T- S F2 n v! z__________________________________________________________________________, T4 {! U9 ~3 @- T" \
6 I( n3 I( ~/ ]: G6 |: b( Q! QMethod 102 ?7 K; W" k% j# L3 v( {
=========
- R7 G! c, V) B7 w
0 C' r+ Q6 x# C' r- p% t=>Disable or clear breakpoints before using this feature. DO NOT trace with9 T) o7 \, j y+ y; T
SoftICE while the option is enable!!
( j- g, i1 [+ a, W( q1 G. x6 j% M* X: D- o8 p8 u
This trick is very efficient: e7 f. K. `5 Y, T; k# {& X
by checking the Debug Registers, you can detect if SoftICE is loaded
; t0 s2 l: K+ @7 z( n(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
( z6 W0 q2 |6 J9 t" G$ d) y5 i% Uthere are some memory breakpoints set (dr0 to dr3) simply by reading their7 P: d6 c6 a( D' y* y. N
value (in ring0 only). Values can be manipulated and or changed as well4 M V2 u3 F, o, a! V" n, F
(clearing BPMs for instance)
% Y0 o6 k* I2 w/ j" A2 @
5 D; a q2 f) ~5 f V/ `__________________________________________________________________________
9 d3 `, g1 i3 t2 N( z$ y' D% d
5 I& q0 R$ a2 g5 w7 k" s. `Method 117 o/ O) @7 C8 h9 `0 r: `
=========. S x! o8 o/ k0 E8 o
4 x6 o2 Q! [/ V: N- I' O" }/ ^
This method is most known as 'MeltICE' because it has been freely distributed
( F& b6 a7 f& @! _" `. wvia www.winfiles.com. However it was first used by NuMega people to allow; z3 a! i# l8 E5 N( F
Symbol Loader to check if SoftICE was active or not (the code is located7 |# }% P) w+ Y4 O. A+ N2 \( }- T
inside nmtrans.dll).4 W/ `# x% V# m7 q4 r7 F9 k
+ S, x% u8 H0 A" I* p- TThe way it works is very simple:
6 y/ O- z: \0 y6 x7 U3 I+ R5 N& KIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for( D' @: f1 y6 ^ R3 m3 I N
WinNT) with the CreateFileA API.
# t0 W. I t F5 G* a. Y, j0 C$ K/ y& Z$ N) s* }+ ]
Here is a sample (checking for 'SICE'):/ |+ }( C& r& Y3 l2 _
# L! S" B1 n! x9 ]BOOL IsSoftIce95Loaded()6 k2 P7 g0 j. r$ Z& u# K7 b
{
& g2 }. A8 L5 i HANDLE hFile; 1 g& @$ L; u8 b
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
) e. |3 D$ ~2 f* F3 z) ^ FILE_SHARE_READ | FILE_SHARE_WRITE,
0 @8 e z+ u) ~4 c2 | NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);" G) v9 @: L; o
if( hFile != INVALID_HANDLE_VALUE )0 Z; w6 A8 Z4 f6 B( ]+ Y# b
{
4 _6 A: |; e3 W7 S& v9 `; T CloseHandle(hFile);
& q/ ^1 }/ L3 |- B% h0 G- }6 W return TRUE;: w# N( i) |5 ?% z% E: [
}- J( T }) C; q6 D$ z
return FALSE;
1 u, S+ ^& P& |}: x, T ~' i' l9 u
* I0 w7 [. s$ f
Although this trick calls the CreateFileA function, don't even expect to be* z( _4 B e2 G# w1 m' D
able to intercept it by installing a IFS hook: it will not work, no way!
! u* k; E8 U; b ]4 d+ ^0 yIn fact, after the call to CreateFileA it will get through VWIN32 0x001F& Y: b6 I$ ]$ m3 b
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), K& r7 T" ^: M
and then browse the DDB list until it find the VxD and its DDB_Control_Proc4 a# z& K; _" Z6 d/ R5 H
field.
; I+ f9 N$ b# q1 Y& tIn fact, its purpose is not to load/unload VxDs but only to send a
' g7 ~" b" s% s( V! k% r4 e/ |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# z: h: x( n$ P/ i0 N n) X- y7 [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 \( B$ F9 @2 j, `
to load/unload a non-dynamically loadable driver such as SoftICE ;-).; ?2 ^: S2 b9 m+ f% Y
If the VxD is loaded, it will always clear eax and the Carry flag to allow5 o( l: G* Q% Z0 G( B: M# \
its handle to be opened and then, will be detected.: v- S. F7 a9 f5 K1 M
You can check that simply by hooking Winice.exe control proc entry point( M3 G3 P, y4 W* Y. ~ u0 I9 {
while running MeltICE.: h5 L/ X2 K8 R, ~ _8 ^% R! G7 R8 W
/ T7 ~1 R/ B z$ Z9 y% v( y g
9 G- V% g |/ {3 E 00401067: push 00402025 ; \\.\SICE" e3 E4 i( _# }1 A+ z9 t
0040106C: call CreateFileA
1 R; t& d2 P! o3 T 00401071: cmp eax,-001
% g) J6 h5 J; H8 e+ A9 p 00401074: je 00401091- \% ~) M$ k% Q, ?# L l5 j4 y
" z7 }0 F! r" r3 _
$ M1 T# }. ?7 ]! V# @, oThere could be hundreds of BPX you could use to detect this trick.; k; Y7 U8 l' O2 _3 i
-The most classical one is:4 N$ ?' U+ @' x0 W
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
- ]; a* P0 M6 m5 v% z *(esp->4+4)=='NTIC'9 h) L0 O7 \: e. R* j
+ h* @ i" S: V0 ^9 u-The most exotic ones (could be very slooooow :-(& U* N+ g$ q9 W, _. \
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
, C2 ~ B0 r+ I& ~) k: c1 h ;will break 3 times :-(
* k# I' v7 O6 Q# d
5 V/ d3 M1 y M7 i1 M* `/ P2 ^-or (a bit) faster:
+ r$ ^, J8 S% b$ F4 Y BPINT 30 if (*edi=='SICE' || *edi=='SIWV')! p7 z1 n/ R# y
3 \4 k; L* \" ~( [ s1 C BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
1 a- a4 \# h% d. S$ s y- p1 u) e ;will break 3 times :-(
) X _' f8 p2 w+ K) G: @
- @. e7 u1 a) l: }+ d& o-Much faster:5 {8 Q) K" r$ G( k: N/ K
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'7 ~5 F; W$ m3 H- \/ ~) n8 m0 O: X
# R: ?% ^ k8 q
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( u4 _3 ~1 K7 I2 ~# u' ~) t/ ufunction to do the same job:
) g, L- Q. p, ?0 r9 p! {$ E% `" f' D3 Z- I8 y
push 00 ; OF_READ
6 Z9 T* h$ l; P0 K0 V mov eax,[00656634] ; '\\.\SICE',0
# b b, {/ K5 T# i+ \ push eax2 i _! F+ _+ n0 `* J; v
call KERNEL32!_lopen9 [9 o3 C0 |# Y8 {" b& M7 {
inc eax0 x: r" ^" M4 t7 @; L( H
jnz 00650589 ; detected
: ~$ l# J8 E$ c* Z) N5 p push 00 ; OF_READ5 X/ Q/ ?9 \# k3 M" G
mov eax,[00656638] ; '\\.\SICE'/ ^ ?# V: d6 z8 I
push eax
# t+ B5 p8 ^8 `2 L# n call KERNEL32!_lopen( ]' L# X0 c% F3 a6 v. E- h
inc eax, H2 c% o {. ~5 I
jz 006505ae ; not detected3 n7 ^. g) @: l& Z( j
% H$ E9 O. O2 F9 a- l5 Z H% v3 g4 T, q+ a9 e( y
__________________________________________________________________________3 F* G M; y% A) o( P7 K/ w2 @* }( _
' B2 ]" Q0 V; q- G+ F$ C/ M5 JMethod 12
: ^6 D3 k$ p4 Y+ d=========- H! E6 f/ c [" f+ d6 T
! ` Z$ O) B; e, K9 q; ^ ?- ^' P
This trick is similar to int41h/4fh Debugger installation check (code 05
! Q" u/ m3 n7 Y3 P' x# _& 06) but very limited because it's only available for Win95/98 (not NT)" J5 X: k. W5 j9 l
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 [. D8 ]* z+ b; T. J( ^9 }9 l5 b+ i2 a" p' l
push 0000004fh ; function 4fh
3 f+ M) B: D3 S8 e. g- D push 002a002ah ; high word specifies which VxD (VWIN32)
+ }* _8 y: S7 h# o0 Y ; low word specifies which service+ \. U. }* L% y! q5 {
(VWIN32_Int41Dispatch)" j3 F- D6 A2 K! l f, r
call Kernel32!ORD_001 ; VxdCall; \* o/ m* ^( |) F
cmp ax, 0f386h ; magic number returned by system debuggers
2 K3 T: `; t% t9 ^' z/ {$ S jz SoftICE_detected" Z u, q# G! V3 r& T. z
: s5 O! T1 ^% ~
Here again, several ways to detect it:
- |% U! e* U) {; Z/ T9 `4 f6 v6 ^1 j
6 M$ Y9 t9 F6 S BPINT 41 if ax==4f: w/ i9 S- @( w& ^
N! w- j! W7 g* a& s
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
" l. O+ R2 C0 `* h( }+ @
' T/ N9 r3 M3 T3 G; w8 M8 r BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
4 E0 H! r$ L9 P7 r# l; E$ Z* [9 c' ?0 U
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
+ a% G2 n, ]: h( m) k; l
& U1 R9 I/ s: f$ [" T__________________________________________________________________________
9 K5 C% j1 M: Y) z+ ^; j& r6 w8 g a. k" [: [7 N( O
Method 13) |2 ]8 T/ h1 i0 y; c
=========9 f! G; h1 d N
% v0 h3 t8 y% P0 U7 TNot a real method of detection, but a good way to know if SoftICE is
h9 C! P% P: N) a2 M2 [, N3 V9 M% \installed on a computer and to locate its installation directory.+ H; t0 o4 v5 G4 |
It is used by few softs which access the following registry keys (usually #2) :$ k! K) w2 ~# r( T' U. G
1 h/ _, [- z, U& U-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; S0 v( S! G- K, i- i
\Uninstall\SoftICE
4 W) Q$ k% T0 F-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' D! b! ]' G% r9 {+ [8 A( W-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, [" B3 A6 R: v6 G& w) b\App Paths\Loader32.Exe
6 [0 {6 a3 l( A3 l" e+ t2 p8 b, \' a( x/ D3 k; D
$ @& I, J$ a, S) f: `Note that some nasty apps could then erase all files from SoftICE directory g! N& [- w$ @# K$ D- s8 R- Q
(I faced that once :-(
9 B& v1 B k# v6 i4 N
2 C/ `3 s" v/ X7 {; L+ @* MUseful breakpoint to detect it:
" ^% f, M0 P& ^2 W' @4 D2 ]. M0 D9 A& u( f4 l1 J. V4 g8 A3 j
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
/ g; u& x( ?$ F6 O, C' |6 T- A3 [5 J" P
__________________________________________________________________________- C/ M% c4 H; [ Z5 }, D4 ?' S$ C
3 Q2 D6 {9 O* V) E
3 I3 D2 R7 E1 }+ o N e. a; zMethod 14 5 H/ y9 h( S0 {! v8 E/ |5 X' R- g& a
=========
* i5 V# n. _8 f: |3 Z* ?, X
0 Y# }' ~: w& a1 L: |& Y/ q! U+ vA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
* z5 F/ ^' q/ K9 A- c7 }is to determines whether a debugger is running on your system (ring0 only).
/ ]+ @9 v5 L* |) g( b9 u' A( l' p9 ~9 Z; h
VMMCall Test_Debug_Installed
" M9 A1 F6 J) ? je not_installed4 H( [+ n: m; B$ S# k; J
, _- A1 F& m" R) u
This service just checks a flag.# O& m6 }/ y2 x5 r, \' Z$ Z
</PRE></TD></TR></TBODY></TABLE> |