mirror of
https://github.com/nbaertsch/nimvoke
synced 2026-06-06 16:24:26 +00:00
Update common.nim
This commit is contained in:
+12
-12
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user