找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>  j0 H! |" \4 Z  Z8 \3 v
<TBODY>6 L2 E- v( R0 e, D; R  Y9 \
<TR>3 w$ f; e# K, R  N3 t# ?( L
<TD><PRE>Method 01   U- Q% m+ d7 N0 ]/ u. }
=========2 W/ g6 S6 y8 D; V0 a
* O  J% N: }# }- V  G
This method of detection of SoftICE (as well as the following one) is5 c6 @( u2 N2 l+ s
used by the majority of packers/encryptors found on Internet.5 W; ]3 y; m- b' h) k1 q" g
It seeks the signature of BoundsChecker in SoftICE  a/ _! E& l, C& E+ Y+ D

8 z& F3 A  i) o% J  H3 s- L% _    mov     ebp, 04243484Bh        ; 'BCHK'5 K  J8 `  ]% Z
    mov     ax, 04h
$ Z; _0 \  H; I3 s    int     3       5 G2 E3 H, {" {4 q9 i8 T
    cmp     al,4; v7 U  m- ^" b
    jnz     SoftICE_Detected
5 R5 c8 \1 I0 v$ C7 q( S9 [2 d1 s: R  V
___________________________________________________________________________
, K4 o3 c) Z$ P1 A0 J
' v. H! `4 a  X5 [" S; l  D" V" v. eMethod 02, L  {4 O5 ^1 w6 v% _
=========
6 `' O" H: h/ k7 x  n9 f
, ^2 y; i6 n! a1 O3 T4 Y: iStill a method very much used (perhaps the most frequent one).  It is used
) V$ e! Z8 w" r' cto get SoftICE 'Back Door commands' which gives infos on Breakpoints,* s+ P" ~: ?# l) E$ \+ F
or execute SoftICE commands...% e/ S. @1 `4 F  \/ R7 n
It is also used to crash SoftICE and to force it to execute any commands
" i6 b/ F5 }1 k) K(HBOOT...) :-((  5 [5 E* |% i/ h
  {) V, d. {0 K' F2 n
Here is a quick description:' h* d+ l+ f; x, |
-AX = 0910h   (Display string in SIce windows)
& U; [; i: s4 N& `! {( @2 Y-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)% S7 r/ K2 M3 [+ y9 z; l8 W, w
-AX = 0912h   (Get breakpoint infos)
' [- h; Z: m3 Y& p4 S% L: ~-AX = 0913h   (Set Sice breakpoints)
1 ^$ v0 {5 x9 R: e4 ?3 M. W-AX = 0914h   (Remove SIce breakoints)/ g4 N% j  E1 _' \: x7 |
3 m( V, j, j; @( ^& c
Each time you'll meet this trick, you'll see:  x# _7 Q4 y9 A: E7 @6 \
-SI = 4647h' }  _) y* }5 z' f
-DI = 4A4Dh5 a" S! k: C1 `3 P
Which are the 'magic values' used by SoftIce.
+ t3 c$ n6 A7 q9 T1 B5 P7 hFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
( ^; A* u/ @  U; U9 V2 }
# z0 o4 N+ Z$ n) ?Here is one example from the file "Haspinst.exe" which is the dongle HASP
! T' w2 [) D1 G; nEnvelope utility use to protect DOS applications:$ U+ t  r; y$ K0 T9 ]) ^
8 P1 e- `" u+ Y' f/ F: [  s
/ J# n6 x  j" I, S# {3 k
4C19:0095   MOV    AX,0911  ; execute command.8 U" ~! N4 Z4 N* q: x
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).
; X% |- q7 q; L+ ?4C19:009A   MOV    SI,4647  ; 1st magic value.
6 \" s" s7 J! g" V( P7 G: j4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
5 B, `9 n% \, i6 ]( o  a4 t2 M4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
6 P- q9 H. {' l9 q  x' X" y: X4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
2 v/ ?  D% ~; o$ O0 t4C19:00A4   INC    CX. l! C* u% H( ?; j: X) }& l! ?6 }
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
9 V6 r' E+ J+ [9 \/ b4 V5 p4C19:00A8   JB     0095     ; 6 different commands.7 {; b& g2 p( H+ T/ o
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.6 ^: v- e5 I6 k6 x
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)
9 h, y% Y2 t. b( s2 B8 P" `; ]. q5 [6 C9 B: ]4 w
The program will execute 6 different SIce commands located at ds:dx, which
8 l4 y5 K9 X9 T6 c* gare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
! ~( p. i9 a; }9 T5 ]/ {5 G3 G( S, E& W' E  e( R
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) e  j, w) J  n5 |
___________________________________________________________________________
% D1 w. ~' o6 H9 Y  b8 D$ a# q; b0 E1 l# d5 w. s/ e& i
' `1 D/ ^3 w: Z) n, f$ z. b) T
Method 03
- y$ A3 e: B+ G  ?# t; h6 T. W=========
) V1 r; X" O0 T+ l- [9 y4 g: v1 Z5 R) Y  a4 j1 Q6 X  ]
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h" L5 L8 f6 K  U: p; n% k: I
(API Get entry point)
, _) u2 U5 k+ z: s, q1 U, ~        : u# [# @# P3 J$ O/ x- \8 h7 F
/ L9 v; u; r- h) h% c: v& z
    xor     di,di
4 c6 |, a; d$ N8 Z2 c' x: Q6 K( {    mov     es,di
  F/ D( S% ^' e# V    mov     ax, 1684h      
6 n1 x, M; o6 g7 w3 {1 J  o% S    mov     bx, 0202h       ; VxD ID of winice7 T! K! `& `- p; ?: f$ S
    int     2Fh0 n& v1 g  r: V1 h! H7 q- Q1 C; ?# t
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
8 |: g9 U3 n( u( X) Y' k    add     ax, di7 O2 v9 E% o9 J; k9 V
    test    ax,ax  \# }1 ~/ a4 c- D$ j3 h
    jnz     SoftICE_Detected, g  F" Q9 y: {0 {# X6 ?
: F6 e$ @! o- Q& _8 H
___________________________________________________________________________1 r% g' [- q9 G# i0 M) w

& s& a" g0 c! @Method 047 M6 a; P. f! B/ i
=========
6 U5 A+ v/ A# Y' k6 S" o" c  H& Y9 A  L4 w) y
Method identical to the preceding one except that it seeks the ID of SoftICE( n; V; x0 T- L4 b8 S+ M
GFX VxD.5 M. |# ?" x! l  Q" k

3 w) P1 |( I; |1 Q    xor     di,di
5 r) D: j7 r8 [1 x+ k. _    mov     es,di
- {: z4 ~  }' L" ?# M4 E8 Q- r& g    mov     ax, 1684h      
0 j2 L, g4 f% A. w    mov     bx, 7a5Fh       ; VxD ID of SIWVID  i+ }2 Y; f, P; S2 C: k9 z6 |* O
    int     2fh
/ Y. P9 }7 n: S- m    mov     ax, es          ; ES:DI -&gt; VxD API entry point
' E4 q& H4 b; k# R& B    add     ax, di5 q( w, W. H1 O) Y) f$ t
    test    ax,ax4 K0 P; G5 ~+ L) |! a+ S! B: W
    jnz     SoftICE_Detected: C2 b6 C; v" O7 r  I3 T* S. \
! w* a9 a, O3 f# ]" J' a
__________________________________________________________________________
* R  f) _! I5 u8 y) K  u: r! g; P1 [- W

2 q* q" m2 h* d* K- M) _$ AMethod 05
' i5 ^/ }5 a( ~  E3 {=========, V, ~7 t( j' z+ G, W; @. Y
% E& ]; t) R: o: O4 ~( M
Method seeking the 'magic number' 0F386h returned (in ax) by all system( w1 y0 b; w8 q* {
debugger. It calls the int 41h, function 4Fh.
! _- p2 t2 h' |" K- cThere are several alternatives.  
% }0 [7 B1 A! w. H& A& V( M
8 K6 `; y% u4 L) |4 j3 u# V$ [The following one is the simplest:
7 p- t' J5 ^% s0 d: |5 i& ?
, G& U! R0 t4 A6 N. d    mov     ax,4fh: g$ F4 E+ o/ g: T+ g
    int     41h
) c* Q0 ^5 N" U" U7 u    cmp     ax, 0F386
; C. R# M8 l1 h0 ~; f% H" F7 _    jz      SoftICE_detected
$ \$ l# a5 ?; e8 G/ e( D0 z5 {5 j, C8 T: t$ X$ ]

- }' ^$ z# c% @; E9 LNext method as well as the following one are 2 examples from Stone's ; Y9 J3 X1 F7 \* F/ J+ |' Z* ?3 t. H
"stn-wid.zip" (www.cracking.net):/ E. \/ b( g9 w

  p3 ]+ F$ t5 Y( L* k4 U' \    mov     bx, cs
2 g1 x! x( T9 n/ i8 u" a0 R4 e/ F    lea     dx, int41handler27 b# U" \# D+ j) O! R/ x
    xchg    dx, es:[41h*4], p3 \$ ]! j  S1 `
    xchg    bx, es:[41h*4+2]
% w* X4 ?2 l* ?6 f* h    mov     ax,4fh) T  i( V9 P8 h/ H, w
    int     41h
, F! i5 j) z! {4 H- s! c' I    xchg    dx, es:[41h*4]/ V. H+ D+ t4 I
    xchg    bx, es:[41h*4+2]) d' I- a1 A, q: K& d9 @
    cmp     ax, 0f386h4 L8 [) Q( i8 ]! H3 M
    jz      SoftICE_detected8 y$ U( K, h$ X) _' [

4 c1 n; N4 k- d0 gint41handler2 PROC9 v/ s% u1 `$ F7 c. d% j
    iret' X" I2 C: h  i9 l' }. o2 x
int41handler2 ENDP
8 ]7 U' ^' x+ d" F
. M: u* W) A+ e" g( Q% Q3 `
! R: V! m7 D, B# g; W+ B_________________________________________________________________________
( w2 ]$ ?5 U% D2 |/ m( p7 S2 l$ H; s& v- I0 h) ~; k4 a: L
7 k1 \( V3 G* @# V% r  |( a; ^
Method 06/ w* X. o6 Y( a
=========( p! g6 p% T2 I# `# |2 X+ Q

( ^3 n3 i# o. ?
4 l5 a' X2 X, _6 @& ~2nd method similar to the preceding one but more difficult to detect:
2 Y, h- x) Q7 G; \) B4 q6 g: P1 {& R
. M* D# z+ z9 f$ P- `* N
int41handler PROC
8 o4 C; l( [: Z6 |9 m    mov     cl,al, r' \1 B3 L8 r+ m
    iret
, x. M1 F8 n6 L7 E) U7 tint41handler ENDP. t) b. n, j, U. n

' d- L- z' \8 p3 N% _0 l9 ?2 z3 ^6 f" d( t
    xor     ax,ax$ |5 ~/ s& J4 X  i$ |( J, K
    mov     es,ax) L8 Y3 Y$ b8 [7 U
    mov     bx, cs
& O9 s) O3 a( S7 E0 Y3 I2 w    lea     dx, int41handler
4 q; b7 c" r" K9 m' V5 u( }, X7 I    xchg    dx, es:[41h*4]
" r- t+ |5 [% w8 B, o% E( z    xchg    bx, es:[41h*4+2]/ X5 t& k* m% m
    in      al, 40h
9 |9 j3 l' E9 Z* J6 Q7 I! E    xor     cx,cx0 r! k. ?* _. H; f; u" p
    int     41h. y* a; a7 }" Y! K9 ~
    xchg    dx, es:[41h*4]9 T/ }0 p7 x3 Y9 ^, m2 K7 y0 l% ~# s
    xchg    bx, es:[41h*4+2]) ^' H3 ~: v! s( Z' f9 a7 @. x7 Z1 Q
    cmp     cl,al. e! O* M9 c6 t7 V* H5 x9 q. W% _
    jnz     SoftICE_detected- t' Z' T' y6 S
* V  [* h: r. u& h$ Y0 Q
_________________________________________________________________________
9 Z8 y' n4 p" c2 {- j8 k- w0 o
' a8 P  n0 }7 J8 j4 n+ EMethod 07
* B9 M' s: U2 t5 H, O=========( M/ _% s% @5 N

6 M9 r  k$ h, R! B2 RMethod of detection of the WinICE handler in the int68h (V86): Q' R/ k1 w& V' I; v
5 m; l2 u9 a- m- n( \0 W
    mov     ah,43h
% j+ V" s, b9 W/ H1 `  E, s    int     68h
+ X" t1 b( Q& r6 m% N/ p5 h) X% s' T    cmp     ax,0F386h8 P8 K7 c. q+ M& i; v
    jz      SoftICE_Detected- D, C8 W% I8 e1 l' k% ^4 F. T

! w5 A2 }# k( \0 u+ u, L; b4 Y/ m. V' P
  n  L/ x$ w8 f7 W" n6 ~3 s0 ]=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
* U2 G3 }! B# q9 S: d% E2 U) y   app like this:
, ~; S  x5 \  D9 {6 G
0 E7 M. {8 Q% e9 v   BPX exec_int if ax==68' Z1 C/ A1 w% S. l, h' g  F
   (function called is located at byte ptr [ebp+1Dh] and client eip is
; l; Q6 N) M" Q( H   located at [ebp+48h] for 32Bit apps)
& G* R8 m. K2 v$ A0 O__________________________________________________________________________0 C$ F6 E* `5 k6 R% H  g, `8 A

) P# y( f, Y% i/ D; t
% r2 ^* B9 N  {* W0 }- k, l3 w  kMethod 08" c) N4 y( \/ k4 t, Y; Z+ L' X
=========* P" A/ S5 l. y' u. [4 h8 N
0 J, h, C9 F# j1 \
It is not a method of detection of SoftICE but a possibility to crash the) ?, T$ a6 y$ P- k# `: k
system by intercepting int 01h and int 03h and redirecting them to another
3 M1 g  B/ z( r  R8 c. @routine.
/ }: o; Z/ I( v; [It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" F/ V0 ^) c+ x+ e# [
to the new routine to execute (hangs computer...)
( B  T: n8 C" [% a: s+ w( C$ `
: J* c% o. w2 l( V, \    mov     ah, 25h
: M; J. o% ^$ C& M. L/ @$ W    mov     al, Int_Number (01h or 03h)
$ ~  E& K/ V# c0 V    mov     dx, offset New_Int_Routine- W8 O+ ]8 m: `8 F$ ]
    int     21h2 H) c1 \" {6 N- e
; w( C8 ^6 }& B8 }2 W$ E1 \
__________________________________________________________________________' `! N1 R! D( G
( n) [1 i' _) Z/ u, L
Method 09
% S0 ]& _; [: l0 g* Q$ L+ {6 ]=========! U" m* R  y; q: K" {+ b

4 @! t* R" h$ U7 h2 ?$ R1 MThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
" h0 h* R8 K# r7 Lperformed in ring0 (VxD or a ring3 app using the VxdCall).
7 |9 Q6 a9 q' j, y, z2 x, SThe Get_DDB service is used to determine whether or not a VxD is installed+ l* U" c" v, j" K
for the specified device and returns a Device Description Block (in ecx) for
2 a4 m1 J5 I8 U0 ]# B9 ?that device if it is installed.
5 v: G3 V8 j6 w/ J1 n
" e6 B$ ~6 [9 M# S7 X- _5 q   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID9 k: X; g* s9 o7 I) S  {+ m
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' r" B2 o2 \- a9 ~* ~/ \: x
   VMMCall Get_DDB
8 C9 t5 |8 m4 H   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
5 S- }' E: T) I! \, q
1 K  z# |$ \: Z3 k% t5 c- t' x6 O7 L' rNote as well that you can easily detect this method with SoftICE:
8 h5 e6 R0 ]7 K. s( O; l7 i- y' _   bpx Get_DDB if ax==0202 || ax==7a5fh
# x; a3 f7 ^, [' J3 Y  ^4 S& h" {- @
__________________________________________________________________________
& Z6 Y$ y2 ?' E9 A7 L& l8 Q+ d/ @/ v: A* ]. I' _
Method 10" y6 `6 {3 w7 B. u5 B. ^
=========( b- b/ x* \$ m  [. C; J
* R8 q' C) b) b# h8 F1 Y4 C
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
; s: @8 R; M4 n- J% {0 R  SoftICE while the option is enable!!) ]1 x: y/ J' V. h( |
# b  R; {5 a# G
This trick is very efficient:
5 ]4 C5 n4 d+ c" |by checking the Debug Registers, you can detect if SoftICE is loaded/ }' `$ c- X, e9 [. h
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if) S: x8 k, I% Q5 H2 L5 c" q8 ^( n
there are some memory breakpoints set (dr0 to dr3) simply by reading their
6 @8 s, k1 Z: k. k$ k0 Kvalue (in ring0 only). Values can be manipulated and or changed as well: O% ^+ z5 w6 d2 x- H8 y, M8 ^
(clearing BPMs for instance)4 K4 }& M" y8 b. z, ]$ N% U- w

4 a* R) c' ^5 O: z! D__________________________________________________________________________$ Q: |1 z6 Y6 g

& e+ |4 e% \+ E5 r0 K5 mMethod 11
3 }# n: z$ U# _=========
+ |. Z" |' H6 Z) h1 N5 e
: Y/ q; Q" N, ~; v$ r  vThis method is most known as 'MeltICE' because it has been freely distributed6 y6 E: }! C; Z* m, }2 w
via www.winfiles.com. However it was first used by NuMega people to allow: U1 f3 H. I% a  G3 m4 H+ o6 S; e
Symbol Loader to check if SoftICE was active or not (the code is located/ T* j5 U2 y5 x( C
inside nmtrans.dll).4 j0 w, l4 Q' z3 R

1 U2 w; `* u, c. j2 s4 _2 b1 XThe way it works is very simple:
: i1 i1 P6 l1 I- Q9 C/ XIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
# a. ~7 T, l& P$ uWinNT) with the CreateFileA API.
- c) ?% o9 M; P2 I
4 u5 n. \  E  N7 A/ EHere is a sample (checking for 'SICE'):
2 u; X6 |' ?) l; V& L: {
* W3 Q' h7 h) e. W/ i5 L$ jBOOL IsSoftIce95Loaded()- j$ s. W4 i; K7 v
{0 g1 X: O. \9 ^  d! W) z, v
   HANDLE hFile;  3 l6 y4 x7 @/ _) M' S# ~
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,7 A+ z! N' B  P7 ]6 V8 F
                      FILE_SHARE_READ | FILE_SHARE_WRITE,+ N$ j. @: }8 I( U# F7 s
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);; T4 k: R# W3 A/ R4 C4 V  N
   if( hFile != INVALID_HANDLE_VALUE )4 U% `' M0 S$ k1 ^# W  P) H$ d
   {
! ~7 j  d( j  u8 E      CloseHandle(hFile);8 `6 U  A) b. [/ |& o9 d( t" F, @/ m
      return TRUE;
, ]: L7 v5 f7 D' g6 a   }
% j4 ~# Y1 Z1 D7 ~3 D" A7 N4 ~   return FALSE;( J" q+ L% V: a+ u8 r8 P/ u! @) z
}
, N! I! b2 B+ Z* L) l+ j
" R- \) \/ i8 c( N( bAlthough this trick calls the CreateFileA function, don't even expect to be
, h% ?2 G# ~* F8 l! d3 xable to intercept it by installing a IFS hook: it will not work, no way!
! ^9 \5 o( c; n/ S2 Z: lIn fact, after the call to CreateFileA it will get through VWIN32 0x001F' R4 j) |2 }6 b$ [
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
; J  l" J3 T/ v5 E' uand then browse the DDB list until it find the VxD and its DDB_Control_Proc
" N. \6 M& W/ W+ h, Nfield.
9 }; @/ R0 J& B( o  EIn fact, its purpose is not to load/unload VxDs but only to send a
0 J+ ]$ s3 {7 wW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
, I& d4 A4 U4 R. Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try
* P0 N% R5 }- i5 d1 yto load/unload a non-dynamically loadable driver such as SoftICE ;-).
4 r" u7 F7 K, ]% H3 W- N% hIf the VxD is loaded, it will always clear eax and the Carry flag to allow- b- p+ z: ~9 Y% q) D7 ^
its handle to be opened and then, will be detected.
. h6 T' k0 l! l* l9 C  qYou can check that simply by hooking Winice.exe control proc entry point" X9 E4 M4 U9 k" L% w% ?5 I, u
while running MeltICE.
6 @& i- Q" O" Y5 e; ?  t6 ^# S3 D5 E8 |
% Q; U- k+ V" ~+ B
  00401067:  push      00402025    ; \\.\SICE2 K* r$ U/ U/ X6 @3 t4 }1 K
  0040106C:  call      CreateFileA
% u; S, k( R) c9 j  00401071:  cmp       eax,-001
( ^2 b3 H! K# k7 |+ d3 i/ a  00401074:  je        004010917 s9 |  _, H2 T
: T( n6 c% s6 l
- K$ v5 [; I# x& y: R8 i& K7 z
There could be hundreds of BPX you could use to detect this trick.
4 `8 k5 z" B1 U2 Z-The most classical one is:
: \/ m/ q  ~* v# f1 C$ J  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||
! R3 b8 c) y( _3 L2 `5 G    *(esp-&gt;4+4)=='NTIC'
' J4 v1 a4 k4 x" o! s9 V+ ]8 d* o  S
-The most exotic ones (could be very slooooow :-(7 e; T1 c% D: A5 ?/ m# M
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  8 t) [* g9 }) H. i' I
     ;will break 3 times :-(5 e" \2 x+ v- I6 U" \

" V9 j. j1 _, g4 ?5 N-or (a bit) faster:
3 d  v0 Y6 V8 N. X3 ]   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
9 v" x6 N; Q+ E! T: k
% V* G* W( ~5 _) T( S7 ~   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  % z: C* V( `8 q; l  Q- s  w
     ;will break 3 times :-(, r$ _( E4 L0 n8 j
* [0 y( j4 Q2 }
-Much faster:
, c3 g7 H: `- Z) B; a   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
; \+ c6 X0 j/ @5 S4 {
" T7 J8 `+ n: L  sNote also that some programs (like AZPR3.00) use de old 16-bit _lopen% e1 x4 ]$ W& m
function to do the same job:3 [+ a" X$ f, J5 E- p
( E5 l, ~& ~5 x7 M
   push    00                        ; OF_READ
5 G  B: J5 c. A/ v& \# }   mov     eax,[00656634]            ; '\\.\SICE',0/ n8 A+ z4 r' c* {* A2 Z  k2 Z
   push    eax5 b* W; N- m# g# n/ x
   call    KERNEL32!_lopen4 R6 i. H- L* u( ^2 k
   inc     eax
1 @" Y5 N2 C& o. g8 T, F$ y8 B/ w   jnz     00650589                  ; detected% b; F) Y7 q0 ~/ M; e
   push    00                        ; OF_READ- _  `7 x) L, Y* e8 j* t
   mov     eax,[00656638]            ; '\\.\SICE'' H2 B* b* M: o0 R% V. J' p7 k
   push    eax$ g: F, m) n- Z6 e. j
   call    KERNEL32!_lopen
" X+ N- h! K. o, e   inc     eax9 O1 S- }. j+ t3 Z, C! f3 q
   jz      006505ae                  ; not detected
' \2 i5 D9 G! d6 X4 H' g* K
' O6 _" i$ G: T. M$ X
; _! x  o) _" W$ B( r+ w" D__________________________________________________________________________6 X( d" g% H& ?4 i3 \/ z
3 T! q; h( P+ J" o5 F) f! m
Method 12+ M0 m* G& r: r+ y9 t5 F% w1 J
=========
9 \( S2 [9 }& ]7 \% h5 w  b% ?, E) {# z  r1 N
This trick is similar to int41h/4fh Debugger installation check (code 05, ]% e7 W, s# e' G5 h9 |6 p8 O- I% ?
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
7 b6 [" _- t) H" H' w4 jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
, s. k; D, ^& Q, ]; Z
& z" {, @9 J: R2 G/ Z+ H   push  0000004fh         ; function 4fh4 ]. J& z) A& {  R2 X
   push  002a002ah         ; high word specifies which VxD (VWIN32)
) v3 c( r$ b! r, M* d) k                           ; low word specifies which service3 |0 K: y5 S) H, s/ A
                             (VWIN32_Int41Dispatch); N9 }. I" c" b' Y/ `6 E0 h1 K  v6 G
   call  Kernel32!ORD_001  ; VxdCall( {0 I2 e, ~/ m& y
   cmp   ax, 0f386h        ; magic number returned by system debuggers$ U* V9 u. z) H. D2 r
   jz    SoftICE_detected
6 u: ~4 o+ p% y# m$ X
3 [, e, p3 O2 T; r0 j; R" |Here again, several ways to detect it:
0 o: o$ p# r- j6 e" W! i9 R0 i  J
' Q( {1 K; V8 c' Z. B% b    BPINT 41 if ax==4f7 Q5 Z. d6 X" w' \3 y: s6 x: u
; W" {& b, y" C2 V" X, _
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one; k8 q& N+ R6 m& {: u
3 X: e! n6 ^$ P0 y' f9 Q8 g& s
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A
- w  _5 ^! N! f8 F6 D: d
4 [" o9 [" [4 M; U( ~5 \0 N! r& E    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
7 U% v: s  Z7 D+ D( @+ g+ p' f6 c$ r' `
__________________________________________________________________________7 o5 A# e1 [6 O- t' y8 O

! ^6 X$ |( [, ]; a: yMethod 13: E+ a; C$ r2 s  M6 [. D. G
=========/ t- k/ H2 t; X2 T1 P/ E, d

- E9 f3 A6 p4 G( }/ VNot a real method of detection, but a good way to know if SoftICE is2 U0 f+ x1 z& |- S* [' g3 t
installed on a computer and to locate its installation directory.  e% R" X, b/ V7 S
It is used by few softs which access the following registry keys (usually #2) :! U/ G: C" E3 D3 M' U1 t6 e1 f- |

: J; u" u! `8 w6 K6 b-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* j" V( I# h, A/ q! v\Uninstall\SoftICE
" d' M& Y/ `1 h) h) ]* a-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE* X# y7 y& h% }. _! S" W! h
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion( d& N, H: ~6 _4 O$ x
\App Paths\Loader32.Exe6 t9 ^7 P' V# E1 h. D$ q
6 b1 r3 R6 i  u* F1 S9 C, {
9 }* z" i! k# `! a- R! J
Note that some nasty apps could then erase all files from SoftICE directory
1 R/ V2 T8 I4 }) L3 T  z. }  }# c(I faced that once :-(9 d" ~7 ]. F" {6 S* ~
6 U  [3 t; B$ b* @% D
Useful breakpoint to detect it:
% G6 e+ [+ V4 N- a6 H# p
% I; X+ q: W8 c$ \     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'  o" Q, g0 d7 Q2 d# Z. k/ X
1 M( s  a% e9 |" J
__________________________________________________________________________. d! }) h# @6 B5 d0 e) w! [
7 G+ L8 f6 \/ X. w" N& I. r

% l" p2 c8 \8 ]Method 14
6 J# L# p3 n& e( c=========, I. Q0 [2 Q) l
3 L0 y: K2 r5 t' {
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
: m$ O/ L7 h- j5 tis to determines whether a debugger is running on your system (ring0 only).5 y4 }- w& F8 s
* M7 l! W: Z% S5 c, v5 i
   VMMCall Test_Debug_Installed, e. u; {1 x+ H; Y& c
   je      not_installed
8 ]  X, D0 Y: M! y! o
, _" z) f8 t9 m/ Y  ZThis service just checks a flag.
0 |$ m$ G9 d9 h" S9 A3 `' m3 g</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-8-14 21:58

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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