title: A relative JMP in x64
body: <p>So I was trying to find some clarification on this and couldnt work it out/not word it correctly for google to give me the correct results so I'm hoping someone might understand me here.</p>
  <p>I'm trying to get my head around assembly for x64 for creating function hooks and I need to clarify how a relative jmp works. So lets say I have a function at <strong>0x7FFFFFF0100</strong>0 and I'm about to write a relative jmp at <strong>0x7FFFFFF00016</strong> the difference between these two addresses is <strong>0xFEA(4074)</strong> however I havent written the relative jmp yet so is the relative difference between the addresses from the address im about to write at to the start of the function or is it from the end of the relative jmp I'm about to write?</p>
  <p>Using a difference of <strong>0xFEA(4074)</strong></p>
  <pre><code>00007FFFFFF0000C mov     [rsp+10h], rbx
  00007FFFFFF00011 mov     [rsp+20h], rsi
  00007FFFFFF00016 jmp     [rip+FEA]
  00007FFFFFF0001C 0
  </code></pre>
  <p>Using a difference of <strong>0xFE4(4068)</strong></p>
  <pre><code>00007FFFFFF0000C mov     [rsp+10h], rbx
  00007FFFFFF00011 mov     [rsp+20h], rsi
  00007FFFFFF00016 jmp     [rip+FE4]
  00007FFFFFF0001C 0
  </code></pre>