Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial script for "Create a PE from scratch" broken #746

Open
Nordwald opened this issue Jul 12, 2022 · 4 comments
Open

Tutorial script for "Create a PE from scratch" broken #746

Nordwald opened this issue Jul 12, 2022 · 4 comments
Assignees
Labels
Builder Good First Issue Issue that can be addressed without an in-depth understanding of LIEF PE

Comments

@Nordwald
Copy link

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
@Nordwald
Copy link
Author

Screenshot from 2022-07-12 14-18-48

@romainthomas
Copy link
Member

Ack (I won't likely have a fix soon)

@romainthomas romainthomas added PE Builder Good First Issue Issue that can be addressed without an in-depth understanding of LIEF labels Jul 14, 2022
@ZehMatt
Copy link
Contributor

ZehMatt commented Jul 22, 2022

I believe this is the same issue as #733 which was fixed by #734. Could you try to test the latest commit?

@chinggg
Copy link

chinggg commented Jul 28, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builder Good First Issue Issue that can be addressed without an in-depth understanding of LIEF PE
Projects
None yet
Development

No branches or pull requests

4 participants