mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
23 lines
499 B
ArmAsm
23 lines
499 B
ArmAsm
/* https://cirosantilli.com/linux-kernel-module-cheat#x86-control-transfer-instructions
|
|
*
|
|
* Unconditional branch to an absolute address stored in memory on in a register.
|
|
*/
|
|
|
|
#include <lkmc.h>
|
|
|
|
LKMC_PROLOGUE
|
|
/* Address in memory. */
|
|
.section .rodata
|
|
label_address: .quad .Lmemory_label
|
|
.text
|
|
jmp *label_address
|
|
LKMC_ASSERT_FAIL
|
|
.Lmemory_label:
|
|
|
|
/* Address in register. */
|
|
lea .Lregister_label(%rip), %rax
|
|
jmp *%rax
|
|
LKMC_ASSERT_FAIL
|
|
.Lregister_label:
|
|
LKMC_EPILOGUE
|