About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
0 Q( W! S  W: |7 K( n$ `<TBODY># \5 u7 i. }: r1 i- ]! A. O
<TR>, ]* i# y* C) C1 d9 t
<TD><PRE>Method 01 : q! }0 y4 Q+ u9 ~
=========
5 Y2 J' W$ J) B4 }; P: z' n* y6 k) I# A* p, l
This method of detection of SoftICE (as well as the following one) is
: j3 |/ s. F  X# @& g! }used by the majority of packers/encryptors found on Internet.0 u* ]) L5 s7 V
It seeks the signature of BoundsChecker in SoftICE
# e0 e- Q) Q1 G7 C) y. }- m3 p! @5 }& L% Q7 l6 o
    mov     ebp, 04243484Bh        ; 'BCHK'
1 D2 ?4 }! _5 G( C    mov     ax, 04h
' _6 L4 _6 J: c1 ^* N* Q- {    int     3      
; ], Q+ t, b$ g& }    cmp     al,4
, \  H# _/ g* |% O- |* N* L    jnz     SoftICE_Detected
( S$ i2 h) |6 L% p8 H* v
8 h( O, Q" `3 [( D___________________________________________________________________________
  [$ l2 U9 \9 i2 D, N3 a2 {% Q/ c' E/ K- B/ I
Method 02
- s  w  z  [/ G3 J" u=========0 d5 _# k8 `9 \1 a6 U

5 M' A1 b6 H- j. j& e) _: N6 VStill a method very much used (perhaps the most frequent one).  It is used- ?$ R: @" j4 C2 J9 }
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,1 e5 g5 k6 Y: [+ \  {+ N  \% ^
or execute SoftICE commands...) o6 e, h3 i: o7 J% b4 r
It is also used to crash SoftICE and to force it to execute any commands2 a' X" I0 I) z# H/ Z
(HBOOT...) :-((  
5 M* X3 T, i# M1 F, ?  Q
; e) ]7 O$ k% w0 a! k3 xHere is a quick description:' X+ t1 d+ N1 R3 t$ y
-AX = 0910h   (Display string in SIce windows)3 s$ B/ L. l+ `* Q7 d& h
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)* k7 Q5 ]" l& q" r. n8 r
-AX = 0912h   (Get breakpoint infos)
9 M$ J: ^4 J. G# o-AX = 0913h   (Set Sice breakpoints)* h6 D: O' |0 {  m* [) R7 d# z  ^: R
-AX = 0914h   (Remove SIce breakoints)
2 s0 [# P6 h& ^5 _6 y; @% ~0 p  }! s8 f' l% o- x( s% X1 y# ?
Each time you'll meet this trick, you'll see:
, o# N# E- z/ o  h-SI = 4647h' A( J. i1 ~# B* w$ t4 R6 t9 G
-DI = 4A4Dh
1 D+ G9 V) [& S6 cWhich are the 'magic values' used by SoftIce.  e; R: W) \* K% N! _  o2 i
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 R1 K+ K( {$ q7 B
; T% `7 S. t. Z1 K
Here is one example from the file "Haspinst.exe" which is the dongle HASP" m* |0 U3 |: X- @: t! ]
Envelope utility use to protect DOS applications:
$ c% E) d" p" m; h5 C
. m7 l1 K/ C% s3 J, n- v8 {, O+ [% L9 j/ y5 ~" K6 u
4C19:0095   MOV    AX,0911  ; execute command.
4 A: c/ o7 I, K$ N3 V4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).* }- m7 j, Q/ H+ `
4C19:009A   MOV    SI,4647  ; 1st magic value.7 W& V, W1 Q; a& R# R9 R9 Z
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.% W% B' E; |1 ]
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
: w% h) i, B( a4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
! \! E9 U. C- p+ J& _) j- i4C19:00A4   INC    CX
8 A6 ^1 q; D" v4 d4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute+ p8 }% ^' t/ Y$ O
4C19:00A8   JB     0095     ; 6 different commands.
  q- t! N  ]# |0 V4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
' X' {7 m5 _& g2 V( O- {- S4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
; t, ~$ F7 z/ g. B, r8 X' c
# v( f5 |5 U# ^/ r1 \4 R7 c+ ?The program will execute 6 different SIce commands located at ds:dx, which
$ b9 `1 J) y: Fare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.& v8 A/ F8 W2 [7 G) ~6 C
  D6 `4 n! K9 T9 B8 I) x' c
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
# Q  x2 m8 b* \1 r" E4 U$ z% q3 j___________________________________________________________________________
1 V* _& T& G0 d% @2 ]! H! q3 Q/ }$ ?8 }, O

* g  X5 B* `/ ~+ R' @Method 039 S2 b# Z2 E4 [, I$ p
=========$ s) w. p: n# w$ \$ n
3 |1 d2 K) k4 B; w$ B6 C
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
! K# }4 V( P# H(API Get entry point)9 t+ ^$ d3 V$ O8 |' e
        , z# p) @5 u, j1 t% v

3 I7 g' R' p0 a% @; d    xor     di,di" @9 _# ?$ X8 p% h% q
    mov     es,di
# @7 L2 U1 Z! y- ~  N$ I9 T0 B    mov     ax, 1684h      
" p$ b8 y' i: d# J( c    mov     bx, 0202h       ; VxD ID of winice) P: n. a$ V6 r7 K* p0 C, G* c
    int     2Fh
  o8 r. Z  h3 m) {* u& a% E6 f    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 R2 N; J, ~5 A" a
    add     ax, di) g3 _5 i, d6 A. m8 r
    test    ax,ax; q' O$ L  F$ z2 o
    jnz     SoftICE_Detected
7 k) n0 d' E, `8 I8 {' W7 j4 T7 ^$ B6 j( _; s$ o5 a
___________________________________________________________________________
* ^; X" b3 |5 m( E5 P* F/ m. t5 ]. ~, a0 l. h3 J
Method 04
" W) H/ m9 H9 h* Y- {4 ?4 C=========8 f" C  W; s6 C) ~+ |/ A
9 z" [% d! K- }% G
Method identical to the preceding one except that it seeks the ID of SoftICE% H% P9 G* p" S- m" p
GFX VxD." R; A& h: `7 [
/ P; i4 K, T9 m: j: ]$ l3 [0 m
    xor     di,di6 b3 r- C) A/ f& W
    mov     es,di
1 n, ^6 e9 D' P2 G$ Z& L    mov     ax, 1684h       4 l3 g3 l6 l& M) ?: ?5 B3 y
    mov     bx, 7a5Fh       ; VxD ID of SIWVID1 m4 t6 ?/ s1 Z: X% G' ~9 f
    int     2fh
' a* D$ F( C4 p: n. t0 I    mov     ax, es          ; ES:DI -&gt; VxD API entry point3 r+ \# Z7 D: N6 \, j2 G
    add     ax, di
/ B3 E" u2 i) p. `    test    ax,ax. k6 k* `- O9 b' M9 s) K; i' P9 J
    jnz     SoftICE_Detected
9 U* T9 {' I9 H7 N2 [5 R# L( L" o! C
__________________________________________________________________________0 C1 f3 z8 p; b( Q! B3 l
+ Y0 `) E% _/ H
: F4 J' P& Y% x. Z
Method 05
5 t  x( K* L; R& ~! b- P$ A=========0 S- v  v0 c  n+ s' X

2 A5 D4 O. j) jMethod seeking the 'magic number' 0F386h returned (in ax) by all system3 f7 g+ @" l0 ?% [
debugger. It calls the int 41h, function 4Fh.
* S: U0 s7 ?2 I. jThere are several alternatives.  % u6 N* E/ \( l6 ?0 e
5 {' M) n, h; y. L$ h
The following one is the simplest:
+ S0 B- Z4 v4 {5 x; H' W% B5 C: H- D% C: \+ w
    mov     ax,4fh
; I) K0 W+ b5 {, ~% p& k2 {    int     41h
1 [/ _; [& E3 A    cmp     ax, 0F386" N/ |* r/ W) d8 P
    jz      SoftICE_detected! A  n( C) q" n! @2 u  y, }

" P, i. I4 G2 ^' Z5 S
" S! h' Z! F% K% d- S& INext method as well as the following one are 2 examples from Stone's 1 H. q0 Y: W( L2 r& u4 x% d3 x: }
"stn-wid.zip" (www.cracking.net):& q1 P# C0 c1 ?3 J- y

( T$ F# N2 v. n- I    mov     bx, cs; _) ]4 x/ N$ }, u2 ~
    lea     dx, int41handler2
3 n. r2 v9 f. |, A9 l4 u    xchg    dx, es:[41h*4]
* S$ p% Y4 e% V) q* {    xchg    bx, es:[41h*4+2]3 w; u/ H) K3 ]# q/ R  C, P2 ^2 }, n
    mov     ax,4fh
$ e# Q, ]+ D# o3 V0 U    int     41h
% s# o- `! Y1 ]& \    xchg    dx, es:[41h*4]1 `8 N# K; r6 a
    xchg    bx, es:[41h*4+2]( ~; n$ c. i; z9 Z* k8 p% m  ~4 Q
    cmp     ax, 0f386h
+ i4 K' f* H. E" q& _. U* k    jz      SoftICE_detected1 B/ \. T, E/ z3 U5 j: l# I* E

! v) J' z3 g! Fint41handler2 PROC
, h) A) p' q2 x8 Y    iret
$ `7 y, G! l( q8 Rint41handler2 ENDP
9 r* c* V( ]# I
. M7 J7 y6 L; [* Z( I
2 g8 A1 d! y1 T' @% l_________________________________________________________________________& M4 T: A8 P# R* R$ W. ~

7 w3 N- S: l/ n9 f* \7 Y  R( D( g
Method 06; o6 j2 H& \+ H. {
=========9 o- {. K9 P( E( ]" f% ^

' `  t, c+ {* ?, t9 |$ E
( r! ~$ D# x' x$ `2nd method similar to the preceding one but more difficult to detect:1 f# v; h1 L8 r2 t

6 W& w5 c* l8 B9 T/ n* p
* [2 X7 Y% A; i7 Q# t% M* Z0 Fint41handler PROC
2 o! \6 V5 o+ i$ H    mov     cl,al
3 w( H+ h. Q! G* b# h    iret
2 W+ n8 @2 q# f' Mint41handler ENDP
! W6 V: T8 r% h7 l6 s+ t, [4 Y9 X0 `) q/ b( s, h5 C  P: B9 A$ M

. ~; u( o+ W; _2 O* C  X" `    xor     ax,ax
4 I- c" k# K+ u+ G. g* ?7 k    mov     es,ax- K$ ]' K7 e) a/ a, J' f" ~. F
    mov     bx, cs, O2 r! l% e6 J/ a
    lea     dx, int41handler
! Q: \6 w4 D5 }1 ?0 X" S8 l/ P    xchg    dx, es:[41h*4]
* A: W& O: p) S9 x    xchg    bx, es:[41h*4+2]8 Y, L) P9 ^) A* l! O9 e
    in      al, 40h" h) ^: u/ q% j0 }
    xor     cx,cx5 r, }5 u- c5 ^2 k$ }
    int     41h
, }1 Y' D+ [8 v+ N/ g    xchg    dx, es:[41h*4]
# i4 t7 b, `+ r' v6 p    xchg    bx, es:[41h*4+2]5 k4 w) C5 c9 {% y
    cmp     cl,al
) j; h4 N0 M3 _$ N* y6 M    jnz     SoftICE_detected! b5 G# s5 Q3 z' j* Z4 g4 K8 X
; {; U/ D* j  x# a/ A
_________________________________________________________________________3 g3 n8 o" k( B, H( H% o! E) G3 c
* Y+ ~, g: l! C, H5 _
Method 07
7 o# k0 ^# e, \4 h' Z/ H=========( j1 Z9 Q, u$ |/ f  H" Y
* \' w1 w$ J  T1 O/ Z
Method of detection of the WinICE handler in the int68h (V86)% V1 X6 F2 o; c& t  Z& e; R
/ W3 Z) f; y' d; z' W
    mov     ah,43h+ M- @* j4 ?* B
    int     68h
% Z# }' R' T2 L6 I; @1 J% s! K    cmp     ax,0F386h. a4 O5 g9 U& i" E! X, _, k/ |
    jz      SoftICE_Detected
, q  j( I: B, i# n0 P! v) v( |' _/ o7 ?' y7 h
# m) s8 T9 N) e) f& t" H
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit# K4 Z( W9 {7 J( K3 C8 [1 Q" P  [, j
   app like this:; K0 u9 U1 Y  r$ o$ f: H

: |$ n3 j& o& l( a- s   BPX exec_int if ax==68
9 V, M1 S4 Z/ z( y7 }1 V$ F   (function called is located at byte ptr [ebp+1Dh] and client eip is
3 X1 X& ^. Z6 x( J- o  Q7 e! _   located at [ebp+48h] for 32Bit apps)
- o9 V8 V- O: Z& x. ~__________________________________________________________________________. _' n8 S" j3 E- _6 w: W- J

. b5 _$ u% Q' p2 e4 J, R1 K+ F: h* W; y4 k6 U2 M2 x8 q
Method 08+ u$ J7 n$ O' c- `
=========
0 e7 A- K& V; `* G% `9 R% l2 p
; [* F& _; g1 ^9 x* C. mIt is not a method of detection of SoftICE but a possibility to crash the* G- A/ _# m1 f' n
system by intercepting int 01h and int 03h and redirecting them to another  j/ N# h. A. f7 k: y, o
routine.$ v/ z4 d8 Q$ L7 `! _9 \
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" Y) o, F2 ^" m1 n
to the new routine to execute (hangs computer...)
. B2 ^- O1 O* y7 m  ]( D: h# m5 e# s- \+ o  R0 j
    mov     ah, 25h
& m3 ^5 G& c6 I2 }    mov     al, Int_Number (01h or 03h)
% g7 ]4 y' |3 X# J" R' V  W( F/ H    mov     dx, offset New_Int_Routine" n6 V8 t8 F% C  I9 Y* z; w
    int     21h
! ]! u5 f0 O4 S( Z& q6 B4 J: a- B+ M* X
__________________________________________________________________________
6 v- a2 t0 v$ E9 h2 k3 i* N! L9 n4 X8 P" J
Method 096 k8 C5 k; X' g# I+ y
=========
; \) A' q" {, |' e3 e* R* ^* Z) H
2 b, k9 c( }! a( j. hThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only" |7 H1 ~4 ^% ?7 B% v0 R% h. ^* P
performed in ring0 (VxD or a ring3 app using the VxdCall).
; H5 Y5 l: {; gThe Get_DDB service is used to determine whether or not a VxD is installed
0 i# p. W" a. ~9 ?% o4 X) Tfor the specified device and returns a Device Description Block (in ecx) for
5 K) v. ~# h( G2 Bthat device if it is installed.$ }0 s- d0 y: v
: T1 q" W# V: h4 V, H
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
4 W7 k/ ?) ?# O$ i: t$ \! ^- U. _8 x   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)3 m1 G1 j+ o1 L5 L) Q! D0 _' z. B7 S
   VMMCall Get_DDB
# o8 o! I- r/ z; D) j  Q7 n# P( p9 m   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed( T/ H  Y% d: O

! v# p8 a! {* |6 S0 yNote as well that you can easily detect this method with SoftICE:
9 S9 T" f0 j1 [   bpx Get_DDB if ax==0202 || ax==7a5fh
; Z% Y" X7 [/ `8 j3 l  t3 K0 t- y  A
__________________________________________________________________________
( d( j- \/ [$ n. }2 u" \  y) {/ p0 F0 S
Method 10
) I7 j) i: I: G9 E9 ^=========2 ~8 }3 t9 K% i( h0 h7 v
# c8 k, [4 D$ o
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
) {; m8 L& w( P6 j  SoftICE while the option is enable!!
, t, T; _1 Y3 i4 f$ I, Y! x
! K3 M) _0 ~) R% H0 \, b* wThis trick is very efficient:
& ?, ]+ A. t) x( E" ]by checking the Debug Registers, you can detect if SoftICE is loaded9 k9 E" A! a7 p: o9 b: ?& V
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 G' z# P: e2 l, \3 a9 B$ A
there are some memory breakpoints set (dr0 to dr3) simply by reading their; C& u8 A& [1 m. ]- j8 t( j1 v
value (in ring0 only). Values can be manipulated and or changed as well
$ {2 j& \% W8 N7 e. x9 H& z1 @(clearing BPMs for instance): n6 q/ f  p$ j$ k/ B5 r

& C  ^$ i: z) l; g1 H& {__________________________________________________________________________
  m, i; k( ?9 C4 J% y( }; @2 K) n
Method 110 I7 h; Z4 ~9 a$ h5 Q  K
=========
9 }6 i' G2 R, D' _' `* n$ u6 l
& I4 r! U3 S8 u0 aThis method is most known as 'MeltICE' because it has been freely distributed
* x& d0 x/ }$ v2 U# W( K  |via www.winfiles.com. However it was first used by NuMega people to allow% [! @* I! r9 y" H; \
Symbol Loader to check if SoftICE was active or not (the code is located
) M2 ?$ T3 e5 X1 U8 U0 `5 }- w3 R& ninside nmtrans.dll).; P) z$ w. Y8 D
7 {' s- r4 [/ c' t2 m3 H7 c
The way it works is very simple:- E) [& f0 ?. m! a5 D
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 i. p( `: B# ~" W' w7 s3 z, O
WinNT) with the CreateFileA API.
3 r& y( f6 i8 i  V6 J  L1 b+ [; }, I! S2 _7 ~. b# u
Here is a sample (checking for 'SICE'):' F7 R% A& Y' Z  D2 i2 Q4 `8 a2 {

% L6 P# J# H, {; y. C  _BOOL IsSoftIce95Loaded()' s) S  ]! f8 N. A$ G0 x
{  y  K) M. l# u* ?
   HANDLE hFile;  0 K8 P+ H( z' u/ W
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
  B' j4 z& m& }; W5 ]                      FILE_SHARE_READ | FILE_SHARE_WRITE,
* C5 {/ t) \  V2 c" t. |1 y                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);* n4 W6 E5 M9 K2 x% P: }
   if( hFile != INVALID_HANDLE_VALUE )
0 r  x7 ?% X2 B5 q5 m  i   {
* m- q2 S: s; ?2 m7 g      CloseHandle(hFile);! M# v; }6 [  S3 ^! e. w$ x
      return TRUE;
* a6 w% L2 O9 q& A2 N8 Y! I   }/ k  M: r. v8 z9 Q; U1 |
   return FALSE;  b5 G/ h; P0 s
}
5 H& V! Z# Y$ {
0 ~! K3 i  p% t# [$ l2 p( ?6 _' IAlthough this trick calls the CreateFileA function, don't even expect to be- p4 w, o. X/ S
able to intercept it by installing a IFS hook: it will not work, no way!
- ~1 @. n7 b5 Q/ [/ E4 dIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
$ a- A9 g& a% w: `, rservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
7 t: U! O6 O, R0 d8 l* x1 Rand then browse the DDB list until it find the VxD and its DDB_Control_Proc2 g1 n0 N; _$ Z& j
field./ D! u. o* p* Q) s5 J  |. b6 K
In fact, its purpose is not to load/unload VxDs but only to send a
/ |) \( R. I7 F$ R4 `W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE), b) Y! ]- O3 G4 B" s+ T
to the VxD Control_Dispatch proc (how the hell a shareware soft could try9 e/ N  q0 Z4 ]
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
  j/ ~+ M! A0 d/ r5 {& V5 J% iIf the VxD is loaded, it will always clear eax and the Carry flag to allow
2 @2 r6 t6 m) {( n  L3 Sits handle to be opened and then, will be detected.
( d* a  W6 b6 ~2 \, o8 dYou can check that simply by hooking Winice.exe control proc entry point
1 S% m4 i/ D: Q$ G2 Gwhile running MeltICE.* n' ^: g2 u; G; M

9 z$ A) M4 y' N! ?8 |
5 x9 ?  R6 x) Q" V( o9 E  00401067:  push      00402025    ; \\.\SICE* d5 x: v: {" m- q) j4 a2 L
  0040106C:  call      CreateFileA
5 W4 K; B' \: R( S! o; V  00401071:  cmp       eax,-001  H! k- y+ o% _3 E4 D. u* l9 e
  00401074:  je        00401091
' R  }* T6 z% X% F2 n% ]  F' S
8 k! N1 b  L  E% Y& t0 n8 z0 c/ D4 l1 o: P3 _0 U
There could be hundreds of BPX you could use to detect this trick.5 R4 E" O, L" M) A6 D3 W
-The most classical one is:1 \: l: p* i1 D: g8 U( h  ]+ }
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||/ _2 M! H2 ~! a! ?; }' S
    *(esp-&gt;4+4)=='NTIC'$ @- _5 X- T! Q; w8 u8 _2 Y: x* n7 U
" j4 H1 W$ r' ?. }3 C
-The most exotic ones (could be very slooooow :-(0 K) c: p+ w4 `$ ?: |% c/ V1 W8 Q
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  - G- K% ~% V, n; W
     ;will break 3 times :-(# V& I/ z$ v% m" C( m- ]3 `
& [- @5 \/ g8 R1 w
-or (a bit) faster:
6 t$ b2 V2 m" v/ R   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 s% G1 g3 n* T( i' c, n. w6 k9 y

( o0 y* k  z0 G' h$ [; @* V' X/ z- ~   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  1 K: E% N1 x) l
     ;will break 3 times :-(4 y; ?. T. i! z  G/ [
0 g2 s( E4 P6 a$ [! n- L
-Much faster:
5 N% k" Q, C2 ~0 w) E, m; ^& c   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'0 I- H2 C/ ^3 _
0 S/ M0 M- u5 P* ]. z6 J6 w( w1 F! o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
# w+ J' a5 z3 R* B4 X# vfunction to do the same job:& W9 ~) v( \/ M  H4 G+ [" o& G% `

! P9 V9 i) I" [0 ?1 K   push    00                        ; OF_READ
/ r2 x8 \/ W9 M$ {& Y: ~- @, R1 X   mov     eax,[00656634]            ; '\\.\SICE',0
4 }2 d; K8 S8 n* A   push    eax: {# e; M' x2 Y  K+ R
   call    KERNEL32!_lopen! d  j9 t9 Y9 g0 ~
   inc     eax/ v9 G9 v8 p( \: Z( Y8 _) B5 \
   jnz     00650589                  ; detected: U8 n- ?6 b1 _+ b$ o" \
   push    00                        ; OF_READ+ t4 Z7 ]  X, ]% ^$ F" O7 B4 U
   mov     eax,[00656638]            ; '\\.\SICE'
; U/ J$ m  ~* ]7 B3 q! Y( t; \   push    eax- B9 k; m2 p3 H; P
   call    KERNEL32!_lopen' X" ]3 v; Z4 J9 y& {
   inc     eax# @$ s4 x- m9 Q# K) N, x! E7 `5 ^9 t
   jz      006505ae                  ; not detected
* Z# X7 @: ]- u6 {* \; Q. t6 b3 \0 t6 F
! K: Y5 l7 W+ r5 k& b
__________________________________________________________________________
9 a2 T. n9 A5 M8 z8 o# m5 E& p
0 U4 u$ h( \2 z# N1 J8 E# GMethod 12
- w6 f  i) k! i3 E# U=========
5 L8 G# K' I' i+ N7 o. O; X! t2 y+ o/ D
This trick is similar to int41h/4fh Debugger installation check (code 05$ C2 q% X( c6 @3 R9 p5 D# N1 }
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
" E/ C  i  Q% A( X: e# i, i: ras it uses the VxDCall backdoor. This detection was found in Bleem Demo.5 K$ Y5 }% t* G& z0 _# @( O
- g4 @) Z4 V! C& ^  g/ I
   push  0000004fh         ; function 4fh. M7 R) |8 q" M: h0 Q+ C3 D# _3 c1 l
   push  002a002ah         ; high word specifies which VxD (VWIN32)9 A" j0 ^. S6 d) c% W5 v  N
                           ; low word specifies which service
* ~* e/ C# y6 j, }                             (VWIN32_Int41Dispatch)
( N0 Y2 d& {% f   call  Kernel32!ORD_001  ; VxdCall: v4 I* F" J" V9 X5 P/ G3 `" ]+ i+ S
   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 ]- p! ?9 o& {! M   jz    SoftICE_detected, m, F% k$ e* z- n! Y/ R5 p' F

' |" R3 F* a9 z$ p9 t8 @  UHere again, several ways to detect it:
! O2 v, M3 l6 ]1 Z% c; Q
9 R" h! R# \- P* @  U    BPINT 41 if ax==4f
4 b2 l, T2 z, \( @
. M, b% b. X. U( |. j" ^    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one" k* C" _. r" P7 O, K0 T
$ u7 t' P! X% F' c5 Z
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A: Q: a+ r' Z/ b' k; J

, s  I% U! [7 c1 f1 P    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!1 L7 D$ M4 v1 R1 f$ d8 y. o' t

1 W. q4 Z' y" W. E2 x% S& z! o__________________________________________________________________________0 q8 i1 N/ y; M4 n( s1 i. o

) o: m$ _+ u% a, y( q1 wMethod 13
) d8 X8 R- g% k* w/ J9 X=========  B3 \% U' t1 Y7 X3 P$ l. `1 G/ M$ N

6 l( p6 b7 P0 ~; O% @7 Y6 Q" C- d7 DNot a real method of detection, but a good way to know if SoftICE is3 S: s8 n/ W& G6 U% g
installed on a computer and to locate its installation directory.
4 {5 m3 ]  G1 X3 d. NIt is used by few softs which access the following registry keys (usually #2) :
" j6 ~, T5 ?$ V, Q( w/ B/ i  R: t2 Z- V& `6 [# b7 [5 O( j6 P+ V
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. W6 Y/ f: T. L+ Y) q. o5 v\Uninstall\SoftICE
2 J2 F# N& L% _. k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE% P8 Y$ s3 R! x7 N+ U9 s- b' W
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  y2 f& s/ }: j/ `3 O1 `* }- J7 j\App Paths\Loader32.Exe* w3 c+ S; Z# E, k5 O( Z& v; _- X
# F! `- p8 j% B. W3 s' ~  e$ ^; v

" I: W7 U3 K+ h, y/ t4 ONote that some nasty apps could then erase all files from SoftICE directory' @/ B0 W# e* c& `, U. x! y* G0 [
(I faced that once :-() r: {) ^# G+ a: c' P/ |

3 I' d1 @( ?  A" b  O: BUseful breakpoint to detect it:
8 q0 r5 A( y# |0 Y3 i( |* n* C* p( q3 U. s2 t" R
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'* O) F3 `# O- Y+ d) ?

' L- V1 S9 z7 P5 b4 c__________________________________________________________________________! p3 y1 U0 b  F9 ^

5 J3 D8 N; O! {  f4 H$ x8 j* ^- @/ P% [5 P9 q% ]+ D- r3 Y0 `. o
Method 14
$ R* l3 l9 k! z0 N- f=========
# i% D* @, w9 l/ D4 _8 b6 ?# f/ I4 P# f4 x  H3 C9 T
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose9 v' x- B% h( e# ^. Q( H! H
is to determines whether a debugger is running on your system (ring0 only).
3 K9 k; ?6 V$ E- A' I8 n  |& L: t& c/ k. h2 \( ~* g. H4 \
   VMMCall Test_Debug_Installed; ?4 p1 Q8 q6 N
   je      not_installed
: B$ S: g0 c2 C/ \: T: q& T
) w5 C7 k, T- q: S/ MThis service just checks a flag.+ J  o: i+ O! t, J6 m/ G3 ]
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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