找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>- ]( r9 g% P' \- m; u- m
<TBODY>, P) |9 E4 N& m2 m  O
<TR>" \7 G# X+ A7 I, ~' n
<TD><PRE>Method 01 + a/ m: I& {% G% ]
=========8 ?1 K, F1 }( b9 p5 k6 Z! W3 ]
# H, o! k6 L# e' Q  z, W
This method of detection of SoftICE (as well as the following one) is
* h% P( [" `$ W  B( J& h# Yused by the majority of packers/encryptors found on Internet.5 p! O6 n5 L1 V  W( Y1 `  S' ]
It seeks the signature of BoundsChecker in SoftICE- S& U- L; X3 e/ V) V

' ~( o1 w  N( U    mov     ebp, 04243484Bh        ; 'BCHK'
! [0 j0 O0 H8 d$ n! Z; w5 y+ C    mov     ax, 04h
; o; h, ?6 Y2 r$ \1 N" g    int     3      
. x  Z$ A+ r/ C% Q) b    cmp     al,4
( n' R4 c' X. \* J    jnz     SoftICE_Detected
6 |: A3 h: R2 F
. c8 a9 m9 c. V- a5 A3 d___________________________________________________________________________) X# ?2 w9 L8 a$ H5 {9 @8 N

7 E# D% b. ^% O% m) v$ P) ?# OMethod 02- I: C/ T+ C. J  b: c  b
=========8 v- I  `2 m3 b

1 `2 I* l4 [3 f5 tStill a method very much used (perhaps the most frequent one).  It is used
# A9 {0 k* H8 Z4 h3 D/ H) `" Oto get SoftICE 'Back Door commands' which gives infos on Breakpoints,, |% |! g: T! S; x
or execute SoftICE commands...! r, F6 y' V# F# H7 F, y
It is also used to crash SoftICE and to force it to execute any commands9 r# Z- r$ v6 P5 J
(HBOOT...) :-((  
! a1 ^7 j( h; p% o/ J# U8 C; X9 C7 S: d
Here is a quick description:$ o/ k" y9 N  V* E3 l! J
-AX = 0910h   (Display string in SIce windows)
4 ~+ [3 X3 c1 \" w( V) e-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx), P# n/ G" C: i0 K1 P; r
-AX = 0912h   (Get breakpoint infos)
/ V+ X6 a$ @, ?* O% r7 \-AX = 0913h   (Set Sice breakpoints)
+ Y$ K+ U- e) z" M6 _" I-AX = 0914h   (Remove SIce breakoints)3 w( B" V7 i  k) s2 e/ `# T
6 v3 |3 d# p- _! f  U" l
Each time you'll meet this trick, you'll see:9 ]$ q5 Z, l0 E: Z+ I8 p, q" ^
-SI = 4647h. L8 z- L5 \) p; E
-DI = 4A4Dh$ C- Z) P5 F; `  C; U0 I+ b2 a
Which are the 'magic values' used by SoftIce.
8 y  D* y  o+ R) F4 @5 x. hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.; x  h* v& ^- Q  a: l9 u" |

. r5 h; b& n' N4 z& n) aHere is one example from the file "Haspinst.exe" which is the dongle HASP+ h! ?9 B# V" i+ q' z3 C  v
Envelope utility use to protect DOS applications:
  M5 T% b% y: a8 h1 ]* ]1 V
. r' ?' F" u/ B0 c% H/ O' Y# Q# R
4C19:0095   MOV    AX,0911  ; execute command.* M% p9 x7 i9 F, u" v' K
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
/ n/ s$ j$ t' x5 e5 S: X4C19:009A   MOV    SI,4647  ; 1st magic value.) ]# z0 L6 a7 Z8 p' j
4C19:009D   MOV    DI,4A4D  ; 2nd magic value." C  M# k$ l( t
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*), _! T8 i, A7 s: a
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute; V  o- k7 q" L/ h( R
4C19:00A4   INC    CX3 U) K- y$ V% W( Y1 _) l- ?1 g
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute  z% e* u- k$ J! y: x
4C19:00A8   JB     0095     ; 6 different commands.+ T3 r% U! ^1 E8 g( E
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.  k9 K4 c( f1 B& m" Y* }
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)8 a% w/ g) T7 N8 Y# c  d

( q; _- N; e1 f1 lThe program will execute 6 different SIce commands located at ds:dx, which
! I; `- I6 X) K) `0 Q; p: I) Dare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
% T. ?" d8 z0 t7 v( }! M) S( t/ z) J1 P3 n
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.$ G. r. H8 h4 c: n+ v* O1 Q
___________________________________________________________________________
5 h# f2 {3 t, I# F" G; W. X0 O
' W6 @2 t; ~1 s! ^6 R" Y4 Z
2 U6 X1 ]; U  R$ x0 N# p& Y3 W* s! VMethod 03
- E8 ~5 z4 Q7 G6 e8 p" @=========
  {1 y1 u8 b$ J$ `" f3 S) @7 u; o3 p, n# x- `/ ]
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h  j; I1 |$ Q% U, D6 K) q3 s
(API Get entry point)
" v* ~8 M# s3 ^$ Y1 \        ; l8 O$ l9 a4 {' q, F5 F: K
1 S; a9 `4 e" Y- _, _2 s8 p
    xor     di,di0 [9 }$ Z8 Q. i2 ]3 C4 t
    mov     es,di
' e2 q/ R! J4 z; F# i    mov     ax, 1684h      
. A2 k) }- r1 C" _* a( Q7 q) x. m    mov     bx, 0202h       ; VxD ID of winice7 p" D; y9 \$ ?, b
    int     2Fh
# m5 u& ^8 n- s$ Z    mov     ax, es          ; ES:DI -&gt; VxD API entry point! p4 L( T- v4 Z0 B4 b9 X" F
    add     ax, di. i& H0 ]! X$ b
    test    ax,ax
. V4 W* J# N3 x* B# F    jnz     SoftICE_Detected$ U5 s! Q) E( t8 u% b/ m4 t, |
" a* Z: B0 h, n8 \: a
___________________________________________________________________________
8 m5 R; @9 T- A& R0 L$ k! Z6 }. V5 Z1 a7 D% s
Method 04
# V# N" H" B% X: W: C. q=========: |5 M  U- G- `3 J3 e
1 y5 b: U$ _6 R; Y
Method identical to the preceding one except that it seeks the ID of SoftICE
" G* F$ r7 C4 k& d8 X$ GGFX VxD./ G6 R% H/ t3 i3 n9 V
. o" ^3 z- O7 w! }, h
    xor     di,di0 Y/ b3 |# t9 J1 u- x
    mov     es,di5 r# x; I* A+ I7 @* a+ L& E& P3 v
    mov     ax, 1684h       " ?7 U: L1 j8 ^) S; A
    mov     bx, 7a5Fh       ; VxD ID of SIWVID, r: Q. D7 e$ G/ K7 P/ |5 |) U
    int     2fh
* P  _' `9 I5 |" _    mov     ax, es          ; ES:DI -&gt; VxD API entry point' M' r) k+ {2 O3 g& i( q
    add     ax, di
$ E  x7 a0 M! c; ?7 ^* H    test    ax,ax
4 D, p' R/ I9 a! _/ U: N( k    jnz     SoftICE_Detected
; p6 v& b2 y% T6 K9 e: h9 Z, v. x7 Y' [  A) _% I
__________________________________________________________________________
; C2 ?& N6 t- O
0 s- g5 L4 }. x" ?( c# ?
3 ^# n9 k- Q% s# V9 Q- UMethod 05; u1 c+ }6 F; Y& m3 _4 h/ v
=========
2 R  h4 {# h( T; a
% B8 ]+ [7 l: \; GMethod seeking the 'magic number' 0F386h returned (in ax) by all system
) V3 |- u9 i1 |/ ~8 `' udebugger. It calls the int 41h, function 4Fh.: I# [& j; m) y8 q
There are several alternatives.  
/ J, Z7 ?4 }4 b, m4 t5 X$ e4 H
The following one is the simplest:
* o3 \; Y4 W/ a5 s5 W& o6 K: N4 a5 k6 l; m1 o, b. R$ m6 M: V
    mov     ax,4fh$ I/ Z- d* c! H5 Q
    int     41h- d/ `, u% H& F2 I" S+ T8 n6 `' J. U
    cmp     ax, 0F386
% C3 C. J. |% i; j    jz      SoftICE_detected
, o# D' R) Y4 g) L1 e4 f9 n8 k, J* t1 s2 M' b3 e
# n$ A- D. E' x: u" @$ a
Next method as well as the following one are 2 examples from Stone's 7 ^' ~6 p# Q- O- ~
"stn-wid.zip" (www.cracking.net):
0 F, R8 z5 F9 q0 Y2 u  B9 _3 ~) K. ]/ l' `  |2 o8 R$ c+ M- u
    mov     bx, cs
, O9 \. s$ X- p# J5 z1 V4 C9 I6 o2 h    lea     dx, int41handler2% e& f; `. K/ I; ]. W+ c7 u8 M
    xchg    dx, es:[41h*4]3 \1 m2 w/ |" m' J4 X% ^
    xchg    bx, es:[41h*4+2]
, g' v3 M, _+ e8 y# i5 u7 S' j    mov     ax,4fh- a8 k1 x+ Y  B% }
    int     41h( v) r' |5 v3 B
    xchg    dx, es:[41h*4]2 i# q. W6 e# r9 a* W  N
    xchg    bx, es:[41h*4+2]
8 G# U! k! E1 S2 _3 n- [    cmp     ax, 0f386h
9 [/ m+ X! D% a, p& _6 A* O    jz      SoftICE_detected
. k, n& V( E/ X* J7 ^; P/ Y' q1 H* E" X0 D
int41handler2 PROC
  S4 L, m4 G7 f2 y6 `! m! n    iret0 k5 n; b" s3 c7 H1 D6 J
int41handler2 ENDP
- p8 h, O0 K9 i6 }3 y2 g% j; b0 F- C3 I& X% K: z

; O# j8 T5 k* Q/ A0 c! d) {_________________________________________________________________________
- I" Q# i" A: p, A6 j) z* |1 Z! t! t4 p; J' M2 d' g8 }- G+ D( r

; w. Q. |' y0 I2 |) TMethod 06  m0 @7 H2 R: _. F, X3 h0 v' B
=========" X" W2 \8 l! M) e& ^, z
& b2 V: {, |* y0 p7 l" w
: j- j+ v: h- k6 E! J- F
2nd method similar to the preceding one but more difficult to detect:
& F6 m; S& P( b* @" Q' ]% j4 l/ j# ~! L. _/ u

' }9 n0 N* h5 B! Cint41handler PROC2 U4 z2 c7 _* I+ ~4 Q
    mov     cl,al7 A9 ^9 Y! D6 J
    iret- }5 L: {- `) U, |5 y  e" |  _
int41handler ENDP9 S0 g! P- {* M1 h

1 v$ \" O. p1 o, D# F  ~% m. y# m) O3 C  i0 H4 E$ f3 L' D9 Z/ |
    xor     ax,ax0 n5 D& [" ]( `
    mov     es,ax
, A  k  _8 s4 H+ Z. }    mov     bx, cs
( t' k7 {2 A3 M$ q8 i1 M! Y    lea     dx, int41handler+ I6 f- y& i/ }
    xchg    dx, es:[41h*4]% j. c: y; o( r5 t  i! F
    xchg    bx, es:[41h*4+2]3 G0 [3 ]' d+ v! c" x
    in      al, 40h
0 g) L/ J1 E1 F& V: I    xor     cx,cx
  p6 k$ \( _: d( v6 A; u    int     41h* `: |* {9 E2 i: L, q  v6 g. Z
    xchg    dx, es:[41h*4]
" T# m4 a5 C5 V  {- X    xchg    bx, es:[41h*4+2]
3 K* z# l! |% y: N+ k- d8 C    cmp     cl,al; p3 j) h$ Q7 [" h" t/ l- R( _
    jnz     SoftICE_detected. n" ]* ?* k. m" ]

" b$ g4 M- h$ p, C# N_________________________________________________________________________! _; H! b; r4 r, H% H# \5 {

' m0 T. W, a- b5 N: \Method 07' Q( v) U- l# C" x& D; l
=========' ?  s0 |, n6 {5 |

" Q2 _, ]1 U4 ?  }8 p5 r. W' CMethod of detection of the WinICE handler in the int68h (V86)
, K! i6 t1 Q! r# M/ P0 w' o9 ?1 L2 B' D" K. z9 X# Q% R/ o
    mov     ah,43h, T& I* j' g' R( L" H* l
    int     68h
+ x8 h* }! r- M    cmp     ax,0F386h$ l! L3 ?3 T0 Y7 a+ V  K4 v
    jz      SoftICE_Detected
" D: _; `/ H1 X' k. \# l0 p: D) n

: ]3 |& {  j' f  N5 s! y=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit- z1 R( n% I& r$ d/ y( n8 o- b
   app like this:, W% i& P; X. S2 i: A5 `% J
, H) k' r4 J' c& ~
   BPX exec_int if ax==68
+ ^* ^' Q$ q; r3 `0 m6 K   (function called is located at byte ptr [ebp+1Dh] and client eip is) J0 S  Q' n/ }( N6 s
   located at [ebp+48h] for 32Bit apps)
6 }0 ^' ^. T2 {( ^__________________________________________________________________________; Q/ `8 k- J5 Y# K
4 F& T/ t/ e8 L7 a7 w

! w- N5 w0 _( L2 ?Method 08% U4 x9 R* u( V- v: E) b
=========0 I: X& d1 ~# z2 q7 H0 V. H/ ?7 P
9 ]/ w4 g+ z6 _$ @! M/ E0 `
It is not a method of detection of SoftICE but a possibility to crash the. ]$ y6 `  U: S( [
system by intercepting int 01h and int 03h and redirecting them to another
% J( W4 A' Y( ~2 i, J7 Froutine.: J0 }& f" k3 v( U+ l
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points! f. b: ?& m0 K
to the new routine to execute (hangs computer...)
: i# l) {& ~1 c: B% S  z) ^3 T6 f6 B% r
    mov     ah, 25h
% K. J: W9 P. c5 K0 n+ F    mov     al, Int_Number (01h or 03h)
+ ^. u7 E! ]' o; ~    mov     dx, offset New_Int_Routine
) _- U- j4 `( J/ r$ n, p    int     21h
: o2 _9 U& m/ D7 D( H: X
  [% B: M) x  S% o8 q, ^, S__________________________________________________________________________6 [4 @/ w" }- K4 v  D' E

: [2 h5 d+ N9 E; {' [0 M% Y2 y8 h5 eMethod 09
3 x5 T# E8 \" m=========8 `6 J2 P4 b" L/ h8 d3 l

6 z- d* J* [$ t; J; y8 @" d) CThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
3 A& a5 n3 t' r( \performed in ring0 (VxD or a ring3 app using the VxdCall).
' |0 T: _4 p) EThe Get_DDB service is used to determine whether or not a VxD is installed2 G9 O, C8 R4 r  c" Z$ `& Q" i
for the specified device and returns a Device Description Block (in ecx) for/ d4 N& t, m4 o9 d4 I
that device if it is installed., d+ O% o- U4 J; J7 w" F1 A( H" x
: c3 s  h; L" `: K6 t4 `
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
, a7 X4 M9 t, U6 K% R1 F, p   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)
. J& z1 ?! I, ?% _7 ~   VMMCall Get_DDB! @+ C- `! o. ]0 O  A5 b
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
9 f1 r$ D" e! p# W) s- Z) A: U
* w! u4 g0 U7 @9 H) YNote as well that you can easily detect this method with SoftICE:) a0 t! w% r1 D9 Q
   bpx Get_DDB if ax==0202 || ax==7a5fh
  q1 G. u) [+ z+ ^+ ]. {+ A4 r* r* I, |3 |
__________________________________________________________________________
& n6 \5 t2 p" w" J+ L& ^
" h  S3 n  o  p' EMethod 10' G- `; }% o+ ]: K
=========
4 i) c* i7 d) s# C6 Q2 {! B6 G# @& `  K4 |! _
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
2 ?) J% W, D6 j- T) p  SoftICE while the option is enable!!
6 u( v" X5 g3 U" g) g9 Q. e  L* [0 l" W+ b- M( n
This trick is very efficient:
- t  @. i4 h* f0 Iby checking the Debug Registers, you can detect if SoftICE is loaded
, i# N/ X( \. b/ L3 f/ L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
1 p8 w/ u0 w/ N* I. Q, s( Wthere are some memory breakpoints set (dr0 to dr3) simply by reading their
* B  V0 B/ _* }% E  S: Xvalue (in ring0 only). Values can be manipulated and or changed as well4 L) |" E: Z, e! O/ A4 F) _  T
(clearing BPMs for instance)0 V/ T" |& k5 R3 h. k  i4 C/ ?% w! X

# V5 p+ ?5 s3 i! g( ]2 S3 |4 V; d__________________________________________________________________________9 o! z! D. Z; B; J& J  q8 C( [  X

' `8 J* P) B8 J" qMethod 11
" z0 A  ]0 I. }9 s: ~9 F/ K=========
+ X4 f" V& J# @" P9 i$ a% i: K' D) K( j
This method is most known as 'MeltICE' because it has been freely distributed
4 `3 ~0 X7 ], N5 [via www.winfiles.com. However it was first used by NuMega people to allow2 C5 b2 K6 i8 G6 {
Symbol Loader to check if SoftICE was active or not (the code is located( D) d) G) j! T8 \
inside nmtrans.dll).; V, A6 h. |6 G3 K2 B9 D: [
& Q- @% z  T) X7 n: [
The way it works is very simple:
4 I2 j8 N- S8 u( i# g0 G  ~It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for& u" @- h+ f" y$ |! r
WinNT) with the CreateFileA API.
0 C$ s  q2 X; _9 `5 Z
% d& G# y9 x2 gHere is a sample (checking for 'SICE'):8 G1 z9 x; V" R6 w+ z2 }
& C  o2 _0 X5 V" ?9 U
BOOL IsSoftIce95Loaded()
  [6 m; @% a7 y7 q{
. D; {# Q# D* ~1 z7 k9 }5 d   HANDLE hFile;  ( u+ G: p8 }! B) U2 o1 M+ [* y$ O
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,9 A7 O- i9 k% z( o4 {: g- A5 s/ {
                      FILE_SHARE_READ | FILE_SHARE_WRITE,' s! J3 W+ n% J7 `
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);+ n& f. z( l9 \2 ?/ r: A7 U
   if( hFile != INVALID_HANDLE_VALUE ): i. k, x7 Z+ U" G
   {
- c* `% H4 d6 j" Z      CloseHandle(hFile);
3 ~" w% W/ V4 Y/ }4 S6 M; f      return TRUE;
4 z4 G+ \) g/ G. v# _   }
; Y4 i( m8 J; k3 S) G   return FALSE;6 u8 R6 e0 W) G$ x* H6 ]3 |5 m
}
$ O$ H+ N5 o2 U. y  \$ B" F2 W5 ~$ U/ `; y
Although this trick calls the CreateFileA function, don't even expect to be/ G2 _6 f8 V* D% R- Y( }5 H
able to intercept it by installing a IFS hook: it will not work, no way!
$ e' o" R. F+ F3 S; CIn fact, after the call to CreateFileA it will get through VWIN32 0x001F* e$ K1 I" c: m& h0 \/ j1 X9 ]" r6 ?
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! x& w5 Q1 |- V# C3 {& kand then browse the DDB list until it find the VxD and its DDB_Control_Proc. T( J1 C2 m+ J# j% P$ Z$ K
field.
" s8 R4 x4 ^7 g" _In fact, its purpose is not to load/unload VxDs but only to send a $ F% s( J' [; `# R/ n) l' a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE); Z% ^$ ~. l0 i: w6 t
to the VxD Control_Dispatch proc (how the hell a shareware soft could try% y) O) N1 L) w# x" G, R
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ w# }. f1 j: c3 |6 N' c( e
If the VxD is loaded, it will always clear eax and the Carry flag to allow$ ^, B: R- S+ y
its handle to be opened and then, will be detected.  J) R  ]; k6 @& f1 {& B3 F
You can check that simply by hooking Winice.exe control proc entry point
; e* Z$ C  V, ?while running MeltICE.
* d% |; ^* Y6 j$ |$ v  C) C- a8 j" Y

0 g; N2 x8 s) w( [7 S7 C+ H  00401067:  push      00402025    ; \\.\SICE
% n" {( m: M0 z7 G5 h) G  0040106C:  call      CreateFileA" q7 H/ S+ e) a: \" P8 Q4 g
  00401071:  cmp       eax,-001
) H. i! ]' H1 T: u  00401074:  je        00401091; ^; q+ P7 c; j) w9 e5 B1 h& v
: y- x1 e& a- m9 {# A1 Y( ]
8 o6 ], Y" s) i# p, i
There could be hundreds of BPX you could use to detect this trick.
, f6 c, |, w$ l. f' f  h- @-The most classical one is:
8 s" r/ n( B0 z6 z; A) q  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
8 ~. [" C2 `) l    *(esp-&gt;4+4)=='NTIC'6 }2 B3 O* J: d
1 }" p' }4 a: E0 _1 u' F
-The most exotic ones (could be very slooooow :-(" ]6 l( K9 L- `2 n" c" ]
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
1 Q2 w5 K# Z+ J7 k* v7 I     ;will break 3 times :-(
" p  R# N/ F- }9 z# B8 M. e
. |; G) A0 [9 s-or (a bit) faster: 4 \$ B/ Y' g- ~
   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'); J. [* p9 K/ F8 O" s0 u

; F4 c/ n/ D; E: j: @' X   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
2 ^# X1 w! b8 K2 C     ;will break 3 times :-(2 H6 |8 v7 T6 I; e

+ J- {8 z- G. j* x/ q/ a-Much faster:4 U" D( w2 [4 N- m# j
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'" q  ?+ T& v. p- E

: {, r$ U: e9 E1 u* r9 ANote also that some programs (like AZPR3.00) use de old 16-bit _lopen
+ |' |' ]- A( l' Mfunction to do the same job:
0 Y& U3 Z" ]. x' J9 i
# w8 L  N& _* k( R! M   push    00                        ; OF_READ- g. P' e% G: Q) T4 [- n; \/ \
   mov     eax,[00656634]            ; '\\.\SICE',0
/ C7 O% Q5 ?3 k; X$ ~   push    eax$ }4 b/ j7 p% F. {4 h
   call    KERNEL32!_lopen* d! ?) M' Q. o& E% S3 Q4 u
   inc     eax* W* }& S" n4 f( }
   jnz     00650589                  ; detected1 O# B9 d/ I4 x6 g% h& J2 F, z
   push    00                        ; OF_READ
0 a, H# G4 |7 V! @) E9 a2 t   mov     eax,[00656638]            ; '\\.\SICE'5 `( h& g0 M- e. a" G
   push    eax
. ~( I: g' k& N6 y$ I   call    KERNEL32!_lopen8 A& O4 k1 c% g- x$ L& b  _
   inc     eax
) i2 @+ N. d9 s, K% F7 p   jz      006505ae                  ; not detected1 \) e+ y4 a2 C% O- M' M0 U+ y& c+ e4 I

8 B  F7 @% B0 h* K6 D; ^; X8 U4 A
' R/ j8 w( S3 ~' g% o5 T__________________________________________________________________________( I; A9 j8 \! x* [6 w$ q  @
( k8 U5 q, h5 e
Method 12- H  e7 H  [5 t' X& e( Y
=========, B# r0 w6 q  T  _* k' C
! z! i' N( ]8 v" U; d9 s
This trick is similar to int41h/4fh Debugger installation check (code 05
" I+ s, G* k  z* p&amp; 06) but very limited because it's only available for Win95/98 (not NT)
4 b; m1 R0 O/ }+ w5 u. Z+ Eas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
' C' x+ s1 l2 V" r3 k
( }( P. c; L) R7 _2 w/ I   push  0000004fh         ; function 4fh
- E7 j2 e/ K4 Q% d   push  002a002ah         ; high word specifies which VxD (VWIN32)3 `3 B# x$ C/ v' ~$ E
                           ; low word specifies which service0 j" W  {; y- n4 Q) w8 k% O
                             (VWIN32_Int41Dispatch)
0 X6 V$ q1 _1 o   call  Kernel32!ORD_001  ; VxdCall5 Z. x: l& N3 w% @8 x$ ~
   cmp   ax, 0f386h        ; magic number returned by system debuggers
% \" w( b- x; r, p- ~" n   jz    SoftICE_detected% ]3 T0 _( R; A: j: z( [3 Z

0 {+ n+ D- \3 v9 G) ~Here again, several ways to detect it:
2 E3 F( Q8 r4 L3 u- a9 F
) R  T, E8 [" S  G5 L* U    BPINT 41 if ax==4f9 r4 y  D: X) T# B" E

# W( t" X) ~) @3 e5 s2 R    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one2 U6 E1 s7 O- m. o) p, l. P- S
9 ~4 ?! t$ h( O
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A; ^( t  I* [) y. k8 v3 o% B

+ E+ ^( D, D0 K' @" `    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
/ E) V  O6 a, M( |1 \% t$ B2 m- J+ O' k* J" a
__________________________________________________________________________
9 {$ b$ X6 G+ C% d) s! v* h
7 J# K! W0 `( ?+ L/ ?Method 13; @% h! i* ?2 Q  k1 p
=========1 P7 F4 l2 s7 _( r  o7 w
# H9 b1 I( z' K  c) m5 a
Not a real method of detection, but a good way to know if SoftICE is+ X+ L0 ]; l) v( k" r
installed on a computer and to locate its installation directory.
' Q* r; b  k8 x( [It is used by few softs which access the following registry keys (usually #2) :
% r0 Q  C% {$ D; N# `4 S2 @5 E
: Z; a+ P- O" s! H0 _: u  l-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
& b) B& k5 Q/ Z0 y\Uninstall\SoftICE
3 h9 U/ g' W0 g, r-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE( x2 |; ]& k; |/ v
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  W) q: s& ]$ x\App Paths\Loader32.Exe$ {' g0 R+ x2 X$ g# S

7 [3 c# y3 _/ p/ l3 e' V  a% ^8 c' b3 r5 {
Note that some nasty apps could then erase all files from SoftICE directory4 n2 P$ ?* x- G7 K8 P! D2 m" V
(I faced that once :-(: n& O1 T# }9 I* W% @3 F
7 {7 v9 f. ]: L5 r) E4 q. ]* M
Useful breakpoint to detect it:7 N& z& K8 n/ y4 U7 y! e9 W. A
1 v- R$ _$ r  |0 q1 ]7 [  x% v& v
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE', w' [( e* p! L$ L4 m/ n

9 y# ?$ b  W& z/ H# d. X* u' Q5 g__________________________________________________________________________, T& B4 f9 m3 q1 ?/ s. A& z5 N

- M/ S8 W- i5 p8 r: \5 ~+ Q8 ?' |) F9 E9 d1 H1 s# P4 {9 s( o. r; j6 i
Method 14 " Y! M! ~3 `/ O, `2 U
=========- J9 D$ Y" }5 t# g0 _' S. u7 O$ f
) p/ A; P& t3 h+ S9 D
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose' C: H+ P" v# d: }+ R
is to determines whether a debugger is running on your system (ring0 only).
; f1 ^" K; ?4 ^; b
' j3 D; Y" u3 s+ t4 V( h% O   VMMCall Test_Debug_Installed
6 `: [4 Q, S( g" o; N3 E2 b   je      not_installed8 B* p$ |) |! p

9 Y8 b( {0 ^3 ?5 |. n! y1 t$ kThis service just checks a flag.# u7 [: X/ x' r
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-19 11:29

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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