<TABLE width=500>
4 ~! u0 R7 |5 X% J<TBODY>& t' U3 } R I+ k
<TR>
2 f- i5 J- p1 _& @$ E<TD><PRE>Method 01
/ v, Y6 ~, V1 k" z" p=========
* E+ s0 H% c( X9 I( P- i8 ]2 I7 G$ j- f5 i# R! J9 k
This method of detection of SoftICE (as well as the following one) is% k) J* N6 z* q) [- |& i# {& G% |; v
used by the majority of packers/encryptors found on Internet./ B$ @5 r% c* Y- U9 s5 L* q
It seeks the signature of BoundsChecker in SoftICE2 X6 k8 S/ p, e6 R" J8 z& Y
+ |8 ?$ E) c: [- y9 o1 q, F! C mov ebp, 04243484Bh ; 'BCHK'& }3 B1 Y6 m9 ~
mov ax, 04h2 h+ Q4 |# l% E
int 3 - u z K c& m4 J
cmp al,4
/ W m" l5 T( D8 y$ N jnz SoftICE_Detected
) t( d* P3 j, d' W5 K$ i4 B
# ~/ W9 }, q W___________________________________________________________________________
% Y% f) I D0 x
" S, o! s; i S" E1 nMethod 02
3 c4 N2 ^. B$ q o+ J) }& h/ n. }=========, w' \( _+ T- j7 c; ~% z
5 @$ L$ {# |* G1 T( i& {0 R' w
Still a method very much used (perhaps the most frequent one). It is used
; N9 O6 A3 k" X6 ^/ s$ bto get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 ?/ m. ^5 Q( e; f
or execute SoftICE commands...
: l& [0 v6 x/ | C' A7 R7 p9 X& wIt is also used to crash SoftICE and to force it to execute any commands
- R. }# H+ b3 F+ ^3 c4 t' G4 {(HBOOT...) :-((
8 c: G! G9 `7 J, `# A5 l% {" v0 I2 U: O. `6 j# Z! a9 X
Here is a quick description:: k* N. P0 m& [ N
-AX = 0910h (Display string in SIce windows)! P- x: b, Y; R3 {
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: W& j6 l1 F. s& w9 }1 V) {-AX = 0912h (Get breakpoint infos)7 g7 ^% I: u9 N$ I& s
-AX = 0913h (Set Sice breakpoints)
9 Q# E3 y* w/ M5 i" ^# T-AX = 0914h (Remove SIce breakoints)
, _7 _1 q" k8 v! w! N0 d+ h. t, U) t& l5 _) o1 E5 }
Each time you'll meet this trick, you'll see:
& \% m1 f1 P4 C+ O# S1 G-SI = 4647h
0 _6 N. H# F/ V- ~$ Y5 W7 C5 C-DI = 4A4Dh0 [" B8 z9 f" }6 o% m2 C, K
Which are the 'magic values' used by SoftIce.! Q9 y5 u9 ^4 {4 x. I
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.5 \' a/ A0 a# F+ r! q+ I
: X6 r- d4 D- q" o' x/ YHere is one example from the file "Haspinst.exe" which is the dongle HASP: |; J! d4 v! Q6 z% a$ q! c7 N$ b' q
Envelope utility use to protect DOS applications:
' o8 g# }! d& K8 _" J% c$ c W
: @% }$ t; k) C7 G
. U% U+ H4 A' q; l* t, p4C19:0095 MOV AX,0911 ; execute command.
9 a8 D' C7 E5 o7 ~4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).; f9 t2 _, d' Y h
4C19:009A MOV SI,4647 ; 1st magic value.
# \. C7 f3 B N5 u6 O" v0 O1 R4C19:009D MOV DI,4A4D ; 2nd magic value.
2 z+ m- J) `" J2 g. V, F4 c* r4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
% A. s3 ]9 }6 F% j# ~2 o4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute7 J* P9 O. A( V4 I
4C19:00A4 INC CX7 C5 D9 I8 x& k
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute" C0 @1 h6 F6 v! y; `2 s/ a
4C19:00A8 JB 0095 ; 6 different commands.
9 q% c* `. k9 P4C19:00AA JMP 0002 ; Bad_Guy jmp back.. r8 T% a/ U( w$ N9 i! n
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
% U: v, Z" _( s* g/ \- d" \. K
4 U( V1 S |- y- t# zThe program will execute 6 different SIce commands located at ds:dx, which
+ M- |) j4 @; D* ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.5 }. ~5 S) j$ f
! z6 ]2 F2 R% A8 S) F! ^" D5 a
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.# V( v" y0 Y( X# g0 S9 G6 T
___________________________________________________________________________
) V0 \& v3 B. E) a: a
# J: A2 q, s. J' ] W* C
' M) s6 Y. W7 ?* z- i! L( ?Method 03
& }8 p4 N9 X0 v=========
/ T" ?- l" x3 ^2 _9 b/ Q4 L1 ]5 @" G" I1 P' j+ O1 M% I2 ^' o& b' H- `2 f
Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h) Y, \7 n4 o; i9 ^) ^
(API Get entry point)
1 q$ s( \5 F- `2 l1 [
& R& @% P% T7 {; R3 F3 L
( {0 c) H& q4 c" Q) a xor di,di8 Q( E+ Q8 V& ^* b2 c h7 I8 s: T8 G
mov es,di( }% |" b# D' X
mov ax, 1684h 9 I. ]9 U2 }- t. v6 [
mov bx, 0202h ; VxD ID of winice7 m. V7 |% @+ O2 V+ P& ~
int 2Fh; [1 a7 M+ i% R2 @) [, G" S( d
mov ax, es ; ES:DI -> VxD API entry point
1 h2 q+ S0 e' ?# }, ~+ R+ z' F, T( k add ax, di9 _% @' ~7 O- z+ \
test ax,ax
, I( \) G4 k$ Q! K+ y. t- Q' ^! d jnz SoftICE_Detected( {* B: i/ t% K3 n# V' [$ ~
- t9 B) [0 A1 `___________________________________________________________________________+ T) O. _) l! D# P. q @6 d1 C
% q+ K7 ?. Y# a# s& a: }Method 04
l6 p9 @! c: }4 u% |, q Z=========( f5 w3 b- j1 ]# P6 t5 z J
2 O* L% _( |9 s
Method identical to the preceding one except that it seeks the ID of SoftICE& M5 O4 N9 ^1 b0 ^9 x2 h2 S
GFX VxD.
' j! A& {' O8 |% T$ J
) l1 o- ?% J% n$ U; Q8 {8 m% W4 Y xor di,di5 Z* p: k- ^( ]% u' _5 R" V
mov es,di
) q7 e+ D- y: d5 J2 S5 E mov ax, 1684h 1 E; t% Y+ H; R. ?' A9 }& ^
mov bx, 7a5Fh ; VxD ID of SIWVID
) x+ p. ]% f( L! V7 O, R# ~ int 2fh
# o' c5 L9 k. `2 C+ ?; n0 Q3 q mov ax, es ; ES:DI -> VxD API entry point' D# `, ?' |8 Q; i- z2 D5 P! B
add ax, di( ]* l5 M$ e, P7 ?5 ]+ q) c; ^/ w9 i
test ax,ax' F( e; T8 H! a& U9 f" W7 u' H
jnz SoftICE_Detected
' a" x7 s, a5 N8 K( p% e7 T6 q8 W b
__________________________________________________________________________
6 f; X, F0 b+ f+ {; s6 e! S! p' c
9 S$ s. ?1 b+ Y$ M1 o
* {% l1 l4 y1 k! e& [Method 056 ]/ S1 w( I' U. @4 ]
=========
5 m7 H X( S0 [$ ~& B7 q
$ R( i( y: h) U# F/ p6 nMethod seeking the 'magic number' 0F386h returned (in ax) by all system p0 t" ?/ l4 ~7 \
debugger. It calls the int 41h, function 4Fh.5 J; j8 N# s" \& H3 ]
There are several alternatives. % e9 L, H/ ?2 H7 E2 y1 k
6 N$ \* H# I, u) I, F: @The following one is the simplest:! l' U: l. j/ L9 H% S1 @- ^9 _& v
2 L% k) m8 ^9 B% e7 a& G% h mov ax,4fh& \. q l j4 b! g. Z
int 41h
. ~4 ?1 ]/ I1 M% e W cmp ax, 0F386
2 W7 X4 J! W7 M: j" h+ m) @) _ jz SoftICE_detected
3 u& ^/ A u; E- W4 G& C6 f& V/ m1 J: t: [/ r
, r% Z1 P" r* h" x0 |7 ^( x% P# v' S
Next method as well as the following one are 2 examples from Stone's ) @6 P; j+ B2 h8 H- J
"stn-wid.zip" (www.cracking.net):1 z, r4 X; ~7 q6 {% P- T$ Q
9 k# b3 q; O" c/ U* C- r
mov bx, cs0 r* K1 P" z! }6 E7 G! e7 t
lea dx, int41handler2
, r C4 H; @1 S% b% h* i xchg dx, es:[41h*4]: b9 ]7 O) t' ~" H7 w0 \1 Q* N3 K; ~
xchg bx, es:[41h*4+2]& Y% i9 u* a+ |8 _9 h+ z
mov ax,4fh
/ W% `7 F/ X# h* F# Q8 N int 41h
8 [0 S5 X! F. R: c xchg dx, es:[41h*4]
. E( `1 s% G1 r: ?$ V0 g xchg bx, es:[41h*4+2]# \! s' t0 E) W+ s1 H
cmp ax, 0f386h7 Q3 q# M, ~) T$ l2 s! O- ^( T7 i
jz SoftICE_detected
7 d" r2 J$ t: p, |8 e3 I, U' \& \+ t& \$ w# n- X
int41handler2 PROC# R' N' F6 k. l& L. s" j/ b. x
iret
: l) }& P' Z- d- v8 qint41handler2 ENDP" `9 E, l' ^4 Z! i
6 ~+ \( o- E' y; S6 w: ?
5 n; _4 v/ M7 } A* m
_________________________________________________________________________* E: D: Z U& Y( M
; j" `9 R- G' N( b `
9 {& A: o" o: Q& \9 N* ~; L$ G0 ]Method 06, P' S2 g8 K- B3 v$ M- q! } m' S
=========
0 @( A/ _7 b( z8 E& ^
1 h7 W5 M( F. S7 `' w" P8 E/ ]! E# _4 z8 E L
2nd method similar to the preceding one but more difficult to detect:
6 \- M0 ~6 k) F5 `9 C( D. R* o1 k/ k% E$ p/ i- u& x5 N2 c: N# ^3 `
- j; s# w& `! x3 R/ v
int41handler PROC
8 b& b0 w f9 ~0 R4 r# i2 O mov cl,al
8 c: E8 D$ a ]# Z iret
- l8 V+ X+ S" {6 ^. E# dint41handler ENDP
. l6 F P3 B) ^# Z. R* p/ r8 u+ X
) F, S( t6 |/ O0 m9 S8 _
xor ax,ax0 m4 }$ \. m U" F+ I& C/ J/ U! G
mov es,ax2 h3 ^+ u7 u6 o' f
mov bx, cs7 R0 p" a) y9 U2 i! U$ h" y8 U" Z+ C& z
lea dx, int41handler. R3 m( y1 n1 j& D' Y
xchg dx, es:[41h*4]# i7 x1 F, T( Y# I9 c# k
xchg bx, es:[41h*4+2]
4 ?; d$ B; ]! ^# i5 l z* _ in al, 40h2 a8 P p3 C+ n$ \" E
xor cx,cx
$ T! `0 P, E5 `- Q- Z int 41h9 x4 p) `$ f0 ~7 o+ V4 ^$ S' C
xchg dx, es:[41h*4]1 o! _: m* A& q
xchg bx, es:[41h*4+2]: Q" v3 I/ k0 P) F9 o8 ? h
cmp cl,al
( k2 {$ q) k1 C# {; V jnz SoftICE_detected& H$ O, t' X1 K2 c' F/ U1 ?* t
2 M3 M r7 x( T0 Y0 W
_________________________________________________________________________8 w+ V6 S5 I4 `# @
. U: Z( V, V% k# \
Method 077 O* n0 K; I( C: m8 t# @& Z) ]
========= V7 I: t& b" H4 Q
6 M5 }6 y' q) ~+ _. L3 N
Method of detection of the WinICE handler in the int68h (V86)/ m. O3 @3 M. ~5 @1 H
9 t" |5 d' b4 u( D/ s7 b# x( u
mov ah,43h
+ z; Q- O$ M0 I X0 L int 68h, g& K* p6 _: e. N' R" B Y6 ?
cmp ax,0F386h. ~. M4 q( q. V0 x1 }0 R& n5 t
jz SoftICE_Detected
! K0 g, _; H5 Q+ w2 Y4 @7 `
8 g2 ~) r/ z. u. ^8 M* M! ]$ H8 z0 o A( j
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
$ i! b6 ]5 S) P6 A1 ~* f/ N app like this: y. Q9 T& K3 m5 R* U# j% x# x( D+ l
S6 j% E+ ~ w3 Y6 J9 J/ k
BPX exec_int if ax==68
2 @+ v- B/ _2 G) I6 m9 o: C' C (function called is located at byte ptr [ebp+1Dh] and client eip is0 V& U! m8 d1 O& o- J, \
located at [ebp+48h] for 32Bit apps)( I# L4 j q: o7 l# x/ s
__________________________________________________________________________' L9 j; J0 D" e. [
: z- E! q2 J3 g- T% Y4 O& @. T+ M
; k) x6 v- U' i( k+ e+ f" V, rMethod 083 ?) P2 P: _, b1 p% g7 s* e8 m7 ]- |6 v
=========$ |7 ]) N8 F2 R5 Y0 i7 k; e
" M! r1 s- _0 J! i( b
It is not a method of detection of SoftICE but a possibility to crash the. b$ ~# X6 ^: f5 W9 p. |8 \7 r
system by intercepting int 01h and int 03h and redirecting them to another" m) q& I& N- z/ }
routine.
) F) e/ r2 e0 _- @$ A$ M( yIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points& m- b; E5 f ?( ?0 L7 V
to the new routine to execute (hangs computer...)/ N# \2 i8 ^ I4 `
' A- \* P/ A* W- e mov ah, 25h1 U$ S1 ^, X4 [. z
mov al, Int_Number (01h or 03h)
) |; Z6 O$ x0 R0 n( x9 X0 Y! J# _ mov dx, offset New_Int_Routine
4 g% Q4 t; c8 y4 {+ h1 q. q int 21h: h/ K# \) x1 I2 q2 f8 @" r
2 V8 p4 E4 W5 u" ?
__________________________________________________________________________' Z9 v. H; ~) f7 e
' U5 F* R; q+ v, t7 V7 H7 _# j+ P
Method 09: E2 u1 ^6 B% L' X
=========
; j( C$ H( }- U8 ~! j* q4 J! E2 @: A3 I' [* I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- o" D! m2 [ G eperformed in ring0 (VxD or a ring3 app using the VxdCall)., |! D' w; k, r$ G$ Y
The Get_DDB service is used to determine whether or not a VxD is installed
W4 \; h7 j, i) Jfor the specified device and returns a Device Description Block (in ecx) for
% \4 T+ u% b- ` O1 i, ]* S0 q- I1 Ithat device if it is installed. v; H) ]0 j5 ^, d5 q* F
& X* x+ g( q& ?7 n4 m! s
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
7 n4 S4 Y1 z: F+ i& ? mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)- M* k7 K3 y8 b$ [
VMMCall Get_DDB
, @4 |4 d9 ]* S( p4 f- g8 C) c mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed2 u. a2 t: h4 U1 p
* ]7 A" Y0 J9 A \- ~1 z$ a5 ENote as well that you can easily detect this method with SoftICE:2 P3 D! k$ v. X$ S& m# U2 O$ p
bpx Get_DDB if ax==0202 || ax==7a5fh
M, a3 T" y& J! Q! R0 w. A4 x |' L" u% F# R( Z4 d; |3 @9 w
__________________________________________________________________________
7 n. h- F0 B! F# p. h8 x+ r3 k3 T: Z8 ^# o3 \
Method 10
# m* j6 U- D* g/ }; F# w=========: i# p1 a5 z- Z% u! w F" q
/ P& _2 O" I1 v6 t4 V) k0 ]* ]3 p- G=>Disable or clear breakpoints before using this feature. DO NOT trace with
: Y- q& K0 Z. l, o- N2 W9 U# {7 I SoftICE while the option is enable!!
: j2 s) H& y& v+ Q; M- M; b# h
! P8 I: p" s6 C a6 t* {% l* SThis trick is very efficient:, J. s9 u4 M0 k' L. w7 j
by checking the Debug Registers, you can detect if SoftICE is loaded
r( R% G% W$ N; @ S(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if* `# n9 ~: I/ |/ q
there are some memory breakpoints set (dr0 to dr3) simply by reading their" P2 d: x0 E0 d8 {
value (in ring0 only). Values can be manipulated and or changed as well
7 c2 R ], F8 f, P9 H* r) d* W% z(clearing BPMs for instance); o' L3 G( o; V7 r/ l3 a& F4 Q s
5 o6 m: C8 X6 F__________________________________________________________________________, x) [( J( ~8 t) V9 L
( |7 Q; S3 m1 h/ K* ~$ b5 t2 D/ R5 n. AMethod 113 q6 n0 z/ `3 O
=========
" e6 d0 t. r M- }: [5 f3 p4 i% ~- g. Z% U! K0 c
This method is most known as 'MeltICE' because it has been freely distributed9 r5 f8 B9 Z0 E
via www.winfiles.com. However it was first used by NuMega people to allow
$ E+ m. j, Y% f/ R4 U sSymbol Loader to check if SoftICE was active or not (the code is located
+ ]; o" E3 V. X: A1 Minside nmtrans.dll).
" U- \ B4 ]2 Y' P# c8 o
4 @( I! w3 y% B, X6 HThe way it works is very simple:- j" p2 G" M. Y* \0 z/ @( V4 U
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for) w. H. w6 s% I) W5 }$ M
WinNT) with the CreateFileA API.
T7 [; l' A% S2 t/ J. P: H( C+ `+ L( ]5 E7 v9 T/ i
Here is a sample (checking for 'SICE'):
# y# O# R) z8 S& D$ E) d/ a) y$ {
9 M" J" M2 W0 {( L/ j: }BOOL IsSoftIce95Loaded()
: i2 o( f. X1 W: J{! ^0 X; ~. R3 B6 E1 |
HANDLE hFile; 6 O# z; x$ E+ S: i- \: Q
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,1 _5 e# m; ?% S% V& s. J+ N
FILE_SHARE_READ | FILE_SHARE_WRITE,
" |7 [+ S% k9 ?9 {7 H& B q NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ _5 U1 }) C6 E! g if( hFile != INVALID_HANDLE_VALUE )
7 N1 y1 k' `# f7 p- z: k* e {2 B: _9 v' y% V
CloseHandle(hFile);* n6 } J; l0 P; \) L$ T
return TRUE;
/ Y; A0 y, E- g$ Q0 Z! A5 x. ^0 x5 m9 r }6 J* z5 e8 ^( m) @/ F8 r
return FALSE;* D+ }: C( E; o2 J( ~ E' I
}
' f6 I, u1 D3 j! a- ^0 [ ^" k3 D+ M- `; |% r( h3 B+ t, [
Although this trick calls the CreateFileA function, don't even expect to be f* l: p/ N" v/ J4 A
able to intercept it by installing a IFS hook: it will not work, no way!, _- ^4 @' c# z' j6 w7 h5 l0 J
In fact, after the call to CreateFileA it will get through VWIN32 0x001F2 T2 h' O1 p* b: c9 ]
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* o7 z' j8 U+ S0 yand then browse the DDB list until it find the VxD and its DDB_Control_Proc" E& ]/ l) d. i. A+ o
field.7 m# r6 ?3 z, Y* _% o9 a* M5 P* I# S
In fact, its purpose is not to load/unload VxDs but only to send a 7 d- d/ W# X( W6 H, N4 B7 _5 b
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)0 N' \7 ^0 {: s" V7 u" D) [
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% |2 A( y8 u5 n2 V5 Y! [to load/unload a non-dynamically loadable driver such as SoftICE ;-).
$ j2 k& f3 x/ e9 J* E/ C, V: hIf the VxD is loaded, it will always clear eax and the Carry flag to allow
8 i) I3 v+ Y* d3 Uits handle to be opened and then, will be detected.6 L0 }+ `. e/ c) [3 @- z* T
You can check that simply by hooking Winice.exe control proc entry point
* i& f4 [1 T. t/ l, Q9 [* E2 pwhile running MeltICE./ E) l8 \$ Z3 z! f: P# w. y t
' r7 h5 Z: l* {. ?' ?6 ]
6 p' h9 t3 `9 p2 M6 |( v 00401067: push 00402025 ; \\.\SICE
& v! y5 d! q$ o% ` w: f/ O( o 0040106C: call CreateFileA% @$ y- g& O2 H$ _* O0 z
00401071: cmp eax,-001
* l; @! K9 C. Q 00401074: je 00401091 r% R8 g4 V3 S) w! w' x
; v8 ]7 r1 }& o
9 B4 o* t9 |6 t) l5 R7 {2 k
There could be hundreds of BPX you could use to detect this trick.' z4 d& Y) L& Q. G7 p
-The most classical one is:
- e" `6 `% C( Y9 n BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
4 F8 _9 p" ?+ P g2 D/ C% Z3 n- W *(esp->4+4)=='NTIC'
% z- {; t& r- i) f+ v9 L0 R6 F$ f
1 k$ ? |; j( N! h7 \5 D-The most exotic ones (could be very slooooow :-(
7 i% F( n: r }2 o4 f9 T BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
2 F8 Z' W/ K1 A0 N- q ;will break 3 times :-(
3 V' k% i+ e2 F* B2 m) O
: ~; ]. U+ M6 `% I' g# ]) u-or (a bit) faster: ( x- P. [" ]; Y% u% X) J s) [2 D( S
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
( P2 ]2 t. y. V& C/ a; e/ ?5 Z4 L( x; x
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' z" i9 Q, ]$ A1 G% w6 L& t
;will break 3 times :-(
, e% a8 \& G$ | p" ^4 @9 c" r% d; A3 v: x8 a
-Much faster:
& I7 V% R& ~2 W( m BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
' Z: u# Q; w3 e) I4 m/ |, e* M; H# m' `" n! ?6 y; z
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ m2 Y- P7 H+ f6 dfunction to do the same job:7 y! q5 H# ^, N/ t
7 I0 z2 e1 D6 E/ Y% L, k! A) v push 00 ; OF_READ
7 E, v* a, q @, i' n& n mov eax,[00656634] ; '\\.\SICE',0
" p/ V; U2 t2 X- _: ? push eax. E5 k# A( ]7 C; s! I
call KERNEL32!_lopen _% J: S2 `. d% y
inc eax
* j8 e5 W1 v H1 W jnz 00650589 ; detected7 K6 M2 L# z4 U1 f
push 00 ; OF_READ |$ v& _0 H/ A3 u$ V" ]/ W
mov eax,[00656638] ; '\\.\SICE'
7 \) B: x' K* L! s push eax6 @7 Q' f U: k$ ^; {
call KERNEL32!_lopen0 G9 j) L6 `3 [: C
inc eax3 N; N! N F! ?4 [
jz 006505ae ; not detected
. I' Q7 x9 z* o
% W: G7 T9 i5 H4 ]
& V5 `; n# ?! O4 U+ {* A$ Q" U__________________________________________________________________________
7 W8 B0 a: b" I- {8 t( U- s a# _3 q8 g6 A
Method 12; M L. X" P; \( x4 j6 W) S. X2 \
=========2 p5 l3 @ X" c) B s B; K
& i0 s, R" ?% L2 w7 z% ?
This trick is similar to int41h/4fh Debugger installation check (code 05( X# Y# @% ]1 Z' ]' N
& 06) but very limited because it's only available for Win95/98 (not NT). _: x$ Q4 V+ d ~$ n3 {! d# N
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.% \ U, s4 H# ~2 w8 h! p
. f- x* D( A, C/ O2 `/ A1 B push 0000004fh ; function 4fh3 L/ ^0 k& \ C. M2 Y p
push 002a002ah ; high word specifies which VxD (VWIN32)8 \- u0 B2 u3 l' p3 ]3 J+ Q d
; low word specifies which service2 S% `0 c! e( \- a- O! L/ o
(VWIN32_Int41Dispatch)" x% |) I" j" |+ I- P
call Kernel32!ORD_001 ; VxdCall
) e. | g) Y2 g0 M' {) t cmp ax, 0f386h ; magic number returned by system debuggers8 P' K0 U/ `4 W3 M1 ~
jz SoftICE_detected
4 O' Y3 o- ~+ \9 x9 F
* s& D3 h, A* J) y5 @( k$ jHere again, several ways to detect it:# h1 K) W9 Q2 a: U+ Y9 o( `
: g r6 A. c9 d, x BPINT 41 if ax==4f
0 R0 W% ~2 \0 o2 y9 `
. E+ p6 }4 B; k2 B6 \ BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
9 s4 ^2 z$ _0 E( z+ V# r) d# o. {9 o! B8 \' Q; ^5 ]
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A2 p8 Z5 U# X( L) v s" L
$ Y" R- l! D0 z7 \1 V: g
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
6 g1 `8 D! T+ v1 H' \
; N8 j6 n# u6 W$ y! t9 B/ k! V__________________________________________________________________________( r h T0 ` J$ W7 F; v w
3 ?6 t% o7 k3 |/ {# b# OMethod 13
! S" y4 p. r; I=========
5 O; `% r2 M1 m! p3 o$ Z/ [5 R! B, S4 I1 Z
Not a real method of detection, but a good way to know if SoftICE is
0 i; d! |. _: h0 A) Vinstalled on a computer and to locate its installation directory.4 G4 a9 \% T3 j% B
It is used by few softs which access the following registry keys (usually #2) :( m0 r N' x9 ?' A `& ^3 o
/ p6 Q' j3 Y8 \7 F( I- r
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) J* S* u6 C1 {% M8 p\Uninstall\SoftICE* F8 K' } T0 y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE" C% r9 Q* }; L9 K. H$ T' F( y7 x9 Y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion1 R! y( n$ t. d/ F% w/ H
\App Paths\Loader32.Exe
% S2 c' H/ ?/ S8 O* E
6 p2 j3 D0 [0 v8 o8 Y/ I# v& O5 \, G! ~ H$ T& A5 J4 i
Note that some nasty apps could then erase all files from SoftICE directory
8 g# f- n% W1 u% C(I faced that once :-(
0 l% c% L& I) u+ \ P7 H# l* @% d1 z0 c3 i9 R3 C' l* X- Z" p8 B
Useful breakpoint to detect it:; e- H* B: o& ~
; A! X c; S3 z6 r* L# b BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
% F, Y% C ~2 B3 x1 X8 w7 S9 i) \
v# Z+ J# H0 h O$ B__________________________________________________________________________% }' r& j) z6 a5 X6 a/ m( g& c% L
: }' H( N& w v. A8 d- C
1 I" k& t1 g7 z% t- D( K! [Method 14
% w+ F* \4 P, H7 c=========
" v) D1 x: ]5 k. Q& R K; _0 _
) Q7 A g! K$ B; uA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose* `3 `% o$ Y# W1 @- D+ _
is to determines whether a debugger is running on your system (ring0 only).
5 T8 l" n% m7 Y3 b2 }0 T
* h5 r D3 o" X VMMCall Test_Debug_Installed
5 l, \5 C" S. }% T7 j% h+ g! r je not_installed* u1 h, B: K$ \* F
: A8 n2 ^+ q# o; Y# a
This service just checks a flag.
2 {, G% O5 ^% D) ~</PRE></TD></TR></TBODY></TABLE> |