Top Level Namespace

Defined Under Namespace

Modules: OneGadget

Instance Method Summary collapse

Instance Method Details

#one_gadget(arg = nil, **options) ⇒ Array<OneGadget::Gadget::Gadget>, Array<Integer>

Shorter way to use one gadget.

Examples:

one_gadget('./libc.so.6')
one_gadget('cbfa941a8eb7a11e4f90e81b66fcd5a820995d7c')
one_gadget('./libc.so.6', details: true)

24
25
26
27
28
29
30
31
32
33
# File 'lib/one_gadget.rb', line 24

def one_gadget(arg = nil, **options)
  unless arg.nil?
    if arg =~ /\A#{OneGadget::Helper::BUILD_ID_FORMAT}\Z/
      options[:build_id] = arg
    else
      options[:file] = arg
    end
  end
  OneGadget.gadgets(**options)
end