Inject so into elf

Zhenyu Guo guozy03@mails.tsinghua.edu.cn
Fri Jun 10 07:31:00 GMT 2005
Hi,
	I am trying to rewrite elf so that my own dll can be loaded next
time. I've added a new Elf64_Dyn entry at the .dynamic segment, just
before the last DT_NULL entry. And, I append the dll name to the end of
the .dynstr whose attributes are designated by DT_STRTAB and DT_STRSZ.
Both the .dynamic segment and .dynstr are moved to the end of the file.
Finally, I rewrite the program header (DT_DYNAMIC), while adding a new
PT_LOAD segment to load the new .dynstr and .dynamic segments.
	After all these are done, I've got msg:  /lib/tls/libc.so.6.1:
version `libbetto.so' not found . (betto is my lib name)
	What the things that I've missed? And is there any better way to
inject my own dll into an elf  file (not a process)?
Thanks,
Zhenyu



More information about the Binutils mailing list