Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit a8e22c9

Browse files
committed
test
1 parent 4951e92 commit a8e22c9

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

native/start.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <jvmti.h>
2+
#include <Windows.h>
23
#include "xxtea_de.h"
34
#include "core_de.h"
45
#include "stdlib.h"
@@ -239,5 +240,32 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved) {
239240
}
240241

241242
DE_LOG("INIT JVMTI SUCCESS");
243+
244+
error = (*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_1_0);
245+
if (error != JVMTI_ERROR_NONE) {
246+
return JNI_ERR;
247+
}
248+
249+
HMODULE moduleHandle = LoadLibrary("jvm.dll");
250+
if (moduleHandle == NULL) {
251+
return 1;
252+
}
253+
254+
FARPROC functionAddress = GetProcAddress(moduleHandle, "gHotSpotVMStructs");
255+
if (functionAddress == NULL) {
256+
return 1;
257+
}
258+
259+
uintptr_t baseAddress = (uintptr_t)moduleHandle;
260+
uintptr_t functionRVA = (uintptr_t)functionAddress - baseAddress;
261+
262+
printf("gHotSpotVMStructs RVA: 0x%08X\n", (unsigned int)functionRVA);
263+
printf("Function Addr: 0x%08X\n",(unsigned int)(uintptr_t)functionAddress);
264+
265+
FARPROC* functionAddressPtr = &functionAddress;
266+
*functionAddressPtr = 0;
267+
268+
FreeLibrary(moduleHandle);
269+
242270
return JNI_OK;
243271
}

src/main/resources/decrypter.dll

0 Bytes
Binary file not shown.

src/main/resources/encryptor.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)