Features:Quote:
I wrote this genius thing a time ago out of boredom. It is a memory patching tool , it actually works like cheat engine when it comes to scanning AOBs and finding addys.
⚠️ Known Issues & Disclaimer:
- The tool may not work properly at times or with certain features.
- It WILL NOT work on Valofe.
- It WILL NOT work on Xero without modifications.
- This tool is highly detected and must be edited if you want to use it at all.
- I WILL NOT answer any questions — use it as-is. Take it or leave it.
- If you ask me stupid questions, don't expect any response.
- Admin Check – Ensures the tool is run as Administrator.
- Process Monitoring – Waits for S4Client.exe to launch, then attaches.
- AOB Pattern Scanning – Scans the process memory for defined byte patterns.
- Hack Management – Add, remove, list, and toggle hacks with commands.
- Memory Patching – Overwrites memory to activate/deactivate hacks (NOP injection).
- Persistence – Saves and loads hacks from a config file.
- Instruction Size Heuristics – Tries to safely determine how many bytes to patch.
- Console UI – Text-based interface with commands like add, scan, list, remove, etc.
Commands:
Code:
add - Add a new AOB hack scan <name|all> - Scan for a specific or all patterns list - Show saved hacks remove <name> - Delete a saved hack <name> 1|0 - Enable or disable a hack clear - Clear screen and show help credits - Show credits exit - Quit the tool
Code:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Security.Principal;
namespace Dynamicbypathetic
{
class Program
{
const int PROCESS_VM_OPERATION = 0x0008;
const int PROCESS_VM_READ = 0x0010;
const int PROCESS_VM_WRITE = 0x0020;
const uint PAGE_EXECUTE_READWRITE = 0x40;
static Process targetProcess;
static IntPtr processHandle;
static bool processAttached = false;
static Dictionary<string, HackFeature> hacks = new Dictionary<string, HackFeature>();
static string configFile = "settings";
[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, out int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
[DllImport("kernel32.dll")]
static extern bool CloseHandle(IntPtr hObject);
[DllImport("kernel32.dll")]
static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, uint flNewProtect, out uint lpflOldProtect);
[DllImport("kernel32.dll")]
static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, uint dwLength);
[StructLayout(LayoutKind.Sequential)]
public struct MEMORY_BASIC_INFORMATION
{
public IntPtr BaseAddress;
public IntPtr AllocationBase;
public uint AllocationProtect;
public IntPtr RegionSize;
public uint State;
public uint Protect;
public uint Type;
}
class HackFeature
{
public string Name { get; set; }
public string AOBPattern { get; set; }
public IntPtr Address { get; set; }
public byte[] OriginalBytes { get; set; }
public byte[] PatchBytes { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public int PatchSize { get; set; }
}
static bool IsAdministrator()
{
using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
{
WindowsPrincipal principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
}
static void Main()
{
if (!IsAdministrator())
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("This program requires administrator rights to function properly!");
Console.WriteLine("Please restart the program as administrator.");
Console.ResetColor();
Console.WriteLine("\nPress any key to exit...");
Console.ReadKey();
return;
}
Console.Title = "Dynamic Console - pathetic";
ShowBanner();
anjalog("Waiting for S4Client.exe...", ConsoleColor.Yellow);
while (!processAttached)
{
try
{
Process[] processes = Process.GetProcessesByName("S4Client");
if (processes.Length > 0)
{
targetProcess = processes[0];
processHandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, false, targetProcess.Id);
if (processHandle == IntPtr.Zero)
{
LogMessage("Failed to open process! Try running as Administrator if you're not already.", ConsoleColor.Red);
return;
}
processAttached = true;
anjalog($"S4Client.exe found (PID: {targetProcess.Id})", ConsoleColor.Green);
ShowHelp();
}
}
catch { }
Thread.Sleep(1000);
}
LoadHacks();
CommandLoop();
}
static void ShowBanner()
{
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine(@"
██████╗░██╗░░░██╗███╗░░██╗░█████╗░███╗░░░███╗██╗░█████╗░
██╔══██╗╚██╗░██╔╝████╗░██║██╔══██╗████╗░████║██║██╔══██╗
██║░░██║░╚████╔╝░██╔██╗██║███████║██╔████╔██║██║██║░░╚═╝
██║░░██║░░╚██╔╝░░██║╚████║██╔══██║██║╚██╔╝██║██║██║░░██╗
██████╔╝░░░██║░░░██║░╚███║██║░░██║██║░╚═╝░██║██║╚█████╔╝
╚═════╝░░░░╚═╝░░░╚═╝░░╚══╝╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░╚════╝░ Console by pathetic
");
Console.ResetColor();
}
static void CommandLoop()
{
while (true)
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("\n> ");
Console.ResetColor();
var input = Console.ReadLine().Trim().ToLower();
if (string.IsNullOrEmpty(input)) continue;
try
{
var parts = input.Split(' ');
var cmd = parts[0];
var arg = parts.Length > 1 ? parts[1] : null;
switch (cmd)
{
case "add": AddHack(); break;
case "scan":
if (arg == "all") ScanAllHacks();
else if (arg != null) ScanHack(arg);
else LogMessage("Usage: scan <hackname|all>", ConsoleColor.Red);
break;
case "list": ListHacks(); break;
case "remove": RemoveHack(arg); break;
case "help": ShowHelp(); break;
case "clear": Console.Clear(); ShowBanner(); ShowHelp(); break;
case "credits": Console.Write("Made out of boredom by pathetic ~~ EPVP @ ANJA"); break;
case "exit": CleanExit(); return;
default: ToggleHack(cmd, arg); break;
}
}
catch (Exception ex)
{
errorlog($" {ex.Message}", ConsoleColor.Red);
}
}
}
static void AddHack()
{
Console.Write("Enter AOB pattern : ");
var pattern = Console.ReadLine().Trim();
if (string.IsNullOrWhiteSpace(pattern))
throw new Exception("Pattern cannot be empty");
Console.Write("Enter description: ");
var desc = Console.ReadLine().Trim();
Console.Write("Enter command name: ");
var name = Console.ReadLine().Trim().ToLower();
if (string.IsNullOrWhiteSpace(name))
throw new Exception("Name cannot be empty");
hacks[name] = new HackFeature
{
Name = name,
AOBPattern = pattern,
Description = desc,
Enabled = false,
Address = IntPtr.Zero,
PatchSize = 0
};
SaveHacks();
LogMessage($"Hack '{name}' added. Run 'scan {name}' to find.", ConsoleColor.Green);
}
static void ScanAllHacks()
{
LogMessage("Scanning all hacks...", ConsoleColor.Yellow);
foreach (var hack in hacks.Values.Where(h => h.Address == IntPtr.Zero))
{
try
{
ScanHack(hack.Name);
}
catch (Exception ex)
{
LogMessage($"Failed to scan {hack.Name}: {ex.Message}", ConsoleColor.Red);
}
}
LogMessage("Scan complete!", ConsoleColor.Green);
}
static void ScanHack(string hackName)
{
if (!hacks.TryGetValue(hackName, out var hack))
throw new Exception("Hack not found");
LogMessage($"Scanning for '{hack.Description}'...", ConsoleColor.Yellow);
var (pattern, mask) = ParsePattern(hack.AOBPattern);
var address = FindPattern(pattern, mask);
if (address == IntPtr.Zero)
throw new Exception("Pattern not found!");
hack.Address = address;
DeterminePatchSize(hack);
SaveHacks();
LogMessage($"Found at: 0x{address.ToInt64():X}", ConsoleColor.Green);
LogMessage($"Auto-detected patch size: {hack.PatchSize} bytes", ConsoleColor.Green);
LogMessage($"Original bytes: {BitConverter.ToString(hack.OriginalBytes)}", ConsoleColor.Green);
LogMessage($"Use: {hack.Name} 1 to enable", ConsoleColor.Green);
}
static (byte[], byte[]) ParsePattern(string aobPattern)
{
var parts = aobPattern.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
var pattern = new byte[parts.Length];
var mask = new byte[parts.Length];
for (int i = 0; i < parts.Length; i++)
{
if (parts[i] == "??")
{
mask[i] = 0x00;
}
else
{
pattern[i] = Convert.ToByte(parts[i], 16);
mask[i] = 0xFF;
}
}
return (pattern, mask);
}
static IntPtr FindPattern(byte[] pattern, byte[] mask)
{
IntPtr address = IntPtr.Zero;
MEMORY_BASIC_INFORMATION memInfo;
while (VirtualQueryEx(processHandle, address, out memInfo, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION))) != 0)
{
if (IsReadableMemory(memInfo))
{
var buffer = new byte[(int)memInfo.RegionSize];
int bytesRead = 0;
if (ReadProcessMemory(processHandle, memInfo.BaseAddress, buffer, buffer.Length, ref bytesRead))
{
for (int i = 0; i < buffer.Length - pattern.Length; i++)
{
if (PatternMatch(buffer, i, pattern, mask))
return IntPtr.Add(memInfo.BaseAddress, i);
}
}
}
address = IntPtr.Add(memInfo.BaseAddress, (int)memInfo.RegionSize);
}
return IntPtr.Zero;
}
static bool IsReadableMemory(MEMORY_BASIC_INFORMATION memInfo)
{
return (memInfo.State & 0x1000) != 0 &&
(memInfo.Protect & 0xF0) != 0 &&
(memInfo.Protect & 0x300) == 0;
}
static bool PatternMatch(byte[] buffer, int offset, byte[] pattern, byte[] mask)
{
for (int i = 0; i < pattern.Length; i++)
if ((mask[i] == 0xFF) && (buffer[offset + i] != pattern[i]))
return false;
return true;
}
static void DeterminePatchSize(HackFeature hack)
{
byte[] buffer = new byte[15];
int bytesRead = 0;
if (!ReadProcessMemory(processHandle, hack.Address, buffer, buffer.Length, ref bytesRead))
throw new Exception("Failed to read memory for size detection");
int size = DetectInstructionSize(buffer);
hack.PatchSize = Math.Min(size, buffer.Length);
hack.OriginalBytes = new byte[hack.PatchSize];
Array.Copy(buffer, hack.OriginalBytes, hack.PatchSize);
hack.PatchBytes = Enumerable.Repeat((byte)0x90, hack.PatchSize).ToArray();
}
static int DetectInstructionSize(byte[] buffer)
{
switch (buffer[0])
{
case 0x90:
case 0xC3:
return 1;
case 0x0F:
return 2;
case 0x84:
case 0x85:
case 0x38:
case 0x39:
return 3;
case 0xE8:
case 0xE9:
return 5;
default:
return 1;
}
}
static void ToggleHack(string hackName, string state)
{
if (!hacks.TryGetValue(hackName, out var hack))
throw new Exception("Unknown command");
if (state != "1" && state != "0")
throw new Exception("Usage: <hackname> 1|0");
if (hack.Address == IntPtr.Zero)
throw new Exception("Address not found. Scan first!");
ToggleFeature(hack, state == "1");
}
static void ToggleFeature(HackFeature hack, bool enable)
{
uint oldProtect;
if (!VirtualProtectEx(processHandle, hack.Address, hack.PatchSize, PAGE_EXECUTE_READWRITE, out oldProtect))
throw new Exception("Failed to change memory protection");
var patch = enable ? hack.PatchBytes : hack.OriginalBytes;
if (!WriteProcessMemory(processHandle, hack.Address, patch, hack.PatchSize, out _))
throw new Exception("Failed to write memory");
VirtualProtectEx(processHandle, hack.Address, hack.PatchSize, oldProtect, out _);
hack.Enabled = enable;
LogMessage($"{hack.Description} {(enable ? "ENABLED" : "DISABLED")}",
enable ? ConsoleColor.Green : ConsoleColor.Blue);
}
static void ListHacks()
{
if (hacks.Count == 0)
{
LogMessage("No hacks saved", ConsoleColor.Yellow);
return;
}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\nSaved Hacks:");
Console.WriteLine("Name\t\tAddress\t\tSize\tStatus\tDescription");
Console.WriteLine("----\t\t-------\t\t----\t------\t-----------");
foreach (var hack in hacks.Values)
{
Console.ForegroundColor = ConsoleColor.White;
Console.Write($"{hack.Name,-10}\t");
Console.ForegroundColor = hack.Address == IntPtr.Zero ? ConsoleColor.Red : ConsoleColor.Green;
Console.Write($"{(hack.Address == IntPtr.Zero ? "Not found" : $"0x{hack.Address.ToInt64():X}"),-10}\t");
Console.ForegroundColor = ConsoleColor.White;
Console.Write($"{hack.PatchSize}\t");
Console.ForegroundColor = hack.Enabled ? ConsoleColor.Green : ConsoleColor.Red;
Console.Write($"{(hack.Enabled ? "ON" : "OFF"),-6}\t");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(hack.Description);
}
Console.ResetColor();
}
static void RemoveHack(string hackName)
{
if (string.IsNullOrEmpty(hackName))
throw new Exception("Usage: remove <hackname>");
if (!hacks.TryGetValue(hackName, out var hack))
throw new Exception("Hack not found");
if (hack.Enabled)
ToggleFeature(hack, false);
hacks.Remove(hackName);
SaveHacks();
LogMessage($"Hack '{hackName}' removed", ConsoleColor.Green);
}
static void LoadHacks()
{
if (!File.Exists(configFile)) return;
try
{
foreach (var line in File.ReadAllLines(configFile))
{
if (string.IsNullOrWhiteSpace(line)) continue;
var parts = line.Split('|');
if (parts.Length < 6) continue;
hacks[parts[0]] = new HackFeature
{
Name = parts[0],
AOBPattern = parts[1],
Description = parts[2],
Address = new IntPtr(long.Parse(parts[3])),
PatchSize = int.Parse(parts[4]),
Enabled = bool.Parse(parts[5])
};
}
LogMessage($"Loaded {hacks.Count} hacks", ConsoleColor.Green);
}
catch (Exception ex)
{
LogMessage($"Error loading hacks: {ex.Message}", ConsoleColor.Red);
}
}
static void SaveHacks()
{
try
{
var lines = hacks.Values.Select(h =>
$"{h.Name}|{h.AOBPattern}|{h.Description}|{h.Address.ToInt64()}|{h.PatchSize}|{h.Enabled}");
File.WriteAllLines(configFile, lines);
}
catch (Exception ex)
{
LogMessage($"Error saving hacks: {ex.Message}", ConsoleColor.Red);
}
}
static void CleanExit()
{
SaveHacks();
if (processHandle != IntPtr.Zero)
CloseHandle(processHandle);
Environment.Exit(0);
}
static void ShowHelp()
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\n Available Commands:");
Console.WriteLine(" add - Add new AOB pattern");
Console.WriteLine(" scan <name|all> - Find pattern in memory");
Console.WriteLine(" list - Show all hacks");
Console.WriteLine(" remove <name> - Delete hack");
Console.WriteLine(" <name> 1|0 - Enable/disable hack");
Console.WriteLine(" credits - Show credits");
Console.WriteLine(" clear - Clear console");
Console.WriteLine(" exit - Quit");
Console.ResetColor();
}
static void LogMessage(string msg, ConsoleColor color)
{
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.Write($"[{DateTime.Now:HH:mm:ss}] ");
Console.ForegroundColor = color;
Console.WriteLine(msg);
Console.ResetColor();
}
static void anjalog(string msg, ConsoleColor color)
{
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.Write("[DYNAMIC CONSOLE]");
Console.ForegroundColor = color;
Console.WriteLine(msg);
Console.ResetColor();
}
static void errorlog(string msg, ConsoleColor color)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("[DYNAMIC CONSOLE - ERROR]");
Console.ForegroundColor = color;
Console.WriteLine(msg);
Console.ResetColor();
}
}
}






