unidecompiler-plugin-dotnet-cli 0.1.4__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/PKG-INFO +2 -2
  2. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/pyproject.toml +2 -2
  3. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/lifter.py +15 -2
  4. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/plugin.py +6 -0
  5. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli.egg-info/PKG-INFO +2 -2
  6. unidecompiler_plugin_dotnet_cli-0.2.1/src/unidecompiler_plugin_dotnet_cli.egg-info/requires.txt +2 -0
  7. unidecompiler_plugin_dotnet_cli-0.1.4/src/unidecompiler_plugin_dotnet_cli.egg-info/requires.txt +0 -2
  8. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/README.md +0 -0
  9. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/setup.cfg +0 -0
  10. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/__init__.py +0 -0
  11. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/assembly.py +0 -0
  12. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/simulation.py +0 -0
  13. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli/support.py +0 -0
  14. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli.egg-info/SOURCES.txt +0 -0
  15. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli.egg-info/dependency_links.txt +0 -0
  16. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli.egg-info/entry_points.txt +0 -0
  17. {unidecompiler_plugin_dotnet_cli-0.1.4 → unidecompiler_plugin_dotnet_cli-0.2.1}/src/unidecompiler_plugin_dotnet_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unidecompiler-plugin-dotnet-cli
3
- Version: 0.1.4
3
+ Version: 0.2.1
4
4
  Summary: .NET CLI assembly frontend plugin for unidecompiler
5
5
  Author-email: Wker <1670133844@qq.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -9,7 +9,7 @@ Project-URL: Repository, https://github.com/Wker666/unidecompiler
9
9
  Project-URL: Issues, https://github.com/Wker666/unidecompiler/issues
10
10
  Requires-Python: >=3.11
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: unidecompiler<0.2.0,>=0.1.10
12
+ Requires-Dist: unidecompiler<0.3.0,>=0.2.1
13
13
  Requires-Dist: dnfile<1,>=0.15
14
14
 
15
15
  # unidecompiler-plugin-dotnet-cli
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "unidecompiler-plugin-dotnet-cli"
7
- version = "0.1.4"
7
+ version = "0.2.1"
8
8
  description = ".NET CLI assembly frontend plugin for unidecompiler"
9
9
  readme = "README.md"
10
10
  license = "AGPL-3.0-or-later"
11
11
  authors = [{ name = "Wker", email = "1670133844@qq.com" }]
12
12
  requires-python = ">=3.11"
13
- dependencies = ["unidecompiler>=0.1.10,<0.2.0", "dnfile>=0.15,<1"]
13
+ dependencies = ["unidecompiler>=0.2.1,<0.3.0", "dnfile>=0.15,<1"]
14
14
 
15
15
  [project.urls]
16
16
  Homepage = "https://github.com/Wker666/unidecompiler"
@@ -40,6 +40,7 @@ from unidecompiler.core.vm_region import (
40
40
  VMStatefulCallbacks,
41
41
  build_hint_region_profile,
42
42
  )
43
+ from unidecompiler.progress import ProgressReporter, report_progress
43
44
  from unidecompiler_plugin_dotnet_cli.assembly import (
44
45
  DotNetAssembly,
45
46
  DotNetInstruction,
@@ -406,12 +407,24 @@ DOTNET_EFFECT_TABLE = VMEffectTable(
406
407
  )
407
408
 
408
409
 
409
- def lift_dotnet_assembly(assembly: DotNetAssembly, metadata: dict) -> "ModuleIR":
410
+ def lift_dotnet_assembly(
411
+ assembly: DotNetAssembly,
412
+ metadata: dict,
413
+ *,
414
+ reporter: ProgressReporter | None = None,
415
+ ) -> "ModuleIR":
416
+ total = len(assembly.methods)
417
+ report_progress(reporter, phase="lift", status="started", completed=0, total=total, unit="function", message="lifting .NET functions")
418
+ functions = []
419
+ for index, method in enumerate(assembly.methods, start=1):
420
+ report_progress(reporter, phase="lift", completed=index - 1, total=total, unit="function", item_label=method.name, message=f"lifting function {method.name}")
421
+ functions.append(_recover_dotnet_method(method))
422
+ report_progress(reporter, phase="lift", completed=index, total=total, unit="function", item_label=method.name, message=f"lifted function {method.name}")
410
423
  return assemble_vm_module(
411
424
  name=assembly.name,
412
425
  source_language="dotnet",
413
426
  metadata={"frontend": metadata, "bytecode_format": "cli-assembly"},
414
- functions=tuple(_recover_dotnet_method(method) for method in assembly.methods),
427
+ functions=tuple(functions),
415
428
  )
416
429
 
417
430
 
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from unidecompiler.core.ir import ModuleIR
4
4
  from unidecompiler.plugins import FrontendModule
5
+ from unidecompiler.progress import ProgressReporter
5
6
  from unidecompiler_plugin_dotnet_cli.assembly import (
6
7
  DnfileAssemblyDecoder,
7
8
  DotNetAssemblyDecoder,
@@ -52,3 +53,8 @@ class DotNetFrontendPlugin:
52
53
  )
53
54
 
54
55
  return lift_dotnet_assembly(module.payload, module.metadata)
56
+
57
+ def lift_with_progress(self, module: FrontendModule, reporter: ProgressReporter) -> ModuleIR:
58
+ if module.frontend_id != self.id:
59
+ raise TypeError(f".NET frontend cannot lift module from {module.frontend_id!r}")
60
+ return lift_dotnet_assembly(module.payload, module.metadata, reporter=reporter)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unidecompiler-plugin-dotnet-cli
3
- Version: 0.1.4
3
+ Version: 0.2.1
4
4
  Summary: .NET CLI assembly frontend plugin for unidecompiler
5
5
  Author-email: Wker <1670133844@qq.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -9,7 +9,7 @@ Project-URL: Repository, https://github.com/Wker666/unidecompiler
9
9
  Project-URL: Issues, https://github.com/Wker666/unidecompiler/issues
10
10
  Requires-Python: >=3.11
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: unidecompiler<0.2.0,>=0.1.10
12
+ Requires-Dist: unidecompiler<0.3.0,>=0.2.1
13
13
  Requires-Dist: dnfile<1,>=0.15
14
14
 
15
15
  # unidecompiler-plugin-dotnet-cli
@@ -0,0 +1,2 @@
1
+ unidecompiler<0.3.0,>=0.2.1
2
+ dnfile<1,>=0.15
@@ -1,2 +0,0 @@
1
- unidecompiler<0.2.0,>=0.1.10
2
- dnfile<1,>=0.15