MCPcopy Create free account
hub / github.com/Y4tacker/JavaSec / main

Method main

6.JavaAgent/LicenceCrack/src/main/java/MyAgent.java:26–48  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

24 }
25 }
26 public static void main(String[] args) throws Exception {
27
28 int flag = 0;
29 while (true) {
30 List<VirtualMachineDescriptor> list = VirtualMachine.list();
31
32 for (VirtualMachineDescriptor desc : list) {
33 if ("CrackLicenseTest".equals(desc.displayName())) {
34 System.out.println("获取到注入进程ID:" + desc.id() + ",进程名称:" + desc.displayName());
35 VirtualMachine vm = VirtualMachine.attach(desc.id());
36 String agentPath = "E:\\LicenceCrack\\target\\LicenceCrack-1.0-SNAPSHOT.jar";
37 // 注入Agent到目标JVM
38 vm.loadAgent(agentPath);
39 vm.detach();
40 flag = 1;
41 break;
42 }
43 }
44 if (flag==1){
45 break;
46 }
47 }
48 }
49}

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.80

Tested by

no test coverage detected