diff --git a/AgentConfig.toml b/AgentConfig.toml index 2780c6d..15c1f34 100644 --- a/AgentConfig.toml +++ b/AgentConfig.toml @@ -1,7 +1,5 @@ [Injection] -BootstrapAPIPath = "D:/Development/JuiceLoader/build/libs/bootstrap-api.jar" JuiceLoaderJarPath = "D:/Development/JuiceLoader/build/libs/JuiceLoader.jar" -JuiceLoaderLibPath = "" EntryJarPath = "D:/Development/JuiceLoader/build/libs/Entry.jar" EntryClass = "cn.xiaozhou233.juiceloader.entry.Entry" EntryMethod = "start" \ No newline at end of file diff --git a/src/agent/libagent.c b/src/agent/libagent.c index 7454c89..ef5df2d 100644 --- a/src/agent/libagent.c +++ b/src/agent/libagent.c @@ -59,13 +59,6 @@ DWORD WINAPI ThreadProc(LPVOID lpParam) { } toml_free(toml_result); - log_trace("Checking bootstrap-api.jar"); - if (GetFileAttributesA(InjectionInfo.BootstrapAPIPath) == INVALID_FILE_ATTRIBUTES) { - log_error("bootstrap-api.jar not found: %s", InjectionInfo.BootstrapAPIPath); - // MessageBoxA(NULL, "bootstrap-api.jar not found", "Error", MB_OK); - return 1; - } - // Check JuiceLoader.jar log_trace("Checking JuiceLoader.jar"); @@ -113,9 +106,6 @@ DWORD WINAPI ThreadProc(LPVOID lpParam) { log_info("Enabled jvmti"); // Inject jars - log_info("injecting bootstrap-api jar..."); - (*jvmti)->AddToSystemClassLoaderSearch(jvmti, InjectionInfo.BootstrapAPIPath); - log_info("injected bootstrap-api jar"); log_info("injecting loader jar..."); (*jvmti)->AddToSystemClassLoaderSearch(jvmti, InjectionInfo.JuiceLoaderJarPath); diff --git a/src/agent/utils/datautils.c b/src/agent/utils/datautils.c index c7ce056..2239fd7 100644 --- a/src/agent/utils/datautils.c +++ b/src/agent/utils/datautils.c @@ -21,21 +21,6 @@ void safe_copy(char *dest, const char *src, size_t dest_size) { bool ReadInjectionInfo(toml_result_t result, InjectParameters* params) { toml_datum_t InjectionTree = toml_seek(result.toptab, "Injection"); - // ======= BootstrapAPIPath ======= - toml_datum_t BootstrapAPIPath = toml_seek(InjectionTree, "BootstrapAPIPath"); - char BootstrapAPIPathStr[INJECT_PATH_MAX]; - if (BootstrapAPIPath.type != TOML_STRING) { - log_error("BootstrapAPIPath is not a string."); - return false; - } - if (BootstrapAPIPath.u.s == NULL || strlen(BootstrapAPIPath.u.s) == 0) { - sprintf(BootstrapAPIPathStr, "%s\\bootstrap-api.jar", params->ConfigDir); - } else { - sprintf(BootstrapAPIPathStr, "%s", BootstrapAPIPath.u.s); - } - safe_copy(InjectionInfo.BootstrapAPIPath, BootstrapAPIPathStr, INJECT_PATH_MAX); - // ======= BootstrapAPIPath ======= - // ======= JuiceLoaderJarPath ======= toml_datum_t JuiceLoaderJarPath = toml_seek(InjectionTree, "JuiceLoaderJarPath"); char JuiceLoaderJarPathStr[INJECT_PATH_MAX];