rizin/r2-bindings/python/test-r_asm.py
pancake 79e3fba4f9 * More work for the bindings
* Make python test programs use system's lib
2011-11-04 03:48:28 +01:00

19 lines
388 B
Python

try:
from r_asm import *
except:
from r2.r_asm import *
def ass(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()
ass (a, 'x86.olly', 'mov eax, 33')
ass (a, 'java', 'bipush 33')