找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
. U# b% y3 |% M/ ^. @) y- L4 [1 ~- o<TBODY>( x1 F8 h: F5 s' m* r, @8 K
<TR>
( E( n9 C9 R! \<TD><PRE>Method 01
7 A5 {3 I2 S- p2 I=========
4 g' a( y5 z3 B/ `6 t( j1 ?: h' a
/ g  b' r0 q; T- ]# h, b8 O) zThis method of detection of SoftICE (as well as the following one) is' V' H8 V0 _& t& {
used by the majority of packers/encryptors found on Internet.
1 H$ f' l+ X" W, PIt seeks the signature of BoundsChecker in SoftICE6 i# s9 @6 ~. T: `, E' W

0 E7 g6 m# K2 r8 R! A$ [    mov     ebp, 04243484Bh        ; 'BCHK'
* P+ ^. H! Q  L; x4 x6 z- w; S    mov     ax, 04h
1 X" k% y$ k) p6 r& u    int     3      
/ x; _2 E: J4 q    cmp     al,4
8 G5 W4 P% E: l$ i7 n" Q    jnz     SoftICE_Detected( E9 @7 ~0 p6 E# N5 j

! B9 [2 \2 ?( i___________________________________________________________________________! K/ Y% B1 r9 b& j

6 S- Y8 `% {# b1 r1 D- _Method 028 S; D. Y  D/ Y! S- t
=========
( `' [! d- t+ U# ?% a5 u1 U  a8 o' F5 g0 e" T7 N4 S0 m8 f
Still a method very much used (perhaps the most frequent one).  It is used$ l& ~( r2 |+ K( {% [6 n6 P
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,9 C$ k. Q; q  C
or execute SoftICE commands...9 b2 x% m' y" W4 e: k$ k0 w) u! J4 d
It is also used to crash SoftICE and to force it to execute any commands( r. S! o2 E" ]( y; ?+ \
(HBOOT...) :-((  
7 z( s# W2 f' W3 m; v1 V# H3 W
% a9 |/ h% o6 G$ J5 H# u7 M- ?1 @7 AHere is a quick description:
7 _+ M4 }0 r, q-AX = 0910h   (Display string in SIce windows)9 x. B0 [: M8 k6 ^4 \
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
, Z/ j# R6 l$ T' t' G2 W$ D-AX = 0912h   (Get breakpoint infos)% }& _5 g9 j; |* u
-AX = 0913h   (Set Sice breakpoints)
# e' k7 c% Z% N4 J& D- F-AX = 0914h   (Remove SIce breakoints)
7 I. w- B: d# G# @- P" T
. h; O% v/ {7 |/ g9 zEach time you'll meet this trick, you'll see:% ~5 p6 q( W) g$ D9 z
-SI = 4647h
! m- B4 `& S  K; b: n-DI = 4A4Dh
) F3 Y5 c- t) T7 _5 y; K- h7 X1 DWhich are the 'magic values' used by SoftIce.
- a- D1 \0 r" W4 ~For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. P1 R6 w/ U# ~( e" U2 Z* f7 B* `! K7 s
Here is one example from the file "Haspinst.exe" which is the dongle HASP: e" t- ^* }5 P1 n: O1 M$ s
Envelope utility use to protect DOS applications:2 _' U3 V# U7 V  J# D6 x7 x
+ Q9 y  \" D" ~) C/ ]; J% Z
' t$ E+ R6 `' F8 ?! U
4C19:0095   MOV    AX,0911  ; execute command./ d$ m2 M5 ^" r' a1 [
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).. A* R% S5 c1 S; B( i* |- w( A
4C19:009A   MOV    SI,4647  ; 1st magic value.! F: y/ e( B  c5 R
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.1 V% c7 y: M8 k3 r% a2 ?* A: {" z
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)6 E- I7 U' v% r1 R& Y0 i, k7 |
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute  y) X2 V+ r* m# _7 H
4C19:00A4   INC    CX6 [8 {9 k) W0 v( i& b# a0 B% o
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
" R9 b: D2 m& R8 _1 A% J' n' f4C19:00A8   JB     0095     ; 6 different commands./ Z# G7 ~( B5 A6 s  N3 c# y
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
0 [7 I' ~; j0 O& Q0 p4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
8 {' j) H/ X9 @8 p8 B/ ^1 i7 ^% R) q, X) n. d4 E" {
The program will execute 6 different SIce commands located at ds:dx, which
+ |% }7 Z5 I/ u6 G! d* @: zare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
' ^7 H2 \9 |. P" V0 ]% b
2 [! I' a* N$ V  r, v4 A* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded., E' t6 i# X3 T- `) V; ^* p8 I  A9 I
___________________________________________________________________________- t2 {& Z+ F6 M8 `  _1 R

' l  C& y* V- T$ ~
* p$ |2 [! X7 Z3 j' yMethod 03
) ^' i. f/ k/ V# [=========- A% ]1 x0 Q/ O0 z+ t
$ R1 ^/ ^: J' W5 n
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h; S+ g) @" d* f- T
(API Get entry point)4 b, F: K4 a9 j3 Y$ O. P
        
9 v' Y$ _* M+ l- }# i
, Q# y' M, S* L5 [! k    xor     di,di
" h3 a4 N6 Q, l    mov     es,di3 o+ `, h' B0 q4 O% S7 f  e
    mov     ax, 1684h      
- V* h  Q; I  t* y    mov     bx, 0202h       ; VxD ID of winice! ]; r- |7 Y' @
    int     2Fh6 Z7 B6 a2 u/ T# G% y! B
    mov     ax, es          ; ES:DI -&gt; VxD API entry point+ V  s* m; ?; @  d2 I0 I
    add     ax, di2 D& N# _0 B* t/ Z, H. G4 h
    test    ax,ax7 R8 J* y0 Z- D
    jnz     SoftICE_Detected! n6 I; }8 t- u7 l+ _$ c

) o1 o8 G$ ~2 @1 p( \6 _6 W$ {___________________________________________________________________________
. b& T. t( @! k
$ u- q% a3 q5 N0 \8 q; KMethod 04/ Y. h2 {  j( h" t$ _
=========
6 Z% y$ s: A5 {7 R# B2 N
7 [5 U) |/ W7 _- f+ Q6 t% PMethod identical to the preceding one except that it seeks the ID of SoftICE
- Z; k  t2 x5 a0 f7 V3 wGFX VxD.  A9 O. J2 U  d+ z' _  X
0 S; O: f( b$ Z% N
    xor     di,di; s7 {+ u4 k+ L- q
    mov     es,di$ @" B1 B" }, e; W+ P
    mov     ax, 1684h       ' Y4 G! X3 O6 w
    mov     bx, 7a5Fh       ; VxD ID of SIWVID3 |' w9 n/ {* w/ d5 U( x
    int     2fh
& v6 G$ d- Q! [( _: i8 B0 o* g$ S    mov     ax, es          ; ES:DI -&gt; VxD API entry point. m: A# K7 [& @- |
    add     ax, di/ O' A- v$ f, \. L/ r* `* k
    test    ax,ax
- R7 Z" k  P1 M. C    jnz     SoftICE_Detected
) _8 f, Y5 w! O6 a4 l+ s' c3 C. |% j/ U- {* }2 i6 ^
__________________________________________________________________________' I1 t$ s1 M) V+ p, k

1 m$ N) u  A% j1 l. h, f. M" Y9 N: b, m9 `# E/ b% h  C$ h/ P
Method 052 h/ Q* @( V4 f% {! ?
=========
% {; U( {" G9 a% C; r$ M' C5 ~" {! Q7 t0 R7 H4 a) V8 s9 a# g
Method seeking the 'magic number' 0F386h returned (in ax) by all system2 [" }. \/ S/ d5 q0 X
debugger. It calls the int 41h, function 4Fh.7 q2 D8 Z1 a  d$ V& n" u/ x
There are several alternatives.  
! ~; x- n; T( v2 @. Y$ E! D/ _' C  Y  n3 H' M3 ~/ J9 z6 k
The following one is the simplest:5 C  Z: ~' e' B6 F- S( U
& T; i8 ?% R) m+ U& ~
    mov     ax,4fh7 D! }! _9 w/ F
    int     41h
- F" x1 S4 R& h. T% A9 B$ z1 B    cmp     ax, 0F386
. o. _6 ?, h, s& A9 F    jz      SoftICE_detected6 |# B! ^: u' g) {/ [8 u. K( U: y

( _1 v. _) u8 i' Z0 f$ p2 J
: O  t# D* W+ a& ?5 ~. gNext method as well as the following one are 2 examples from Stone's
6 R# f9 ~+ V* [+ C) t; N0 V! C; r"stn-wid.zip" (www.cracking.net):! x7 ?* s" i9 T+ t% a
& g8 G9 i+ T# R6 f/ D
    mov     bx, cs! X' O: i+ h2 x# Z
    lea     dx, int41handler2
( y+ Y3 U& m0 R3 C( k    xchg    dx, es:[41h*4]) y7 u& S1 U* ?& z
    xchg    bx, es:[41h*4+2]
1 k' [  p+ y' x5 b( H    mov     ax,4fh3 \% D! x4 @' b9 Q5 t7 t" f; M
    int     41h( r3 q/ w2 L3 r5 ^+ U
    xchg    dx, es:[41h*4]
' E. P- p' `/ A    xchg    bx, es:[41h*4+2]; j) S! B& F4 J/ }; L4 z$ b
    cmp     ax, 0f386h
5 c  g& ]" p  E: n# Y2 |$ R4 W1 D    jz      SoftICE_detected3 Y' K" W' |; E6 X4 s! l
" l% y4 l, {4 L4 ^0 x, k
int41handler2 PROC
- M5 Q4 D! L- ^' M    iret! Y) {/ B% v0 _
int41handler2 ENDP
" j: k( g' e2 T4 Q4 Q% o
1 R0 c# B; [% l: I0 _. Z
9 f0 }- o7 p: y% k( V3 U_________________________________________________________________________
) `! \$ Y" s' s' h" \
5 D( H5 g- s4 d
1 b$ D/ f7 ^' G+ LMethod 06
: Z. Z! V- }* m2 {0 l" Y" k3 t=========
# x" J$ U8 h2 n. U7 R. X/ n% B) @$ L: I1 w/ M1 i

3 |0 @1 n$ |( k+ G2nd method similar to the preceding one but more difficult to detect:
+ j* d% a) {& _$ _; J
5 H+ P  b0 V! F- m$ d/ i1 ]! a" O/ d' y0 A1 b' [5 ^3 v+ Z) L. h
int41handler PROC3 }) C! f& |& m+ K: `) B' `# ^
    mov     cl,al. M$ g. h) F4 V: t
    iret. _8 g2 m4 v# S! x  g7 P0 w% T" C
int41handler ENDP
) g, `& P; G$ H9 |6 B5 w1 h! W$ Z" C, u! v7 b  B9 }: }2 d

- S* O- r! j' j2 S# \) I( ~    xor     ax,ax
, A& @# J4 L, x    mov     es,ax4 F) G, h; Y! ~
    mov     bx, cs0 z8 x: ~" p: p9 `- Z
    lea     dx, int41handler! e+ m% y7 a! F/ r: e9 ~' a8 Q# ?
    xchg    dx, es:[41h*4]6 f2 C2 t' ^( \6 z
    xchg    bx, es:[41h*4+2]
) \8 V* A7 E4 k    in      al, 40h
/ o5 n0 s% u2 K! g* V; [- Z    xor     cx,cx
6 Y! y) r% j- M: h* B! R, R$ H. Y    int     41h3 j* T* ?: X7 V. U
    xchg    dx, es:[41h*4]
5 D  ~5 M- E: k( c9 D" S/ r    xchg    bx, es:[41h*4+2]
* `/ d/ A" L% J9 A5 H2 u    cmp     cl,al
( _+ A9 x. L5 i- k    jnz     SoftICE_detected8 i& C  n9 X; X* S* _# x7 Z

  l) p4 v" q# g# s0 {) p_________________________________________________________________________
+ }2 s% `  _+ k  Z/ m5 I
! a! X. ^1 z; v1 r7 f. YMethod 07
+ {. y5 Z* f: J& S& f7 b=========. ?. W+ _- ?+ N2 d9 J5 D' |

& j9 l$ t" J' O+ G+ YMethod of detection of the WinICE handler in the int68h (V86)$ N. ^) K& z$ D0 T, t. X

( X6 K" m- b' [5 M4 d" b. U' e    mov     ah,43h! K) x8 u4 {$ X5 o, F
    int     68h
. w1 ]% }- j4 t; s    cmp     ax,0F386h
5 O8 l/ r7 ~& o/ x( L" v    jz      SoftICE_Detected
7 |% Z6 i& }8 @( J' R! Z: W: Q2 Q6 N+ x" W* D

) e/ Z; o  Y- Y" O( c# }% M=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 O/ y4 r+ _& H   app like this:
$ K, B! \$ Z2 J. q. I9 K- A
! A( V) D# r5 V   BPX exec_int if ax==68
! U0 s2 N! @0 S; L3 Y, j: ?   (function called is located at byte ptr [ebp+1Dh] and client eip is7 A1 a4 I' d, T9 f9 r1 ^  {( }
   located at [ebp+48h] for 32Bit apps)  e9 t5 O  Q2 U+ X2 V+ g2 f
__________________________________________________________________________/ C- E- G/ H) y$ C
! Z' [/ n! Y2 w

& ~' U9 Z' B7 x( r9 {$ nMethod 08
+ T5 O0 q4 X( H9 T) e& N=========' C" Y6 \6 S3 N4 J  D) |' g
3 p' _5 j) g7 f& T% T
It is not a method of detection of SoftICE but a possibility to crash the# ~* L, e+ N, v, G' X2 z* L
system by intercepting int 01h and int 03h and redirecting them to another# k' R$ }+ d# q$ s
routine.4 U9 n9 o. S( x3 X
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
5 t, n5 n' {7 `  l+ Dto the new routine to execute (hangs computer...)
, \$ `; t' E2 g( K7 p9 B- x# @
1 |7 [; k# u7 Z  ]    mov     ah, 25h% l$ ~. E  V& p3 K; ~) a
    mov     al, Int_Number (01h or 03h)( N$ U; y9 H# b# S
    mov     dx, offset New_Int_Routine* k; R& |' t9 ~3 Q: S
    int     21h
) _4 Y& J2 i: A0 s! a8 C& e) u, z" ^! i! r
__________________________________________________________________________: M& q6 j. a; p
. h5 _8 n1 A2 u2 c. N
Method 09
. A0 ]; r1 _0 d1 O=========! F$ g: Q+ j2 a. P+ V' t

0 T2 X, B* \) e, N) mThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
# q- I, h' A( a" ?" W) a. Mperformed in ring0 (VxD or a ring3 app using the VxdCall).1 Z$ ~1 j5 n# _! q+ [
The Get_DDB service is used to determine whether or not a VxD is installed
/ e7 K* ^5 X' q1 A0 Z: Efor the specified device and returns a Device Description Block (in ecx) for7 \' h' K8 u- C: E
that device if it is installed.. G3 E1 K& S' k2 A

  j% ^3 Z. }3 F: H* ^1 L" u   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID% t/ E6 {5 n6 t2 [  o
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
9 f1 u9 M  N. p* U! P' G& k& J! e1 @8 r; C   VMMCall Get_DDB
2 x# m) \  A$ ]   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed, q; L( ]5 \+ a2 ?8 d7 L
' y/ E% g" s! l' J4 k5 {$ U0 e
Note as well that you can easily detect this method with SoftICE:
3 w. F! {' b, e; V   bpx Get_DDB if ax==0202 || ax==7a5fh  Q; r) p5 d$ x8 G% X( D5 t# d
( |( G! Y. T  C) K5 u! G0 |* `
__________________________________________________________________________; C+ g. I: U: F+ b- A: e- x' a# |

2 k( j0 C  _( z2 fMethod 10
) K% J! Z* U4 i  ^=========
3 f# f. c- J* L) P) F. n
5 w+ \" |: e6 s& P( ~=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
  ^8 d) I# v) X+ Q: J: I2 S4 H  SoftICE while the option is enable!!6 z5 s! {* u2 j& W1 n
# L+ W* s8 O- L7 R
This trick is very efficient:; K- \7 [: W, O! T8 e1 _/ c
by checking the Debug Registers, you can detect if SoftICE is loaded, d' b8 |$ n9 \, b1 e! N# N% L. y
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if6 R, r. ^  D, Z% n
there are some memory breakpoints set (dr0 to dr3) simply by reading their
, O7 c! y* U7 T) X0 W" [; B! |value (in ring0 only). Values can be manipulated and or changed as well
8 I/ U( o. j/ W, p(clearing BPMs for instance)
' a1 R- z# A  j- U9 v' f* G
2 S3 ], L4 f, h+ m4 ?__________________________________________________________________________4 p& B6 W' X% p$ W
' d9 H; Z7 J! b3 @  ~0 {
Method 11
( s  [+ d& d4 `1 @=========
( h: C0 q8 g) [) |: ^6 A1 g! {% V7 S1 y; |
This method is most known as 'MeltICE' because it has been freely distributed7 ~% J$ y; z' t# U
via www.winfiles.com. However it was first used by NuMega people to allow
+ V; s: p9 u5 C) Y1 O# z; U# e( `Symbol Loader to check if SoftICE was active or not (the code is located' Y6 n; I' @% ^& H3 w
inside nmtrans.dll).% B* P( A/ @4 H# i
$ _/ [2 e" U2 Q6 @
The way it works is very simple:
2 E' L8 d+ X* V6 MIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for. ^, ~+ b9 q. k- n
WinNT) with the CreateFileA API.
& b; l. w5 b% y0 ^- _* y* A* F! }! f1 q! K; q5 [
Here is a sample (checking for 'SICE'):
9 n. L, z0 `# K. e4 h  b
/ L6 s9 \7 [$ @BOOL IsSoftIce95Loaded()2 q8 n$ V4 X. s2 M
{
1 h$ P3 d  [  Y& U   HANDLE hFile;    Z9 U5 x/ k6 u
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,# p% z" D) [+ B5 R1 D; N! c
                      FILE_SHARE_READ | FILE_SHARE_WRITE,! q7 S( D& w4 B" {- \
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);' J% f- |! B* W  V
   if( hFile != INVALID_HANDLE_VALUE )
* {, R# d2 C) D3 ]; l" P8 N% d   {
, L1 [8 D3 C1 F      CloseHandle(hFile);
: t! |( [3 S, D% A$ c1 a+ S) o* z% C      return TRUE;; N# J7 r! `4 I+ g
   }  f" B: L1 K7 _! y
   return FALSE;
8 K3 y! W5 V% J" K0 \" M}; z. C% q8 B1 d; x4 c5 N
2 U9 r% U6 p& V% J  C  J; `
Although this trick calls the CreateFileA function, don't even expect to be
% ~& w- J/ |* J) ]& n; u7 Y, l# Kable to intercept it by installing a IFS hook: it will not work, no way!7 k2 }9 d1 Z; Z  p" v, q
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
4 [* [& f4 u" i4 tservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)' C! O, L6 ?& N. g3 O* c+ w
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
7 c; P' D, i* J0 d9 R) j8 Hfield.% v; S3 m- A1 K  o5 y% B+ ^1 U3 o
In fact, its purpose is not to load/unload VxDs but only to send a
# R; ]9 N1 E. e, Q' m( W) _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)5 ~3 ?8 o( j' z1 ^
to the VxD Control_Dispatch proc (how the hell a shareware soft could try0 T' x' Z* v9 T  X
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
# G( C4 E* E# ~- L9 UIf the VxD is loaded, it will always clear eax and the Carry flag to allow
( o7 d3 u# h& {0 ]3 p/ @, tits handle to be opened and then, will be detected.$ E! y# `: E- I8 U( |9 `: v
You can check that simply by hooking Winice.exe control proc entry point
4 o1 N  s& C' Z9 Vwhile running MeltICE.
- ~+ G- ?3 D. ?7 p0 ]
& Z" H" E* Q7 \. H9 p: ^- w/ N* q5 O1 U, F, a4 M) y
  00401067:  push      00402025    ; \\.\SICE; R2 C' f- v: |# A  j
  0040106C:  call      CreateFileA8 {% S" o& H+ f5 K
  00401071:  cmp       eax,-001
; X& \" i: [2 k  00401074:  je        00401091
0 ?" j# v2 x  q7 G3 [
4 N" J) ~0 }6 _5 u
+ C  ], b1 r! I# p0 H7 Y# NThere could be hundreds of BPX you could use to detect this trick.
( V8 L+ `$ g" H9 ]/ F: j-The most classical one is:
6 i+ ?& x- E. F) U  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
$ N) w/ `7 V$ e( `/ R( ^2 S, i    *(esp-&gt;4+4)=='NTIC'$ @! }! S8 [. M. L  Q3 Q% F$ J

) C) ?! b2 L" g7 l-The most exotic ones (could be very slooooow :-(
/ q! q' d3 ]7 a   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  . X; Q$ w3 m* ^" J7 _
     ;will break 3 times :-(/ G" H; s- ]$ P  N' J' Q2 G
8 v% n0 w5 O# ^4 l: x' v" q* t! j
-or (a bit) faster:
+ W) U! F, x$ u: k& f4 G   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). B' H0 R& r5 Q) w' n
, [/ N5 u8 i8 {: q8 m0 S( R
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  " r, v1 t5 @3 @: H. ^; I
     ;will break 3 times :-(
" y" M+ C3 ^: y9 E4 J4 a* }
9 R* x  u0 l1 s% |" B-Much faster:+ g+ C* p  ?3 g
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV': `' x* r1 y. i4 a% o6 ]

4 h, o! i/ B1 u# QNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
- Y8 t, X- j& ^6 |$ cfunction to do the same job:
7 e; Q2 b8 r5 ^  K/ \
/ m0 `$ g4 K* T% |   push    00                        ; OF_READ( f) @# m) e/ n
   mov     eax,[00656634]            ; '\\.\SICE',04 F, q4 b0 H5 U0 p
   push    eax" U/ N4 i; Q& o! y* K" L0 `
   call    KERNEL32!_lopen4 n' z7 P4 b3 A( j: L7 F+ s
   inc     eax
  D, W8 o! c3 ^- W. B3 n# D   jnz     00650589                  ; detected
  P* n% d" D& ~: K/ x   push    00                        ; OF_READ) H1 }. q. a. l1 Q2 q# z5 P: [
   mov     eax,[00656638]            ; '\\.\SICE'
3 l( p9 L' K  s# g! E   push    eax
$ g0 F' J0 e: c$ R   call    KERNEL32!_lopen8 X3 N& K* S/ Q! X2 ?- e9 Y
   inc     eax6 W* m, D) }6 \7 N) `* ~
   jz      006505ae                  ; not detected  l) v/ o* U4 G7 z
0 B) F& u2 n- ?2 O% e

+ q; \, @/ Y. L__________________________________________________________________________& Z1 [9 Z9 m5 C7 ^$ U  A
% ]( Y% }  a" X
Method 12
" i5 p/ l+ L. v; f) B=========
6 d; k- F0 F2 D' j8 q
  `! P& B) j8 @. N8 ]# G$ g/ D5 SThis trick is similar to int41h/4fh Debugger installation check (code 056 c3 E- U+ D6 _
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. P4 g% z' N6 q, \as it uses the VxDCall backdoor. This detection was found in Bleem Demo.# d- @# D' r# B" c. s

1 O  i+ Y: t7 X* h0 S  P   push  0000004fh         ; function 4fh  ]2 Y5 F- A. U$ Z5 Y1 x) q
   push  002a002ah         ; high word specifies which VxD (VWIN32)
9 S8 \1 G9 ]7 `; o. M& F5 @                           ; low word specifies which service9 e) ?7 U  }9 x5 W
                             (VWIN32_Int41Dispatch)
) E/ X5 _. W% H   call  Kernel32!ORD_001  ; VxdCall
% ^# T5 W) g% H& p  V   cmp   ax, 0f386h        ; magic number returned by system debuggers
- l7 Q$ @6 c5 p* d3 d) U   jz    SoftICE_detected
& q$ U  \! Z' X6 G; ~
3 D- F4 x3 j* e* Z' d, f; v6 jHere again, several ways to detect it:, y4 m( @8 X8 P2 f8 `0 p
) j* l( I, R: @6 f$ P. {
    BPINT 41 if ax==4f( y; j' Q: Y7 P* x& E1 W

/ R: z& r$ W" c3 p: ~2 o    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
- E! _- S) ^7 ?1 c% w
# y# w+ g, |" Q2 N    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A# j7 O7 E6 @& v' Q/ z: u

# g) p- `) p% w) Q    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!7 m/ \9 Q0 `8 s* }1 s5 `

+ k6 ?' y# I* a7 b; J1 }. v  s__________________________________________________________________________
* H' X6 J; l7 O' J
+ T, [! T. n6 I0 w$ l) R' JMethod 13
4 e) J  }  a9 P: m=========# `% o3 W; f, w9 u

1 ^' H! m; }/ H8 V9 uNot a real method of detection, but a good way to know if SoftICE is
8 b7 {) @* L7 `. U  |9 Iinstalled on a computer and to locate its installation directory.
) T* j4 A. J; ~It is used by few softs which access the following registry keys (usually #2) :# M: n6 v* f% O; U0 _6 E! ]8 \
3 Y! \+ @- j" `! U$ b6 s$ y
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion$ R% R% C. a2 j; J& W9 s
\Uninstall\SoftICE
# n8 Q" W7 H4 T" S: l5 U/ m4 v-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
0 W/ l* `  z  u( o* I' a-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
3 I2 C# D9 q% P% `, j\App Paths\Loader32.Exe( |: m9 |. @" \. I
8 \3 F6 O0 S9 Z

. U2 @7 i0 w! A0 _7 q( aNote that some nasty apps could then erase all files from SoftICE directory
! M! V' d5 g9 _& x0 ^9 T+ ]) I0 \(I faced that once :-(* G3 p0 R* Z7 _5 i! o) b
% c; w; Q2 W/ S: R: ^
Useful breakpoint to detect it:) d7 @' W1 ?" [8 T
& p6 q' n7 {+ l$ l
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
. ^' _( f. Y& y; [
4 `0 {! P2 C! A$ G4 w) Z: m* x__________________________________________________________________________
! t2 P6 Z0 l0 x$ F' B
, x' g2 e1 b2 x1 Y9 O2 s" }& r; q6 }* J% \- \
Method 14 1 ^9 @$ y4 e2 ^- `
=========8 ]. L' F# q3 A$ _
8 C- ]8 x3 Q, H) O2 U" r
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose; V# b& D2 H7 g% q9 `# L* E" |
is to determines whether a debugger is running on your system (ring0 only).
1 K" [% H0 I7 f4 O7 d7 w4 \& |4 y) b3 ^9 |% v5 G
   VMMCall Test_Debug_Installed* [. z+ `% U6 d3 y8 \" F4 x% {7 w
   je      not_installed* M3 I+ Z' S; S7 Q  e/ ]/ X: P$ u
9 }. l7 i) V8 B3 _! z9 c
This service just checks a flag., ~% S2 g4 N4 d4 t
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-26 21:56

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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