From 40f227ba381969f271de25e4c9961c647664d40d Mon Sep 17 00:00:00 2001 From: Seliaste Date: Thu, 2 Apr 2026 16:38:48 +0200 Subject: [PATCH] Fixed the type hinting to guarantee addition between the instruction enum and other lists of bytes --- utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 4f45633..4dd0c34 100644 --- a/utils.py +++ b/utils.py @@ -3,13 +3,16 @@ from enum import Enum import lief -class Instructions(list[int], Enum): +class Instructions(Enum): RET = [0xC3] PUSH = [0x68] MOV_REG = [0xC7] CALL_ADDR = [0xFF, 0x15] JUMP_ADDR = [0xFF, 0x25] + def __add__(self, other: list[int]) -> list[int]: + return list(self.value) + other + def is_32b(pe: lief.PE.Binary): return pe.abstract.header.is_32