找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
. j7 U6 e7 a8 J) m; k& b<TBODY>4 P7 A. r) x! Q
<TR>" i4 h6 b" n& g; t, j
<TD><PRE>Method 01 3 ~5 d! R$ V. U* n% @. U- V5 b
=========
  a7 r/ \! h# c# v& H' j
' w% k2 H3 h0 J/ jThis method of detection of SoftICE (as well as the following one) is5 F5 o; j  K( l: |  t0 Y7 A8 H9 x
used by the majority of packers/encryptors found on Internet.4 W, Y- h0 @7 N. Z% X, r7 e
It seeks the signature of BoundsChecker in SoftICE  O! J9 G# q5 G  T" P
" }. F2 m: V1 L
    mov     ebp, 04243484Bh        ; 'BCHK'0 {2 o- Q6 }( t6 n
    mov     ax, 04h& E* @; N- }$ f( Y4 {4 _' d" ~6 I
    int     3      
/ K: m" _! q0 @    cmp     al,4+ z, ^7 ?- U) V# z$ w
    jnz     SoftICE_Detected& ^- }7 u0 K* e5 u
! f/ D" \% K& J! A% E* O
___________________________________________________________________________
9 d' M+ {2 H. _4 }2 N) w* J' {5 n; T# U5 r% V
Method 02
* \: K) a, b$ d5 A9 x1 Z=========$ j* M+ A* F. r$ {
- J, T9 u% N3 L( E
Still a method very much used (perhaps the most frequent one).  It is used' v. g! F4 m' h$ @
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,; x5 ?! h& J$ o. U
or execute SoftICE commands...
) X+ [6 K- r7 e3 MIt is also used to crash SoftICE and to force it to execute any commands
0 j/ {2 H9 G3 u' @& D6 Y) s(HBOOT...) :-((  
2 Y2 k6 K9 P# G9 e
" u/ h" E: p- Z! AHere is a quick description:
# z1 I# o0 r2 i: L3 }-AX = 0910h   (Display string in SIce windows)
2 |  }4 H! {( [* j: t: Q0 D. B-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)- O  J9 B3 U' D1 |
-AX = 0912h   (Get breakpoint infos)
, q- y, r3 [# u4 O+ q-AX = 0913h   (Set Sice breakpoints)& v# p' T- Y9 W! W
-AX = 0914h   (Remove SIce breakoints)
& Z2 o8 m% g( E9 R
+ Z  f  p1 B) w2 A' mEach time you'll meet this trick, you'll see:! B; l- a- n* C5 x
-SI = 4647h
7 W/ i0 u8 X% I* z/ g-DI = 4A4Dh
$ {( c$ h$ O7 X/ ~- k/ E4 Z8 Z/ [Which are the 'magic values' used by SoftIce.* K& y: Z% U+ B1 G
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
. L( S! d/ Q/ O
2 P. |7 V9 h- w& U( a# t4 w# tHere is one example from the file "Haspinst.exe" which is the dongle HASP' K8 d, `0 w$ g( k2 d
Envelope utility use to protect DOS applications:" b) }! Q% W5 c

) `! P  \6 f0 v& G, g( D
. a: @; B$ b" c) X4C19:0095   MOV    AX,0911  ; execute command.
! N0 \3 b; V" M4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
, H5 {, ~' H7 u. b) B4C19:009A   MOV    SI,4647  ; 1st magic value.
/ z7 A- `8 f/ c' w) u% x9 }4C19:009D   MOV    DI,4A4D  ; 2nd magic value.$ u& P" x2 Q8 d( M: P
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
; [( @. E; U' q. M4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute( b% t! z/ E4 y1 d/ W- B" a$ T
4C19:00A4   INC    CX
/ [/ t2 i# U! J/ |4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute) G% a% T3 y3 i7 A/ F- }  Q$ K2 i
4C19:00A8   JB     0095     ; 6 different commands.
7 P, ?- l2 X) C0 g3 G2 v4C19:00AA   JMP    0002     ; Bad_Guy jmp back.' V6 f; p+ q! R0 v; _
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)  e$ Y% M# k9 c1 |0 A* U' R

. h+ V' ^: O) n# ZThe program will execute 6 different SIce commands located at ds:dx, which( W  }0 c0 [( B  {
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.  c' T" J- H& ^  k2 S) K8 ]
/ b$ v/ ^# {( e/ ]+ h( B/ n7 q
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
; T3 N9 R) @5 ?( @  |# Z( K___________________________________________________________________________; D8 ^( d' {# D2 _

' z( k! H4 l4 Q& u# E9 [% N; J6 Y( F2 r; S
Method 03
- U# p1 x: i6 N1 M) Z$ v3 p* Q=========9 f: B: x; m' a& x% G0 j
  M7 o( {7 f. c; S9 K
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, M* W" u& ?+ V8 h/ P  d6 p7 I: d
(API Get entry point)
) x; o/ J) y9 v) g+ I3 b  [* w        8 r0 C! G* s3 ^2 ]0 C- f% M7 N2 _

: k/ f) ?8 ?& m6 i; D& }    xor     di,di$ f; t- ]- b& j2 S3 A
    mov     es,di
0 H9 C$ r$ R' B    mov     ax, 1684h       $ H& h4 V: T; H: Y/ X
    mov     bx, 0202h       ; VxD ID of winice# e9 Q$ P+ V3 i1 n
    int     2Fh
: m4 }- O2 U) p) x! h5 A9 L    mov     ax, es          ; ES:DI -&gt; VxD API entry point8 }, [& A" d& U
    add     ax, di+ ?6 @7 @: X) T( O  Y& a' c
    test    ax,ax4 _1 N: L! D% X: k7 A' y
    jnz     SoftICE_Detected
# c# f: }" O: m! ]: W+ z( V0 q" v1 q
___________________________________________________________________________
6 L1 t8 _# a/ W0 b
) J/ X) A. B/ Z' h; ]Method 04
  M! o0 Y2 y4 n2 u$ K# _# C+ `=========7 y- h2 B8 h1 ]" Z' x

) ?6 Z& s- g& y: K. W7 K. OMethod identical to the preceding one except that it seeks the ID of SoftICE
6 j7 p- V+ \/ u( f# RGFX VxD.
6 J; U+ F+ ?1 E0 M' _
% _; B$ {4 s! C  `# x    xor     di,di. N( {, g1 Y' ?+ B4 `; }, p# J
    mov     es,di( ~, p7 n- H- L# d1 l. o# N" H" o
    mov     ax, 1684h       * p/ x2 W, b4 Z, F% e8 u
    mov     bx, 7a5Fh       ; VxD ID of SIWVID) q2 \: G' a- c; w+ z! ]. ^
    int     2fh' Y  a$ J+ p& k% D4 W8 D
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
& }5 @2 @$ O$ l5 ~3 e6 R    add     ax, di( ?; E" p! K! a( ~* _
    test    ax,ax
0 E( u; y# ]- U+ B& p8 `    jnz     SoftICE_Detected
- f% d! [; o  w9 e( O8 `: O9 o3 v9 O) s& s
__________________________________________________________________________8 E( O  n7 ?' J
% j) o9 h; ~$ c+ [5 q, k: p* ]

5 N7 s9 |$ N+ m5 u1 ~+ N- RMethod 057 C& D  q( \) b0 X. Q. P6 y
=========
. p; ^# t" x  {% a6 A, F5 z" o" P* g, `; `7 H5 w: ~* i: L
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& V6 x0 ~: I/ G6 v$ H! ydebugger. It calls the int 41h, function 4Fh.
8 l, z& X7 E* Y" b& g" N3 H, A3 G! ZThere are several alternatives.  
" E; A/ g2 B' S" s
( G7 h4 \" w4 E. U; a# jThe following one is the simplest:/ Z5 G- k# b$ s7 Q+ M5 |+ Y4 H9 O

4 z; U' p$ K1 c6 ^% v    mov     ax,4fh9 S) A+ L* v6 ^" h5 C/ _9 e
    int     41h
! [5 P$ ?* L6 a/ p) A    cmp     ax, 0F386
5 t" `: z! u; B6 v8 k, `    jz      SoftICE_detected+ y5 @4 d: j! n

) U) I0 b5 P" b& u" M9 S4 ~6 g6 X6 ]- N  v1 o
Next method as well as the following one are 2 examples from Stone's , i' W6 {% K6 s3 k  U7 y2 H% ]( q
"stn-wid.zip" (www.cracking.net):; |& I# L5 |1 q

: `# b3 V: h- _& g7 ^; w    mov     bx, cs
8 x  \  `; u2 ]* |9 Y    lea     dx, int41handler28 K$ Z$ R8 b/ |- D
    xchg    dx, es:[41h*4]
! M3 D) q1 b; n: j    xchg    bx, es:[41h*4+2]
3 [* T: L8 p  Y! |) Q    mov     ax,4fh
* f' C5 ]/ d' n: K* ~- _    int     41h' _( Y4 A! u% L1 H
    xchg    dx, es:[41h*4]  c# S6 F# `3 E0 f8 I! _0 R
    xchg    bx, es:[41h*4+2]
1 R$ R% g' i$ ?" U$ s# Q    cmp     ax, 0f386h. N/ R6 Y2 V# m5 q- b
    jz      SoftICE_detected" V. j! ~! w9 l

* ?: ^' s$ O+ p. x9 ?' `* Aint41handler2 PROC
! B+ u; ]# E& e' a  N    iret
' z7 g6 i' @+ m+ l+ o' ?+ h+ Nint41handler2 ENDP
# I3 I) o% s! i. X6 R$ \" |, Z% ~; `3 Z, O: p

! y+ K, @  ]3 `8 [6 c8 o- }& L_________________________________________________________________________0 z2 Q6 g/ j8 k% r
1 u: x7 l6 f% ]' _! P* a& h, [
9 K" h6 V  G6 H. L) W
Method 06
8 B! H& G% _& I& Y" k# |=========
, j9 H0 b1 Q' Q/ r) ]- [: m- }! B3 N3 a! i& q$ t7 f0 S" r

9 ~7 z6 f( i2 b, T, V: p% l4 b  W* a2nd method similar to the preceding one but more difficult to detect:
8 C: z. M. |: D5 }# ]
* V- A& U, f) s3 ~3 \8 f
- l4 B7 S. o' ^* C* I0 Y. a. i, eint41handler PROC  ]2 ^, e8 i& J  f
    mov     cl,al8 M6 a% I3 H8 `1 [; x! R; z
    iret
0 p- E+ @+ T6 m9 f) T, tint41handler ENDP
: k7 F; ]5 O! B1 g& p; M% ^3 Z
6 L+ I$ M# s  X$ T" U
    xor     ax,ax* g6 J% {. H: W% K% f
    mov     es,ax- h* _( B) ?4 T9 w% q; I
    mov     bx, cs, M0 q# V4 j+ m9 J
    lea     dx, int41handler( e) E9 Z# ^$ T0 L& R8 {4 _
    xchg    dx, es:[41h*4]  m; b) ^3 Y! [# o& s1 r& X
    xchg    bx, es:[41h*4+2]
9 u" B) K3 \% U4 i! a' H! ^    in      al, 40h
3 P7 F+ v# e$ D' E    xor     cx,cx
' U& B5 n: f9 o! Y8 o3 z/ G    int     41h  c5 u) r+ `  S
    xchg    dx, es:[41h*4]
: K3 B* P; I* y6 S8 Z5 w    xchg    bx, es:[41h*4+2]
- k9 J4 t* u! \    cmp     cl,al! k, W" x) F6 ^0 O- m3 @- y' f
    jnz     SoftICE_detected3 ?; a* y8 G9 L, O# l- @

" e/ a; J$ I- K" N* j/ N_________________________________________________________________________: z( E3 |8 x" Z% m

' Z% z# h' C' H$ s  m' {5 T) t+ AMethod 073 l5 L3 T6 c% ?9 N* s' u
=========
: \8 ?  u3 H7 d4 z
: M% Q2 B) E+ i' ~. h# t, R& f/ xMethod of detection of the WinICE handler in the int68h (V86)+ P* k- l0 X# h0 e; o% `- V8 h
! l$ M( u' M$ J/ i0 D# R+ T. y; Y
    mov     ah,43h6 d+ S- X( \/ y' i' a
    int     68h, \& y+ n1 h- F1 V6 t" P. Q
    cmp     ax,0F386h) F$ q( v) ]* q3 t5 V. m3 [
    jz      SoftICE_Detected
# j6 E2 E" I+ K2 f" \( |' N
# y8 f& z+ K, I% q/ y$ O6 w+ d/ v( A+ r" z, ?
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. U0 I, q# ~8 K, u, e/ ?! R   app like this:2 L8 Y! M: G; g' ~4 X- u
* L5 ~2 v6 l/ x/ L
   BPX exec_int if ax==686 B- n) U2 x2 t* \
   (function called is located at byte ptr [ebp+1Dh] and client eip is3 t8 u$ ?7 u' U9 ]$ B  F3 X
   located at [ebp+48h] for 32Bit apps)( C7 x7 I$ j" T3 ~4 Z7 G7 `2 O& x
__________________________________________________________________________
& D% o& Z6 g! P4 ]: u- F+ c! l
: p: m' g% ?6 {- g7 ~! i; Z( t
# F; M$ h' V$ J* V. ^Method 08% k3 K3 b/ @: N# q8 w$ h+ S
=========
6 l( q2 J% t3 m9 @  `
  q1 o: C7 R7 i: y) M5 p* Z7 bIt is not a method of detection of SoftICE but a possibility to crash the. M  p4 S! N; e" }
system by intercepting int 01h and int 03h and redirecting them to another
! |- F( T9 [9 G) h0 x- u8 l" Z( Xroutine.) J- @: Z: ]5 m8 d
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
. C! T* |; Y' kto the new routine to execute (hangs computer...)
' a- o4 d9 D0 B) _+ S0 ^- E  C
7 A. ^& x) O6 ]/ f; f    mov     ah, 25h# u" Q) O1 c1 \+ ]- j+ m% B' a' k
    mov     al, Int_Number (01h or 03h)
) C' O: Y  z; J) E; z7 t2 s) v    mov     dx, offset New_Int_Routine9 a0 Q; I* U" t
    int     21h
( r+ |4 {0 Y7 G7 P. v% w# W' \; q% z$ K  ]2 p
__________________________________________________________________________
8 T4 x( B" T0 m& E5 g0 t: L1 s- P5 W- E: A
Method 09
! g4 n0 f9 R7 B: u=========# X9 f9 v; |: q* |  c" d. @% @" A
" @7 ]4 n* ^! T* b. `
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only  b! `' a5 `  g7 C& o- O
performed in ring0 (VxD or a ring3 app using the VxdCall).+ T) K/ U* h0 G8 `$ i
The Get_DDB service is used to determine whether or not a VxD is installed
3 {. E! T6 U+ \1 Efor the specified device and returns a Device Description Block (in ecx) for
* X9 I1 `5 n8 I$ u9 v6 p# `8 }' \% ?that device if it is installed.$ t. v9 N0 o. `5 J. n

( O1 B' m9 f& W3 ?* \/ F8 n: R5 V   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 v; J, i( [" n  i0 B6 g, D
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)+ j2 e; p  k( n' l0 \& T
   VMMCall Get_DDB
) [( d: N3 V) E   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
, s- m  v4 T# t; H+ B: k% L! N$ D% t, g
Note as well that you can easily detect this method with SoftICE:) {+ @6 N; x' ]+ l$ I+ X8 H$ c3 q
   bpx Get_DDB if ax==0202 || ax==7a5fh
: g- L+ H7 k" N" z! g' y
! M- g% T  C5 K) N__________________________________________________________________________
2 Z: ?! _: j  i
+ m6 B4 g+ d  _" qMethod 10
7 B. _, X* L7 ]! z1 O0 N=========
0 f* \, x% \, Q( a* h( J6 j1 K+ H, W6 |1 i" K
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
) t3 i2 Q! V5 u  v3 S7 p$ B' g  SoftICE while the option is enable!!
* W+ C! `$ M7 C; ^7 @; |+ |8 s* i3 o0 \& B- N
This trick is very efficient:
! `0 x4 R% Z! l$ @8 a, J. Yby checking the Debug Registers, you can detect if SoftICE is loaded
% c2 l1 T3 V+ W4 x" Z, y(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
$ V# x; ]( F5 E* ]6 othere are some memory breakpoints set (dr0 to dr3) simply by reading their; C5 z: e' z. p0 @+ R6 k6 e
value (in ring0 only). Values can be manipulated and or changed as well" C3 l( O2 o! ~. Z1 ]# C$ _
(clearing BPMs for instance)0 U- _/ q, L- W- ~
" e; f6 C+ Q- l% D* h7 i! z: B
__________________________________________________________________________
/ v: [, x# n/ c. L: A5 v
! `* S: X. o2 d5 [% Z. YMethod 11
1 \- W$ e3 J- Q/ E' Q=========4 N$ v4 H8 J7 T) U  l

9 N& A, |- f' j/ ^) H8 B3 w  yThis method is most known as 'MeltICE' because it has been freely distributed) c$ M% v9 g8 {6 [' B* S! p$ t
via www.winfiles.com. However it was first used by NuMega people to allow0 g: E7 C+ y& J+ r  }' z2 A2 k
Symbol Loader to check if SoftICE was active or not (the code is located+ P' N- Y. [" b1 d$ [
inside nmtrans.dll).5 {4 L8 ^$ b, y- l$ V5 V# |) g

3 n" i9 W) A$ pThe way it works is very simple:3 x* Q1 f* z& m
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 `5 Q4 h; X; sWinNT) with the CreateFileA API.
7 b3 P+ _; c  q% C: U
4 l8 V2 Z. _: `; Q7 C2 ^Here is a sample (checking for 'SICE'):
+ E2 e/ e6 N, n1 R
- t, t4 P+ N0 A3 G/ g" J( QBOOL IsSoftIce95Loaded()3 w3 V- \( R6 w, O
{% a% p' n; o) X; t9 s
   HANDLE hFile;  2 l7 e$ p/ g- C* H
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* m5 E. {$ K3 {8 X6 p/ K$ \  Q                      FILE_SHARE_READ | FILE_SHARE_WRITE,# R/ L: _; o9 O
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ P/ E' x5 N" j$ h3 n  W6 V
   if( hFile != INVALID_HANDLE_VALUE )4 r  P9 J& Z2 A: ]
   {0 r! x& k$ C, H/ y1 S; O) V
      CloseHandle(hFile);
1 M8 T; C5 b9 d  e$ w' B* A1 _( r      return TRUE;
2 ?3 E" R0 ?5 p& U   }
  j, s  m8 I. J$ G) ~+ g   return FALSE;, K9 M. w! O, J9 r( T
}/ V9 ?7 t8 T, b" Z+ r
" g4 K2 p# d+ M/ h; }
Although this trick calls the CreateFileA function, don't even expect to be
( ~* G7 _+ p" U2 o8 h8 H' `able to intercept it by installing a IFS hook: it will not work, no way!. Q8 P" E* A9 e+ v4 [, k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F  l6 G- n" z! {* X% p( q
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)4 Y: R4 f3 L' _1 b9 u
and then browse the DDB list until it find the VxD and its DDB_Control_Proc3 F7 d; F, F4 H' u
field.1 a$ F$ U$ u% O, W
In fact, its purpose is not to load/unload VxDs but only to send a 2 t9 ~6 F% v' [' ], p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
7 t+ F4 v- S5 M% r) L( {) W6 |* T1 Nto the VxD Control_Dispatch proc (how the hell a shareware soft could try
  w4 f; C% w( _& J8 A0 ^+ yto load/unload a non-dynamically loadable driver such as SoftICE ;-).3 m4 v/ ?+ s  ^' s2 V
If the VxD is loaded, it will always clear eax and the Carry flag to allow
: k" U* v+ Q* H  aits handle to be opened and then, will be detected.
- K" Z, z# O7 L' j; hYou can check that simply by hooking Winice.exe control proc entry point$ A0 ~) N+ P$ `  j% x, [
while running MeltICE.
$ O/ |- Z2 F* y* _; W4 K4 f& Q2 W" A% T" W
4 m1 Y7 ^7 G) \6 J9 C
  00401067:  push      00402025    ; \\.\SICE& r' s3 C- Q, E7 X* I) m) C( U
  0040106C:  call      CreateFileA+ J5 D7 p- a% ~/ g1 G
  00401071:  cmp       eax,-001# K( J: S% c% n
  00401074:  je        00401091$ d/ g( ?  y; {8 W3 Q

4 m* q- W! Z# o; d. f; ]* A& D! ^% h+ Y  a' F  v- v; `
There could be hundreds of BPX you could use to detect this trick.
7 h7 U- P3 f# a) ]-The most classical one is:
  q( x6 {4 D8 M1 }" ^8 y  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||& @4 d) Z) `$ O( a7 {$ X
    *(esp-&gt;4+4)=='NTIC': {2 B' Y% r0 k( m

5 `8 T" {/ ~. c-The most exotic ones (could be very slooooow :-(( ^# \! ~% E- J5 O
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
2 @9 ~4 j8 X- ~* E, d6 ]     ;will break 3 times :-(
5 f% G) h" ^' q( f, v
/ g0 W$ X0 i4 ]" j-or (a bit) faster:
9 M. c$ F, ~+ ?4 B   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
$ q6 _) G5 b1 U! a" ~* O9 q
0 }" j, l4 o- A6 P3 ?  a   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
6 G& {4 N+ b% a; K/ k( s     ;will break 3 times :-(  |7 a# c2 b& T$ E
* r) t4 R1 d: \. R
-Much faster:
) A8 @0 ^: u* r* R; f6 H$ g9 A   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
1 u4 z+ U! x4 h/ t& }5 k
- e1 U# k8 X4 ?& X: Y% L9 `Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
5 O) p/ t: F& H$ ^function to do the same job:4 q5 b' }8 \' h9 _# U! m# t8 H

( Z. u. K8 }7 U   push    00                        ; OF_READ
, h: k9 g/ H: X% r1 P# X   mov     eax,[00656634]            ; '\\.\SICE',0
, F, b4 N* k0 R' ?! l4 l4 @! l   push    eax) ]1 y* e) v6 s/ m+ O
   call    KERNEL32!_lopen
3 G; _3 c# M4 W7 l   inc     eax# H, f2 e4 @9 X& P
   jnz     00650589                  ; detected
1 ^2 l; I8 z0 W4 U' |. D   push    00                        ; OF_READ" F/ b$ O$ V" k
   mov     eax,[00656638]            ; '\\.\SICE'
* {% i( {& ?  N4 y1 |   push    eax. v) |4 ~- C4 O* C7 D6 p3 y
   call    KERNEL32!_lopen& a* V; \4 D  n& f# I
   inc     eax# \) _. k3 F. i$ j( H# c# Q7 O2 I
   jz      006505ae                  ; not detected
2 r- g* ~( K% N2 D* f  l7 z; B* b  j* X4 a  y

3 J- ?3 [6 x7 Q& b) H! T__________________________________________________________________________8 T; U& q% d9 n
3 e1 h8 h4 S3 c2 X$ E! S
Method 12
" [5 L' m5 e3 H* z; J5 m=========! m* X; V! c$ O5 E! f
0 x1 a0 F  O7 R* U% ]) `, D
This trick is similar to int41h/4fh Debugger installation check (code 052 E# W) m- D: i
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
. M( f  o7 D8 w3 f3 pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
. T) f+ G9 T9 L9 a. h! |
; e7 z/ c* S, k+ _& {2 |1 p+ h   push  0000004fh         ; function 4fh. a  F9 E& b% r( m
   push  002a002ah         ; high word specifies which VxD (VWIN32)
& R/ r, a- x2 \0 Y                           ; low word specifies which service
2 [& z1 K0 a, A, g                             (VWIN32_Int41Dispatch)& O" F" J  @3 Q. Y" t4 S
   call  Kernel32!ORD_001  ; VxdCall
- P6 h( T, c7 E7 `. R+ ^" k1 M2 _9 l0 R   cmp   ax, 0f386h        ; magic number returned by system debuggers/ ^+ a9 [2 d, V' o
   jz    SoftICE_detected
, f: P1 ^& \  z, X! W6 T3 b9 k5 R4 w( \( a
Here again, several ways to detect it:
* W3 F7 e* J/ D; f
/ G* Z3 w' Q+ X: Q7 `    BPINT 41 if ax==4f
9 f: E- ]& J1 a) B. ]
- \9 u3 j: v9 @    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
  l6 }. C. f# k7 x9 a' {3 B& X  C/ |1 t+ S
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
( C* ^5 p; z- T" t9 q+ p; t, |2 Q2 i. d4 {. i, c* c" M6 c8 P
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
. L- y! j: B, ?4 W2 N0 z
$ \9 h$ a- ^; J: C0 i# I) E__________________________________________________________________________, V2 f2 X3 `( S1 J1 o4 N+ i6 X6 o8 F

' i4 f6 C  J) o$ XMethod 136 h+ h2 q3 K, ^. R% P3 i' F0 D
=========
( y2 M) o4 T. {& |& ], r3 N# ]) D/ w) Y$ t0 Z  ~' ?! w( w
Not a real method of detection, but a good way to know if SoftICE is
8 X  \6 b9 d' r4 m) zinstalled on a computer and to locate its installation directory.) K1 g) n1 z) S1 ?
It is used by few softs which access the following registry keys (usually #2) :
) y* T" l' @- O  B% |
, W5 R, J6 p/ A( }2 r-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion0 q1 Z# F2 h" e
\Uninstall\SoftICE9 U9 c. B% Y7 h  r! |5 ^
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
) t# U/ @& \3 M$ h-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion) D4 O& P$ \$ y
\App Paths\Loader32.Exe
/ S- i$ N6 z2 C8 Q, p/ h/ O! ~9 U1 o! W( i( `
0 d5 l# b( ?# `3 n
Note that some nasty apps could then erase all files from SoftICE directory
0 R& x1 i" s! i# l6 j; r' M(I faced that once :-(
1 i! |( E- p6 {3 ^. j
6 U3 _+ W' ~1 k, w: zUseful breakpoint to detect it:
6 r' n7 d, ~, }5 r1 W' t
8 u; W) ^3 Y9 T+ F  A8 ~" y     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
: `2 k5 B, X! r8 C* R
7 a5 E& B7 i4 ^# h__________________________________________________________________________$ i- R% Y; Y8 @

! i6 l! |6 U2 [3 s/ u6 v8 O8 |7 a. g. A7 M6 b: o
Method 14 / M& h2 [1 O. @- [
=========
# V5 G8 Y) ?+ J3 a- ~6 K$ C
4 x, q; D5 q+ ^7 K& B" y# {$ nA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
2 V" X  S& l$ X) m! }is to determines whether a debugger is running on your system (ring0 only).1 U; H6 R- \5 u4 N9 t
6 w' W. ]5 c6 q$ v' K6 l
   VMMCall Test_Debug_Installed" D2 m+ n8 a4 J
   je      not_installed
! S3 `6 D: V: Z& x- Y5 e5 ?% H8 u9 T5 G' N9 p
This service just checks a flag.
. M5 c: w" A. m& T4 T9 y</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-2-16 04:37

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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