找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
, k4 `) m9 `6 f6 @8 |- O! z# u: |  v<TBODY>
2 a# L: o; \  N  e, c<TR>
! T5 h% i6 O+ v0 V5 c* }<TD><PRE>Method 01
+ X: _9 ]. {! s) \=========
/ c2 W9 X( z; m$ F2 @% J% x. t9 n( X9 ?* m0 n* r1 W
This method of detection of SoftICE (as well as the following one) is, L# v1 q0 T# p# v" }; k* e. _
used by the majority of packers/encryptors found on Internet.
4 w# F3 C  a9 u& LIt seeks the signature of BoundsChecker in SoftICE" }2 x* o& J7 s3 i

4 i: |( H# t, ]5 W" F    mov     ebp, 04243484Bh        ; 'BCHK'
8 ^  O, w# F- E! ]- `; k5 t8 |5 Z    mov     ax, 04h
4 b9 p7 b3 }- z! K, G    int     3       % v4 }5 e: G, q
    cmp     al,4
7 S, b' L4 X; y6 ]9 \. G    jnz     SoftICE_Detected
5 Y6 A' ^# R* i$ v/ _: g+ s
; E0 z# x* U& y___________________________________________________________________________. j- G4 W) U# D' e

# b* U/ b* H$ H" gMethod 02
+ t; ^# E" @7 E$ F  @- F6 I=========
! v9 o& o" ], B2 O) K3 f- J
* a0 P2 X. p8 p/ KStill a method very much used (perhaps the most frequent one).  It is used
7 o9 |5 v* F5 h' s- Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
! N) L9 v, k- Q" y: t2 c, @or execute SoftICE commands...
3 E0 a/ y& K: RIt is also used to crash SoftICE and to force it to execute any commands
& B9 ]) S0 U0 X3 w- }; `, Q(HBOOT...) :-((  5 p$ f) [3 l- w; p% d3 a
- L; u2 W9 ]) ^; J! r$ A
Here is a quick description:' o: \6 I6 T: c) o! l& D' w
-AX = 0910h   (Display string in SIce windows)
% J% K" ^+ h6 _5 `" E, A! \2 W" l( P-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
9 J' I+ @4 _) e-AX = 0912h   (Get breakpoint infos)
) S$ K3 n! H; a8 a4 o: j-AX = 0913h   (Set Sice breakpoints)" q: y, K8 B6 M3 H$ D  l
-AX = 0914h   (Remove SIce breakoints)% w) f9 v- K  C# s/ n5 V

- J* H, g8 \8 X) a8 M5 M9 d$ xEach time you'll meet this trick, you'll see:6 d% P6 ?/ S7 [5 K4 L0 u- |+ }
-SI = 4647h: }( T0 A* f4 c( Y
-DI = 4A4Dh
  \( z' z2 }# D8 H* @Which are the 'magic values' used by SoftIce.5 Y4 x6 y% O  X. L# B% H: D1 T% F9 H
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
" b6 ~, T  L) n# P$ F0 V$ ?" G  s/ V7 |3 q# t
Here is one example from the file "Haspinst.exe" which is the dongle HASP
- v( \  m3 Y+ R, W7 @Envelope utility use to protect DOS applications:
* _2 w+ H# d1 }3 d+ w9 ~7 Z1 f2 Y3 m
+ G) z. s1 k+ E  G9 U" c( S
4C19:0095   MOV    AX,0911  ; execute command.+ l) B: `( e' t; O7 [0 _
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
" ?1 b% ?3 \7 O( V' `& p1 F* W4C19:009A   MOV    SI,4647  ; 1st magic value.
4 D% M, i2 G0 c4 G4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
/ p- C/ Y; \2 t5 L# A+ R& R4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
+ y; Y& p4 T1 I* V- s3 Y6 f0 J4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
- c  y, e! ^' Z, c$ P& u2 |4C19:00A4   INC    CX
) {1 K* N% p- t- @: v  N$ ]4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
$ ~0 s# T0 w% [4 V; j) d: I5 a4C19:00A8   JB     0095     ; 6 different commands.7 |0 c- [- D% ~* L
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
3 A0 {: a; s/ ~4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
8 D9 Z0 _. M2 b7 g' v5 M5 s2 }* P% g- b
4 U& P, ]2 _* E: I% b5 oThe program will execute 6 different SIce commands located at ds:dx, which
( a# `8 [6 X' R' Y4 ?  Jare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
3 c) Q- Y) w& ^% I3 k& D4 ^* M% l$ |: a5 @# B% K3 \
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
2 z6 Y% k  e2 @7 ~' r- h___________________________________________________________________________1 Y0 m! e4 r$ F  M* N- q
# J( G8 j( O4 Z" T7 \

0 B: ?# t) x7 o: x$ k) @Method 03
/ L3 c% j3 H; T" |& S/ w9 X2 [: C3 ]=========
  b* T5 P9 O* q- O# x$ n$ |' q3 [, {* U3 n( Q
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
) t9 ^# x8 e2 s8 e2 O(API Get entry point)- q2 `4 }, O1 S9 _# Y: A
        
& N9 t+ B* v  R" w5 g% d9 h: q. p4 G6 T
    xor     di,di4 w. D" B7 R6 k* |6 v+ x* s
    mov     es,di# _7 i' N$ u( O- V7 S- s7 q0 L& u$ z* `
    mov     ax, 1684h      
" B5 U0 n" y4 v9 A; d    mov     bx, 0202h       ; VxD ID of winice2 m& ?2 p* _- b5 G
    int     2Fh
% M5 P4 M* b# G- D: W% d9 V2 q" ?    mov     ax, es          ; ES:DI -&gt; VxD API entry point9 K2 z; |% {/ \3 q
    add     ax, di
' R/ o) y  m  z    test    ax,ax7 J  @  B- R. [$ v/ ?% r. L  @9 r
    jnz     SoftICE_Detected
! @. o" o! ]! {  z$ A" b! M% X% ^$ r; a* n3 W
___________________________________________________________________________- E1 k; T7 \$ t. r3 D# o1 T
1 [6 ^0 n8 Y3 L8 y% |0 f3 A& N
Method 04
! e& f# l% h1 Y5 P# d& ]=========- S2 B/ Q1 Z% h" E  B
2 ]! F% W* F2 Z! b* Q3 e4 H" L
Method identical to the preceding one except that it seeks the ID of SoftICE% P. g- Y! V* y) r, @6 \
GFX VxD.4 t) G' D  _0 k# M, P

! s0 B" i$ W5 K    xor     di,di
) x6 z( S. W0 J* i: x    mov     es,di' R4 c& R( B2 L
    mov     ax, 1684h      
" v; q8 v% ]6 W2 v    mov     bx, 7a5Fh       ; VxD ID of SIWVID6 [" D+ ]5 G6 Q+ i8 g
    int     2fh
8 {! }* U# M( b  C; b6 e% z    mov     ax, es          ; ES:DI -&gt; VxD API entry point
  c9 {/ K" c  i' I    add     ax, di$ B2 S+ j/ w7 s& d) v  o1 ?6 S
    test    ax,ax8 N  H9 J( v6 F+ j- P. l" H% c& A
    jnz     SoftICE_Detected4 W0 u7 o  @3 W- R
; Z; u8 s. A* U4 P
__________________________________________________________________________' e; Q: n; C2 n! B: X
/ M+ }: s% I; {; m  {' M- N3 r
- h* Y( `; s6 d. ]
Method 05
2 E, I' J) K# {+ {6 X+ ?$ i/ ~=========* J# v; O0 ]  r; ?5 b% ?

  n" }3 a! s/ L  z1 xMethod seeking the 'magic number' 0F386h returned (in ax) by all system
. I, }) N, m% a, h+ R8 @/ @7 p# wdebugger. It calls the int 41h, function 4Fh.; V% ?* j/ }0 h+ b" G, z' m
There are several alternatives.  
0 F  g2 K# J7 t2 L0 {
9 V# o) d4 r1 }. j  iThe following one is the simplest:/ J' ^, @5 p* `
" }, i1 ]7 R& ]$ p' P5 |, t
    mov     ax,4fh
% `& W+ n3 {3 z* g    int     41h
, U7 g5 @  ]6 u    cmp     ax, 0F386
3 s8 Y2 w: v" }: k    jz      SoftICE_detected
  G' n  w% b: d; K1 z" |2 r+ {# L& R  i
1 I% m- U8 L0 g4 l& `
Next method as well as the following one are 2 examples from Stone's ( w/ \4 m1 A/ `! @% d; L: ?
"stn-wid.zip" (www.cracking.net):
$ _8 W$ n- b4 K; g$ e' F7 U$ ?7 K
7 f0 [9 k) O7 R4 P+ k    mov     bx, cs
6 J( R+ Y; F3 v) T3 y    lea     dx, int41handler2
4 [( e3 F! E/ X4 m8 B: D    xchg    dx, es:[41h*4]
. @7 g& r* W5 i6 X8 j    xchg    bx, es:[41h*4+2]
  `5 V: l3 }" ~' }7 c4 Z1 x% D    mov     ax,4fh
! Z- e1 G3 R2 q* n% c% W# C    int     41h3 L' O, j1 D/ ]$ y6 U
    xchg    dx, es:[41h*4]
& `* }5 D2 x8 {    xchg    bx, es:[41h*4+2]& X, F, H8 b4 Z6 a9 E
    cmp     ax, 0f386h
* @) t' h2 ?6 k4 M6 P& A# ?; m    jz      SoftICE_detected0 a9 k- w- i' ~" G- a$ M7 v' z7 L
0 O8 h  O! M- `, N6 @  [) t. e
int41handler2 PROC5 F% S/ y+ f7 q: `( A4 u
    iret
) _, ~1 G% N2 A$ uint41handler2 ENDP
3 a  g! f' b& u8 ^% [8 [
! B$ ^5 e% Y- h% T: T$ L% K3 g; U/ X. A2 N) J. x- L# o9 r* ^
_________________________________________________________________________
$ p& r; `. ?) d, n% J: u
  ^( R2 p  a# m" M6 [
6 ?5 o1 A) @) s  A7 }5 pMethod 06
( y$ `8 j% }% J4 d! n, @- Z=========
& H5 j1 y) y% B3 V9 j) X; x3 Y0 z8 ?( b5 ~% D' t5 p7 k
: F* ]6 t5 T( K! j
2nd method similar to the preceding one but more difficult to detect:
4 ?$ ~% b# w# u7 b/ j# W. c! m5 |# m3 S' i$ y6 {4 ~

, ~$ M1 ?# {5 Yint41handler PROC
9 `- v/ e# ~4 o    mov     cl,al8 t# o0 t9 p% k7 k
    iret
1 E6 I* u; m, `& O8 ]  X) uint41handler ENDP
9 w2 [% A7 _0 R6 v6 l6 Y7 q8 K$ S- U6 u

  P7 w% @; A4 S/ K    xor     ax,ax
- r3 y7 A6 @: u. u* E    mov     es,ax
( d- m% Z& j6 Y2 h8 V( \& v    mov     bx, cs
; X4 ]" r3 F+ _, k; D( w0 [3 D( o( ^' T    lea     dx, int41handler
8 e' R+ X  I" t5 P1 J    xchg    dx, es:[41h*4]
; J1 l& p. l* U  z3 G+ _    xchg    bx, es:[41h*4+2]
/ Y2 c& ~2 g  w1 |# a    in      al, 40h
2 Y+ h7 D5 v$ S7 n$ D    xor     cx,cx; [/ c  ]6 c- j
    int     41h
. \1 _/ _$ q0 U+ s0 W) o    xchg    dx, es:[41h*4]. O/ l7 n( E& q! b( T+ ~
    xchg    bx, es:[41h*4+2]1 o# Q. _5 i" c
    cmp     cl,al
) e7 D4 D. }& w1 d0 z- l& I    jnz     SoftICE_detected' t3 Z/ _- p3 F% A* O0 [
( n: ?: C+ q  j: S  S8 X3 |
_________________________________________________________________________- A, E% ]" S9 Z

' z6 Q' K7 @9 C7 [Method 07
5 i- c4 W5 R1 {! J& k=========
5 _) n4 A0 w% d3 A
2 ?1 {3 q* o! N  ]! X' PMethod of detection of the WinICE handler in the int68h (V86)0 g5 I$ `1 ]  ]( C  G6 @3 q& l
5 I2 H$ o5 I$ D' e: U
    mov     ah,43h0 W" t: t* k4 _0 E6 Y
    int     68h
) I) a( n$ Q2 T: L% R3 Q6 f    cmp     ax,0F386h$ V- Z4 _$ E; q  Z4 w. Y
    jz      SoftICE_Detected
# w+ L! _2 U2 L  S9 b0 R; F. @- X0 a0 d* d; [
0 {* G3 a! P2 u$ ]
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
+ \4 _+ S4 p2 A& n/ X/ O   app like this:& a- @& p- S$ p5 z6 M9 C& w
/ {* B8 O3 b, P9 ]# q  q- c- H6 a" l
   BPX exec_int if ax==68
) {2 p& q' V) U4 j, J   (function called is located at byte ptr [ebp+1Dh] and client eip is
4 W3 s: x% D5 f1 m( V3 G0 W   located at [ebp+48h] for 32Bit apps)
# F! i4 v2 h0 h9 w__________________________________________________________________________
2 x( B& |$ Y% J1 P  J& K& r3 ^2 s2 a+ ?. T7 x
: M+ `" m9 S3 o. o7 L& w0 l
Method 08
: |% j! C, T; \5 j=========3 Q1 ~) K% d6 C$ ]" ~9 {
( G4 W9 J, o3 L  w' {) k# i0 x
It is not a method of detection of SoftICE but a possibility to crash the
: Q6 u- Q8 p' C( n- b" {system by intercepting int 01h and int 03h and redirecting them to another" M) L2 s9 K# B& ?7 W7 G5 w/ L
routine.1 F6 E1 p$ d+ F. k2 z" v
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ \/ `1 }- z7 R% F! q, ^
to the new routine to execute (hangs computer...)  V6 Z5 w$ P4 H) o3 B' y
& C0 u0 h( c* w9 U, W1 d3 V  p
    mov     ah, 25h) x3 U7 X7 @/ @2 |8 A& |
    mov     al, Int_Number (01h or 03h)% [  {+ U, _# e! Y1 U; T& s- a, r
    mov     dx, offset New_Int_Routine4 A6 X2 A' M3 `/ k' x
    int     21h% [7 S9 h8 N! ]: v2 s6 J% _! |1 V
; c! c7 j4 T! F' o% R9 ~/ s
__________________________________________________________________________. e6 u+ r* L1 d
+ I/ d7 M5 S6 S" Z, c4 B2 I( u" _
Method 090 O' r6 J8 {% k' t; K
=========% J* i, `, y9 \' j4 k1 C

8 q. R3 W3 X* t5 }5 e3 x& dThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
- d& d* M" g, N( O0 t0 Aperformed in ring0 (VxD or a ring3 app using the VxdCall).5 R5 g5 k7 h* Z' F/ c$ n( u4 E9 `
The Get_DDB service is used to determine whether or not a VxD is installed6 n% Z* Z  ^9 K' v8 f" @
for the specified device and returns a Device Description Block (in ecx) for
" k& o* J$ @5 f: uthat device if it is installed., X0 h0 m; d9 T# _% V. y

  O$ Q# s# A# y+ a1 d* R* U   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
- h2 D( n; C. x4 y: b; [' i# ^; O  P   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& S) R. F/ g' ^, ^
   VMMCall Get_DDB! R0 ^3 ]- o6 R- w
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
$ r5 I4 `: G" V* E4 ~5 F
. H0 n3 _4 u' ~1 Y* ANote as well that you can easily detect this method with SoftICE:& _/ \4 i- ^0 I0 P/ v
   bpx Get_DDB if ax==0202 || ax==7a5fh) q! V' R& d$ O+ U. Z8 ?
8 E" G7 S0 {, Q6 W# J; h
__________________________________________________________________________% E! J: {3 `, \; H. W6 b( x, y2 c

" i0 \6 h1 V% Y/ y: Y/ MMethod 10$ B% W( ?& A. p' G6 _
=========
# N; I4 W1 c' K$ B, c, q
4 U5 ?3 X3 ~0 X3 P& f=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with( F+ E% z. Y) L2 D
  SoftICE while the option is enable!!
! p8 D' Q/ l* _: c- I3 D# d' x5 S6 F5 ?8 q) w* z' H" s& L! r
This trick is very efficient:  H% @' M% G( c, c9 _; [. V7 K+ b
by checking the Debug Registers, you can detect if SoftICE is loaded
/ v" ~) M' D7 t; g  ^/ c7 c(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if  v8 Q7 S7 @/ W4 ]2 ~
there are some memory breakpoints set (dr0 to dr3) simply by reading their) e# y0 R& s9 _7 G( g: _
value (in ring0 only). Values can be manipulated and or changed as well
; k9 n; d: c2 K(clearing BPMs for instance)
+ p2 k. P, h& G& u$ |& c$ H5 n' H0 e5 V
__________________________________________________________________________( ?" `; u/ p! ^% D
7 K! ^, b+ s4 _' N
Method 11, t* `( n- T* j$ H) h/ n
=========
2 |6 g. s0 h4 U, a+ D: A) M: J1 d% a" k2 i
This method is most known as 'MeltICE' because it has been freely distributed
1 o# i3 b' {, U# yvia www.winfiles.com. However it was first used by NuMega people to allow
8 i' ?9 E: n) w3 u: `* q$ fSymbol Loader to check if SoftICE was active or not (the code is located
* n# O$ t$ e; [1 oinside nmtrans.dll).2 e- f: v4 s. Y! m6 ^7 w

  s' C% U5 }# v; |% lThe way it works is very simple:0 ~! N! D/ A8 f4 ?3 u2 o% i; X3 L
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for9 Q0 u9 L7 B% `8 e8 n
WinNT) with the CreateFileA API.: u, Z# T7 v- p) Q8 b9 Z

! A: T, i! V* E  D1 o3 w9 pHere is a sample (checking for 'SICE'):
" {8 R0 u+ N# m4 y0 \3 k+ m+ ^5 B5 [5 A) v4 v
BOOL IsSoftIce95Loaded(). Z! k! p1 |0 K% q1 a
{
( s+ t+ K+ W4 i0 ]0 [: w, ^   HANDLE hFile;  ! H2 X& c+ A$ S) C# K
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
( p# J- {  F7 b& p- Y" w                      FILE_SHARE_READ | FILE_SHARE_WRITE,* [1 B9 h, J! v+ [5 [/ O; b# E5 O
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! M; n, l& t. k! n& x) f9 Q) m   if( hFile != INVALID_HANDLE_VALUE ); z( H, w; F% b
   {. `, S, a$ x. U( }
      CloseHandle(hFile);
# r4 d7 o8 c; g0 x, @' l      return TRUE;( e9 b9 X% L) K
   }" }+ T  x, X& x' H) u& d& X9 [
   return FALSE;' ]# B7 j" x. M. T; T% R5 \- Q: d
}3 t' p+ Y4 J, l5 @* N( ], Z

6 }0 T) `' U& |3 ^$ N/ d' LAlthough this trick calls the CreateFileA function, don't even expect to be2 `- y. A, C( {% f3 e
able to intercept it by installing a IFS hook: it will not work, no way!
% z. d7 ~- f& U& h+ f4 zIn fact, after the call to CreateFileA it will get through VWIN32 0x001F7 X- V: L0 g  d2 z4 x0 C, k
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)1 m1 V) D. @7 p' D+ x
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
4 f- R  F+ A8 L0 {field., m7 u$ e6 i1 |& Y+ ^) s3 n  m- m
In fact, its purpose is not to load/unload VxDs but only to send a
8 a. m# p: w7 X( z, ZW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* y+ r" r: u, i/ }, g7 hto the VxD Control_Dispatch proc (how the hell a shareware soft could try/ j% ?( f7 a: B1 E3 |
to load/unload a non-dynamically loadable driver such as SoftICE ;-).$ T3 J5 L2 k3 s
If the VxD is loaded, it will always clear eax and the Carry flag to allow
  h6 v2 f" r. R8 y8 rits handle to be opened and then, will be detected.* |2 u9 g; e( x5 T& v: F. Y
You can check that simply by hooking Winice.exe control proc entry point& ~& ?: u5 S: }
while running MeltICE.7 @# W" V1 c$ \  F7 j7 E
6 Z& v2 U9 T  |( a  R8 S+ M& q# K

: v, W# r5 j$ m9 B: @" J) T) {  00401067:  push      00402025    ; \\.\SICE, K4 x1 \! o2 D5 L) U, e
  0040106C:  call      CreateFileA
5 ?, W& q* e8 v( ]0 d* |: {  00401071:  cmp       eax,-001
0 s4 z( Y! k* X0 S( W  00401074:  je        004010910 C$ ]; K6 h- b0 Q; c. K4 H* ^7 Z" @
* e  {. G; F/ Y0 W3 N2 N  w- R

) f  ^5 O+ R; \- g+ `1 w; ~There could be hundreds of BPX you could use to detect this trick.
( C( N5 K6 q' J' a2 P! u-The most classical one is:
! ], e% B/ X8 _2 ]3 `  ]3 G' `$ O  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
" D' _7 T: b6 ]0 _' e, v    *(esp-&gt;4+4)=='NTIC'
/ i6 N- [4 f) V) s! k- C! l  x( u3 W& m% X
-The most exotic ones (could be very slooooow :-(8 n2 N) n: X; e
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  ) E! {8 [1 T! j% K5 Z
     ;will break 3 times :-(
4 I' N0 M# t! ?5 }* z
- F2 q. t- y2 G' L6 Q- ~# Y-or (a bit) faster:
0 S% Z0 J/ ^8 K! b) I- j9 N7 O) v   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
, [9 ]1 v% v4 d( S8 f! d2 i7 R; [! }' A% ?6 q8 F: L$ j6 W/ p2 b
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ( J9 @. S' u8 D/ x  ~- L* U; A
     ;will break 3 times :-(- p, A' u& C3 \+ Z; @# n3 ]

6 M# V; V( t9 h) i-Much faster:
- |) I( i8 E$ w+ h   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
/ ^; n' M2 K" k- s* M) x9 {- f+ S3 M& w
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
  J8 b6 t0 v) W* R. Xfunction to do the same job:
$ P+ G- B( ~1 D) m: ?! }. s) u
: A) B9 P& u  C+ j   push    00                        ; OF_READ
' o* l1 L* W. ~$ B: b8 N   mov     eax,[00656634]            ; '\\.\SICE',0
9 n7 |; V# C+ H' e6 Y/ Z   push    eax6 n# a0 r0 R3 L& |
   call    KERNEL32!_lopen
& I9 U1 M, O1 m" r   inc     eax
" U$ I+ I3 k- D  r, `0 J   jnz     00650589                  ; detected
. M( [  o0 K$ k! q, `1 b" W! {" B   push    00                        ; OF_READ
* v, H- r, N8 \* k! y0 I' C   mov     eax,[00656638]            ; '\\.\SICE'
  R. ~1 W" o8 z3 a   push    eax
/ g( ~! y0 z2 H+ N3 |( v9 h   call    KERNEL32!_lopen) U% G/ X' _: Y+ H; M% b: m
   inc     eax
5 B. W9 C7 B; k/ ~1 c   jz      006505ae                  ; not detected
" ?  H5 X6 |$ Z( M% s4 w8 ~; L2 @2 `* t/ ~& a4 p5 t7 L9 x

8 b+ P) b' m5 w+ v  W7 _6 |__________________________________________________________________________$ B7 x5 [5 D/ e* y6 W# v

3 e8 U6 N5 Y3 UMethod 12
: l4 k9 y+ A( ?3 o% Q=========  |# B" V& S: S0 g3 Q

4 h- w* ~) l9 T  `1 I, J4 v( gThis trick is similar to int41h/4fh Debugger installation check (code 05
2 g8 M5 g+ l# S; P&amp; 06) but very limited because it's only available for Win95/98 (not NT)6 P5 _9 o* z2 p. ^7 W( U
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
8 J3 `$ J$ H  A& f- ~
/ d6 g. J; x1 a! Z  \3 E7 |   push  0000004fh         ; function 4fh6 v% ^9 Q$ F2 e+ r  ?- t
   push  002a002ah         ; high word specifies which VxD (VWIN32)4 F" W3 D$ T$ A
                           ; low word specifies which service
  ]0 G. U! {, J$ E- p                             (VWIN32_Int41Dispatch)/ a4 j( D" V4 i/ R6 k2 L
   call  Kernel32!ORD_001  ; VxdCall
* J8 A& ?' v; H/ Q0 W   cmp   ax, 0f386h        ; magic number returned by system debuggers$ e+ _  y* {+ t8 g4 m& ?
   jz    SoftICE_detected
, |  ]8 ?# q; X, s( }5 j. g6 X: a7 f$ a. {9 N, @
Here again, several ways to detect it:
8 w( g8 c) ^0 }( K! B) A3 N" ~1 w8 R3 \: D3 V6 E
    BPINT 41 if ax==4f
( d0 n0 U, t: t6 h* V& r* T0 j8 K: u$ Z0 H9 q
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
8 B* x8 e. M$ f" [# D
4 T+ Q1 @' y2 H2 X3 P    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
; ]8 p* [, s# i5 d' K3 [
' M" \6 l  ]' v- v5 _    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!$ f3 U( e# Y5 e

$ b& L/ I. U- Z0 `__________________________________________________________________________. }9 C& D" C; s3 r+ z
; ?# @( T. O( e1 U# G
Method 130 x* E) o! A% q# G4 N) F8 P( j$ H
=========
0 M! a9 E  G7 ?! \+ P6 k: x* r5 S/ m+ F) S
Not a real method of detection, but a good way to know if SoftICE is2 n+ B' _) \: [1 c
installed on a computer and to locate its installation directory.
$ X/ J& N/ B# a7 |: B( IIt is used by few softs which access the following registry keys (usually #2) :" P3 E0 H( @5 @

. @& n8 O( O! Q" s7 {& A& h-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. \1 I- Q6 u" {- C8 }+ v2 C' z3 k\Uninstall\SoftICE' g* ?' b, k( J" @) `) B* x
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
- s% Y1 R( I% o- A: t- J-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 P! P+ W- U: `/ f" L\App Paths\Loader32.Exe
- {4 E. c* ~- p, i- e9 {% P( N/ L. B( Y. H& B2 V6 ?5 O& u* P
% H$ B& }8 `( y9 [8 _* A
Note that some nasty apps could then erase all files from SoftICE directory! M9 i5 N, t4 u
(I faced that once :-(
& O$ D0 Y, a7 N0 j0 z8 ^' C' \) W" n
Useful breakpoint to detect it:) U2 |% E, d* b& t; b
7 w$ P+ R6 Z) {% c- p4 |: {
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'# f+ A7 E( e: Q9 G' m
% C% K! K" O3 y/ A) }$ F
__________________________________________________________________________: m( h, Y; u: [! I# y7 M+ e  a

* |" y* M/ i! V9 J0 r
2 I2 G. B  J0 V$ ?Method 14 . ]( s& @9 ~8 y' [; i$ D! K
=========% q) u. y% |9 K/ B9 D
  ]( \5 I, I7 J$ t
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
4 v- {: v0 w) Y5 Z. J7 [, ais to determines whether a debugger is running on your system (ring0 only)., M/ s$ d0 Q: c; d: H  q. R
# H1 _* ]0 G9 R$ a) @1 h& U
   VMMCall Test_Debug_Installed4 \$ C4 d6 ?  s3 [0 \& s
   je      not_installed
* G! g; u9 N0 f3 y# |2 U0 m, V, \( f' r1 m  t8 o! V2 o
This service just checks a flag.0 \2 s9 k5 Q, H9 {0 ]
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-5-3 02:42

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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