daily pastebin goal
93%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python2
  2. ## -*- coding: utf-8 -*-
  3.  
  4. # $ python oops.py
  5. # rsi:64 bv[63..0]
  6. # rip:64 bv[63..0]
  7. # [@0x1001]:64 bv[63..0]
  8.  
  9. from triton import *
  10.  
  11. def cb1(ctx, reg):
  12.     print reg
  13.     ctx.setConcreteRegisterValue(reg, 0x1000)
  14.  
  15. def cb2(ctx, mem):
  16.     print mem
  17.  
  18. ctx = TritonContext()
  19. ctx.setArchitecture(2)
  20. ctx.addCallback(cb1, CALLBACK.GET_CONCRETE_REGISTER_VALUE)
  21. ctx.addCallback(cb2, CALLBACK.GET_CONCRETE_MEMORY_VALUE)
  22.  
  23. ctx.convertRegisterToSymbolicVariable(ctx.registers.rsi)
  24.  
  25. inst = Instruction("\x48\x8b\x46\x01") # mov rax, [rsi+1]
  26. ctx.processing(inst)
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
 
Top