import sys
def main():
try:
f = open(sys.argv[1],'rb')
except:
print "Usage: %s filename > var.h" %(sys.argv[0])
sys.exit(1)
x = f.read()
j = 0
filename = sys.argv[1].replace('.','_')
filename = filename.replace('\\','_')
sys.stdout.write("unsigned char __file[] = { \n\t")
for i in range(0,len(x)-1):
j+=1
t = "0x%02x," % ord(x[i])
sys.stdout.write(t)
if (j==16):
j=0
sys.stdout.write("\n\t")
t = "0x%02x" % ord(x[i])
sys.stdout.write(t)
sys.stdout.write("\n};")
f.close()
if __name__=='__main__':
main()
def main():
try:
f = open(sys.argv[1],'rb')
except:
print "Usage: %s filename > var.h" %(sys.argv[0])
sys.exit(1)
x = f.read()
j = 0
filename = sys.argv[1].replace('.','_')
filename = filename.replace('\\','_')
sys.stdout.write("unsigned char __file[] = { \n\t")
for i in range(0,len(x)-1):
j+=1
t = "0x%02x," % ord(x[i])
sys.stdout.write(t)
if (j==16):
j=0
sys.stdout.write("\n\t")
t = "0x%02x" % ord(x[i])
sys.stdout.write(t)
sys.stdout.write("\n};")
f.close()
if __name__=='__main__':
main()