Re: Getting from TJump to TMethod.Code...



> However, I encountered a problem, I'm not quite sure how to tackle.
> Namely, if I wanted to use this technique on another method, I'd
> first need to look up the dissasembly of the method and determine
> the instruction at the 5th byte, relative to the start address.
> I need to know where that instruction ends, so that I can:
>
> a.) preserve it in whole
> b.) set a jump to skip it
>
> Is there a way to automate this?

The Intel Architecture Developer's manual is a great source for
information about assambly and machine code. Volume 2 deals with
individual opcodes and has a decoding table too.

Volume 2A is found here; also get 2B which is linked to as well:
http://developer.intel.com/design/pentium4/manuals/253666.htm

BTW if you just want to skip one opcode you can replace it with NOPs
too; they were meant for that purpose. The most common NOP is the
one-byte NOP opcode $90 (which is actually XCHG EAX, EAX). There exist
multi-byte NOPs, which can be more efficient but aren't really needed.

.



Relevant Pages

  • Re: Variable length instructions, the future for all CPU designs.
    ... operands before opcodes as long as no operand "looks like" an opcode. ... The speed inscrease is hardly a result of the instruction encoding, ... The disadvantage is that you might need to add NOPs ... when the opcode is 16 bits to get the next 32 bits to decode. ...
    (comp.arch)
  • Re: Ancient history [was Re: Public disclosure ...]
    ... instruction where the CRLF pair was the immediate part of the opcode. ... The next two bytes where NOPs, so if the line terminator pair was ... The area where a backwards jump had to patched in (via ... JMP instruction. ...
    (sci.crypt)
  • Re: Fastest IA32 nops - single- and multi-byte
    ... of instruction memory? ... They map to internal NOPs that can be executed at a rate of three per cycle ... The second line shows 1 nop and no 0x66 prefix. ...
    (alt.lang.asm)
  • Re: Nop insertion
    ... I've never seen NOPs used so deliberately outside of device driver ... advance to guarantee completion before any instruction that uses the ... That requires knowledge of the memory system ... because the load could be served from the cache or have to go all the ...
    (comp.compilers)
  • Re: Nop insertion
    ... Are there inorder architectures that need precise number of nops ... You can issue one instruction per cycle. ... If you access a destination register of such an ...
    (comp.compilers)