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

etelf mirror elf generation (1-1 output) failed to update function address in _start #33

Closed
orcguru opened this issue Feb 1, 2021 · 1 comment

Comments

@orcguru
Copy link

orcguru commented Feb 1, 2021

Unfortunately I had some binaries which setup _libc_start_main parameter by mov instructions on x86_64. In below example 0x531e30 points to __libc_csu_init, however etelf failed to update 0x531e30 to the new address, and so crash happens...

0000000040000018 <_start>:
40000018: 31 ed xor %ebp,%ebp
4000001a: 49 89 d1 mov %rdx,%r9
4000001d: 5e pop %rsi
4000001e: 48 89 e2 mov %rsp,%rdx
40000021: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
40000025: 50 push %rax
40000026: 54 push %rsp
40000027: 49 c7 c0 20 1e 53 00 mov $0x531e20,%r8
4000002e: 48 c7 c1 30 1e 53 00 mov $0x531e30,%rcx
40000035: 48 c7 c7 70 39 42 00 mov $0x423970,%rdi
4000003c: e8 8f 02 60 c0 callq 6002d0 __libc_start_main@plt
40000041: f4 hlt
40000042: 90 nop
40000043: 90 nop

Maybe I will try to manually update it for now, and see if I have time to dig into this later...

@orcguru
Copy link
Author

orcguru commented Jun 18, 2021

Unfortunately my CentOS creates elf that has constant addresses all over the places... I will give it a try to work around the problem, and will definitely publish the patch if I have one...

@orcguru orcguru closed this as completed Jun 18, 2021
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

No branches or pull requests

1 participant