Method: Rex::PeParsey::PeBase#_load_exception_directory

Defined in:
lib/rex/peparsey/pebase.rb

#_load_exception_directoryObject



1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/rex/peparsey/pebase.rb', line 1097

def _load_exception_directory
  @exception   = []

  exception_entry = _optional_header['DataDirectory'][IMAGE_DIRECTORY_ENTRY_EXCEPTION]
  rva             = exception_entry.v['VirtualAddress']
  size            = exception_entry.v['Size']

  return if (rva == 0)

  data = _isource.read(rva_to_file_offset(rva), size)

  case hdr.file.Machine
    when IMAGE_FILE_MACHINE_AMD64
      count = data.length / IMAGE_RUNTIME_FUNCTION_ENTRY_SZ

      count.times { |current|
        @exception << RuntimeFunctionEntry.new(self,
          data.slice!(0, IMAGE_RUNTIME_FUNCTION_ENTRY_SZ))
      }
    else
  end

  return @exception
end