About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
8 [# o" ]: q. X* k, Q8 [& k, S3 n6 W  v/ s<TBODY>
- T  E, W3 Y* w# }5 Z<TR>( `* f& e) B1 k
<TD><PRE>Method 01
1 }# {/ d# J6 K=========
4 A8 L# L: Y" I! c7 K; H1 [( d8 @  G; }) s) u
This method of detection of SoftICE (as well as the following one) is
" X* w9 B4 b9 {& {* ?, X: Q' _used by the majority of packers/encryptors found on Internet.
. f& O5 q9 S- _It seeks the signature of BoundsChecker in SoftICE% k5 O$ }& w; x3 R; ?2 M

9 l; i( k' _  i' w1 V    mov     ebp, 04243484Bh        ; 'BCHK'8 M7 J# l2 `/ U3 l/ J2 L
    mov     ax, 04h4 `; _% Q  _: o6 Y
    int     3      
0 c* q$ [/ h+ b; g8 _    cmp     al,4% \0 S0 ?; ~' Z% u# A: P6 U7 L. e
    jnz     SoftICE_Detected/ j* j" f8 f8 ]3 T, H
- A5 R( W, |( V: _$ N& ]; W) G
___________________________________________________________________________
' X4 \6 R9 C! ^6 Z  \
$ j1 d  n1 R9 Q( @Method 02. P# E, `4 k& `; X2 N% @
=========
/ T2 ~1 _$ [+ ?1 _" q, a' N+ y. j# K9 C0 ]! a
Still a method very much used (perhaps the most frequent one).  It is used; D; V, ?& A! q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,: K4 d( }9 q5 d# b2 {# Q% W
or execute SoftICE commands...
. F" z1 O7 q9 O) L: yIt is also used to crash SoftICE and to force it to execute any commands9 U  x, M, t- D, [' M& L
(HBOOT...) :-((  
/ X3 I4 g9 n+ T
+ q! J+ q: v6 {! E4 B4 YHere is a quick description:$ L4 e2 D& x/ V
-AX = 0910h   (Display string in SIce windows)! W, a/ N* T1 m* |/ \
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)) G& T3 B3 u! b* t; m% o  H
-AX = 0912h   (Get breakpoint infos)" L( ^- ~9 g' b, N8 @0 a8 M
-AX = 0913h   (Set Sice breakpoints)% L0 g4 [8 |# H( ?5 I
-AX = 0914h   (Remove SIce breakoints)
8 v* ~0 V* _( A( n( T4 a
9 e9 U/ G9 ^3 T: J% }Each time you'll meet this trick, you'll see:
* Y! E4 Y3 F# V( U2 C-SI = 4647h) H6 [) ~/ t+ ]  ?; O
-DI = 4A4Dh
+ [/ e0 n+ T- r" R6 N9 z9 t! ?Which are the 'magic values' used by SoftIce.
& G$ i, v7 K5 q2 V' JFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.) O/ e% x& x% r; J2 e9 z0 X. {
0 |7 M1 K% a3 G5 o0 z) J5 A- a
Here is one example from the file "Haspinst.exe" which is the dongle HASP
( o' w. F5 L! q% }( c' NEnvelope utility use to protect DOS applications:
% H7 h2 P1 y! ~2 o& o5 ^9 y1 v$ G* a* A

: o4 z; w  o) J5 `% C+ `+ o4C19:0095   MOV    AX,0911  ; execute command.3 F/ u7 C$ L& w; j' C( @! {
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ l! Z- K1 s8 x" Q8 {- R( e& Q4C19:009A   MOV    SI,4647  ; 1st magic value.
  s+ Z' w" h( n( p* I4C19:009D   MOV    DI,4A4D  ; 2nd magic value.! }2 R5 n) H1 H% n, g
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)0 F1 f$ u; {6 Z8 |$ `+ b; W
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute3 t/ \" y& C# h# ~" N6 I- a. K
4C19:00A4   INC    CX
, k# i9 i# [' S# T4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
! I8 _+ j  r, H" b3 x' s4C19:00A8   JB     0095     ; 6 different commands.5 {8 h  a; ]/ [8 l. d+ L
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! `$ C& E+ `% U4 U
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
1 I! E! U, t0 Z' C2 i) L5 h, |( r! z$ y. r+ R# w0 ^$ h
The program will execute 6 different SIce commands located at ds:dx, which
8 |. Y" p  {2 k) k+ U  gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.7 K, Y" s. s/ R$ N. Q' b+ u8 {+ {. ]

# s  j' _( F# Q0 e* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
! Q7 E: \0 p4 o- K: Q" f% |# Z___________________________________________________________________________: Z2 M( T: h: P; b; ^1 h6 q

2 l1 g6 o- k( B1 d' v
# O: B0 ~* C9 R  q3 x3 g8 EMethod 037 n2 _4 L! v4 J
=========& M9 N* p. y- V! o0 l
3 Y- v$ c5 v: t7 J+ Q6 Z
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! \/ x/ f+ t7 L* J6 X(API Get entry point): T2 b7 v9 U- J) p  w1 r/ C
        ( S, B, V! g- s( c: S& t+ |2 I
6 G5 Q3 K, c9 f
    xor     di,di
- b5 \8 L( @' X8 Y    mov     es,di
" q3 w9 J. R8 J2 K/ e    mov     ax, 1684h       * _8 e- E, q7 |4 E' f
    mov     bx, 0202h       ; VxD ID of winice+ ]4 X, _- T6 u6 k8 i1 q6 S; l
    int     2Fh
+ y+ M. j8 ?$ t) ~& M; D. N; Z8 w    mov     ax, es          ; ES:DI -&gt; VxD API entry point$ c8 ^' T5 l) b# r5 h) O8 |! s( w
    add     ax, di
, e* J$ I  }: \$ ^, a3 \$ W2 f    test    ax,ax  ^# Y. w& D* W" ?. H' b  E
    jnz     SoftICE_Detected
' }* Q% x/ {, y# y& J9 O" }0 W& d8 ]- X0 a1 O7 p0 {: X7 A
___________________________________________________________________________: V& `# y0 |) k$ y3 m
' K$ b- i+ D' M5 x! R. C& j
Method 04
5 f! `- X" K0 j# b=========
$ V1 O: c: V9 U5 E
- y" ?4 |; ~! J6 tMethod identical to the preceding one except that it seeks the ID of SoftICE. x" z1 V( Y% H9 Y' U$ F0 ?0 D
GFX VxD.
; M  H+ ^( X, a; z8 f; E3 Z7 S3 A3 i9 f9 e( {. T% Y
    xor     di,di% V, L8 \; o. F  T! O8 c$ K
    mov     es,di
6 Q0 s% ~1 E/ R8 o  J3 w/ v    mov     ax, 1684h      
' S$ N. T  j" b8 R4 v0 d    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 @9 C1 z+ ?7 w! h
    int     2fh/ R+ q9 b" n  A
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, {( v) s. K5 e. Q1 P: K4 W    add     ax, di, o' s" Q) n! p1 d4 H
    test    ax,ax* K' \: C, K* J" I0 u6 i; t) F
    jnz     SoftICE_Detected  t9 w* c. `% [

- t; |( X; v* H__________________________________________________________________________& r7 E  X0 H$ j/ z' G
( c6 f# V( b7 J

7 h% j( o  z9 `& F) C4 Y6 ?Method 05
; {5 v$ a# H/ U& E! D- M9 w5 `=========8 ~  H' j6 `* q2 x
$ ?' }5 z4 P0 y% G* j5 Q
Method seeking the 'magic number' 0F386h returned (in ax) by all system
5 F$ p! t/ f3 g, h: [debugger. It calls the int 41h, function 4Fh.& [. b. }2 |5 ]
There are several alternatives.  
% o1 W2 u( j" S8 u% O" _, u, Q- }! `7 ~, F
The following one is the simplest:7 `0 s6 ~3 \% {' e( [9 S' K
6 z9 s$ j6 T$ `, g+ T
    mov     ax,4fh9 J' s& X* g. I0 Z" k/ v' `
    int     41h
: @, H% s. \  ]    cmp     ax, 0F386) l4 Y* o, T' \9 s3 C8 ?/ p
    jz      SoftICE_detected
! y3 ?0 Y  a2 G" x$ I) c' c: H3 j
1 D' H. r2 R. F* e( K% \$ |9 f3 b0 \& _  Z: P1 Z' h
Next method as well as the following one are 2 examples from Stone's
0 m7 T+ n5 N7 e* D% X2 y9 J$ _7 B"stn-wid.zip" (www.cracking.net):
9 M" d+ ?! N- }) I% I" S
5 T0 W4 C6 ~7 N  z! y. ]( Z    mov     bx, cs5 C9 }. H7 P* b0 L* W) F0 ?/ l* k
    lea     dx, int41handler2
7 R. b8 q. ?9 c, N. e    xchg    dx, es:[41h*4]; m+ p7 E8 T6 N9 `
    xchg    bx, es:[41h*4+2]+ O# ^, e4 x  Z9 i! R
    mov     ax,4fh
. F2 \- H! k9 p: l# S, [& o    int     41h
- D5 B9 u' Y" \9 o    xchg    dx, es:[41h*4]
% h% f3 ]8 d! C$ k2 L    xchg    bx, es:[41h*4+2]! K! b. n: g" N# S7 r6 L+ R! `
    cmp     ax, 0f386h# u5 c$ c: F8 G7 O8 O3 [
    jz      SoftICE_detected% l) c; T: t# h) l6 e
" u" R5 n2 j; I/ M4 w0 x- s
int41handler2 PROC
5 n1 b) I. C! X6 N3 R1 p. P    iret9 f- t) A/ G3 g2 e; Y
int41handler2 ENDP
2 c" X7 p% Z  h' Y: a  u/ d2 P, X- z& ^$ C. {

6 \! a0 {/ Q6 L; x- S_________________________________________________________________________
4 m7 D. y9 F5 \: u  i- x" U7 X  Y" k, Z% n
0 R& k* E- ^7 q+ v$ [% U0 h
Method 06, i1 @/ G  X1 I9 L: n1 P0 z
=========
# `) a2 N; w1 M& _# U; ^4 b( z" k( o$ u; O6 b, e  ?

6 L' }% `, \9 S! [7 L; `2nd method similar to the preceding one but more difficult to detect:
/ R: U$ N3 X  O( U" x3 D
# W! I. o% e9 E# S  p( O8 ^9 t
( L5 Y% {# i) F* C% r+ zint41handler PROC
. \- ]1 G8 E' D8 S    mov     cl,al+ r$ `$ H5 X( m
    iret4 O$ u4 r  L; W  M% h! }) x- `# n& Q
int41handler ENDP
" v) Q4 P7 Y- n* Q/ y
' `4 m  s# J9 J# n$ x" v9 j+ C# n) D/ s1 \& G2 y7 t6 e- V- ]* m" G! ]
    xor     ax,ax
, f# ~, q$ J# s; t3 s; j6 P    mov     es,ax5 T+ g/ N9 W& v# T6 }
    mov     bx, cs; D* O) w$ \- H0 m7 \
    lea     dx, int41handler6 \$ d5 P  a1 `1 T: {; m4 v
    xchg    dx, es:[41h*4]2 h/ I. c8 p; _' o$ F& u
    xchg    bx, es:[41h*4+2]
$ G  X# A) B- `3 E' W9 w8 i    in      al, 40h
) Z& i1 `: U% I- G2 y! c    xor     cx,cx- U* K+ G- m$ q; J# v
    int     41h' o, L: @! N9 ~; W: c
    xchg    dx, es:[41h*4]4 d. ~- n6 H+ D
    xchg    bx, es:[41h*4+2]+ E1 |* k) g! Z2 Z; o
    cmp     cl,al
/ l% [: g/ x% M* `' E! c: D    jnz     SoftICE_detected  i7 R4 E! p$ [. W7 V  c6 D: F/ p$ M
5 u; x$ D$ Q; t; L3 F6 o& G7 m
_________________________________________________________________________
: f3 [% i' z4 X" Y0 t: W2 x4 s4 \. L5 q1 ]# f. E/ I
Method 07/ y) W( f( z. W8 B
=========
" u# R# X  k0 w
% r0 w! @) Z0 ~Method of detection of the WinICE handler in the int68h (V86)( N) P( q- g/ N$ `; b
% R# u# L. R, h2 O: g, A6 P* R% C
    mov     ah,43h
1 C' h! _+ ~" P; L    int     68h! @, u  `; w# i1 b$ \
    cmp     ax,0F386h' S% D* \& c* a9 E; n6 V+ U4 Z
    jz      SoftICE_Detected
% p: e2 K* I2 Y" D) }* r' a+ @- `+ |
, d, c5 _- Z( F3 b2 K- o! o
' f# S2 ~9 k% i+ J=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit: {( i+ R7 b3 m- \5 [( E
   app like this:
& W* t; U' t* p7 q8 I& w, E7 l! Q3 A5 X4 J# [+ U9 p' `, ~! ?; _+ e
   BPX exec_int if ax==68: Y) N# ]5 P- V) s4 |& r
   (function called is located at byte ptr [ebp+1Dh] and client eip is5 N2 L7 V: ~/ J2 t, r% G, B( x9 v
   located at [ebp+48h] for 32Bit apps)5 I6 }0 Z5 V' Z2 s& C( u  s6 f
__________________________________________________________________________
3 z2 C6 o; N+ E  s; J, ?
; d, \, t$ W  J; b+ o0 C4 }4 f! a& W% D
Method 081 z) N+ M3 r* h5 i: E3 Y4 f- C. P
=========/ @# O, a% R0 M. Z2 x+ z

9 B* W& [; T% C$ g% D8 L% hIt is not a method of detection of SoftICE but a possibility to crash the
8 y8 Q5 \1 I+ E7 L% |& Ksystem by intercepting int 01h and int 03h and redirecting them to another
& @, r& C9 S  rroutine.' A+ d3 D! \& t- s% ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- r, L$ k! e2 n5 @6 y
to the new routine to execute (hangs computer...)2 Z- ~, R, ]3 p7 Q" q
/ b+ w1 q: W) U5 [" k: J
    mov     ah, 25h. H, h1 G' N% v. H) W5 a
    mov     al, Int_Number (01h or 03h)
' R  n# a# z* _1 [# x. r    mov     dx, offset New_Int_Routine, b. n; a; h& V/ ^# e5 ~+ \
    int     21h+ A5 C+ D. n0 B" Y

! a) J0 W/ {* n. Z* {# l__________________________________________________________________________
" y, l7 q2 d6 t2 [9 R# D$ J& o0 r. z
+ y1 |( ?* J' j* n6 gMethod 09/ X. h% v) y5 A
=========
; V2 y' b& A4 T$ P4 ?. V
" I) p4 K; l8 {. XThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
1 X6 f+ n' O/ Z1 l  U! P1 f5 a& Iperformed in ring0 (VxD or a ring3 app using the VxdCall).: z4 A* ]# ]2 A4 b
The Get_DDB service is used to determine whether or not a VxD is installed
& q! l: [( U- u# w, T+ T% dfor the specified device and returns a Device Description Block (in ecx) for
4 j4 O/ W& N) T7 V" B$ dthat device if it is installed.
7 S  I, `2 m8 {% {/ x, _+ p9 I/ P, ?  P, P
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
/ v; O3 {% ~- x% y' l   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
& J( D( y4 g8 K+ d+ w5 w  M3 q% Q   VMMCall Get_DDB
; W" X) U! F  H  }/ X' s   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed7 N$ d/ t4 q/ C+ Q0 H
7 d6 ^$ Z* T: h- x3 s1 J% f- p
Note as well that you can easily detect this method with SoftICE:
9 h8 i) g' ?4 f$ M# ?0 s   bpx Get_DDB if ax==0202 || ax==7a5fh8 z  v( k( ]2 J4 d- E1 M5 d
+ ], N% E- u& v# K; Z: H
__________________________________________________________________________
, b  }5 M: _/ A* j9 ~0 S9 {! q% c, F$ f; ]! a- B$ ]- o
Method 10
7 K. d' O+ [0 Q; F# R, W# V=========
) ^+ H4 E- R+ Q! r1 {! q6 x; L1 v8 J% W4 H6 f) w
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
, ^+ L! n" g/ w4 ~5 V' W' _& J  SoftICE while the option is enable!!
: L  Z) A  }# V, D0 F5 `. b+ T8 l  b4 r
This trick is very efficient:
! o$ @9 U# P' Z: [2 A* |# Q2 F, D4 Nby checking the Debug Registers, you can detect if SoftICE is loaded/ ]6 d$ K% A0 [7 a- A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! y( W% y# H" ^there are some memory breakpoints set (dr0 to dr3) simply by reading their5 A  c) y9 m3 h! Y- ?
value (in ring0 only). Values can be manipulated and or changed as well
( q8 e- f9 `2 H8 z1 l+ \6 m(clearing BPMs for instance)$ A5 m1 a9 b/ B
! |% b8 B& r7 c0 S; H7 M0 N8 ]
__________________________________________________________________________! ?$ g! ^. l! Q' |/ l2 x2 w

- k$ c2 f7 b/ X8 q7 v- q4 X. b: M/ gMethod 116 @% ?4 J7 P8 l2 a& M
=========4 w' s. m" m2 M/ ~4 F

" B+ l, U0 k+ _This method is most known as 'MeltICE' because it has been freely distributed; W* U& [' ?( ]1 e$ ^, x
via www.winfiles.com. However it was first used by NuMega people to allow
2 W: [" m$ C- w/ o8 n! u3 o4 SSymbol Loader to check if SoftICE was active or not (the code is located
3 P: n( y+ n2 i( |: [inside nmtrans.dll).
& W# P5 t  ?, X& ~+ F7 {7 A
0 k9 A0 h9 y/ c- J4 H9 o- P+ \The way it works is very simple:. S6 w( d' C" s( P- N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 \, Y# R$ C9 e
WinNT) with the CreateFileA API.
. t' l9 T; U2 `
8 z! l/ @9 s; R6 fHere is a sample (checking for 'SICE'):
' {/ p4 b% D* k3 r+ d% V
% e" ]/ c3 z9 R8 J7 Z: X- D" ?( WBOOL IsSoftIce95Loaded()7 X9 X' ]* W+ {4 |
{
) C7 Y! z5 R+ x   HANDLE hFile;  
( F( I7 d8 d- k3 G9 n   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 n) G) p; z; c9 c, X1 Y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
/ k; \' q: d' \) s                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);0 X3 V/ V+ {( N+ a) q
   if( hFile != INVALID_HANDLE_VALUE )& k* [1 F4 j" B  N6 S
   {( X6 v: {3 F# P; A% J" p* ~0 O
      CloseHandle(hFile);1 O0 B7 Z/ \9 h
      return TRUE;% c- Y- w  R$ A& p
   }
* \, c! H8 }) y   return FALSE;
6 t1 S: p6 N/ j' Y}
; M$ d% k0 Z( v6 N* b- `0 k
7 M1 I/ O" g' O* L& Q: LAlthough this trick calls the CreateFileA function, don't even expect to be. i. @* {7 H$ s& W; \, a* B* @! h9 [
able to intercept it by installing a IFS hook: it will not work, no way!$ l6 Z5 B9 a, t% }  Q3 N& r
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
) \. g* ?1 c% ~8 a  Z4 v1 kservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( ?' G# M, E2 e) M( _4 w  kand then browse the DDB list until it find the VxD and its DDB_Control_Proc8 f4 Z- N. e  |" S- O
field.: {& b! F6 I/ R$ O9 k
In fact, its purpose is not to load/unload VxDs but only to send a 2 H" \% i. t: Y0 ^5 E$ g
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 T, u. @2 B( h0 B7 [4 s4 r6 }0 _to the VxD Control_Dispatch proc (how the hell a shareware soft could try
* M7 {/ Q6 N4 ]3 T0 r3 y7 Pto load/unload a non-dynamically loadable driver such as SoftICE ;-).
3 P0 v8 R  v$ I0 ]If the VxD is loaded, it will always clear eax and the Carry flag to allow
* l7 ]  M4 \( Wits handle to be opened and then, will be detected.
; o; }( p, ~5 K7 v# ~/ `9 UYou can check that simply by hooking Winice.exe control proc entry point
0 ]3 b4 V& X4 `/ Q0 d7 A- Mwhile running MeltICE.
1 K9 n: N/ `* y4 ?7 q# S* ?$ h' w0 g
! D3 G9 J( ]" ]/ U
7 @* E0 `6 R& W  v% ?) w  00401067:  push      00402025    ; \\.\SICE
2 i0 X4 A. H4 J3 H" t  0040106C:  call      CreateFileA
; B- `. [6 j6 U1 {, ?, g5 k( o  00401071:  cmp       eax,-0018 K6 R; ^/ ?* l9 ]
  00401074:  je        00401091& _+ r  t& C$ F+ {3 K) v- L% j) R; j' \
% w: S+ g+ j9 h5 V$ @
. q/ {. N' J1 e7 a
There could be hundreds of BPX you could use to detect this trick.
7 w5 R) Y9 G5 _4 N-The most classical one is:
  S: \# ^+ O0 s! M+ o2 O6 J  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
# r4 |% I) v6 _: P3 B    *(esp-&gt;4+4)=='NTIC'9 D/ D1 D8 Y1 g; ]1 |* I; u
. E( N% u/ d; F) e+ q; S, u  n/ ]
-The most exotic ones (could be very slooooow :-(4 M5 }$ f* b( E# y: D
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')    y: v' P. C; L7 f
     ;will break 3 times :-($ q& {2 Q: G0 R, t! y$ Z8 ^

  J* F' \& {* F) v-or (a bit) faster:
8 V4 ?2 Y) L9 H$ v1 _/ m$ X! E7 ]   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')  x- u' H& C' G' V
9 z8 `  M  Q: M+ S& Y9 U. p, V
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ! j& j5 w* O. E! F1 w
     ;will break 3 times :-(# w" F* S; v! e$ Y, Q9 g
8 @- ]. A6 F; O, Y" d# }
-Much faster:
& d! x/ R0 ?. M4 u: R" _   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'9 h7 {9 M- K1 E& O! [. ^* g/ J
' S' C2 R0 q' @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
8 V9 J% f' N6 h+ c6 c! }) }5 Efunction to do the same job:; U: j( U* g  k  e" T
% V4 v) ?$ g) K% `& N! c# p9 N# N: l8 H
   push    00                        ; OF_READ
; H2 e* J$ |* K0 v+ f   mov     eax,[00656634]            ; '\\.\SICE',02 f$ \% y) |# ~4 T* }" a
   push    eax1 W* R* M6 d6 ^5 x! P# |  f
   call    KERNEL32!_lopen
+ n2 @6 M  u& c3 r; V9 t   inc     eax9 P9 M7 p3 d  w2 w+ m3 }
   jnz     00650589                  ; detected" w, r% [, O, q# {& G
   push    00                        ; OF_READ
# Z; P' D+ @2 B0 _/ Q0 u   mov     eax,[00656638]            ; '\\.\SICE'
2 q8 \- r" q% P. Z. Y   push    eax2 G/ X1 V! u* G6 f0 ~; x
   call    KERNEL32!_lopen
/ T+ l( _1 j& u   inc     eax
$ l! X8 z9 l9 E% K: M7 T   jz      006505ae                  ; not detected9 s" L1 m% U: p% a4 v5 ?2 q- k5 F
! i: V" d1 D0 L+ V1 O; [

5 X9 W( \; v) V__________________________________________________________________________1 [4 ?  ^% ?5 g" ], r
9 n. P: C8 K% t& W' Z' F. g: ]
Method 12  Z2 p) X5 x) U7 T( j7 @
=========+ c, ?: z' N1 A5 `5 d9 m, [

, s  i/ K. C3 x; [0 F7 n8 @This trick is similar to int41h/4fh Debugger installation check (code 05
1 J4 D' v/ G$ ]9 U&amp; 06) but very limited because it's only available for Win95/98 (not NT)
3 c) Q- z) C% v2 yas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
- v) w8 Q! ]- L$ ~( E" z8 ~
9 N. d1 m& @& b: Q$ ]   push  0000004fh         ; function 4fh# L6 C* _5 B8 l0 T, D6 U
   push  002a002ah         ; high word specifies which VxD (VWIN32)5 w' U2 d2 _6 _4 H
                           ; low word specifies which service2 a; D; U' [% m. m
                             (VWIN32_Int41Dispatch)' j3 k' h; n4 x
   call  Kernel32!ORD_001  ; VxdCall' a7 [! Y, O$ x5 D. k
   cmp   ax, 0f386h        ; magic number returned by system debuggers, B3 d9 U' G7 {% |9 q# z
   jz    SoftICE_detected: y8 h9 `6 V1 S- ?* K: s: h
: g) ~  C$ J1 q
Here again, several ways to detect it:3 `  X( M; `1 V/ g- ]8 ^
, G) {! _* k$ m
    BPINT 41 if ax==4f
5 F  C7 u) Z3 R
* ^/ Z/ a; b! W% X6 D0 l" m    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one3 `% E2 z1 N! A+ o9 A

  [  r, ^6 C" ^" O' e: @0 V& C    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
, W1 K3 Q. i  e, ~: j0 k; h5 p$ W: U' E* F
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!: ^/ i# k. s  N: X% l1 }! {
! D( @5 J5 f0 Z/ I/ y! O" z8 Q9 _
__________________________________________________________________________
/ ~+ v; [: ]9 ~) w, o
; ^9 r2 I# [7 q. U" e1 ^. wMethod 13- r+ s, L3 l# o% f, ^" E( z
=========7 N( O" W: Y! Z5 C5 ?

9 K1 F: u, {0 [0 t$ q# L# Z+ HNot a real method of detection, but a good way to know if SoftICE is" D! Q/ p% a# W+ K" ]
installed on a computer and to locate its installation directory.- a7 J+ `, w9 A/ {
It is used by few softs which access the following registry keys (usually #2) :6 D& S: X4 S/ x8 u

' q' ~) k0 Y" s6 W-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% H1 m$ n8 d0 ~1 g3 i% R
\Uninstall\SoftICE
2 a2 a  t1 d* O: O3 ^9 x7 m  P-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' ]8 @; Q; B2 _: ?  t* n& `
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( Z6 r; D: _- m8 Z$ s1 Q; k
\App Paths\Loader32.Exe
2 I+ m2 g% r/ S; `5 d7 P3 l3 ]# p0 c2 y- F$ m1 D: j

# y9 T) C) t7 v: N2 R) n1 y: P, bNote that some nasty apps could then erase all files from SoftICE directory0 G1 d# C. E2 L$ W9 x4 l
(I faced that once :-(5 @' o0 y) R3 n) z5 K( R; o5 k  m

* ?5 U) Q1 ^9 o4 @  L) w$ v8 hUseful breakpoint to detect it:" Z0 A, [' M: g9 F* ]* X
. k4 E( z/ w6 X9 i1 X3 n/ q
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
6 N7 l3 W  |7 x% ]/ s" z/ \- o* W0 U3 B8 g1 a  W$ c- K+ {
__________________________________________________________________________& l- j, T  g; G6 P# J4 [) W
$ y% q/ E( F; O+ E

8 _; l' L0 M8 O3 o7 IMethod 14 ) H' x( C' s" P( W6 |. r
=========: [" i/ J9 I$ b4 P2 f8 J' z# }& h* r& _
2 E0 F) r) g2 t6 G$ B1 v8 K, t# ]
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: Q8 G4 n0 z' Ois to determines whether a debugger is running on your system (ring0 only).
! W0 m: z+ r) A/ J3 c
. w5 |2 S& R: v   VMMCall Test_Debug_Installed
( z3 K7 B. U7 e) g) S- b2 j7 L   je      not_installed1 a2 A0 t9 G1 X

( }" S1 X- V9 R+ J+ A* rThis service just checks a flag.
$ g/ G/ Q8 v6 y& H: l</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19052200号-1

在本版发帖
关注公众号
QQ客服返回顶部