找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
) Z' ]7 m0 E, b; L' }<TBODY>6 t9 t" Q6 x4 {  P& _, I
<TR>5 P% j- a8 s+ u5 p- G) i3 x
<TD><PRE>Method 01
* I  Y% D) C9 o/ q! t=========
* F/ f/ X7 ^& w1 Z' n1 y* F1 t! i+ f# \% f* G
This method of detection of SoftICE (as well as the following one) is2 O+ R& M- ~+ a
used by the majority of packers/encryptors found on Internet.
" Y0 }2 p- i1 m) c/ m7 {# iIt seeks the signature of BoundsChecker in SoftICE
' G- N* s: H* q. ~+ `* ]) n* H3 o, M6 _& [' t# _& L
    mov     ebp, 04243484Bh        ; 'BCHK'& _* n3 s. N* ~6 O" M
    mov     ax, 04h6 L6 b9 M2 h6 }$ \
    int     3      
& e  h7 A- p( Z' e    cmp     al,4
1 _0 V" J4 V8 F& i1 T" ?    jnz     SoftICE_Detected  f/ j, l% n7 V( Q7 t8 H

6 Y5 }. X) W& D5 @___________________________________________________________________________* K6 F4 c+ S/ a4 I

8 J; k3 |# C3 s- U' o6 wMethod 024 w% A+ Q" q6 c+ ^
=========
* p! r# d- ~$ {! Y$ g+ I1 M( S( f" G. d7 }# ?, g. `+ w4 P
Still a method very much used (perhaps the most frequent one).  It is used$ {: P1 K$ f' ~7 X
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,8 h* k* u2 D3 O. f( f
or execute SoftICE commands...7 V/ u# S' s9 O  B, |) r6 v
It is also used to crash SoftICE and to force it to execute any commands
" A' D8 a  @" p4 W! y* |(HBOOT...) :-((  
* T6 k6 R5 a. J2 w+ }; Q. l' E5 k; N) x7 v( g
Here is a quick description:
8 A- j' E& P* R: u-AX = 0910h   (Display string in SIce windows)
3 f5 }( S/ {5 R* Y  O* H-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
$ V) A6 \' G5 B0 ?-AX = 0912h   (Get breakpoint infos)
1 q& S* C" p3 E) H6 V-AX = 0913h   (Set Sice breakpoints)
" s) a! R1 K0 T" H- s: ~4 G: |+ c-AX = 0914h   (Remove SIce breakoints)
7 w: L0 n$ F/ K2 ^% Y; ?$ [: |$ m# h# I7 i
Each time you'll meet this trick, you'll see:6 z0 \5 Y' Z: N/ I& m3 [1 q- V
-SI = 4647h# h7 _  d! a7 q* Q
-DI = 4A4Dh" V, L0 h4 @8 w) E
Which are the 'magic values' used by SoftIce.
/ H& d  F2 X/ Z- EFor more informations, see "Ralf Brown Interrupt list" chapter int 03h., q2 G( [6 z" L/ F2 m; i% a( k; N! s

2 \9 f3 K+ ~+ P! ]Here is one example from the file "Haspinst.exe" which is the dongle HASP8 F) Y5 Y0 A7 _7 K
Envelope utility use to protect DOS applications:
+ n) r, B! }/ n' c
" J- n3 e0 Y3 X6 b& B, n* d
0 A8 H8 `/ f4 P; g5 E+ G6 S4C19:0095   MOV    AX,0911  ; execute command.% G7 O: c- M, {1 e9 G9 M
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
. ?4 O, P( z; K! a4C19:009A   MOV    SI,4647  ; 1st magic value.
* x& g# l( v" u4C19:009D   MOV    DI,4A4D  ; 2nd magic value.8 w: I+ K$ @5 I3 D: Y. v
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
3 L3 z6 ^9 y( {/ z9 H! q# j5 Y4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
! E" B$ V: Q" Z7 v, M4C19:00A4   INC    CX
/ N9 F. E- e, v4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute0 Q' X( h5 v8 c5 c0 `
4C19:00A8   JB     0095     ; 6 different commands.! U7 y! U5 m2 p  E! D
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
3 l) p9 _5 j% p3 x& N9 R( |4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)$ Y% e0 C: R! r$ k
) q. ^9 p8 E  b8 ]9 M# w2 s
The program will execute 6 different SIce commands located at ds:dx, which; Y5 V3 {& X( ?
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ h% X4 g7 A2 t$ H% x4 o

1 x+ C! |% u+ W' Q" y1 I- `* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
& S0 F& u% {) m  G2 Q4 K9 b. w___________________________________________________________________________' z  R! y$ t3 N; o: \8 S

2 m0 I* h. t4 C8 ~7 o  K' ^( Q1 F- n
Method 03) B9 m5 l2 a* e! u$ n! J8 C: X4 j
=========
" y: f' `" Z! P: x  Q+ {; V
: H. B; w3 f7 `+ }( @: M1 G# |) [  SLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
9 d/ z) U/ ^4 h! v(API Get entry point)
. ]8 r5 a3 I) J! F, N4 ^) T! e        " |  Q+ \. C% |
, M4 P! c5 O% m2 z, h' X0 @* G
    xor     di,di8 {8 b" s2 u0 D
    mov     es,di% s4 o0 G" e6 Z8 ]$ `2 F% R
    mov     ax, 1684h      
8 H. j1 S7 W3 j# Q: g; G4 E    mov     bx, 0202h       ; VxD ID of winice) j' \  y( A4 I( @- u' ~
    int     2Fh3 l% v2 X  d9 \8 M' ^$ J- ^
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
( G' D1 C  ~+ `  X# O( ]    add     ax, di
& n" D  t. q3 T3 I4 H    test    ax,ax
$ u1 C$ W" F& _- H6 ^6 T8 B0 }    jnz     SoftICE_Detected: c4 V. u: X& l& z
+ V# i2 y1 T+ ?' K
___________________________________________________________________________
, W3 K" V6 g' m( K! ~
% X( X' I& t# j1 U$ oMethod 04
+ m, s8 C) j9 ^& t+ E8 G=========0 ^- Z5 ]; U% [0 J" E- G

0 e8 K+ P7 D" y, \% `9 H% yMethod identical to the preceding one except that it seeks the ID of SoftICE
0 }/ W! M! a" BGFX VxD.
0 E+ w5 a& L& T% e! P$ a, w
; j5 A6 C, F7 k) B5 t4 U    xor     di,di5 }2 F: b/ |4 F8 y& g/ {% F
    mov     es,di
! y* x7 [3 |) k: I* B4 ~* y$ S    mov     ax, 1684h      
3 w6 j3 y* @( v4 g) p' p' z3 Q# d! Q    mov     bx, 7a5Fh       ; VxD ID of SIWVID
1 T) ?' {) q/ |' s    int     2fh6 u1 q8 R# `0 m) Z
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
9 ^5 \7 d5 N8 [  L; C7 l, e/ l    add     ax, di
8 L0 Z2 i8 F4 D1 s  g% |    test    ax,ax
+ s1 j* N0 B) E) Z( U$ [    jnz     SoftICE_Detected' m' ?5 @9 B& H; {6 X5 J

* X6 u( Z5 J9 o) o__________________________________________________________________________
( h' Y# ]" ~, ^- _. w# J( `9 l, Q# s2 T1 ?/ s# J* u' D9 a8 y
/ R3 ~2 p# k% r8 h# F) e
Method 05: g5 c$ Z2 @# b9 D1 e$ v
=========
' G9 `  t2 g# c7 P: ^& f, D: c2 X) \0 ^
Method seeking the 'magic number' 0F386h returned (in ax) by all system
/ @# ^) ?* o! ^6 ~. t- G& gdebugger. It calls the int 41h, function 4Fh.
. L' n4 G8 c* Q7 G& d$ @There are several alternatives.  
' O( f2 r* F+ _6 P! z2 t2 {+ x7 J- e9 P, T5 R& ~
The following one is the simplest:; D/ h. M; g# f+ D* v
- Q1 E3 i4 s5 L& U4 d# W0 b+ W4 \
    mov     ax,4fh: w! a& j/ b8 I" @. p) a
    int     41h
! ^7 F, h/ e+ W6 F) R: [    cmp     ax, 0F386% J1 w- {& X0 e
    jz      SoftICE_detected
. x6 E1 Z& g2 r* g& Q+ f- Y5 F' ]+ P/ E- S9 z( O5 s7 [+ G
' J' A5 q/ r8 Z0 {9 V% X' R
Next method as well as the following one are 2 examples from Stone's 5 @* m9 E. J! Z7 @
"stn-wid.zip" (www.cracking.net):
; z6 Y7 H6 s# B4 s* i* C( _& Y% P% J) _4 J% R
    mov     bx, cs$ T' d+ M* {( A- T% D' W. [+ h
    lea     dx, int41handler2
/ T/ L# [, M5 A& {8 b4 Q    xchg    dx, es:[41h*4]
. H: K5 v/ A  ~3 W0 w3 b  L    xchg    bx, es:[41h*4+2]
; a/ J- j" N! G    mov     ax,4fh
6 H5 m( O) N! {* e    int     41h7 n7 {5 w. ?5 w  ?& x$ W
    xchg    dx, es:[41h*4]  z( E3 t1 f8 |  [
    xchg    bx, es:[41h*4+2]
+ a6 |2 n& q; n* A9 e    cmp     ax, 0f386h+ o9 b( q( ]/ j
    jz      SoftICE_detected
; S+ G8 M5 i! o4 U/ W6 i3 a/ N  S/ m4 G7 R. I& m9 c% d4 R
int41handler2 PROC" s& H4 x; }. k2 v- X
    iret1 J/ T* u2 @& j2 B2 F! ~
int41handler2 ENDP
) u# ]) ]% X3 A5 T" Z4 r- X! b" n% E
% M! W$ n' P' d
_________________________________________________________________________3 K9 U, a: V5 I5 P- G
: V% K8 G9 s, b

8 G0 W+ V/ B: O! XMethod 06
* z) f6 @  G* `  t=========- a1 i* x7 k9 i; z

6 c& }6 O7 ~+ P' V- M, e$ o; i( ~4 t4 w: d; [: p1 v/ t8 n
2nd method similar to the preceding one but more difficult to detect:2 F1 V" ?+ I! {1 q/ ^* \
6 z+ U+ J4 q) t

! h' l) z6 `. f& {+ ~! s  u/ Sint41handler PROC
% a0 f( [9 }& X" m3 z* N( h3 L    mov     cl,al' ^2 t: b9 \: r) E/ J
    iret
" h' M0 S$ a% {2 w3 S3 o0 t7 rint41handler ENDP0 _/ Y; T: t# @% z0 L9 x
. @2 y: k; C9 Y. }1 i3 l

8 @" r' [/ C1 i4 |! u  f  Z    xor     ax,ax
' r- u( `: {( K! t1 k4 u( q    mov     es,ax. ^$ V5 U7 |% l6 |* n2 ?
    mov     bx, cs
9 K8 ], i! X  H4 v    lea     dx, int41handler, T2 U9 \7 b% ]8 P
    xchg    dx, es:[41h*4]
. `5 t, @9 ?' b, `: C    xchg    bx, es:[41h*4+2]9 L% }1 Z; i4 b' @2 a6 {
    in      al, 40h
$ \) f9 b2 ?$ x  g: Z6 ^    xor     cx,cx! l# d7 f* D" f7 J) y
    int     41h
( \% r+ h, ^* ^! b* U% Q    xchg    dx, es:[41h*4]4 Y* w4 B& D0 Q' u7 A
    xchg    bx, es:[41h*4+2]
/ a! j" H* }+ R9 M3 H+ ^    cmp     cl,al
& Y. m; r8 a# ^) W    jnz     SoftICE_detected9 s& n; h* M, s! r

) E2 j& q6 A5 R+ P8 B- G_________________________________________________________________________
# v: T2 X; k/ s1 Z! t3 J" P1 Q! @2 A  g% m6 Y2 c1 A2 t2 w
Method 07. t( {0 T5 x/ ?6 h0 d
=========  V% m7 N/ k1 e3 O2 x8 ^& m

6 K% P, O( x+ i; t3 O# TMethod of detection of the WinICE handler in the int68h (V86)' p) a8 N7 ^' @* K( L' u

: ?& m" h; v. _    mov     ah,43h
% I7 Z* s2 h. P, q/ B( \    int     68h
$ A( ~5 n$ d4 E& O$ J! ]    cmp     ax,0F386h, r# E. m+ O! c0 {* _1 `
    jz      SoftICE_Detected
4 ~3 G3 X. G/ k! x1 J" E, V
# \7 T7 a2 v$ }; Y4 t5 z* w3 V; V- ^5 [
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit4 P# R3 X: C+ D. s8 R4 ]
   app like this:5 z1 e: S( d5 G& @. R) b
: L4 a3 ~% B" k4 i
   BPX exec_int if ax==680 W0 A$ ], D' l
   (function called is located at byte ptr [ebp+1Dh] and client eip is
  S" a- q6 L) u6 e* Y   located at [ebp+48h] for 32Bit apps)' Y2 j, }# B5 v& U" s
__________________________________________________________________________
& L: X1 x& B  I# L# r# f
$ S/ E  v( N2 Q6 c3 b. K9 J9 C- a1 |, H
Method 08
+ X% X; V: @; [1 `9 p6 g1 u=========4 m. {4 u9 X; g

( W( ^, F! m$ h: R. [& V4 aIt is not a method of detection of SoftICE but a possibility to crash the
9 ~* @- R2 [8 P  J) E5 Xsystem by intercepting int 01h and int 03h and redirecting them to another3 \2 D8 M3 o  |2 [
routine.
, f2 d; G5 C( t: U& MIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. m. ?) t0 j% e! ^% c$ Hto the new routine to execute (hangs computer...)
; J5 B9 }2 ^3 t9 R7 F, T7 m; h5 @0 |6 H/ R) m) n
    mov     ah, 25h4 e* {; W6 x$ F: y& q
    mov     al, Int_Number (01h or 03h)
* L4 r+ y1 A, `    mov     dx, offset New_Int_Routine' A, M1 i/ o9 T- R% q0 S. E
    int     21h1 J1 h' M2 l' E

8 f( I( o- X: T4 s__________________________________________________________________________
9 a! ~* {; `: z3 r3 n6 Z
9 R6 G; [7 x% ]- h1 F4 q8 DMethod 09
& {3 N3 Y# Z' o* v( A# U# j7 y=========$ e* f, _; t5 N2 q  Z! p
6 ^/ y) L9 o' m/ T3 Z. R1 g
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, l# g0 E2 v. aperformed in ring0 (VxD or a ring3 app using the VxdCall).; }+ D! k0 p. w5 K: G
The Get_DDB service is used to determine whether or not a VxD is installed
  z3 Z5 A% Y0 Q( u2 C$ f4 ~* Mfor the specified device and returns a Device Description Block (in ecx) for) Q7 h# @9 ~. K+ h3 O3 ?
that device if it is installed.. ]; X8 W* `; N" W! M4 g
# M% i& v. o/ V' [
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
5 Q: o' I0 C# j% @2 a7 E, S3 S   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
4 f# H* ]5 s8 X2 t/ H7 p- D$ L" |; ]   VMMCall Get_DDB& D# u* p( s+ H
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed2 g+ E3 h  `! B3 d3 P; J, X9 y
! w8 {7 w% G) C+ ^
Note as well that you can easily detect this method with SoftICE:
/ G; T4 Q# A, B; O   bpx Get_DDB if ax==0202 || ax==7a5fh! B; J+ y- E: q( O. F: e3 b6 q

% `$ `. p$ b, A; |7 k( `__________________________________________________________________________$ I( U  O) y. s7 _7 a, q. @9 L! O
' Z; I1 @& \, ?- I* Z
Method 10
& h! O+ V3 [3 N) q4 d=========4 Z1 G* b/ b4 n- I1 ]
: Z# x: S/ D* J. T4 a+ O( {/ E9 P
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with- |" a; H& e- y  K( s- ~& k
  SoftICE while the option is enable!!
( v# F- z% _4 ~- P6 x+ N
" ~" ]; D+ w. G3 b  L3 e2 \This trick is very efficient:
2 v# d0 r, |" k# b2 |by checking the Debug Registers, you can detect if SoftICE is loaded7 Y- T! g: G& R; O
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if! }$ N0 R  ^9 v  A
there are some memory breakpoints set (dr0 to dr3) simply by reading their6 b6 a0 H. D% Q+ }( X' k
value (in ring0 only). Values can be manipulated and or changed as well
- u4 E" U) Q2 M2 ?2 _(clearing BPMs for instance)
1 I" O* K( H* k6 @) u: k9 D) d/ w, y& \
$ G7 y/ {: a1 n+ V$ `& ]8 e__________________________________________________________________________
& W6 Y0 r. H9 i0 s/ ^' @) Q2 h6 I  Y7 M
Method 11) ]4 x. m' B0 h6 Z2 A
=========5 v, n7 Q: i7 i. f5 y

  H+ w4 {! T" Z# j% G. tThis method is most known as 'MeltICE' because it has been freely distributed
4 f" x( m0 C' `* k+ Cvia www.winfiles.com. However it was first used by NuMega people to allow2 V: _6 |) I! a2 [
Symbol Loader to check if SoftICE was active or not (the code is located4 C1 L" o/ w" l( E  v
inside nmtrans.dll).
0 T% m3 J: ?, U# O* l% n
+ U. q% m! O( M. ~6 dThe way it works is very simple:
8 i1 d; V! Q( }; d6 h: d% eIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
2 W' G. [! A+ U; V% H) nWinNT) with the CreateFileA API.( l/ W9 N3 r- h1 ]4 d8 f

( R- X: C4 F" @8 o: S: e+ aHere is a sample (checking for 'SICE'):/ M0 d  y( F" f6 g/ h

9 ^5 B2 H' [5 [  d: ^BOOL IsSoftIce95Loaded()
! L/ v. g3 g5 X, Q" v{& @' i) Y# M1 `% ^
   HANDLE hFile;  # l; K; h3 {8 ?% l
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. D& B/ f- ?8 N$ p- O
                      FILE_SHARE_READ | FILE_SHARE_WRITE,$ `% W1 A9 v5 {8 i" c1 G
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- `2 o5 v- D3 e" f7 e4 O   if( hFile != INVALID_HANDLE_VALUE )0 ~" `: T, I& u7 [; B* `1 k
   {2 V, \7 Z) `9 f0 C& o
      CloseHandle(hFile);
. I, U- }; Y( X- W' d0 x      return TRUE;7 y+ g' {. ^, l* h8 r3 ^7 p
   }8 t6 g# b! M4 ]+ {- t' c
   return FALSE;
/ s- t) R: x- M- v4 P) w  }}3 `3 Q' ?1 c$ P( E! G( [
2 R0 U$ t. s- p
Although this trick calls the CreateFileA function, don't even expect to be
8 L# ^3 ]# [9 ~8 |/ ]( B; Oable to intercept it by installing a IFS hook: it will not work, no way!
5 p6 L% @& R: t9 LIn fact, after the call to CreateFileA it will get through VWIN32 0x001F% m/ X$ }8 h& a& X9 Y8 N
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
( o0 a0 q. X$ j8 z& L6 N8 j5 Hand then browse the DDB list until it find the VxD and its DDB_Control_Proc! @! W% Q$ f3 A0 |
field.
! I3 G! @0 @1 B0 [3 h9 [In fact, its purpose is not to load/unload VxDs but only to send a , W, G" L% m: N( ~6 g1 ^$ q3 E. x
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ B" I# q: X& S# i+ C6 U
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
9 h/ W* f) N5 V! E1 I; F% L: ito load/unload a non-dynamically loadable driver such as SoftICE ;-).
* h3 S& t3 \3 k# ?7 XIf the VxD is loaded, it will always clear eax and the Carry flag to allow
( L( X8 l* i& G& M9 ^2 U1 E$ |$ }its handle to be opened and then, will be detected.
" o& M2 I3 e+ Z. ~; KYou can check that simply by hooking Winice.exe control proc entry point
, i# M& k* r# E& E4 |while running MeltICE.
) T1 Q- W1 \3 I3 i4 `, k0 c& E7 @& \1 q/ g3 v" R+ r; d" e" r

: F( ?4 Q" u: T: F* X  b, T  00401067:  push      00402025    ; \\.\SICE
: ~: Y# y0 ^! U5 ^- b/ l  0040106C:  call      CreateFileA& L* B" r1 N5 l4 z5 H( K- y
  00401071:  cmp       eax,-001, m& p4 z, G, _, h: l
  00401074:  je        00401091+ m! t6 \6 Z/ r2 G, ~9 ]9 [

) T" c+ j! t) W$ H' V, ?, J4 o& [2 \
% \0 w# d0 O$ J6 F9 rThere could be hundreds of BPX you could use to detect this trick.8 p! s6 p! |0 }& W1 ^
-The most classical one is:$ ^& ?& ^1 X4 R' G
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||' D# s3 v# [3 S
    *(esp-&gt;4+4)=='NTIC'
# G3 @3 r0 b: r% c* w7 O
) C* B  W/ O' h" \! ]-The most exotic ones (could be very slooooow :-(
" y8 s3 w2 \: M   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
6 D& x: L* ~& a     ;will break 3 times :-(3 r  a% C, D' h( z+ ]

& `5 X) [4 K# t-or (a bit) faster: * S' N2 m' R% Z) E! ?; W9 f
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& R9 ?) v: D6 H5 X0 o; O( W( U" s# h

4 T; Y3 R- i" S   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  . Q+ @! k- @* |! e! ~
     ;will break 3 times :-(" P" K7 j5 z2 J- a8 @) T
7 y- t: W) ]$ |( Y8 W9 X
-Much faster:; U3 K/ }) W, r+ v! k, n
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
' O' I% s. s4 U& D
) o. p: W9 n/ W% q" {& D: ?: zNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
) p9 d1 Z0 K% r1 C* c, Ufunction to do the same job:
' i3 \$ Y/ ]" {' G
( G; X# e% z  d/ {" g   push    00                        ; OF_READ; `  c1 P( h2 j2 E! ]
   mov     eax,[00656634]            ; '\\.\SICE',0
3 |% K* K" Y( ?$ v$ C3 x; Z$ x4 _   push    eax
9 }% x: c) N/ z0 }( D   call    KERNEL32!_lopen
' ]- b2 N6 R2 d* K   inc     eax6 }' @2 o3 J* H1 n8 N( T' ?
   jnz     00650589                  ; detected
& ?$ ?3 v$ U' y7 N! S9 c   push    00                        ; OF_READ$ B  S7 D8 N5 \. z  ^- h$ M, W, Y: z
   mov     eax,[00656638]            ; '\\.\SICE'" n# I5 l! F: r0 ~: K0 w2 n8 |
   push    eax( ^, R+ q! o0 d9 k
   call    KERNEL32!_lopen
, F" J+ q: e9 t: p# O" P0 K# u   inc     eax
2 k- ?; q6 S) T1 M8 @   jz      006505ae                  ; not detected1 F2 m4 V0 |( C3 k' M0 J  F& t# J

6 O  x# M2 K1 q, f
+ v4 q' Z7 O: G__________________________________________________________________________
0 L9 ~8 A0 I' k% O- p) F( a8 G8 R& n6 }4 _5 v# z
Method 127 C  X2 ~$ Q4 b4 |7 {" a7 B. ^
=========
/ {( G0 u3 S# |# d0 K8 `1 u9 w
0 Q- X$ _. r; y8 J1 Y$ nThis trick is similar to int41h/4fh Debugger installation check (code 05
; U+ R* L/ O% _0 [&amp; 06) but very limited because it's only available for Win95/98 (not NT)8 s' x! K4 C0 q
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.! Q  s% g6 s, t8 N7 V
( x5 L+ W- _% ]) D
   push  0000004fh         ; function 4fh
- A; i# v) `  j! M   push  002a002ah         ; high word specifies which VxD (VWIN32)5 _& a  Q0 \1 Q) {5 b+ v
                           ; low word specifies which service( M9 p; v# M  C! n
                             (VWIN32_Int41Dispatch)
4 q. [/ G1 X. Z6 p8 n8 Q% U   call  Kernel32!ORD_001  ; VxdCall
2 b# D% Y! m' L+ x   cmp   ax, 0f386h        ; magic number returned by system debuggers
, s- {) y! E, E- x9 y6 `5 Z   jz    SoftICE_detected: p: t, }: @) C. J- f

! @7 M* ^- o8 q; IHere again, several ways to detect it:
. v$ s7 x1 a# L) K6 u, C1 @
5 b/ z! O* _0 K" r* |    BPINT 41 if ax==4f
: Y) E- G. Y3 }* O
9 B, D# X1 J4 F% b) E* I    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one. _  D* F  L. u  H: J1 D: W

3 F4 Z7 ?- H5 ~) ?% N: b: A9 Y    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A7 {/ M" B) [+ t
) w* p% M1 r/ k" u* g% J7 l
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
9 ^- e: j2 K8 g6 \1 q- W# ^
+ s7 {5 k3 C, ~9 k/ N. e7 B__________________________________________________________________________6 D% i8 n7 e9 W0 g- v. Q
9 u' y: @  Z' r2 o  {
Method 13' e$ O+ U8 c0 ^1 j- y1 B9 `
=========+ G, E9 C2 w: `5 d

0 D2 t" I' L8 K0 QNot a real method of detection, but a good way to know if SoftICE is
2 i6 n( u  `- u, rinstalled on a computer and to locate its installation directory.
' ?4 c3 [2 H% K! P# X5 E& qIt is used by few softs which access the following registry keys (usually #2) :
4 |. @8 a- k- U& r$ X
; P- \  X; `* t+ N-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion+ K, u) d! K# F+ R) `. R" a8 H5 e& L
\Uninstall\SoftICE) `7 `. B" `/ l8 S- P- q/ |
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
3 E' o9 b; Z) f6 n-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion2 }2 u6 n3 T% Z# B3 F6 l/ S
\App Paths\Loader32.Exe
+ h$ ?+ J- e9 P! x, o/ J5 q, b" L+ {2 A, p7 ?
( W4 E! }0 U. j* X- c+ J/ W
Note that some nasty apps could then erase all files from SoftICE directory% W/ |! K: S, x! E3 y2 e" F
(I faced that once :-(
  y+ [( P# T7 {( d3 \' k1 |1 [' t% w1 [5 k. o3 f
Useful breakpoint to detect it:
5 S2 M4 i+ G6 Z4 e* p4 `, v5 c0 d% \6 E: d
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
% a& s2 o! T. K9 w6 U. m4 p- M$ |: b  ]0 x6 N3 g  e
__________________________________________________________________________
; S( q5 K8 Q* z  L
. t  K& x9 _$ m5 _; }. A* T- {$ x$ {
Method 14 / g4 V" P! w8 G9 o$ N5 z3 c
=========
- P7 x) C0 D; q! M4 c9 b' U% [2 j( d+ @) S7 ?0 O/ B6 [) w
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
% Q, R7 o" _0 D1 Pis to determines whether a debugger is running on your system (ring0 only).
3 n* K5 \6 x% ^! y4 b) H6 w$ ^/ e* X
   VMMCall Test_Debug_Installed2 j$ x& P: n8 R& g  ~0 f( k' x
   je      not_installed3 s- s% L+ [" {) N2 g. i1 y

5 }+ J9 R4 h6 FThis service just checks a flag.
7 P) _* {, F+ X" T% `* E- P</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-19 20:53

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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