Class: PWN::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/pwn/driver.rb

Overview

Used to consume options passed into PWN drivers and load PWN::Env

Defined Under Namespace

Classes: Parser

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. <[email protected]>



53
54
55
56
57
# File 'lib/pwn/driver.rb', line 53

public_class_method def self.authors
  "AUTHOR(S):
    0day Inc. <[email protected]>
  "
end

.helpObject

Display Usage for this Module



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/pwn/driver.rb', line 61

public_class_method def self.help
  puts "USAGE:
    # Load default driver options into PWN::Env
    opts = PWN::Env[:driver_opts]
    #{self}::Parser.new.parse(&:on).parse!

    # Add more options by passing a block to the parser
    opts = PWN::Env[:driver_opts]
    #{self}::Parser.new do |options|
      # Boolean option
      options.on('-b', '--boolean') do |o|
        opts[:boolean] = o
      end

      # String option
      options.on('-sSTRING', '--string=STRING') do |o|
        opts[:string] = o
      end
    end.parse!

    #{self}.authors
  "
end