Skip to content

Commit

Permalink
Add back support for amd64 x32 ABI
Browse files Browse the repository at this point in the history
Recognize x32 ELF files as amd64.
  • Loading branch information
peace-maker committed Nov 24, 2023
1 parent 65f9d57 commit 78e8701
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pwnlib/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def arch(self, arch):
try:
defaults = self.architectures[arch]
except KeyError:
raise AttributeError('AttributeError: arch must be one of %r' % sorted(self.architectures))
raise AttributeError('AttributeError: arch (%r) must be one of %r' % (arch, sorted(self.architectures)))

for k,v in defaults.items():
if k not in self._tls:
Expand Down
1 change: 1 addition & 0 deletions pwnlib/elf/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def _describe(self, *a, **kw):
def get_machine_arch(self):
return {
('EM_X86_64', 64): 'amd64',
('EM_X86_64', 32): 'amd64', # x32 ABI
('EM_386', 32): 'i386',
('EM_486', 32): 'i386',
('EM_ARM', 32): 'arm',
Expand Down

0 comments on commit 78e8701

Please sign in to comment.