Advertisement
babusha

Untitled

Jul 20th, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.51 KB | None | 0 0
  1.  
  2. ARGV.each do |file_name|
  3.     @file_name = "decompilled_"+file_name+".bf"
  4.     @count = 0
  5.     File.open(@file_name,'w') do |line|
  6.         File.open(file_name) do |file|
  7.             file.each_byte do |b|
  8.                 case b
  9.                 when 0x1
  10.                     line.write '+'
  11.                 when 0x2
  12.                     line.write '-'
  13.                 when 0x3
  14.                     line.write '>'
  15.                 when 0x4
  16.                     line.write '<'
  17.                 when 0x5
  18.                     line.write ','
  19.                 when 0x6
  20.                     line.write '.'
  21.                 end
  22.                 @count += 1
  23.                 if @count == 45
  24.                     line.puts
  25.                     @count = 0
  26.                 end
  27.             end        
  28.         end
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement