parameters: (self, fd)
docstring: Parses out the binary images section in order to get the load offset.
docstring_summary: Parses out the binary images section in order to get the load offset.
docstring_tokens: Parses out the binary images section in order to get the load offset .
function: def _ParseBinaryImages(self, fd):
      """Parses out the binary images section in order to get the load offset."""
      # The parser skips some sections, so advance until the "Binary Images"
      # header is reached.
      while not fd.readline().lstrip().startswith("Binary Images:"): pass
  
      # Create a regex to match the lines of format:
      # |0x<start> - 0x<end> <binary-image> <version> (<version>) <<UUID>> <path>|
      image_re = re.compile(
          '[ ]*(0x[0-9a-f]+) -[ \t]+(0x[0-9a-f]+) [+ ]([a-zA-Z0-9._\-]+)')
  
      # This section is in this format:
      # |<start address> - <end address> <image name>|.
      while True:
        line = fd.readline()
        if not line.strip():
          # End when a blank line is hit.
          return
        # Match the line to the regex.
        match = image_re.match(line)
        if match:
          # Store the offsets by image name so it can be referenced during
          # symbolication. These are hex numbers with leading '0x', so int() can
          # convert them to decimal if base=0.
          address_range = (int(match.group(1), 0), int(match.group(2), 0))
          self._binary_images[match.group(3)] = address_range
function_tokens: def _ParseBinaryImages ( self , fd ) : # The parser skips some sections, so advance until the "Binary Images" # header is reached. while not fd . readline ( ) . lstrip ( ) . startswith ( "Binary Images:" ) : pass # Create a regex to match the lines of format: # |0x<start> - 0x<end> <binary-image> <version> (<version>) <<UUID>> <path>| image_re = re . compile ( '[ ]*(0x[0-9a-f]+) -[ \t]+(0x[0-9a-f]+) [+ ]([a-zA-Z0-9._\-]+)' ) # This section is in this format: # |<start address> - <end address> <image name>|. while True : line = fd . readline ( ) if not line . strip ( ) : # End when a blank line is hit. return # Match the line to the regex. match = image_re . match ( line ) if match : # Store the offsets by image name so it can be referenced during # symbolication. These are hex numbers with leading '0x', so int() can # convert them to decimal if base=0. address_range = ( int ( match . group ( 1 ) , 0 ) , int ( match . group ( 2 ) , 0 ) ) self . _binary_images [ match . group ( 3 ) ] = address_range