1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Properly initialize the stack when in 64bit mode.

This commit is contained in:
Jennifer Taylor 2021-09-03 22:42:31 +00:00
parent ab4c82b886
commit 539c98f8a6

View File

@ -26,7 +26,7 @@ class Memory:
class Registers:
def __init__(self) -> None:
def __init__(self, stack: int) -> None:
self.rax = 0
self.rbx = 0
self.rcx = 0
@ -34,7 +34,7 @@ class Registers:
self.rsi = 0
self.rdi = 0
self.rbp = 0
self.rsp = 0xFFFFFFFF
self.rsp = stack
self.zf = False
self.sf = False
@ -95,7 +95,7 @@ class PEFile:
def vprint(*args: Any, **kwargs: Any) -> None:
pass
registers = Registers()
registers = Registers(0xFFFFFFFFFFFFFFFF if self.is_64bit() else 0xFFFFFFFF)
memory = Memory()
formatter = Formatter(FormatterSyntax.NASM) # type: ignore