<TABLE width=500>! ?& l) ?4 `: U
<TBODY>
4 ^ k# i6 B( N C6 Q<TR>: C) z: f' k& c# I _
<TD><PRE>Method 01 8 l5 \% Q) Q' r" F" \3 G1 a
=========
- z& x! q9 ~6 A- j% C# X' t q1 Y* E; C- B# ]" f8 a& K& M; j
This method of detection of SoftICE (as well as the following one) is
0 u' T& p t$ ]7 j, V y# g( aused by the majority of packers/encryptors found on Internet.5 u. P4 A% g# W9 Y8 [0 o% j
It seeks the signature of BoundsChecker in SoftICE
" v3 A7 X8 G1 H& x1 e- _( X5 W$ r4 T( }! L2 a5 l! V
mov ebp, 04243484Bh ; 'BCHK'
4 M( W% O. ]! ]0 k7 o5 a mov ax, 04h
s4 d; @( X: |0 T! Z/ }4 r; S int 3
( M4 h. V* j; ] @$ Z2 `; _% ]0 P cmp al,4" n& D: a, p# G4 s4 u- _ A- h
jnz SoftICE_Detected6 y! r6 n+ W: x( ?. d$ t b! u/ O
2 i+ b: f+ d' l) a& u0 L! E___________________________________________________________________________5 x! [* {( b: F# X5 b
* C. F9 E8 r1 o" C `) ]9 s4 ~; v
Method 02
5 W$ C/ V! ^- z=========
9 F. z ]- v3 F& o4 I# @3 r, K6 p1 V" \$ V
Still a method very much used (perhaps the most frequent one). It is used
" u. ^8 E& C% z" a$ Sto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
& ^0 ?+ h1 a0 ~ xor execute SoftICE commands..., T+ m- ?. x( X
It is also used to crash SoftICE and to force it to execute any commands9 E6 ]/ E3 D" o! [5 L$ }
(HBOOT...) :-((
7 [7 ?* j1 X) o6 L( j7 p2 _
: k5 ?0 \$ y S1 r/ |0 r1 O$ Y8 ]7 VHere is a quick description:2 S- K! Q, F7 w& H( V7 N0 s
-AX = 0910h (Display string in SIce windows)1 V- t/ K* K! K8 s
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)- M* ^1 Y1 G& E7 k
-AX = 0912h (Get breakpoint infos)! z2 Q' T# q: o' Q4 N
-AX = 0913h (Set Sice breakpoints)0 ^( }4 N+ v8 |. m% c
-AX = 0914h (Remove SIce breakoints)
5 Y4 n( n/ r# P5 n2 o0 B
4 P5 @- G! F3 [9 N, pEach time you'll meet this trick, you'll see:
9 w) s) p# t# c3 p6 [+ E4 G8 U, A-SI = 4647h) L4 c- P9 z0 o) ?1 }4 s
-DI = 4A4Dh! x' U9 O* T7 [$ z9 ?
Which are the 'magic values' used by SoftIce.
. w' ^9 ]/ |) P: G L* hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: q5 w0 p1 G2 T& H0 x. l$ [ R1 i! |' i$ E
Here is one example from the file "Haspinst.exe" which is the dongle HASP) I5 B: K/ q, @
Envelope utility use to protect DOS applications:4 @9 ^7 M2 V" L$ w4 Z8 D0 Q
2 v% B, ]& R7 I
1 G& |) s9 Z ~: D
4C19:0095 MOV AX,0911 ; execute command.9 |/ M6 D+ Q* G% s5 m3 n9 o6 X& Y% a
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' C% z" n8 k$ e B, I0 I. g8 z( B3 k
4C19:009A MOV SI,4647 ; 1st magic value.$ O9 I; H. ~$ U$ F7 }& c% Y
4C19:009D MOV DI,4A4D ; 2nd magic value./ R; T. H' j$ ]+ F
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
1 n- P( {+ O, h8 U4 y4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute" Q" ]" v2 R1 t2 F& s' g
4C19:00A4 INC CX( S) @* ?8 u+ `8 I. e6 N# U& l4 F
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
* p0 d. o0 F) g- g' Q2 R. G: P4C19:00A8 JB 0095 ; 6 different commands.
1 v% j! e* i& K: o$ z D6 C4C19:00AA JMP 0002 ; Bad_Guy jmp back.6 A' {, G6 W2 k& H i
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
, V4 H7 T& J3 N" Q* i- o1 n1 H0 ~% [; p7 x2 M- Y6 G4 p
The program will execute 6 different SIce commands located at ds:dx, which
: B* {7 ^. r* u3 F( @9 Aare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.9 E8 `+ o; X& S
1 a+ l$ _! W2 c+ e
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
9 m, @" v( s3 f6 k* y' p& G& ?; J___________________________________________________________________________2 A, q& y J- G- e
1 @# y- K: c) a0 O
% S% Y' \ N/ y, k$ w
Method 03) l; P# G2 R* `( J U1 A; f
=========
4 v2 Y4 ^6 d, F! ~" G% Q
7 [* G4 K0 L1 I0 W% _Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
+ @$ x1 _1 P4 y7 i(API Get entry point)
! N% G) a0 t. k# B+ s" l, E2 n # J3 L; w& M. S( z: |( @
$ O. G$ E J7 f$ U8 w) S4 h3 s xor di,di( a% ^" i+ B: f! U* `
mov es,di
5 k/ _" `! d7 {( d: k mov ax, 1684h
6 p" F, t6 o& L/ F) W9 }3 s) o mov bx, 0202h ; VxD ID of winice
J- z9 L8 q z: _" S int 2Fh
) Y1 a8 S( o9 O& z7 Q5 K @ mov ax, es ; ES:DI -> VxD API entry point1 B0 X2 f) u8 I% T- {% a; O8 D' D( r
add ax, di
, o+ Z. |5 R. u n+ Q' i test ax,ax1 ^8 |5 H4 c: q M9 s
jnz SoftICE_Detected& p: h/ q9 @9 G9 `: c9 E
- r0 h6 n6 ~4 x( R. \; P: J___________________________________________________________________________6 O+ D1 r8 J4 W7 @( Y2 O( @, B% K% V4 k
! j) U: \4 Z/ d+ V( [Method 04
% M8 f. E" m0 ]8 C=========$ G! }- z$ s0 G; i" j, j9 J7 D
: y+ q7 ^! w: C: u q
Method identical to the preceding one except that it seeks the ID of SoftICE7 z# }, e: z( |' \. b; m
GFX VxD.9 I Q" p- {/ W8 R- u& e9 ]
& B! _" b- ]; r xor di,di$ X( }" a. p9 w! g2 B9 a; w# d1 _
mov es,di- I- v. u4 V8 {( N B/ x+ [
mov ax, 1684h ) Q2 g8 h0 m) f7 I& g) W
mov bx, 7a5Fh ; VxD ID of SIWVID r# x/ D6 A4 F( t3 ]- _9 D
int 2fh. `; P2 r8 U" p: @; R* G2 i5 |1 V
mov ax, es ; ES:DI -> VxD API entry point# ]! }! d& c) F7 Z
add ax, di
! t" }) C, b9 a% z test ax,ax; M) ?# _3 U9 P
jnz SoftICE_Detected; D$ @0 _: j/ ^) Q) P
$ r; G9 F m# q7 f+ n
__________________________________________________________________________# c( q! j, ? ~$ m3 {+ T
. B6 C; b' [: m& R" P' L2 g
9 N4 W7 X' C4 uMethod 05
5 y1 G3 [# b0 m/ f- Y* R=========
C: a+ |2 u: P" ] Q1 y9 j
/ J3 P) k* h, V# DMethod seeking the 'magic number' 0F386h returned (in ax) by all system. Q! v) c6 G( k: x( s& n u
debugger. It calls the int 41h, function 4Fh.2 e5 @' J( K% i& a) r- a. _
There are several alternatives.
1 u8 E( i* H* A4 Q( ~" f( a, `0 I) V0 J; N1 m4 m8 o+ i5 `% ]6 X
The following one is the simplest:
& k" n( `' K+ R9 r
$ K5 i" H( R4 s; C) U8 m/ z( t* ~ mov ax,4fh, [3 O8 x" k6 {
int 41h+ M* C" P7 ]6 B" A8 i; p& E
cmp ax, 0F3867 D3 J O; p7 p/ \
jz SoftICE_detected
$ v! l! [/ ]! g; M$ _3 J5 N' |2 Y& N& F, T' j2 w
- t& |, N8 u; Y" V5 iNext method as well as the following one are 2 examples from Stone's
, k) p3 P _0 C- k' n( j0 [ ~"stn-wid.zip" (www.cracking.net):
6 J( O1 ~# i! I, v
) W6 H; L* X8 u0 n5 F mov bx, cs. ?% ?7 l% `5 x2 D2 |" I
lea dx, int41handler2
4 R+ e% U- _2 X- x4 ? xchg dx, es:[41h*4]
8 o$ A5 ?$ Y' S& y6 N* e4 _ xchg bx, es:[41h*4+2]
4 D. w: s& x8 D! \$ M3 A* H9 O mov ax,4fh* e/ F) \* [* S
int 41h1 |: A8 y* [- D+ ?( G% i. U
xchg dx, es:[41h*4]6 A; _ G* Y7 Y% A1 r* ~( B: t9 T
xchg bx, es:[41h*4+2]
9 O! @' W" Z" Q6 ` cmp ax, 0f386h, ^4 r. ^1 [. H
jz SoftICE_detected% V- K, j e& c! }
# _0 }& X, u5 Q4 s
int41handler2 PROC
/ B" Q$ Y% n$ n iret
& D+ U0 Y- u' a5 C% n& U6 d/ w" nint41handler2 ENDP
8 T6 [, P) h C8 C" C6 |+ N
4 m* w" } `, n2 |/ P9 e
% U8 G7 }0 H5 |: D; T2 y/ q_________________________________________________________________________+ V3 C4 `+ p2 i: [# D& t+ r
8 [- o2 N7 o( m% G: @
# C, s0 Y: s& i) j& O. gMethod 06
5 w1 u5 v" l9 p3 N# N' u+ y7 T=========% B' r# t+ h( I' n! s8 [
0 x5 X. u' ~( z8 x$ S" w. l3 Y& i. ^& l4 A3 H
2nd method similar to the preceding one but more difficult to detect: I3 G6 F7 \. g" Z9 u4 }
2 X; t$ {' X9 h" L
: s" u6 \ W, O! ^ C( ]; c, ]int41handler PROC* N) w0 _! n% U2 b
mov cl,al
$ @: t K. s' w g iret6 f' s6 N! s' j, j7 E3 @
int41handler ENDP! q- B9 q1 w/ [1 d. N
1 A: m2 z- \' o5 s% J3 e) j) l* ]7 Y! E2 C3 b+ Z! A; q7 E! N
xor ax,ax& X& C8 \; |0 O4 E& m9 F
mov es,ax# o% j+ A) a# S) M- f
mov bx, cs$ }6 g& e+ F/ o% G' c4 g
lea dx, int41handler
4 a1 r7 c- N& v- H0 C xchg dx, es:[41h*4]' W8 ]4 ]# c1 |
xchg bx, es:[41h*4+2]" `2 X6 @, U6 @: b Q6 D% j$ j4 n
in al, 40h7 k, _& ?: v/ O- m8 K5 W
xor cx,cx- o# u/ U% S# h
int 41h
- w) H/ ?0 J6 ^: d8 g3 P xchg dx, es:[41h*4]& h& x* {$ t& x' e( F7 z9 w
xchg bx, es:[41h*4+2]+ K! ~5 y( b6 \$ _ F3 U
cmp cl,al" o1 c; r) _- l: F
jnz SoftICE_detected
! `! ~! q0 M4 _7 Y& d5 J9 p7 a* ^8 f e
_________________________________________________________________________
0 J( d7 E! K7 k% K+ h9 B# a
1 A& i1 i$ w1 B# b! sMethod 07
# j8 f f# T+ o, `- p6 q! c=========4 I6 W+ j1 I2 |& j
- i2 F; t# j- H/ x3 }
Method of detection of the WinICE handler in the int68h (V86)
' g) t" g j- f$ [% }+ x
( W7 u" s! u0 K7 e, } mov ah,43h
9 k0 g8 K6 ?( o4 b# Z$ r int 68h! H {. s+ w! N+ j
cmp ax,0F386h
8 L( q4 e+ }& Z0 u jz SoftICE_Detected
- n% O2 ^% s) p" C8 `" B) O' d6 C& B% H; h5 M) e5 X0 f
' ^, r9 U0 ?7 s$ s& e' Y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 u! N8 S( F: e3 [# i+ q, m+ w$ w app like this:
& w. F' r& B: G5 {/ I1 I
. E1 O1 e8 I% N9 t6 z BPX exec_int if ax==68" b' u3 G" T6 r2 O, x% {7 s
(function called is located at byte ptr [ebp+1Dh] and client eip is
: A6 U" |7 Z& v; E located at [ebp+48h] for 32Bit apps), |1 i2 r9 {% W0 k3 b" Y2 h$ r& s
__________________________________________________________________________5 b7 n. _* _# q* C. \3 @6 z- Q0 \$ ^& L
5 c0 Q, B# p( r$ E- g; {
5 N9 T/ w( ?) q; ]# j) H: eMethod 080 k9 n& u4 E# v( o5 f8 m3 d& @4 @
=========' N/ j" S2 j6 F$ g$ o6 v- g
, D( [+ f- O/ L* `+ p/ eIt is not a method of detection of SoftICE but a possibility to crash the
% o: H9 ~5 f, A' Usystem by intercepting int 01h and int 03h and redirecting them to another
8 V8 g0 s$ r; R# _ o0 Xroutine.
) t: r# g7 x: {: D2 x6 W+ XIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
Q7 e$ {! z2 Z! T1 v) D( ^7 S/ @to the new routine to execute (hangs computer...)/ A0 K9 Q; }+ u& o# h
p2 ]; n2 x, y/ P* Y# p( e3 I R
mov ah, 25h" ~5 \; ^' o5 c( R! R D. }
mov al, Int_Number (01h or 03h)
3 _3 v) ?+ E, X6 u2 g- { mov dx, offset New_Int_Routine8 u) D, p$ m1 t5 B3 L ]
int 21h. Z" i0 a( c: [! J) A
9 ?/ T1 W4 q. G d8 n' T__________________________________________________________________________7 W9 z3 z' S7 | M! f
, w% x) Y; e# f, ^8 s7 wMethod 097 N) {/ T+ X9 i. W2 C. a
=========
, ^, z) u7 F! q1 f: U* ]* J
1 ~* W, V+ Z& J5 d3 v3 [% j* `1 OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only/ q9 C* t7 o* v& V; h
performed in ring0 (VxD or a ring3 app using the VxdCall).4 l3 i6 z( E6 l; q4 x
The Get_DDB service is used to determine whether or not a VxD is installed
" w! B6 O! T9 w- |( q* afor the specified device and returns a Device Description Block (in ecx) for
7 u1 g/ [+ i1 [that device if it is installed.
& {6 @0 }. n/ n; W* L
1 n1 F7 |* ~( ~: N3 j* \ mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID0 H6 D6 L* l: }+ h; U2 d7 h7 S
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 ~$ n k' v/ w( q t
VMMCall Get_DDB
; S5 h( v( K4 j1 p3 k% P0 q mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
. ^3 o; A$ ~( x5 X* n
6 ?: ~6 H, D4 SNote as well that you can easily detect this method with SoftICE:: Y$ H6 Q- A. w" \. J q
bpx Get_DDB if ax==0202 || ax==7a5fh; A% E: ^$ B0 b9 {' g
3 \" v+ v# m x3 a. i" m0 f__________________________________________________________________________) {) z: E) \% b2 n; |, ~8 f+ N. }
& s j0 x6 W' x' h* z
Method 10: [* L$ \/ m, n) [7 J- @
=========$ Q- J5 u# I# `6 L: b4 e8 @
& }, u- }0 g3 g' m$ T- V# U7 L
=>Disable or clear breakpoints before using this feature. DO NOT trace with
9 U+ M* n. i% K: \5 q Y3 |( x SoftICE while the option is enable!!9 `- m! J- q9 ]9 y
X' g- D9 q3 x/ W0 A
This trick is very efficient:
! F/ q9 R3 p, r# |by checking the Debug Registers, you can detect if SoftICE is loaded' D2 |5 `6 p- \7 f' m$ ?
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if2 J1 f( G8 l1 A8 V. i: c" B, o
there are some memory breakpoints set (dr0 to dr3) simply by reading their
3 V% U4 S( k) r Avalue (in ring0 only). Values can be manipulated and or changed as well
8 x' A, b9 ^% L$ T(clearing BPMs for instance)# G/ g& L A1 f2 k; A) e/ e
4 j' G ]0 H+ Z7 G) p t4 t
__________________________________________________________________________* Q( F* P& F; [$ a
6 R, x Y; K# a. `Method 11 x" @3 u Q! O6 Z" B- g
=========
; H3 m5 c o9 V! X5 m: `
8 v0 Q& j1 b5 d! `" W0 @( P# cThis method is most known as 'MeltICE' because it has been freely distributed
# ]6 M6 {! w% m4 a. ivia www.winfiles.com. However it was first used by NuMega people to allow6 }. ?" N9 j( X1 v% e
Symbol Loader to check if SoftICE was active or not (the code is located
, i9 J T* h# i+ K# G6 y- Oinside nmtrans.dll).2 {! J1 {( k2 g; S
9 g6 S" X0 l5 ^, R0 O" H6 B3 U oThe way it works is very simple:
' Q' R6 F3 O) k) K5 CIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
+ ]+ S1 s- }- V0 s5 i3 ?WinNT) with the CreateFileA API.( f1 c! l$ U; Y0 I
: _$ D u$ V& `, ^* ]Here is a sample (checking for 'SICE'):
, x9 z, Y$ Z6 u, P6 r
7 T; q0 E9 |' i1 N' N* v) P/ KBOOL IsSoftIce95Loaded()( l0 N/ H3 t, H& m( ]7 v. i$ L. z I3 P
{( N+ r+ V5 c) u9 H) R
HANDLE hFile; 3 n) n7 k0 ]0 x% y* {
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
1 [$ B4 r* W$ ~5 z: i/ `6 ~, `/ ~$ v FILE_SHARE_READ | FILE_SHARE_WRITE,
- ~& T: g4 g3 z- V _$ k NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
0 z V. ?* ?6 \# h+ l: E if( hFile != INVALID_HANDLE_VALUE )
3 i8 y% |+ P5 H" R {
, t" X( h" }: l T# s5 C8 ~; y CloseHandle(hFile);
, s W$ a3 x2 p! ^ return TRUE;7 {: \% `+ i5 U4 O
}
- A5 `8 p& c4 ]3 W0 @ ~, I return FALSE;
7 P F+ P3 H1 F5 B: k A}
( ?. e# O- ^/ [/ V8 s; E. z3 l! `! L+ |2 [' `
Although this trick calls the CreateFileA function, don't even expect to be
8 H0 z3 E) r' _5 T8 p# N* C8 uable to intercept it by installing a IFS hook: it will not work, no way!# j0 g: w$ ^! v0 ]3 X& r T# i2 g
In fact, after the call to CreateFileA it will get through VWIN32 0x001F$ ^0 x6 q2 p# v& ~4 T9 |/ c
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
2 `) [5 M: P1 [% T* m8 oand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 l- U2 K; J+ n
field.
$ g8 }- C+ v/ @& T+ ?In fact, its purpose is not to load/unload VxDs but only to send a
1 C% q: p$ A: c; w8 L# d# JW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)! { x. M/ l8 @7 c D- [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
3 {9 Y% u k) I4 U1 \* b6 O! {to load/unload a non-dynamically loadable driver such as SoftICE ;-).
, k; g1 C3 A7 N* K: y* m* UIf the VxD is loaded, it will always clear eax and the Carry flag to allow
$ M7 s! {* z% B+ Dits handle to be opened and then, will be detected.- l) y, V9 z! p! W4 g
You can check that simply by hooking Winice.exe control proc entry point
8 b v7 X1 c8 u% u6 twhile running MeltICE.
% D% W# W' [; Z# ^% M. H
; d' T* X$ r+ w% x, o3 Q% h4 m2 n' Z
# }- M* z0 S5 c* h, H/ u 00401067: push 00402025 ; \\.\SICE( A+ F" r3 r1 x4 q" r, {* a$ @
0040106C: call CreateFileA/ A! _& J/ o4 q
00401071: cmp eax,-001
' o8 {6 A" W9 [3 }0 }& s3 Z( i 00401074: je 00401091! O; P% x7 \, u' ^% G
0 H, H6 `2 X8 B$ `3 }# O: o7 v7 C" t, M
There could be hundreds of BPX you could use to detect this trick.# l( Z; d& R/ q E. y# y2 L6 z
-The most classical one is:
G4 q# z/ a% d4 d BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||8 G/ d4 R0 W7 J9 }
*(esp->4+4)=='NTIC'1 i2 }& U# w1 r) F' U: ~
! a/ ?) j& a; L) i ~- F
-The most exotic ones (could be very slooooow :-( V: p" Q' C+ L) x) @$ x
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 w8 g" d$ Q5 z* [- P" K0 G5 ?0 ~9 l
;will break 3 times :-(+ P2 {' L! Z7 ?, b
" Q, O* u% q9 n% O4 ^-or (a bit) faster: % Q' W5 d; X1 i E8 V r' }, R
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" j* }- }1 \5 H: V
2 j- a3 o- T: O% A. A! ` BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
4 N9 d9 v7 \; y7 Y ;will break 3 times :-(# \4 g3 K) v! L6 u& z
. R2 a4 ~- ~' b5 A/ P
-Much faster:
2 f6 k! z3 }, E" q/ k* d BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
1 I( N6 w/ w" a) W, r# ?
' E7 u3 l- a+ ^! } C6 tNote also that some programs (like AZPR3.00) use de old 16-bit _lopen* r# S2 c: v- l+ G# t! j
function to do the same job:' {, _* y$ {9 Y I) W, P3 I' E
+ _ u8 v( G+ c3 s
push 00 ; OF_READ) V% @9 I/ a; q
mov eax,[00656634] ; '\\.\SICE',0
# {' Z% j; }" O- Y5 e. B% M+ ^0 k3 E! b push eax \5 ^7 G9 p0 e4 ?
call KERNEL32!_lopen6 ]: w9 Z9 r; O2 Q+ Y
inc eax
# P- d+ n% W, L( g jnz 00650589 ; detected
j; e, b* n" n2 t/ B3 E6 Y6 l push 00 ; OF_READ
! f7 {5 X, Z+ }* T. ^ mov eax,[00656638] ; '\\.\SICE'! `8 l) v5 o1 S! c, w1 T( ]0 `
push eax
0 S+ `+ s J/ g- g* D, t call KERNEL32!_lopen+ U. M7 |1 X8 ?6 g' ^0 J- |
inc eax
9 s- U3 w2 ]+ R' A! j# e jz 006505ae ; not detected8 L+ `# e: e" a2 K& p
9 b4 w# K9 r" N+ F( |2 O- |# E* ?
3 w5 m. n4 H" k- ___________________________________________________________________________
3 d s$ G: v9 o( L2 a! Q9 M4 N; R' P8 M; G" a
Method 12
/ _3 P* r9 l! o$ N6 T( f=========
' K0 ` S P& |; {% D$ h" F0 A1 Z4 l
) T9 [4 o. ?/ d$ E' b5 QThis trick is similar to int41h/4fh Debugger installation check (code 05, |, b( o2 h: L2 p! L4 ?
& 06) but very limited because it's only available for Win95/98 (not NT)
( n- i# f; o4 I6 R* r& K' A+ r: {as it uses the VxDCall backdoor. This detection was found in Bleem Demo.' t$ Z! X1 x# C% C+ X5 T
5 @$ `5 r" \6 R# `. J$ O push 0000004fh ; function 4fh
3 C( m7 s; J- W9 d push 002a002ah ; high word specifies which VxD (VWIN32)
+ z% U2 z% B# r6 Q8 f' P: Y ; low word specifies which service
6 z+ m( q& [: L0 @ (VWIN32_Int41Dispatch). _8 X' F# `/ U6 u
call Kernel32!ORD_001 ; VxdCall
& b& r1 \; X7 V! c" v l, w cmp ax, 0f386h ; magic number returned by system debuggers" X3 O7 ~7 _2 [& o% M) y* M0 |' ?
jz SoftICE_detected
% w9 o6 q. j$ Y! @6 P7 W5 p% M) ~ ] @! P! @9 a! o% e' [
Here again, several ways to detect it:
) T' I9 b+ K9 J- b
% ?" q/ n9 t+ h$ b6 v7 i BPINT 41 if ax==4f
" _5 d5 \6 f5 o2 L0 U
: L2 }5 ^5 S5 H ` BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
2 p/ [4 G8 S, v* C/ ^" o& D2 b. D% i I
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A9 g' y" r& \1 U+ u/ n8 Q9 F$ E
R _$ _8 O( V( E5 }3 s# x ]
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
8 w4 H7 X7 `$ }+ L. Q8 U) m' t
, ^1 B* D9 D. q# ]6 e: ^__________________________________________________________________________3 X% u, q7 h8 K' d
9 u( J; ^4 G" \; a7 t7 _% r. SMethod 13
9 E/ a3 `" P3 R# C* y9 T: c=========
! p0 h- X* m( q! K9 J+ k( p
. M* B5 ?) ?9 @; j. W" ~Not a real method of detection, but a good way to know if SoftICE is
$ a. V6 Y# ?7 n' G$ g kinstalled on a computer and to locate its installation directory.
2 ~- C4 b: `% s* ~It is used by few softs which access the following registry keys (usually #2) :
( @- V4 X5 Z( j) ~( B0 l3 s8 r( y" ?# l4 L1 t2 ?
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( Z3 U$ p' _: @. n
\Uninstall\SoftICE
* R- V; p. s% n3 b% r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
$ l- m# r! t) M# H$ j5 {' i# B-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. ?$ y/ ~4 l: k" [2 [. U
\App Paths\Loader32.Exe! j9 m1 x8 e5 a8 T! w8 X+ z- G2 C3 c
8 Q3 \! s" o) ]: r2 Q# i' j) H6 N; ~% ~4 |
Note that some nasty apps could then erase all files from SoftICE directory
1 t4 j% T% t3 C) {5 o(I faced that once :-(% U2 {8 C& t& G
& N+ M8 h/ y4 O, x3 @: hUseful breakpoint to detect it:
1 C3 D! J$ C/ C- s$ C& e: C' b6 D& T/ ]3 y: }
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
0 V" o+ I0 B9 p3 ^) ~
* k3 w: B' f ~* U. L__________________________________________________________________________
" l+ u x4 J! Z) Q/ y8 f/ r7 a7 k) Z3 U- S- H
9 k8 y5 h7 h0 t8 y8 W1 W
Method 14
9 N( \* l' r. l" z6 W7 [8 Y=========. Y6 t5 B) y! |$ I) @0 D% D
' S4 @4 R) F6 zA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose E' D( u8 }& x4 N" F
is to determines whether a debugger is running on your system (ring0 only).
$ c/ g2 d. J% r; Z# B) i+ H4 F
' w4 `, b7 O/ A VMMCall Test_Debug_Installed
* @4 X2 v' r& E) U8 @7 x! {& ^ je not_installed c! j/ K7 q4 ^
, }0 @9 o/ H( R/ r0 g! V" k7 \
This service just checks a flag.
- t: q% e% S( ?6 r3 d</PRE></TD></TR></TBODY></TABLE> |