Open GoogleCodeExporter opened 9 years ago
[deleted comment]
//Create PE image from file stream
pe_base image(pe_factory::create_pe(pe_file));
//Get Resource Manager
resource_directory root(get_resources(image));
pe_resource_manager res(root);
//Change the name of the old resource section (Not Sure if this is neccesary)
image.section_from_directory(pe_win::image_directory_entry_resource).set_name("o
ldres");
//Add the resource by providing data, a root name, resource id, language, ...
res.add_resource(<-Some Binary Data Here->, L"BIN", 205, 1033,0,0);
//Create new resource section and add it to the image
section new_resources;
new_resources.get_raw_data().resize(1);
new_resources.set_name(".rsrc");
new_resources.readable(true);
section& attached_section = image.add_section(new_resources);
//Rebuild the resources
rebuild_resources(image, root, attached_section);
//Build the new executable by providing file stream to write new PE to
rebuild_pe(image, new_pe_file);
Original comment by Damian.D...@gmail.com
on 28 Nov 2013 at 10:14
Original issue reported on code.google.com by
460457...@qq.com
on 23 Aug 2013 at 4:16