Tim Roberts wrote:
> tony <spamtrap@[EMAIL PROTECTED]
> wrote:
>> Does the technique of jumping into the middle of instruction
>> compatible with security systems like Pax in Linux and Data Execution
>> prevention (DEP) in Windows XP SP2? I mean i am not clear that when
>> the program jumps into the middle of instruction, does it executes
>>from data area or code area?
>
> There is nothing magical about the beginning and ending of an
instruction.
> It's just a sequence of bytes that the CPU interprets. When you make a
> jump, the CPU doesn't know or care whether it is the first byte of an
> instruction. It will just load and execute it.
Architecturally it cannot care, in reality (performance-wise) it can:
Jumping into the middle (of a previously executed) opcode will flush the
information that was cached during the previous pass, i.e. things like
instruction boundaries on a Pentium, or the trace cache on a P4.
You are of course perfectly right that it has to work, there's no
alignment requirements for x86 opcode bytes like there is on most RISC
cpus (aligned 16 or 32-bit opcodes).
Terje
--
- <Terje.Mathisen@[EMAIL PROTECTED]
>
"almost all programming can be viewed as an exercise in caching"


|