feat: port aelrynth 2026.9.27.2 snapshot onto GitHub history

Overlay upstream/main (9b5e276) onto BlankenshipG main without rewriting
history. Keep origin-only Decal/plugin/docs trees. Re-apply aelrynth.com
and sibling-fork URL fixes that aelrynth git still has as tombohar links.

Co-authored-by: BlankenshipG <BlankenshipG@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-10-04 15:43:50 +00:00
commit 4ddbb52eb2
No known key found for this signature in database
244 changed files with 59710 additions and 3067 deletions

View file

@ -0,0 +1,8 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="RynthCore.HookResolver.UI.App"
RequestedThemeVariant="Dark">
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

View file

@ -0,0 +1,20 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace RynthCore.HookResolver.UI;
public partial class App : Application
{
public override void Initialize() => AvaloniaXamlLoader.Load(this);
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}
base.OnFrameworkInitializationCompleted();
}
}

View file

@ -0,0 +1,49 @@
using System.Linq;
using System.Text;
using Avalonia.Media;
using RynthCore.HookManifest.Schema;
using RynthCore.HookResolver.Core.Discovery;
namespace RynthCore.HookResolver.UI;
public sealed class DiscoveryCandidateRow
{
public DiscoveryCandidateRow(StringDiscoveryCandidate candidate)
{
Candidate = candidate;
Va = $"0x{candidate.Va:X8}";
PushSiteVa = $"push @ 0x{candidate.PushSiteVa:X8}";
var s = candidate.Snapshot;
Summary = $"{s.LengthBytes} bytes • {s.InstructionCount} instr • " +
(s.EndsAtReturn ? "ends RET" : "no RET");
PrologueDisplay = FormatHex(s.PrologueHex);
CallTargetsDisplay = s.CallTargets.Count == 0
? "(none)"
: string.Join(" ", s.CallTargets.Take(5).Select(ct => $"+0x{ct.Offset:X3}→0x{ct.Va:X8}"));
AccentBrush = s.EndsAtReturn && s.LengthBytes > 16
? new SolidColorBrush(Color.Parse("#26C1A6"))
: new SolidColorBrush(Color.Parse("#E0B040"));
}
public StringDiscoveryCandidate Candidate { get; }
public FunctionSnapshot Snapshot => Candidate.Snapshot;
public string Va { get; }
public string PushSiteVa { get; }
public string Summary { get; }
public string PrologueDisplay { get; }
public string CallTargetsDisplay { get; }
public IBrush AccentBrush { get; }
private static string FormatHex(string raw)
{
var sb = new StringBuilder(raw.Length + raw.Length / 2);
for (int i = 0; i < raw.Length; i += 2)
{
if (i > 0) sb.Append(' ');
sb.Append(raw, i, 2);
}
return sb.ToString();
}
}

View file

@ -0,0 +1,123 @@
using System.Linq;
using System.Text;
using Avalonia.Media;
using RynthCore.HookManifest.Schema;
using RynthCore.HookResolver.Core.Diff;
namespace RynthCore.HookResolver.UI;
public sealed class HookRow
{
public HookRow(HookManifestEntry entry, EngineResolution? engine)
{
Entry = entry;
SymbolId = entry.SymbolId;
Status = entry.Status.ToString();
Va = entry.Address?.Hex ?? "—";
Detail = entry.Reason
?? entry.ChosenCandidateReason
?? (entry.Validations.Count > 0 ? entry.Validations[0].Detail : "");
StatusBrush = entry.Status switch
{
ResolutionStatus.Resolved => new SolidColorBrush(Color.Parse("#26C1A6")),
ResolutionStatus.Ambiguous => new SolidColorBrush(Color.Parse("#E0B040")),
ResolutionStatus.Unresolved => new SolidColorBrush(Color.Parse("#D24F4F")),
_ => new SolidColorBrush(Color.Parse("#8896A0")),
};
if (engine is null)
{
EngineVa = "—";
DiffSymbol = "·";
DiffBrush = new SolidColorBrush(Color.Parse("#56646D"));
DiffTooltip = "no engine-log entry for this symbol";
}
else if (engine.Va is null)
{
EngineVa = "unavailable";
DiffSymbol = "⊘";
DiffBrush = new SolidColorBrush(Color.Parse("#D24F4F"));
DiffTooltip = "engine logged UNAVAILABLE";
}
else
{
int engineVa = engine.Va.Value;
EngineVa = $"0x{engineVa:X8}";
if (entry.Address is { } toolAddr && toolAddr.Va == engineVa)
{
DiffSymbol = "✓";
DiffBrush = new SolidColorBrush(Color.Parse("#26C1A6"));
DiffTooltip = $"match ({engine.Kind})";
}
else if (entry.Address is null)
{
DiffSymbol = "?";
DiffBrush = new SolidColorBrush(Color.Parse("#E0B040"));
DiffTooltip = "tool unresolved, engine has VA";
}
else
{
DiffSymbol = "✗";
DiffBrush = new SolidColorBrush(Color.Parse("#D24F4F"));
int delta = entry.Address.Va - engineVa;
DiffTooltip = $"mismatch — tool/engine delta {delta:+#;-#;0}";
}
}
}
public HookManifestEntry Entry { get; }
public string SymbolId { get; }
public string Status { get; }
public string Va { get; }
public string EngineVa { get; }
public string DiffSymbol { get; }
public string DiffTooltip { get; }
public string Detail { get; }
public IBrush StatusBrush { get; }
public IBrush DiffBrush { get; }
public bool HasSnapshot => Entry.Snapshot is not null;
public string SnapshotSummary
{
get
{
var s = Entry.Snapshot;
if (s is null) return "(no snapshot — symbol unresolved)";
return $"{s.LengthBytes} bytes • {s.InstructionCount} instructions • " +
(s.EndsAtReturn ? "ends at RET" : "no RET in range");
}
}
public string SnapshotPrologue =>
Entry.Snapshot is { PrologueHex: var hex } ? FormatHex(hex) : "—";
public string SnapshotCallTargets
{
get
{
var s = Entry.Snapshot;
if (s is null || s.CallTargets.Count == 0) return "(none captured)";
var sb = new StringBuilder();
foreach (var ct in s.CallTargets.Take(8))
sb.AppendLine($" +0x{ct.Offset:X3} → 0x{ct.Va:X8}");
return sb.ToString().TrimEnd();
}
}
public string SnapshotNote => Entry.Snapshot?.Note ?? "";
public bool HasSnapshotNote => !string.IsNullOrEmpty(Entry.Snapshot?.Note);
private static string FormatHex(string raw)
{
var sb = new StringBuilder(raw.Length + raw.Length / 2);
for (int i = 0; i < raw.Length; i += 2)
{
if (i > 0) sb.Append(' ');
sb.Append(raw, i, 2);
}
return sb.ToString();
}
}

View file

@ -0,0 +1,301 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using RynthCore.HookResolver.Core.Diff;
using RynthCore.HookResolver.Core.Discovery;
namespace RynthCore.HookResolver.UI;
public sealed class MainViewModel : INotifyPropertyChanged
{
public const string DefaultAcClientPath = @"C:\Games\RynthCore\AcClient\acclient.exe";
public const string DefaultManifestPath = @"C:\Games\RynthCore\hooks.json";
private string _acClientPath = DefaultAcClientPath;
private string _manifestPath = DefaultManifestPath;
private string _logPath = EngineLogParser.ResolveDefaultLogPath();
private string _statusText = "Ready.";
private string _sha256 = "—";
private int _resolvedCount;
private int _ambiguousCount;
private int _unresolvedCount;
private int _matchCount;
private int _mismatchCount;
private int _totalCount;
private bool _isResolving;
private bool _canSave;
private HookRow? _selectedRow;
public ObservableCollection<HookRow> Hooks { get; } = new();
public string AcClientPath
{
get => _acClientPath;
set
{
if (_acClientPath == value) return;
_acClientPath = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanResolve));
}
}
public string ManifestPath
{
get => _manifestPath;
set { if (_manifestPath != value) { _manifestPath = value; OnPropertyChanged(); } }
}
public string LogPath
{
get => _logPath;
set { if (_logPath != value) { _logPath = value; OnPropertyChanged(); } }
}
public string StatusText
{
get => _statusText;
set { if (_statusText != value) { _statusText = value; OnPropertyChanged(); } }
}
public string Sha256Display
{
get => _sha256;
set { if (_sha256 != value) { _sha256 = value; OnPropertyChanged(); } }
}
public string CountsDisplay => _totalCount == 0
? ""
: $"resolved {_resolvedCount} ambiguous {_ambiguousCount} unresolved {_unresolvedCount} ({Hooks.Count}/{_totalCount})";
public string DiffDisplay => (_matchCount + _mismatchCount) == 0
? ""
: $"vs engine log: match {_matchCount} mismatch {_mismatchCount}";
public bool IsResolving
{
get => _isResolving;
set
{
if (_isResolving == value) return;
_isResolving = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanResolve));
}
}
public bool CanResolve => !_isResolving && File.Exists(_acClientPath);
public bool CanSave
{
get => _canSave;
set { if (_canSave != value) { _canSave = value; OnPropertyChanged(); } }
}
public HookRow? SelectedRow
{
get => _selectedRow;
set
{
if (ReferenceEquals(_selectedRow, value)) return;
_selectedRow = value;
OnPropertyChanged();
OnPropertyChanged(nameof(HasSelection));
}
}
public bool HasSelection => _selectedRow is not null;
// ── Discovery tab state ──────────────────────────────────────────────
private string _searchLiteral = "ChatBarEnter";
private ProloguePreset _selectedPreset = StringDiscoveryService.Presets[0];
private int _maxBackward = 0x2000;
private bool _looseMatch;
private StringReferenceMode _referenceMode = StringReferenceMode.PushImm32;
private string _discoveryStatus = "Enter a string and click Search.";
private DiscoveryCandidateRow? _selectedCandidate;
private bool _isDiscovering;
public ObservableCollection<DiscoveryCandidateRow> DiscoveryCandidates { get; } = new();
public IReadOnlyList<ProloguePreset> Presets => StringDiscoveryService.Presets;
public string SearchLiteral
{
get => _searchLiteral;
set
{
if (_searchLiteral == value) return;
_searchLiteral = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanSearch));
}
}
public ProloguePreset SelectedPreset
{
get => _selectedPreset;
set
{
if (ReferenceEquals(_selectedPreset, value)) return;
_selectedPreset = value;
OnPropertyChanged();
}
}
public int MaxBackward
{
get => _maxBackward;
set { if (_maxBackward != value) { _maxBackward = value; OnPropertyChanged(); } }
}
public bool LooseMatch
{
get => _looseMatch;
set { if (_looseMatch != value) { _looseMatch = value; OnPropertyChanged(); } }
}
public StringReferenceMode[] ReferenceModes { get; } =
(StringReferenceMode[])System.Enum.GetValues(typeof(StringReferenceMode));
public StringReferenceMode SelectedReferenceMode
{
get => _referenceMode;
set { if (_referenceMode != value) { _referenceMode = value; OnPropertyChanged(); } }
}
public string DiscoveryStatus
{
get => _discoveryStatus;
set { if (_discoveryStatus != value) { _discoveryStatus = value; OnPropertyChanged(); } }
}
public DiscoveryCandidateRow? SelectedCandidate
{
get => _selectedCandidate;
set
{
if (ReferenceEquals(_selectedCandidate, value)) return;
_selectedCandidate = value;
OnPropertyChanged();
OnPropertyChanged(nameof(HasDiscoverySelection));
}
}
public bool HasDiscoverySelection => _selectedCandidate is not null;
public bool IsDiscovering
{
get => _isDiscovering;
set
{
if (_isDiscovering == value) return;
_isDiscovering = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanSearch));
}
}
public bool CanSearch => !_isDiscovering && !string.IsNullOrWhiteSpace(_searchLiteral);
// ── Class/vtable discovery state ─────────────────────────────────────
private string _searchClass = "gmRadarUI";
private string _classDiscoveryStatus = "Enter a class name (e.g. gmRadarUI) and click Find.";
private VtableMethodRow? _selectedVtableMethod;
private bool _isVtableDiscovering;
public ObservableCollection<VtableMethodRow> VtableMethods { get; } = new();
public string SearchClass
{
get => _searchClass;
set
{
if (_searchClass == value) return;
_searchClass = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanSearchClass));
}
}
public string ClassDiscoveryStatus
{
get => _classDiscoveryStatus;
set { if (_classDiscoveryStatus != value) { _classDiscoveryStatus = value; OnPropertyChanged(); } }
}
public VtableMethodRow? SelectedVtableMethod
{
get => _selectedVtableMethod;
set
{
if (ReferenceEquals(_selectedVtableMethod, value)) return;
_selectedVtableMethod = value;
OnPropertyChanged();
OnPropertyChanged(nameof(HasVtableSelection));
}
}
public bool HasVtableSelection => _selectedVtableMethod is not null;
public bool IsVtableDiscovering
{
get => _isVtableDiscovering;
set
{
if (_isVtableDiscovering == value) return;
_isVtableDiscovering = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CanSearchClass));
}
}
public bool CanSearchClass => !_isVtableDiscovering && !string.IsNullOrWhiteSpace(_searchClass);
public void BeginResolve(int totalSymbols)
{
_resolvedCount = _ambiguousCount = _unresolvedCount = 0;
_matchCount = _mismatchCount = 0;
_totalCount = totalSymbols;
Hooks.Clear();
CanSave = false;
IsResolving = true;
StatusText = $"Resolving {totalSymbols} symbol(s)…";
Sha256Display = "—";
OnPropertyChanged(nameof(CountsDisplay));
OnPropertyChanged(nameof(DiffDisplay));
}
public void AddRow(HookRow row)
{
Hooks.Add(row);
switch (row.Entry.Status)
{
case RynthCore.HookManifest.Schema.ResolutionStatus.Resolved: _resolvedCount++; break;
case RynthCore.HookManifest.Schema.ResolutionStatus.Ambiguous: _ambiguousCount++; break;
case RynthCore.HookManifest.Schema.ResolutionStatus.Unresolved: _unresolvedCount++; break;
}
switch (row.DiffSymbol)
{
case "✓": _matchCount++; break;
case "✗": _mismatchCount++; break;
}
OnPropertyChanged(nameof(CountsDisplay));
OnPropertyChanged(nameof(DiffDisplay));
}
public void EndResolve(bool success, string message, string? sha256 = null)
{
IsResolving = false;
StatusText = message;
if (sha256 is not null) Sha256Display = sha256;
CanSave = success && Hooks.Count > 0;
}
public event PropertyChangedEventHandler? PropertyChanged;
private void OnPropertyChanged([CallerMemberName] string? name = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}

View file

@ -0,0 +1,540 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:RynthCore.HookResolver.UI"
xmlns:disc="clr-namespace:RynthCore.HookResolver.Core.Discovery;assembly=RynthCore.HookResolver.Core"
x:Class="RynthCore.HookResolver.UI.MainWindow"
x:DataType="local:MainViewModel"
Width="1440"
Height="820"
MinWidth="1000"
MinHeight="560"
Title="RynthCore Hook Resolver"
Background="#0B1218">
<Window.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="12.5" />
<Setter Property="Foreground" Value="#D6DDE3" />
</Style>
<Style Selector="TextBox">
<Setter Property="FontSize" Value="12" />
<Setter Property="Background" Value="#0F161D" />
<Setter Property="Foreground" Value="#D6DDE3" />
<Setter Property="BorderBrush" Value="#243742" />
</Style>
<Style Selector="ComboBox">
<Setter Property="FontSize" Value="12" />
<Setter Property="Background" Value="#0F161D" />
<Setter Property="Foreground" Value="#D6DDE3" />
<Setter Property="BorderBrush" Value="#243742" />
</Style>
<Style Selector="Button">
<Setter Property="FontSize" Value="12" />
<Setter Property="Padding" Value="14,8" />
<Setter Property="Background" Value="#1A2E38" />
<Setter Property="Foreground" Value="#26C1A6" />
<Setter Property="BorderBrush" Value="#26C1A6" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="6" />
</Style>
<Style Selector="Button:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="#26C1A6" />
<Setter Property="TextElement.Foreground" Value="#0B1218" />
</Style>
<Style Selector="Button:disabled">
<Setter Property="Opacity" Value="0.4" />
</Style>
<Style Selector="ListBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="0" />
</Style>
<Style Selector="ListBoxItem">
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#152633" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="#12202A" />
</Style>
<Style Selector="TabItem">
<Setter Property="FontSize" Value="13" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Padding" Value="14,6" />
<Setter Property="Foreground" Value="#8896A0" />
</Style>
<Style Selector="TabItem:selected">
<Setter Property="Foreground" Value="#26C1A6" />
</Style>
</Window.Styles>
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="14">
<Border Grid.Row="0"
Padding="14"
CornerRadius="14"
Background="#132028"
BorderBrush="#26C1A6"
BorderThickness="1"
Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="RynthCore Hook Resolver"
FontSize="18"
FontWeight="SemiBold"
Foreground="#26C1A6" />
<TextBlock Text="Offline resolver — pattern-scan known hooks (Hooks tab) or discover new ones by string reference (Discover tab)."
Margin="0,4,0,0"
Foreground="#8896A0"
TextWrapping="Wrap" />
</StackPanel>
</Border>
<Border Grid.Row="1"
Padding="12"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1"
Margin="0,0,0,10">
<StackPanel>
<Grid ColumnDefinitions="Auto,*,Auto,Auto" RowDefinitions="Auto">
<TextBlock Grid.Column="0"
Text="acclient.exe:"
VerticalAlignment="Center"
Margin="0,0,10,0"
MinWidth="100" />
<TextBox Grid.Column="1"
Text="{Binding AcClientPath, Mode=TwoWay}"
VerticalAlignment="Center" />
<Button Grid.Column="2"
Content="…"
Margin="8,0,0,0"
MinWidth="38"
Click="OnBrowseAcClient" />
<Button Grid.Column="3"
Content="Resolve"
Margin="8,0,0,0"
IsEnabled="{Binding CanResolve}"
Click="OnResolveClick" />
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="Auto" Margin="0,8,0,0">
<TextBlock Grid.Column="0"
Text="engine log:"
VerticalAlignment="Center"
Margin="0,0,10,0"
MinWidth="100"
Foreground="#8896A0" />
<TextBox Grid.Column="1"
Text="{Binding LogPath, Mode=TwoWay}"
VerticalAlignment="Center" />
<Button Grid.Column="2"
Content="…"
Margin="8,0,0,0"
MinWidth="38"
Click="OnBrowseLog" />
</Grid>
</StackPanel>
</Border>
<TabControl Grid.Row="2" Background="Transparent" BorderThickness="0" Padding="0">
<!-- ───────────── HOOKS TAB ───────────── -->
<TabItem Header="Hooks">
<Grid ColumnDefinitions="*,12,420" Margin="0,8,0,0">
<Border Grid.Column="0"
Padding="0"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<Grid RowDefinitions="Auto,*">
<Grid Grid.Row="0"
ColumnDefinitions="2.4*,0.9*,1.3*,1.3*,0.4*,2.2*"
Margin="14,10,14,8">
<TextBlock Grid.Column="0" Text="Symbol" FontWeight="SemiBold" Foreground="#8896A0" />
<TextBlock Grid.Column="1" Text="Status" FontWeight="SemiBold" Foreground="#8896A0" />
<TextBlock Grid.Column="2" Text="Tool VA" FontWeight="SemiBold" Foreground="#8896A0" />
<TextBlock Grid.Column="3" Text="Engine VA" FontWeight="SemiBold" Foreground="#8896A0" />
<TextBlock Grid.Column="4" Text="Diff" FontWeight="SemiBold" Foreground="#8896A0" HorizontalAlignment="Center" />
<TextBlock Grid.Column="5" Text="Detail" FontWeight="SemiBold" Foreground="#8896A0" />
</Grid>
<ListBox Grid.Row="1"
ItemsSource="{Binding Hooks}"
SelectedItem="{Binding SelectedRow, Mode=TwoWay}"
SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate DataType="local:HookRow">
<Border BorderBrush="#1A2730"
BorderThickness="0,1,0,0"
Padding="14,8">
<Grid ColumnDefinitions="2.4*,0.9*,1.3*,1.3*,0.4*,2.2*">
<TextBlock Grid.Column="0" Text="{Binding SymbolId}" VerticalAlignment="Center" FontFamily="Cascadia Mono, Consolas, monospace" />
<TextBlock Grid.Column="1" Text="{Binding Status}" Foreground="{Binding StatusBrush}" FontWeight="SemiBold" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding Va}" VerticalAlignment="Center" FontFamily="Cascadia Mono, Consolas, monospace" />
<TextBlock Grid.Column="3" Text="{Binding EngineVa}" VerticalAlignment="Center" FontFamily="Cascadia Mono, Consolas, monospace" Foreground="#A8B2BB" />
<TextBlock Grid.Column="4" Text="{Binding DiffSymbol}" Foreground="{Binding DiffBrush}" FontWeight="SemiBold" VerticalAlignment="Center" HorizontalAlignment="Center" ToolTip.Tip="{Binding DiffTooltip}" />
<TextBlock Grid.Column="5" Text="{Binding Detail}" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="#A8B2BB" />
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
<Border Grid.Column="2"
Padding="14"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<ScrollViewer>
<StackPanel>
<TextBlock Text="Function context" FontSize="14" FontWeight="SemiBold" Foreground="#26C1A6" />
<TextBlock Text="Click a row to inspect the resolved function."
Margin="0,4,0,0"
IsVisible="{Binding !HasSelection}"
Foreground="#8896A0" />
<StackPanel IsVisible="{Binding HasSelection}" Margin="0,8,0,0">
<TextBlock Text="{Binding SelectedRow.SymbolId}" FontFamily="Cascadia Mono, Consolas, monospace" FontWeight="SemiBold" TextWrapping="Wrap" />
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto" Margin="0,8,0,0">
<TextBlock Grid.Row="0" Grid.Column="0" Text="status: " Foreground="#8896A0" />
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding SelectedRow.Status}" Foreground="{Binding SelectedRow.StatusBrush}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="tool VA: " Foreground="#8896A0" />
<SelectableTextBlock Grid.Row="1" Grid.Column="1" Text="{Binding SelectedRow.Va}" FontFamily="Cascadia Mono, Consolas, monospace" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="engine VA: " Foreground="#8896A0" />
<SelectableTextBlock Grid.Row="2" Grid.Column="1" Text="{Binding SelectedRow.EngineVa}" FontFamily="Cascadia Mono, Consolas, monospace" Foreground="#A8B2BB" />
</Grid>
<Separator Margin="0,10,0,8" Background="#1A2730" />
<TextBlock Text="snapshot" FontWeight="SemiBold" Foreground="#26C1A6" />
<TextBlock Text="{Binding SelectedRow.SnapshotSummary}" Margin="0,4,0,0" />
<TextBlock Text="prologue (8 bytes)" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedRow.SnapshotPrologue}" FontFamily="Cascadia Mono, Consolas, monospace" />
</Border>
<TextBlock Text="CALL targets (offset → VA)" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedRow.SnapshotCallTargets}" FontFamily="Cascadia Mono, Consolas, monospace" />
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Border>
</Grid>
</TabItem>
<!-- ───────────── DISCOVER TAB ───────────── -->
<TabItem Header="Discover by string">
<Grid RowDefinitions="Auto,Auto,*" Margin="0,8,0,0">
<Border Grid.Row="0"
Padding="12"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<StackPanel>
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="Auto">
<TextBlock Grid.Column="0" Text="string:" VerticalAlignment="Center" Margin="0,0,8,0" MinWidth="60" />
<TextBox Grid.Column="1" Text="{Binding SearchLiteral, Mode=TwoWay}" VerticalAlignment="Center" />
<Button Grid.Column="2"
Content="Search"
Margin="14,0,0,0"
IsEnabled="{Binding CanSearch}"
Click="OnSearchClick" />
</Grid>
<Grid ColumnDefinitions="Auto,1.4*,Auto,1.2*,Auto,70,Auto" RowDefinitions="Auto" Margin="0,8,0,0">
<TextBlock Grid.Column="0" Text="prologue:" VerticalAlignment="Center" Margin="0,0,8,0" MinWidth="60" />
<ComboBox Grid.Column="1"
ItemsSource="{Binding Presets}"
SelectedItem="{Binding SelectedPreset, Mode=TwoWay}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate DataType="disc:ProloguePreset">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Column="2" Text="reference:" VerticalAlignment="Center" Margin="14,0,8,0" />
<ComboBox Grid.Column="3"
ItemsSource="{Binding ReferenceModes}"
SelectedItem="{Binding SelectedReferenceMode, Mode=TwoWay}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
ToolTip.Tip="PushImm32 = printf-style string arg (precise). AnyImm32InText = mov/lea/cmp immediate (broad). DataPointer = string used as a .rdata table entry (no function)." />
<TextBlock Grid.Column="4" Text="walk back:" VerticalAlignment="Center" Margin="14,0,8,0" />
<TextBox Grid.Column="5" Text="{Binding MaxBackward, Mode=TwoWay}" VerticalAlignment="Center" />
<CheckBox Grid.Column="6"
Content="loose"
IsChecked="{Binding LooseMatch, Mode=TwoWay}"
VerticalAlignment="Center"
Margin="14,0,0,0"
Foreground="#D6DDE3"
ToolTip.Tip="Match the string even if it isn't NUL-terminated (finds substrings embedded in longer strings)." />
</Grid>
</StackPanel>
</Border>
<Border Grid.Row="1"
Margin="0,10,0,10"
Padding="12,10"
CornerRadius="10"
Background="#091017"
BorderBrush="#1A2730"
BorderThickness="1">
<SelectableTextBlock Text="{Binding DiscoveryStatus}" TextWrapping="Wrap" Foreground="#D6DDE3" />
</Border>
<Grid Grid.Row="2" ColumnDefinitions="*,12,420">
<Border Grid.Column="0"
Padding="0"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<ListBox ItemsSource="{Binding DiscoveryCandidates}"
SelectedItem="{Binding SelectedCandidate, Mode=TwoWay}"
SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate DataType="local:DiscoveryCandidateRow">
<Border BorderBrush="#1A2730"
BorderThickness="0,1,0,0"
Padding="14,10">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Va}"
FontFamily="Cascadia Mono, Consolas, monospace"
FontWeight="SemiBold"
Foreground="{Binding AccentBrush}" />
<TextBlock Text=" "/>
<TextBlock Text="{Binding Summary}" Foreground="#A8B2BB" />
</StackPanel>
<TextBlock Text="{Binding PushSiteVa}"
Margin="0,2,0,0"
FontFamily="Cascadia Mono, Consolas, monospace"
Foreground="#56646D" />
<TextBlock Text="{Binding CallTargetsDisplay}"
Margin="0,2,0,0"
FontFamily="Cascadia Mono, Consolas, monospace"
FontSize="11"
Foreground="#56646D"
TextWrapping="Wrap" />
</StackPanel>
<Button Grid.Column="1"
Content="Promote"
VerticalAlignment="Center"
Margin="10,0,0,0"
Click="OnPromoteStringCandidate" />
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<Border Grid.Column="2"
Padding="14"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<ScrollViewer>
<StackPanel>
<TextBlock Text="Candidate context" FontSize="14" FontWeight="SemiBold" Foreground="#26C1A6" />
<TextBlock Text="Search for a string, then click a candidate to inspect."
Margin="0,4,0,0"
IsVisible="{Binding !HasDiscoverySelection}"
Foreground="#8896A0" />
<StackPanel IsVisible="{Binding HasDiscoverySelection}" Margin="0,8,0,0">
<SelectableTextBlock Text="{Binding SelectedCandidate.Va}" FontFamily="Cascadia Mono, Consolas, monospace" FontSize="14" FontWeight="SemiBold" />
<TextBlock Text="{Binding SelectedCandidate.Summary}" Margin="0,6,0,0" />
<TextBlock Text="prologue (8 bytes)" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedCandidate.PrologueDisplay}" FontFamily="Cascadia Mono, Consolas, monospace" />
</Border>
<TextBlock Text="CALL targets" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedCandidate.CallTargetsDisplay}" FontFamily="Cascadia Mono, Consolas, monospace" TextWrapping="Wrap" />
</Border>
<TextBlock Text="push site" Margin="0,10,0,4" Foreground="#8896A0" />
<SelectableTextBlock Text="{Binding SelectedCandidate.PushSiteVa}" FontFamily="Cascadia Mono, Consolas, monospace" />
</StackPanel>
</StackPanel>
</ScrollViewer>
</Border>
</Grid>
</Grid>
</TabItem>
<!-- ───────────── DISCOVER BY CLASS (RTTI) TAB ───────────── -->
<TabItem Header="Discover by class">
<Grid RowDefinitions="Auto,Auto,*" Margin="0,8,0,0">
<Border Grid.Row="0"
Padding="12"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="Auto">
<TextBlock Grid.Column="0" Text="class name:" VerticalAlignment="Center" Margin="0,0,8,0" />
<TextBox Grid.Column="1"
Text="{Binding SearchClass, Mode=TwoWay}"
VerticalAlignment="Center" />
<Button Grid.Column="2"
Content="Find vtable methods"
Margin="14,0,0,0"
IsEnabled="{Binding CanSearchClass}"
Click="OnSearchClassClick" />
</Grid>
</Border>
<Border Grid.Row="1"
Margin="0,10,0,10"
Padding="12,10"
CornerRadius="10"
Background="#091017"
BorderBrush="#1A2730"
BorderThickness="1">
<SelectableTextBlock Text="{Binding ClassDiscoveryStatus}" TextWrapping="Wrap" Foreground="#D6DDE3" />
</Border>
<Grid Grid.Row="2" ColumnDefinitions="*,12,420">
<Border Grid.Column="0"
Padding="0"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<ListBox ItemsSource="{Binding VtableMethods}"
SelectedItem="{Binding SelectedVtableMethod, Mode=TwoWay}"
SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate DataType="local:VtableMethodRow">
<Border BorderBrush="#1A2730"
BorderThickness="0,1,0,0"
Padding="14,8">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Slot}"
FontFamily="Cascadia Mono, Consolas, monospace"
Foreground="#56646D"
Width="40" />
<TextBlock Text="{Binding Va}"
FontFamily="Cascadia Mono, Consolas, monospace"
FontWeight="SemiBold"
Foreground="{Binding AccentBrush}" />
<TextBlock Text=" "/>
<TextBlock Text="{Binding Summary}" Foreground="#A8B2BB" />
</StackPanel>
<TextBlock Text="{Binding CallTargetsDisplay}"
Margin="40,2,0,0"
FontFamily="Cascadia Mono, Consolas, monospace"
FontSize="11"
Foreground="#56646D"
TextWrapping="Wrap" />
</StackPanel>
<Button Grid.Column="1"
Content="Promote"
VerticalAlignment="Center"
Margin="10,0,0,0"
Click="OnPromoteVtableMethod" />
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<Border Grid.Column="2"
Padding="14"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1">
<ScrollViewer>
<StackPanel>
<TextBlock Text="Vtable method" FontSize="14" FontWeight="SemiBold" Foreground="#26C1A6" />
<TextBlock Text="Find a class, then click a slot to inspect."
Margin="0,4,0,0"
IsVisible="{Binding !HasVtableSelection}"
Foreground="#8896A0" />
<StackPanel IsVisible="{Binding HasVtableSelection}" Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding SelectedVtableMethod.Slot}"
FontFamily="Cascadia Mono, Consolas, monospace"
Foreground="#56646D" />
<TextBlock Text=" " />
<SelectableTextBlock Text="{Binding SelectedVtableMethod.Va}"
FontFamily="Cascadia Mono, Consolas, monospace"
FontSize="14"
FontWeight="SemiBold" />
</StackPanel>
<TextBlock Text="{Binding SelectedVtableMethod.Summary}" Margin="0,6,0,0" />
<TextBlock Text="prologue (8 bytes)" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedVtableMethod.PrologueDisplay}" FontFamily="Cascadia Mono, Consolas, monospace" />
</Border>
<TextBlock Text="CALL targets" Margin="0,10,0,4" Foreground="#8896A0" />
<Border Background="#091017" BorderBrush="#1A2730" BorderThickness="1" CornerRadius="4" Padding="8,6">
<SelectableTextBlock Text="{Binding SelectedVtableMethod.CallTargetsDisplay}" FontFamily="Cascadia Mono, Consolas, monospace" TextWrapping="Wrap" />
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Border>
</Grid>
</Grid>
</TabItem>
</TabControl>
<Border Grid.Row="3"
Padding="12"
CornerRadius="12"
Background="#0F161D"
BorderBrush="#243742"
BorderThickness="1"
Margin="0,10,0,0">
<Grid ColumnDefinitions="*,Auto,Auto">
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<SelectableTextBlock Text="{Binding StatusText}" />
<StackPanel Orientation="Horizontal" Margin="0,4,0,0">
<TextBlock Text="{Binding CountsDisplay}" Foreground="#8896A0" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,2,0,0">
<TextBlock Text="{Binding DiffDisplay}" Foreground="#8896A0" />
<TextBlock Text=" • SHA-256: " Foreground="#56646D" Margin="8,0,0,0" />
<TextBlock Text="{Binding Sha256Display}" Foreground="#56646D" FontFamily="Cascadia Mono, Consolas, monospace" />
</StackPanel>
</StackPanel>
<TextBox Grid.Column="1" Text="{Binding ManifestPath, Mode=TwoWay}" Width="320" VerticalAlignment="Center" Margin="0,0,8,0" />
<Button Grid.Column="2" Content="Save Manifest" VerticalAlignment="Center" IsEnabled="{Binding CanSave}" Click="OnSaveClick" />
</Grid>
</Border>
</Grid>
</Window>

View file

@ -0,0 +1,283 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Platform.Storage;
using Avalonia.Threading;
using RynthCore.HookManifest.Schema;
using RynthCore.HookResolver.Core.Diff;
using RynthCore.HookResolver.Core.Discovery;
using RynthCore.HookResolver.Core.Offline;
using RynthCore.HookResolver.Core.Resolution;
using RynthCore.HookResolver.Core.Symbols;
using Manifest = RynthCore.HookManifest.Schema.HookManifest;
namespace RynthCore.HookResolver.UI;
public partial class MainWindow : Window
{
private readonly MainViewModel _vm = new();
private readonly List<HookManifestEntry> _promotedEntries = new();
private Manifest? _lastManifest;
private AcClientImage? _cachedImage;
private CancellationTokenSource? _cts;
public MainWindow()
{
InitializeComponent();
DataContext = _vm;
}
private async void OnBrowseAcClient(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
var files = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "Choose acclient.exe",
AllowMultiple = false,
FileTypeFilter =
[
new FilePickerFileType("AC client executable") { Patterns = ["acclient.exe", "*.exe"] }
]
});
if (files.Count > 0)
{
string? path = files[0].TryGetLocalPath();
if (!string.IsNullOrEmpty(path)) _vm.AcClientPath = path;
}
}
private async void OnBrowseLog(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
var files = await StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "Choose RynthCore.log",
AllowMultiple = false,
FileTypeFilter =
[
new FilePickerFileType("RynthCore log") { Patterns = ["*.log", "*.*"] }
]
});
if (files.Count > 0)
{
string? path = files[0].TryGetLocalPath();
if (!string.IsNullOrEmpty(path)) _vm.LogPath = path;
}
}
private async void OnResolveClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
_cts?.Cancel();
_cts = new CancellationTokenSource();
var ct = _cts.Token;
var symbols = AllSymbols.Default;
_vm.BeginResolve(symbols.Count);
AcClientImage? image = null;
try
{
image = await AcClientImageLoader.LoadAsync(_vm.AcClientPath, ct);
_cachedImage = image;
_vm.Sha256Display = image.Input.Sha256;
}
catch (Exception ex)
{
_vm.EndResolve(false, $"Load failed: {ex.Message}");
return;
}
IReadOnlyDictionary<string, EngineResolution> engineLog;
try
{
engineLog = await EngineLogParser.ParseAsync(_vm.LogPath, ct);
}
catch (Exception ex)
{
engineLog = new Dictionary<string, EngineResolution>();
_vm.StatusText = $"Log parse warning: {ex.Message}";
}
try
{
await foreach (var entry in HookResolveOrchestrator.ResolveAsync(image, symbols, ct))
{
engineLog.TryGetValue(entry.SymbolId, out var engineRes);
await Dispatcher.UIThread.InvokeAsync(() =>
_vm.AddRow(new HookRow(entry, engineRes)));
}
// Re-attach anything promoted from the Discover tabs so a re-resolve
// doesn't drop it.
foreach (var promoted in _promotedEntries)
_vm.AddRow(new HookRow(promoted, null));
_lastManifest = ManifestBuilder.Compose(image.Input, BuildEntries());
string logNote = engineLog.Count > 0
? $" • {engineLog.Count} engine log entries compared."
: " • (no engine log found at the configured path)";
_vm.EndResolve(true, $"Done. Manifest ready ({image.Input.Sha256[..12]}…).{logNote}");
}
catch (OperationCanceledException)
{
_vm.EndResolve(false, "Cancelled.");
}
catch (Exception ex)
{
_vm.EndResolve(false, $"Resolve failed: {ex.Message}");
}
}
private IEnumerable<HookManifestEntry> BuildEntries()
{
foreach (var row in _vm.Hooks)
yield return row.Entry;
}
private void PromoteEntry(string symbolId, int va, int rva, FunctionSnapshot snap, string reason)
{
if (_promotedEntries.Exists(e => e.Address?.Va == va))
{
_vm.StatusText = $"Already promoted: 0x{va:X8}.";
return;
}
var entry = new HookManifestEntry
{
SymbolId = symbolId,
Status = ResolutionStatus.Resolved,
Address = new ResolvedAddress(va, rva),
PatternId = "promoted",
MatchedCandidates = 1,
ChosenCandidateReason = reason,
Snapshot = snap
};
_promotedEntries.Add(entry);
_vm.AddRow(new HookRow(entry, null));
if (_cachedImage is not null)
{
_lastManifest = ManifestBuilder.Compose(_cachedImage.Input, BuildEntries());
_vm.CanSave = true;
}
_vm.StatusText = $"Promoted {symbolId} → manifest now has {_vm.Hooks.Count} entries (Save to write).";
}
private void OnPromoteStringCandidate(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
if (sender is Control { DataContext: DiscoveryCandidateRow row })
{
string literal = _vm.SearchLiteral.Trim();
var c = row.Candidate;
PromoteEntry(
$"discovered.str:{literal}@0x{c.Va:X8}",
c.Va, c.Rva, c.Snapshot,
$"promoted from string-ref '{literal}' (push @ 0x{c.PushSiteVa:X8})");
}
}
private void OnPromoteVtableMethod(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
if (sender is Control { DataContext: VtableMethodRow row })
{
string cls = _vm.SearchClass.Trim();
var c = row.Candidate;
int rva = c.Va - (_cachedImage?.View.ImageBase ?? 0x00400000);
PromoteEntry(
$"discovered.vt:{cls}[{c.SlotIndex}]@0x{c.Va:X8}",
c.Va, rva, c.Snapshot,
$"promoted from {cls} vtable slot {c.SlotIndex} (vtable 0x{c.VtableVa:X8})");
}
}
private async void OnSearchClassClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
_vm.IsVtableDiscovering = true;
_vm.VtableMethods.Clear();
_vm.SelectedVtableMethod = null;
_vm.ClassDiscoveryStatus = $"Loading acclient.exe and walking RTTI for '{_vm.SearchClass}'…";
try
{
if (_cachedImage is null || _cachedImage.Input.Path != _vm.AcClientPath)
{
_cachedImage = await AcClientImageLoader.LoadAsync(_vm.AcClientPath);
_vm.Sha256Display = _cachedImage.Input.Sha256;
}
string className = _vm.SearchClass.Trim();
var result = await Task.Run(() => VtableDiscoveryService.Discover(_cachedImage!, className));
_vm.ClassDiscoveryStatus = result.Summary;
foreach (var method in result.Methods)
_vm.VtableMethods.Add(new VtableMethodRow(method));
}
catch (Exception ex)
{
_vm.ClassDiscoveryStatus = $"Search failed: {ex.Message}";
}
finally
{
_vm.IsVtableDiscovering = false;
}
}
private async void OnSearchClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
_vm.IsDiscovering = true;
_vm.DiscoveryCandidates.Clear();
_vm.SelectedCandidate = null;
_vm.DiscoveryStatus = $"Loading acclient.exe and searching for '{_vm.SearchLiteral}'…";
try
{
if (_cachedImage is null || _cachedImage.Input.Path != _vm.AcClientPath)
{
_cachedImage = await AcClientImageLoader.LoadAsync(_vm.AcClientPath);
_vm.Sha256Display = _cachedImage.Input.Sha256;
}
var request = new StringDiscoveryRequest(
_vm.SearchLiteral.Trim(),
_vm.SelectedPreset.Bytes,
_vm.MaxBackward,
_vm.LooseMatch,
_vm.SelectedReferenceMode);
var result = await Task.Run(() => StringDiscoveryService.Discover(_cachedImage!, request));
_vm.DiscoveryStatus = result.Summary;
foreach (var candidate in result.Candidates)
_vm.DiscoveryCandidates.Add(new DiscoveryCandidateRow(candidate));
}
catch (Exception ex)
{
_vm.DiscoveryStatus = $"Search failed: {ex.Message}";
}
finally
{
_vm.IsDiscovering = false;
}
}
private async void OnSaveClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
if (_lastManifest is null)
{
_vm.StatusText = "Nothing to save — run Resolve first.";
return;
}
try
{
await ManifestBuilder.WriteAsync(_lastManifest, _vm.ManifestPath);
_vm.StatusText = $"Saved → {_vm.ManifestPath}";
}
catch (Exception ex)
{
_vm.StatusText = $"Save failed: {ex.Message}";
}
}
}

View file

@ -0,0 +1,16 @@
using Avalonia;
namespace RynthCore.HookResolver.UI;
internal static class Program
{
[System.STAThread]
public static int Main(string[] args)
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}

View file

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<RootNamespace>RynthCore.HookResolver.UI</RootNamespace>
<AssemblyName>RynthCore.HookResolver.UI</AssemblyName>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HookResolver.Core\RynthCore.HookResolver.Core.csproj" />
<ProjectReference Include="..\..\src\RynthCore.HookManifest\RynthCore.HookManifest.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,49 @@
using System.Linq;
using System.Text;
using Avalonia.Media;
using RynthCore.HookManifest.Schema;
using RynthCore.HookResolver.Core.Discovery;
namespace RynthCore.HookResolver.UI;
public sealed class VtableMethodRow
{
public VtableMethodRow(VtableMethodCandidate candidate)
{
Candidate = candidate;
Slot = $"[{candidate.SlotIndex:D2}]";
Va = $"0x{candidate.Va:X8}";
var s = candidate.Snapshot;
Summary = $"{s.LengthBytes} bytes • {s.InstructionCount} instr • " +
(s.EndsAtReturn ? "ends RET" : "no RET");
PrologueDisplay = FormatHex(s.PrologueHex);
CallTargetsDisplay = s.CallTargets.Count == 0
? "(none)"
: string.Join(" ", s.CallTargets.Take(5).Select(ct => $"+0x{ct.Offset:X3}→0x{ct.Va:X8}"));
AccentBrush = s.EndsAtReturn && s.LengthBytes > 8
? new SolidColorBrush(Color.Parse("#26C1A6"))
: new SolidColorBrush(Color.Parse("#E0B040"));
}
public VtableMethodCandidate Candidate { get; }
public FunctionSnapshot Snapshot => Candidate.Snapshot;
public string Slot { get; }
public string Va { get; }
public string Summary { get; }
public string PrologueDisplay { get; }
public string CallTargetsDisplay { get; }
public IBrush AccentBrush { get; }
private static string FormatHex(string raw)
{
var sb = new StringBuilder(raw.Length + raw.Length / 2);
for (int i = 0; i < raw.Length; i += 2)
{
if (i > 0) sb.Append(' ');
sb.Append(raw, i, 2);
}
return sb.ToString();
}
}

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="RynthCore.HookResolver.UI"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2</dpiAwareness>
</windowsSettings>
</application>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>