<TABLE width=500>5 V# j3 B1 V4 O. q4 d
<TBODY># z: k& N5 L5 D3 c/ c4 T# K
<TR>) @; w3 b3 U6 a V6 j
<TD><PRE>Method 01 % w+ [5 h$ [2 [' `. L
=========6 N' [4 h, r& V( t3 S; e) k
1 G1 A* k- S. @ zThis method of detection of SoftICE (as well as the following one) is
3 Z" ]/ T; k. lused by the majority of packers/encryptors found on Internet.
! O! X4 q( r* U* d' wIt seeks the signature of BoundsChecker in SoftICE/ i9 l& A8 Y& Z2 K% |* {
. h/ q* m4 [& @ I' o. D( D mov ebp, 04243484Bh ; 'BCHK'9 Z; z9 `! Z5 w4 J8 X
mov ax, 04h
, L, {2 Y7 B. p' e% J4 h% \ int 3
; j! q7 X$ r9 C) o4 C, u( q5 t cmp al,4
' X0 ?2 c& y9 A" @1 {8 M2 Y) ? jnz SoftICE_Detected9 G4 K2 o6 o3 H7 ^
9 x' `, o: s) @- Z- j___________________________________________________________________________
5 ~- H8 N$ H% |$ d
6 N, i, r& c" |+ _" E9 A% pMethod 02
# ?- o- `* c4 d4 Y( s! T6 @$ K1 {=========
9 c# s; {( h% f) k5 j( u. H6 D. L' o/ ]8 r% {* ?
Still a method very much used (perhaps the most frequent one). It is used
" ?, o0 ^+ K% V+ p0 q# D; Uto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
4 f5 d1 g4 u7 p' @or execute SoftICE commands...
1 g; B) e* H+ {) Y# h3 g9 v, hIt is also used to crash SoftICE and to force it to execute any commands
3 |; h) \1 v8 c, L2 a(HBOOT...) :-(( 7 A( [" k G1 a1 a* V- l" h
P# `% Q: E) T
Here is a quick description:. _$ w M0 h+ C, }
-AX = 0910h (Display string in SIce windows)
/ V2 }) G* E8 _, R V-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, r0 k. g/ ]3 b' a# e. m9 N) q-AX = 0912h (Get breakpoint infos)/ A8 B6 c5 s7 g" p- t" b" f
-AX = 0913h (Set Sice breakpoints)
# v( I M2 t2 }7 y' }. z: w& X# p; P-AX = 0914h (Remove SIce breakoints)- p s9 x$ Q5 r. V3 `
4 V3 }3 _" a- Z/ A* W, K6 C8 mEach time you'll meet this trick, you'll see:
1 c4 g& a& T3 k* O-SI = 4647h: g5 D$ h) T7 |# z
-DI = 4A4Dh: c" Q R. Y3 O. o2 H$ B/ o6 n
Which are the 'magic values' used by SoftIce.
: \$ V: @2 R% Z* PFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# g0 `* M, H, I" V' f& R- B: w. [! o3 o4 t; q1 \( s/ L
Here is one example from the file "Haspinst.exe" which is the dongle HASP
% C+ U, O0 @7 O p& U2 Y* j- M5 w3 eEnvelope utility use to protect DOS applications:
+ b# s/ [; r) J; z" [5 i, ]; M' w% x+ z9 J( b5 n) ]. L, J/ m
5 s3 G4 u- n9 ~5 {( Y l6 a5 N3 P! C
4C19:0095 MOV AX,0911 ; execute command.
3 J0 u* w# _. I4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).6 }' v m2 j( J+ J6 \) K0 T9 ~5 r
4C19:009A MOV SI,4647 ; 1st magic value. Z' I: ? }; p3 M7 P3 L" d
4C19:009D MOV DI,4A4D ; 2nd magic value.
! V% V: M* X/ N# a4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)- K0 a* k( l) l& h- q7 G
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute- d" i: ?& V; n, e5 `: E
4C19:00A4 INC CX9 H* j, k! p, A9 ^. o4 O0 g
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute/ h* n1 T8 e8 ~( Y; v
4C19:00A8 JB 0095 ; 6 different commands./ @% H' V7 G, k2 J8 f7 |" @& }9 T1 _
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
1 u4 H V9 }, X4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
& \8 J9 ]1 X* b2 P# F) f% J7 h9 f6 r1 Z1 e; ]2 q# S3 V
The program will execute 6 different SIce commands located at ds:dx, which* e1 {9 C* Z* {5 M' g3 Q
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 |) _& a! w0 o& D2 q
# f1 ~: ?# `' D7 @; I2 i
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.1 k6 |. [% [+ D
___________________________________________________________________________
1 B: \5 p6 D+ `5 a) R2 \& K
- Y! a- K# S& B; c5 l+ h9 p+ l$ X* }5 t \8 L3 x
Method 03- E) y3 n D/ T# J' G+ E
=========
/ ]$ o& a8 d( W: w2 s9 q
, _0 q( Q$ t$ [( ~% p2 Q2 d5 z! `Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h& S% k [. U1 a: a
(API Get entry point)
, w2 X" p: m) |' ^) n2 r H
( S3 z5 P7 g) \3 a9 ?+ p7 t
$ V) T Y/ F1 r8 L xor di,di$ i8 d: t: k. h4 e C; e0 }; _
mov es,di
0 m. _# e* D8 d, Y& y( Q mov ax, 1684h
- f( T- j0 M* H1 e8 q$ G* g* J3 } mov bx, 0202h ; VxD ID of winice& _ q' D4 I2 l8 M( N' M4 H
int 2Fh
6 q" I5 B1 ^, J( x mov ax, es ; ES:DI -> VxD API entry point5 h! j/ |, ]9 z8 p/ J( H
add ax, di9 L; s3 o& y0 S" S2 ?8 L
test ax,ax" A2 @8 x! g9 ~
jnz SoftICE_Detected
9 D1 h; a4 n& F$ D7 T c/ V/ j: p1 T# k, ~7 b0 R, p6 Q: X
___________________________________________________________________________" S! h( S$ k8 p# r* g
/ b8 s8 V! s7 Q# M8 u1 J& w
Method 049 I& [2 C9 M0 k# K9 l
=========
2 B0 H# D+ m y' I' n2 d# g& d0 E& W6 S7 T" U3 a
Method identical to the preceding one except that it seeks the ID of SoftICE
3 F9 G2 n2 o5 `# A# M- ZGFX VxD.6 ]" [1 G; `) H
3 X" w2 ?2 V. R! F) R5 i+ c" o) l
xor di,di
3 {! o7 s2 Z1 j+ D6 J mov es,di
9 S% N" |7 H4 p! @ mov ax, 1684h 6 m2 P! ]- w- f7 e
mov bx, 7a5Fh ; VxD ID of SIWVID
- _; P6 W4 t& d: [. o8 m+ X: q; T( { int 2fh* I8 ^) i7 v8 ^/ x% ~
mov ax, es ; ES:DI -> VxD API entry point: X$ c4 W! e: h8 ^2 [( q; z0 S
add ax, di3 l2 N/ D( h+ D- o1 }9 Z
test ax,ax
+ U/ D6 O6 H' |# P' ~' v3 y( h jnz SoftICE_Detected8 j9 A! T5 S/ i9 r
0 \/ p% {! }" o# h4 w' \0 ^
__________________________________________________________________________& Q7 R- S& U& F( f; Q2 z5 J+ G) P/ q
* p3 e) {+ `( Q7 T* G5 C
' G$ _) H O( N( M* q" B
Method 05% T) V9 _4 @6 d1 X+ g* x, `
=========8 S8 ?5 e9 }' e) t% Y7 b9 j1 \! t
d' h# `+ k7 E3 N. D6 |Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 U; w+ Y4 ]6 Q8 y: }8 y- o: A9 r- bdebugger. It calls the int 41h, function 4Fh.; c6 x2 J" B, I$ R; }1 p
There are several alternatives.
/ h% O1 g* x' X7 Q y/ y
0 Q, D% t. m) I% ^/ ^The following one is the simplest:6 C- u7 C; i5 }8 K3 K8 p! v- V
7 b9 [# ]0 s) N' z1 L# K9 T
mov ax,4fh' d& O4 ], b% H( T$ G; s! w
int 41h
5 p7 E# f O' R/ K% Z4 w' j cmp ax, 0F386
4 V h& f5 V9 P- y, E9 [ jz SoftICE_detected
* t, L( ]: l% c3 t0 G4 \$ S+ t5 a- i' Z- J2 f7 V
, C/ z9 N3 m# O8 L7 k( KNext method as well as the following one are 2 examples from Stone's
. n% b; g7 m' N1 m' p7 U% l- O" l"stn-wid.zip" (www.cracking.net):
$ Q% ?( p3 Q- M- v( N0 K5 I. d0 a+ U5 V2 [ d- V
mov bx, cs
8 H2 \2 ]; b j& k; d7 |9 C1 u lea dx, int41handler2
+ r! e% u1 }6 ]4 V& Q xchg dx, es:[41h*4]
" `! u0 t& k. l1 G' ^ xchg bx, es:[41h*4+2]& F3 l2 Q1 }5 g
mov ax,4fh
8 T: v8 K& m$ m2 N% b! c$ [6 m/ d: m int 41h4 Q2 C% E9 k1 i! F8 s
xchg dx, es:[41h*4]0 o3 C! ?9 @8 A9 R" y; f
xchg bx, es:[41h*4+2]
$ }5 x0 _9 I8 E. t& j" L+ P cmp ax, 0f386h, s; R; {4 ] k* m
jz SoftICE_detected
4 m+ ?1 X, T# o' ^5 U. d+ Y$ g. Y3 k
9 z" G- \5 v& X! Wint41handler2 PROC7 q. O# D2 Z0 H6 _
iret$ r" v) c# l* T
int41handler2 ENDP/ ?# l( C H* I
$ J8 x9 @) k/ Z9 Q* J- `, [
% R, X1 p3 @' s' C5 J. l9 ^_________________________________________________________________________
+ b2 D: h/ U1 H* Y9 u, d" y& C5 [) S, z7 H/ j" E) I
7 c$ p, Q9 D6 B# D+ k
Method 06( g' y4 r# G2 d8 ^
=========1 Y3 V- R& c1 R1 m
( U$ P& u2 [8 \2 g* U3 R; V
8 B3 E2 s, ]: @% _, W0 I4 I- a
2nd method similar to the preceding one but more difficult to detect:
# _- }- } z. U4 G" Q, o) W3 e1 v0 v+ ^- i
+ c# ~8 j9 i: W U5 t
int41handler PROC
X1 a E* K( U3 e mov cl,al) M, }2 A& r( L
iret1 U6 Z$ s( x7 V x# u1 h
int41handler ENDP/ G+ c9 `" F: g! @
% s% o/ P ?7 E+ j9 h; L* u6 ]& C# W
# E, L/ d3 W4 ~- C5 L6 C. x$ K xor ax,ax* W# {2 `' [! p$ ^8 _# x3 I
mov es,ax
) A) d) E3 o4 ~# y mov bx, cs
6 P" S" q: }, E9 K/ N# B2 q lea dx, int41handler
6 y5 m5 [. i! M, j8 B ]! c9 e xchg dx, es:[41h*4]
% ~& ^2 B6 L, |( Z5 N( M xchg bx, es:[41h*4+2]
4 f+ i! K. }3 H/ @& _! E- { in al, 40h
) i4 w4 R7 ]0 h( l! V) ~ xor cx,cx9 O. d5 w E; I0 O2 w9 p
int 41h9 n q5 M. }, U9 k( J
xchg dx, es:[41h*4]! V1 U6 S1 N ]1 e
xchg bx, es:[41h*4+2]
! _4 u' E8 O8 z* d+ N* z cmp cl,al) }( m3 v9 L3 a, m
jnz SoftICE_detected' s) u D% [* W4 z" _
7 O4 N5 Q& q8 x6 c; N) j8 _: S
_________________________________________________________________________
! n5 h/ y$ ?5 J3 ?. s6 L
2 p- X+ G- K* I. Q3 ?! i' ^Method 07* a, K) J+ A. s' L4 q" k
=========
! m. g' G! z. E0 i
+ _6 e) d9 K8 }% wMethod of detection of the WinICE handler in the int68h (V86)
9 f2 |7 m" c8 c1 g# W& K
6 d( z$ e7 U& f) m mov ah,43h Q2 h4 `# k: ?- ]' g+ H5 l
int 68h: j! J: d2 a3 u7 x; Z/ h0 X$ q6 Q
cmp ax,0F386h* u& K( G% { R% B/ I+ F1 P
jz SoftICE_Detected* M0 j2 r7 c; C" |. V! G) K" n) s0 _# |6 q
4 n' f- R" _8 j* n9 a( |
4 M, g) h) w% ~/ \5 F=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; p& D7 a5 I A1 \, y8 z% ~1 x6 A
app like this:
9 I: k& p, C1 F/ K, ^* L
9 ~, n9 ^5 k3 \+ } BPX exec_int if ax==68 Q4 n! r6 R3 A/ W( t, U" I8 S
(function called is located at byte ptr [ebp+1Dh] and client eip is
9 s4 m# [; \' G; ?7 j: O located at [ebp+48h] for 32Bit apps)
' r7 ?( Q( g* [. A6 n__________________________________________________________________________
; A* I( E! M& R" K m' S! {
6 P) \, m* _+ x. h# M7 l: J2 m+ L# G0 K" x$ W* |
Method 08! I6 w; B1 ~4 }% e/ q" x
=========
5 O" [8 D' f& Q2 B% @5 A
) v) n$ Y. ?2 ^" RIt is not a method of detection of SoftICE but a possibility to crash the5 x6 k, f/ e5 R" t% k
system by intercepting int 01h and int 03h and redirecting them to another
$ `% `' M; L& ^4 R& broutine.
, H9 ?" }3 W( v5 nIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 @6 _ @' n. D: R6 D
to the new routine to execute (hangs computer...)
" J: W' M$ ]1 ?" f/ Y* a0 c. H b+ C0 P! Y
mov ah, 25h8 d/ g. J" a2 t2 F. a. r! {
mov al, Int_Number (01h or 03h), I. X' C% b2 X/ M5 K( c3 C6 o
mov dx, offset New_Int_Routine
+ {: [/ a1 y, i' ^ int 21h
0 A- r0 u; i) x0 y/ `; ~* D
# d7 `: ~ H% Z2 i0 l: S* M/ P- M__________________________________________________________________________8 e+ D, n6 ~- S2 s4 c" b
6 I$ Z4 b8 E' g" LMethod 09
* \+ H) B K+ a4 s0 @" x=========' u' e9 N# W+ j! j# Y# x. y0 p
7 K9 l/ F2 M9 s' C7 K7 ]' x
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
+ {* v' r, y, H8 [3 q$ Uperformed in ring0 (VxD or a ring3 app using the VxdCall).
( D0 H$ }# ~+ j' b3 M! p b! u( YThe Get_DDB service is used to determine whether or not a VxD is installed
7 P" I) U$ y! W8 a* d: {& Z( }for the specified device and returns a Device Description Block (in ecx) for
& z$ h' b0 b& cthat device if it is installed.
1 L9 m( c5 G% t! u% A+ r8 k. u4 _6 V' @* i3 `4 ^
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID: U9 N( {+ e0 k% ]8 \, S7 k# l
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
+ W8 @$ |% Z; y% z9 N% [2 x VMMCall Get_DDB( a o! }6 p* `; @2 ?; J- `
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed
4 s4 F% o5 v' `" e) I0 Z
+ @, U* Q6 n) m% MNote as well that you can easily detect this method with SoftICE:
+ k8 [4 D6 L$ |4 m: l+ E1 I bpx Get_DDB if ax==0202 || ax==7a5fh
0 S+ q) W; f' F" [3 ~0 R! Z0 q
3 _/ O+ V& n6 j' H/ r! `__________________________________________________________________________, `* y0 @; ^9 r% S2 J; D- y, M
/ ]3 u7 k5 t" N$ B
Method 10
; ?2 ]( `2 R) W+ R3 T' @1 u k4 F=========
& o! u2 y6 W; |, N; i
2 z" e( F3 Q; Z! m4 L=>Disable or clear breakpoints before using this feature. DO NOT trace with h1 K( l7 Y9 U4 b0 x
SoftICE while the option is enable!!
6 u5 h7 Q; @- w$ v- T9 q6 }. G+ E G1 r8 i
This trick is very efficient:0 c0 k! S; w3 T! W$ a1 u( b
by checking the Debug Registers, you can detect if SoftICE is loaded. C" a% D* t( K. _) v5 R8 |( k1 {
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
0 g) C2 g9 H7 Sthere are some memory breakpoints set (dr0 to dr3) simply by reading their
5 ]; y4 Z, Q2 ?7 _value (in ring0 only). Values can be manipulated and or changed as well; `) }. r- T7 K* p7 {- v: v9 E% P" ~
(clearing BPMs for instance)0 d# I* @6 _0 f0 U# C: l, m
) K5 y$ K" a, m0 P# R8 Z
__________________________________________________________________________& g$ \2 l& R% A# z+ |$ N. T
+ D" T5 Y+ \; |% L7 ~3 B& Z; d) h5 E6 sMethod 11
2 s: k! }. u: Q=========
4 E! W, m( I% t" f3 {$ z3 z, H4 j( F6 V9 L0 K* B; L. e: K$ w: D
This method is most known as 'MeltICE' because it has been freely distributed; ^9 s; B: Z8 _
via www.winfiles.com. However it was first used by NuMega people to allow7 S5 T2 {& |8 m4 d0 U" B8 g
Symbol Loader to check if SoftICE was active or not (the code is located) f/ z' E6 U* Y9 v' y6 C/ j
inside nmtrans.dll).( @2 Y$ e- w8 ~
- w" }4 }. [ R# K! s" S& OThe way it works is very simple:
0 `9 Y* a) T( g8 L+ ~8 {+ b2 TIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
: I, z& d2 u- w, z, N$ ?WinNT) with the CreateFileA API.
6 C# M0 J& s% m: W! d2 ^& r$ U8 N( e8 M: \" p% ]$ p }0 W& a& X
Here is a sample (checking for 'SICE'):
& R, I2 l) _+ u: ^9 a; A0 V
* j: v P: |0 b; x' j9 x- RBOOL IsSoftIce95Loaded()( `1 C8 S) S' \$ X2 @6 N: ^1 S" d
{
w3 [+ d8 D) u, T: k) o; i HANDLE hFile; ' E- y# z& f( S! F% [9 b8 [
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,2 @) X5 Z2 a- E |0 B
FILE_SHARE_READ | FILE_SHARE_WRITE,- ~7 s0 b9 l- V; r6 ^- ^, j5 n
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
{1 R2 R( ?) ]" K7 l8 A( C if( hFile != INVALID_HANDLE_VALUE )( z8 ~ ~, ]# y C8 o$ P" G
{8 _( W. N8 k+ p% K+ p( I2 [
CloseHandle(hFile);* h! o# u8 V. @+ a8 l, ~, _
return TRUE;
! c8 n% Y, K B5 w( R- T0 S, G }
1 M d# I1 b5 I0 ^4 c- `# v return FALSE;7 u' v: w7 W; M3 U
}9 f9 b( v( z; _% A! j
5 J$ i2 M8 Q$ w& S: i# k5 u9 l/ X& GAlthough this trick calls the CreateFileA function, don't even expect to be
& I* S, C3 \4 p3 Z' ~% ~' {able to intercept it by installing a IFS hook: it will not work, no way!; U# a0 K6 B; j
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( _1 P/ A d0 h1 l! @1 H9 @
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
0 @: r' ]7 p0 t4 D9 `$ E. Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc, ^* w- ]& ^1 o( t& x
field.. e' i1 F4 k! F8 _" o
In fact, its purpose is not to load/unload VxDs but only to send a # J9 y- S9 m( Z! U8 e2 k! Y/ X" ^
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 H4 q0 D& i) _4 _- oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
7 h3 ^$ ~$ J1 f/ `0 z t) Mto load/unload a non-dynamically loadable driver such as SoftICE ;-).
) [9 |$ }2 x0 R) [If the VxD is loaded, it will always clear eax and the Carry flag to allow
6 W8 w% N$ @; V! Dits handle to be opened and then, will be detected.9 S3 m- F2 w/ W1 n' ?
You can check that simply by hooking Winice.exe control proc entry point
7 u6 y- f% ]+ v$ |% |while running MeltICE., H8 \3 L- S) k1 n$ v
l* z! b( e, G/ v! c) d6 A: h& _! S
( Z j7 g9 ^' B. a 00401067: push 00402025 ; \\.\SICE7 ^6 J5 c/ B( @( S% d! m
0040106C: call CreateFileA G) e! r$ J3 `1 K
00401071: cmp eax,-001$ [' S ^+ g/ j; u6 O6 ~6 `( t
00401074: je 00401091
1 j9 a1 G1 j" f% {
- n& W9 p9 l. k1 b( F7 f$ r5 T& v: p+ B
There could be hundreds of BPX you could use to detect this trick., r' |& q# t6 u; ]8 [
-The most classical one is:
4 ~$ f' i2 Q- `3 O, u BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||6 K3 x. Z: @* s% c$ r0 N- P
*(esp->4+4)=='NTIC'
$ q* }7 X# N: Y% m2 M- D" r; m( q) c3 [* Z6 ^' O( m* n9 \! q
-The most exotic ones (could be very slooooow :-(' b) F* y: \6 C. s* v z- a; i" ~
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') - H' l2 U9 o5 |' C+ S7 x% x9 Q. I
;will break 3 times :-(% H I' \, z- t5 g$ ]2 _% ]
8 q1 d* d" h- ? U' N2 Y
-or (a bit) faster:
+ Q) X. H% P' U/ `' F( c BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 M) ~# B" b- ~3 d3 b$ m( ]' v8 ?5 m4 o/ \5 d# @ g
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
3 M( Z! q* t4 c# ] ;will break 3 times :-(
6 g( m' z5 g' F P. i0 m7 r! k2 }( B
-Much faster:1 Q; h2 o! s% H% `9 k: [
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'! D" R# B3 Q# V9 d
/ m$ @0 R( T7 F0 Y' I/ w+ _
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
- _6 O+ o, P+ u; Bfunction to do the same job:
$ e* o; p R( y6 _& O. Y* C& o& Q, }
push 00 ; OF_READ
3 K3 ?9 k" q$ S mov eax,[00656634] ; '\\.\SICE',0& m* a5 P. t7 ?! m6 j Z: Y
push eax% Q+ s! v: t0 m$ n3 J( L$ K
call KERNEL32!_lopen E( X3 H) P/ A9 n+ f" a* B
inc eax V4 d9 B) ~0 U- z; t+ Z: G
jnz 00650589 ; detected' v8 R5 q! e2 B
push 00 ; OF_READ
- E2 J' c$ }4 ` mov eax,[00656638] ; '\\.\SICE'0 X# G, l- u# _2 i. P! O! B3 h9 g/ c" f
push eax
9 A& s7 _1 F5 ` call KERNEL32!_lopen
# n& g2 [' K' j$ u: k inc eax
9 a& h: k6 k9 d% m) \# O jz 006505ae ; not detected1 z% m/ S5 P0 T# k
+ R% f+ m. Z5 _2 b( h2 \- o( l( W/ c" H$ F* i- S
__________________________________________________________________________$ B" r' o& U. T
% N% u8 D- C" j+ ~9 U/ e6 D
Method 12
2 i6 i! p P" P; e% J=========
2 ]2 B6 \' h- `* [! o; `5 K$ W
: k3 Y' g; ]: z7 rThis trick is similar to int41h/4fh Debugger installation check (code 056 D/ Q) I( f: ?* j$ ?! r& h& [
& 06) but very limited because it's only available for Win95/98 (not NT)3 t# z0 j9 p2 a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
0 Z$ } F! e& g" p7 K4 l! Y) k) i* T) O* ^7 F
push 0000004fh ; function 4fh
! }% n. y7 w0 V3 _: P push 002a002ah ; high word specifies which VxD (VWIN32)8 x/ N5 p& D7 M Y
; low word specifies which service2 |& J! G1 V: R$ {. k. k
(VWIN32_Int41Dispatch)
: T# |6 f ?- ~' | call Kernel32!ORD_001 ; VxdCall
3 S- S/ D# V4 g cmp ax, 0f386h ; magic number returned by system debuggers9 s- {& I& L" _9 f' C$ o0 P
jz SoftICE_detected, N6 ^6 l9 o6 o! P$ c0 T/ W% ]
# G6 e0 D2 x7 I" h5 \ RHere again, several ways to detect it:
- v. L6 d1 K E! `: P9 p
: s& m5 b8 {; A# j. Z BPINT 41 if ax==4f* k0 k8 N2 ~* l3 ~
( e. m4 N+ g. L0 [5 o" s# h BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one+ }3 s' [' n( f* l
" o- s, x6 w/ [. x, u BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
. _' K$ t8 M4 D6 ?
1 u7 G0 W4 X9 b- m+ v: @5 }" y6 B5 a) I BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!0 h% ^1 X3 F- B0 `# _2 o& U7 u3 M
4 d4 q6 M7 M' v" n0 i; n+ P; k. m$ e
__________________________________________________________________________/ C6 Q* M9 L2 C, r
7 k9 X# Z/ v* _3 _
Method 13* w# F6 y4 O) k d- w3 V
=========9 A4 n4 @% s" e' E c# } I
! @ w: |2 B; y7 zNot a real method of detection, but a good way to know if SoftICE is- A$ c0 ~4 i- W' J0 q) X" W
installed on a computer and to locate its installation directory.
y0 I9 l$ E* I5 UIt is used by few softs which access the following registry keys (usually #2) :
( H$ `2 S1 g) N2 s& d
9 Z8 U* F/ u8 S, R8 @-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" `, C2 n# c6 F* o/ q5 Z
\Uninstall\SoftICE
6 Z+ C/ T" b6 a$ |1 [$ k7 Y-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; y2 Y, Z" J- O, C# v-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- |1 H1 i' O. o5 E7 i( D1 q0 F% O4 z\App Paths\Loader32.Exe
' R/ V$ \& @# ?& y) `7 T1 V4 S( T1 N, h3 G3 g
4 Y' S5 E. k+ D6 ?3 `0 Z+ zNote that some nasty apps could then erase all files from SoftICE directory. d+ h( i/ A. N) a& A
(I faced that once :-(
/ j3 z! u! ?+ E2 m9 X! f& k( T0 G9 J6 s. q4 Y! s6 {
Useful breakpoint to detect it:
; E' a( `1 V, C% e$ _1 E8 Y' G0 x
, i& M: P1 u* y7 K P2 t BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'" s& U9 h# Z+ a I2 O
% w! m0 y" [9 z0 G I__________________________________________________________________________8 W Y V3 W, ~7 h( H" w+ `
; y% N/ F$ o9 {; A
' i. ?5 L8 C8 M" {' a/ YMethod 14 , C! M( ~& q8 H: N
=========& U8 U5 k M2 G" Y! x
7 i+ j! b: {3 r7 Z, r$ F# \, [; JA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
, W; S: Z- B! s% ^2 Y+ @# W5 a9 wis to determines whether a debugger is running on your system (ring0 only).
3 G, F9 E( _* z
0 \; r$ k3 l8 W0 R) P VMMCall Test_Debug_Installed7 S) z* _2 B& m1 ^) ~
je not_installed
. O! d2 n3 C' b
T; p* e1 n' y7 XThis service just checks a flag.: J2 o- x- ?; `, h9 z! E+ z; v
</PRE></TD></TR></TBODY></TABLE> |