• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

HeartPattern/MC-Remapper: Deobfuscator for Minecraft by mapping json

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

HeartPattern/MC-Remapper

开源软件地址(OpenSource Url):

https://github.com/HeartPattern/MC-Remapper

开源编程语言(OpenSource Language):

Kotlin 100.0%

开源软件介绍(OpenSource Introduction):

Maven metadata URL Jenkins GitHub top language CodeFactor Grade GitHub repo size GitHub GitHub commit activity GitHub last commit

MC-Remapper

Deobfuscator for Minecraft

Mojang provide mapping file of obfuscated class, field, and method name for minecraft mod developer. This program applies mapping file to original minecraft code. It does not decompile jar, but only apply mapping. You have to decompile jar with your favorite decompiler after deobfuscate minecraft with mc-remapper.

Compile

Java 17 is required to compile MC-Remapper.
Clone project to your local machine and open terminal in the directory where build.gradle located. Run following command to compile.

./gradlew installDist

Runnable script and runtime libraries will generate under build/install/MC-Remapper.

Usage

Open terminal at build/install/MC-Remapper/bin. Execute MC-Remapper (Mac/Linux) or MC-Remapper.bat(Windows) with following parameters.

Arguments

Execute with specific file

To run mc remapper with a specific file, you can provide input jar and mapping txt.

Input jar is path to file or url of obfuscated minecraft client or server.

Mapping txt is path to file or url of proguard's mapping txt file. You can find it at .minecraft/versions/$version$/$version$.json file.

Execute with version

To run mc remapper with automatically download artifact and mapping tt, you can provide artifact name and version id.

Artifact name is either server or client.

Version id is release version or snapshot version.

Options

--output or --output-name(Default=Generate from other arguments)

Path to output file. If file already exists, overwrite it.

--thread (Default=8)

Number of thread used for apply mapping to class.

--fixlocalvar (Default=no)

Fix local variable name \u2603(). This variable name declared multiple time in same scope, so some decompiler does not work. There are three options.

option description
no Do not fix
rename Rename problematic local variable to debug$index like debug1, debug2...
delete Delete problematic local variable

--reobf (Flag, Default=no)

This option is useless for now. Both forge and bukkit modify nms with their own mapping, therefore applying this option is meaningless

Reobf option reverses mapping direction. By default, MC-Remapper map obfuscated code to deobfuscated code. However, if you write your mod/plugin with deobfuscated minecraft source and apply it to forge/bukkit, minecraft will crash with NoClassDefFoundException, NoSuchMethodException, or else. That's because, forge or bukkit use obfuscated code, but your plugin tried to access to deobfuscated code. In this case, you have to re-obfuscate your mod/plugin to use obfuscated minecraft code. You can use this option to map deobfuscated to. obfuscated code.

For csrg/srg mappings, this option is needed to apply deobfuscating mapping. i.e. deobfuscating = --reobf, reobfuscating = no --reobf.

--format (Default=proguard)

Supported mapping format: proguard, csrg, srg

--autologger (Flag, default=no)

Static final fields with type org.apache.logging.log4j.Logger is automatically renamed to LOGGER if it is not explicitly renamed by the mapping.

--autotoken (Flag, default=no)

Members' names that are Java keywords are automatically appended an underscore (_).

--mappackage (Map, default=None)

Renames packages AFTER other mappings are applied. Can occur multiple times, where they are merged.

Example: --mappackage =net.minecraft.server.v1_15 --mappackage net.minecraft.server=net.minecraft.server.v1_15

The unnamed package is renamed to net.minecraft.server.v1_15, and net.minecraft.server is renamed to net.minecraft.server.v1_15.

Example usages

Execute by specifying input file and mapping url

./MC-Remapper server.jar https://launcher.mojang.com/v1/objects/448ccb7b455f156bb5cb9cdadd7f96cd68134dbd/server.txt

Execute by specifying input and mapping file with options

./MC-Remapper server.jar server_mapping.txt --output deobf.jar --thread 8 --fixlocalvar=delete --reobf

Execute by specifying version

./MC-Remapper server 1.15.2



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap