# Path: nitro/event.py
# class SyscallType(Enum):
#     """System call mechanism"""
#     sysenter = 0
#     syscall = 1
# 
# Path: nitro/backends/arguments.py
# class ArgumentMap:
#     """
#     ``ArgumentMap`` is a base class for providing access to system call arguments.
#     """
# 
#     ARG_SIZE = {
#         SyscallType.syscall: 'P',   # x64 -> 8 bytes
#         SyscallType.sysenter: 'I'   # x32 -> 4 bytes
#     }
# 
#     __slots__ = (
#         "event",
#         "process",
#         "modified",
#         "arg_size_format"
#     )
# 
#     def __init__(self, event, process):
#         """
#         :param NitroEvent event: event that is used to access arguments
#         :param Process process: process which address space is used for argument lookups
#         """
#         #: Underlying event
#         self.event = event
#         #: Process associated with the ``ArgumentMap``
#         self.process = process
#         self.modified = {}
#         self.arg_size_format = self.ARG_SIZE[self.event.type]
# 
#     def get_argument_value(self, arg_type, opaque):
#         if arg_type == SyscallArgumentType.register:
#             value = self.event.get_register(opaque)
#         else:
#             # memory
#             size = struct.calcsize(self.arg_size_format)
#             addr = self.event.regs.rsp + (opaque * size)
#             value, *rest = struct.unpack(self.arg_size_format, self.process.read_memory(addr, size))
#         return value
# 
#     def set_argument_value(self, arg_type, opaque, value):
#         if arg_type == SyscallArgumentType.register:
#             self.event.update_register(opaque, value)
#         else:
#             # memory
#             size = struct.calcsize(self.arg_size_format)
#             addr = self.event.regs.rsp + (opaque * size)
#             buffer = struct.pack(self.arg_size_format, value)
#             self.process.write_memory(addr, buffer)
# 
# class SyscallArgumentType(Enum):
#     register = 0
#     memory = 1


from nitro.event import SyscallType
from nitro.backends.arguments import ArgumentMap, SyscallArgumentType


class WindowsArgumentMap(ArgumentMap):
    """
    ``WindowsArgumentMap`` provides read and write access to system call arguments.
    """

    CONVENTION = {
        SyscallType.syscall: [
            (SyscallArgumentType.register, 'rcx'),

# Path: nitro/event.py
# class SyscallType(Enum):
#     """System call mechanism"""
#     sysenter = 0
#     syscall = 1
# 
# Path: nitro/backends/arguments.py
# class ArgumentMap:
#     """
#     ``ArgumentMap`` is a base class for providing access to system call arguments.
#     """
# 
#     ARG_SIZE = {
#         SyscallType.syscall: 'P',   # x64 -> 8 bytes
#         SyscallType.sysenter: 'I'   # x32 -> 4 bytes
#     }
# 
#     __slots__ = (
#         "event",
#         "process",
#         "modified",
#         "arg_size_format"
#     )
# 
#     def __init__(self, event, process):
#         """
#         :param NitroEvent event: event that is used to access arguments
#         :param Process process: process which address space is used for argument lookups
#         """
#         #: Underlying event
#         self.event = event
#         #: Process associated with the ``ArgumentMap``
#         self.process = process
#         self.modified = {}
#         self.arg_size_format = self.ARG_SIZE[self.event.type]
# 
#     def get_argument_value(self, arg_type, opaque):
#         if arg_type == SyscallArgumentType.register:
#             value = self.event.get_register(opaque)
#         else:
#             # memory
#             size = struct.calcsize(self.arg_size_format)
#             addr = self.event.regs.rsp + (opaque * size)
#             value, *rest = struct.unpack(self.arg_size_format, self.process.read_memory(addr, size))
#         return value
# 
#     def set_argument_value(self, arg_type, opaque, value):
#         if arg_type == SyscallArgumentType.register:
#             self.event.update_register(opaque, value)
#         else:
#             # memory
#             size = struct.calcsize(self.arg_size_format)
#             addr = self.event.regs.rsp + (opaque * size)
#             buffer = struct.pack(self.arg_size_format, value)
#             self.process.write_memory(addr, buffer)
# 
# class SyscallArgumentType(Enum):
#     register = 0
#     memory = 1


# Path: nitro/backends/windows/arguments.py
from nitro.event import SyscallType
from nitro.backends.arguments import ArgumentMap, SyscallArgumentType



class WindowsArgumentMap(ArgumentMap):
    """
    ``WindowsArgumentMap`` provides read and write access to system call arguments.
    """

    CONVENTION = {
        SyscallType.syscall: [
            (SyscallArgumentType.register, 'rcx'),

            (SyscallArgumentType.register, 'rdx'),