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

ukee

Well-Known Member
OP
Member
Joined
Nov 23, 2015
Messages
236
Trophies
0
XP
665
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, , Reason: Added a simple save editor

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,645
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,

ukee

Well-Known Member
OP
Member
Joined
Nov 23, 2015
Messages
236
Trophies
0
XP
665
Country
Malaysia
OK, but what do we change in hxd?
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.

7oz7k4l.png


The same goes for the TP Medal.
 

Kotomine Kirei

Well-Known Member
Member
Joined
May 21, 2015
Messages
330
Trophies
0
XP
422
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,
  • Like
Reactions: ukee

omega7

Well-Known Member
Member
Joined
Jun 16, 2018
Messages
106
Trophies
0
Age
27
XP
565
Country
Australia
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.

7oz7k4l.png


The same goes for the TP Medal.
Im new to hex editing, can you elaborate on what offset 0x29-0X2D is?
 

Kotomine Kirei

Well-Known Member
Member
Joined
May 21, 2015
Messages
330
Trophies
0
XP
422
Country
United States
Im new to hex editing, can you elaborate on what offset 0x29-0X2D is?

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.
 
  • Like
Reactions: omega7

omega7

Well-Known Member
Member
Joined
Jun 16, 2018
Messages
106
Trophies
0
Age
27
XP
565
Country
Australia
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.
Thanks, exactly what i was looking for
 
  • Like
Reactions: Kotomine Kirei

supermariorick

Well-Known Member
Member
Joined
Jun 18, 2010
Messages
640
Trophies
1
XP
816
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,

NSW-Shadow

Active Member
Newcomer
Joined
Aug 3, 2018
Messages
32
Trophies
0
Age
36
XP
201
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.
 

ukee

Well-Known Member
OP
Member
Joined
Nov 23, 2015
Messages
236
Trophies
0
XP
665
Country
Malaysia
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.
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.
 

Ra1d

Well-Known Member
Member
Joined
Jul 31, 2010
Messages
1,362
Trophies
1
Website
Visit site
XP
2,153
Country
Canada
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.

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.
 
  • Like
Reactions: ukee

NSW-Shadow

Active Member
Newcomer
Joined
Aug 3, 2018
Messages
32
Trophies
0
Age
36
XP
201
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?

--------------------- MERGED ---------------------------

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
 

supermariorick

Well-Known Member
Member
Joined
Jun 18, 2010
Messages
640
Trophies
1
XP
816
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.
 

NSW-Shadow

Active Member
Newcomer
Joined
Aug 3, 2018
Messages
32
Trophies
0
Age
36
XP
201
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
Did you manage to edit to unlock all characters in Xenoverse 2?
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
 

JeepX87

Well-Known Member
Member
Joined
Aug 17, 2016
Messages
1,705
Trophies
0
Age
36
XP
3,186
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

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.
 

NSW-Shadow

Active Member
Newcomer
Joined
Aug 3, 2018
Messages
32
Trophies
0
Age
36
XP
201
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.
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Sorry for accidentally bending over