|
Revision 37977, 467 bytes
(checked in by saturday06, 3 years ago)
|
|
sort
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | system("upx --ultra-brute #{ARGV[0]}")
|
|---|
| 3 |
|
|---|
| 4 | file = open(ARGV[1], "rb")
|
|---|
| 5 |
|
|---|
| 6 | print "const char #{ARGV[0]}_DATA[] = {\n"
|
|---|
| 7 |
|
|---|
| 8 | while true
|
|---|
| 9 | print "X("
|
|---|
| 10 | 20.times do |n|
|
|---|
| 11 | unless n == 0
|
|---|
| 12 | print ","
|
|---|
| 13 | end
|
|---|
| 14 | r = file.read(1)
|
|---|
| 15 | if r
|
|---|
| 16 | char = r[0]
|
|---|
| 17 | else
|
|---|
| 18 | char = 0
|
|---|
| 19 | end
|
|---|
| 20 | print sprintf("%02x", char)
|
|---|
| 21 | end
|
|---|
| 22 | print ")\n"
|
|---|
| 23 | if file.eof?
|
|---|
| 24 | break
|
|---|
| 25 | end
|
|---|
| 26 | end
|
|---|
| 27 |
|
|---|
| 28 | print "0};\n"
|
|---|
| 29 |
|
|---|
| 30 | print "const size_t #{ARGV[0]}_BYTES = #{file.pos};\n"
|
|---|
| 31 |
|
|---|