Botanias matrix wings

Dieses Thema im Forum "Offtopic" wurde erstellt von alfiealfie, 2. Mai 2016.

  1. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Ok so a few days ago I was going through botanias source code and stumbled on thsee flugel tiara wings called "the one" only obtained by renaming a flugel tiara in an anvil (like renaming the manatee sword "the elucidator") but to get the name you need to Crack this

    @Override
    public void onEquipped(ItemStack stack, EntityLivingBase player) {
    super.onEquipped(stack, player);
    if(stack.getItemDamage() != WING_TYPES && hash(stack.getDisplayName()).equals("16E1BDFD1D6AE1A954C9C5E1B2D9099780F3E1724541F1F2F77310B769CFFBAC")) {
    stack.setItemDamage(WING_TYPES);
    stack.getTagCompound().removeTag("display");
    }
    }
    String hash(String str) {
    if(str != null)
    try {
    MessageDigest md = MessageDigest.getInstance("SHA-256");
    return new HexBinaryAdapter().marshal(md.digest(salt(str).getBytes()));
    } catch (NoSuchAlgorithmException e) {
    e.printStackTrace();
    }
    return "";
    }
    // Might as well be called sugar given it's not secure at all :D
    String salt(String str) {
    str = str += "wowsuchsaltmuchsecurityverywow";
    SecureRandom rand = new SecureRandom(str.getBytes());
    int l = str.length();
    int steps = rand.nextInt(l);
    char[] chrs = str.toCharArray();
    for(int i = 0; i < steps; i++) {
    int indA = rand.nextInt(l);
    int indB;
    do {
    indB = rand.nextInt(l);
    } while(indB == indA);
    char c = (char) (chrs[indA] ^ chrs[indB]);
    chrs[indA] = c;
    }
    return String.copyValueOf(chrs);
    }

    The end result is this

    635763801556004336.

    They require no mana upkeep, I will tell you in 2 days if no one else can decode it, if you can tell me the answer and I will verify whether or not it's right and say up here a list of people who guessed:

    Hints:

    It's 19 characters long and a matrix reference, happy dehashing!
     
  2. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Oh and I would use eclipse if I where you, not a crappy online one, they don't really do salt
     
  3. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    It's hashed, you'd have to bruteforce it if you want to be able to figure it out, setup a cracker and get workinging that uses these functions until you get the output would probably be the best way
     
    Fireforce gefällt das.
  4. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    It's hashed with salt however, so while brute forcing it may be the best way, it isn't the only way
     
  5. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    well, while i was digging for a short time (i have school in 10-20 minutes) here go at this
    Code:
    public class picochar {
    	public static char[] charset = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
    	int num;
    	int mod;
    
    	picochar(int init, int mod)
    	{
    		num = init%mod;
    	}
    
    	picochar(char init, int mod)
    	{
    		for(int i = 0; i < mod; i++)
    		{
    			if(charset[i] == init)
    				num = i;
    		} 
    	}
    
    	public char get()
    	{
    		return charset[num];
    	}
    
    	public boolean equals(char  ch)
    	{
    		return (get() == ch);
    	}
    
    	public void increment()
    	{
    		num++;
    	}
    }
    and the method that uses that?
    Code:
    public static String next(String s) {
    	int length = s.length();
    	picochar pc = new picochar(s.charAt(length - 1),mod);
    	if(pc.equals(picochar.charset[mod-1]))
    		return length > 1 ? next(s.substring(0, length - 1)) + 'a' : "aa";
    	pc.increment();
    	return s.substring(0, length - 1) + pc.get();
    }
    there's a hash bruteforcer, go atem' and figure out how to run it on that thingy
     
  6. tyler489

    tyler489 Well-Known Member

    Beiträge:
    1.873
    Zustimmungen:
    202
    Ortszeit:
    22:42
    Gyazo - bef3c85d6a57baaed897320af605ce3d.png
    Code:
    	}
    
    	@Override
    	public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
    		super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
    		par3List.add(StatCollector.translateToLocal("botania.wings" + par1ItemStack.getItemDamage()));
    	}
    
    	@Override
    	public void onEquipped(ItemStack stack, EntityLivingBase player) {
    		super.onEquipped(stack, player);
    		if(stack.getItemDamage() != WING_TYPES && hash(stack.getDisplayName()).equals("16E1BDFD1D6AE1A954C9C5E1B2D9099780F3E1724541F1F2F77310B769CFFBAC")) {
    			stack.setItemDamage(WING_TYPES);
    			stack.getTagCompound().removeTag("display");
    		}
    	}
    

    I learned something interesting Apparently other players cant see these wings
    Also mine burns mana -_-
     
    Zuletzt bearbeitet: 2. Mai 2016
  7. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    You use the /give command? If you did then it doesn't work it has the named something to be counted otherwise it's the basic tiara[DOUBLEPOST=1462217860][/DOUBLEPOST]Naming it to the hashed name is what causes the code @Override, changing the function and texture[DOUBLEPOST=1462217916][/DOUBLEPOST]But evidently you still get the texture
     
  8. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    hahahaha, ok, i have hints for the rest of you,
    Botania Matrix Wings : feedthebeast
    [Botania] Matrix Wings? : feedthebeast
    [Botania] Konami Code Spoiler! : feedthebeast
    these three have the people mentioning how it was found, by the original 2[DOUBLEPOST=1462220039,1462218477][/DOUBLEPOST]Final hint i found while digging through commits: the original function wassssssssssssss
    Code:
    stack.getDisplayName().hashCode() == 0x7867EB0B
    which means that it's fairly easy to get the string due to how java's hashcode function works, happy coding!
     
  9. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Oh nice, chugga you don't have a life do you? Anyways that makes things a bit easier provided it codes for the currently used name but to be safe I'm almost done brute-forcing it against the scrip of all three matrix films first, wasn't that hard to get, however if it isn't in there I'll just brute force everything including gibberish which may dent my 5tb ssd's storage but totally worth it to show these wings off to people who don't know it
     
  10. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    It's the same name, here's a stack overflow page implementing algorithms that can work for this
    code challenge - Un-hash the Java Hash - Programming Puzzles & Code Golf Stack Exchange
    And you're right, i have no life, i can google everything ;)[DOUBLEPOST=1462225809,1462222901][/DOUBLEPOST]Update: old hash doesn't seem to be 19 characters, so you have to bruteforce using the new one, someone can use a dictionary attack to sift through the old brute force to see what it used to be ;)
     
  11. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Told you it wouldn't be, also instead of the whole dictionary I'm running it against the scrip for the matrix films first as it is a reference and 19 characters long, the only two hints vazkii has given[DOUBLEPOST=1462226926][/DOUBLEPOST]Also the google-fu is strong with you chugga, took you less than a day to find out what took me 3 days
     
  12. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    i have really fast fingers and am really good at typing optimized keywords into google :D
     
  13. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    My pc just sent me an alert that it's done cracking against the scripts, I'm at school atm, so I'll remotely tell it to start cracking against the dictionary incase it didn't get an output
     
  14. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Beiträge:
    5.861
    Zustimmungen:
    730
    Ortszeit:
    23:42
    msg me the results later, or put a codedump on pastebin ;) supposedly it's a reference to neo
     
  15. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    My remote app only allows me to save outputs and start new cracks, not SEE the outputs, that required a $10 payment, screw that[DOUBLEPOST=1462227950][/DOUBLEPOST]Also chugga you just want to show off these wings to people on the server who can't obtain them don't you sneaky[DOUBLEPOST=1462228060][/DOUBLEPOST]Just realised something, if I post the name here, it would be the only place on the entire Internet people could get it from withought doing it themselves :D
     
  16. profrags

    profrags Well-Known Member

    Beiträge:
    542
    Zustimmungen:
    155
    Ortszeit:
    20:42
    So message it to certain people only :3?
     
  17. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Atm it's you and chugga Cuz only you 2 replied
     
  18. julio1237878

    julio1237878 Game enthusiastic

    Beiträge:
    1.024
    Zustimmungen:
    144
    Ortszeit:
    20:42
    Secret holders :p you sir are evil
     
  19. alfiealfie

    alfiealfie Well-Known Member

    Beiträge:
    465
    Zustimmungen:
    98
    Ortszeit:
    15:42
    Indeed:pompous:
     
    profrags gefällt das.
  20. julio1237878

    julio1237878 Game enthusiastic

    Beiträge:
    1.024
    Zustimmungen:
    144
    Ortszeit:
    20:42
    But like they say Finders Keepers
     

Diese Seite empfehlen