-
Notifications
You must be signed in to change notification settings - Fork 18
Fundamentals of Memory Editing
This guide will give you an introduction to in-memory mod making.
Memory editing is the process of modifying parts of the game while it is running, i.e. in memory. This allows you to make dynamic changes to the game's state and modify things that may not be editable in files. With some effort, it also allows you to add your own logic to certain game functions.
However memory editing should not be treated as a blanket replacement for editing files.
As a rule of thumb: If it can be edited via files, do it via files.
Things usually get a lot more complex and finnicky once they get loaded into memory, so don't make your life harder than it needs to be.
It is recommended that you have at least a little bit of low-level programming experience. I.e. C or C++. I will be explaining things as I go, but having some knowledge on the subject will make it easier to understand.
There are multiple different ways of going about making memory edits. In general, we differentiate between 3 distinct approaches. All of these can of course be mixed and matched as needed.
- Following and reading from/writing to pointers
- Directly modifying assembly instructions
- Hooking functions
These are in order from easiest to hardest. Keep in mind that using them is not the hard part, understanding how they work is. But do not worry, all three approaches will be covered in this guide.
The most straight forward method of making memory edits is by using pointers. Most simple cheats operate using this approach to change simple values such as zenny, item count, damage, etc.
If you do not know what a pointer is I highly recommend reading up on it as you will be hearing this word a lot in this guide.
Here is a Wikipedia article to get started.
If you know what a pointer is it should already be pretty apparent what this approach aims to do. We get a persistent pointer to a certain value in memory which we wish to modify. That pointer may or may not be multiple levels deep.
To elaborate, a multilevel pointer is a pointer which you may need to dereference multiple times, possibly adding additional offsets between each step.
The assembly modification approach is a bit more technical than the pointer one. In this approach we replace certain assembly instructions with our own to influence control flow or game state.
These edits are usually pretty simple, just replacing a few instructions.
For example we modify a write operation to always write a certain value. This could be used to lock your stamina at 100% at all times, just to give an example.
You should know at least a little bit about x86_64 assembly to follow this guide, but you can also just look up instructions as you go. If you do not know what assembly is at all, I don't recommend following this guide just yet.
I will be explaining some common instructions in the guide as we go.
Hooking functions is the most "difficult" approach of the three. Understanding it requires some more indepth knowledge about assembly.
Hooking a function is the process of detouring control flow to your own code and then back to the games code. This allows you to make more elaborate changes compared to direct asm modification.
You can do more advanced changes such as modifying function parameters, doing comparisons, completely rewriting certain functions, etc.
If you don't know basic assembly I highly recommend checking out one of the other two guides instead.
There are 2 primary methods of accessing program memory.
The first is by creating an exe, which will access the games memory externally, the other is by injecting a dll (i.e. plugin) into the game and accessing program memory internally.
Both approaches are equally viable but one may be more useful than the other for specific purposes. Here are some points of reference:
Pros:
- Straight forward, easy to get started with
- Ability to add a GUI/CLI to your mod
Cons:
- Slower, due to WinAPI
- More easily detected
- Has to be manually started upon game launch
Pros:
- Fast
- Is auto-loaded upon game launch (plugin)
- Harder to detect
Cons:
- Annoying to add a GUI/CLI
- Harder to debug
General Tutorials
Animation Tutorials
Audio Tutorials
File & In Game IDs
- Accessory and Specialized Tool IDs (Asset)
- Armor IDs (Asset)
- Decorations IDs
- EFX IDs
- Endemic Critter IDs (Asset)
- Face IDs (Asset)
- Furniture IDs (Asset)
- Gimmick IDs (Asset)
- Hairstyle IDs (Asset)
- Item IDs
- LMT IDs
- Material IDs
- Medal IDs
- Model Bone Function IDs
- Monster IDs
- Monster Shell IDs (A-P)
- Monster Shell IDs (Q-Z)
- NPC IDs (Asset)
- NPC Base Model (Asset)
- Palico Equipment IDs (Asset)
- Pendant IDs (Asset)
- Poogie Clothes IDs
- Quest IDs
- Skill IDs
- Stage IDs (Asset)
- Player Weapon Action IDs
- Weapon IDs (Asset)
- Weapon ID Dump (GS,SnS,DB)
- Weapon ID Dump (LS,Ham,HH)
- Weapon ID Dump (Lan,GL)
- Weapon ID Dump (SA,CB)
- Weapon ID Dump (Bow,HBG,LBG)
Model Tutorials
- Quick Guide to Importing Models (Blender 2.79)
- Walkthrough of a Weapon Import
- Basics of Exporting Into the .mod3 Format
- How To Fix UVs Sharing a Seam
- How To Separate Mesh Parts in Blender
- Rotating, Moving and Resizing in Blender
- How to Split a Single Mesh Outfit into Player Equippable Parts
- Jigglebone Chains (.ctc) and Colliders (.ccl)
- Axial CTC Rotations
- Editing Hair Models and Materials
- Useful Blender Scripts
- [external page] How to Make All Polygons Into Triangles (Required for MHW models)
- [external page] How to Convert Triangles Back Into Quads
- [external page] How to Change The View-port clipping Parameters For Large Models
- [external page] How to Set Origin to Vertex in Edit Mode
- [external page] Shortcut to repeat the last operation in Blender
- [external page] Transferring Rig Weights From One Mesh To Another
- [external page] How to Copy Paint Weights From One Object to Another
- [external page] How to Remove All Zero-Weight Vertex Groups
- [external page] How to Weight Paint Against Current Pose
- [external page] Making a Hair Rig
- [external page] Physics Transfer
EFX Tutorials
FSM Editing
MRL3 Tutorials
NPC Editing
Plugins and Memory Editing
Monster AI Editing
General Texture Tutorials
- Obtaining, Converting and Replacing Textures
- Textures with Paint NET
- How To Open DDS Files
- Editing Textures
- Understanding Alpha Channels
- Exporting Textures with Transparency
- How To Achieve Glass Texture
- How to create Crystal materials with Alpha Textures
- Working Around the Mip Map Loading Bug
- [external page] Extracting a UV Layout
Specific Texture Tutorials
Asterisk's Plugin Notes
Miscellaneous Tutorials
Outdated Tutorials
- How to Make an NPC Skin Material Support Skin Color Customization
- Plugin Comparison
- A Theoretical Proposal on Skeleton Extension
- Monster Hunter World Save Editor Tutorial
- Making Copies of a Save Slot
- Making a Green Screen
- Notes on CTC Physics Jiggle Files
- Opening MRL3 file with a template
- Transferring MRL3 Files Between Models
- Expanding mrl3 Reference List
- How to Edit Eye Color in mrl3 Files