Skip to content

Commit

Permalink
BL3: Add protobuf parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Sep 9, 2023
1 parent 640fd83 commit 38b45ae
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BL3_find_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# See https://github.com/FromDarkHell/BL3SaveEditor for a lot of great info.
import argparse
from BL1_find_items import FunctionArg, Consumable
import Protobufs.OakSave_pb2 as pb2 # protoc -I=../BL3SaveEditor/BL3Tools ../BL3SaveEditor/BL3Tools/Protobufs/*.proto --python_out=.

class SaveFileFormatError(Exception): pass

Expand Down Expand Up @@ -39,7 +40,7 @@ def parse_savefile(fn):
remaining = data.int()
if remaining != len(data): raise SaveFileFormatError("Remaining length incorrect (got %d, expecting %d)" % remaining, len(data))
raw = bogodecrypt(data.peek())
print(raw[:256])
char = pb2.Character(); char.ParseFromString(raw)

def main(args=None):
parser = argparse.ArgumentParser(description="Borderlands 3 save file reader")
Expand Down
52 changes: 52 additions & 0 deletions Protobufs/OakProfile_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 38b45ae

Please sign in to comment.