Skip to content
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

add 'AMD64' arch in get_system_arch() #555

Merged
merged 2 commits into from
Mar 25, 2022
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
2 changes: 1 addition & 1 deletion python/meterpreter/meterpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def get_system_arch():
ctypes.windll.kernel32.GetNativeSystemInfo(ctypes.byref(sysinfo))
values = {0:'x86', 5:'armle', 6:'IA64', 9:'x64'}
arch = values.get(sysinfo.wProcessorArchitecture, uname_info[4])
if arch == 'x86_64':
if arch == 'x86_64' or arch.lower() == 'amd64':
Copy link
Contributor

@adfoster-r7 adfoster-r7 Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#555 (comment)

In particular:

Cygwin on Windows uses "x86_64", FreeBSD uses "amd64", Linux uses "x86_64". Mac OS X uses "x86_64" for Intels (and ppc64" for PowerPCs).

Should we add those values too? 👀

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the edgecases are only really around powerpc, which isn't a super relevant target these days

From the freebsd uname man pages:

EXAMPLES
     The hardware platform (-m)	can be different from the machine's processor
     architecture (-p),	e.g., on 64-bit	PowerPC, -m would return powerpc and
     -p	would return powerpc64

arch = 'x64'
return arch

Expand Down