#include #include #include #include int main(int argc, char **argv) { const char *defkey = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"; /* 32 chars */ const char *ck = (argc > 1 && strlen(argv[1]) == 32) ? argv[1] : defkey; wchar_t wkey[256]; size_t n = strlen(ck); for (size_t i = 0; i < n; i++) wkey[i] = (wchar_t)ck[i]; wkey[n] = 0; if (!SetEnvironmentVariableW(L"SLINKY_LICENSE", wkey)) { printf("SetEnvironmentVariableW failed: %lu\n", GetLastError()); return 1; } printf("[host] SLINKY_LICENSE=%s (len %zu)\n", ck, n); fflush(stdout); HMODULE h = LoadLibraryW(L"C:\\Users\\nicot\\Downloads\\lib_beta_win_unpacked.devirt.bin~\\lib_beta_win_unpacked.devirt.bin"); printf("[host] LoadLibraryW -> %p (GLE=%lu)\n", (void *)h, GetLastError()); fflush(stdout); Sleep(12000); printf("[host] still alive after 12s; DLL %s\n", h ? "(check if unloaded via GetModuleHandle)" : ""); HMODULE h2 = GetModuleHandleW(L"C:\\Users\\nicot\\Downloads\\lib_beta_win_unpacked.devirt.bin~\\lib_beta_win_unpacked.devirt.bin"); printf("[host] GetModuleHandle now -> %p\n", (void *)h2); fflush(stdout); return 0; }