diff options
Diffstat (limited to 'Mono.Cecil.PE/ImageWriter.cs')
-rw-r--r-- | Mono.Cecil.PE/ImageWriter.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Mono.Cecil.PE/ImageWriter.cs b/Mono.Cecil.PE/ImageWriter.cs index 6f921d9..b5cdbe9 100644 --- a/Mono.Cecil.PE/ImageWriter.cs +++ b/Mono.Cecil.PE/ImageWriter.cs @@ -95,9 +95,8 @@ namespace Mono.Cecil.PE { if (rsrc == null) return; - var raw_resources = new byte [rsrc.Data.Length]; - Buffer.BlockCopy (rsrc.Data, 0, raw_resources, 0, rsrc.Data.Length); - win32_resources = new ByteBuffer (raw_resources); + var reader = module.Image.GetReaderAt (rsrc.VirtualAddress); + win32_resources = new ByteBuffer (reader.ReadBytes ((int) rsrc.SizeOfRawData)); } Section GetImageResourceSection () |