raw2c.pl
资源名称:tcpmp.rar [点击查看]
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:0k
源码类别:
Windows CE
开发平台:
C/C++
- #!/usr/bin/perl -w
- # Turns binary files into C source code (static const unsigned char arrays).
- use strict;
- for (@ARGV) {
- open INPUT, $_ and binmode INPUT or die "$_: $!n";
- s!.*[/\]!!;
- y/0-9A-Za-z/_/c;
- print "static const unsigned char ${_}[] = {nt";
- my $buf;
- print join ', ', map sprintf('0x%02X', $_), unpack 'C*', $buf
- if read INPUT, $buf, 16;
- print ",nt", join ', ', map sprintf('0x%02X', $_), unpack 'C*', $buf
- while read INPUT, $buf, 16;
- close INPUT;
- print "n};n"
- }