Jump to content

Recommended Posts

Posted

so i installed java decompiler gui but because minecraft has custom fields and things is showing them and func_ and field_ are not readable, i watched a tutorial but is too old(is using bearded octo nemesis but i cant download it), is there another way to deobfuscate the func_numbers and field_numbers?

Posted
  On 12/28/2021 at 10:50 PM, Luis_ST said:

why, what's the reason for?

Expand  

well im creating a mod with some similar features to other mods, and i want to read the code(im not copying the mod and reupload it i promise) because i like testing with modding and minecraft and with other mods

Posted
  On 12/28/2021 at 11:09 PM, ElTotisPro50 said:

im in minecraft 1.16.5 and using Intellij Idea Community, do you mean i can open a .class file(that is not mine) in mi IDLE?(if i can, how)

Expand  

in your IDE yes, take a look at the Dependencies of your project,
you will find the minecraft scource code in the forge-<forge_version>_<mappings_type>_<minecraft_version>.jar, in the package net.minecraft

unfortunately i can't tell, where you find the Dependencies exactly in your Project since i'm not familiar with Intellij (i use Eclipse)

Posted
  On 12/29/2021 at 8:15 PM, Luis_ST said:

in your IDE yes, take a look at the Dependencies of your project,
you will find the minecraft scource code in the forge-<forge_version>_<mappings_type>_<minecraft_version>.jar, in the package net.minecraft

unfortunately i can't tell, where you find the Dependencies exactly in your Project since i'm not familiar with Intellij (i use Eclipse)

Expand  

i dont want the source code of my project or minecraft or forge, i want to deobfuscate  a separated .class file of other mod for example:

InventedMod

InventedBlock.class

inventedBlockContainer.class

 

ETC

Posted (edited)

[EDIT] Sorry I misread your post. This isn't possible for other mods unless you have specific mappings for them. Many are open source, and you can find the source code on curseforge. Many mods that don't list their source on curseforge still have public github repos you can search for.

If you want to build off of a mod that doesn't provide source it's a good idea to check the license first to make sure the author permits what you're trying to do. If they do or you reach out and get permission you'll have to figure out what methods mean contextually, or ask the mod dev for source. 

Edited by Drosophila
misread
Posted
  On 12/29/2021 at 8:28 PM, Drosophila said:

[EDIT] Sorry I misread your post. This isn't possible for other mods unless you have specific mappings for them. Many are open source, and you can find the source code on curseforge. Many mods that don't list their source on curseforge still have public github repos you can search for.

If you want to build off of a mod that doesn't provide source it's a good idea to check the license first to make sure the author permits what you're trying to do. If they do or you reach out and get permission you'll have to figure out what methods mean contextually, or ask the mod dev for source. 

Expand  

is there a internet page where i can find what func_ and field_ means one by one, like a translation for them?, literally thats the only thing i need

Posted (edited)
  On 12/29/2021 at 8:47 PM, ElTotisPro50 said:

is there a internet page where i can find what func_ and field_ means one by one, like a translation for them?, literally thats the only thing i need

Expand  

Those are arbitrary prefixes created by the process of obfuscation. The naming convention refers to functions and fields. They could just have easily been foo_ and bar_. 

Edited by Drosophila
typo
  • 3 weeks later...
Posted
  On 1/16/2022 at 7:19 PM, Majd123mc said:

Hold on, there might be a chance that the mod files aren't being the ones obfuscated, but simply the vanilla function calls are.

@ElTotisPro50 Are all the functions and methods like this? Or are only some of them

Expand  

oh i know that the mod didnt obfuscated the methods, maybe minecraft did, an example is: world.func_numbers or player.func_numbers, this is from a mod called deathnote mod

public class DeathNoteGUIGui extends DeathnoteModElements.ModElement {
  public static HashMap guistate = new HashMap<>();
  
  private static ContainerType<GuiContainerMod> containerType = null;
  
  public DeathNoteGUIGui(DeathnoteModElements instance) {
    super(instance, 5);
    this.elements.addNetworkMessage(ButtonPressedMessage.class, ButtonPressedMessage::buffer, net.neio.deathnote.gui.DeathNoteGUIGui.ButtonPressedMessage::new, ButtonPressedMessage::handler);
    this.elements.addNetworkMessage(GUISlotChangedMessage.class, GUISlotChangedMessage::buffer, net.neio.deathnote.gui.DeathNoteGUIGui.GUISlotChangedMessage::new, GUISlotChangedMessage::handler);
    containerType = new ContainerType((ContainerType.IFactory)new GuiContainerModFactory());
    FMLJavaModLoadingContext.get().getModEventBus().register(this);
  }
  
  @OnlyIn(Dist.CLIENT)
  public void initElements() {
    DeferredWorkQueue.runLater(() -> ScreenManager.func_216911_a(containerType, net.neio.deathnote.gui.DeathNoteGUIGui.GuiWindow::new));
  }
  
  @SubscribeEvent
  public void registerContainer(RegistryEvent.Register<ContainerType<?>> event) {
    event.getRegistry().register(containerType.setRegistryName("death_note_gui"));
  }
  
  private static void handleButtonAction(PlayerEntity entity, int buttonID, int x, int y, int z) {
    World world = entity.field_70170_p;
    if (!world.func_175667_e(new BlockPos(x, y, z)))
      return; 
    if (buttonID == 0) {
      Map<String, Object> $_dependencies = new HashMap<>();
      $_dependencies.put("entity", entity);
      $_dependencies.put("guistate", guistate);
      $_dependencies.put("x", Integer.valueOf(x));
      $_dependencies.put("y", Integer.valueOf(y));
      $_dependencies.put("z", Integer.valueOf(z));
      $_dependencies.put("world", world);
      WriteProcedureProcedure.executeProcedure($_dependencies);
    } 
  }
  
  private static void handleSlotAction(PlayerEntity entity, int slotID, int changeType, int meta, int x, int y, int z) {
    World world = entity.field_70170_p;
    if (!world.func_175667_e(new BlockPos(x, y, z)))
      return; 
  }
}

as you can see func_numbers is seen after "something."

Posted
  On 1/16/2022 at 7:19 PM, Majd123mc said:

Hold on, there might be a chance that the mod files aren't being the ones obfuscated, but simply the vanilla function calls are.

@ElTotisPro50 Are all the functions and methods like this? Or are only some of them

Expand  

also there is a program called bearded octo nemesis that deobfuscate any .class files(is made for minecraft) but it doesnt work :(

Posted
  On 12/29/2021 at 8:18 PM, ElTotisPro50 said:

i dont want the source code of my project or minecraft or forge, i want to deobfuscate  a separated .class file of other mod for example:

Expand  

of how many classes/methods/fields do you need the SRG names (and yes func_175667_e is a SRG name and not a obfuscate name)

Posted
  On 1/17/2022 at 7:47 PM, Luis_ST said:

of how many classes/methods/fields do you need the SRG names (and yes func_175667_e is a SRG name and not a obfuscate name)

Expand  

what is a SRG?, ( https://imgur.com/a/RRPPegl )

"of how many classes/methods/fields do you need the SRG names" i dont understand your question, i need to convert those obfuscated fields or "SRG" as you said to readable fields

Posted

Hi!

I think the Forge Discord has a Bot for converting SRG Names to the newest Mappings. I don't know how it works but try just going on their discord an typing !help or something like that 

Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can :D

Also: PLEASE use SPOILERS for logs!

Posted
  On 1/18/2022 at 5:37 AM, Luis_ST said:

I think this would make the hole thing clear

Expand  

ok that just explained me how forge obfuscate the fields but i need to really deobfuscate them not to explain mehow they do it(maybe im blind and in the page there is  tool or something that deobfuscates the fields but i didnt see anything)

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.