找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
6 h/ [, [  f& H: o' {- s/ `% |6 `9 X<TBODY>
' x* t* G, z  s<TR>' B# W* o# B& C! ^5 I0 }. y' J1 q
<TD><PRE>Method 01
5 s5 Y" n0 H/ l7 U& o! ^=========
0 G4 U: |$ e: x
- m2 P0 z3 C/ |0 PThis method of detection of SoftICE (as well as the following one) is
8 T' B* i4 A) l4 jused by the majority of packers/encryptors found on Internet.
9 v7 H. \' }; \: p; x. K0 a% t. T/ PIt seeks the signature of BoundsChecker in SoftICE$ d9 v: c/ z# W9 L; Q7 t6 V/ s

! x. L. `# m, i7 m. \& I0 Y    mov     ebp, 04243484Bh        ; 'BCHK'
6 t6 \3 u. D7 \( m! ]& M; U5 t! [    mov     ax, 04h6 y4 Z& r+ v* q& O  ^
    int     3      
7 d! k- B' {7 k$ b6 F    cmp     al,48 i/ D& M6 E4 p! c& @2 |! r
    jnz     SoftICE_Detected$ q$ ^' Z, o; \( _+ z
/ Z- ]; J0 V' Y2 P& R: {3 n5 @( C
___________________________________________________________________________
" B- c% ]' L* q1 s5 x1 a9 [# J5 g, a
Method 02
( T- [" F+ E" G9 g; d- |/ e=========
8 X$ F5 v3 x7 ^4 D: @9 z2 y& k1 Y8 o6 r/ k7 m# d" ^, l0 Z
Still a method very much used (perhaps the most frequent one).  It is used7 n$ [0 |8 m/ y
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
# [7 x8 R- W. @5 J. w  u8 |or execute SoftICE commands...2 A  y, a- E6 ~, M$ p
It is also used to crash SoftICE and to force it to execute any commands) ~7 o& @" O" a# o: M  g$ H
(HBOOT...) :-((  % d6 h* e& R7 j6 ]$ O' T

! R( i- R5 y. F, U! }- O" w2 ZHere is a quick description:# s9 z6 F. A( r! O
-AX = 0910h   (Display string in SIce windows)
6 L" }2 M5 v6 {-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
7 V4 w) N, p. D# {( p0 I-AX = 0912h   (Get breakpoint infos)" Q/ W: _5 Z# j! x
-AX = 0913h   (Set Sice breakpoints)0 z5 L( W0 d* Z' @
-AX = 0914h   (Remove SIce breakoints)7 Q5 Z  Q% n* Q# c; g1 j  I
5 P4 s, t- M$ e5 C$ A5 f
Each time you'll meet this trick, you'll see:1 S  `) k( t; C$ d: f% ^
-SI = 4647h9 S9 i: b8 M# H; V3 b7 v% N
-DI = 4A4Dh7 V1 ?8 R# L* U- I0 I1 \- n$ l, S
Which are the 'magic values' used by SoftIce.
+ _, v! E& n( @; U: R0 u$ O9 w' iFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.4 r$ X- v2 d) A8 O# K4 n

7 M* `2 x* p# [! E! V' A/ Y- ?/ T: qHere is one example from the file "Haspinst.exe" which is the dongle HASP  g/ t7 v3 c0 g) R5 u; f: ?
Envelope utility use to protect DOS applications:1 J. d" Y" n, k& g* L3 W
8 r  o9 O! |, @, W

! Z7 L. j  K% c7 L& B4C19:0095   MOV    AX,0911  ; execute command.
: k, F  ?" L5 X. }6 S4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
& T( K0 q& Y- w6 y. m9 e+ d  r4C19:009A   MOV    SI,4647  ; 1st magic value.
6 {- y' h+ V1 R" T! b$ a4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
+ z% d  g: |: d  q5 `0 j: r4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)* q3 g$ a) F& y$ n5 {. {
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
& k, g* ~: N9 m- K) R( z) u# _4C19:00A4   INC    CX3 O: z6 G. r8 m3 P
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
" x& U* m- N* G) ^- P. |* w4C19:00A8   JB     0095     ; 6 different commands.! ?  ~  Y' g6 {# [/ o
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.# P+ c: W, s  s# `
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)# @) c4 `0 d% m$ a

1 t. `! H) l" j8 s+ j7 XThe program will execute 6 different SIce commands located at ds:dx, which
5 |3 S9 J+ g3 S- I0 U5 C1 S5 tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
+ D6 z9 B+ G7 `; H& x5 I7 j) ~7 @' ]0 S. r9 ^- w. G# R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" `& e. G; U) i; {___________________________________________________________________________
- O8 n2 q" j/ J0 v1 t; i/ s. v6 w/ |$ M* }+ U$ d
4 v. E7 I* j- }0 S
Method 03  z2 t# [$ c" A# e* W! I* p0 x
=========
7 x7 u+ O+ ]3 d2 D/ J, M
) f0 s; m- {! T: g. W5 mLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h* V. Q% p- q5 |+ s- H, ^
(API Get entry point)3 z) z  ~( ?3 @( w2 X8 k
        
: L& u1 Y& I- }5 b3 }
! ^1 a7 w. z* S    xor     di,di
: E) Q$ n0 @+ }7 x5 J8 n    mov     es,di: f; \* t1 x( w* [8 W
    mov     ax, 1684h      
: ~4 u" K" b& m$ B    mov     bx, 0202h       ; VxD ID of winice
/ C, M$ c, T" I  G8 c. @4 P8 p    int     2Fh
9 D7 A# z) v: h# k. W& J# z    mov     ax, es          ; ES:DI -&gt; VxD API entry point
! O# g) @! x' X    add     ax, di
) y2 U: S: ^; |    test    ax,ax
- d( T: w" B' \    jnz     SoftICE_Detected, X3 k1 T  [8 F% J5 ?

6 B1 y' V" o6 `4 a, m___________________________________________________________________________
9 p  t; T. U: c# j1 F: P/ z
4 u( L6 |& B! r& lMethod 047 A8 g. M' i+ X: i) O1 J" ~
=========
/ S+ b2 v. W! q% ^; v, e" t- j& Q$ [4 W9 g. F7 n& F* E
Method identical to the preceding one except that it seeks the ID of SoftICE, \) o* r$ I% r" Y# M' B( R
GFX VxD.
7 C+ s- `1 _9 ]% C: ?
: e! u8 [* u) P6 J; e    xor     di,di
. s# T3 [) O( n4 k/ K' V    mov     es,di2 J9 h$ `+ I7 k( Q# L
    mov     ax, 1684h       6 Z* n7 i  |% H! n! q8 a$ P
    mov     bx, 7a5Fh       ; VxD ID of SIWVID2 \" }  r3 C# z4 O& S
    int     2fh
; b0 B: G4 D# z/ z6 M: ~' ?$ I- A  k    mov     ax, es          ; ES:DI -&gt; VxD API entry point
8 Y; ~& t7 Z% ^' e    add     ax, di
7 b( u9 @# U% Q( _    test    ax,ax" |4 B$ f" r4 \# s2 g
    jnz     SoftICE_Detected
$ t4 t4 ]" ~" I7 C7 B
: ^/ r" s4 J- S8 Z8 w1 x. ~$ A" Z__________________________________________________________________________* O1 ^9 ]8 q0 f/ B; A1 P
  ]% ~/ l3 d* K' F1 J* E

- y* c! n2 T& ?! _8 O' |" v  E' l" r% KMethod 05! Q6 h: M7 Z1 }1 G1 @
=========
5 h! @( {7 E- ]+ j% Q5 T2 y/ s3 x9 n; }4 T0 J0 B) t* ~
Method seeking the 'magic number' 0F386h returned (in ax) by all system6 e& [; \- f) x+ c* c
debugger. It calls the int 41h, function 4Fh.
0 r1 ?0 x) M; S* w- t; TThere are several alternatives.  
" q* T! C; D5 Z" Q& a0 L, t7 e
9 ?6 ]+ {0 _  \2 Y6 r: MThe following one is the simplest:8 O1 O) m( p) ]5 G0 x  c; f

' z8 b! a4 ?4 U( a    mov     ax,4fh
5 H% b+ E+ m* q6 d0 l" u( v    int     41h
: |0 _1 d8 Q$ ^. v    cmp     ax, 0F386+ S; d$ o1 W/ w' S! [5 y
    jz      SoftICE_detected# x4 c/ A9 q" Z. G) I* ~( F  s
/ |$ y4 k% v1 B. u9 h; j- u! J( v, p

$ D5 I! A7 d1 J+ ^& l' X1 O2 KNext method as well as the following one are 2 examples from Stone's
  O) U4 E- \! X: {"stn-wid.zip" (www.cracking.net):2 X7 k* N' c' q/ t) l

# C7 i+ z- c2 z. B    mov     bx, cs
& |  A' i& @1 u& V( p, p" [4 n    lea     dx, int41handler2" F, b4 g& w8 p# J9 `5 j+ M
    xchg    dx, es:[41h*4]
, s4 E5 v! ~8 {' E: ?" ]    xchg    bx, es:[41h*4+2]0 O$ U8 ~! X% _
    mov     ax,4fh
" H) i6 f$ J. K& n    int     41h
/ M* n/ ?  j1 f; I( ^: D    xchg    dx, es:[41h*4]
( c: ~1 w# n" e: q- K$ P( J    xchg    bx, es:[41h*4+2]
' O$ U4 ]/ S# `' M8 |. i% U8 E2 h    cmp     ax, 0f386h
0 x: s0 s2 E3 a$ l& b    jz      SoftICE_detected; I  Z/ P; g' v7 L$ o

' s- G& N' r1 o$ }  }' Z- Hint41handler2 PROC
8 ^. _4 e& t7 w% @9 W    iret) t" h; [: p1 F( Q
int41handler2 ENDP
; v% E" n5 j/ ^# s0 g3 @# ^- d; Q- U0 ~) S

3 G. X# [3 Q# ~( E. M2 x5 Y_________________________________________________________________________
4 X1 Y" i/ z0 q- L5 O  _% r
8 g& q) n$ o6 M3 m) H3 t7 S% m6 g" M. |# E8 C
Method 06! \& a7 ~* X) H* u
=========
) D; l4 X7 E7 v- A8 \6 [; u) X
0 I3 H  L0 b2 C2 R: O$ l, ]# Z5 q1 e3 k4 v- p  }+ d
2nd method similar to the preceding one but more difficult to detect:
7 C4 e) G7 z/ H8 F
6 c8 y6 w: _/ D7 j. X' D% {/ Q" u' R4 S/ @6 i: Z: d, p
int41handler PROC
% u1 c- f/ l: ]% I' I# N    mov     cl,al
) \$ ^0 k& S- E& P+ b) C. j9 X% b    iret
- ]+ m1 D" T/ \% I# C$ zint41handler ENDP
% u9 v1 T- `3 k* W4 R5 N3 D6 X2 d1 h3 ~9 p

: r% k5 ?$ J" D0 _" v6 [5 x    xor     ax,ax* O  {" F$ ^* U5 T$ A* m
    mov     es,ax
+ R+ W2 d) {! f8 J3 L6 {' q1 C    mov     bx, cs0 s5 D2 i, M$ v) g% V2 ?
    lea     dx, int41handler
( x6 f. X. r. M+ o% n6 X. D1 I    xchg    dx, es:[41h*4]
& I5 ^1 V% A& q0 Z+ p    xchg    bx, es:[41h*4+2]
# a) T, ^' o/ c6 R: W" k! M    in      al, 40h8 x3 n) g$ Z4 N% s7 r" j" ^" ~! ~4 M
    xor     cx,cx
: K6 j; P+ o6 i- n9 z! c( @    int     41h& a/ o. w3 u( P' k9 c8 t7 W
    xchg    dx, es:[41h*4]
" A$ W1 ?! @. w3 f    xchg    bx, es:[41h*4+2]
# z" X# |, _+ Z    cmp     cl,al
) k  n4 |5 \; x9 Z4 m8 I5 X0 U6 M    jnz     SoftICE_detected: F1 X) ~' }, L  K8 J

. i! @9 |3 @" q: u: _% ?) T_________________________________________________________________________
/ c8 G8 C& A6 W6 w
3 M$ u3 N8 c! E6 E' rMethod 07
; W! |1 C! ~% x' F1 d=========! t) V  a1 n! d6 R. `0 F2 P) C9 x
+ f3 B3 n& C8 D& ^7 A* u
Method of detection of the WinICE handler in the int68h (V86)) a0 ?" U- y! C; ?, u) R

: ^5 \6 }' T' @5 [$ Q( M    mov     ah,43h
! C6 v/ l2 f6 \. Y4 j    int     68h7 c1 L/ I9 m# I, p
    cmp     ax,0F386h
+ P" z% Z& S2 D$ r# v4 x5 d  _' \    jz      SoftICE_Detected0 c" k8 }" N7 \8 M; K
1 g6 \% p( n$ O' G* ]% q- d+ i+ A) w- x
+ [) {% v7 F& v) v$ A
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit/ q9 x2 H7 P1 f" A% Y
   app like this:1 \5 N4 Q  O. c5 I( D! Q
: A" ^; T2 u7 s
   BPX exec_int if ax==68$ {2 g- t$ K: }0 D' {8 M" o  E% V+ S
   (function called is located at byte ptr [ebp+1Dh] and client eip is) h. S2 |1 L2 h- U
   located at [ebp+48h] for 32Bit apps)
0 O$ R+ w, u! X# J- h1 l__________________________________________________________________________7 |" n( l7 Y6 l
; s. x) s+ q8 y& C1 L) |3 e

" u5 h1 O% S& [' |) j) p2 I- D. _( HMethod 084 M( Z) P7 `4 H8 G4 w+ x
=========' i1 o- ~) J$ K* b5 k

' M+ A: R- C5 t2 t- a, DIt is not a method of detection of SoftICE but a possibility to crash the# L1 v( I$ m9 p9 ^% x
system by intercepting int 01h and int 03h and redirecting them to another
8 S/ K; b$ \9 A8 T! F  f9 f3 rroutine.
9 P( Q- r* C& [0 U) t9 q9 C, tIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" n" q1 y! Z8 ]* g
to the new routine to execute (hangs computer...)
6 j! A. H4 A/ D6 O1 @0 V& R& p- I
# J( i! n7 y; ]$ H: U: a    mov     ah, 25h) R' K/ N8 S9 x# F% D/ t* s
    mov     al, Int_Number (01h or 03h)
7 b2 X: y! \& ]; B5 X% d5 P    mov     dx, offset New_Int_Routine4 F0 X' |/ z% U$ W; X1 v; o
    int     21h
3 ]) H5 W7 h* M: I* V. ~
, j. U2 h3 w7 e; M__________________________________________________________________________
. D1 _& _4 x) P8 l- T
, X# k! ^0 Z# U. U: OMethod 09$ ^$ K& u5 H/ [% X' e
=========' g3 h! i" s! C# }* W# ?* y
5 z8 |5 \/ z+ v* N2 z/ e/ I
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only+ f" h6 m& ~2 J) W
performed in ring0 (VxD or a ring3 app using the VxdCall).
! B# r4 m* R, o) gThe Get_DDB service is used to determine whether or not a VxD is installed
, K! v$ _: V, C, c: pfor the specified device and returns a Device Description Block (in ecx) for9 A3 m5 f/ f+ j: g* i
that device if it is installed.
0 h, X! s. _" r$ k
+ C0 ?8 D: h! }8 t! d) k) j1 j   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
' z4 Q: k: Z' V   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)& U5 S9 e7 [+ T2 }# T# H
   VMMCall Get_DDB
- _0 [% C9 m& Y& k" S9 f   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
& X* y! y  A9 ]7 t/ ~% T# A
" g4 Q: f$ s, ?8 D% G% ~) FNote as well that you can easily detect this method with SoftICE:( P  S8 l+ K' B; V
   bpx Get_DDB if ax==0202 || ax==7a5fh6 a( y, h/ @/ A* U

  D- ^$ F4 I" p  Q/ }$ a__________________________________________________________________________
7 u( c1 s+ d1 k/ w: |' j
. H9 u' y. d/ L. t, }# x% HMethod 10
: Q- h5 J3 J& }; P=========" V, h' a0 W( F& w8 x
+ A5 q* B5 |) d% Q5 f
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
$ `! y% w0 n# n8 Y  SoftICE while the option is enable!!' @8 S3 ^- g7 m' y& \% G
; z" v; `  {4 T( Z4 R
This trick is very efficient:4 `5 e" g* R0 H& F; p
by checking the Debug Registers, you can detect if SoftICE is loaded
0 t0 f0 E9 h2 C0 o( @4 z1 ?* H(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if9 k, ~6 G$ Q/ `) Y
there are some memory breakpoints set (dr0 to dr3) simply by reading their  {: h5 e3 Z& x9 P
value (in ring0 only). Values can be manipulated and or changed as well3 Z7 n2 j; k1 @
(clearing BPMs for instance)
# s' M9 v' i, W, d* m9 m3 a' C% h  C" f, O! g, L5 R; x  Q
__________________________________________________________________________2 ^1 |5 U, P8 H9 m9 y+ h
4 P8 _! c# d' n$ K- M& ]0 g" G
Method 11
- J4 Z4 c: K# f) L=========
) O. E: _* B5 ~4 c0 N
4 u- V# v# N1 w  YThis method is most known as 'MeltICE' because it has been freely distributed
$ A/ K. o+ X8 g: l6 ovia www.winfiles.com. However it was first used by NuMega people to allow. g$ I' j2 u* F5 p/ ~
Symbol Loader to check if SoftICE was active or not (the code is located: j1 d$ u1 k" ^  B4 i$ o' g3 E2 N
inside nmtrans.dll).* e5 n- O, {0 ?$ A

( B, R- I, b% X" `1 x) ?9 `The way it works is very simple:
! S8 u0 S: ]2 [$ z; t/ G; |It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for' G# m* W$ I9 L" W" y
WinNT) with the CreateFileA API.9 \2 [, \4 W, z: p! {; f
$ Y/ H7 h$ l" |+ ?7 u
Here is a sample (checking for 'SICE'):8 X( v$ n+ j) a+ x: ?3 }
: t* J8 @. n4 q  w
BOOL IsSoftIce95Loaded()# }+ t+ {5 I' I) `2 g
{
0 U% R, K. E7 e1 K   HANDLE hFile;  
/ _8 y. s$ c3 p# I/ [$ p& V   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,, N& Y# u( W; m, X/ L
                      FILE_SHARE_READ | FILE_SHARE_WRITE,6 i' n0 R: O3 m6 x8 s
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
$ h) [: T; o8 C6 D/ @/ p   if( hFile != INVALID_HANDLE_VALUE )" s7 A! V6 Z1 z
   {3 k: M0 ?5 m" h! B; M1 A7 p
      CloseHandle(hFile);0 G4 n) U2 }* S- }* J) N4 c# r
      return TRUE;: o: g4 b% K  H4 C, I0 R% [! W1 n5 L
   }
4 o* F( N! _' s8 o   return FALSE;
. i5 t% U" q! C4 f5 D: Y1 H7 ~}
; f- V" z% t3 @- Z7 t, y/ t
( r0 Q8 }& |- o6 G! a# `Although this trick calls the CreateFileA function, don't even expect to be
& ^& I* s# b5 R1 Y9 g& a( r& _/ aable to intercept it by installing a IFS hook: it will not work, no way!9 {% x" H$ D' i( _3 [* d& I- ?
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
" [, _9 y3 e& sservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
$ }+ z7 o6 s: cand then browse the DDB list until it find the VxD and its DDB_Control_Proc) d7 P* Q, E0 ^# Q
field.
5 T5 J1 o2 m% u* M- z- gIn fact, its purpose is not to load/unload VxDs but only to send a
- Q# T! k$ {9 z8 s, t0 nW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ Z! T7 b, d+ w$ s# q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try; L% ?0 l1 j/ ^4 @+ Y: v
to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* p6 X+ O0 X' ?$ Y$ D8 `% jIf the VxD is loaded, it will always clear eax and the Carry flag to allow
6 ^/ b* Z- c! N, [  A/ Gits handle to be opened and then, will be detected.
/ y: ^4 X7 s8 z: S, a) v6 jYou can check that simply by hooking Winice.exe control proc entry point
. R4 n  A6 F: q7 \. }) |: j+ z  Mwhile running MeltICE.2 V9 d1 O5 c' i( {2 x1 J
5 h' x$ C6 d1 m# R5 v/ m4 `- g
' Z, Z; _7 A5 s- D5 `+ N2 O* k
  00401067:  push      00402025    ; \\.\SICE
1 s' V) U; }! Q8 j0 O  0040106C:  call      CreateFileA
# u$ B8 E7 Q1 D, k# x! V  00401071:  cmp       eax,-0018 P1 A) H1 D3 \* d% n$ z: K
  00401074:  je        004010917 {5 T8 j, C& q" Y! q6 l
* t& r% N& g0 r* H) z

. `. e* l. t4 }* G  oThere could be hundreds of BPX you could use to detect this trick.
: Z& l: Z+ h! x/ G-The most classical one is:$ e% X& |& H& U. h; m! y! Q% ~6 u- n
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||; J2 t! z0 O$ C; x
    *(esp-&gt;4+4)=='NTIC'/ h: r' ?! Q  k, u; }0 R% b
8 h3 ?, u% }: w
-The most exotic ones (could be very slooooow :-(
$ B# m! h4 p! M3 \, E* @' T   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
& x9 r6 I, @4 i) h1 E& D' h$ S* R     ;will break 3 times :-(
! X1 e% W* T8 n" d5 W1 D/ p5 f$ t8 {' G' b# r0 v
-or (a bit) faster:
; j0 `, n4 P4 c7 g   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 s9 {' @' j! A% J- o
$ n1 L9 S' _& `  H1 }   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  ' A/ H% }# p* l: y
     ;will break 3 times :-(( ?& A. @0 }, a

/ m5 o: u* `& S# H- B-Much faster:
% ]# g0 N  s1 X! K2 S# D, p8 _   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV': h( ?2 }! Q7 |/ \, p2 X
% o; U: T6 D1 T1 \9 [8 @
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen) \8 a( B- E$ P4 O4 Z- S6 x& k
function to do the same job:7 E+ l* N% u& k) A
0 R" s2 X% V# v
   push    00                        ; OF_READ
" f; W" s/ _: _+ E' [# ]9 Q; H0 `   mov     eax,[00656634]            ; '\\.\SICE',0
' G+ T) Y+ P' R5 o   push    eax+ {6 V+ d+ q. s, v. j
   call    KERNEL32!_lopen
% r- @) E1 L' o4 t" `   inc     eax
- c: x! }$ S7 K+ J   jnz     00650589                  ; detected
$ h+ k9 x  i* E8 m6 y   push    00                        ; OF_READ: {2 Q$ M( l3 W# ^7 c9 e! H7 J
   mov     eax,[00656638]            ; '\\.\SICE'
& X: ^9 z8 K9 H& \; v6 ]   push    eax% n5 @! E5 N& f, o, ^
   call    KERNEL32!_lopen; Q, @$ K, m  A8 s2 h
   inc     eax
- }3 }* ?; u0 c3 d% j3 w   jz      006505ae                  ; not detected! ^- n6 T. P/ W+ E3 ^2 e2 G# q

& v+ q& G/ {( J7 R8 B- {
# u" f( R$ f# Q% d. ?; ~5 h6 k__________________________________________________________________________6 C: Z  S) f% D& P0 z

& B- z8 Z: z* g- Z, o3 Q' F7 ?9 w4 UMethod 12) U0 V/ P, l' {* U& }# Y, S: _5 c$ Y
=========
$ B8 |# Q6 h( f0 \% a9 W7 Z3 q6 w5 z1 e4 I% ?7 F/ ?
This trick is similar to int41h/4fh Debugger installation check (code 05
7 c6 U: t1 x! s9 M8 y/ _: y&amp; 06) but very limited because it's only available for Win95/98 (not NT)3 g2 G' ^# _$ W% J. p
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.* G6 `! _- i) @* c4 b$ v  _

- g! W! i$ K! J$ x+ U- P. N" I# X   push  0000004fh         ; function 4fh  J$ D% g( ?4 z0 b
   push  002a002ah         ; high word specifies which VxD (VWIN32)
. G) R1 k6 Y2 T* C& M6 H                           ; low word specifies which service0 [, [# E  W6 R/ c, n* r
                             (VWIN32_Int41Dispatch)) m3 S, k# h) |2 }  @  E
   call  Kernel32!ORD_001  ; VxdCall
6 z8 v4 C  Q" B0 V8 g   cmp   ax, 0f386h        ; magic number returned by system debuggers
! ]# M5 L$ P$ M2 O# }' D   jz    SoftICE_detected
0 V2 Q" p2 @2 u% N- l4 e, y4 _; `  F
Here again, several ways to detect it:
" b* {( W$ n- R2 m$ v" ^
2 n% R3 ?% [5 l% e  Y) S! I    BPINT 41 if ax==4f$ @. h, F; }4 w, n% q

1 j. P# c+ j! k( Y# k* W    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
1 H2 J  k9 T) _* k% r
  q0 @% J4 h1 y) u* M    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
% j( x1 W! s. P/ D# b6 c. q
* t" T: L* T# ]  |: Y2 p. S    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
% K+ G9 l  B, e! o! F, P1 S; f/ v
__________________________________________________________________________
/ c$ t9 p1 o2 i. x" q8 l
9 S8 H7 g! U- _: W! p8 R/ _Method 13* q( @0 d$ n1 |8 e8 {
=========
3 ]+ l) R4 }+ n3 a3 ^
- J+ _" G5 S" I- g+ l# c. W: o; u3 kNot a real method of detection, but a good way to know if SoftICE is
) Z( g. z  \& r4 Q! N+ minstalled on a computer and to locate its installation directory.
( P1 w( R' v- ^  q3 K8 DIt is used by few softs which access the following registry keys (usually #2) :
/ L5 ?& z" ^' k1 B, ^  M
: P5 b0 M+ i; O. I6 q$ u-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
4 K! }; X# O- M* ~3 i\Uninstall\SoftICE% M% G: h; Y8 t/ l+ ^+ X
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE9 j$ C- F9 T8 I- W& P$ y
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
- c$ s" z8 _! q( O3 I/ N  Z$ F\App Paths\Loader32.Exe8 @$ E) k4 `9 {& R: y1 }0 B! E2 c# \/ l

8 H% `5 Z6 z3 ^2 l( N1 c7 U' ~5 u+ H5 U, i. `* M4 k9 a/ ~
Note that some nasty apps could then erase all files from SoftICE directory
$ y8 |+ Z0 H; b# D% @9 P9 e(I faced that once :-(  H" a1 W  K& l

, J/ m9 Y) e- h6 e! q3 _Useful breakpoint to detect it:& ^0 |+ d9 I- _# G+ Y- K  j

( z5 X8 ~. z) a0 C' O* L     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'! V  w- g+ v+ ?' q1 d9 g
$ W4 s7 s* F) w) j, Y- O
__________________________________________________________________________# M) m; m* H4 i+ t6 Q

/ W' a& K' L3 e% i' w$ |; D: ?2 s
9 Q9 S2 q! y" BMethod 14 1 x: A) M0 a3 n9 x
=========
, U/ |# |0 ]" ^0 ]0 p; M% `: |: u/ |0 d; W1 Z8 V
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
. Q  k- o5 k, K4 Q* D4 `0 yis to determines whether a debugger is running on your system (ring0 only).7 J$ [4 d7 L2 ?1 g* M; }
8 H5 I8 B( P1 ~7 w( ?
   VMMCall Test_Debug_Installed
: O, w) {9 O' Z, H: h; A   je      not_installed. ^; L$ i7 o& {

7 r/ k0 f) a6 s1 F, p. hThis service just checks a flag." s& Z3 F0 d: u) _
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-27 18:55

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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