/scripts/bin2c.c

主宰稳场 提交于 2019-11-29 21:40:54

/*
 * Unloved program to convert a binary on stdin to a C include on stdout
 *
 * Jan 1999 Matt Mackall <
mpm@selenic.com>
 *
 * This software may be used and distributed according to the terms
 * of the GNU General Public License, incorporated herein by reference.
 */
/*
*此函数用于将一个二进制文件转化为一个C字符串数组,如可将图像文件转化为一个字符数组形式
*运行例子如下:
*cat bin2c | ./bin2c test
*将得到如下结果:
*const char test[] =
        "/x7f/x45/x4c/x46/x01/x01/x01/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x02/x00/x03/x00/x01/x00/x00/x00/x50/x83/x04/x08/x34/x00/x00/x00"
        "/xa8/x09/x00/x00/x00/x00/x00/x00/x34/x00/x20/x00/x08/x00/x28/x00"
        "/x1e/x00/x1b/x00/x06/x00/x00/x00/x34/x00/x00/x00/x34/x80/x04/x08"
        "/x34/x80/x04/x08/x00/x01/x00/x00/x00/x01/x00/x00/x05/x00/x00/x00"
        "/x04/x00/x00/x00/x03/x00/x00/x00/x34/x01/x00/x00/x34/x81/x04/x08"
        "/x34/x81/x04/x08/x13/x00/x00/x00/x13/x00/x00/x00/x04/x00/x00/x00"
        "/x01/x00/x00/x00/x01/x00/x00/x00/x00/x00/x00/x00/x00/x80/x04/x08"
        "/x00/x80/x04/x08/x94/x06/x00/x00/x94/x06/x00/x00/x05/x00/x00/x00"
        "/x00/x10/x00/x00/x01/x00/x00/x00/x94/x06/x00/x00/x94/x96/x04/x08"
        "/x94/x96/x04/x08/x04/x01/x00/x00/x0c/x01/x00/x00/x06/x00/x00/x00"
        "/x00/x10/x00/x00/x02/x00/x00/x00/xa8/x06/x00/x00/xa8/x96/x04/x08"
        "/xa8/x96/x04/x08/xc8/x00/x00/x00/xc8/x00/x00/x00/x06/x00/x00/x00"
        "/x04/x00/x00/x00/x04/x00/x00/x00/x48/x01/x00/x00/x48/x81/x04/x08"
        "/x48/x81/x04/x08/x44/x00/x00/x00/x44/x00/x00/x00/x04/x00/x00/x00"
        "/x04/x00/x00/x00/x50/xe5/x74/x64/x20/x06/x00/x00/x20/x86/x04/x08"
        "/x20/x86/x04/x08/x1c/x00/x00/x00/x1c/x00/x00/x00/x04/x00/x00/x00"
        "/x04/x00/x00/x00/x51/xe5/x74/x64/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x06/x00/x00/x00"
        "/x04/x00/x00/x00/x2f/x6c/x69/x62/x2f/x6c/x64/x2d/x6c/x69/x6e/x75"
        "/x78/x2e/x73/x6f/x2e/x32/x00/x00/x04/x00/x00/x00/x10/x00/x00/x00"
        "/x01/x00/x00/x00/x47/x4e/x55/x00/x00/x00/x00/x00/x02/x00/x00/x00"
        "/x06/x00/x00/x00/x09/x00/x00/x00/x04/x00/x00/x00/x14/x00/x00/x00"
        "/x03/x00/x00/x00/x47/x4e/x55/x00/x6e/x84/xaa/x6c/xd3/x1f/x77/xe5"
        "/x28/x02/x6b/xe5/x6a/xf2/x8d/x97/xde/x18/xda/xd5/x02/x00/x00/x00"
        "/x06/x00/x00/x00/x01/x00/x00/x00/x05/x00/x00/x00/x00/x20/x00/x20"
        "/x00/x00/x00/x00/x06/x00/x00/x00/xad/x4b/xe3/xc0/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x35/x00/x00/x00"
        "/x00/x00/x00/x00/xf2/x00/x00/x00/x12/x00/x00/x00/x01/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x20/x00/x00/x00/x3d/x00/x00/x00"
        "/x00/x00/x00/x00/xb6/x01/x00/x00/x12/x00/x00/x00/x2e/x00/x00/x00"
        "/x00/x00/x00/x00/x39/x00/x00/x00/x12/x00/x00/x00/x29/x00/x00/x00"
        "/x00/x00/x00/x00/x8f/x01/x00/x00/x12/x00/x00/x00/x1a/x00/x00/x00"
        "/xd8/x85/x04/x08/x04/x00/x00/x00/x11/x00/x0f/x00/x00/x5f/x5f/x67"
        "/x6d/x6f/x6e/x5f/x73/x74/x61/x72/x74/x5f/x5f/x00/x6c/x69/x62/x63"
        "/x2e/x73/x6f/x2e/x36/x00/x5f/x49/x4f/x5f/x73/x74/x64/x69/x6e/x5f"
        "/x75/x73/x65/x64/x00/x70/x75/x74/x73/x00/x70/x72/x69/x6e/x74/x66"
        "/x00/x67/x65/x74/x63/x68/x61/x72/x00/x5f/x5f/x6c/x69/x62/x63/x5f"
        "/x73/x74/x61/x72/x74/x5f/x6d/x61/x69/x6e/x00/x47/x4c/x49/x42/x43"
        "/x5f/x32/x2e/x30/x00/x00/x00/x00/x02/x00/x00/x00/x02/x00/x02/x00"
        "/x02/x00/x01/x00/x01/x00/x01/x00/x10/x00/x00/x00/x10/x00/x00/x00"
        "/x00/x00/x00/x00/x10/x69/x69/x0d/x00/x00/x02/x00/x4f/x00/x00/x00"
        "/x00/x00/x00/x00/x70/x97/x04/x08/x06/x02/x00/x00/x80/x97/x04/x08"
        "/x07/x01/x00/x00/x84/x97/x04/x08/x07/x02/x00/x00/x88/x97/x04/x08"
        "/x07/x03/x00/x00/x8c/x97/x04/x08/x07/x04/x00/x00/x90/x97/x04/x08"
        "/x07/x05/x00/x00/x55/x89/xe5/x83/xec/x08/xe8/x95/x00/x00/x00/xe8"
        "/x1c/x01/x00/x00/xe8/xa7/x02/x00/x00/xc9/xc3/x00/xff/x35/x78/x97"
        "/x04/x08/xff/x25/x7c/x97/x04/x08/x00/x00/x00/x00/xff/x25/x80/x97"
        "/x04/x08/x68/x00/x00/x00/x00/xe9/xe0/xff/xff/xff/xff/x25/x84/x97"
        "/x04/x08/x68/x08/x00/x00/x00/xe9/xd0/xff/xff/xff/xff/x25/x88/x97"
        "/x04/x08/x68/x10/x00/x00/x00/xe9/xc0/xff/xff/xff/xff/x25/x8c/x97"
        "/x04/x08/x68/x18/x00/x00/x00/xe9/xb0/xff/xff/xff/xff/x25/x90/x97"
        "/x04/x08/x68/x20/x00/x00/x00/xe9/xa0/xff/xff/xff/x00/x00/x00/x00"
        "/x31/xed/x5e/x89/xe1/x83/xe4/xf0/x50/x54/x52/x68/x10/x85/x04/x08"
        "/x68/x20/x85/x04/x08/x51/x56/x68/x24/x84/x04/x08/xe8/xab/xff/xff"
        "/xff/xf4/x90/x90/x55/x89/xe5/x53/x83/xec/x04/xe8/x00/x00/x00/x00"
        "/x5b/x81/xc3/xf4/x13/x00/x00/x8b/x93/xfc/xff/xff/xff/x85/xd2/x74"
        "/x05/xe8/x76/xff/xff/xff/x58/x5b/xc9/xc3/x90/x90/x90/x90/x90/x90"
        "/x55/x89/xe5/x53/x83/xec/x04/x80/x3d/x9c/x97/x04/x08/x00/x75/x3f"
        "/xb8/xa0/x96/x04/x08/x2d/x9c/x96/x04/x08/xc1/xf8/x02/x8d/x58/xff"
        "/xa1/x98/x97/x04/x08/x39/xc3/x76/x1f/x8d/xb4/x26/x00/x00/x00/x00"
        "/x83/xc0/x01/xa3/x98/x97/x04/x08/xff/x14/x85/x9c/x96/x04/x08/xa1"
        "/x98/x97/x04/x08/x39/xc3/x77/xe8/xc6/x05/x9c/x97/x04/x08/x01/x83"
        "/xc4/x04/x5b/x5d/xc3/x8d/x74/x26/x00/x8d/xbc/x27/x00/x00/x00/x00"
        "/x55/x89/xe5/x83/xec/x08/xa1/xa4/x96/x04/x08/x85/xc0/x74/x12/xb8"
        "/x00/x00/x00/x00/x85/xc0/x74/x09/xc7/x04/x24/xa4/x96/x04/x08/xff"
        "/xd0/xc9/xc3/x90/x8d/x4c/x24/x04/x83/xe4/xf0/xff/x71/xfc/x55/x89"
        "/xe5/x51/x83/xec/x24/x89/x4d/xe4/xc7/x45/xf8/x00/x00/x00/x00/x8b"
        "/x45/xe4/x83/x38/x01/x7e/x41/x8b/x55/xe4/x83/x3a/x02/x7e/x10/x8b"
        "/x55/xe4/x8b/x42/x04/x83/xc0/x08/x8b/x00/x89/x45/xe8/xeb/x07/xc7"
        "/x45/xe8/xe0/x85/x04/x08/x8b/x55/xe4/x8b/x42/x04/x83/xc0/x04/x8b"
        "/x00/x8b/x55/xe8/x89/x54/x24/x08/x89/x44/x24/x04/xc7/x04/x24/xe1"
        "/x85/x04/x08/xe8/xa4/xfe/xff/xff/xc7/x04/x24/xf6/x85/x04/x08/xe8"
        "/x98/xfe/xff/xff/xeb/x21/x83/x45/xf8/x01/x8b/x45/xf4/x89/x44/x24"
        "/x04/xc7/x04/x24/xf9/x85/x04/x08/xe8/x7f/xfe/xff/xff/x8b/x45/xf8"
        "/x83/xe0/x0f/x85/xc0/x74/x0e/xe8/x40/xfe/xff/xff/x89/x45/xf4/x83"
        "/x7d/xf4/xff/x75/xd1/xc7/x04/x24/x00/x86/x04/x08/xe8/x6b/xfe/xff"
        "/xff/x83/x7d/xf4/xff/x75/xb1/x8b/x45/xe4/x83/x38/x01/x7e/x22/x8b"
        "/x55/xe4/x8b/x42/x04/x83/xc0/x04/x8b/x10/x8b/x45/xf8/x89/x44/x24"
        "/x08/x89/x54/x24/x04/xc7/x04/x24/x02/x86/x04/x08/xe8/x2b/xfe/xff"
        "/xff/xb8/x00/x00/x00/x00/x83/xc4/x24/x59/x5d/x8d/x61/xfc/xc3/x90"
        "/x55/x89/xe5/x5d/xc3/x8d/x74/x26/x00/x8d/xbc/x27/x00/x00/x00/x00"
        "/x55/x89/xe5/x57/x56/x53/xe8/x5e/x00/x00/x00/x81/xc3/x49/x12/x00"
        "/x00/x83/xec/x1c/xe8/x9b/xfd/xff/xff/x8d/x83/x20/xff/xff/xff/x89"
        "/x45/xf0/x8d/x83/x20/xff/xff/xff/x29/x45/xf0/xc1/x7d/xf0/x02/x8b"
        "/x55/xf0/x85/xd2/x74/x2b/x31/xff/x89/xc6/x8d/xb6/x00/x00/x00/x00"
        "/x8b/x45/x10/x83/xc7/x01/x89/x44/x24/x08/x8b/x45/x0c/x89/x44/x24"
        "/x04/x8b/x45/x08/x89/x04/x24/xff/x16/x83/xc6/x04/x39/x7d/xf0/x75"
        "/xdf/x83/xc4/x1c/x5b/x5e/x5f/x5d/xc3/x8b/x1c/x24/xc3/x90/x90/x90"
        "/x55/x89/xe5/x53/xbb/x94/x96/x04/x08/x83/xec/x04/xa1/x94/x96/x04"
        "/x08/x83/xf8/xff/x74/x0c/x83/xeb/x04/xff/xd0/x8b/x03/x83/xf8/xff"
        "/x75/xf4/x83/xc4/x04/x5b/x5d/xc3/x55/x89/xe5/x53/x83/xec/x04/xe8"
        "/x00/x00/x00/x00/x5b/x81/xc3/xb0/x11/x00/x00/xe8/xd0/xfd/xff/xff"
        "/x59/x5b/xc9/xc3/x03/x00/x00/x00/x01/x00/x02/x00/x00/x00/x00/x00"
        "/x00/x63/x6f/x6e/x73/x74/x20/x63/x68/x61/x72/x20/x25/x73/x5b/x5d"
        "/x20/x25/x73/x3d/x0a/x00/x09/x22/x00/x5c/x78/x25/x30/x32/x78/x00"
        "/x22/x00/x09/x3b/x0a/x0a/x63/x6f/x6e/x73/x74/x20/x69/x6e/x74/x20"
        "/x25/x73/x5f/x73/x69/x7a/x65/x20/x3d/x20/x25/x64/x3b/x0a/x00/x00"
        "/x01/x1b/x03/x3b/x18/x00/x00/x00/x02/x00/x00/x00/xf0/xfe/xff/xff"
        "/x34/x00/x00/x00/x00/xff/xff/xff/x50/x00/x00/x00/x14/x00/x00/x00"
        "/x00/x00/x00/x00/x01/x7a/x52/x00/x01/x7c/x08/x01/x1b/x0c/x04/x04"
        "/x88/x01/x00/x00/x18/x00/x00/x00/x1c/x00/x00/x00/xb4/xfe/xff/xff"
        "/x05/x00/x00/x00/x00/x41/x0e/x08/x85/x02/x42/x0d/x05/x00/x00/x00"
        "/x1c/x00/x00/x00/x38/x00/x00/x00/xa8/xfe/xff/xff/x69/x00/x00/x00"
        "/x00/x41/x0e/x08/x85/x02/x42/x0d/x05/x43/x83/x05/x86/x04/x87/x03"
        "/x00/x00/x00/x00/xff/xff/xff/xff/x00/x00/x00/x00/xff/xff/xff/xff"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x01/x00/x00/x00/x10/x00/x00/x00"
        "/x0c/x00/x00/x00/xd4/x82/x04/x08/x0d/x00/x00/x00/xb8/x85/x04/x08"
        "/xf5/xfe/xff/x6f/x8c/x81/x04/x08/x05/x00/x00/x00/x1c/x82/x04/x08"
        "/x06/x00/x00/x00/xac/x81/x04/x08/x0a/x00/x00/x00/x59/x00/x00/x00"
        "/x0b/x00/x00/x00/x10/x00/x00/x00/x15/x00/x00/x00/x00/x00/x00/x00"
        "/x03/x00/x00/x00/x74/x97/x04/x08/x02/x00/x00/x00/x28/x00/x00/x00"
        "/x14/x00/x00/x00/x11/x00/x00/x00/x17/x00/x00/x00/xac/x82/x04/x08"
        "/x11/x00/x00/x00/xa4/x82/x04/x08/x12/x00/x00/x00/x08/x00/x00/x00"
        "/x13/x00/x00/x00/x08/x00/x00/x00/xfe/xff/xff/x6f/x84/x82/x04/x08"
        "/xff/xff/xff/x6f/x01/x00/x00/x00/xf0/xff/xff/x6f/x76/x82/x04/x08"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/xa8/x96/x04/x08/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x02/x83/x04/x08/x12/x83/x04/x08/x22/x83/x04/x08/x32/x83/x04/x08"
        "/x42/x83/x04/x08/x00/x00/x00/x00/x00/x47/x43/x43/x3a/x20/x28/x47"
        "/x4e/x55/x29/x20/x34/x2e/x31/x2e/x32/x20/x32/x30/x30/x37/x30/x39"
        "/x32/x35/x20/x28/x52/x65/x64/x20/x48/x61/x74/x20/x34/x2e/x31/x2e"
        "/x32/x2d/x33/x32/x29/x00/x00/x47/x43/x43/x3a/x20/x28/x47/x4e/x55"
        "/x29/x20/x34/x2e/x31/x2e/x32/x20/x32/x30/x30/x37/x30/x39/x32/x35"
        "/x20/x28/x52/x65/x64/x20/x48/x61/x74/x20/x34/x2e/x31/x2e/x32/x2d"
        "/x33/x32/x29/x00/x00/x47/x43/x43/x3a/x20/x28/x47/x4e/x55/x29/x20"
        "/x34/x2e/x31/x2e/x32/x20/x32/x30/x30/x37/x30/x39/x32/x35/x20/x28"
        "/x52/x65/x64/x20/x48/x61/x74/x20/x34/x2e/x31/x2e/x32/x2d/x33/x33"
        "/x29/x00/x00/x47/x43/x43/x3a/x20/x28/x47/x4e/x55/x29/x20/x34/x2e"
        "/x31/x2e/x32/x20/x32/x30/x30/x37/x30/x39/x32/x35/x20/x28/x52/x65"
        "/x64/x20/x48/x61/x74/x20/x34/x2e/x31/x2e/x32/x2d/x33/x33/x29/x00"
        "/x00/x47/x43/x43/x3a/x20/x28/x47/x4e/x55/x29/x20/x34/x2e/x31/x2e"
        "/x32/x20/x32/x30/x30/x37/x30/x39/x32/x35/x20/x28/x52/x65/x64/x20"
        "/x48/x61/x74/x20/x34/x2e/x31/x2e/x32/x2d/x33/x33/x29/x00/x00/x47"
        "/x43/x43/x3a/x20/x28/x47/x4e/x55/x29/x20/x34/x2e/x31/x2e/x32/x20"
        "/x32/x30/x30/x37/x30/x39/x32/x35/x20/x28/x52/x65/x64/x20/x48/x61"
        "/x74/x20/x34/x2e/x31/x2e/x32/x2d/x33/x32/x29/x00/x00/x2e/x73/x79"
        "/x6d/x74/x61/x62/x00/x2e/x73/x74/x72/x74/x61/x62/x00/x2e/x73/x68"
        "/x73/x74/x72/x74/x61/x62/x00/x2e/x69/x6e/x74/x65/x72/x70/x00/x2e"
        "/x6e/x6f/x74/x65/x2e/x41/x42/x49/x2d/x74/x61/x67/x00/x2e/x6e/x6f"
        "/x74/x65/x2e/x67/x6e/x75/x2e/x62/x75/x69/x6c/x64/x2d/x69/x64/x00"
        "/x2e/x67/x6e/x75/x2e/x68/x61/x73/x68/x00/x2e/x64/x79/x6e/x73/x79"
        "/x6d/x00/x2e/x64/x79/x6e/x73/x74/x72/x00/x2e/x67/x6e/x75/x2e/x76"
        "/x65/x72/x73/x69/x6f/x6e/x00/x2e/x67/x6e/x75/x2e/x76/x65/x72/x73"
        "/x69/x6f/x6e/x5f/x72/x00/x2e/x72/x65/x6c/x2e/x64/x79/x6e/x00/x2e"
        "/x72/x65/x6c/x2e/x70/x6c/x74/x00/x2e/x69/x6e/x69/x74/x00/x2e/x74"
        "/x65/x78/x74/x00/x2e/x66/x69/x6e/x69/x00/x2e/x72/x6f/x64/x61/x74"
        "/x61/x00/x2e/x65/x68/x5f/x66/x72/x61/x6d/x65/x5f/x68/x64/x72/x00"
        "/x2e/x65/x68/x5f/x66/x72/x61/x6d/x65/x00/x2e/x63/x74/x6f/x72/x73"
        "/x00/x2e/x64/x74/x6f/x72/x73/x00/x2e/x6a/x63/x72/x00/x2e/x64/x79"
        "/x6e/x61/x6d/x69/x63/x00/x2e/x67/x6f/x74/x00/x2e/x67/x6f/x74/x2e"
        "/x70/x6c/x74/x00/x2e/x64/x61/x74/x61/x00/x2e/x62/x73/x73/x00/x2e"
        "/x63/x6f/x6d/x6d/x65/x6e/x74/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x1b/x00/x00/x00/x01/x00/x00/x00/x02/x00/x00/x00/x34/x81/x04/x08"
        "/x34/x01/x00/x00/x13/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x01/x00/x00/x00/x00/x00/x00/x00/x23/x00/x00/x00/x07/x00/x00/x00"
        "/x02/x00/x00/x00/x48/x81/x04/x08/x48/x01/x00/x00/x20/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/x31/x00/x00/x00/x07/x00/x00/x00/x02/x00/x00/x00/x68/x81/x04/x08"
        "/x68/x01/x00/x00/x24/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/x44/x00/x00/x00/xf6/xff/xff/x6f"
        "/x02/x00/x00/x00/x8c/x81/x04/x08/x8c/x01/x00/x00/x20/x00/x00/x00"
        "/x05/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x04/x00/x00/x00"
        "/x4e/x00/x00/x00/x0b/x00/x00/x00/x02/x00/x00/x00/xac/x81/x04/x08"
        "/xac/x01/x00/x00/x70/x00/x00/x00/x06/x00/x00/x00/x01/x00/x00/x00"
        "/x04/x00/x00/x00/x10/x00/x00/x00/x56/x00/x00/x00/x03/x00/x00/x00"
        "/x02/x00/x00/x00/x1c/x82/x04/x08/x1c/x02/x00/x00/x59/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x01/x00/x00/x00/x00/x00/x00/x00"
        "/x5e/x00/x00/x00/xff/xff/xff/x6f/x02/x00/x00/x00/x76/x82/x04/x08"
        "/x76/x02/x00/x00/x0e/x00/x00/x00/x05/x00/x00/x00/x00/x00/x00/x00"
        "/x02/x00/x00/x00/x02/x00/x00/x00/x6b/x00/x00/x00/xfe/xff/xff/x6f"
        "/x02/x00/x00/x00/x84/x82/x04/x08/x84/x02/x00/x00/x20/x00/x00/x00"
        "/x06/x00/x00/x00/x01/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/x7a/x00/x00/x00/x09/x00/x00/x00/x02/x00/x00/x00/xa4/x82/x04/x08"
        "/xa4/x02/x00/x00/x08/x00/x00/x00/x05/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x08/x00/x00/x00/x83/x00/x00/x00/x09/x00/x00/x00"
        "/x02/x00/x00/x00/xac/x82/x04/x08/xac/x02/x00/x00/x28/x00/x00/x00"
        "/x05/x00/x00/x00/x0c/x00/x00/x00/x04/x00/x00/x00/x08/x00/x00/x00"
        "/x8c/x00/x00/x00/x01/x00/x00/x00/x06/x00/x00/x00/xd4/x82/x04/x08"
        "/xd4/x02/x00/x00/x17/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/x87/x00/x00/x00/x01/x00/x00/x00"
        "/x06/x00/x00/x00/xec/x82/x04/x08/xec/x02/x00/x00/x60/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x04/x00/x00/x00"
        "/x92/x00/x00/x00/x01/x00/x00/x00/x06/x00/x00/x00/x50/x83/x04/x08"
        "/x50/x03/x00/x00/x68/x02/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x10/x00/x00/x00/x00/x00/x00/x00/x98/x00/x00/x00/x01/x00/x00/x00"
        "/x06/x00/x00/x00/xb8/x85/x04/x08/xb8/x05/x00/x00/x1c/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/x9e/x00/x00/x00/x01/x00/x00/x00/x02/x00/x00/x00/xd4/x85/x04/x08"
        "/xd4/x05/x00/x00/x4b/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/xa6/x00/x00/x00/x01/x00/x00/x00"
        "/x02/x00/x00/x00/x20/x86/x04/x08/x20/x06/x00/x00/x1c/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/xb4/x00/x00/x00/x01/x00/x00/x00/x02/x00/x00/x00/x3c/x86/x04/x08"
        "/x3c/x06/x00/x00/x58/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/xbe/x00/x00/x00/x01/x00/x00/x00"
        "/x03/x00/x00/x00/x94/x96/x04/x08/x94/x06/x00/x00/x08/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/xc5/x00/x00/x00/x01/x00/x00/x00/x03/x00/x00/x00/x9c/x96/x04/x08"
        "/x9c/x06/x00/x00/x08/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/xcc/x00/x00/x00/x01/x00/x00/x00"
        "/x03/x00/x00/x00/xa4/x96/x04/x08/xa4/x06/x00/x00/x04/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/xd1/x00/x00/x00/x06/x00/x00/x00/x03/x00/x00/x00/xa8/x96/x04/x08"
        "/xa8/x06/x00/x00/xc8/x00/x00/x00/x06/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x08/x00/x00/x00/xda/x00/x00/x00/x01/x00/x00/x00"
        "/x03/x00/x00/x00/x70/x97/x04/x08/x70/x07/x00/x00/x04/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x04/x00/x00/x00"
        "/xdf/x00/x00/x00/x01/x00/x00/x00/x03/x00/x00/x00/x74/x97/x04/x08"
        "/x74/x07/x00/x00/x20/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x04/x00/x00/x00/xe8/x00/x00/x00/x01/x00/x00/x00"
        "/x03/x00/x00/x00/x94/x97/x04/x08/x94/x07/x00/x00/x04/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x04/x00/x00/x00/x00/x00/x00/x00"
        "/xee/x00/x00/x00/x08/x00/x00/x00/x03/x00/x00/x00/x98/x97/x04/x08"
        "/x98/x07/x00/x00/x08/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x04/x00/x00/x00/x00/x00/x00/x00/xf3/x00/x00/x00/x01/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x98/x07/x00/x00/x14/x01/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x01/x00/x00/x00/x00/x00/x00/x00"
        "/x11/x00/x00/x00/x03/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/xac/x08/x00/x00/xfc/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x01/x00/x00/x00/x00/x00/x00/x00/x01/x00/x00/x00/x02/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x58/x0e/x00/x00/x40/x04/x00/x00"
        "/x1d/x00/x00/x00/x2e/x00/x00/x00/x04/x00/x00/x00/x10/x00/x00/x00"
        "/x09/x00/x00/x00/x03/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x98/x12/x00/x00/x30/x02/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x01/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x34/x81/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x01/x00/x00/x00/x00/x00/x48/x81/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x02/x00/x00/x00/x00/x00/x68/x81/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x03/x00/x00/x00/x00/x00/x8c/x81/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x04/x00/x00/x00/x00/x00/xac/x81/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x05/x00/x00/x00/x00/x00/x1c/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x06/x00/x00/x00/x00/x00/x76/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x07/x00/x00/x00/x00/x00/x84/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x08/x00/x00/x00/x00/x00/xa4/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x09/x00/x00/x00/x00/x00/xac/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0a/x00/x00/x00/x00/x00/xd4/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0b/x00/x00/x00/x00/x00/xec/x82/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0c/x00/x00/x00/x00/x00/x50/x83/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0d/x00/x00/x00/x00/x00/xb8/x85/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0e/x00/x00/x00/x00/x00/xd4/x85/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x0f/x00/x00/x00/x00/x00/x20/x86/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x10/x00/x00/x00/x00/x00/x3c/x86/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x11/x00/x00/x00/x00/x00/x94/x96/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x12/x00/x00/x00/x00/x00/x9c/x96/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x13/x00/x00/x00/x00/x00/xa4/x96/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x14/x00/x00/x00/x00/x00/xa8/x96/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x15/x00/x00/x00/x00/x00/x70/x97/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x16/x00/x00/x00/x00/x00/x74/x97/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x17/x00/x00/x00/x00/x00/x94/x97/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x18/x00/x00/x00/x00/x00/x98/x97/x04/x08"
        "/x00/x00/x00/x00/x03/x00/x19/x00/x00/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x03/x00/x1a/x00/x01/x00/x00/x00/x74/x83/x04/x08"
        "/x00/x00/x00/x00/x02/x00/x0d/x00/x11/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x04/x00/xf1/xff/x1c/x00/x00/x00/x94/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x12/x00/x2a/x00/x00/x00/x9c/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x13/x00/x38/x00/x00/x00/xa4/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x14/x00/x45/x00/x00/x00/x98/x97/x04/x08"
        "/x04/x00/x00/x00/x01/x00/x19/x00/x53/x00/x00/x00/x9c/x97/x04/x08"
        "/x01/x00/x00/x00/x01/x00/x19/x00/x62/x00/x00/x00/xa0/x83/x04/x08"
        "/x00/x00/x00/x00/x02/x00/x0d/x00/x78/x00/x00/x00/x00/x84/x04/x08"
        "/x00/x00/x00/x00/x02/x00/x0d/x00/x11/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x04/x00/xf1/xff/x84/x00/x00/x00/x98/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x12/x00/x91/x00/x00/x00/x90/x86/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x11/x00/x9f/x00/x00/x00/xa4/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x00/x14/x00/xab/x00/x00/x00/x90/x85/x04/x08"
        "/x00/x00/x00/x00/x02/x00/x0d/x00/xc1/x00/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x04/x00/xf1/xff/xc9/x00/x00/x00/x74/x97/x04/x08"
        "/x00/x00/x00/x00/x01/x02/x17/x00/xdf/x00/x00/x00/x94/x96/x04/x08"
        "/x00/x00/x00/x00/x00/x02/x12/x00/xf0/x00/x00/x00/x94/x96/x04/x08"
        "/x00/x00/x00/x00/x00/x02/x12/x00/x03/x01/x00/x00/xa8/x96/x04/x08"
        "/x00/x00/x00/x00/x01/x02/x15/x00/x0c/x01/x00/x00/x94/x97/x04/x08"
        "/x00/x00/x00/x00/x20/x00/x18/x00/x17/x01/x00/x00/x10/x85/x04/x08"
        "/x05/x00/x00/x00/x12/x00/x0d/x00/x27/x01/x00/x00/x50/x83/x04/x08"
        "/x00/x00/x00/x00/x12/x00/x0d/x00/x2e/x01/x00/x00/x00/x00/x00/x00"
        "/xf2/x00/x00/x00/x12/x00/x00/x00/x41/x01/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x20/x00/x00/x00/x50/x01/x00/x00/x00/x00/x00/x00"
        "/x00/x00/x00/x00/x20/x00/x00/x00/x64/x01/x00/x00/xd4/x85/x04/x08"
        "/x04/x00/x00/x00/x11/x00/x0f/x00/x6b/x01/x00/x00/xb8/x85/x04/x08"
        "/x00/x00/x00/x00/x12/x00/x0e/x00/x71/x01/x00/x00/x00/x00/x00/x00"
        "/xb6/x01/x00/x00/x12/x00/x00/x00/x8e/x01/x00/x00/xd8/x85/x04/x08"
        "/x04/x00/x00/x00/x11/x00/x0f/x00/x9d/x01/x00/x00/x94/x97/x04/x08"
        "/x00/x00/x00/x00/x10/x00/x18/x00/xaa/x01/x00/x00/xdc/x85/x04/x08"
        "/x00/x00/x00/x00/x11/x02/x0f/x00/xb7/x01/x00/x00/xa0/x96/x04/x08"
        "/x00/x00/x00/x00/x11/x02/x13/x00/xc4/x01/x00/x00/x20/x85/x04/x08"
        "/x69/x00/x00/x00/x12/x00/x0d/x00/xd4/x01/x00/x00/x00/x00/x00/x00"
        "/x39/x00/x00/x00/x12/x00/x00/x00/xe6/x01/x00/x00/x98/x97/x04/x08"
        "/x00/x00/x00/x00/x10/x00/xf1/xff/xf2/x01/x00/x00/xa0/x97/x04/x08"
        "/x00/x00/x00/x00/x10/x00/xf1/xff/xf7/x01/x00/x00/x00/x00/x00/x00"
        "/x8f/x01/x00/x00/x12/x00/x00/x00/x07/x02/x00/x00/x98/x97/x04/x08"
        "/x00/x00/x00/x00/x10/x00/xf1/xff/x0e/x02/x00/x00/x89/x85/x04/x08"
        "/x00/x00/x00/x00/x12/x02/x0d/x00/x25/x02/x00/x00/x24/x84/x04/x08"
        "/xeb/x00/x00/x00/x12/x00/x0d/x00/x2a/x02/x00/x00/xd4/x82/x04/x08"
        "/x00/x00/x00/x00/x12/x00/x0b/x00/x00/x63/x61/x6c/x6c/x5f/x67/x6d"
        "/x6f/x6e/x5f/x73/x74/x61/x72/x74/x00/x63/x72/x74/x73/x74/x75/x66"
        "/x66/x2e/x63/x00/x5f/x5f/x43/x54/x4f/x52/x5f/x4c/x49/x53/x54/x5f"
        "/x5f/x00/x5f/x5f/x44/x54/x4f/x52/x5f/x4c/x49/x53/x54/x5f/x5f/x00"
        "/x5f/x5f/x4a/x43/x52/x5f/x4c/x49/x53/x54/x5f/x5f/x00/x64/x74/x6f"
        "/x72/x5f/x69/x64/x78/x2e/x35/x36/x34/x37/x00/x63/x6f/x6d/x70/x6c"
        "/x65/x74/x65/x64/x2e/x35/x36/x34/x35/x00/x5f/x5f/x64/x6f/x5f/x67"
        "/x6c/x6f/x62/x61/x6c/x5f/x64/x74/x6f/x72/x73/x5f/x61/x75/x78/x00"
        "/x66/x72/x61/x6d/x65/x5f/x64/x75/x6d/x6d/x79/x00/x5f/x5f/x43/x54"
        "/x4f/x52/x5f/x45/x4e/x44/x5f/x5f/x00/x5f/x5f/x46/x52/x41/x4d/x45"
        "/x5f/x45/x4e/x44/x5f/x5f/x00/x5f/x5f/x4a/x43/x52/x5f/x45/x4e/x44"
        "/x5f/x5f/x00/x5f/x5f/x64/x6f/x5f/x67/x6c/x6f/x62/x61/x6c/x5f/x63"
        "/x74/x6f/x72/x73/x5f/x61/x75/x78/x00/x62/x69/x6e/x32/x63/x2e/x63"
        "/x00/x5f/x47/x4c/x4f/x42/x41/x4c/x5f/x4f/x46/x46/x53/x45/x54/x5f"
        "/x54/x41/x42/x4c/x45/x5f/x00/x5f/x5f/x69/x6e/x69/x74/x5f/x61/x72"
        "/x72/x61/x79/x5f/x65/x6e/x64/x00/x5f/x5f/x69/x6e/x69/x74/x5f/x61"
        "/x72/x72/x61/x79/x5f/x73/x74/x61/x72/x74/x00/x5f/x44/x59/x4e/x41"
        "/x4d/x49/x43/x00/x64/x61/x74/x61/x5f/x73/x74/x61/x72/x74/x00/x5f"
        "/x5f/x6c/x69/x62/x63/x5f/x63/x73/x75/x5f/x66/x69/x6e/x69/x00/x5f"
        "/x73/x74/x61/x72/x74/x00/x67/x65/x74/x63/x68/x61/x72/x40/x40/x47"
        "/x4c/x49/x42/x43/x5f/x32/x2e/x30/x00/x5f/x5f/x67/x6d/x6f/x6e/x5f"
        "/x73/x74/x61/x72/x74/x5f/x5f/x00/x5f/x4a/x76/x5f/x52/x65/x67/x69"
        "/x73/x74/x65/x72/x43/x6c/x61/x73/x73/x65/x73/x00/x5f/x66/x70/x5f"
        "/x68/x77/x00/x5f/x66/x69/x6e/x69/x00/x5f/x5f/x6c/x69/x62/x63/x5f"
        "/x73/x74/x61/x72/x74/x5f/x6d/x61/x69/x6e/x40/x40/x47/x4c/x49/x42"
        "/x43/x5f/x32/x2e/x30/x00/x5f/x49/x4f/x5f/x73/x74/x64/x69/x6e/x5f"
        "/x75/x73/x65/x64/x00/x5f/x5f/x64/x61/x74/x61/x5f/x73/x74/x61/x72"
        "/x74/x00/x5f/x5f/x64/x73/x6f/x5f/x68/x61/x6e/x64/x6c/x65/x00/x5f"
        "/x5f/x44/x54/x4f/x52/x5f/x45/x4e/x44/x5f/x5f/x00/x5f/x5f/x6c/x69"
        "/x62/x63/x5f/x63/x73/x75/x5f/x69/x6e/x69/x74/x00/x70/x72/x69/x6e"
        "/x74/x66/x40/x40/x47/x4c/x49/x42/x43/x5f/x32/x2e/x30/x00/x5f/x5f"
        "/x62/x73/x73/x5f/x73/x74/x61/x72/x74/x00/x5f/x65/x6e/x64/x00/x70"
        "/x75/x74/x73/x40/x40/x47/x4c/x49/x42/x43/x5f/x32/x2e/x30/x00/x5f"
        "/x65/x64/x61/x74/x61/x00/x5f/x5f/x69/x36/x38/x36/x2e/x67/x65/x74"
        "/x5f/x70/x63/x5f/x74/x68/x75/x6e/x6b/x2e/x62/x78/x00/x6d/x61/x69"
        "/x6e/x00/x5f/x69/x6e/x69/x74/x00"
        ;

const int test_size = 5320;
非常适用于根据原始数据批量生成相应的字符数组
*/
#include <stdio.h>

int main(int argc, char *argv[])
{
 int ch, total=0;

 if (argc > 1)
  printf("const char %s[] %s=/n",
   argv[1], argc > 2 ? argv[2] : "");

 do {
  printf("/t/"");
  while ((ch = getchar()) != EOF)
  {
   total++;
   printf("
//x%02x",ch);
   if (total % 16 == 0)//每行显示16个字符
    break;
  }
  printf("/"/n");
 } while (ch != EOF);

 if (argc > 1)
  printf("/t;/n/nconst int %s_size = %d;/n", argv[1], total);

 return 0;
}

转载于:https://my.oschina.net/fuyajun1983cn/blog/263803

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!