LIEF
LIEF copied to clipboard
Tutorial script for "Create a PE from scratch" broken
Describe the bug The script to the tutorial 02 - Create a PE from scratch is completely broken.
- There is no optional header
- Sections are unnamed
- Sections are overlapping
- Sections are extremely big (e.g. 0x400061 to 0x74a1648f)
- There is no import table
To Reproduce Follow the steps in 02 - Create a PE from scratch or execute the tutorial script: pe_from_scratch.py
Expected behavior Working executable with correct headers and sections
Environment (please complete the following information):
- System and Version : Fedora 36
- Target format: PE
- LIEF commit version: 0.12.1-c7b3ce3b
Ack (I won't likely have a fix soon)
I believe this is the same issue as https://github.com/lief-project/LIEF/issues/733 which was fixed by https://github.com/lief-project/LIEF/pull/734. Could you try to test the latest commit?
I just test the script and use radare2 to analyze the generated PE file, it seems the problem still exists.
[0x00400074]> iS
[Sections]
nth paddr size vaddr vsize perm name
――――――――――――――――――――――――――――――――――――――――――――――――――――――
0 0x00001000 0x1c 0x00400074 0x78658000 ---- sect_0
1 0x00002000 0x1c 0x00400061 0x74617000 ---- sect_1
2 0x00003000 0x200 0x00400000 0x317000 ---- sect_2