Giter Site home page Giter Site logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
[deleted comment]

from portable-executable-library.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 22, 2024
//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 [email protected] on 28 Nov 2013 at 10:14

from portable-executable-library.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.