Files
ghostwire/native/discovery_check.cpp
T

14 lines
496 B
C++
Raw Normal View History

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdint.h>
#include <stdio.h>
#include "core_discovery.h"
int wmain(int argc,wchar_t** argv) {
if(argc!=2)return 2;
HMODULE h=LoadLibraryExW(argv[1],nullptr,DONT_RESOLVE_DLL_REFERENCES);
if(!h)return 3;
CoreLayout l{};bool ok=discoverCoreLayout((uintptr_t)h,l);
if(ok)printf("primary=%llx secondary=%llx query=%llx\n",
l.primary-(uintptr_t)h,l.secondary-(uintptr_t)h,l.query-(uintptr_t)h);
FreeLibrary(h);return ok?0:4;
}