<TABLE width=500>
0 k5 n) F9 V. q<TBODY>. Z! C$ Z K3 b, Q2 G
<TR>0 m/ i* m0 f' ]
<TD><PRE>Method 01
& O) i6 I Q5 { [- r( g=========
6 T; V* f) K- E' E9 v" p K5 v- w. V1 f2 z( N s. K' K. D% @( V
This method of detection of SoftICE (as well as the following one) is
7 Y- u( Q2 ~2 D. r! ^used by the majority of packers/encryptors found on Internet.
1 O0 ]2 c1 z) e) R. B+ @It seeks the signature of BoundsChecker in SoftICE
: T; C% }# Z( b" d& l/ [8 [, _7 y7 X/ N. d9 f
mov ebp, 04243484Bh ; 'BCHK'
S* e, m: J, x5 F mov ax, 04h
3 V# h2 |% A1 M, W f' K int 3
1 `; _& v6 z' z# L$ x- I! z cmp al,4
4 C. S6 O9 p/ @; F6 d0 _# P w jnz SoftICE_Detected
' J8 p3 W z& W4 |7 J) w) k( T; O& l. h
___________________________________________________________________________
! s4 o3 P5 H6 j$ b( |% l- a$ Z5 P1 ^+ n) N2 Z' q+ h
Method 02
; j& W. h2 c. a- S=========* c. u& P; R Z
0 b/ I5 N' N$ H7 v% R- Z; k
Still a method very much used (perhaps the most frequent one). It is used) |% X* f8 o G5 b
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ W2 O k( t; P5 m6 x7 Nor execute SoftICE commands...2 u' n0 {% D( u/ e+ i% u
It is also used to crash SoftICE and to force it to execute any commands
' f" C* v* Z( ^. r2 w4 S(HBOOT...) :-(( ' L/ c5 A7 P7 c( Y* z, [
# r9 A3 B/ }. p4 w- }" ~) g
Here is a quick description:
; C+ h2 w7 m6 x- C- O4 R-AX = 0910h (Display string in SIce windows)# l8 b# l. }. m" h \/ d N
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
9 \1 I* o ^* I( B-AX = 0912h (Get breakpoint infos)" x; M0 z( ~$ C+ y9 E/ P4 h6 r
-AX = 0913h (Set Sice breakpoints)0 i; a, o: V# B1 l) q, P7 W" @" {
-AX = 0914h (Remove SIce breakoints); t5 t0 G3 _% i- W
+ D& |5 v; l. Y8 t3 |( W+ Y6 BEach time you'll meet this trick, you'll see:
; u/ Y5 s S9 K, T4 c; e8 }-SI = 4647h
& A! n1 E" ^6 r-DI = 4A4Dh
3 g" M+ {4 D8 M8 DWhich are the 'magic values' used by SoftIce.
8 |, l' Y* ~1 B7 P# pFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
, U# ~+ ~2 t/ S9 |0 v
( G/ X0 w( |5 v9 gHere is one example from the file "Haspinst.exe" which is the dongle HASP
% b! y- V% g: J0 H' N0 {" EEnvelope utility use to protect DOS applications:
$ p! n' b& ~- F7 n; J& c" ]0 o+ i4 v/ e( T* J" @' ?# U
0 U, B" U4 O7 p5 r& O/ j
4C19:0095 MOV AX,0911 ; execute command.
/ i, S0 k5 t1 A5 @+ Y! {$ X) d4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).8 b H2 P; J# v+ [
4C19:009A MOV SI,4647 ; 1st magic value.! H5 a6 w6 N* G) D% N- A! }
4C19:009D MOV DI,4A4D ; 2nd magic value.
& Z w+ r6 C! K7 D4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)
2 R. G# m" D4 ]4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute H: ?2 P/ F# g R" [: E
4C19:00A4 INC CX
5 f+ X' n8 t4 R( U* V4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
( S6 M5 o( ]9 r% `4C19:00A8 JB 0095 ; 6 different commands.4 n2 n, C6 h$ c/ J# @
4C19:00AA JMP 0002 ; Bad_Guy jmp back.
, m+ H5 R4 p' s) @4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
4 S) s4 S6 ?- z* I: A8 H0 `+ q; y
: n6 g. ^3 c" g1 e0 x' r+ d g! aThe program will execute 6 different SIce commands located at ds:dx, which
+ n! u! R9 X) X3 O) Y7 L! care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' ~) t; u. D! i6 T2 W6 x# M( W- j9 M V) f: a) j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ n6 L& o6 ?7 N5 ?# b
___________________________________________________________________________
' e- g- c. ^7 o" `' P
2 a' @! d! s5 C7 v1 g& S( i! s4 P6 p
/ n2 }$ C4 q4 P5 BMethod 03
! g! M% h% Z: F# H( K% ]$ |=========
% g4 S# {( w9 p1 _; J. \. R1 k1 L
& n7 p- x* @& _' _6 _0 JLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h8 k p8 \1 f: ^2 N/ B
(API Get entry point)3 j5 P* U$ o% k0 O9 {/ O8 n
2 n+ `# f1 j# O1 X {; B. {
4 |% T* Z5 T; Z( `! L xor di,di
4 V3 D6 m2 h6 J4 }( u mov es,di, D& O) s* t9 a+ o, w* T
mov ax, 1684h ( `# ^' e& x0 e" R
mov bx, 0202h ; VxD ID of winice
' }* H. t Z; f int 2Fh
0 d3 a6 l0 B- D mov ax, es ; ES:DI -> VxD API entry point
" T$ M9 J. d# n y2 u0 ^4 S add ax, di" r* [ o1 f0 |" `0 K9 z3 a8 j
test ax,ax
2 z; d# _6 J5 u* h1 Y) y jnz SoftICE_Detected+ V/ E: ^2 d" L9 l
$ _' _2 J+ D- U9 m; U___________________________________________________________________________
( q- i. F5 t8 O. J* j! s
% [# P4 H; t! \/ N- MMethod 04
: e! t9 l/ v. N0 n8 ^5 c=========$ R! {/ ^0 v7 S: R" a# Y
; `; s* ]5 Q& i, ~ b- K2 i
Method identical to the preceding one except that it seeks the ID of SoftICE
& q3 x% H8 K4 A' N* f& O' ]% r- C- H2 vGFX VxD.
3 D$ E4 m( ?( I- ^: T# @) W( V8 @/ g) ~9 q+ F, H+ t! N& d
xor di,di6 t8 c: ^9 z. h6 y( x
mov es,di
/ K3 q+ Z. M) S4 w mov ax, 1684h ! U8 V- F* ]5 P( w ]1 H- S
mov bx, 7a5Fh ; VxD ID of SIWVID
6 n' x6 P3 X' v; p' G7 P0 L- K( X int 2fh) [! s. z8 E3 R
mov ax, es ; ES:DI -> VxD API entry point6 |( n) w# P( ~* ?/ p( d
add ax, di, b: R( r, Y/ X
test ax,ax$ I7 K+ l$ H+ Q( j) q
jnz SoftICE_Detected5 z! j6 c3 E# M7 `7 h% L7 N
) L; H# ^+ s+ J7 j5 _
__________________________________________________________________________4 ?# Y( @! r- ~3 W' l
! ?+ F/ y/ V! W' c* ~- q9 f& v
8 O, g2 ]) n% l) P5 oMethod 059 w* b" y( M! y9 K1 F0 v$ ]9 A
=========
5 h; G4 j5 o }# T8 `
' M2 N7 N3 e v/ {$ b% lMethod seeking the 'magic number' 0F386h returned (in ax) by all system- B: Z" u& F8 u! P* r
debugger. It calls the int 41h, function 4Fh.
. X# Z1 `* W' Q" J% sThere are several alternatives.
. I0 [; Y8 z( L9 [5 ]) ?) ^; J; S( n0 r0 t c: Q$ t( r, i
The following one is the simplest:
% X; G& ?9 D9 {2 H. |
# Q- j8 w5 o' K8 E3 ]4 y; I mov ax,4fh
/ x% p, T: R9 @$ i- ` b/ B) h: y int 41h
9 Q; T9 \2 d2 J7 X& c4 ] cmp ax, 0F3862 i4 g1 I% y8 d) ^0 ^+ s/ V
jz SoftICE_detected
# p% j+ L5 ] M
# U* R# a" q d- Q( X0 N; N; \+ D; U
Next method as well as the following one are 2 examples from Stone's
7 _( {* ~" V- o( @# f"stn-wid.zip" (www.cracking.net):; ~3 N6 W+ T" E" d. c4 N; b, P
: {# G& \* i6 R" b) G, z7 \ mov bx, cs
f5 g6 J+ W0 N1 t lea dx, int41handler2
2 B* p' G7 T) S, ^/ s7 | xchg dx, es:[41h*4] _1 E! I2 [1 A2 M8 T- X* l
xchg bx, es:[41h*4+2]7 N& Q; g& I4 H& { q x5 _
mov ax,4fh
" C& U" W) V- ]! P" u7 [) N int 41h
1 A1 l$ F$ D6 Q6 g: v$ a xchg dx, es:[41h*4]
, `& Z1 [, [2 D3 u ]6 e0 h xchg bx, es:[41h*4+2]7 `8 G/ [& \" y2 J7 Y$ l
cmp ax, 0f386h4 t: r5 f' d, e" X% y! e
jz SoftICE_detected8 x" c, p' j5 R' `) u3 c
$ k; Z, U3 Q% u# Xint41handler2 PROC& O5 l% \: U/ S! \
iret# ?- m; d) t9 {+ W
int41handler2 ENDP
( R1 {' {3 a5 N0 ^2 L* i3 ?$ Z# i9 T0 O" \ k
/ X6 d9 a, a* X- K
_________________________________________________________________________
/ j# M. X8 W. Q- R: F3 c2 I2 D4 K: W& m! ~/ a, i# p
$ I/ \4 V& w6 ?$ r9 u" T. X
Method 06. t6 w1 [1 a# q1 J4 J, D
=========
: T9 O* i/ v: T7 |8 t
3 G" a6 c3 b3 g$ b- e' X5 E
6 R0 g7 ^& _. |# ]2nd method similar to the preceding one but more difficult to detect:
, E, b3 [4 E/ q; @. {- ]; f P( G5 m1 Y" T6 Y0 r, [3 u# }
1 \# L- d) C* c/ k
int41handler PROC
9 [" p9 Y- n" K- K* F3 a mov cl,al$ @9 V+ F: d* i1 ~
iret9 I/ u9 K$ S& O4 ]1 A3 w+ z/ [
int41handler ENDP
: y( L' ]& q! A+ U. Q
: p* R- d4 @, s \' c" J& W
2 j& w* S4 k U% A( B8 D xor ax,ax( s( ~" q1 x3 n9 i4 ?
mov es,ax% u5 B8 g- }. N. o6 R3 n" R5 P4 s
mov bx, cs% M# a/ f$ D/ u& b
lea dx, int41handler, \6 w% D1 W+ ~7 C6 k
xchg dx, es:[41h*4]
l' F- ]& X/ X2 Q+ ?0 { xchg bx, es:[41h*4+2]' P7 R. x$ [! c( G4 @
in al, 40h
, x1 t7 c# Q! i6 X/ G+ b: w xor cx,cx# y4 V' S* s( z, g& M7 N) N
int 41h
% b- b& [% A# F6 Y xchg dx, es:[41h*4]
3 F" f( I" d) h i' s4 Z xchg bx, es:[41h*4+2]
1 \0 L+ Q1 d( _* A6 i7 Q9 _' O cmp cl,al
4 k5 j8 C; D2 s* X jnz SoftICE_detected
% V* h( }0 `3 G9 n9 A
/ d/ i. k8 q) }1 ^; u" ~( c_________________________________________________________________________6 M& @8 Q8 u; ]- H( Z$ ]1 A) y
: D- d3 x+ F: c+ U# ]
Method 07
+ [1 o/ a, X0 A# X8 |=========0 |0 z5 o' I0 A+ R/ O' y3 `8 G( Q& S$ P
2 v, i; L ^2 m0 d/ p! r! z; T6 ?Method of detection of the WinICE handler in the int68h (V86)6 x0 _+ B4 r) t7 b. H1 Q; h0 i( Z
, v6 v& s7 D7 i- [; O- E9 P8 b mov ah,43h4 X& f6 v9 d7 c9 n
int 68h' G! h. X; t- |( r2 l2 _1 c" y
cmp ax,0F386h8 K% [4 u" m( D/ ^) ?" l% y( U0 _
jz SoftICE_Detected
. A* ^# I1 [1 U H A$ ` a5 W+ z$ w O! J/ a* _
( I$ z7 r: _$ G0 h' `' d
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
" i( b' V' I0 Y app like this:- u$ a! Y- B# r
+ I* a+ [$ l5 x3 Z& J BPX exec_int if ax==68
7 G$ G7 b% n- P4 J+ W (function called is located at byte ptr [ebp+1Dh] and client eip is) J; K% [6 ?4 ~1 B3 ^
located at [ebp+48h] for 32Bit apps)0 F; J/ D1 p* a; Y, U
__________________________________________________________________________
1 X4 N5 k7 X! K$ E6 V, ?
5 I v7 O9 M7 K
4 O; `, m! e4 }1 JMethod 08
6 P$ r# @: d: g" Z5 X=========- L2 b+ c. X, |. C2 \' y: ] C; W, M8 E
7 W& q! h3 K. X0 d- }' z9 n
It is not a method of detection of SoftICE but a possibility to crash the
8 Y: w' u+ a* Qsystem by intercepting int 01h and int 03h and redirecting them to another3 b+ V. f. L( Z0 U- U
routine.$ o+ _; W; p# R* K
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 `: b% d1 c8 ^to the new routine to execute (hangs computer...)& a/ }$ T3 \) m
8 K6 U s4 Z3 m: u% T( C* q mov ah, 25h J, P0 n! b8 Z' j6 r* s
mov al, Int_Number (01h or 03h)
I. T) D$ X7 Q9 E- b+ ` mov dx, offset New_Int_Routine G+ z% y# Y9 c U2 K
int 21h
" X9 M$ I* ]: h& u
3 @" w- u; ^! [# R, w y__________________________________________________________________________
' l1 x: b4 T5 i2 i& ?5 [
6 y0 |2 y: b$ k( X$ Y. Z% v# E, g' Z( \% AMethod 09# Y+ X4 _' U/ X5 o
=========
" P& P2 _) r% I' o& P. O
/ L! {) J$ O: h7 L. U' Y7 \This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only4 t( w" _5 M0 P9 g5 P
performed in ring0 (VxD or a ring3 app using the VxdCall). l2 g) {5 u2 _$ A2 V) g
The Get_DDB service is used to determine whether or not a VxD is installed
O" H2 b: |# l6 W* p/ n' ]for the specified device and returns a Device Description Block (in ecx) for
L! |& }0 s2 Q$ y3 Ithat device if it is installed.
4 t% ~1 } [2 S/ |
& K& V+ ]$ b9 ^, a( }4 `/ Z9 m mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID' i0 o, i; W q
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
5 s1 f3 L8 @6 |. Y3 B0 K3 D VMMCall Get_DDB" W8 Y% l. K9 m# `9 J
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed0 L: m3 K+ g" I' ~+ I* V( b8 Z
7 ?! Y3 W3 ~0 L! |) e0 v7 cNote as well that you can easily detect this method with SoftICE:
3 \; Y+ a- Y% [- k; }% S6 V bpx Get_DDB if ax==0202 || ax==7a5fh- A- A2 n+ w# C7 s
4 A. r) p) w* z% [7 a__________________________________________________________________________( \0 o+ U4 h; j6 X- e; \8 [, S. k+ S
- y- D. Y) l% q6 t! Q$ B# b
Method 10; `9 [- }/ A. p, |, ^
=========
2 Q H+ P$ E6 I
! w3 v. }" B( v! U0 g) H q3 c* M, Z( ^=>Disable or clear breakpoints before using this feature. DO NOT trace with
; |- g/ M/ ]1 m0 y" | SoftICE while the option is enable!!9 c; n3 P# I9 E' A
4 R6 q' L' X( w; ^" n# zThis trick is very efficient:; M& f& F4 [: ]* Z- c! {
by checking the Debug Registers, you can detect if SoftICE is loaded
: n& c2 d( L- j0 h/ Z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
4 x& x; c; P G8 [there are some memory breakpoints set (dr0 to dr3) simply by reading their- Q+ M& O5 @: O# X! n
value (in ring0 only). Values can be manipulated and or changed as well7 c, c6 U: I* w9 K
(clearing BPMs for instance)
4 e8 p- q ~3 h, c+ r* M9 W/ K3 Y. {
__________________________________________________________________________
# A- n# y: w0 H( ^
; U& q5 G( F3 V- ?) b$ C3 m" o( PMethod 11
7 z" R4 t3 A2 E {/ Z& U$ B8 l========= Y, B1 V7 A9 e3 R5 g" j" S0 b
( J7 Y# N* _0 Y7 \# @/ ^This method is most known as 'MeltICE' because it has been freely distributed
& _; w' y" c- M0 T& X: U+ H) g* Xvia www.winfiles.com. However it was first used by NuMega people to allow
* K8 H! X6 {0 T' ySymbol Loader to check if SoftICE was active or not (the code is located8 ]; o( E8 X0 _' L2 g6 x- z
inside nmtrans.dll).
1 H, }! }+ n2 f6 A9 J
, {& ?2 n9 D. Z% o6 u1 a: WThe way it works is very simple:5 }0 B* w6 W. h7 a1 S$ Y- ~! M
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
3 K* h6 G1 S5 {$ w2 y4 s1 X3 ~2 gWinNT) with the CreateFileA API.4 ]9 [' A/ C7 D7 {' d7 @
2 S+ p0 _; C7 p: U7 h4 s8 c; PHere is a sample (checking for 'SICE'):
) R: p% Y& S5 \0 @( M. i1 O
2 O" }7 U+ m4 M, }# `- I# N6 FBOOL IsSoftIce95Loaded()
% S6 X& w! ]" R. S6 V1 F3 Q7 ^% ~' m{1 j a- L0 J8 P8 ]0 P
HANDLE hFile; 6 g2 ]) a: H! r! r, ?( V- f. Y
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
; _2 p3 J7 Q2 g6 m% i/ f FILE_SHARE_READ | FILE_SHARE_WRITE,/ c8 S- `0 H; H. L& e7 ]
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);- Z2 u0 X3 O, A% R0 u
if( hFile != INVALID_HANDLE_VALUE )
) a, J" @! G9 ]( D {/ k! p0 ~1 {/ r, Q
CloseHandle(hFile);
2 _+ a& C$ r; i/ }5 U) [2 C return TRUE;
; w4 e- ?9 W9 y) x$ T8 ^: O( x7 j }$ u0 U$ m3 ?" F5 F
return FALSE;+ |5 G6 [( k# o1 Y }
}$ C2 d$ v/ J5 V6 i# w
$ U- e0 C1 P% Q, r/ kAlthough this trick calls the CreateFileA function, don't even expect to be3 x4 F3 e: |* S2 n+ S4 [. w
able to intercept it by installing a IFS hook: it will not work, no way! D1 R' H6 |, {
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
& K& a2 Q* O8 ? kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" G' }, x( f$ M% m W2 v. N- A. } ~and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 }3 Y6 l3 a( a7 {8 kfield.
: K5 a E. ^+ KIn fact, its purpose is not to load/unload VxDs but only to send a
/ n% e9 M A+ MW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 f5 S( o' U5 w+ N1 }6 l( H4 u$ b
to the VxD Control_Dispatch proc (how the hell a shareware soft could try5 N6 T. ~2 t1 ]) W3 j0 @
to load/unload a non-dynamically loadable driver such as SoftICE ;-).: F: O5 Z( D8 a/ j5 n A$ x
If the VxD is loaded, it will always clear eax and the Carry flag to allow# B; R1 Z* C; z1 t5 j6 y1 A4 a
its handle to be opened and then, will be detected.
) ]6 m e7 b0 e' ~& h8 S# {You can check that simply by hooking Winice.exe control proc entry point
8 G# u* m$ r# }' Y0 @while running MeltICE.$ @/ b( A1 k5 O1 h3 j. v( B6 G6 l( D. v
; v7 U+ E* R2 g1 G8 K! T& k* p) y" A" Q+ n
00401067: push 00402025 ; \\.\SICE0 O( ]# i- y1 q9 r M4 y
0040106C: call CreateFileA
3 q8 N; @2 [$ }8 `1 A4 B$ v 00401071: cmp eax,-001, j: B- L/ X+ s2 b% `
00401074: je 00401091' N. [9 x$ E7 H C$ x5 u
0 |* N6 y; m9 a! f* P4 g& I7 [
4 [0 [6 {+ o; v' \! ^/ p
There could be hundreds of BPX you could use to detect this trick.
4 V; z* E9 U# l% R-The most classical one is:( \' M5 S/ v* t6 h# v6 y
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||/ E8 `: _- S& s0 d& Q
*(esp->4+4)=='NTIC'
1 V4 m! P2 q+ I" Y5 D T- C/ u( {4 j
2 V4 H% D, Q7 v/ D& {' ~( t+ n-The most exotic ones (could be very slooooow :-(
9 E Z- v& s: n/ D7 U6 S& z' Q& h: l. j BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
% v) C* X+ _' z) c) h; p; d ;will break 3 times :-(& e/ ]0 i5 s$ a" q2 w% G; a" @) f) X
; a& r, a, T* L j( p! I1 M-or (a bit) faster: " v# ^0 g- K" F- Y/ ]1 U7 r6 U
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')8 [& v9 h5 F4 G( d( B
# e) }! P4 E! Y/ @) y$ g$ l! v BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'
" ?$ N& f& g; s' S/ ~' j; y ;will break 3 times :-( s0 F3 o9 M7 |/ F; p# g+ n$ i
6 c! J* Q+ ] ~7 d' s& S-Much faster:
7 X& r6 y& O( ?6 V3 A: |& h( M! {" P BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'( s2 o" o( O( j; g( z4 w/ n
H3 q7 V! r4 MNote also that some programs (like AZPR3.00) use de old 16-bit _lopen) a$ o9 i. ` @6 t; x2 U
function to do the same job:, r% j; e/ a/ A4 m7 p* K0 s
7 ?8 F! w; A3 M' {0 ^ push 00 ; OF_READ
# R; F5 r8 H! t/ x7 b' u mov eax,[00656634] ; '\\.\SICE',0
/ @- j& _( m+ S! R4 \- z, P push eax/ c0 N' e/ l1 b+ n& m9 D8 k
call KERNEL32!_lopen
0 Q7 @& ]- j# W. c! X inc eax% [" k4 I# T1 P
jnz 00650589 ; detected( Z! D6 E$ j* y0 n9 S' C, \
push 00 ; OF_READ
% N4 s% |, w) {, S n mov eax,[00656638] ; '\\.\SICE'; t+ \( j; q* F4 j5 L
push eax) t' y; p3 x: e4 m, l
call KERNEL32!_lopen
: }6 S3 y. x1 s1 | inc eax
+ |& L$ A( G* V3 y8 ? jz 006505ae ; not detected
3 e: l; Q' Y/ _' q5 z- ]& r, h( ~" {( O% F3 f
# A% I% M$ E' Q$ B! f
__________________________________________________________________________
4 L" W2 h6 [1 K6 I9 t/ ~& b3 k' W
" Z* K! C. u) K1 v! wMethod 12( `' f1 M. j( J5 b( Q2 U$ f
=========
9 P: i8 k+ ?( M2 m" h3 a. D# A. R% t+ `! c/ ` p0 R. I
This trick is similar to int41h/4fh Debugger installation check (code 059 W3 y8 B2 \( ~9 @+ S9 k
& 06) but very limited because it's only available for Win95/98 (not NT)
~# W1 a$ [0 G, B3 u7 R# Aas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
! y5 u4 t! o/ t! S$ e
# l* F8 l# ~1 ]; |1 a3 ~& T+ @ push 0000004fh ; function 4fh) H; x* B" {% `
push 002a002ah ; high word specifies which VxD (VWIN32)" E9 F, C5 P. {3 `( {
; low word specifies which service, S6 x1 G1 [, v6 a
(VWIN32_Int41Dispatch)) k n4 [% ]' t% F$ |3 K
call Kernel32!ORD_001 ; VxdCall
0 C$ ^0 U8 `# Y& M! E cmp ax, 0f386h ; magic number returned by system debuggers
; v# c% z5 w4 D# X jz SoftICE_detected
- o( J# y$ h' Z) |! X4 [8 P; Y, d$ @0 ] W" ~; n
Here again, several ways to detect it:
, g ~; w: t: R! s
* E. m3 l' y! u% x BPINT 41 if ax==4f* E) h o- u$ J' R7 |
1 ~9 y% N4 k0 j$ Q3 H BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one( G) l, y) }2 _* f. _' Z3 R
8 N P8 e4 z5 ^' U7 M BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
% p6 ~3 A; q$ f
e8 e% X% L& o' s3 \+ P# y* ] BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
l, b& A& R ^% ?7 E0 n# B \ ]7 s/ C: N( s+ ]+ U; p" w
__________________________________________________________________________& Q w* i5 h" I( Q& N0 L
; o+ A. ^5 r+ e
Method 13/ @6 w) i2 j# F
=========6 g2 d" l; B% f+ `
* r( {9 V; g7 k1 j) _3 YNot a real method of detection, but a good way to know if SoftICE is0 G$ ~- ^# ?8 A* j* t; _! g
installed on a computer and to locate its installation directory.1 i6 o# @3 b* p3 n" M
It is used by few softs which access the following registry keys (usually #2) :
/ J1 q- J$ w: Y/ q! ?* E4 V
0 K' q* R2 c! {# o. _8 n4 o-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 F3 l( m1 x8 ~. U" f/ L
\Uninstall\SoftICE
! R6 M; ^3 |$ g! N. z-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) S' T9 ?+ c9 a0 D2 q, G$ T-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! r/ f( a+ F( D6 W0 V! R# d# W\App Paths\Loader32.Exe+ A7 X# }4 I. E! ^
7 v; V$ p8 C% E8 y
& y6 W7 Q- G: L+ S' d! j3 M9 TNote that some nasty apps could then erase all files from SoftICE directory
1 g7 r6 |% `( z# b(I faced that once :-(7 w. U% c! \0 O! N8 G/ }
" b8 m' I* c; b7 Z
Useful breakpoint to detect it: B$ |# E# }4 u2 c5 Y3 I% ]9 Y( I8 N
& W' ~8 c+ g1 S' K5 z! m) X" U6 Y
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
4 V( T6 ^ m! |$ _: k* H" H6 A7 K
& C/ ~& W2 \" v$ S+ I__________________________________________________________________________
: Y/ o# h8 K0 T; l4 N
( M3 B% m( ?" F) @! ^3 A4 r
( S2 _7 L" {, LMethod 14
$ ]. u& N- [. ?6 g6 \=========
5 O6 C4 U9 K+ ^$ }% y1 S2 v
. }+ t# o& b# WA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
$ P, [7 t& n: o3 h( eis to determines whether a debugger is running on your system (ring0 only).5 j( } `' G: n! ^0 f! C2 }5 h, v8 N
% g$ X# y0 v! d$ [# u VMMCall Test_Debug_Installed
0 u) r6 m7 B: d1 O6 }5 Q je not_installed/ y' d# S {! g
3 V# z! N7 P1 R! L
This service just checks a flag." h& D4 _$ e6 C6 x9 C
</PRE></TD></TR></TBODY></TABLE> |