Here is a python script to convert txt to gct.
import sys, binascii
if len(sys.argv) < 3 or sys.argv[1] not in ['f','c']:
print 'Usage: python gct.py <command> <data>'
print 'Commands:'
print '\tf\tRead codes from a file.'
print '\tc\tRead codes from command line.'
print '\t\tExample: python gct.py c 04337f18 05f5e0ff'
sys.exit(1)
if sys.argv[1] == 'f':
raw = open(sys.argv[2]).read().split('\n')
codes = ''
for c in raw:
c = c.replace(' ','')
if len(c) == 16:
try:
binascii.unhexlify(c)
codes += c
except:
print 'Error: Non-hex digit found in "%s %s"' % (c[:8], c[8:])
sys.exit(1)
elif sys.argv[1] == 'c':
try: codes = ''.join(sys.argv[2:])
except:
print 'Error: Non-hex digit found.'
sys.exit(1)
else:
print 'How did you get this far?'
sys.exit(1)
data = '\x00\xd0\xc0\xde\x00\xd0\xc0\xde'
data += binascii.unhexlify(codes)
data += '\xf0\x00\x00\x00\x00\x00\x00\x00'
while 1:
title = raw_input('Enter game ID: ')
if len(title) < 6: print 'Game ID too short!'
else: break
open('%s.gct' % title,'w').write(data)
print '%s.gct created.' % title