nodes: 0, module; 1, function_definition; 2, function_name:_executable_memory_regions; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, for_statement; 12, if_statement; 13, expression_statement; 14, return_statement; 15, identifier:objects; 16, None; 17, identifier:force_segment; 18, False; 19, comment:"""
          Get all executable memory regions from the binaries
  
          :param objects: A collection of binary objects to collect regions from. If None, regions from all project
                          binary objects are used.
          :param bool force_segment: Rely on binary segments instead of sections.
          :return: A sorted list of tuples (beginning_address, end_address)
          """; 20, comparison_operator:objects is None; 21, block; 22, else_clause; 23, assignment; 24, identifier:b; 25, identifier:binaries; 26, block; 27, not_operator; 28, block; 29, assignment; 30, identifier:memory_regions; 31, identifier:objects; 32, None; 33, expression_statement; 34, block; 35, identifier:memory_regions; 36, list; 37, if_statement; 38, identifier:memory_regions; 39, expression_statement; 40, identifier:memory_regions; 41, call; 42, assignment; 43, expression_statement; 44, call; 45, comment:# If we have sections, we get result from sections; 46, block; 47, elif_clause; 48, elif_clause; 49, elif_clause; 50, elif_clause; 51, else_clause; 52, assignment; 53, identifier:sorted; 54, argument_list; 55, identifier:binaries; 56, attribute; 57, assignment; 58, identifier:isinstance; 59, argument_list; 60, if_statement; 61, call; 62, block; 63, call; 64, block; 65, call; 66, comment:# a blob is entirely executable; 67, block; 68, call; 69, block; 70, block; 71, identifier:memory_regions; 72, list_comprehension; 73, identifier:memory_regions; 74, keyword_argument; 75, attribute; 76, identifier:all_objects; 77, identifier:binaries; 78, identifier:objects; 79, identifier:b; 80, identifier:ELF; 81, boolean_operator; 82, comment:# Get all executable sections; 83, block; 84, else_clause; 85, identifier:isinstance; 86, argument_list; 87, for_statement; 88, identifier:isinstance; 89, argument_list; 90, if_statement; 91, identifier:isinstance; 92, argument_list; 93, expression_statement; 94, expression_statement; 95, identifier:isinstance; 96, argument_list; 97, pass_statement; 98, expression_statement; 99, expression_statement; 100, expression_statement; 101, tuple; 102, for_in_clause; 103, identifier:key; 104, lambda; 105, attribute; 106, identifier:loader; 107, not_operator; 108, attribute; 109, for_statement; 110, comment:# Get all executable segments; 111, block; 112, identifier:b; 113, identifier:PE; 114, identifier:section; 115, attribute; 116, block; 117, identifier:b; 118, identifier:MachO; 119, attribute; 120, comment:# Get all executable segments; 121, block; 122, identifier:b; 123, identifier:Blob; 124, assignment; 125, call; 126, identifier:b; 127, attribute; 128, call; 129, assignment; 130, call; 131, identifier:start; 132, binary_operator:start + len(backer); 133, pattern_list; 134, call; 135, lambda_parameters; 136, subscript; 137, identifier:self; 138, identifier:project; 139, identifier:force_segment; 140, identifier:b; 141, identifier:sections; 142, identifier:section; 143, attribute; 144, block; 145, for_statement; 146, identifier:b; 147, identifier:sections; 148, if_statement; 149, identifier:b; 150, identifier:segments; 151, for_statement; 152, identifier:tpl; 153, tuple; 154, attribute; 155, argument_list; 156, identifier:self; 157, identifier:_cle_pseudo_objects; 158, attribute; 159, argument_list; 160, identifier:tpl; 161, tuple; 162, attribute; 163, argument_list; 164, identifier:start; 165, call; 166, identifier:start; 167, identifier:backer; 168, attribute; 169, argument_list; 170, identifier:x; 171, identifier:x; 172, integer:0; 173, identifier:b; 174, identifier:sections; 175, if_statement; 176, identifier:segment; 177, attribute; 178, block; 179, attribute; 180, block; 181, identifier:seg; 182, attribute; 183, block; 184, attribute; 185, attribute; 186, identifier:memory_regions; 187, identifier:append; 188, identifier:tpl; 189, identifier:l; 190, identifier:warning; 191, string:'Unsupported object format "%s". Treat it as an executable.'; 192, attribute; 193, attribute; 194, attribute; 195, identifier:memory_regions; 196, identifier:append; 197, identifier:tpl; 198, identifier:len; 199, argument_list; 200, attribute; 201, identifier:backers; 202, attribute; 203, block; 204, identifier:b; 205, identifier:segments; 206, if_statement; 207, identifier:section; 208, identifier:is_executable; 209, expression_statement; 210, expression_statement; 211, identifier:b; 212, identifier:segments; 213, if_statement; 214, identifier:b; 215, identifier:min_addr; 216, identifier:b; 217, identifier:max_addr; 218, attribute; 219, identifier:__name__; 220, identifier:b; 221, identifier:min_addr; 222, identifier:b; 223, identifier:max_addr; 224, identifier:backer; 225, attribute; 226, identifier:memory; 227, identifier:section; 228, identifier:is_executable; 229, expression_statement; 230, expression_statement; 231, attribute; 232, block; 233, assignment; 234, call; 235, attribute; 236, comment:# Take all sections from this segment (MachO style); 237, block; 238, identifier:b; 239, identifier:__class__; 240, attribute; 241, identifier:loader; 242, assignment; 243, call; 244, identifier:segment; 245, identifier:is_executable; 246, expression_statement; 247, expression_statement; 248, identifier:tpl; 249, tuple; 250, attribute; 251, argument_list; 252, identifier:seg; 253, identifier:is_executable; 254, for_statement; 255, identifier:self; 256, identifier:project; 257, identifier:tpl; 258, tuple; 259, attribute; 260, argument_list; 261, assignment; 262, call; 263, attribute; 264, attribute; 265, identifier:memory_regions; 266, identifier:append; 267, identifier:tpl; 268, identifier:section; 269, attribute; 270, block; 271, attribute; 272, attribute; 273, identifier:memory_regions; 274, identifier:append; 275, identifier:tpl; 276, identifier:tpl; 277, tuple; 278, attribute; 279, argument_list; 280, identifier:section; 281, identifier:min_addr; 282, identifier:section; 283, identifier:max_addr; 284, identifier:seg; 285, identifier:sections; 286, expression_statement; 287, expression_statement; 288, identifier:section; 289, identifier:min_addr; 290, identifier:section; 291, identifier:max_addr; 292, attribute; 293, attribute; 294, identifier:memory_regions; 295, identifier:append; 296, identifier:tpl; 297, assignment; 298, call; 299, identifier:segment; 300, identifier:min_addr; 301, identifier:segment; 302, identifier:max_addr; 303, identifier:tpl; 304, tuple; 305, attribute; 306, argument_list; 307, attribute; 308, attribute; 309, identifier:memory_regions; 310, identifier:append; 311, identifier:tpl; 312, identifier:section; 313, identifier:min_addr; 314, identifier:section; 315, identifier:max_addr
code: def _executable_memory_regions(self, objects=None, force_segment=False):
          """
          Get all executable memory regions from the binaries
  
          :param objects: A collection of binary objects to collect regions from. If None, regions from all project
                          binary objects are used.
          :param bool force_segment: Rely on binary segments instead of sections.
          :return: A sorted list of tuples (beginning_address, end_address)
          """
  
          if objects is None:
              binaries = self.project.loader.all_objects
          else:
              binaries = objects
  
          memory_regions = [ ]
  
          for b in binaries:
              if isinstance(b, ELF):
                  # If we have sections, we get result from sections
                  if not force_segment and b.sections:
                      # Get all executable sections
                      for section in b.sections:
                          if section.is_executable:
                              tpl = (section.min_addr, section.max_addr)
                              memory_regions.append(tpl)
  
                  else:
                      # Get all executable segments
                      for segment in b.segments:
                          if segment.is_executable:
                              tpl = (segment.min_addr, segment.max_addr)
                              memory_regions.append(tpl)
  
              elif isinstance(b, PE):
                  for section in b.sections:
                      if section.is_executable:
                          tpl = (section.min_addr, section.max_addr)
                          memory_regions.append(tpl)
  
              elif isinstance(b, MachO):
                  if b.segments:
                      # Get all executable segments
                      for seg in b.segments:
                          if seg.is_executable:
                              # Take all sections from this segment (MachO style)
                              for section in seg.sections:
                                  tpl = (section.min_addr, section.max_addr)
                                  memory_regions.append(tpl)
  
              elif isinstance(b, Blob):
                  # a blob is entirely executable
                  tpl = (b.min_addr, b.max_addr)
                  memory_regions.append(tpl)
  
              elif isinstance(b, self._cle_pseudo_objects):
                  pass
  
              else:
                  l.warning('Unsupported object format "%s". Treat it as an executable.', b.__class__.__name__)
  
                  tpl = (b.min_addr, b.max_addr)
                  memory_regions.append(tpl)
  
          if not memory_regions:
              memory_regions = [(start, start + len(backer)) for start, backer in self.project.loader.memory.backers()]
  
          memory_regions = sorted(memory_regions, key=lambda x: x[0])
  
          return memory_regions