Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Decompile java classes without field_ and func_


ElTotisPro50
 Share

Recommended Posts

21 hours ago, 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)

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)

Link to comment
Share on other sites

1 hour ago, 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)

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

Link to comment
Share on other sites

[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
Link to comment
Share on other sites

1 hour ago, 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. 

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

Link to comment
Share on other sites

13 minutes ago, 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

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
Link to comment
Share on other sites

  • 3 weeks later...
1 hour ago, 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

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."

Link to comment
Share on other sites

1 hour ago, 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

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

Link to comment
Share on other sites

8 hours ago, Luis_ST said:

did you use Mcreator?

im not a psycho hahaha, im programming everything in my mod (the code i leaved is from a obfuscated class of a mod called death note mod for 1.15.2, that was an example of how minecraft obfuscate the names)

Link to comment
Share on other sites

On 12/29/2021 at 9: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:

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)

Link to comment
Share on other sites

1 hour ago, 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)

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

9 hours ago, ElTotisPro50 said:

"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

I think this would make the hole thing clear

Link to comment
Share on other sites

1 hour ago, Luis_ST said:

I think this would make the hole thing clear

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)

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
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Are you using Fabric? I'm not sure if this forum would be the right place then.
    • server failed to start and gives me "Failed to load data packs, can't proceed with server load. You can either fix your data packs or reset to vanilla with --safeMode" error when i look in my logs. its updated to the latest version of forge(40.1.0), and I don't have any data packs installed as far as I know. And I will upload the full logs if asked as i dont know how to attach a document to this post.  
    • Pioneer Craft [modded] {1.18.2} {SMP} {Community} {Light Roleplay} We are Pioneer Craft and we seek you !!! We are building a community of passionate players to build, trade, and share some laughs with. Are you tired of playing alone? Or are you here seeking a server with dedicated members; a server where you are not overlooked and can voice your opinions? If you are interested in these things too, then come join us in Pioneer Craft! Our server is player built and driven. We have a custom mod pack with mods chosen by our community to suit our needs. We have designed our server for player driven roleplay! There will be four communities which will each be self-sufficient. We encourage and seek builders who want to create a beautiful world to live in. This is a whitelist server and we are looking for dedicated applicants and experienced builders. Applications are located on our website which can be accessed through the discord. Other than the application questions, we are requesting photos of your prior builds which will be taken into consideration. Please show photos of your builds in the share-your-work section of the discord. The server uses CurseForge to run. This server is for mature members (16+) . Discord (must join): https://discord.gg/c4uJvb29CN
    • Pioneer Craft [modded] {1.18.2} {SMP} {Community} {Light Roleplay} We are Pioneer Craft and we seek you !!! We are building a community of passionate players to build, trade, and share some laughs with. Are you tired of playing alone? Or are you here seeking a server with dedicated members; a server where you are not overlooked and can voice your opinions? If you are interested in these things too, then come join us in Pioneer Craft! Our server is player built and driven. We have a custom mod pack with mods chosen by our community to suit our needs. We have designed our server for player driven roleplay! There will be four communities which will each be self-sufficient. We encourage and seek builders who want to create a beautiful world to live in. This is a whitelist server and we are looking for dedicated applicants and experienced builders. Applications are located on our website which can be accessed through the discord. Other than the application questions, we are requesting photos of your prior builds which will be taken into consideration. Please show photos of your builds in the share-your-work section of the discord. The server uses CurseForge to run. This server is for mature members (16+) . Discord (must join): https://discord.gg/c4uJvb29CN 
    • Update: I didn't need capabilities. In fact, I didn't need to override applyEffectTick at all. But it seems like I need reflections. The increased hitbox size now works for both entity and block collision--with a little drawback. This is what it looks like so far: // this event handler checks every tick if the living entity has the "big" effect @SubscribeEvent public static void entitySizeChange(LivingEvent.LivingUpdateEvent event) { LivingEntity livingEntity = event.getEntityLiving(); if (livingEntity.getActiveEffectsMap() != null && livingEntity.hasEffect(ModEffects.BIG.get())) { EntityDimensions newDims = livingEntity.getDimensions(livingEntity.getPose()).scale(8.0F, 2.0F); try { // using reflection Field field = Entity.class.getDeclaredField("dimensions"); field.setAccessible(true); field.set(livingEntity, newDims); // setting the living entity's EntityDimensions EntityDimensions newEntityDimensions = (EntityDimensions) field.get(livingEntity); livingEntity.setBoundingBox(newEntityDimensions.makeBoundingBox( // setting the living entity's AABB livingEntity.getX(), livingEntity.getY(), livingEntity.getZ() )); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } }   The aforementioned drawback is that, when the effect wears off, the living entity's still keeps its bigger hitbox until it changes pose (i.e. my player crouching). Given that the EntityEvent.Size event fires whenever an entity changes pose, should I manually fire it with EVENT_BUS::post when that entity's effect wears off? If so, where? I tried manually firing EntityEvent.Size on my overridden removeAttributeModifiers(), but to no avail. 
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.