Last active
October 7, 2022 14:00
-
-
Save eur0pa/8382836 to your computer and use it in GitHub Desktop.
Dark Souls Deaths Counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import struct | |
def main(): | |
with open('DRAKS0005.sl2', 'rb') as fo: | |
fo.seek(0x2c0, 0) | |
for slot in range(0, 10): | |
fo.seek(0x100, 1) | |
name = fo.read(32) | |
if name[0] != '\00': | |
fo.seek(-0x120, 1) | |
fo.seek(0x1f128, 1) | |
deaths = fo.read(4) | |
fo.seek(-0x04, 1) | |
fo.seek(-0x1f128, 1) | |
print "name: %s\tdeaths: %d" % (name.decode('utf-16').split('\00')[0], struct.unpack('i', deaths)[0]) | |
else: | |
fo.seek(-0x120, 1) | |
fo.seek(0x60190, 1) | |
raw_input("Press Enter to continue...") | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made some changes to correctly reflect the 2015 savegame format in my fork based on your code as it did not work for me anymore (only for char in slot 1), maybe want to merge?