Created
June 8, 2015 06:51
-
-
Save therealmik/bfd90016b83af799828e to your computer and use it in GitHub Desktop.
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/python3 | |
import struct | |
import sys | |
import operator | |
dirent = struct.Struct("<II") | |
def getEntities(fd): | |
fd.seek(8) | |
offset, length = dirent.unpack(fd.read(8)) | |
fd.seek(offset) | |
return fd.read(length) | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print("Usage: {0:s} <file.bsp>".format(sys.argv[0])) | |
sys.exit(1) | |
with open(sys.argv[1], "rb") as fd: | |
print(str(getEntities(fd), "US-ASCII")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment