I'm reading practical-binary-analysis book about binary analysis but at chapter 7 "SIMPLE CODE INJECTION TECHNIQUES FOR ELF", I learned about hexedit a binary and injecting code section to it there is a tool named elfinject I compiled it in code/chapter7/ directory with the command
sudo apt install libelf-dev && make elfinject
after it i copy my ls binary with cmd
cp /bin/ls ls.entry
then I figured out the entry point of the binary which was 0x67d0 ( maybe different for u )
readelf -h ls.entry
after that I replaced entry point I found with readelf in hello.s
push 0x67d0
ok after this I compiled hello.s with cmd
nasm -fbin -o hello.bin hello.s
now, i injected it in ls.entry binary with cmd
./elfinject ls.entry hello.bin ".injected" 0x800000 0
but in the output it segfault after printing hello world message I'm not noob I just explained everything to make things clear, I also tried gdb but it didn't worked also can u elaborate PLT_NOTE segment overriding in bit details?