diff --git a/build.gradle b/build.gradle
index c2cb0fd..6e5ab81 100644
--- a/build.gradle
+++ b/build.gradle
@@ -56,6 +56,7 @@ dependencies {
implementation 'org.ow2.asm:asm-analysis:9.7.1'
implementation 'org.ow2.asm:asm-util:9.7.1'
implementation 'org.ow2.asm:asm-tree:9.7.1'
+ implementation 'net.bytebuddy:byte-buddy:1.17.6'
implementation 'org.jsoup:jsoup:1.17.2'
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/.suo b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/.suo
new file mode 100644
index 0000000..0d29bf9
Binary files /dev/null and b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/.suo differ
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db
new file mode 100644
index 0000000..895bd0a
Binary files /dev/null and b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db differ
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db-shm b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db-shm
new file mode 100644
index 0000000..e02962a
Binary files /dev/null and b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db-shm differ
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db-wal b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.db-wal
new file mode 100644
index 0000000..e69de29
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.opendb b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.opendb
new file mode 100644
index 0000000..5d9f9da
Binary files /dev/null and b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/Browse.VC.opendb differ
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/DocumentLayout.json b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/DocumentLayout.json
new file mode 100644
index 0000000..302e03c
--- /dev/null
+++ b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/DocumentLayout.json
@@ -0,0 +1,91 @@
+{
+ "Version": 1,
+ "WorkspaceRootPath": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\",
+ "Documents": [
+ {
+ "AbsoluteMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
+ "RelativeMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|solutionrelative:GetInstance\\org_tzd_debug_GetInstance.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
+ },
+ {
+ "AbsoluteMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
+ "RelativeMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|solutionrelative:GetInstance\\org_tzd_debug_GetInstance.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
+ },
+ {
+ "AbsoluteMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\dllmain.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
+ "RelativeMoniker": "D:0:0:{3C9F4D1A-8483-4E0A-94FB-7E75617957A9}|GetInstance\\GetInstance.vcxproj|solutionrelative:GetInstance\\dllmain.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
+ }
+ ],
+ "DocumentGroupContainers": [
+ {
+ "Orientation": 0,
+ "VerticalTabListWidth": 256,
+ "DocumentGroups": [
+ {
+ "DockedWidth": 200,
+ "SelectedChildIndex": 6,
+ "Children": [
+ {
+ "$type": "Bookmark",
+ "Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
+ },
+ {
+ "$type": "Bookmark",
+ "Name": "ST:0:0:{1c64b9c2-e352-428e-a56d-0ace190b99a6}"
+ },
+ {
+ "$type": "Bookmark",
+ "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
+ },
+ {
+ "$type": "Bookmark",
+ "Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}"
+ },
+ {
+ "$type": "Bookmark",
+ "Name": "ST:0:0:{d3750d8a-574b-4fb3-b7e2-aa8af40e8231}"
+ },
+ {
+ "$type": "Document",
+ "DocumentIndex": 1,
+ "Title": "org_tzd_debug_GetInstance.h",
+ "DocumentMoniker": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.h",
+ "RelativeDocumentMoniker": "GetInstance\\org_tzd_debug_GetInstance.h",
+ "ToolTip": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.h",
+ "RelativeToolTip": "GetInstance\\org_tzd_debug_GetInstance.h",
+ "ViewState": "AQIAAAEAAAAAAAAAAAAcwA4AAAAxAAAA",
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
+ "WhenOpened": "2025-06-26T12:47:16.975Z",
+ "EditorCaption": ""
+ },
+ {
+ "$type": "Document",
+ "DocumentIndex": 0,
+ "Title": "org_tzd_debug_GetInstance.cpp",
+ "DocumentMoniker": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.cpp",
+ "RelativeDocumentMoniker": "GetInstance\\org_tzd_debug_GetInstance.cpp",
+ "ToolTip": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\org_tzd_debug_GetInstance.cpp*",
+ "RelativeToolTip": "GetInstance\\org_tzd_debug_GetInstance.cpp*",
+ "ViewState": "AQIAAAAAAAAAAAAAAAAAAA0AAAALAAAA",
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
+ "WhenOpened": "2025-06-26T12:42:02.251Z",
+ "EditorCaption": ""
+ },
+ {
+ "$type": "Document",
+ "DocumentIndex": 2,
+ "Title": "dllmain.cpp",
+ "DocumentMoniker": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\dllmain.cpp",
+ "RelativeDocumentMoniker": "GetInstance\\dllmain.cpp",
+ "ToolTip": "C:\\Users\\Administrator\\source\\repos\\GetInstance\\GetInstance\\dllmain.cpp",
+ "RelativeToolTip": "GetInstance\\dllmain.cpp",
+ "ViewState": "AQIAAAAAAAAAAAAAAADwvwAAAAAAAAAA",
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
+ "WhenOpened": "2025-06-26T12:39:18.259Z",
+ "EditorCaption": ""
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/.vs/GetInstance/v17/ipch/71f1c34df6139ca1.ipch b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/ipch/71f1c34df6139ca1.ipch
new file mode 100644
index 0000000..187fe26
Binary files /dev/null and b/src/main/Cpp/GetInstance/.vs/GetInstance/v17/ipch/71f1c34df6139ca1.ipch differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj
new file mode 100644
index 0000000..a15e3fb
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj
@@ -0,0 +1,162 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 17.0
+ Win32Proj
+ {3c9f4d1a-8483-4e0a-94fb-7e75617957a9}
+ GetInstance
+ 10.0.20348.0
+
+
+
+ DynamicLibrary
+ true
+ v143
+ Unicode
+
+
+ DynamicLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+ DynamicLibrary
+ true
+ v143
+ Unicode
+
+
+ DynamicLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C:\Users\Administrator\.jdks\corretto-20.0.2.1\include\win32;C:\Users\Administrator\.jdks\corretto-20.0.2.1\include;$(IncludePath)
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;GETINSTANCE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ true
+ Use
+ pch.h
+
+
+ Windows
+ true
+ false
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;GETINSTANCE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ true
+ Use
+ pch.h
+
+
+ Windows
+ true
+ true
+ true
+ false
+
+
+
+
+ Level3
+ true
+ _DEBUG;GETINSTANCE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ true
+ Use
+ pch.h
+
+
+ Windows
+ true
+ false
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;GETINSTANCE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ true
+ Use
+ pch.h
+
+
+ Windows
+ true
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.filters b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.filters
new file mode 100644
index 0000000..32f20b0
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.filters
@@ -0,0 +1,39 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ 头文件
+
+
+ 头文件
+
+
+ 头文件
+
+
+
+
+ 源文件
+
+
+ 源文件
+
+
+ 源文件
+
+
+
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.user b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.user
new file mode 100644
index 0000000..5df420f
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/GetInstance.vcxproj.user
@@ -0,0 +1,6 @@
+
+
+
+ false
+
+
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/GetInstance/dllmain.cpp b/src/main/Cpp/GetInstance/GetInstance/dllmain.cpp
new file mode 100644
index 0000000..daed8c8
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/dllmain.cpp
@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "pch.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
diff --git a/src/main/Cpp/GetInstance/GetInstance/framework.h b/src/main/Cpp/GetInstance/GetInstance/framework.h
new file mode 100644
index 0000000..80cbbc9
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/framework.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
+// Windows 头文件
+#include
diff --git a/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.cpp b/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.cpp
new file mode 100644
index 0000000..12bb17e
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.cpp
@@ -0,0 +1,85 @@
+#include "pch.h"
+
+#include
+#include
+#include
+
+// JVMTIصΪÿʵñǩ
+static jvmtiIterationControl JNICALL
+objectInstanceCallback(jlong class_tag, jlong size, jlong* tag_ptr, void* user_data) {
+ *tag_ptr = 1; // Ϊʵù̶ǩ1
+ return JVMTI_ITERATION_CONTINUE;
+}
+
+extern "C" JNIEXPORT jobjectArray JNICALL
+Java_org_tzd_debug_GetInstance_getInstance(JNIEnv* env, jclass clazz, jclass targetClazz) {
+ // ȡJVM
+ JavaVM* vm;
+ env->GetJavaVM(&vm);
+
+ // ȡJVMTI
+ jvmtiEnv* jvmti = nullptr;
+ jint result = vm->GetEnv((void**)&jvmti, JVMTI_VERSION_1_0);
+ if (result != JNI_OK || jvmti == nullptr) {
+ env->ThrowNew(env->FindClass("java/lang/IllegalStateException"),
+ "Failed to get JVMTI environment");
+ return nullptr;
+ }
+
+ // ӱǩ
+ jvmtiCapabilities capabilities = { 0 };
+ capabilities.can_tag_objects = 1;
+ jvmtiError error = jvmti->AddCapabilities(&capabilities);
+ if (error != JVMTI_ERROR_NONE) {
+ env->ThrowNew(env->FindClass("java/lang/UnsupportedOperationException"),
+ "JVM doesn't support object tagging");
+ return nullptr;
+ }
+
+ // ʵñǩ
+ error = jvmti->IterateOverInstancesOfClass(
+ targetClazz,
+ JVMTI_HEAP_OBJECT_EITHER,
+ objectInstanceCallback,
+ nullptr
+ );
+ if (error != JVMTI_ERROR_NONE) {
+ env->ThrowNew(env->FindClass("java/lang/RuntimeException"),
+ "IterateOverInstancesOfClass failed");
+ return nullptr;
+ }
+
+ // ȡǩĶ
+ jlong tag = 1;
+ jint count = 0;
+ jobject* instances = nullptr;
+ error = jvmti->GetObjectsWithTags(
+ 1,
+ &tag,
+ &count,
+ &instances,
+ nullptr
+ );
+ if (error != JVMTI_ERROR_NONE) {
+ env->ThrowNew(env->FindClass("java/lang/RuntimeException"),
+ "GetObjectsWithTags failed");
+ return nullptr;
+ }
+
+ //
+ jobjectArray resultArray = env->NewObjectArray(count, targetClazz, nullptr);
+ if (resultArray == nullptr) {
+ jvmti->Deallocate((unsigned char*)instances);
+ return nullptr;
+ }
+
+ //
+ for (int i = 0; i < count; i++) {
+ env->SetObjectArrayElement(resultArray, i, instances[i]);
+ }
+
+ // ͷJVMTIڴ
+ jvmti->Deallocate((unsigned char*)instances);
+
+ return resultArray;
+}
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.h b/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.h
new file mode 100644
index 0000000..54c7fc1
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/org_tzd_debug_GetInstance.h
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include
+/* Header for class org_tzd_debug_GetInstance */
+
+#ifndef _Included_org_tzd_debug_GetInstance
+#define _Included_org_tzd_debug_GetInstance
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_tzd_debug_GetInstance
+ * Method: getInstance
+ * Signature: (Ljava/lang/Class;)[Ljava/lang/Object;
+ */
+JNIEXPORT jobjectArray JNICALL Java_org_tzd_debug_GetInstance_getInstance
+ (JNIEnv *, jclass, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/main/Cpp/GetInstance/GetInstance/pch.cpp b/src/main/Cpp/GetInstance/GetInstance/pch.cpp
new file mode 100644
index 0000000..b6fb8f4
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/pch.cpp
@@ -0,0 +1,5 @@
+// pch.cpp: 与预编译标头对应的源文件
+
+#include "pch.h"
+
+// 当使用预编译的头时,需要使用此源文件,编译才能成功。
diff --git a/src/main/Cpp/GetInstance/GetInstance/pch.h b/src/main/Cpp/GetInstance/GetInstance/pch.h
new file mode 100644
index 0000000..9660927
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/pch.h
@@ -0,0 +1,13 @@
+// pch.h: 这是预编译标头文件。
+// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
+// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
+// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
+// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
+
+#ifndef PCH_H
+#define PCH_H
+
+// 添加要在此处预编译的标头
+#include "framework.h"
+
+#endif //PCH_H
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.dll.recipe b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.dll.recipe
new file mode 100644
index 0000000..5c342db
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.dll.recipe
@@ -0,0 +1,11 @@
+
+
+
+
+ C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.dll
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.iobj b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.iobj
new file mode 100644
index 0000000..c0d8820
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.iobj differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.ipdb b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.ipdb
new file mode 100644
index 0000000..1d5530c
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.ipdb differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.log b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.log
new file mode 100644
index 0000000..6d35435
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.log
@@ -0,0 +1,7 @@
+ org_tzd_debug_GetInstance.cpp
+ 正在创建库 C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.lib 和对象 C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.exp
+ 正在生成代码
+ Previous IPDB and IOBJ mismatch, fall back to full compilation.
+ All 13 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
+ 已完成代码的生成
+ GetInstance.vcxproj -> C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.dll
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.pch b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.pch
new file mode 100644
index 0000000..a3a7d94
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.pch differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.command.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.command.1.tlog
new file mode 100644
index 0000000..e6c7be8
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.command.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.read.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.read.1.tlog
new file mode 100644
index 0000000..53e8335
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.read.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.write.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.write.1.tlog
new file mode 100644
index 0000000..f92149c
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/CL.write.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/Cl.items.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/Cl.items.tlog
new file mode 100644
index 0000000..468b70f
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/Cl.items.tlog
@@ -0,0 +1,3 @@
+C:\Users\Administrator\source\repos\GetInstance\GetInstance\dllmain.cpp;C:\Users\Administrator\source\repos\GetInstance\GetInstance\x64\Release\dllmain.obj
+C:\Users\Administrator\source\repos\GetInstance\GetInstance\org_tzd_debug_GetInstance.cpp;C:\Users\Administrator\source\repos\GetInstance\GetInstance\x64\Release\org_tzd_debug_GetInstance.obj
+C:\Users\Administrator\source\repos\GetInstance\GetInstance\pch.cpp;C:\Users\Administrator\source\repos\GetInstance\GetInstance\x64\Release\pch.obj
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/GetInstance.lastbuildstate b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/GetInstance.lastbuildstate
new file mode 100644
index 0000000..7c748f5
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/GetInstance.lastbuildstate
@@ -0,0 +1,2 @@
+PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.40.33807:TargetPlatformVersion=10.0.20348.0:
+Release|x64|C:\Users\Administrator\source\repos\GetInstance\|
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.command.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.command.1.tlog
new file mode 100644
index 0000000..efcc79f
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.command.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.read.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.read.1.tlog
new file mode 100644
index 0000000..3dcd982
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.read.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.secondary.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.secondary.1.tlog
new file mode 100644
index 0000000..29675df
--- /dev/null
+++ b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.secondary.1.tlog
@@ -0,0 +1,5 @@
+^C:\USERS\ADMINISTRATOR\SOURCE\REPOS\GETINSTANCE\GETINSTANCE\X64\RELEASE\DLLMAIN.OBJ|C:\USERS\ADMINISTRATOR\SOURCE\REPOS\GETINSTANCE\GETINSTANCE\X64\RELEASE\ORG_TZD_DEBUG_GETINSTANCE.OBJ|C:\USERS\ADMINISTRATOR\SOURCE\REPOS\GETINSTANCE\GETINSTANCE\X64\RELEASE\PCH.OBJ
+C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.lib
+C:\Users\Administrator\source\repos\GetInstance\x64\Release\GetInstance.EXP
+C:\Users\Administrator\source\repos\GetInstance\GetInstance\x64\Release\GetInstance.IPDB
+C:\Users\Administrator\source\repos\GetInstance\GetInstance\x64\Release\GetInstance.iobj
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.write.1.tlog b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.write.1.tlog
new file mode 100644
index 0000000..0d90297
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/GetInstance.tlog/link.write.1.tlog differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/dllmain.obj b/src/main/Cpp/GetInstance/GetInstance/x64/Release/dllmain.obj
new file mode 100644
index 0000000..7a58883
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/dllmain.obj differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/org_tzd_debug_GetInstance.obj b/src/main/Cpp/GetInstance/GetInstance/x64/Release/org_tzd_debug_GetInstance.obj
new file mode 100644
index 0000000..fde85d9
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/org_tzd_debug_GetInstance.obj differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/pch.obj b/src/main/Cpp/GetInstance/GetInstance/x64/Release/pch.obj
new file mode 100644
index 0000000..10f7302
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/pch.obj differ
diff --git a/src/main/Cpp/GetInstance/GetInstance/x64/Release/vc143.pdb b/src/main/Cpp/GetInstance/GetInstance/x64/Release/vc143.pdb
new file mode 100644
index 0000000..d51983d
Binary files /dev/null and b/src/main/Cpp/GetInstance/GetInstance/x64/Release/vc143.pdb differ
diff --git a/src/main/Cpp/GetInstance/x64/Release/GetInstance.dll b/src/main/Cpp/GetInstance/x64/Release/GetInstance.dll
new file mode 100644
index 0000000..0379cc8
Binary files /dev/null and b/src/main/Cpp/GetInstance/x64/Release/GetInstance.dll differ
diff --git a/src/main/Cpp/GetInstance/x64/Release/GetInstance.exp b/src/main/Cpp/GetInstance/x64/Release/GetInstance.exp
new file mode 100644
index 0000000..9949376
Binary files /dev/null and b/src/main/Cpp/GetInstance/x64/Release/GetInstance.exp differ
diff --git a/src/main/Cpp/GetInstance/x64/Release/GetInstance.lib b/src/main/Cpp/GetInstance/x64/Release/GetInstance.lib
new file mode 100644
index 0000000..33c4e8d
Binary files /dev/null and b/src/main/Cpp/GetInstance/x64/Release/GetInstance.lib differ
diff --git a/src/main/Cpp/GetInstance/x64/Release/GetInstance.pdb b/src/main/Cpp/GetInstance/x64/Release/GetInstance.pdb
new file mode 100644
index 0000000..d19e54b
Binary files /dev/null and b/src/main/Cpp/GetInstance/x64/Release/GetInstance.pdb differ
diff --git a/src/main/java/com/axis/innovators/box/AxisInnovatorsBox.java b/src/main/java/com/axis/innovators/box/AxisInnovatorsBox.java
index 86916d5..ecda107 100644
--- a/src/main/java/com/axis/innovators/box/AxisInnovatorsBox.java
+++ b/src/main/java/com/axis/innovators/box/AxisInnovatorsBox.java
@@ -1,6 +1,5 @@
package com.axis.innovators.box;
-import com.axis.innovators.box.decompilation.gui.ModernJarViewer;
import com.axis.innovators.box.events.GlobalEventBus;
import com.axis.innovators.box.events.OpenFileEvents;
import com.axis.innovators.box.events.StartupEvent;
@@ -8,10 +7,10 @@ import com.axis.innovators.box.gui.*;
import com.axis.innovators.box.plugins.PluginDescriptor;
import com.axis.innovators.box.plugins.PluginLoader;
import com.axis.innovators.box.plugins.PluginPyLoader;
+import com.axis.innovators.box.register.LanguageManager;
import com.axis.innovators.box.register.RegistrationSettingsItem;
import com.axis.innovators.box.register.RegistrationTool;
import com.axis.innovators.box.register.RegistrationTopic;
-import com.axis.innovators.box.register.LanguageManager;
import com.axis.innovators.box.tools.*;
import com.axis.innovators.box.util.PythonResult;
import com.axis.innovators.box.util.Tray;
@@ -27,19 +26,20 @@ import org.apache.logging.log4j.core.appender.RollingFileAppender;
import org.apache.logging.log4j.core.config.Configuration;
import org.api.dog.agent.VirtualMachine;
import org.jetbrains.annotations.NotNull;
-import org.tzd.lm.LM;
import javax.swing.*;
import java.awt.*;
-import java.awt.event.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import java.io.*;
import java.lang.instrument.Instrumentation;
import java.lang.management.*;
-import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
-import java.util.*;
import java.util.List;
+import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -72,9 +72,20 @@ public class AxisInnovatorsBox {
private final List windowsJDialogList = new ArrayList<>();
private final StateManager stateManager = new StateManager();
private UserTags userTags;
+ private final boolean isDebug;
+ private static DebugWindow debugWindow;
- public AxisInnovatorsBox(String[] args) {
+ public AxisInnovatorsBox(String[] args, boolean isDebug) {
this.args = args;
+ this.isDebug = isDebug;
+ }
+
+ /**
+ * 获取调试状态
+ * @return 调试状态
+ */
+ public boolean isDebugEnvironment(){
+ return isDebug;
}
@@ -82,7 +93,7 @@ public class AxisInnovatorsBox {
try {
LibraryLoad.loadLibrary("FridaNative");
LibraryLoad.loadLibrary("ThrowSafely");
- LibraryLoad.loadLibrary("DogAgent");
+ LibraryLoad.loadLibrary("DogAgent");
} catch (Exception e) {
logger.error("Failed to load the 'FridaNative' library", e);
}
@@ -325,21 +336,8 @@ public class AxisInnovatorsBox {
// 播放错误音效的方法
private void playErrorSound() {
try {
- // 使用系统默认的错误音效
Toolkit.getDefaultToolkit().beep();
-
- // 或者播放自定义音效
- /*
- File soundFile = new File("error_sound.wav");
- if (soundFile.exists()) {
- AudioInputStream audioIn = AudioSystem.getAudioInputStream(soundFile);
- Clip clip = AudioSystem.getClip();
- clip.open(audioIn);
- clip.start();
- }
- */
- } catch (Exception ex) {
- // 忽略音效播放错误
+ } catch (Exception ignored) {
}
}
@@ -357,10 +355,8 @@ public class AxisInnovatorsBox {
private void processAppender(ZipOutputStream zos, Set addedFiles,
Appender appender) throws IOException {
- if (appender instanceof FileAppender) {
- FileAppender fileAppender = (FileAppender) appender;
+ if (appender instanceof FileAppender fileAppender) {
String fileName = fileAppender.getFileName();
-
if (fileName != null && !addedFiles.contains(fileName)) {
addFileToZip(zos, new File(fileName), "logs/");
addedFiles.add(fileName);
@@ -410,7 +406,9 @@ public class AxisInnovatorsBox {
filePattern = filePattern.substring(lastSlash + 1);
}
int patternStart = filePattern.indexOf('%');
- if (patternStart == -1) patternStart = filePattern.indexOf('$');
+ if (patternStart == -1) {
+ patternStart = filePattern.indexOf('$');
+ }
if (patternStart > 0) {
baseName = filePattern.substring(0, patternStart);
@@ -531,7 +529,9 @@ public class AxisInnovatorsBox {
}
private String formatMemory(long bytes) {
- if (bytes < 1024) return bytes + " B";
+ if (bytes < 1024) {
+ return bytes + " B";
+ }
int exp = (int) (Math.log(bytes) / Math.log(1024));
char unit = "KMGTPE".charAt(exp - 1);
return String.format("%.1f %sB", bytes / Math.pow(1024, exp), unit);
@@ -601,22 +601,10 @@ public class AxisInnovatorsBox {
return tempFile;
}
- // 添加目录到ZIP(递归)
- private void addDirectoryToZip(ZipOutputStream zos, File dir, String basePath) throws IOException {
- if (!dir.exists() || !dir.isDirectory()) return;
-
- for (File file : dir.listFiles()) {
- String entryPath = basePath + "/" + file.getName();
- if (file.isDirectory()) {
- addDirectoryToZip(zos, file, entryPath);
- } else {
- addFileToZip(zos, file, entryPath);
- }
- }
- }
-
private void addFileToZip(ZipOutputStream zos, File file, String entryPath) throws IOException {
- if (!file.exists()) return;
+ if (!file.exists()) {
+ return;
+ }
String entryName = entryPath + file.getName();
ZipEntry zipEntry = new ZipEntry(entryName);
@@ -755,7 +743,7 @@ public class AxisInnovatorsBox {
* @param windowsJDialog 窗口
*/
public boolean isWindowStartup(WindowsJDialog windowsJDialog) {
- return windowsJDialogList.contains(windowsJDialog);
+ return !windowsJDialogList.contains(windowsJDialog);
}
/**
@@ -790,8 +778,34 @@ public class AxisInnovatorsBox {
isWindow = true;
}
- public static void run(String[] args) {
- main = new AxisInnovatorsBox(args);
+ private void createDebugWindow() {
+ debugWindow = new DebugWindow();
+
+ // 关键配置:设置为独立窗口,不受模态对话框影响
+ //debugWindow.setAlwaysOnTop(true);
+ //debugWindow.setFocusableWindowState(true);
+ //debugWindow.setFocusable(true);
+
+ // 当主窗口关闭时关闭调试窗口
+ ex.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ debugWindow.dispose();
+ }
+ });
+
+ ex.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowOpened(WindowEvent e) {
+ debugWindow.setVisible(true);
+ }
+ });
+
+ debugWindow.setVisible(true);
+ }
+
+ public static void run(String[] args, boolean isDebug) {
+ main = new AxisInnovatorsBox(args,isDebug);
try {
main.initLog4j2();
main.setTopic();
@@ -828,7 +842,15 @@ public class AxisInnovatorsBox {
SwingUtilities.invokeLater(() -> {
try {
- main.ex = new MainWindow();
+ main.ex = new MainWindow(){
+ @Override
+ public void setVisible(boolean b) {
+ if (debugWindow != null) {
+ debugWindow.setVisible(b);
+ }
+ super.setVisible(b);
+ }
+ };
GlobalEventBus.EVENT_BUS.post(new StartupEvent(main));
PluginPyLoader.getLoadedPlugins().forEach((pluginId, pyPluginDescriptor) -> {
if (pyPluginDescriptor.getLastResult().getInterpreter() != null){
@@ -843,8 +865,9 @@ public class AxisInnovatorsBox {
main.runWindow();
} catch (Exception e) {
logger.error("There was a problem starting the main thread", e);
- if (main.ex != null)
+ if (main.ex != null) {
main.ex.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ }
main.organizingCrashReports(e);
throw new RuntimeException(e);
}
@@ -860,8 +883,9 @@ public class AxisInnovatorsBox {
} catch (Exception e) {
logger.error("Failed to load plugins", e);
- if (main.ex != null)
+ if (main.ex != null) {
main.ex.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ }
main.organizingCrashReports(e);
throw new RuntimeException(e);
}
@@ -870,8 +894,9 @@ public class AxisInnovatorsBox {
main.thread.start();
} catch (Exception e) {
logger.error("In unexpected errors", e);
- if (main.ex != null)
+ if (main.ex != null) {
main.ex.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ }
main.organizingCrashReports(e);
throw new RuntimeException(e);
}
@@ -894,6 +919,10 @@ public class AxisInnovatorsBox {
ex.initUI();
isWindow = true;
ex.setVisible(true);
+
+ if (isDebug) {
+ SwingUtilities.invokeLater(this::createDebugWindow);
+ }
}
/**
diff --git a/src/main/java/com/axis/innovators/box/Main.java b/src/main/java/com/axis/innovators/box/Main.java
index 21c9533..41c87b4 100644
--- a/src/main/java/com/axis/innovators/box/Main.java
+++ b/src/main/java/com/axis/innovators/box/Main.java
@@ -1,12 +1,11 @@
package com.axis.innovators.box;
import com.axis.innovators.box.browser.MainApplication;
-import com.axis.innovators.box.browser.WindowRegistry;
import com.axis.innovators.box.decompilation.gui.ModernJarViewer;
+import com.axis.innovators.box.register.LanguageManager;
import com.axis.innovators.box.tools.ArgsParser;
import com.axis.innovators.box.tools.FolderCleaner;
import com.axis.innovators.box.tools.FolderCreator;
-import com.axis.innovators.box.register.LanguageManager;
import javax.swing.*;
import java.io.File;
@@ -46,6 +45,20 @@ public class Main {
LanguageManager.loadLanguage("system:zh_CN");
}
+ // 检查是否包含调试控制台参数
+ boolean debugWindowEnabled = false;
+ for (int i = 0; i < args.length; i++) {
+ if ("-debugControlWindow-on".equals(args[i])) {
+ debugWindowEnabled = true;
+ // 移除此参数避免干扰后续处理
+ String[] newArgs = new String[args.length - 1];
+ System.arraycopy(args, 0, newArgs, 0, i);
+ System.arraycopy(args, i + 1, newArgs, i, args.length - i - 1);
+ args = newArgs;
+ break;
+ }
+ }
+
List