elf

SYSV vs. Linux/GNU ELF formats

给你一囗甜甜゛ 提交于 2019-12-08 19:16:12
问题 The question is in the context of the following question: Why are libraries not found, even though they are clearly on the -L path? . It seems that my libraries and my object file have a different ELF format, which might cause the linker to not "find" the libraries. Now, this leads to a couple of questions: It seems that my compiler normally generates SYSV ELF files. (Checked with file ). However, for that particular C++ source, it generates a Linux/GNU ELF object file. I wonder why, so I

set breakpoint in an stripped ELF executable

有些话、适合烂在心里 提交于 2019-12-08 00:57:29
问题 I have an ELF 32-bit dynamically linked, stripped file which I wish to debug. While trying to set a breakpoint at an address a message saying that the symbol table is not loaded. My questions are: When you say that an ELF file is stripped what exactly is happening? How do you strip an ELF file? Is it possible to reconstruct the symbol table somehow? Is it not possible to set breakpoints in gdb on a stripped executable? 回答1: Stripping ELFs is is done with the gnu binutils tool strip, from the

Can I get object name from a symbol information in the symbol table in an ELF file?

和自甴很熟 提交于 2019-12-07 21:26:25
问题 I have successfully parsed an elf file (executable file) compiled from multiple source files. I am able to get the binding(local,global,weak), type(object,file,section,function), size of the symbol and the address of the symbol along with the symbol name ( from string table). The section to which the symbol is linked is also known to me. My question is that can we get the exact object file name( * *.obj) which contains the symbol from the symbol table information? Am I missing some

How can I build for linux 32-bit with go1.6.2

早过忘川 提交于 2019-12-07 15:55:29
问题 Is there any combination of GOARCH and GOOS values which I can set in order to build ELF 32-bit binary? 回答1: GOOS=linux and GOARCH=386 . More examples: architecture: 32-bit -> GOARCH=386 64-bit -> GOARCH=amd64 OS: Windows -> GOOS=windows Linux -> GOOS=linux OS X -> GOOS=darwin FreeBSD -> GOOS=freebsd For the complete list (valid "individual" values) refer to go/build/syslist.go file: const goosList = "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows " const

Create and test x86-64 ELF executable shellcode on a Linux machine

自作多情 提交于 2019-12-07 13:00:11
问题 I am creating a training on buffer overflows and stack/heap attacks. I am working on an Ubuntu 12.04 x86_64 machine and want to show some sample buggy programs and the ways you could exploit those vulnerabilities. I am trying to start with the most basic shellcode I have found so far, the simple exit call, which should exit the program being overflowed. Hereby the exitcall.asm : ;exitcall.asm [SECTION .text] global _start _start: xor ebx,ebx ; zero out ebx, same function as mov ebx,0 mov al,

How can I find the size of a ELF file/image with Header information?

天大地大妈咪最大 提交于 2019-12-07 12:19:01
问题 I need to find the size of an elf image for some computation. I have tried with the readelf utility on linux which gives the informations about the headers and section. I need to have the exact file size of the elf(on the whole). How do I find the size of the ELF from the header information or Is there any other means to find the size of an elf without reading the full image. 回答1: You can use the stat functions family (stat(), lstat(), fstat()) to get the size of any file (using the st_size

Can ELF symbols be represented in UTF8?

两盒软妹~` 提交于 2019-12-07 10:31:28
问题 May a symbol in the ELF table use UTF8 characters or is it restricted to ASCII? Note: It is not a problem that I am trying to solve, it is more something I am wondering. 回答1: ELF string tables use NUL-terminated strings, so you could possibly store UTF-8 encoded symbol names inside them. That said, the tools that use such symbols would need to be Unicode-aware to work correctly. For example: Whether your programming language tool chain correctly classifies a specified Unicode 'character' as a

What is “Alignment” field in binary formats? Why is it needed?

北城以北 提交于 2019-12-07 09:38:52
问题 In ELF file format we have an Alignment field in Segment Header Table aka Program Header Table . In case of Windows PE file format they take it to next level the Sections have two alignment values, one within the disk file and the other in memory. The PE file header specifies both of these values. I didn't understand a thing about this alignment. What do we need it for? How & Where is it used? Again, I don't know what is alignment in binary file format context but why do we need it? 回答1: Well

Code sequences for TLS on ARM

旧街凉风 提交于 2019-12-07 04:38:04
问题 The ELF Handling For Thread-Local Storage document gives assembly sequences for the various models (local exec/initial exec/general dynamic) for various architectures. But not ARM -- is there anywhere I can see such code sequences for ARM? I'm working on a compiler and want to generate code that will operate properly with the platform linkers (both program and dynamic). For clarity, let's assume an ARMv7 CPU and a pretty new kernel and glibc (say 3.13+ / 2.19+), but I'd also be interested in

Make text segment writable, ELF [duplicate]

时间秒杀一切 提交于 2019-12-07 03:07:53
问题 This question already has answers here : How can I make GCC compile the .text section as writable in an ELF binary? (4 answers) Closed 4 years ago . I need to make .text segment of an executable ELF writable. The program i need to modify is written in C and i can compile it. Any ideas? Thanks A lot. 回答1: For the answer below, I'm going to use this test program: #include <stdio.h> #include <stdlib.h> int main (int argc, char **argv) { printf ("Hello world\n"); void *m = main; *((char *) m) = 0