Fixed a warning in simple_x[86|64]

This commit is contained in:
hakril
2018-09-26 09:36:41 +02:00
parent 91cbcce38f
commit 0e52272ddc
2 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -789,7 +789,7 @@ class JmpType(Instruction):
arg = initial_args[0]
if isinstance(arg, str) and arg[0] == ":":
return DelayedJump(cls, arg)
return super(JmpType, cls).__new__(cls, *initial_args)
return super(JmpType, cls).__new__(cls)
class Push(Instruction):
+19 -2
View File
@@ -608,7 +608,7 @@ class JmpType(Instruction):
arg = initial_args[0]
if isinstance(arg, str) and arg[0] == ":":
return DelayedJump(cls, arg)
return super(JmpType, cls).__new__(cls, *initial_args)
return super(JmpType, cls).__new__(cls)
class JmpImm(object):
@@ -847,8 +847,25 @@ class _NopArtifact(Nop):
pass
class Label(object):
class Byte(Instruction):
"""Output a raw byte"""
encoding = [(UImm8(),)]
class Raw(Instruction):
"""Output raw data"""
def __init__(self, *initial_args):
if len(initial_args) != 1:
raise ValueError("raw 'opcode' only accept one argument")
self.data = initial_args[0].decode("hex")
def get_code(self):
return self.data
class Label(object):
def __init__(self, name):
self.name = name