I've injected a DLL into an existing game.
I can import functions and variables like this:
typedef const wchar_t* (__fastcall *get_string_t)(const char*, int, const char*, int);
get_string_t real_get_string = reinterpret_cast<get_string_t>(0x6f9ec0);
int& g_cx = *reinterpret_cast<int*>(0x8523e0);
but these function pointers and variables add an indirection and have cumbersome syntax. Is there a way to import the original functions from the executable such that the linker can find them and I can use normal (extern) declarations?