pwntools icon indicating copy to clipboard operation
pwntools copied to clipboard

fix: asm() using the incorrect assembler for amd64 architecture

Open CuB3y0nd opened this issue 1 year ago • 2 comments

Changed the priority of assembler usage in amd64

CuB3y0nd avatar Mar 01 '25 14:03 CuB3y0nd

Thanks! Now I think I did not say it clearly: we want every architrcture to follow this pattern.

For example, assembling aarch64 should first try aarch64*-as, then native (if and only if host arch is aarch64), and then arm*-as as it frequently implements aarch64. And so on.

It should also be based on existing which_binutils function. My globs were supposed to be just illustrative, but the code should be kind of like the following:

aliases = {
 'aarch64': ['arm', 'something-exotic'],
 'amd64': ['i386', 'whatever'],
...
}

try(target)
if hostmachine == target: try(native)
for alias in aliases[target]:
  try(alias)

So just like it used to be, but native moved between the first try and the rest of them, instead of current buggy implementation (native is currently considered last).

Arusekk avatar Mar 01 '25 21:03 Arusekk

Can you apply the changes you have in mind here please @Arusekk?

peace-maker avatar Aug 05 '25 17:08 peace-maker