Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from struct import unpack
- with open('hud_questinfo.gui', 'rb') as content_file:
- #with open('hud_name.gui', 'rb') as content_file:
- content = content_file.read()
- if content[0:3]!='GUI':
- sys.exit(0)
- off = content[8:8+4]
- offI = unpack("I",off)
- print("FileSize: %08x" % offI)
- poff = content[0xC8:0xC8+4]
- poffI = unpack("I",poff)[0]
- off = content[0x168:0x168+4]
- offI = unpack("I",off)[0]
- i=offI
- print("PropertiesValArray: %08x" % poffI)
- print("PropertiesTextArray: %08x" % i)
- print("Len of content: %08x" % len(content))
- texts=[]
- textdict={}
- while (i<len(content))and(content[i]!='\x00'):
- s=""
- while content[i]!='\x00':
- s += content[i]
- i += 1
- texts.append((i-offI-len(s),s))
- textdict[i-offI-len(s)] = s
- i+=1
- print("Texts:")
- for (i,s) in texts:
- print("%08x %s" % (i,s))
- print("Property values:")
- i = poffI
- while (i<len(content))and(content[i]!='\x00'):
- u = unpack("I",content[i:i+4])[0]
- i+=16
- toff = unpack("I",content[i:i+4])[0]
- i+=8
- v = unpack("I",content[i:i+4])[0]
- if toff == 0:
- break
- if toff not in textdict:
- print("%08x not found" % toff)
- break;
- t=textdict[toff]
- print("offset: 0x%08x roffset: 0x%08x unkn:% 4d text:%40s val:% 4d [0x%08x]" % (i-8-16,i-poffI-8-16,u,t,v,v))
- i+=8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement