找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
; |4 A: H$ R( V; V6 ]<TBODY>& ^3 y) Z7 |/ K! g2 u) M
<TR>
1 D8 W# E( V+ @* E! \<TD><PRE>Method 01 8 M: C) S& |$ ?6 y
=========9 U  O- s8 U4 I  o$ ?
7 v) L$ E/ }: T7 Z% @$ X! L
This method of detection of SoftICE (as well as the following one) is* _$ W) N: p4 H( A, E9 J( K
used by the majority of packers/encryptors found on Internet.# J  t$ m# |1 y, t0 Q* `
It seeks the signature of BoundsChecker in SoftICE
: R/ m2 F1 f3 V4 k
  M* t1 a. `7 Z  M+ p    mov     ebp, 04243484Bh        ; 'BCHK'/ O5 f3 r" P8 O+ b
    mov     ax, 04h
/ ~4 U8 w. c5 R    int     3      
* G" j& i6 B+ q1 P    cmp     al,4
& l: T, i, L7 ]7 m6 I0 F9 f    jnz     SoftICE_Detected
: k8 L. m; P) }4 |3 B1 a1 Z# z. p4 e6 {+ @7 S3 i
___________________________________________________________________________) d7 V' J7 X" j% A& o: O, d- A

, [% {& A% b$ x4 L3 `3 R+ rMethod 020 y% r/ B+ L) d2 R, {% O
=========
% _: L# W- u  n& U# t0 ~; N1 _% g
Still a method very much used (perhaps the most frequent one).  It is used) p) S  g, q; N8 N
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,$ M0 j6 w) a/ |, x; f: w% u
or execute SoftICE commands...
( g& @! w# L! c6 iIt is also used to crash SoftICE and to force it to execute any commands
( e! i' Y) m) D, K7 R(HBOOT...) :-((  
$ p$ {6 t, j! `4 g
; L7 h* s# E( ?- `* @6 @Here is a quick description:
& p  h+ h' x/ E( {3 r3 V2 r8 u-AX = 0910h   (Display string in SIce windows), E1 l) D2 N% P2 Z; D) K7 T
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)! S( b. ^* d" Z# b/ G' o
-AX = 0912h   (Get breakpoint infos)- n5 g/ z( Y) R/ R5 P3 v* V
-AX = 0913h   (Set Sice breakpoints)( o( ]$ W! S2 j4 J* m6 r2 h* S
-AX = 0914h   (Remove SIce breakoints)
" F( ~/ B: p* ?0 ^6 T3 o
2 `$ X" P2 |" ^( fEach time you'll meet this trick, you'll see:
! z0 T' U' i. p7 e/ ]-SI = 4647h6 [2 x) `8 I+ T
-DI = 4A4Dh6 h+ u( z1 r/ s+ S9 O7 q, P
Which are the 'magic values' used by SoftIce.
4 G0 M* t5 p! a  r* d2 GFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 F+ k9 p' A# H. n: k2 N4 C
+ p; L0 U9 Z& ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP
- ]& W9 f7 X. Q5 g/ vEnvelope utility use to protect DOS applications:
5 v+ W1 {6 y# H
+ S- \; P. Z. `8 W( N6 r) v, h6 O5 C
4C19:0095   MOV    AX,0911  ; execute command.
9 z( @* N/ \. F. s8 I9 [4 a4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
, ^' l9 D1 v( f2 |& g6 ~4 r3 T7 X4C19:009A   MOV    SI,4647  ; 1st magic value.
1 o$ R2 d6 t& P+ A6 ]4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
" k2 J$ ?. }( j& n4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)( a3 x1 w1 b$ B$ ?" f! E$ ~" T9 ^
4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
! B. z% s; y* ?4C19:00A4   INC    CX
" z+ J8 D! }; x" V, k$ O9 C4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute# q' v2 i7 Y8 P+ p) q
4C19:00A8   JB     0095     ; 6 different commands.8 N* q7 y' ^3 n* \: u7 k& l, c5 O
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
5 a  \4 a9 l& j/ ?4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)/ G- b7 B! g! |) E" E. L5 f

% e! P+ k( s, b0 iThe program will execute 6 different SIce commands located at ds:dx, which
8 |" V( h' S- rare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ \9 m- v) w( k( ]# t4 v& D4 F

! _" k6 @0 c5 |* T) T" V* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
" A% {6 A- O0 Y! u) r" M___________________________________________________________________________9 y& I2 h, \' h( x4 n: b
* j# D2 x  f: \, s
8 w* K! {3 E" _) a+ w
Method 03
* d$ u4 o. R: p8 G=========* J1 @  e$ q  \+ U. E( \
( f3 r- r: b! O
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h5 t* E2 ], [- c# J+ X7 n' z; \) t
(API Get entry point)" Z8 b# _" X/ D5 [% c( d5 y( S1 ?5 F
        
+ M8 @$ C) `9 v( ~4 Y# [
. }7 e9 P0 f* w& @/ m4 Y  e    xor     di,di) q  Q2 D( |' E6 M2 k- e  f3 T, P
    mov     es,di. d! x) I8 i' `% Z, K* D
    mov     ax, 1684h      
  E. X* p$ H/ [    mov     bx, 0202h       ; VxD ID of winice
, a8 w/ ^" N) x- w0 g4 m    int     2Fh! j$ j* `' t1 R( ?; g
    mov     ax, es          ; ES:DI -&gt; VxD API entry point* ~% ~5 M3 a+ {  ^* g' B- s
    add     ax, di0 Z) _6 a) u) t/ Y& i6 W  C& [2 H
    test    ax,ax) J! z5 U$ h. T2 h4 f2 G. d3 `5 @
    jnz     SoftICE_Detected
% s1 s+ b6 E$ |" p. ~9 [6 p" V  d* e, U) Z& H8 B- W" q  ^( Y
___________________________________________________________________________
" G* ?" {+ _) Q* l
, ~. N0 d$ p5 ^3 ~9 s6 K8 H. M+ VMethod 04
4 o7 \: j. j6 a=========
6 j5 g& o0 D' c  T' @" O5 {  h6 K2 q) |, n9 g; t7 C
Method identical to the preceding one except that it seeks the ID of SoftICE
/ j! d1 u0 ~8 n4 h( AGFX VxD.
3 F1 `  ~& `5 i+ }( u
8 @! n  b: b+ \    xor     di,di
1 i2 N6 k: x0 z, ~5 j! T) Z+ ~- W8 }    mov     es,di: M8 E- O5 [1 z3 R# G5 G& _
    mov     ax, 1684h      
9 `% q' o  q# D; M; b8 G    mov     bx, 7a5Fh       ; VxD ID of SIWVID
, ]8 P) Z+ P2 V) S# F- k* w, Y8 ]! L    int     2fh
5 o3 u; B1 o1 l) n; u    mov     ax, es          ; ES:DI -&gt; VxD API entry point+ E5 a8 p/ ~( W, O$ |' E7 H
    add     ax, di
9 d4 C; d1 h& H8 h: w/ ~" n* H    test    ax,ax
$ [; K. G0 K+ ~! F4 h    jnz     SoftICE_Detected. F: ~9 h+ N1 J2 ?

9 M6 R7 e9 g8 O$ [' E  F* o__________________________________________________________________________1 r2 S6 E* K# G5 r0 Z- u! K9 o

. f: z+ C1 y' B+ L
) D  i, X: u" ~Method 059 V) E( K8 A+ m, [
=========
" B4 J" I9 Y  Y+ j: t9 z, S$ K+ ^1 u8 u: q! m: n7 N3 B0 ~  E
Method seeking the 'magic number' 0F386h returned (in ax) by all system, M1 E; |3 {; c: N, k
debugger. It calls the int 41h, function 4Fh./ l' R$ g: W0 F7 X  f: d
There are several alternatives.  - `7 E( \# w8 n" a  S; X6 D8 X: [

1 D: q) v: ~5 hThe following one is the simplest:9 d& S6 y$ w+ I/ N! S- t

6 D0 S, U9 R7 B* Y1 B  a    mov     ax,4fh: L) M* G: Z' f: o
    int     41h% C' f  H! Q* H* ~& T5 W& @
    cmp     ax, 0F386
# F3 G& G2 ~6 E9 C4 J3 @% J4 H& e    jz      SoftICE_detected* I* G9 d6 W  F, o  f1 f3 ?. \
; _0 Z/ ]% _5 h4 V$ ?* n- O

8 v$ p( t; g+ BNext method as well as the following one are 2 examples from Stone's 6 D5 s" U  R4 F: M
"stn-wid.zip" (www.cracking.net):7 t# Q$ m& ~1 h6 \) |* p+ K
3 j2 X6 _* G. l5 m
    mov     bx, cs' F% D0 b+ h* V, E) Q- E
    lea     dx, int41handler2
* [6 w# {" l# J/ D( ~2 u    xchg    dx, es:[41h*4]3 [& d7 Q" z7 [+ V4 t$ q/ k6 Q
    xchg    bx, es:[41h*4+2]
$ W& U/ p) ~, x. C, R+ q6 ~: {    mov     ax,4fh
6 L7 O* U) m6 E' Z& E    int     41h
. O. _' _3 m& s3 i1 E/ p! s0 T    xchg    dx, es:[41h*4]
$ `$ P6 v' c! Q# C! I/ Z2 ^& w    xchg    bx, es:[41h*4+2]
5 ], c4 L: g. ~3 i: J, a$ O    cmp     ax, 0f386h
$ O0 v) t# X2 [; [- }- F    jz      SoftICE_detected
3 c' p1 ?$ v: @! R% F2 \1 w
  U/ K" T# [7 \; z, _int41handler2 PROC
! ]; U' `3 }3 T9 v+ l& L, k    iret
( T5 Y1 |: N0 {int41handler2 ENDP
9 v! c- {! F# T" z2 H
1 a0 p, Z$ L" P6 \9 y/ {$ D3 {' N. c5 x- i( \# A# o
_________________________________________________________________________& E* k+ ^  k. S) p/ {
; w1 [" J: L6 H5 D" r' E1 O

, _; c; T! l  r2 G+ u2 d6 UMethod 06
9 Z7 ^/ w' S( X% y& q  d. R, Y! e( I" T=========- e& v( @( K0 o) @4 r- {3 h
4 ^; J; \( j* K0 E+ v" k
  q% W$ I8 k  |
2nd method similar to the preceding one but more difficult to detect:. e( b8 Z& |  ^) x& R' e: B
( `& D7 P' V0 m. e& V0 {
, ?3 V! U' _& n
int41handler PROC
# z/ N  H, U: f, S, O: V- @: a    mov     cl,al
9 C5 C: j" R4 ^6 V    iret& k. J! [2 v+ c; h
int41handler ENDP4 o/ b  U9 }3 H) {
6 |9 j  A* w% M! C4 e
) H, ?) U, f$ p8 Y+ K
    xor     ax,ax
! D3 q, h: B8 k. P2 C    mov     es,ax
$ s( M; I% M* I. N% J8 K    mov     bx, cs
$ \5 d3 n( q" h0 Y# B    lea     dx, int41handler# C+ w( a6 b7 |6 L, r
    xchg    dx, es:[41h*4]
9 l& S0 ^' @; f2 X" N    xchg    bx, es:[41h*4+2]( Y( R: X8 w# w$ F
    in      al, 40h3 S" {# P) O: u9 p
    xor     cx,cx
' ^# C* o+ Z* H6 |7 E0 L9 E    int     41h
5 s* P& i) U4 o+ F6 j* Y    xchg    dx, es:[41h*4]5 ^: f& h' v% @
    xchg    bx, es:[41h*4+2]2 |- z: Z" F: T4 G3 _4 z7 k
    cmp     cl,al
7 ]- I- \0 B/ B6 u% L- h2 C# H    jnz     SoftICE_detected
, L/ N2 i3 k1 P$ ^# R( [" J/ ?+ ^# e2 u8 y$ U9 E  N" ]4 C9 d& K" _
_________________________________________________________________________, _$ _( e6 v% j5 j
- j! Y# Q! H; m/ X% x6 @
Method 074 d( o# u4 D* [; }- f
=========
$ }5 N$ [) s1 L' x2 ?
5 i2 {) `, |0 {& g8 Q( |6 F5 p3 z# XMethod of detection of the WinICE handler in the int68h (V86)
6 M. c# A, ~/ |  ~4 R0 l
9 J0 ]! X5 |' b8 g  M    mov     ah,43h3 T. ]$ D' }, z3 Q6 W7 B
    int     68h
( ?" T2 _! S( x: L4 j1 R" A    cmp     ax,0F386h
/ i2 x+ D0 M! F$ z    jz      SoftICE_Detected) v4 B; q' A1 r5 Q

: ?% f4 l7 |: h8 r, j6 k8 I
. T, J! p- G1 D. y+ A1 D! M7 U=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
. o6 [( a8 o: ]& q+ s9 R7 Z* c# S   app like this:
* o, \) k) D- H5 M1 s8 V2 B
: M' p$ A- H5 s" e  b. m$ W   BPX exec_int if ax==68/ L" }% ~: c' Q  p
   (function called is located at byte ptr [ebp+1Dh] and client eip is
% c2 i5 b0 C$ z6 k   located at [ebp+48h] for 32Bit apps)" d' E0 i7 q) W7 X, v# Z) u) T1 O
__________________________________________________________________________! ]2 R# v9 f- R! Z/ R0 g# o
8 |' h( O6 L# u6 r4 v/ y1 Y
5 _% Q; L3 @5 y+ B
Method 08( Z: Y& V! @5 m
=========9 K, F" C- z& H3 |7 T4 R1 I8 S) [& T

+ ?4 @3 o5 o+ W) \" q, }- wIt is not a method of detection of SoftICE but a possibility to crash the
: j0 T9 @3 z9 q1 A" V' ]8 S& a5 _5 qsystem by intercepting int 01h and int 03h and redirecting them to another
. ~: F' z: M3 ^2 Z: O& @' aroutine.
6 ~% z3 o6 a1 u. g& bIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points+ d, Y$ Y4 P) W6 I! E  |: T
to the new routine to execute (hangs computer...)
& I  o  u- W& ^3 I
7 h# W! \; n$ {3 N* m# y9 P/ [    mov     ah, 25h
% s0 m' w  M# a; f/ s    mov     al, Int_Number (01h or 03h)  Z5 q: m/ P0 w9 s
    mov     dx, offset New_Int_Routine
* Z( T1 f$ h, O* d  S    int     21h5 y- {3 q" K# U1 }. c8 M- j5 N1 E

! w9 s) h! u" @2 E+ Z" f5 ~0 E! B__________________________________________________________________________
7 B# m" a7 J& k
, B# c1 \. m8 w4 B, B  sMethod 09
, G, l  G  U% b  y. G: K=========( B0 t+ t% }6 M# ^

6 q( X2 h9 N9 V$ u, B, OThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
( s0 l' D! W% T$ Bperformed in ring0 (VxD or a ring3 app using the VxdCall).% m" {; ]% u* J/ w
The Get_DDB service is used to determine whether or not a VxD is installed
% q! ?( i, ]% s9 e8 b, D' mfor the specified device and returns a Device Description Block (in ecx) for
8 w2 U* ^1 j( @; r- Y! _that device if it is installed.
' x& U; b  m! \$ z
7 Y6 s5 X/ `4 j/ z* g   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID; [* L/ a0 a$ N6 }, Q+ g% K+ k+ A
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)8 ~0 g7 ?. m8 E4 A( t
   VMMCall Get_DDB
7 i- p4 W: C5 C; E- r2 t3 e* l+ _   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed! z0 a. Z, J- n; Y( z& A1 g

$ p% y+ F# `# ^4 lNote as well that you can easily detect this method with SoftICE:
& ^3 O3 m5 Z  R$ ?  Y   bpx Get_DDB if ax==0202 || ax==7a5fh& f. J- K6 p) w8 _& z$ l" e. _8 a

$ s* p0 G% w/ b% q5 A$ z% t__________________________________________________________________________
) L8 V& T- A! K* C3 M+ i& w' z! H6 M8 v, \, Q, B) ~& F5 P( \
Method 10
, o9 u( ], [6 b4 V7 y=========' C) ?  u' Y  ?6 X+ W! @
- d9 h* Y: U1 p! Q' \
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with& Y3 b) J" @  S/ S2 a
  SoftICE while the option is enable!!2 A3 l& x# p- N" i
& m+ r! P2 D& S; d3 t# r% x" a8 I0 ~
This trick is very efficient:
# r% s0 @! D/ F3 J! M/ a& d8 jby checking the Debug Registers, you can detect if SoftICE is loaded8 a' F+ ~* L. c
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if( q4 `: a1 N0 W2 Y( F, [
there are some memory breakpoints set (dr0 to dr3) simply by reading their* l# \8 F4 r0 J0 z
value (in ring0 only). Values can be manipulated and or changed as well3 A3 X! m6 i/ S# V" N8 B
(clearing BPMs for instance)
1 R+ e9 X1 K2 V# t2 Z# M* S6 I" Y- F# _9 q; w, q
__________________________________________________________________________) \7 k4 [1 K7 M% M0 w- v; ~: s
9 I9 n3 D7 q8 ^; i$ f% K4 }
Method 11
9 K& m! k- o* n! S5 h1 z8 @! b=========
2 n8 ^9 v! G- c  r' U8 }* Z/ e' m& T9 a$ g: ~  f9 x
This method is most known as 'MeltICE' because it has been freely distributed) [9 U. B# o9 p! B7 K! a
via www.winfiles.com. However it was first used by NuMega people to allow
* _" @! A: |2 v( zSymbol Loader to check if SoftICE was active or not (the code is located
5 J( a. ?/ g4 k5 z) c! w6 A4 einside nmtrans.dll).) ^, U- t' h9 d! O
! l0 ^9 y! v! A1 a
The way it works is very simple:
* ?  r9 U0 G( V* Z/ h; e) Z0 NIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for! O! W( ^2 A: l0 X" g8 {
WinNT) with the CreateFileA API.
: Q" {/ q1 O2 M+ r& X2 X1 U; g! E1 c  V4 O* b' ]+ y5 @" {) [* E
Here is a sample (checking for 'SICE'):, A  T3 S2 Y; T) T) A3 v6 ^

) q4 s4 q, }& @' n; \0 K4 F& V8 bBOOL IsSoftIce95Loaded()" p2 ~$ ?- a5 X) Z+ M
{! Z9 y# J$ X! }0 q& u
   HANDLE hFile;  
8 r+ O& m; t9 c# }; j  ~   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,. g0 a4 H, f. G# ?& c+ p
                      FILE_SHARE_READ | FILE_SHARE_WRITE,
! L3 ^  g4 [" s8 T7 j1 H/ X8 n                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
' X, N) b& g( [( w: P   if( hFile != INVALID_HANDLE_VALUE ). X" ~2 R# |+ C) b0 D
   {
" P% Q. B' r% Q5 ^9 i$ V" b. E% ?      CloseHandle(hFile);( @! v6 u+ U: @$ ^, t* U
      return TRUE;: K! f/ _: h8 T, j
   }
1 Z3 E' D1 I' C% A" \! u" |   return FALSE;) k. K8 G, M' G# \
}5 r0 {+ ?  N2 i% L
. C1 p7 E+ O. h6 m3 n6 {
Although this trick calls the CreateFileA function, don't even expect to be3 T6 _8 s% j0 r) I7 B
able to intercept it by installing a IFS hook: it will not work, no way!  X* N' U1 n4 C! X: l  I; G) U. b
In fact, after the call to CreateFileA it will get through VWIN32 0x001F; v0 \7 L3 m- t* N% i7 e  d7 h3 E
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
" D$ Z7 p& d8 z* A9 F( b/ eand then browse the DDB list until it find the VxD and its DDB_Control_Proc
/ R4 m+ v0 l7 q* V0 pfield.9 I" ?+ {+ \4 O' ~/ v
In fact, its purpose is not to load/unload VxDs but only to send a ; I9 A# a2 I- J! L4 X* P, a
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE). S' l. u" b' b' J( o- J( v
to the VxD Control_Dispatch proc (how the hell a shareware soft could try6 H) ]4 ^5 G# x2 g
to load/unload a non-dynamically loadable driver such as SoftICE ;-)./ ~* g5 f; d6 G$ K
If the VxD is loaded, it will always clear eax and the Carry flag to allow: `% M; ~* x- F; g. N* V
its handle to be opened and then, will be detected.4 B; r6 O3 a% O0 M$ C
You can check that simply by hooking Winice.exe control proc entry point# U. O1 e( A$ E) y; s
while running MeltICE.
  z; [. k1 C# ~5 _9 G0 h1 C5 ]* I
: |/ g  ]+ y4 Y& U7 c9 V
( @, l) }8 r( G  00401067:  push      00402025    ; \\.\SICE
* t& J3 h+ F2 D4 A& x. {& x: Q) a  0040106C:  call      CreateFileA
4 \6 u4 Z( \" r6 Q5 y  00401071:  cmp       eax,-001$ h+ I+ R) c8 T8 b: ^
  00401074:  je        00401091# k& J# D0 {# d( Y8 P/ x& r+ b

# K. Y! G0 q5 N& g  f6 _  |/ y. ^
There could be hundreds of BPX you could use to detect this trick.- B+ d) J( V+ a- y  K
-The most classical one is:- T$ L) C) B6 J3 L* I0 e" d
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||# Q' E* C; g8 Y- M
    *(esp-&gt;4+4)=='NTIC'
; I. x7 k( `. a% D8 [$ s/ m# E3 j0 J" H; f2 t6 Z
-The most exotic ones (could be very slooooow :-(' K7 v5 U$ p4 P! G* Z5 A
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  - f; ^9 R' A: Z* h! C' }/ M8 V
     ;will break 3 times :-(
0 f5 a; {8 E9 |( G) i2 o' O) r# Y7 e5 v1 J) q* Q9 }' o
-or (a bit) faster:
: W3 P; t% e* R5 t   BPINT 30 if (*edi=='SICE' || *edi=='SIWV'). |9 s; B7 h+ @- V' K/ A" i
# t) {; c# Q4 L* J9 @% J4 i
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  4 A9 p( p  @) ~1 t
     ;will break 3 times :-(
& [6 W9 b6 E; s* N2 ^5 ]7 C
5 ^: {$ c: Q% _2 S% `7 _-Much faster:: L0 M* U' O+ k8 Q: D& R9 x
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'$ x# e1 V& U' a8 a$ R9 I, d9 p! k
( `: ~' r) C% m5 w( g
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
) \  y# u+ y- ]8 ifunction to do the same job:/ {; F: V8 O) }5 f
$ b0 E& x. y4 Y
   push    00                        ; OF_READ8 Q$ m. O" h9 A7 j
   mov     eax,[00656634]            ; '\\.\SICE',0
7 j* W9 k1 W* b& _7 ^0 C1 t7 w! C   push    eax; R' k) i& ]; K
   call    KERNEL32!_lopen, D! \' ?+ ^2 h' g  C2 I
   inc     eax1 F9 v' z+ B+ @- a5 E
   jnz     00650589                  ; detected  c* l9 c8 Y) y6 L% J6 W( A: C
   push    00                        ; OF_READ
% o0 X1 q( y, g   mov     eax,[00656638]            ; '\\.\SICE'5 m/ N1 Z1 p" f, W0 d9 p+ K0 I; d
   push    eax
4 H$ N- q' _4 V4 O# Q   call    KERNEL32!_lopen
4 m) k, c2 V2 P- \% {   inc     eax
; _. L. f9 \: U% l- U( N1 }   jz      006505ae                  ; not detected
; J* v: s. S$ w& p2 B- u: Q) }$ c: w
* [9 E; Z2 p3 O, Z6 {3 ^
__________________________________________________________________________# x% q$ H5 T6 r7 [
6 j0 k+ q" _  h
Method 12
$ j8 Y( d4 J! X+ _* d=========
. J0 ]8 E) f1 ?( m" L- I  S8 k) P) Z- B& {4 t5 e+ m) D# u3 l
This trick is similar to int41h/4fh Debugger installation check (code 05
5 Z  g% z0 v% ^1 X, W&amp; 06) but very limited because it's only available for Win95/98 (not NT)
( `& W7 ]% m6 Pas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
9 l: D" h6 B0 f0 p8 y( K4 }8 |8 V0 G2 u- [$ b& [
   push  0000004fh         ; function 4fh
9 `4 M" f( o0 I   push  002a002ah         ; high word specifies which VxD (VWIN32); P/ w% y2 b" N
                           ; low word specifies which service6 s1 o, Y) |1 p6 y8 @: p" T" m
                             (VWIN32_Int41Dispatch)6 W6 K; N8 o. {. U7 h/ L
   call  Kernel32!ORD_001  ; VxdCall  j- F) o* f6 e/ G; `* t
   cmp   ax, 0f386h        ; magic number returned by system debuggers; l, A4 Q5 u3 _" q7 ~7 h8 w% M2 K
   jz    SoftICE_detected
( W! D3 B9 O+ o/ n
. W  P$ k% f2 j& _- b+ DHere again, several ways to detect it:
- D/ {! q  P5 a# p5 U8 p# _. y, E2 D1 n5 v6 q% d9 |2 @& r7 ]2 D5 Q
    BPINT 41 if ax==4f
2 [' O/ u, I/ l1 L! {3 i% l6 N+ M; `, N8 L8 [3 O
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one( q& g5 d" O! d2 o9 C" S: g; J9 T( y
8 b& C. L( R% h# ?, e
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
* t. ?1 j  U- _
) V! j3 m% ^" A) d+ ]    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!; j9 O! y1 H: R4 i. R! e( s
7 R2 A$ _" C6 J7 A0 j! B
__________________________________________________________________________6 \( m! _- W6 ~1 m, u' I. x  E8 }

! y/ h+ O2 X% E" |1 N$ U. o7 JMethod 13
. X+ y8 K; T5 }, B5 o9 Y" B=========
9 Q; I+ F. o$ I2 s$ W. v% T  V4 m% W, O  f& _/ x
Not a real method of detection, but a good way to know if SoftICE is
" @8 [: F- I6 [" x7 A) c& S9 A, oinstalled on a computer and to locate its installation directory.2 }9 J+ g+ l2 V1 e6 ~% J$ L* t. C7 o
It is used by few softs which access the following registry keys (usually #2) :
8 a: c2 J1 k& }8 z1 {$ K' E. F
3 s' D1 b  C0 y8 {-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) s: l6 r8 a7 z( q1 ~/ y  j+ T% L\Uninstall\SoftICE
: l& ]3 {6 T, L' ?. a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
+ a7 R, \1 I1 H-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
, r& d3 Y( l  M, O8 s1 e7 u& U: T\App Paths\Loader32.Exe
! j4 h( }; G8 b. l: K& Z! U
% U" |  v' c" I
% V2 b1 y7 S  j! CNote that some nasty apps could then erase all files from SoftICE directory
/ [+ h  E& X! X  _2 w) I/ \(I faced that once :-(
* V5 T1 L) c8 f9 `& D* A6 m. Z2 @, J, D
Useful breakpoint to detect it:. s( t% i* Y; A" v3 f! j1 Y

7 x9 F% `$ f1 l' J     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
8 I  l! F" L' `$ {3 o( T7 F9 i7 y1 t: O3 b$ K
__________________________________________________________________________
: o( o# v6 |! \0 j; j
4 T$ s: U: @1 J+ w8 }# ?/ k  g  B& b. j/ O# [+ \
Method 14
( O  R1 M: \' a0 |' i! O=========
& P$ J& J' g( E, t2 Y- P& {3 I$ v8 P
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
! b7 a# P4 @' F% |1 K. Ois to determines whether a debugger is running on your system (ring0 only).
8 y4 r4 n  E) B  E: I3 S/ g+ p$ x; x3 B# V$ |
   VMMCall Test_Debug_Installed- m+ ^: k$ z4 Q/ `
   je      not_installed
3 {1 T% i- p1 u' N. D
, }8 a! X4 F" q1 {0 AThis service just checks a flag./ y" t9 s2 e: I2 r& `1 ~
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-27 21:57

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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