Skip to content

Commit 8c07186

Browse files
committed
flake
1 parent 9c4dd83 commit 8c07186

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

pyplugins/apis/syscalls.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,34 @@
2121
"Syscalls"
2222
]
2323

24+
2425
class SyscallEvent:
2526
__slots__ = ('_sce', 'name')
2627

2728
def __init__(self, sce):
2829
self._sce = sce
29-
30+
3031
# 1. Fast C-string extraction natively supported by dwarffi.
31-
# Calling bytes() on the array field does a direct buffer slice
32+
# Calling bytes() on the array field does a direct buffer slice
3233
# (equivalent to your old start:start+size math) without the boilerplate.
3334
raw_bytes = bytes(sce.syscall_name)
34-
35+
3536
# 2. Parse the C-string
3637
self.name = raw_bytes.split(b'\x00', 1)[0].decode('utf-8', errors='replace')
3738

3839
def __getattr__(self, attr):
39-
# 3. Transparently pass through any standard field accesses
40+
# 3. Transparently pass through any standard field accesses
4041
# (e.g., event.orig_x0) to the underlying dwarffi instance.
4142
return getattr(self._sce, attr)
42-
43+
4344
def __setattr__(self, attr, value):
4445
# If the attribute belongs to the wrapper, set it locally
4546
if attr in self.__slots__:
4647
object.__setattr__(self, attr, value)
4748
else:
4849
# Otherwise, forward the write to the underlying dwarffi instance
4950
setattr(self._sce, attr, value)
50-
51+
5152
@property
5253
def size(self) -> int:
5354
# Expose the size from the underlying dwarffi BoundTypeInstance
@@ -531,17 +532,6 @@ def _syscall_interrupt_handler(self) -> bool:
531532
if func_name:
532533
self._name_to_hook_ptrs[func_name].append(hook_ptr)
533534

534-
'''
535-
On repeated calls to the same syscall in portal we produce new
536-
syscall_event objects. However, it doesn't update the version of the object
537-
that the function has. This means that when it sets values we have a
538-
different object and can fail.
539-
540-
So we keep the original syscall_event object in a dictionary and check if the
541-
sequence number is the same. If it is we use the original object.
542-
'''
543-
544-
545535
def _get_proto(self, cpu: int, sce: Any, on_all: bool) -> SyscallPrototype:
546536
"""
547537
Get the syscall prototype for a given event.

0 commit comments

Comments
 (0)