找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; I  R* A2 m& e' @* Z<TBODY># {: \  w7 a) O$ w/ N" }: ]
<TR>7 N# v8 g0 _. Q4 G! b- ]6 a3 U
<TD><PRE>Method 01 . H6 K/ }* l+ e: K7 g
=========
1 X' U, T; f: U8 Y
% b- _8 s  Q) D$ hThis method of detection of SoftICE (as well as the following one) is" d/ q! b4 }# |7 h9 V' |
used by the majority of packers/encryptors found on Internet.: H5 g: r8 S. u
It seeks the signature of BoundsChecker in SoftICE
+ f4 Q9 G( E5 Z( j  ^% \" W) i9 F+ \2 W/ c& Y2 t! F
    mov     ebp, 04243484Bh        ; 'BCHK'
4 E: [+ R  P, B$ @: |    mov     ax, 04h
+ r0 Q% B3 R' K    int     3       . k8 B7 X; l4 R! `
    cmp     al,4
; `9 K, T5 u4 D* }- Y    jnz     SoftICE_Detected. q0 V, e" c# ~- n' P
' [# Q% ^: U5 r, f: S% |
___________________________________________________________________________
9 Q( j0 K: \$ X' E' G( c3 x  `4 h4 _; v/ v  g1 U
Method 02) }; Z& b2 Q* j0 a& ]
=========- O1 V+ b, B$ Y4 H

/ H2 t' {( d+ a3 I. o! O% l# e0 AStill a method very much used (perhaps the most frequent one).  It is used0 Z- K% [5 E8 }& q
to get SoftICE 'Back Door commands' which gives infos on Breakpoints," ?  a- B; }3 Y" t$ |
or execute SoftICE commands...
! ?! U& Q) L$ F2 vIt is also used to crash SoftICE and to force it to execute any commands$ {( G5 `* M! K; t) N3 ]
(HBOOT...) :-((  
5 b* T0 }! D: l! O$ X1 z/ Z
! d- P& _+ w. V3 c; R5 AHere is a quick description:+ i. |3 \3 {8 R$ [8 N
-AX = 0910h   (Display string in SIce windows)
* O0 \/ A5 k% r1 L-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)7 `5 Z& c4 T# @* |% r  \) w6 }
-AX = 0912h   (Get breakpoint infos)/ h7 h2 p0 S0 E
-AX = 0913h   (Set Sice breakpoints)
5 v- x0 [$ d8 {/ Z8 L-AX = 0914h   (Remove SIce breakoints)
/ x8 j9 h" r4 d- Y) _2 R7 H/ N& m4 ]; U. d( Z' E5 k  U
Each time you'll meet this trick, you'll see:  u: r6 P3 j& E" \$ l1 f
-SI = 4647h/ P" a  p; h* O1 }% L9 T
-DI = 4A4Dh
1 [7 J" H9 Q1 |) o4 ^, qWhich are the 'magic values' used by SoftIce.; B9 i4 }1 Y) Q5 k
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.$ e# |1 I2 N6 Q7 m! s
  h( @; ?3 I) C: x
Here is one example from the file "Haspinst.exe" which is the dongle HASP
# H( c% k# B/ ~! V% b+ q+ jEnvelope utility use to protect DOS applications:( w/ ~$ c2 m" C1 w4 ~
' |5 B$ u  S/ c; E% ~

& ^* S2 L) L2 ]  ~$ Y* E4C19:0095   MOV    AX,0911  ; execute command.
, x. b2 x2 e" {6 E8 r. z2 m4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).& M) A% S% B; A# c: S: E
4C19:009A   MOV    SI,4647  ; 1st magic value.$ j0 f) P! R& C4 v# X
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
  M2 _/ R, ~8 j+ F+ d3 R% b* {4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
- |" j9 b2 l! u0 c4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute4 e0 [. I+ j0 H( N6 x0 v, X. B
4C19:00A4   INC    CX
: v0 n& i9 ^+ `; [: f+ N2 L2 e4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute: P6 D8 f# Z* w+ \
4C19:00A8   JB     0095     ; 6 different commands.
* c& g4 ?1 }  D$ Z4C19:00AA   JMP    0002     ; Bad_Guy jmp back.7 Q: R9 O* S$ X: ?, n5 q  H
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)" T3 t+ P1 d" ~6 F, O. q0 ^
# X2 R1 h2 H. h" L
The program will execute 6 different SIce commands located at ds:dx, which4 {. O; @' j, _
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
$ l% f3 K* Q5 u" w# V  m6 g+ Y. a, g
2 N3 \  v& J8 g$ i. e3 B* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
4 w5 Y; e; j+ T3 C0 n( ?: @___________________________________________________________________________0 I- s# Q4 U; A  }6 h

) f9 B! `- ^' t5 `& ?. b# ^* \! d5 C) B: u: ^4 k# Q( K
Method 03/ u8 ~* {6 Z" n. V
=========, \1 i  i# y+ T1 a' ^  Q

5 t' x5 e) i' M7 uLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. F8 @1 }4 F0 l: Z/ |' ?" L(API Get entry point). ?( E9 u8 [2 h6 }
        
% V, S3 P0 Z7 q1 w( Z
+ U# H$ G: l; r9 H9 `. u    xor     di,di0 i) }% K) h' X" B" ]$ d( ^
    mov     es,di, O) t- H3 y, t  d( |( n+ m
    mov     ax, 1684h       6 [6 A6 i6 \) M1 |1 S! E
    mov     bx, 0202h       ; VxD ID of winice- ?+ @+ X5 P& T% T
    int     2Fh
/ [, B, l& W; _* D    mov     ax, es          ; ES:DI -&gt; VxD API entry point
1 Y( L+ p( w, u, T/ A* L    add     ax, di7 s# e  [$ P6 G
    test    ax,ax) O$ D5 ?" |" a
    jnz     SoftICE_Detected
* I6 d" J$ U/ e+ A4 h: r- k3 q6 D0 H1 {
___________________________________________________________________________" e7 T1 u! _9 s, |' X0 q8 e2 M# r
" Z& i! j3 B0 {6 O
Method 04
  D- W2 W/ r# U4 z. U' h; F=========  V! `% {. I- N' q
7 Y; ~: y8 J3 D( o0 ~
Method identical to the preceding one except that it seeks the ID of SoftICE
8 I1 T6 y) X5 ]9 n0 x3 n# u6 QGFX VxD.
* Y) r, {4 J5 f3 [6 p) _7 P: r: g# p0 x* A1 U7 E' [
    xor     di,di
8 P% E' A% s/ w0 o' I  y    mov     es,di4 W( {( R. a7 @3 J# a
    mov     ax, 1684h         o# Y8 ^7 f) X& ?4 R
    mov     bx, 7a5Fh       ; VxD ID of SIWVID% C. I3 Z% Q" C: Z6 t4 c2 E" K
    int     2fh
7 E: ^: _5 B6 N$ F: y+ W( n# u    mov     ax, es          ; ES:DI -&gt; VxD API entry point5 C. H3 u( J  r& f
    add     ax, di; T  m$ T8 d: B( {( [' b
    test    ax,ax
$ Y! n/ a; p4 O5 J: T    jnz     SoftICE_Detected2 v; L% I9 ~) u" M
7 ?. }# s' q$ X( |2 e1 ~9 E* ^( e
__________________________________________________________________________6 D: o/ j5 Y; z, A" q
1 V* X# {+ t3 f) G; ^& y

$ U- O# H7 a" T0 @: }Method 05( D0 j# d( j+ f
=========" z8 o  P/ C' T( w+ F+ y* Q& A$ M% O

( n, b9 m( P/ `5 Z% pMethod seeking the 'magic number' 0F386h returned (in ax) by all system; O  m1 q. y, B6 X: F8 Q5 N
debugger. It calls the int 41h, function 4Fh.
0 C9 D+ e9 [1 |8 |, x" rThere are several alternatives.  
$ O" l# I3 f# J0 l: W- w* K& w* i  O9 t* h  v
The following one is the simplest:2 d7 G. o) @& |3 d/ u
" i6 p6 k" f* C1 y- H; M8 `
    mov     ax,4fh, }7 @9 {" _2 P& x* w/ X
    int     41h
: k3 |# Y9 F$ ?6 w2 o    cmp     ax, 0F386& S# B2 C% K8 w: X$ j4 q
    jz      SoftICE_detected
* o) d7 m- [; v$ [7 G% q. M  |& V+ z
9 o! W+ L9 M1 T& U
, E* N: \8 O* I6 ^# i3 WNext method as well as the following one are 2 examples from Stone's " n+ |) f) I$ q+ s; B( Y
"stn-wid.zip" (www.cracking.net):
3 E% _4 H+ |! l6 M$ o) j) e* A7 V" t" a4 V! ~3 q, B+ Y
    mov     bx, cs: M1 }( {+ E, @0 N9 _9 ?
    lea     dx, int41handler22 x$ Z5 F& p! k8 F3 a  }
    xchg    dx, es:[41h*4]
- r+ h6 o; {3 E4 N    xchg    bx, es:[41h*4+2]
$ R) y9 U+ o( `, }    mov     ax,4fh+ _$ ?, c# I) Y5 e1 I
    int     41h# t+ o  z9 K/ I7 G7 l* ]0 g
    xchg    dx, es:[41h*4], W+ Q' c% B. N% B7 h
    xchg    bx, es:[41h*4+2]! [" J, Z% k; p4 Z7 w+ D
    cmp     ax, 0f386h
! s& E& G5 |' x: x: a; ?3 C" b    jz      SoftICE_detected
# Q6 j. U8 N* T$ E
5 n6 W9 E+ H% e1 ?int41handler2 PROC
7 i0 F4 t0 l' m8 f3 v+ h    iret# I* S1 w3 f$ V, f+ I# @1 m6 W
int41handler2 ENDP
* K& A. E% {/ i( M" O! U
/ @# F& p) b" i$ m2 [$ `4 v/ S5 j* H2 Y
_________________________________________________________________________9 m4 m, q  H" h( h/ M3 O
; o" d1 c/ i3 D$ s, a& Z

& N1 D7 n. [7 ~" n% CMethod 061 w; ~. @0 o, k$ e2 L
=========
: Y: V/ ?% a1 ?8 I8 H% T  X  ?5 U9 U2 y/ J: g/ |7 [# }+ N& K

' z2 c( `2 ?% ^. C) @+ U7 R2nd method similar to the preceding one but more difficult to detect:
0 ?* R3 i$ w' T4 p
+ \2 p% s& k  N" n
$ M. [+ x; L( Lint41handler PROC$ R" }6 M9 N! j
    mov     cl,al
; T# f7 a0 o( `* U    iret
' r/ v/ Z: D# e9 b) T, k! Jint41handler ENDP; f: }! g# U$ K& |, U

' r; P, }) X. p' t
9 Z6 j( k. D/ E1 E- v+ ^    xor     ax,ax5 F" Q6 f$ f  D9 R5 p
    mov     es,ax' E/ X. g( e  {& Y; {$ B! @% D
    mov     bx, cs
" y0 F, T3 C- r- _3 _; r) R    lea     dx, int41handler
6 a3 y2 t! ]1 Q    xchg    dx, es:[41h*4]3 k9 v- W7 N& n8 \; E; h5 U% f
    xchg    bx, es:[41h*4+2]
  Q' M2 N# P3 O/ t    in      al, 40h
* A9 J0 }8 K3 K. `    xor     cx,cx, `6 g" k4 r# `
    int     41h4 z* w* i. r. f; D7 K4 |" `, g0 s
    xchg    dx, es:[41h*4]# k$ E( k3 p$ r7 {% J
    xchg    bx, es:[41h*4+2]
- T- |, H- ^) `/ D0 q9 o5 z    cmp     cl,al+ g6 \2 l: F2 t: w9 h- `
    jnz     SoftICE_detected& J7 t' I' D: P9 Y( n
6 a# z$ C; g. w$ b5 D
_________________________________________________________________________
9 |" W( s- k6 G+ w2 G+ |8 |
# E! I5 g' z0 r/ X/ |% B! ~Method 07
% E1 g. }" \$ J# V( K# t5 t2 i$ |=========
! B8 R. B4 H* d4 x; P+ s
! O0 u9 B- [' O+ gMethod of detection of the WinICE handler in the int68h (V86)
& s- Y+ T- }) Q! H) Q$ z0 U
& m7 H1 h4 W4 b& Z  `# Q. R' y7 K    mov     ah,43h& L$ _) ^' R  l1 l: q; ^' F
    int     68h
8 ?3 \( W/ |: N# [8 m; i* |2 \+ Q$ Y    cmp     ax,0F386h
: G2 I$ x0 j# J( a  F3 Y: h    jz      SoftICE_Detected3 ~; l3 W7 t" [" h. {6 p8 J
% s( r! E" R/ D9 ^* i4 `* c
" v- N! j+ a. `0 J+ g9 N) y
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
! k$ u- e* W) v; V( L; p   app like this:" L+ m, T* H  N; @0 [) F& w1 X
& P" a; ]' u4 @: n4 b. s* G& T
   BPX exec_int if ax==68. s; S% f* }& _3 n& q+ n
   (function called is located at byte ptr [ebp+1Dh] and client eip is, m8 v! c6 @2 l3 L
   located at [ebp+48h] for 32Bit apps)" [9 |1 ]7 @) G$ D, u# l
__________________________________________________________________________$ p+ @( x9 |3 j7 q* Y

7 g8 M1 y( \+ D; E5 P2 [* e2 s5 e- z: D: W3 L4 d7 ]4 n: V, F
Method 08
- y( B2 A: E% u# X4 B' C=========( @/ i2 j4 F) ]
4 G7 F* g! v4 t. ]
It is not a method of detection of SoftICE but a possibility to crash the
9 J/ I: ]' s6 F) wsystem by intercepting int 01h and int 03h and redirecting them to another7 _/ K6 {! y) @
routine.
5 a7 L3 t% K# o, rIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 F" x; S! B  p! B9 `" O: Pto the new routine to execute (hangs computer...)5 c- Z/ e4 U3 I5 A( I# u6 ]
; A9 m% i: R( a, Q5 n+ p
    mov     ah, 25h
7 H6 A4 n" l) m3 Z$ x$ j    mov     al, Int_Number (01h or 03h)' N+ o+ Q5 _: E6 }/ [9 p
    mov     dx, offset New_Int_Routine
, T0 N7 k: Y' ?    int     21h
7 \" Y! }9 P- s5 [6 U1 h8 z& v1 `; s
__________________________________________________________________________
, X. j. X+ }# H" l9 m, `
% H. a* F- G/ B4 t( @' yMethod 09: r; V2 b5 }& w$ o5 g
=========$ ^% V) v) m# p  L/ N/ z6 o
# E5 f: w( k) b2 }6 N
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only2 W/ J) L& ^, G1 {3 H+ p
performed in ring0 (VxD or a ring3 app using the VxdCall)., H- x* `& T8 X/ U+ a
The Get_DDB service is used to determine whether or not a VxD is installed
* T1 H- }, M/ q* t6 _* [  sfor the specified device and returns a Device Description Block (in ecx) for
& G% C6 F9 S' Q" R: dthat device if it is installed.5 C5 G$ g3 a( @4 r7 P

2 ^0 V1 j% {6 R   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID  g6 u) l* w, `
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
* h* Y% m; R3 G* i; _   VMMCall Get_DDB
( z3 K8 p3 g( Z" U   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
' X4 `; @& a+ s" o* |& n$ B1 `
7 o9 A8 y6 h. z$ GNote as well that you can easily detect this method with SoftICE:6 d" X  Q$ C6 b
   bpx Get_DDB if ax==0202 || ax==7a5fh; d/ w8 w9 d( ?* t$ o' |

9 B6 }$ H5 z% p  u, }__________________________________________________________________________' ?4 o. R& b( U0 U% N, X
" @3 B* f9 s% v0 ?/ p# n) p8 }
Method 10
7 {. R( b% B0 I& `7 q0 N  t=========& v% l# M4 m. L' q, B

) v& r; |. |0 D* _=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
/ X9 b' L* J% E, A" I1 f  SoftICE while the option is enable!!8 R& W6 o( T1 ?" i0 @+ F: j' o" d
4 Q6 H/ v# D0 B0 m. r- y0 V" y
This trick is very efficient:, w( G$ P. S6 R& {* f7 ~
by checking the Debug Registers, you can detect if SoftICE is loaded, E- D5 M4 H* Q6 a5 C9 G
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
! S8 z/ L& ^0 v0 Pthere are some memory breakpoints set (dr0 to dr3) simply by reading their2 f0 y  ?% k+ v" i
value (in ring0 only). Values can be manipulated and or changed as well6 g: W; w, ?# [
(clearing BPMs for instance)1 h$ O4 ?1 c( M& D5 d' x) r: [4 P
3 H& ^! Z% q9 J* M6 Q, e# v" D& ?
__________________________________________________________________________" x4 Y; i# w  l; `) S8 I- y
4 R% i0 T4 z) w
Method 11
8 Z& i! W- h  z8 r( R0 f# t=========
4 D0 Q* }; c; h' t: {- s& M2 R
" s) s$ A2 l( P$ L, L# \This method is most known as 'MeltICE' because it has been freely distributed
6 ]; ~8 j9 I- r8 d/ b, p, @via www.winfiles.com. However it was first used by NuMega people to allow7 [: Z0 ]" K( F* o' e, Z
Symbol Loader to check if SoftICE was active or not (the code is located
- b* O- c1 S4 e! R  X2 ]+ D8 pinside nmtrans.dll).
/ W1 ~! |* L. J' @1 b7 {& ~. ~0 A1 O. @" N) i: G
The way it works is very simple:) v' n+ A" Z. e, t- j4 {
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& A- N4 z% W/ `2 y4 |. d
WinNT) with the CreateFileA API.2 t% c; q8 C8 _6 Z% C1 u0 F6 ^! g: o3 F
; n$ _4 B. K9 H2 {$ Y
Here is a sample (checking for 'SICE'):
8 a1 |6 Y+ q5 I' z4 ], b, J! _5 M" K8 A6 ~
BOOL IsSoftIce95Loaded()3 c* l1 ~( S+ G$ v2 W
{$ u. n& ?8 K8 |& j! ^' ^
   HANDLE hFile;    T) U/ I) n( G
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,3 A( N  ~( L, ~9 u. S
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
2 }7 X( W& o6 V$ l4 V: U+ j( b( J- L                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 X0 p" C% \1 r) u8 H' i7 M6 `
   if( hFile != INVALID_HANDLE_VALUE )
, I" `9 G: `; `+ N0 N+ S1 u   {
8 L, U9 `% ?. M1 L& a8 F& B$ I      CloseHandle(hFile);& I# p- P- R: g, [
      return TRUE;
4 X1 v& A; @1 v( k* m7 m1 _$ P: b   }. y! Q5 f* u( n
   return FALSE;5 j) T  C% Q9 l. M3 K
}2 e) J: ~8 F: p  U! S
: J* |  L9 j9 t- m6 s) M
Although this trick calls the CreateFileA function, don't even expect to be
1 r4 j: L0 I6 R8 u& c  `7 b  P. Fable to intercept it by installing a IFS hook: it will not work, no way!
: O) d2 D% i  G" z3 j0 A: xIn fact, after the call to CreateFileA it will get through VWIN32 0x001F% z+ q; i, W6 P% n8 h3 M# ~
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
: w7 X7 ]1 Y) }8 E7 |, Y+ p. A% Xand then browse the DDB list until it find the VxD and its DDB_Control_Proc! y& \4 C' T& X) y) f- C# W1 _: b4 b8 ]
field.
: v5 f9 X; R; j9 vIn fact, its purpose is not to load/unload VxDs but only to send a + }4 M+ F, p, k: Z9 H
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)# C8 K0 `+ V& q7 C2 U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& ^& e- B/ e7 I8 U5 rto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 @& X; j9 w  n, z  N, `& ?If the VxD is loaded, it will always clear eax and the Carry flag to allow
) |- o+ W* d" cits handle to be opened and then, will be detected.
* Y9 z6 j4 Z+ g1 o+ F5 {You can check that simply by hooking Winice.exe control proc entry point& Y9 E; R1 W; J! Y
while running MeltICE.6 L+ U: [2 V, ^. L' ?
* R* ]+ Z, m0 w& o8 T
' O3 H: y, @% d6 ~5 c4 N' q
  00401067:  push      00402025    ; \\.\SICE
& a* ~- p$ g( _  0040106C:  call      CreateFileA
3 n1 q/ a  Y0 z  00401071:  cmp       eax,-0012 _' z9 x$ z. C" e
  00401074:  je        004010912 G. g% r2 Y2 a  J( d. Z

( ~8 J! Q+ w# A5 ~4 K
9 s- a9 [# I: i# G% H/ dThere could be hundreds of BPX you could use to detect this trick.
8 J& x) S% m  W! A-The most classical one is:  w; h. i, O' i6 v2 G3 v2 X
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||& U. D3 E# F/ g2 ^/ k6 `0 b8 J
    *(esp-&gt;4+4)=='NTIC'2 A# b, ?& H& J- R- l, Q

7 a9 h0 ~8 I  }$ p$ ]8 L-The most exotic ones (could be very slooooow :-(
/ K- m2 E9 S/ x1 p6 @1 n5 z   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  5 `$ h0 y1 f3 R0 K
     ;will break 3 times :-(' m$ L7 F; _6 }2 \

6 q+ p! C5 x$ a/ d# m-or (a bit) faster:
& l* \' D# v! d; \: ~8 r   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')% C$ {  G' e$ }2 g! |% O/ M

: {; Z$ Q: u) m4 t  u   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 Z/ O4 y* h- z; r: S     ;will break 3 times :-(/ x* k1 B& \1 w& |' u8 H* N8 ^

4 T+ G* z! F1 K! ]4 U0 q9 c-Much faster:+ U1 O) M# ^8 E1 s, _
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV') T0 F' O+ H. F$ X$ a
& N1 Y+ L7 L) v3 @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
! B3 C) m$ a$ L2 |8 Q# vfunction to do the same job:( M; }! y$ q& U! X$ s+ d- P5 E0 {

9 m5 v6 c% `$ Y7 Q- f+ V4 K/ o4 ^   push    00                        ; OF_READ
' i  q$ |# i1 h; C0 n/ x' s   mov     eax,[00656634]            ; '\\.\SICE',0
) K7 T  Y  R# _! x, [3 @1 ^1 F$ [, D   push    eax: ?; H9 _( `1 G( T6 _( P) Z( d! a
   call    KERNEL32!_lopen
. D, e, j7 Q* p( j. }   inc     eax
- I1 s( m0 i/ p* W0 s* ~2 ~   jnz     00650589                  ; detected
: G. Q$ N9 _! i3 m   push    00                        ; OF_READ
3 j8 j- ^* {! }+ [- M, h7 G   mov     eax,[00656638]            ; '\\.\SICE'( H2 P+ B- ~: I9 _& I
   push    eax2 @. Y+ y: B! ~' m4 d# j5 p
   call    KERNEL32!_lopen
4 L( O9 p& {4 d2 o   inc     eax
; K( F$ j! W' h$ v. j2 D. o  L* @   jz      006505ae                  ; not detected8 J. o9 F, D, v' D7 W

7 s3 J; d2 i, S1 |6 E) q: J" w9 s( w, b- b" l
__________________________________________________________________________
* K+ |/ m2 ?0 A' V
  I  L7 g0 A, F) m, _; mMethod 12. C6 l9 A, _8 N+ K
=========- r% _' f4 ~3 Z- u, @: d" K& D8 z/ S
& s  ~, g: @8 X: r" P+ t
This trick is similar to int41h/4fh Debugger installation check (code 05
$ t8 p2 t- t" v6 Q0 A&amp; 06) but very limited because it's only available for Win95/98 (not NT)
) h4 }' a  y/ Q1 |% Bas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
5 W4 X' O: l8 l# G3 U5 Q9 h
+ b( x4 u& ~9 D% e& _! S   push  0000004fh         ; function 4fh/ y* l. ^* T* P7 ^
   push  002a002ah         ; high word specifies which VxD (VWIN32)3 d+ n- X" U' B. U9 Q
                           ; low word specifies which service' a/ K& i2 N8 \9 g( l$ B
                             (VWIN32_Int41Dispatch)
. A8 p$ ^- k# W( l% h# V   call  Kernel32!ORD_001  ; VxdCall' U. }; H' J& S9 Y+ X# \
   cmp   ax, 0f386h        ; magic number returned by system debuggers. y+ j2 Y. U) z# i7 A/ v
   jz    SoftICE_detected9 T4 X0 h8 Q* ^4 K+ {* L& N
0 r) _8 F: V4 c2 [7 {2 r; k
Here again, several ways to detect it:* G2 V- F6 a( X( m4 J' U" \$ Q

  y1 X0 ]0 V1 i  T+ ]  `; f    BPINT 41 if ax==4f3 E/ A' @" B6 `& N( L4 i
/ C1 v/ j4 g: Q8 V  x  j7 C
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one2 j# l, `) L1 c- A

2 |$ |4 E3 N' G    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
. m& q! ^9 v0 n/ y! a9 x- g; d  b
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
8 h. k, u! r2 {! {  ~8 _$ x5 U( i: l2 l& `
__________________________________________________________________________
3 n, k; x  d. b3 D! y: D' Y! ~
) A& m6 _1 L" |Method 13# F% L) s6 f. X$ g# k5 o, |
=========
% l4 l" g* e' M! h6 E4 ]1 U9 O. c: y/ T0 J
Not a real method of detection, but a good way to know if SoftICE is
+ _$ S  P+ x' Y8 \7 k& n$ xinstalled on a computer and to locate its installation directory.
- ^5 d# s; x) \! Z& I1 i, oIt is used by few softs which access the following registry keys (usually #2) :
' u- V6 X- b% @5 O. e  G1 F. a+ T3 @+ B3 p$ G5 H; e* x
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
0 c# k  p4 I# ^9 b. w7 J\Uninstall\SoftICE/ {9 I5 E: J: D. l9 Q
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE$ V! E. }  Y- K6 e* ~
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
; N" o; I; ^2 S  h) p\App Paths\Loader32.Exe0 ]: w( c9 H  n; O+ `6 w; B  u
' u7 B, i* ?! U& F
$ y1 M1 v2 B5 Y' M, @; ^! @
Note that some nasty apps could then erase all files from SoftICE directory, ]% U% x/ k2 h* b2 I. V; _8 {' t
(I faced that once :-(
1 q( h2 Q5 k6 K% I3 V4 b, X$ Q' c
' |& c$ J) }$ Z* i1 r' uUseful breakpoint to detect it:. z6 @& z$ `! ^4 r5 N

5 N/ y5 s1 X# B! c     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'- o8 b5 x6 n( B1 R9 e* z/ K
8 Y. `9 j4 ~' R
__________________________________________________________________________
$ Z9 W% b% R3 O8 W) A; _  y
. e* D7 K' ^" z: W' P9 e  W  \" y. G
Method 14
  s( \& x/ T; M" u1 P" l1 v=========* J: J1 D- P5 A5 {
, r; B, R% Z, M. K% O; @0 B
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 W! C( l- n' K: h- {$ q
is to determines whether a debugger is running on your system (ring0 only).
' _( W, d9 }7 _& }$ W. G9 y+ `
3 R6 j, [4 v6 b  L- t: j9 R5 G   VMMCall Test_Debug_Installed
  Q: H* B+ K* y( B2 f4 J   je      not_installed
) D; t0 f6 `, e9 d' h! e
: v1 A: G, S$ ]: p3 oThis service just checks a flag.
2 Z6 W$ p3 }" X; \</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-13 17:50

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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