From 0e52272ddc5bb96ff0323f5fca40a7fbb84e53e3 Mon Sep 17 00:00:00 2001 From: hakril Date: Wed, 26 Sep 2018 09:36:41 +0200 Subject: [PATCH] Fixed a warning in simple_x[86|64] --- windows/native_exec/simple_x64.py | 2 +- windows/native_exec/simple_x86.py | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/windows/native_exec/simple_x64.py b/windows/native_exec/simple_x64.py index 2c4c464..10e6e25 100644 --- a/windows/native_exec/simple_x64.py +++ b/windows/native_exec/simple_x64.py @@ -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): diff --git a/windows/native_exec/simple_x86.py b/windows/native_exec/simple_x86.py index 78d3f23..cbcec6b 100644 --- a/windows/native_exec/simple_x86.py +++ b/windows/native_exec/simple_x86.py @@ -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