import sys

dll = open(sys.argv[1], 'rb').read()

res = ''
for i,ch in enumerate(dll):
    res += hex(ord(ch))+ ','
    if i % 15 == 0:
        res += '\n'

res = res.rstrip()
res = res.rstrip(',')
res = "unsigned int vncbuffer_len = "  + str(len(dll)) + ";\nunsigned char vncbuffer[] = \n{" + res + "};"

print res


@@ -304,14 +304,15 @@
 %22%0A%0Aprint
- 
+(
 res
+)
 %0A%0A

Update gen_buffer.py to python3