Advertisement
Guest User

Untitled

a guest
Aug 29th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.39 KB | None | 0 0
  1. #![feature(asm)]
  2.  
  3. macro_rules! fake_jump {
  4.     ($id:expr) => {
  5.         unsafe {
  6.            
  7.             asm!(
  8.             "
  9.            jmp $0
  10.            lea eax, [ebx]
  11.            xor eax, 0xDEADBEEF
  12.            retn
  13.            $0:
  14.            "::"0"($id)::"volatile", "intel");
  15.         }
  16.     };
  17. }
  18.  
  19. fn main() {
  20.     fake_jump!("FirstFunc");
  21.     println!("Hello, world!");
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement