Skip to content

Commit

Permalink
Support more output formats
Browse files Browse the repository at this point in the history
  • Loading branch information
KINGSABRI committed Feb 20, 2013
1 parent abba79d commit 8bad70b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bofk-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,32 @@
options[:bin2hex] = bin2hex
end
#--> bin to Hex: Format type
opts.on('-t', '--type TYPE', "Only used with 'bin2hex'. Types: ruby, perl, python, c.") do |type|
opts.on('-t', '--type TYPE', "Only used with 'bin2hex'. Types: ruby, perl, python, c.") do |type|
options[:type] = type
end
#--> Version
opts.on('-v', '--version', 'Display Buffer Overflow Kit version.') do |v|
options[:version] = v
end
#--> Help screen
opts.banner = "\nUsage:".underline +
opts.banner = "\nUsage:".underline +
" ruby bofk-cli.rb {OPTIONS} ARGUMENT\n\n"

opts.on( '-h', '--help', "Display help screen \n" ) do
decor = decoration.decorate("Help screen.")
puts "#{decor[:head]}".light_blue + "#{decor[:title]}".white + "#{decor[:tail]}".light_blue
puts "#{opts}"

puts "\nExternal tools - bin/\n".underline +
"[-] hex2bin.rb \t Hex to Binary file - BoFkit.\n" +
"[-] nasm.exe \t Assembler and disassembler.\n" +
puts "\nExternal tools - bin/\n".underline +
"[-] hex2bin.rb \t Hex to Binary file - BoFkit.\n" +
"[-] nasm.exe \t Assembler and disassembler.\n" +
"[-] mona.py \t Immunity debugger plugin - Corelan team.\n"

puts "\nExamples:\n".underline +
"ruby bofk-cli.rb --pattern-create 500\n" +
"ruby bofk-cli.rb --pattern-offset Aa4Z\n" +
"ruby bofk-cli.rb --pattern-offset Zu2Z --pattern-length 40000\n" +
"ruby bofk-cli.rb --hex2lend 0x41F2E377\n" +
puts "\nExamples:\n".underline +
"ruby bofk-cli.rb --pattern-create 500\n" +
"ruby bofk-cli.rb --pattern-offset Aa4Z\n" +
"ruby bofk-cli.rb --pattern-offset Zu2Z --pattern-length 40000\n" +
"ruby bofk-cli.rb --hex2lend 0x41F2E377\n" +
"ruby bofk-cli.rb --bin2hex input.bin\n\n"
puts "#{decor[:end]}".light_blue
exit
Expand Down Expand Up @@ -150,10 +150,10 @@
puts "#{decor[:head]}".light_blue + "#{decor[:title]}".white + "#{decor[:tail]}".light_blue
@bin2hex.read(options[:bin2hex])
puts mark[:+] + "File Size:".white.underline + " #{File.size(options[:bin2hex])} bytes.".white
if options[:type] == nil
type = "No format specified."
if options[:type] == nil
type = "No format specified."
else
type = options[:type]
type = options[:type]
end
puts mark[:+] + "Format type:".white.underline + " #{type} \n".white
puts "#{@bin2hex.to_hex(options[:type])}".light_cyan
Expand Down

0 comments on commit 8bad70b

Please sign in to comment.