找回密码
 注册

QQ登录

只需一步,快速开始

About anti-SoftICE tricks

[复制链接]
发表于 2008-9-28 16:34:50 | 显示全部楼层 |阅读模式
<TABLE width=500>
. e: ?3 w* T6 }1 ~4 C6 f<TBODY>
0 ]4 S; U; k: b<TR>
  Z; L3 V4 p  S<TD><PRE>Method 01 2 v/ P5 R3 X3 c. G) J7 ^) V% l
=========1 V: K3 I& n& K) Z# u! W
4 B1 P: d& y' H6 K# \5 I1 ^: e
This method of detection of SoftICE (as well as the following one) is1 w  ~, a+ I/ n5 _$ K6 r
used by the majority of packers/encryptors found on Internet.' {7 p# D) ^3 G4 T, g4 J/ d
It seeks the signature of BoundsChecker in SoftICE, q$ N8 I4 G5 O
  c' A: Q6 b3 E" a
    mov     ebp, 04243484Bh        ; 'BCHK', x/ o8 n. C' t6 w" Y
    mov     ax, 04h/ P9 h- S1 V3 ]9 E! @
    int     3       + Z1 X) ?  f; N( v, b8 u
    cmp     al,4
7 L: l" `$ j: p1 @# x. Q3 |* E    jnz     SoftICE_Detected% m: E4 H7 y* d- |
( t% V! ^1 }% q' g6 k" L
___________________________________________________________________________
0 t/ C+ @& v% v( H, p2 b
$ t- j9 t1 t* B- u9 d$ ~Method 02
0 M% x% Q: z0 K$ F: |=========
8 p. H! N& D' k. P2 H! L+ ~6 k# n3 }) d) d' a3 Q7 q* `
Still a method very much used (perhaps the most frequent one).  It is used" F! r( y. F! G1 z4 c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 s& R0 m! l, [& q' C
or execute SoftICE commands...
+ N' z; k; B! a8 E2 [1 A# ~$ zIt is also used to crash SoftICE and to force it to execute any commands, ?9 m+ i1 g! C, J( ?( x6 s: [# W
(HBOOT...) :-((  / b, K( ^' }/ q5 [
3 Z* U1 g/ B0 t# i% v
Here is a quick description:
6 G; B  l! L5 P: Y5 c-AX = 0910h   (Display string in SIce windows)
# @1 v0 T9 Z1 p" p-AX = 0911h   (Execute SIce commands -command is displayed is ds:dx): F( N/ T/ w$ l0 k' P. D
-AX = 0912h   (Get breakpoint infos)7 m& [! ^8 l' e' G8 A/ ~8 q4 \: P
-AX = 0913h   (Set Sice breakpoints)
: q) [7 m+ P8 [2 [; s-AX = 0914h   (Remove SIce breakoints)" N% ^* z' ?& s+ j4 I
; ~6 b7 L9 t! {' ~$ D
Each time you'll meet this trick, you'll see:
% C) D0 e$ X0 _% R-SI = 4647h) x- _( t; J7 G) u  j" [+ ?
-DI = 4A4Dh
! ~7 t- j7 B- \. i) G7 P7 DWhich are the 'magic values' used by SoftIce.
5 E* }/ m2 X0 T. b* _( a2 S  nFor more informations, see "Ralf Brown Interrupt list" chapter int 03h.
7 Q" o1 V6 q/ D8 m/ H1 F
$ G# F) O% v, Y/ OHere is one example from the file "Haspinst.exe" which is the dongle HASP
: G, H) i8 J% d1 JEnvelope utility use to protect DOS applications:* Z- @5 W% _0 y3 y- N

! G  _% F7 R1 S' i1 h9 p  R
. q- G# p7 W  w* u7 k+ |4C19:0095   MOV    AX,0911  ; execute command.
/ f: U4 |: O. |0 l3 n! `* C1 c0 h4 q+ Q4C19:0098   MOV    DX,[BX]  ; ds:dx point to the command (see below).( T* O; C5 E  U% W% ]) H& X: E; V5 ?
4C19:009A   MOV    SI,4647  ; 1st magic value.
1 E) W5 q0 O1 T% ?1 X/ c' F4 ^4C19:009D   MOV    DI,4A4D  ; 2nd magic value.
) x1 p+ h$ T' ~! r3 b' N4C19:00A0   INT    3        ; Int call.(if SIce is not loaded, jmp to 00AD*)
9 E) J2 F5 C/ H% p2 u6 ~4C19:00A1   ADD    BX,02    ; BX+2 to point to next command to execute
) A: R4 c$ H$ Q" ~" R% K4C19:00A4   INC    CX0 B% ]8 D+ X( }- R
4C19:00A5   CMP    CX,06    ; Repeat 6 times  to execute+ ?2 m$ S; d; d7 L2 K( A/ O
4C19:00A8   JB     0095     ; 6 different commands.
2 S' Q  |- O" x! i, P4C19:00AA   JMP    0002     ; Bad_Guy jmp back.
! ^. v$ Q& a% r4C19:00AD   MOV    BX,SP    ; Good_Guy go ahead :): Q$ X0 M0 s, B, k

. V6 n  t1 [+ {# d# T+ l+ fThe program will execute 6 different SIce commands located at ds:dx, which9 L- b, j* `. J
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
) w( o! d5 T+ u' m1 V3 U; \
3 `8 g$ c8 f+ K0 o3 p/ |* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.7 z# {9 l: n* Q6 o7 g0 J. o" F. M
___________________________________________________________________________+ I" Q/ Z+ M) |- P
5 O+ G; h! W2 O! E
" A& _. J8 K  A: N
Method 03. f9 g6 ~$ _, W/ [+ x5 g8 k
=========
$ `4 s6 ?& {* c9 `; A
$ S: ]& t1 g" A& C8 CLess used method.  It seeks the ID of SoftICE VxD via the int 2Fh/1684h. V& f/ Y1 E0 }6 x- u
(API Get entry point)
3 p& @- c# a8 F9 f, U4 O3 \* C% n6 w        % L# B  s- R, k  {. X, D: x
( M2 y' m0 N1 B2 d
    xor     di,di* a/ Y/ |* j5 o6 C) N8 S
    mov     es,di
5 l, ~+ B" \9 L+ M, D    mov     ax, 1684h       & N. i' D- x' Q: s$ H, R0 y) n# U
    mov     bx, 0202h       ; VxD ID of winice: c% a$ r! M1 L. l; A8 n; r! o' s
    int     2Fh6 O/ X7 U# Y, r
    mov     ax, es          ; ES:DI -&gt; VxD API entry point
7 a- m' [: O3 f) T6 Q5 q    add     ax, di  A. n2 k$ o& M& l
    test    ax,ax6 `2 S, h1 p4 t7 R
    jnz     SoftICE_Detected* h  K; t! t8 ?) m0 \

3 x5 E. G7 [9 l) V  H___________________________________________________________________________7 D/ R# b* x5 O- X4 I) r3 L

# c  {$ `0 k( l: h8 bMethod 04
/ N2 I% w' M& U0 J# T=========0 K0 r2 e2 [- _

/ F1 H1 A5 y6 k% h( j, _1 [Method identical to the preceding one except that it seeks the ID of SoftICE& `3 |  q3 p& U' d5 \% _5 `" K& R
GFX VxD.  w) W* G: B& F' K: U% B  W* E
; V- ]4 _# ~0 `/ i# z9 Q% O
    xor     di,di
1 A) ?, b/ H; q) U9 k* Y3 k! Y/ t: T    mov     es,di5 f; u: i& ~4 ?3 x+ y
    mov     ax, 1684h       , ^( M" c* T1 b/ f/ Z* @
    mov     bx, 7a5Fh       ; VxD ID of SIWVID8 g3 n' m2 r/ ?8 A
    int     2fh! L* _7 u/ ^. p" J5 T; o
    mov     ax, es          ; ES:DI -&gt; VxD API entry point1 e; G+ n' D( D! W! _+ K
    add     ax, di
+ {+ L$ p6 T! ^: @# k8 _2 w/ L, I    test    ax,ax
* r0 u) n" V% a    jnz     SoftICE_Detected
2 }# A. O/ b9 }8 q
% a4 z2 f8 `1 M) Z3 ?__________________________________________________________________________
) K2 @) k# ?: @# W/ e) t% e
2 Q4 O, e% k2 Y. F9 g0 v, p$ I, J0 ]$ V% R3 I* y8 u" h
Method 05
' j# m3 I/ u5 e7 i=========
+ J4 f$ {9 m/ J1 ]
' F* h$ {4 \( w  n" jMethod seeking the 'magic number' 0F386h returned (in ax) by all system3 B& Y& S. j4 J4 u. U) m$ M/ V6 S) Q
debugger. It calls the int 41h, function 4Fh.4 Q6 \& a# d  Y! l# l
There are several alternatives.  
2 z8 h' x$ s2 ?" N3 N7 n. d$ ]7 v( X2 b8 r
The following one is the simplest:
* x0 W# V! S) i" v  j0 G( }2 c$ \0 t- y. \  p
    mov     ax,4fh
3 o2 w" ~- p) L" f    int     41h
9 q6 \, O3 a! Q, M    cmp     ax, 0F386
- H) x( O  S# g4 T3 y    jz      SoftICE_detected* \) o. ^5 L$ G- r: ]  m" R

$ q. e( I, V& t6 U$ o3 Q7 R) v' A$ p5 v. c! `/ H
Next method as well as the following one are 2 examples from Stone's
; f- A% r! R" T) W6 w- h$ ]"stn-wid.zip" (www.cracking.net):
; S8 H) D6 n0 N' E7 V& g( I+ ]+ [( K8 m% D% k8 M
    mov     bx, cs
' g. i/ _9 ~% ?6 s- }: F    lea     dx, int41handler2
! X& V0 T2 g9 |+ N) H7 ~1 M, N    xchg    dx, es:[41h*4]2 e( Z/ ]. c+ w; U8 m, C
    xchg    bx, es:[41h*4+2]7 U9 K( ]1 k$ ?
    mov     ax,4fh+ h1 i+ i" h* }$ x1 M# y
    int     41h" E4 V. H2 w' g! ?. z. J, ]
    xchg    dx, es:[41h*4]
2 ?+ P; [3 {( R5 {2 U    xchg    bx, es:[41h*4+2]: r' e) @5 ?( D% w$ v! {$ M, Q: B4 a
    cmp     ax, 0f386h2 M0 f0 l3 I. K9 P  j5 |0 {' O
    jz      SoftICE_detected  r8 z+ a4 W8 Z; W
1 x8 j; W/ D6 D5 B' D* [; c
int41handler2 PROC
' @9 R# I) K% U$ r/ F, [    iret. n3 S4 H, T' d( X+ G; a
int41handler2 ENDP! }* v6 f( X) n+ A8 T+ I) d

% f6 m. p# q/ {4 Z' V/ |! ?: Q; y3 @2 s& v" m7 j" K- B
_________________________________________________________________________
/ B, Z; J5 [' z+ F2 F
$ q  W: q) S: U: L) I8 {: b$ n; c) O& J" R" b
Method 06
* ~, V2 u% M8 e% q9 b- \=========' |+ r2 M; M1 u

9 R* O$ q& `' \! K  X5 ~. W1 {, [& T9 |9 r0 W4 W
2nd method similar to the preceding one but more difficult to detect:0 r, A( u4 B$ V8 ^

7 I! x% q3 U1 |" w# n- L! M
: e: }6 l: ^3 B5 Y/ F2 rint41handler PROC# g$ L5 V6 b$ y( s: y
    mov     cl,al; ]. a& T2 r: W  T" e) x9 G5 P" y# v
    iret0 ?0 s$ l4 I8 M1 T  E
int41handler ENDP
  Q! n) i6 \- S
7 s3 V; N7 Z/ ]  G4 p/ t; w$ F- F3 h  F8 |: T( ?
    xor     ax,ax
7 E( B% u- G8 `4 A" w6 X    mov     es,ax5 o! \0 E0 \8 J' _! u) Z
    mov     bx, cs4 x! W' T% W5 n+ I/ c, N
    lea     dx, int41handler
- S+ A6 y  _/ Z3 C    xchg    dx, es:[41h*4]7 N5 G2 k% _! ~- @4 o
    xchg    bx, es:[41h*4+2]4 q/ t, ~! B$ E3 x
    in      al, 40h& Y0 L: z8 Y. _! D
    xor     cx,cx
0 V1 q2 j6 l6 d8 Q  V1 k# N, |+ X    int     41h& N: B( M3 I2 i6 r* p" m$ _
    xchg    dx, es:[41h*4]
( c: Y/ a2 d; Q- k+ f$ a, c    xchg    bx, es:[41h*4+2]
9 J+ ]* f# Y, M0 m) ^+ @2 N+ [$ B$ [3 D    cmp     cl,al
" H  z* A" X( x! |! W& l    jnz     SoftICE_detected
( Y# [9 H, t0 h2 u& H. k7 f" w7 `/ w$ x3 v: U4 I/ I1 r+ v
_________________________________________________________________________3 F* f4 `* m  F! Y  ]

' ~, g9 c+ E' o! b, gMethod 07
3 F3 h( ^) N4 t=========
1 G1 m3 C% w9 X4 K8 g3 Q, }- u8 U( ?1 {, t* ]
Method of detection of the WinICE handler in the int68h (V86)
1 C9 V5 z" u8 P% j& x  ?  M0 E# M3 Y9 L  H' s
    mov     ah,43h6 k! c, M( V  D, I& @/ V9 P( i
    int     68h
& j" k% X  h8 H% k3 u7 l4 q! q    cmp     ax,0F386h/ a) Y  {& a6 Y0 G
    jz      SoftICE_Detected& e: R* @, u4 J, Q# _+ I: y
0 ^8 I# H! O. J- l9 e
: {3 a; F9 s+ o6 i* R
=&gt; it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
0 u4 {1 I# o4 c, R. {8 F: l0 Y   app like this:& [8 @7 {5 w. [" V5 ^- V. z: G
$ F! q9 G9 y8 k0 M9 N: l
   BPX exec_int if ax==68* L* H" W3 C7 z" d* e
   (function called is located at byte ptr [ebp+1Dh] and client eip is
3 f2 d" l5 f8 J+ P  x   located at [ebp+48h] for 32Bit apps)
3 l# u8 N; X. G, I& u8 \( V( a__________________________________________________________________________& a% j& M! k3 ^+ S7 f

1 _* n5 s( _( d# q$ ^/ Z" F. z
. t0 H6 V5 h9 b5 W  C+ cMethod 08% S: m: J4 L6 d$ C7 N; q6 [
=========, t' t% R! ~& ?% |9 `
4 X2 f# {9 _2 ]6 t  ^. _& ^
It is not a method of detection of SoftICE but a possibility to crash the! o4 J; D/ r7 O
system by intercepting int 01h and int 03h and redirecting them to another
. l/ S6 I) ?0 H0 \" Droutine.! M. y7 I1 i: J2 }
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points7 g+ v4 k) O* q' M% K3 Z
to the new routine to execute (hangs computer...)0 N  _7 p2 R/ x: A& I

) l# `( h+ _0 E" D' `    mov     ah, 25h* N2 |4 x$ k+ E4 h; b
    mov     al, Int_Number (01h or 03h)
4 i* `5 J. k" a0 A8 l! C    mov     dx, offset New_Int_Routine/ x) x0 m0 i# f/ C
    int     21h; e# F# q" n. Q
8 W; K2 J& i1 \/ o% K, _# `$ }- G7 E- z
__________________________________________________________________________
8 h- x& s+ y% v- e0 M6 v/ e
. ], X; m+ ~- d3 J' s$ a, NMethod 09+ W0 _" g3 j! O" \5 a; B3 ?
=========
# L- }) _; b0 H* }
0 M7 `. m, N" T: ~% GThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only6 p6 x- v( h) s
performed in ring0 (VxD or a ring3 app using the VxdCall).
! S( [1 }) l8 B! VThe Get_DDB service is used to determine whether or not a VxD is installed
" r: F1 G# d) A( ^0 Q/ n! Ffor the specified device and returns a Device Description Block (in ecx) for$ }2 h% x1 W' _: M& o
that device if it is installed./ t/ C) V( U- E2 g% h+ U! L

" ~& a0 l. T" ^3 b   mov     eax, Device_ID   ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 v* t& r9 }6 [' r- j# b   mov     edi, Device_Name ; only used if no VxD ID (useless in our case ;-)% @( c9 t; n- I+ A2 a  a
   VMMCall Get_DDB
$ I  O8 V. t0 d/ l   mov     [DDB], ecx       ; ecx=DDB or 0 if the VxD is not installed
  O. l) f& z) A, o* b/ R- W) M7 U, K% \; V
Note as well that you can easily detect this method with SoftICE:
# L1 b0 P% D8 @, N2 e   bpx Get_DDB if ax==0202 || ax==7a5fh
0 |; c8 S- U# d' s% M  s6 p  x: c# G2 T
__________________________________________________________________________
7 o4 C2 V: D$ Q' a1 H% e% [% G& a0 L5 F- |8 k" I8 N' v
Method 10; J/ |9 W( Q; n! V! Y8 K1 V
=========- d$ b  k0 C' \

& n8 ?1 K9 p# w% R7 P& q=&gt;Disable or clear breakpoints before using this feature. DO NOT trace with
/ [; R. `6 `, I% _1 V  SoftICE while the option is enable!!8 z# _- m1 _+ A& W

! @# S2 e* k  HThis trick is very efficient:
, {- c2 o3 H1 R$ W' bby checking the Debug Registers, you can detect if SoftICE is loaded
1 b5 ^9 V+ E. @( E% R2 Q3 L(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if0 t! U' }1 k  b% y
there are some memory breakpoints set (dr0 to dr3) simply by reading their3 ^8 Q! T; Q5 s) q9 l  N
value (in ring0 only). Values can be manipulated and or changed as well; V9 F+ o  W. X* F
(clearing BPMs for instance)* j. R( f, ]' u+ n

7 p4 L- [+ l% Z( r6 ^, G__________________________________________________________________________. d$ h2 o$ Y, `& D. ?. p5 z

' m+ b; C! b% T: q" L& OMethod 11
3 ~6 |: B& f! y" ^) i=========
* ?5 r  X8 |4 P) i7 e/ f3 Z) X+ s5 d8 U& Z9 h4 f+ x
This method is most known as 'MeltICE' because it has been freely distributed* ^6 r+ @% ?" z) S. w
via www.winfiles.com. However it was first used by NuMega people to allow, b% l3 v: W/ |! n" J5 v- r. h
Symbol Loader to check if SoftICE was active or not (the code is located
  K7 y, J" A7 O  a! c. Xinside nmtrans.dll).
  ?  z9 P+ m/ R; W+ f* Z7 @2 E  K, A8 ~1 N% y* K
The way it works is very simple:: I( h. i$ V5 b/ B. c
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for# r% u: Y- J' m3 U9 M9 R$ A
WinNT) with the CreateFileA API.6 g. e; v( B" m

* R4 z; I$ s* k! a( Z2 [, Z, ~Here is a sample (checking for 'SICE'):0 d, ^1 Y( C4 l! |) Q/ @

( a( v: }+ w! e- R; cBOOL IsSoftIce95Loaded()0 b+ s( u/ X4 e6 T. v( G
{
- K! H4 u- D' g# |' i! J   HANDLE hFile;  
7 }7 u* j" ]5 }. d   hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,0 X$ Z1 O& z: h7 s( v
                      FILE_SHARE_READ | FILE_SHARE_WRITE," z$ W0 s9 B* O0 A. X( C
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);9 _  p0 B4 t& p
   if( hFile != INVALID_HANDLE_VALUE )/ p: p2 I# E7 A& f, E3 B+ q
   {
6 P4 m3 f& a3 j6 d! i      CloseHandle(hFile);
! p  W7 I; i: K* L; D      return TRUE;  {6 [- P, {1 @
   }
+ U- H# P# g3 X- J* r0 I   return FALSE;
2 a6 D* I$ C3 \% [* d" d}) R) w) L0 b" v) X% K+ J0 W
7 ~8 x% Z- K  b
Although this trick calls the CreateFileA function, don't even expect to be$ j, f: G' z) `, V! Z$ M. q( E
able to intercept it by installing a IFS hook: it will not work, no way!
+ U, M' Q+ e7 E+ g7 i9 GIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
5 W/ e& {  T8 X4 b" {9 Iservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)
! k9 @" A  J% ^4 a( J$ h: K) I  aand then browse the DDB list until it find the VxD and its DDB_Control_Proc0 s" U; g: x/ v/ T! M& p
field.
3 _3 S" V0 a  U! cIn fact, its purpose is not to load/unload VxDs but only to send a 8 k$ ^) z6 G; \4 p
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)+ {/ m) t' N  k4 Y5 Q- g% q
to the VxD Control_Dispatch proc (how the hell a shareware soft could try
& z6 M  J- @& p% J* Q' Yto load/unload a non-dynamically loadable driver such as SoftICE ;-).* m, j1 P% Y. N) j, Z
If the VxD is loaded, it will always clear eax and the Carry flag to allow/ {% A& W3 [  j9 I1 g  h# ~+ @1 c
its handle to be opened and then, will be detected.
3 [: @" l3 B7 ]7 h% aYou can check that simply by hooking Winice.exe control proc entry point: L9 x9 ]6 z1 [- d, V* P" ?
while running MeltICE.2 m. i9 i" H$ M$ q9 k& M9 `& Q( }5 h
  b: W3 x3 S; j. H, m" R) A& l. h

# ]$ ^$ [1 _8 U+ [  00401067:  push      00402025    ; \\.\SICE/ k( z8 v6 h  z# o
  0040106C:  call      CreateFileA' ^$ ~& \" L" ^$ I
  00401071:  cmp       eax,-001
0 J4 ~- @/ G0 Q3 y6 q  00401074:  je        00401091
4 i9 p6 S+ F& u% ]; T
8 c$ }" {3 Q0 o2 ?
" Y- t1 ]9 F, E7 H2 b8 zThere could be hundreds of BPX you could use to detect this trick.
) X7 ]" a; s' O/ i( g9 G/ n-The most classical one is:
" E# m7 u; j* _  BPX CreateFileA if *(esp-&gt;4+4)=='SICE' || *(esp-&gt;4+4)=='SIWV' ||$ L* v$ O+ I' o: B: o# a: h
    *(esp-&gt;4+4)=='NTIC'
8 B3 |; S. d' W& n: H
/ _: g( m' c8 m% m, ~- u8 Q- v-The most exotic ones (could be very slooooow :-(0 S6 X1 B+ T9 I- M9 h3 ?
   BPINT 30 if eax==002A001F &amp;&amp; (*edi=='SICE' || *edi=='SIWV')  
/ l8 G/ P2 K+ q0 \  z     ;will break 3 times :-(
; Y8 y+ c. c! `% e0 _- D1 V
5 ]5 N+ v, R3 j$ t  S; Z3 B-or (a bit) faster:
3 k1 w! i& G4 p' S! S   BPINT 30 if (*edi=='SICE' || *edi=='SIWV')9 Z0 n1 B6 u4 R' H
* j6 [- d6 t& z) z! A8 b
   BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV'  
& k# j& s1 A+ N0 ~  V( s     ;will break 3 times :-(
! Y: m" i5 J0 _9 v) ?3 b  h; j$ o9 l  f- s% u. g' L
-Much faster:4 p- u; B% `7 C/ L7 a  L4 r" G7 S
   BPX VMM_GetDDBList if eax-&gt;3=='SICE' || eax-&gt;3=='SIWV'
$ J) S& q- ?: }
: n  C8 t! H5 o: t( Q* nNote also that some programs (like AZPR3.00) use de old 16-bit _lopen
2 |: _% L8 u9 S. O8 ]+ p/ Dfunction to do the same job:
* B, ?9 _& ?' q3 g# K' ?# y0 ?# u8 R' \9 j* \( }" u& K& O
   push    00                        ; OF_READ
: x/ v' ^0 C. a   mov     eax,[00656634]            ; '\\.\SICE',0
5 o* k! D: F5 T   push    eax- r& Z; Q% W( ~( x  N
   call    KERNEL32!_lopen
! _2 ?6 ]% I8 q5 i   inc     eax, P( _7 {/ w  r7 {1 f
   jnz     00650589                  ; detected
5 |& ~2 e3 Y- d" h$ C   push    00                        ; OF_READ' n# Y7 |) a; s1 v- H
   mov     eax,[00656638]            ; '\\.\SICE'; P  z. K4 w3 R2 Z3 S
   push    eax) g) r. U3 [) u) S3 j6 O; q
   call    KERNEL32!_lopen8 Y/ @# K/ U) D3 {* X; C4 C& b
   inc     eax3 @/ J: R% Z" C) I+ K; Z
   jz      006505ae                  ; not detected' c/ V" A8 e5 x$ O

6 X1 g& x. Z2 F9 w% ?
% E- b6 N* x( L6 S__________________________________________________________________________
' e1 W  d: f' V( W& V6 s  l8 E' z# f) p$ F3 Q8 m
Method 12
) l7 T  ~$ i% E7 c$ @* q4 h% X: d=========3 ?% h6 ?1 ~$ }- G! M% M

) K4 Z* e/ X0 V/ ^; Q/ ^4 {This trick is similar to int41h/4fh Debugger installation check (code 056 @. i) H; a  M, M3 @0 `
&amp; 06) but very limited because it's only available for Win95/98 (not NT)
2 ]6 I/ C, i. Was it uses the VxDCall backdoor. This detection was found in Bleem Demo.( X- @7 l9 a: j3 w

  @! w, U+ h! h# h6 a  g  l, q   push  0000004fh         ; function 4fh( Y6 g! O4 C! i& q. \" a! i+ f
   push  002a002ah         ; high word specifies which VxD (VWIN32)
5 M: h, }/ S. p6 i0 I6 n1 I                           ; low word specifies which service  O; u5 {# r9 \
                             (VWIN32_Int41Dispatch)
+ I7 A6 B( y( ?   call  Kernel32!ORD_001  ; VxdCall
7 h% m: C" t. z# H   cmp   ax, 0f386h        ; magic number returned by system debuggers
0 v3 f- Y; `$ C% y9 Y6 o   jz    SoftICE_detected& {. e; [, J. J' ^+ n

0 h0 U- L/ N- N$ W& g: wHere again, several ways to detect it:$ x- z; K3 W/ c( b5 ]
4 M. m' _# K' a3 T2 {; I2 @9 C; ?
    BPINT 41 if ax==4f5 y5 Q: |2 U1 S+ x
& @& i& ]6 q5 B7 h: C. d( Y
    BPINT 30 if ax==0xF386   ; SoftICE must be loaded for this one, n  R3 y) C8 B) q. i

( ~! U" A* D  P2 o4 w    BPX Exec_PM_Int if eax==41 &amp;&amp; edx-&gt;1c==4f &amp;&amp; edx-&gt;10==002A002A$ o% `/ e- H- E6 N. G: y
+ C, s* k4 v9 t  G8 E
    BPX Kernel32!ord_0001 if esp-&gt;4==002A002A &amp;&amp; esp-&gt;8==4f   ; slooooow!' R, x7 A! f  K+ T4 W
0 j5 F) F& [1 f: Z7 b, J
__________________________________________________________________________5 X: k( j+ a( _. n

$ _' E% D) T7 q2 ?! ^" xMethod 13; T( n" M" z9 X7 C/ _3 L
=========5 Y  K* u8 t& M# ^" I

: V2 X" c8 ?( t0 s: E  CNot a real method of detection, but a good way to know if SoftICE is
2 @& _" K7 F5 Vinstalled on a computer and to locate its installation directory.. C7 C- M, {  c
It is used by few softs which access the following registry keys (usually #2) :
/ E  P5 a' T. {* L' g: x8 w9 i; Z2 f' R
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
8 i0 [' |% Y! m2 Y' l! v\Uninstall\SoftICE' m2 Z% _# V) ]/ M9 [* D% g
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
; D/ A( s7 M+ c- ?8 r-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
" e# ^5 w4 n+ ], S$ r1 n' X\App Paths\Loader32.Exe
5 a/ S. V) I5 Y, W
" l# P1 a$ c' @- z* u! A" t! R2 i8 ~9 p7 H3 p! J
Note that some nasty apps could then erase all files from SoftICE directory
, ]# g2 ~/ x, Z* z' @(I faced that once :-(0 I3 T+ |5 T& T
8 j/ I" `) b3 ^3 Y$ f
Useful breakpoint to detect it:
6 i  v& {, u0 J$ P3 A1 X
9 c. t7 L  H5 H9 o     BPX _regopenkey if *(esp-&gt;8+0x13)=='tICE' || *(esp-&gt;8+0x37)=='tICE'9 G, p4 O4 @0 a, i$ X( l1 c
* L1 [4 U7 x" k7 T+ c4 {: H  s
__________________________________________________________________________/ P4 i$ e) B% ^. \

& T) `- E) G* j- o+ d- u% g/ W- L4 O3 Z
- c% Y- I! x4 T+ G; ?1 ?/ vMethod 14 / k0 {# M% M2 Y; b7 e: x
=========& d$ ?! S/ t' Q0 p! }, @
' U( [7 J) e/ W
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose
0 d" {( K# s6 B1 C2 d) i% x/ |is to determines whether a debugger is running on your system (ring0 only).
, R) i8 ]1 [- |" \6 l( I4 I1 o* W, \* u0 p% B! r  j: v
   VMMCall Test_Debug_Installed. u) a  u# @# Q0 d4 K
   je      not_installed
6 }- i0 Q- r( d7 x
4 X# I& |1 I' ?/ G, DThis service just checks a flag.' S) l3 ~+ N! I' C3 z- K1 v
</PRE></TD></TR></TBODY></TABLE>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-7-31 12:13

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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