Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a syscall implementation for llseek #1640

Merged
merged 16 commits into from
Mar 30, 2020
Merged
2 changes: 1 addition & 1 deletion manticore/native/cpu/abstractcpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def read_int(self, where, size=None, force=False):
self._publish("did_read_memory", where, value, size)
return value

def write_bytes(self, where, data, force=False):
def write_bytes(self, where: int, data, force: bool = False) -> None:
"""
Write a concrete or symbolic (or mixed) buffer to memory

Expand Down
7 changes: 4 additions & 3 deletions manticore/native/cpu/cpufactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
I386CdeclAbi,
SystemVAbi,
)
from .abstractcpu import Abi, Cpu, SyscallAbi


class CpuFactory:
Expand All @@ -28,20 +29,20 @@ class CpuFactory:
}

@staticmethod
def get_cpu(mem, machine):
def get_cpu(mem, machine: str) -> Cpu:
cpu = CpuFactory._cpus[machine](mem)
mem.cpu = cpu
return cpu

@staticmethod
def get_function_abi(cpu, os, machine):
def get_function_abi(cpu: Cpu, os: str, machine: str) -> Abi:
if os != "linux" or machine not in CpuFactory._linux_abis:
raise NotImplementedError(f"OS and machine combination not supported: {os}/{machine}")

return CpuFactory._linux_abis[machine](cpu)

@staticmethod
def get_syscall_abi(cpu, os, machine):
def get_syscall_abi(cpu: Cpu, os: str, machine: str) -> SyscallAbi:
if os != "linux" or machine not in CpuFactory._linux_syscalls_abis:
raise NotImplementedError(f"OS and machine combination not supported: {os}/{machine}")

Expand Down
Loading