Disassemble srrounding instructions.
(self)
| 239 | |
| 240 | @Render.divider_printer("[ DISASM ]", footer=True) |
| 241 | def context_asm(self) -> None: |
| 242 | """Disassemble srrounding instructions. |
| 243 | """ |
| 244 | |
| 245 | address = self.cur_addr |
| 246 | prediction = self.predictor.predict() |
| 247 | |
| 248 | # assuming a single instruction is in the same size of a native pointer. |
| 249 | # this is not true for all architectures. |
| 250 | ptr = address - self.pointersize * self.disasm_num |
| 251 | listing = [] |
| 252 | |
| 253 | # taking disasm_num instructions before, current, and disasm_num instructions after |
| 254 | for _ in range(self.disasm_num * 2 + 1): |
| 255 | insn = self.disasm(ptr) |
| 256 | listing.append(insn) |
| 257 | |
| 258 | ptr += insn.size |
| 259 | |
| 260 | self.render_assembly(listing, address, prediction) |
no test coverage detected