找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>" B) u/ p3 A8 G% B1 r
<TBODY>5 O. I9 g8 ?4 E' \3 L
<TR>
/ K6 ?) H" n$ k* S( w- }1 }6 j2 `<TD><PRE>Method 01 0 s& Q% M2 z. n7 t
=========6 G4 |$ \  v& e" ^4 m* J7 A6 N

7 P3 y. V+ e8 Q8 t6 }This method of detection of SoftICE (as well as the following one) is
! `# [' m- a- y5 q: p# l- Bused by the majority of packers/encryptors found on Internet.. y( R) ~, D$ M. f; y; E" h
It seeks the signature of BoundsChecker in SoftICE
5 \: n) m4 O) G& B# l$ S: c# ]: t; T8 O. _1 I( {! `
    mov     ebp, 04243484Bh        ; 'BCHK'
3 u7 z: j* `$ [( v/ ?    mov     ax, 04h4 y( k, s2 P# ~. q
    int     3       8 r! Q! m+ W6 N; l/ [
    cmp     al,49 I2 H$ M5 M! i2 i5 T4 B
    jnz     SoftICE_Detected& ~  R3 [/ @  e3 V5 y
! T5 Q6 G- [' d7 v! ^1 a1 K
___________________________________________________________________________
) ?. Q0 J- s3 T: Y5 @6 M* e$ u
: f3 m5 `3 X/ p; e$ y, |0 XMethod 02
2 T5 X: u& v! [=========; z( \- ^+ p% F# w9 R
+ {% h- k1 R* f- U) M1 I
Still a method very much used (perhaps the most frequent one).  It is used7 D" [9 _0 S0 D; X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,+ ^1 H1 K7 D9 t, {
or execute SoftICE commands...4 ^( b! {; a0 c2 R; J6 ^; r- a
It is also used to crash SoftICE and to force it to execute any commands! J+ L2 L% n( g2 s. r" X
(HBOOT...) :-((  
* C' f# S) ^7 f( U: L1 A; d( ]7 }( H+ U$ N0 n4 `5 n: q
Here is a quick description:
7 n' Q* {6 \( I1 A, L-AX = 0910h   (Display string in SIce windows)
$ g7 q2 g; _( v, L( Z1 t-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)7 k% l! P  D$ G2 t5 A
-AX = 0912h   (Get breakpoint infos)
- \& b7 ]' x  S6 u' v* Q+ \-AX = 0913h   (Set Sice breakpoints)
) a# ?; x/ V" L' Y. f0 W- P7 }-AX = 0914h   (Remove SIce breakoints)
$ M' L, e9 V2 \6 F8 F. r! t  L5 A6 W1 x2 f- d; _* K  G& k" c+ y
Each time you'll meet this trick, you'll see:
. y( L  y  _& \-SI = 4647h
8 A- M  {2 \, ]7 L' Z-DI = 4A4Dh
7 T# ?% |# p* _6 z3 w9 Z* IWhich are the 'magic values' used by SoftIce.! c! r3 h: j9 z2 z
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.: E- A. v1 E8 [5 M8 \

; Y0 Q! ^4 T( V! D4 ]Here is one example from the file "Haspinst.exe" which is the dongle HASP1 S/ J/ z% g( V1 g4 |7 e
Envelope utility use to protect DOS applications:% |: h$ L; _! w" R
8 i" ~3 h, a. S4 G

# F: D& @! C: l# u4C19:0095   MOV    AX,0911  ; execute command.
7 E( k2 j/ l  J; R( n5 A0 x- B4 }9 o/ i4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
& f$ o: X9 j* T: I! @! [8 }3 o+ r4C19:009A   MOV    SI,4647  ; 1st magic value.
. I0 k0 O( j7 P8 I/ W- f4 i- d4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
% [8 C+ P2 t  B9 X2 C+ ^6 J; ~4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)# l$ A0 n# U( [% o* O& P6 n( q
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 N: A; C, b: D
4C19:00A4   INC    CX
+ y/ s& @# S2 k$ c0 W* n+ L4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
+ _, u0 Q& ^4 r7 J. Z' T, _# n4C19:00A8   JB     0095     ; 6 different commands.
/ g( M1 D+ N0 U- D, t' t4C19:00AA   JMP    0002     ; Bad_Guy jmp back.! Z# }' C8 c# x* s, U
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)) c' k0 h  B# O6 U. K& H1 `
5 S) a4 k8 _! Y8 x  H0 m3 F* P
The program will execute 6 different SIce commands located at ds:dx, which
, t) t6 x7 P4 R: b# @9 ]. i' f6 ~% H* Vare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
7 w- b; W$ r! u1 V+ V
9 a& z, @( L  @' j# H/ D1 D* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; C6 ^# c4 b* M___________________________________________________________________________
0 D8 T- c% J* R0 r1 r3 ^
2 W. Q+ t7 Z: ^, E4 s' y9 B3 k" F* O# w" W/ z! Y" d
Method 03
0 O! _1 @4 w$ P: y& N: z=========2 E1 L& N/ a; {, Y  d( n
0 B9 i$ D# }1 Q! f- J& J
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. Y! v, O, ]8 C- g5 k(API Get entry point)0 R. O: _8 h+ h+ [, k) Y
        3 n" a, `$ J4 Z" c+ Y

- `1 h4 n1 d; [8 Q/ |/ ?4 ]& V    xor     di,di1 [8 e4 @! T4 a3 A; E+ x
    mov     es,di
/ c& T1 Z: s) u$ _4 P+ W7 N/ c    mov     ax, 1684h      
: C$ e1 s% v! t3 ^    mov     bx, 0202h       ; VxD ID of winice
5 A) y4 C* A, j/ \* [, g    int     2Fh" f( K& o* M3 `$ q
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
% g3 L, b$ b2 R' T: |5 ]6 p    add     ax, di
3 `, I2 l) s$ `$ }    test    ax,ax
" E: L: I5 @: q1 V- N; b    jnz     SoftICE_Detected6 ^% Q, T# m' R) @% C8 l

% `# B/ p, ?5 M. s9 q( n___________________________________________________________________________
/ k' s0 ~) p( b3 n4 J
" ^" n1 x/ q. K! [$ E# z: ^4 RMethod 04
; F, z. z' G/ w9 q/ S=========. O6 x2 F6 k% g. k$ D7 M( }8 L, X

5 y1 N$ Q: r; T8 [2 g3 QMethod identical to the preceding one except that it seeks the ID of SoftICE
% q! f) M7 [3 Y. R( T& vGFX VxD.( E; Q) ^! N0 l: S/ J; ~# D; ~- R

; t+ h7 _/ @  \, y7 l! [; p9 V# ]    xor     di,di
" u8 h6 p0 h3 o7 j  H9 G/ F    mov     es,di7 r3 }2 K( Y8 O9 Q
    mov     ax, 1684h      
2 Q# O& j9 a6 ^, D    mov     bx, 7a5Fh       ; VxD ID of SIWVID
* Q! `5 ^; U: p3 `$ ~    int     2fh
! I6 }# {# H9 E  E. F    mov     ax, es          ; ES:DI -&gt; VxD API entry point; N+ B+ a* |/ K- W5 W1 k1 i
    add     ax, di# d  y, z5 I% ^" d$ e2 V' Z
    test    ax,ax
( ~; ~  M/ G6 L    jnz     SoftICE_Detected; ]- {2 v' n* R# e9 c
4 y* F4 j* P, O) h/ N* n
__________________________________________________________________________
0 F, E3 {; \- f
# w4 r, ~- L6 P7 t. [+ Y7 A; k* h  \2 `% C
Method 05
6 D1 B9 K; u' s% p- \" ]=========
  r7 v- R- H8 ~, s
- s  D! y' b+ z5 ^- N8 HMethod seeking the 'magic number' 0F386h returned (in ax) by all system% D: ?/ j2 a2 D: a5 d8 W; Q
debugger. It calls the int 41h, function 4Fh., S+ O! Z) M' l! x; B6 X* [- {0 f: b
There are several alternatives.  ; H6 y9 g$ h, M) j
, G9 N% h( I9 R% ]
The following one is the simplest:
3 _+ Q- Y0 _/ L9 t% u" c$ o+ y" j
6 v% F1 O! v0 _, D8 ^8 L( {    mov     ax,4fh0 f! L2 [& e8 O* X( i% N
    int     41h
7 ?$ |. `9 B  o4 X$ V# x# o+ d0 z8 @" x5 ]    cmp     ax, 0F386
0 T2 r' j) c7 @, ~4 d8 f    jz      SoftICE_detected8 z) e9 G9 }1 T0 @' G
- H6 B8 G4 [; ~, e
7 Q$ b( S, b8 ?' I; `) Y& Y
Next method as well as the following one are 2 examples from Stone's
5 g1 v( p' h+ S, [2 r: L"stn-wid.zip" (www.cracking.net):
  R- {* x# c' w" O. `& L( n& \3 H% o+ g2 @
    mov     bx, cs
. ?9 o; j8 ]7 E1 f( x; @8 X2 A    lea     dx, int41handler2
  U+ D$ [# H/ F3 ~2 M1 j& s) J    xchg    dx, es:[41h*4]0 ~% s8 b) o7 ]. m( K( r
    xchg    bx, es:[41h*4+2]0 S- ~# a! j! F6 T( N$ |  B
    mov     ax,4fh7 S7 ~; b3 t6 H/ T7 s" y
    int     41h6 D9 J1 b6 ~# t  Z
    xchg    dx, es:[41h*4]
5 i+ _: @7 L/ t# O. j+ ^/ J    xchg    bx, es:[41h*4+2]' \- ^: o- w! \0 ]2 M6 S
    cmp     ax, 0f386h$ z; |: [/ {' p& A% e5 G3 ^7 {
    jz      SoftICE_detected8 o' w2 y" c* B4 F

% q0 s  ]/ h5 U* K+ p" o9 f% H6 Fint41handler2 PROC* \1 @# Y% a$ L3 B. n0 f
    iret
( J! E3 E# Z+ A+ W: t% Kint41handler2 ENDP7 d& |7 F) G% t# a& g. s, i, |

6 S) z3 P: i+ J/ Z7 C5 d. q) W1 H1 J" d0 ^+ z
_________________________________________________________________________1 K; s$ x5 w7 t- A. m3 F& ]- H

3 V" l8 w- r& Y" M, n
0 p7 Z% h$ _" A& I) NMethod 06& [$ {% c* w( B# [0 E% ?9 S
=========6 P  z$ y2 @, w& @. b

1 x+ t& m& w4 H7 d# }- j/ h: ^0 x2 ^/ ^+ X) u
2nd method similar to the preceding one but more difficult to detect:
' I" ~1 ^- |% |0 ]  ~0 r, N( R9 n" X1 }7 M
& F  L+ e" V1 N3 d7 p7 {
int41handler PROC
+ g& J- p7 E- F& `8 J1 U    mov     cl,al& c  d, S3 j* \4 D* C' ~
    iret
0 Q4 J5 _$ d/ B& o  Aint41handler ENDP) z0 L" a0 a2 E" i. [! N7 Q" M
9 K- p& L6 F$ b1 v  ?
6 q' X' |  ?# ?' `9 M: i! t) h
    xor     ax,ax8 ~( z# |9 J+ P
    mov     es,ax
( k7 _' r0 W8 ~  l. Z    mov     bx, cs
" \; x2 S+ f/ R2 y5 {: ^% m    lea     dx, int41handler) i3 z" H2 r0 \6 j: o
    xchg    dx, es:[41h*4]! H6 ^6 A/ e( ^; x% t3 w, l: j
    xchg    bx, es:[41h*4+2]! g3 x( x* |$ R3 g6 c# w
    in      al, 40h
0 n0 e) Y& H5 m    xor     cx,cx
) [5 }9 F6 p" x) G+ R) j  V    int     41h
1 F1 ^8 h' ]7 j% |  @    xchg    dx, es:[41h*4]9 t& O0 g7 }$ u+ |8 g: f
    xchg    bx, es:[41h*4+2]: X# K- v+ T0 b! {8 r3 m2 q
    cmp     cl,al
3 h7 X9 j) Y' S4 v, P) r0 V) r    jnz     SoftICE_detected
# _6 F$ }! S2 Y# w- I2 u+ W, C9 A$ T
_________________________________________________________________________
, R; j: b  b* d0 C
# t8 B: r7 y, {* t5 P8 L3 S/ XMethod 077 m2 Q, n6 ^" r; W# i: B
=========
! R  v( C3 d8 F1 O: y
1 C! l4 ^. Q; ]" g8 L% b4 MMethod of detection of the WinICE handler in the int68h (V86)
7 X* s" t5 G! H1 Z+ K, Z0 s3 X
7 R. D- W  @8 A: G& B3 S, q3 ~5 @( f    mov     ah,43h, ?6 B5 m2 \% @' R. s
    int     68h
# i: X6 g% O7 D5 m+ q- _3 U    cmp     ax,0F386h2 H" _# d1 a- R; N+ y" P
    jz      SoftICE_Detected
- ?. y' w# n3 a1 I* v6 o
% G2 u/ B, C5 y9 f. b! [' t
# p0 Q8 w& _. Y9 ]: ~=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
) \9 C' `: @+ Y( K& k! w2 x   app like this:" R* o! Q. W1 t8 ]- V% Q+ B" z( C
. e- g+ \5 x( g4 n( J6 }  J5 Q% i
   BPX exec_int if ax==68/ _4 N! \6 b/ s1 O& |7 A9 T
   (function called is located at byte ptr [ebp+1Dh] and client eip is% V, k6 x# c3 J+ ^0 i# F
   located at [ebp+48h] for 32Bit apps)
5 R, G5 d# o( P4 R__________________________________________________________________________- A: r& X& S* Z+ g
9 n7 p6 @) ?+ o2 S! J
" G3 L# u) q+ M% ?1 I4 e
Method 08
/ @( g9 e* ~2 |! c: ~6 b$ z=========
* H+ e/ Z6 k4 L! o% ]- i
7 c! o, O& U/ z, n" {6 j7 z8 bIt is not a method of detection of SoftICE but a possibility to crash the! B; L( A2 j1 `% \
system by intercepting int 01h and int 03h and redirecting them to another
$ m( p# ]1 l# a  B+ Xroutine.- M3 L2 G6 [) J7 B
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points- h& W$ E$ U8 L
to the new routine to execute (hangs computer...)
- Y2 P; C+ i4 t2 D6 f$ t+ D+ n
* f( k6 ]1 A4 U! H8 u, t6 D    mov     ah, 25h6 h4 J! N8 l  |& L3 w* p/ ?/ \
    mov     al, Int_Number (01h or 03h)4 {$ y) `* a, q( f; Y
    mov     dx, offset New_Int_Routine
. Q+ \; w3 A- a4 g/ m+ O: w    int     21h
( v! U+ E& P! S$ d4 w* O7 s# @* p0 Q# T, a/ w7 ^6 p) m; b. y6 R
__________________________________________________________________________
" F( j$ i& b* m" \
# j7 D8 o# _0 n' Y, j6 {8 Q" t7 eMethod 094 ^- f) ]: M1 G
=========
# }! A# l( P9 J& C0 V( C9 v% ]
) ^, S! G! T) A9 i+ y8 ~; v6 |, V. HThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only- s. b9 d; i# {0 O4 Q: _5 V" |/ p
performed in ring0 (VxD or a ring3 app using the VxdCall).
# R# ^$ X9 ^* y. Z4 R# T+ }9 H" vThe Get_DDB service is used to determine whether or not a VxD is installed9 ~" c+ z3 q! o' k* n0 @& q
for the specified device and returns a Device Description Block (in ecx) for
: ?& v# T8 Y  q5 Z% G9 Rthat device if it is installed.& J4 m& F/ g/ g) j! I# c

, b$ Y7 X9 L# q  C   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID/ B7 I+ P. _/ n1 j* r" X8 `
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 x# B8 D& [$ V9 p   VMMCall Get_DDB
9 B, B  h$ }9 v, Y  `' {   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
8 }! q, ?1 [+ g9 H
! h, I( T8 O* z3 Y7 a! O7 tNote as well that you can easily detect this method with SoftICE:
4 E: x  }1 K5 n  u" r8 A   bpx Get_DDB if ax==0202 || ax==7a5fh( n! [4 A) G% U8 X& |1 O
) \$ ~7 y; S% N' d+ E2 O4 [
__________________________________________________________________________
3 n; w7 T4 V% y0 A" }5 u( F" N( {5 `( {: \, N+ D; t* k
Method 107 R/ h1 W4 p7 Q* a' Z9 q
=========
! a2 M4 }& V) X2 {4 I- q
  h' q- q3 `  ]# d/ ^+ _=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with' l$ ?% |, c3 @  m7 W
  SoftICE while the option is enable!!
/ [. N6 x+ k1 N& O( ^' K/ Y7 W4 \: t$ _' ?8 k
This trick is very efficient:
9 A9 d1 a) T& i; i* {5 Dby checking the Debug Registers, you can detect if SoftICE is loaded, N* x2 @& J6 f% K7 X- @0 j; v& `
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
9 e. U6 A0 E) u: V/ F' rthere are some memory breakpoints set (dr0 to dr3) simply by reading their
) Z& ]4 g( y6 e; J! _& n4 Q" e. Kvalue (in ring0 only). Values can be manipulated and or changed as well# t$ p' [% r. }  s  f/ x( ?, Z
(clearing BPMs for instance)1 @8 ]+ U" b) _6 y

+ O, r7 ]9 L# K) s$ x5 ^__________________________________________________________________________
! V6 Q% u3 o' m
! I% `0 c3 u" b0 ]Method 11
6 r( W' |7 x& |2 i4 Z=========
$ N% x# x  G5 H. M7 j
, Z2 t% m$ W, hThis method is most known as 'MeltICE' because it has been freely distributed
1 }: P! h, P9 f5 l" [0 }4 pvia www.winfiles.com. However it was first used by NuMega people to allow# l5 d6 h2 S# i6 o( u
Symbol Loader to check if SoftICE was active or not (the code is located
& I+ ?: i: u4 ?" V; ~" l; dinside nmtrans.dll).
! x! b5 E' v" K9 N9 ?8 a+ B) O( z
( b/ q- T, Z$ e; E' HThe way it works is very simple:, [+ W/ G$ r0 b3 F: Z1 i. |
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for7 Z, \# t5 F: Z- f& l
WinNT) with the CreateFileA API.
+ S5 T/ _- Q1 {- n7 |. S3 G4 O# M: d% v+ j' n
Here is a sample (checking for 'SICE'):
( D1 q( @7 o  Z5 w2 g; _( k0 ?/ w& H7 v9 w+ w+ j
BOOL IsSoftIce95Loaded()
/ k! Z$ Q/ k9 A4 S- r5 F{
2 d; I  r7 r! c& c) W- p   HANDLE hFile;  
- Q" Z* ~  L! c% V. G3 t   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,) q+ J: D( t' {' q
                      FILE_SHARE_READ | FILE_SHARE_WRITE,9 O1 I4 a/ \( s& u; u
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6 x8 d1 ~8 v& S3 _! ~% Q   if( hFile != INVALID_HANDLE_VALUE )
/ Z0 @% h9 X6 @' D   {
: F: @0 N; Y7 Z) |  l$ j      CloseHandle(hFile);6 d+ d, |9 W3 e, _6 R
      return TRUE;. z' H5 w$ T' `3 ~: o7 c
   }
! `. R, M6 S$ m; Q9 L+ }+ Z   return FALSE;' W5 a3 G3 }1 |6 m) C' f: W5 F* ?
}
& m- ~  n. f' W( R! G
$ a4 W' K# }! |+ _  UAlthough this trick calls the CreateFileA function, don't even expect to be
' M& S1 Q7 M( v) @able to intercept it by installing a IFS hook: it will not work, no way!1 i& ^, }8 k6 f. R" F
In fact, after the call to CreateFileA it will get through VWIN32 0x001F( S; s$ g: n: f3 X3 q+ U
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
* l/ Q+ K2 o" x  P5 W8 qand then browse the DDB list until it find the VxD and its DDB_Control_Proc
) ]. G4 M. j: x2 v5 ~field." W; C1 S& X. A. R% u) }5 Q. j
In fact, its purpose is not to load/unload VxDs but only to send a
) I7 ]# B! G; Z6 C5 W; R* vW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
8 K4 L# W" z# p4 {to the VxD Control_Dispatch proc (how the hell a shareware soft could try
% L) y5 H+ s$ D' f$ o1 ?# yto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 u* W  K% W+ b+ e5 O" x1 k/ LIf the VxD is loaded, it will always clear eax and the Carry flag to allow
3 L0 w: s! v* H: v* Rits handle to be opened and then, will be detected.
1 d5 Q$ n* c8 B. Q: y) bYou can check that simply by hooking Winice.exe control proc entry point0 Y1 Y3 j& Y9 p' e7 _% E
while running MeltICE.  V" G2 |2 W2 T

$ p0 R* |% H' }* d$ n/ ?' \+ F- \  T5 A- Z
  00401067:  push      00402025    ; \\.\SICE* e; ?3 H  C5 B4 l: W
  0040106C:  call      CreateFileA- O: p1 w1 B  P9 i
  00401071:  cmp       eax,-001
* a5 N- ~$ t+ k# M9 M: j& E0 N  00401074:  je        00401091  a; N/ z4 X' \: V

% Z+ Y% n0 x9 H; G. u6 q( A. |& q5 D1 J+ s
There could be hundreds of BPX you could use to detect this trick.
' c' o! `* v  J, p-The most classical one is:9 }# w7 G! A' D5 }3 t+ {5 l8 y5 J+ F0 w
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
% p4 @; A2 K& S$ p8 r. M4 {) z7 E    *(esp-&gt;4+4)=='NTIC'# \1 g) ^$ ^0 y+ o' Q! P, y' d
2 D" t( m& c* j; D
-The most exotic ones (could be very slooooow :-(
3 @2 q3 c; j$ p! z; d( U3 V   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  . h$ R  E3 J5 ~
     ;will break 3 times :-(
1 g8 e# _6 }# N5 F
/ t$ e4 ^6 D+ w9 v, O1 z" f/ I-or (a bit) faster: 1 g6 S/ W8 k' X6 H* q
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
5 B. x9 e2 z9 b. D' y' t
* G8 p! E; t; A   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
: P2 Y# ?: }8 a     ;will break 3 times :-() n4 V& C8 h8 [" c6 \3 d7 k

2 Q% R7 B$ c7 d% v- [-Much faster:. F' }6 ^6 d. g
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
  Y) n$ C  @/ A& x1 A) C, O* O$ a" ~. H8 e5 v
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen& }# Z0 C1 H* b6 t) |- t9 S3 A8 k
function to do the same job:) w! m+ M3 \' _$ x  `- Z& l' a
7 D2 a& B) g8 J% G8 ?6 y
   push    00                        ; OF_READ
1 ]7 e  u" ~* I. R; u5 e+ M! O   mov     eax,[00656634]            ; '\\.\SICE',0
' t' A6 U) [4 V9 _# k3 R* E   push    eax& i, v" B% }2 Z9 z7 H# q
   call    KERNEL32!_lopen* i& |( Y2 l) [" `, \
   inc     eax
  ]7 D$ t' _, _* V) M   jnz     00650589                  ; detected
1 C( l2 S. P" \! I* i" F   push    00                        ; OF_READ. m9 `' M6 N" z9 O8 S
   mov     eax,[00656638]            ; '\\.\SICE': ]7 W, m% @8 o3 i
   push    eax
" `2 }  w1 C2 L) g) O* j   call    KERNEL32!_lopen
0 p8 P! g/ d  l. R   inc     eax
3 ?. g! I; b  F* {' l4 T$ i) [   jz      006505ae                  ; not detected& f6 _! m2 ^& S* \% x) J; }

9 U) H& R" S- e& }
+ d/ W) `+ C+ i& L6 D* k4 W6 u__________________________________________________________________________
7 ^, a, l  h8 V  H% W4 P" z
7 L# k- t& U3 P6 `Method 12: R8 `% L6 _% W
=========9 m3 Z. l* r+ ~4 s+ z" R" r

% O. l. T$ K: ]3 i6 vThis trick is similar to int41h/4fh Debugger installation check (code 052 t7 U9 k! m! V/ R# l% N! J
&amp; 06) but very limited because it's only available for Win95/98 (not NT)  t9 p) |2 q" o- D& R
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.8 i, v5 y. l( U

: l4 \$ f) e0 H, B   push  0000004fh         ; function 4fh
# v! e3 Z. n3 r+ X; s* @- {: B   push  002a002ah         ; high word specifies which VxD (VWIN32)
, x1 w3 b7 P1 w                           ; low word specifies which service
3 g9 D$ }* g+ K# O                             (VWIN32_Int41Dispatch)
5 b/ q+ n: A: D9 I9 i7 U   call  Kernel32!ORD_001  ; VxdCall" ?9 S; _2 J" `4 |# H5 ?
   cmp   ax, 0f386h        ; magic number returned by system debuggers
! z  y" [1 ^; M9 d4 n2 P4 e0 B5 R   jz    SoftICE_detected
5 U- d/ o+ m; T! Q
/ k2 F( j0 Z1 u2 kHere again, several ways to detect it:
! O  W; W9 U& G8 b0 m1 w# n) U4 N/ ]$ n; ^/ z/ ?. N1 Z- d
    BPINT 41 if ax==4f6 v$ B" n: U. `& {' h
3 c* B4 _$ P9 @# m* j1 r6 g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one& n- B; S1 j; Y, n6 E( s

! t9 ?8 |( I5 y% g& S. @1 K    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
1 G$ F! U% x4 @& _6 V# ~& |  i( X2 x; M- @7 W* |
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!. y5 W7 I  U9 R2 c+ V/ @+ z( X

* }/ J- Z( w& [2 x1 T+ |; s. Z__________________________________________________________________________! E7 {. M7 S1 O3 R6 I6 L. {

/ [7 P$ v5 V5 vMethod 13& ~% a6 i4 b! t0 ^  ?3 o& c, D
=========
9 m, O+ j) a+ m$ x% O& \
* K+ J# |9 Z1 U( ]& b1 UNot a real method of detection, but a good way to know if SoftICE is! N6 Q! o) x+ d; L6 \1 f% s) M
installed on a computer and to locate its installation directory.7 e( {7 C, B/ W/ e" X) x$ s
It is used by few softs which access the following registry keys (usually #2) :
: V. ~; t0 \( u: M- ^2 ?6 V" ]: z8 _8 S
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
' ~, @% d8 Y) d* ~  G\Uninstall\SoftICE
7 v0 R) T, t. D1 C: m9 O( @+ V-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
( s# L8 m5 o. w6 D6 C  w% f2 t* D, }-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
+ T( C0 M) q: h% C/ }% g/ Z, J\App Paths\Loader32.Exe
$ e. f; _% J' i0 ]( f3 P! P. X* f+ [6 Z9 w" B
6 y* W" O& Y+ n
Note that some nasty apps could then erase all files from SoftICE directory" m  Z" e: i: I
(I faced that once :-(- p7 R" B- V' ]( M# @+ S

9 u& b5 j2 ]+ P3 x, r/ _Useful breakpoint to detect it:
. m2 B. h! W/ o9 R& i
" e9 l/ `; B6 O; g  L+ r( L' g1 w* ^     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
  Q# q+ W6 [* F7 A. h6 h0 i; J! a; M0 N& Q2 O3 z+ ]
__________________________________________________________________________0 A6 _: E; d) o, O% I

' A; N. s, r! x) F' _' ^
2 H+ y( m% t7 ]9 b2 g& \  ?Method 14
3 y3 q4 }; k4 h8 p) _7 ^5 D=========
  |9 B' W1 g+ G0 i
' G; [2 e+ C- U# v8 T2 FA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
- b9 @! z5 ^$ a0 n) F( ^" Fis to determines whether a debugger is running on your system (ring0 only).
' x3 p- Y0 x. |3 u
; P) t; {! t) G6 `, r9 P: a/ ?; p   VMMCall Test_Debug_Installed0 _3 i4 r8 D6 T
   je      not_installed
: \, k2 ~5 B; s& s: N; M) C9 ~) Y* Z( \1 k8 m8 }3 q
This service just checks a flag.3 w' t+ K0 c, s7 u4 o" d: m  P; h  T" v
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-4 08:37

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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