Part 3: verdict plumbing (stderr is ground truth), elimination matrix, inert-by-construction proof for Route-1, honest ceiling
This commit is contained in:
1 parent
f5225a7fec
commit
cca4ff16cf
8 files changed
+550
No files matched your search
@@ -0,0 +1,52 @@
|
||||
/* keytest3: JVM + LoadLibrary(client) then a TRACER WINDOW (client mapped,
|
||||
* guard unconsumed), then explicit slinky_init. For MemoryAccessMonitor use.
|
||||
* usage: keytest3.exe <32-char key>
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <jni.h>
|
||||
|
||||
typedef jint (JNICALL *CreateVM_t)(JavaVM **, void **, void *);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
const char *key = (argc > 1) ? argv[1] : "E984C65498462E0BB9877136F4368535";
|
||||
size_t n = strlen(key);
|
||||
if (n != 32) { printf("[k3] key must be 32 chars\n"); return 1; }
|
||||
wchar_t wkey[64]; for (size_t i = 0; i <= n; i++) wkey[i] = (wchar_t)(unsigned char)key[i];
|
||||
SetEnvironmentVariableW(L"SLINKY_LICENSE", wkey);
|
||||
printf("[k3] key=%s\n", key); fflush(stdout);
|
||||
|
||||
HMODULE jvm = LoadLibraryW(L"C:\\Program Files\\Eclipse Adoptium\\jdk-8.0.502.7-hotspot\\jre\\bin\\server\\jvm.dll");
|
||||
if (jvm) {
|
||||
CreateVM_t cjv = (CreateVM_t)GetProcAddress(jvm, "JNI_CreateJavaVM");
|
||||
JavaVM *vm = NULL; void *env = NULL;
|
||||
JavaVMInitArgs va; memset(&va, 0, sizeof va);
|
||||
va.version = JNI_VERSION_1_8; va.ignoreUnrecognized = JNI_TRUE;
|
||||
printf("[k3] JNI_CreateJavaVM -> %d\n", cjv ? cjv(&vm, &env, &va) : -1); fflush(stdout);
|
||||
}
|
||||
|
||||
HMODULE k32 = GetModuleHandleW(L"kernel32.dll");
|
||||
unsigned char *fle = (unsigned char *)GetProcAddress(k32, "FreeLibraryAndExitThread");
|
||||
unsigned char *et = (unsigned char *)GetProcAddress(k32, "ExitThread");
|
||||
unsigned char stub[7] = { 0x8B, 0xCA, 0xE9, 0, 0, 0, 0 };
|
||||
intptr_t rel = (intptr_t)et - (intptr_t)(fle + 7);
|
||||
memcpy(stub + 3, &rel, 4);
|
||||
DWORD old;
|
||||
VirtualProtect(fle, 7, PAGE_EXECUTE_READWRITE, &old);
|
||||
memcpy(fle, stub, 7);
|
||||
VirtualProtect(fle, 7, old, &old);
|
||||
|
||||
HMODULE h = LoadLibraryW(L"C:\\Users\\nicot\\Downloads\\lib_beta_win_unpacked.devirt.bin~\\lib_beta_win.dll");
|
||||
printf("[k3] client -> %p\n", (void *)h); fflush(stdout);
|
||||
printf("[k3] TRACER WINDOW open (60s)...\n"); fflush(stdout);
|
||||
Sleep(60000);
|
||||
printf("[k3] calling slinky_init...\n"); fflush(stdout);
|
||||
typedef int (WINAPI *init_t)(const wchar_t *);
|
||||
init_t init = (init_t)GetProcAddress(h, "slinky_init");
|
||||
int r = init ? init(wkey) : -1;
|
||||
printf("[k3] slinky_init -> %d %s\n", r, r == 0 ? "<== VALID" : "<== rejected");
|
||||
fflush(stdout);
|
||||
Sleep(15000);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user