-
Notifications
You must be signed in to change notification settings - Fork 212
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
Opening 0x07/0x08 "unbreakable" in radare2 #12
Comments
(i know this wasn't unbreakable) |
And gdb attach isn't even required. You can just use objdump and manually add symbols i guess. |
(which gives you symbols too) |
(except objdump sometimes fails...) |
(looking at what it says, it claims that there is 648588715588852480 program headers... unless i screwed up ELF parsing.) |
of course. Linux doesn't care about that. it uses sections not program headers... |
Oh i screwed up endianness... So i used big-endian for x86-64 which is little endian.. going back to parsing it |
And entry point is at: |
I parsed out section headers... there is one useful and a ton of (fuzzed in?) garbage. |
or maybe not fuzzed in. i screwed up elf parsing again (ELFs are hard, ok?) |
It claims there are 9 headers:
I looked at the original and it seems to be the same. These 3 super-high section types are withing the "OS Specific" range. So maybe some linux specific stuff? |
here is the elf header: |
(i am writing tools to do this so i can do this in superior typescript) |
BUT it has nice types (it took me ages to get it to work) |
I appreciate the shared investigation and experiments for people to discover here. But please don't write single sentence responses. This is not a chat 😅 |
Okay, so as it turns out this only works in older versions of radare, my radare that i got off master few days ago reads it fine. But my (older) gdb as well as all of binutils+llvm-binutils don't like it. The error is even more apparent when you try to
|
How? I modified it to hang for a second at the end, so i have time to quickly ^Z it away, and:
That got gdb attached (with debug symbols & everything)
Then, i used
vmmap
to get its mappings and found that the layout is something like this:So i used nasm to get an object that looks ok similar:
And ran:
nasm embed.s -felf64 -o asdf-fake.o
To my surpries, asdf-fake.o was good enough for radare and i was able to open it.
But there were no symbols (they were left alone in the cold with gdb). After analyzing it i did
s <TAB> <TAB>
and found some functions radare2 found:So i had a look at the first function,
fcn.08000718
. It was a small leaf function which looked very much like PLT handler. It had a code XREF fromfcn.0800089a
What is that? main.
So that wasn't too hard...
The text was updated successfully, but these errors were encountered: