mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-22 05:37:06 +00:00
c326db2e77
- 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
21 lines
456 B
Python
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')
|