Jump to content

Recommended Posts

Posted

Hello! I recently lost all the source code to a mod I have been working on and no longer can edit its code. I was lucky and found a version of the mod compiled (in a JAR file) which I then used with luyten to decompile and attempt to use. The problem now is that a lot of the methods are now obfuscated. I was wondering if there was anything I could do to deobfuscate my own code? I know that forge does it when decompiling mc but I want to do it after mc has been decomplied. Is there a task to run for that? Thanks in advance!

Posted

Hello there, depending on the version of forge/minecraft there is a csv file provided in forge which contains mappings (i.e. obfuscated method name A = not obfuscated method name). You could then use a framework like javassist to remap the method calls/field accesses using this info (or do it manually using something like notepad++ with the replace in files function). Either way this is a lot of work not gonna lie your probably better off just rewriting your mod you should still be able to copy half of your stuff over so it should be a reasonably quick process.

 

There used to be a way to do this using mcp but the last time I attempted any such things is probably 6 years ago for < Minecraft 1.4 not sure if these tools still exist and to what extend they can still be made to do this.

Posted
Just now, UXELDUXEL said:

Hello there, depending on the version of forge/minecraft there is a csv file provided in forge which contains mappings (i.e. obfuscated method name A = not obfuscated method name). You could then use a framework like javassist to remap the method calls/field accesses using this info (or do it manually using something like notepad++ with the replace in files function). Either way this is a lot of work not gonna lie your probably better off just rewriting your mod you should still be able to copy half of your stuff over so it should be a reasonably quick process.

 

There used to be a way to do this using mcp but the last time I attempted any such things is probably 6 years ago for < Minecraft 1.4 not sure if these tools still exist and to what extend they can still be made to do this.

Funny thing is I found those CSV files and I am using them right now! They are working pretty well except they are missing a few functions that I cant seem to find. Other than that I managed to deobfuscate a large portion. Do you have any suggestions for finding these missing mappings?

Posted

No this CSV file is the only thing I have ever used.

Altho I have not looked for further mappings.

I am not developing mods myself, I fix mods that other people made mainly so they can be actually used in a server.

So i don't really have a need to see the full source code of a mod.

I only need to find the portion that buggy (or has you know, remote code execution exploits...) and then fix it using whatever means necesarry.

 

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.

Announcements



×
×
  • Create New...

Important Information

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