From 6f792d1f4543a9d625208a66522ce5d83a4cc549 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Mon, 11 May 2015 23:03:47 -0400 Subject: [PATCH] Write actual RVA values --- .../Microsoft/MicrosoftExecutableDataFormat.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Microsoft/MicrosoftExecutableDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Microsoft/MicrosoftExecutableDataFormat.cs index f491a18c..8faba48f 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Microsoft/MicrosoftExecutableDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Microsoft/MicrosoftExecutableDataFormat.cs @@ -517,7 +517,9 @@ Watcom C++ 10.6 W?h$n(i)v W?h$n(ia)v W?h$n()v peoh.imageSize = 16384; peoh.headerSize = 512; peoh.subsystem = 2; - peoh.rvaCount = 16; + + uint[] rvas = new uint[16]; + peoh.rvaCount = (uint)rvas.Length; if (peoh.enabled) { @@ -552,6 +554,12 @@ Watcom C++ 10.6 W?h$n(i)v W?h$n(ia)v W?h$n()v #endregion #endregion + // write the RVA values + for (uint i = 0; i < peoh.rvaCount; i++) + { + bw.WriteUInt32(rvas[(int)i]); + } + #region Sections { System.Collections.Generic.List peshes = new System.Collections.Generic.List();