def offset(addr, sym = nil)
      return unless load?

      segment = @info.to_segment(sym)
      if segment.nil?
        sym, segment = @info.segments
                            .select { |_, seg| seg.base <= addr }
                            .min_by { |_, seg| addr - seg }
      end
      return $stdout.puts "Invalid address #{Helper.hex(addr)}" if segment.nil?

      $stdout.puts Helper.color(Helper.hex(addr - segment)) + ' after ' + Helper.color(sym, sev: :sym)
    end
def offset(addr, sym = nil)
      return unless load?

      segment = @info.to_segment(sym)
      if segment.nil?
        sym, segment = @info.segments
                            .select { |_, seg| seg.base <= addr }
                            .min_by { |_, seg| addr - seg }
      end
      return $stdout.puts "Invalid address #{Helper.hex(addr)}" if segment.nil?

      $stdout.puts Helper.color(Helper.hex(addr - segment)) + ' after ' + Helper.color(sym, sev: :sym)
    end
Show the offset in pretty way between the segment.
 Very useful in pwn when leak some address,
 see examples for more details.
 @param [Integer] addr The leaked address.
 @param [Symbol] sym
   The segement symbol to be calculated offset.
   If this parameter not given, will loop segments
   and find the most close one. See examples for more details.
 @return [void] Offset will show to stdout.
 @example
   h.offset(0x7f11f6ae1670, :libc)
   #=> 0xf6670 after libc
   h.offset(0x5559edc057a0, :heap)
   #=> 0x9637a0 after heap
   h.offset(0x7f11f6ae1670)
   #=> 0xf6670 after :libc
   h.offset(0x5559edc057a0)
   #=> 0x9637a0 after :heap