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

Little help with writing the modifications of an PE #394

Closed
GanbaruTobi opened this issue Mar 10, 2024 · 1 comment
Closed

Little help with writing the modifications of an PE #394

GanbaruTobi opened this issue Mar 10, 2024 · 1 comment

Comments

@GanbaruTobi
Copy link

Hello, I just tried to use this crate.
I parsed an PE from memory into an PE and that seems to work. But how do I write the modified result? Thanks for any help

    let poptions = ParseOptions{ resolve_rva : false, parse_attribute_certificates : false};
    let mut pe_mem = goblin::pe::PE::parse_with_opts(memory_data, &poptions)?; 
    
    for section in &mut pe_mem.sections {
        section.pointer_to_raw_data = section.virtual_address;
        section.size_of_raw_data = section.virtual_size;
   }
   //write the modifications here.
}
@m4b
Copy link
Owner

m4b commented Mar 10, 2024

writing a PE (or binary file in general) is generally much more involved than reading. However, there is ongoing work to support writing pe in #389 as well as previously merged PRs. https://github.com/RaitoBezarius/ifrit is an example of this. if you need a specific feature that isn't covered, feel free to open another issue with that feature, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants