title:
openedXBE = open("test.xbe", "rb") # open test.xbe for reading in binary mode
openedXBE.seek(400, 0) # set startingpoint for reading
xbeText = openedXBE.read(80) # Read out the entire section assigned to the Title
openedXBE.close() # Never forget to close a file you opened.
binText = xbeText[::2] # copy every odd character to a new string
xbeText = "" # empty the xbeText string
for s in binText: # iterate the string
if ord(s) in range(32, 127): #if the current character is in the ascii range
xbeName += s # add the character to xbeName
titleID:
fh = open("Q:\\scripts\\default.xbe",'rb') #open xbe
fh.seek(0x104) # seek to first dword
s1 = fh.read(4) #read dword
s1 = struct.unpack('L',s1) #unpack byte into integer
fh.close() #close file
fh = open("Q:\\scripts\\default.xbe",'rb') # open xbe
fh.seek(0x118) # seek to second dword
s2 = fh.read(4) # read dword
s2 = struct.unpack('L',s2) # unpack byte to integer
fh.close() # close file
s3 = int(s2[0]) - int(s1[0]) + 8 # calculate final dword
fh = open("Q:\\scripts\\default.xbe",'rb') # open xbe
fh.seek(s3) # seek to final dword
theS = fh.read(4) # read dword
theS = struct.unpack('L',theS) # unpack byte to integer
fh.close() # close file
theS = hex(theS[0]) # make a hex number of it
theS = theS.replace("x","") # remove the 0x
theS = theS.replace("L","") # getting a junk L on the end of the string, no idea why