About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
5 k7 s6 r! F. n( r) N, f<TBODY>5 x1 [" p' Z% j7 r  Q! {8 u2 \. R
<TR>7 [1 L* L8 Q( k: S# L
<TD><PRE>Method 01 ( V0 d/ B$ q6 g. z5 v, U6 ~) a% F7 Y
=========4 T) o% d& g1 M- ^% o; ]
! a2 H( R/ k* H. ^
This method of detection of SoftICE (as well as the following one) is. I# D, d$ a8 [" w$ C+ \+ v: l
used by the majority of packers/encryptors found on Internet.$ G  F# j3 |! s/ }
It seeks the signature of BoundsChecker in SoftICE
. ^4 |4 R; x# E! j6 `  M, ~- p8 g
! s) }6 o! s4 \4 C+ k    mov     ebp, 04243484Bh        ; 'BCHK'
7 ]1 L0 n; v# J. }* Y$ G    mov     ax, 04h
8 ], T- n' F& s' Q" y( o    int     3      
( K' p  J& |* X: q" S    cmp     al,4: E( z% T# ~3 z# H2 k/ L
    jnz     SoftICE_Detected
- A( Z( J; r8 p. V" j: G6 m4 Z: p6 W8 z! r2 U
___________________________________________________________________________- |$ C) v# t- _" C) E% D# P
( C! [1 P: Q' Q. Q& D5 L- u
Method 02" r  B7 H3 @- c3 c
=========
  b  `' x" o" D8 R: s' I- |" y+ }1 d1 E; h; a! _: T" y
Still a method very much used (perhaps the most frequent one).  It is used% m7 c' M( v1 N2 F0 m3 W
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,. Q) i" O) K/ u3 u3 w; `
or execute SoftICE commands...% A9 R8 a4 g1 H: n5 s
It is also used to crash SoftICE and to force it to execute any commands
$ f) |& O+ B$ s7 y) c- c* \! N(HBOOT...) :-((  
- y* G- y  `6 _) w) t* u4 t2 F% x8 _' B* b+ D
Here is a quick description:8 h0 a2 h: W7 n9 ]7 p4 E* U/ r/ t2 j: ~
-AX = 0910h   (Display string in SIce windows)8 j' k+ D- R8 S9 l+ S" I; u
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)' q3 W, W! O" x. D5 v
-AX = 0912h   (Get breakpoint infos)
, d9 t3 x- V3 G. a4 X/ x" e9 M-AX = 0913h   (Set Sice breakpoints)
6 t  d8 W  Z0 B7 a( ^/ D+ z-AX = 0914h   (Remove SIce breakoints)
! e* D( J! f. C! g, a
% U$ i; e8 n2 D, BEach time you'll meet this trick, you'll see:
! U2 P9 V( h+ Y+ C4 J) J-SI = 4647h( E9 d. s& e: D8 |: k" |3 q2 G
-DI = 4A4Dh
+ |  }" _+ Z1 N# f1 bWhich are the 'magic values' used by SoftIce.$ A! D/ {" r1 Y+ k8 G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
: B' P9 n/ T) ^0 q1 p/ e
* x9 K/ H: ^* J, k5 gHere is one example from the file "Haspinst.exe" which is the dongle HASP
9 S% D. L( v& |  ?! V0 `) A  NEnvelope utility use to protect DOS applications:
3 l$ @7 \' G' u: F1 z9 m" y2 J% T' Y0 ~4 j" }- T$ v* y: j( d- {# }' F

1 u" n" e' e" R: b1 v2 D4C19:0095   MOV    AX,0911  ; execute command.% O/ |. G. K( a% s) g; H
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).3 Q# k4 e- C- `# y. c( N0 Z. S
4C19:009A   MOV    SI,4647  ; 1st magic value.2 U- R1 T* h7 M" R( N
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.& Q* h1 W$ p! S6 q# Q
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
0 k* q  H& ]" @  o9 ~4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
6 D- {. e9 D, p5 |. c- w9 ~4 w4C19:00A4   INC    CX5 {" p5 h3 ?( v; x" I8 o
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute( B+ |9 j7 G( W  O1 X6 \6 q
4C19:00A8   JB     0095     ; 6 different commands.& W! ]+ z0 o6 i' }# m8 C7 x! ~
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# z4 a& p- L) c! u: |" W
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)2 f, P2 n0 b1 J% E5 p2 r
" O; |, H* M' j  Z4 \; \& n" g
The program will execute 6 different SIce commands located at ds:dx, which( [3 Q5 J% V$ g; C# @. P
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
& a) \2 ?4 L' a. I+ d* o% r' _1 P- t6 t! v% V; [* H: S
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
* y. s3 k* y1 Y4 V0 i. Q3 o___________________________________________________________________________1 Y  B+ A2 {. q3 w% T, a; d

0 Q' q, x( t4 P2 }. T: @5 C7 B1 H' }$ G+ y0 L4 i
Method 03# }- A0 R9 o4 [7 J
=========
- E2 r9 D1 j9 k+ I
: w/ i9 Y- `4 N# ILess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
$ P% A2 O. D% y  Z/ a  s: j9 [(API Get entry point)" h0 P' y& D0 e% z1 G
        9 K% c' Y7 y, V. O

+ s9 x( k2 R, E$ L6 g  N4 z    xor     di,di
1 I% Q" A! I4 C. F7 d: L7 {3 F    mov     es,di! K9 W2 O3 A* ?! N5 j$ M# S$ Y
    mov     ax, 1684h      
/ G) |& U4 z+ C$ X    mov     bx, 0202h       ; VxD ID of winice
6 d& L; g. d; D9 u; v    int     2Fh( L  L* Q  ~2 K: D' j2 A
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
* [! E3 ]1 P- p/ O9 ?. H9 U    add     ax, di0 P2 D$ T1 T- n: ?0 s6 Z. j
    test    ax,ax
: e  f3 x# P' Y4 O    jnz     SoftICE_Detected  y+ t+ d7 j+ P  r# J$ p+ w+ A/ J
2 o, v5 e. m# h6 f0 i5 n( G  V! B
___________________________________________________________________________
8 @8 i) K. V; T1 K7 N7 q, Y. ~) Z7 _( ]! Y7 }/ s7 F
Method 049 ]6 T, \: E& N) R  H' A. ~
=========
9 [/ g4 h- F" L2 [
" L' @4 B9 u% x, P# \8 FMethod identical to the preceding one except that it seeks the ID of SoftICE( N; S" u. @4 H
GFX VxD.
* o% [4 v; v" N' Z! q. l, U2 J% d. B# @
    xor     di,di
# l( u% W3 R, g    mov     es,di+ X( g6 G/ u  q; Q% k7 `
    mov     ax, 1684h       / B1 K) C/ s5 m( L
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
$ [( K1 |* l8 ^6 r- B% D' }' E    int     2fh
2 I5 R$ S7 P3 n9 A* k    mov     ax, es          ; ES:DI -&gt; VxD API entry point
+ K  s' U: Q0 H( y    add     ax, di
0 }+ ~* F+ P, y* O4 E7 ~1 d    test    ax,ax
' \+ S6 a: g# ]) x0 m! Z$ Q    jnz     SoftICE_Detected$ o6 @$ Y1 A4 v
- V7 D* H5 e- R- y; H
__________________________________________________________________________! O- I8 Z  E5 E- U+ m8 ?
6 _9 B( h1 @7 ^! B9 L

5 P/ j& [( C* s# j5 ]- F. {: g2 uMethod 05
# \3 V' T; X' \8 f* T, s: a=========+ ~, z) R  N1 [3 _
$ R! q! X. o4 i: Y( t
Method seeking the 'magic number' 0F386h returned (in ax) by all system
  C- ^1 l6 n  i  Jdebugger. It calls the int 41h, function 4Fh.7 X$ i& s+ b" }) u
There are several alternatives.  5 h$ K% E, w2 P. m' s, B( ]

, @& y: k' u/ [7 |The following one is the simplest:
5 ]& }* d7 F1 F! P. H) t0 A! |4 R! k7 s
    mov     ax,4fh) ]) W* x, E7 {% Q# Q9 v
    int     41h. o) j( q2 u" D& B
    cmp     ax, 0F386
7 _9 G* z) Q: [2 [: \    jz      SoftICE_detected; E+ H" \- r# ^$ ^2 V( c: E
" X0 t: P) Z& I
% ~0 y) b! T( `$ G" I8 y
Next method as well as the following one are 2 examples from Stone's * @) {8 Y4 [' u6 X5 J4 c( w
"stn-wid.zip" (www.cracking.net):
3 q8 G) A* C0 J8 w
( G) k& y; E" \* S    mov     bx, cs
/ B) P. s$ ^  u5 ^0 T    lea     dx, int41handler2
  }7 }# \/ r9 R/ G) O# ?' ?. J4 O    xchg    dx, es:[41h*4]
& k9 c& p8 i6 W0 t# v9 R  m& q    xchg    bx, es:[41h*4+2]
5 `# y# p8 e' ]- P( D8 l    mov     ax,4fh
5 z+ t# `! x- u) ~0 R1 V    int     41h6 `* k/ x, w5 W$ y
    xchg    dx, es:[41h*4]8 o" N: _8 r5 c* Z! _
    xchg    bx, es:[41h*4+2]2 [% {/ n* P' ^: z
    cmp     ax, 0f386h" {  A( N: q  |
    jz      SoftICE_detected
. p' X$ \4 N$ n- Y& G# o2 U  x/ U. Y- o
int41handler2 PROC
2 K/ U. g) z, R& U1 e    iret4 T  {2 ?- c4 ]
int41handler2 ENDP
5 x, I' s6 F& G# u8 g/ o" }# l0 f# f3 V1 W. ]1 a

  ^: ^1 O/ n. {3 C) A( x& j_________________________________________________________________________
# r; Z. D7 p9 T4 Y2 V$ J3 d, q( v6 S- U7 B, L3 W

$ F' B9 a. l+ s( C6 t$ qMethod 069 T# a: r$ \! A8 U$ ]% ?( Z! V
=========. K$ B* L( Y% e& R$ P
6 @5 X0 Q$ ]! e% n" x

- K  j+ ]2 Y9 p7 j1 P2nd method similar to the preceding one but more difficult to detect:5 B0 Q, l4 J4 f  X1 ]2 V

4 w1 K" W7 ^4 i
& {8 |( t7 [6 i7 _9 j4 U. Rint41handler PROC
5 L& B( _+ k3 O9 f. t    mov     cl,al
$ w+ \& K. @8 S& l    iret1 l" Q* ]- I4 [( e9 S! g6 h
int41handler ENDP
  Q+ P/ ?$ u7 e  d
' \) k0 P4 {# a2 }  l( [$ F# M  Y% d7 S& x
    xor     ax,ax
; S) `! k# S" q6 W- t/ T    mov     es,ax
& A4 T6 z. K: |( i2 j( f8 p; {! H    mov     bx, cs
! R& T4 A; F: C* K# X" k    lea     dx, int41handler
, R" {6 O8 D8 a) y! x! {    xchg    dx, es:[41h*4]1 a9 q0 ], P. @# m  A
    xchg    bx, es:[41h*4+2]4 @4 V+ u; }9 B' ]
    in      al, 40h2 K! e% B  ?* d$ F: r
    xor     cx,cx
* f, v1 S; S# J) q    int     41h
- m1 O" C7 Z/ q6 u: w+ B6 f" k! K    xchg    dx, es:[41h*4]
) y  [2 Y3 n  ?9 N% `% m- t    xchg    bx, es:[41h*4+2]" t# ?* a& A: q% o/ G) W+ A/ u
    cmp     cl,al! Y1 b5 Z: N" e6 y$ M
    jnz     SoftICE_detected7 `! f0 w3 O/ P7 Q
/ S4 G  i$ I, v. U" }
_________________________________________________________________________
3 t. X5 D, D3 D" u) e, y% W! {6 [3 F' V) l  R  \
Method 07
1 T: s$ K, n: p0 w7 |=========5 x9 O, o6 C" o7 Q. I
* e8 [/ l* y& i- v/ u
Method of detection of the WinICE handler in the int68h (V86)
/ X0 H/ ?' W# O; O. i8 F
" z( y  i+ a4 u3 Q/ p8 h- w# [* M* x    mov     ah,43h
' V2 J- m2 Q/ Z1 |: K    int     68h
7 x; ]4 z4 X/ H0 @4 X0 [    cmp     ax,0F386h
* [: t5 ^9 P0 H% _! h9 D7 f0 c* `    jz      SoftICE_Detected
& J1 ^' P0 \; L7 B1 E" h3 w$ B
$ ]9 C" S# g; P: D# n6 P% r' Y
, Q  S- Y: y1 Q6 g. [6 Z! J5 n=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit0 u: T6 V% V2 |/ Z: R0 w
   app like this:) ]0 B9 q" A% @9 C6 k9 \3 p

2 S' W8 T2 O3 C" V' G. c   BPX exec_int if ax==68
% h- A# u# p, g. s/ f   (function called is located at byte ptr [ebp+1Dh] and client eip is
+ {9 @' U# \/ B; }   located at [ebp+48h] for 32Bit apps)
8 W& ]# r/ V, M/ W- x__________________________________________________________________________$ b/ ?/ j; v; ?1 E' A$ w1 d  W
% A) U6 B+ m6 F
7 r# n8 D! {4 p/ N" S  Y
Method 08
* ?) Z2 g" A. i=========! v$ K# v) X" `. R

8 Z, p3 ?8 g2 k$ WIt is not a method of detection of SoftICE but a possibility to crash the" Z8 \  U2 c( f# l5 V- z5 M9 m: D
system by intercepting int 01h and int 03h and redirecting them to another
. R' I2 m# X2 ^0 g. j$ E1 jroutine.
9 b' Q* ]8 m9 S( i3 u5 C2 \2 RIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
7 @4 L! J. V% ^( n% dto the new routine to execute (hangs computer...)( ~: U0 ^3 H, C# k: G! M+ E

( H3 n+ }7 i7 I6 p+ i    mov     ah, 25h; N1 ~+ `- T5 b9 j
    mov     al, Int_Number (01h or 03h)
- x1 Y4 u' V; i    mov     dx, offset New_Int_Routine" H! ]; M% F& s* r" u
    int     21h
. C3 _/ B+ q7 t6 Y+ s$ I* B  }9 a4 y& j6 R' ^
__________________________________________________________________________
6 h; m/ n* s$ P, ^3 ^# a) l$ V' ^6 Z; z/ |! ~8 c
Method 09' b6 D) s7 f/ n1 t
=========" ^+ j. E: }8 X, E( `) x" F

, d( Q- g. l6 m! R" KThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
* ?: f5 x' X9 uperformed in ring0 (VxD or a ring3 app using the VxdCall)." M" r, P% ]# Q8 E& g" g& t$ n" ?
The Get_DDB service is used to determine whether or not a VxD is installed
# d4 @6 t  h; `- i: O$ Gfor the specified device and returns a Device Description Block (in ecx) for
1 u5 R0 \$ v6 x% I7 K2 d( qthat device if it is installed." U, z% Q7 ~( ~/ c9 Z- I
; q& `& _9 k" A5 S
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% W, I0 ~( C6 l/ p, v
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& Y( l2 Z, h2 j* I% u* b+ q1 C; e
   VMMCall Get_DDB
+ B' W1 R7 ~, O( i   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed8 b0 |9 k: G8 `+ B. ^5 ?' ?& j  V
( t$ y% b$ w7 g9 X( s% l0 \0 ], o' G
Note as well that you can easily detect this method with SoftICE:' K' _) U+ j: V  ?  [6 L
   bpx Get_DDB if ax==0202 || ax==7a5fh
, p8 q+ ^0 H% b$ G  ]" I" u7 B, B8 O/ Y' t- @3 U* t- C4 |
__________________________________________________________________________
! U+ S8 x; D2 b% P  ~3 m! W4 E  l4 S1 f- ]  |
Method 10- l. F. f" Z  ], n7 h3 j, m4 q
=========
2 z8 U9 A) v6 x% ?9 k" l
3 r/ F3 F* U' [1 N" b=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
, [+ {8 H/ J' F# [5 B% I8 H; C# e  SoftICE while the option is enable!!
, J3 M0 w& ]* S( y1 _  X) S! p
' z4 F1 E: w9 f9 i" A) K) ~0 ?" \This trick is very efficient:( m0 p% k% F1 V9 w5 f0 J5 o- M) {
by checking the Debug Registers, you can detect if SoftICE is loaded; R: a" L$ s+ H% l) r/ }- A
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
% _$ c: v! |( A0 Lthere are some memory breakpoints set (dr0 to dr3) simply by reading their
, I+ s/ i2 `7 R5 \; _' u) Y- ivalue (in ring0 only). Values can be manipulated and or changed as well
. I8 a( c0 o4 [6 V  @(clearing BPMs for instance): ^2 h6 s- q4 y0 R' F# P

6 F# D% U7 |4 `  e__________________________________________________________________________
! N2 T) T( U) L  x8 l0 _
  ]/ g; v, `, j: ~, D& A- bMethod 11
. D& S# R8 x& f& b% I: r=========$ K. O! H: a# u' h
! `& Q6 d& M. s
This method is most known as 'MeltICE' because it has been freely distributed
8 J% C& A6 d. w2 ]7 Gvia www.winfiles.com. However it was first used by NuMega people to allow
, w  I/ z) J5 f- G; gSymbol Loader to check if SoftICE was active or not (the code is located
2 ]5 n, \* C- k% xinside nmtrans.dll).
( K* D( m8 x7 Q* C3 g; g! r5 N1 {4 q) u0 v; Q  z
The way it works is very simple:
' f7 e2 m& ]/ iIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
4 w" e6 k1 S0 k1 [* ?4 f* RWinNT) with the CreateFileA API.
# E7 @% f% R: {0 ~. g
0 J/ c# @1 H+ x2 zHere is a sample (checking for 'SICE'):! X5 i8 \# w  J2 k$ p5 p# ]: A
! K8 r6 v9 {7 _  a
BOOL IsSoftIce95Loaded(); `) U$ u3 r3 t- t$ b$ T/ @
{
8 W4 c- o! U2 W# r% f8 Q   HANDLE hFile;  : D4 Y$ C; q3 w2 |! h4 i3 ?
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
7 _3 Q; [$ @6 ^# G( n# A, S                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ f' `/ z' F7 U- e( O. ?6 E
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
% T4 G, S" W8 ]" s& Y   if( hFile != INVALID_HANDLE_VALUE )& E4 i% ~0 I" c* N
   {
- k: r' h0 X# }! O( z6 H2 `+ Z! ~. B* J      CloseHandle(hFile);  S2 g& p  `. \3 B# D, c
      return TRUE;# s8 ]4 I0 m! k0 T: K$ X9 X. H: a7 u
   }% e( y8 p. w  k/ L+ T
   return FALSE;& w$ ^, b( Q. f
}" r6 B6 w1 M; p$ X/ U$ i! M, K

0 d+ C6 Z9 R1 \9 j2 [8 y) FAlthough this trick calls the CreateFileA function, don't even expect to be
8 j( g: c. {- t' t( }8 p1 t0 gable to intercept it by installing a IFS hook: it will not work, no way!
- e5 Z; m5 l$ q  z4 Q. RIn fact, after the call to CreateFileA it will get through VWIN32 0x001F) s/ ~/ f! m* U3 N  y% O
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
1 o) m! y5 p6 @: M8 Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc
! w' Z2 J: K7 b" _" f- Z' Sfield.
( j1 b( d: W3 C. K( b" e& W/ TIn fact, its purpose is not to load/unload VxDs but only to send a 3 R; @1 p6 a& H6 Q9 q3 q3 u
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)6 o$ L) J$ y' p. \. g+ t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
, D, e- G* |7 o# D( ito load/unload a non-dynamically loadable driver such as SoftICE ;-).: y7 c$ \( d1 ^# J$ }
If the VxD is loaded, it will always clear eax and the Carry flag to allow
, J' E( z' a, N" n; w, I- u$ Lits handle to be opened and then, will be detected.0 e6 j2 c/ E1 x  o6 L
You can check that simply by hooking Winice.exe control proc entry point5 y' Z9 w6 I& Y! F2 W! v, N1 h
while running MeltICE.
$ @: B5 m# m  |& p% x1 J& x5 ]3 ~# R
& m( f) n- g2 y0 I/ x5 z
  00401067:  push      00402025    ; \\.\SICE
" c% g) e3 x' P$ \  0040106C:  call      CreateFileA; t5 {- M) Z: P$ @, W9 R
  00401071:  cmp       eax,-001
: P7 b7 X+ x5 \& U" l  00401074:  je        00401091
( {7 P/ v  Q" e2 i. [0 @" o7 \$ ~. `7 _' X( n& V+ `
3 Y0 p' u9 a1 F& a0 E7 m4 G( z5 N! p
There could be hundreds of BPX you could use to detect this trick.
0 K. k. u$ k1 l& q-The most classical one is:
3 O! F" r4 {8 p& \+ `9 y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||+ ]! x0 ?5 a5 J9 P# |4 t
    *(esp-&gt;4+4)=='NTIC'
. _, V; h7 T4 F' u! w- m) w
' n7 ~( I: o- U' b6 e% y( C-The most exotic ones (could be very slooooow :-(
9 F4 F+ ~! _' @3 O   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  5 U+ i$ M3 y/ c/ P2 G% l, i
     ;will break 3 times :-(
1 c+ S' g- S  A! I5 s! I5 ~9 ]0 g
7 W+ X- V% Y7 [-or (a bit) faster:
. `" Y8 Z4 m8 p9 T  k! I7 D   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')4 }: X6 H1 J6 {' y4 ^, L2 _- o

7 E" U1 p  U  q& L   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  . Q) J: U/ N) L! @* }2 s
     ;will break 3 times :-(
( |; p+ Z# N9 n
  A8 T( ~) x. {. j. s2 F# C-Much faster:
8 q' J: Q) g2 g1 ~1 T+ s/ b   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'' r: _8 v7 t% K

: p& b0 s$ M! O1 H2 E8 [, R* VNote also that some programs (like AZPR3.00) use de old 16-bit _lopen3 j8 P' D5 C( J  @: F1 N
function to do the same job:
' d5 J) c% K% P2 _
9 S5 Q) I) ?+ K   push    00                        ; OF_READ
# G; u2 [7 M& ?. l2 D   mov     eax,[00656634]            ; '\\.\SICE',08 y' ?6 c* c1 C
   push    eax& o) u: C; i2 H+ [( _3 D$ Z, O
   call    KERNEL32!_lopen8 B$ W: q) c5 i9 r+ n. v  D; h: b
   inc     eax. B3 q. A& S/ B. q/ J2 e* y
   jnz     00650589                  ; detected9 w$ M- B7 U. `( |% [; Q, w
   push    00                        ; OF_READ
- ^  U6 |2 k9 W% ]7 u, Z   mov     eax,[00656638]            ; '\\.\SICE'% u. _4 {) y) S8 `2 G, L
   push    eax
& K7 E' s+ ?0 i* a  a: d   call    KERNEL32!_lopen- h+ k* _2 D. ]& ]6 c* `1 H
   inc     eax
) f8 v" `* c0 O, d% j  {* r' ^, }   jz      006505ae                  ; not detected+ m1 z# R+ S; Z/ w2 M
( X) x  p5 n  }/ V& j, }
2 C) u* Y5 I! i  N* |: A% ~) u- T
__________________________________________________________________________7 N" ]$ ~9 Z% k/ C9 y
- d* {7 @% j# g/ p" b+ [
Method 12% Q* h0 p2 z; b& ]. y3 B+ `# Q. I
=========
1 a  P& G( v, h9 }* s
3 F4 b. C, J; q0 @This trick is similar to int41h/4fh Debugger installation check (code 05
! m* ~* i" u3 e5 m9 |# q% g* K&amp; 06) but very limited because it's only available for Win95/98 (not NT)
* A, |$ u' E8 e; q- ?8 w% K9 mas it uses the VxDCall backdoor. This detection was found in Bleem Demo.6 G. k: k9 Z3 J  {* u. C

' C! P1 J* L* a) n   push  0000004fh         ; function 4fh5 L) R2 i4 u5 o( v' ~/ w3 A
   push  002a002ah         ; high word specifies which VxD (VWIN32)9 K0 x% b. |- \5 v; U/ [
                           ; low word specifies which service: q7 V7 M# N1 ~" P( e& u9 }1 J5 z
                             (VWIN32_Int41Dispatch): s, [% n0 Q1 M/ k5 t* ^; e+ t6 C) w
   call  Kernel32!ORD_001  ; VxdCall& w0 _5 x) L. M, Y
   cmp   ax, 0f386h        ; magic number returned by system debuggers4 \7 m; X5 j4 k! A
   jz    SoftICE_detected
$ @% R* l- |# E9 K* m/ Y
! z+ S6 E8 A5 MHere again, several ways to detect it:/ n& ^2 X7 Z& F

: i5 \, [. R8 i9 t    BPINT 41 if ax==4f# N" t; @0 L/ x+ p
4 E- b$ P& T7 c
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one: Q3 F6 T+ p8 c
2 j6 S2 Z0 \1 ^. X) a; |) V9 o: k
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A( Z& `4 h9 T% L/ x' g% I: l( c9 z

. a1 f$ d, n1 i; k    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!$ j) `3 Y$ {( X# E

. a" X9 f+ X* a( ?__________________________________________________________________________
4 r* c, W$ i" i3 b! L" n* l* ~' Z$ k0 C0 h. [0 b
Method 13
) @0 D, L+ x8 Q/ ]& b=========' B' V: E! h4 I- |! e' m& X
* v7 }, [2 O- ]/ q; }
Not a real method of detection, but a good way to know if SoftICE is
: l7 G2 j- x; n" u" hinstalled on a computer and to locate its installation directory.4 s8 q$ V. q; n- @: ^
It is used by few softs which access the following registry keys (usually #2) :! {4 E+ x$ b8 u; I% O0 Y/ K

7 K8 h  a1 e, b$ n3 N" e# w-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion- y% J0 \. u, O+ G" q
\Uninstall\SoftICE
* Z% W/ l, _' D- ?2 r, f-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE; x6 E3 i4 q' r; x0 O4 Q  C
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
. K' Z. s6 O( C; E7 v  Q\App Paths\Loader32.Exe2 k0 ]$ [  k. O9 L" Z

' |, P1 L, H* _' a0 K' d1 M$ t1 i+ ]# B3 {& `- J
Note that some nasty apps could then erase all files from SoftICE directory3 `! G6 N- @9 M9 f: h( k9 a9 w
(I faced that once :-(
6 C5 F3 Z4 b% a) ^
& h) u6 J* |% D5 kUseful breakpoint to detect it:
3 B9 X) g/ O% q) T2 a, Z# U; M1 u7 E4 y7 T: p' ~$ D- J# P
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'$ C7 m* w6 I( ]" {, ^% M1 y% f

: X/ m, l4 f; V( S4 y3 ___________________________________________________________________________% F1 Y1 |' R" F' ]
9 F; F$ f5 Z# m8 s( g" {, X

7 O0 v* h& X* \  mMethod 14 : F! N# I3 ]& `
=========
) t/ r# c! O' |3 U1 r  N% j" C& t: ~1 k( _9 T- u0 b
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose$ v1 P& l: Y$ @4 ^# Y# c- o
is to determines whether a debugger is running on your system (ring0 only).
$ D; v) S4 I6 R) w8 s" S0 {+ q2 B& M7 `2 d/ v
   VMMCall Test_Debug_Installed  d- s" Y4 U' J  p- {, J
   je      not_installed
( Q: c; e- I9 Q& o2 w! M* p
7 O1 k" ?6 f% c" G4 d* r4 rThis service just checks a flag.
9 ]% i& T9 t7 T% t8 t' \. L</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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