Asm generate hotfix

This commit is contained in:
MS 2024-02-01 17:42:12 -05:00 committed by GitHub
parent fce90ed8d8
commit efa86711f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@
import re
from typing import Callable, List, Optional, Tuple
from collections import namedtuple
from isledecomp.bin import InvalidVirtualAddressError
from capstone import Cs, CS_ARCH_X86, CS_MODE_32
disassembler = Cs(CS_ARCH_X86, CS_MODE_32)
@ -55,7 +56,11 @@ def is_relocated(self, addr: int) -> bool:
def float_replace(self, addr: int, data_size: int) -> Optional[str]:
if callable(self.float_lookup):
float_str = self.float_lookup(addr, data_size)
try:
float_str = self.float_lookup(addr, data_size)
except InvalidVirtualAddressError:
# probably caused by reading an invalid instruction
return None
if float_str is not None:
return f"{float_str} (FLOAT)"