unidecompiler-plugin-lua 0.1.1__tar.gz → 0.1.2__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 (19) hide show
  1. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/PKG-INFO +2 -2
  2. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/pyproject.toml +2 -2
  3. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/chunk54.py +3 -0
  4. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/lifter.py +2 -0
  5. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/luac.py +2 -0
  6. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua.egg-info/PKG-INFO +2 -2
  7. unidecompiler_plugin_lua-0.1.2/src/unidecompiler_plugin_lua.egg-info/requires.txt +1 -0
  8. unidecompiler_plugin_lua-0.1.1/src/unidecompiler_plugin_lua.egg-info/requires.txt +0 -1
  9. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/README.md +0 -0
  10. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/setup.cfg +0 -0
  11. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/__init__.py +0 -0
  12. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/normalize.py +0 -0
  13. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/plugin.py +0 -0
  14. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/simulation.py +0 -0
  15. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua/support.py +0 -0
  16. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua.egg-info/SOURCES.txt +0 -0
  17. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua.egg-info/dependency_links.txt +0 -0
  18. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua.egg-info/entry_points.txt +0 -0
  19. {unidecompiler_plugin_lua-0.1.1 → unidecompiler_plugin_lua-0.1.2}/src/unidecompiler_plugin_lua.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unidecompiler-plugin-lua
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Lua bytecode 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.1
12
+ Requires-Dist: unidecompiler<0.2.0,>=0.1.2
13
13
 
14
14
  # unidecompiler-plugin-lua
15
15
 
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "unidecompiler-plugin-lua"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Lua bytecode 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.1,<0.2.0"]
13
+ dependencies = ["unidecompiler>=0.1.2,<0.2.0"]
14
14
 
15
15
  [project.urls]
16
16
  Homepage = "https://github.com/Wker666/unidecompiler"
@@ -198,6 +198,7 @@ def _read_code(reader: _Reader) -> tuple[LuaInstructionListing, ...]:
198
198
  count = reader.varint()
199
199
  instructions: list[LuaInstructionListing] = []
200
200
  for pc in range(1, count + 1):
201
+ artifact_offset = reader.offset
201
202
  raw = reader.unpack("I")
202
203
  opcode = _OPCODES[raw & 0x7F]
203
204
  instructions.append(
@@ -206,6 +207,8 @@ def _read_code(reader: _Reader) -> tuple[LuaInstructionListing, ...]:
206
207
  line=None,
207
208
  opcode=opcode,
208
209
  operands=_decode_operands(opcode, raw),
210
+ artifact_offset=artifact_offset,
211
+ size=4,
209
212
  )
210
213
  )
211
214
  return tuple(instructions)
@@ -32,6 +32,7 @@ from unidecompiler.core.vm_function import (
32
32
  from unidecompiler.core.vm_bytecode import VMBytecodeStep
33
33
  from unidecompiler.core.vm_hints import VMHint
34
34
  from unidecompiler.core.vm_operands import VMDecodedInstruction, VMOperand
35
+ from unidecompiler.provenance import ByteRange
35
36
  from unidecompiler.core.vm_region import (
36
37
  VMLinearState,
37
38
  VMRegionOpcodeClasses,
@@ -1105,6 +1106,7 @@ def _lua_decoded_instruction(instruction, source: SourceRef) -> VMDecodedInstruc
1105
1106
  source=source,
1106
1107
  operands=tuple(VMOperand(role=_lua_operand_role(operand), value=operand, text=operand) for operand in instruction.operands),
1107
1108
  raw=f"{instruction.pc}: {instruction.opcode} {' '.join(instruction.operands)}".strip(),
1109
+ artifact_range=(None if instruction.artifact_offset is None or instruction.size is None else ByteRange(instruction.artifact_offset, instruction.size)),
1108
1110
  )
1109
1111
 
1110
1112
 
@@ -54,6 +54,8 @@ class LuaInstructionListing:
54
54
  opcode: str
55
55
  operands: tuple[str, ...]
56
56
  comment: str | None = None
57
+ artifact_offset: int | None = None
58
+ size: int | None = None
57
59
 
58
60
 
59
61
  @dataclass(frozen=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unidecompiler-plugin-lua
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Lua bytecode 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.1
12
+ Requires-Dist: unidecompiler<0.2.0,>=0.1.2
13
13
 
14
14
  # unidecompiler-plugin-lua
15
15
 
@@ -0,0 +1 @@
1
+ unidecompiler<0.2.0,>=0.1.2
@@ -1 +0,0 @@
1
- unidecompiler<0.2.0,>=0.1.1