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

LIEF 0.10.1: 05_ELF_infect_plt-got Segmentation Fault #6

Open
d4em0n opened this issue Dec 12, 2020 · 1 comment
Open

LIEF 0.10.1: 05_ELF_infect_plt-got Segmentation Fault #6

d4em0n opened this issue Dec 12, 2020 · 1 comment

Comments

@d4em0n
Copy link

d4em0n commented Dec 12, 2020

➜  05_ELF_infect_plt-got git:(master) ls
arch  crackme.c  hook.c  hook_pltgot.py  Makefile  script.ld
➜  05_ELF_infect_plt-got git:(master) make
gcc crackme.c -O3 -o crackme.bin
chmod u+rx crackme.bin
gcc -Wl,-T script.ld -fno-stack-protector -nostdlib -nodefaultlibs -fPIC -Wl,-shared hook.c -o hook
In file included from hook.c:1:
arch/x86_64/syscall.c:24:13: warning: conflicting types for built-in function ‘_exit’; expected ‘void(int)’ [-Wbuiltin-declaration-mismatch]
   24 | static long _exit(int errcode) {
      |             ^~~~~
➜  05_ELF_infect_plt-got git:(master) ✗ ls
arch  crackme.bin  crackme.c  hook  hook.c  hook_pltgot.py  Makefile  script.ld
➜  05_ELF_infect_plt-got git:(master) ✗ make run
python ./hook_pltgot.py
chmod u+x ./crackme.hooked
./crackme.hooked XXXXXXXXXXXXXXXXXXXXX
make: *** [Makefile:16: run] Segmentation fault (core dumped)
➜  05_ELF_infect_plt-got git:(master) ✗ ./crackme.hooked
[1]    115659 segmentation fault (core dumped)  ./crackme.hooked
➜  05_ELF_infect_plt-got git:(master) ✗ python3 -m pip list | grep lief
lief                    0.10.1
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
➜  05_ELF_infect_plt-got git:(master) ✗ uname -a
Linux justpwn 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

crackme.hooked.zip

@Bluekezhou
Copy link

I encountered the same problem.

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

2 participants