找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>- b$ q9 ?4 c  R: f0 B
<TBODY>
6 ~* x" g/ U" u8 L; U$ x8 q<TR>
: H2 D# u4 i) `# t<TD><PRE>Method 01 ( x( n% O/ d( r# a" T
=========
! }; w1 k9 y; K  \. u' y8 ^# O0 f, c# U6 X* ~# h0 p
This method of detection of SoftICE (as well as the following one) is: t% n; |2 n# D2 R
used by the majority of packers/encryptors found on Internet.8 N% c5 h( ?2 E* N- }
It seeks the signature of BoundsChecker in SoftICE
  [( K9 [6 R" k- {+ m# x; y: X6 N# T! K+ t0 ?$ Y# a
    mov     ebp, 04243484Bh        ; 'BCHK'
) D( h1 A3 ]) k  Z6 J7 {- _  ^0 }' V, ~    mov     ax, 04h
9 _7 `/ P! c# q) R( A& E2 q    int     3      
" B' r9 f' h% _. D% O' C* v    cmp     al,4
4 d) h$ {% H% G; e& w/ r7 u, h. }    jnz     SoftICE_Detected$ V0 `. }0 d4 d$ M
1 \4 U) ^4 b4 h8 f3 ]
___________________________________________________________________________' f& n; z* q5 f9 \" X- Q
/ f# n$ ^6 g# ~- n
Method 02
; L: _% F: M3 s2 J* J" |=========# N* u! O+ V3 \, Z( D% B
& Z. P; P# L" m/ x# k' Y
Still a method very much used (perhaps the most frequent one).  It is used, {, p: d: Q* a+ N; l
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
# }, Q. E- b$ {2 K* h- cor execute SoftICE commands...
% d0 D7 _: I  Z. E! PIt is also used to crash SoftICE and to force it to execute any commands3 u) r$ v' l" c( k
(HBOOT...) :-((  , B- W8 Z4 f4 S9 _$ o
$ A: Y7 {) B% Z0 B# L
Here is a quick description:
9 H" z) O* l6 K7 V  S-AX = 0910h   (Display string in SIce windows), U5 [" b9 [; a) U4 }% s2 a
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' t3 ~& K( E' l/ }/ A
-AX = 0912h   (Get breakpoint infos)- B8 [' u0 |7 O& E9 H; ?# t
-AX = 0913h   (Set Sice breakpoints)4 b$ O* X, X2 J7 M" ~/ ?
-AX = 0914h   (Remove SIce breakoints)
7 V! u. }2 W& U4 T2 D: L9 c: U: j/ V7 I: H: H* a1 A$ \
Each time you'll meet this trick, you'll see:' D% U/ j: r2 A6 O2 }
-SI = 4647h0 J! ~/ C4 u- @' E' I' a
-DI = 4A4Dh
9 o% _% M4 a* K/ P1 a" bWhich are the 'magic values' used by SoftIce." I& ^! B7 L! i$ V
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.  J" ]$ Q( n1 d( \/ \
2 h3 f5 ?6 b! o
Here is one example from the file "Haspinst.exe" which is the dongle HASP
. b1 w" P7 [, k# E7 [Envelope utility use to protect DOS applications:
& v4 O9 |$ ?9 V  U1 g  A) {& o- x  P( `) c# f2 ^# P6 g. p; z

& H1 N5 [) ~8 P; B4C19:0095   MOV    AX,0911  ; execute command.  ]  U9 B9 a6 ~  g
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).8 C7 s9 ?  j) L) |0 h
4C19:009A   MOV    SI,4647  ; 1st magic value.
) X$ N8 I" F0 I5 l& w, S" q4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
7 v; F2 @# p8 v7 p4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*); h+ L9 L! M8 T0 Z* F5 g3 D
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 t6 B0 ?0 X4 Q+ K5 {
4C19:00A4   INC    CX3 o1 |; i8 U" f3 r6 E
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute7 X+ y& F$ X3 w7 z: o
4C19:00A8   JB     0095     ; 6 different commands.
5 p7 L9 |( K  M, K6 y+ Y  H5 A4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
/ w( K1 `5 C+ f1 b) R* @4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)5 j! [6 ~6 }+ l5 w6 O* {# M5 `
( K7 G! y% E2 F2 V
The program will execute 6 different SIce commands located at ds:dx, which
! J, ?5 p/ _% n5 Kare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
" r* z6 T; r8 N; c5 w5 _/ j4 X
( ~) @( c) y. v8 N' y, J3 E) L* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
8 y$ o  k* p5 k) \8 A9 y$ b___________________________________________________________________________
) }5 }& S5 B* N! b8 S9 c6 ]' s3 ^
) A5 |8 Q' F! Z0 D" e/ K8 x$ G* {% k0 |5 v. \
Method 03& {( D8 M- \  v' D  G; j% s# B
=========9 k! j4 i  l$ {+ c

6 B* x6 u' d4 KLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ J3 J; ?6 e0 D$ c(API Get entry point)
, m! s2 ^8 r) ~0 [9 [' b        + k4 W8 t$ H+ o

  v8 ~9 N+ k. A& k  Z; \3 z    xor     di,di
$ b8 H- @8 u, z) E4 m5 t    mov     es,di+ s5 f9 [$ ~. J% M( n
    mov     ax, 1684h       , d1 f# B. ~3 `! J9 s+ f
    mov     bx, 0202h       ; VxD ID of winice6 q' w0 B: _: g8 ]3 b$ {
    int     2Fh/ X3 e; q& P8 O/ }' ^
    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 t* Z5 s  \5 Q, i
    add     ax, di
# G. D6 z/ P! o# h5 e    test    ax,ax
. w+ k4 w% h! M, t# ?    jnz     SoftICE_Detected7 r, I2 b' \2 t" i2 L, Q

; A) j8 D" r$ {___________________________________________________________________________
' q* O* T" s: z- P% D8 Z4 l1 q  [5 M8 a6 S& |+ w
Method 04
: |9 `4 S8 u& L! _( a6 J=========
  X/ U, ]: d# _, s0 a' Y: l1 k
' T/ b$ s; {% \, D. mMethod identical to the preceding one except that it seeks the ID of SoftICE
" k' z% X5 ^% X$ jGFX VxD.
* Z6 `- o% \. E# O: c9 W, a9 p5 O
7 [; R% W$ ~9 A5 z1 r0 ^    xor     di,di9 h6 p3 h6 J4 u0 w3 a, ^3 Z. B' `/ O
    mov     es,di
  t- f$ r$ [5 @+ R1 q    mov     ax, 1684h      
5 `2 [+ a9 I2 k7 c7 q& w    mov     bx, 7a5Fh       ; VxD ID of SIWVID4 F$ W$ n4 p  o
    int     2fh4 |$ G' A" y6 t. ~: D
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
0 ]" O5 t+ }! I  v9 h2 j0 ^: G$ v    add     ax, di
; u+ G8 k1 \0 `+ d/ {5 P4 l    test    ax,ax* X8 W% k8 l- T( O9 C* w! p
    jnz     SoftICE_Detected( @4 Z) |# P' C6 n" S2 Y: i" @- N

7 d2 b8 @5 |' D; \. |" ]+ _! `__________________________________________________________________________
: O5 \7 O6 B" {3 Q4 u
" d3 k/ ~$ V" d: C' W5 r+ N( L0 Z1 g+ k; J7 }7 q
Method 05
. _; f- Y  w2 h; Q) p+ B9 e=========
; Z% L0 a5 T+ g: R; X( `
* r# x6 J5 y$ j- |Method seeking the 'magic number' 0F386h returned (in ax) by all system
- F6 ^$ V7 Z, {: z5 h! q: ~( ]+ Vdebugger. It calls the int 41h, function 4Fh.
" P5 F) I! @! K, F" T1 e: @There are several alternatives.  7 e' ~; Y. {- }9 `! h( P+ m
# M  P2 B8 ?$ F# d/ k( X
The following one is the simplest:
' Z" X& B$ p( j) T9 ^; f
( K5 y; h/ u- S1 v, N    mov     ax,4fh
6 p9 b& c& j$ P    int     41h& `; I. i8 f" H, Q4 A+ d
    cmp     ax, 0F3869 ^) a8 L3 [7 Y  d  m
    jz      SoftICE_detected& V7 p9 z; `' @- N! f9 @6 v' V

, u* m  ~- a4 U7 x! O
0 }7 b0 G0 O; P* e: |0 j# |% J4 Z" ANext method as well as the following one are 2 examples from Stone's
! ?& H! E1 J" P# B* Q"stn-wid.zip" (www.cracking.net):
. D0 m( k4 N- u4 {6 ]" m4 m8 I9 Y! O+ J9 E" M! F
    mov     bx, cs
) `1 S- m: ]( o4 j0 _    lea     dx, int41handler2
& O8 O0 g4 I- \1 j    xchg    dx, es:[41h*4]
) P5 I/ x* g2 G$ f    xchg    bx, es:[41h*4+2]6 ]8 c6 a; R4 U8 S! D: z: l) N# U
    mov     ax,4fh9 Y, G' J9 @! k9 ]
    int     41h3 C! f9 h* o  ?! C% ]
    xchg    dx, es:[41h*4]% L( i7 ?4 o9 q% {2 a4 I
    xchg    bx, es:[41h*4+2]5 e" Y, n# E/ W5 f
    cmp     ax, 0f386h
1 J- q; q, O# u* q. N2 S* M    jz      SoftICE_detected
- k8 i7 f( C- K2 l
' G3 T+ q2 g+ T3 r8 S. j7 h& cint41handler2 PROC7 L9 U; l* Q/ s  O- H5 o+ |
    iret
; H3 |% ?$ O* q& Eint41handler2 ENDP* ~8 B8 a. J4 p& w0 V+ |
! v8 s1 ~' }6 P  {+ Q% h

! t# I0 x6 A6 B* l* ?2 R/ [_________________________________________________________________________! Z) q6 T  z: }# G: V9 p5 M& A( h

# i2 _% h: p8 C5 C$ F8 q( Q3 N( j6 R6 ^1 ]0 h. H) l7 ]
Method 06
, J/ w, V" ]; k+ Q=========/ Q( P, P- I+ \1 a

  _% c  W" U% V- Q: i5 _
3 T+ F: |; \* B, E2 C" A+ G- i: V/ e% z2nd method similar to the preceding one but more difficult to detect:+ \" J! h0 p" T0 C  {
( @8 d3 v7 _8 f  r
0 n9 U( E' C) M8 @7 F
int41handler PROC
! E5 X7 c, ^/ v' ]+ w+ a. u4 ^" Y2 O    mov     cl,al+ z" A" u, Z, B2 D% e8 y0 z6 u" Z
    iret
! ~$ L: L0 h/ x1 _. t* |int41handler ENDP
' A$ i- B. ?9 u8 p8 \  G6 D" Z9 p. w$ W/ Y4 U

$ N% k/ ^0 q% W, X4 m    xor     ax,ax
5 ]+ b" u, z/ p$ l4 f" j: E& y    mov     es,ax1 p% J6 x* }- m) u9 Y& M$ F4 W
    mov     bx, cs
* t% ]. ~+ F$ Z& Q$ l    lea     dx, int41handler
1 \+ x! a3 t0 _3 m0 s* K8 E( C" v    xchg    dx, es:[41h*4]
; N; V% x' ^" x    xchg    bx, es:[41h*4+2]
0 V, a, l. a5 l# z. _) H7 ^    in      al, 40h
- ]( O' n: j1 V, l& v& J    xor     cx,cx
* F) f& H+ `* f9 V( Z    int     41h+ [4 [( D' R- y# Z+ d
    xchg    dx, es:[41h*4]  Y/ W$ c5 T' m, y; s1 R  ]! {, N
    xchg    bx, es:[41h*4+2]2 x2 |* L7 y1 k% J/ i# M# z$ `( y
    cmp     cl,al
# p, `5 r9 _% m: l% Z* d" m    jnz     SoftICE_detected( v  `7 q: a) @+ G3 r

- O) W3 ?6 {0 ?! x1 w$ u_________________________________________________________________________- F1 `# U# ]( q
6 T% E* c; c& r2 V, `' }
Method 07" s: T; A$ m9 e' |2 V2 h
=========
0 y- i! r: v( s: T9 f& h# \4 \( G9 F
Method of detection of the WinICE handler in the int68h (V86)2 @) ?/ V, R4 e, q

0 Y% Q  ^7 j: ?$ y9 ?( P    mov     ah,43h9 J# k8 Y. c' y" y% k2 [
    int     68h& z- U% e2 ?6 O3 P
    cmp     ax,0F386h8 @6 B$ ?$ X7 ?" ^/ V
    jz      SoftICE_Detected
# z- L- s+ E2 R  U7 d1 X1 h8 k, l' D

( u: E/ J5 [$ o. Z/ S' n8 |=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit" d+ u1 _, d$ p3 t# j9 w
   app like this:) |4 Q  ~" }) p

3 H9 i1 T. n$ @1 Q1 l( |! B- |   BPX exec_int if ax==68
0 y& V* A, B/ g) @& J   (function called is located at byte ptr [ebp+1Dh] and client eip is' p" p, r: _9 }* i) Q% X0 s: D3 G* Q
   located at [ebp+48h] for 32Bit apps)
4 u* X0 ]( F! J6 m  `% R__________________________________________________________________________0 ?8 i: s3 R- V
2 k# t7 O* q, \+ I6 `6 M
! \6 ]/ m' O5 c# H; r( J
Method 084 |$ x" W6 T* B4 c1 K' \. r4 b4 ~' A; V/ a
=========
' Z$ w/ c& g! m. t$ `
$ R1 n! C& t% g$ ~6 W3 _; T$ VIt is not a method of detection of SoftICE but a possibility to crash the
6 V8 t$ E5 J! s( Q8 Gsystem by intercepting int 01h and int 03h and redirecting them to another' y9 M( O/ `* z4 S6 J
routine.
, h  {8 c8 j7 ~" x0 b: U0 dIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
0 _  ]0 h. `4 vto the new routine to execute (hangs computer...)/ r" w9 d7 n/ d6 K2 A2 _* @
6 ?" U' y4 c, a
    mov     ah, 25h
/ v. H6 ?" Z% ^( s; w% ], \    mov     al, Int_Number (01h or 03h)
  V8 Y, R) K6 r    mov     dx, offset New_Int_Routine: g+ {4 o2 e- U$ z4 s) _
    int     21h
7 M3 S  r) ?& Z
. t0 d2 Y2 Q2 l" _* [( J2 O__________________________________________________________________________
/ K4 Y( @0 D* S- W
$ ^  p4 ^7 b* ]# z: v  oMethod 098 v, R& C8 C2 m# h) {
=========
2 Q- k1 f, A! ]! l$ w9 X3 G
  N& U( r5 x& U. _8 V0 s' WThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% j# E: s2 y+ B' f0 T6 q" M; ]performed in ring0 (VxD or a ring3 app using the VxdCall).
$ U* L2 D5 P' n' i6 }3 }The Get_DDB service is used to determine whether or not a VxD is installed, r9 P2 B, G0 W0 z  Y! b
for the specified device and returns a Device Description Block (in ecx) for, v# V0 f5 q+ T) @9 ~
that device if it is installed.* D% a+ B2 U7 G) ^; m/ i( O/ c
0 `! q7 ^) T; ~6 u, F0 g% H, T
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, _" K# A+ Q# f3 e6 l& m) f* @   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-). n( _0 }( C) ~( [+ u
   VMMCall Get_DDB
6 I" H# c7 r1 o( q' }   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed" X3 ^, X5 c3 m% d7 m8 A

6 f7 B* L3 I! QNote as well that you can easily detect this method with SoftICE:, H6 t1 s" }8 s7 \  i4 l. v: A/ d3 a
   bpx Get_DDB if ax==0202 || ax==7a5fh
0 W1 B4 W; \& ]0 b( [& H9 B
4 m+ k  M& k& {- O9 Z: s__________________________________________________________________________! {. d( ]8 X9 e7 q  \$ Q1 i
6 S! d8 e5 n2 J( C' I
Method 10
, V- V) L+ h* r$ ], Z: ]! D+ O=========
8 ]' \9 [# t  J4 v1 F1 D( L" i2 O% W* Z! C
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
9 d7 `. o7 n  Z; W  SoftICE while the option is enable!!1 c. \& _/ K/ E. ~
. P' f' Y- _" u9 x  }6 T
This trick is very efficient:0 G- S% ?+ ~4 W; a' X# @
by checking the Debug Registers, you can detect if SoftICE is loaded
" F& Q( C8 I. ~4 @(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
- L7 u4 d* s; B( Zthere are some memory breakpoints set (dr0 to dr3) simply by reading their$ d- J  ?5 @/ T9 F/ @6 J$ d
value (in ring0 only). Values can be manipulated and or changed as well
; g2 v0 Z9 n; R% \(clearing BPMs for instance)
3 m) ]8 M. `* C4 p/ O2 A
- ~  h: W9 l, }' f- z2 U- ]__________________________________________________________________________- w, E- U# l6 i. k7 H* m* f8 G
  `+ d. V% f5 G- f, x
Method 11
+ G$ C4 h0 @( l1 P' \3 p0 E# S=========9 |3 a) Z. w* H' m8 g# ]1 x
" A0 r' J' A4 d: Z$ e/ L8 Y/ T
This method is most known as 'MeltICE' because it has been freely distributed
* J" G" j/ @$ S. s. h/ pvia www.winfiles.com. However it was first used by NuMega people to allow
% |6 O# S/ j8 y7 zSymbol Loader to check if SoftICE was active or not (the code is located9 p5 ~: W  X! I, W! v
inside nmtrans.dll).( |) C& w; ?! s* ]1 ?. h0 q3 C

; Y; b! ^3 f5 a6 BThe way it works is very simple:8 b( @% i% O( c) z4 b- x
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for4 W+ |% g7 x$ M# d
WinNT) with the CreateFileA API.. s( Z* @: i2 K: [
: h7 l1 Q4 ]5 \8 j
Here is a sample (checking for 'SICE'):6 R! P# E7 z+ }' B/ P7 \7 y

0 C9 K' C+ B$ pBOOL IsSoftIce95Loaded()
1 h% p( S( h' D0 [{
3 B3 P1 w8 S5 [/ B   HANDLE hFile;  7 |: O# ]+ b: S2 P: ?3 |1 E3 G
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
& c. H$ ?0 s& T* m9 n% q                      FILE_SHARE_READ | FILE_SHARE_WRITE,
) A9 _  b0 \7 Q1 e  ]# I                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; a% O) E& P# L/ p2 j9 m
   if( hFile != INVALID_HANDLE_VALUE )9 O8 K1 K. K( y
   {8 t( \: H) |! B% [& F
      CloseHandle(hFile);- l# h" W9 T' _# F6 o: ]* |+ C
      return TRUE;
$ [, x8 d: e4 z8 O   }6 D" N5 _+ P! Q) ?5 b  Y: b4 x
   return FALSE;( ^3 Q) n+ f# a; A* I
}* ^! A7 j3 H6 V' ~
: o$ }/ `; P0 A. A% m
Although this trick calls the CreateFileA function, don't even expect to be1 X2 m9 w. D3 b4 ?+ U9 M- s
able to intercept it by installing a IFS hook: it will not work, no way!
5 E$ t" S, q8 gIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
/ M& Z5 l2 n& X) cservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 X' F5 u, N; b  C# G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 y3 p6 ^% q9 s7 z% ]2 Afield.. y* M- P' f! A5 Z- D8 Q9 c
In fact, its purpose is not to load/unload VxDs but only to send a
" m0 m+ }5 D0 u, _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)4 \( R8 n, q4 L( s% s
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! W8 t7 d" [  V* D& W7 Vto load/unload a non-dynamically loadable driver such as SoftICE ;-).  z0 L6 Q0 H, B3 C5 J9 B
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 a) {+ m* S" g% K5 J
its handle to be opened and then, will be detected.9 X6 J4 Q! v1 r. x) Z2 {& t' D0 f
You can check that simply by hooking Winice.exe control proc entry point% t+ o' @- N* W" I' I: U: p$ _2 p
while running MeltICE.
% f# L5 T8 m- v" R0 c2 M
. t7 l3 f) ]2 V4 q. k! C# g. }1 }' N9 o
  00401067:  push      00402025    ; \\.\SICE
# d! ^# l3 N  S! M  0040106C:  call      CreateFileA
; T) t+ i9 C9 }2 s5 b. }- Y! j: C  00401071:  cmp       eax,-001& C, U- S6 F+ R0 \* q0 V4 w( W
  00401074:  je        00401091
% J6 u) d3 P/ V- ?* @5 q. h+ y# P( @7 H* m3 v) S! m

# F3 V$ w6 Q* W# @2 `0 o/ jThere could be hundreds of BPX you could use to detect this trick.
$ N+ [: s3 p" i$ p+ v9 ^' Z-The most classical one is:+ D9 Q* \/ p7 R/ p; C
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||* j' M5 a8 Z, l! a) S6 ]" t% e$ b, D
    *(esp-&gt;4+4)=='NTIC'
$ d3 G3 V$ I- q7 i" T1 v
6 P# Z8 B2 p' U5 }" Y, \-The most exotic ones (could be very slooooow :-(' G7 n6 v- }- Z- [6 F) l- _' k
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  : L  V! [, Q, J  s* E7 |1 \
     ;will break 3 times :-(# C$ |6 ^# M* {4 x+ E, C& c
; _7 e# _4 d% E/ I- o! M- q# `
-or (a bit) faster:
1 @" H/ U2 x8 \4 U   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
2 n  D) e6 W! u7 u/ E# N! T  |: W
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ! |$ l$ ?& P. Z* N# W  A
     ;will break 3 times :-(
0 L6 O5 W4 ]5 D2 ?) I. Q, z3 H: E. z/ V; p3 P
-Much faster:
3 L; f0 }* I7 j+ J3 \2 L   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'+ G# s6 i& ^/ f- `

) B, v. h5 s! cNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
( s6 w  v$ r, qfunction to do the same job:
; M: Z9 V) _7 d  _  \- l3 {
* G1 x! w1 o+ r: [9 Q   push    00                        ; OF_READ( {* T- e) C' X  j' G7 R( R
   mov     eax,[00656634]            ; '\\.\SICE',0( p$ k. Q' y, r
   push    eax
; u+ A' K, t* e1 K: c6 b6 a- ~   call    KERNEL32!_lopen# L) S5 D6 }# G- c% X  r4 E# C( @" y
   inc     eax* u: ^1 U9 b: G+ p4 G# G
   jnz     00650589                  ; detected/ @! q- X( j/ W3 L, g& x. e
   push    00                        ; OF_READ
- ?; ]4 w/ t- X" x& X, s   mov     eax,[00656638]            ; '\\.\SICE'
$ C! P% t0 E, \, Z   push    eax. d- m1 c8 A7 T6 [4 g& I
   call    KERNEL32!_lopen
4 e$ s& I) h* P9 Q/ I: P   inc     eax
$ ~) h* d5 P4 d/ `1 H- C5 W1 H   jz      006505ae                  ; not detected% s) w# F! ^/ r5 |0 f7 `( |

& F. m* @% ?  l7 s4 k1 h) `, _/ H
! G! G* V1 O. a* m* B3 }__________________________________________________________________________& O9 K* J- `- h7 E! X' Q0 K0 A
" a$ k$ u* B( P) t  z
Method 121 Y$ w, u; v1 X$ Q( o
=========$ A+ X% N; K! z4 B! Z0 r8 O$ b/ D+ H
3 e  p( I) d9 \# H3 }" G
This trick is similar to int41h/4fh Debugger installation check (code 05
; _7 i1 |7 F" Z5 x7 c&amp; 06) but very limited because it's only available for Win95/98 (not NT)
& y. I/ a) @4 N  M6 Z/ D. y- Pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.$ m  U" r" t9 ~4 k( f' v2 l

* P8 c% _- }/ d8 s   push  0000004fh         ; function 4fh8 ^( \& A" H- S9 l# t
   push  002a002ah         ; high word specifies which VxD (VWIN32)
3 X" }3 j, H! U. J) }! {                           ; low word specifies which service
( R  x* k% \9 v                             (VWIN32_Int41Dispatch)- x  u9 v' r; a7 q3 Z3 T
   call  Kernel32!ORD_001  ; VxdCall; e3 y3 B' A2 D7 n
   cmp   ax, 0f386h        ; magic number returned by system debuggers
4 X+ y! M1 I3 i   jz    SoftICE_detected" c+ C$ x6 N+ F( I8 c( d
' S2 X. Z. T$ L1 V' l0 K9 L0 t+ y
Here again, several ways to detect it:" j) M- k+ J9 ?( Y: M0 p
% B8 z" o  a+ J9 K( \" ~
    BPINT 41 if ax==4f
3 |9 j) ~3 L  Z- d9 n2 J5 D! J0 v8 e3 e9 y
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
2 B; e: Y  S& J3 t5 v
5 k7 V& E" k7 l2 E2 f    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A9 {; \, ]. J9 J+ s7 l
/ w; N2 A6 H8 k  [1 y" h
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!/ t  G( Z- {5 T# N7 G9 r& P2 a

7 M( t- U  b" l* D2 W7 v( S$ Y- W__________________________________________________________________________$ A5 l% u& S% j" l

$ q  r' j2 c" R# A2 o9 c; K8 ?7 kMethod 13
9 g: e& T" n4 J=========
3 i' h: T" F9 P2 j: _) ~
  A* Q, N) g2 l$ c* Y: iNot a real method of detection, but a good way to know if SoftICE is
+ [$ `- d' X& @1 C& Z: {installed on a computer and to locate its installation directory.
) [" j; F( J& \: w- s$ q% v9 uIt is used by few softs which access the following registry keys (usually #2) :* s0 L1 x4 ^# i& o8 [: t
: b+ r0 f3 ]0 N) L
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. i2 Z6 S7 G1 r/ }
\Uninstall\SoftICE
6 v3 }4 P" i) a; o+ B-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE2 @, H  Y. q% F: _: a2 T
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion% m0 h5 T; {6 A7 R7 ?
\App Paths\Loader32.Exe
1 H2 ?; ^" n% w4 }; d* a/ T8 g) a6 [2 D' `* @  }3 w# H/ d

. Y/ G* \4 u. j9 c9 X' {; `8 pNote that some nasty apps could then erase all files from SoftICE directory" ^# U1 t+ e5 Y8 b$ U  Y
(I faced that once :-(
& \$ x5 @3 ^1 m4 O- \* V! O. N% ~1 ^" E1 W. r! c/ Z  U) T& S
Useful breakpoint to detect it:
& [3 p1 `/ a' ^
7 A, u9 L, t5 H     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'5 m2 g' {( o/ P% P- y! G4 V
& ^7 e2 b# b' e
__________________________________________________________________________. \3 P8 N# T$ n6 M% n% R

* v2 i# \, ?9 _. C+ w6 u" G7 q  W5 v2 F
Method 14 5 \3 B8 U, V# D& \6 c% O
=========
$ y8 h  ?2 E0 v, T7 ]; h' G( u% C- T+ _9 k/ g/ ]) R3 C3 Q. Q$ _
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose6 \- O  K& z& O4 S
is to determines whether a debugger is running on your system (ring0 only).5 g$ d2 u  o- v+ ^  F: J9 W
! J) @8 X7 [5 e: n: Z
   VMMCall Test_Debug_Installed5 |1 N0 }- ?1 g6 X1 M6 b
   je      not_installed6 ^5 L6 |: K. W4 ^4 Z

  C+ w5 M* y' h' |" p/ t7 k( k9 eThis service just checks a flag.5 y- B: B: G/ \) U* ?
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|本地广告联系: QQ:905790666 TEL:13176190456|Archiver|手机版|小黑屋|汶上信息港 ( 鲁ICP备19052200号-1 )

GMT+8, 2026-8-9 02:21

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表