Why exactly is MakeKeyBin.exe legal?

Discussion in 'Wii - Hacking' started by Mr. Mysterio, May 2, 2015.

  1. Mr. Mysterio
    OP

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    Why is it legal to distribute MakeBeyBin.exe, but not the Wii common key? I'm thinking about making a similar program for the Wii U, and I want to know exactly how MakeKeyBin.exe does not violate Nintendo's copyright. I get the general idea that it doesn't actually contain the key, but it runs some math formula involving the number "42" to generate it. If that IS the reason it's legal, then wouldn't an AES encrypted 7z file with a password of 42 work the same way?​
     
    Margen67 likes this.
  2. bobmcjr

    bobmcjr GBAtemp Advanced Fan

    Member
    894
    334
    Apr 26, 2013
    United States
    Why is any sequence of data legal when it can be XOR'd with something to produce copyrighted numbers?
     
  3. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,710
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    An encrypted 7z file with the key inside is illegal as it's still sharing it (just in a password protected archive).

    Creating a Fibonacci function program which happen to produce an existing copyrighted string is fine, Fibonacci itself is not illegal to share. you don't control what users enter as input number to that function.
    sharing a simple +-xxxxx to the key would be questionable... don't do that, thanks.
     
    Margen67 and Mr. Mysterio like this.
  4. Mr. Mysterio
    OP

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    Thanks. Would you happen to know of a good article that describes that Fibonacci function and how I can use it to create an arbitrary number? (I would find it myself, but I don't know what to search for.)

    If someone here still has the source code for MakeKeyBin.exe, I also would love to look at that!
     
  5. Oxybelis

    Oxybelis GBAtemp Fan

    Member
    348
    74
    Jan 10, 2010
    Fibonacci function can not make any arbitrary number by itself. But with some other arithmetic manipulations can.

    Making up arbitrary number could be done with a lot of functions and some const numbers.
    Even rand()
     
    Margen67 likes this.
  6. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,710
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    fibonacci was just the first name I thought. it's just an example to say that using an existing/known algorithm could generate data matching something else by only providing a specific input. the function by itself is not illegal.
    The way your function generates the output could be illegal (if 124568 was illegal, sharing 124526 and telling using to add 42 is questionable. I will not to start discussing legality on this sharing method)
     
  7. Mr. Mysterio
    OP

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    What about a program that contains SHA1 hashes of each byte in the key, then runs rand() for each byte until it gets one that matches the hash for that byte. It would not contain the key, only hashes. Do you think that would be legal?

    To clarify, this is what I mean:
    Code:
     
    byte[] generatekey() {
        byte[][] hashes = {{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}, {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx});
       
        byte[] key = new byte[16];
        byte tmp;
       
        for (int c = 0; c < 16; c++) {
            tmp = 0;
            while (calchash(tmp) != hashes[c])
                tmp = getrandombyte();
            key[c] = tmp;
        }
       
        return key;
    }
     
    
     
  8. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,710
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    To my opinion it's still not good, as it's used to only generate the key, it has no other purpose and will not generate anything else.
    hashes of single bytes is also too obvious to find. having a list of 256 hashes and comparing them manually would be even faster than launching your program using rand(), it's like providing the key in clear.
     
  9. nastys

    nastys ナースティス

    Member
    1,466
    858
    Aug 5, 2014
    Italy
    Earth
    I experimented a bit with makekeybin and found out that it just converts a hardcoded number from hex to dec, adds 42 to each byte and converts it back to hex, but I'm not 100% sure...
     
    Mr. Mysterio likes this.
  10. Mr. Mysterio
    OP

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    I'm poking around it with a disassembler right now actually!
     
    nastys likes this.
  11. nastys

    nastys ナースティス

    Member
    1,466
    858
    Aug 5, 2014
    Italy
    Earth
    Let me know what you find out. We could make a KeyX generator for the 3DS :lol:
     
    Mr. Mysterio likes this.
  12. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,468
    4,779
    Mar 17, 2010
    Norway
    Alola
    makekeybin is just as illegal as anything else IMO, it may not contain the exact data but it contains a method to get it, it's like putting the key inside a zip/rar archive, it's not the exact same data but it's easy to get. It still contains copyrighted data just not the method to retrieve it.
    The only difference is that you have to specify the answer to life, the universe and everything but the answer is mentioned in literally ever post that mentions it.
     
    Margen67 likes this.
  13. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,204
    8,970
    Nov 21, 2005
  14. Mr. Mysterio
    OP

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    OK, I've figured out the algorithm that MakeKeyBin uses:

    Code:
    byte input_42 = 42; // The number 42 that the user input.
    byte num = xx;
    byte data[] = {xx, xx, xx, xx, xx, num, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, num, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx}
    byte common_key[16]; // key.bin
    byte korean_common_key[16]; // kkey.bin
     
    common_key[0] = data[0] ^ input_42;
     
    for (int c = 1; c < 16; c++) {
        common_key[c] = data[c] ^ common_key[c-1];
    }
     
    korean_common_key[0] = common_key[15] ^ data[16];
     
    for (int c = 1; c < 16; c++) {
        korean_common_key[c] = data[c+16] ^ korean_common_key[c-1];
    }
    
    (I replaced the key with "xx"es.)

    I think MakeKeyBin.exe is actually not legal. :unsure:
     
    VinsCool, Margen67 and nastys like this.
  15. nastys

    nastys ナースティス

    Member
    1,466
    858
    Aug 5, 2014
    Italy
    Earth
    Why not?
    As long as it can generate different keys depending on the user input and doesn't have the key hardcoded, it is legal, right?
    According to your reverse-engineered algorithm, the program only contains the key XORred by 42 (which, BTW, is not the key itself) , but it doesn't mean the output will be the key, because that depends on the user input.
    For example, if I made a program that generates a LEGAL key by entering 30, but a user enters 42, therefore generating an illegal key (which the program was not intended for), would it still be illegal?

    EDIT: by the way, I just finished making a 3DS 7.x KeyX generator, but I don't know if I can release it here...
     
  16. vladik4kides

    vladik4kides Advanced Member

    Newcomer
    56
    3
    Sep 27, 2015
    Well, if it's illegal or not I still need title keys generator..