NHSE/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs
Kurt ebfd2ca87f Add generic RAM read/write form
accessible once a save is loaded, same as item injecting

untested, but should be fine
2020-04-01 16:29:56 -07:00

27 lines
716 B
C#

using System.Linq;
using System.Windows.Forms;
using NHSE.Injection;
namespace NHSE.WinForms
{
public partial class SimpleHexEditor : Form
{
public byte[] Bytes;
public SimpleHexEditor(byte[] originalBytes)
{
InitializeComponent();
RTB_RAM.Text = string.Join(" ", originalBytes.Select(z => $"{z:X2}"));
Bytes = originalBytes;
}
private void Update_Click(object sender, System.EventArgs e)
{
var bytestring = RTB_RAM.Text.Replace("\t", "").Replace(" ", "").Trim();
Bytes = Decoder.StringToByteArray(bytestring);
DialogResult = DialogResult.OK;
Close();
}
}
}