[Release] Villain3ds - Basically freeShop but runs on your PC

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by tranxuanthang, Oct 30, 2017.

  1. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    Hi @tranxuanthang! I've got a quick question regarding the cia files that villain3ds installs. I've tried downloading PKMN Ultra USUM and have managed to download the file off villain3ds. However, when I try downloading the cia file, it always ends up in a failure to install with the following information:

    Name: Pokemon Ultra Sun ALL (00040000001b5000).cia
    Attributes: none
    Size 2.29GiB
    Title ID: 00040000001B5000
    Version: 0 (0.0.0)
    Installed size: 3.44GiB

    Error
    Failed to install CIA file
    Result code: 0xD8A08012
    Level: Permanent (27)
    Summary: Invalid State (5)
    Module: AM (32)
    Desc: <unknown> (18)

    Any idea what I'm doing wrong?
     
  2. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    The CIA is corrupted. Either your SD is failing or it didn't transfer properly.
     
    tranxuanthang likes this.
  3. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    You used the built-in download to download this right? (the 'download anyway' choice).
    Could you do a hash check of that cia file? In windows you can use this freeware http://www.winmd5.com/
     
    Last edited by tranxuanthang, Nov 19, 2017
  4. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    Yup! I used the download anyway function.
    Here's the checksum value (?) of the file: 71df26fae8e132f600080a2538263fd1
    (Does that make sense? Not sure if I'm looking for the right thing)
     
    tranxuanthang likes this.
  5. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    It's definitely corrupted then.
    Also, the size should be 3.7 GB, not 2.29 GB.
    @tranxuanthang, it's probably a better idea to get the SHA sum rather than the MD5 as it's much more consistent than MD5. Here's the SHA digest for Ultra Sun for reference.
     
    Last edited by Joom, Nov 19, 2017
    tranxuanthang likes this.
  6. Dasfilth

    Dasfilth Member

    Newcomer
    12
    6
    Nov 20, 2016
    United States
    Can/will you add functionality to have it convert/output to .3ds file format? Be very cool to play the titles I already own using Citra, too. Last I checked it doesn't support .cia files. :/
     
  7. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    So whats steps should I do to download it now?
     
  8. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    I'm trying to download ultra sun right now to compare the checksum to yours and @Joom's so hold on.
    And if you have a good internet speed, and you have no problem downloading it again, you can help me by downloading this title a few times, then run checksum and compare with your first checksum. I have just uploaded version 0.1.0-alpha.0 (here: https://drive.google.com/open?id=0B9X-MK30m7IKYmprS2VPM2JJUU0) so you can try downloading with it too. It have a better built-in downloader than previous versions.

    — Posts automatically merged - Please don't double post! —

    I know there are some apps calculate all the checksum types out there, but I'm not sure if it's safe (no 'pro' version, no bloatware, adware download) to link here or not :rofl:
     
    Luteus likes this.
  9. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    Sooo this is the checksum for the second download attempt! @tranxuanthang

    e106eba4e8ef492ed915cfcd6c5028ff
     
    tranxuanthang likes this.
  10. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    That's.. weird, it's not even match your first download and @Joom's. What is that cia's size, is this 3,7GB? I'm almost finished downloading this and will tell my file's checksum soon.

    Update: I think I have the same hash as @Joom:
    Code:
    [tranthang@thang-manjaro-linux cias]$ md5sum "Pokémon™ Ultra Sun ALL (00040000001b5000).cia"
    3d01a4284b0d8fddb8ae4453b059590f  Pokémon™ Ultra Sun ALL (00040000001b5000).cia
    [tranthang@thang-manjaro-linux cias]$ sha1sum "Pokémon™ Ultra Sun ALL (00040000001b5000).cia"
    0de1138a4be558560913f0a7b1d37c7dc316ce40  Pokémon™ Ultra Sun ALL (00040000001b5000).cia
    Can MD5 checksum really be different even if the files is extractly the same?
    Also I found this GUI software for calculating many hash types including sha1 for windows, because not everyone is familiar with command line.
    https://raylin.wordpress.com/downloads/md5-sha-1-checksum-utility/
     
    Last edited by tranxuanthang, Nov 19, 2017
  11. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Like I said, MD5 is inconsistent. The SHA sum should be the same every time, and there are command line tools available for every OS.
    https://support.microsoft.com/en-us...or-sha-1-cryptographic-hash-values-for-a-file
    https://www.microsoft.com/en-us/download/details.aspx?id=11533

    MD5 takes metadata and other variables into effect (modification and creation dates, file system language, etc.), so digests are fairly random. SHA is purely about file integrity, and should be consistent every time. For example, if I were to change the file name of the Ultra Sun CIA, the MD5 would be different but the SHA would be the same.
     
    Last edited by Joom, Nov 19, 2017
  12. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    In this case the file's MD5 and SHA1 is still the same as yours, but maybe we should use SHA1 for checking file integrity from now on.
    Now can you: Go to [basedir]/raw/00040000001b5000/ and check the SHA1 hash of all the files in there (tmd, cetk, 00000000, 00000001)?
    It's like, your make_cdn_cia process had been terminated before it finished creating the cia file.
     
    Last edited by tranxuanthang, Nov 19, 2017
  13. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Your sums matched mine? Hmm. I wonder if this guy's router disconnects multiple connections thinking it's a SYN/ACK flood. A lot of routers do this, and it's a common problem with those that download torrents, for example, because the router's own security causes it to kill downloads, and in more severe scenarios (like mine) the entire router kills itself due to the multiple concurrent connections.
     
    Last edited by Joom, Nov 19, 2017
  14. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    possibly because I live on a university campus thus I'm using university internet xD
     
  15. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Bummer. University networks are notorious for this kind of stuff. I wonder if you set up a VPN locally, and then connected to it, would the university be able to tell? (They would.) Their network is probably poorly configured and lumps all concurrent connections in with "LOL BITTORRENT". These kinds of configurations cause problems with Steam, too.
     
    Last edited by Joom, Nov 19, 2017
  16. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    I've heard in some country you could be arrested if downloading any inappropriate contents using university's wifi so be careful xD
     
  17. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    Hahaha I should be fine~ Don't worry!

    In regards to this, How do you want me to check it?
     
  18. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    It doesn't matter how you check it if your university's network is messing with the download. The resulting sum will always be different because your download is corrupted by the network you're using. Honestly, you'd probably be better off getting the game with freeShop since it downloads titles from a single connection.
     
  19. tranxuanthang
    OP

    tranxuanthang GBAtemp Regular

    Member
    210
    163
    Jul 6, 2015
    Ok, there are (at least) 4 files required for the make_cdn_cia to create the cia file. And my app's work flow is like this:
    1. Download the 'tmd' file from cdn.
    2. Use some part of 'tmd' file to create the ticket file 'cetk'.
    3. Find the 'content count' aka the number of contents the app need to download, and the cID of those contents (usually 00000000 and 00000001). The number of 'content count' is usually 2.
    4. It downloads those contents, and saves as '00000000' and '00000001' files at disk.
    5. Now there are 4 files in raw folder: tmd, cetk, 00000000 and 00000001. The make_cdn_cia is executed, and output a cia file.

    So I want to find which files are corrupted the last time you create that Ultra Sun cia. It might be 'tmd', or '00000001' file, I don't know, or it could be make_cdn_cia's fault and not your university wifi's.

    So you'll need to check the file hashes all of them (4 files), instead of just .cia file like before. I wish I have time to explain more, but I'm not at home right now (using my phone to write this), so give it a try.

    — Posts automatically merged - Please don't double post! —

    The app downloads every content files at the same time but any version <0.0.7 actually downloads just one thread for each content files (1 of 2 content files is very small and should be already finished by the time we click 'download anyway' button of second content files). I know university's wifi sucks (mine even requires proxy to connect to the internet) but just to be sure.
     
  20. Luteus

    Luteus Newbie

    Newcomer
    8
    2
    Nov 19, 2017
    Singapore
    HAHAHA so after trying and download the file again, Villain3DS crashed xD So it'll be awhile~