找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
5 I6 W; V+ b. v" |<TBODY>
1 e- G; m% S: }9 _6 w<TR>
4 h- S- S6 B# e" p<TD><PRE>Method 01
9 [: i" @1 @0 J1 ]: Q! ]0 @=========
% y2 Z- Y, T6 R. [9 _
( g1 ]- K9 w, M, M0 t$ ^This method of detection of SoftICE (as well as the following one) is4 e5 `" Q% O4 j( M& F, R. s
used by the majority of packers/encryptors found on Internet.
6 X8 c5 e  `* h/ a) u  iIt seeks the signature of BoundsChecker in SoftICE
" n; \7 A* ^: ^" z( e6 W: L/ T0 `$ v  x- O7 F. _1 |
    mov     ebp, 04243484Bh        ; 'BCHK'
& f' K: {# D. |4 b3 P9 \    mov     ax, 04h, I8 j; }% s1 R' K. P+ ~
    int     3      
" J! T0 h1 T7 R) D/ ^    cmp     al,4
" l; k/ d, e. d8 X7 }    jnz     SoftICE_Detected
! t( H$ q- w) n5 p9 I7 }, `0 t9 P  |
& M8 x& F1 t6 j& x6 C- e& G___________________________________________________________________________
* a: b5 S5 k1 @$ O' z3 e
" t( u* m' D/ [' o) S+ I/ y( I% p+ iMethod 02  a$ j+ I/ E, a, r* W
=========
& ~6 U- x1 O1 a, J0 ]5 \2 a2 C. Y, g* c* E3 `/ B3 o
Still a method very much used (perhaps the most frequent one).  It is used
: x8 y( J' x# ito get SoftICE 'Back Door commands' which gives infos on Breakpoints,4 {; l6 K) D7 F% f  \6 Q& |
or execute SoftICE commands...; s1 \" L/ i% N: I
It is also used to crash SoftICE and to force it to execute any commands4 K1 |! q  ?, v( ]2 I  U
(HBOOT...) :-((  
3 p. z+ V8 Q' n8 @  n& r0 e5 Q" q. N& P9 t5 k) n0 N. F; i' G% n: A
Here is a quick description:
; z, A1 F9 c6 g" M-AX = 0910h   (Display string in SIce windows)' \% U# P! [+ _! o( B4 a
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
& \: h; `- f# g) A  Z6 z) m-AX = 0912h   (Get breakpoint infos)
' o3 j' R1 h% D7 ?9 R/ {( V* ]-AX = 0913h   (Set Sice breakpoints)/ x2 S" M# B8 _, g) k  b
-AX = 0914h   (Remove SIce breakoints)
/ p8 X  y9 D* q5 h6 O9 J% ?+ r7 v( B. s
Each time you'll meet this trick, you'll see:
" D2 x3 h/ m7 l9 G" `% r4 }7 _+ |4 O1 T-SI = 4647h& g$ P+ m' g; h4 H$ n
-DI = 4A4Dh
8 c$ Y; `( b2 k  I& YWhich are the 'magic values' used by SoftIce.
7 P' c- b# x% P/ o' c2 @* aFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: E  s$ V9 n% i% j3 W$ d2 {2 b1 K: s( m/ ~3 W' Z9 M
Here is one example from the file "Haspinst.exe" which is the dongle HASP3 X3 j3 p$ x! ~4 ]* R' G9 r
Envelope utility use to protect DOS applications:8 x& K8 f& g; g2 I4 N
$ b4 r" H/ Z, a0 x6 f

. D. C/ q7 z& G4C19:0095   MOV    AX,0911  ; execute command.
" e" `6 A2 b1 n. N; c( T$ A* B5 g9 k4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).' i7 W) H' ?* V( L4 Q4 `
4C19:009A   MOV    SI,4647  ; 1st magic value.! Z8 A% \9 `9 y% F6 Y4 J7 }
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
# V; ]4 ^5 m( t# r2 {) A4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
) ]" ~! M& n; H4 V- J: J' |+ J/ O4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute3 q/ V2 ]1 `: G; S0 J2 b
4C19:00A4   INC    CX
/ i8 L! ]5 m& L7 u7 g. Y4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
) R: t( B' q5 a; M/ s4C19:00A8   JB     0095     ; 6 different commands.9 u. ~% x. g- c( w8 |! w8 t8 F" _
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
* G7 c; h, @  P& D% T; `( G4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
1 q* A( U8 L+ s1 D- l' k0 S9 C2 n" w: t& }& V4 M+ ?$ S8 g( j2 o
The program will execute 6 different SIce commands located at ds:dx, which
% y. P( I0 w+ K/ ]6 Nare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
9 c& u' R2 V! J7 j5 |+ x& n
5 W6 |3 V5 B- `- l; e* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
3 C5 |4 D: g4 Z. f2 n___________________________________________________________________________9 _% Y' i) G% {9 T" u

) h& ~( J  V# [2 o7 ?5 `0 p/ Q! x* P8 d
Method 031 L- U2 a/ g/ U3 i# @" }
=========
# S1 u, Y+ N& l" w1 K
# F+ Q( M; a& V- z4 G- i4 s7 ZLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
- e# c- Q% j  i: `! N, a(API Get entry point)  H3 c. m1 o  Q+ k
        
+ Z& s. b% Q: R" u
6 C, c' j- g' M1 B    xor     di,di
, s$ E- m1 d( c0 x9 j( P( U    mov     es,di+ f, ?; O' E8 U, \, x. x
    mov     ax, 1684h       2 F  c/ F9 Z! [
    mov     bx, 0202h       ; VxD ID of winice
% S3 N$ T5 G# B# |! ]5 J    int     2Fh
7 n2 }2 B6 [! p; y    mov     ax, es          ; ES:DI -&gt; VxD API entry point) e, T/ Y5 t0 u- h  L; n& u
    add     ax, di+ h! P% ~" W. `' W" o
    test    ax,ax
) J# I+ C9 E/ o0 E! s1 D7 _    jnz     SoftICE_Detected* `9 b$ L8 m. b, y8 N0 ~% x

, o! G; Q; ?( V7 f___________________________________________________________________________
# W3 i- B# `9 O7 s/ t- o- Q* o' m: o& G' V) [2 _: u, S9 f
Method 04
2 l: E" c7 f3 @5 r* e=========
- ]: }3 T( C) ?
2 c- U+ s5 j, E$ m4 b7 pMethod identical to the preceding one except that it seeks the ID of SoftICE+ {/ H9 K. p9 ^$ P
GFX VxD./ |; d  }* ?9 t! r* W

0 ]# }6 G4 {3 u4 c( e( J    xor     di,di$ H! l! O$ R1 M+ N& S
    mov     es,di8 ]5 \, T- z! F; u3 Y
    mov     ax, 1684h       9 R" B  u: T/ d( R  }  u
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
' l& d  e5 S" M9 @    int     2fh
2 k) J4 ?3 n2 L3 P( }2 K$ G7 x    mov     ax, es          ; ES:DI -&gt; VxD API entry point) @8 U. Z3 P% r% E% j
    add     ax, di
* D; X& \$ c+ i0 Z; ~: u6 V3 ]3 i- ]    test    ax,ax
7 e3 ?  x8 N7 f    jnz     SoftICE_Detected
* g5 P& L+ @* V# J* K, Q4 ^
, |0 f) @- x7 K  J4 k/ K$ u__________________________________________________________________________
5 x+ K4 w4 w8 d" a5 s( O6 A" ~9 d
. `9 B% r: `) y- P1 P$ {
5 H; \- ^- M' V; m6 e, GMethod 05
" X$ @1 c7 Y  G. Z=========/ O% x2 D/ o5 P$ B" F: R- v4 X
- E3 `% L' z: O( }" K
Method seeking the 'magic number' 0F386h returned (in ax) by all system
8 S, t# ?' ?  _9 A% rdebugger. It calls the int 41h, function 4Fh.
; @2 _# [) w  M; G! V- D9 RThere are several alternatives.  
, k* [7 J  _, E% J$ c
* H& G, H5 g) k1 RThe following one is the simplest:: J- k1 F0 j7 B2 p9 x* l
, A% f) n5 v: ^* |, j6 f0 o" ?
    mov     ax,4fh
+ ]; L+ J- C2 P. B$ v" v    int     41h+ Q7 R" e" P; ?1 w* B9 E
    cmp     ax, 0F386
4 K% q! \  ^% O( \9 k* ^% i6 a/ K    jz      SoftICE_detected
( S# I3 q% R9 R( J$ p) m& N. ]6 I
% \. K; f  X% P4 _5 I' t
Next method as well as the following one are 2 examples from Stone's
  D! s, M: k  \1 U4 ~8 D. E6 t"stn-wid.zip" (www.cracking.net):
: A3 G+ B" ~7 H1 c: W! r! D" B/ P/ W9 |" N
    mov     bx, cs: X1 S* G+ q2 x& `( i/ k
    lea     dx, int41handler29 G) R- ?- r2 {5 @8 D% J4 W
    xchg    dx, es:[41h*4]
* g+ i8 {; y- K9 ~" f7 v    xchg    bx, es:[41h*4+2]
6 Z1 Q- P+ `- L; F6 W5 m0 e# Q$ [    mov     ax,4fh1 n# ^  Z9 N( r2 x5 Q2 P" R
    int     41h* @! G  d& \, i
    xchg    dx, es:[41h*4]
3 `9 B* _7 I% B* B$ \    xchg    bx, es:[41h*4+2]& o: B# e5 ~. o# m. z& F
    cmp     ax, 0f386h" p/ R5 l2 V: T# k. F
    jz      SoftICE_detected
  b1 s0 |, u5 o8 O; a0 u6 j( `
int41handler2 PROC
- X0 q+ I! u  u    iret0 q  B: K1 G  D" K( O
int41handler2 ENDP
$ U4 Z' u5 X0 h, q! S6 ?. }) ?6 x! o. a" q9 N
; p2 A+ H9 B  u2 \
_________________________________________________________________________
3 h1 M- c' L9 ^: P
0 D) a- c, E; y9 A2 |' }
5 e9 t$ O$ ]9 U8 V" D  I* ]Method 06; A, N& y9 l7 `$ F
=========
3 M- N& v+ |  e2 r
- b+ b: S( A4 V' ~$ W; K* _) l, y- I) O' ]) v2 l
2nd method similar to the preceding one but more difficult to detect:
0 m. K: q1 a7 U+ H0 @. I& n  s. H* B/ S
! p. V$ H2 R: y8 C. q
int41handler PROC) Q3 L& ?- ~( r# C7 U* J
    mov     cl,al; {6 I* c" a; ?7 \% [. ~
    iret1 p! q  U2 x: K) ^. O6 R5 L+ b7 d
int41handler ENDP) ]2 K1 O$ ?* t' K4 q3 r7 t" {4 L
1 T* G! Q9 j3 }5 ^
2 N0 U! ^. k* r: Y4 h  o
    xor     ax,ax
; [: }! s  p" n2 O2 f3 ?7 Z    mov     es,ax4 h3 @* n5 F: P" S/ H/ Z
    mov     bx, cs
0 t+ }$ I" g9 {) d" m/ S) U/ b1 A    lea     dx, int41handler1 p, d, |  M0 L) Z  V6 Y% q: R
    xchg    dx, es:[41h*4]
) b' [4 Y6 f9 o    xchg    bx, es:[41h*4+2]+ _& \) B1 ^' N
    in      al, 40h
# S/ u4 l8 K' ]. _* L$ g    xor     cx,cx) T: q# x) R2 {$ Y2 {
    int     41h* e1 g* \, A6 b3 ^, r6 v
    xchg    dx, es:[41h*4]3 T; I% I) H9 C3 U
    xchg    bx, es:[41h*4+2]8 Y! C7 B4 I  F6 M1 M
    cmp     cl,al
. F8 P2 r. j+ p) l. ?    jnz     SoftICE_detected/ ]; Q. ^% w# d; r

) T, j! U1 a8 i: s: z_________________________________________________________________________& D( `3 i' t. L$ K9 _0 e1 \) k0 t8 I
4 [! ~- G# Q& T7 Z( O6 G9 w
Method 079 t) t4 P4 c4 r; x; ~+ t
=========9 Q9 {$ B: O; T' H7 _7 ^5 c
) h; n9 V6 ^/ C2 e. S) K
Method of detection of the WinICE handler in the int68h (V86)
# N+ }" W) j' N7 y/ i8 ]! V) t( w& J  L4 @( @
    mov     ah,43h5 ]6 N7 h3 N! @! s3 Y( G
    int     68h8 Z1 a) I4 O: [+ b& Q- {6 q2 r  |  V
    cmp     ax,0F386h: s3 l8 n/ j9 `2 X0 S1 b) [- C
    jz      SoftICE_Detected
2 u! r3 j6 t3 f. G. H6 P
. y* o# ^. S# z/ p1 A' `! x8 U+ R" k3 n; n
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* {1 K4 h8 H# G. {  F. Z   app like this:' `+ T5 R5 L( l, J/ X7 B0 Y

2 G# d  t# {! B, `% x- Y   BPX exec_int if ax==68
4 ^+ g& s. R, q0 K; q" e9 G   (function called is located at byte ptr [ebp+1Dh] and client eip is5 m- N7 ?/ h! x' F
   located at [ebp+48h] for 32Bit apps)! g; W9 m; D' v- B+ ^6 A  T0 e
__________________________________________________________________________  m* p" d4 C% L

$ j9 E' y  q7 v7 G) R/ F' X* a& R3 \& X8 `0 ?
Method 08: f4 @# [/ n  n& B/ i
=========) s" y% y1 z  z: J

) t: b- m, B0 j, ^: vIt is not a method of detection of SoftICE but a possibility to crash the
" R1 C$ z4 A+ Z% Y" o8 p: Rsystem by intercepting int 01h and int 03h and redirecting them to another
2 b( p; r3 l+ g1 x7 P! P, b) _routine.
% V; v! g; ~' y& F6 x& P2 |0 |It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points8 D; v4 x2 W3 p0 i4 [4 [3 J
to the new routine to execute (hangs computer...)( t3 t- G4 l3 M, L
! W# b. E1 U3 @3 X% A, {
    mov     ah, 25h
$ f  B( B, O+ M8 A: \    mov     al, Int_Number (01h or 03h)
# K1 ^, {0 S! _. a; ]+ l    mov     dx, offset New_Int_Routine
8 |# s: B; r7 |2 v# }! a, w    int     21h* ?5 C$ e' y4 ]

% G' u; d9 M% C0 R% Z__________________________________________________________________________
0 U3 |8 f& @" P( }5 M& T, y- o$ W- T" S5 T1 m
Method 09
1 g8 C2 e: s8 G) b, r; }; Q=========
$ R3 i) w2 e) T2 f1 S; q9 x& q# J  s5 ~6 a* T
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only  }9 J- q( ?6 Q0 o0 W; h7 A
performed in ring0 (VxD or a ring3 app using the VxdCall).4 c% \3 N; i2 c
The Get_DDB service is used to determine whether or not a VxD is installed2 t  X! N" l# ^" P* K+ L
for the specified device and returns a Device Description Block (in ecx) for0 h' I' T, |6 \" L1 D
that device if it is installed., O. s' v6 G, s; o% X
+ L& [: Y' L1 q( H; `, T
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% p$ o. {5 D. C' X$ B# w
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
# f; R, f. j! n6 y; {   VMMCall Get_DDB
; y$ e9 r+ v, B" q* G+ [   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
: ?% [6 R8 o2 `4 q8 Y1 `7 Q; O
" m2 d0 [  \( R, k- LNote as well that you can easily detect this method with SoftICE:- S# E) }: X: g# X- O3 G$ r2 G* ?( @
   bpx Get_DDB if ax==0202 || ax==7a5fh6 I) z8 n1 \; D# E9 ~3 P1 ^
7 E: }2 e$ ]- F: j
__________________________________________________________________________- C- u, G7 t; {8 [% y/ G
9 p' H& B% q+ ]; R0 k& N
Method 10& ]  b4 u. e/ L3 J- x! M) Y/ |. ~
=========
/ q1 @0 [8 i$ a/ O  s6 R/ D# ?9 X
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with- T( [5 Q4 x7 l% @' p- {
  SoftICE while the option is enable!!
& Q( B- O7 |* O: x/ s' U
% v: D  ~* Q2 vThis trick is very efficient:
3 ?: r) L, x! Q9 eby checking the Debug Registers, you can detect if SoftICE is loaded
$ d/ G/ n+ g+ J) X6 S3 T+ E' |(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 m( D0 p) r, Gthere are some memory breakpoints set (dr0 to dr3) simply by reading their- G# s: P: B: ^& J
value (in ring0 only). Values can be manipulated and or changed as well7 \' x; M, T) V( z
(clearing BPMs for instance)
. j- m6 s& }* S2 q( O( f' r) o3 Y. N0 H0 e) L% h: H
__________________________________________________________________________
+ |  D4 j2 Z) a$ }& F/ ~
  ^* d$ c. D- ~) B3 DMethod 11
3 D. I/ `8 I% A- N% |/ x=========
+ ]4 i* B8 l+ T3 g
7 K% r4 Q6 ]9 EThis method is most known as 'MeltICE' because it has been freely distributed
2 e* G" `3 U4 x8 `/ I0 ~via www.winfiles.com. However it was first used by NuMega people to allow
( S2 q: o& _9 {; {Symbol Loader to check if SoftICE was active or not (the code is located( [0 p( `1 w  j, i
inside nmtrans.dll).: g, [' @2 w" [1 I
1 B, z. I8 R# k. `/ U3 j* K/ m
The way it works is very simple:
% q  j3 i1 v: j4 \  k' KIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for- N4 ]% b. h. M9 h. P7 |; I
WinNT) with the CreateFileA API.
, Z: O- J2 ^' {' B' V% v- q" Z
( ]  d) A2 R. M* C5 E% hHere is a sample (checking for 'SICE'):
2 e( N8 }! S: b5 N6 b+ l* M/ S3 t( h9 f, |
BOOL IsSoftIce95Loaded()
& R0 ~7 d$ R" p5 a3 I& A$ W% `8 \{
" m0 |6 A; n& Y' t2 Q% T   HANDLE hFile;  - t) m5 K% Z- I% Q2 u+ ]& c/ \  ~
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,6 l* ]5 B) p9 O3 ]! z
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
& O8 P  v! u2 E                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; H' R0 ], `9 g8 ^! C+ m
   if( hFile != INVALID_HANDLE_VALUE )
0 d& I) N6 L+ R( z& f   {
+ c% A( ?. X- I/ r! i: z1 p      CloseHandle(hFile);3 J: O  e6 N. G
      return TRUE;7 Z7 k" o" q& q+ m7 @
   }
4 i# D. O# y, C: K- n' t9 d: e- `- r   return FALSE;
" z4 V6 R& u. o2 _}" X3 z8 ]+ K# m9 p6 A! R- c  i( A
# C# I' c6 F4 S1 j, G+ k+ |
Although this trick calls the CreateFileA function, don't even expect to be9 [8 x4 j( N8 Y- {( a
able to intercept it by installing a IFS hook: it will not work, no way!
, X5 t3 S4 M7 d: d, X) SIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
: O7 S. k0 Q) N8 M  s  U( tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function), x# T6 d% e. R8 I# U/ [
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
) u4 ~# u! l5 ^) f  b! Gfield.
  W0 w- D, B  q' aIn fact, its purpose is not to load/unload VxDs but only to send a 0 c  Q& _7 j( d* i5 E
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
) f3 A. G" \% s7 D0 p0 Jto the VxD Control_Dispatch proc (how the hell a shareware soft could try
% ~2 k6 B1 E# E  Q  {( ^8 Bto load/unload a non-dynamically loadable driver such as SoftICE ;-).% o3 X$ C, I; w. t  z
If the VxD is loaded, it will always clear eax and the Carry flag to allow6 F/ B* u9 G4 V7 t# \8 W
its handle to be opened and then, will be detected.
3 `/ V% P1 E  \6 n8 w, ~4 n7 iYou can check that simply by hooking Winice.exe control proc entry point8 b' v  ?) u$ x5 [1 @( E
while running MeltICE.
& I) q9 V, e  Z! D3 ~0 d1 E' G% T. ^7 d0 ^
: p9 |' F. R' l7 ~2 T4 C9 T
  00401067:  push      00402025    ; \\.\SICE
# P$ ^# }7 n3 B, K/ Y2 W. j  0040106C:  call      CreateFileA
; u" L( C2 F6 ?1 _  00401071:  cmp       eax,-001
' l3 [1 Y3 G' E% Q- \" }* K  00401074:  je        00401091
6 `- v( v4 A5 m0 q) I
* Y& ?0 o1 p# E- y2 s! Q5 j. H2 w' \1 A8 [6 G- {. t
There could be hundreds of BPX you could use to detect this trick.
" }5 X0 [/ {3 c  P5 [( l-The most classical one is:
0 A- v8 w1 t# P. R9 e% n  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||) N7 I1 T# J$ t! A7 l  h; @- ~
    *(esp-&gt;4+4)=='NTIC'$ {- j: g1 f" U$ t, b0 }' g, \

6 q9 F% p" g2 b) k  K- ]6 G  \-The most exotic ones (could be very slooooow :-(
8 N# ]/ k7 g& O0 K   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ! t' V- F6 K0 w
     ;will break 3 times :-(
# G5 j& h' @. T4 G, \, P0 ]7 a& b( b! {! U( y
-or (a bit) faster:
" K, D% L- n, A# u; s   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')$ M. C6 P+ ~& G" i

3 y* p  ^3 _, y! a; \; n   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  $ b! `9 V  M- M
     ;will break 3 times :-(
7 a' b  q" q7 T! q* S7 b
  d* N% V  G" q5 k* K3 F9 f7 O-Much faster:8 V! w! N1 E" }/ q: H" x
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
9 N6 Q9 v3 M! w2 G# \# x6 l* i. h, z; @% \8 L/ E8 |2 L
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
/ x: j2 r/ R& o- E4 ~4 e% }6 vfunction to do the same job:" L8 h" V* E4 K8 |* }3 Q  z& e
$ C8 m) H. Q% X1 t2 P! Q
   push    00                        ; OF_READ
" k2 `6 U2 A( n$ @( A! Q   mov     eax,[00656634]            ; '\\.\SICE',0
; w; t: O* B$ f9 E) G* a   push    eax( {4 X2 g% ~. A2 S$ \. H
   call    KERNEL32!_lopen
! y! e1 Y/ `' e2 V, H   inc     eax# a3 w" J* y& {
   jnz     00650589                  ; detected+ \" B' c: o+ W8 `# b
   push    00                        ; OF_READ$ P6 N! W  {( ]. c
   mov     eax,[00656638]            ; '\\.\SICE'
! Q6 j9 d) R  n! |2 j4 A( w9 h2 A   push    eax8 P  g+ p% U0 ~: \1 D6 V# z" c
   call    KERNEL32!_lopen
( ^0 `( a8 G4 v; R( E) |   inc     eax
1 ]7 L& f) R  [1 z" G   jz      006505ae                  ; not detected
( m0 x$ h" H* R' A2 K  ]8 t+ Z2 |* E! @6 K8 R

4 C& n" W: K" w7 [__________________________________________________________________________7 j/ D$ }5 l, P. X) a

" B& s* l- W! ?Method 129 f; v. {8 k4 O( z- V
=========
$ M( w6 H: [& E- t7 F" \. d* c# Y+ h* R' t$ M% p9 m. m
This trick is similar to int41h/4fh Debugger installation check (code 055 p# G6 h5 W4 a& a2 E5 ?9 |
&amp; 06) but very limited because it's only available for Win95/98 (not NT)7 Z8 V6 x5 }/ f: k" o. q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo./ @9 z- f+ v2 O6 T9 D. X9 ^) B! p1 A

$ U) N. u$ ]* F! ?) B7 Q: X   push  0000004fh         ; function 4fh! m! T: Y1 S6 [1 T7 L
   push  002a002ah         ; high word specifies which VxD (VWIN32)
  |5 d4 B+ h% K# s% x                           ; low word specifies which service0 M+ B1 R5 k! t# O
                             (VWIN32_Int41Dispatch)" y2 I4 I) H$ S% K1 `/ E. e
   call  Kernel32!ORD_001  ; VxdCall6 z+ H7 r# {% H. {) V
   cmp   ax, 0f386h        ; magic number returned by system debuggers
- S( a) b$ S7 y( s   jz    SoftICE_detected
( Q5 J3 T; T5 h
3 C9 j# I9 j& e; l  {* xHere again, several ways to detect it:
) z, g% x- ]7 g9 Z" V* _! K: _6 R) l6 K: D6 @) V
    BPINT 41 if ax==4f
4 z% n2 q6 e- c: [5 J+ a2 w6 e5 I2 p* U9 Z" _
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
5 a' Z, D$ V' m( k3 V0 u
' M3 n, t- b! C6 g0 Y" e    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A1 A, n0 X: }5 n# B; L
: k  h" M7 Q9 f, i
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 ], V7 E0 p( b
7 R! q* B7 T+ k: v- r$ s( o2 C* b" I" S, T
__________________________________________________________________________
4 l3 U3 _9 m( \+ l3 l
) m5 e+ O  Z8 K* b# a* SMethod 13
5 u, [" v3 t, z1 M& ~=========
; I+ H  m4 F: W3 z! x" ^
3 S# b$ t" S& X5 k0 bNot a real method of detection, but a good way to know if SoftICE is) i  q3 h" b  S+ y
installed on a computer and to locate its installation directory.
' n$ C! c8 u( N% Q7 z# Q5 c9 K7 jIt is used by few softs which access the following registry keys (usually #2) :3 N0 c8 \# z4 ?
% X6 o, n! o1 g1 ?
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 {$ j1 R) |3 w! ^2 U4 S
\Uninstall\SoftICE% O& t$ l% P, }7 q' s
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE' z2 U0 U/ ?7 B, K* v  j) j
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- |/ W9 l% ~3 d' X2 N+ X  D\App Paths\Loader32.Exe6 F/ z3 n# B' K! {# l

- f/ e& }; _" j: q+ v; x( B" D9 U2 o- r" A, Z& _: ]
Note that some nasty apps could then erase all files from SoftICE directory
" B; N& u; P' ^" C(I faced that once :-(9 P9 r& y6 ^( Z% g2 p" D) q3 M/ w

; P" C) S, r% F( ?$ n5 e7 l% qUseful breakpoint to detect it:6 }/ I% R( u2 _/ `( ^. S) X5 F

  L# X- x% W1 Q+ K7 y& ~# t     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'$ a" p( B; Z2 Y! g, _) h

- h, \* t3 T; L% n/ _" f__________________________________________________________________________, ]* M" h! c* [+ B1 Q! W$ E

, K4 m4 v! d& Y- A& w* X
8 {+ K$ n# [" {2 N& m" d& tMethod 14 % n3 \( }& M6 l* i; v
=========9 T8 s) f" S: N* |( n7 d

" N* O* {! C3 `$ b7 O9 KA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 |0 M0 y( ~4 z, k6 nis to determines whether a debugger is running on your system (ring0 only).
$ M" k" y( @& P* Z
- w7 {: f2 S" l   VMMCall Test_Debug_Installed2 Y6 d5 C2 G7 u; w; M, t# ]9 A
   je      not_installed1 q( g3 L1 w7 a# x
0 w# U  }( Q0 {! B0 _& h
This service just checks a flag.1 L' i: e. K. U" A# P6 G1 g7 l
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-7 01:32

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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