Editing PE (exe) in rust. #1099
-
Good afternoon, p.s. I didn't find a save method in “pe::Binary”. And it's not clear on assigning a value at all. Here is int main() {
std::unique_ptr<LIEF::PE::Binary> binary = LIEF::PE::Parser::parse("input.exe");
auto& sections = binary->sections();
if (!sections.empty()) {
sections[0].size(0x2000);
sections[0].content(std::vector<uint8_t>{0x90, 0x90, 0x90});
}
binary->write("output.exe");
return 0;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Ars-Mond Right now the Rust bindings only expose "read-only" API so there is no way to modify a PE in Rust (at the moment". It should be supported in the future though |
Beta Was this translation helpful? Give feedback.
Hi @Ars-Mond
Right now the Rust bindings only expose "read-only" API so there is no way to modify a PE in Rust (at the moment".
It should be supported in the future though