Skip to content

Added simple RIP CALL creation #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions peachpy/x86_64/operand.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ def __init__(self, address, size=None, mask=None, broadcast=None):
from peachpy.x86_64.function import LocalVariable
from peachpy.literal import Constant
assert isinstance(address, (GeneralPurposeRegister64, XMMRegister, YMMRegister, ZMMRegister,
MemoryAddress, Constant, LocalVariable)) or \
MemoryAddress, Constant, LocalVariable, RIPRelativeOffset)) or \
isinstance(address, MaskedRegister) and \
isinstance(address.register, (XMMRegister, YMMRegister, ZMMRegister)) and \
not address.mask.is_zeroing, \
"Only MemoryAddress, 64-bit general-purpose registers, XMM/YMM/ZMM registers, " \
"Only MemoryAddress, 64-bit general-purpose registers, RIP-Relative addresses, XMM/YMM/ZMM registers, " \
"and merge-masked XMM/YMM/ZMM registers may be specified as an address"
from peachpy.util import is_int
assert size is None or is_int(size) and int(size) in SizeSpecification._size_name_map, \
Expand Down Expand Up @@ -279,6 +279,8 @@ def __init__(self, address, size=None, mask=None, broadcast=None):
self.address = MemoryAddress(rsp, displacement=address.offset)
self.symbol = address
self.size = address.size
elif isinstance(address, RIPRelativeOffset):
self.address = address
else:
# Convert register to memory address expression
self.address = MemoryAddress(address)
Expand Down