找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>5 n; T* B/ S8 b
<TBODY>
3 A" N  e, g, }) f. t<TR>& m9 X1 H9 a2 w+ u$ {/ h, w
<TD><PRE>Method 01 & @; Q3 Z" X# O# _: ?* G
=========
& D# J$ X  I7 ]. j4 j' S9 T% L1 q% B+ R* o$ Y% k
This method of detection of SoftICE (as well as the following one) is" `( c- _9 [6 {9 a. L6 S+ D) r- T
used by the majority of packers/encryptors found on Internet.: H, x( R6 n, ?4 n4 w
It seeks the signature of BoundsChecker in SoftICE5 Y7 T1 ?- @- p5 ^0 Y- r4 P

6 U2 P8 ^/ F- q' J9 g    mov     ebp, 04243484Bh        ; 'BCHK'
- a3 h; q! R" C9 ~$ M    mov     ax, 04h
8 z( Y& a! L- Z; h    int     3       ! N7 K4 P* _6 {1 O' s& v4 t0 h0 ~
    cmp     al,4% |! P, K/ |; \( _0 l1 k
    jnz     SoftICE_Detected
3 `) ~. P9 v7 f6 K' U8 t4 K, y4 {, g  ?: D; a! Q6 r" S
___________________________________________________________________________( A9 \; Y, U6 M* s; @

& c$ b$ R3 k9 UMethod 02
1 u8 _/ D& [* {: r=========
; m6 T* e6 j& T& s$ |; S5 J! ^' p
Still a method very much used (perhaps the most frequent one).  It is used$ i* G- P* e8 V# b' L
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,, N" }: u6 J  z9 k0 l9 A: N
or execute SoftICE commands...
" E" l2 U% s6 Z$ YIt is also used to crash SoftICE and to force it to execute any commands
; O; @8 j- Q% T(HBOOT...) :-((  
; E) }. P: J6 E. {4 A% S
3 o$ o# G6 D' H8 kHere is a quick description:
  }+ x) v3 y9 {+ T, G$ \-AX = 0910h   (Display string in SIce windows)
( N; |: D4 B4 y& I" b/ x1 x-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx): I. s4 v7 ?2 `6 x: ?6 B
-AX = 0912h   (Get breakpoint infos)! k5 l; \0 J2 e  p4 l# N& @, W) b
-AX = 0913h   (Set Sice breakpoints)
; ]  @+ b+ b+ s1 N, M. t-AX = 0914h   (Remove SIce breakoints)
7 L# r" k- ?0 {/ y) h% m
6 E& F4 ^) c, IEach time you'll meet this trick, you'll see:
  q" a4 l5 c% H4 P0 u0 X-SI = 4647h) ~( n3 n& }( t$ E' l" d; |
-DI = 4A4Dh, O% s/ i  C( [: N& n4 @
Which are the 'magic values' used by SoftIce.% _: H; Y* A4 Z2 S5 u
For more informations, see "Ralf Brown Interrupt list" chapter int 03h./ x& n* k/ m8 i7 |1 c
( p% N2 r. ]- e. y3 l" \# g* x
Here is one example from the file "Haspinst.exe" which is the dongle HASP
: x# k0 n1 x) u- qEnvelope utility use to protect DOS applications:
# |* a5 n! y* u5 U2 q6 [  D# k, E. P+ W" ^* O9 Q

; n' x. g7 `% V3 [4C19:0095   MOV    AX,0911  ; execute command.
% G2 w: W# R3 c! N( a1 M# I4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).( a) W. F/ T, ]# D
4C19:009A   MOV    SI,4647  ; 1st magic value.
8 ]! v( H8 b% Q# b: Q/ y4C19:009D   MOV    DI,4A4D  ; 2nd magic value.  A8 c" D  T; w: _- A$ r
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)6 [3 A" j& q) O0 R6 }
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
8 E0 i! r/ y6 ]# k4C19:00A4   INC    CX  {+ D+ j" R5 o' j* d4 a  Q
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute* K& f! C, v. w4 s
4C19:00A8   JB     0095     ; 6 different commands.4 J) L. M1 H5 s& B! h* a
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
" ^" G* c: n5 }  {9 X4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)0 f) c' r" `, n& u- U# h6 G

0 H. ?& K+ K4 ^4 ^; \7 y2 LThe program will execute 6 different SIce commands located at ds:dx, which. W( D1 N- i' y& |: q( A1 {  K
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 b. M, ?! i  M- E8 j! ~. h* }& j; Y7 Z7 d+ ~
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.; @/ p  ~7 p+ d. S* n2 u8 W
___________________________________________________________________________- o/ W  K/ n( \3 e
1 s: W) |; _/ N$ h( x4 s, b

* f# X$ \' t7 G# sMethod 03, w5 |3 N2 ]5 M9 ]' ^+ L( C
=========2 O' H* z# k) h8 ]+ Z6 c

% a+ {/ P4 P2 i1 uLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h6 J2 ?# i2 y- l+ {
(API Get entry point)$ N/ ^5 M& z" u' U% D/ L1 }
        
4 w  B1 ^# I5 D+ Y  @( X+ ]3 l0 T
: v7 B) e/ k$ @  ~5 |    xor     di,di
* j# L1 s! T3 d2 B1 l) a* |    mov     es,di3 G" k0 n) X2 f* B, g
    mov     ax, 1684h       - Z( m& {2 v8 O3 g2 R$ x  Y$ v- B
    mov     bx, 0202h       ; VxD ID of winice
2 ]: A# d  {3 U0 l" O    int     2Fh0 o- ]6 h& R% s0 j
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
/ p1 n6 ], U3 t: t    add     ax, di0 l; a/ x: A! H+ L1 }. I
    test    ax,ax% _+ |- g' f+ G
    jnz     SoftICE_Detected* Q3 k# r# t! {  P- \' w

+ Q* e9 r3 i& `: d7 E+ x# v___________________________________________________________________________
. {* u; f5 e& s  t( i+ l6 g2 j: m
Method 041 {, f* k9 L7 |6 b. q$ K
=========
8 c  A8 U' t* F+ d- b" ?, `9 Z  A2 R8 C* X
Method identical to the preceding one except that it seeks the ID of SoftICE
  G0 H0 n. x7 O+ d$ n2 B* P: CGFX VxD.
* m8 {0 F" i4 e
* ^) Q! H' a( s2 _1 Q) z/ W    xor     di,di
# ^4 N. r  r1 r; \# L    mov     es,di
  @  e4 z; s5 k, A" V& z/ N: j    mov     ax, 1684h       * {; V) @: k( Z& Y9 P/ V
    mov     bx, 7a5Fh       ; VxD ID of SIWVID2 k# P. S0 V' x+ G) \) z
    int     2fh, y) |  h% k; g9 a+ e; u& V
    mov     ax, es          ; ES:DI -&gt; VxD API entry point" }6 y5 h( Q( s3 C; K- M
    add     ax, di7 w/ z# F+ T9 y" p6 l
    test    ax,ax5 N# x7 r, ~% H4 a* \) p' L
    jnz     SoftICE_Detected
) g" w5 ~, D: V( Q3 D- m) P) w) X+ F2 l) t+ j
__________________________________________________________________________
$ |1 I: G/ t- Y/ h8 \" U. y3 {
/ F, r. J9 _! c; \. ?- d2 w1 ^- ^8 G& _" `$ b$ A
Method 05
! g3 b/ X: ]0 z=========
0 l! _' K: g" v" t. W
4 F0 j; g; v' H8 ~Method seeking the 'magic number' 0F386h returned (in ax) by all system
: J1 Y- P. R* z# H. s- N7 b+ Gdebugger. It calls the int 41h, function 4Fh." t* J& k/ B5 n$ e
There are several alternatives.  ' m8 V8 F" u- s* r8 U
3 l+ @, M, L. O# A" B9 P* S% @* l
The following one is the simplest:! e6 ^. A+ f' B2 W. i3 b
/ f3 @  `+ t" n4 d' J
    mov     ax,4fh4 X  s& h- k& g: ]( X. G+ N4 R4 r; z
    int     41h, i+ |+ `' {$ ^, g. Z# s: a  P
    cmp     ax, 0F386# d+ J0 J( Q9 v/ \% }* |  Z. F
    jz      SoftICE_detected3 w$ B9 ?* R  X: U) G
4 g4 T7 K! @/ {. @$ m

* K# [$ V! d( c7 qNext method as well as the following one are 2 examples from Stone's - t$ o- M0 s' U, w5 u2 p/ P
"stn-wid.zip" (www.cracking.net):' }& f% T1 o/ F6 s

  I$ O1 ^8 C9 X; q    mov     bx, cs) [; E- `  B& z. H- O% G
    lea     dx, int41handler2* D4 p. J0 `' w4 `" X9 j
    xchg    dx, es:[41h*4]/ |. t3 h' p. V8 _
    xchg    bx, es:[41h*4+2]
% @! N" r" {( F; [' o& j7 c; b    mov     ax,4fh6 F' f2 d7 i0 F5 f# `' l3 o9 j1 `
    int     41h' _' X' w0 G+ n7 L
    xchg    dx, es:[41h*4]
$ T% r5 B0 T9 R, n" a    xchg    bx, es:[41h*4+2]
" N2 Y2 V+ |; \+ c7 Y    cmp     ax, 0f386h/ `% v4 s# [& g, r4 z0 Z
    jz      SoftICE_detected# ^  A6 x: L) Y- Q# Z* }3 T2 p7 {! {
+ D/ v* S6 b4 |. h7 C
int41handler2 PROC
: F8 y  X( G( D& v: L. J    iret
: L/ I- v. m5 h- Yint41handler2 ENDP
: y; h' \' R$ S7 P  G( j7 y( a, h" l' a

: A' n' C7 L" A- l_________________________________________________________________________
% G! ?( F; G- s6 W3 m3 ^. |; t! }/ f2 b  u0 b) Z

  o+ U7 t2 N7 w) c/ K1 FMethod 06
* K! c9 K- P) L4 U+ H1 M=========1 x+ \* D1 T) q

  s5 C1 H2 l  K, q. |9 H) m) N. F+ T% {, D4 v: c
2nd method similar to the preceding one but more difficult to detect:& Q8 ^5 Y; o9 s0 L/ T: b
3 Z7 u; G6 D" M( i1 B6 K% u/ t+ j

# D" q- W; ^! Y) yint41handler PROC5 {; _2 X1 O* E+ k  R" i6 k* W
    mov     cl,al0 n. v! `$ x2 D8 A5 z" l
    iret
* z0 H  G9 L6 ~0 r. Yint41handler ENDP
* c6 L: z  q/ I9 J; k3 c6 K& y) x4 F. g+ s

5 ~6 e5 n& E+ Z) C4 Q/ I; m$ N0 V    xor     ax,ax
1 ^8 B% {: w/ Q! {" m1 ^2 _' A1 M    mov     es,ax
  L, F9 i4 ^. ]    mov     bx, cs0 w0 u+ K- l4 c# }, r: S: K
    lea     dx, int41handler
- s6 x% Q/ y4 U" Q+ c    xchg    dx, es:[41h*4]: \! f+ K/ p; K. |0 o& |
    xchg    bx, es:[41h*4+2]5 s- j5 g8 x1 u6 U% A
    in      al, 40h
  A  S) S8 [3 g3 ~    xor     cx,cx; S  }4 a, q! a$ S: Y4 u
    int     41h& X- {  D+ ^  d) L) K5 J2 O- S, k2 v
    xchg    dx, es:[41h*4]+ _) i. d. `  P% j9 ?" B: R8 g
    xchg    bx, es:[41h*4+2]% {2 l( T+ G# e& g, P, g3 ]
    cmp     cl,al
$ I7 n: C. x5 \% i5 Y  y( |6 b    jnz     SoftICE_detected
! g" O" ~: ^9 v9 x4 d
" @1 B5 ^/ D, B6 {# L) L_________________________________________________________________________3 h% v+ h0 ~) d7 }3 k4 K
0 P5 q0 a' s  e- a. d9 ~" O2 L: [
Method 07
3 s' d9 f9 j+ y9 @5 {$ |=========
$ m8 }: T; A$ U  r5 J4 B& P' {; o: I1 J& \# R% X0 j5 q6 n# Z) d
Method of detection of the WinICE handler in the int68h (V86): `6 M; g7 w3 |/ d! `; v
3 p0 x1 C+ Y; p
    mov     ah,43h
+ ~/ M9 _7 u6 e    int     68h
2 ]. A# g* k, @: |8 }# _2 y, N    cmp     ax,0F386h
8 M8 \* G6 b1 g( i  ], k$ w' k    jz      SoftICE_Detected" \" n  I4 a' R1 V4 t, x- c

. \4 F% L) U9 j# ~/ C& d/ G+ j8 @" L5 Q/ c
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit1 [7 k' O$ H7 V! `& G- u( e2 |
   app like this:! b# y. y# ]! }- k4 q

3 h% S; t7 w8 V& n0 \   BPX exec_int if ax==68; Y" g- m) N' }  {0 T# p3 X
   (function called is located at byte ptr [ebp+1Dh] and client eip is
& X+ K' C6 |* Z9 m   located at [ebp+48h] for 32Bit apps)
" b3 W2 S5 ]3 p' _% N  n__________________________________________________________________________2 ]/ I2 t/ W; W

* ?! W! y# w% S% F, e! J! Z; D( _; q
Method 08
  ]2 }% W. p/ L+ c# Q0 B=========
$ P& ^" u4 \% {$ d' z$ F" I: J: P
It is not a method of detection of SoftICE but a possibility to crash the; E: z& E$ K+ F+ r6 H% ^! e" a* ^) P
system by intercepting int 01h and int 03h and redirecting them to another
9 B9 H2 c, d0 Z7 {routine.
- _, K+ l! W" z; }5 V0 AIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points' W" c5 x2 ]) ~- H4 V* o. }# E
to the new routine to execute (hangs computer...)- n) m: a, _# {/ H3 }" E
$ I  M7 Z5 U6 h9 @' A/ [! m
    mov     ah, 25h
' ~6 @$ _/ D  c3 c    mov     al, Int_Number (01h or 03h)
; z/ H$ F& P9 g    mov     dx, offset New_Int_Routine
& m: E1 |# ^$ J7 d  x5 V9 t    int     21h
8 l( e. \' b0 s& r2 _( {7 m! n* n2 C8 d" R
__________________________________________________________________________- }; M0 M' R  ?

: m3 \# h, ^7 RMethod 09: S( P" Y% l+ p  x
=========5 e/ \& C& D+ |  I" v+ J9 f% X+ C% d

- C( O$ X3 t9 Z0 W2 C( b! r4 BThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only. S" G4 v  T( ~) T
performed in ring0 (VxD or a ring3 app using the VxdCall).
: K9 z0 Q8 b$ K6 [5 v; wThe Get_DDB service is used to determine whether or not a VxD is installed. d1 i' N9 W$ x7 [: N9 n3 q: n
for the specified device and returns a Device Description Block (in ecx) for5 n7 ^- O# R  W+ K" n) p
that device if it is installed.9 |+ J! J. f, Z4 A  A* {
( @6 C% Y3 e7 l$ A+ H  |) M
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ [; C* k2 f" U0 m6 p/ ~/ w) g
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! Z/ L3 {3 d) J
   VMMCall Get_DDB( j0 y) ~% |; f- [. L. p
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
+ @. H3 A& D9 O7 R% K" u$ u2 b- }$ `& d. n
Note as well that you can easily detect this method with SoftICE:
9 m% k1 E# `0 ]) c/ V   bpx Get_DDB if ax==0202 || ax==7a5fh4 X, |. {" O8 w( s

3 I/ R- D4 w  _' S% G__________________________________________________________________________0 f7 N3 {7 }2 ]

+ A- f) g  N" R' S$ G0 XMethod 10# ~) R4 d( P+ c) n0 S/ ?& z
=========
1 N* c- P/ u5 i8 `+ z! l
( o5 V% P+ V) [8 e5 [" s4 P=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with! ~) Z$ e; J% u
  SoftICE while the option is enable!!4 D# T9 I, E( i: I2 X
( V, ]3 L* {' i6 o6 d; K8 l7 X
This trick is very efficient:9 U% L! n) b2 J% a
by checking the Debug Registers, you can detect if SoftICE is loaded3 l6 e# ?# e  k1 u$ y' M: F
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
, s. o- p5 E2 Q9 h. Xthere are some memory breakpoints set (dr0 to dr3) simply by reading their
4 V  D  u+ D" ?$ N% _3 m9 d* Z; Qvalue (in ring0 only). Values can be manipulated and or changed as well& ^( l0 x  ^6 S; ~+ S* t. [
(clearing BPMs for instance)# S/ z& ?( z' M+ V

; ^- g2 [% w! X__________________________________________________________________________
5 y" q5 X1 T5 ^5 v( Y, q' C3 h$ r0 [" C5 P4 F" z6 V3 u8 d9 s
Method 11! `6 V& ?  Q* D8 S8 o; {
=========
) f; c; C1 y0 Y! e6 c, i; \7 A% E/ A$ {
This method is most known as 'MeltICE' because it has been freely distributed  Q9 |* `2 T1 n4 v
via www.winfiles.com. However it was first used by NuMega people to allow: |1 K9 Z8 S: K+ H% ]9 I
Symbol Loader to check if SoftICE was active or not (the code is located
, c+ ?# m, T' D" P. R& qinside nmtrans.dll).  I/ l1 u+ T5 ?9 S. x1 p6 e0 @/ l

0 `! F9 R* g9 t* G$ @0 t6 v) `The way it works is very simple:0 l0 {+ S1 Z0 t  X; K3 k
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for: z! m( s  c9 U5 u2 N4 U0 @
WinNT) with the CreateFileA API.
/ j2 h! j9 ?6 z( W: ]3 I* v* j  t& f, M1 Q1 N/ ~
Here is a sample (checking for 'SICE'):7 g; m! }9 I6 M) G" u& i
3 V. _( d/ u# C4 ^: O  e+ G
BOOL IsSoftIce95Loaded()
+ m; G3 O- V" {& Y' }{7 _9 F' J$ x; _' Y
   HANDLE hFile;  
. G; @: J6 A" u5 o   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
6 v$ v: p" m% K2 L, t$ J8 z                      FILE_SHARE_READ | FILE_SHARE_WRITE,
8 G- h- r! W/ d7 `8 C6 W                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);2 a+ b' e: w$ A' h5 E3 ~1 V2 _
   if( hFile != INVALID_HANDLE_VALUE )" U/ E- }- L4 m7 f9 A  g
   {2 }! L$ ^0 q3 ~, J: R8 T
      CloseHandle(hFile);
5 F) ?2 j: s" q- @- s0 P* L  X6 i. J      return TRUE;
8 y' {* i* x# _' \; U& m   }, l$ W  A4 G$ |: f
   return FALSE;
: Q: R% @/ X8 Z- }% Y}7 a. r& z, ]  [- K

' Y5 W6 h. q# P, ~' EAlthough this trick calls the CreateFileA function, don't even expect to be0 K, x$ N* |1 ]( E
able to intercept it by installing a IFS hook: it will not work, no way!
7 Y( p: m, E; e& R/ J+ s. P. ^% n# MIn fact, after the call to CreateFileA it will get through VWIN32 0x001F. \* U- E( V6 W. X9 U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 [6 }' s4 I0 X0 ~( S7 ^& d% W& ?
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 b0 }/ F6 c% }* b  [& Qfield.: w) c2 O3 L0 P, x& h+ p0 S) T6 _2 Y
In fact, its purpose is not to load/unload VxDs but only to send a 6 Y! o/ b, [- o
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), Z0 y: L; I1 j; n
to the VxD Control_Dispatch proc (how the hell a shareware soft could try2 I- B! P' H0 h8 N- g- Q
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
' C- @4 G4 Q# PIf the VxD is loaded, it will always clear eax and the Carry flag to allow( l; d5 [$ W( {0 @/ A! H/ Q7 a
its handle to be opened and then, will be detected.
4 y4 h+ Q+ k5 v! c* H+ @You can check that simply by hooking Winice.exe control proc entry point% W. W2 f5 r) B$ I: ^
while running MeltICE.
  t# k3 P/ g+ b  Z( Z/ [+ f8 H
$ q0 y7 \. M# K1 z; X$ ^. b1 G+ b- v$ o: E) W3 J. G7 r
  00401067:  push      00402025    ; \\.\SICE
3 @+ d. Z* _/ r4 m% X3 i" e6 l  0040106C:  call      CreateFileA, C0 I. j, W, W7 [
  00401071:  cmp       eax,-001  k: n7 Q- ~: c) A8 l8 A
  00401074:  je        00401091
  j/ u- J' u; r7 K* r
* F) u$ E% G6 D; d! U8 Z
8 m' F$ {  V! \  ^There could be hundreds of BPX you could use to detect this trick.3 K- ^$ E6 j. v/ O4 D/ y+ A
-The most classical one is:
; p. f0 p9 D1 A  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
; X' e% {, D5 _- m/ r    *(esp-&gt;4+4)=='NTIC'
+ M4 J7 F& M! o" `
& n. y: ^  [7 ]# Z  {+ s% ^- Q$ e-The most exotic ones (could be very slooooow :-(7 I" R7 {  u- e# {* X5 G# L  ^
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  / D' g! T0 l' ^+ ^
     ;will break 3 times :-(
8 D3 }! ]0 k4 D' z' p0 D; R+ z6 j. L+ [
& C/ h# ?  b5 [; l  ]; E-or (a bit) faster: - a2 N4 i1 L8 a- I" _
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
& d& F, Q9 V5 w
- Q+ f& F# R5 m   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  . h( o& t  p! l  f0 R6 _. S$ r
     ;will break 3 times :-(8 ~- d8 `& Q0 n. F+ F
9 G2 u, l) n+ C' l: s# L
-Much faster:6 ]3 D, C8 h3 `3 D, a
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'! ^/ T# g; T- O+ H+ q4 |- R& }
7 w8 S# q+ Q. P( p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen4 u3 e5 h" F) g/ e
function to do the same job:
3 y* ^& S8 {, q! Y9 |  f/ _2 P* w
+ T9 S; q- l! b  B4 ?1 \, H   push    00                        ; OF_READ
3 [8 p/ c$ S: Y# v   mov     eax,[00656634]            ; '\\.\SICE',0
# `6 M2 l9 \0 X& H/ o. Y9 p   push    eax4 c2 x* X, }/ K! h" Y+ V
   call    KERNEL32!_lopen
1 l& g* b8 S, E+ m0 g# ~# f' c: K   inc     eax/ E. h0 y# ^* @4 k. Q+ D1 f
   jnz     00650589                  ; detected
- q% K" F% V# w: f8 C   push    00                        ; OF_READ, m7 d% M4 S# T, P" M9 `
   mov     eax,[00656638]            ; '\\.\SICE'/ M8 Z% j9 I# }! B( X& J2 r
   push    eax! A( b, P* }7 F7 j9 Q, O4 s
   call    KERNEL32!_lopen3 k0 W7 S9 e" w- ]7 \/ W9 }+ U
   inc     eax( |  _$ e4 }6 Z0 \
   jz      006505ae                  ; not detected; t& n# R; q+ ^& b1 |

3 m- O  v$ i6 L
1 w% }: I) `: A  Q! l6 e; l4 }__________________________________________________________________________
  J* I+ G6 j) g$ m9 @5 _4 M6 I; O# Q
Method 12* R4 @+ W0 F( F/ ?  [3 d
=========$ q4 \2 e, {8 U8 L& b) n# @9 G

( I7 {8 q: P! N# `9 t6 l! E% VThis trick is similar to int41h/4fh Debugger installation check (code 054 U2 N" Z" [) c, n" C2 `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)  |: W" z+ ]9 u( ?
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 s: v3 f) |9 D- m
# o) n4 A- B5 V6 b+ [
   push  0000004fh         ; function 4fh! B! s' M  ~" |3 K/ ^- ~
   push  002a002ah         ; high word specifies which VxD (VWIN32)
+ h4 X" f/ @- p$ y& Z                           ; low word specifies which service2 `6 j( u8 ~' i" {- j2 L
                             (VWIN32_Int41Dispatch)! T7 I+ Z8 }, {/ y
   call  Kernel32!ORD_001  ; VxdCall
; ~$ @  {  h/ {, k   cmp   ax, 0f386h        ; magic number returned by system debuggers
4 f4 h/ Y$ ~& D" n! X   jz    SoftICE_detected
0 O6 r: d1 f/ s2 C1 A: u; |* i" Z
Here again, several ways to detect it:
1 x5 [* R: _9 Z2 z% x
, O2 P" [8 F+ |/ V' d    BPINT 41 if ax==4f
: J. a/ Y$ m; m) @/ R5 g! c
. w# s3 C9 \' U% ?    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one* L# J: ^$ D, g  \+ v0 \& P
" M5 l$ b% Q: ?; `
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A  S1 |- k/ X; n  @( F  _
6 M, M- U0 F. |1 }
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!# D+ e. c2 b* H" x% |! J/ k7 z8 D

& D& u! T# B4 s9 U  s__________________________________________________________________________5 n  @" m/ `8 x1 [, M

5 f) y- m7 |* r7 p! UMethod 13
# v# E4 x1 y5 q, i1 h2 M. T4 M=========
0 n# T5 ]7 ~/ E' W. T3 b
) A' e/ Q( x" o8 X8 UNot a real method of detection, but a good way to know if SoftICE is5 e7 J" @0 C6 F
installed on a computer and to locate its installation directory.
& x' I8 i1 {4 ?  G0 nIt is used by few softs which access the following registry keys (usually #2) :
0 L: G" U; z5 ]/ ~1 K2 X: x5 C7 m; {& n% f$ j2 ]
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" `9 m- T6 X; J9 n+ G  R# ]+ z\Uninstall\SoftICE
3 m- X$ I+ y/ g-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
. b) h' w5 b) _5 P# ^-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" _- M2 v- D3 c( w" ?' X' k; U
\App Paths\Loader32.Exe; [3 [$ [* Y- I8 ^* K8 {4 k

; U3 v8 ]# U( z" l7 y6 `
; ^7 ]2 `: @) b6 G1 F& ?# hNote that some nasty apps could then erase all files from SoftICE directory, N  |/ U& Z  y: U: u: ~1 u
(I faced that once :-(
+ d! C; }! i' ]% j$ `+ P. T+ W- x' w" W  s7 l. [; _6 k
Useful breakpoint to detect it:+ T$ s( m" O$ W& Q  O6 ~' s  x
( u. T. B" N' u" r; b; `
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'6 l4 F  M4 K5 ?  Z2 z
! s* Q3 p) C# g# f, [/ ?
__________________________________________________________________________
+ R# `% l8 ?& q4 S8 _5 j$ f7 w4 _0 @5 Z  s( m% a) Z5 \
1 @8 b* a$ q# o; [7 X
Method 14
2 W2 D& e. d- N3 D=========6 f+ g4 Z: I0 ]! D6 ]8 ~% x6 L
5 H/ X+ r: T* a& n* C* Z3 G0 b: A7 [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 J2 U. ], w2 F% q5 f0 a6 Yis to determines whether a debugger is running on your system (ring0 only).. W0 G2 Y2 d8 N5 S. H7 T! a
+ |7 A6 x6 |& T+ ]3 c
   VMMCall Test_Debug_Installed2 O/ t$ k9 S5 h& e9 R, m
   je      not_installed
; a; j& r; v9 M
$ g5 ^9 F0 E# p  u& s" kThis service just checks a flag.  X4 p- S2 A7 L; n' I# q* @# f
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-6 14:50

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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