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)

Parameters:

  • arg (String?) (defaults to: nil)

    Can be either build_id or path to libc.

  • options (Mixed)

    See OneGadget.gadgets for ore information.

Returns:



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

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