Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Various Quality of Life features #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Changed 'Auto-name' into 'Init from RTTI' and it now also inits the v…
…table pointer automatically.
  • Loading branch information
FransBouma committed Jul 3, 2023
commit b61edca698a3c7111c2d328e289ea966340b81f4
4 changes: 2 additions & 2 deletions 4 ReClass.NET/Controls/MemoryViewControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ public void Reset()
}


public void AutoNameCurrentClassFromRTTI(ClassNode classNode)
public void InitCurrentClassFromRTTI(ClassNode classNode)
{
var args = new DrawContextRequestEventArgs { Node = classNode };

Expand All @@ -721,7 +721,7 @@ public void AutoNameCurrentClassFromRTTI(ClassNode classNode)
Address = args.BaseAddress,
Level = 0,
};
classNode.AutoNameFromRTTI(view);
classNode.InitFromRTTI(view);
}
}
}
72 changes: 36 additions & 36 deletions 72 ReClass.NET/Forms/MainForm.Designer.cs

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

6 changes: 3 additions & 3 deletions 6 ReClass.NET/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ private void memoryViewControl_SelectionChanged(object sender, EventArgs e)

addBytesToolStripDropDownButton.Enabled = parentContainer != null || isContainerNode;
insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !isContainerNode;
autoNameClassToolStripMenuItem.Enabled = nodeIsClass;
initClassToolStripMenuItem.Enabled = nodeIsClass;

var enabled = selectedNodes.Count > 0 && !nodeIsClass;
toolStrip.Items.OfType<TypeToolStripButton>().ForEach(b => b.Enabled = enabled);
Expand Down Expand Up @@ -1054,15 +1054,15 @@ private void memoryViewControl_DrawContextRequested(object sender, DrawContextRe
}


private void autoNameClassToolStripMenuItem_Click(object sender, EventArgs e)
private void initClassToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectedNodes = memoryViewControl.GetSelectedNodes();
var node = selectedNodes.FirstOrDefault()?.Node;
if (node == null || !(node is ClassNode))
{
return;
}
memoryViewControl.AutoNameCurrentClassFromRTTI(node as ClassNode);
memoryViewControl.InitCurrentClassFromRTTI(node as ClassNode);
}
}
}
9 changes: 6 additions & 3 deletions 9 ReClass.NET/Nodes/BaseNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ public abstract class BaseNode
/// <summary>Gets or sets the parent node.</summary>
public BaseNode ParentNode { get; internal set; }

/// <summary>Gets a value indicating whether this node is wrapped into an other node. We see classnodes never as wrapped.</summary>
public bool IsWrapped => (ParentNode is BaseWrapperNode && !(this is ClassNode));
/// <summary>Gets a value indicating whether this node is wrapped into an other node. </summary>
public bool IsWrapped => (ParentNode is BaseWrapperNode);
FransBouma marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>All nodes that are wrapped can't be selected except classnodes because they have a context menu</summary>
public bool CanBeSelected => (!IsWrapped || (this is ClassNode));
FransBouma marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>Gets or sets a value indicating whether this node is hidden.</summary>
public bool IsHidden { get; set; }
Expand Down Expand Up @@ -376,7 +379,7 @@ protected void AddSelection(DrawContext context, int x, int y, int height)
Contract.Requires(context != null);
Contract.Requires(context.Graphics != null);

if (y > context.ClientArea.Bottom || y + height < 0 || IsWrapped)
if (y > context.ClientArea.Bottom || y + height < 0 || !CanBeSelected)
{
return;
}
Expand Down
13 changes: 10 additions & 3 deletions 13 ReClass.NET/Nodes/ClassNode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Drawing;
using System.Linq;
Expand Down Expand Up @@ -52,8 +53,12 @@ public static ClassNode Create()
return new ClassNode(true);
}


public void AutoNameFromRTTI(DrawContext context)

/// <summary>
/// Initializes the class' name and vtable node from RTTI information, if it's not set already
/// </summary>
/// <param name="context"></param>
public void InitFromRTTI(DrawContext context)
{
// first node should be a VTable node or a hex64/32 node
if (Nodes.Count <= 0)
Expand All @@ -77,7 +82,9 @@ public void AutoNameFromRTTI(DrawContext context)
if (!string.IsNullOrEmpty(rttiInfoFromFirstNode))
{
// convert first node to vtable node
#warning IMPLEMENT: CONVERT NODE TO VTABLE NODE
var newVTableNode = BaseNode.CreateInstanceFromType(typeof(VirtualMethodTableNode));
var createdNodes = new List<BaseNode>();
this.ReplaceChildNode(firstNode, newVTableNode, ref createdNodes);
}
}
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.