找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>2 @" {1 J; \0 I; U& h3 g8 Y: ], [
<TBODY>
- x# Z: p3 _6 i1 n<TR>2 ^$ U4 u" g8 n. L2 O
<TD><PRE>Method 01 / s; `# R1 J4 M
=========7 ?$ I( I5 u, C4 t
/ P  k6 p' ]0 v" Z7 x
This method of detection of SoftICE (as well as the following one) is0 Y3 ~- B% K0 G/ R5 c
used by the majority of packers/encryptors found on Internet.
/ v7 T; r6 K, q1 sIt seeks the signature of BoundsChecker in SoftICE
& M' `) q/ n6 y  s) ]2 V; c5 y
# B) k+ k" X9 ]! H! r    mov     ebp, 04243484Bh        ; 'BCHK'
2 ^1 S5 a+ N# e! v* r7 c0 ]! U    mov     ax, 04h
5 ]$ |- A+ u/ S% B9 t' n    int     3      
# L* I/ f, k% o; D7 f& N5 l' t    cmp     al,4/ j6 S" m0 v' [$ F6 T$ P' O, r8 c4 i3 c
    jnz     SoftICE_Detected
: h$ t9 h# M" G$ r5 X4 h1 s, _1 m: `/ |. Y: O( A2 L5 i. e
___________________________________________________________________________
1 i+ ~" |9 l# A* T0 i1 `7 ?5 F# d
0 l: P9 J1 ?  t) [' BMethod 02
: j  K# @$ r! y0 `, i=========- C: H! ~1 x& A. k' h: Y& V

6 T) J! f: b6 j8 O  N8 N' p0 C: AStill a method very much used (perhaps the most frequent one).  It is used- r3 |2 @" E, O" X: y) n
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
$ m0 p& `. v1 Z7 f! k. @0 n6 aor execute SoftICE commands...* Q% @: W& d% P+ I3 z$ m
It is also used to crash SoftICE and to force it to execute any commands; G/ `, A3 @9 b! a: z! ]. v, o# A
(HBOOT...) :-((  
# u' S/ E  \0 }' y2 _* \3 q3 P0 [5 m& ?1 W- C
Here is a quick description:! |! I2 B% i/ a8 U% N: |* U( N
-AX = 0910h   (Display string in SIce windows)" [+ T! |7 d# \/ w/ V1 G6 [, n6 E
-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx)
* W' [+ O" u+ w" D8 [+ n/ N  r. C+ `-AX = 0912h   (Get breakpoint infos)- S0 h+ G/ u; I
-AX = 0913h   (Set Sice breakpoints)
0 T. w) [( }! J8 [. @-AX = 0914h   (Remove SIce breakoints)" B4 C9 a) `, ?
6 |1 g# d; z+ y) \( t
Each time you'll meet this trick, you'll see:
- W( A( N7 F2 G-SI = 4647h
: c6 e3 ^6 i6 {* D1 X3 |2 Q-DI = 4A4Dh# M0 b- A  }8 X4 K( k/ l
Which are the 'magic values' used by SoftIce.; T) E3 y3 p# w4 M( J( F
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.1 z6 V0 R3 s) J: @4 J

4 r, t) d; K. h7 y0 jHere is one example from the file "Haspinst.exe" which is the dongle HASP
4 f3 n4 o* ^2 U9 `$ I9 I6 ~5 nEnvelope utility use to protect DOS applications:" O0 B( U3 l- B) B+ P
  Z" }4 R6 t2 q

) @# z1 o3 g: Q4C19:0095   MOV    AX,0911  ; execute command.+ H! J  [9 I- Q! G  z
4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).! F* ^9 o% o' L6 z* |! {& g8 r8 C' O2 `
4C19:009A   MOV    SI,4647  ; 1st magic value.. v' g+ }* V5 X' T
4C19:009D   MOV    DI,4A4D  ; 2nd magic value.* @! H0 B. r4 }; p; S/ Y
4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
" w) r- d# S3 H3 I4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute. {( ]+ M( i: N, P
4C19:00A4   INC    CX
$ |- M/ X& f0 {: [) ~' e; V3 E4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute
: ~! R" w. F5 x8 @8 t7 a4C19:00A8   JB     0095     ; 6 different commands.' U- E  B* G8 d4 N. y
4C19:00AA   JMP    0002     ; Bad_Guy jmp back.* W( I0 j; E, H/ [0 j- @
4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :)4 }" s6 E9 s( L6 c5 h. O* }
% i% t- ^* Y4 K1 ?7 u  Q1 I' K+ z
The program will execute 6 different SIce commands located at ds:dx, which+ Y7 R7 ^7 ^! Y" ?4 j' F
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.1 I( W/ [# ^- G6 F9 A
8 i/ K# |+ q9 w8 j
* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded./ A4 s" K6 A/ @% Y+ s
___________________________________________________________________________# H8 o+ n& {2 G' {

1 |5 H- g5 U" [3 r; w! H; F: X% }1 L: [
Method 03, ~) ]' A7 n' f, z' G9 f
=========
! n" d  w5 B3 R9 }0 }* K1 T4 u* D# k( f% X
Less used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h
' P* n% S9 H# j1 q4 o(API Get entry point)1 Z/ `$ {' ?$ Z- V
        0 v( h4 T/ S2 V" _
. |% `' l/ H5 N" U  p0 h
    xor     di,di, }; O/ F& z: c+ R) _! o/ D0 O
    mov     es,di
) B- E! W+ u1 V7 u" T    mov     ax, 1684h      
  z9 [, C- t& [! y; v( e* D- D    mov     bx, 0202h       ; VxD ID of winice. _# ^0 c: W0 a: s  E
    int     2Fh
( B( c; F  X* _    mov     ax, es          ; ES:DI -&gt; VxD API entry point& z7 W, h6 S+ H9 i* [0 ^
    add     ax, di
1 b  |+ b  ]8 F. `    test    ax,ax' \" t0 c4 w0 R  o
    jnz     SoftICE_Detected
  `9 [5 Q1 _( b
1 [% h0 L; O3 l* Z___________________________________________________________________________
8 q+ _# ]) X, d; u' j, p
3 E' |. W& X0 q) g! \- [$ q( A$ }Method 04$ S/ \6 D7 ]! R9 u; [
=========
( ]5 G- o5 S! c
2 H; x0 ?4 G' yMethod identical to the preceding one except that it seeks the ID of SoftICE* D1 |: ], G4 I3 J/ Z, Y; A
GFX VxD.4 v' P0 i, [* ?  ^+ L; Q( \
5 _. C. }( j* H' V; s1 E& T
    xor     di,di
) v$ q5 L6 \" ^1 ]- G# Q. C9 H- W    mov     es,di* J; N! r, M$ b2 ]
    mov     ax, 1684h       / J4 E2 X# k. R- I
    mov     bx, 7a5Fh       ; VxD ID of SIWVID
: ?; A1 ~  O" L    int     2fh7 b6 {/ i$ T9 s7 q7 p( u+ B7 s
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
4 j. M/ C3 v* j7 D8 f3 [4 {    add     ax, di0 o  y% O! P, N/ o! e+ x
    test    ax,ax
( Q1 o/ ?# X( x9 u. Q; X    jnz     SoftICE_Detected- m+ \: p8 u/ ~8 K. e5 M- X9 |3 x) M
# C; \6 p* U  }7 l3 c
__________________________________________________________________________& Q+ ^' V6 \% F# |8 a

' T( A! E. v$ v+ L
5 c" Y1 d( _9 @Method 05! h. S7 ~6 H, Y. N5 C4 D
=========8 B* R% a+ l/ [

5 X7 Z) G( Y, ^0 n5 p: A' UMethod seeking the 'magic number' 0F386h returned (in ax) by all system
/ [0 f7 s6 X( k7 bdebugger. It calls the int 41h, function 4Fh.
- p: d  _# l# b( D) pThere are several alternatives.  
9 V$ m' G% [, ?! i
1 E# e7 E# B) \* kThe following one is the simplest:
0 j( {1 ]3 R1 A9 U' k
, G# D& n/ ?/ d8 `  s9 @    mov     ax,4fh
% _8 D0 }9 o4 Z: E$ }; \1 _" j% h    int     41h
; j; s1 b2 V3 {    cmp     ax, 0F386
8 J/ r  l  {, R    jz      SoftICE_detected' u5 Q1 J3 N2 _5 H
( F' d# D' Y, E

6 i" n5 E: Z! O5 J9 v1 i; N/ B9 _0 pNext method as well as the following one are 2 examples from Stone's
! j( Y$ `# `! ?' Q"stn-wid.zip" (www.cracking.net):0 k4 l  V. p. \( H

; u2 @2 E- N3 }+ ~. |$ s    mov     bx, cs
% _8 x0 F! e, ?9 Y9 l9 j    lea     dx, int41handler2
1 w7 v% W3 k  j" d4 I8 D    xchg    dx, es:[41h*4]1 X6 I0 n: l9 O) P0 v$ Q
    xchg    bx, es:[41h*4+2]
/ z, }3 B5 k; Y    mov     ax,4fh9 N, b/ e; M8 Y( B. h& ]
    int     41h
4 }# P0 j" T' s+ h    xchg    dx, es:[41h*4]
" ^- T! S& E& a' f1 P    xchg    bx, es:[41h*4+2]8 B" E/ E4 M* }0 f. R/ R
    cmp     ax, 0f386h
+ k; @" y% Y$ x& b    jz      SoftICE_detected, V: P2 G$ N+ Y/ e

  O% C2 L- {. D- S) H7 pint41handler2 PROC
5 H$ y  E# @. g2 s. Y# N" t    iret
* N  w+ u2 b9 S( u2 V0 `. H  L! Xint41handler2 ENDP. S- P4 d7 ^' P, p8 r

2 u- B# j4 f1 k7 s
1 A. B' B! I5 H& ?# [) o_________________________________________________________________________8 T* O  O3 s, ]- `- z* g

% N) g% o+ V/ a* n
1 x" O9 }; g$ y( D- W8 g' nMethod 066 s2 U) s7 O4 \2 A
=========* H! m" l$ A% f: }

1 H- i! [% ?+ x; K0 @# C2 f
( Z9 o/ [' {* W6 `  u  _2nd method similar to the preceding one but more difficult to detect:
9 Z6 N. J. W( U/ R/ d! o3 h1 ?6 j* s% g( j+ ~, n+ C

' }0 w' [2 P# L1 B+ d' n! Jint41handler PROC! U8 J# G$ i9 o$ @1 W
    mov     cl,al( X8 J% D6 Z- a; o8 q: ~+ D  _
    iret3 {# ?# }! S+ P7 B6 r( O+ ]/ P
int41handler ENDP7 D# M" `8 D6 Z: K: ]
- e# ?! V( ?7 z, t
8 s: G. x- [$ Z! _  W* H
    xor     ax,ax
& v3 m7 t& r: P- q    mov     es,ax/ N9 M, x0 X; Z: x' F1 H* p% x
    mov     bx, cs* h+ k" N6 m' b8 R; D! H8 P
    lea     dx, int41handler
3 ]5 J% t; ^, h, {$ Z0 E" n' ?  P    xchg    dx, es:[41h*4]
$ l! ]2 O+ T, w: T) @0 L$ S$ q    xchg    bx, es:[41h*4+2]4 a/ |6 C: @' q, z
    in      al, 40h3 P) K( M1 b- _
    xor     cx,cx3 Q& @- n( c8 U
    int     41h1 [  \2 b$ F) \4 M) u  [7 D3 \3 ?
    xchg    dx, es:[41h*4]+ Z- T- P% e2 m
    xchg    bx, es:[41h*4+2]
- y5 n. Z, e' f- M; n" _, y7 H) V0 W    cmp     cl,al
1 l, P/ e4 }6 L; L) I! D& k    jnz     SoftICE_detected  y* s1 N; A! L  y
, `: Z' `4 v/ R  D
_________________________________________________________________________
, i4 K8 }0 a+ ~. ], r
& Z, p1 C- J! h9 `* [7 uMethod 07
1 w' Y- q; ~( ]: l2 v6 e1 I=========+ }3 j6 @0 q5 q) Q7 ]

# Z9 Z. \- u% v) j' uMethod of detection of the WinICE handler in the int68h (V86)
, d! c4 U5 i8 P# _( Y9 `& B; C# r) \/ s2 |- I
    mov     ah,43h; O/ ^1 S: m; U
    int     68h
2 \; R  ^6 h- |6 p    cmp     ax,0F386h2 E% a- d& s3 `( X
    jz      SoftICE_Detected3 N/ r( P& S) |+ b; P
1 Z) z/ N( W0 [6 q
7 r, M) p" {5 q( B0 q! h0 m) \
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
/ X0 w% V2 \4 U5 f   app like this:
4 b5 P- q% E; o, o1 t0 Z% O' j+ s# I2 Z0 P
   BPX exec_int if ax==68
/ v8 ]; g+ B8 z  A   (function called is located at byte ptr [ebp+1Dh] and client eip is
& T, _" Z0 M. ]- {6 F: x5 a% M   located at [ebp+48h] for 32Bit apps)
7 m4 A; J, o& h__________________________________________________________________________
1 q3 ]5 U4 g9 o( R! y
; {* X! a, p# h' R1 S4 T
; b1 l( H/ I% n1 gMethod 085 [) Z( @$ f9 z2 b+ R. a
=========
' J) }  \( Z' P& F  I5 ?  B& }4 I, Y' _4 B8 c5 n6 S: c0 \% T. C+ }" D
It is not a method of detection of SoftICE but a possibility to crash the
$ l, `! {, s3 E2 K5 k7 zsystem by intercepting int 01h and int 03h and redirecting them to another* s0 ?" D5 g$ m  z6 F6 m
routine.) ?/ l8 F! f/ M
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
6 a& Q. V5 s- Rto the new routine to execute (hangs computer...)4 Q( q% A( N* h+ V0 n' m. N
1 z% h$ A& b6 X. V4 K. L
    mov     ah, 25h/ ]- h( N, m% L$ A8 A( B0 v
    mov     al, Int_Number (01h or 03h)
* Z, d: R! J$ [4 M, Y& l    mov     dx, offset New_Int_Routine
. v% F/ D! M2 f0 N2 n" U, K0 T/ U    int     21h! }- B9 u; E' w$ D; ?

% r) [7 v7 h, ?% M3 M: M__________________________________________________________________________
/ Q) F* C- N' v# j. e& C
  S1 H8 J* m% {4 CMethod 09
* p' }) o  S0 ]4 d0 h! _0 [=========
4 O9 ]) k# K- @" [1 N9 z" k. v) k7 G2 f
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only, D; u4 P. y" C) a( G
performed in ring0 (VxD or a ring3 app using the VxdCall).) l$ z9 @- u0 u" `, U8 ]6 S
The Get_DDB service is used to determine whether or not a VxD is installed
3 V' @( m! h6 u1 Y: kfor the specified device and returns a Device Description Block (in ecx) for
0 U, I4 V4 ]8 n' X7 q1 q7 y% {; B! _that device if it is installed.: N! _; Q- s/ m7 [+ }
7 R1 d/ H+ {5 F1 h" G3 |
   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID2 T. a  W$ o, `. s0 k
   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)' C5 m, O4 }4 _0 c" L+ K& ^# M
   VMMCall Get_DDB& Y) Z* X$ v% S- |6 T
   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
' c$ X8 i; l( b7 f, C' {$ R! ~6 d
Note as well that you can easily detect this method with SoftICE:$ ]; X" O$ ^' h. H
   bpx Get_DDB if ax==0202 || ax==7a5fh7 b. J: Y& a: j) a1 [
8 E6 m! w# E+ S* v8 t
__________________________________________________________________________
0 p7 u5 k6 P6 a+ I' d( A0 n+ L6 w# R/ p& ~/ r, @5 ~; E
Method 10
8 |& U/ Y& @$ o* N* g' P6 I4 N=========
7 \2 M; z! ]) ]8 O+ M+ F7 m$ r$ \0 r; j, g- }
=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
3 h- Z. l6 a. M+ H8 @) a  SoftICE while the option is enable!!
- f+ ^+ `4 ~9 b! ^. [! G8 ?1 h  z; ]. q3 k
This trick is very efficient:
5 M! I+ g' @) N6 T5 i5 _  h3 qby checking the Debug Registers, you can detect if SoftICE is loaded- \2 p/ U/ k% d% P& r; U! n
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if
: w% T- ~6 y# h$ }9 \' Cthere are some memory breakpoints set (dr0 to dr3) simply by reading their3 G1 ?0 o* p3 M, t9 e7 _& z
value (in ring0 only). Values can be manipulated and or changed as well+ I! ^  G1 [# y; x6 F
(clearing BPMs for instance)! W; |- ~6 e, ]3 Q5 G8 O

/ K9 e% q3 g+ Y* Y8 s, b2 g/ q__________________________________________________________________________. Z% ^6 C( i: g) y, ~) q3 p8 M

& {, I% o2 [2 S8 \6 T4 ZMethod 11% ~. C. h! j! u
=========5 b- a- m5 h( T& i* _

# W; P, u+ f4 F( e7 zThis method is most known as 'MeltICE' because it has been freely distributed, R, h. R* z8 @
via www.winfiles.com. However it was first used by NuMega people to allow
. Z4 g9 v, F% n1 G/ qSymbol Loader to check if SoftICE was active or not (the code is located2 i7 t& \. R& z4 U) @
inside nmtrans.dll).: [3 _( n6 G* l
, _' Q9 ~% ^% B  X
The way it works is very simple:
* R/ m, o- V0 g* r* EIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for0 o$ y( {1 P) _! h* A& Z7 A
WinNT) with the CreateFileA API./ f9 I/ f+ H6 H# R
( E) M) d) y& L& h! v" b: H# i
Here is a sample (checking for 'SICE'):, ^, }. U6 S9 O0 u' C" _' f
( ~# h6 r0 J/ ?* P
BOOL IsSoftIce95Loaded()
: o( @6 p$ y# V; p4 _9 C+ Y* B{
3 g, L- w; g# O8 s' P   HANDLE hFile;  1 E; C0 ^! W7 E% H9 J- x
   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
* u2 p- x& O9 V                      FILE_SHARE_READ | FILE_SHARE_WRITE,) j0 ^+ K. T3 P: W$ m* A% Q
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
4 I; t& \) G& {/ l( Q5 Z  ?   if( hFile != INVALID_HANDLE_VALUE )
; A6 Z4 g; s" \6 O8 ~9 z# K4 v   {% N) s# p7 L) m/ J
      CloseHandle(hFile);
  c: [5 D3 @+ ?/ Z- E      return TRUE;
  B, R2 g3 g) m% I; M   }8 z5 D: c/ O0 i$ J, v
   return FALSE;3 i: n5 Y9 h, @8 o5 S# V* L5 l
}; z6 d2 y4 r1 R7 X5 w: i
$ t, ^, W9 Z& `7 g' v) B* a9 R
Although this trick calls the CreateFileA function, don't even expect to be
6 ]6 ]4 z/ O( r5 Pable to intercept it by installing a IFS hook: it will not work, no way!0 a$ Q$ @2 ~4 v& s! w4 _- T
In fact, after the call to CreateFileA it will get through VWIN32 0x001F
* l$ F9 c; X0 g/ n7 V7 D3 bservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)" z% o( o8 {& k, I4 _
and then browse the DDB list until it find the VxD and its DDB_Control_Proc6 u5 \( w8 _" ]% ~* Z  D
field.
0 V1 u2 Y5 X7 [8 @  [- RIn fact, its purpose is not to load/unload VxDs but only to send a
7 p6 O3 \. S0 q& O9 I, X; i* TW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
* q# ?/ N- J8 Zto the VxD Control_Dispatch proc (how the hell a shareware soft could try( w5 E( m+ D  c7 ^3 ~
to load/unload a non-dynamically loadable driver such as SoftICE ;-).2 T( A1 b+ s6 q
If the VxD is loaded, it will always clear eax and the Carry flag to allow- O/ j7 V3 }% }' I. Q
its handle to be opened and then, will be detected.
6 d9 j& a- U0 C( w, Z, |2 q; BYou can check that simply by hooking Winice.exe control proc entry point
( p6 ~5 d  _( ?8 B. X  Z. W8 Rwhile running MeltICE.% ]8 D4 o/ }( w/ ^! y6 o0 P3 L5 }
9 T' y& e! p5 l" a6 |0 `% v: ^
' f6 u. ]. G% f$ c  `
  00401067:  push      00402025    ; \\.\SICE
! X2 V" Q. R$ x0 E0 P' Q7 J+ S6 f5 n  0040106C:  call      CreateFileA! f8 B) k( s  L" a+ I2 V3 I- m
  00401071:  cmp       eax,-001
$ ~7 u2 c! |5 q* P: K0 q8 T/ d  00401074:  je        00401091
/ k7 P* s$ ]# {2 P# b* f/ ^) O. _) C  b2 [
) ?8 m7 M4 Q9 w( x
There could be hundreds of BPX you could use to detect this trick., Y/ l  r7 {3 w/ m5 {6 e
-The most classical one is:8 ?7 G$ D$ T# p) R. {! ]  k& o
  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||# Z1 n- i! V) l: R+ a
    *(esp-&gt;4+4)=='NTIC'
7 ~" q" o$ f- ?( `  F8 I' M. |
) h' O* Q5 O8 x( i1 J+ b-The most exotic ones (could be very slooooow :-(
7 J0 H# z  X5 N( b( g2 I+ v+ H7 k2 g   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  / e. q3 P: R0 n0 S' E& J
     ;will break 3 times :-(
* p5 m- G& _! l4 [( g7 L  A" O; g& B, O+ s0 o! X$ R
-or (a bit) faster:
$ O9 D1 d8 _- m5 r0 u   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')- e# |( r4 D7 f5 p$ y1 {9 h

$ V3 R/ F! w2 I3 C4 r   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  6 j0 k6 b3 Q3 ~9 _4 Z" z0 T
     ;will break 3 times :-(; Y9 P  \+ q$ u( x, v- \; b" Z
4 j, F7 H; q. A9 \6 ~0 R8 I5 s
-Much faster:) ?9 x" ~" _- Y8 J# ]
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'. J0 P' A2 `) V. r

3 e( \: X$ [+ I! u$ HNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
: N5 B6 u/ i+ J( _5 m- N) k; Pfunction to do the same job:
) v7 m  g& `+ P5 @! o' `* A4 T2 H9 W
   push    00                        ; OF_READ
  t) s. Z2 L6 d7 Z  E3 [' U& i4 [   mov     eax,[00656634]            ; '\\.\SICE',0
+ N1 i  t  J* O   push    eax  Q! G' i+ W% m" M
   call    KERNEL32!_lopen8 n7 z" D2 |9 d+ Z0 X  ^
   inc     eax
+ R1 e  R% u$ I, l. k& A   jnz     00650589                  ; detected1 c% r* T) v- ?+ o/ w5 L& k
   push    00                        ; OF_READ
& T! M9 [, w- [: W$ |( {7 o   mov     eax,[00656638]            ; '\\.\SICE'  R/ x8 M5 I0 t( P+ g! l4 M
   push    eax
1 s5 F" B5 O" O7 X9 [0 w  L   call    KERNEL32!_lopen
2 a, j  b& c/ F& P, a) X   inc     eax
8 j5 {0 a5 m* w1 J) F6 g, J1 n   jz      006505ae                  ; not detected
3 H$ l) D, i, R+ a4 ]. M5 B6 o+ Z3 ?4 _5 A  Y& [5 p
) j  z3 s# q$ T/ Z5 y  d
__________________________________________________________________________" b0 M' @* k( R7 J0 M. |& H- a
) r# ]) Q" f) p: t# b
Method 121 p7 R4 S; }2 @% K$ f- _
=========
2 N$ o$ p/ |; y, b# `, D& K8 w4 T6 u" r0 k/ G5 k
This trick is similar to int41h/4fh Debugger installation check (code 05
4 E& P$ _# b9 U# R6 T9 Z0 j&amp; 06) but very limited because it's only available for Win95/98 (not NT)) A4 n" G4 N5 R( f8 p+ P7 @" u
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.
% @/ n& W: V5 X4 E$ |9 ]) i6 L" D  ~% y, _- P4 M  p8 t
   push  0000004fh         ; function 4fh4 K2 ?. b1 k2 H# L( g; J# H: h
   push  002a002ah         ; high word specifies which VxD (VWIN32)
& F: O  y; O/ P: Y- ]+ d% J! D' w, ~                           ; low word specifies which service" V* ~; [, C$ m  v9 U5 x* `
                             (VWIN32_Int41Dispatch)3 c/ d$ Z# _. g  ^
   call  Kernel32!ORD_001  ; VxdCall* l8 P7 \4 l- j4 g9 H
   cmp   ax, 0f386h        ; magic number returned by system debuggers2 B. `1 `# d' G4 p7 T
   jz    SoftICE_detected/ @5 `" F  B/ {6 X$ p

& d3 ^4 [$ F9 G3 J% c( pHere again, several ways to detect it:2 o1 H5 w( I3 }$ s2 }- o

. [+ n, M! ]# B    BPINT 41 if ax==4f
/ c. N8 ?5 T& h. O: t2 _! Y- ]$ g! M+ r: G9 ?& l
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one3 _5 D* x$ ]# }
$ z! N+ ]  t: b; j
    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A' U) Q  f$ A( {! r- @' I

3 Z. [0 h9 r. [9 e5 G2 m    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!
* ~5 l1 c5 j8 F. i" v( C5 D" U( i
( Z. Z6 B$ w; t, F1 l% K& n__________________________________________________________________________: l3 O5 {* B/ g( Q3 ?, i" y! d
: c( H- p2 H0 B+ g
Method 13# N4 u; z5 _( x) _+ e' p
=========2 [- _  [& x+ u; f& A" G

" O1 z+ E4 L2 w- u' \9 Z6 v; BNot a real method of detection, but a good way to know if SoftICE is
8 [! W' a( h$ f5 J. Jinstalled on a computer and to locate its installation directory.) S! f5 H: ~. Z
It is used by few softs which access the following registry keys (usually #2) :6 z2 P4 O. D+ i8 ~1 m

: k( d0 H. O9 I% I3 @. }-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
) x, M- m1 M& w" O6 O# B1 U\Uninstall\SoftICE
4 u: \" R0 r# N3 G5 i" ^-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE0 z9 i3 ^: Y1 ^3 U6 L. t
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
9 ?/ I0 Q- |# }0 W; B; A\App Paths\Loader32.Exe  j0 V; p5 a/ ^8 U! b9 @2 L
1 U; \7 }+ W4 x1 }2 I
4 g& U7 b: u) e  P
Note that some nasty apps could then erase all files from SoftICE directory
# y& R9 x( Z- d6 `, Z6 D0 j; l(I faced that once :-(0 @9 e  L; d. {. G# ~  B
; c* d4 }7 ?" v; S0 P  r
Useful breakpoint to detect it:
9 c5 B. E% w! \. E" @+ @  z! E9 E: a( t, l+ K, h
     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'
8 b0 C3 |$ G' d% j6 i- p) |0 j( M' f: Q  x  l0 l* I% w& J! A
__________________________________________________________________________
: Y- n" B' A# I0 P8 j1 }  A5 W: ?1 i7 E) y( n/ t) M5 z7 K  D0 A
' y9 M3 V! I3 [
Method 14 : Q$ J  D1 r6 t  ]4 O; ^
=========% h" ^9 c: D( q

$ O& I9 h, A2 _% A1 i( aA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose- S8 V- q8 X; {+ A) C
is to determines whether a debugger is running on your system (ring0 only).
. H6 B, {. _4 q& J4 W; C- p: ^0 B* b3 o; x
   VMMCall Test_Debug_Installed" n& V" t& Y& R' Y- h
   je      not_installed
" v+ F* |* A4 E
' N, [6 R0 D3 W2 LThis service just checks a flag.
5 J8 F- L0 k" S. I9 G</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-5-21 16:24

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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