Fixed the type hinting to guarantee addition between the instruction

enum and other lists of bytes
This commit is contained in:
Aéna Aria 2026-04-02 16:38:48 +02:00
parent bc2753f98a
commit 40f227ba38

View file

@ -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