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

Adding pattern for looking up baremetal arm binutils #1916

Closed
wants to merge 8 commits into from
Closed

Adding pattern for looking up baremetal arm binutils #1916

wants to merge 8 commits into from

Conversation

WittsEnd2
Copy link
Contributor

Pwntools Pull Request

This is an additioinal pattern so that baremetal arm (specifically arm-none-eabi) can be found by pwntools.

Testing

This was primarily tested through manual inspection. I ran the automated tests and it didn't break anything

Target Branch

I am putting this in dev for now; however, since it is a relatively simple one-line code, it could go into stable if desired.

@WittsEnd2
Copy link
Contributor Author

The reason why I added this was that pwntools couldn't find the packages from the apt package binutils-arm-none-eabi. By adding this one line of code, it was able to find it. This is specific to setting the context architecture to arm and context operating system to baremetal.

@heapcrash
Copy link
Collaborator

This needs a CHANGELOG addition

@WittsEnd2
Copy link
Contributor Author

Added the commit to Changelog. I am having issues undoing an accidental commit to the Dockerfile that I made. Is there a simple way to undo this? I can get my way around Git, but not a Git expert.

@Arusekk
Copy link
Member

Arusekk commented Jun 19, 2021

Try git rebase -i HEAD~7 to reorder and/or improve clarity of your changes, and then during the rebase process try doing git checkout dev path/to/file in order to get the clean version of the file, and then git commit --amend to insert additional changes into a done commit.

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -199,6 +199,7 @@ def which_binutils(util):
else:
patterns = ['%s*linux*-%s' % (arch, gutil),
'%s*-elf-%s' % (arch, gutil),
'%s-none*-%s' % (arch, gutil),
Copy link
Member

Choose a reason for hiding this comment

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

What if you have both packages installed? Does this break anything or it passes the tests? Also, IIRC bare-metal ARM can be compiled with any *arm*-gcc with correct commandline flags, not only by arm-none-eabi-gcc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on what I have seen from my own testing (and manually tested), which_binutils() returns the first binutils that it recognizes. It will first find linux-gnueabi then the linux-gnueabihf. If those are not there then it tries to find none-eabi. There seems to be no conflict.

Co-authored-by: Arusekk <arek_koz@o2.pl>
@WittsEnd2
Copy link
Contributor Author

I am going to do another fork and add the changes there just to keep it simple. I am having difficulties fixing my mistakes with the commits. I will close this and create another pull request with just one/two commit.

@WittsEnd2 WittsEnd2 closed this Jun 19, 2021
@WittsEnd2
Copy link
Contributor Author

Updated pull request for this is numbered 1921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants