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

Making x64 hello sample position independent #26

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Caesurus
Copy link

@Caesurus Caesurus commented Apr 7, 2018

I tested this with the PIE binary that I've been working with and with a standard binary like ls

@lunixbochs
Copy link
Owner

0x19+size seems wrong, maybe it should still be hello, then do %#x-rip?

@lunixbochs
Copy link
Owner

lunixbochs commented Apr 8, 2018

memcpy PIE is done here with the magic _PKST_ label: https://github.com/lunixbochs/patchkit/blob/master/core/arch.py#L73

@Caesurus
Copy link
Author

Caesurus commented Apr 10, 2018

That's exactly what I was looking for. Updated as you suggested, looks much better.
Tested with PIE and standard ls binary

It is a shame that the hello variable isn't used though, it's nice to see that inject returns that address and how to use it. Maybe it's good to have this as a separate example, hello64_pie.py?

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.

2 participants