Short answer: not the RID. You are mixing up three separate numbering systems, and once you separate them the answer is obvious.
The three numbers you are looking at
- Token / RID -
0x06001EBB and 0x04000D1E are metadata tokens. The RID is just the row number in the metadata table. It identifies the method or field to the runtime, nothing more.
- RVA / offset -
0x16BE680 is where the method sits in the binary, and 0x78 / 0x8 are field offsets inside the object layout. These are file positions.
- Game ID - the actual value the game uses to identify a dungeon. This is the
int parameter, and it is the same value stored in PFLHNHCHPFJ at offset 0x8.
So the dungeon is identified by the int, and that int is what you force. The RID tells you which method to patch, not which dungeon to load.
Where the value actually lives
GetDungeonData is
static, so there is no
this pointer and the parameter arrives in
w0 - the same register that carries the return value. Overwrite w0 before the body runs and the body will look up your dungeon instead of the one it was called with.
Why you cannot just overwrite the first instruction
Because
mov w0, #id replaces whatever was there, and that instruction is gone. If it was the stack frame setup (
stp x29, x30, [sp, #-0x20]!) you have corrupted the prologue. You need either a hook or a code cave.
The clean way - hook it
With Dobby, LGL or Frida this is three lines, no cave needed:
Code:
void* orig = nullptr;
int (*oGetDungeonData)(int) = nullptr;
int hGetDungeonData(int id)
{
return oGetDungeonData(0x1234); // your dungeon id
}
// register: hook(GetDungeonData, hGetDungeonData, &orig);
Nothing is destroyed, the original still runs, and you can toggle by returning
id instead of the constant.
The static-patch way - code cave
- Copy the first 3 to 4 whole instructions of the function into an empty executable region.
- In the cave, append
mov w0, #id then b back to the instruction after your overwrite point.
- Overwrite the function's first instruction with a
b to the cave.
Code:
00 02 80 52 mov w0, #0x10 ; small ids fit in one instruction
E0 1F 80 52 mov w0, #0xFF
C0 03 5F D6 ret
For anything past 255 you need
movz +
movk instead. Build those on armconverter, do not hand-assemble them.
Why not just write the field
You can -
DungenList is static, so you can reach the dictionary and write
0x8 on every entry. But the key and the value's own id field then disagree, and anything downstream that reads
PFLHNHCHPFJ will see a mismatch with the key it was found under. It works for a display hack and breaks for anything that re-resolves by id. Patching the argument keeps key and value consistent.
Getting valid ids
The ids are not in the metadata as a neat list - they are whatever the callers pass. Easiest source is runtime: open the dungeon list screen with GameGuardian attached, search the
int you see, and the values that come back are the real ids. Cross-check them against
DungenList entry counts so you know the range. If there is an enum or a constants class next to
AELEPACEJDO in the dump, use that instead - it is faster and safe.
The skin changer comparison
Same shape, and worth being precise about it because it is the same trick everywhere: a skin changer hooks the getter that returns the equipped skin id and returns a different one, or writes the equipped id field directly. Either way it is
one id, forced at the point it is read. Your dungeon version forces the id at the point it is looked up. Identical mechanism, different function.
The failure mode to watch for is that
GetDungeonData also gets called during loading with ids the game expects to resolve normally. Forcing every call to one id can blank the list. If that happens, only override when the incoming id matches a specific value:
Code:
int hGetDungeonData(int id)
{
if (id == 3) id = 0x1234;
return oGetDungeonData(id);
}