<TABLE width=500>
# ^" E. \- R+ k% P7 K<TBODY>
- }' n5 e5 Y& f' |" p! ^- [6 x<TR>1 J) {: F& q: A! X& H; `- |
<TD><PRE>Method 01 ( S: T5 _& ^6 D4 E# m8 q6 M8 P
=========: @. @; V+ V% t% |
5 C- C( W" ?) n7 H2 b
This method of detection of SoftICE (as well as the following one) is
% G- q: d* P, vused by the majority of packers/encryptors found on Internet./ X1 p6 r" x% {$ @5 N9 j
It seeks the signature of BoundsChecker in SoftICE
7 u# i4 p1 D6 X/ c: H
& d) ^( ~9 L% T2 H+ o mov ebp, 04243484Bh ; 'BCHK'
- n7 l% R' @7 n u8 q mov ax, 04h# X) W8 Y; m/ s' @+ H, J9 h
int 3
6 j0 a; R' s9 J3 m, B, E cmp al,40 V) j6 @1 d: l6 M ^
jnz SoftICE_Detected% s4 K+ K1 A) g p# {/ _* s
& S2 e$ [! M l0 c4 c8 Q1 S9 w; p
___________________________________________________________________________
3 q" @7 n( @- |6 W; p+ r' _8 y. x4 ~2 a# J1 J5 O
Method 02) j- j. ?7 X* B2 q/ t1 i- C
=========; Z8 b5 ~! Y; u- Y* H
/ v: R$ x. c. Y3 v! Y
Still a method very much used (perhaps the most frequent one). It is used* u& y8 M1 ?) x5 |
to get SoftICE 'Back Door commands' which gives infos on Breakpoints,2 N3 A" o1 Y% U/ M/ G9 Y; w8 o
or execute SoftICE commands...
6 Y9 B5 A0 |" f- zIt is also used to crash SoftICE and to force it to execute any commands
9 d/ l$ z8 N$ z(HBOOT...) :-(( 8 D$ v5 o0 S- K. G
# M& ~# H3 a+ R
Here is a quick description: f) e+ w; a6 d, r& s* o- V+ v. ]
-AX = 0910h (Display string in SIce windows)6 X) R$ C- ]6 g+ n. n- x
-AX = 0911h (Execute SIce commands -command is displayed is ds:dx)
# A" ?* h3 m' i2 Z-AX = 0912h (Get breakpoint infos)
# z1 y* d7 h+ _: E-AX = 0913h (Set Sice breakpoints)
8 j/ r% K% {( h! z) {-AX = 0914h (Remove SIce breakoints)" T5 t) j9 M& [. k
; J ~) h! B# k2 z8 Q( M
Each time you'll meet this trick, you'll see:+ `( t; ], v( u/ M! o1 {
-SI = 4647h$ X! R2 E- {0 A5 \
-DI = 4A4Dh( Q ]: Y3 U* b8 W" C
Which are the 'magic values' used by SoftIce.4 I4 F+ ]" u( J/ I; q! @4 y3 w
For more informations, see "Ralf Brown Interrupt list" chapter int 03h.% H( `( g" Z I( y2 T% r
, [6 ]. _) ] w
Here is one example from the file "Haspinst.exe" which is the dongle HASP7 k. _4 }2 M; ?' R# N2 v/ h- o
Envelope utility use to protect DOS applications:9 c) Q( O" q$ k$ L5 s
3 J% a$ U# P" E' e
! Y( k- T) W6 Z8 s/ H, I4C19:0095 MOV AX,0911 ; execute command.) g1 l5 `( e7 r+ h3 @5 c/ j
4C19:0098 MOV DX,[BX] ; ds:dx point to the command (see below).' H! }! L5 b# O4 y H
4C19:009A MOV SI,4647 ; 1st magic value." w: u- N# N' @* G: j, J
4C19:009D MOV DI,4A4D ; 2nd magic value.& ^- i$ L* g$ q5 F, o
4C19:00A0 INT 3 ; Int call.(if SIce is not loaded, jmp to 00AD*)* a. c5 n4 [- s
4C19:00A1 ADD BX,02 ; BX+2 to point to next command to execute
+ _/ Y" L3 Y. `$ m6 w9 k+ r2 S4C19:00A4 INC CX: B" H/ B5 ^( N; S: m
4C19:00A5 CMP CX,06 ; Repeat 6 times to execute
7 a! o4 C4 |( u, J2 ]4C19:00A8 JB 0095 ; 6 different commands.7 h+ u( \; l3 }3 ]* N% b
4C19:00AA JMP 0002 ; Bad_Guy jmp back.' d) ~$ E' u2 P) d% I& S, p
4C19:00AD MOV BX,SP ; Good_Guy go ahead :); L: E) o% X2 E* ~; r/ J# B; y) P
; c* @' V/ ` D2 H( BThe program will execute 6 different SIce commands located at ds:dx, which
9 B0 k5 z2 K1 tare: LDT, IDT, GDT, TSS, RS, and ...HBOOT.* { R7 K( ]- n, t6 z' }) C
. c( ~. f, ]& q' D* X+ G2 C5 p1 d9 i* the "jmp to 00ADh" is performed via an SEH if the debugger is not loaded.) v; T7 g/ V8 b
___________________________________________________________________________! ^8 }2 F( T# g: t% m
2 Q! e8 ~6 l; ^1 f+ L$ J
% f% j3 h: j1 Z: h0 HMethod 03
' q+ S1 i1 e( H% S; A=========5 C$ \8 p: ?# q
* _, {# h0 Q. z% N1 i5 HLess used method. It seeks the ID of SoftICE VxD via the int 2Fh/1684h, D8 I/ G$ F$ a% g6 ?/ C1 x
(API Get entry point), C1 O! E, t. M" h5 p# H
! D6 Z/ C$ _: K
* i: t1 J" o$ ]' X% r; W* N1 b xor di,di
1 N" P6 U( ^0 m4 k C: ^1 ] mov es,di0 w' Z7 D& G( ]
mov ax, 1684h 1 H; ^8 X, |4 b2 s2 u! [
mov bx, 0202h ; VxD ID of winice$ R+ u7 L1 z% a) w/ h
int 2Fh: Q7 ~, I5 m. D" ~' \1 }3 L/ T
mov ax, es ; ES:DI -> VxD API entry point! n1 } s8 x, y- k3 c
add ax, di
H' `2 L1 {/ {+ y8 ~8 ]3 q test ax,ax" _% G. q! o* f; {0 Q, G" y$ x+ o
jnz SoftICE_Detected
. h5 ~$ Y* s( N
# J9 s, R0 w- h: W) n, b) P; Y___________________________________________________________________________9 E A8 _. `! w' s. J
8 I5 ^- k/ H' N: @5 h+ o7 {: n. s4 z2 C
Method 042 M6 |& ~# x! p& g0 v+ b5 g8 j; E
=========
4 O: g. V: X& k
) M( j9 m: |8 m. _' O' v5 nMethod identical to the preceding one except that it seeks the ID of SoftICE' E' h6 S8 D( K- C* f# x& W
GFX VxD." G; X% L# s) V* G: I* b0 m
- d7 j2 j1 M; ~/ Z2 m& E
xor di,di, A0 ]5 R7 w. d' B! y+ C
mov es,di
$ u! G# i5 ~, e9 N4 Z mov ax, 1684h
& Y; {$ W/ l& n$ c; ]4 h n mov bx, 7a5Fh ; VxD ID of SIWVID
1 g% o) p4 a( `( C4 [. Z int 2fh u; i* u6 i, q+ G
mov ax, es ; ES:DI -> VxD API entry point1 `' L" r$ R2 S$ N% N
add ax, di6 ^5 P4 x% T8 u/ f8 g
test ax,ax7 q: A' Z" i$ O) `6 j! ]8 z; v6 m
jnz SoftICE_Detected
% m% Y, j9 B' A4 j. ]$ z9 M+ d) ]& [/ e! p& H5 O6 I
__________________________________________________________________________
5 u3 ^$ h9 ^6 B3 _) V
4 c1 X3 S* Q1 g! J- H
- E" }. j: y0 W- P, C; F, FMethod 05
/ Y( Q" K4 ?" v5 Z=========4 c3 b$ \) Q( y9 z+ {
" M# y8 R# a0 }! Z! RMethod seeking the 'magic number' 0F386h returned (in ax) by all system$ @4 d m* e0 ^: b/ G; A7 Q
debugger. It calls the int 41h, function 4Fh.
) g( `: h! v9 BThere are several alternatives.
; ` H: O1 I" G7 o$ e: \: m# @: I
The following one is the simplest:4 R: t2 i% z7 P7 N* b6 u
2 u9 W& _3 x+ e8 ^8 p
mov ax,4fh# n" Q6 k- ?% S$ M, u
int 41h( L! ~6 R+ k! i* R: N' H
cmp ax, 0F386
! \ R) z+ u) p' T jz SoftICE_detected7 P0 O7 J, y6 R0 |6 Q' t* H5 X
% u2 h! L$ e6 k: \$ z7 w: B
$ w0 w1 e" J/ c1 q1 c1 p4 ?Next method as well as the following one are 2 examples from Stone's ; e1 U1 C& {. C" p9 i- l
"stn-wid.zip" (www.cracking.net):- d7 U( [) J0 m
, z) _6 _& X8 P$ T7 ?+ H& L mov bx, cs
5 i! d4 ^' ~- i F lea dx, int41handler2
4 S) I- k* x- C+ C% @ xchg dx, es:[41h*4]
7 f6 b4 K' T1 \8 I1 c6 v xchg bx, es:[41h*4+2]
" O$ b6 M% M3 j7 M9 n mov ax,4fh# D% ^" r2 d9 K# D, C h0 f0 `
int 41h
* }0 s; o/ x E: U4 b xchg dx, es:[41h*4]
: p3 r4 g; ]9 V0 I0 n xchg bx, es:[41h*4+2]7 I- z- f9 c8 y
cmp ax, 0f386h) ]' s6 a( e4 D6 E7 l
jz SoftICE_detected
( @" q1 h/ p+ ^6 `% y6 a( a: O9 @$ }9 {
int41handler2 PROC
- B' i! D, \7 ? iret
& K: l9 V8 i3 uint41handler2 ENDP
6 U3 J- a' b& B% M6 t
3 p* I$ b4 v- s4 Z2 r8 B( H" N% e/ S3 d1 Z( ^( k$ Y
_________________________________________________________________________
% K% Y* \; d' G& k' }0 M% y/ u2 \7 \
- v9 u2 W1 S; p' `/ ^" |# R- P) b/ u
Method 06
r4 v7 ?8 h. t( a! p=========
" n0 ^! Z4 D; U& q6 b. O2 x( a. A1 I! _: h: T
) j7 ~; I" v I- P; m. u% }( I5 O2nd method similar to the preceding one but more difficult to detect:
0 i6 e( j& n3 j, T: ^5 T
# D- H% @1 O% T& M! G0 Q' @' q8 b, s% i2 J/ `
int41handler PROC* @4 m' a: j# [4 a& g
mov cl,al2 X" D8 R+ Z' K% z& ?; s' d
iret
: h( C- d: J( F9 hint41handler ENDP
# g9 I) z5 |( O- l& I& k
; i9 x1 }' L" M0 M# J# x( C2 m
, D- A" N7 i/ f: w$ `6 a0 x xor ax,ax
! _6 z2 \# U' E) g+ y: Y( R# ] mov es,ax
4 i1 U ?0 b, _1 s mov bx, cs) O( w p; a5 \4 i
lea dx, int41handler7 k9 \0 W$ s/ P- l l; W0 d
xchg dx, es:[41h*4]1 a6 _* p6 L1 @# K) C
xchg bx, es:[41h*4+2]
1 r$ u. w# i# r3 @6 X7 Q9 L* K in al, 40h! z. j$ J+ a/ V; Z2 H; {: q! I
xor cx,cx
! \0 M' s6 @2 {! o( L int 41h
4 E/ Z1 J. Q y' _ xchg dx, es:[41h*4]/ F6 N8 {7 `1 [% M( c
xchg bx, es:[41h*4+2]
$ R, v; D0 n2 I, j cmp cl,al% W/ j/ h# ]# Q
jnz SoftICE_detected; S o3 Z5 h7 t4 c; q2 u' Y
2 J5 m- ~1 Q& B4 y# W, l
_________________________________________________________________________
! G9 a& p# p$ Q$ W, J6 W# V2 H! k) `$ z! }0 l: e* N
Method 07& {4 J% w4 b" ?, i8 W& w7 S9 L
=========
# U: d' E) b ~1 [4 G
8 a9 g- G3 W) l% SMethod of detection of the WinICE handler in the int68h (V86)' K9 p2 V: R4 v4 {. h0 U6 r
# K% N" H5 N2 a" F mov ah,43h; s$ M& y' f' b" Z( J/ I# o" H
int 68h
8 i+ o; _! J' M$ ~$ C" o cmp ax,0F386h
2 @' N4 s% e; T jz SoftICE_Detected3 ]# ~- H L: n3 y d; ^" P+ H
& l" k6 H& a+ v1 ]5 @0 Z% P8 E
=> it is not possible to set a BPINT 68 with softice but you can hook a 32Bit
6 B$ X( E( Z% H- n3 v* Z ^ app like this: y8 O1 k, f' N4 q6 ?0 k, Z
+ ?0 {" L t( x8 e0 G
BPX exec_int if ax==68" Y9 S$ r r2 A W' r
(function called is located at byte ptr [ebp+1Dh] and client eip is& X8 X& {: Y6 }) l- t, w4 b+ r
located at [ebp+48h] for 32Bit apps)
9 o) A- @* q9 z0 {$ L% h. Z0 \ i__________________________________________________________________________9 E6 w% T( ~, |: P9 c
% e6 ]2 [. V* F/ j& b) L% m0 ? ?' P* u* V/ l x7 u
Method 08/ b( k2 o$ h: x" z, {# R
=========- N# \5 n( _6 U
6 l7 ^$ T8 u r3 R4 E' U1 o
It is not a method of detection of SoftICE but a possibility to crash the1 V: N: [/ N" Q; X8 Z
system by intercepting int 01h and int 03h and redirecting them to another
3 r& N2 ~0 T' n/ Nroutine.
! ~; j1 `, m+ b; _, tIt calls int 21h functions 25h and 35h (set/get int vector) and ds:dx points9 b" t! a, ~8 Y5 `
to the new routine to execute (hangs computer...)7 _2 Z3 s# h: ?" a( [
6 w, q7 I p4 j' Z9 l
mov ah, 25h
( R& `9 F: R- I3 V! Q+ q mov al, Int_Number (01h or 03h): M' Z/ m8 K& O' \0 ~! `5 {
mov dx, offset New_Int_Routine
9 A# D6 ~- [5 ^ int 21h+ I2 i. B0 D U: c6 {( \; J
& U' C( l9 D2 d! F0 B" M# ~__________________________________________________________________________
% |- } z) i5 k% J- ?$ \
/ d, B1 W I" |' kMethod 09& L; @+ z* |. x0 B+ S$ j
=========
# ^) T D* V0 P3 V+ H1 |& Q: |$ A4 q0 g1 l( ^6 d- G/ X- S& E
This method is closed to methods 03 and 04 (int 2Fh/1684h) but it is only' B, b) i7 W, r8 z
performed in ring0 (VxD or a ring3 app using the VxdCall).
4 g5 d- ?6 H" uThe Get_DDB service is used to determine whether or not a VxD is installed2 ^$ G: q) D& s- i6 I8 o: m7 X
for the specified device and returns a Device Description Block (in ecx) for: x. R/ L9 S8 \
that device if it is installed.6 X. b% G1 h0 n% b" K
# Y$ c. ]2 h- ^1 d8 g6 l0 N( G mov eax, Device_ID ; 202h for SICE or 7a5Fh for SIWVID VxD ID7 W( p5 s, s! {8 j' Q* N0 f* k
mov edi, Device_Name ; only used if no VxD ID (useless in our case ;-)$ Z; F6 D5 p. E9 N2 \% W0 s! U
VMMCall Get_DDB
3 g$ C, X8 }3 o$ @6 u mov [DDB], ecx ; ecx=DDB or 0 if the VxD is not installed& {) V- B8 O$ Y( v
. s! r2 ?1 U% S$ o' x6 g
Note as well that you can easily detect this method with SoftICE:
! h- _/ b! j2 ^+ z$ A bpx Get_DDB if ax==0202 || ax==7a5fh
5 ?' N B0 p0 O6 D9 T' e
- M$ j; P3 b8 J d% ___________________________________________________________________________: w5 U: }: D. e' }: S
$ a$ ?; Y- b( q! c* O6 {2 lMethod 10
" v& u1 k; x3 f4 @# m- S=========4 K/ `6 ?- Z; ^* Y
9 p& D, m0 ?. X% m: F=>Disable or clear breakpoints before using this feature. DO NOT trace with
' i. v+ ^: c, g6 `) q, Z( x: Z9 S SoftICE while the option is enable!!
" m/ w4 y* m; O* v8 S1 O3 A0 e m, k$ ^9 d! l
This trick is very efficient:
: f' ?/ p: o: U5 a/ }1 Sby checking the Debug Registers, you can detect if SoftICE is loaded9 W: P. Q* d! H% K7 n% h7 e
(dr7=0x700 if you loaded the soft with SoftICE loader, 0x400 otherwise) or if5 h s r _/ {: M9 s$ S
there are some memory breakpoints set (dr0 to dr3) simply by reading their
8 w0 M! l6 a) z4 S2 {& mvalue (in ring0 only). Values can be manipulated and or changed as well& E+ x8 T3 N. G, O9 @; B
(clearing BPMs for instance)" ]# a" H% {2 g3 a }( m# N
* V& r1 w& Z; o# G__________________________________________________________________________4 r6 e- y/ N; Y5 ] J
3 L( v* K! S" YMethod 11
( I6 ~5 N. p$ I9 Y=========
" Y: F J& a J( `6 ~ G7 z
$ P# \) z( A0 H) T+ a1 fThis method is most known as 'MeltICE' because it has been freely distributed! K H1 c6 `# I1 p
via www.winfiles.com. However it was first used by NuMega people to allow
_7 _6 _! D, MSymbol Loader to check if SoftICE was active or not (the code is located
4 [4 `; B9 w, winside nmtrans.dll).
+ C4 ?- p: }" |8 d0 D6 e5 @9 g
6 m, G1 o5 w \- qThe way it works is very simple:2 j4 Z Y9 V/ m5 Q1 P& g- o# g
It tries to open SoftICE drivers handles (SICE, SIWVID for Win9x, NTICE for
6 e% z2 F7 S2 ? @+ v; J/ G9 p- ?WinNT) with the CreateFileA API.
7 f/ R3 R! P, H. h2 b, |/ s" ?8 A) d* v# F6 v
Here is a sample (checking for 'SICE'):- u1 Q4 O8 \3 K$ B$ l
! M: G- E" i* `6 z* D. P, Z$ O
BOOL IsSoftIce95Loaded()
& @ A6 C9 P& x$ j/ R- r# {{
1 a/ ~* |9 X1 [- b$ G$ z HANDLE hFile;
/ X9 h7 H' a' A) @4 `( O hFile = CreateFile( "\\\\.\\SICE", GENERIC_READ | GENERIC_WRITE,
" P, m3 o2 b# I# @# ?, b4 _' T( @ FILE_SHARE_READ | FILE_SHARE_WRITE,- Y; Z3 Q7 }4 o, L% C
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);7 @% k2 R4 B3 M/ h
if( hFile != INVALID_HANDLE_VALUE )
* V# k4 m/ L7 U% w+ o$ o {) P9 h: @( j2 T. i, i
CloseHandle(hFile); b! O/ {7 e4 o T7 j1 o7 |! u, ^3 L
return TRUE;- a8 p k) H6 U" a
}
Q, J9 m W! U return FALSE;' |9 B, w4 y& a* v7 e$ j
}
6 ]0 O; I+ j7 N
: ]5 f( J2 R: v6 c0 qAlthough this trick calls the CreateFileA function, don't even expect to be4 g& N2 K* n# Z4 ?/ J5 N, E
able to intercept it by installing a IFS hook: it will not work, no way!
9 x) ^/ S2 V0 U0 \In fact, after the call to CreateFileA it will get through VWIN32 0x001F z( R. B$ ?$ S: w; g2 p Y) j
service _VWIN32_ReleaseWin32Mutex (via Kernel32!ORD_0001/VxDCall function)- Q- E$ F9 C2 z( a
and then browse the DDB list until it find the VxD and its DDB_Control_Proc: L, b5 J8 T: S9 p# N& c
field.' y3 _" I' H, B: r* o
In fact, its purpose is not to load/unload VxDs but only to send a
+ y! h% V! b t: X: w4 yW32_DEVICEIOCONTROL (0x23) control message (DIOC_OPEN and DIOC_CLOSEHANDLE)
1 L+ P$ d" J0 t5 @+ uto the VxD Control_Dispatch proc (how the hell a shareware soft could try
+ E. _2 {6 O( O1 z5 P/ sto load/unload a non-dynamically loadable driver such as SoftICE ;-).
J) U3 f) G7 d0 E: j! I8 U7 cIf the VxD is loaded, it will always clear eax and the Carry flag to allow! _& m0 ?# ]1 }6 a/ @3 d
its handle to be opened and then, will be detected.
, N) F# _, v% S- d- H- i' {1 wYou can check that simply by hooking Winice.exe control proc entry point2 D# ?" @% |- l5 F( U+ [3 b
while running MeltICE.
9 J7 M# v' t0 B( O7 R8 G! o( A* F3 ~' D3 t1 v" {5 R, j' t
- I+ ^9 I( Z& V4 K' C( Z 00401067: push 00402025 ; \\.\SICE3 p A8 {7 N) r4 Q
0040106C: call CreateFileA
. h. J1 j5 v* m1 V( B; i4 h 00401071: cmp eax,-0016 h$ f3 Z X& d9 w* n( l. m$ F
00401074: je 00401091
& [( Q+ |+ D2 g% }2 B0 [' C2 _8 B2 F
! s x& T" p ]4 m4 lThere could be hundreds of BPX you could use to detect this trick.
B0 K9 }. n; p- x7 Q; W2 n-The most classical one is:
6 H# [# h/ E9 x0 F BPX CreateFileA if *(esp->4+4)=='SICE' || *(esp->4+4)=='SIWV' ||4 E' }& H4 _" X) A( |& X
*(esp->4+4)=='NTIC'' @' Y1 ^3 J: W, {% l
+ H) c- R- F- r9 c; d
-The most exotic ones (could be very slooooow :-(
( Z2 S2 o, V9 _) b8 p2 _ BPINT 30 if eax==002A001F && (*edi=='SICE' || *edi=='SIWV') 5 c l* \$ Z' _2 Q& z: F* W
;will break 3 times :-(
4 L; P* i7 f. q8 H
% g+ d F7 N% I/ A-or (a bit) faster:
* `) [ E0 p" k) y) w# d BPINT 30 if (*edi=='SICE' || *edi=='SIWV')
+ ]: K* D. i: a/ S. V( ^4 e
$ ^: ]3 @0 S% c BPX KERNEL32!ORD_0001 if *edi=='SICE' || *edi=='SIWV' - r) d# J- ` i1 Q. c% q: I
;will break 3 times :-(* y8 t# f5 I$ f/ y" V- q. K
1 X! R) K, `1 s) a, Q9 M! e
-Much faster:5 k5 c2 x- m9 Q0 _; W( O( `
BPX VMM_GetDDBList if eax->3=='SICE' || eax->3=='SIWV'
) J) Y1 L9 X- D* p" V/ a# f I& s9 S; b1 B: p
Note also that some programs (like AZPR3.00) use de old 16-bit _lopen
9 W" y% ^8 S- _% Lfunction to do the same job:* d# z1 T" g* c3 E4 e' B
A0 s/ Q* y; n9 I# e push 00 ; OF_READ$ Y9 h! }3 @" K! z
mov eax,[00656634] ; '\\.\SICE',0
" J8 c. ^$ H8 L' J J9 a push eax% I7 G+ ?3 h) [0 ?3 F& v
call KERNEL32!_lopen
4 o$ }" B, H# b1 }% n" c inc eax# v$ x. M$ U9 f( }1 Q
jnz 00650589 ; detected; _, _% I) c/ y+ V$ l0 ]9 e# ~) Y
push 00 ; OF_READ! u8 a% _7 W5 k3 Z# R+ A+ i, ~
mov eax,[00656638] ; '\\.\SICE'
. e4 c% h! a- J' u& L push eax4 y9 x, a1 F6 N- b! J2 n+ D
call KERNEL32!_lopen! Y+ P" Q$ {1 r8 j( X8 _! g
inc eax! H+ n, K+ w8 {* g4 ^
jz 006505ae ; not detected) F4 |6 i& h7 a7 f* p
1 d" ?; ~/ i! U! `3 P' j& {
% p( k/ X2 M! r__________________________________________________________________________
# k) n0 m0 O+ |; S/ e' H
k$ C: B. s2 n+ s4 {% O% A' OMethod 12
m$ J: T# p7 `7 l6 m! z' m6 L=========) q+ |# p- o6 @3 ~4 A" G* U
1 k4 [2 z5 U y% @2 f" {
This trick is similar to int41h/4fh Debugger installation check (code 05
/ `( o6 g3 ~5 l* X2 }. C& 06) but very limited because it's only available for Win95/98 (not NT)7 E# [2 \6 v" W- H' K) `7 Q1 @( w5 J
as it uses the VxDCall backdoor. This detection was found in Bleem Demo.0 F a, a- v J/ | b& L
8 G7 h! X0 g/ P+ q) M push 0000004fh ; function 4fh3 S( c* I" s( {- S
push 002a002ah ; high word specifies which VxD (VWIN32)
% k1 e0 n9 }! P/ t7 _. _ ; low word specifies which service
' |+ N3 M. |" j- e# |! j/ z (VWIN32_Int41Dispatch)1 A, L9 r& B S5 U) Q" Z$ n# [, L
call Kernel32!ORD_001 ; VxdCall
, V x" H4 x+ Y0 L k- V cmp ax, 0f386h ; magic number returned by system debuggers
, Z/ G+ Z% ^7 c' u+ }' _ jz SoftICE_detected* f% A7 I. \- l
6 X; c, X) F2 Q0 I0 r* S/ L# }7 t" f
Here again, several ways to detect it:6 a% Z" g* Q7 x6 H( Y
, \. s0 U4 |1 b3 R: M
BPINT 41 if ax==4f* N+ R9 g/ S3 i* b( t
$ S' P+ k: x* j6 K$ \8 w BPINT 30 if ax==0xF386 ; SoftICE must be loaded for this one1 P- t6 Y+ t: |& w& o
6 ~* y* g' {4 Y7 {. d/ P# G6 ]
BPX Exec_PM_Int if eax==41 && edx->1c==4f && edx->10==002A002A1 p* W R, M3 Q% Q
7 F; h# ^1 ]" b$ q4 {* C, X& n7 n% q
BPX Kernel32!ord_0001 if esp->4==002A002A && esp->8==4f ; slooooow!
- q2 W& {8 Z2 [1 J* b7 k% s7 G6 D. D* ~ d! W W
__________________________________________________________________________
1 _! ?7 u* i4 E3 {
' V, `8 B2 m n3 d' oMethod 13
& \4 g. z1 s% p6 ~. {1 u1 P/ S=========
% U" I% l/ y1 Q6 e4 A4 ?# B9 ]3 c: q2 `
Not a real method of detection, but a good way to know if SoftICE is
% A# }; G8 d! n& |0 G) R* v1 Binstalled on a computer and to locate its installation directory.
: C1 M" P; [: }/ }5 ? fIt is used by few softs which access the following registry keys (usually #2) :
1 z* n: Q5 U3 O4 _# e) B( M" @9 }# \
-#1: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
$ b8 r" e# F+ l\Uninstall\SoftICE
8 p$ ~! j' X( ?) d, O7 C5 k-#2: HKEY_LOCAL_MACHINE\Software\NuMega\SoftICE
1 U; l, e, f9 c3 P1 I-#3: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
* L* [7 _6 X2 N: k* B\App Paths\Loader32.Exe
' o- ]) H& t$ \8 S& S) s+ ?/ G, l# e: ?: N; d
' p9 `, o* g0 G2 L7 B
Note that some nasty apps could then erase all files from SoftICE directory6 Z" n7 K4 p: J/ ]4 d
(I faced that once :-(
% j, A1 x; z( f4 T$ K0 H! _8 ^8 i6 W' F& U7 x7 t
Useful breakpoint to detect it:$ S, D. @& H# D9 w1 b$ ?7 u
) Z8 m. p9 t: P4 k$ K/ C- j BPX _regopenkey if *(esp->8+0x13)=='tICE' || *(esp->8+0x37)=='tICE'
3 G* y& ~! |: m5 f5 }/ r( M, s: r2 ]# @9 j
__________________________________________________________________________
8 ]4 g; k& j! t {4 h' {
" y" _$ Y7 G- H2 q$ U/ k
0 ^# y5 b# E, mMethod 14
9 r+ p4 `3 F) n; Q0 T=========/ E8 r) s/ H t# I$ b; X
5 p& ~7 h: H0 W4 D, k6 B5 E; gA call to VMM 'Test_Debug_Installed' service. As the name says, its purpose. Q$ Y% r6 N; K) f0 h
is to determines whether a debugger is running on your system (ring0 only).
( A% e: P7 f" \ R3 X7 F" f/ u p* h; N- C
VMMCall Test_Debug_Installed% Q! z% R2 n: N6 {' V; _
je not_installed
4 X+ K1 k& L( D8 ~& ~# U }1 s4 q
8 g# B+ a* c8 u+ FThis service just checks a flag.
/ }* ]/ w b9 o9 r: c- q' b- z! F. j! H4 y</PRE></TD></TR></TBODY></TABLE> |