Jump to content

[1.7.2] Deobfuscating mod code help


Electrobob99

Recommended Posts

Like The subject states, I have hit a bit of a snag with obfuscating reversal. You see I am getting this message when hovering over this code

 

Message:

 cannot convert from Object&Comparable<?>&Serializable to boolean

Code:

 bound[0] = [i](!iblockaccess.isAirBlock(i - 1, j, k) ? 1 : false)[/i]

From what the compiler suggests I should add a cast to boolean, but I am not quite sure if that's correct or not.

I also have this problem that within a setBlockBounds method that is later in code, which says this part undefined, don't know if it's a problem or not:

setBlockBounds(bound[0] != 0 ? 0.0F : 0.25F, 0.0F, bound[1] != 0 ? 0.0F : 0.25F, bound[2] != 0 ? 1.0F : 0.75F, bound[4] != 0 ? 1.0F : 0.5F, bound[3] != 0 ? 1.0F : 0.75F);

 

Help would be appreciated, thank you

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Show more of the code, what does "iblockaccess" point to?

Ok, this is the method where it is contained, with what "iblockaccess" points to:

 

public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k)
{
     boolean[] bound = new boolean[6];
     Block block = iblockaccess.getBlock(i, j - 1, k);
     if (block != this)
{
bound[0] = (!iblockaccess.isAirBlock(i - 1, j, k) ? 1 : false);
bound[1] = (!iblockaccess.isAirBlock(i, j, k - 1) ? 1 : false);
bound[2] = (!iblockaccess.isAirBlock(i + 1, j, k) ? 1 : false);
bound[3] = (!iblockaccess.isAirBlock(i, j, k + 1) ? 1 : false);
bound[4] = (!iblockaccess.isAirBlock(i, j + 1, k) ? 1 : false);
       setBlockBounds(bound[0] != 0 ? 0.0F : 0.25F, 0.0F, bound[1] != 0 ? 0.0F : 0.25F, bound[2] != 0 ? 1.0F : 0.75F, bound[4] != 0 ? 1.0F : 0.5F, bound[3] != 0 ? 1.0F : 0.75F);
}
else
{
bound[0] = ((iblockaccess.getBlock(i - 1, j, k) == this) && (iblockaccess.isAirBlock(i - 1, j - 1, k)) ? 1 : false);
bound[1] = ((iblockaccess.getBlock(i, j, k - 1) == this) && (iblockaccess.isAirBlock(i, j - 1, k - 1)) ? 1 : false);
bound[2] = ((iblockaccess.getBlock(i + 1, j, k) == this) && (iblockaccess.isAirBlock(i + 1, j - 1, k)) ? 1 : false);
bound[3] = ((iblockaccess.getBlock(i, j, k + 1) == this) && (iblockaccess.isAirBlock(i, j - 1, k + 1)) ? 1 : false);
setBlockBounds(bound[0] != 0 ? 0.0F : 0.25F, 0.0F, bound[1] != 0 ? 0.0F : 0.25F, bound[2] != 0 ? 1.0F : 0.75F, 1.0F, bound[3] != 0 ? 1.0F : 0.75F);
}
}

 

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Why are you trying to store "1" or "false" into a boolean?  Booleans can't store "1".

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

Ok, so bound is a boolean[]. So bound[0] = needs a boolean. But this expression: (!iblockaccess.isAirBlock(i - 1, j, k) ? 1 : false) yields and int or a boolean, where the most common supertype is Object (or really Serializable, but who cares about that).

So... you need to make it always return a boolean. In this case just replace the 1 with true. This is a decompiler error, because true and false are represented as 1 and 0 in the bytecode.

Thank you, the true in place of 1 did fix the first issue, but I didn't fix the error with "bound[0] != 0" within the setBlockBounds inner method, unless I have to change the "0" to false? Would that be right?

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Ok, another problem I have encountered was with this line in the configuration:

Property debug = cfg.get("general", "debug", false);
/* 144:152 */       debug = debug.getBoolean(false);

I also noticed there is a boolean named debug in the beginning of the main file. I'd assume that it's supposed to be different xD Like change the Property debug to a different name, or change the Boolean debug to a different name?

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

boolean debug = cfg.getBoolean("genera","debug",false);

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

boolean debug = cfg.getBoolean("genera","debug",false);

Define "doesn't work".

By doesn't work I mean I get this when I change it: "the method getBoolean(String, String, Boolean) is undefined for the type Configuration"

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

That error is obvious.

I think I would how to resolve this, found there were actually 2 variables named debug, one was a Property type, and the other was of Boolean type. So I think all I should have to do is change one of their variable names.

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Ok, so things were going fine for me, until I got to the biome portion of my endeavors. In one of the main biome files, I found this line of code which gives an error:

BiomeManager.icyBiomes.add(new BiomeManager.BiomeEntry([i]biome[/i], 10));

. So my question is what could be done to fix this?

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

What's the error?

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

What's the error?

Well, to be honest I do know why it doesn't work, in that biome creation changed. Specifically the fact that the BiomeManager class no longer has icybiomes/warmbiomes, etc. But what I want to know is what is supposed to be used in place of:

"BiomeManager.icyBiomes.add(new BiomeManager.BiomeEntry(biomename, 10));"

 

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

/*
     * These lists should no longer be accessed directly. Instead, use the appropriate add, remove and get methods within this class.
     */
    @Deprecated
    public static List<BiomeEntry> icyBiomes = biomes[biomeType.ICY.ordinal()];

 

Huh, it says deprecated with a note on what to use instead.  Use the appropriate add, remove and get methods within this class.

 

    public static void addBiome(BiomeType type, BiomeEntry entry)
    {
        isModded = true;
        
        int idx = type.ordinal();
        List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
        if (list != null) list.add(entry);
    }

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

/*
     * These lists should no longer be accessed directly. Instead, use the appropriate add, remove and get methods within this class.
     */
    @Deprecated
    public static List<BiomeEntry> icyBiomes = biomes[biomeType.ICY.ordinal()];

 

Huh, it says deprecated with a note on what to use instead.  Use the appropriate add, remove and get methods within this class.

 

    public static void addBiome(BiomeType type, BiomeEntry entry)
    {
        isModded = true;
        
        int idx = type.ordinal();
        List<BiomeEntry> list = idx > biomes.length ? null : biomes[idx];
        if (list != null) list.add(entry);
    }

Doesn't seem to be the case for 1.7.2, and to show it here is the BiomeManager class verbatim:

 

public class BiomeManager
{
    public static ArrayList<BiomeGenBase> strongHoldBiomes = new ArrayList<BiomeGenBase>();
    public static ArrayList<BiomeGenBase> strongHoldBiomesBlackList = new ArrayList<BiomeGenBase>();

    @SuppressWarnings("unchecked")
    public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
    {
        if (!MapGenVillage.villageSpawnBiomes.contains(biome))
        {
            ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
            biomes.add(biome);
            MapGenVillage.villageSpawnBiomes = biomes;
        }
    }

    @SuppressWarnings("unchecked")
    public static void removeVillageBiome(BiomeGenBase biome)
    {
        if (MapGenVillage.villageSpawnBiomes.contains(biome))
        {
            ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
            biomes.remove(biome);
            MapGenVillage.villageSpawnBiomes = biomes;
        }
    }

    public static void addStrongholdBiome(BiomeGenBase biome)
    {
        if (!strongHoldBiomes.contains(biome))
        {
            strongHoldBiomes.add(biome);
        }
    }

    public static void removeStrongholdBiome(BiomeGenBase biome)
    {
        if (!strongHoldBiomesBlackList.contains(biome))
        {
            strongHoldBiomesBlackList.add(biome);
        }
    }

    public static void addSpawnBiome(BiomeGenBase biome)
    {
        if (!WorldChunkManager.allowedBiomes.contains(biome))
        {
            WorldChunkManager.allowedBiomes.add(biome);
        }
    }

    public static void removeSpawnBiome(BiomeGenBase biome)
    {
        if (WorldChunkManager.allowedBiomes.contains(biome))
        {
            WorldChunkManager.allowedBiomes.remove(biome);
        }
    }
}

 

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Try

BiomeDictionary.registerBiomeType(BiomeGenBase biome, Type ... types)

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

Ok here is another question. I have heard that I could use the BON program to deobfuscate classes, but what I want to know is, what do I put into the "MCP Folder" parameter. I ask this since there is no MCP folder anymore.

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Ok here is another question. I have heard that I could use the BON program to deobfuscate classes, but what I want to know is, what do I put into the "MCP Folder" parameter. I ask this since there is no MCP folder anymore.

Download BON2, it is updated for the new Forge installation.

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

Ok, didn't know there was a Bon2, but... dumb question, where do I install it? Mainly ask this because I get this error when I try to run it:

Guava Couldn't be found. You must run setupDevWorkspace or setupDecompWorkspace atleast once to in order to use this.

Followed by:

Guava couldn't be added to the classpath. Please report to Parker8283. java.lang.ClassNotFoundException: com.google.common.collect.Maps

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

It clearly tells you whats wrong.

I understand that it can't find Guava. My question is where is Guava, since even I can't find it in my modding environment either.

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

Guava Couldn't be found. You must run setupDevWorkspace or setupDecompWorkspace atleast once to in order to use this.

Reading helps.

Ok, I just ran both setupDevWorkspace as well as setupDecompWorkspace successfully, and the results..... Same error occurred. Says that guava still can't be found.

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

Link to comment
Share on other sites

I think I will just give up using Bon2, since I don't want to make a 1.8 workspace just so I can deobfuscate the code. I want to get it working in the version I stated in, and perfect it before I port it.. More fun that way xD

Member of Aerotech Networks, a Multi-Gaming server.

Also Currently porting the "Rise of the Automatons" minecraft mod

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This is a MacOs related issue: https://bugs.mojang.com/browse/MC-118506     Download this lib: https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar and put it into ~/Library/Application Support/minecraft/libraries/ca/weblite/java-objc-bridge/1.0.0  
    • I use Bisect-Hosting, and I host a relatively modded server.  There is a mod I desperately want to have in a server. https://www.curseforge.com/minecraft/mc-mods/minehoplite This is MineHop. It's a mod that replicates the movement capabilities seen in Source Engine games, such as Half-Life, and such.  https://youtu.be/SbtLo7VbOvk - A video explaining the mod, if anyone is interested.  It is a clientside mod, meaning whoever is using it can change anything about the mod that they want, with no restrictions, even when they join a server with the same mod. They can change it to where they can go infinitely fast, or do some other overpowered thing. I don't want that to happen. So I just want to know if there is some way to force the SERVER'S configuration file, onto whoever is joining.  I'm not very savvy with all this modding stuff. There are two config files: minehop-common.txt, and minehop.txt I don't really know much about how each are different. I just know what the commands relating to acceleration and stuff mean.    
    • My journey into crypto trading began tentatively, with me dipping my toes into the waters by purchasing my first Bitcoin through a seasoned trader. With an initial investment of $5,000, I watched as my investment grew, proving to be both fruitful and lucrative. Encouraged by this success, I decided to increase my investment to $150,000, eager to capitalize on the growing popularity of cryptocurrency, However, as cryptocurrency gained mainstream attention, so too did the number of self-proclaimed "experts" in the field. Suddenly, everyone seemed to be a crypto guru, and more and more people were eager to jump on the bandwagon without fully understanding the intricacies of this complex world. With promises of quick and easy profits, these con artists preyed on the uninformed, luring them into schemes that often ended in disappointment and financial loss. Unfortunately, I fell victim to one such scheme. Seduced by the allure of easy money, I entrusted my hard-earned funds to a dubious trading platform, granting them access to my accounts in the hopes of seeing my investment grow. For a brief period, everything seemed to be going according to plan, with regular withdrawals and promising returns on my investment. However, my hopes were soon dashed when, without warning, communication from the platform ceased, and my Bitcoin holdings vanished into thin air. Feeling helpless and betrayed, I confided in a family member about my predicament. They listened sympathetically and offered a glimmer of hope in the form of a recommendation for Wizard Web Recovery. Intrigued by the possibility of reclaiming what I had lost, I decided to explore this option further. From the moment I reached out to Wizard Web Recovery, I was met with professionalism and empathy. They took the time to understand my situation and reassured me that I was not alone in my plight. With their guidance, I embarked on a journey to reclaim what was rightfully mine. Wizard Web Recovery's expertise and dedication were evident from the start. They meticulously analyzed the details of my case, uncovering crucial evidence that would prove invaluable in our quest for justice. With each step forward, they kept me informed and empowered, instilling in me a newfound sense of hope and determination. Through their tireless efforts and unwavering support, Wizard Web Recovery succeeded in recovering my lost Bitcoin holdings. It was a moment of triumph and relief, knowing that justice had been served and that I could finally put this chapter behind me. In conclusion, My experience with Wizard Web Recovery  was nothing short of transformative. Their professionalism, expertise, and unwavering commitment to their clients set them apart as true leaders in the field of cryptocurrency recovery. I am forever grateful for their assistance and would highly recommend their services to anyone in need of help navigating the treacherous waters of cryptocurrency scams. 
    • Ok so: Two things to note: It got stuck due to my dimension type. It was previously the same as the overworld dimension tpye but after changing it , it didn't freeze during spawn generation. ALSO, APPARENTLY, the way I'm doing things, the game can't have two extremely-rich dimensions or it will make the new chunk generation be veeery VEEERY slow. I'm doing the dimension file genreation all in the data generation step now, so it's all good. Mostly. If anybody has any tips regarding how can i more efficently generate a biome-rich dimension, im all ears.
    • https://mclo.gs/qTo3bUE  
  • Topics

×
×
  • Create New...

Important Information

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