Skip to content

reobf: add string remap option#235

Open
M41G wants to merge 1 commit into
MCPHackers:mainfrom
M41G:reobf-string-remap
Open

reobf: add string remap option#235
M41G wants to merge 1 commit into
MCPHackers:mainfrom
M41G:reobf-string-remap

Conversation

@M41G
Copy link
Copy Markdown

@M41G M41G commented May 13, 2026

Adds a stringremap option for selected packages during reobfuscation.

I use this for ASM bytecode injection code that lives outside the Minecraft source classes and does not modify those classes directly. That code still carries MCP names in string literals, such as transformer owner/name/desc values or field reflection names. Normal reobfuscation remaps bytecode references, but those strings are left alone, so the transformer can stop matching once the jar is obfuscated.

This could also help other projects that keep patching logic in separate transformer packages instead of editing the decompiled Minecraft sources. It lets those packages opt in by prefix, keeps the default MCP workflow unchanged, and avoids broad string rewriting across unrelated classes.

Adds an opt-in package list for rewriting MCP strings during reobfuscation.

Handles transformer owner/name/desc strings and field reflection names before normal mappings are applied.
@M41G M41G force-pushed the reobf-string-remap branch from 33d168b to 4dc472a Compare May 13, 2026 21:11
@PhoenixVX
Copy link
Copy Markdown
Member

Sorry for the late response, my immediate thought when I read the PR title was that this probably belongs in an RMCP plugin instead of being a default feature. I have not yet tested it to see if it functions as it should. If you have a good reason for this being in RMCP itself, I may reconsider it.

@M41G
Copy link
Copy Markdown
Author

M41G commented May 21, 2026

Sorry for the late response, my immediate thought when I read the PR title was that this probably belongs in an RMCP plugin instead of being a default feature. I have not yet tested it to see if it functions as it should. If you have a good reason for this being in RMCP itself, I may reconsider it.

I believe it belongs in RMCP because it fixes a gap in reobfuscation that I fell into, which is not a project specific workflow. RMCP already remaps bytecode references, but ASM transformers and reflection code often store class/member references as string literal. If those stay in MCP names, the jar can reobfuscate successfully but fail at runtime because the transformer no longer matches obfuscated names.

Since this is opt-in defaults off, and only applies to selected package prefixes, it should not affect the normal workflow of some developers. It just lets transformer-heavy projects get correct reobf output without needing a separate plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants