Open Pamplemousse opened 4 years ago
Here is the pwntools
code raising this error: https://github.com/Gallopsled/pwntools/blob/dev/pwnlib/asm.py#L140-L205 .
It's expecting aarch64-linux-gnu-as
, which is not present.
I spent some time fiddling around Cross Compiling without being able to get a derivation working, so I am not sure it's the right way to go...
Cross-compiling Python packages is still a bit of an open issue.
Would that be a solution though?
I mean, I would expect the Python package to be compiled to target the host nonetheless, but with some cross-compiled dependencies (for several architectures - say you want to write shellcode to target arm
then aarch64
, you don't want to reinstall pwntools
).
Or maybe I am misunderstanding what you mean by "cross-compiled Python packages"...
I marked this as stale due to inactivity. → More info
For those of us that will run into the same kind of issue, and in the waiting of a robust way to deal with this, here is a simplified version of the shell.nix
I use:
with import <nixpkgs> { };
let
binutils_commands = "as ld objcopy readelf";
armhf-binutils = pkgsCross.armhf-embedded.buildPackages.binutils;
in
mkShell rec {
buildInputs = [
pwntools
armhf-binutils
makeWrapper
which
];
shellHook = ''
# `pwntools` is `which`ing for Debian looking commands...
for COMMAND in ${binutils_commands}; do
makeWrapper "$(which "arm-none-eabihf-$COMMAND")" "arm-linux-gnu-$COMMAND"
done
PATH="$(pwd):$PATH"
'';
exitHook = ''
for COMMAND in ${binutils_commands}; do
rm "arm-linux-gnu-$COMMAND"
done
'';
}
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/wishing-for-pkgscross-mips-to-exist-failed-to-contribute-it/13158/1
I marked this as stale due to inactivity. → More info
Describe the bug When wanting to write shellcodes for foreign architectures,
pwntools
complains about the absence of a cross-compiledbinutils
.To Reproduce
Gives the following error:
[ERROR] Could not find 'as' installed for ContextType(arch = 'aarch64', bits = 64, endian = 'little')
see full error
``` [ERROR] Could not find 'as' installed for ContextType(arch = 'aarch64', bits = 64, endian = 'little') Try installing binutils for this architecture: https://docs.pwntools.com/en/stable/install/binutils.html Traceback (most recent call last): File "Notify maintainers
@bennofs , @kristoff3r
Metadata