bintocarr.pl
来自「是关于linux2.5.1的完全源码」· PL 代码 · 共 31 行
PL
31 行
#!/usr/bin/perl -w# $Id: bintocarr.pl,v 1.1.1.1 2001/12/17 13:59:27 bjornw Exp $# Copy of mkjulbin.pl made by Olof# convert a binary stdin to a C-file containing a char array of the input# first argument is the symbol name$symbol = shift @ARGV;print "#include <linux/init.h>\n\n";#print "unsigned char $symbol", "[] __initdata = {\n";print "unsigned char $symbol", "[] = {\n";my $char;$bcount = 0;while(read STDIN, $char, 1) { printf("0x%x, ", ord($char)); $bcount++; if(!($bcount % 16)) { print "\n"; }}print "\n};\n";$lensymb = ("_" . ($symbol . "_length"));print "__asm__(\"\\t.globl $lensymb\\n$lensymb = $bcount\\n\");\n";
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?