RELEASE xv2savdec - Tool to decrypt/encrypt Dragon Ball Xenoverse 2 Switch save files

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by ukee, Nov 14, 2018.

  1. ukee
    OP

    ukee GBAtemp Regular

    Member
    2
    Nov 23, 2015
    Malaysia
    This is a tool to decrypt and re-encrypt your DBXV2 save file (savefile1.dat).
    The decrypted save file cannot be opened with save editors that are meant for PC/XBone/PS4 versions. I have made a simple one through the link down below.
    Warning: This tool was only tested on DBXV2 ver. 1.10.02, I am unsure if it will work with lower versions.
    As always, make backups of your save before trying this tool.

    Instructions:
    • Drag a .dat file into the program, and it will create a ".sav.dec" file with the decrypted content.
    • Drag a .sav.dec, and it will create an encrypted "_enc.dat" file.
    Download here (and also source):

    Github: https://github.com/mineminemine/xv2savdec_switch/releases/latest

    Download my simple save editor here:

    Github: https://github.com/mineminemine/DBXV2-NS-Save-Editor/releases/latest

    Credits:
    • Eternity - Huge thanks goes to Eternity for his/her initial work on a DBXV2 save file decryptor/encryptor (xv2savdec) for PS4/XBone/PC
    • @Falo - For converting the xv2savdec for the Switch, he/she converted the decryption function while I only converted the encryption function from his/her work
    Falo was also the one who found out that the Switch version does not contain an MD5 header which made things much simpler.
     
    Last edited by ukee, Nov 23, 2018 - Reason: Added a simple save editor
  2. Karatox

    Karatox Newbie

    Newcomer
    1
    Nov 15, 2018
    France
    Hello,
    How do I modify the backup after the conversion?
     
  3. ukee
    OP

    ukee GBAtemp Regular

    Member
    2
    Nov 23, 2015
    Malaysia
    Use a hex editor like HxD to edit your decrypted save file.
     
  4. Karatox

    Karatox Newbie

    Newcomer
    1
    Nov 15, 2018
    France
    OK, but what do we change in hxd?
     
  5. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    21
    Oct 27, 2002
    France
    Engine room, learning
    change what you want.
    if there's no editor yet, you'll have to compare different saves to know where each values are stored.
    or wait for someone else to do that, and someone else (or same user) to create a save editor tool.
    it's even possible the (future) save editor will include automatic encrypt/decrypt steps thanks to this tool.

    for now, there's only the decryption part, more work or tools are needed for value edition without hexeditor.

    until then, you have some "tips" in the first post :
    0x24-0x28 - Zeni
    0x29-0X2D - TP Medal

    which means go to address 0x24 to edit Zeni amount.
     
    Last edited by Cyan, Nov 15, 2018
  6. ukee
    OP

    ukee GBAtemp Regular

    Member
    2
    Nov 23, 2015
    Malaysia
    Like what Cyan said, you'll need a hex editor to edit the file.

    Offsets:
    0x24-0x28 - Zeni
    0x29-0X2D - TP Medal

    Example:
    You want 999,999 Zeni, convert the 999,999 to hexadecimal notation (‭00-0F-42-3F‬) then reverse it (3F-42-0F-00) and put them in the 0x24-0x28 offsets.

    [​IMG]

    The same goes for the TP Medal.
     
  7. Kotomine Kirei

    Kotomine Kirei GBAtemp Regular

    Member
    2
    May 21, 2015
    United States
    Thank you for the save tool.

    Here are some save addresses found on 1.10.00, and some explanations about the formats that the items are in.
    I am not sure if they are correct or not, or if they are different depending on the save or version.
    So, it is a good idea to make a copy of saves before changing anything.

    Equipment and Item Format
    Equipment
    Items
    QQ Bangs
    Unknown
     
    Last edited by Kotomine Kirei, Dec 6, 2018
    ukee likes this.
  8. omega7

    omega7 Member

    Newcomer
    2
    Jun 16, 2018
    Australia
    Im new to hex editing, can you elaborate on what offset 0x29-0X2D is?
     
  9. Kotomine Kirei

    Kotomine Kirei GBAtemp Regular

    Member
    2
    May 21, 2015
    United States
    I am not sure what you are asking, but you can see if this helps:

    Offsets and other things
     
    omega7 likes this.
  10. omega7

    omega7 Member

    Newcomer
    2
    Jun 16, 2018
    Australia
    Thanks, exactly what i was looking for
     
    Kotomine Kirei likes this.
  11. supermariorick

    supermariorick GBAtemp Advanced Fan

    Member
    4
    Jun 18, 2010
    United States
    The awakening skills block is definitely at 0x15428
    That is confirmed the awakening skills by cross referencing with the IDs from the PC version save editor, converting them to hexadecimal, reversing the bytes, and searching the values in the decrypted save file in a hex editor. There is no mistaking it because there are no other matching results for each search of the ID. You can unlock all the awakening transformations by setting the beginning of each slot of data to 01 which the save editor does for only the super skills. More blocks are added with each update + DLC activated. 0xF428 is the beginning of the evasive skills block. Found and confirmed with the same logic about the transformation awakening skills. More to come.

    EDIT

    here is a compilation of Dragon Ball Xenoverse 2 save editing research so far with credit to everybody who helped with it
    https://cdn.discordapp.com/attachme...26053518784593930/XV2_Switch_Save_offsets.txt

    if you know how to do hex editing, you can do all of this easily
    even better theres an extra bonus in there
    an experimental method of "conversion" to the PC version save file (thanks to oODemonBoyOo from xenoversemods) so the tools that already exist for the PC version on xenoversemods can be used to edit your save file then you can convert it back to the Switch version!

    As always, be sure to keep backups in case something goes wrong and your save gets wiped due to save corruption.
     
    Last edited by supermariorick, Dec 22, 2018
    ukee, Kotomine Kirei and omega7 like this.
  12. NSW-Shadow

    NSW-Shadow Member

    Newcomer
    1
    Aug 3, 2018
    United States
    can anyone confirm if the experimental conversion of a switch save to pc actually worked for them? I've been fiddling around with it (it's like 3 steps, so I really doubt I can mess up on it anymore) and have been unable to even get the lazybones switch XV2 save editor to even recognize my save. I get an error about failing to parse time.
     
  13. ukee
    OP

    ukee GBAtemp Regular

    Member
    2
    Nov 23, 2015
    Malaysia
    What experimental conversion? If you're trying to use save files from the PC version on your Switch, it won't work, they have different save file structures.
    As mentioned in my first post, any save editors for the PC version will not work with the Switch version due to the same reason I mentioned earlier, they have different file structures.
     
  14. Ra1d

    Ra1d GBAtemp Maniac

    Member
    7
    Jul 31, 2010
    Canada
    If you refer to the text file mentioning "converting" the file to the pc version save file, there's a reason it's in quotations, you're not literally converting the file to make it compatible with pc XV2 or vice versa, it's only for save editing purposes.
     
    ukee likes this.
  15. NSW-Shadow

    NSW-Shadow Member

    Newcomer
    1
    Aug 3, 2018
    United States
    I was talking about the text file, but I was talking about taking a Switch XV2 save, decrypting it, hex editing the things that the text file says, and then using the lazybones pc save editor (supermariorick said doing what was in the text file should make that work), converting the edited stuff back via text file instructions, and loading the save on Switch again. Sorry if that was unclear but has anyone tried that experimental conversion and has had success with their save being readable on the save editor?

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

    I'm not trying to play it on PC, I'm doing the save editing garbage only but I can't make my save be read due to afforementioned issue about fail to parse time
     
  16. JeepX87

    JeepX87 GBAtemp Fan

    Member
    4
    Aug 17, 2016
    United States
    Did you manage to edit to unlock all characters in Xenoverse 2?
     
  17. supermariorick

    supermariorick GBAtemp Advanced Fan

    Member
    4
    Jun 18, 2010
    United States
    The experimental "conversion" involves taking header information from a decrypted Switch version save, swapping it with the header information from a decrypted PC version save temporarily, adding a few bytes after the header and at the bottom from the PC version save so not only are most of the data shifted to match the decrypted PC version save, but also the save is changed to match the filesize of the PC version temporarily. These temporary changes are so you can then open the decrypted savefile with lazybones's Xenoverse 2 PC version save editor and edit things that haven't been found quite yet for the Switch version offsets. Granted, things are still shifted differently even with 8 bytes being added to the file so not everything can be changed properly. However, using this method results in more editing than what he have from the known Switch version offsets. Then you simply save the changes to the save data and then revert the experimental changes by removing the extra bytes and changing the header back to the Switch version. I didn't realize it at first, but I forgot one extra step and that being that each Switch version save has their own personal header and you need to copy that first line and save it somewhere in order for it to work properly. Then when reverting it back to Switch version save format you copy it back and remove the extra bytes so the re-encryptor recognizes it. I highly recommend making a backup of the save before doing any editing or trying any of this. I know for sure trying to edit mentor customizations won't work because the data is shifted and I don't know exactly how. I did manage to unlock everything including all the quests though and even recovered data from an old borked save file and imported the characters to the new save file. Can't exactly guarantee everyone can get this method working and I had help doing it anyway. However, if you can pull it off the results are great. I even set presets with unobtainable boss skills beyond the crystal raid boss skills.
     
  18. NSW-Shadow

    NSW-Shadow Member

    Newcomer
    1
    Aug 3, 2018
    United States
    It'd mean a lot to me if someone could honestly try the conversion because I'm sus about some sort of thing I'm missing
    there's actually a character unlock nsp (used to be on eShop for free), I can't find it due to my favorite stash being down, but I'll get you copy when I can
     
  19. JeepX87

    JeepX87 GBAtemp Fan

    Member
    4
    Aug 17, 2016
    United States
    Yes, I noticed that eShop used to offer free DLC to unlock all characters and it was removed after 1 month.

    I'm not sure about safe to install free DLC NSP without getting banned.

    That why I ask for save with all characters unlocked.
     
  20. NSW-Shadow

    NSW-Shadow Member

    Newcomer
    1
    Aug 3, 2018
    United States
    Assuming you're running CFW or HB, I'd take it to have the same general risk. I at least wasn't banned for using it in the past until I got a shit ton of errors on HB and was then banned so uh, this is up to you, really. DM me if you want the NSP tho, I found it
     
    JeepX87 likes this.
Loading...