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

Function peb

Loading_1.2/Loading/lazy_importer.hpp:329–344  ·  view source on GitHub ↗

some helper functions

Source from the content-addressed store, hash-verified

327
328 // some helper functions
329 LAZY_IMPORTER_FORCEINLINE const win::PEB_T* peb() noexcept
330 {
331#if defined(_M_X64) || defined(__amd64__)
332 return reinterpret_cast<const win::PEB_T*>(__readgsqword(0x60));
333#elif defined(_M_IX86) || defined(__i386__)
334 return reinterpret_cast<const win::PEB_T*>(__readfsdword(0x30));
335#elif defined(_M_ARM) || defined(__arm__)
336 return *reinterpret_cast<const win::PEB_T**>(_MoveFromCoprocessor(15, 0, 13, 0, 2) + 0x30);
337#elif defined(_M_ARM64) || defined(__aarch64__)
338 return *reinterpret_cast<const win::PEB_T**>(__getReg(18) + 0x60);
339#elif defined(_M_IA64) || defined(__ia64__)
340 return *reinterpret_cast<const win::PEB_T**>(static_cast<char*>(_rdteb()) + 0x60);
341#else
342#error Unsupported platform. Open an issue and I'll probably add support.
343#endif
344 }
345
346 LAZY_IMPORTER_FORCEINLINE const win::PEB_LDR_DATA_T* ldr()
347 {

Callers 1

lazy_importer.hppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected