SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static FOO: u64 = 0x00000004;
  2.  
  3. unsafe fn jmp(addr: *const core::ffi::c_void) {
  4.     asm!("ldr %0, %1" : "=r"(addr) : "0"(addr));
  5.     asm!("br %0" : : "0"(addr));
  6. }
  7.  
  8. fn main() {
  9.     println!("{:?}", FOO as *const core::ffi::c_void);
  10.     unsafe {
  11.         jmp(FOO as *const core::ffi::c_void);
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top