Hide Win32 API imports from your binary's Import Address Table:
constexpr uint32_t HashString(const char* str) {
uint32_t hash = 0x811c9dc5;
while (*str) {
hash ^= (uint8_t)*str++;
hash *= 0x01000193;
}
return hash;
}
// Usage in code:
FARPROC pVirtualAlloc = GetExportByHash(hKernel32, HashString("VirtualAlloc"));Because HashString is evaluated by the compiler via constexpr, the string "VirtualAlloc" is never compiled into the binary, only the hash 0x4A1F3B20!