From e190fa98fa90c66066cf8f96cb6b97c30c1640cd Mon Sep 17 00:00:00 2001
From: rukaimi <rukaimi@985867f9-ca9c-e1f6-822d-e8a4186388af>
Date: Wed, 19 Sep 2012 15:34:56 +0000
Subject: [PATCH] Fixed resource rebuilder bug

---
 pe_lib/pe_base.cpp | 2 +-
 pe_lib/pe_base.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pe_lib/pe_base.cpp b/pe_lib/pe_base.cpp
index b152ff9..0e19b58 100644
--- a/pe_lib/pe_base.cpp
+++ b/pe_lib/pe_base.cpp
@@ -3642,7 +3642,7 @@ void pe_base::rebuild_resource_directory(section& resource_section, resource_dir
 		IMAGE_RESOURCE_DIRECTORY_ENTRY entry;
 		if((*it).is_named())
 		{
-			entry.Name = 0x80000000 | current_strings_pos;
+			entry.Name = 0x80000000 | (current_strings_pos - offset_from_section_start);
 			WORD unicode_length = static_cast<WORD>((*it).get_name().length());
 			memcpy(&raw_data[current_strings_pos], &unicode_length, sizeof(unicode_length));
 			current_strings_pos += sizeof(unicode_length);
diff --git a/pe_lib/pe_base.h b/pe_lib/pe_base.h
index d69c50e..0fd6483 100644
--- a/pe_lib/pe_base.h
+++ b/pe_lib/pe_base.h
@@ -12,7 +12,7 @@
 
 //Please don't remove this information from header
 //PE Library (c) DX 2011 - 2012, http://kaimi.ru
-//Version: 0.1.4
+//Version: 0.1.5
 //Free to use, modify and distribute
 
 // == more important ==
-- 
GitLab