<TABLE width=500>1 y* z7 Q% ?3 `& ~: v
<TBODY>+ ?5 r8 U* h6 }4 S
<TR>5 _4 K) t0 h" W% ^ I5 \
<TD><PRE>Method 01 " |- V1 P/ P# E& m7 y# S% s: V( s' A
=========& w; @, ?1 [5 h1 e; c( |0 V5 Q# U
' V0 C. R5 ^/ V$ J( Y, JThis method of detection of SoftICE (as well as the following one) is
4 ]4 s; I; x0 H; Aused by the majority of packers/encryptors found on Internet.
" x9 h9 Q9 k; p; a! v/ l4 OIt seeks the signature of BoundsChecker in SoftICE4 V2 u, \' w3 Y7 ~9 q
2 Y9 X$ A8 P# e' P, Q4 q
mov ebp, 04243484Bh ; 'BCHK'! W' ?6 t3 _# X( }/ m# K; V
mov ax, 04h8 M1 c0 m+ |6 g1 T- J$ e
int 3 }6 A1 u6 f% g0 |& W1 R' t
cmp al,4
6 H! f( c( K, B, i jnz SoftICE_Detected' {! X) A1 h6 }7 \" s" U4 s, t
% j, w; |* z k4 F
___________________________________________________________________________
0 E$ P6 \; @( t, O; f0 L
6 g) E6 }+ u% e7 oMethod 02
2 J+ j9 v ], J. K, W=========$ u; J" a: L0 g, u/ @
# v. }: U: o% s$ U8 n/ p
Still a method very much used (perhaps the most frequent one). It is used
& S ^0 C* Z* ]' xto get SoftICE 'Back Door commands' which gives infos on Breakpoints,
' _. H( [- s7 C8 T) dor execute SoftICE commands...
7 M& P+ U' S3 @/ sIt is also used to crash SoftICE and to force it to execute any commands( o- N$ b/ L q3 c! u, e
(HBOOT...) :-(( 9 y& Y& M" P" N* F h: @( F( x2 F1 J
3 T8 f0 m0 e& t9 u' F' g! M2 jHere is a quick description:/ F3 r# s* Z% `9 I7 b @
-AX = 0910h (Display string in SIce windows)/ l8 C/ x$ r; P- m/ h4 n7 v
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
: m" ^ b, f9 r: @-AX = 0912h (Get breakpoint infos)1 X- {, c# Z: z4 m. R9 o9 F
-AX = 0913h (Set Sice breakpoints)
5 | `3 y. d8 N) h( y% \8 B2 y-AX = 0914h (Remove SIce breakoints)+ e* M8 T1 s9 [% E
: f; c4 q. B) d4 w5 _5 y- G& W# s
Each time you'll meet this trick, you'll see:
7 r' G& P0 j0 A. T! M% a$ y-SI = 4647h2 R8 u, H' P: ?! m
-DI = 4A4Dh
. J1 l0 u# E" E1 P& bWhich are the 'magic values' used by SoftIce.3 c3 X& f. m% s" ~) s( G1 M
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.7 Q& ? A+ i* w. [
1 N; X$ T* }+ [$ Q3 z8 ~
Here is one example from the file "Haspinst.exe" which is the dongle HASP( ?' U3 X( A. j" a! n, u7 |/ N
Envelope utility use to protect DOS applications:* M4 W# p" w& `" Z& A' O( f* V
1 @' c+ ~+ g1 B- M& ~
3 L: c1 |( ?. c( N; ]* D1 X
4C19:0095 MOV AX,0911 ; execute command.) ]: U& n$ ~) F) J# v4 B
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below). p# q' @2 K/ i7 p7 Y- @1 ?
4C19:009A MOV SI,4647 ; 1st magic value.
4 ~% y% Q2 T( f) e4C19:009D MOV DI,4A4D ; 2nd magic value.# Z7 e! }2 P( s8 {8 t8 _ v
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)! j* ?1 a, f+ m
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ F6 n8 I: @6 V- m l. M# F4C19:00A4 INC CX
% r0 a# z9 Z, \" V3 Y1 v& O4C19:00A5 CMP CX,06 ; Repeat 6 times to execute; o2 k7 l7 B+ v
4C19:00A8 JB 0095 ; 6 different commands.
$ v S8 V6 [" M+ x4C19:00AA JMP 0002 ; Bad_Guy jmp back.
( V6 k7 N- c# \; h# n" I$ N4C19:00AD MOV BX,SP ; Good_Guy go ahead :)
9 G$ q+ ?2 p' [5 _: D' y6 k* ]1 L
- G+ e1 y4 v! j8 b O: K- rThe program will execute 6 different SIce commands located at ds:dx, which9 P; `# E4 ?7 s
are: LDT, IDT, GDT, TSS, RS, and ...HBOOT.
5 i+ W( b: A r+ g! V/ |& V
6 m! O7 k+ u4 U* [+ J1 y+ f* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.: `- L( l, c; m8 v2 k) J" k& X
___________________________________________________________________________9 {! u, h9 L" w% A
\7 k& u) z6 K( D( o& y* w( v4 w$ w+ ?6 S2 ?1 d/ H
Method 03( f7 @! V& O W. n9 x5 |
=========
7 t8 U8 n' N- v3 S) J
7 D9 o4 b& x& RLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h7 u, T' V' e2 o6 Q. \
(API Get entry point)- B+ V; L6 Y) _) |3 P6 o) I6 X
3 D1 M8 R3 C8 O3 h7 h' p
5 ?* X. c+ Y; c0 Q
xor di,di
. c, @. v- B C+ h3 H mov es,di
( k' i4 t H3 U- Q* v mov ax, 1684h
* H/ y! q: _: T2 A3 v mov bx, 0202h ; VxD ID of winice
6 n/ {9 g# S/ ? int 2Fh3 C4 p3 H6 G, p5 W" n- m
mov ax, es ; ES:DI -> VxD API entry point: h+ N2 P) N, @
add ax, di3 s# d" s: v7 K, K
test ax,ax
" }/ }7 p, p: T3 E' |. R6 | jnz SoftICE_Detected' u% D; z+ N6 W; `" q5 o! G2 C
8 y' u/ ^! M' ^) e- y/ D# [' c
___________________________________________________________________________
4 Y2 H* o g$ a1 j6 t% G" |7 W
Method 04# N! [0 W9 N# y! R1 |
=========7 r9 q+ u5 n% S
( r. z. n% V' ~6 R
Method identical to the preceding one except that it seeks the ID of SoftICE
9 ^. S( P, @1 ~' BGFX VxD.0 M/ a5 V' P0 K, |6 z6 C* R
' S) R- L0 A: L6 u0 p T/ n; X7 A
xor di,di
9 p; H0 @: n- b j u5 k% q O mov es,di
! l8 I2 }$ Z1 F4 L, U mov ax, 1684h + r X% T2 {- r: e- e/ }4 h6 ~1 x. X
mov bx, 7a5Fh ; VxD ID of SIWVID- B3 W4 f( ?9 t7 Y( Z
int 2fh6 ` y1 G. m! ?. J4 f' W
mov ax, es ; ES:DI -> VxD API entry point$ n$ d) s, c* n
add ax, di3 l) o5 i0 A8 B$ |8 A
test ax,ax
# Y: l: i$ X' V jnz SoftICE_Detected! r0 n8 K* J9 G, |
9 T0 h7 m* r* B/ z__________________________________________________________________________( g5 i! _! I; h, D: _6 @3 |
4 v8 }. }# C/ v& H: L
2 [1 L. R" M |; Z! Q) G/ `
Method 052 R8 v% V5 N% B: w# v# L6 q
=========- l: }, J' ^6 c% | v. B1 w& B8 P
& N, O1 A% I t: h( P9 g: v" ^
Method seeking the 'magic number' 0F386h returned (in ax) by all system0 u4 W- Q7 C/ ? J6 o
debugger. It calls the int 41h, function 4Fh.
: E1 ` |& D; X* V5 k+ J4 _There are several alternatives.
t% }, G! m8 p# `" H, B2 I6 P( X: z0 E+ p. @) r
The following one is the simplest:
$ c, h- E% d! R- R
# s1 W4 Z( d) A. G9 r mov ax,4fh
' U8 h. t8 m$ O6 E. b+ x6 R) B0 o int 41h
' F: C6 K" L1 ]. ?, l& S cmp ax, 0F386
9 a+ n5 w. ?7 `9 O$ j' ?; @- o) t4 ` jz SoftICE_detected) O, t. l; l; S% r& H. o3 z9 U9 X
( w3 T/ w0 Z0 |0 f; p; z' i# j- D+ x3 [% G1 y/ Q
Next method as well as the following one are 2 examples from Stone's
& D9 u. R7 b3 g& ]7 A"stn-wid.zip" (www.cracking.net):: u1 a* P. y" E8 R
! o3 F( c/ T, V2 p9 B; f mov bx, cs& h- o# `3 e$ [4 L' C
lea dx, int41handler26 H: G9 x% u8 M1 g
xchg dx, es:[41h*4]
E8 j1 i0 D3 ^; {5 i2 q xchg bx, es:[41h*4+2]
: o% O9 t) z* A- Y mov ax,4fh4 c, u/ U, `7 v! w/ M
int 41h
5 Y) ^" \6 P4 z5 A xchg dx, es:[41h*4]+ u+ v, w% r( h1 x; b+ u
xchg bx, es:[41h*4+2]8 u# n% l, Z8 A+ p1 a
cmp ax, 0f386h/ `9 s8 j% Q; S' _1 S+ X
jz SoftICE_detected
) ~! p& ~% r _8 \
5 P8 E* N$ @+ rint41handler2 PROC+ Q i( N9 l# ?5 N. b7 t
iret( E; l6 b* N2 d. n m3 D, n* Q6 @
int41handler2 ENDP, ?$ A6 ^- ^; Q
% P. F' W$ h# ]
, Q4 c1 T; D# r# M: |' D* d
_________________________________________________________________________
2 K' U4 b5 s1 S4 u, m
5 u+ P3 R* q- s R; A6 j S: @( `; \' G3 M' V
Method 06. G$ G3 X7 o; Z9 `2 A# t, o* u
=========4 s1 w" u7 Y% b3 W$ ?4 H1 @# t
6 z' U# g( G, Y! F5 M, q0 `3 G5 D! A. E) ?7 m5 \
2nd method similar to the preceding one but more difficult to detect:5 K; r+ ^# q; b& f1 c4 t
' B" A* W/ h w$ A# G; j2 I
; }2 S4 b* N3 x. eint41handler PROC
3 K; q: [2 q& Y7 p7 _; |3 w% ~ mov cl,al
+ \' R& l7 }! [; k0 m iret; o7 }4 \' y% ?6 ]2 V' f E9 ^$ v
int41handler ENDP& \3 r! Q2 ]. C' x4 i5 V
! a* d' d) T+ Z4 k0 J h6 M9 F. p) Y* j0 X* g: S1 c
xor ax,ax
. a1 V5 t) l" Y" I% X mov es,ax& a: _; d. J3 C h
mov bx, cs
' r( {2 ?$ G' T8 k& c' l lea dx, int41handler7 e, P& G2 P# B& s: T4 ?# F
xchg dx, es:[41h*4]
$ C0 ~# y7 K8 Y9 Y8 M) P/ ]7 C xchg bx, es:[41h*4+2]
0 g2 P8 U9 y' u( g in al, 40h; C* x! g1 R. p8 L' R- a
xor cx,cx5 Y) V7 \( H" P3 C7 B& g
int 41h
" i0 z$ L- _ K$ Q6 `" T xchg dx, es:[41h*4]
h# m8 I! B+ j) i. y xchg bx, es:[41h*4+2]
9 H/ A; F, m, P: f cmp cl,al1 V4 L1 Q0 ^) {* N/ [
jnz SoftICE_detected
3 o8 V3 k* F K% j
8 E P8 H: c& X) R7 i% r+ [_________________________________________________________________________6 f; T, H. K* d, y( l w
' H" x f' z# H5 w9 l+ g0 a! i( \Method 073 X9 v( h( n o
=========9 s8 k/ @6 Y" {# ?. a& e
+ z5 `/ K6 T y7 O- B" KMethod of detection of the WinICE handler in the int68h (V86)
- n( Q3 O' c4 P
$ M# a, ~ w8 S z mov ah,43h$ R: b- u+ g, D, e7 b
int 68h/ B' a( s$ G; n1 P- z7 n
cmp ax,0F386h) F2 C" l: V$ q6 I2 F
jz SoftICE_Detected4 M. A+ t7 g9 F, l. T/ P3 p2 g* t
* @8 d& J5 F0 O' W( ~; e# z4 l
* _* B/ D; ]3 N6 z" J7 D: \5 O=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit; K+ \9 B3 f, L, y" M/ j& G, Q& P
app like this:' H7 l4 q( V1 g% a! Q; [7 G
?: H$ i: s5 ]& ]- ~# t) J BPX exec_int if ax==68
6 Z: S3 M; V, ~5 X. L8 E (function called is located at byte ptr [ebp+1Dh] and client eip is
! G6 P; k5 ]: w) a2 J$ l7 Y) Q! S0 ~ located at [ebp+48h] for 32Bit apps): Q. k2 n6 g( s2 ^3 h, e+ R U
__________________________________________________________________________( \" t& ? ?' s
; a: t8 z4 u2 \* ~5 t. @) @# P8 u! v
Method 08
0 V$ ?" E6 r) q0 n2 c=========
# c& `1 ?+ I5 F% g W! R( Y
+ d8 y4 S: a" U9 s- ^# lIt is not a method of detection of SoftICE but a possibility to crash the4 C1 }; G" c; t4 W" x
system by intercepting int 01h and int 03h and redirecting them to another
; t2 S2 j6 ^# G% oroutine.# g* X1 x- P. C- S
It calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points
9 F U7 d( S- |6 X1 b5 Mto the new routine to execute (hangs computer...) W1 f! Q H9 v& ~% Q$ ^8 i
, [& R4 X0 u& N
mov ah, 25h
# A) ]$ o: A3 K0 s mov al, Int_Number (01h or 03h); A! ~+ v# ]; K6 ~
mov dx, offset New_Int_Routine
/ L5 }( Q" r2 K+ F8 T" ]# s int 21h
! C5 E4 J4 s5 V# [# _& \% p3 @. _/ d- W: C) F1 O4 Z' H2 N
__________________________________________________________________________
4 s. X) m4 i9 I; m+ R5 [5 E( N9 _9 ^4 S; w
Method 09, w, a; h& K, b% w- o9 [5 I/ r) c
=========0 }9 L7 c9 H9 G8 {
+ S4 h) c/ A0 O; d. sThis method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only
, [1 }8 K* h1 h3 Operformed in ring0 (VxD or a ring3 app using the VxdCall).
( H9 f( f N- \. m, ZThe Get_DDB service is used to determine whether or not a VxD is installed4 z' s3 L! M% N$ E
for the specified device and returns a Device Description Block (in ecx) for
& }9 u( x2 q! }; a y# o* ?that device if it is installed.
& u# q' o6 ~- ?5 c0 {# d% h- L1 ~8 _6 |
mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID
0 t1 V1 k) W- u' X. j1 Z mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)9 M9 R! M/ `* l4 A
VMMCall Get_DDB
6 g" R2 {. c9 i# @7 E mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed* e/ x9 a/ u( R
6 L5 L; M' q; ]$ @2 _% t6 \
Note as well that you can easily detect this method with SoftICE:# s$ g9 r, d5 a. R7 `8 \0 _
bpx Get_DDB if ax==0202 || ax==7a5fh
& q. @' _8 \/ L
0 u0 ?: v# `% I) ]8 G& E$ _6 q2 \0 M# {__________________________________________________________________________
. E- S: F+ M8 ]# G0 @: t7 P; k3 t- V$ ^; O
Method 107 H5 p7 r& E- ]8 i) K% p5 S* m
=========
* W4 [, U7 l i5 @* F
) m# `5 \& g8 P0 q( ~" K=>Disable or clear breakpoints before using this feature. DO NOT trace with
. Z6 Z3 C0 t$ S( J. _# I SoftICE while the option is enable!!* }2 G: O0 r: d0 |" Y
+ p% N9 s( b& t6 b8 W
This trick is very efficient:) D8 j. h5 W' X
by checking the Debug Registers, you can detect if SoftICE is loaded% [2 u1 i E. X8 j1 _$ [
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if7 |# M& \( s1 C) z8 @) }% q* g
there are some memory breakpoints set (dr0 to dr3) simply by reading their
' d* E* a* F1 L& Z% e) P. S( E Lvalue (in ring0 only). Values can be manipulated and or changed as well9 I5 l2 h# l2 `9 k
(clearing BPMs for instance)
7 n7 d" x7 T$ t; l2 H5 A( x* W( L5 }
__________________________________________________________________________
! M# S" ~. C$ [: n
( ]. M- B( m: [2 V+ Q! iMethod 11
* G- U2 Q8 z" p; ~=========
( [" q# L4 f7 ^9 Z3 b; `( Z4 g& N
9 Q+ W$ s/ Q/ t0 a% {This method is most known as 'MeltICE' because it has been freely distributed4 E* w; a4 w3 N% C, I: ~
via www.winfiles.com. However it was first used by NuMega people to allow
' N# x( {" p: d# c! {8 Z( hSymbol Loader to check if SoftICE was active or not (the code is located9 m7 U& R9 h0 `" g ~& h) v# [
inside nmtrans.dll).+ _! _# g: \3 M# Q' V
! E/ _- `) E" ~! ]1 D7 Y! f- r+ C5 dThe way it works is very simple:6 s& J9 C. a. L# D2 ]" w: ?" N
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for% o& m4 Q/ }# W5 j: [ ?3 A- m
WinNT) with the CreateFileA API.1 n4 M( Y! `3 U8 @; f) e
+ Y+ t1 Y0 [' \& a6 B! n% fHere is a sample (checking for 'SICE'):
' d% V5 ^" B/ a3 o* ~- F8 K
* e+ B& u0 x- o7 Z& U: jBOOL IsSoftIce95Loaded(): e* K; J' j8 L& B* ~/ l/ n$ A
{- h3 O' w& M# L, g/ Z. d
HANDLE hFile; 4 p! o: e5 L o- `
hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
% k' O3 T0 [( o+ _: } FILE_SHARE_READ | FILE_SHARE_WRITE,) ]! P' [ `/ T+ P ^+ R9 K' y; F( u/ h
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);: ?3 d" G" V7 a: e
if( hFile != INVALID_HANDLE_VALUE )( v# M$ U; A3 H, b& C* k0 }
{9 }. |& S- H& X) {0 t/ g; z
CloseHandle(hFile);8 H0 {& V+ v5 |$ U: `
return TRUE;6 ]' I) M# }& ~ N
}8 Q! b: Z5 f; I+ t2 g- z* j( X
return FALSE;" H& N/ L( x; c& r3 l# @! Q4 a& x
}
) I9 |% H6 N" \. _+ A$ j3 f/ w" `3 b/ G
Although this trick calls the CreateFileA function, don't even expect to be
$ }: i$ ^& Y5 O* t% Jable to intercept it by installing a IFS hook: it will not work, no way!
0 R! w7 D* M1 T8 k% M3 h2 r4 DIn fact, after the call to CreateFileA it will get through VWIN32 0x001F
* A; g" B- C9 } aservice _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)7 v. I Z$ j: \0 ~& A4 N
and then browse the DDB list until it find the VxD and its DDB_Control_Proc
0 E5 c! L' l8 a4 Y$ Dfield.
q; Q0 f3 v+ l' {' e9 YIn fact, its purpose is not to load/unload VxDs but only to send a o `" |4 t% H) Z
W32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
w9 Q# z7 ]6 p; tto the VxD Control_Dispatch proc (how the hell a shareware soft could try
0 E& P- m+ X8 \* }, C3 kto load/unload a non-dynamically loadable driver such as SoftICE ;-).
: q% u2 g) {, n7 f; F; V, dIf the VxD is loaded, it will always clear eax and the Carry flag to allow$ ~' C7 {$ k4 @
its handle to be opened and then, will be detected.1 y/ {7 }2 j# ?
You can check that simply by hooking Winice.exe control proc entry point
5 z& b9 i, U* r9 N& E+ q, ~while running MeltICE.! y# F' c' H. M9 E* B8 W- ?! u
' f. |2 p- B& T: d+ E2 n
8 u) ?: y$ W$ Q. U5 _1 W 00401067: push 00402025 ; \\.\SICE
* W) }$ j9 T( y; I) R 0040106C: call CreateFileA6 R: i; Y* ^: { x+ R
00401071: cmp eax,-001
7 }# k! V, |' R% I) a 00401074: je 00401091
: n) B A, o; F, G* @. A1 k# Q- [: u9 m1 D& ?
3 j' t+ X& `9 p7 @: y! ?There could be hundreds of BPX you could use to detect this trick.
5 r* x: {; C; G8 {-The most classical one is:+ H$ X4 T/ V* d7 [4 N
BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||
3 I& r) z5 y; c) v *(esp->4+4)=='NTIC'
% E1 e- W) c& l( O. X. w" ^ n9 X" G( R- X4 L
-The most exotic ones (could be very slooooow :-(
# ?& C/ y: _! V. Z BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV')
+ G; S' f9 `1 H1 V ;will break 3 times :-(% Y* X, ~8 K- B* U0 C* O6 D5 t
z) M* h! a9 w" Y( a
-or (a bit) faster: 1 H9 T& O( v$ |$ N5 m0 T/ ?
BPINT 30 if (*edi=='SICE' || *edi=='SIWV')6 o9 Q0 }% x' B$ Q9 o% \ g
* t9 {+ t1 |" _8 s, l
BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' % Q2 a5 M# ?9 f8 F) G0 o4 }: I/ \
;will break 3 times :-(* [0 U `5 \% F- m+ U* c. u: T
4 [. p. z, \8 E
-Much faster:% V; s f# m! i
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
3 ?( U, p+ x+ N- k3 F7 Q0 }
1 U. K5 a |5 W) S* i- d# N6 TNote also that some programs (like AZPR3.00) use de old 16-bit _lopen7 W* [+ E) V/ R' v
function to do the same job:
, l/ u4 \( J7 Q. O$ H
& T4 c. q( p5 H$ }! G push 00 ; OF_READ
3 O7 s1 q, E Y, I0 m8 N) F mov eax,[00656634] ; '\\.\SICE',0
, S" Z/ E$ Q9 v push eax: P% h6 c7 t4 E# u) a
call KERNEL32!_lopen
1 f7 {0 G$ q' Q( W& o inc eax
3 H. P/ d+ {) K8 M9 [! f7 Z jnz 00650589 ; detected' \( S+ V$ {. [6 Z/ F% [' E" A9 p& [' e
push 00 ; OF_READ7 P6 E0 ~0 K$ s5 U* |( T }
mov eax,[00656638] ; '\\.\SICE'8 D. e6 p0 W( W9 w7 ?' ]
push eax6 I( q0 t# Q6 {8 w5 W/ y& d
call KERNEL32!_lopen, T9 E7 y. z: i: Z X( A/ q! l
inc eax2 A+ z& v! v/ r1 ^+ C
jz 006505ae ; not detected. b; x8 Q& d3 G
8 ~* r; r& J) M3 B- i, e b4 @
# B w1 v" E" h/ B- d7 i" F__________________________________________________________________________
! | C& _ R3 C9 R9 ]. H
$ R9 {& q l2 N$ T- CMethod 12
- H; s+ s/ Q2 u3 c d6 N=========, |2 r% l/ ?) O: Z: i. r6 G
7 v+ ?" W% V2 A0 h: XThis trick is similar to int41h/4fh Debugger installation check (code 05
* O5 v& d! I- h; X5 c/ U& 06) but very limited because it's only available for Win95/98 (not NT)
# T( F" _1 a; L5 jas it uses the VxDCall backdoor. This detection was found in Bleem Demo.
; H* C$ c V6 W5 l/ Y. |& J- u2 g* ~ }( O
push 0000004fh ; function 4fh
, e: z0 R6 ^# `7 c# c* w2 G push 002a002ah ; high word specifies which VxD (VWIN32)
4 r3 }% @2 o- n ; low word specifies which service
$ V# x G! ]; {" o$ f: e (VWIN32_Int41Dispatch); j! o$ `* P# @0 L" x, z
call Kernel32!ORD_001 ; VxdCall& n+ Y) ] t3 Y/ B8 N' d6 h
cmp ax, 0f386h ; magic number returned by system debuggers1 _% w+ _; {3 d; N+ b; s
jz SoftICE_detected
& s$ z4 ]0 X L+ l6 K
; h$ [1 @2 }+ C6 n) k i5 o9 BHere again, several ways to detect it:
( l1 M2 ~4 l& g4 K- E8 n& a6 r$ t. G$ ^4 Z1 K, R
BPINT 41 if ax==4f
! P' h5 K% ?8 h* y }, ]+ g( O9 ] y8 E& J( g
BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one, U/ E( o+ A) a; ~5 N3 G( e
8 H% E4 S; ~4 S7 h, E c I) v BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A
7 q: i4 M; w# y& l
+ o" h8 q3 ~$ G G( ]/ A BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
0 J7 P" I) e) v: s2 E5 K! m# `. D/ B, G8 v1 m* H s M
__________________________________________________________________________
, i# \, |9 o& b3 C% y! g- s. C$ [" \# N- [
Method 13
3 `- `$ x% n; b/ L- \=========
0 V* A. m; b1 l' y
$ I; j7 z5 I8 m% t2 N( u6 w0 ?Not a real method of detection, but a good way to know if SoftICE is
w* g& u7 g o9 finstalled on a computer and to locate its installation directory.$ p2 k7 X4 Z3 z4 L- q
It is used by few softs which access the following registry keys (usually #2) :
; P6 A0 b% u k2 I0 W. E( @7 M. Q( D' z8 l4 \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion4 O, B: k+ m* n" \" u' o$ h
\Uninstall\SoftICE; m4 r2 r6 T: ]0 m3 H: l
-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
' w$ l, E [; L-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
1 J' X8 w' K# X( w4 `; |5 c r\App Paths\Loader32.Exe: o: t* W8 }; G
. u! H0 w, V( S
9 w5 Q$ B9 O! P, v! }6 y: i
Note that some nasty apps could then erase all files from SoftICE directory+ J! ^! d6 e2 D8 }
(I faced that once :-(' r7 U, j- l6 C+ Z2 R& n/ ]
/ f9 \4 P! \4 H* }' J! a3 dUseful breakpoint to detect it:
* X6 I, I5 K0 r! B+ Z+ n
. p7 d% i. x7 @! M: k BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'& f9 `6 O! v7 J& R
$ o/ \3 S& E4 G5 a5 H7 G& k__________________________________________________________________________
z I3 j3 p" P+ G
2 A( b4 t+ l r; i$ J0 G1 z
8 Y! ^8 l `8 j- JMethod 14
4 Y9 v( E2 y- X9 E! I=========4 h) j, y2 p- q9 F* C) ?
# [% F! a, `, ]: e0 ?9 p
A call to VMM 'Test_Debug_Installed' service. As the name says, its purpose8 Z; R3 c& h, Q+ S! }
is to determines whether a debugger is running on your system (ring0 only).
+ U/ B( A/ |) P: ]
$ e% m4 [' ]1 T* s1 N VMMCall Test_Debug_Installed
3 V! T" b# m5 d7 T+ ^1 I8 ~ je not_installed
% h7 H8 c |5 L1 D+ @5 M# y* B* [0 e3 H& C) Y- r
This service just checks a flag.8 @4 e, F8 L) g' Q4 P9 U3 m
</PRE></TD></TR></TBODY></TABLE> |