radare2/swig/python/test-r_asm.py
pancake c326db2e77 * Integration with valaswig for many libraries
- typedef function pointers in r_search (rSearchCallback)
  - hide R_API stuff as it should in many .h files
  - typedef classes in rCore, rSearch
* Add perl, ruby, python examples for r_asm and r_bp
  - Many other libraries are compiled by default
* Adapt r_asm vapi to the current C api (massemble returns rAsmCode)
  - dynamically allocatable string buffer
* Rename seek->offset to avoid collisions
2010-01-12 02:12:18 +01:00

21 lines
456 B
Python

from r_asm import *
def disasm(a, arch, op):
print "---------------------------->8- - - - - -"
print "OPCODE: %s"%op
a.use (arch)
print "ARCH: %s"%arch
code = a.massemble (op)
if code is None:
print "HEX: Cannot assemble opcode"
else:
print "HEX: %s"%code.buf_hex
a = rAsm()
print "---[ name ]-----[ description ]----------"
a.list()
disasm (a, 'x86.olly', 'mov eax, 33')
disasm (a, 'java', 'bipush 33')
disasm (a, 'java', 'invalid opcode')