Guest User

Untitled

a guest
Jan 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. def parse(f)
  4. buffer = ""
  5. open(f) { |file| file.seek 0x404;file.each_byte {|c| buffer << (0xff - c).chr} }
  6. rindex = buffer.rindex(/<\/word>/) + "</word>".size
  7. open(f.sub(".ydic", ".xml"), "w+").write(buffer[0...rindex].gsub("</word>", "</word>\n"))
  8. end
  9.  
  10. (puts "Usage: #{File.basename $0} dict_file_1 [...]";exit 1) if ARGV.size < 1
  11. ARGV.each { |f| parse f }
Add Comment
Please, Sign In to add comment