<div dir="ltr">Hello everyone,<div><br></div><div>I wish to preserve information about jump-tables as they are "fixed-up" with their actual address at link time and after dissembling the executable, it is impossible to know that there is a jump table in the code.</div><div><br></div><div>Additionally, I also want to pin-point indirect jumps to these jump-table entries in the final disassembly.</div><div><br></div><div>To get a clearer idea about my requirement, consider the following example.</div><div><br></div><div><div>/* Some code */</div><div>/* The below line is associated with a jump table */</div><div><b>leaq<span style="white-space:pre">  </span>LJTI0_0(%rip), %rax     ## encoding: [0x48,0x8d,0x05,A,A,A,A]</b></div><div><b>                                        ##   fixup A - offset: 3, value: LJTI0_0-4, kind: reloc_riprel_4byte</b></div><div>movq<span style="white-space:pre">    </span>-32(%rbp), %rcx         ## encoding: [0x48,0x8b,0x4d,0xe0]</div><div>movslq<span style="white-space:pre"> </span>(%rax,%rcx,4), %rdx     ## encoding: [0x48,0x63,0x14,0x88]</div><div>addq<span style="white-space:pre">     </span>%rax, %rdx              ## encoding: [0x48,0x01,0xc2]</div><div><i>/* The below line is an indirect jump to a jump table entry */</i></div><div><b>jmpq<span style="white-space:pre">     </span>*%rdx                   ## encoding: [0xff,0xe2]</b></div></div><div><br></div><div>Corresponding disassembly of the executable:</div><div><br></div><div>/* Some code */</div><div>/* Somehow, I want to find the starting address of the jump table from the below line */</div><div><div><b>100000dd9:<span style="white-space:pre">      </span>48 8d 05 0c 01 00 00 <span style="white-space:pre">        </span>leaq<span style="white-space:pre"> </span>268(%rip), %rax</b></div><div>100000de0:<span style="white-space:pre">   </span>48 8b 4d e0 <span style="white-space:pre"> </span>movq<span style="white-space:pre"> </span>-32(%rbp), %rcx</div><div>100000de4:<span style="white-space:pre">     </span>48 63 14 88 <span style="white-space:pre"> </span>movslq<span style="white-space:pre">       </span>(%rax,%rcx,4), %rdx</div><div>100000de8:<span style="white-space:pre"> </span>48 01 c2 <span style="white-space:pre">    </span>addq<span style="white-space:pre"> </span>%rax, %rdx</div><div>/* Somehow, I want to know if a jump statement is an indirect jump to a jump table entry from the below line */</div><div><b>100000deb:<span style="white-space:pre">   </span>ff e2 <span style="white-space:pre">       </span>jmpq<span style="white-space:pre"> </span>*%rdx</b></div></div><div><b><br></b></div><div><br></div><div>Any leads on how to achieve the task would be highly appreciated.</div><div><br></div><div>Thank you.</div><div><br></div><div><br></div><div>Regards,</div><div>Malhar Thakkar</div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY3MxM2IxMDMxQGlpdGguYWMuaW4%3D&type=zerocontent&guid=efe523ea-fec5-44f5-9217-663f65e8b769"><font color="#ffffff" size="1">ᐧ</font></div>