Jump to content

[SOLVED] Is there any tool to update obfuscation mapping for mod codes?


herbix

Recommended Posts

For example, now I have these codes in my mod:

    @Override
    public void func_180434_a(WorldRenderer worldRenderer, Entity entity, float time, float f4, float f5, float f6, float f7, float f8) {
        ...
    }

Maybe in another obfuscation mapping, func_180434_a is replaced by renderParticle. If I changed the mapping, a compile error occurs.

So is there any tool that input two mappings and my codes, output rewrited codes that replaced all obfuscated methods and fields? So that I could focus on issues such as BlockPos replacing x,y,z instead of renaming func_180434_a to renderParticle.

 

Any clue could help.  :D

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Link to comment
Share on other sites

If you change the mappings, to what mappings did you change it and what is the compile error?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

If you change the mappings, to what mappings did you change it and what is the compile error?

 

It's just an example.

I mean, if the deobfuscated name of a vanilla method changed in some mappings, the codes that follow old mappings and use the method couldn't be compiled when using new mappings. The same method, is named A in old mappings while named B in new mappings. My codes call A(). If I change to new mapping, A() doesn't exist and my codes can't be compiled until I change A() to B(). I'm seeking a way to do it automatically.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Link to comment
Share on other sites

While a bit of a pain it isn't to bad to do it manually. Your IDE (like Eclipse) will highlight everything that changed as an error and you look at the mapping CSV file to look up what it changed to. You can usually do it in about 15 minutes.

 

Yes. It's easy to replace func_aaa_b to something, since aaa is an unique number. And I can simply use text replacement to achieve this.

However, if func_aaa_b is mapped to A in old mappings and B in new mappings. I have to look up A in old mappings to get func_aaa_b, and then look up it in new mappings to get B. It cost more time and I can't simply replace text because it's not unique. I have to do it manually in case change other methods with the same name. That's why I am looking for a tool.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Link to comment
Share on other sites

While a bit of a pain it isn't to bad to do it manually. Your IDE (like Eclipse) will highlight everything that changed as an error and you look at the mapping CSV file to look up what it changed to. You can usually do it in about 15 minutes.

 

Yes. It's easy to replace func_aaa_b to something, since aaa is an unique number. And I can simply use text replacement to achieve this.

However, if func_aaa_b is mapped to A in old mappings and B in new mappings. I have to look up A in old mappings to get func_aaa_b, and then look up it in new mappings to get B. It cost more time and I can't simply replace text because it's not unique. I have to do it manually in case change other methods with the same name. That's why I am looking for a tool.

 

I think the func_aaa_b names may be unique across entire workspace but someone else would have to confirm.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I think the func_aaa_b names may be unique across entire workspace but someone else would have to confirm.

 

You didn't get my point.

It's not me who defines func_aaa_b.

 

Correct.  They're SRG names.  And the way SRG works is that they are 100% identical between different versions of Forge and usually the same across versions of Minecraft (a major rewrite of a class can throw that out the window though).

 

But your point doesn't make any sense because we don't know where you're trying to get to and where you are coming from.  What version of Minecraft (and Forge) is A, what version of Minecraft (and Forge) is B, etc?

 

It doesn't help that you say you want to translate func_aaa_b to something, but can't because it's not func_aaa_b.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

Thank you, Lex.

This may be what I'm looking for. Seems I should look at Forge repositories before I asked here.

And thanks to all who replied me.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Link to comment
Share on other sites

  • 4 months later...

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

Thank you, Lex.

This may be what I'm looking for. Seems I should look at Forge repositories before I asked here.

And thanks to all who replied me.

 

I am looking for something like this to update some mods. Were you able to create some easier-to-use tool to update minecraft mod source?

Link to comment
Share on other sites

1) Don't hijack threads. Make your own.

2) If I understand you correctly, you want to update a mod for an older Minecraft version to a newer one? You'd have to do it yourself, which means you have to decompile an deobfuscate the mod source, make changes to the source, obfuscate and compile it again.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

1) Don't hijack threads. Make your own.

2) If I understand you correctly, you want to update a mod for an older Minecraft version to a newer one? You'd have to do it yourself, which means you have to decompile an deobfuscate the mod source, make changes to the source, obfuscate and compile it again.

 

I have exactly the same problem as the original author of this topic and I wanted to know if he was able to create some script which helps with the problem.

Link to comment
Share on other sites

There is no tool to magically update an old mod. More changes in different versions than just mappings. If you want to update an old mod, you'll have to do as larsgerrits said. Obtain the source code (preferably by completely legal means), make any necessary changes, and then recompile it.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Link to comment
Share on other sites

There is no tool to magically update an old mod. More changes in different versions than just mappings. If you want to update an old mod, you'll have to do as larsgerrits said. Obtain the source code (preferably by completely legal means), make any necessary changes, and then recompile it.

 

Thanks guys, but I am neither new to coding, nor to minecraft modding. I am looking for a tool which uses a mapping list (like the MCP Mapping table) and updates all obfuscation mapping variable, methods, classes in my code to the readable ones from the list.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.