2

I am trying to learn and use Elfreader by compiling a simple hello world program to a elf file as-

gcc -o test test.c

The file compiles correctly and runs perfect. But when I try to run ReadElf on it by

readelf -h test

it returns

readelf: Error: Not and ELF file - it has the wrong magic bytes at the start

What do you think I am doing wrong, or is there a problem with my linker script? Let me know if you need any additional info from me.

4

1 回答 1

-1

您可以检查文件格式类型如下:

$ objdump -t hello.exe

hello.exe:文件格式pei-i386

也许我猜你的文件不是精灵格式。

于 2019-04-10T08:24:32.817 回答