public void AddFixedup(long module_base, int index, PointerTypeInformation pointer)
 {
     if (!_pointer_fixup.ContainsKey(Tuple.Create(module_base, index)))
     {
         _pointer_fixup.Add(Tuple.Create(module_base, index), pointer);
     }
 }
Пример #2
0
        private PointerTypeInformation CreatePointerType(TypeInformationCache type_cache, long module_base, int index, SymbolLoadedModule module)
        {
            var length       = GetSymbolLong(IMAGEHLP_SYMBOL_TYPE_INFO.TI_GET_LENGTH, module_base, index) ?? 0;
            var type_id      = GetSymbolDword(IMAGEHLP_SYMBOL_TYPE_INFO.TI_GET_TYPEID, module_base, index);
            var is_reference = GetSymbolDword(IMAGEHLP_SYMBOL_TYPE_INFO.TI_GET_IS_REFERENCE, module_base, index) ?? 0;
            PointerTypeInformation pointer;

            if (type_id.HasValue)
            {
                pointer = new PointerTypeInformation(length, index, module,
                                                     null, is_reference != 0);
                type_cache.AddEntry(module_base, index, pointer);
                type_cache.AddFixedup(module_base, type_id.Value, pointer);
                pointer.PointerType = CreateType(type_cache, module_base, type_id.Value, module);
            }
            else
            {
                return(new PointerTypeInformation(length, index, module,
                                                  new BaseTypeInformation(0, 0, module, BasicType.Void), is_reference != 0));
            }
            type_cache.AddEntry(module_base, index, pointer);
            return(pointer);
        }