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

Rabin2 resize section / change section permissions not working #15449

Open
mehdithreem opened this issue Nov 11, 2019 · 3 comments
Open

Rabin2 resize section / change section permissions not working #15449

mehdithreem opened this issue Nov 11, 2019 · 3 comments

Comments

@mehdithreem
Copy link

Hello

I want to extend the .text section of an ELF file in order to add some functionality to it. When I run rabin2 -O r/.text/2048 a.out, it does not print any error, but the .text section size remains the same.

In addition, running rabin2 -O p/.data/rwx a.out or rabin2 -O e/0x8038000 a.out results in segmentation fault. It seems rabin patching functionalities does not work at all.

I have tested on both MacOS 10.15.1 and Ubuntu 18.04 environments. My targets were /bin/ls and a small gcc compiled program.

This is the output of rabin2 -O r/.text/2048 a.out:

delta: 2024
-> elf section ()
-> elf section (.interp)
-> elf section (.note.ABI-tag)
-> elf section (.note.gnu.build-id)
-> elf section (.gnu.hash)
-> elf section (.dynsym)
-> elf section (.dynstr)
-> elf section (.gnu.version)
-> elf section (.gnu.version_r)
-> elf section (.rela.dyn)
-> elf section (.rela.plt)
-> elf section (.init)
-> elf section (.plt)
-> elf section (.plt.got)
-> elf section (.text)
-> elf section (.fini)
-> elf section (.rodata)
-> elf section (.eh_frame_hdr)
-> elf section (.eh_frame)
-> elf section (.init_array)
-> elf section (.fini_array)
-> elf section (.jcr)
-> elf section (.dynamic)
-> elf section (.got)
-> elf section (.got.plt)
-> elf section (.data)
-> elf section (.bss)
-> elf section (.comment)
-> elf section (.shstrtab)
-> elf section (.symtab)
-> elf section (.strtab)
-> program header (0x00000040)
-> program header (0x00000238)
-> program header (0x00000000)
-> program header (0x00000e10)
-> program header (0x00000e28)
-> program header (0x00000254)
-> program header (0x000006e8)
-> program header (0x00000000)
-> program header (0x00000e10)
COPY FROM 0x00001050
COPY TO 0x00001838
Shifted 2024 byte(s)

Sorry for asking my question here, I googled a lot but didn't found any solution.

@phra
Copy link
Contributor

phra commented Jan 20, 2020

any update on this? i have the same problem with 4.2.0.

@radare
Copy link
Collaborator

radare commented Jan 20, 2020 via email

@hitzhangjie
Copy link

hitzhangjie commented Aug 21, 2020

I came across the same problem.

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

No branches or pull requests

6 participants