You've already forked linux-packaging-mono
Imported Upstream version 6.4.0.137
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
parent
e9207cf623
commit
ef583813eb
@@ -11,8 +11,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
#if !READ_ONLY
|
||||
|
||||
namespace Mono.Cecil.PE {
|
||||
|
||||
class BinaryStreamWriter : BinaryWriter {
|
||||
@@ -89,5 +87,3 @@ namespace Mono.Cecil.PE {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
5
external/cecil/Mono.Cecil.PE/ByteBuffer.cs
vendored
5
external/cecil/Mono.Cecil.PE/ByteBuffer.cs
vendored
@@ -160,8 +160,6 @@ namespace Mono.Cecil.PE {
|
||||
return value;
|
||||
}
|
||||
|
||||
#if !READ_ONLY
|
||||
|
||||
public void WriteByte (byte value)
|
||||
{
|
||||
if (position == buffer.Length)
|
||||
@@ -334,8 +332,5 @@ namespace Mono.Cecil.PE {
|
||||
Buffer.BlockCopy (current, 0, buffer, 0, current_length);
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
19
external/cecil/Mono.Cecil.PE/ImageWriter.cs
vendored
19
external/cecil/Mono.Cecil.PE/ImageWriter.cs
vendored
@@ -11,8 +11,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
#if !READ_ONLY
|
||||
|
||||
using Mono.Cecil.Cil;
|
||||
using Mono.Cecil.Metadata;
|
||||
|
||||
@@ -360,6 +358,11 @@ namespace Mono.Cecil.PE {
|
||||
WriteUInt32 (characteristics);
|
||||
}
|
||||
|
||||
uint GetRVAFileOffset (Section section, RVA rva)
|
||||
{
|
||||
return section.PointerToRawData + rva - section.VirtualAddress;
|
||||
}
|
||||
|
||||
void MoveTo (uint pointer)
|
||||
{
|
||||
BaseStream.Seek (pointer, SeekOrigin.Begin);
|
||||
@@ -367,7 +370,7 @@ namespace Mono.Cecil.PE {
|
||||
|
||||
void MoveToRVA (Section section, RVA rva)
|
||||
{
|
||||
BaseStream.Seek (section.PointerToRawData + rva - section.VirtualAddress, SeekOrigin.Begin);
|
||||
BaseStream.Seek (GetRVAFileOffset (section, rva), SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
void MoveToRVA (TextSegment segment)
|
||||
@@ -811,6 +814,14 @@ namespace Mono.Cecil.PE {
|
||||
return pe_header_size + SizeOfOptionalHeader () + (sections * section_header_size);
|
||||
}
|
||||
|
||||
public void PatchMvid (Guid guid)
|
||||
{
|
||||
uint offset = GetRVAFileOffset (text, text_map.GetRVA (TextSegment.GuidHeap));
|
||||
BaseStream.Seek (offset, SeekOrigin.Begin);
|
||||
var arr = guid.ToByteArray ();
|
||||
BaseStream.Write (arr, 0, arr.Length);
|
||||
}
|
||||
|
||||
void PatchWin32Resources (ByteBuffer resources)
|
||||
{
|
||||
PatchResourceDirectoryTable (resources);
|
||||
@@ -851,5 +862,3 @@ namespace Mono.Cecil.PE {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
4
external/cecil/Mono.Cecil.PE/TextMap.cs
vendored
4
external/cecil/Mono.Cecil.PE/TextMap.cs
vendored
@@ -10,8 +10,6 @@
|
||||
|
||||
using System;
|
||||
|
||||
#if !READ_ONLY
|
||||
|
||||
using RVA = System.UInt32;
|
||||
|
||||
namespace Mono.Cecil.PE {
|
||||
@@ -108,5 +106,3 @@ namespace Mono.Cecil.PE {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user