找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>' P4 f) o  k0 U- N3 X
<TBODY>
# ^  ~5 M) P/ B5 l$ M<TR>% g5 a! [6 ]" k2 {
<TD><PRE>Method 01 " l* e5 C3 `$ f7 F( k; g
=========
; r! H8 ^6 e# }. k$ P; n
1 _) ~9 T$ P' }8 c1 l' s2 RThis method of detection of SoftICE (as well as the following one) is  y% o, y3 A( y" S7 W) ^3 h  o; q
used by the majority of packers/encryptors found on Internet.
7 C' b' q* ]- v7 b( P4 U' eIt seeks the signature of BoundsChecker in SoftICE+ W& u# r3 O0 k- A5 h4 S! s
- w. _- [3 P8 a4 |$ p
    mov     ebp, 04243484Bh        ; 'BCHK'
) x4 {6 m5 T- `' [; c0 j+ N2 ^% Z    mov     ax, 04h
: v# }9 H0 V/ E3 _' L, h  p    int     3      
( L3 P0 c4 e/ I2 I9 H( g- G    cmp     al,4% g0 z  u& G7 A0 h' j4 t
    jnz     SoftICE_Detected* ?3 W3 `( Y) t/ Y. U

6 B+ t- a' ?$ ~7 V1 n/ f$ d( T___________________________________________________________________________# e; X. T, i  l9 W; d6 `' [% ]

$ K/ S) L2 t: u5 e1 oMethod 02
) a( Q$ @6 N* G& T* j/ Y  F=========7 I" ~: a& A3 I
; x: z4 }+ a2 x& ?! W' G" }
Still a method very much used (perhaps the most frequent one).  It is used3 x' y3 [2 A" a# _+ _! H6 o
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
+ u$ P7 R% P6 S$ o* i) l5 `or execute SoftICE commands...; k2 Q2 H% k: w
It is also used to crash SoftICE and to force it to execute any commands
- w9 M: W# @/ ~- J4 F(HBOOT...) :-((  2 r" f# A2 T$ K( s, H- c6 E

3 G0 K% M5 T* q1 ~0 Q( i- eHere is a quick description:4 r. s. e3 p4 v9 H2 l9 o& h7 C
-AX = 0910h   (Display string in SIce windows), _% c2 G5 a- v! K  H0 x
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx). `: H3 t1 M2 X/ I
-AX = 0912h   (Get breakpoint infos)
4 t3 f0 i8 p$ H8 F) k-AX = 0913h   (Set Sice breakpoints)5 J, R. {. H% P" m9 X
-AX = 0914h   (Remove SIce breakoints)
4 P4 g, h8 o1 ~  `6 {/ x2 q% [; ^& ~, u
Each time you'll meet this trick, you'll see:
- v( l0 B8 W- L( `2 m-SI = 4647h
1 Z9 `& p5 }( O% k) D-DI = 4A4Dh- t+ M( x5 K7 F, G8 b& I
Which are the 'magic values' used by SoftIce.
1 \/ |( \, [- T2 b( b3 NFor more informations, see "Ralf Brown Interrupt list" chapter int 03h., H; C$ b) u6 S( O% |- z

1 k, M8 F. _- ?9 N  Z$ e  [Here is one example from the file "Haspinst.exe" which is the dongle HASP
9 u2 ^1 E0 x! @9 p# SEnvelope utility use to protect DOS applications:! x" N* |$ B, `7 ^; R# X* x5 N
' C' k0 N' s5 [7 L# M

$ c  A- `* a, M1 d; U4C19:0095   MOV    AX,0911  ; execute command." s( P9 ?5 `" {
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).8 x" U! `* T1 a
4C19:009A   MOV    SI,4647  ; 1st magic value.
8 G- Q# V1 E9 B% `) Z' T4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
- B9 p) O9 |* ]+ K7 F, W( V  P4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
- Y" @0 R8 q! i6 N* f4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute7 V0 m6 E8 @7 t! H
4C19:00A4   INC    CX5 Z* L& l: I( @
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute; j1 \. d/ n. k
4C19:00A8   JB     0095     ; 6 different commands.
' d4 ~' c; n. A, }& z6 o4C19:00AA   JMP    0002     ; Bad_Guy jmp back.% L5 S0 c% O; L. }  w6 A% L, U& U
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)+ L* F# s3 Y( j" y* \

+ N5 z7 Q& @" R# ^/ r  UThe program will execute 6 different SIce commands located at ds:dx, which( b  H1 u3 \1 s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.3 {" [5 x$ i8 l( x
/ L; n7 C- m7 U% y) I& \4 S4 d7 o' ]
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.  M6 a) G. v* ], C
___________________________________________________________________________
5 B* i0 C2 y0 s) \: y* L
0 y, m: I( a' U- F; M( ]. w/ D4 d. l( T% z' U
Method 03
3 u6 z8 |7 D* Z=========- {! q6 z4 ~# r/ s; k

! e; d  p$ e4 H) m/ WLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h, _  ]) ]1 ?/ G
(API Get entry point)& X  J. G) H3 J+ W4 c
        & s$ b9 ?* b6 C! r- q0 W- ^
) X" }: U1 z: B/ f! r, V  M2 f& l
    xor     di,di
6 _9 w( k7 P$ K& r/ r    mov     es,di/ J3 H; R0 [0 V* N' w
    mov     ax, 1684h      
6 G; {9 _- H' t# x, D8 p0 [    mov     bx, 0202h       ; VxD ID of winice
3 a1 `7 I9 }; I+ d    int     2Fh# A7 w1 ~, O$ D" A% n& i( T/ N
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
6 G$ @) [, \: y0 |1 u& Y    add     ax, di
0 w9 B7 o6 f0 |    test    ax,ax2 j4 j" y+ y* N7 H* t0 w  n
    jnz     SoftICE_Detected
% K* t8 V6 O& D) b: r" ^/ m1 @/ a2 H6 }# z  Z* T
___________________________________________________________________________4 L6 Q" ]2 T7 L1 x
7 m! Y3 Y; r4 ^4 e/ G7 k
Method 04, [/ s( R! T3 _# f" X! x
=========* Y4 O+ N' J  `: v7 e& h

5 Z1 a9 w* J% w9 |Method identical to the preceding one except that it seeks the ID of SoftICE
) b7 ?- N! ]2 y* ^  qGFX VxD.
6 \- w' P% P4 [- G2 _/ ^: `( j2 N% a$ C( Y: m' s, U
    xor     di,di
0 a. l# S6 F3 z$ r! I( _% ?    mov     es,di' o+ k( ~9 M2 ?4 |7 O* n
    mov     ax, 1684h       8 i/ D; x$ p( w5 G9 z% j
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
' K/ y- M) {& j+ `3 h0 d: y( Y    int     2fh
$ ?8 `6 Q& H6 [. G  i! `; r    mov     ax, es          ; ES:DI -&gt; VxD API entry point7 W+ \" M; |$ W
    add     ax, di5 r( v! S. V: f
    test    ax,ax0 e2 Z; H- B3 i0 f6 y
    jnz     SoftICE_Detected
/ I! F( s4 G- L" k& q2 ^
. k4 ~. ~" R  t! U__________________________________________________________________________, E( w( J( b8 p: j0 @

# j+ r. y" O* m6 n. b0 i4 k; l6 {% L/ _
Method 05
! f! f9 v/ V* S# O: ]=========' \1 I5 v' O  S. _5 `* F

3 T7 F0 ?3 I* BMethod seeking the 'magic number' 0F386h returned (in ax) by all system
3 B0 e- k# [1 idebugger. It calls the int 41h, function 4Fh.( H8 K( E8 Q" _, u" W9 [
There are several alternatives.  
/ J3 _* x' b" F
% \3 d4 D# A+ X. VThe following one is the simplest:) ]) o: W( r; n7 u

! k( s/ \2 K1 |% B. M    mov     ax,4fh1 u) n- a+ G" y- c
    int     41h
. c9 u: T) T3 _( m    cmp     ax, 0F3868 f3 X5 f+ V6 v
    jz      SoftICE_detected: H7 r- t2 F. s
& G. d. B+ R5 g& Q& G6 z

! m* ?/ b% P0 X4 k( M5 NNext method as well as the following one are 2 examples from Stone's 9 c% H4 v# u; q
"stn-wid.zip" (www.cracking.net):0 F% E/ ?# R  h$ i1 m
7 I+ K- c' `5 x, X  I+ [; C7 d
    mov     bx, cs. E$ K9 _2 q: S0 ~# r/ T. e1 `
    lea     dx, int41handler2
' i1 h; m- h. w" J3 o' Y    xchg    dx, es:[41h*4]" I) @8 u4 t, j# I# X4 \
    xchg    bx, es:[41h*4+2]
( @% x( ~$ [& N5 `8 M' L. ?    mov     ax,4fh
2 P( W9 {7 _: z9 i) {7 g/ Z    int     41h
& ^2 q2 W, D! q7 |7 `' p    xchg    dx, es:[41h*4]) c3 E! {! ?  j5 w% a5 p% H2 A3 {
    xchg    bx, es:[41h*4+2]
! x& b8 H8 E6 i9 @( ~# q$ j* H' K    cmp     ax, 0f386h  V2 P2 R2 M" \) S1 [  f- ^0 [
    jz      SoftICE_detected2 t' k8 k; I; y: E( m

; ?( J" H  h& D/ N1 E, Cint41handler2 PROC4 h0 ~% y: N& j+ z7 i1 i; w4 Z
    iret
+ F$ S" y6 \5 n9 X2 I6 Wint41handler2 ENDP
/ L+ j/ \9 g3 N5 b; _2 }
2 m. H* c/ t0 u& u/ _) h" p
: Y5 O1 I; a) ^' ?1 Y; T_________________________________________________________________________! z: I- b/ l+ {6 J2 y: b) {

% a) X+ _9 X( O" c
" q# b; d7 t2 ]( I/ Q" h/ S4 L4 DMethod 06
& X- c& P# _# }# S4 u=========
; k; }) b# b# h. b0 u8 z0 R2 l. D. T/ I3 O2 ^8 H3 m6 z
/ W: r% ?& v* F% m7 }7 G( M
2nd method similar to the preceding one but more difficult to detect:2 i9 d3 v8 ^5 W3 ]6 [6 V' n

2 Z& u0 e1 i  D( u$ s0 w9 i2 s7 o" [: L5 F) x: N- d
int41handler PROC+ L; \5 w2 ~* G7 V+ W& m# ^, ~
    mov     cl,al( m4 q1 e4 K! X5 C2 X. g
    iret% f" u. `! H+ q0 O3 e1 B- K7 f
int41handler ENDP
/ U/ u7 B( A$ O2 H8 y: e! S% ?' o8 X$ j

: j7 D) F/ G( {5 Q$ G! \( U: @    xor     ax,ax
5 p, Q7 E" M6 [& n& U1 q+ O) {& k8 a    mov     es,ax) }, E) R1 J$ w' r" _
    mov     bx, cs+ L* v: s4 V  @- r) E
    lea     dx, int41handler
4 v' E- [8 U$ e: c, P2 K- G    xchg    dx, es:[41h*4]* T- i: `" k! O; r
    xchg    bx, es:[41h*4+2]
& z, _+ k3 F" L3 U    in      al, 40h; e, J( u- w& `3 J8 R& B" H8 G& _
    xor     cx,cx
* o+ x- u) T2 n9 Y6 @1 E2 H4 h    int     41h
# \, e/ b* h6 Q6 g3 b) n7 C' C& q    xchg    dx, es:[41h*4]4 T, V6 |3 {7 Q7 E( E9 h
    xchg    bx, es:[41h*4+2]
1 F  N+ h; s- y$ S8 O# |    cmp     cl,al
- ?: T# i" i& B& f% H    jnz     SoftICE_detected3 ~" x: l/ L$ J+ v% o8 ^

7 m* m+ p; _7 |_________________________________________________________________________
  ~3 t, ?# v4 s5 Z7 r' u$ V
; ]) W( u: t% y1 }$ U$ O/ AMethod 07
) A8 M" o: E# @' H. `1 {* Y=========) u. i$ l* j: _' K( u9 Z0 t+ \0 s- D

' N7 d! _; q4 KMethod of detection of the WinICE handler in the int68h (V86)/ n) X" m7 y- X' i0 \

5 @* U0 L& K, ~% _# c    mov     ah,43h/ t; p+ _7 K  `1 }* C$ @$ Y
    int     68h
7 Q; B$ N( M$ V; U    cmp     ax,0F386h
, c1 x0 F; `$ D7 x    jz      SoftICE_Detected7 E0 h9 r3 ?5 o& S2 B
$ O0 i6 g3 H) o) P1 s

. y0 W$ G# ?, W# `% J+ A! P=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit( i4 b' m" v! c3 V
   app like this:
8 X2 D+ n& E1 k2 d! [0 p6 ^3 f* C  w8 E% Y$ w
   BPX exec_int if ax==68
& [( `4 u) v% W3 m   (function called is located at byte ptr [ebp+1Dh] and client eip is3 M7 e5 ]/ P9 d7 _4 l0 w9 P
   located at [ebp+48h] for 32Bit apps)
+ E0 \& h- ^2 R% B__________________________________________________________________________
) G' Y* m  q* `8 d( U, S+ p* q; G& t
0 n6 b0 F* ~; E3 n9 ~2 S2 v4 L- E) K& P. z+ R  o" G" U7 P
Method 08
1 b/ i1 C+ H3 t/ y2 [=========7 Q" g1 p/ b; K+ k

+ @4 ?4 ~& I7 O0 XIt is not a method of detection of SoftICE but a possibility to crash the, t1 f3 y7 e- ^5 D9 z
system by intercepting int 01h and int 03h and redirecting them to another
* J/ a1 i( _! Croutine.) \; e4 q1 ?. c2 T. ?
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points1 l3 e. X- h% v& d
to the new routine to execute (hangs computer...)
% }* W  w1 j' m5 `$ _. N1 y) p8 I0 J7 z, \5 t8 N2 f+ j- c
    mov     ah, 25h
* m) \7 L0 v0 B: {$ v    mov     al, Int_Number (01h or 03h)) Z) f' [3 c+ |) D2 p
    mov     dx, offset New_Int_Routine' w5 V- N5 _( Q
    int     21h
) v' `6 q9 i* E. H
, e% b8 c8 M1 W, a" l1 l# X' B__________________________________________________________________________* w9 B' Q8 W: y8 M! c& ~

2 e7 {- u' X& s; a' {Method 09( k0 j4 G# F2 G- H
=========
- }! A" k  ^5 o0 @. F1 ]" y
1 t- U+ ~6 j* u4 |( w  PThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
% u7 [3 N  F/ n5 Fperformed in ring0 (VxD or a ring3 app using the VxdCall).' s& d+ Z3 W* Y) k9 a; I. X+ V
The Get_DDB service is used to determine whether or not a VxD is installed: X0 V4 m2 O2 T; F6 s; B
for the specified device and returns a Device Description Block (in ecx) for
, z" U* y  m3 W8 w: rthat device if it is installed.) T/ _' F: {4 Y/ a! X" u
0 s4 b0 p3 g# s2 {& w- B
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
* s0 S5 E  j& B& @   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)4 N- A0 W7 |- p: a
   VMMCall Get_DDB
, H3 u) `2 u. J8 q, J6 U   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
7 a, T' f" L6 i- h5 f( w  r' V  B$ l: X# a+ X" O4 b$ j, d
Note as well that you can easily detect this method with SoftICE:9 y. u& {9 i5 i
   bpx Get_DDB if ax==0202 || ax==7a5fh- Q9 u4 |' p0 G6 L8 H# b

+ L& T1 o8 {, ?7 F" r  C* u__________________________________________________________________________
" ]8 x4 T$ J/ h# V/ y/ h' Y
/ _& ~; q/ l6 s# s. T8 ~Method 10
7 u) N% N' z: d) h=========
9 `) |. g, L: y5 L
, b: Z' c; A# r+ b  d# n& `=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
3 ^$ C7 ]" h7 K  SoftICE while the option is enable!!% j  T* W/ ^' Y6 c- N, |3 O$ o. ]

8 p& e7 d2 @1 |$ ^# L: W# \This trick is very efficient:2 _, P, H6 l; z' N5 o
by checking the Debug Registers, you can detect if SoftICE is loaded& j" ]0 X% x& C  X
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if: D6 @' f5 {7 e0 m
there are some memory breakpoints set (dr0 to dr3) simply by reading their
* {4 O) q+ I: E4 Lvalue (in ring0 only). Values can be manipulated and or changed as well0 p0 w5 c0 t& @( R0 r+ F' J5 k
(clearing BPMs for instance)4 v7 }# C* h2 f1 ^1 H7 t% }' I
% x( f. d6 |$ N+ R4 K
__________________________________________________________________________
9 k- Y( T5 j2 K5 W" Z
; g# m! M% u% n) A& g. {1 [Method 11
. Y( Z+ S) A6 r; U=========
5 b+ G9 o# z) f3 s1 p
" s( a. e( E4 J( i3 I( IThis method is most known as 'MeltICE' because it has been freely distributed1 Y* f7 H8 Z  @$ p5 ]& }4 |/ [
via www.winfiles.com. However it was first used by NuMega people to allow1 }9 p8 Q. r) n: I. ^$ \
Symbol Loader to check if SoftICE was active or not (the code is located  {4 Z$ q; m/ w, u
inside nmtrans.dll).
- w* \) a! X2 r# N, ?7 L4 m# O% G' g! i6 A0 k
The way it works is very simple:1 ?3 F9 i6 w8 D$ @4 J
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
& y) G' K- ?( mWinNT) with the CreateFileA API.
4 e9 _+ d& v* N1 K2 g5 Z9 e* A' F. \- H2 Z' a
Here is a sample (checking for 'SICE'):( h; @7 y9 N; V# c- U1 V

/ U/ C% }) o) K3 OBOOL IsSoftIce95Loaded()) E0 Q+ @% D( r! s! b% q
{
5 x/ k1 \4 h  X6 ?7 n& [* }; W   HANDLE hFile;  
: ?* |: F; @3 v0 x6 ~6 D7 f4 p   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
- g2 _  _. ~1 T3 y                      FILE_SHARE_READ | FILE_SHARE_WRITE,
) y: y2 u$ }! E4 z: ?                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);4 u% ^* p3 z5 m( x
   if( hFile != INVALID_HANDLE_VALUE )
, Q6 d& N2 J+ p: A   {
% G+ e% _& j7 T* m. U* t* Y      CloseHandle(hFile);
% R+ R2 q' o3 h( U0 a2 V2 q- ]      return TRUE;
( g3 e# J4 O  ~4 ~! p   }1 X7 Q# z- o5 u& d% }
   return FALSE;
( ~/ f9 Q( V* p  d5 K}
. C( Q! _' h7 m) h7 l* w5 ~, [) @1 c
$ [3 a& j9 M9 i( H4 LAlthough this trick calls the CreateFileA function, don't even expect to be3 @  z! G" i) r$ K. V
able to intercept it by installing a IFS hook: it will not work, no way!- H* U8 U/ N- N/ n4 i) ^
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 `8 N, ~& y; I. s8 N) @, Yservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)8 b& F# D+ M3 l- `5 n
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ m( V# D9 B1 |- ufield., X" x2 R  B9 J# g* c; x: D
In fact, its purpose is not to load/unload VxDs but only to send a
( U8 ]. Z' Q! L% O+ D. o, |W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); ^9 u: C8 I' H3 I) |& {& w
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
" J& D8 v: D& |9 d: y8 gto load/unload a non-dynamically loadable driver such as SoftICE ;-)./ S0 p8 w) J3 a5 Q" ~( q
If the VxD is loaded, it will always clear eax and the Carry flag to allow; r  R8 e! Y7 c  T0 @! v
its handle to be opened and then, will be detected.( V7 |- I+ H* Z) ]" R% b8 e
You can check that simply by hooking Winice.exe control proc entry point; C2 s5 e0 H0 F2 J- X$ i
while running MeltICE.
8 y5 g5 j" b! j9 r+ D8 c/ }2 l. s' x2 @! S
8 ^, J3 J6 }$ I. o
  00401067:  push      00402025    ; \\.\SICE
! Y& m! Y7 M# W+ q0 `  0040106C:  call      CreateFileA* n, j: b. P& ]  A6 T
  00401071:  cmp       eax,-0015 m6 J. Z5 l: P; W" E; J$ K9 V
  00401074:  je        00401091
1 Z; _& Q& ?- g6 L3 |6 b+ ?+ z. z' w. M8 X6 Q. h8 V% T! W, H1 n7 ?% F

) I, x$ L- l" o& Q5 GThere could be hundreds of BPX you could use to detect this trick.* x- t1 y- @0 s, e4 v$ P: h3 l
-The most classical one is:
8 N* g7 l* x# \2 M3 {3 e  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||- C9 i. h# p/ I7 q. {  v
    *(esp-&gt;4+4)=='NTIC'
, L. p+ _- Q& u6 n
; _3 h" L3 N- ]0 y-The most exotic ones (could be very slooooow :-(" S# r8 _- k. ^* ]2 h
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  6 `) g+ S# u& Z' I3 F: P2 X3 J1 J
     ;will break 3 times :-(
9 O" ]8 ^! o) e/ i. b, M5 L/ f* R' h0 E4 [! _
-or (a bit) faster: 7 s' Z2 l5 K6 H
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')& [2 u1 G4 G# l* w7 s' n! w  |
$ Q' [( \6 ~9 E; o3 e6 v: s
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  2 S: |. D2 E+ g/ {
     ;will break 3 times :-(& @! D, K/ v, R; V# f

9 g( @$ U8 p1 _! ^9 y-Much faster:
4 b; v  \; f  `- i; r6 q   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'3 ^7 [6 ?4 ~  ]

6 v/ N! T1 H* _! J0 B: _, [( h' {Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
' \4 `0 {7 Z: Q4 ifunction to do the same job:
0 y  b0 ~! m  B7 v
$ }3 \& \3 ?/ [  ?2 a& o2 E. B* w( M   push    00                        ; OF_READ: S- E" T3 H* ]' [' i; d6 O8 X  H$ \
   mov     eax,[00656634]            ; '\\.\SICE',0/ d* a$ ]: {+ V; s
   push    eax
" b4 s. R% q# i8 @7 L" v+ y1 p( v- _   call    KERNEL32!_lopen0 s% b! Q8 K5 }4 B# k
   inc     eax8 e; [& m, I/ a, j' {3 K( V
   jnz     00650589                  ; detected0 `; {  Q2 i: a
   push    00                        ; OF_READ
( O& \# K, l0 p& Y   mov     eax,[00656638]            ; '\\.\SICE'
+ A8 B. f; _: |+ s   push    eax
; \* M' _  h" [   call    KERNEL32!_lopen
+ B) P& _' G- y( q6 u2 y   inc     eax
3 y; {# k- }/ `0 t   jz      006505ae                  ; not detected
& F. I# T/ |" X; M3 Q2 u
) @1 z( a' s* ?4 N; S% d  U
' O# H1 D6 b3 O6 {8 a  R__________________________________________________________________________+ d, h# e( r* c. E4 W
4 @5 ?# p( k5 }0 n( H
Method 12
3 r1 P% Q6 O9 M, s=========
# `; i7 J; u- ~3 [% C) g- X' u5 H/ S) O% }/ M7 K' o  A
This trick is similar to int41h/4fh Debugger installation check (code 05
$ u  z. W/ z. F; E6 F&amp; 06) but very limited because it's only available for Win95/98 (not NT): Y- d8 ^* {- `; c- [" E- G. x
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." p  }. b4 U% E7 P( C. z

6 j/ l$ T% F2 e- s2 ^( l   push  0000004fh         ; function 4fh
* z+ X$ p+ }: n9 Y/ H2 N   push  002a002ah         ; high word specifies which VxD (VWIN32)5 ]1 @2 m1 x6 z; w; J" Y
                           ; low word specifies which service
- B2 R8 i4 y) L, t2 {( ?. p                             (VWIN32_Int41Dispatch)
; G- f& T  l. A% l# J   call  Kernel32!ORD_001  ; VxdCall
% ^4 d3 ]! U9 R, Q   cmp   ax, 0f386h        ; magic number returned by system debuggers$ J0 y! l( x, a" R' d2 [
   jz    SoftICE_detected$ v% p  b+ L/ v" J

& [; P" s0 u" y. C* ]8 a  VHere again, several ways to detect it:
' G0 d6 r$ }/ x- _- x4 s# H+ k7 D
0 B3 q/ B3 s  |2 {; J8 u5 ^    BPINT 41 if ax==4f- x& n; c3 i% T- e$ l' @

4 Q* ?$ [. f8 R# S# h3 o    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one8 d/ q; L* v5 T8 J: J: A3 ~' H

0 O9 R( E4 `+ M    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
. f7 x; U3 n/ G
8 H1 R* C3 e9 D6 Y    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
3 B  o6 b, ?4 a. z* E* t. a- f
, Y: T5 T. r! U; c( ~. O1 R9 q__________________________________________________________________________  n8 r* u3 z" k; o( G1 }

$ [; `0 L: T5 n. N; h$ q0 EMethod 13
* r( E, W1 P$ w% h+ C) X=========
+ h  I2 A; F% o% j* R6 f
' U4 U, [2 x% L* t/ x% U! lNot a real method of detection, but a good way to know if SoftICE is
* f" m% d& q* |installed on a computer and to locate its installation directory.( Q/ U2 Y! X- G8 T$ f
It is used by few softs which access the following registry keys (usually #2) :3 N2 }2 W8 j& n3 C
6 X, C8 x: T' Q0 x  [! o, _# o
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion; m9 u; w  y4 z- h6 ^
\Uninstall\SoftICE
  f3 A# d. k- z9 b2 E; S( y4 t-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' G2 s0 }) h3 `- T3 P-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion" R( V5 W. K! U7 e, q$ {
\App Paths\Loader32.Exe5 Y  i" g6 T( S. U9 U- t& A

8 P8 s! ]/ m/ N
" R* V; c) g+ r  R* }Note that some nasty apps could then erase all files from SoftICE directory
. {$ P& }" K  E5 Z- k(I faced that once :-(6 g3 i: T/ i9 O. N1 Y- a

2 X- X) @) x' ^/ \4 P2 _: mUseful breakpoint to detect it:
1 _' M6 l1 U2 s  a" S! s/ r, ^  I8 d( J% z9 y1 F
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
9 z4 Q8 N: F& u6 o6 S& n" V. d- ~
6 j! k* [, ]0 Z: k# \7 q( A__________________________________________________________________________  k' L$ p. V  H5 T0 e7 ]. U& a+ u

6 H; Y4 x7 _/ b/ @
: R' V% Q7 ?) b/ D& N$ vMethod 14 6 k) |# d' w! }- L/ T
=========
+ i" x+ I, o. T: [: ]1 S# ^# e& j# X
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
3 y- u, G6 m' d( s4 f( k7 C3 w; Ris to determines whether a debugger is running on your system (ring0 only).
7 y  [8 y# s# b# M! A5 `2 Q' A5 ]- r
   VMMCall Test_Debug_Installed% X4 J9 T- Y3 K; j2 Z2 Z) G9 O! A
   je      not_installed
& k' |: r4 @; ^6 P; f" ]5 x* F) B3 f
% Y. }: G7 z0 i, |! BThis service just checks a flag.! s7 j) ?1 S- i% T" l" R
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-21 18:59

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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