<TABLE width=500>* B$ l& a5 m* ^9 e
<TBODY>2 j8 _1 S7 f) o4 R- n* t
<TR>
0 a' A! c1 l2 u4 F [9 J<TD><PRE>Method 01 : {! f$ i! r$ D0 o6 {* K, ^9 o% y
=========) N" }4 e3 o3 }4 Q5 u+ x
3 J1 Z D. g2 n5 C& Y4 u' m
This method of detection of SoftICE (as well as the following one) is# K6 s( y% N. l$ x: a; p4 |
used by the majority of packers/encryptors found on Internet.
8 n. E: e1 Q/ DIt seeks the signature of BoundsChecker in SoftICE
4 W8 z. `: L0 E- Z
0 X6 l# P: ~" h* H p( z1 _ mov ebp, 04243484Bh ; 'BCHK'
- @/ C9 P3 N3 X6 _5 }/ m4 z0 F mov ax, 04h& h/ F+ `9 ?; d! M6 h
int 3
1 }% k) P* M, N7 v( v- Z cmp al,4
% I1 |/ u8 h8 u- D! f5 Q6 C- {: e jnz SoftICE_Detected
4 y6 r' C8 _7 B. Z; j/ y% t% V9 U7 d* z: |
___________________________________________________________________________
& a7 W0 ~$ _$ M6 p8 H2 d: N! [. |" M3 z+ q2 K( u+ N6 u
Method 02
' y# v$ U' g$ E5 ]' v=========
$ a) K6 T1 I, p& z
& c1 i( c7 S8 j% K. oStill a method very much used (perhaps the most frequent one). It is used1 e3 R; `0 S: C9 |. \+ Y2 G
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, u' | d( {+ V% r, H% k* Q+ a) m' v
or execute SoftICE commands...
- Z7 b; @9 l5 s* p0 p7 JIt is also used to crash SoftICE and to force it to execute any commands/ [5 ]8 l( s* O* P7 S" E1 P) c5 ~; _
(HBOOT...) :-(( % D3 l* q/ s; k5 K, Y% g
3 y& V& u1 m8 p( @3 K j
Here is a quick description:
B% T8 N8 ~( L, O/ d$ e: U-AX = 0910h (Display string in SIce windows)) T E8 k6 N2 m/ Z# e6 \' a9 d7 B% b7 z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)& C8 ~# |1 [$ R; n9 T0 H# a7 @
-AX = 0912h (Get breakpoint infos)
* n* e }; E5 x# d3 i5 ]" j9 t3 w7 N-AX = 0913h (Set Sice breakpoints)
* y+ g$ ~5 H. L, d$ U-AX = 0914h (Remove SIce breakoints)
- F4 [; M4 {/ R' w! R+ e* T
9 w5 P: a& f" J, b0 J/ c8 iEach time you'll meet this trick, you'll see:
& V3 \6 S0 E+ A7 X& I- R-SI = 4647h
, Z* ]" R1 x! U" B& F* s-DI = 4A4Dh
5 [! Z$ H, t% @" b3 H9 CWhich are the 'magic values' used by SoftIce.
: `8 n- _1 h1 L4 B, kFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.: T! |( ^/ F+ a
9 N6 ~& |% c9 U: b2 h3 w8 QHere is one example from the file "Haspinst.exe" which is the dongle HASP
) {$ Z+ j# _8 D. UEnvelope utility use to protect DOS applications:
1 U ~ m( M) [; H7 r
$ m" ~1 [9 \- S& ~0 @0 i# I n
5 F7 w3 N3 M" K# E N0 t4C19:0095 MOV AX,0911 ; execute command.
6 S: C8 ^& M7 t# T+ M5 G; I. I4 o4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
5 | e: V3 X+ N: p4C19:009A MOV SI,4647 ; 1st magic value.2 ]) j3 S. }4 |( N2 Q$ y& B( z. ^
4C19:009D MOV DI,4A4D ; 2nd magic value.
4 F8 f; F( c- i6 Z4 F4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*). z/ w( O4 D" M' n- g- r
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ c8 c+ B. z8 t$ c4C19:00A4 INC CX! z+ Z8 G& D% _! {2 q
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute- S- S9 x6 ] i! ]3 @
4C19:00A8 JB 0095 ; 6 different commands.
# r; M X- L0 T. T) K5 j- }4C19:00AA JMP 0002 ; Bad_Guy jmp back. V- r* e( S! {) f3 k
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)* `/ V$ @6 ~, b! E
3 A' K% i# o, l8 [! N$ a: ]The program will execute 6 different SIce commands located at ds:dx, which
3 p: {" u' p) d3 ?4 rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 v" }- H' c% Y; b" R/ t$ W
8 [% [' b3 I; @8 z. B
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 y& f4 Y) \4 O% t' F( k___________________________________________________________________________) F& T( z2 ?+ w$ o0 k& @1 q- j
: E+ e7 G/ g0 x( V( P* V- X5 n
! m# f8 y; s/ n; A/ j" c' Q" N3 K' v
Method 033 X0 z' ]& X0 L6 a/ e$ w. B' X
=========
7 b+ i( `$ S" ~. t3 ~8 h2 b o X/ `! T
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h! h# p- w! k# ?' r/ B7 ]! w0 @
(API Get entry point)
A& V6 j: x# t* m 4 |$ W- F( B8 ~& K9 d$ I
+ `, V) N# P5 }) c9 x+ P
xor di,di) p; X% W9 P6 I) F( g" l* }
mov es,di
( R: [; U# B' D" C: E& h/ t9 ~4 [ mov ax, 1684h " [/ T) T9 u9 e" D9 l& `, L( G3 i4 p
mov bx, 0202h ; VxD ID of winice+ \7 x5 z, E) u( A3 }% j
int 2Fh! W7 x/ t( w* I3 n* @9 b
mov ax, es ; ES:DI -> VxD API entry point% g- ?. D: A, z% W) T$ O
add ax, di
1 B0 V f; }; n- K test ax,ax, K6 y2 Q) v6 P8 G+ r0 V) r. P
jnz SoftICE_Detected
* z; E2 n! c9 F; z
9 ^$ R8 L k2 n: E___________________________________________________________________________
6 \ J6 ?+ i, X9 f6 r5 {4 ^8 E% D C* S+ h" V4 D$ h: J: M5 ]
Method 04
* o3 m ^6 s' s( ?) s8 o9 s=========
( `& [* P2 u0 V; }6 H/ \$ h; ?+ O: J4 ^+ q1 m& b# B& F& g' I( z
Method identical to the preceding one except that it seeks the ID of SoftICE
* x1 A; e0 e: m# K. eGFX VxD.
: l) [* j, E+ x3 p0 j7 ]: ~8 P: Y: i: E# `( O8 K9 O$ q
xor di,di4 x" H; e* r9 M
mov es,di
$ K/ L& x+ [- u, `& k8 O& U mov ax, 1684h
: {8 r6 i; _/ C mov bx, 7a5Fh ; VxD ID of SIWVID
3 P& ?3 b% |1 L( C$ K5 L# C, g int 2fh7 M9 I1 ?! K) s# M# _) D/ c, n+ l
mov ax, es ; ES:DI -> VxD API entry point
5 H! F$ ?. M/ M! H& I$ r4 R. R4 q add ax, di
1 X4 F p% u1 A" k& u- @# u test ax,ax
g, U- o: \+ T$ G4 U Y* M8 a l jnz SoftICE_Detected
5 l; u3 K( u% Y: t& N' O
- a2 O- N+ ]. S" a* I) R1 ~* l$ c__________________________________________________________________________
% D- g) [$ h X! F' @: ^
, j \1 J( N2 H% n* [7 n' B
9 p- W3 _/ F0 S* v. [. n5 o( X5 jMethod 05# k' w9 l- M8 _9 ^9 j$ S+ b
=========1 W8 z; K5 _+ b/ A# o
5 z4 ~- J/ Q( m8 O% sMethod seeking the 'magic number' 0F386h returned (in ax) by all system
8 d+ |; |' O5 _0 [9 C" I% ^) Ldebugger. It calls the int 41h, function 4Fh.4 A; |7 h) ~& \ {: t$ r
There are several alternatives. 6 Q$ [9 D* K% K4 O) ?+ z1 y
5 L6 K4 g; L- `4 [# U! ]: _3 Z
The following one is the simplest:
' \. K+ u7 s `+ u3 Y' p# [2 C. m2 D) w( E9 A4 n6 i
mov ax,4fh R" g" p+ p; Q! ?* C8 N+ p
int 41h8 Y. ~6 u. c7 B" K
cmp ax, 0F386
. _% i7 p% G& ]3 l& W jz SoftICE_detected
# r' {" {2 g% e5 ^3 ]$ ^: c7 D$ M3 ~- g9 C- q: f
: L4 }3 t0 {& _( o" Q5 W8 h) D5 W/ T3 \Next method as well as the following one are 2 examples from Stone's 8 F+ R; G5 e$ g+ P; H
"stn-wid.zip" (www.cracking.net):
& L0 y* o' g' M4 Z' f6 ]1 ?$ |. W+ r4 m% C2 p
mov bx, cs8 e. Z0 z/ F& r( A* O/ b
lea dx, int41handler2/ l, |" N0 P2 @7 Z* C4 r: ~1 o
xchg dx, es:[41h*4]
: q% T+ Y+ k7 H; b- \1 z( p xchg bx, es:[41h*4+2]
# n) R: G( d! ~, r mov ax,4fh- m$ {- g1 R. s# C
int 41h7 Y) `$ f2 p% A, Y3 G# w. \
xchg dx, es:[41h*4]
Q8 p! _, m2 F3 S! c3 ` xchg bx, es:[41h*4+2]
' i$ D. }" H% X o, ~- s: U cmp ax, 0f386h$ c+ t7 I% \/ }5 i- G
jz SoftICE_detected
: A) z- J5 C' U( B/ T
9 u# B* K; }8 `6 U$ r, Uint41handler2 PROC# W$ b, U0 C% ]
iret, x) s* `4 E( i1 U
int41handler2 ENDP8 H. }- x, r' N+ x3 M
% }+ o/ w) `1 U! h, B2 ?
3 y3 ~$ x8 j S; c" X# F_________________________________________________________________________: U0 H g! s' z
" Y* [; B2 e& s. t+ m Y7 i
/ n9 q, R1 Q# K0 w
Method 06
( p- B6 A4 M4 w8 L- ?4 l=========
0 w) F3 a3 a1 g$ g6 u4 o& p% D% R) i5 r5 d* r
3 d2 A& g: i+ L8 r# ]* f" O# D" D
2nd method similar to the preceding one but more difficult to detect:
% x, V9 r( [' K4 ^( R. l6 H4 Y* T
% y2 F8 T. D5 O" x9 H& Z
int41handler PROC
8 T. b& ^0 _" A( y' B mov cl,al
* W; s# `2 v7 s+ {0 K; v iret
: u/ I4 @) T W1 Tint41handler ENDP
; ]( M: y( k" N+ Y% u! A: N" J J
6 u+ _3 q& b. }0 c xor ax,ax& [) e4 I4 S# N& ~
mov es,ax" u A, T, a! d1 s; Q
mov bx, cs5 R" v8 t, E. ^: S5 {
lea dx, int41handler2 \/ P" l) P1 j$ _6 a( G; K
xchg dx, es:[41h*4]! p5 M4 I6 h& b" p* |0 J5 w; n
xchg bx, es:[41h*4+2]
5 S# h% T$ {4 |0 A6 S t8 l in al, 40h' _8 e' A" I+ p9 N5 w. g# l
xor cx,cx
/ l, [9 j; t+ V4 L# W6 e9 H8 v. u7 [6 t int 41h1 }- x7 ~$ O: ^6 I/ a! B4 Z
xchg dx, es:[41h*4]
$ K8 U; A5 V8 E' C; o9 x y xchg bx, es:[41h*4+2]
( z5 O$ T6 h- v( ~& `6 g cmp cl,al+ E- N( j" s% G5 Q
jnz SoftICE_detected/ L) u/ G& a5 T% F
: S8 g- [, f' U2 [
_________________________________________________________________________0 K! B( o5 c9 Q4 [
# a4 b8 Z- C# Y# M2 ]4 KMethod 07
* R1 C6 l9 K3 Q0 O% M5 E=========
- m9 ?! @- j# n5 t' D$ c: R4 r, \/ c) L" L' I8 V! e. d( w
Method of detection of the WinICE handler in the int68h (V86)( `4 I5 |1 D/ |" M' D
7 |* @! Y6 ^) W7 D7 v
mov ah,43h
' \1 [! E( X- e int 68h
, l) \/ [7 m0 l# A2 M) o8 U# Y cmp ax,0F386h
" F% c* o7 D7 G$ e jz SoftICE_Detected1 |" H4 ]* E8 A
( u# o6 T; A" U4 Q) i0 K+ s! u5 }
/ ^5 R$ o" K- K) L2 K. B" y=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
, {, A5 y$ l; A( Q: v2 v app like this:
3 w; w3 ^9 M9 O0 f* r- w; g% ~- X7 o8 e5 H6 c3 u* a! U
BPX exec_int if ax==68
4 ~7 P% K, u& I: w( @ (function called is located at byte ptr [ebp+1Dh] and client eip is: i% t+ N% V# K8 N: ~! M* T/ t
located at [ebp+48h] for 32Bit apps)
: n3 o7 v7 b$ t4 X6 S__________________________________________________________________________
; z, X t: b, S. J! A
$ ^) J# F. F/ D0 P& Y7 h" s/ P- Y# k: o, P/ u' q7 B( ]) Q
Method 08
# k) b' D0 B' y. c g! W- T=========
& T6 ~1 N+ T' g6 p6 c7 _7 X9 |& p' i1 b
It is not a method of detection of SoftICE but a possibility to crash the
" @4 [& Y8 z5 t4 W4 W5 H& v% Z; _2 ^system by intercepting int 01h and int 03h and redirecting them to another3 }6 Q4 F, B5 X0 U3 I6 D: i# |
routine. @+ }2 r- J9 l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points# F. q7 n, I* f# A+ y4 I
to the new routine to execute (hangs computer...) A. t0 Y) B j6 ]; n2 v( D4 b
" ^+ c$ y N: n. N+ j4 u; C mov ah, 25h: @# P2 w! I2 r
mov al, Int_Number (01h or 03h)0 K' L. _5 _* w8 w( O% I6 f; O2 l
mov dx, offset New_Int_Routine
4 P; ~& n. Y( Q: m1 W. P( R int 21h
7 P4 H6 n( _; K5 p
0 d/ @2 {; X# a4 }4 q* P__________________________________________________________________________: v. \2 z! b. J* B8 T& j. q
! d' w$ r% d. a! x( Y; G
Method 09 k! a0 {, b$ e2 y. ~" Q d
=========
/ m) K ]" H1 h8 v
' L6 R6 j; W8 C, B: xThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' U9 `, y5 A1 nperformed in ring0 (VxD or a ring3 app using the VxdCall).( k! k, Q% s) p5 G
The Get_DDB service is used to determine whether or not a VxD is installed! ~* C% z4 L6 p4 S
for the specified device and returns a Device Description Block (in ecx) for
5 n! N- g [6 b$ I7 H" P/ I2 ~& \that device if it is installed." V. t) O$ C8 \- h4 i+ _1 h0 x. n
8 P6 B# l8 l( O, U
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID. Q& f% i1 U1 a8 ^
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& c. V1 H; p% n( {4 u7 L1 V VMMCall Get_DDB
4 l( \3 }6 R7 m2 m9 _7 I2 f mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
1 I8 e; Z. [% I9 C3 d
$ @5 S7 C( c- Y, @" ONote as well that you can easily detect this method with SoftICE:
7 a2 T: m; r& a% V Q9 O bpx Get_DDB if ax==0202 || ax==7a5fh9 k& l. k% X3 G7 x2 h2 s% P
: p/ r; p6 g) P* I- K0 n
__________________________________________________________________________6 [* m$ ^. |) \
% Y8 k& G+ ~7 E
Method 10
) j% N0 r C3 _" M4 l" K1 j=========! G1 J2 a) S" y- M1 h/ [2 F/ V
5 Q5 Z. k4 T5 G$ M. d
=>Disable or clear breakpoints before using this feature. DO NOT trace with
+ G( _4 \9 k1 b1 r& X8 g# n, W SoftICE while the option is enable!!
- R L! B5 R6 j$ g
: w4 z0 K! ^! }+ W7 {- t1 e! gThis trick is very efficient:' l+ c$ h8 p4 g
by checking the Debug Registers, you can detect if SoftICE is loaded, j2 j7 O1 j4 V9 f9 o `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if. R1 @' n0 Y- j/ ]
there are some memory breakpoints set (dr0 to dr3) simply by reading their
! O6 h7 p& Z& q$ D! G; m1 f- v" [' w! Avalue (in ring0 only). Values can be manipulated and or changed as well0 ]3 c. G; S2 d* G4 c- H( V
(clearing BPMs for instance)
% L0 G% e( k8 R9 i& g% N) R& s, u/ ]* F- I
__________________________________________________________________________
# g) }0 z( R) M: G' ?) m# x3 j: e' |0 C* h0 ^. ^2 p& M# ~1 R
Method 11
' o; o. f5 r! [- j' j7 [1 n- c=========
1 P/ J3 ]5 R0 }! D J/ g: E" i6 v; a4 T9 S3 ?5 ?% p
This method is most known as 'MeltICE' because it has been freely distributed
( \- u' D6 y, }/ v8 l7 Wvia www.winfiles.com. However it was first used by NuMega people to allow! R- c3 Q- Y3 P" z2 [
Symbol Loader to check if SoftICE was active or not (the code is located
& `+ H3 ?* Q) T' _1 x* ^inside nmtrans.dll).
) g* s! y& H* z) m* s% t, a# u3 h, h0 O5 \
The way it works is very simple:
1 ]* ^2 r1 f- @) K, W; sIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# i7 ^+ ~- c6 |. V9 l( _# n
WinNT) with the CreateFileA API./ x/ k2 E4 M+ O% S) o5 q
k3 N% e I. YHere is a sample (checking for 'SICE'):1 F; c3 O6 S, M8 c& `
! l; i; n9 h0 n; e/ fBOOL IsSoftIce95Loaded()3 o, [- i4 M# o$ q
{$ D5 |! n7 }% v2 c% u
HANDLE hFile; % @; b7 E* d4 l8 G3 \
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
9 V# Y1 ]5 j5 N; u0 ?- Y$ ^ FILE_SHARE_READ | FILE_SHARE_WRITE,
# O% v+ W; m; L/ z8 I NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
# S8 |$ m7 f# ?. x* z9 ^7 J6 @ if( hFile != INVALID_HANDLE_VALUE )
2 Z! T' f" x" n& Z {
. I2 x' Z8 E: k! j CloseHandle(hFile);
' Q6 i) T# Q* j5 }4 P- v2 q7 g return TRUE;/ ]8 \1 k6 h' n' z6 a9 C K
}
4 j- [2 V3 ^# |1 U return FALSE;
4 F' Z( A0 W- W; {}
) t3 Y9 t# a* y' ~; v0 i* `0 M& I
Although this trick calls the CreateFileA function, don't even expect to be4 i2 f( N6 N. h) {2 w
able to intercept it by installing a IFS hook: it will not work, no way!
1 a% h( P7 K8 O) w. o' i" M3 D/ E0 QIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' a- M, k U7 G$ s; c" V
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 K% E2 k e4 ^: d+ K
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
* z- o& W6 J% \- n7 L! {field.
8 ~' `+ c' k& u2 O: uIn fact, its purpose is not to load/unload VxDs but only to send a
( S% o- t* ^1 p) e9 ^5 q7 FW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE) J3 I- K" l z
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* @; L" C5 h' jto load/unload a non-dynamically loadable driver such as SoftICE ;-).
& B4 H7 e$ m+ C7 M( t* S( i) XIf the VxD is loaded, it will always clear eax and the Carry flag to allow
2 z: V, V6 q( H# _" V2 e. \" bits handle to be opened and then, will be detected.
9 B# v: V) E. d2 yYou can check that simply by hooking Winice.exe control proc entry point
2 l8 Y* S g+ }" Pwhile running MeltICE.
- c" E3 T3 _! t+ G) q$ O8 D0 K) V% k; m/ T) \$ t
' Y1 ?5 s5 n( ^0 P: x+ J
00401067: push 00402025 ; \\.\SICE3 ?. I8 S+ A" _7 B8 M( k
0040106C: call CreateFileA
: U% b9 m( m! c! P 00401071: cmp eax,-0012 H: K& N6 I* X" e/ Q! `6 j
00401074: je 00401091
& S1 N! @7 z/ x9 K2 _9 f
* J( C5 N P6 u
$ J3 x P, K( s0 ~- e3 W3 K8 @ w" N/ }There could be hundreds of BPX you could use to detect this trick. b8 G/ {3 L, L* v
-The most classical one is:- G2 s% X% }" V
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
( I; P' ^/ ]( S& G0 Q) q* s; w( p *(esp->4+4)=='NTIC'# V, b5 b i- Z/ Y* c$ V% e5 x
( x( D& W, c( _/ N0 [6 Y$ k! _-The most exotic ones (could be very slooooow :-(3 I( m: ?! a$ ]6 _
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
. I0 `' r4 A% j5 s& \ ;will break 3 times :-(
9 ?& b) V3 i! U' T9 [& g
8 ]" P2 f# p( I; x$ X& g-or (a bit) faster:
5 f! V1 k6 ~! z3 P BPINT 30 if (*edi=='SICE' || *edi=='SIWV')" c) c( |: G [# L* `
/ O/ X: |+ T: }) ?% b BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
$ M8 H( G9 ~. d ;will break 3 times :-(+ Q/ F$ Q, I* b( \( W) t& u6 U
. ?4 a8 p5 V$ v, J-Much faster:. S, r/ z6 i7 p# c) n; v
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'7 {; E) G& v3 B" l5 Q& w- W; N. r8 l
; X6 C) W4 L. P8 f4 ~
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen' A- l2 p1 G8 K5 O0 P
function to do the same job:
6 q# k# z2 U {, v8 u4 U1 S1 j6 f3 Q$ ?+ i: L- N+ O4 F2 z. L
push 00 ; OF_READ
0 \1 y& q$ R4 s/ e/ G( j/ [ mov eax,[00656634] ; '\\.\SICE',0( Z6 J m% a# i" c- }) q7 \
push eax' g) y: q4 k/ W/ ]
call KERNEL32!_lopen
" X; e( m) l# o) o/ i inc eax
# W# a8 g$ l6 n5 d) `. i jnz 00650589 ; detected' E0 M/ N3 ?, X7 C
push 00 ; OF_READ
0 k% W9 M; B; V6 M) `# t2 j mov eax,[00656638] ; '\\.\SICE'
+ i, x( l$ @5 [% q! w push eax# J' m1 n& P( g5 f6 r0 n
call KERNEL32!_lopen, E, H! [" y( D5 v
inc eax
. T! J; Q q+ @! ^' K O# t jz 006505ae ; not detected2 l" `. o6 d( w: k2 x. P+ V7 n
( K% Y1 P# U# |3 D0 H. I: P
3 L) ?5 Q, ~* K. F: c8 t i
__________________________________________________________________________( [) C# t$ d2 p6 J) r
5 H% R5 _" `# e: q% T: f0 R1 DMethod 126 a8 y) Z' i: D( Y
=========, e9 {. Z: V* X# f6 I- O0 Z/ B
; H$ X2 E9 x/ k6 o' A# E3 I8 F/ z* JThis trick is similar to int41h/4fh Debugger installation check (code 05( K( G) Y$ s$ k7 |: h; Z# o
& 06) but very limited because it's only available for Win95/98 (not NT)
8 k# Q4 p! h$ O# C- cas it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 t t6 Q( }* O, R. C6 a# J
8 a- Y6 x( r. N6 [" ~ push 0000004fh ; function 4fh
: N# U8 \" y2 C4 A push 002a002ah ; high word specifies which VxD (VWIN32)
" j; j% {+ M( U2 \7 b( e ; low word specifies which service; F' M# @! |" F0 A; N% `
(VWIN32_Int41Dispatch)
9 E2 y1 m2 B) C1 I3 M* k call Kernel32!ORD_001 ; VxdCall, r- e* c% S q3 x% t
cmp ax, 0f386h ; magic number returned by system debuggers
' K' a1 i% K8 x U% Y jz SoftICE_detected( p2 @% l2 T5 R& h& ?4 k/ g
8 y. @- M. m2 J% w7 C, H( G! `
Here again, several ways to detect it:" Y! q$ [8 {5 ~3 ^2 e% g, s: d
9 { g( l; a6 G: a9 m' R BPINT 41 if ax==4f' s( K! D* X. J/ P- z
+ H: _2 f6 v2 P: ` BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one: k u/ S Z% M4 y% o
: U3 q' R7 s p6 D. |' \: R0 ]
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
/ x$ T% \, f6 S7 F) I: P* u3 z+ S3 p- `% Q7 W
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
2 U- {! p! s \5 r( U" B
' {0 F# R/ C, f: [__________________________________________________________________________1 ~, |% h0 @/ S4 r
& B$ P+ C# r# j' e7 ~- sMethod 13
& \0 L2 p* W$ ~# F. V; u' C- T=========
1 v3 T, `% J& c6 {/ A& l) i% h- r1 A: i: T& n& [
Not a real method of detection, but a good way to know if SoftICE is8 p2 a8 g' [: a5 {0 Z) i
installed on a computer and to locate its installation directory.* [. {/ B' j3 ?: ?, H' l4 n: [
It is used by few softs which access the following registry keys (usually #2) :
; A+ {5 q+ S& K& a
" e, h( P" F% m" \; x-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- r4 O) t9 Z( g) m- d0 C, y\Uninstall\SoftICE
8 m8 |1 f6 m& S, x# c-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
, ?/ W& r+ [, N6 }7 G q-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" D4 k# X6 z9 w. Z' a, f3 Z' m
\App Paths\Loader32.Exe7 J: b# g( i& B5 j( e3 g
9 ~/ [! v D: m1 p& A. Q Q0 T
- w7 ]" \% l# L( O! ]7 f
Note that some nasty apps could then erase all files from SoftICE directory
) p/ z |. L& G! r6 a2 x(I faced that once :-(
$ d+ K7 @0 ]5 T, K* N7 }# D% q/ C6 E
Useful breakpoint to detect it:( A- F7 W6 e- {
& K; {2 n9 c" N/ r% Z# n, u BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" X5 D# |! @ V1 Y6 ]2 W4 p; l
. A% z8 n. D' V1 D" c% @5 e
__________________________________________________________________________
d1 C* W/ Z |* @5 t3 J/ }( c$ ^0 k6 Y$ ]$ H X/ m
. _ a/ a! ~; B8 q* _Method 14 - A. Q/ V S% \# U5 e' q
=========
2 ~& `1 p& Y, g8 h+ T0 }; ]! k$ G+ W) Z+ }" B( x/ X! p+ b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
' o/ j* \% x; _( a- Zis to determines whether a debugger is running on your system (ring0 only).
9 m7 l; E/ q! V! P+ a+ o: Y8 Q+ f! [! F: Z+ ?9 F7 D
VMMCall Test_Debug_Installed6 B7 V" T( V- A9 p T2 A/ _
je not_installed/ ^# u0 Y4 z7 B( e' I
/ R$ _5 f% M& g- h1 l
This service just checks a flag.# J6 z( B" s4 k1 k9 Y3 x% T2 R! g
</PRE></TD></TR></TBODY></TABLE> |