View Full Version : [WIP] Borderlands 2 Compression Toolkit
fairchild
10-11-2012, 12:07 PM
Yet again a compression toolkit, this time for Borderlands 2...
I would like to first say a big thank you to Mojobojo for making the initial
research and utils. Without him i wouldn't have come this far. Thanks!
This is not an Savegame Editor, that will be taken care of by the team behind
WillowTree 2.
NOTE: This is a WIP release, compression is barely supported now..
Update:
0.2.0b * Added compression support (probably buggy as hell).
0.2.1b * Bug fixes. (Thanks Idlehands for pointing these out.)
▄
▄ ▄▄▄▄▄▄▄ ▄ █▀▀▀▀ ▀▀ ▀ ▄▄▄▄▄▄▄▄ ▀▄▄▄▄ ▄
▄▄▄▄▄▄ ▀ ▄▄▄▄▄▄█▀▀▀▀▀█ ▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀█ █▀▀▀▀▀▀ ▄▄▄▄ █▄▄▄▄▄▄▄▄
▄▄█▀▀ ▄▄ ▀█▀▀▀ ▄▄ ▀▀ ▀▀▀ █▀▀ ▄▄ ▀▀█▄ ▀ █▀ ███▀̦ █ ▀▀▀▀ ████ ▄██ ▄▄▄▄ ▀█
▀ ▀▀ ▄▄██▀█▓▄ ▄▄██▀█▓▓▄ ███ ▄▄██▀██▓▄ █▀▀▀▀█ ███¦ █▄▄¦Ì███¦Ì███¦Ì███▄Ì███¦ ▄
▄▓▓██▀ ▀▀▄██▀ Ì██▓¦Ì██¦▄██▀ Ì██▓¦ ▄▄█▓▄ Ì████▄▄▄ ▓███ ████ █ ▄▄▄▄███▓
Ì▓██¦ ░ Ì▓██¦ ▀▀████ ███ ▓█¦ ▄███▀▄███▀ ▓███ ▀██▓▓ ██¦Ì███¦ ▄███▀ Ì██▓¦
▓███▀ █ ▓███ ░Ì███¦Ì██▓ ███ ░▀▀ Ì▓██¦ ▄¦Ì▓██¦Ì¦Ì██▓¦Ì█ ████ Ì▓██¦ ▄██▓▓▀
▀ Ì███¦Ì█¦Ì███¦ ▀▀▀▀ ▀▀ Ì███¦ ▀ ▀▓██▄██ ▀▀▀▀ ██ ███▓ Ì▓██¦ ▀▓██▄██▀▀ ▄▄ ▄
█ ▀▀▀▀ ██ ▀▀▀▀ █▀▀▀▀▀▀█▄ ▀▀▀▀ █▀█▄▄ ▀▀ ▄▄█▀▀▀▀█¦Ì███¦Ì ▀▓▓██▄░ ▀▀ ▄▄█▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▄ ▀ ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀ !f █ ▀▀▀▀ ██▄▄ ▀▀▀▀ █▀▀▀▀
▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀ p r e s e n t s . . ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀ █▀ ▀
▀ ▀▀▀▀▀ ▀ ▀
Borderlands 2 Compression Toolkit by fairchild
================================================== ===== version 0.1.0b ===
Usage: borderlands2.exe [options] <input> <output>
Options:
-d - Decompress.
-c - Compress.
Release notes:
Yet again a compression toolkit, this time for Borderlands 2...
I would like to first say a big thank you to Mojobojo for making the initial
research and utils. Without him i wouldn't have come this far. Thanks!
This is not an Savegame Editor, that will be taken care of by the team behind
WillowTree 2.
To use this toolkit you must first extract the savegame from within the
xbox 360 container (CON), then use this toolkit on the extracted file.
If you try to use this on the CON file itself it will give you a warning.
This is not a click 'n play tool, you need to use it from the Command Prompt
or any other methods that handles this tool.
WARNING!
Always backup your saves, this tool may corrupt remove your savegames.
Decompress
==========
Now to decompress a savegame you run the application by entering the following:
* <PTEF> = the path to the extracted files, ex: c:\test
<PTEF>\borderlands2.exe -d <PTEF>\<my savegame filename> <PTEF>\save.decompressed
Example: c:\test\borderlands2.exe -d c:\test\SaveGame.sav c:\test\save.decompressed
The toolkit will process the savegame and decompress it's compressed data block
to the file names "save.decompressed".
Open "save.decompressed" in your favorite hex editor :-)
Compress
========
To compress and inject the uncompressed blocks back into your savegame use the
following command:
NOTE: !! make a copy of your orginal savegame !!
* <PTEF> = the path to the extracted files, ex: c:\test
<PTEF>\borderlands2.exe -c <PTEF>\save.decompressed <PTEF>\SaveGame.sav
Example: c:\test\borderlands2.exe -c c:\test\save.decompressed c:\test\SaveGame.sav
This will take the decompressed block, named "save.decompressed" and
compress them, rebuild the package to a file named "SaveGame.sav.rebuilt".
The file to inject back into your CON file is the file ending with ".rebuilt" !
NOTE:
Always make backup of your savegames!!
Have fun :-)
TwztdKaos
10-11-2012, 12:12 PM
If it works thank for all you hard work fairchild
Visual OS
10-11-2012, 01:18 PM
When I try to decompress the file, borderlands2.exe stops working and forces me to close the program.
PUR3 RAF3X
10-11-2012, 01:26 PM
You guys found the right Huffman good work ;)
CloudStrife7x
10-11-2012, 03:43 PM
the beast strikes again, you rock broski
TheLastDude
10-11-2012, 04:01 PM
*takes off sunglasses* mother of god...
it's beautiful. now to try this out. thanks for releasing it fairchild!
Visual OS
10-11-2012, 04:10 PM
Can someone confirm this worked for them so I can figure out what I did wrong?
OGCuban
10-11-2012, 04:42 PM
This great man!! I see WillowTree 2 conning soon!
Thanks for all the hard work fairchild!
fairchild
10-11-2012, 07:52 PM
Working on rewriting the tool to make it more stable. Also there seems to be an issue (need to investigate for a workaround) when you have spaces in your pathnames. Other problems please let me know here so that i can fix them.
AllEyezOnMe
10-11-2012, 09:01 PM
Same pb with the program. thx and keep up the good work
Edit, i put the wrong pic, i made it with the SaveGame.sav extracted from my save with Horizon but it still crashes...
Bullyrider
10-11-2012, 09:08 PM
I got the same issue but did get it to work.
in the command prompt if i first navigate to the folder where borderlands2.exe is located and then just omit the directories it works.
you will also need to have the save file in the same directory as the exe
so for me i just type into cmd "cd C:\test" then "borderlands2.exe -d SaveGame.sav save.decompressed"
MadeGuy
10-11-2012, 09:17 PM
I successfully decompressed my save, but I'm having trouble finding my skill points. Trying to get rid of the flashing extras as a way to test this. Tried converting the decimal value ot hex and then searching but I can't find it. Any ideas?
Idlehands88
10-11-2012, 09:17 PM
Same pb with the program. thx and keep up the good work
The Compression tool needs to be fixed, fairchild is working on fixing it, so until then there will be Errors.
Also you aren't supposed to load the Save0008.sav file into CMD, you have to extract the SaveGame.sav File from the Save0008.sav using Horizon.
Idlehands88
10-11-2012, 09:18 PM
I successfully decompressed my save, but I'm having trouble finding my skill points. Trying to get rid of the flashing extras as a way to test this. Tried converting the decimal value ot hex and then searching but I can't find it. Any ideas?
Can you send me your Decompressed save and the value for your Skill Points?
AllEyezOnMe
10-11-2012, 09:19 PM
yep worrking this way, thx both
MadeGuy
10-11-2012, 09:20 PM
Can you send me your Decompressed save and the value for your Skill Points?
Sure hold on...
EDIT: Sent
fairchild
10-11-2012, 09:22 PM
Same pb with the program. thx and keep up the good work
Edit, i put the wrong pic, i made it with the SaveGame.sav extracted from my save with Horizon but it still crashes...
This looks like a PC version of the savegame (correct me if im wrong). Only Xbox360 is supported currently, but... i will now try to detect PC saves as well and allow support for this.
Visual OS
10-11-2012, 09:25 PM
Thanks for the tip Bullyrider. It worked perfectly.
Edit: I decompressed the file with no issue but after editing, I couldn't compress it.
kill_seth
10-11-2012, 09:27 PM
This looks like a PC version of the savegame (correct me if im wrong). Only Xbox360 is supported currently, but... i will now try to detect PC saves as well and allow support for this.
If I remember correctly, the pc's version is in little endian. After the lzo data is decompressed, read the uint32 after the magic (WSG).
If (UInt32 == 2)
{
type = X360;
}
else if (UInt32 == 33554432)
{
type = PC;
}
else
{
type = UNKNOWN;
}
fairchild
10-11-2012, 09:28 PM
Will make a new build tomorrow (hopefully more stable than the current WIP build). For those interested in making a save editor, read about "protobuf". Thats whats used in the game to store the values etc.
TwztdKaos
10-11-2012, 10:06 PM
I got it to work with my mecromancer level 1 save looking around i didnt see much but the skill tree and the challenges i havent got very far in the game to have values gonna try me regular character next
Idlehands88
10-11-2012, 10:15 PM
I found where the Fast Travel Locations are :P
Some interesting ones to add in and test (got them from the Coalesced.bin file):
TundraExpressSecret
DLC 1 Locations:
CavesToOasisTown
OasisTown
SaltFlats
RefineryToSaltFlats
ShipGraveyardToSaltFlats
SpireToOasisTown
WormBellyToOasisTown
truthdude
10-11-2012, 11:07 PM
Hi my first post, I would like to say thanks to fairchild for this first off. Also after looking through a decompressed save im yet to find anything relating to guns. I find this strange and im wondering where that info is stored. Has any one had any luck yet?
CynicalEngineer
10-11-2012, 11:29 PM
Was able to decompress the SaveGame.sav just fine. When trying to compress the save.decompressed file, it never gave me a new SaveGame.sav.rebuilt.
EDIT: My bad, just realized the first post said "compression not yet supported."
legitmod
10-11-2012, 11:49 PM
Hello Thanks to Fairchild for the great tool big ups to you bro.:109:
In no way am i trying to thread hijack just trying to keep this all together if so i can make a separate thread. Here is a tut on how to use this amazing tool i in no way take any credit for this tool only my tut thanks to fairchild..
http://www.youtube.com/watch?v=XrWnwhfkn3A
lookinoverit
10-11-2012, 11:55 PM
hmm, I've modded everything in my save already but this is quite the info you can see in the text now. wonder all the good stuff we can change like challenges info and quests? I used a junk save that I'm not familiar with the in-game values so some is a little mystery here but I think I am going to try this with my current save so I will know what values are what and where to look. Thanks for this tool fairchild. This could be fun to play with.
LittlJ
10-11-2012, 11:55 PM
Great work fairchild! I was successfully able to decompress my save, but can't seem to find the values in HxD for the life of me. :/
MadeGuy
10-12-2012, 12:52 AM
Great work fairchild! I was successfully able to decompress my save, but can't seem to find the values in HxD for the life of me. :/
I'm a little worried that I'm not seeing 'barrel 5' or nothing but I'm hopeful that a lot of good will come out of Fairchild's work. Also, i'd like to say that i'm excited to see the man himself, XanderChaos whatching this thread...
Idlehands88
10-12-2012, 01:38 AM
I think I found Eridium...
It's an Int32 value of 12000000 (used to be 00000000) I had 0 Eridium and now have 18 more (12 in HEX).
The value is at the top of the save:
http://imageshack.us/a/img600/281/bl2eridium.png
reapermech
10-12-2012, 01:46 AM
fairchild great work looks like there is a glimmer of hope for a tool thankyou and the other devs for working on this
Idlehands88
10-12-2012, 01:56 AM
hey idle the full size link to that image is giving a file removed due to TOS lol fairchild great work looks like there is a glimmer of hope for a tool thankyou and the other devs for working on this
Ya I deleted the first image I put up, I made a mistake on it lol, refresh the page and you can see the new image :)
JizzaBeez
10-12-2012, 06:33 AM
Hey fairchild, have you any chance to see what algo (or hmac key) is used on the gpd's savedata? I have a working tool to decompress/read/write the data but I don't know the hash...
Scorpius2005
10-12-2012, 08:35 AM
Thankfully we have good people like you working hard to get an editor up for Borderlands 2
fairchild
10-12-2012, 08:39 AM
Hey fairchild, have you any chance to see what algo (or hmac key) is used on the gpd's savedata? I have a working tool to decompress/read/write the data but I don't know the hash...
Have you checked that it's not huffman encoded like the savegames? If you have the lzo decompressed data of the gpd's savedata i can check real quick if it's huffman encoded.
If not i guess i can have a look at it when i'm done creating the compression process of this tool :-)
Edit:
Updated first post with the latest build, this has compression support (may not work as expected).
Idlehands88
10-12-2012, 11:50 AM
Have you checked that it's not huffman encoded like the savegames? If you have the lzo decompressed data of the gpd's savedata i can check real quick if it's huffman encoded.
If not i guess i can have a look at it when i'm done creating the compression process of this tool :-)
Edit:
Updated first post with the latest build, this has compression support (may not work as expected).
Thanks for the update fairchild, but the Compression isn't working for me :( The Compression doesn't give me a .rebuilt file (it writes the Compression to the original .sav file). I even just Decompressed my save and then Compressed it and it didn't work. Even after trying to re-Decompress the save I just re-Compressed the borderlands2.exe stops working :'(
http://imageshack.us/a/img805/8346/bl2compressiontoolerror.png
fairchild
10-12-2012, 01:45 PM
Updated build, hopefully corrected all incorrect values when recompressing.
Vincent Valentine
10-12-2012, 03:11 PM
Have you checked that it's not huffman encoded like the savegames? If you have the lzo decompressed data of the gpd's savedata i can check real quick if it's huffman encoded.
If not i guess i can have a look at it when i'm done creating the compression process of this tool :-)
Edit:
Updated first post with the latest build, this has compression support (may not work as expected).
He means does the .gpd use the same hash as the savgame? Cause he's gotten the decompression to work but doesn't know the hash
kill_seth
10-12-2012, 03:33 PM
Hey fairchild, have you any chance to see what algo (or hmac key) is used on the gpd's savedata? I have a working tool to decompress/read/write the data but I don't know the hash...
The profile data is as follows:
SHA1[20 Bytes]
decompressedSize[4 Bytes]
compressedBuffer[LZO_1X_1]
I have successfully decompressed/modded/compressed the data, and was able to use it on the pc. The problem I have is injecting back into the gpd without ruining the gpds structure.
chaosknight118
10-12-2012, 05:09 PM
This compression/ decompression tool works wonders i can finally see some excellent progress in the save with the hex editor. Quick question though, i've been looking through the save for a bit has anyone found the location for skill points yet, i see someone has found the eridium already and i was wondering if it might be close by? either that or back pack space which i cant seem to find either.
Visual OS
10-12-2012, 05:33 PM
Works for me too!
Idlehands88
10-12-2012, 06:08 PM
Updated build, hopefully corrected all incorrect values when recompressing.
Thanks man, but it still doesn't work :'( I tried it on 3 of my saves and it corrupts them everytime, the Compression tool does fix the checksum right?
Serious_M
10-12-2012, 06:45 PM
nice work on this toolkit fairchild
TwztdKaos
10-12-2012, 07:17 PM
Thanks man, but it still doesn't work :'( I tried it on 3 of my saves and it corrupts them everytime, the Compression tool does fix the checksum right?
Yeah it looks that way we have figured out the compression now just need a checksum fixer
JizzaBeez
10-12-2012, 09:29 PM
Have you checked that it's not huffman encoded like the savegames? If you have the lzo decompressed data of the gpd's savedata i can check real quick if it's huffman encoded.If not i guess i can have a look at it when i'm done creating the compression process of this tool :-)Edit:Updated first post with the latest build, this has compression support (may not work as expected).The GPD uses LZO1X compression. I said this weeks ago. The hash on the data is 160bit (not sha1 or ripemd). I can't upload the data right now because I'm on my iPhone, but the data is in TitleSpecific1 of the gpd.
kill_seth
10-12-2012, 09:45 PM
The GPD uses LZO1X compression. I said this weeks ago. The hash on the data is 160bit (not sha1 or ripemd). I can't upload the data right now because I'm on my iPhone, but the data is in TitleSpecific1 of the gpd.
When I tested it with the PC's profile data, it matched the data with the gpd. I was able to mod it, and I only fixed the SHA1. I'm not sure what 160bit hash your referring to. Unless your talking about the two strings that show up after you start the game.
TheLastDude
10-12-2012, 10:58 PM
hey fairchild.
any plans to put a gui around this once its perfected to make it easier? kinda like what kill_seth did.
JordanElliott
10-12-2012, 11:03 PM
is there a way you can add ps3 support if i send u a copy of my save?
JizzaBeez
10-13-2012, 12:21 AM
When I tested it with the PC's profile data, it matched the data with the gpd. I was able to mod it, and I only fixed the SHA1. I'm not sure what 160bit hash your referring to. Unless your talking about the two strings that show up after you start the game.
No, I'm not referring to the String's in the savedata... I've checked several profile's gpds and the 160bit hash at the begin of the savedata is not a basic SHA1... I will include the files that I'm looking at and you can see.
I've included:
- BL2 GPD
- entry # 0x63E83FFF
- entry # 0x63E83FFF's savedata (0x0 = byte[] 160bit_hash, 0x14 = int32 decompress_length, 0x18-EOF = byte[] compress_data)
- compressed data (0x0 = int32 decompress_length, 0x4-EOF = compress_data)
- decompressed data (uses basic UE3 savegame struct)
-I also included a HexWorkshop bookmark for : entry # 0x63E83FFF's savedata
How you get a SHA1 hash from any of the entry's data is beyond me...lol
pistol_pte
10-13-2012, 01:08 AM
Not sure if this hepls but this is from WillowGame.xxx
it might give some sort of idea of savegame structure
class PlayerSaveGame extends Object
editinlinenew;
struct native SkillSaveGameData
{
var private SkillDefinition SkillDefinition;
var private int Grade;
var private int GradePoints;
var private int EquippedSlotIndex;
structdefaultproperties
{
SkillDefinition=none
Grade=0
GradePoints=0
EquippedSlotIndex=-1
}
};
struct native ResourceSaveGameData
{
var private ResourceDefinition ResourceDefinition;
var private ResourcePoolDefinition ResourcePoolDefinition;
var private float Amount;
var private int UpgradeLevel;
structdefaultproperties
{
ResourceDefinition=none
ResourcePoolDefinition=none
Amount=0.00
UpgradeLevel=0
}
};
struct native InventorySaveGameData
{
var private ItemDefinitionData DefinitionData;
var private int Quantity;
var private bool bEquipped;
var private Engine.WillowInventory.PlayerMark Mark;
structdefaultproperties
{
DefinitionData=(ItemDefinition=none,BalanceDefinit ion=none,ManufacturerDefinition=none,ManufacturerG radeIndex=0,AlphaItemPartDefinition=none,BetaItemP artDefinition=none,GammaItemPartDefinition=none,De ltaItemPartDefinition=none,EpsilonItemPartDefiniti on=none,ZetaItemPartDefinition=none,EtaItemPartDef inition=none,ThetaItemPartDefinition=none,Material ItemPartDefinition=none,PrefixItemNamePartDefiniti on=none,TitleItemNamePartDefinition=none,GameStage =0,UniqueId=0)
Quantity=0
bEquipped=false
Mark=PlayerMark.PM_Standard
}
};
struct native UnloadableDlcItemSaveGameData
{
var private InventorySerialNumber SerialNumber;
var private int Quantity;
var private bool bEquipped;
var private Engine.WillowInventory.PlayerMark Mark;
structdefaultproperties
{
SerialNumber=(Buffer=0,Buffer[1]=0,Buffer[2]=0,Buffer[3]=0,Buffer[4]=0,Buffer[5]=0,Buffer[6]=0,Buffer[7]=0,Buffer[8]=0,Buffer[9]=0,Buffer[10]=0,Buffer[11]=0,Buffer[12]=0,Buffer[13]=0,Buffer[14]=0,Buffer[15]=0,Buffer[16]=0,Buffer[17]=0,Buffer[18]=0,Buffer[19]=0,Buffer[20]=0,Buffer[21]=0,Buffer[22]=0,Buffer[23]=0,Buffer[24]=0,Buffer[25]=0,Buffer[26]=0,Buffer[27]=0,Buffer[28]=0,Buffer[29]=0,Buffer[30]=0,Buffer[31]=0,Buffer[32]=0,Buffer[33]=0,Buffer[34]=0,Buffer[35]=0,Buffer[36]=0,Buffer[37]=0,Buffer[38]=0,Buffer[39]=0,State=SerialNumberState.SNS_Empty,RunningCounte r=0,EncryptedLength=0)
Quantity=0
bEquipped=false
Mark=PlayerMark.PM_Trash
}
};
struct native WeaponSaveGameData
{
var private WeaponDefinitionData WeaponDefinitionData;
var private WillowDeclarations.EQuickWeaponSlot QuickSlot;
var private Engine.WillowInventory.PlayerMark Mark;
structdefaultproperties
{
WeaponDefinitionData=(WeaponTypeDefinition=none,Ba lanceDefinition=none,ManufacturerDefinition=none,M anufacturerGradeIndex=0,BodyPartDefinition=none,Gr ipPartDefinition=none,BarrelPartDefinition=none,Si ghtPartDefinition=none,StockPartDefinition=none,El ementalPartDefinition=none,Accessory1PartDefinitio n=none,Accessory2PartDefinition=none,MaterialPartD efinition=none,PrefixPartDefinition=none,TitlePart Definition=none,GameStage=0,UniqueId=0)
QuickSlot=EQuickWeaponSlot.QuickSelectNone
Mark=PlayerMark.PM_Standard
}
};
struct native UnloadableDlcWeaponSaveGameData
{
var private InventorySerialNumber SerialNumber;
var private WillowDeclarations.EQuickWeaponSlot QuickSlot;
var private Engine.WillowInventory.PlayerMark Mark;
structdefaultproperties
{
SerialNumber=(Buffer=0,Buffer[1]=0,Buffer[2]=0,Buffer[3]=0,Buffer[4]=0,Buffer[5]=0,Buffer[6]=0,Buffer[7]=0,Buffer[8]=0,Buffer[9]=0,Buffer[10]=0,Buffer[11]=0,Buffer[12]=0,Buffer[13]=0,Buffer[14]=0,Buffer[15]=0,Buffer[16]=0,Buffer[17]=0,Buffer[18]=0,Buffer[19]=0,Buffer[20]=0,Buffer[21]=0,Buffer[22]=0,Buffer[23]=0,Buffer[24]=0,Buffer[25]=0,Buffer[26]=0,Buffer[27]=0,Buffer[28]=0,Buffer[29]=0,Buffer[30]=0,Buffer[31]=0,Buffer[32]=0,Buffer[33]=0,Buffer[34]=0,Buffer[35]=0,Buffer[36]=0,Buffer[37]=0,Buffer[38]=0,Buffer[39]=0,State=SerialNumberState.SNS_Empty,RunningCounte r=0,EncryptedLength=0)
QuickSlot=EQuickWeaponSlot.QuickSelectNone
Mark=PlayerMark.PM_Trash
}
};
struct native InventorySlotSaveGameData
{
var private int InventorySlotMax_Misc;
var private int WeaponReadyMax;
var private int NumQuickSlotsFlourished;
structdefaultproperties
{
InventorySlotMax_Misc=0
WeaponReadyMax=0
NumQuickSlotsFlourished=0
}
};
struct native MissionPlaythroughSaveGameData
{
var private int PlayThroughNumber;
var init private array<init private MissionStatusPlayerData> MissionData;
var init private array<init private UnloadableDlcMissionStatusData> UnloadableDlcMissionData;
var init private array<init private PendingMissionRewardData> PendingMissionRewards;
var init private array<init private UnloadableDlcPendingRewardData> UnloadableDlcPendingMissionRewards;
var init private string ActiveMission;
var init private array<init private MissionDefinition> FilteredMissions;
structdefaultproperties
{
PlayThroughNumber=0
MissionData=none
UnloadableDlcMissionData=none
PendingMissionRewards=none
UnloadableDlcPendingMissionRewards=none
ActiveMission=""
FilteredMissions=none
}
};
struct native UnloadableDlcEchoCallData
{
var init private string CallDefName;
var private int DlcPackageId;
structdefaultproperties
{
CallDefName=""
DlcPackageId=0
}
};
struct native PlayerUIPreferences
{
var private string CharacterName;
var private Color PrimaryColor;
var private Color SecondaryColor;
var private Color TertiaryColor;
structdefaultproperties
{
CharacterName=""
PrimaryColor=(R=255,G=255,B=255,A=255)
SecondaryColor=(R=255,G=255,B=255,A=255)
TertiaryColor=(R=255,G=255,B=255,A=255)
}
};
struct native RegionGameStageData
{
var private RegionDefinition RegionDef;
var private int GameStage;
var private int PlaythroughIdx;
structdefaultproperties
{
RegionDef=none
GameStage=0
PlaythroughIdx=0
}
};
struct native UnloadableDlcRegionGameStageData
{
var private string RegionDefName;
var private int GameStage;
var private int PlaythroughIdx;
var private int DlcPackageId;
structdefaultproperties
{
RegionDefName=""
GameStage=0
PlaythroughIdx=0
DlcPackageId=0
}
};
struct native WorldDiscoveryData
{
var private name DiscoveryName;
var private bool HasBeenUncovered;
structdefaultproperties
{
DiscoveryName=None
HasBeenUncovered=false
}
};
struct native ExpansionData
{
var private int Tag;
var private array<private byte> Data;
structdefaultproperties
{
Tag=0
Data=none
}
};
struct native UnloadableDlcChallengeData
{
var init private string ChallengeDefName;
var private int DlcPackageId;
structdefaultproperties
{
ChallengeDefName=""
DlcPackageId=0
}
};
struct native OneOffLevelChallengeData
{
var private byte PackageId;
var private byte ContentId;
var private array<private int> Completion;
structdefaultproperties
{
PackageId=0
ContentId=0
Completion=none
}
};
struct native BankSlot
{
var private InventorySerialNumber InventorySerialNumber;
structdefaultproperties
{
InventorySerialNumber=(Buffer=0,Buffer[1]=0,Buffer[2]=0,Buffer[3]=0,Buffer[4]=0,Buffer[5]=0,Buffer[6]=0,Buffer[7]=0,Buffer[8]=0,Buffer[9]=0,Buffer[10]=0,Buffer[11]=0,Buffer[12]=0,Buffer[13]=0,Buffer[14]=0,Buffer[15]=0,Buffer[16]=0,Buffer[17]=0,Buffer[18]=0,Buffer[19]=0,Buffer[20]=0,Buffer[21]=0,Buffer[22]=0,Buffer[23]=0,Buffer[24]=0,Buffer[25]=0,Buffer[26]=0,Buffer[27]=0,Buffer[28]=0,Buffer[29]=0,Buffer[30]=0,Buffer[31]=0,Buffer[32]=0,Buffer[33]=0,Buffer[34]=0,Buffer[35]=0,Buffer[36]=0,Buffer[37]=0,Buffer[38]=0,Buffer[39]=0,State=SerialNumberState.SNS_Empty,RunningCounte r=0,EncryptedLength=0)
}
};
struct native LockoutData
{
var private LockoutDefinition LockoutDef;
var private int LockoutTime;
structdefaultproperties
{
LockoutDef=none
LockoutTime=0
}
};
struct native UnloadableDlcLockoutData
{
var private string LockoutDefName;
var private int LockoutTime;
var private int DlcPackageId;
structdefaultproperties
{
LockoutDefName=""
LockoutTime=0
DlcPackageId=0
}
};
var private PlayerUIPreferences UIPreferences;
var private PlayerClassDefinition PlayerClassDefinition;
var private int ExpLevel;
var private int ExpPoints;
var private int GeneralSkillPoints;
var private int SpecialistSkillPoints;
var private int CurrencyOnHand[13];
var private int PlaythroughsCompleted;
var private array<private SkillSaveGameData> SkillData;
var private array<private ResourceSaveGameData> ResourceData;
var private array<private InventorySaveGameData> ItemData;
var private array<private UnloadableDlcItemSaveGameData> UnloadableDlcItemData;
var private InventorySlotSaveGameData InventorySlotData;
var private array<private WeaponSaveGameData> WeaponData;
var private array<private UnloadableDlcWeaponSaveGameData> UnloadableDlcWeaponData;
var private array<private MissionPlaythroughSaveGameData> MissionPlaythroughs;
var private CustomizationDefinition AppliedCustomizations[5];
var private transient array<private byte> StatsData;
var private array<private name> VisitedTeleporters;
var private transient name LastVisitedTeleporter;
var private transient int SaveGameId;
var private transient int SaveVersion;
var private int PlotMissionNumber;
var private int ActiveMissionNumber;
var private bool bReceivedDefaultWeapon;
var private transient bool bIsBadassModeSaveGame;
var private bool bIsDlcPlayerClass;
var private transient bool bShowNewPlaythroughNotification;
var private transient bool bAwesomeSkillDisabled;
var private transient array<private int> UsedMarketingCodes;
var private transient array<private int> MarketingCodesNeedingNotification;
var private transient int TotalPlayTime;
var private transient string LastSavedDate;
var private array<private ExpansionData> DLCExpansionData;
var private array<private ChallengeDefinition> ChallengeList;
var private array<private UnloadableDlcChallengeData> UnloadableDlcChallengeList;
var private array<private RegionGameStageData> RegionGameStages;
var private transient array<private UnloadableDlcRegionGameStageData> UnloadableDlcRegionGameStages;
var private array<private WorldDiscoveryData> WorldDiscoveryList;
var private array<private int> BlackMarketUpgrades;
var private Guid SaveGuid;
var private transient array<private int> LevelChallengeUnlocks;
var private transient array<private OneOffLevelChallengeData> OneOffLevelChallengeCompletion;
var private transient int MaxBankSlots;
var private transient array<private BankSlot> BankSlots;
var private transient int NumChallengePrestiges;
var private transient array<private LockoutData> LockoutList;
var private transient array<private UnloadableDlcLockoutData> UnloadableDlcLockoutList;
var private int DLCPlayerClassPackageId;
var private array<private name> FullyExploredAreas;
var private transient int NumGoldenKeysNotified;
var private transient int LastPlaythroughNumber;
var private array<private TrainingMessageDefinition> QueuedTrainingMessages;
thedevil-is-here
10-13-2012, 03:36 PM
mine also does this
Hold on wait! So if this compression works, does it mean that we won't need a JTAG/RGH to modify Borderlands 2? Only Hex Editor? Because if its possible then this game is going to be ripped in to shreds :D
reapermech
10-13-2012, 05:44 PM
it can be decompressed but when we try to compress the save there is still some issues that need to be looked at just keep being patient an editor will soon follow
Guys, I know you can't compress yet anyways but I wanted to Decompress my save and it didn't work! This is frustrating, I have a picture to show what I did...
http://i1058.photobucket.com/albums/t414/MoZaidz/ProblemwithDecompression_zps2573e03e.png
Dont put it all on one line, thats what i did at first.
where there is brackets put the file path to what is in brackets
also make sure your savegame.sav is in the same folder as the .exe
Do:
cd c:\[folder containing borderlands2.exe]
e.g. cd c:\borderlands2
Press enter
then type
borderlands2.exe
Press enter
then type
borderlands2.exe -d savegame.sav save.decompress
press enter
Then it should work
Also fairchild i managed to find money in hxd (i understand it might be a dynamic offset, so it would be pointless posting), however when i edit (using hxd or the tool i quickly created), the save is corrupt in borderlands (not in xbox storage)
I tried generating SHA1 checksums, but that didnt make a difference. Is it a different checksum or is there something else?
DMand
10-13-2012, 07:32 PM
Nice work fairchild hope you guys can knock out the compression now thanks for releasing this
Dont put it all on one line, thats what i did at first.
where there is brackets put the file path to what is in brackets
also make sure your savegame.sav is in the same folder as the .exe
Do:
cd c:\[folder containing borderlands2.exe]
e.g. cd c:\borderlands2
Press enter
then type
borderlands2.exe
Press enter
then type
borderlands2.exe -d savegame.sav save.decompress
press enter
Then it should work
Also fairchild i managed to find money in hxd (i understand it might be a dynamic offset, so it would be pointless posting), however when i edit (using hxd or the tool i quickly created), the save is corrupt in borderlands (not in xbox storage)
I tried generating SHA1 checksums, but that didnt make a difference. Is it a different checksum or is there something else?
THANKS MAN!
JizzaBeez
10-13-2012, 11:54 PM
Yeah there is a problem with the tool compressing. My game is corrupt or says "unloadable content" even when I only decompress, then compress back (without editing).
Yeah there is a problem with the tool compressing. My game is corrupt or says "unloadable content" even when I only decompress, then compress back (without editing).
When we are able to properly compress this, would we be able to modify items and such? I dont see any of my items in the decompressed save file
WarpedChalice
10-14-2012, 12:35 AM
works like a charm thanks man :)
kill_seth
10-14-2012, 03:57 AM
No, I'm not referring to the String's in the savedata... I've checked several profile's gpds and the 160bit hash at the begin of the savedata is not a basic SHA1... I will include the files that I'm looking at and you can see.
I've included:
- BL2 GPD
- entry # 0x63E83FFF
- entry # 0x63E83FFF's savedata (0x0 = byte[] 160bit_hash, 0x14 = int32 decompress_length, 0x18-EOF = byte[] compress_data)
- compressed data (0x0 = int32 decompress_length, 0x4-EOF = compress_data)
- decompressed data (uses basic UE3 savegame struct)
-I also included a HexWorkshop bookmark for : entry # 0x63E83FFF's savedata
How you get a SHA1 hash from any of the entry's data is beyond me...lol
I see what your talking about now. I wrote a tool for the PC's Profile Data and with it I'm able to mod the data and re-compress and then fix the hash. The hash is a SHA1 and I remember testing the hash on the GPD Profile Data and it was a SHA1 as well. The only thing I can think of is maybe they updated it with the Title Update. I know that's a long shot, but I have the PC game with is not updated and I only messed with the GPD before the Title Update was released for the xbox.
Philymaster
10-14-2012, 12:09 PM
I think the hash in the GPD is a modified SHA1 like Gears of War 3.
I've use the Gears of War 3 editor from Horizon and experimented with my LIVE profile.
If I change the Profile, Device and Console ID from my Profile Horizon fix the GoW 3 hash without any problems.
But if I edit the XUID from my profile Horizon says that the PlayerStorage header is broken.
So I think that Gears of War 3 and Borderlands 2 use a SHA1 and modified it with the XUID.
Hope that helps
fairchild
10-15-2012, 08:43 AM
Thanks man, but it still doesn't work :'( I tried it on 3 of my saves and it corrupts them everytime, the Compression tool does fix the checksum right?
Yes, both the SHA1 and CRC32, but i suspect that the Huffman encoder im using has some bugs thats causing this. Investigating..
masonimal
10-26-2012, 08:13 AM
Hi umm as I am new to all of this and have been getting a massive headache looking around for anything related to helping with modding Borderlands 2 and making it so Playstation can have its fair share of mods (like most of the Xbox 360 players have). I have been looking into anything I could find that may help me and so far all I have come across is more stuff being updated for Xbox and nothing on Playstation. While I realize that it is much harder to break a PS3's encryption I have been able to look over different programs. Not so much the code, I believe they would rather keep the code so I dont steal it, and help out with it anywhere that I can. I would love to help in any way since I do have a PS3 and general knowledge of programming and coding. I am also part of FRC (First Robotics) and I believe a few people from my Robotics group that cover programming for the robot could help out and maybe look over some of the save files and things like that, maybe break more of it down so we can find what needs to be opened up for us to modify it the way we want. It would be much appreciated if someone could give me a headway so that I may get involved. As much as I would like to see Borderlands 2 modded, I would much more like to see it modded for the PS3 so I can go back to the good old days of Willowtree like with Borderlands 1.
My email is
[email protected] (I check this the most often) and if anyone could get back to me, I would love to help out in anyway that I can. Thnx
vBulletin Solutions, Inc. All rights reserved.