elf

How to rename dynamic symbols in arm elf .so file?

折月煮酒 提交于 2021-01-16 12:06:38
问题 I need to modify a so inside an Android APK. The task is to rename the dynamic symbols in side the so (which is the function name). For example, change from Java_com_example_abc_.... to Java_com_yahoo_zzz_.... I try to use WinHex directly search and replace text words, the apk startup error. Seems like the .hash section also needs to be updated, but i do not know how to update the .hash section. My question is what is the correct or preferable way to rename the dynamic Symbol? I heave been

How to rename dynamic symbols in arm elf .so file?

倖福魔咒の 提交于 2021-01-16 12:03:10
问题 I need to modify a so inside an Android APK. The task is to rename the dynamic symbols in side the so (which is the function name). For example, change from Java_com_example_abc_.... to Java_com_yahoo_zzz_.... I try to use WinHex directly search and replace text words, the apk startup error. Seems like the .hash section also needs to be updated, but i do not know how to update the .hash section. My question is what is the correct or preferable way to rename the dynamic Symbol? I heave been

How to rename dynamic symbols in arm elf .so file?

和自甴很熟 提交于 2021-01-16 12:02:07
问题 I need to modify a so inside an Android APK. The task is to rename the dynamic symbols in side the so (which is the function name). For example, change from Java_com_example_abc_.... to Java_com_yahoo_zzz_.... I try to use WinHex directly search and replace text words, the apk startup error. Seems like the .hash section also needs to be updated, but i do not know how to update the .hash section. My question is what is the correct or preferable way to rename the dynamic Symbol? I heave been

Map sharing between different ebpf program types

China☆狼群 提交于 2021-01-04 08:58:38
问题 Is it possible to share ebpf maps between different program types. I need to share a map between a tc-bpf program and a cgroup bpf program. This should be possible if the map is pinned to file system that act as global namespace. But, I haven't got this working. The map is created by tc-bpf program and pinned to global namespace. Since it is tc-bpf program, the map is of type struct bpf_elf_map. This bpf program is loaded via iproute2. Now, I have a cgroup bpf program that should be accessing

what is segment 00 in my Linux executable program (64 bits)

让人想犯罪 __ 提交于 2021-01-03 09:41:31
问题 Here is a very simple assembly program, just return 12 after executed. $ cat a.asm global _start section .text _start: mov rax, 60 ; system call for exit mov rdi, 12 ; exit code 12 syscall It can be built and executed correctly: $ nasm -f elf64 a.asm && ld a.o && ./a.out || echo $? 12 But the size of a.out is big, it is more than 4k: $ wc -c a.out 4664 a.out I try to understand it by reading elf content: $ readelf -l a.out Elf file type is EXEC (Executable file) Entry point 0x401000 There are

what is segment 00 in my Linux executable program (64 bits)

可紊 提交于 2021-01-03 09:29:38
问题 Here is a very simple assembly program, just return 12 after executed. $ cat a.asm global _start section .text _start: mov rax, 60 ; system call for exit mov rdi, 12 ; exit code 12 syscall It can be built and executed correctly: $ nasm -f elf64 a.asm && ld a.o && ./a.out || echo $? 12 But the size of a.out is big, it is more than 4k: $ wc -c a.out 4664 a.out I try to understand it by reading elf content: $ readelf -l a.out Elf file type is EXEC (Executable file) Entry point 0x401000 There are

how to understand fields of Relocation section '.rela.plt'

人盡茶涼 提交于 2021-01-01 04:43:52
问题 I'm trying to understand the dynamic linking of shared libraries on Linux. Given the following dump of Relocation section '.rela.plt': Offset Info Type Sym. Value Sym. Name + Addend 000000373f68 0f8300000007 R_X86_64_JUMP_SLO 0000000000000000 _ZN8CashFlowmIERK7Paym + 0 000000373f70 0f9800000007 R_X86_64_JUMP_SLO 0000000000000000 _Z8printCapPK3CapP8_IO + 0 000000373f78 0f9900000007 R_X86_64_JUMP_SLO 0000000000000000 _ZN13SharedBaggage16ge + 0 000000373f80 0f9c00000007 R_X86_64_JUMP_SLO

Linux default behavior against `.data` section

戏子无情 提交于 2020-12-23 09:31:49
问题 Story Case 1 I accidentally wrote my Assembly code in the .data section. I compiled it and executed it. The program ran normally under Linux 5.4.0-53-generic even though I didn't specify a flag like execstack . Case 2: After that, I executed the program under Linux 5.9.0-050900rc5-generic . The program got SIGSEGV . I inspected the virtual memory permission by reading /proc/$pid/maps . It turned out that the section is not executable. I think there is a configuration on Linux that manages

Generated ELF executable segfaults during startup

别说谁变了你拦得住时间么 提交于 2020-12-12 05:10:23
问题 I'm generating an ELF executable with a .text section loaded into a LOAD segment. It disassembles fine, but trying to run it under gdb gives During startup program terminated with signal SIGSEGV, Segmentation fault. readelf gives: ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry