Fixed the type hinting to guarantee addition between the instruction
enum and other lists of bytes
This commit is contained in:
parent
bc2753f98a
commit
40f227ba38
1 changed files with 4 additions and 1 deletions
5
utils.py
5
utils.py
|
|
@ -3,13 +3,16 @@ from enum import Enum
|
||||||
import lief
|
import lief
|
||||||
|
|
||||||
|
|
||||||
class Instructions(list[int], Enum):
|
class Instructions(Enum):
|
||||||
RET = [0xC3]
|
RET = [0xC3]
|
||||||
PUSH = [0x68]
|
PUSH = [0x68]
|
||||||
MOV_REG = [0xC7]
|
MOV_REG = [0xC7]
|
||||||
CALL_ADDR = [0xFF, 0x15]
|
CALL_ADDR = [0xFF, 0x15]
|
||||||
JUMP_ADDR = [0xFF, 0x25]
|
JUMP_ADDR = [0xFF, 0x25]
|
||||||
|
|
||||||
|
def __add__(self, other: list[int]) -> list[int]:
|
||||||
|
return list(self.value) + other
|
||||||
|
|
||||||
|
|
||||||
def is_32b(pe: lief.PE.Binary):
|
def is_32b(pe: lief.PE.Binary):
|
||||||
return pe.abstract.header.is_32
|
return pe.abstract.header.is_32
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue