Log in

View Full Version : [WIP] Borderlands 2 Compression Tool



kill_seth
09-18-2012, 11:14 PM
Virus Scan: Click Here (https://www.virustotal.com/file/0abd4b6639ccae4b39821e167083c3a27560988bb6f6fd20f2 d33115849377ae/analysis/1348005749/)
Down Link: Click Here (http://j.gs/1Pxx)



-Borderlands 2 Compression Tool v1
--Decompresses LZO Encryption
--Compresses LZO Encryption
--Fixes SHA1 Checksum

-Please Note
--Decompressed data might still be compressed.
--That compression (if any) is not known by me.
--Do not move runtime created files from their created path.
--Removing them will cause the program not to save.
--Make sure you create a backup of your save.

-Credits
--Program Creator: kill_seth
--ISOLib Creator: PureIso & Jappi88 @ http://360Haven.com
--LZO Creator: Markus


It looks like the game uses the LZO-Professional v2.0 to compress the data.

CloudStrife7x
09-18-2012, 11:16 PM
great work on this compression tool kill_seth

I C0z I
09-18-2012, 11:17 PM
damn nice work kill_seth (http://www.360haven.com/forums/members/kill_seth.html)

blacksnight
09-18-2012, 11:17 PM
nice tool kill_seth thanks.

ThisGuyP1469
09-18-2012, 11:45 PM
Awesome! i know people were needing this for making a editer, Thank you thank you thank you =D

Ravanofdarkness
09-19-2012, 12:13 AM
Nice one Seth, this should help out those working on an Editor for the Game. :)

iH8 Fr0st
09-19-2012, 12:22 AM
good job Seth :)

LiquidRiver
09-19-2012, 12:50 AM
Thanks for working on this.

LiquidRiver
09-19-2012, 12:56 AM
I have not used a compression tool/ program before. What is the process to do this with my gamesaves?

kill_seth
09-19-2012, 12:58 AM
I have not used a compression tool/ program before. What is the process to do this with my gamesaves?

Simply open your game save and it will decompress the lzo data. If you edit anything in the decompressed file, hit save and it will compress and inject it back into your save.

Edit: Looks like the compression is still wrong. I'll keep working on it!

jackblackjack2009
09-19-2012, 01:44 PM
if we use this for now can we edit money and skillpoints using hex editor in that decompressed file
thanks

offsafety
09-19-2012, 03:32 PM
if we use this for now can we edit money and skillpoints using hex editor in that decompressed file
thanks

I was wondering the same thing, although in my case i have very limited knowledge using hex editors. I've done so years ago, but I don't remember anything about them. I am definitely willing to learn, and though I'm a fast learner, I may also need step by step instructions for what to do to edit skill points and money if that's a possibility.

In any case, thank you very much for this. People like you and other members of xbox360haven have changed my life and they way I play my games.

Serious_M
09-19-2012, 04:56 PM
nice job on this tool kill_seth

Vincent Valentine
09-19-2012, 05:01 PM
I was wondering the same thing, although in my case i have very limited knowledge using hex editors. I've done so years ago, but I don't remember anything about them. I am definitely willing to learn, and though I'm a fast learner, I may also need step by step instructions for what to do to edit skill points and money if that's a possibility.

In any case, thank you very much for this. People like you and other members of xbox360haven have changed my life and they way I play my games.
Tried this yesterday and I still couldn't find any of my stats

Semetric
09-19-2012, 05:12 PM
As the creator said, Compression is incorrect.

Philymaster
09-19-2012, 05:15 PM
It looks like the game uses the LZO-Professional v2.0 to compress the data.

Yes it's using LZO Professional v2.02.
But i thought the game using the checksum from Gears of War 3 and not SHA1?

kill_seth
09-19-2012, 08:54 PM
Yes it's using LZO Professional v2.02.
But i thought the game using the checksum from Gears of War 3 and not SHA1?

The SHA-1 is saved at 0 and covers the compressed data. There might be more, but since I don't know the GOW3 hash I can't confirm.

SyntheticSin
09-19-2012, 11:30 PM
Just wanted to give a quick thanks for all the hard work you guys are putting into these tools. It sounds like Gearbox made it a little bit harder to mod this time but I have no doubt you guys will come through. Thanks!

kmkramer
09-19-2012, 11:47 PM
Im still seeing encrypted symbols in a hex editor... but i probably have no idea what im talking about. Should I expect to see some words when this works?

kill_seth
09-19-2012, 11:59 PM
Im still seeing encrypted symbols in a hex editor... but i probably have no idea what im talking about. Should I expect to see some words when this works?

Next time try reading the notes before asking a question.



-Please Note
--Decompressed data might still be compressed.
--That compression (if any) is not known by me.

BrayWyatt
09-20-2012, 01:24 AM
heres my save to help out with the editor.

http://img.photobucket.com/albums/v676/jasonvoorhees987/photo1_zpsbe94727e.jpg

http://img.photobucket.com/albums/v676/jasonvoorhees987/photo2_zpscebdc31b.jpg

http://img.photobucket.com/albums/v676/jasonvoorhees987/photo3_zps98f04ebe.jpg

http://img.photobucket.com/albums/v676/jasonvoorhees987/photo4_zps187b25db.jpg

http://img.photobucket.com/albums/v676/jasonvoorhees987/photo5_zps2d9ae569.jpg

thegutta
09-20-2012, 04:37 AM
Awesome job on the tool seth :)

jackblackjack2009
09-20-2012, 07:17 AM
so the question is will there be a proper save editor in the next coming weeks
even if its just similar to dragons dogmas editor where we still need to search for the values
hopefully yes
thanks and good luck to the geniuses that will make this possible
cheers

DMand
09-22-2012, 08:48 AM
Nice work seth and glad to see your site back up

BrayWyatt
09-22-2012, 09:03 AM
I can upload another save if you want me to.

kill_seth
09-22-2012, 09:31 AM
I can upload another save if you want me to.

Saves aren't really the issue. I just can't reproduce the compression 1:1, I think lzopro is needed. Was hoping fairchild would confirm that, but he hasn't said anything yet.

Fen
09-22-2012, 09:45 AM
Thanks for the work on this so far!

PUR3 RAF3X
09-22-2012, 10:47 AM
Saves aren't really the issue. I just can't reproduce the compression 1:1, I think lzopro is needed. Was hoping fairchild would confirm that, but he hasn't said anything yet.

He work 12-14h so I can understand when we have no time for coding the dll done.

TheHitmanLandon
09-23-2012, 03:19 AM
How do I open it up in Hex it just random stuff lol

zMATeR
09-23-2012, 04:10 AM
How do I open it up in Hex it just random stuff lol

Lol ^^^

Sent from my MB855 using Tapatalk 2

istylez6
09-23-2012, 06:12 AM
thankz kill zeth nice work time to mod

dippidip
09-23-2012, 10:21 AM
I 'm really asking myself???,isn't there anyone who can find the save decryption algorithm(s) in the default.xex.
Not that I can,cause I know nothing about de/encryption and algo's.
But it is definitely somewhere in the .xex.
Otherwise,how would the console do it without instructions.

I really hope someone get it right and makes it possible to ultimately create a save editor for BL2 like willowtree.

meow_mix
09-23-2012, 03:39 PM
The SHA-1 is saved at 0 and covers the compressed data.
That means the key is in the gamesave, or at least used to dynamically generate it.

Has anyone tried decrypting it?
Has anyone tried disassembling the PC version?

LittlJ
09-23-2012, 07:28 PM
I swear people don't know how to read -_- people if you'd actually read through the thread, you'd know it's not currently working but Kill_Seth and/or Fairchild are working on it. If nothing else at least test the dang thing before saying thanks for making it work. With that said, thank you seth for making what headway you have so far, and I'll be excited to see what you come up with. Tbf though, it is quite a bit more fun to just play through it once before mods come out lol. Plus if you really want to cheat that bad you can just dupe your stuff..

lockmonster
09-24-2012, 12:54 PM
Well i will be keeping my eye out for this and a editor tool

TheLastDude
09-24-2012, 10:05 PM
even if this only decompresses and compresses so much data, i think im going to give it a go in regards to hex editing.

will also be downloading the resigner.

here goes nothing... wish me luck.

meow_mix
09-24-2012, 11:35 PM
you will get no where. I posted about this, but my message was deleted due to profanity or rules violations.

It's encrypted. Yes indeed this tool decompresses the LZO compression, but the file still is wrapped as a SHA-1 hash.
We need to decrypt it in order to hex edit --- the data is not hex-editable, whatsoever. You can't find or change a single thing and expect a valid result, it's impossible. Unless you are lucky w/ changing a single bit, lucky beyond belief. Actually no that's still not possible. lol
I was hoping to use an xbox save on PC, but am not having good results w/ that.

Which is why I am baffled by the amount of "thanks" in this thread, as this tool, though great, does not do what we all wish it to do. Perhaps soon that will change :)

kill_seth
09-24-2012, 11:51 PM
you will get no where. I posted about this, but my message was deleted due to profanity or rules violations.

It's encrypted. Yes indeed this tool decompresses the LZO compression, but the file still is wrapped as a SHA-1 hash.
We need to decrypt it in order to hex edit --- the data is not hex-editable, whatsoever. You can't find or change a single thing and expect a valid result, it's impossible. Unless you are lucky w/ changing a single bit, lucky beyond belief. Actually no that's still not possible. lol
I was hoping to use an xbox save on PC, but am not having good results w/ that.

Which is why I am baffled by the amount of "thanks" in this thread, as this tool, though great, does not do what we all wish it to do. Perhaps soon that will change :)

Please refer to the title of the thread. This is a "Work in Progress." Me and a few other people are working on figuring out the proper compression/decompression. This tool has the decompression method for the data stored in your profile. I thought they were the same, but it turns out the save structure is different.

MadeGuy
09-25-2012, 02:21 AM
you will get no where. I posted about this, but my message was deleted due to profanity or rules violations.

It's encrypted. Yes indeed this tool decompresses the LZO compression, but the file still is wrapped as a SHA-1 hash.
We need to decrypt it in order to hex edit --- the data is not hex-editable, whatsoever. You can't find or change a single thing and expect a valid result, it's impossible. Unless you are lucky w/ changing a single bit, lucky beyond belief. Actually no that's still not possible. lol
I was hoping to use an xbox save on PC, but am not having good results w/ that.

Which is why I am baffled by the amount of "thanks" in this thread, as this tool, though great, does not do what we all wish it to do. Perhaps soon that will change :)

You seem to have a really hard time understanding what "work in progress", means. From the beginning, he posted that it may not work and that the compression was not known by him. The fact that so many people (including myself), thanked him is because we commend his efforts because at least he tried and still is trying to figure this out. All you're doing is ¤¤¤¤¤ing and whining about it. Got a problem? Do it yourself.

PUR3 RAF3X
09-25-2012, 04:56 PM
I use LZO 2.06 and have no probs De/Compress my own data. The Borderlands 2 data I can only compress the fist 10% right from the orginal data. An another prob are rebuild the header right with the LZO_Compress result.

meow_mix
09-25-2012, 06:58 PM
we commend his efforts because at least he tried and still is trying to figure this out.

I fully understood what WIP means. I'd have to be a retard not to. I was looking for the following response, so that we as a community could at least work together to resolve this, instead of having ZERO transparency as it were (stating you don't know what is and isn't working, is not going to help anyone):

Me and a few other people are working on figuring out the proper compression/decompression. This tool has the decompression method for the data stored in your profile. I thought they were the same, but it turns out the save structure is different.

Though you are right MadeGuy, I am not being appreciative for the work that has been done, and for that, I apologize. I'll reply later once I have found information that will aid kill_seth in furthering this tool; and if I don't reply, then perhaps I will have to stick my foot in my mouth, eh?

Is a bit frustrating when all you see is people saying thank you, and no one actually working to resolve the problems. It's as if no one even downloaded it.
That was my angle. SO once again, my apologies; now I see that people are indeed working on it. I'll try to contribute instead of expressing opinion and perspective in the future.

Thanks to kill_seth for his continued work on this. :)

kill_seth
10-05-2012, 02:01 AM
Well I decided to install the pc version and I have successfully modded the badass tokens. Now for the xbox, the problem I'm having is that I can't find a proper gpd handler that lets you replace the entries correctly. The one in ISOLib doesn't allow me to rebuild it because the Title2 and Title3 are null, so it returns an error.

Here is what I did on the pc: http://gyazo.com/04f306c80a7b7fe06721c993256295b8

ProCisicon
10-05-2012, 05:18 AM
I hope you get this figured out!

When you post a gyazo you can add .png to the end of the link and use bbcode and it will post the pic. If you didn't know.

9746

Jappi88
10-05-2012, 08:58 AM
Well I decided to install the pc version and I have successfully modded the badass tokens. Now for the xbox, the problem I'm having is that I can't find a proper gpd handler that lets you replace the entries correctly. The one in ISOLib doesn't allow me to rebuild it because the Title2 and Title3 are null, so it returns an error.

Here is what I did on the pc: http://gyazo.com/04f306c80a7b7fe06721c993256295b8

I know about the error for the gpd class... I made it quick a while ago and never actually tested it.. I will remake the class to work much better.
I will update isolib when the class is done.

Silplix
10-05-2012, 09:58 AM
Very nice share. Thanks ! ;D

OGCuban
10-05-2012, 05:02 PM
Thanks for all the hard work you guys are putting into making this work someday!

lickerout
10-06-2012, 01:39 AM
feel free to corect me if i'm wrong but from what i hear it is suppost to have the same compression method that gears of war 3 uses, so would it be possible to use the decompression method that was used with the gears 3 save editor if it does? (if you can get in touch with the guys that made it)

Edit: did not read the entire thread looks like you already knew but just thought of something else, is it possible the save looks for the profile saved info aswell as the stuff from the regular save? (just thinking outside the box here) loading info from both the save and the gpd at the same time giving it an extra layer of security you would have to match the save to the gpd so maybe try the save plus the gpd and decopress them both at the same time edit and recompress again or something like that .

EachHitNDiceLow
10-06-2012, 04:48 PM
Great work.

TheLastDude
10-07-2012, 10:23 AM
i think i found something that might help you guys out. there's some pretty neat information in there and i was thinking that you guys could work with these guys to make willowtree 2 happen:

http://sourceforge.net/projects/willowtree/forums/forum/1117810/topic/5874406/index/page/1

iKing
10-07-2012, 04:55 PM
wow this game really takes a lot of time right?

FasuXe
10-07-2012, 11:28 PM
hey kill_seth,

Maybe this script would help. https://github.com/pclifford/borderlands2
I was able to decompress my gamesave with it. Still haven't figured out much in hex editor though. :-(

*** UPDATE *****

Using the script I do get a somewhat readable file. It appears they are using some sort of huffman tree encryption. Here is a clip of the resulting decompressed file.

9772

TheLastDude
10-08-2012, 06:14 PM
Using the script I do get a somewhat readable file. It appears they are using some sort of huffman tree encryption. Here is a clip of the resulting decompressed file.

word, yo. that was also mentioned in the thread i linked as well. thanks for the helpful post. i hope both of our links will help out the guys in this thread.

pogi
10-08-2012, 06:19 PM
Awesome! work thanks for ur hard work ! and share :P

Kp Romplestein
10-08-2012, 10:51 PM
I keep getting an "invalid save file" error when using that script. Any idea why?

pclifford
10-08-2012, 11:47 PM
I keep getting an "invalid save file" error when using that script. Any idea why?

If the save came from a PC the first version of the script couldn't understand that format. It should now be able to read and write both console and PC formats, including converting between them.

Kp Romplestein
10-09-2012, 12:23 AM
If the save came from a PC the first version of the script couldn't understand that format. It should now be able to read and write both console and PC formats, including converting between them.

Ah, thanks so much for the reply. Unfortunately it was a console save (thus this newest update shouldn't resolve whatever the problem may be). I'm quite unfamiliar with python, lzo, etc. and I'm beginning to think it would be burdensome of me to ask for further assistance.

Thanks for taking the time though.

Edit: Just realized that this may be easily answered: what version of the Python LZO bindings are required? I've got v1.08

NCHelix
10-09-2012, 02:44 AM
Ah, thanks so much for the reply. Unfortunately it was a console save (thus this newest update shouldn't resolve whatever the problem may be). I'm quite unfamiliar with python, lzo, etc. and I'm beginning to think it would be burdensome of me to ask for further assistance.

Thanks for taking the time though.

Edit: Just realized that this may be easily answered: what version of the Python LZO bindings are required? I've got v1.08

From what I read version 2 or newer of the Python LZO bindings are required for the script.

EDIT: 2.6 or later

Any luck making changes to the save using this script yet?

pclifford
10-09-2012, 07:16 AM
From what I read version 2 or newer of the Python LZO bindings are required for the script.

EDIT: 2.6 or later

Any luck making changes to the save using this script yet?

You need Python 2.6 or later (not Python 3), but any version of the LZO bindings should work: I'm using 1.08.

The problem might be that for an Xbox save you first need to extract the SaveGame.sav file, which contains just the Borderlands 2 data without all the Xbox wrapping, from inside the save entry using a tool like Horizon from http://www.xboxmb.com/horizon/. If you've already done that and it's still not working can you upload the file you're trying somewhere so I can take a look at it?

tertiussc
10-09-2012, 07:49 AM
http://myxboxsaves.com/imago/pictures/kill_seth/borderlands2lzo.png

Virus Scan: Click Here (https://www.virustotal.com/file/0abd4b6639ccae4b39821e167083c3a27560988bb6f6fd20f2 d33115849377ae/analysis/1348005749/)
Down Link: Click Here (http://j.gs/1Pxx)



It looks like the game uses the LZO-Professional v2.0 to compress the data.
Hmm does this now mean i will be able to hex edit the values? if so is there a tutorial on how to do this?

PUR3 RAF3X
10-09-2012, 08:41 AM
This is fun I say few days ago what the SD use after lzo lol.

NCHelix
10-11-2012, 08:17 AM
I've successfully edited saves for all character classes including the newest Mechromancer using the Python script given on here.

Definitely would be nice to have a UI around it at some point though :)

cobbis
10-12-2012, 06:30 AM
I have tried to use the scrpit that pclifford created but it keeps giving me an "invalid save game" error. I have tried using the save0001.sav and savegame.sav files but I get the same error. Any help is appreciated.

FasuXe
10-12-2012, 12:44 PM
I have tried to use the scrpit that pclifford created but it keeps giving me an "invalid save game" error. I have tried using the save0001.sav and savegame.sav files but I get the same error. Any help is appreciated.

You have to extract the actual SaveGame.save file using a tool like modio.

Idlehands88
10-12-2012, 12:47 PM
You have to extract the actual SaveGame.save file using a tool like modio.

He already said that he tried it on the extracted SaveGame.sav file......

FasuXe
10-12-2012, 12:49 PM
He already said that he tried it on the extracted SaveGame.sav file......

He didn't actually say he extracted it. For all we know, he tried to to just rename the file. I just know that error usually comes from not having extracted the SaveGame.sav inside the Save001.sav.

cobbis
10-12-2012, 05:37 PM
He didn't actually say he extracted it. For all we know, he tried to to just rename the file. I just know that error usually comes from not having extracted the SaveGame.sav inside the Save001.sav.

Yes I did extract the savegame.sav from my save0001.sav, I have a basic knowledge of all this stuff.

JordanElliott
10-12-2012, 06:18 PM
I've successfully edited saves for all character classes including the newest Mechromancer using the Python script given on here.

Definitely would be nice to have a UI around it at some point though :)

if i post my ps3 game save would you be able to edit it for me?

pclifford
10-12-2012, 07:19 PM
I have tried to use the scrpit that pclifford created but it keeps giving me an "invalid save game" error. I have tried using the save0001.sav and savegame.sav files but I get the same error. Any help is appreciated.

Have you tried the latest version from the site? Earlier versions didn't work properly under Windows, which could give the results you describe. And if that doesn't work either, can you upload your save somewhere for me to take a look at?

Wra
10-12-2012, 08:17 PM
Have you tried the latest version from the site? Earlier versions didn't work properly under Windows, which could give the results you describe. And if that doesn't work either, can you upload your save somewhere for me to take a look at?

Fancy making a brief tutorial on how to do this? :-) Super noob when it comes to python.

chaosknight118
10-12-2012, 10:39 PM
I agree with Wra on this could someone possibly give an explanation on how to do this i've been messing around with this script for 2 days now and still have not even come close to figuring this python stuff out

cobbis
10-13-2012, 01:38 AM
Have you tried the latest version from the site? Earlier versions didn't work properly under Windows, which could give the results you describe. And if that doesn't work either, can you upload your save somewhere for me to take a look at?

I think it is the early version and I am using windows. If you have the link for the newest I would appreciate it, Thanks.

pclifford
10-13-2012, 02:49 AM
I think it is the early version and I am using windows. If you have the link for the newest I would appreciate it, Thanks.

It's on the github page at https://github.com/pclifford/borderlands2 and I've removed the dependency on the lzo bindings, so it should be easier to get working under Windows now.

thedevil-is-here
10-13-2012, 11:02 AM
Iv downloaded and opened pclifford-borderlands2-d54ef9a in python and iv never used this before so iv extracted the borderlands 2 savegame with modio and i get the savegame.sav and i don't know what to do now i'm guessing somewhere in the script i have to put the location of the extracted save but i don't know were any help? or even better could someone post a youtube vid from start to finish.

pclifford
10-13-2012, 04:35 PM
Iv downloaded and opened pclifford-borderlands2-d54ef9a in python and iv never used this before so iv extracted the borderlands 2 savegame with modio and i get the savegame.sav and i don't know what to do now i'm guessing somewhere in the script i have to put the location of the extracted save but i don't know were any help? or even better could someone post a youtube vid from start to finish.

Here's what I did on an old Windows XP machine. I guess it's probably similar on Windows 7 but I don't have access to that.

Go to http://www.python.org/download/ and download either "Python 2.7.3 Windows Installer" or, if you're running 64-bit Windows, "Python 2.7.3 Windows X86-64 Installer".

Run that .msi file and if you go with the defaults it'll install Python under C:\Python27\

Read the instructions at https://github.com/pclifford/borderlands2

Click on the "ZIP" button to download the files, and put savefile.py in a directory alongside the SaveGame.sav file you want to modify/convert/view/whatever. I'll assume you created a directory called "bl2" on the C: drive for simplicity, and put both savefile.py and any saves you want to modify in there.

Click the Windows Start button down the bottom left and click "Run...". In the window that appears enter "cmd" in the "Open:" textbox and click OK.

In the black window that appears enter "c:", press return, then enter "cd \bl2" and press return.

Then take one of the commands from the instructions on the github page and where it starts with "python" type "c:\python27\python" instead, eg:

c:\python27\python savefile.py -m "" SaveGameFromAPC.sav SaveGameForAnXbox.sav

If you later find something you don't think is working, try downloading the script again from the github page as it has been updated frequently the past few days.

chaosknight118
10-13-2012, 05:27 PM
Thx pclifford for that explaination im currently trying it out now and after i entered what i wanted to edit i gave me a bunch of unreadable lines of code and it beeped a few time not sure if it worked or not but i'll plug it back in and give it a shot.

Edit: it actually does work awesome thankyou so much. The reason it gave me the weird code and noises was due to the fact i missed a step, make sure when you put everything in that you at the very end make a New file in the CMD window to put the changes in for example

my python is in c:\python27 and my savefile.py and my extracted save file is in c:\borderlands2 so my code was

c:\python27\python savefile.py -m skillpoints=75,backpack=200 c:\borderlands2\SaveGame.sav SaveGame1.sav

This gave me 75 skillpoints and a backpack of 200 capacity and put all the changes in a new file called SaveGame1.sav in the same folder as the original save.

hope this helps anyone else with questions, im going to enjoy my now newly overpowered mechcromancer =D

cobbis
10-13-2012, 05:58 PM
It's on the github page at https://github.com/pclifford/borderlands2 and I've removed the dependency on the lzo bindings, so it should be easier to get working under Windows now.

I believe it works now, I am testing as I respond. YES, it now works for me with windows. Thanks for this clifford.

Footer
10-13-2012, 06:15 PM
Hi,

I'm with Mac OS X 10.68 and I have some errors :

Traceback (most recent call last):
File "savefile.py", line 727, in <module>
main()
File "savefile.py", line 709, in main
output.write(modify_save(input.read(), changes, endian))
File "savefile.py", line 590, in modify_save
player = read_protobuf(unwrap_player_data(data))
File "savefile.py", line 317, in unwrap_player_data
raise BL2Error("Invalid save file")
__main__.BL2Error: Invalid save file

here is the python version :

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin

Any idea about what is wrong for me?

Thanks

truthdude
10-13-2012, 06:39 PM
Works fine for me on win7 Thanks so much!! i tryed changing the rare loot relic to 50 but it didnt work lol, guns worked fine tho :)

pclifford
10-13-2012, 06:44 PM
Hi,

I'm with Mac OS X 10.68 and I have some errors :

Traceback (most recent call last):
File "savefile.py", line 727, in <module>
main()
File "savefile.py", line 709, in main
output.write(modify_save(input.read(), changes, endian))
File "savefile.py", line 590, in modify_save
player = read_protobuf(unwrap_player_data(data))
File "savefile.py", line 317, in unwrap_player_data
raise BL2Error("Invalid save file")
__main__.BL2Error: Invalid save file

here is the python version :

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin

Any idea about what is wrong for me?

Thanks

You haven't extracted the save file from the Xbox save container. On a PC you'd use something like Horizon or Modio, and I don't know if there's an equivalent for the Mac. If you have access to a Windows machine (or virtual machine on your Mac) the simplest thing would be to install one of those programs on that and extract the SaveGame.sav file there. If you want to run the script on your Mac, then transfer the file over and make the changes there, then copy the resulting .sav file back to the PC and re-insert it into the save container with whichever of Horizon or Modio you chose.

kinkbikerider
10-13-2012, 07:09 PM
Anyone have a problem converting a pc save to a xbox save using the python script method?
I can get it to run the script and have no errors but the new file that gets created isnt in a xbox format.

Edit: I worked it out and got it working. :)

NCHelix
10-13-2012, 07:09 PM
Could probably create a fairly basic UI around this if pclifford had no objections. Would be much easier now that the lzo bindings dependency is gone. May help people with using it

AllEyezOnMe
10-13-2012, 07:21 PM
I admit I was a little skeptical that it works, but now I am convinced, changed eridium amount, added skillpoints and backpack, so my thanks go to kill_seth, pclifford and chaosknight118..thx guys.

Wra
10-13-2012, 07:55 PM
Take a look at this, you can make it a little easier and not have to type the directory for python in.

http://pythoncentral.org/how-to-install-python-2-7-on-windows-7-python-is-not-recognized-as-an-internal-or-external-command/

Footer
10-13-2012, 07:57 PM
I've extract the ad hoc save file with horizon via vmWare, copy the save on the Mac. Then, here is what I enter in the terminal on Mac:

Last login: Sat Oct 13 20:52:09 on ttys002
You have new mail.
mac-pro:~ Footer$ cd /Users/Footer/Downloads/pclifford-borderlands2-b550a05
mac-pro:pclifford-borderlands2-b550a05 Footer$ savefile.py -m eridium=99 /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0001.sav /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0002.sav
-bash: savefile.py: command not found

pclifford
10-13-2012, 08:53 PM
I've extract the ad hoc save file with horizon via vmWare, copy the save on the Mac. Then, here is what I enter in the terminal on Mac:

Last login: Sat Oct 13 20:52:09 on ttys002
You have new mail.
mac-pro:~ Footer$ cd /Users/Footer/Downloads/pclifford-borderlands2-b550a05
mac-pro:pclifford-borderlands2-b550a05 Footer$ savefile.py -m eridium=99 /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0001.sav /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0002.sav
-bash: savefile.py: command not found

The directory containing savefile.py isn't in your PATH variable, and the file may not be executable anyway. Two options:

1) Run: "chmod +x savefile.py" once to make it executable, and then you can run it as "./savefile.py" (note the ./ at the beginning, to tell the shell to find the program in the current directory)

2) Run it through python explicitly by starting the command as "python savefile.py" rather than just "savefile.py"

Footer
10-13-2012, 10:18 PM
Here is what I get now with chmod. I now have an empty save0003.sav file

mac-pro:pclifford-borderlands2-b550a05 Footer$ python savefile.py -m eridium=99 /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0001.sav /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0003.sav
Traceback (most recent call last):
File "savefile.py", line 727, in <module>
main()
File "savefile.py", line 709, in main
output.write(modify_save(input.read(), changes, endian))
File "savefile.py", line 590, in modify_save
player = read_protobuf(unwrap_player_data(data))
File "savefile.py", line 317, in unwrap_player_data
raise BL2Error("Invalid save file")
__main__.BL2Error: Invalid save file

I'll install Python into vmWare tomorrow to try it.

Thanks for your job.

Vuze
10-13-2012, 11:03 PM
pclifford:
Ive created a tool (with GUI) in VB that can successfully edit money, lvl, etc however the save becomes corrupt when i go to use it. Im guessing its due to checksums but how did you fix this in your python script and any ideas how i would do it in VB.
Thanks

oo_advent_oo
10-13-2012, 11:42 PM
After i put the new savegame.sav file back into the actual game save and try to put it in put it back on my flashdrive through horizon i get invalid stfs package. I've tried opening it in modio as well and it says something along the lines of invalid parameters. Anyone know why?


Edit: I actually got it to work, i just tried it a couple more times and it finally worked. Thanks for all the hard work guy, i REALLY appreciate it :)

reapermech
10-14-2012, 03:58 AM
this method that pclifford provided worked great for me minus the item level command (i may have entered it wrong) ..... its so fun to be able to do this on borderlands 2 now i wonder when we can edit our badass percentages ??

chaosknight118
10-14-2012, 05:19 AM
well badass rankings and points are all in your profile along with all the data on skins for all characters as well as the golden keys not your save files so i think that one may be a bit far off for now...the last thing people would want is a corrupted profile >_< but if they do come up with something for that i'll will definitely want to test that out =D

jmoney
10-14-2012, 06:18 AM
why is it that when i dl this file"pclifford" it says "savefile.py "but when i extract it,it only says "savefile" ??? and i keep getting error no such file or directory

Footer
10-14-2012, 11:28 AM
Here is what I get now with chmod. I now have an empty save0003.sav file

mac-pro:pclifford-borderlands2-b550a05 Footer$ python savefile.py -m eridium=99 /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0001.sav /Users/Footer/Downloads/pclifford-borderlands2-b550a05/Save0003.sav
Traceback (most recent call last):
File "savefile.py", line 727, in <module>
main()
File "savefile.py", line 709, in main
output.write(modify_save(input.read(), changes, endian))
File "savefile.py", line 590, in modify_save
player = read_protobuf(unwrap_player_data(data))
File "savefile.py", line 317, in unwrap_player_data
raise BL2Error("Invalid save file")
__main__.BL2Error: Invalid save file

I'll install Python into vmWare tomorrow to try it.

Thanks for your job.

After a good night with my problem in head, I try to drag and drop the save file form vmWare to Mac and now everything is OK. Before, I transferred the file with a shared folder between vmWare and Mac and it seems to corrupt the save file.

thedevil-is-here
10-14-2012, 02:58 PM
http://www.youtube.com/watch?v=aUONvF40q08
check the tut

jmoney
10-14-2012, 04:06 PM
i tried cant get this to work wierd hmmm oh well

oo_advent_oo
10-14-2012, 09:18 PM
why is it that when i dl this file"pclifford" it says "savefile.py "but when i extract it,it only says "savefile" ??? and i keep getting error no such file or directory


You extract the game save, such as Save0001.sav to get SaveGame.sav. not the savefile.py, hope this helps