Update icicle-emu to the latest version

This commit is contained in:
Duncan Ogilvie
2024-06-21 23:29:49 +02:00
parent fa997bc581
commit 4871727ac3
8 changed files with 319 additions and 202 deletions
+4 -3
View File
@@ -1,16 +1,17 @@
from .icicle import *
class MemoryError(Exception):
def __init__(self, message, code):
class MemoryException(Exception):
def __init__(self, message: str, code: MemoryExceptionCode):
super().__init__(message)
self.code = code
def __str__(self):
return f"{super().__str__()}: {self.code}"
def __ghidra_init():
import os
for path in __path__ + [os.getenv("GHIDRA_SRC", ".")]:
processors_dir = os.path.join(path, "Ghidra/Processors")
processors_dir = os.path.join(path, "Ghidra", "Processors")
if os.path.isdir(processors_dir):
os.putenv("GHIDRA_SRC", path)
os.environ["GHIDRA_SRC"] = path
+4 -5
View File
@@ -9,9 +9,10 @@ class MemoryProtection(Enum):
ExecuteRead = ...
ExecuteReadWrite = ...
class MemoryErrorCode(Enum):
class MemoryExceptionCode(Enum):
Unallocated = ...
Unmapped = ...
UnmappedRegisters = ...
Uninitialized = ...
ReadViolation = ...
WriteViolation = ...
@@ -43,7 +44,7 @@ class ExceptionCode(Enum):
Sleep = ...
Syscall = ...
CpuStateChanged = ...
DivideByZero = ...
DivisionException = ...
ReadUnmapped = ...
ReadPerm = ...
ReadUnaligned = ...
@@ -71,11 +72,9 @@ class ExceptionCode(Enum):
Environment = ...
JitError = ...
InternalError = ...
UnmappedRegister = ...
UnknownError = ...
class MemoryError(Exception):
code: MemoryErrorCode
class Icicle:
def __init__(self, architecture: str, *,
jit = True,