convert str input to bytes
StringRefMemoryObject constructor binding specifies bytes as its input parameter, so we have to convert it.
This commit is contained in:
parent
b3bf7f86cd
commit
fea82991c3
1 changed files with 3 additions and 0 deletions
|
|
@ -129,6 +129,9 @@ class Disassembler(object):
|
||||||
@bs)
|
@bs)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
if isinstance(bs, str):
|
||||||
|
bs = bytes(map(lambda c: ord(c), bs))
|
||||||
|
|
||||||
code = api.llvm.StringRefMemoryObject.new(bs, base_addr)
|
code = api.llvm.StringRefMemoryObject.new(bs, base_addr)
|
||||||
idx = 0
|
idx = 0
|
||||||
align = self.mai.getMinInstAlignment()
|
align = self.mai.getMinInstAlignment()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue