def handle_near(libc_file, gadgets, near)
      return error('Libc file must be given when using --near option') unless libc_file

      functions = if File.file?(near) && OneGadget::Helper.valid_elf_file?(near)
                    OneGadget::Helper.got_functions(near)
                  else
                    near.split(',').map(&:strip)
                  end
      function_offsets = OneGadget::Helper.function_offsets(libc_file, functions)
      return error('No functions for processing') if function_offsets.empty?

      function_offsets.each do |function, offset|
        colored_offset = OneGadget::Helper.colored_hex(offset)
        OneGadget::Logger.warn("Gadgets near #{OneGadget::Helper.colorize(function)}(#{colored_offset}):")
        display_gadgets(gadgets.sort_by { |gadget| (gadget.offset - offset).abs }, @options[:raw])
        show("\n")
      end
      true
    end
def handle_near(libc_file, gadgets, near)
      return error('Libc file must be given when using --near option') unless libc_file

      functions = if File.file?(near) && OneGadget::Helper.valid_elf_file?(near)
                    OneGadget::Helper.got_functions(near)
                  else
                    near.split(',').map(&:strip)
                  end
      function_offsets = OneGadget::Helper.function_offsets(libc_file, functions)
      return error('No functions for processing') if function_offsets.empty?

      function_offsets.each do |function, offset|
        colored_offset = OneGadget::Helper.colored_hex(offset)
        OneGadget::Logger.warn("Gadgets near #{OneGadget::Helper.colorize(function)}(#{colored_offset}):")
        display_gadgets(gadgets.sort_by { |gadget| (gadget.offset - offset).abs }, @options[:raw])
        show("\n")
      end
      true
    end
Implements the --near feature.
 @param [String] libc_file
 @param [Array<OneGadget::Gadget::Gadget>] gadgets
 @param [String] near
   This can be name of functions or an ELF file.
   - Use one comma without spaces to specify a list of functions: +printf,scanf,free+.
   - Path to an ELF file and take its GOT functions to process: +/bin/ls+