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

How to remove resource section #6

Open
GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments
Open

How to remove resource section #6

GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Hello!
I trying to replace resource (remove and create new one with same name).
I following your example 
(https://code.google.com/p/portable-executable-library/source/browse/trunk/sampl
es/resource_editor/main.cpp)

So, i do rename of section

image.section_from_directory(pe_win::image_directory_entry_resource).set_name("o
ldres");

Then create new section 

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);

But after this my PE file become almost 2x times bigger size.

I think this is happening because my resulting PE file have two sections which 
are almost the same except one resource i working with.

So, the question is: How can i completely remove old resource "oldres", so i 
have no duplicate data inside my resulting PE.

Fix me if i'm wrong.

Thanks, Dmitry.


Original issue reported on code.google.com by sdv.br...@gmail.com on 11 Sep 2014 at 1:59

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

No branches or pull requests

1 participant