<TABLE width=500># t" V) @5 [. b# o! u$ |
<TBODY>6 y' I( {5 L- F- l V: _5 d% @
<TR>
' @5 g1 F# Z4 N* s<TD><PRE>Method 01
& \% b. K `4 M+ Q- G=========' M: H0 s" r6 h5 v+ O, w* Y
8 y- l. d8 S4 v! QThis method of detection of SoftICE (as well as the following one) is( }, D& Y' l* A6 P- G
used by the majority of packers/encryptors found on Internet.
" _3 b7 l& }' r# K. E9 vIt seeks the signature of BoundsChecker in SoftICE
9 |5 s$ b& z& c: q4 S u |
( f" o" w5 G0 A* E- K9 f) S mov ebp, 04243484Bh ; 'BCHK'
3 h, I- r7 q# M9 G& c' a. [ mov ax, 04h. B: f s) Z/ V1 f
int 3
3 E6 P( b1 k5 \) j/ A2 L' u cmp al,4
1 Y- y; [( ?: `& _: }( ?- e* h jnz SoftICE_Detected
4 N+ i8 d- Z" l" t
! R6 \+ O3 v9 u; H8 H' ~___________________________________________________________________________
3 @: O. u' w) o6 f: ]3 |- J
; M- c' @' I6 `5 r/ i0 ]Method 02
/ N4 K4 k) J7 _* t9 C2 N1 V3 p5 B=========: J( T& {; ^$ V1 X, Q
# L. U# m0 l! P3 _7 G8 Y0 {
Still a method very much used (perhaps the most frequent one). It is used* e# y- B1 C7 J8 u; c
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,
2 e# Q' U$ n* @: a. o& T$ Z( ior execute SoftICE commands...% C$ S0 \$ N8 `( m3 F
It is also used to crash SoftICE and to force it to execute any commands
8 `* ]+ {- S: s, d8 m: m(HBOOT...) :-(( - N& P- @0 e" P) t; e
7 i! `6 S! q; X+ m9 E0 A" Y
Here is a quick description:' F. O2 s- N! t! h. ?7 R5 Y
-AX = 0910h (Display string in SIce windows)3 D/ u% X+ n9 j1 L; I9 B1 z
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
, t& l% v3 `, @" O-AX = 0912h (Get breakpoint infos)0 R- F x. v" h; Z: t
-AX = 0913h (Set Sice breakpoints)1 W- ] S C% W+ v$ I
-AX = 0914h (Remove SIce breakoints)* Q7 {4 ]9 I8 X4 p+ E$ Q' F: l# k
- b# _" d, w% F* N- aEach time you'll meet this trick, you'll see:2 l" b1 ]3 c% X# u+ u6 ^
-SI = 4647h. x1 V* j: J' K0 Q7 A3 q
-DI = 4A4Dh/ k- i4 {' a! w2 @; T3 g
Which are the 'magic values' used by SoftIce./ n. a' G2 d v
For more informations, see "Ralf Brown Interrupt list" chapter int 03h., \ z. D6 U0 h, B; O" I
7 Q$ }2 B" i9 ^% |+ K$ g+ t4 i2 \6 hHere is one example from the file "Haspinst.exe" which is the dongle HASP5 S. [# K2 \9 ^4 f* z' h
Envelope utility use to protect DOS applications:
! _/ B4 e6 w$ E6 |, x! ^% ]: b; Z9 ?. P
" G0 U; H1 D, w5 j8 L! J/ h4C19:0095 MOV AX,0911 ; execute command.
& S& i9 Q; J* e) p9 l4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).
- `2 [& S0 M) O2 {4C19:009A MOV SI,4647 ; 1st magic value.
* |! p% ~- W: o9 g, m) A4 t5 l5 S4C19:009D MOV DI,4A4D ; 2nd magic value.
6 R* @* a) n8 d2 U- r/ ?% `" x4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)8 ]. z( p7 C; q- E& _
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute1 Y- N+ m, o4 b7 M8 `# R3 e
4C19:00A4 INC CX
# `" Z+ d: g" U$ Q" ^# I4C19:00A5 CMP CX,06 ; Repeat 6 times to execute+ T' ^( X! g& ]& k0 C' ^/ f
4C19:00A8 JB 0095 ; 6 different commands.
$ h5 z- b* O$ {6 b( X, s4C19:00AA JMP 0002 ; Bad_Guy jmp back.) E% a8 J7 f$ ~7 S7 T
4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
7 o' q- q0 ^$ g+ l
3 m# n& h7 D1 U- tThe program will execute 6 different SIce commands located at ds:dx, which
, f& M( X/ D' {9 r. i3 hare: LDT, IDT, GDT, TSS, RS, and ...HBOOT./ y. @( Z9 y" B5 M- k( L/ z
$ r( }* z$ J8 P) y. _* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.
/ t$ Y3 k* \1 r2 f___________________________________________________________________________- d) ]6 S, R5 D2 ?% G( y
/ l( ]2 C4 @8 G( ]# b1 U
4 H+ @+ z" x7 d/ _% F* @
Method 038 w& H9 D8 O7 A! e, @
=========
1 `1 `* P( |1 H5 E/ O! ~
! p! {. E' [9 w& O% |1 x, ^Less used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h
. o- h' u& x6 G8 T6 B! i2 r(API Get entry point). U/ r1 u' e2 S; V0 z) m. @: e0 y
1 v a! P- M4 c# c7 j* a/ _3 M3 {' M$ \) E
xor di,di
8 i+ [! s+ U% {+ ?9 A mov es,di
' Q4 c; n/ O6 q9 r mov ax, 1684h 5 f$ s v0 M+ q! b# k' ~
mov bx, 0202h ; VxD ID of winice) G) O" @) ~9 R* A$ l; E- F
int 2Fh
8 U$ n* A6 a2 Y5 i2 m# f! H8 ~ mov ax, es ; ES:DI -> VxD API entry point/ w5 U$ R- M1 j5 t- F
add ax, di
$ e, o j2 E: Z U. o test ax,ax' Q2 O5 y& F; f/ T1 w# v1 t
jnz SoftICE_Detected4 l8 n7 v. R* J+ ^+ i
J0 S& t& Z: n+ y& s+ p___________________________________________________________________________
& H( ~, y8 H! p0 m7 {- E. J% N+ g# _9 |( `) g- x- ^5 R+ p* P
Method 04
3 }7 v& D- D; u& }1 i4 o6 {1 A=========/ z3 V- s; C1 F7 ?7 Y: w/ o& [
9 L% t- o0 @9 @3 e4 u9 s4 a
Method identical to the preceding one except that it seeks the ID of SoftICE8 q" k I5 V: t, A
GFX VxD.
3 I7 D/ \" s) {$ p2 i' H8 S
/ F0 p+ p8 V* P xor di,di
+ z* }$ l. a* N9 p( F& ? mov es,di# Y7 P$ I0 p% {! U, F
mov ax, 1684h
- o3 A: V+ C5 E6 M) y0 h: l mov bx, 7a5Fh ; VxD ID of SIWVID
- U9 h0 ?3 H/ f( I" C int 2fh
# Y3 Q- }+ D4 m# I mov ax, es ; ES:DI -> VxD API entry point
9 T) R" M, D/ F2 ]$ Q& c add ax, di
3 ?/ b+ g; ~( o; r4 S/ T/ E+ H test ax,ax1 P" Z3 b! v& N3 D' f7 ^3 T; L1 `; g
jnz SoftICE_Detected; q, @3 V# j5 u1 T2 G
d2 v: A3 D* a, p$ [1 c" N__________________________________________________________________________
9 a% k6 \* d4 n9 d+ a8 }1 t6 d+ U$ }, ^( Z Z2 f u
" S& ~* i% |. h( m# `0 P
Method 05
: P3 Q% T8 [+ ]5 @=========, G' @4 {( A3 q( ]
5 K4 R3 K- o4 U+ ]/ VMethod seeking the 'magic number' 0F386h returned (in ax) by all system, [- }6 \. h1 ]0 X# |
debugger. It calls the int 41h, function 4Fh.* A; k/ x- W1 t( T5 m
There are several alternatives. 7 p8 o, @. o# _
6 O* b$ z/ u5 ^& x0 \. T) U
The following one is the simplest:
, e6 r2 y3 h$ \' v- d; |! @' d# ]2 y, A" j
mov ax,4fh
# d0 P$ d: p! I+ _9 z; G2 q int 41h
/ y' N" w2 S" f' F cmp ax, 0F386
' l" w6 L5 {5 m: {# y# [ jz SoftICE_detected& i8 P H8 F: U. B" |) [& U
! v# `) P: [& H* c3 t+ c) m/ S# i$ v1 p) L7 b" g' C
Next method as well as the following one are 2 examples from Stone's % G; [- e: u; y+ q% e3 q# i
"stn-wid.zip" (www.cracking.net):
" ]! x: Y$ q1 a' v: E, V4 d. l8 V$ @( {2 b
mov bx, cs
- F7 \2 ~9 X' f2 B$ | lea dx, int41handler2
2 J. S7 `0 v- Y5 V, ] xchg dx, es:[41h*4]2 J+ p$ h7 \+ w% z0 `* S: D
xchg bx, es:[41h*4+2]
4 w$ |8 J5 ^) a; V0 L) E' M& }. @5 E mov ax,4fh" `* m& ~! i( r D% C
int 41h
0 n! W6 d u# o6 b+ ]" b v xchg dx, es:[41h*4]! |" F. l9 S$ {! p4 A
xchg bx, es:[41h*4+2]
/ b) W$ b2 }6 g; U& p8 v3 n6 \5 x7 o cmp ax, 0f386h
4 e9 l% V/ o$ i$ p jz SoftICE_detected
" T9 F5 ]) z1 _/ R5 r7 ]
* R' v8 B7 T5 Q, ?$ _% {int41handler2 PROC
% D/ I) C' |% q, s* C iret
' I2 O/ \- d( c4 }$ E+ {1 yint41handler2 ENDP
3 `. I& u2 F7 z! R. ^
5 u& u# M5 ]. L+ O* M) V
4 `. U2 v* q- u) @+ W_________________________________________________________________________5 U+ I7 C( z: w! S0 P1 C! n0 ]' b
' c" C3 S6 i$ w1 ?) m
! l( J7 I5 Y4 R3 gMethod 06
4 q7 s# e7 S6 T& ~6 o7 |+ _' j=========& }, y5 ]5 A2 R' g* I, K$ W
$ f, F2 }; Q( Q! _& Q% \* R% k0 E* q' Q" a1 r
2nd method similar to the preceding one but more difficult to detect:+ A/ L4 I7 f2 c; x8 M
# X/ V* l! E( ~4 L
5 S0 `* Y! l6 {) O1 a8 iint41handler PROC- O& |( \( j' J+ u1 }* K
mov cl,al- D& [8 D4 G( Q3 b* P) ^) `
iret
6 Y- i8 T( l! P. K, oint41handler ENDP) R# D; O2 [3 l- K0 s9 h9 [
# ?+ g; W! p+ q5 M+ X9 a7 |1 w
xor ax,ax+ `3 F. N4 ?9 b. L- b4 V2 I. _; e7 x
mov es,ax
2 [9 Y4 S- k/ N2 P% W mov bx, cs, ]* M- ~" k7 h" H) @" Z3 Q0 |
lea dx, int41handler# j- U2 \/ t& U- b/ N' O
xchg dx, es:[41h*4]% L: N* O% ]: k6 Y' r7 p
xchg bx, es:[41h*4+2]4 i+ }2 W3 X, r+ h; Y" S
in al, 40h
9 X6 i, e: L7 ?6 H' x xor cx,cx
* ~7 B5 S4 U4 p int 41h
i2 X, |# |( E6 l xchg dx, es:[41h*4]
9 M" U) A) d* s& q2 w6 y2 l xchg bx, es:[41h*4+2]
8 O6 W0 E+ `8 a: E- X5 `& ~; W/ @+ A2 z cmp cl,al) ?) Q6 S8 \( i0 S+ Y* r
jnz SoftICE_detected
' \' j. d" u) Z0 K3 P$ N8 f
: f. f1 R U; a4 p$ j_________________________________________________________________________
* Q8 @; G5 b: m/ q& a% X/ n$ t
# _9 A) X5 h9 k# x1 l( ?Method 07
* ~; M2 Q2 Z8 [; |% [2 m=========
& b1 t: O8 [7 @9 p6 k# [, M! P _2 A+ ?
+ ~3 C& n5 r6 G* j. {$ Q+ ]Method of detection of the WinICE handler in the int68h (V86)
/ T P% H& i* {0 O; ^2 ]
7 n% U4 z/ Q* @5 c6 i$ N, d mov ah,43h
; [' }6 S1 Y" c P# r' T int 68h
% ?: q' W# E0 \8 d' b0 A, h6 A$ ~ cmp ax,0F386h1 X! W3 v( K) ^- O" Z" w% \0 X
jz SoftICE_Detected8 H1 o6 V; e/ i, N( B. t
6 c' l' O7 e$ A$ Y' H
! e2 `# U3 [- z0 ^# N$ |) w* B. e
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit M- }$ [! ^& T2 Q: H" z
app like this:* a1 Y6 y/ x1 `% O- H5 B5 n) `
% ]5 n7 j( J; |$ d0 n* a BPX exec_int if ax==68
7 w6 a3 d, X" k (function called is located at byte ptr [ebp+1Dh] and client eip is
/ g5 e& i0 j- O+ B& v% | located at [ebp+48h] for 32Bit apps) X! u9 ^1 [) W9 B. P4 v, L
__________________________________________________________________________
# g7 L* f5 K7 W' ~3 J6 `; s. n3 }; @0 Q4 Y. l! h+ j" o
$ r" i d8 A" p, i$ X4 x( C
Method 08
6 a2 l2 S! `& Y2 a5 x) q. x=========
% x' p0 f& j$ B8 G. Z6 T' q# ]: r& h2 A l. W
It is not a method of detection of SoftICE but a possibility to crash the( B+ o; K& h: V5 K+ r; f
system by intercepting int 01h and int 03h and redirecting them to another: ?) w9 a+ V& }$ d7 L
routine.5 B3 j3 x% m7 w2 f. r$ p
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points" d& C" }# O& }9 k# \, m
to the new routine to execute (hangs computer...)) O' z5 Y8 S! H; x+ G/ v9 t6 E i
: K. v& m) L6 J. U) Q mov ah, 25h
/ ?" J. C- P; p! r2 E mov al, Int_Number (01h or 03h)
. O1 \+ }4 ~) Y0 T) K2 k2 q mov dx, offset New_Int_Routine X, ]' x1 x# c3 V9 q7 F
int 21h
1 @' h% N" L% f+ ]6 d. r" N1 H2 b9 K* F9 `& M- U& e& }5 M
__________________________________________________________________________! M; J! v z4 p
* I! `" h0 I) ^2 _: Z* f* d" P L+ ~0 T
Method 09
4 ~3 R! k U1 o, x=========* a- o: i' E- A: x7 [3 ?: m
8 j8 Z E- C9 J0 U+ r8 t
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
0 h/ m0 T6 Y5 o- f* _2 L* Qperformed in ring0 (VxD or a ring3 app using the VxdCall).) E! h4 h- Z9 h1 Y0 G8 v
The Get_DDB service is used to determine whether or not a VxD is installed( D- V: d, P- e1 T1 j
for the specified device and returns a Device Description Block (in ecx) for
. |. J( v, h. ]0 zthat device if it is installed.: Q; E2 J: k/ t
& S; L1 ^9 @% ?! B! ? mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
8 e3 ^; M+ x* J' |/ t% s1 _9 Q mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)" B' p% q H" E" W
VMMCall Get_DDB$ j1 Q( x+ X' N0 y
mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed. B( f3 A: t$ F9 w8 k0 ]4 o
' G. S6 p" U! x* P' \Note as well that you can easily detect this method with SoftICE:
+ J1 R! S8 g7 v3 g bpx Get_DDB if ax==0202 || ax==7a5fh
# a" ]. Z4 R: ?1 G2 e
$ I) j# U/ P+ w__________________________________________________________________________
1 B* N$ x8 ^8 c1 ^5 ?$ e! w6 J7 {" \0 Y' b0 J
Method 10
- a$ W) k" B: v. c1 K! ]# |/ g=========* ?5 W) h% c8 \! k. E
: h& k P' B1 ^; i: t, x=>Disable or clear breakpoints before using this feature. DO NOT trace with
# F7 r; ?. [$ I ^" i f1 M# L SoftICE while the option is enable!!
7 L5 R9 J6 Y, e" i' Y" O5 ]
& S1 D; x9 o2 D2 _8 E$ o; ^This trick is very efficient:
, Y6 Y6 |1 s, e3 }, Uby checking the Debug Registers, you can detect if SoftICE is loaded
' C6 F, c/ u& V/ }4 Z: f(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if4 r4 Z* K" c# k! C
there are some memory breakpoints set (dr0 to dr3) simply by reading their1 B2 O+ q2 i% U
value (in ring0 only). Values can be manipulated and or changed as well
" L) ^) A& C+ s+ h(clearing BPMs for instance)- u1 t& E4 Q8 A7 a
( X: [4 L$ C* Z o- N0 @8 a$ H& u__________________________________________________________________________
* F' L# E9 A0 i' ?8 C/ [( `& P' ` E% a% {% z0 ^
Method 11* Q2 ]+ q$ _7 b8 x* [6 z
=========
6 V8 s8 ]. }* j* k# e- X2 c) O' x% L
1 X/ k7 j5 f$ F% ]This method is most known as 'MeltICE' because it has been freely distributed
4 ?5 x& z) E# I2 C) u. ~8 U; P% Wvia www.winfiles.com. However it was first used by NuMega people to allow
8 h, v: n" T, G1 i2 E/ bSymbol Loader to check if SoftICE was active or not (the code is located( p" i6 N- U/ f, k P
inside nmtrans.dll).
% p# a4 G8 @8 r
9 r* s* X1 v' E* w$ |The way it works is very simple:
! o- p8 _/ Q6 I3 h, C+ jIt tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for6 ]- M( Z' |1 x! O1 |& r
WinNT) with the CreateFileA API.
1 r+ r2 o6 x6 X$ }/ {* ?9 L @9 l
" O# F9 M8 C0 w* |9 r( pHere is a sample (checking for 'SICE'):
+ m2 t" U; |' C5 d# [) n: j. y1 E% W, P" h3 N
BOOL IsSoftIce95Loaded()
; q4 }; E0 l! T{
( d. g" n7 |, W" H" K' l0 g3 F HANDLE hFile;
( y1 R" a: @4 [5 I% G4 o' R hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,+ ~. p% ~. Q* B+ N4 O
FILE_SHARE_READ | FILE_SHARE_WRITE,
$ g3 B# n+ C- m0 V6 k NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);3 Y2 l) t! N( \1 x
if( hFile != INVALID_HANDLE_VALUE )
& i: Y+ [: ]5 o/ ~ {
& @; z f! T* _2 g) C+ U CloseHandle(hFile);
% ~0 d, P! E: r4 l6 j$ k return TRUE;: g- s% e3 m: i4 K0 W
}
% t3 @7 y. F1 z return FALSE;
/ p5 M0 s$ ~; e- T# z}
/ `( m( T7 Z: @- e% O
; \3 f: M0 G5 k. k: \/ n$ EAlthough this trick calls the CreateFileA function, don't even expect to be7 u! V+ b0 R3 p. K0 c5 c
able to intercept it by installing a IFS hook: it will not work, no way!
, Z, }8 K" f0 w6 Q' c* D0 HIn fact, after the call to CreateFileA it will get through VWIN32 0x001F" c1 D* y# M' I0 P7 I( l" l" T
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 P. n1 T4 N7 G+ }
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
5 _6 ~) {. {% `& ~field.+ W A( M& l" c
In fact, its purpose is not to load/unload VxDs but only to send a
; F; B, ~/ @0 [0 k5 ~7 _/ w) ]& _W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
9 J' o; v, e( A2 ^/ [, f" Oto the VxD Control_Dispatch proc (how the hell a shareware soft could try
( w8 P, n" u6 A6 I3 U( ?to load/unload a non-dynamically loadable driver such as SoftICE ;-).
* V, `, j" e' a4 U! v2 PIf the VxD is loaded, it will always clear eax and the Carry flag to allow
! i8 B9 x# |0 c0 M, ]! m. pits handle to be opened and then, will be detected.
R9 ^/ s4 y q9 v) G+ SYou can check that simply by hooking Winice.exe control proc entry point9 Y# s" e4 k5 A& Y
while running MeltICE.
! \1 ~* ~' f7 i6 @0 l" M/ f8 J3 U
/ d5 T! B" v% [) W1 a! K: {' `% a5 f. L1 l9 {8 R/ G# r% B
00401067: push 00402025 ; \\.\SICE
6 V7 V9 {/ `2 S" L+ G 0040106C: call CreateFileA
0 ?7 o0 f) t0 h 00401071: cmp eax,-001
n: [8 p1 v& j3 | i6 Q/ ~ 00401074: je 00401091
' E5 |8 Q% v7 \4 a# x
0 m1 E. p" |' e4 G7 A+ W3 t9 w1 J; ?9 P" b5 ~3 b
There could be hundreds of BPX you could use to detect this trick.
' p1 g6 a/ Z) ^2 m9 ?( i- R-The most classical one is:
! g1 F4 x+ ^; @ BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
% C, F) j4 h6 |+ T *(esp->4+4)=='NTIC'
* {( h4 C6 M7 @6 ]1 E
6 `6 P6 P3 K1 [7 u" o-The most exotic ones (could be very slooooow :-(
k- Z: D0 e% C6 X1 m' X1 C( b2 c BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
* m. |% u! H( _# [: s$ U% O ;will break 3 times :-(
( u& G3 ]& J: S; B1 }
( {! o1 b x* q9 ]9 {-or (a bit) faster: $ P$ ?% a. i0 X& F$ y4 y# R, h
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
3 a' \: B0 U* {7 Z# m& E! F
) f" s' G( k: t/ O BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' ) z: k8 a, r* y/ A! S) M: J! q
;will break 3 times :-(
3 p: Y8 w* u( ~; p0 o% y! l+ ]+ s
-Much faster:3 W+ h, k2 ], z5 _) P4 E
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
: D) Q6 q6 ~. ]( w3 d6 t) q" H" `9 y' G0 }
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
. ^+ o) E* ?9 `function to do the same job:8 B3 x3 i r1 |2 D d8 i$ _
9 w% X/ r. u" C9 L3 `0 F
push 00 ; OF_READ
3 v" q) u% w1 k1 w mov eax,[00656634] ; '\\.\SICE',0# `! k: E8 }4 r, K7 e) m4 i
push eax7 ]) D" r5 G6 ^# h Z1 l
call KERNEL32!_lopen/ i6 }4 M( g O2 |& p# E8 |% v
inc eax- N0 s/ F7 \: j
jnz 00650589 ; detected% ]$ S# i( w' j( ?# p
push 00 ; OF_READ: g' H7 ~! A0 x3 E4 Z
mov eax,[00656638] ; '\\.\SICE' a5 E. l) I# y8 ]# e8 c
push eax: g/ B7 C: _% q
call KERNEL32!_lopen
: V! v+ F0 x; [* I inc eax
9 F; }# }9 @( V5 y jz 006505ae ; not detected
) P6 Y' W- o0 Q6 P- h; ?! n5 D `( H1 Q3 |) k0 q
: _/ f2 ]4 L1 R; E# R- Y__________________________________________________________________________* G; R9 K; H: t4 p. F
: w4 E3 i5 ?+ o
Method 12
% F' P( {9 P" c: O* z=========
# Y9 J# d0 i$ k' |- Q- N! r
: t2 |& F! f$ p. ~; ?This trick is similar to int41h/4fh Debugger installation check (code 05
5 b9 A2 \6 M m+ S& 06) but very limited because it's only available for Win95/98 (not NT): x: x% l1 i! I7 `! I1 y( E: i
as it uses the VxDCall backdoor. This detection was found in Bleem Demo." k) D" L$ p7 f8 _. s- `# ]) j
& [6 h$ x ^! N2 y8 \& j4 n' O push 0000004fh ; function 4fh
& G9 R7 ^. D# L( _ push 002a002ah ; high word specifies which VxD (VWIN32)
- }; Y/ O* A$ ~' P: Z* e ; low word specifies which service/ l' K: u5 @! J0 v1 i, W7 j0 ?/ K
(VWIN32_Int41Dispatch)3 ?6 A* K* W9 ]2 U8 C4 W
call Kernel32!ORD_001 ; VxdCall
/ a- N8 @3 s+ A4 _2 F# F2 j r cmp ax, 0f386h ; magic number returned by system debuggers
/ G* ~/ c* o9 }. m( L/ z jz SoftICE_detected- W2 @* N$ X- t, B5 M- ?) F
7 \) [ G2 B) X, G3 w6 z9 q
Here again, several ways to detect it:9 X- M. q! K, B- f. F- j
* E0 F; { L4 Z
BPINT 41 if ax==4f; g0 w2 O3 r4 F9 V$ ?
% G; L) e% a/ u6 O& _1 h, Y! F; z. S BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one
/ c" d& Z+ `3 q- u6 X O M
9 Q# A) D9 q' ~' m7 I, } BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A6 z0 [+ i8 V2 ~& l/ u6 h
% u. L1 B* p. W$ a BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
) T+ p. d- l. i" A% p: n, O# A$ T c8 j) K6 D* f
__________________________________________________________________________
, k6 S2 ^; @) m; ?3 e, r6 O- G5 l+ M+ x# E3 N% W
Method 13/ V' V Z j+ Q( K
=========8 p; L k6 x2 [6 I u; D
$ ^! l: p" u/ { H1 t! O7 f" h5 w' J
Not a real method of detection, but a good way to know if SoftICE is
4 H3 Y) U4 J' \$ J- K4 Pinstalled on a computer and to locate its installation directory.
4 E: ]" c( }. g" E1 dIt is used by few softs which access the following registry keys (usually #2) :9 Y2 M5 c6 W/ ^5 F4 F
/ b+ n- R# M6 b D3 k; s' u
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 T2 y' Z3 w, J/ Z: t\Uninstall\SoftICE
7 B' A% I% Q2 {0 E-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE! a7 V" y6 h# l% q, E) P, W2 |
-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
% D$ H" y R7 e2 z4 R\App Paths\Loader32.Exe2 U( D6 v0 |4 S) O/ p
. `: J$ T y7 M0 O: g" [
2 z4 G4 C& I* O4 I- f" P6 ]% |Note that some nasty apps could then erase all files from SoftICE directory
' J7 `5 y/ Q" W! p(I faced that once :-(9 I6 J% f+ z( ~* ]$ z
8 O1 D. m& E' I0 C& Q) R! B' h7 dUseful breakpoint to detect it:0 C* E: g% j& e$ c" x! z; a
. a+ C* u, V( @6 }! `: z) `4 U. q- ^7 v
BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'7 Q# C/ m; y2 l* X. j7 Q
: s# T% o9 I) ~2 j; d
__________________________________________________________________________" S. U( `% B8 E( a
. F" \8 _7 d! c
7 }! P' z- L+ d" _
Method 14 \, W8 G, U2 z5 g
=========. e& h/ } I+ {/ v4 W; |' k) ]
X0 @* y z6 M4 [
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose! `8 ~8 o' B, k# A
is to determines whether a debugger is running on your system (ring0 only)., ]! F+ u) p7 S8 t2 P1 w
/ _; R. } M% S& F% h( f7 U
VMMCall Test_Debug_Installed
5 h ~! j% o/ M' X je not_installed
. J% i8 |% A D* J6 o* j! ~% w4 D; W( ^ l7 Z6 |
This service just checks a flag.
: V1 M8 M5 i9 m8 Q. j. V</PRE></TD></TR></TBODY></TABLE> |