{"id":29360199,"url":"https://github.com/ffxivapp/sharlayan","last_synced_at":"2025-07-09T07:12:05.359Z","repository":{"id":2625203,"uuid":"47009706","full_name":"FFXIVAPP/sharlayan","owner":"FFXIVAPP","description":"Visit us on Discord! https://discord.gg/aCzSANp","archived":false,"fork":false,"pushed_at":"2024-09-27T12:40:29.000Z","size":15573,"stargazers_count":119,"open_issues_count":18,"forks_count":36,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-06-19T03:33:36.936Z","etag":null,"topics":["c-sharp","ffxiv","ffxivapp","memory","scanner","utility"],"latest_commit_sha":null,"homepage":"https://xivapp.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FFXIVAPP.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Icehunter"]}},"created_at":"2015-11-28T04:12:22.000Z","updated_at":"2025-04-28T17:47:54.000Z","dependencies_parsed_at":"2024-07-10T09:12:14.299Z","dependency_job_id":null,"html_url":"https://github.com/FFXIVAPP/sharlayan","commit_stats":{"total_commits":109,"total_committers":10,"mean_commits":10.9,"dds":"0.21100917431192656","last_synced_commit":"f6dbe35adbb587c10cc31b94b7e92c2489e45740"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FFXIVAPP/sharlayan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FFXIVAPP%2Fsharlayan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FFXIVAPP%2Fsharlayan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FFXIVAPP%2Fsharlayan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FFXIVAPP%2Fsharlayan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FFXIVAPP","download_url":"https://codeload.github.com/FFXIVAPP/sharlayan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FFXIVAPP%2Fsharlayan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264411192,"owners_count":23603807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","ffxiv","ffxivapp","memory","scanner","utility"],"created_at":"2025-07-09T07:12:00.224Z","updated_at":"2025-07-09T07:12:05.354Z","avatar_url":"https://github.com/FFXIVAPP.png","language":"C#","funding_links":["https://github.com/sponsors/Icehunter"],"categories":[],"sub_categories":[],"readme":"# sharlayan\n\nIssue tracking, feature request and release repository.\n\n# What is this?\n\nThis is the main memory module for FFXIVAPP split out into it's own repo. For enterprising people this means not having to wait for a full app update as this \"should\" be a drop in replacement for your existing one in your FFXIVAPP folder.\n\nPending anything catastrophic update-wise it should be good to go.\n\n# How do I use it and what comes back?\n\n- Add as a reference into your project.\n\nThat's the basic of it. For actual instantiation it works as follows:\n\n```csharp\nusing Sharlayan;\nusing Sharlayan.Enums;\nusing Sharlayan.Models;\n\n// DX11\nProcess[] processes = Process.GetProcessesByName(\"ffxiv_dx11\");\nif (processes.length)\n{\n    // supported: Global, Chinese, Korean\n    GameRegion gameRegion = GameRegion.Global;\n    GameLanguage gameLanguage = GameLanguage.English;\n\t// whether to always hit API on start to get the latest sigs based on patchVersion, or use the local json cache (if the file doesn't exist, API will be hit)\n\tbool useLocalCache = true;\n\t// patchVersion of game, or latest\n\tstring patchVersion = \"latest\";\n    Process process = processes[0];\n    ProcessModel processModel = new ProcessModel {\n        Process = process\n    }\n    SharlayanConfiguration configuration = new SharlayanConfiguration {\n        ProcessModel = processModel,\n        GameLanguage = gameLanguage,\n        GameRegion = gameRegion,\n        PatchVersion = patchVersion,\n        UseLocalCache = Settings.Default.UseLocalMemoryJSONDataCache\n    };\n    MemoryHandler memoryHandler = SharlayanMemoryManager.Instance.AddHandler(configuration);\n}\n```\n\nThe memory module is now instantiated and is ready to read data. When switch processes you should call:\n\n```csharp\nSharlayanMemoryManager.Instance.RemoveHandler(processModel);\n```\n\n# Reading\n\nThe instantiated memory handler for the process comes with it's own reader, or you can create your own.\n\n### Using Predefined\n\n```csharp\nMemoryHandler memoryHandler = SharlayanMemoryManager.Instance.GetHandler(processModel);\nXResult result = memoryHandler.Reader.GetX();\n```\n\n## Actors (Monster, Player, NPC, etc) Reading\n\n```csharp\nusing Sharlayan;\n\nActorReadResult readResult = memoryHandler.Reader.GetActors();\n\n// Removed is list of ID's that were in the last scan\n// New is all the new ID's added\n// Also returned is the Current list of actors.\n\n// The result is the following class\npublic class ActorReadResult\n{\n    public ActorReadResult()\n    {\n        RemovedMonster = new Dictionary\u003cuint, uint\u003e();\n        RemovedNPC = new Dictionary\u003cuint, uint\u003e();\n        RemovedPC = new Dictionary\u003cuint, uint\u003e();\n\n        NewMonster = new List\u003cuint\u003e();\n        NewNPC = new List\u003cuint\u003e();\n        NewPC = new List\u003cuint\u003e();\n    }\n\n    public ConcurrentDictionary\u003cuint, ActorItem\u003e MonsterEntities =\u003e MonsterWorkerDelegate.EntitiesDictionary;\n    public ConcurrentDictionary\u003cuint, ActorItem\u003e NPCEntities =\u003e NPCWorkerDelegate.EntitiesDictionary;\n    public ConcurrentDictionary\u003cuint, ActorItem\u003e PCEntities =\u003e PCWorkerDelegate.EntitiesDictionary;\n    public Dictionary\u003cuint, uint\u003e RemovedMonster { get; set; }\n    public Dictionary\u003cuint, uint\u003e RemovedNPC { get; set; }\n    public Dictionary\u003cuint, uint\u003e RemovedPC { get; set; }\n    public List\u003cUInt32\u003e NewMonster { get; set; }\n    public List\u003cUInt32\u003e NewNPC { get; set; }\n    public List\u003cUInt32\u003e NewPC { get; set; }\n}\n```\n\n## ChatLog Reading\n\n```csharp\nusing Sharlayan;\n\n// For chatlog you must locally store previous array offsets and indexes in order to pull the correct log from the last time you read it.\nint _previousArrayIndex = 0;\nint _previousOffset = 0;\n\nChatLogReadResult readResult = memoryHandler.Reader.GetChatLog(_previousArrayIndex, _previousOffset);\n\nList\u003cChatLogEntry\u003e chatLogEntries = readResult.ChatLogEntries;\n\n_previousArrayIndex = readResult.PreviousArrayIndex;\n_previousOffset = readResult.PreviousOffset;\n\n// The result is the following class\npublic class ChatLogReadResult\n{\n    public ChatLogReadResult()\n    {\n        ChatLogEntries = new List\u003cChatLogEntry\u003e();\n    }\n\n    public List\u003cChatLogEntry\u003e ChatLogEntries { get; set; }\n    public int PreviousArrayIndex { get; set; }\n    public int PreviousOffset { get; set; }\n}\n```\n\n## Inventory Reading\n\n```csharp\nusing Sharlayan;\n\nInventoryReadResult readResult = memoryHandler.Reader.GetInventoryItems();\n\n// The result is the following class\npublic class InventoryReadResult\n{\n    public InventoryReadResult()\n    {\n        InventoryEntities = new List\u003cInventoryEntity\u003e();\n    }\n\n    public List\u003cInventoryEntity\u003e InventoryEntities { get; set; }\n}\n```\n\n## Party Reading\n\n```csharp\nusing Sharlayan;\n\nPartyInfoReadResult readResult = memoryHandler.Reader.GetPartyMembers();\n\n// Removed is list of ID's that were in the last scan\n// New is all the new ID's added\n// Also returned is the Current list of actors.\n\n// The result is the following class\npublic class PartyInfoReadResult\n{\n    public PartyInfoReadResult()\n    {\n        RemovedParty = new Dictionary\u003cuint, uint\u003e();\n\n        NewParty = new List\u003cuint\u003e();\n    }\n\n    public ConcurrentDictionary\u003cuint, PartyMember\u003e PartyEntities =\u003e PartyInfoWorkerDelegate.EntitiesDictionary;\n    public Dictionary\u003cuint, uint\u003e RemovedParty { get; set; }\n    public List\u003cUInt32\u003e NewParty { get; set; }\n}\n```\n\n## Player Info Reading\n\n```csharp\nusing Sharlayan;\n\nPlayerInfoReadResult readResult = memoryHandler.Reader.GetPlayerInfo();\n\n// The result is the following class\npublic class PlayerInfoReadResult\n{\n    public PlayerInfoReadResult()\n    {\n        CurrentPlayer = new CurrentPlayer();\n    }\n\n    public CurrentPlayer CurrentPlayer { get; set; }\n}\n```\n\n## Target Reading\n\n```csharp\nusing Sharlayan;\n\nTargetReadResult readResult = memoryHandler.Reader.GetTargetInfo();\n\n// TargetsFound means at least 1 was found\n\n// The result is the following class\npublic class TargetReadResult\n{\n    public TargetReadResult()\n    {\n        TargetEntity = new TargetEntity();\n    }\n\n    public TargetEntity TargetEntity { get; set; }\n    public bool TargetsFound { get; set; }\n}\n```\n\n# Roll your own app?\n\nIf you want to add your own signatures to scan for you can modify the json file directly that's automatically downloaded/saved into your application directory.\n\nYou can also override the built in like so:\n\n```csharp\nSharlayanConfiguration configuration = new SharlayanConfiguration {\n    ProcessModel = new ProcessModel {\n        Process = Process.GetProcessesByName(\"ffxiv_dx11\").FirstOrDefault(),\n    },\n};\nMemoryHandler memoryHandler = new MemoryHandler(configuration);\n// it be default will pull in the memory signatures from the local file, backup from API (GitHub)\nmemoryHandler.Scanner.Locations.Clear(); // these are resolved MemoryLocation\n\nvar signatures = new List\u003cSignature\u003e();\n// typical signature\nsignatures.Add(new Signature\n{\n\tKey = \"SOMETHING\",\n\tValue = \"0123456789ABCDEF\",\n\tOffset = 0\n});\n// pointer path based (no signature)\nsignatures.Add(new Signature\n{\n\tKey = \"SOMETHING2\",\n\tPointerPath = new List\u003clong\u003e\n\t{\n\t\t0x0123456789\n\t}\n});\n// Aseembly Signature Based\nsignatures.Add(new Signature\n{\n\tKey = \"SOMETING3\",\n\tValue = \"0123456789ABCDEF0123456789ABCDEF\",\n\tASMSignature = true,\n\tPointerPath = new List\u003clong\u003e\n\t{\n\t\t0L, // ASM assumes first pointer is always 0\n\t\t144L\n\t}\n});\n\nmemoryHandler.Scanner.LoadOffsets(signatures);\n```\n\nOnce this is complete you can reference this when reading like so:\n\n```csharp\nvar somethingMap = memoryHandler.GetByteArray(memoryHandler.Scanner.Locations[\"SOMETHING\"], 8);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffxivapp%2Fsharlayan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffxivapp%2Fsharlayan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffxivapp%2Fsharlayan/lists"}