{"action":"closed","issue":{"url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/issues/6","labels_url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/issues/6/comments","events_url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/issues/6/events","html_url":"https://github.com/FafnerKeyZee/portable-executable-library/issues/6","id":69838118,"number":6,"title":"How to remove resource section","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/FafnerKeyZee/portable-executable-library/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-21T12:53:37Z","updated_at":"2015-04-21T12:59:54Z","closed_at":"2015-04-21T12:59:54Z","body":"```\nHello!\nI trying to replace resource (remove and create new one with same name).\nI following your example \n(https://code.google.com/p/portable-executable-library/source/browse/trunk/sampl\nes/resource_editor/main.cpp)\n\nSo, i do rename of section\n\nimage.section_from_directory(pe_win::image_directory_entry_resource).set_name(\"o\nldres\");\n\nThen create new section \n                \nsection new_resources;\nnew_resources.get_raw_data().resize(1); \nnew_resources.set_name(\".rsrc\"); \nnew_resources.readable(true); \nsection& attached_section = image.add_section(new_resources);\n\nBut after this my PE file become almost 2x times bigger size.\n\nI think this is happening because my resulting PE file have two sections which \nare almost the same except one resource i working with.\n\nSo, the question is: How can i completely remove old resource \"oldres\", so i \nhave no duplicate data inside my resulting PE.\n\nFix me if i'm wrong.\n\nThanks, Dmitry.\n\n\n```\n\nOriginal issue reported on code.google.com by `sdv.br...@gmail.com` on 11 Sep 2014 at 1:59"}}