1. ukee

    OP ukee GBAtemp Regular
    Member

    Joined:
    Nov 23, 2015
    Messages:
    236
    Country:
    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

    Joined:
    Nov 15, 2018
    Messages:
    2
    Country:
    France
    Hello,
    How do I modify the backup after the conversion?
     
  3. ukee

    OP ukee GBAtemp Regular
    Member

    Joined:
    Nov 23, 2015
    Messages:
    236
    Country:
    Malaysia
    Use a hex editor like HxD to edit your decrypted save file.
     
  4. Karatox

    Karatox Newbie
    Newcomer

    Joined:
    Nov 15, 2018
    Messages:
    2
    Country:
    France
    OK, but what do we change in hxd?
     
  5. Cyan

    Cyan GBATemp's lurking knight
    Former Staff

    Joined:
    Oct 27, 2002
    Messages:
    23,228
    Country:
    France
    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

    Joined:
    Nov 23, 2015
    Messages:
    236
    Country:
    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 Fan
    Member

    Joined:
    May 21, 2015
    Messages:
    313
    Country:
    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.

    "WW WW 00 00 XX YY ZZ 00"
    (WW - ID)
    (00 - Nothing)
    (XX - Category)
    (YY - Amount)
    (ZZ - Equipped)
    (00 - Nothing)

    For example:
    "07 01 00 00 03 14 00 00"

    07 01 - ("0107" = ID "263")
    03 - (Category "03" "Feet"?)
    14 - (Amount "20")
    00 - (Equipped "0")

    I am not sure how equip numbers work beyond "00".
    A "01" might mean the character in save slot 1.

    There are "FF FF FF FF FF 00 00"s below the existing items.
    These should be overwritten with new items.

    IDs start from "00 00" and might go up to "50 01" (337), but looking in-game, I see less items despite that number, which might mean that there are some that are not used.
    I am not sure if adding IDs that are not used will have any adverse effects on the game and saves or not.

    Also, it might take a while to write all of the items, since there are about 1,144 items, as far as I can tell, and if you added equipment going from "00 00" to "50 01" and then items, that would probably mean writing 1,788+ entries.
    Upper Body? - 1408
    Category: 00?
    Total: 252+?

    Lower Body? - 2408
    Category: 01?
    Total: 252+?

    Hands? - 3408
    Category: 02?
    Total: 152+?

    Feet? - 4408
    Category: 03?
    Total: 244+?

    Accessories? - 5408
    Category: 04?
    Total: 136+?
    Food? - 6408
    Category: 05?
    Total: 19+?

    Mixing Items? - 7408
    Category: 06?
    Total: 32+?

    Important Items - 8408
    Category: 07
    Total: ?
    Dragon Balls: 01, 02, 03, 04, 05, 06, 07
    Distorted Time Eggs: 08, 09, 0A, 0B, 0C

    Capsules? - 9408
    Category: 08?
    Total: 37+?

    Gifts - ?
    Category: ?
    Total: 8+?

    They might be in the same area as Capsules are.
    QQ Bangs - A408
    Category: 09
    Total: ?

    The format for QQ Bangs: WW WW WW 00 XX YY ZZ 00
    (W - Attribute Levels)
    (00 - Nothing)
    (XX - Category)
    (YY - Amount)
    (ZZ - Equipped)
    (00 - Nothing)

    I am guessing that attribute levels go from "0" to "A".
    (0) = (-5)
    (1) = (-4)
    (2) = (-3)
    (3) = (-2)
    (4) = (-1)
    (5) = (0)
    (6) = (+1)
    (7) = (+2)
    (8) = (+3)
    (9) = (+4)
    (A) = (+5)

    For example, "A0 3A 76 00 09 01 00 00" might be:
    A - (Health +5)
    0 - (Ki -5)
    3 - (Stamina -2)
    A - (Basic ATK +5)
    7 - (Strike Supers +2)
    6 - (Ki Blast Supers +1)
    09 - (Category "09")
    01 - (Amount "1")
    The first two might be Super Souls and Skills.

    ? - B248
    ? - D428
    ? - F248
    ? - 13428
    ? - 15428
    ? - 17428
     
    Last edited by Kotomine Kirei, Dec 6, 2018
    ukee likes this.
  8. omega7

    omega7 GBAtemp Regular
    Member

    Joined:
    Jun 16, 2018
    Messages:
    104
    Country:
    Australia
    Im new to hex editing, can you elaborate on what offset 0x29-0X2D is?
     
  9. Kotomine Kirei

    Kotomine Kirei GBAtemp Fan
    Member

    Joined:
    May 21, 2015
    Messages:
    313
    Country:
    United States
    I am not sure what you are asking, but you can see if this helps:

    If I am correct, the offset is the distance from a specified starting point.
    In this case, the beginning of a save file.

    In a hex editor, you have:
    Rows with "00000000", "00000010", "00000020", etc. on the left, and columns with "00"-"0F" to the right.
    The hex editor "HxD" shows the column numbers above each column.

    Offsets "29"-"2D" would be:
    At row "00000020", in columns "09"-"0D".

    Also, you might want to read this.
    The byte order of a file is sometimes reversed from what you might expect.
    So new values need to be reversed before replacing the old values.

    For example, say that a file uses a reversed byte order, and you want to find the hex value "176BB" (95,931 in decimal).
    You need to take "176BB" and:
    1. Even it by adding a "0" in front of it ("0176BB").
    2. Separate it ("01 76 BB").
    3. Reverse it ("BB 76 01" or "BB7601").

    After you find the value that you are looking for, you need to do the same thing with the new value that you want to replace it with.
    So, if you find "BB 76 01 00 00" for example, and you want to make it "5F5E0FF" (99,999,999 in decimal), you need to:
    1. Even it ("05F5E0FF").
    2. Separate it ("05 F5 E0 FF").
    3. Reverse it ("FF E0 F5 05" or "FFE0F505").
    4. Replace the old value with it ("FF E0 F5 05 00").

    Also, keep in mind that if you copy and paste the new values usually you will want to overwrite the old values with the new ones and not insert the new values, as inserting them will cause the file size to increase, which might cause problems with it.
     
    omega7 likes this.
  10. omega7

    omega7 GBAtemp Regular
    Member

    Joined:
    Jun 16, 2018
    Messages:
    104
    Country:
    Australia
    Thanks, exactly what i was looking for
     
    Kotomine Kirei likes this.
  11. supermariorick

    supermariorick GBAtemp Advanced Fan
    Member

    Joined:
    Jun 18, 2010
    Messages:
    640
    Country:
    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
  12. NSW-Shadow

    NSW-Shadow Member
    Newcomer

    Joined:
    Aug 3, 2018
    Messages:
    32
    Country:
    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

    Joined:
    Nov 23, 2015
    Messages:
    236
    Country:
    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

    Joined:
    Jul 31, 2010
    Messages:
    1,361
    Country:
    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

    Joined:
    Aug 3, 2018
    Messages:
    32
    Country:
    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 Advanced Fan
    Member

    Joined:
    Aug 17, 2016
    Messages:
    748
    Country:
    United States
    Did you manage to edit to unlock all characters in Xenoverse 2?
     
  17. supermariorick

    supermariorick GBAtemp Advanced Fan
    Member

    Joined:
    Jun 18, 2010
    Messages:
    640
    Country:
    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

    Joined:
    Aug 3, 2018
    Messages:
    32
    Country:
    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 Advanced Fan
    Member

    Joined:
    Aug 17, 2016
    Messages:
    748
    Country:
    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

    Joined:
    Aug 3, 2018
    Messages:
    32
    Country:
    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.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - xv2savdec, Xenoverse, decrypt