<TABLE width=500> U# U' ?# \. ~- X1 X7 O2 Q
<TBODY>
- A$ T7 `- s1 Q: O# h<TR>: E+ I" D8 i% ]5 Z" |; A4 Y
<TD><PRE>Method 01 3 J, c5 [5 K* c( Q7 h+ t
=========9 L& m' W0 S! g, x
3 w: Q6 ~/ k, ?$ RThis method of detection of SoftICE (as well as the following one) is1 K' R, L* x; }" ~9 q" }" }
used by the majority of packers/encryptors found on Internet.
3 m8 ]9 s% Z5 e( `+ x6 y) cIt seeks the signature of BoundsChecker in SoftICE
1 D' J5 o& L7 I7 c4 w }5 x3 c1 t' a4 g
mov ebp, 04243484Bh ; 'BCHK'
7 v `/ z+ X- K1 n9 Q5 ~* B mov ax, 04h- V5 b$ ?2 V- a \- j
int 3 5 S1 N3 ?% R( x
cmp al,4$ ]' h, {* ^+ i% n+ M) V- n$ @- \8 }
jnz SoftICE_Detected) w- l; Q3 l. j, ^' j
5 ]2 W0 H9 t' h8 ^6 B3 }+ u___________________________________________________________________________
% l$ {: p2 \2 l F/ Q! c2 m! i o; \ ` u9 f
Method 029 E& k4 i/ w" B4 I$ |
=========
' B( _, l9 q2 s8 V& z5 ^% |
2 l" g! {; i$ n: nStill a method very much used (perhaps the most frequent one). It is used
" U4 y a5 G" g+ p9 o: {to get SoftICE 'Back Door commands' which gives infos on Breakpoints," G. o; y# V* @& z6 x; V( i |
or execute SoftICE commands...
& Z. N* ]9 I; E1 v* W' N3 k% s) iIt is also used to crash SoftICE and to force it to execute any commands
- o8 f! A; @" H% y, s(HBOOT...) :-(( : _. s4 r) R3 K0 t" @/ S
% j$ x+ W( ?4 b: z7 U, cHere is a quick description:' m& D1 H& O" G- R4 W' i
-AX = 0910h (Display string in SIce windows)
0 k. ^; b7 G6 k! J' w2 {-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)/ o, |) `. u* }% ^" E! J% ]. g
-AX = 0912h (Get breakpoint infos)
g7 @* J M) o4 |3 g# k: O7 a H-AX = 0913h (Set Sice breakpoints)
0 o( j2 {4 D5 e* B6 O$ q; N6 d-AX = 0914h (Remove SIce breakoints)! ~1 P4 b9 b2 V
0 r, k) ^6 M& E1 P4 ?3 u4 ]6 c: Y
Each time you'll meet this trick, you'll see:
7 T. G9 O$ ?# m* Z: ^7 _: h-SI = 4647h' q$ `8 W4 R& `6 u
-DI = 4A4Dh6 e( B8 \ c8 D$ y6 ?
Which are the 'magic values' used by SoftIce. ?' y# d5 T( p% F# G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.% H( {- ]3 w3 g( a& D1 P
0 D9 N3 h+ L. H! {5 F3 e
Here is one example from the file "Haspinst.exe" which is the dongle HASP9 [$ I7 N) v$ u& X+ C
Envelope utility use to protect DOS applications:! g$ w$ F; @* A- e+ t, u+ t
6 Y& R9 g7 |8 t/ n! n+ `( |/ x/ p! X& Z6 r
4C19:0095 MOV AX,0911 ; execute command./ e! {7 S9 ?! [9 }+ O
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
7 G- c: y$ v. U! x! c- S4C19:009A MOV SI,4647 ; 1st magic value./ V3 Q. q$ A; M4 N9 h
4C19:009D MOV DI,4A4D ; 2nd magic value.) T# a; }8 z$ t- P' r9 s- I
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
$ F: [& F! n. j! K7 A, ^4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
6 ^! v7 P' U3 v) p. J. D$ G4C19:00A4 INC CX2 g6 V6 ~5 o6 a
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute8 I2 e4 p/ @9 D1 `8 B
4C19:00A8 JB 0095 ; 6 different commands.: S' l% I% u, j& a5 R
4C19:00AA JMP 0002 ; Bad_Guy jmp back.+ h- Y2 C" f D5 c$ J7 i
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
% E! F8 R/ N( |: X
8 ^/ K. @. s/ p) F' {3 @The program will execute 6 different SIce commands located at ds:dx, which& [+ P% \4 ?/ @# R8 s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' p1 T$ W e7 k' ~& C" P8 i" ~1 G b3 e' Y' B1 s
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ w: M9 `, [& j) S& `___________________________________________________________________________3 G4 P. h6 Z6 c, Z: W- C4 X
9 j$ u7 y6 y& j. V8 R
, H7 J, j, q# W$ e$ y+ Q% N9 j F; W
Method 03
: A2 {! S) r+ N: @( b7 g3 W=========
7 |' l* O, X1 Q2 s! t; [8 |
4 Y% l$ V4 K3 h" O- p+ p3 X/ xLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! E2 u9 |7 Q3 D, t5 e% A(API Get entry point)
" x B' {6 U9 k& i$ P $ N/ e0 X, _9 j6 c; k5 r# O, [
) y' n) e$ {5 y- Q xor di,di
+ F; m4 O8 F. z) p0 l& |' o mov es,di
7 [" @+ N& z3 F: ` ^ mov ax, 1684h * x( j/ P5 N) c6 e; x0 m( c
mov bx, 0202h ; VxD ID of winice$ }( n* |+ t% u, t0 A+ j
int 2Fh# |& f9 M5 R6 u% E7 X
mov ax, es ; ES:DI -> VxD API entry point& }2 ~* Y; i8 g
add ax, di
) M# ?6 ?2 K9 t+ ^ test ax,ax
) M5 b4 s6 y; ~ jnz SoftICE_Detected
5 i/ c+ m) [3 d1 t$ m# c) d# A) y, \ m( o, I, t# N
___________________________________________________________________________
' @0 B! }) C2 K% h+ }0 {( }! O/ H# L, t" j
Method 04- l' I, h5 r! [2 \9 J
=========6 I0 L. W! @# V- b
2 Q9 ^2 w; ~8 j/ {8 vMethod identical to the preceding one except that it seeks the ID of SoftICE' ^3 W _7 b. @
GFX VxD.! Y0 ^" |% N+ @1 L7 ^
- S6 r+ m( A, ]' K xor di,di' p# L) Q: q- ]
mov es,di
; a' s) d3 e0 {! H- V" s2 r& h1 P mov ax, 1684h + I- H3 R- X F- s, c+ F; t
mov bx, 7a5Fh ; VxD ID of SIWVID# ]; ]5 U3 c& `7 A
int 2fh; [; I" ]0 k- K( ^
mov ax, es ; ES:DI -> VxD API entry point
- g, U0 x' N6 O add ax, di
" G6 n9 N% ]% i test ax,ax
7 N; w& S6 O; V: p, H9 f3 D2 ]9 w jnz SoftICE_Detected& j, p5 {* F% I8 T9 T' c9 J
1 c v8 D$ {. v' u8 `/ f
__________________________________________________________________________8 T9 i$ X% H$ t0 |' I* C
6 B2 a0 K. j2 ?; v+ f* s4 E' y; w$ y% x9 V8 F& W% K1 o% i
Method 05
& I* @6 T) ?6 A5 G9 V6 h! _1 n=========
/ {6 I) j# U# @& X4 {* | |$ g( A1 Q5 F0 A4 Y; u2 N' r
Method seeking the 'magic number' 0F386h returned (in ax) by all system
$ ?( n4 {) M( V; f5 O1 D3 t! cdebugger. It calls the int 41h, function 4Fh.
+ E. ?: I8 f: MThere are several alternatives.
& i4 F4 d/ f" Y4 B3 M3 Q3 Y5 v+ [. c$ d3 O! w5 R% \7 j
The following one is the simplest: f+ k* O6 w& C* ]+ |
) Z% q' ]7 g& m9 u$ p9 }2 I6 S. j* J mov ax,4fh
! E" m" ?% m! `& y5 x; v- |+ k3 } int 41h
, b0 a" g& e( g8 P+ B6 S' |/ g( h cmp ax, 0F386, h! N T6 ?% g/ z. _
jz SoftICE_detected( H) K0 U( y9 b2 u W: M6 T, I
o$ D0 _# m6 M; _; i8 k; s& `9 v9 X
Next method as well as the following one are 2 examples from Stone's
) i7 R6 q" L$ Q/ C3 E"stn-wid.zip" (www.cracking.net):
" l) R! ?" N& o) V$ k3 r# s3 \2 l* i3 U; p( b
mov bx, cs2 `' X, `' H/ k2 I
lea dx, int41handler2
$ Q6 R) p- v, X# I! \" I1 H M xchg dx, es:[41h*4]
+ c$ K" W$ q! L. U& }9 ~6 c1 w3 n" Z xchg bx, es:[41h*4+2]
5 F( _8 i) T3 q! ^& e3 ?1 p1 u9 e mov ax,4fh
% B5 L" L, C: R7 {% r: V" @2 B1 k& W) @4 z int 41h: U6 T2 d/ ^7 @0 |6 N& O
xchg dx, es:[41h*4]6 `9 ~; V5 U& p% O! C
xchg bx, es:[41h*4+2]& }1 S, f% ?5 Z1 D! w" T
cmp ax, 0f386h
5 m; b7 R. }7 w jz SoftICE_detected
1 u7 A A8 x& _; z5 S
" S1 `5 @ ~/ r$ ?2 D: wint41handler2 PROC
( I ~! ~! _. C- ? iret
$ I; a0 V' u1 h% j9 Oint41handler2 ENDP
0 k V8 x8 m+ f8 g9 u" i1 G$ J; t2 T
$ X1 p& A2 k' b$ L6 C
_________________________________________________________________________
! i0 A! L; ^( ]* {5 z3 i0 n; n7 y, G. i" e$ J0 ]. k5 n
1 t" a3 o2 ~" s
Method 06" P5 o) i: T( d% H6 C
=========
5 ^+ ]" Z- A- R: G9 b; i# A
4 x( j! v: C( s; W4 m' C" B! l& D$ i \4 V! R: g
2nd method similar to the preceding one but more difficult to detect:
3 u- |' g' `4 U* z l. k% n, S& O1 K2 `7 {2 ]- s
0 _. \8 C6 ?! W) o+ d1 {6 r+ s! {
int41handler PROC
- Z) t1 n1 s5 R& ^# n mov cl,al
, Z8 m. D, z" ]4 K4 Q1 ~+ s# Z iret
8 u+ ^* V9 ~3 v' w/ b( Vint41handler ENDP
. d" X* G: m9 X- f
: e) V6 `3 q& X0 D3 ^( ?/ s* m& [9 N6 C+ V) G/ {3 p
xor ax,ax
( B: Q' @# v7 @ mov es,ax
9 Z! ~9 @: l$ I% q mov bx, cs/ U% x# U9 r( R$ O/ V
lea dx, int41handler
1 y0 o2 D/ @. |/ i xchg dx, es:[41h*4]$ Q$ L5 y5 |/ q
xchg bx, es:[41h*4+2]6 @3 H4 x; G3 _
in al, 40h
# c4 d3 `7 o$ m3 c xor cx,cx
$ o4 y& U+ u2 r/ x5 J int 41h, Y3 K8 J2 g* i
xchg dx, es:[41h*4]2 e2 M) q& `7 j; R. T
xchg bx, es:[41h*4+2]; b& d$ |, |, ^9 z+ O* @
cmp cl,al
! Z( Q0 }- A$ {: a9 B% S jnz SoftICE_detected/ U( h1 S& x7 \( i8 n0 [1 u! U! w
. {7 @! r8 K$ O6 b
_________________________________________________________________________
! n' w- ]: e% l; K; N
( ^$ B7 x1 |5 q, ]+ DMethod 07
r {# m: [4 B=========
3 `, I8 L @: \4 F( M* U' c( n5 C* e1 C# C
Method of detection of the WinICE handler in the int68h (V86)$ ~ o3 E. u) _6 c: C2 R" p
* [6 Z; j5 ^6 }- _& q- h! d( t mov ah,43h
. U* n! i+ y T3 b$ ^4 W int 68h+ O) X1 r! Q1 i ?' c! d
cmp ax,0F386h
# k, o1 u7 V: z( h3 x' L jz SoftICE_Detected
g j( C# z, W8 ^9 k0 H, g7 C6 L8 K8 t
1 }* d) T/ y! e1 Z& }2 r
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# g" }8 \! Q6 t6 Q2 ?) N4 E
app like this:- i4 b. I6 B8 R
4 A( D' k5 p, l- ? BPX exec_int if ax==68
% }/ G! ~" k1 _- F5 @9 @ (function called is located at byte ptr [ebp+1Dh] and client eip is, L3 ]- d- s F1 ~/ [* [
located at [ebp+48h] for 32Bit apps)" ?8 T! C5 x4 }: b7 I. a
__________________________________________________________________________5 B1 w& d* \9 j) k. M
! F- c4 n" s# x1 i
& d- g4 q# D5 D7 H* b3 aMethod 08
) |4 w" \8 ~' T+ m7 G/ \0 Y=========
: J' J% Z6 t3 w8 C+ s2 n3 W9 }6 r
3 G( ^5 X8 | C. i2 P# SIt is not a method of detection of SoftICE but a possibility to crash the
6 q3 Q4 R( Q. Q7 _* H% _& m5 R+ A6 Wsystem by intercepting int 01h and int 03h and redirecting them to another5 z" {8 N5 Z1 R! `8 i+ k+ u
routine.
8 n. o1 a7 {7 Y, d1 oIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
: _( T# U: Q0 V6 x: i* zto the new routine to execute (hangs computer...)3 }" g) E4 L% d4 ^* x+ b0 a
3 b* B ^! Q( O0 B mov ah, 25h
$ J3 V o- S8 y3 A! o mov al, Int_Number (01h or 03h)9 c; z! E( _+ l! d. X7 P7 x' R# y
mov dx, offset New_Int_Routine
! P5 h X! \5 v: B* [! _% b V0 o int 21h; C' R! t1 S* B+ C, o
" B+ W" Y/ u# ~. a__________________________________________________________________________
) D8 v3 i$ T5 j$ V9 U
6 Q, |% @ Q' {% M; K" PMethod 09. f6 M( K* n7 L7 f' j: d7 K
=========' v# Z0 K+ \3 C; _2 o/ B" f' t
( A z# S* }8 h$ H( PThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only3 b+ {* i5 h1 o/ n
performed in ring0 (VxD or a ring3 app using the VxdCall).
& m* Z, O O3 aThe Get_DDB service is used to determine whether or not a VxD is installed
1 C: e5 o5 _1 H' w$ `7 ]for the specified device and returns a Device Description Block (in ecx) for3 C. I; H5 i n& B% E
that device if it is installed.
8 d9 G9 @+ S6 A# A* R% Q. X, q: A8 c' D& C* K- k2 W7 I
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
" E8 d ^# U& D" a2 G; J mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)# l6 s& E/ e- a/ l
VMMCall Get_DDB! _) e. O/ ]0 d* p3 a
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
3 y( }/ d8 }' @5 I# {. r+ x
: ^/ t, N# X2 A3 x3 RNote as well that you can easily detect this method with SoftICE: m& s* V. l% `
bpx Get_DDB if ax==0202 || ax==7a5fh; e% {2 q0 b% ?9 R$ S3 m
$ }, d, N O& a3 [( k; ~4 H: t; U__________________________________________________________________________/ s* u+ c5 u! q" o# d% g6 t
! Q/ }2 Q) K! \1 W4 `; f
Method 10
6 P! b$ |1 I% ?( Z1 Z=========6 n6 ?" g" i9 T3 g
' |" \* V: O9 A/ ~( h* n/ I5 \$ ?=>Disable or clear breakpoints before using this feature. DO NOT trace with$ H* l& l7 Z8 c: `' H6 [/ t
SoftICE while the option is enable!!! X( K' r. V4 u" ]/ J1 |
# @8 |6 G' G$ ?This trick is very efficient:
% R# G9 k- `$ d, b) P( J0 o9 hby checking the Debug Registers, you can detect if SoftICE is loaded
+ r# P, E0 r2 o8 x(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if8 `3 C( N |- r# {7 }$ l' U- h
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, l8 n# Q$ r% S$ }( dvalue (in ring0 only). Values can be manipulated and or changed as well! U) u% v/ d! m
(clearing BPMs for instance)
4 }8 k- a% M8 ^$ v- l4 v. e7 n x( l: a' O0 ~( r
__________________________________________________________________________
; A6 x/ g1 o" w3 B. f k) S$ K: s" o _( ?- ^2 r
Method 11
# H- f& [; X+ P$ }, K=========; @9 ~. f& p+ r( a t9 | ^
! p% m, G4 f3 V* g0 p7 `
This method is most known as 'MeltICE' because it has been freely distributed
5 U9 Y0 }# B# U8 ^via www.winfiles.com. However it was first used by NuMega people to allow
+ ?. A' F+ Z- D8 g- ISymbol Loader to check if SoftICE was active or not (the code is located
7 ~; c# J2 v" d4 z. |inside nmtrans.dll).6 y% L4 J4 `. O8 v9 H# I0 V# I7 m
. N2 v/ K3 ?' J9 mThe way it works is very simple:+ K$ T( g& R& p8 `, j8 y
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
, M8 e/ G0 \; |+ V! r$ W$ X$ ~WinNT) with the CreateFileA API.. k( `# t; B9 z" t M7 i
% P$ n9 H# c* ~1 {3 C) y
Here is a sample (checking for 'SICE'):
$ n. P. N7 ` V$ a8 M' T
9 n$ N' j; P$ OBOOL IsSoftIce95Loaded()
5 R9 W5 l6 {! R8 Q{( s: i# j+ P% y7 f9 a0 Q
HANDLE hFile;
# h. ~' N; {' X, f* B hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 g% y7 W7 i Y, h; o& o FILE_SHARE_READ | FILE_SHARE_WRITE,
[% r6 G; R9 e. z3 _' n! o3 g NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);! s5 m7 v+ X$ _# f0 ]% {
if( hFile != INVALID_HANDLE_VALUE )
0 z3 S* T+ {$ A6 e, p {
# V, G; F2 m) H: P1 |9 x3 h CloseHandle(hFile);
; y* M* w$ c! @! F3 {4 W2 g \ return TRUE;' l% S- @# c2 a9 E* @5 q) {5 Z$ e
}
' }. u9 t3 S4 F( v; j return FALSE;
5 L9 @3 @$ P$ [( y) g0 e0 f, h" z}. f% A) k9 `' ]8 C* V
& x4 R- h1 E# T+ o0 B' {Although this trick calls the CreateFileA function, don't even expect to be
& u5 P* c! D b/ Hable to intercept it by installing a IFS hook: it will not work, no way!) I" R6 X* f/ ?# {! }6 t
In fact, after the call to CreateFileA it will get through VWIN32 0x001F3 l+ `. R4 g4 P& ^5 i
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ \5 x$ ~6 K$ D! ~: H; Qand then browse the DDB list until it find the VxD and its DDB_Control_Proc
: p* [5 B. ?1 U5 Y! K5 `field.
- h( W7 X% Q, i# aIn fact, its purpose is not to load/unload VxDs but only to send a
. p* H$ m4 i7 t9 uW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! ]: r4 v1 S7 N, y3 X9 T
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
1 N* O% G6 U) N }2 ]8 m: M- j! Gto load/unload a non-dynamically loadable driver such as SoftICE ;-).% `6 Y3 b: r9 y* F a( { f
If the VxD is loaded, it will always clear eax and the Carry flag to allow* G9 Q3 q( a# Q/ W2 X0 ~
its handle to be opened and then, will be detected.
7 a* u* Y2 n7 v; i: MYou can check that simply by hooking Winice.exe control proc entry point
, V0 B8 Q" o3 o* l5 ]/ b. O# Z0 Bwhile running MeltICE.
8 G5 S; [5 ~3 X+ e& E9 ~
6 B {0 k& k# B; x& ?
\$ I( ?: n4 H* d3 k5 a) b 00401067: push 00402025 ; \\.\SICE' o! }6 ~' D+ A0 m
0040106C: call CreateFileA
6 d) S2 T/ k! A 00401071: cmp eax,-001
1 q8 k8 L: H1 f2 g2 Y 00401074: je 00401091
9 S# e- i+ i7 |$ B& y' |; a4 j" S# t0 V. \
$ J# r: Y/ T* R3 d7 h9 V% W
There could be hundreds of BPX you could use to detect this trick.$ Y. {/ `/ h' T+ x( X+ {# q. \" [9 E
-The most classical one is:
: s7 T7 B( W% p5 Q BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
7 O: [$ J7 g k, w* P *(esp->4+4)=='NTIC'' p, B; Q; \5 O; P, J7 |
0 T8 T7 u5 v% I4 P1 y-The most exotic ones (could be very slooooow :-() H# H! S) W8 l3 X% H' D0 X: F
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 8 y2 b/ H9 R6 W Z J/ N
;will break 3 times :-(
: w) l6 U" v8 m3 o( Z9 m
L1 ^4 p$ Z% e% M2 b/ O-or (a bit) faster: " {& s6 M: ?/ \9 d" j3 _
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ j% D D5 v" f# h0 r$ c! J o: I2 ^
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
5 i9 ~" V+ C, J ;will break 3 times :-(
, J7 T0 ~8 \& n
, k0 l, k/ N+ {2 ?-Much faster:6 M- q; f1 {# |* U
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
9 w/ L7 ^# W1 T+ y% X# W0 o: y8 Z$ g5 D
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
" x% L7 V- D1 V3 p$ Dfunction to do the same job:+ Q; |: b# G2 J; ~% Q B
1 M' j; R$ |. [% ^1 y push 00 ; OF_READ* {2 u1 k# t- L$ K* A3 j- W
mov eax,[00656634] ; '\\.\SICE',0
! J; i0 H2 j, u: ~' {: U push eax0 z% l& a& F( ~1 j& u. ]% S# l1 e
call KERNEL32!_lopen7 x9 ?9 i3 p* C2 f
inc eax
& t ]0 l( Q$ i0 B( W! `: U jnz 00650589 ; detected% R( x i" ]! z/ p) _
push 00 ; OF_READ
9 R3 d( H, u7 }: v* q mov eax,[00656638] ; '\\.\SICE'
3 ~8 X' N" b: d4 ^% }3 p. k push eax! } a4 s8 g1 Y8 K7 N9 w& o
call KERNEL32!_lopen
! o/ l' J. F3 h( K6 } inc eax; z# E% G( X8 Z8 U
jz 006505ae ; not detected' E* M. K8 g1 g" K) j: M
4 p: s: C1 r* ~) y. n- n# `3 Y* u
2 A( D m% [5 b2 X) ]1 B
__________________________________________________________________________
3 t$ e+ R& `* m& Q% A% O
P$ Q6 p: g2 x; v: s# {2 qMethod 12
5 c6 W' X( h. l" w=========6 i% A5 L$ |+ v1 B1 R. T5 N2 o
" x( N; Y2 } e0 P4 ]This trick is similar to int41h/4fh Debugger installation check (code 05
b6 \6 s2 b% X- f3 g! o& 06) but very limited because it's only available for Win95/98 (not NT)3 ^) f% U% {; c, E- O% T z" o' g; N8 Y
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# G. t( V9 b" W( x
9 D9 O9 t3 c1 c# |2 l
push 0000004fh ; function 4fh
' d7 e2 V, h J) j, H1 Q& T push 002a002ah ; high word specifies which VxD (VWIN32)
. p6 w" C- m8 V/ O ; low word specifies which service/ h0 F0 a! F8 r4 h# v: ~$ h
(VWIN32_Int41Dispatch)
' Q, B- D3 u- F7 ~5 B# b call Kernel32!ORD_001 ; VxdCall
9 t- J4 n' b- T) Z4 d) i cmp ax, 0f386h ; magic number returned by system debuggers) U7 k5 x9 H B- ^/ ] ^
jz SoftICE_detected+ E. S- x h h. D& s& T C2 E
8 q% B) x0 L( y3 D" s
Here again, several ways to detect it:
8 Q& T) ~7 O* v- Z: P, W4 ^+ U9 H# x' v
BPINT 41 if ax==4f
) U3 ?/ D/ o6 h/ c4 G7 | @" i4 F; c: j2 c; X
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
6 |3 E5 B3 k- L1 |$ W, ?0 \/ |- ^) n$ F- f0 ^- V x
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A* ]$ |9 ~- i; C7 r1 \
5 S) L- c5 p$ Z- w5 n BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!. Z; l! d3 _" N
3 f3 Q5 B2 a/ z
__________________________________________________________________________
3 y {1 K ~% L+ `9 `: [' O7 {5 u" ]3 F) `( ?6 u7 [2 V
Method 13
' U1 a6 |+ g2 y=========% |# F" t# K2 V, W
- T( z9 y9 I6 s( J @, i$ z
Not a real method of detection, but a good way to know if SoftICE is* N* q' s4 v3 P0 |% Y( j
installed on a computer and to locate its installation directory.
: b0 w6 Q8 b' p. K2 H: [1 J3 XIt is used by few softs which access the following registry keys (usually #2) :" h. E6 z$ C1 @% B
2 d8 H/ Z, M/ ^7 D0 [
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 R# B/ a$ c* F! c) A
\Uninstall\SoftICE7 W4 c% ^, K7 X, k+ ?: E
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE8 q9 v7 \8 Z* ^" E. w
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 D$ @* ~* V6 e& r\App Paths\Loader32.Exe, C# Y5 G8 N- g: d3 x# r
% O+ R3 @4 W8 T% y, [* H
! C4 Q' b4 J7 |! i% C# {, [
Note that some nasty apps could then erase all files from SoftICE directory& `7 ^0 m f l) z3 b$ i7 _6 v2 f
(I faced that once :-(! w2 v+ i/ S9 _+ z
# `1 ?1 o4 V ]3 I
Useful breakpoint to detect it:, ~" I# [4 e2 `" J$ }8 r \' i
! r% l0 v+ A1 X5 e. P, [ BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
+ @9 d- K" k- E( B5 y9 V* P8 a- p0 B, @
__________________________________________________________________________
0 \: o" I( A) m' D- C3 C2 e0 V: O+ b4 O( x
% t% S/ {$ }+ D6 K& q/ o( t
Method 14
% N6 [) u6 M, b- R=========
0 H) A3 A8 K* O5 { p; \% s7 g& V6 m9 S/ ]7 V* J% D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 Q) Z m/ j8 ` `is to determines whether a debugger is running on your system (ring0 only).
# K4 Z; o- u3 F4 Y7 Z) s( V" ?/ Y$ [* j' H
VMMCall Test_Debug_Installed, j# D& G8 ]* T. l
je not_installed
2 v, l4 Y: r Q. D" B
# `# U' E$ q& a! p" q9 c+ hThis service just checks a flag.2 s0 o- E- ]6 b- H
</PRE></TD></TR></TBODY></TABLE> |