|
|
|
@ -235,7 +235,7 @@ namespace Mono.Cecil.PE {
@@ -235,7 +235,7 @@ namespace Mono.Cecil.PE {
|
|
|
|
|
WriteByte (8); // LMajor
|
|
|
|
|
WriteByte (0); // LMinor
|
|
|
|
|
WriteUInt32 (text.SizeOfRawData); // CodeSize
|
|
|
|
|
WriteUInt32 (reloc != null ? reloc.SizeOfRawData : 0 |
|
|
|
|
WriteUInt32 ((reloc != null ? reloc.SizeOfRawData : 0) |
|
|
|
|
+ (rsrc != null ? rsrc.SizeOfRawData : 0)); // InitializedDataSize
|
|
|
|
|
WriteUInt32 (0); // UninitializedDataSize
|
|
|
|
|
|
|
|
|
@ -267,7 +267,7 @@ namespace Mono.Cecil.PE {
@@ -267,7 +267,7 @@ namespace Mono.Cecil.PE {
|
|
|
|
|
|
|
|
|
|
WriteUInt32 (0); // Checksum
|
|
|
|
|
WriteUInt16 (GetSubSystem ()); // SubSystem
|
|
|
|
|
WriteUInt16 (0x8540); // DLLFlags
|
|
|
|
|
WriteUInt16 ((ushort) module.Characteristics); // DLLFlags
|
|
|
|
|
|
|
|
|
|
const ulong stack_reserve = 0x100000; |
|
|
|
|
const ulong stack_commit = 0x1000; |
|
|
|
@ -754,17 +754,18 @@ namespace Mono.Cecil.PE {
@@ -754,17 +754,18 @@ namespace Mono.Cecil.PE {
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
var public_key = module.Assembly.Name.PublicKey; |
|
|
|
|
if (public_key.IsNullOrEmpty ()) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
if (public_key != null) { |
|
|
|
|
// in fx 2.0 the key may be from 384 to 16384 bits
|
|
|
|
|
// so we must calculate the signature size based on
|
|
|
|
|
// the size of the public key (minus the 32 byte header)
|
|
|
|
|
int size = public_key.Length; |
|
|
|
|
if (size > 32) |
|
|
|
|
return size - 32; |
|
|
|
|
// note: size == 16 for the ECMA "key" which is replaced
|
|
|
|
|
// by the runtime with a 1024 bits key (128 bytes)
|
|
|
|
|
} |
|
|
|
|
// in fx 2.0 the key may be from 384 to 16384 bits
|
|
|
|
|
// so we must calculate the signature size based on
|
|
|
|
|
// the size of the public key (minus the 32 byte header)
|
|
|
|
|
int size = public_key.Length; |
|
|
|
|
if (size > 32) |
|
|
|
|
return size - 32; |
|
|
|
|
|
|
|
|
|
// note: size == 16 for the ECMA "key" which is replaced
|
|
|
|
|
// by the runtime with a 1024 bits key (128 bytes)
|
|
|
|
|
|
|
|
|
|
return 128; // default strongname signature size
|
|
|
|
|
} |
|
|
|
|