About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500># u& I. X4 I) ~4 U# {4 F9 v) G
<TBODY>
  q/ t0 d: ]9 i, y  k<TR>
; U3 |+ E6 N, K: M- b<TD><PRE>Method 01 ; B4 y0 Z4 y( H1 h/ B% j
=========) [: m% m4 L7 f6 \

% W( t7 t3 o8 v1 R# K- f( nThis method of detection of SoftICE (as well as the following one) is
) c& \& m/ G; t6 W/ tused by the majority of packers/encryptors found on Internet.
5 F9 ?8 h  F( n& _  O4 wIt seeks the signature of BoundsChecker in SoftICE
  x8 e' r& P; c7 `
0 p) k! y8 Y! X2 B    mov     ebp, 04243484Bh        ; 'BCHK'
" w3 W/ H% V- Z7 e$ _    mov     ax, 04h, r6 [( I; S( C- i/ z
    int     3       2 d. Q% [% m5 l% k* s9 F; a4 h
    cmp     al,44 L+ O" J& T7 b& h; a6 M( b
    jnz     SoftICE_Detected9 |- _7 C0 B, E9 r. z) ^

! C* J& i7 c% r___________________________________________________________________________% }, q, ?/ r- S3 F
: O5 R) \2 x) U8 M' K
Method 02
. ]! w# z+ o) w/ q4 x8 W/ d; |5 M% b=========
, J; m8 g3 d0 ~# j& S6 i/ M4 [" n% F& V; o: v* v, k4 K
Still a method very much used (perhaps the most frequent one).  It is used, O% ~8 C7 R  N9 d  W; P
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,3 W8 l# t" c" S3 N/ ~! k% Q5 V" k
or execute SoftICE commands...
6 J/ u% ?2 G: x4 g" N. hIt is also used to crash SoftICE and to force it to execute any commands
# a6 i. F8 w  o# X; q7 k(HBOOT...) :-((  5 V+ I- {1 s' \

& y% b1 v1 f2 t* `- ~Here is a quick description:  x$ }$ i: C0 H4 _
-AX = 0910h   (Display string in SIce windows)
. |! t5 h3 }" Z1 H6 e! S# w-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
9 f7 u, r3 s7 z-AX = 0912h   (Get breakpoint infos)# P+ ~9 i4 n( n
-AX = 0913h   (Set Sice breakpoints)
4 K4 X. Y/ y; M0 A-AX = 0914h   (Remove SIce breakoints)% H, Y0 b- t  h/ O0 h3 v% o
- t! _7 @- B2 }$ P; J# \
Each time you'll meet this trick, you'll see:- s. T: _$ M; c9 p
-SI = 4647h4 @1 L( ~5 t6 t" C3 d% a. s
-DI = 4A4Dh/ r; b- }  ?% X4 @$ T
Which are the 'magic values' used by SoftIce.3 ^( {" E; [, v3 V! \9 `
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.) g0 r0 n6 R( R7 N+ _' ^- v# N7 g
: @/ q# s. ^! Z- |$ V8 r
Here is one example from the file "Haspinst.exe" which is the dongle HASP- h( R$ o+ \0 g( e
Envelope utility use to protect DOS applications:. r  j6 g2 f. U

7 f  [/ V: U; g4 Q: f/ m. x4 j, h, E7 u: T
4C19:0095   MOV    AX,0911  ; execute command.
% p% m* X4 |% }4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).' J: N3 F4 o4 F. h8 z) h
4C19:009A   MOV    SI,4647  ; 1st magic value.8 z% W+ f; r3 [- f" _7 b
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
: U/ y6 Z- |' g. z4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)5 \% N- i$ i9 q# O, Y) q
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute! M9 h% F: Y( r- o
4C19:00A4   INC    CX
0 C6 g) `$ F$ ?/ O2 [6 ]8 L) i) H4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute% _+ [8 N$ T* C7 ^6 w# a
4C19:00A8   JB     0095     ; 6 different commands.5 R- U! n' i. N: r$ ~2 ?% Y
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
8 n8 k5 Y: I% V8 Z. c& Q3 W4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
& }' z+ [+ w& D; [# T
) a) C0 S3 F& }# @1 }4 _The program will execute 6 different SIce commands located at ds:dx, which
) J! O' w1 q/ {1 Y' ^are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.; l1 W0 R) g8 D# j  n

/ {' V% {3 `# m; C* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& z% ~. |- e" Q___________________________________________________________________________7 [6 u# C& z  @, D" L% ~

4 V7 s% f5 F  F7 N- g5 f) G" k. H. ]7 D  C4 Q4 [, V
Method 03  C5 [, m: ^6 ]' n; Y3 s
=========* l1 j4 {3 A7 |0 s7 Z, X& s
9 Y! h" {% t1 F! m
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
/ ~9 [2 i" m7 M* _(API Get entry point)& n2 j5 {2 V8 l. Z7 ~) L
        3 p4 P3 _, u5 u$ V+ z2 O1 l: T& s& t' \
% ^* b# l. _8 U: R2 {3 N
    xor     di,di' ]0 p( x- u. ~
    mov     es,di' Y: y  n# Y! x
    mov     ax, 1684h      
3 C3 j5 B5 K; |. s: H* U    mov     bx, 0202h       ; VxD ID of winice
( Z2 v6 E9 @) m    int     2Fh
- ]: c+ h5 \0 o    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! F2 h9 _& w3 I' }- g! `% J    add     ax, di
* [- O) g: u5 Q) ~& P8 Z    test    ax,ax
, M  H6 ^0 `6 [    jnz     SoftICE_Detected/ _4 q4 P9 J! Y5 `1 j, H

( y2 {8 }, J3 X; d___________________________________________________________________________
* Q, D( h+ |1 L' p8 X9 Y; R$ u8 l0 F1 V8 J
Method 04  }# n. R. s1 I8 M2 r
=========
% ]3 D, b0 ]) [; a/ A# ^/ ~2 o' T/ T# O6 M" r& a
Method identical to the preceding one except that it seeks the ID of SoftICE
1 A8 U; ]" [* VGFX VxD.
' m0 i! Q4 h& V$ R+ O) g
9 t4 C7 L' o$ W' ~    xor     di,di8 ^7 G* x/ ?  t" A
    mov     es,di
4 d$ V3 h  H1 B; {+ @( Q    mov     ax, 1684h       - R- g4 S7 R8 p6 m/ C
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
% ]8 Y* x, X8 H    int     2fh
% D' _( z6 U  o% g' ~    mov     ax, es          ; ES:DI -&gt; VxD API entry point
# t6 V4 R. m% S8 ~: x6 i4 f    add     ax, di, a. a' C$ C) b% Z. ^( @$ C8 N, V
    test    ax,ax8 h7 d9 L4 e0 |+ v) [
    jnz     SoftICE_Detected" k" ?) l; p" [, @3 c# z3 u

9 u% m1 ]$ y% q/ y* y__________________________________________________________________________
; m6 v- ?- u; H8 P9 Y: l+ `' R* e1 n
& ^. M" C/ r# [+ |2 W% X
Method 05
" ^5 v  g; b( s/ }) e=========: T4 ~# S1 a, N/ ?( z  s
" V/ j7 m1 z# U( z' c& P' \- b
Method seeking the 'magic number' 0F386h returned (in ax) by all system3 N* i* o7 z4 X8 l4 M. p
debugger. It calls the int 41h, function 4Fh.# W3 r3 b% ~$ H1 O
There are several alternatives.  
3 a  n6 G4 D8 p" A- q1 \. ?# |* M
The following one is the simplest:
$ j0 K+ k9 ~% [% v- o$ b1 c6 D4 o0 g
    mov     ax,4fh
/ P! }: C  Y% ^9 d; M3 J  M    int     41h- H) j& c" k# }" A
    cmp     ax, 0F3866 ]7 \# z% R8 w+ S5 u% |' C
    jz      SoftICE_detected+ J" Y- L: F3 P8 e2 ?; L" \* ^
2 Y+ e# @7 \7 B1 V
; d; x: e. b" ]
Next method as well as the following one are 2 examples from Stone's 5 H/ v3 _6 r" ]2 G
"stn-wid.zip" (www.cracking.net):
* ]& L. b% K" {+ h  @; R) A7 T. P% H/ M( R: K* z
    mov     bx, cs8 s) M" i$ |& M2 U! P; a4 \
    lea     dx, int41handler2
$ |; L- ^/ n1 ^( G, o    xchg    dx, es:[41h*4]
5 X0 `! a4 v8 y7 l    xchg    bx, es:[41h*4+2]# C+ G) y, @) W( g
    mov     ax,4fh
# e, A* u6 [2 s9 E    int     41h$ O3 N' |- @) V" |! _, |8 A2 [
    xchg    dx, es:[41h*4]9 J5 m. k2 f2 L7 D/ [
    xchg    bx, es:[41h*4+2]
# k" b7 n4 k# b2 s8 N    cmp     ax, 0f386h
5 A5 ~5 a" B5 O" P& x3 F0 W    jz      SoftICE_detected6 q" I5 Y( K6 M- H) Z6 `. |$ n( E
' X; W. f8 t' `7 J
int41handler2 PROC. M4 P# T* R% p0 K2 Q
    iret8 Z5 l6 @- E/ ~* w% M5 Q
int41handler2 ENDP+ {- z6 w+ @' `, M. h
8 D- C; e% w+ e3 Z) r: C* Y1 u

% p+ k8 H! j9 }  k7 a_________________________________________________________________________% f; T9 H* s2 e* {& p0 _8 K

2 ?' D7 R6 K* B) z9 N0 n- q( N& x9 c3 H2 L  ^: j$ }
Method 06, E3 P& }. Z8 q7 Y% i0 M- {9 j4 I
=========/ e. i* ~7 f1 `6 S
4 c+ K5 q, ~. L6 z1 H% `

, G/ r. }6 M6 ?6 f2nd method similar to the preceding one but more difficult to detect:
" M7 p& I3 d) s# X$ R9 I. s* d+ s, Q1 N3 u% I3 N
4 {: p( M" p/ A6 i' A9 t
int41handler PROC
& S. x+ n# {3 L+ D$ R9 U# [    mov     cl,al
9 k# w0 ^, y) Q# b/ d! b( c: j    iret* m  I, I3 M- e9 R3 @) m- t' i
int41handler ENDP
  ^# U6 _: Q) h9 X) z) y
" V( X& l7 q7 o4 q. D5 J, A5 N/ @$ u4 L  {7 |
    xor     ax,ax
' F) S6 f2 v& F, I) H4 |* H7 k- F    mov     es,ax
8 m- Z) e% f6 Y- W: k    mov     bx, cs) ~- W- U1 Z  U: [; ]7 `7 `
    lea     dx, int41handler
. y$ S- L! i' A+ Y    xchg    dx, es:[41h*4]  x/ [# m5 ^: |% F
    xchg    bx, es:[41h*4+2]( W- ?3 T! ]2 J" |, Q
    in      al, 40h( P' N. i* e+ K. w9 Y
    xor     cx,cx0 u  D6 b1 I1 b& Y! X. g6 |2 W
    int     41h
  {- ~) i7 S& L$ ?1 g$ K    xchg    dx, es:[41h*4]
! O$ D3 s% Z* R& F6 v    xchg    bx, es:[41h*4+2]
- v* V, j  i% p3 y    cmp     cl,al: W. i5 B7 |4 m8 x* j, e
    jnz     SoftICE_detected
( o) _9 D/ s% s2 B# h' e; P$ _; [
_________________________________________________________________________+ p" R) Y% J; v# ]! b" F6 V* h
- Y2 P# Y0 j* W+ l4 T, A/ y" P& f6 K
Method 07
6 B( ?& `! y4 }/ L" R6 c=========# }2 D  e, ^" D

+ ]  x+ B. E0 G  {7 z, S4 w- PMethod of detection of the WinICE handler in the int68h (V86)
! Q- N) s+ `: n3 Q% l' j6 r
* P5 z7 {  J2 Z$ V& u; O% r2 D( f    mov     ah,43h
& H2 q# h' j+ @' F  E( g- M    int     68h
/ t% R; O; P* ^4 ^    cmp     ax,0F386h3 w- v2 z7 g" D6 b
    jz      SoftICE_Detected1 L9 B% K  Z) ~$ N; m. S
% q; ^  D5 X" l6 P

5 o! ?$ F4 u. h' u9 c=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
% \+ w. O, I% [: z! T  S   app like this:" g5 [% q2 Y6 w5 O
! b+ m, O' Y! z2 o5 \
   BPX exec_int if ax==68
" [7 Q. o. i  Y, \( O, }+ o- X   (function called is located at byte ptr [ebp+1Dh] and client eip is. E6 H, i5 _4 u$ A- M
   located at [ebp+48h] for 32Bit apps)
- e5 M# {  P& h- }; t! o__________________________________________________________________________; e& K  E! P5 j# j

& B6 ?) B5 P4 |9 d5 E; X7 ^* i0 l- R! w3 j+ q
Method 087 ?& f  S( q/ r1 P, P; ?
=========
$ |2 a, ]0 G8 N
+ w2 @) ^9 ^$ r2 j/ q6 B7 f# nIt is not a method of detection of SoftICE but a possibility to crash the% n& ^( X, p! D
system by intercepting int 01h and int 03h and redirecting them to another# k0 R" @, S. A! S/ z
routine.. U) o8 w% q- c/ |# l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
4 s; ?6 ?0 k: ?$ r0 Mto the new routine to execute (hangs computer...)
6 O" L/ Y/ b* V& W: d& K( R  Q
* }6 Q- a% Y, _/ [    mov     ah, 25h* J6 U' k# ?- _6 a
    mov     al, Int_Number (01h or 03h)# T7 M- Y7 ~. g' F5 i0 U" L
    mov     dx, offset New_Int_Routine
# p" F8 Z& x5 S  m5 I    int     21h
# M* E* {& y4 `- h6 o( D$ B: Q2 O1 _; l* q( P
__________________________________________________________________________' j. o) o) e3 J* Q5 v7 ?  Q; m

6 _: G9 e* E- yMethod 09* o' H6 D) L/ f
=========
  H1 g; y6 F; q) X- \% A# h+ Q4 B- x' q* c0 z2 n& Y; a% j0 S
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only* u8 M' b0 N  e! G, E0 W' _
performed in ring0 (VxD or a ring3 app using the VxdCall)., l& T" S; @0 }* x- Y. J
The Get_DDB service is used to determine whether or not a VxD is installed# O" r( L2 ^" |8 H& j' u
for the specified device and returns a Device Description Block (in ecx) for
# x1 G% i4 L; d1 ?" Bthat device if it is installed.8 z2 ^* ?* {6 G' {  J/ q$ e

; K. U; w& }- m* e9 B& W   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' z. v6 L! M4 ~0 C7 {   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* f; L# E6 |$ z% }  [) S   VMMCall Get_DDB
5 J; v) ?9 P0 Y: q/ W   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 }+ p2 F& T+ z$ C5 X
) D* Q5 r9 F2 [& F. Z4 ~, Q' qNote as well that you can easily detect this method with SoftICE:
. @0 J6 I1 ?( f) |' l   bpx Get_DDB if ax==0202 || ax==7a5fh. q0 @% e* W0 J; j+ R! ?

1 I9 n# _( x5 M7 U6 M% F! N% h__________________________________________________________________________
3 h) w3 A' m5 [2 I4 Q; {. l7 N7 W. g: h# Q( C$ P7 }
Method 102 y' B  o' M  G. X+ Z; U, N3 O
=========
1 A3 B5 o: i0 b- O' L% U% I$ o. r8 z+ A
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with, _7 [1 t& W; j" A
  SoftICE while the option is enable!!6 g* R( L1 V! {% t8 K
% M0 i8 ]6 X2 |' E# P8 `! _; p
This trick is very efficient:
, ~) n: Q9 N; _9 I4 Sby checking the Debug Registers, you can detect if SoftICE is loaded
9 P- [8 \! ]1 p, z(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if; R9 ?5 r) A! T: g
there are some memory breakpoints set (dr0 to dr3) simply by reading their
" s2 n& Q9 X8 m9 [value (in ring0 only). Values can be manipulated and or changed as well
- n; I  p2 M9 {- ], ]4 U(clearing BPMs for instance), l8 R4 F6 F+ U0 ^  s! q

2 j- `, U% I4 ^4 c__________________________________________________________________________
4 \! R. y3 K2 R4 Z$ R7 c3 z+ P" t! }6 A7 p& ?
Method 11
; x/ ^% s% \( a$ D" r=========# f/ @* w8 w% D

; c9 x" {# d" n- q! L/ h6 [This method is most known as 'MeltICE' because it has been freely distributed
( U, n0 v+ N  Qvia www.winfiles.com. However it was first used by NuMega people to allow
$ P, D7 w: ~; W5 d( |Symbol Loader to check if SoftICE was active or not (the code is located( Y1 I9 L! w; L" _. l- ]# T
inside nmtrans.dll).  P  `$ w9 t9 |( j$ B1 N
/ w8 p  k) z8 A6 f4 r: W
The way it works is very simple:+ g7 ^; B  X; f1 {& I% R0 W! g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
! H1 P, n  A, L+ `WinNT) with the CreateFileA API.
' P7 }6 x$ D$ l$ s. S# u! |' f& C" b% n6 t
Here is a sample (checking for 'SICE'):
, e' @/ K) z5 d+ h$ P1 S
! ]- B; i3 u  N$ g2 o' g% _BOOL IsSoftIce95Loaded()9 T. F. x2 n8 w" [
{2 ?8 u/ ~; d9 Z0 S: `
   HANDLE hFile;  
' g2 I3 E( F0 i8 h   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
  V& n8 I+ O8 P' x7 \: v/ r                      FILE_SHARE_READ | FILE_SHARE_WRITE,9 Z& O  [2 u& Y1 j( Y' M, T
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! A, O' \) h6 }% }   if( hFile != INVALID_HANDLE_VALUE )9 x6 T; x# Y; L) S% T0 m. g- J
   {. g' }+ R9 |' }8 m8 D
      CloseHandle(hFile);
' R) l' i" N4 K3 u  G2 w      return TRUE;9 P: R2 b' e: @5 m( g, h% |
   }
- P/ r3 [- A0 @; M9 u5 d1 i/ [% V9 T   return FALSE;/ D# `/ u6 Z$ G/ F* s2 Y4 ~( A: s: E
}- M2 [* D! A3 o) L0 |  S( \
4 F" T' f* J: ~) ?# P7 S2 I1 @' Y
Although this trick calls the CreateFileA function, don't even expect to be
1 e2 p+ }# ]; {" ^# l& c- a5 w' rable to intercept it by installing a IFS hook: it will not work, no way!
. }8 V( k7 N4 m5 hIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
9 @/ [, \; @* x8 Aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function). ~& z7 f' m7 d8 q- m4 G
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
1 X4 E) F$ A+ R+ D2 P7 j+ |field.
, ~5 E+ E- q6 x! d0 }1 y: }- BIn fact, its purpose is not to load/unload VxDs but only to send a , t5 y; c  s( S& W, S9 ~2 r
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# I8 [( t& p4 b( O$ E# D: t2 {! }
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 w  i& I- z8 K, A. T2 R2 F! N& uto load/unload a non-dynamically loadable driver such as SoftICE ;-).
7 s) e: a  Z6 p& d0 `If the VxD is loaded, it will always clear eax and the Carry flag to allow
  s' y- q2 |2 cits handle to be opened and then, will be detected.
) Z+ u% w9 x+ ]9 jYou can check that simply by hooking Winice.exe control proc entry point
3 H& `. B& v2 E0 r( bwhile running MeltICE.6 |$ S. h+ t; K$ ]* ?
' v  T0 K# l& Q$ ?4 b9 V

- a% F8 V- g$ G1 _: E' B7 B  00401067:  push      00402025    ; \\.\SICE
' @# ~4 }# D5 R; L  D3 f  0040106C:  call      CreateFileA
) L/ z- D: h; I  00401071:  cmp       eax,-0010 T! }3 W% b4 H/ q
  00401074:  je        004010916 ~4 u. J% P" I; T% F  l
& @7 `# y& s, {& a) i; S

; S2 N0 j0 f2 V& |" sThere could be hundreds of BPX you could use to detect this trick.# L' K/ v! h2 B3 ^1 V8 Z; T
-The most classical one is:
8 V/ g5 L8 s' n: `  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||/ Q; X- y- ^5 E; A& B5 e3 I0 `
    *(esp-&gt;4+4)=='NTIC'
9 Y2 A1 J3 F! q/ G0 d8 o# `) Z8 V8 U) }$ N( y2 ?9 z
-The most exotic ones (could be very slooooow :-(
- F, }8 ^8 J$ {/ }- n   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
  U1 B4 X9 o& t! z9 D) m& W     ;will break 3 times :-(7 q- h* e1 Y4 Y4 q/ i

. V  k- |. @! X-or (a bit) faster:
, `3 v& m! Y9 J   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
- k% u* n2 f2 E% ~/ E% \+ E. N% C' T; H
6 _' K1 g7 I# T( d   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 ?, A" c) _2 W4 O2 d6 U3 [     ;will break 3 times :-(
3 H+ T5 F% v1 p& p
3 v7 W4 f4 I2 d$ a3 o2 x. v-Much faster:
& s: F9 r! x; ~3 D) {! m   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'" S8 r$ M8 N3 z2 q2 I* \2 c8 v

9 I) ]8 e+ m3 t7 _0 x. F  N, Z; ^Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
( T0 n, D/ F' `  H. ^function to do the same job:
, c  y% p3 R/ U' r# f3 B8 s& y* G  Z: }4 V& w  G2 s* j4 ^
   push    00                        ; OF_READ
* M% A$ Q, K' C   mov     eax,[00656634]            ; '\\.\SICE',0
6 `5 k! W  s& [   push    eax
* j5 r* F8 i( M7 J   call    KERNEL32!_lopen- |9 c! D* P' R( A
   inc     eax
" M' y! \2 N( m7 M5 j# D   jnz     00650589                  ; detected) N* r; [7 |! j. }. \
   push    00                        ; OF_READ8 W7 E. f# ~9 Y+ X$ k4 t
   mov     eax,[00656638]            ; '\\.\SICE'6 T8 W' `) q) [" s2 P
   push    eax- Q$ o" K5 F5 V; B2 o+ L% _# A2 Y
   call    KERNEL32!_lopen
7 K5 M" s4 `- t: C& h6 g   inc     eax7 B7 i+ c) Y5 ^) m- @8 ~
   jz      006505ae                  ; not detected
' @( U, z$ g# W1 t
# |' ?+ T& R! ]6 h9 y) H
4 V# y+ Z3 D4 E__________________________________________________________________________
' p" ^2 v' y4 Z) ]; H. Q: {$ m& G0 V0 V3 P4 h1 G7 Z0 w6 X
Method 12
, ]+ l8 f7 s1 X/ x6 ]=========
5 M% v  V8 F' n" x$ {* w; F. H
" H( V, W! v6 g0 y- w/ bThis trick is similar to int41h/4fh Debugger installation check (code 05
; Q% t; B( h6 u0 u( Y&amp; 06) but very limited because it's only available for Win95/98 (not NT)
% f3 m. \' l* P: |: Pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.7 v7 O8 E1 V) D- a

2 ]% n' d  [( k- S( g3 M' [0 X   push  0000004fh         ; function 4fh
7 A3 F( r! \& f+ `   push  002a002ah         ; high word specifies which VxD (VWIN32)  n- U8 l+ A0 Q/ h# F% b5 t
                           ; low word specifies which service
* d+ @& h* E1 p# x4 Z# I, @                             (VWIN32_Int41Dispatch)
) v2 U3 d1 M2 v! ~7 A6 Z   call  Kernel32!ORD_001  ; VxdCall: j* w% s) |3 q0 l
   cmp   ax, 0f386h        ; magic number returned by system debuggers  P5 r# A4 L- v
   jz    SoftICE_detected$ \! E$ M$ t# Y8 I

& @: _( ], u& g! eHere again, several ways to detect it:
1 q6 J0 j) R3 u7 a5 W" |
8 H- E6 |$ y; I0 t    BPINT 41 if ax==4f) `" M9 n2 o, S) X# O
$ R3 H0 A# r% N$ k, g
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one; E2 Y; P0 Q9 r. @

% h- j& M$ a2 ?; Y# C( Y    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A1 x) W4 M, @4 J. U) K

) U* e& G2 O, b  m+ ^1 H- J    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!+ D+ ]( U  h, U, p& U

2 A1 g6 n" X' `6 {8 Y9 F__________________________________________________________________________
9 D, e, I/ d* m  @! c" M* @% k0 i0 ~2 z2 D) c8 K0 @+ G0 w
Method 13
" m7 I' e. H1 Q& N* k3 g=========% N# _; H2 ^) l: ^0 {
' E. [4 a# I" p+ t4 x2 X4 x% c: H
Not a real method of detection, but a good way to know if SoftICE is
  L% _$ m0 c0 tinstalled on a computer and to locate its installation directory.
# a) V* N1 Z2 X  G6 yIt is used by few softs which access the following registry keys (usually #2) :
8 w: q/ r, I2 @9 x" {$ o0 g: ~/ r% K  k/ a3 k+ x8 P9 v9 V+ ~' ?
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion5 m. {( w0 {' p" A8 T
\Uninstall\SoftICE
' k  f" l. L; b-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE) T" R6 u* E) G4 v$ ~8 y9 s$ M
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion! H: \/ ~/ y# z9 f
\App Paths\Loader32.Exe
9 A: T$ T8 d/ p& c% N) g
8 n' T- [; e. w2 b) \- B7 \. X6 _6 j6 x) T3 }$ L: g$ S* c  c
Note that some nasty apps could then erase all files from SoftICE directory# T5 t" I" Q; q; t
(I faced that once :-(
9 \$ m) b0 d5 A! Y, Q. M/ B; |1 Z! ?" P/ Y/ p9 g- v
Useful breakpoint to detect it:+ J+ a5 `% r* W* R# K" V7 t7 p
1 |/ z. g; K7 l" y" k; r
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
5 T) [9 u/ w, `; u3 e% H5 U  X: I. |! _8 |6 m4 P: v* n
__________________________________________________________________________; E& M9 l6 y: Y& A

6 n* f+ J% E' R0 K
2 w" [; E, M* z1 ?( g% a8 ?  @Method 14 - M: }$ h* C5 q+ k0 j8 S
=========- w5 E1 @+ N- O7 `1 p6 |, N

3 q# @8 _- a) L4 GA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose+ N1 f' B* u7 X& e0 P! _2 ^, a( N8 q
is to determines whether a debugger is running on your system (ring0 only).
& V2 F$ R% F1 b& F( W4 Y9 d& T
8 q% p8 C0 v! ?/ R& N! e! C   VMMCall Test_Debug_Installed
% h% i% _3 W: i4 X9 i% U9 h   je      not_installed
( _) m1 `, [, Z7 l
: L& i+ e6 _2 S+ LThis service just checks a flag.  x* ]# e% A' y
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号

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

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

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