Update common.nim

This commit is contained in:
Noah Baertsch
2024-10-26 11:21:08 -04:00
committed by GitHub
parent e9209e5803
commit f0439f8119
+12 -12
View File
@@ -53,17 +53,17 @@ when defined amd64:
when defined i386:
{.passC:"-masm=intel".}
proc GetPEB*(): ptr PVOID {.asmNoStackFrame.} =
## Uses inline assembly to get a pointer to the PEB
asm """
push rbx
xor rdi, rdi
mul rdi
mov rbx, rax
add rdi, 0x20
mov eax, fs:[rdi+0x10]
pop rbx
ret
"""
proc GetPEB*(): ptr PVOID {.asmNoStackFrame.} =
## Uses inline assembly to get a pointer to the PEB
asm """
push rbx
xor rdi, rdi
mul rdi
mov rbx, rax
add rdi, 0x20
mov eax, fs:[rdi+0x10]
pop rbx
ret
"""
pPEB = GetPEB()