找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
+ h) i6 a# D7 J, z* Z- s<TBODY>9 ^- C+ @, w. |: k3 R
<TR>
1 N2 }$ |+ H, x8 ~0 h<TD><PRE>Method 01
0 T' ~# X1 P" y" T0 V* B=========
1 I9 T. [8 m$ y2 ~; k
/ N6 Q6 t; ^2 n9 Q$ }, v' XThis method of detection of SoftICE (as well as the following one) is6 `- M6 G1 {$ f+ t# ]$ y# {. q
used by the majority of packers/encryptors found on Internet.7 i$ I# Y% c( r' V! v2 n5 C5 U
It seeks the signature of BoundsChecker in SoftICE+ O6 B: h7 n% X2 p4 g9 x
# A4 V! I& C6 a1 F1 h: a) M
    mov     ebp, 04243484Bh        ; 'BCHK'
3 c# t( F. {8 h0 _! j/ b* q( Z5 M    mov     ax, 04h
) D4 e) K) }; N$ \* {    int     3       $ A+ T; U8 L4 }
    cmp     al,49 b5 y1 Y2 f5 p; t3 c9 j3 h
    jnz     SoftICE_Detected
+ d# o& m! \0 g+ _2 g
1 j: i2 c7 b0 `6 E; R: E% I, `/ C8 C___________________________________________________________________________
; y8 n/ h! l0 h. f; O5 s7 u
. G( U7 |0 b' GMethod 02
  x  o3 O" b5 b9 T) A# h=========# m; M5 ]8 {1 u, {7 M  A2 y

, |5 p# i8 i4 D4 S* XStill a method very much used (perhaps the most frequent one).  It is used
$ F7 z7 G5 j" i, _* g. Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
" t1 }* d5 Z& R& r6 hor execute SoftICE commands...$ ]9 N; b* {- f# t0 X# E# a
It is also used to crash SoftICE and to force it to execute any commands: D5 d- M+ a1 S  n# O: u
(HBOOT...) :-((  & j# O; A' D# _3 f, @' e, E

, H4 M0 a7 `6 Y* K. eHere is a quick description:; e# @3 l9 i' N+ l. Y2 f
-AX = 0910h   (Display string in SIce windows), f0 ~7 I' i" ?" p- s
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)& F, ?# t0 }6 E7 |% ~% Y$ n
-AX = 0912h   (Get breakpoint infos)
5 g6 y* C. g1 \8 D( L7 f3 J-AX = 0913h   (Set Sice breakpoints)
4 }# }/ X* N8 j  |! M0 j-AX = 0914h   (Remove SIce breakoints)
7 N: v6 h! k, {  O1 T) r" F9 f- f9 Q0 `9 U. |( S! }* `- N
Each time you'll meet this trick, you'll see:
8 j- u' G% K" v8 Q9 b4 ^  q6 w3 c! q-SI = 4647h
7 d- C& l5 E9 E" J9 j1 U- M-DI = 4A4Dh. R5 i" d. G- k) p4 n
Which are the 'magic values' used by SoftIce.
& X2 q8 @/ r/ I: g: i# \+ YFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
' _( K6 Y% K% q# @( O6 t5 e7 u  W' |% B6 b0 w
Here is one example from the file "Haspinst.exe" which is the dongle HASP" C- S5 _$ t) w7 s) z# f
Envelope utility use to protect DOS applications:/ m' e/ C# U- K$ v

: I. r! ?! w# U- ?, T
! I- r4 M' y0 V  o+ C! w4C19:0095   MOV    AX,0911  ; execute command.) V4 |5 C: p9 b5 ]6 [. s  k' Z
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
: S) A/ X9 i4 h4C19:009A   MOV    SI,4647  ; 1st magic value.
  {  `/ w) a' g) ]8 z4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
% V9 X$ P6 B& j- k& M  W' [; p' t4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)% h& g0 w# f' W) j  s% P$ l; M
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute) [2 }7 ^- _/ p1 h- U/ K& u: a
4C19:00A4   INC    CX8 Q, t* D9 b& {( R
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
. I$ w5 u6 `( M4 L0 |2 p- L+ m4C19:00A8   JB     0095     ; 6 different commands.
5 o. I" O3 y/ y, s9 Y9 G* t4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
, X$ L" S  s% c4 x4 T4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :), B) e' W# K0 @8 C

5 t0 u9 j1 L; M1 \: nThe program will execute 6 different SIce commands located at ds:dx, which
2 B& r# q0 C6 N- [- u* Y& z+ qare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
/ S/ }6 c& N2 p3 E" f, ]/ L! G2 x4 Y4 m8 b1 ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
( q9 I; Z' }% \- g6 L7 }2 ~$ t3 [- p___________________________________________________________________________
3 k+ s& K* K: Z7 P2 `
. d1 f& F" T, M. S" J' d1 E
8 a" A1 C' k, q! }Method 038 N+ t3 ?3 \3 k1 s; M: {  h. S5 }1 ^3 i3 B
=========8 ~1 X1 W* f- [4 ^# p1 t5 L: ^

) ?$ h' H' Z$ }$ C: y$ eLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
# @- E/ p4 n8 f(API Get entry point)" B8 `/ q# y- ~. g8 e6 b: J
        
+ w$ N( w' V- r) F) t* F' w5 r
4 J% w/ x, n8 ]8 Y    xor     di,di! [% H6 l+ v4 n; |9 ^
    mov     es,di
4 d5 p) T% A! p  Y    mov     ax, 1684h       9 D7 n- r: S0 n" O& ~4 T, w
    mov     bx, 0202h       ; VxD ID of winice
7 j  _6 I7 [3 G; ~2 l& G1 {    int     2Fh
7 v8 R3 W& j0 n    mov     ax, es          ; ES:DI -&gt; VxD API entry point. T2 w' a. [1 {9 H% i
    add     ax, di
! v1 v; b! @. ]  ?1 f( q7 J" z3 A    test    ax,ax
1 t# i( p/ H0 t1 W# r- X0 U    jnz     SoftICE_Detected
! L9 F) D! T3 s3 N8 E$ ~6 [
, I, }, W9 p8 m( }___________________________________________________________________________
2 t8 u; v: q3 m$ x  X; ]2 {
$ G; y" v. k, a% Z4 cMethod 040 U1 ^9 T. E3 _9 d% E: j
=========, C3 X; n; I  v- V7 L; F
5 a/ j( V4 u* ?0 g1 E
Method identical to the preceding one except that it seeks the ID of SoftICE
1 u9 p! h: p( r' C  tGFX VxD./ K4 @( Y! T, `/ n5 m; c

  {7 l+ E* }  G# b- F9 g: ?; i    xor     di,di5 c+ p8 c- k  c& {
    mov     es,di
9 I' u1 T0 o( a8 w1 D; X2 }    mov     ax, 1684h      
- ?  M8 p# L  \1 C1 A4 M3 y2 Y    mov     bx, 7a5Fh       ; VxD ID of SIWVID, O- L: c. ^/ C0 }6 Q* D+ X
    int     2fh
3 ]/ R5 f: Y: S3 k% G    mov     ax, es          ; ES:DI -&gt; VxD API entry point: f& B  I& y1 \
    add     ax, di
! e, y. L( b3 u- U3 Q9 j% l    test    ax,ax$ w4 _4 u, d7 C
    jnz     SoftICE_Detected/ Y0 P5 D: e) ~- a8 E0 |

4 {2 \8 m9 |) C6 R1 s5 ]$ c__________________________________________________________________________
$ K, Z1 `5 r! ^" h" E' V0 X$ u$ d) O, s: O# P0 q

0 p$ a8 @6 Y  ]* O2 q5 J2 x  HMethod 05" `2 f% c. m: {8 r1 W) c: y" }  x! P
=========
8 q9 [$ m7 E& N* s! b$ r
4 p, E+ M( z7 u$ ^' f& kMethod seeking the 'magic number' 0F386h returned (in ax) by all system
4 K: g7 D8 T8 H8 S# n( I6 L2 v; Jdebugger. It calls the int 41h, function 4Fh.
, A+ q9 G0 k; R( @There are several alternatives.  7 _, I" m$ ~1 ~) _& m% N; @- d8 G% s

. ]7 y, r# n% s, m& {- nThe following one is the simplest:/ i- M$ Q; m( E' P; a. v0 G. m
& e0 R" G7 q8 v
    mov     ax,4fh9 o- `% K2 k7 _
    int     41h, S5 [7 j0 u7 m
    cmp     ax, 0F386
# b4 }9 q3 j9 t    jz      SoftICE_detected" [: s/ I$ ~' Q7 h3 n6 e" d

1 F. a* O) h* `' z  F- i# X- s2 A& t
% i# b/ C. A4 ?( s; yNext method as well as the following one are 2 examples from Stone's 5 N* }5 W0 n* Q& Z
"stn-wid.zip" (www.cracking.net):# d1 W6 w1 M- H/ p7 U2 r. C- m6 i

: M5 [6 d/ `) ?! \( V    mov     bx, cs% @) Q4 f7 o- G. H1 \; S# o
    lea     dx, int41handler2: D: o! Q& a  S0 b) F: S% c& I
    xchg    dx, es:[41h*4]8 l  u& U- M- Q7 j3 M+ P
    xchg    bx, es:[41h*4+2]
: o9 _1 q. s* M+ M8 z) Q    mov     ax,4fh
& ^, M4 P7 K/ P# {    int     41h% b8 v3 F( X2 t) V  K( i% s
    xchg    dx, es:[41h*4]  y) D! j. E5 H' \8 j; y
    xchg    bx, es:[41h*4+2]; y! H4 P5 p( E1 H
    cmp     ax, 0f386h
; h" n9 K7 b6 W$ W) ~* X1 _7 W    jz      SoftICE_detected
/ G( h; h/ w2 M
& N4 s4 e" v2 A- zint41handler2 PROC
: f$ I( f4 `! U) w" F9 _    iret
" o! y2 _# W# x! k* eint41handler2 ENDP4 Y% B$ ]# j: z0 _* O2 E

1 c& J2 w9 d8 f. Q3 W6 i3 S2 b7 U/ ]3 [
_________________________________________________________________________
2 b! [' d1 o% W" R/ x+ h: B' `4 }: n. n( R
8 D: }( x8 n8 v. `# v
Method 06$ ^2 H1 Z& `- P
=========$ X' C. H0 X/ i1 I& z7 K
0 Z2 H/ m$ J5 m

3 p9 x" c9 F) p: P6 T% A2nd method similar to the preceding one but more difficult to detect:
5 p, d- G/ z2 N# T5 z6 t; f& U2 T4 B0 Q7 K! S/ d! d
% P8 O% i) n# Q4 @& C
int41handler PROC
4 H* \/ w2 p( B* I' N8 o    mov     cl,al
$ Q+ ^/ f: x" p) p! C4 h. y3 o    iret# _1 u$ E$ R% m0 |4 A3 S% m
int41handler ENDP* x. S( n  p5 z: y
- N. ]7 `) d. J. o0 ]& V8 a6 `1 d
  ]! c/ B# m; U1 b) H7 n! Y  ~
    xor     ax,ax8 b9 i' y3 t0 z. O$ N6 Z0 G
    mov     es,ax+ ], S# _6 V( _: @) m
    mov     bx, cs  k; P% n0 F( N) ^# ^, @) b
    lea     dx, int41handler
. l7 R% o: N1 D; M' f    xchg    dx, es:[41h*4]
$ f+ R6 a5 M8 r2 O    xchg    bx, es:[41h*4+2]  |" b" ~( b) z7 X5 S3 p
    in      al, 40h1 ~$ j5 R8 \# ^) C' t) d. S/ g
    xor     cx,cx! @' M, {* M/ f; G
    int     41h! C: r& [# r- ^+ w# F7 N/ P
    xchg    dx, es:[41h*4]% U4 x! O4 P! V8 V* S
    xchg    bx, es:[41h*4+2]/ k5 Z  P, H4 K0 y
    cmp     cl,al; V& b/ a# N1 x) F9 V) X& b
    jnz     SoftICE_detected
' |% i! F0 N8 k4 ?: P+ p, e: u1 ?' z' F
_________________________________________________________________________5 }- ~7 k5 R# |0 q% B. }  j

: x: @: w/ b. k5 d4 ^. }" fMethod 07
+ v2 K; P! c& f! ~8 L=========
5 [# U4 u" c0 x+ t+ H6 z" p4 c+ F; o: b6 c+ v6 h! X$ |2 T
Method of detection of the WinICE handler in the int68h (V86)( a5 v0 O# Y4 b3 n

4 H! c8 x. T; u9 k* X2 c; S4 }! P    mov     ah,43h$ @6 k; L6 R  [# Z) x0 E, B
    int     68h1 s. v0 L  X/ K
    cmp     ax,0F386h' d( _, w- T  u7 d9 w% G, @) T; H
    jz      SoftICE_Detected+ b: S' Z: t2 w

  @- D5 e  W7 C8 p" K" W% ?; v
( N9 o: Y+ h( T8 A7 @" x& P' b  n7 N=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 w/ J+ e5 ^1 ?; V8 ]$ x4 S   app like this:
; W  _  ~% i# {) y# v. S  I
1 `8 `4 u: K. Q' X   BPX exec_int if ax==68
- U8 S7 x4 r6 b7 R, v   (function called is located at byte ptr [ebp+1Dh] and client eip is
. O3 V" O  o, N" C+ C   located at [ebp+48h] for 32Bit apps)
/ L* Y  V2 S7 M& c__________________________________________________________________________( k" x0 W* |" a9 J

6 G* m) O" @+ L8 k. H/ i0 b5 E/ R& f( V3 j( X
Method 08
& D6 P; p0 W* c/ \2 k4 m. H) h=========$ T/ v7 ], i, h9 c

- ]; R6 {! x( F  D) ]& U/ T4 B7 ?It is not a method of detection of SoftICE but a possibility to crash the
& q5 A5 D' m1 Asystem by intercepting int 01h and int 03h and redirecting them to another  z- x9 c! G9 X
routine.
* W; ~2 A! I% H& j1 @% PIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
* L3 U! K- B5 e* ]2 v$ a0 X9 Bto the new routine to execute (hangs computer...)# o  m& w3 Y5 y$ h7 u9 G6 O
, W% H- Z' b4 f0 y5 V' x
    mov     ah, 25h
6 }' L4 s- Z0 `. k    mov     al, Int_Number (01h or 03h)* |. s, |6 d0 i5 P' P
    mov     dx, offset New_Int_Routine
1 U* |# l1 T( a5 D) [! |& v    int     21h
1 N- _; h  F3 Y% g& }9 H% c  C& m/ s6 Y: ?& _8 o/ L7 I+ ~+ X
__________________________________________________________________________' G( H  E* {4 V

7 T9 e) t; v3 w; Q* Z, I- dMethod 09/ t/ e4 |2 W& S: U
=========
! a: G+ V, m3 \8 R  _. R0 P* A( L, y  V6 u
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only5 z7 }9 U4 ~1 C8 g0 E
performed in ring0 (VxD or a ring3 app using the VxdCall).
7 M1 B$ a+ {' V7 a) d* |The Get_DDB service is used to determine whether or not a VxD is installed
, y! c4 H, d$ Vfor the specified device and returns a Device Description Block (in ecx) for
8 }4 Y4 J  Z! S& m3 P  p+ Lthat device if it is installed.- Q4 o' ]% s. i* j
1 @. t1 i! o. i" I2 V
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID4 _" B3 K; Z9 x$ F$ u" L% K
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)2 T2 ^& [5 O. k3 X8 E
   VMMCall Get_DDB
$ M, b( k2 I9 ?   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
/ a- Y  W: f& }) f+ O
" A! G8 x$ g8 v  |( A0 F- o8 DNote as well that you can easily detect this method with SoftICE:+ i  D3 R- d2 Z0 V/ Z% @& c" _$ y
   bpx Get_DDB if ax==0202 || ax==7a5fh
& X$ C$ b' |* c; E5 r; \0 b, l
__________________________________________________________________________, L2 ]( Z; o7 c# }# T

5 E: t5 n4 ?! z+ FMethod 103 s' p* e$ c. W1 Y( B; O3 k
=========5 m& v% V* K5 f# a  H

' C8 N3 m( ~) o=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with& V7 ~" d; n8 W" o& u
  SoftICE while the option is enable!!) |: }/ n7 \, y8 M1 h
7 A$ X- \2 V) E% E0 L; b8 d7 h
This trick is very efficient:, C7 d' p  o4 Q( N
by checking the Debug Registers, you can detect if SoftICE is loaded! H  L; Y4 Q5 J
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( r* p8 u! }( A; ?4 y
there are some memory breakpoints set (dr0 to dr3) simply by reading their# d8 m* F; k+ C  F
value (in ring0 only). Values can be manipulated and or changed as well
9 R1 \5 o' _5 M4 z) B/ c5 }5 d( j7 [(clearing BPMs for instance)& b: n) J' f: U2 [6 Q

/ x1 s' G! @9 J4 ]$ A, B; ~__________________________________________________________________________
8 g& W% Z, B$ d" b3 l$ x# j  s0 c2 f; B
Method 11: f0 Z8 @7 Q6 L$ V. s
=========
& Y3 A; j, p8 ?0 p5 L5 G9 l; w9 R6 T2 m7 S1 a2 a. ?" V# `
This method is most known as 'MeltICE' because it has been freely distributed
( c) G& ~% C5 g- t  `via www.winfiles.com. However it was first used by NuMega people to allow
4 F# Q) |( U( b, zSymbol Loader to check if SoftICE was active or not (the code is located' U/ k: v9 ~& ?  Z, i9 c/ U
inside nmtrans.dll).
" w% o/ F# S! X* M$ S/ U  n
4 r. R1 v1 e& y$ i9 j% ]; M  u/ oThe way it works is very simple:
: K& W8 N. Y8 ~2 P9 _It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! ^/ z& E; Y6 i* qWinNT) with the CreateFileA API.1 \4 E  f# H4 E: n- l

( u0 v, ]" A. K! O: T* [9 LHere is a sample (checking for 'SICE'):' e  a  B- O4 T( Y, ]8 s) E

, B7 H% |4 x. S; ]/ |9 C7 TBOOL IsSoftIce95Loaded()
7 o$ Y6 @' u" g2 k6 W5 m{2 K4 F0 F. n1 f1 F! {' x
   HANDLE hFile;  ! J; u9 \: [" X4 [: _9 E/ |
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,' A% L' J2 ~2 A8 f. t/ k2 Y
                      FILE_SHARE_READ | FILE_SHARE_WRITE,; s4 j" v( o: u4 O% v
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ T0 o1 ^; o. s/ X/ p7 w# ?
   if( hFile != INVALID_HANDLE_VALUE )
! p/ O/ B. f! @* m8 q: y   {4 f% s* d, U% V0 f* [
      CloseHandle(hFile);% q2 }. o$ o, z6 s) ^6 c3 e# X" v
      return TRUE;& _/ v; o  T: z1 v+ M( L6 `5 W) A
   }6 ~9 A& h( R7 H* X
   return FALSE;
: u. |7 Q" U% D}' s5 W6 a  `6 ]$ v0 Y$ u

( Q1 r" |: t. GAlthough this trick calls the CreateFileA function, don't even expect to be/ K; @/ ~# C4 G7 g0 U3 c
able to intercept it by installing a IFS hook: it will not work, no way!  E7 v( V$ T) N# ~; h
In fact, after the call to CreateFileA it will get through VWIN32 0x001F& C4 a9 o/ e" Q8 y, h3 [2 y, t
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 [* I* C7 ?: ?* ?) |
and then browse the DDB list until it find the VxD and its DDB_Control_Proc( G! {  R5 e7 S& y
field.; C4 ]& M7 B2 A3 P1 \  v
In fact, its purpose is not to load/unload VxDs but only to send a
- w7 _" H8 L, t  aW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)9 r4 o( L2 ^4 E& ?8 C+ u8 i
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 Q& y( g& j- h" h% R& y
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
8 R) X0 ]) }- l) dIf the VxD is loaded, it will always clear eax and the Carry flag to allow
1 d) n/ c! C) g& lits handle to be opened and then, will be detected.
( c! S$ v/ b2 [5 e3 eYou can check that simply by hooking Winice.exe control proc entry point# u3 o- b' B. r. O
while running MeltICE.7 e8 _0 |: J2 Z$ e1 u! H0 ?
, }* S1 M3 d$ }, f) U+ E5 f: S
9 d; U3 w9 ]  b  z: n2 ?
  00401067:  push      00402025    ; \\.\SICE$ a/ W. R2 S: t* H, u( h$ L
  0040106C:  call      CreateFileA
( f! `: b/ T8 B, M1 c  00401071:  cmp       eax,-001
2 T- B; F3 u5 \; u& I0 q" A/ F4 i) T9 Y  00401074:  je        00401091
  |8 M% b! \; r( C3 u" k) y
7 Q. ^' o, y; f! m% g
, o' G6 c5 V+ OThere could be hundreds of BPX you could use to detect this trick.
) P; q- g( d# n% E-The most classical one is:
: I8 \, X& c/ j/ x, a' R  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
' I' d& x7 X0 X    *(esp-&gt;4+4)=='NTIC'% K$ C: N- ~/ s0 \: a7 |( T2 C

( a6 H: ~. B+ P5 b+ A) c-The most exotic ones (could be very slooooow :-(, u' a0 C5 f* K6 ?
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ) u: B* b: {& D, v& w* V
     ;will break 3 times :-(# G& L: e( h1 v* j" ~4 t% |5 U

8 O, m- J+ j7 L9 \3 T0 o-or (a bit) faster: 3 r/ K$ \2 r# P) H. l* O" c. z
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
1 e9 D3 M+ m& r  Q( p: X( c% @
! k! \% x: s1 Z0 J   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  5 r! {% k, W  S; j( ~
     ;will break 3 times :-(
7 _, V8 S6 m& _) q- ?
$ D/ L' ]  P; s" y8 k-Much faster:" E3 a3 F, H2 w' e. k/ \
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
! ?1 B/ l; y0 \1 f; n2 T0 Z3 w6 t% W" f# \7 t9 o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! m; k' Y; a. j; T# Vfunction to do the same job:" a+ P' U( ?% h4 T/ Z' `
! X$ [' r. K! E2 ~. Y( j
   push    00                        ; OF_READ
/ j- K7 W. n% ~8 f  V4 l   mov     eax,[00656634]            ; '\\.\SICE',0: q: r3 h- R5 t+ L1 n# l6 o/ y5 v
   push    eax
2 s# g+ z1 \% ^; k   call    KERNEL32!_lopen" P2 [7 s' z- s* V" N- S
   inc     eax
$ P2 f7 D5 @) M3 E1 O' q( k8 ~0 X" v  c   jnz     00650589                  ; detected" l  M; O8 B  y+ y  [
   push    00                        ; OF_READ
3 A; a  B9 q7 S   mov     eax,[00656638]            ; '\\.\SICE'. A' a5 N2 w% j
   push    eax
) ?8 ]  ^' v0 j. |2 m+ g7 ^   call    KERNEL32!_lopen1 e9 c+ o8 o! Z
   inc     eax
/ F, W8 X& L3 |  X, n   jz      006505ae                  ; not detected
7 J: v* b  q" t. g; u# b) T5 n3 L7 T, f* Z8 q8 |
# A0 w. N! v3 P) V9 f4 [$ R5 o
__________________________________________________________________________
& p3 T! G+ @- I) @" y, [9 T) a2 j# u1 _5 H6 z9 v. F
Method 127 f' @! `% A" `. q' |
=========. S; B: U- q& O8 K3 U

8 l* ]( E, D9 }. H9 t8 @! t# QThis trick is similar to int41h/4fh Debugger installation check (code 05
% G% [6 |9 t, r, Y8 H&amp; 06) but very limited because it's only available for Win95/98 (not NT)
# f& I) j, A9 ^+ z* K" J7 Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.
# s. i- p& Q- D, e0 ^/ P5 b" _$ v
! f: f0 j  f% F- t0 x& V   push  0000004fh         ; function 4fh
5 g/ O0 V" o# ^6 n" o6 O   push  002a002ah         ; high word specifies which VxD (VWIN32); B* R7 D1 j1 M  [- h/ [
                           ; low word specifies which service
. o( `& i, e& l" g$ ]                             (VWIN32_Int41Dispatch)
2 X$ ]7 S0 S9 C# v# t5 E, N1 @   call  Kernel32!ORD_001  ; VxdCall/ k6 X- v$ L. m& S
   cmp   ax, 0f386h        ; magic number returned by system debuggers
) y2 A) l0 W, \7 x& p; r  K" _   jz    SoftICE_detected
6 u+ h+ ?- j( d0 y$ @" Y& O) }! e' F( f( I8 @' _! }: _
Here again, several ways to detect it:
5 I- t( K# Q5 U# v( z7 u/ [6 U, T" ]
    BPINT 41 if ax==4f
! P0 ^$ O4 K; S7 v$ y- [) P4 k$ `5 O6 N# T
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
9 K4 i3 X& E8 ~7 q! [  d0 B0 C
' B# p3 P' `4 x$ E/ G    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
* D# \. Y' D$ H, C0 F
9 U0 U% h# m2 b2 ^6 r    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
( o& j) ]( g9 _) G7 u
9 U7 M. e: z6 X* n__________________________________________________________________________' x+ e& d4 F+ j) p8 H9 A

4 @2 h( C8 |) U- y" y) sMethod 13# |+ C5 Z( j0 e3 O
=========
% w* k, {6 D+ M  d. e5 Q: j/ X' b. G
+ O5 I& d# G6 z# yNot a real method of detection, but a good way to know if SoftICE is
  b- b+ Q$ k4 d) O$ {0 Qinstalled on a computer and to locate its installation directory.
' S# V( Y- d9 S# D+ j  l! wIt is used by few softs which access the following registry keys (usually #2) :) g/ p3 |' G  o+ `/ @# J5 y2 b# ~
) |) t/ @, L- E
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. B. V5 P2 L3 Q\Uninstall\SoftICE: H& \: E+ _+ n
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE1 Q2 k) U. L; P( R  `
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
! b; x5 I" {8 x# z; Z\App Paths\Loader32.Exe
6 u; a$ I: s$ A: Z- ]* \7 Y- H2 M6 y7 h+ `" u: Q% |

/ d8 O4 l8 J6 j+ a0 q$ R0 ~Note that some nasty apps could then erase all files from SoftICE directory
: i+ G& j# D5 b1 |- D2 N3 O$ g- d(I faced that once :-(
' F, f! |$ X# Z& G9 h) e, |; |# ^$ Y- j6 b. Z) R2 i0 z
Useful breakpoint to detect it:
$ N0 [. M# U7 I8 U3 ?. {  N) G6 ]8 m; d6 l
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
& b* U9 g, T$ V* a* A9 a1 _; r* I( R3 \3 Q4 m8 d
__________________________________________________________________________
1 \* K. k& \$ x# l
- B0 j, i7 `! l: c! I  K8 E8 i% ~% o% @3 X  o# ~! `) [5 t; @
Method 14
* b" j, w( Q- j5 M( ?/ u  o$ c( e- M! `=========
9 J' [  L/ ?- k4 z8 y
- L  i$ B. c% c9 C7 ~) ]A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose) N6 L6 D. i+ z7 g
is to determines whether a debugger is running on your system (ring0 only).
; U8 i( f+ ?* M, ~+ J5 p/ @8 a& a  T2 Z  U8 M) D
   VMMCall Test_Debug_Installed! S- o8 S% M/ F/ y9 V& Y: t: P
   je      not_installed" G1 {, F9 l0 l7 g. M
  A6 Z1 m+ V4 g$ G- m, h* o2 u/ M+ W6 z
This service just checks a flag.  c0 o1 D3 Y2 J6 y
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-6 03:54

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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