估计是卡在这点了,折腾两天,技术无法超越[Asm] 纯文本查看 复制代码 24 public void Execute(JitUnpackerSettings settings) {
25 Module module;
26 void* moduleHandle;
27 ModuleDefMD moduleDef;
28 void*[] methodHandles;
29
30 PrepareAllMethods();
31 // 防止陷入编译死循环
32 module = Assembly.LoadFile(settings.AssemblyPath).ManifestModule;
33 if (RuntimeEnvironment.IsClr4x)
34 moduleHandle = (void*)(IntPtr)module.GetType().GetField("m_pData", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(module);
35 else
36 moduleHandle = (void*)(IntPtr)typeof(ModuleHandle).GetField("m_ptr", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(module.ModuleHandle);
37 moduleDef = ModuleDefMD.Load(settings.AssemblyPath);
38 methodHandles = LoadMethodHandles(module, moduleDef);
39 _unpacker = LoadedUnpackerDetectors.Detect(moduleDef).CreateUnpacker(new UnpackerContext(module, moduleDef, moduleHandle, methodHandles, settings));
40 Logger.Instance.LogInfo($"Detected {_unpacker.Name} Obfuscator ({Path.GetFullPath(settings.AssemblyPath)})");
41 Console.CursorVisible = false;
42 ExecuteImpl();
43 Console.CursorVisible = true;
44 SaveAs(PathInsertPostfix(settings.AssemblyPath, ".jupk"));
45 _unpacker.Context.ModuleDef.Dispose();
46 _unpacker.Context.DumpedModuleDef.Dispose();
47 Logger.Instance.LogInfo("Finished");
48 Logger.Instance.LogNewLine();
49 }
|