Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
342 B

  1. #!/usr/bin/env perl
  2. open( HANDLE,shift) || die;
  3. undef $/;
  4. binmode HANDLE;
  5. $data=<HANDLE>;
  6. $ctr=0;
  7. $out.=sprintf("static unsigned char %s[] = {\n ", shift);
  8. for($i=0;$i<length($data);$i++)
  9. {
  10. $out.=sprintf("0x%02x,", unpack("C", substr($data,$i,1)) );
  11. $out.="\n " if ( ( $ctr % 20) == 19);
  12. $ctr++;
  13. }
  14. $out.="0x00\n};\n";
  15. print $out;