Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
579 changes: 579 additions & 0 deletions Relocation Section Editor/PeHeaders.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Relocation Section Editor/Relocation Section Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="PeHeaders.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Relocations.cs" />
Expand Down
325 changes: 160 additions & 165 deletions Relocation Section Editor/Relocations.cs

Large diffs are not rendered by default.

59 changes: 35 additions & 24 deletions Relocation Section Editor/frmAddRelocation.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Relocation Section Editor/frmAddRelocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Relocation_Section_Editor
{
public partial class frmAddRelocation : Form
{
private uint address;
private Relocations.BASE_RELOCATION_TYPE type;
private UInt64 address;
private PeHeader.BASE_RELOCATION_TYPE type;

public frmAddRelocation()
{
Expand All @@ -30,13 +30,13 @@ private void btnCancel_Click(object sender, EventArgs e)

private void btnOK_Click(object sender, EventArgs e)
{
if (!uint.TryParse(txtAddress.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out address))
if (!UInt64.TryParse(txtAddress.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out address))
{
MessageBox.Show("\"" + txtAddress.Text.ToUpper() + "\" isn't a valid address");
MessageBox.Show("\"" + txtAddress.Text.ToUpper() + "\" isn't a valid address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

type = (Relocations.BASE_RELOCATION_TYPE)(cboType.SelectedIndex + 1);
type = (PeHeader.BASE_RELOCATION_TYPE)(cboType.SelectedIndex + 1);

this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
Expand All @@ -52,12 +52,12 @@ private void txtAddress_KeyPress(object sender, KeyPressEventArgs e)
e.Handled = true;
}

public uint GetAddress()
public UInt64 GetAddress()
{
return address;
}

public Relocations.BASE_RELOCATION_TYPE GetRelocType()
public PeHeader.BASE_RELOCATION_TYPE GetRelocType()
{
return type;
}
Expand Down
74 changes: 44 additions & 30 deletions Relocation Section Editor/frmEditRelocation.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Relocation Section Editor/frmEditRelocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace Relocation_Section_Editor
{
public partial class frmEditRelocation : Form
{
private uint oldAddress;
private uint newAddress;
private Relocations.BASE_RELOCATION_TYPE type;
private UInt64 oldAddress;
private UInt64 newAddress;
private PeHeader.BASE_RELOCATION_TYPE type;

public frmEditRelocation(uint oldAddress, Relocations.BASE_RELOCATION_TYPE oldType)
public frmEditRelocation(UInt64 oldAddress, PeHeader.BASE_RELOCATION_TYPE oldType)
{
InitializeComponent();

Expand Down Expand Up @@ -42,28 +42,28 @@ private void txtNewAddress_KeyPress(object sender, KeyPressEventArgs e)

private void btnOK_Click(object sender, EventArgs e)
{
if (!uint.TryParse(txtNewAddress.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out newAddress))
if (!UInt64.TryParse(txtNewAddress.Text, System.Globalization.NumberStyles.AllowHexSpecifier, null, out newAddress))
{
MessageBox.Show("\"" + txtNewAddress.Text.ToUpper() + "\" isn't a valid address");
MessageBox.Show("\"" + txtNewAddress.Text.ToUpper() + "\" isn't a valid address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

type = (Relocations.BASE_RELOCATION_TYPE)(cboType.SelectedIndex + 1);
type = (PeHeader.BASE_RELOCATION_TYPE)(cboType.SelectedIndex + 1);

this.DialogResult = System.Windows.Forms.DialogResult.OK;
}

public uint GetOldAddress()
public UInt64 GetOldAddress()
{
return oldAddress;
}

public uint GetNewAddress()
public UInt64 GetNewAddress()
{
return newAddress;
}

public Relocations.BASE_RELOCATION_TYPE GetRelocType()
public PeHeader.BASE_RELOCATION_TYPE GetRelocType()
{
return type;
}
Expand Down
Loading