<TABLE width=500># j* l2 X3 b- c2 J5 N& E( k8 Q
<TBODY>) U4 U) ^4 ]8 o0 [, Y b' }
<TR>
5 Q5 Z5 v; {7 j+ ^: }3 e `<TD><PRE>Method 01 ; @! T# B) U9 V0 {- _, ^9 F f- A0 s
=========9 _. n. D6 W j0 b9 P6 P; `+ C
3 p! p% n2 z" U5 \" `/ T
This method of detection of SoftICE (as well as the following one) is
1 u$ \4 n" w( J/ J4 t2 ~( |8 Sused by the majority of packers/encryptors found on Internet.9 ^* e: q) f* K: `
It seeks the signature of BoundsChecker in SoftICE
2 K4 J5 l0 ?' p0 F7 ]1 Y' R$ D7 t( y3 a7 _0 @
mov ebp, 04243484Bh ; 'BCHK'; E+ }- D, d# _- T* R! p- A8 a
mov ax, 04h
; [6 c m- U9 ]9 g* G int 3 . A; n% j R8 A( ^6 d( H
cmp al,4: A% a, l" @7 o j5 ~+ ~5 P9 @9 N
jnz SoftICE_Detected3 J& B* i5 Z. S9 s& w& ?, g! U
2 C1 H9 u' J- ^* Q6 Y$ P' _
___________________________________________________________________________
( O0 l. X8 n2 H
6 j( Z3 M9 D' G9 |" O4 DMethod 02
" c$ x4 A6 i1 ~6 {. N9 q=========
4 r/ K' V7 C) l6 ]
: q, V' C) q# j9 s5 b: k7 A" P" l5 xStill a method very much used (perhaps the most frequent one). It is used
# [, f$ O- m. sto get SoftICE 'Back Door commands' which gives infos on Breakpoints," I, M Y; E6 D5 _7 f/ E
or execute SoftICE commands...
. Q. p+ N; e1 uIt is also used to crash SoftICE and to force it to execute any commands) Y5 B! A5 e, s9 H4 e0 Z
(HBOOT...) :-((
9 ?6 L. J8 @& z$ S1 |$ ^+ K* V# l2 B. g* r! |+ q+ N& `5 U3 F
Here is a quick description:
/ W5 X0 C5 @- c& ~( o' \-AX = 0910h (Display string in SIce windows)
`& E: \+ X9 j$ L5 G-AX = 0911h (Execute SIce commands -command is displayed is ds:dx), e. C+ D$ f" {" ?, X' i
-AX = 0912h (Get breakpoint infos)
* }& I3 S: A6 n' _/ ]# U: H-AX = 0913h (Set Sice breakpoints)7 G% ~; n* }3 K7 Z1 i, g+ x( [, M) m' y
-AX = 0914h (Remove SIce breakoints)
; t; N2 T: z& C( R( q0 i8 m1 H+ a5 R) _" v3 c; \/ m' |% w! |
Each time you'll meet this trick, you'll see:
: D, `1 m1 w" k$ h% a5 t. s0 A) h-SI = 4647h
) S8 J8 A; ]& V+ R5 r-DI = 4A4Dh
- G$ c: j$ `! U d4 _3 xWhich are the 'magic values' used by SoftIce., N6 j+ I& ?$ E7 u7 X) Y8 D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h. S% O+ x! ]) x, T; S
5 ]. S3 W# v/ k. K7 {0 [3 h9 LHere is one example from the file "Haspinst.exe" which is the dongle HASP
, t6 H" }4 B4 hEnvelope utility use to protect DOS applications:' Q% `7 h# P) v
0 i3 J( ~8 i$ \1 B1 N! ?
$ G# [( k) e: u% b0 c4C19:0095 MOV AX,0911 ; execute command. X: S7 V- B' Y! b, L
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
$ M% _ W. C& v. F5 H4C19:009A MOV SI,4647 ; 1st magic value.& }% P3 `- T K5 f
4C19:009D MOV DI,4A4D ; 2nd magic value.
3 W# p7 M+ |. x& e7 |4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
. [' O$ q8 z! g( R4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
' S4 [$ l% A1 y4C19:00A4 INC CX
3 r$ l9 D k: W8 Q9 Z( L4C19:00A5 CMP CX,06 ; Repeat 6 times to execute$ e: e5 S0 p8 D9 F( H) o5 }. C
4C19:00A8 JB 0095 ; 6 different commands.2 M& Z0 n! X, u9 {
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
: ^! E- [$ J6 v5 ?4 j6 [& c: _. f) ^4C19:00AD MOV BX,SP ; Good_Guy go ahead :)/ v n/ }5 u: r N# W
`" v: J0 ]3 r
The program will execute 6 different SIce commands located at ds:dx, which
# L3 ]! y# O. M# p3 eare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ [& h$ B) i% u' }) O) o
2 N% c& o; L" w; b5 _$ M( _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 |2 [/ w$ `* B! E, t0 p7 }( u+ V' X___________________________________________________________________________
& K" O/ o% i5 L+ ?0 l4 i7 I/ f
, n" T9 l2 r3 F9 }) f9 R+ c: y) m" I5 m$ e) [. V
Method 03
( X1 _: i" y: x2 x) v0 R2 L: S=========
; ^1 O, P/ P; E$ F. i' b
/ C2 K' R( `6 RLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h' \. n/ D2 b" O. l) s- b
(API Get entry point)# K( m0 e7 @- O0 J$ Z
, g7 X- w0 F4 u' S1 T0 a6 m1 f- S. S
xor di,di9 q) ~' V9 I1 D& N1 M
mov es,di
4 C4 @9 o9 O( Q' e2 x; s" q mov ax, 1684h
: E$ r, t' U7 @% ?0 F/ q1 M9 k4 ^8 L" D( u mov bx, 0202h ; VxD ID of winice
+ r/ F6 q9 Z! v& l7 G& t/ `1 M' z8 y int 2Fh; H$ R- Z; W [! ?8 ?3 l
mov ax, es ; ES:DI -> VxD API entry point
) q) I( L5 v. ~' b U( Z add ax, di, B; Q. G. \: {0 l0 O" Q8 P
test ax,ax
6 E/ \7 \( C6 h* b/ \3 L jnz SoftICE_Detected8 g" \) Y# o9 b. v9 I ]" q9 q
' r1 [- }+ P" t3 ^; P4 e5 u___________________________________________________________________________
5 e) P5 Z, h" J5 B/ d% B! u' P* z* s, `6 `8 M
Method 04
$ W! _5 E/ H' Y( D9 [=========
% Z! G& e: l& A0 P. {8 a% T3 u( _7 E
V, `5 r# E2 Q* M2 s) iMethod identical to the preceding one except that it seeks the ID of SoftICE+ M( l! t4 _3 e5 r- g# ^
GFX VxD.& {. F2 [" E0 V) Z8 A2 q% t& d
6 i$ ?! J6 ^) g: m7 T xor di,di O& D% A2 R) K( F) X
mov es,di6 F. ]( ]/ L4 H9 X0 M7 K3 o2 J
mov ax, 1684h 0 o( M+ ~) d+ u8 {6 P
mov bx, 7a5Fh ; VxD ID of SIWVID6 V7 D3 D' J E" _* O3 s/ K/ ]/ H6 Q
int 2fh, f* ?. J- v7 z$ i, t+ Y
mov ax, es ; ES:DI -> VxD API entry point
' ~% C% k" ^: O, I; e add ax, di2 g% G) V$ y* y; o1 o4 Z2 @7 a) W
test ax,ax
" X$ Y- h7 ]3 O- L$ ?' W- c8 n6 b. K jnz SoftICE_Detected
7 p& E6 q5 z9 }$ T4 I9 \; w+ x5 J! a6 E5 `
__________________________________________________________________________3 E. @! V$ W! C# p3 W6 y. U4 U2 f( A4 a
/ _& s. s: N. u# B
3 v: Z0 {/ S2 J- v# ~
Method 05
7 i; h( e$ O1 D/ s% B) K' R=========+ E2 S; U" d# J0 S: w6 j( f) c
5 {* u% C3 G5 e1 F+ X9 Y+ _Method seeking the 'magic number' 0F386h returned (in ax) by all system
3 B5 }- p( A1 f7 F8 Mdebugger. It calls the int 41h, function 4Fh.* X2 Q- P' a" Z% F: S8 G- \
There are several alternatives. 9 I% z. O8 ^* G4 q. @! i _% @
# L3 N s5 }3 i7 E
The following one is the simplest:) m6 B/ @) H" C+ E( B( y9 i
3 s$ z4 k" e, [' \- {! N mov ax,4fh
0 V0 E3 |' O8 k/ I9 b( R+ d: R int 41h# |; f/ h3 N7 {! S
cmp ax, 0F386
9 a! Q% x& s. R/ t2 t& U. O: ? jz SoftICE_detected; L, P) r1 v& E3 A# C4 I
' c; E, w: h" s: H$ M+ F8 Y/ p( _5 L3 Q
Next method as well as the following one are 2 examples from Stone's
0 n7 i( U% H& `$ o, s"stn-wid.zip" (www.cracking.net):% u; L3 \$ m& d5 R; `8 P
' X$ v/ g! |) _7 }! C" n mov bx, cs
5 S. M' E! }5 x( L. i o" }( K lea dx, int41handler2
\# X! u( [1 u L, U4 T d xchg dx, es:[41h*4]4 \! E8 \6 z) f/ H4 ]3 U
xchg bx, es:[41h*4+2]: L8 W) ]& A) x2 ~) j
mov ax,4fh! h/ y) N: Z4 M- J1 V5 F
int 41h
: }2 W7 E7 A+ [4 q$ R xchg dx, es:[41h*4]
& l! }* g0 v9 v xchg bx, es:[41h*4+2]" s# |+ H$ S( A& E: I0 r7 D+ S1 B1 f2 A
cmp ax, 0f386h8 @7 [& u1 J7 Q4 u$ l
jz SoftICE_detected
8 F4 Z: _3 C K! G9 a2 s# k) c' T: O
int41handler2 PROC
: R2 U$ X* C7 B iret
/ q% C, q6 Y) T+ iint41handler2 ENDP- n5 t! z9 e" @, z
9 t: P$ j5 ~, M) \
/ V3 V$ U- a) l V1 t5 I x_________________________________________________________________________% A2 v& j: E& J. E6 m
, c6 |: ~9 d. p' z
* Y6 H! w% Z+ Q, BMethod 06, e4 l! e& a5 _' U9 D
=========
! P' X, O& f1 |3 \* d6 C E6 i! P# G% w6 @) p
- ]6 H8 Y0 G& K2nd method similar to the preceding one but more difficult to detect:1 U, O# T* L9 C& V
3 ]. E' Z# P6 R* W
. i; `/ s. ]8 |, `
int41handler PROC# a7 q, [1 |; A+ W( J5 |* q9 D
mov cl,al' T. E; S' @* O! }
iret! \" d9 S( m0 W7 ~' `/ ^( T5 q
int41handler ENDP
% t) d: q4 r+ G9 ~9 \0 X4 G; o; m2 H8 \+ x: ~) z1 y
- }- n+ K2 q+ e3 @
xor ax,ax
- I/ R( d6 p* C* H mov es,ax- D- C2 i3 e$ T7 o2 O) N" S
mov bx, cs
; _2 R3 E$ X6 M, i/ ] ]9 r lea dx, int41handler9 K2 b1 Z0 X" t' k+ a, s; [+ x( w9 i
xchg dx, es:[41h*4]+ @/ ~; C- ]' m8 m
xchg bx, es:[41h*4+2]
/ v E3 H. R7 k1 `( s+ i in al, 40h w6 N, A! r. F2 w2 i) {
xor cx,cx5 A# D+ f; W3 @$ E& H, z
int 41h: [ i! V% k4 \& O& ^
xchg dx, es:[41h*4]# P: E# f% A) l$ H% L# O
xchg bx, es:[41h*4+2]- T7 k/ i, p$ f
cmp cl,al9 x" g" x% \. {
jnz SoftICE_detected1 ]1 o; ~2 l# |0 ?
2 f2 G ]9 L4 L- V( \$ U% U% n
_________________________________________________________________________
% X3 N! k# f8 u; K* i" B( w, o& e8 c8 ~
Method 07
- U- |/ `% h/ |" r3 X=========
! D7 ~, _, z$ r7 X1 u! k! c; m
) X/ J: S+ G- ]8 Y; ?# t8 `: l/ f" m7 zMethod of detection of the WinICE handler in the int68h (V86)
" S& i0 X' C( G! a6 ^# x
2 r# h9 k8 r9 a% Z2 D mov ah,43h# F( ~' m8 W" |8 @
int 68h+ C. q- X3 \- J8 a# j
cmp ax,0F386h. l1 J; I5 |' `7 U" y/ [9 t
jz SoftICE_Detected9 s$ A/ v( A6 Q' r- z/ u
2 k8 `4 W2 I9 r- |& g" J* n+ X/ ?3 p4 ?4 K2 ]2 @
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit+ X2 s9 k, ~) Y4 {: F
app like this:6 ? k' p8 `% Y7 I. M3 j' ]
; r! y: F1 W! G$ m BPX exec_int if ax==68' Q# W* \; Z/ ]( P) L
(function called is located at byte ptr [ebp+1Dh] and client eip is
$ q1 G+ T! M. V7 N! J5 b8 V4 P located at [ebp+48h] for 32Bit apps)
# X9 ^& n( I8 l2 `__________________________________________________________________________
8 D! w& V! a* K% f, j5 R
. d- E4 x6 k( N9 p) f. D6 D: s: q
/ [) a1 T& r1 n, y0 ?Method 083 G* i& ^7 Q' D9 A) m8 }# @
=========$ Y3 x/ Q7 |1 q5 f7 x. Q
1 D' W8 P$ v5 H& W1 L7 [* d" j# S9 M9 ]It is not a method of detection of SoftICE but a possibility to crash the3 R0 d- a" d" D, s+ w# ?& ?3 K
system by intercepting int 01h and int 03h and redirecting them to another7 ?+ x9 j, M( Q5 p
routine.
7 x3 F! P e3 Z9 B! ?, _, A" |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points. ^0 r# ^( [0 u; ]
to the new routine to execute (hangs computer...)4 j- r" r4 W c
& z% ` N8 g7 k" N2 g8 M, I& ]5 V mov ah, 25h ^! f/ u* q0 T3 l
mov al, Int_Number (01h or 03h): t9 `; M8 E$ B4 {3 z: ?
mov dx, offset New_Int_Routine
- o, m; [ g+ F- M- f4 i/ m5 H; U int 21h
f' H- p! Q2 y- o# E
9 s& n( R! D+ B: G3 b__________________________________________________________________________
3 V/ R. ?) z' x2 a, o
; k3 a* E9 Z v& _Method 09
& s! ?) @" `, W! B3 G: d2 X' }, [=========9 ]3 A O$ H) b1 d8 D1 b% C$ i
# Z+ v- _8 \; D q
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
/ [' q7 a( p+ mperformed in ring0 (VxD or a ring3 app using the VxdCall).
9 c* Q* p. K% S+ ?. N" GThe Get_DDB service is used to determine whether or not a VxD is installed
8 f! C* l) q( }for the specified device and returns a Device Description Block (in ecx) for
+ [4 J8 [- l$ }- g' ethat device if it is installed.
! s% y' e2 M" V& s/ G* T% e* h5 P2 |; h5 Z% D- _) u8 b
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
2 N# l% b7 a" w( @- ?1 m. w' e mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
0 w4 ?* F! G, T# b$ [2 g6 r/ q VMMCall Get_DDB6 J4 m+ F( V2 D) C* |, x
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* I. u0 F8 Y3 ~$ {# W
7 _9 I3 t# ` @/ w5 [- FNote as well that you can easily detect this method with SoftICE:3 ^! J9 x* J; |8 m- d4 V
bpx Get_DDB if ax==0202 || ax==7a5fh8 z' L9 m# Z- A' L1 R4 o: ]
- I7 b N( s3 P4 M) T
__________________________________________________________________________
3 I+ h4 D. H5 S$ w# `) s) f8 x* g( ]- Q6 I
Method 105 Y3 X5 {) G6 M8 @5 |
=========
' ~4 W2 @/ p' V& v" g v) k; y7 }+ ~$ A1 P3 G
=>Disable or clear breakpoints before using this feature. DO NOT trace with
3 w1 C P4 ]' ]- j SoftICE while the option is enable!!
! C5 o, l8 X$ n/ m( k
; Y% y; D; n. a" fThis trick is very efficient:. y1 ^+ K7 a1 q
by checking the Debug Registers, you can detect if SoftICE is loaded
" O9 K L a2 ^" a" p9 L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if# E4 u' g' X1 `8 }2 Q0 j5 x
there are some memory breakpoints set (dr0 to dr3) simply by reading their, Z% W7 ?# s) Y" {
value (in ring0 only). Values can be manipulated and or changed as well
6 @1 \8 X: M$ y+ x(clearing BPMs for instance)! u) |7 {# x2 {* T$ L1 H2 g
) B) U8 p: O) ]4 j9 f P: T__________________________________________________________________________- e; t+ @3 |9 U5 m+ h8 I* F
5 D" ~* o: N+ ^9 G* ]Method 117 ]8 }3 w+ o0 m& e' ~6 g" z8 \1 b% ~
=========6 X5 C- l7 `* D
5 o$ O1 O# H' r/ i6 O8 K3 GThis method is most known as 'MeltICE' because it has been freely distributed
; r5 X$ `. ]( l( G! ]4 |via www.winfiles.com. However it was first used by NuMega people to allow
" [7 J6 P0 a! D& u# `9 jSymbol Loader to check if SoftICE was active or not (the code is located
! z. m# M" Q: a3 U( ninside nmtrans.dll).
1 I7 A: W9 m& O, B) w5 T T. j
" i- d1 D/ u$ K' `' h, a, uThe way it works is very simple:
" [! J& a7 T7 n* ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! A& u& q8 j+ D9 p' b/ O9 y) r3 }WinNT) with the CreateFileA API.
# R3 k! u4 ^: {2 G4 {5 @' M& u9 ^$ f# A( J4 a2 M
Here is a sample (checking for 'SICE'):: n F6 E! ~, D! |
( P! i/ L6 f `" I
BOOL IsSoftIce95Loaded()
7 r4 d( ]' [1 S, N) j{7 V/ G8 [" K+ l/ D
HANDLE hFile; - d( D/ B$ y% U8 J! @
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, [# x& y0 d' c" Y
FILE_SHARE_READ | FILE_SHARE_WRITE,
! U& | d: s& u NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1 P& n. Q) X5 ?0 Y! T5 ^: i! O if( hFile != INVALID_HANDLE_VALUE )
' e' Z( I _5 n4 k+ N! u {7 ]( o3 n- W% V1 K! f- b2 l
CloseHandle(hFile);
# ]$ s6 M* G" F* b8 M) [ return TRUE;, b/ q" `6 z: @- u; m4 s# t& Q
}4 n4 t( m/ B1 k7 e% i
return FALSE;
5 q/ {3 g( l# W1 R" V7 C! N}
5 {3 _5 ]4 D0 k& L4 l/ W/ e& L t! ~7 W5 G2 ~; J
Although this trick calls the CreateFileA function, don't even expect to be7 I% ~4 x* m# y
able to intercept it by installing a IFS hook: it will not work, no way!
. ?) z& d1 L$ J. W! |$ `$ cIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ a; q5 t5 R! \9 y9 Lservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
, A. h8 s$ Z& j' W! Band then browse the DDB list until it find the VxD and its DDB_Control_Proc; a: g# y2 B( P7 \
field.
/ N) e9 v1 E ?) r# X9 l& E6 HIn fact, its purpose is not to load/unload VxDs but only to send a . o8 [" a' D6 w* @9 V0 U9 x0 h: [
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
' ~1 Y1 c" `: B3 Uto the VxD Control_Dispatch proc (how the hell a shareware soft could try% ^4 E: o, m) [1 {6 v0 X
to load/unload a non-dynamically loadable driver such as SoftICE ;-).& p+ S F2 Y& Z$ L6 {& Q3 s
If the VxD is loaded, it will always clear eax and the Carry flag to allow
) i4 F: {" }$ q( l; V" e$ E2 X: aits handle to be opened and then, will be detected.
% |2 v* V& X9 P' G4 sYou can check that simply by hooking Winice.exe control proc entry point& l0 x) [7 ]/ s" m n
while running MeltICE.; }; z% y+ T# y8 }2 z
! b: ~& O6 {: I8 o+ S' {" Z5 R- M7 f% t3 [( F! V6 c. @7 e- b
00401067: push 00402025 ; \\.\SICE. H+ r- E4 R- `' a7 s+ M x! R) g1 C, b
0040106C: call CreateFileA' g+ w4 W( s; N$ t7 v
00401071: cmp eax,-0013 U% }- x) H0 j
00401074: je 00401091! w& }" [ R" J" a
/ B* _5 u; x/ k6 _ i$ _5 l' H$ n4 e& A5 S
There could be hundreds of BPX you could use to detect this trick.1 s; l2 F/ K0 T" O; o3 {8 x+ G4 Z
-The most classical one is:
( D2 O9 \$ N( M BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||, `: M( U% h; P/ a
*(esp->4+4)=='NTIC'
& n/ A3 @- B2 ?5 e
% }9 B9 _4 L/ y$ l-The most exotic ones (could be very slooooow :-(4 g, K7 u* S' X1 O" b9 W
BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 0 U2 f+ c( n; O
;will break 3 times :-(
2 K* J" \3 [# \' Y7 u1 I5 C; Y* m9 g) Z7 U4 y' W
-or (a bit) faster: # Z' X+ J# O0 n2 {& J0 e
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
W+ h! X) ?7 |* O, ^, T ]% c$ r* o
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ' }; n( G# N2 u( ]* W
;will break 3 times :-(, ]- U: k; L, I4 t/ [6 m# t
+ ^1 t1 r6 H* z-Much faster:1 S! t9 U$ |: u# l: O: ^& f
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
3 R5 y, j# F4 l+ r; y4 G, o1 c' S$ a5 z/ j7 X" m6 m) V H
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
7 K9 i5 T' P1 Efunction to do the same job:/ W& \- k- V3 ~
$ B) J& k8 o$ d. ~0 `
push 00 ; OF_READ
1 E8 D/ Y' f1 q) U: Y mov eax,[00656634] ; '\\.\SICE',07 M6 P+ R- `) F* T1 I+ j
push eax
* ^; c+ t d) U9 e call KERNEL32!_lopen
$ m3 C% Z: N( ~5 D: t7 F* W, c* M6 V inc eax
0 S& L1 u4 M0 o' r, i jnz 00650589 ; detected _- V. v, }' v/ \8 W& k
push 00 ; OF_READ9 R# M" e" i; o- Q, a: X1 h
mov eax,[00656638] ; '\\.\SICE'8 o3 ^" X- a+ g9 }1 r$ B
push eax
) v# B9 k" K3 p call KERNEL32!_lopen
/ y, j: f9 f- @. i7 \0 d4 g( ? inc eax
4 N! ^. ^) D: Z jz 006505ae ; not detected0 J, T( h0 A* V. Z
0 y9 R; z: O) u" w% P1 ]& [3 p; D1 |0 }+ Q7 Y- C: Y# B$ P" {
__________________________________________________________________________
; h) [0 F& u# t) k9 n$ j1 G- s# s2 Z0 H8 d$ Z" k9 _- I
Method 12
" Z1 l: K! Y/ C- Z( y; u=========
1 p0 P- B+ ?5 x. _- K2 a o6 C- K" z$ C; L6 o \# R" {- ?4 U- p9 w
This trick is similar to int41h/4fh Debugger installation check (code 05" Q+ P1 `( u M6 g
& 06) but very limited because it's only available for Win95/98 (not NT)
( ]- Y3 g7 _% k( c( Zas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
* a0 n0 e+ B" P0 \+ @& Q5 e$ a6 f
! g% B' I2 Q, ~' n push 0000004fh ; function 4fh
: j' O/ b& X' {& L% ?) f4 W0 l) y push 002a002ah ; high word specifies which VxD (VWIN32)* P4 o5 R- Q3 Q
; low word specifies which service! {- E) M& {$ Z7 K
(VWIN32_Int41Dispatch)9 @1 a" J6 g4 _* C8 L6 b! K0 a% M
call Kernel32!ORD_001 ; VxdCall
! k4 `3 M, \% n& O: b+ X ~" m cmp ax, 0f386h ; magic number returned by system debuggers
: a/ B3 z" q7 \ jz SoftICE_detected" r8 E5 V: `7 i9 V! R* C2 ~& a
- t7 E9 T% f j- F# ?( p5 s
Here again, several ways to detect it:
: \ H3 N, [; h+ n) S6 `2 p m9 ^. u+ j3 d, W
BPINT 41 if ax==4f+ t& c+ T/ q: n/ L% m& ~1 `. G
* G- i" e. s2 o BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one& A' w' ^0 u, {8 H2 f) D' ]5 M
$ a$ y& @' c* t4 i
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
) q- h. O; {! n% }7 V
* O3 X0 G' P+ _ BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!! q2 `( q i( L" M A8 b( H! r% ?( J
( ?/ ^0 O, S7 G* Y0 M6 H% s
__________________________________________________________________________
* g" `& O5 H" [! j/ ~4 y. _( X; k$ m2 P. h( \9 B: d9 H
Method 13( z) T$ j6 _1 `$ h' ^2 I
=========
1 F. b" V* ~% i+ [& u$ F6 h" [+ M3 j, O$ U
Not a real method of detection, but a good way to know if SoftICE is
- i; v& o9 ]" |6 }: ^$ o; yinstalled on a computer and to locate its installation directory., d" B0 I6 F% i% {; J0 i9 }
It is used by few softs which access the following registry keys (usually #2) :
% p; }/ T5 K7 ]0 I9 F6 o8 O9 { @0 N; w( o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 n" c! k5 Z/ b/ ~! B\Uninstall\SoftICE" X4 G" F7 r5 x5 {/ c7 } h5 V1 Z
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ J* ^: Y6 V7 [% X6 s4 P1 k/ D
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; L, u% k. C5 R! O+ ^9 x0 Z
\App Paths\Loader32.Exe
7 E. h; ^; U6 X: ?% ?0 _, W/ z7 |7 G
' F6 m0 e9 ^) `Note that some nasty apps could then erase all files from SoftICE directory8 o7 i1 Q' [# b" C3 j
(I faced that once :-(
; l {+ ~, H. L. W- [; \9 N, L/ |% F5 |9 D9 {
Useful breakpoint to detect it:
- }, I0 ]0 y! g- a6 \3 B- [! G4 J2 T' W
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
( v2 |, \% _3 e; {9 M$ C/ B) B f7 }4 n9 R. @- ~
__________________________________________________________________________
7 l% A- x- Y( ^. ?5 O5 W% n0 i% p% n" U. j o
4 X+ M" P3 q0 \" X; T+ @Method 14
/ V- D0 d/ T$ o& i% i9 E( H=========
2 O7 M) J/ W. o: x' `4 N
: o+ @" X1 r! u1 a3 g$ @! CA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
U4 w b$ y+ J3 Yis to determines whether a debugger is running on your system (ring0 only).
+ y. S D1 ~8 x: Q, S/ {: F% z1 R$ k/ f9 s
VMMCall Test_Debug_Installed
" C& c) j" q, ?3 g1 { je not_installed
& c, M% }& B5 R8 I* t/ W/ X6 u9 K7 F+ f5 ^( \$ l7 y
This service just checks a flag.
, U& d* F& K' N$ M) X# }</PRE></TD></TR></TBODY></TABLE> |