About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>! f$ @/ Z& H+ }! `% m+ Z
<TBODY># E+ y+ R: Q2 W) b% o- q" t6 s
<TR>
  ^7 ~+ X- L0 T  l: j& o0 L: M<TD><PRE>Method 01 , a5 u- ]7 X' P
=========& @1 U5 V0 y/ H7 M& ]: l

2 H9 ~& g- p' P' W6 D1 o' _# m$ v6 m3 [This method of detection of SoftICE (as well as the following one) is
- S6 E9 \1 X7 T: ]used by the majority of packers/encryptors found on Internet.
' t' J! \: W% j! r; [1 ?It seeks the signature of BoundsChecker in SoftICE! B& B# ]  R8 }6 N3 F! b% b
$ q  x1 ^" x+ \2 E" W
    mov     ebp, 04243484Bh        ; 'BCHK'. @6 m5 O+ s& Z0 j) ?/ l
    mov     ax, 04h, b8 J6 F3 i. i- a
    int     3      
' Y& L1 ^# |1 @$ k; G    cmp     al,4, W& S7 ~, S7 B4 ^! C- D
    jnz     SoftICE_Detected
$ j# k4 J7 l% ?
  ~' k$ w6 n+ M" [$ R& D9 t___________________________________________________________________________
5 [# v7 r9 p% y9 A$ Z5 _) {: ~
$ @. l3 M: o1 k- BMethod 02
, C2 y1 n& C) o+ {4 r) @=========
' Y1 i# {; o' x# h5 H# }) R1 K% p9 f& ?) w8 F' e
Still a method very much used (perhaps the most frequent one).  It is used$ H2 ]5 N2 A% O  y7 c# k: Q1 ]
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,  L! J* G! |* m2 C% o$ [
or execute SoftICE commands...
# i' P5 I+ o$ m7 y. o: M1 c# NIt is also used to crash SoftICE and to force it to execute any commands
; g! _0 P* T% [8 w(HBOOT...) :-((  
) i9 c0 B  F1 O+ E; E8 P% z9 J
9 J+ B% f* j. g0 P: ]+ [9 DHere is a quick description:$ ?8 H4 A' |: }, x+ |; |$ C! L
-AX = 0910h   (Display string in SIce windows)
' L4 O  t; O* c- [; c-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
0 @0 w& F" M" g, _: O8 A0 r1 i-AX = 0912h   (Get breakpoint infos)
4 S0 ]' f+ r  q# }0 Y-AX = 0913h   (Set Sice breakpoints)$ W9 p# \# j) L6 w
-AX = 0914h   (Remove SIce breakoints)
; a. ^/ q7 Q( C
1 d2 S5 m1 _  e- LEach time you'll meet this trick, you'll see:
! j% W; n! h& g! U: l$ w* l-SI = 4647h5 W6 p( F$ l* E* `+ a* Q
-DI = 4A4Dh: x) c# T. N0 A- v: i+ ?. I% z
Which are the 'magic values' used by SoftIce.
6 [) w6 @1 l( fFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 S3 q0 L# s. Y2 _- U: H" _) I1 \9 l
4 ]5 @& D3 w& d+ w6 |
Here is one example from the file "Haspinst.exe" which is the dongle HASP
' A/ e( C7 P5 o6 K, O* [1 U+ T3 y3 }9 IEnvelope utility use to protect DOS applications:  z2 ^$ l: a, W. ?6 j. D

: b7 g' d. P9 R! Y: q
0 C* t: T1 U) w# f  l4C19:0095   MOV    AX,0911  ; execute command.
7 |& B6 ]4 T' @, \' d+ C9 z4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).8 ~, I1 `8 X4 M9 i8 @# A
4C19:009A   MOV    SI,4647  ; 1st magic value., j! B! u1 \1 ^/ D$ @$ |
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
* P' \% K3 N5 i" [* J. R# H( X) m! n4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)6 l% f% W! R& i. j
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
8 n$ V5 E1 P8 B0 i) z; a4C19:00A4   INC    CX
; k: u& x1 R9 L% f/ i  p4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  M. p+ T) o# N% r
4C19:00A8   JB     0095     ; 6 different commands.
3 y: m( B" G0 ~1 t4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
5 a+ E  Z* ]* A$ h6 `3 c8 N4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)% s9 P4 _. f6 F: i- u3 `4 h- p
8 |: D/ F0 I8 ?8 [
The program will execute 6 different SIce commands located at ds:dx, which
5 T. [3 S$ |4 c6 care: LDT, IDT, GDT, TSS, RS, and ...HBOOT.8 Y- F; K. H# ]" ~

9 {$ x8 `: `! H4 k& i2 Y1 n* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 n& u; Y  P* N$ i' f9 s
___________________________________________________________________________, e# w  `- C4 E4 {2 l$ N

: q, \( ~0 I& @+ \2 A3 v! Q
6 {; o( d, e' i, g( L+ jMethod 03
% p* q, F& b4 g" `: F=========0 K" M# `7 I1 k% d

8 L$ D0 B3 K; ]: D% t# VLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
5 w, {) }0 t! D0 w/ M(API Get entry point)& _! _2 F  o$ `* g/ K7 U
        2 M0 @; }; `6 ^; }8 t3 a& m9 \

4 {/ G# k" M" `4 ^2 J    xor     di,di4 J+ `% @; F& @' h6 Z! A
    mov     es,di7 q7 w. j' h9 b% X" P# G0 I( _& K
    mov     ax, 1684h      
0 Q8 G8 U2 `9 u9 j. ^  p    mov     bx, 0202h       ; VxD ID of winice2 X3 Z& @3 Z( S- q' ]2 V
    int     2Fh1 `# d8 V; x! `& G5 O1 ^
    mov     ax, es          ; ES:DI -&gt; VxD API entry point! ?+ [, m- l( v/ I
    add     ax, di
. i! X1 g+ t, q, @  m' E) i5 R5 [    test    ax,ax
0 s% D0 O( E' w# x+ @4 k    jnz     SoftICE_Detected( {1 L3 }8 K1 a( g9 m5 t+ f( |9 I; y

( {: U2 r9 I) P/ k1 [+ ?___________________________________________________________________________3 p' s4 o. b  c! {$ K

; x/ u6 |9 J4 h7 f3 GMethod 04
" k; \+ j* z# ]" C: N% b. T/ m=========
2 C) l+ V) s4 e( N  T/ g% P  H# @
Method identical to the preceding one except that it seeks the ID of SoftICE
8 M5 Y# S% ^& n' QGFX VxD.
) T. }( l6 f; v4 C, |$ T9 q9 Y2 l
9 h! K8 x1 P; T9 \1 B4 o4 X# x2 }    xor     di,di+ |  `' i+ _! u+ u
    mov     es,di6 Q9 B9 v7 I  V1 |, {0 M( v
    mov     ax, 1684h       ) l' b$ [! |6 \; X- |) B  Z
    mov     bx, 7a5Fh       ; VxD ID of SIWVID  k# o" q) ^: c* \5 r0 ~/ p
    int     2fh
) ~" i& {% x, k- ]- h2 V- S    mov     ax, es          ; ES:DI -&gt; VxD API entry point
" I4 A: X' _9 G, B5 r    add     ax, di
9 D* w" Z: e( h. f3 |* W    test    ax,ax
" L; Q1 M/ ?4 e3 s& g$ q    jnz     SoftICE_Detected! Z' a# X+ P0 P: Q" D; _
1 |# Z# d( x8 f& j; h; X
__________________________________________________________________________
/ X' l4 ]6 \% P  n. @5 A1 A; `) n, s6 U  L4 T4 |
0 b) b* e/ R8 v* P/ g2 T
Method 05- r$ |& ^8 ^5 c+ g( o7 w
=========" _$ m! S" f# f- @2 Q: k

, }) Q! F6 F0 W% n* D2 F9 aMethod seeking the 'magic number' 0F386h returned (in ax) by all system
( u; F* c2 S$ p. Adebugger. It calls the int 41h, function 4Fh.
, A' P7 v8 s, f$ g! P- fThere are several alternatives.  
  Q+ {# U9 |1 c8 K$ |) b# z  _/ K6 M
The following one is the simplest:& J! b# r+ r1 g$ n$ ]

3 Y% `0 P, \( c, P/ i( W    mov     ax,4fh- q. c$ Q1 S+ Y' M: G% N; e8 L+ y
    int     41h
# _# x2 Y$ N- I3 p; Q: b+ ^$ \0 t/ [    cmp     ax, 0F3865 _* I5 x& O+ {- S8 O
    jz      SoftICE_detected
! ]* b$ T; N7 L- q, n: P+ U: p! ?7 g: @5 ~) ~" k

1 U7 z% {, W' TNext method as well as the following one are 2 examples from Stone's
2 L& Y+ g1 U. Q" P' w+ D6 E" Q% a"stn-wid.zip" (www.cracking.net):( F; S  X+ n" Q2 }; K

9 S8 o3 A4 E$ m    mov     bx, cs
. v0 W4 ?1 E) i- j9 S( v) m    lea     dx, int41handler2/ Z5 U6 W8 x* ]
    xchg    dx, es:[41h*4]
9 a3 @+ f7 U7 v9 T2 I2 F    xchg    bx, es:[41h*4+2]
0 H7 W- c4 B$ Q    mov     ax,4fh6 j% E" i0 x! d* G% K* [
    int     41h/ i* j. Z" w4 M2 _2 e, a% N# F4 U
    xchg    dx, es:[41h*4]
2 }  s" {# ^/ M5 ^/ @" S    xchg    bx, es:[41h*4+2]
" f5 h4 m! \* k    cmp     ax, 0f386h
8 s0 j2 J3 |- k  ^    jz      SoftICE_detected; g, y# @# n* d7 r" Y
$ y7 ]7 `. A$ L4 I1 j" Y6 t
int41handler2 PROC
4 i8 V+ Y! t1 R4 q$ n    iret
$ I: w/ }! _8 }& Jint41handler2 ENDP
6 }. s2 s2 s/ Y/ e" R7 X; I5 j
4 K' ^+ Y8 D, F9 y' B
' f( E, m3 m) \  ~+ V( Z6 M! n' S6 U_________________________________________________________________________4 d* V8 x4 n( `1 o+ |" ]

: N  @3 g; |9 W! @2 u6 j# o& ^6 M% X( a6 A/ p5 Q6 Y
Method 06
  Y1 F) f* H& @* W$ J+ q, h" F=========
  }8 X1 `# U! F/ @" A! k# \2 v" Y9 l; E( Q

' x. R+ ]( U1 C2nd method similar to the preceding one but more difficult to detect:; n5 t. t" a  t% z1 X8 y3 v" Q

( v" R8 [# [/ P8 R4 ^6 h* Q2 k. K: p( j  ~
int41handler PROC* O! K1 j' w2 X4 z6 [: l+ D, |5 m
    mov     cl,al
% a: h( F- O7 c# c/ y1 S    iret6 k( X# Z5 M1 w4 x) [# B* N1 J
int41handler ENDP
3 M# i8 l3 ~8 s" k" n5 h' s7 V, n  Y
; K: X4 |/ d3 n; z2 ~/ r6 y: |2 h1 p. m2 ^# S) i2 E
    xor     ax,ax7 f  l  _" q3 W% y% S: |' I7 t$ e
    mov     es,ax
* A1 n# n0 w4 ?: w  G/ V4 e! E    mov     bx, cs
% ^0 V% e+ _" N; ?4 w! K, D" l    lea     dx, int41handler
: G5 v2 R% Z7 k5 K( S    xchg    dx, es:[41h*4]8 p' v" w+ t! X$ v& N+ P
    xchg    bx, es:[41h*4+2]
5 y3 Z: b9 Y8 ^0 D5 O    in      al, 40h
4 f) L) ?* ?5 o7 ?- A: U# r! _    xor     cx,cx7 q- a' s) O4 N/ w+ Z
    int     41h
8 `5 P3 @+ f5 D" N    xchg    dx, es:[41h*4]/ q' Y" u$ a- s0 j& o
    xchg    bx, es:[41h*4+2]
/ ~$ K) u$ b* P4 B+ G6 W    cmp     cl,al
: W" {3 w8 H" ^$ a5 D& ^    jnz     SoftICE_detected
: p% u- I* ^/ d. f# k/ R8 |0 c: y  ~
_________________________________________________________________________
3 h& U# Z2 k* Q: B, e
' {: [$ Z6 p, Z, w6 ?# ]1 yMethod 07* y2 k9 v9 z% d* m
=========
; M# i' c+ n% D9 s' K/ u$ e, z) ~) I% h
Method of detection of the WinICE handler in the int68h (V86)' H9 ?6 ]5 N2 {7 ?
6 t( K! |+ p6 a
    mov     ah,43h/ ]$ C8 {9 q) r- a% o) p/ y
    int     68h5 f$ R. F4 o) _
    cmp     ax,0F386h
) Q) r' s* r2 z- c+ E  j# x3 }9 p/ f    jz      SoftICE_Detected* S7 c/ h3 r" z, A  H) K8 w; v
1 V+ B% ~2 o. |7 I) k0 O* ?
) a' i6 d: f; X- E' i- h7 _, {$ `
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit5 d; \, x9 I' {3 `- Q0 |
   app like this:* i8 q. F, [) Q- O7 I" l
2 G# O3 {4 H/ ~% K; K3 A9 p% f9 |
   BPX exec_int if ax==68
& d$ c5 v: x( R3 _5 a   (function called is located at byte ptr [ebp+1Dh] and client eip is5 }5 \' m. s' o# ]6 A
   located at [ebp+48h] for 32Bit apps)) L; Q7 z) i5 V
__________________________________________________________________________
* B) G! V0 W6 _( Q& m2 W- N
( l$ f1 W' F. \9 A7 \2 \. k' G$ }. Z7 S' C" ?! |
Method 08
& a# m) D+ l9 U6 J5 o6 ~7 _=========
7 [. [( N; R1 B! N3 {) T* s9 o' Y" F) ^0 @; e1 V
It is not a method of detection of SoftICE but a possibility to crash the
) p9 b5 m& K$ r8 e* _: |0 C& Bsystem by intercepting int 01h and int 03h and redirecting them to another7 b2 }. f, F" k
routine.
2 K# }7 I, k7 j# p& e/ mIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
3 F" H; Z+ I1 Wto the new routine to execute (hangs computer...)+ C# Q0 R% Y. _, t
1 F" F+ W5 J9 R6 W
    mov     ah, 25h( `% e3 n# m! s6 b2 @* n  s
    mov     al, Int_Number (01h or 03h)
: K3 _' d4 n9 u. o% g/ b2 E    mov     dx, offset New_Int_Routine( I, V4 {; w4 Z3 Q! d* N! ]
    int     21h! ?$ H% t# d3 N! G  R# A0 o9 H& |% D7 q
+ y! S8 u, I2 C! p7 N' B
__________________________________________________________________________( d& }9 _& x8 Y

; _0 V% G  n5 |  C. w& DMethod 09
! o# m8 v& B: `/ e1 L3 N=========
" w/ O; V( G3 e) @$ B1 ?; {; j3 K7 c2 m0 J( U. U
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
  r4 F; a: M9 s$ X# b+ Uperformed in ring0 (VxD or a ring3 app using the VxdCall).* ^8 [2 @  K$ t* d
The Get_DDB service is used to determine whether or not a VxD is installed* q% u. `5 b( L
for the specified device and returns a Device Description Block (in ecx) for
# g! c4 f1 D& j7 L" H* t, Cthat device if it is installed.
! i* T# E( a) q/ G$ h
" m! M4 j! u9 h  I5 `/ r+ o3 u0 g' @   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
) w  P- {3 J/ i# ?# K. `. S6 T   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)! ], `" @8 u# I% `
   VMMCall Get_DDB' P! @4 n3 z1 W8 E, Q. K; a* [
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
! E: t0 f8 _7 D8 S
- A9 i  \3 q" N% rNote as well that you can easily detect this method with SoftICE:
- b. x+ M8 l. ?3 e3 J8 ]; J   bpx Get_DDB if ax==0202 || ax==7a5fh
/ e% X1 q$ F. i( P
3 V+ A* D9 {! g$ j  v6 n, g* u# h$ L__________________________________________________________________________
  C  ]3 X5 [2 R% p/ S* X1 [3 m" k, ]3 ?. u+ C, ^) M, H
Method 10
7 Y& S+ ?2 u+ M7 p) S5 |4 C=========: t+ T6 j0 ?5 c
5 U" @5 D& G, U0 B
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
5 b" b2 q2 W% u; g8 m7 ?9 P2 l  SoftICE while the option is enable!!) i/ v4 w' b( i/ u% E3 k) R6 j

* b0 n7 _: D/ X7 s/ A, R4 j, Z8 k: IThis trick is very efficient:
) X1 l7 O/ Z9 l9 b& H/ R+ pby checking the Debug Registers, you can detect if SoftICE is loaded
* H/ g0 @% C; r( m9 w' {(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 }$ k/ }" }* H7 N' t2 M: p
there are some memory breakpoints set (dr0 to dr3) simply by reading their! b- r! O- t% F+ ]) y9 ^$ Y
value (in ring0 only). Values can be manipulated and or changed as well
$ T) C' J* ^1 o(clearing BPMs for instance)
# r* r4 x: Y: Z5 H
# |! O$ O4 ]: Q/ Q) q3 ^__________________________________________________________________________+ f0 |+ O1 J7 k' I. x$ l1 F
. d3 N1 r+ M% _, J5 s6 C
Method 11+ h# e* m* D4 I' N
=========
2 K$ v2 H9 R) [+ O: v! K
7 c0 D% G: M6 t( a, Q$ V+ \/ QThis method is most known as 'MeltICE' because it has been freely distributed% k% }1 D, u2 ?- ~. W
via www.winfiles.com. However it was first used by NuMega people to allow. d. }! n( H. |+ X
Symbol Loader to check if SoftICE was active or not (the code is located* E. Y$ o$ }  R+ n
inside nmtrans.dll).+ f9 W8 M# c+ A5 j. Y1 H0 |/ _) n
1 G! A3 i" o  i
The way it works is very simple:
9 ?* z) N$ j, Q+ K6 RIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
7 |. z! A& F4 A* z  vWinNT) with the CreateFileA API./ K- Q7 _, j* s% c0 m& o
% ]2 H+ e4 g8 G3 ?" `+ }
Here is a sample (checking for 'SICE'):. ~- O7 v( w3 t5 t6 s" F

; d$ h1 R1 ~' Z( Z* q. e" y# EBOOL IsSoftIce95Loaded(). g0 ?' j; X  R1 L* Q" x9 }" I' O7 e
{; M* m2 p; I! w0 j# I
   HANDLE hFile;  
8 t- Y7 X6 G! N. J) D; C4 ~1 o   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, h: K4 N' p; z  f, K
                      FILE_SHARE_READ | FILE_SHARE_WRITE,& V( o5 }" f4 O
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);6 J( f$ S( p7 F* c
   if( hFile != INVALID_HANDLE_VALUE )& C. ?! Y4 @5 @; ~
   {, y& C4 F" W# T( f0 J( |0 S$ i! e
      CloseHandle(hFile);) X: Y4 }9 b! T; z. g) N! M
      return TRUE;; h' G* W; P! O4 @& E  }: R' I
   }5 ?) x- @; w( N4 T1 b
   return FALSE;
* k: b+ N  p: [/ T/ Q# b$ v( @}
7 u! F3 N' [/ V9 q4 H' ~/ f& @6 u
Although this trick calls the CreateFileA function, don't even expect to be/ F4 Y: n' V( H4 z
able to intercept it by installing a IFS hook: it will not work, no way!
* F6 o1 z) S; |4 }# cIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
3 \5 U4 H' t! G+ j& O/ Oservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)/ ]# S+ f- _: t. V" S8 ~
and then browse the DDB list until it find the VxD and its DDB_Control_Proc, M. G* n8 d. P5 t7 |- f4 t
field.6 h' T/ T( ^5 i" s1 X5 s* Q
In fact, its purpose is not to load/unload VxDs but only to send a - }( ~3 e5 T: n4 F4 d; f( n
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
- w7 y; Z$ d$ _9 C4 T  M4 pto the VxD Control_Dispatch proc (how the hell a shareware soft could try
, T& `3 b% w) g' s$ Z) n$ \3 Sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
/ V6 n2 W/ P. Y0 E& FIf the VxD is loaded, it will always clear eax and the Carry flag to allow
& f9 U2 C9 ?# M, ^+ h1 G8 Xits handle to be opened and then, will be detected.. T& D: _5 D% f5 [+ ]
You can check that simply by hooking Winice.exe control proc entry point) ^' F8 |+ n8 J
while running MeltICE.
; r5 h5 i; x; c) u
; M1 L% ?3 V) h% b6 q9 s) a/ m
( t/ |' j7 c0 {! A, S: ~2 [  w% @  00401067:  push      00402025    ; \\.\SICE5 y0 b: c, q. \3 d: I# `
  0040106C:  call      CreateFileA! o& t& H) E3 f8 I- N
  00401071:  cmp       eax,-001
; y. H: i" z/ j9 i' m" Y4 p  00401074:  je        00401091
) a: W$ w) l/ \1 M. n% W5 i+ \7 H% s( P

( r) f+ P6 u) I1 R8 K7 o2 N+ h+ tThere could be hundreds of BPX you could use to detect this trick./ I4 h* T- k, S9 E3 V
-The most classical one is:% x$ [  k3 @/ }- S6 ]! X
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||! D) R4 O. |9 [
    *(esp-&gt;4+4)=='NTIC'. a8 \) O2 H$ Y  c& [

7 o! Y# Q  Z* ?% R-The most exotic ones (could be very slooooow :-(  I2 K( L9 ]& R  s7 C
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  $ D* M/ Q- p: {3 R
     ;will break 3 times :-(
- l9 p' }5 w7 r& S# K
8 N- q, b, X; r, |" n6 b/ q# d-or (a bit) faster: ' |8 t0 B' f9 b6 o/ o4 ?! N
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
% K+ S" h4 }8 }# i$ [9 o# ?
% d0 |" w& V' D* }$ T& P8 |   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
) _" C  Q1 r) X     ;will break 3 times :-(! s0 q# W- U1 l
5 M; N8 q1 Z/ P+ X" c
-Much faster:
: s% i$ O. Z$ n6 {   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'4 U3 S# S' L# v2 u" J

" J3 u5 H% f5 L6 a7 H( `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) l2 v2 h& F) k% h
function to do the same job:; H. p: G; s- A% ]# @6 A# k% o

& L0 b1 J. ]& {, r) V8 Q3 I   push    00                        ; OF_READ
, h( F! l$ L7 O$ r# G2 L   mov     eax,[00656634]            ; '\\.\SICE',0
; {6 ^' }# B  m, j0 K   push    eax7 c& d. C) z$ m
   call    KERNEL32!_lopen
% {( g# L1 v" f   inc     eax
; b0 @7 n1 Q, T5 N2 [- x   jnz     00650589                  ; detected: p4 C* @# H' D0 ]6 X6 L
   push    00                        ; OF_READ
- a4 [9 o; b. v. u   mov     eax,[00656638]            ; '\\.\SICE'4 H. Q6 P% T2 q8 x; F
   push    eax6 h( [" \2 J1 d$ o, ~7 Q
   call    KERNEL32!_lopen8 K8 v8 X; E* i' M. A' F( G2 n( A
   inc     eax$ W5 j- @$ a) z0 X& [( _1 s4 }
   jz      006505ae                  ; not detected6 O" x. x4 W) ], m! B

2 T1 \" W, p" ?" j  }  T6 u
1 }0 w0 C/ k' c$ r6 j: A__________________________________________________________________________
" N- }- N1 e; h5 \$ m: ?6 _3 Z6 v- |& @. Q
Method 12
( T; M: F5 M" I0 O0 g=========
! I# r! J% U3 O5 M9 J& G9 a; k: b* k# ]1 M0 {! z
This trick is similar to int41h/4fh Debugger installation check (code 05
/ \8 W5 j+ k$ D2 v0 |7 I! T&amp; 06) but very limited because it's only available for Win95/98 (not NT)/ p. a  V8 V+ Q6 a
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.. U8 x; H4 z( D4 O# B( w- I3 l( i# D9 Q

9 m8 s: E( D- j; v   push  0000004fh         ; function 4fh
3 f7 J1 j3 \6 H$ F" |   push  002a002ah         ; high word specifies which VxD (VWIN32)5 A  I4 M8 q6 |! t/ ^+ q: I
                           ; low word specifies which service) L( w, \* h6 M. i$ B
                             (VWIN32_Int41Dispatch)
* d  p- i# L( f   call  Kernel32!ORD_001  ; VxdCall
  `6 D% J+ H) w, y: T, ?' b9 [$ @   cmp   ax, 0f386h        ; magic number returned by system debuggers
3 W5 ^0 T4 m/ @, n- ?" ?: F   jz    SoftICE_detected
. M: d0 W: n" C3 m$ P
* O0 F' K) Z. j; h9 _" W, H  y4 FHere again, several ways to detect it:9 a- p1 A" D3 V3 m- [" i
4 S8 A1 b" ~1 P. J2 ~- g) Z* {0 ], [
    BPINT 41 if ax==4f% E' q; B+ ?4 ?

6 M$ n3 B2 B( u, Y& z/ @5 z. A' ~    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
+ ~0 ]) X, D6 S4 u# i1 v" Y/ c  x' M# U2 e* F1 o& Y
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
. }' {: L7 U/ Z- R$ S& S% b+ v
6 h- E# ?* C& A' l; |. n' L  i    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
$ C5 N5 |2 t7 }8 m% a" F
' t/ H6 F! D; t' e, ^/ M__________________________________________________________________________
% I$ J4 P& n/ v8 P
, o/ H# G" Q' T9 d) o0 Z: nMethod 13" D3 M3 g% x  ^6 [
=========
& \9 y& V% p6 [0 \" l% N% }
1 s, `2 C+ L" B6 f) qNot a real method of detection, but a good way to know if SoftICE is+ R0 E  n0 ?: Z* R
installed on a computer and to locate its installation directory." I, f$ u- V% H+ m1 q+ `
It is used by few softs which access the following registry keys (usually #2) :: _4 ^! z' h+ v

; ?. P" H3 l8 ]1 s+ S+ w( r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 h2 ?$ p% K3 e5 A0 O# k  u( n\Uninstall\SoftICE5 g- a6 A3 j/ Q* o% X% Y
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
# f4 T5 d1 H0 U$ ?-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) M: S) w2 e0 e. K0 i\App Paths\Loader32.Exe, w; M  \+ L$ Y+ j) j7 {

( ^( s: N" @  t7 Y# Q
  D9 _3 r& v( X1 GNote that some nasty apps could then erase all files from SoftICE directory2 h+ n* p1 d0 V7 u( D/ v
(I faced that once :-(5 D$ A$ G* ?" e

" b% _7 g" |% \6 @$ }; r) H: \Useful breakpoint to detect it:+ \& F# f2 d4 p
+ s( M) N) O: ]- p+ ^8 n% u
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'3 S3 _* ^( i/ G7 a, b6 O! q. c1 r

) U  s* `+ o- w# P: `5 G__________________________________________________________________________
4 E9 t  B) g7 c$ u8 |+ ?& R
, Y: X$ k( p% ?1 N8 [7 \; _7 a* H7 i7 D! v7 A
Method 14
- v; P; i- w( ~2 G" Q6 Z' C, {: j: y=========% t7 r, }( c* @4 z" g) o4 s( z1 Z
* L- Q7 @/ q- P% X3 l: M+ `" @
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% Z/ s3 Y9 a  m( m. Z+ c. h& ~is to determines whether a debugger is running on your system (ring0 only).
# h# ]( z! Z7 O2 ^( U$ @/ c
5 \; h4 l! i: f# Q+ o) f- J! |   VMMCall Test_Debug_Installed
8 X" d- c" t/ k  K' @: l* V   je      not_installed
/ E8 e. K! f" d3 d0 A/ v+ \8 M' O' J  \! v7 j6 ]- W/ C; c
This service just checks a flag.8 F# w+ {- w3 r. g* M9 y
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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