找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>* Q2 \+ E/ a* x8 S& Q  F+ Y5 g4 z
<TBODY>
  g0 F! x  G$ i& M" T6 c<TR>
, W' J; }0 y& ?1 [" `! v<TD><PRE>Method 01
7 W5 ?, V0 `* X# i  S=========3 b+ `# _) i* f7 N" I" e1 O

* x* c0 C' T% A2 l6 I5 W' i* VThis method of detection of SoftICE (as well as the following one) is8 p8 G- Z+ X% y' O) c
used by the majority of packers/encryptors found on Internet.& @3 K9 Z" G4 U2 i$ v* e& {# ?' H
It seeks the signature of BoundsChecker in SoftICE
' \# Y# @3 b! s+ G9 s6 G7 j# E2 j2 f- f. a2 s
    mov     ebp, 04243484Bh        ; 'BCHK'& ^* [+ Y% h+ |& B% y
    mov     ax, 04h
% S" N2 r; \- K0 f    int     3      
8 C4 E3 @# p) `9 r2 f5 P6 y    cmp     al,4  W) t, [3 w8 c1 J6 w- w* o
    jnz     SoftICE_Detected: q$ Z2 F$ u( z# U2 t

8 q7 y# l. j5 z( b2 Q6 x& B8 [___________________________________________________________________________
0 R9 A2 s2 ?4 v! q' F1 k0 B
8 y5 ~5 y7 ]  j+ lMethod 027 J) c  w5 @9 R
=========
* q; p. [: v8 M+ M6 H/ k$ {" Y6 B% b, j& _6 g
Still a method very much used (perhaps the most frequent one).  It is used! R# a, K) Y3 O* [! }: I& X5 e
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
* M1 b9 p* T8 E+ y! I0 S: lor execute SoftICE commands...
$ E" s7 Z0 q; b0 ?9 _; u) YIt is also used to crash SoftICE and to force it to execute any commands, g( r& h6 l- p2 z8 a2 D5 m
(HBOOT...) :-((  " p1 y9 W  n, w% b# \2 e6 |" w

. @' g" q7 z! ?( Y" `$ c# K! B, ~Here is a quick description:5 N. B4 ~, f* l' l6 D/ H% l8 Q. P
-AX = 0910h   (Display string in SIce windows)
. [/ A; N( g- P& K+ w8 F-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
# x; V3 P/ ?+ K" T7 }5 a8 x-AX = 0912h   (Get breakpoint infos); g4 q8 }9 d7 _9 |
-AX = 0913h   (Set Sice breakpoints)
! L( d$ ^7 L. j* W-AX = 0914h   (Remove SIce breakoints)
, O, I  w& y+ [3 ^6 L% ?0 j: E& X/ D: A. d1 G
Each time you'll meet this trick, you'll see:  c! J; u( g# g$ g$ G
-SI = 4647h
  s2 M& f! x7 X* N  b. }-DI = 4A4Dh
5 _# w/ R0 a, N) a' ?9 e( vWhich are the 'magic values' used by SoftIce.2 M# q/ T1 V8 i, D
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.
# ^* P, y6 q& |  k: F" c; y3 E2 ?! k7 ]% I! C
Here is one example from the file "Haspinst.exe" which is the dongle HASP3 W- L6 u: q2 Z% [- k, h
Envelope utility use to protect DOS applications:
9 d9 a; }! O& s6 o" ]" ~3 F; k  Y6 s% Y/ ^2 `, c, a# ^, E
6 t$ q& V5 n/ w" b; |6 h6 ]
4C19:0095   MOV    AX,0911  ; execute command.# L3 D8 O  a* u/ k0 C& ^
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
; q; e- J* |9 }, E1 }5 X3 Y  |4C19:009A   MOV    SI,4647  ; 1st magic value.
& ^' Y2 O9 Y; |% n; ~7 s4C19:009D   MOV    DI,4A4D  ; 2nd magic value.$ W2 ^; }) j3 T7 E- f1 E# R( D9 I# l
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
5 j( H* ^6 B" Z& b: y4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute# J' D8 }  v9 m; c; G" z# f
4C19:00A4   INC    CX
! B1 B- F# t' e  _. N4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute$ p, D+ D0 }* ?; n; A) W3 J0 k
4C19:00A8   JB     0095     ; 6 different commands.0 t; m9 y' x( A
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
; X* M9 G' k8 q5 v2 e* o( u. _4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
% q' f0 o: l+ m3 A: X
+ ?/ L) V$ t( I( w- o* e1 mThe program will execute 6 different SIce commands located at ds:dx, which; A8 e+ ^4 b6 h
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.4 C" B& E+ N! l, E- S2 D2 J
' M* @7 m, C$ p5 r. c) T( R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.5 t6 v/ U9 U5 s) _* w" [
___________________________________________________________________________8 G  b( l+ Z# D
; U( ~2 a1 p9 F+ V( H
3 ?6 d9 k; a0 I/ i
Method 03# h* D4 b; G1 U5 f" q
=========
. }+ V# N. q# h. [1 T: V% y. h0 }5 I' {
  B5 u1 @7 j: N. h' xLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 D& ?  ~5 k4 _. a' o+ B( D5 X" ?3 V
(API Get entry point)
* x4 R3 z# u% r8 p6 S        ; _, c& {$ u9 B; @0 I1 D

1 C0 b1 c5 c! r/ u    xor     di,di
: h# W2 r( d1 e; h; D: f    mov     es,di
1 @3 H' M" k  M, ?) d; K& S: J3 H    mov     ax, 1684h       6 |- ^) w" `* t. ^" e5 N7 W
    mov     bx, 0202h       ; VxD ID of winice/ `# p9 K9 W5 c& z
    int     2Fh1 Y" f/ n% d, G8 o( q* ?: \
    mov     ax, es          ; ES:DI -&gt; VxD API entry point: ^/ L: r  B3 _& V. O1 Q. `1 G
    add     ax, di
) D4 B  f( |- }- \, S    test    ax,ax4 S% P' X9 b! D7 O2 M/ a3 y& u
    jnz     SoftICE_Detected
1 [9 l7 e$ G6 q: E
6 U+ d% T; R0 Q___________________________________________________________________________
( T  @( ]4 k. [& e  d% ]7 J2 P: s+ \2 M. ]1 G
Method 04
$ V* }4 l/ N% S1 I1 A  w' C=========3 @2 w5 `+ Y. }  |" |; B
4 S: t) |/ Z/ K7 C5 D
Method identical to the preceding one except that it seeks the ID of SoftICE
5 Q0 J2 T  ]* iGFX VxD.
: V) v( f- d0 h- W" @; o/ h7 [7 I, ?9 j: m9 x3 f
    xor     di,di0 l, b, ], P$ v* L' Q
    mov     es,di, a$ p' k$ n6 M8 M# ~; l
    mov     ax, 1684h       - H+ e/ K) K4 x' w  G
    mov     bx, 7a5Fh       ; VxD ID of SIWVID- g( ^4 @% t! }
    int     2fh8 r" b( M& q0 Z0 X
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
, L4 g8 r( ]2 P& K2 ?    add     ax, di
$ o4 _* n2 W& Z! h% z/ X6 N    test    ax,ax
* n( \9 p+ m6 U, u' Z# W: n    jnz     SoftICE_Detected
! r8 i( y: r  F5 ?, T
; T; |* _8 Z- i% Z3 O__________________________________________________________________________& C/ O3 ?7 ^: \5 T2 K+ M/ s
% H. u) x6 Q- D* p/ u! c% f  I* ^& F2 ]

9 e; R" O9 p" j" U/ DMethod 05; _& _9 w' l  h5 h5 Z5 i1 c( m
=========/ \3 F  I' N4 c1 [; x
# I: r7 Y$ @  R7 q  f% S
Method seeking the 'magic number' 0F386h returned (in ax) by all system
& y2 {' s' T8 \( ~; Udebugger. It calls the int 41h, function 4Fh.
: E3 T6 v) I7 ~1 O  Q  c  TThere are several alternatives.  % d- `  F- s8 }
: l. I7 ^, H" M$ Q/ i! N# t5 Q/ T" p
The following one is the simplest:
( {/ p+ m6 j5 M
; c+ R& n" N: y4 Z    mov     ax,4fh1 [% u- O  j+ U& ~4 T6 u
    int     41h1 J# |6 W4 Y' R. h) G
    cmp     ax, 0F3862 h1 }% }3 [' {9 ]& \! l5 _
    jz      SoftICE_detected
, ^4 S4 w5 H* O8 l* i1 \& t, |: f/ t" N' C# W' E( R+ W

. h( o  o( m) p- ANext method as well as the following one are 2 examples from Stone's : \' n& N9 ]' u
"stn-wid.zip" (www.cracking.net):
* }% @4 \' g( [# ^0 o( A$ l
) Q& N2 r9 Y# }, e    mov     bx, cs
) [6 u" T. U( l    lea     dx, int41handler2* U+ T1 J+ \" @: ~- v2 a
    xchg    dx, es:[41h*4]7 I+ _8 F, {; V; z  [# e
    xchg    bx, es:[41h*4+2]
0 S3 j( C8 h% e    mov     ax,4fh5 r$ @$ D  C( d  {
    int     41h1 v( r( {, u$ v, k/ ~4 H4 S* [+ D
    xchg    dx, es:[41h*4]
! O) X- Q6 M1 N9 @* U% Y. r4 [1 V    xchg    bx, es:[41h*4+2]
' B. z  _4 g/ z' `    cmp     ax, 0f386h
+ P& ^& }& I, l; _* v    jz      SoftICE_detected
& u1 w" Z0 E( N9 n* t
7 F6 {( W1 J7 |" @int41handler2 PROC: z1 |( j4 j) V4 g
    iret$ a% B* d- n; T
int41handler2 ENDP
. j# N0 t: c* D1 D7 |# ]. u' n. V1 Q
0 j2 F8 y, G" E/ G+ W# a* n- r% q
_________________________________________________________________________
" a3 u- Y( A' M8 v" M/ ?
+ `( y* ?# v+ y# Q, j4 R
: L( x9 z* b* t# [* H, b5 D$ uMethod 06. q, B( q4 C5 q& G1 z
=========
. u  j) l7 ]0 p2 ]- [# O8 F) Q$ R! ^! W2 O' ?, m
5 u) l. h/ f3 w7 p
2nd method similar to the preceding one but more difficult to detect:
. k5 F9 ?: Z. l! q; w  z, O
; G8 b; l& Q9 A! V, p) |) I2 ]- ^3 ?) Y4 Y/ e$ e2 Y( r7 A
int41handler PROC
& p3 L& i4 D& y+ ~, _% m    mov     cl,al
! O; U9 n" |% z* \: s3 |    iret; ]5 E; X  D6 T
int41handler ENDP2 U$ x# Z2 ^7 \/ y; [
; y  Z  Z% T. v# w, W4 r: p

3 L# K1 g/ r+ X- U, j    xor     ax,ax
- H: o$ O+ J! N" x5 r2 _    mov     es,ax
' C" u6 p: L1 d; D& d& r    mov     bx, cs3 b# D. _/ ]9 k" C1 A/ |
    lea     dx, int41handler0 @" Z+ e% {- Q$ X
    xchg    dx, es:[41h*4]
( l; g! J+ z7 K1 e; [$ \    xchg    bx, es:[41h*4+2]
5 _9 a9 n$ W! B3 M; F    in      al, 40h
! K- j: D5 t1 \, E2 d    xor     cx,cx
) p& r* V- p: a    int     41h, c- N- L1 U$ v  i  [
    xchg    dx, es:[41h*4]: n0 O3 R' s6 u2 ~
    xchg    bx, es:[41h*4+2]9 J! m& T) a. _5 p+ c8 r7 p
    cmp     cl,al6 W( b" P  L" c$ S* \6 I0 b$ x! K
    jnz     SoftICE_detected. R! d- E0 t" U' q$ ?4 u4 m

; Y+ `! X# i6 {# n: g" n3 Y0 Y  E9 W_________________________________________________________________________
2 ]/ @" d% t9 f  t" Q: @
; d7 B! Z( J* Q  W3 D% JMethod 07
  w  z2 e/ e( U' @$ X1 P: z$ Y8 P=========' G, G9 U5 G: f. m. |6 o' ]
4 P. S; C7 {+ R; C2 t
Method of detection of the WinICE handler in the int68h (V86)' {: h  A" _/ O& G8 D6 q/ l- T

9 P+ Q* h& q; j6 E4 x    mov     ah,43h" ^9 h. m* I2 z; D, l
    int     68h
" J4 T2 k; g. y7 i' e    cmp     ax,0F386h; g, S% G& i% h
    jz      SoftICE_Detected
/ @, X- U. i4 a
+ G4 t- K( t9 g+ c3 ]
7 {/ u2 l: N& g7 n=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit3 v8 R( N) m5 Q& u
   app like this:$ r* c# n: ~/ |; [! k2 G: Q! _
% x* p3 J  {4 X) ~( h8 e6 X1 h* I
   BPX exec_int if ax==68
; Q+ @; C* n, ^) u   (function called is located at byte ptr [ebp+1Dh] and client eip is
- c. d3 x$ R1 l9 w   located at [ebp+48h] for 32Bit apps)- S/ }% P  X; h7 ^  |
__________________________________________________________________________; l3 |1 \$ r; B8 f+ m/ ?
9 m) p2 y8 N( `! |

/ R; ?* X' y5 ]) t+ K" J/ V! EMethod 08& R9 s( D+ A/ ^1 ^& Z3 [
=========9 {# x* |1 b% q& u

7 c" J7 y/ @! `" ~4 _9 [It is not a method of detection of SoftICE but a possibility to crash the. [5 Y( B5 U* W& X  I; O8 @. [
system by intercepting int 01h and int 03h and redirecting them to another
2 \% p6 z: I! ~4 Y: N3 M2 {routine.
4 g1 M  P* W/ F* \It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
' z( I9 m6 u9 H9 @8 _: Hto the new routine to execute (hangs computer...)9 ^$ c+ ~9 U5 y* u7 U+ Z3 Z  C6 R! K

- }0 ~+ n2 S5 P0 I5 o0 u    mov     ah, 25h
& J# W0 d$ u: l+ P- g    mov     al, Int_Number (01h or 03h)# O, V: w0 n6 E+ Q; Q, _
    mov     dx, offset New_Int_Routine
+ ~: Z7 t0 L' J7 Y    int     21h
( c; o$ @1 }7 H% m
( w2 w' o+ M8 w__________________________________________________________________________* w1 K; a. v+ J9 @
, w) P% V" |8 S
Method 094 w+ o# W' ?9 `$ \( z
=========. ~/ C8 Q  D7 j

: l. A/ ?1 B" [- |This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
' R" ?2 p2 b* ?1 a) K1 fperformed in ring0 (VxD or a ring3 app using the VxdCall).0 v' V4 |7 T3 X9 V8 r) w: S& p$ F
The Get_DDB service is used to determine whether or not a VxD is installed5 Y6 q: c. [. G5 X7 q
for the specified device and returns a Device Description Block (in ecx) for* l# e! I, X5 q3 R" g8 z0 w/ e
that device if it is installed.: f' V5 y% X; a% `  e9 y7 P; v
. m" A2 ^# x! O4 G0 r+ ~+ ~6 |
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID5 \+ ]- ?9 \! {! B- ^% {
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)/ M& Y8 W$ c2 M' G7 O
   VMMCall Get_DDB
0 T( }! n4 A9 [% u/ l' i3 C# l/ C   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
& v( [# X% L3 X" y" X( w) L) f* r) ~; j9 G8 i& O& A! t+ d# n
Note as well that you can easily detect this method with SoftICE:3 G2 V' ]4 V' K7 c/ U
   bpx Get_DDB if ax==0202 || ax==7a5fh9 O- c! ^6 |" G. f$ U9 @
% U' L( ]. Y* m2 y: `  U! G' v
__________________________________________________________________________
/ r2 B) z" C1 u$ o6 ?7 e
: q6 O0 ]- C- K- ]& U$ U) LMethod 10
9 ~: }7 j7 _2 z& l$ V' H=========
& O+ S: h2 Y' X5 y9 m- p5 I' M1 E) j2 D  {, M  W
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
4 m& M% Y1 @' E' y5 w  m* H! g  SoftICE while the option is enable!!( F, K% _. F( c- ]1 z- S" p
5 g6 h4 d& C! k
This trick is very efficient:
7 L+ I  {% g2 [9 {% Z. vby checking the Debug Registers, you can detect if SoftICE is loaded
1 @! U% s" x  h(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
6 E6 q" y3 y% {& ^$ x  Fthere are some memory breakpoints set (dr0 to dr3) simply by reading their0 ~, m- W; i. N  Y: @8 S
value (in ring0 only). Values can be manipulated and or changed as well! u, B7 ~; z" v3 n* \1 E5 V. W4 g
(clearing BPMs for instance)
+ l4 X7 i" H2 ^1 |0 I/ I: C7 [5 D* _3 [% `6 c. W
__________________________________________________________________________
; M4 I. \% u7 k7 {' d8 x1 m% L. }) i. p1 F( u  i7 Z1 y, [) E/ _
Method 11
4 [8 s. E; ]! ~$ c7 |- Q9 ^+ F% l=========
0 A# ]  u8 b! T8 F, r" M* X
& F+ j, o8 e0 n8 T% H* DThis method is most known as 'MeltICE' because it has been freely distributed
+ _4 _3 N4 B* d. p4 D" ?) ^9 Xvia www.winfiles.com. However it was first used by NuMega people to allow: j2 _$ O0 p" Y$ A3 v
Symbol Loader to check if SoftICE was active or not (the code is located3 u: v' z; m# ~: |2 U# w7 k3 I! {
inside nmtrans.dll).8 x9 ?9 n. S2 d5 p. i4 x
% u; ~! p. V4 n2 @1 g
The way it works is very simple:2 \0 M' g4 V& c' f" V* f
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for1 t9 o$ Z! i8 b3 `, K: e' q
WinNT) with the CreateFileA API.3 y) L3 g, K8 }, q& ~
) n8 Y: K  W. f2 _: U! T* B+ n
Here is a sample (checking for 'SICE'):4 s& }' `3 G, Y$ U
/ w5 N1 |$ M; F5 B; [7 u, ^
BOOL IsSoftIce95Loaded()
8 e* L: s8 z; F; e3 t- q: _! a) b{
! b8 c. {' `0 E# ?   HANDLE hFile;  
* b- c  M/ f5 F   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
! L) ~! u0 l% j0 o* x                      FILE_SHARE_READ | FILE_SHARE_WRITE,
+ @3 H$ a, f0 y, m                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
. M7 [! {  n' L1 ?& V   if( hFile != INVALID_HANDLE_VALUE )
% J8 ?! [3 Z' L4 O: r- ]+ M   {, x/ q  s1 l8 z/ N6 K% V
      CloseHandle(hFile);& g, h2 T' B. R; i3 d
      return TRUE;
! o, S! p) a, d: `1 D   }& S8 E' y+ G0 [4 S- T- ^( y
   return FALSE;
5 _7 ^1 t7 h! j7 B5 ?}
3 S0 n! x5 e( l& D0 R0 @* _, l
( G2 h0 ]1 X- O( d6 d9 cAlthough this trick calls the CreateFileA function, don't even expect to be% T" z# v  {7 l4 D7 F. b
able to intercept it by installing a IFS hook: it will not work, no way!4 |+ A3 o4 G3 ^% {( T$ k
In fact, after the call to CreateFileA it will get through VWIN32 0x001F" T- U& [" c3 E1 W; l7 S
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
3 S! [) v6 T, P" e, dand then browse the DDB list until it find the VxD and its DDB_Control_Proc. ?4 Y2 ^3 l; r" _2 z/ C. _: ~# Q
field.& C. `9 A' Q5 O
In fact, its purpose is not to load/unload VxDs but only to send a 4 m7 q1 @! H4 ?% I6 g& M, C* d; O
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)' }. ]5 {! y7 Q$ B3 v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
! ]  x7 Q) m$ J+ P' H! P# Q- e0 I1 sto load/unload a non-dynamically loadable driver such as SoftICE ;-).7 ?- V0 C: q% M5 M5 g7 @4 {* Q
If the VxD is loaded, it will always clear eax and the Carry flag to allow" a" ~6 ]/ Q3 `6 p$ T
its handle to be opened and then, will be detected.* q* n# e9 }1 k+ [$ X0 k. ]9 N2 U0 p
You can check that simply by hooking Winice.exe control proc entry point
( C9 q* j; Z, I! N; [8 U# owhile running MeltICE.
6 V4 _  R0 {0 s/ A4 O& ^
- q8 {3 H8 _/ A7 m3 W: s, Y6 a3 {+ S. P! z& U* ~; X. F
  00401067:  push      00402025    ; \\.\SICE: a( r$ s3 O1 t& ^
  0040106C:  call      CreateFileA$ S* `) E* q8 C' k4 a. B3 A
  00401071:  cmp       eax,-001/ k0 [1 a! W/ O9 f+ |- W8 C% D
  00401074:  je        00401091: H: A8 M, f" Y& b# g7 ~7 @
6 g% O4 c' L+ `8 Y& Q  f
7 M7 q% \1 E  `# f' }/ B
There could be hundreds of BPX you could use to detect this trick.
- p: f' r) O- C/ O7 N6 j-The most classical one is:
4 `& s9 u: W( V; J( P9 O9 I$ t  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||5 D# x0 B' @7 A/ `2 S# J
    *(esp-&gt;4+4)=='NTIC'
& X+ x, O1 {' S  l+ G' e0 e% t
+ \# \% {  [; n0 O-The most exotic ones (could be very slooooow :-(% Q7 R* C* J4 M
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  , m  M* r9 y5 |9 s. s
     ;will break 3 times :-(
  w6 h. s  w: q. a3 U+ H
, N0 f( s4 g! z4 R: Q-or (a bit) faster:
+ P4 f* ^1 D( g   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
# l- ?0 g4 O; m  j# k% n! C
! x/ H& r: N' R8 q" k   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
/ R8 W8 t# M* A% l% \5 s+ y     ;will break 3 times :-(' w+ Z! y3 z6 c5 I3 j1 d: x
9 ?- k) H6 B* w( R
-Much faster:
+ x$ M; D- S6 v# \9 D  d   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
% v# V' U- D  w9 ?% V3 |0 c$ z2 v; N! ?- o
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen0 b6 A4 Z: h9 O: }- U$ E
function to do the same job:
% n% `- p5 @" z( v" b" N+ R; I7 w, z4 H' g* g" R6 G
   push    00                        ; OF_READ
' `: H: e/ F7 L   mov     eax,[00656634]            ; '\\.\SICE',0
- }; }9 U# j: y2 N# W) ^   push    eax, t2 {3 U. }% ^- x8 D' V- u. p
   call    KERNEL32!_lopen. B3 Y7 l* ~5 v9 x0 Z
   inc     eax* T- i' ?5 Q2 I3 x
   jnz     00650589                  ; detected
2 f) F; n/ g/ }  d& e7 M   push    00                        ; OF_READ/ j: p  L' I" q
   mov     eax,[00656638]            ; '\\.\SICE'
2 v1 f( ^- g) x. s" h( n   push    eax0 I7 ~- U9 u6 C, @5 X1 s
   call    KERNEL32!_lopen1 x. n' v/ {  @
   inc     eax
0 \5 N: |, N5 h5 N4 }, O   jz      006505ae                  ; not detected
0 ^4 f* d; j# _+ H6 ~3 i4 N7 x
; y$ V! r) T( X/ K4 d4 i
6 b  p4 S/ y$ g1 u+ {, Q" c5 N' Q__________________________________________________________________________+ Q, Y& j7 O, D9 `

( F$ S& q9 p) e& H. yMethod 12
' r  N4 I, o% R/ D. J; U=========) |, c. n; b9 J; \8 M
: R( D+ g" J8 a7 u8 p+ i: P( P& @
This trick is similar to int41h/4fh Debugger installation check (code 053 T- u# c$ ]) |- W6 F% y: o
&amp; 06) but very limited because it's only available for Win95/98 (not NT): \5 Q7 z2 x( d. ^( h9 @1 z
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 b8 r, u* x! K2 Y* w
" ~/ D3 ^$ P  [9 K
   push  0000004fh         ; function 4fh: C* b1 s! ]3 |
   push  002a002ah         ; high word specifies which VxD (VWIN32)1 ?" M# r+ Y; V" s# N
                           ; low word specifies which service* {( h* A* j% [0 u( S6 i
                             (VWIN32_Int41Dispatch)5 w* Z4 @3 K% h' @8 u) M' z
   call  Kernel32!ORD_001  ; VxdCall
7 R1 d* e- n) U) ~8 S   cmp   ax, 0f386h        ; magic number returned by system debuggers
" y3 }  Z) w6 n& t; A   jz    SoftICE_detected
3 B# M  ]  X  k1 Y; o( a
1 n) R5 {/ ?6 @: ZHere again, several ways to detect it:
4 B. [* Y! U. r6 P7 G
# X4 E) S; J9 m- _" H* z    BPINT 41 if ax==4f
3 o; @; f, X. z* w$ N3 Q
4 T/ K/ P) k7 m2 w* j0 H    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one
$ E) O6 X: o" |( `5 \% M; L$ X4 c/ u
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
/ I- X1 {+ B( r8 Q* i# _/ Y4 U% O: K
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!/ }5 _7 e/ A  e

+ A$ v# Z! m2 @7 _! |3 V. \__________________________________________________________________________/ C1 B+ D3 W" K( B5 ^0 U! f

) G4 X: j7 {+ G. X, n7 {Method 13
" f7 O0 j: R* I=========6 f0 a( N( @& e

( `+ t7 b/ b- h  C* CNot a real method of detection, but a good way to know if SoftICE is( n* S( d7 Y' b: a& m- g& N) x
installed on a computer and to locate its installation directory.
" o& Y4 e+ V2 M9 z, U8 x) SIt is used by few softs which access the following registry keys (usually #2) :
% s1 F( f0 L3 n( ~/ B. M
" ]- Z. E% V' \' U! c-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) X& T5 h0 x2 |* I9 U. G  w\Uninstall\SoftICE' h9 B; j: @+ L6 J  H
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
9 V- Q2 c* M3 s. |7 K-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion/ Z, _7 G+ I3 @* v/ T
\App Paths\Loader32.Exe
+ e( r" x; O& _2 o: {" f+ S
) ]) f& b. K- G* E  ~' v- r0 s  `; a* ~  u0 j" ~. o
Note that some nasty apps could then erase all files from SoftICE directory$ o0 R$ _6 p! T: F; m7 S; n
(I faced that once :-(" \$ I5 q0 E, ]/ a0 b

2 G, u, @1 L# SUseful breakpoint to detect it:6 O; O, D- l) B# u+ W
$ X" c- V/ z3 E$ X
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'0 Y* r/ m; ~4 }* J8 k
- Y7 O2 ^- y+ F' T
__________________________________________________________________________
; A$ d6 l7 `( q" x% i
" ~% I& L% H6 \( ?. `: v- Q% Y3 P3 p$ j. H, B# v
Method 14 : ?* s% q2 R- T0 o4 E: {
=========
* Y5 w5 r' Q: l8 c  L; w% J7 F* r) ~  h! @9 i6 a
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 G$ U8 E6 d2 I& I9 Eis to determines whether a debugger is running on your system (ring0 only).
7 Z( C- i+ k% u0 F% ]5 {- g$ L2 A( X% s7 G. X& V4 |
   VMMCall Test_Debug_Installed1 V+ z* ^" K6 `  D! H8 c. z8 f. Q
   je      not_installed
( k* X9 I- ?* \; z, M1 \: G- S# S  R- ?. \7 \
This service just checks a flag." h( r2 @! ]/ s5 K
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-15 14:26

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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