|
CODE:
The final algorithm is using this information is.
* Increase p_shoff by PAGE_SIZE in the ELF header * Patch the insertion code (parasite) to jump to the entry point (original) * Locate the text segment program header * Modify the entry point of the ELF header to point to the new code (p_vaddr + p_filesz) * Increase p_filesz by account for the new code (parasite) * Increase p_memsz to account for the new code (parasite) * For each phdr who's segment is after the insertion (text segment) * increase p_offset by PAGE_SIZE * For the last shdr in the text segment * increase sh_len by the parasite length * For each shdr who's section resides after the insertion * Increase sh_offset by PAGE_SIZE * Physically insert the new code (parasite) and pad to PAGE_SIZE, into the file - text segment p_offset + p_filesz (original) 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10617731/viewspace-959652/ ,如需转载,请注明出处,否则将追究法律责任。
下一篇:
写给初入黑道朋友们几句话……(转)
请登录后发表评论
登录
全部评论
|