MCPcopy Create free account
hub / github.com/SecurityAnalysts01/ShellcodeLoader / get

Method get

Loading_1.2/Loading/lazy_importer.hpp:560–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558
559 template<class F = T, class Enum = unsafe_module_enumerator>
560 LAZY_IMPORTER_FORCEINLINE static F get() noexcept
561 {
562 // for backwards compatability.
563 // Before 2.0 it was only possible to resolve forwarded exports when
564 // this macro was enabled
565#ifdef LAZY_IMPORTER_RESOLVE_FORWARDED_EXPORTS
566 return forwarded<F, Enum>();
567#else
568
569 Enum e;
570
571 do {
572#ifdef LAZY_IMPORTER_HARDENED_MODULE_CHECKS
573 if(!e.value->DllBase || !e.value->FullDllName.Length)
574 continue;
575#endif
576
577 const exports_directory exports(e.value->DllBase);
578
579 if(exports) {
580 auto export_index = exports.size();
581 while(export_index--)
582 if(hash(exports.name(export_index), get_offset(OHP)) == get_hash(OHP))
583 return (F)(exports.address(export_index));
584 }
585 } while(e.next());
586 return {};
587#endif
588 }
589
590 template<class F = T, class Enum = unsafe_module_enumerator>
591 LAZY_IMPORTER_FORCEINLINE static F forwarded() noexcept

Callers

nothing calls this directly

Calls 7

hashFunction · 0.70
get_offsetFunction · 0.70
get_hashFunction · 0.70
sizeMethod · 0.45
nameMethod · 0.45
addressMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected