hashbinkit 0.2.0__tar.gz → 0.2.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 (25) hide show
  1. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/PKG-INFO +1 -1
  2. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/data.py +5 -8
  3. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/serialize.py +11 -4
  4. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit.egg-info/PKG-INFO +1 -1
  5. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/pyproject.toml +1 -1
  6. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/LICENCE +0 -0
  7. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/README.md +0 -0
  8. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/__init__.py +0 -0
  9. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/canonicalize.py +0 -0
  10. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/digests/__init__.py +0 -0
  11. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/digests/bloom.py +0 -0
  12. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/digests/common.py +0 -0
  13. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/digests/simhash.py +0 -0
  14. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/digests/unary.py +0 -0
  15. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit/graph.py +0 -0
  16. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit.egg-info/SOURCES.txt +0 -0
  17. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit.egg-info/dependency_links.txt +0 -0
  18. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit.egg-info/requires.txt +0 -0
  19. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/hashbinkit.egg-info/top_level.txt +0 -0
  20. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/setup.cfg +0 -0
  21. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/tests/test_bloom.py +0 -0
  22. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/tests/test_common.py +0 -0
  23. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/tests/test_data.py +0 -0
  24. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/tests/test_simhash.py +0 -0
  25. {hashbinkit-0.2.0 → hashbinkit-0.2.2}/tests/test_unary.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hashbinkit
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Hashing utility for binary function similarity analysis.
5
5
  License-Expression: GPL-3.0-or-later
6
6
  Project-URL: Homepage, https://github.com/valbucci/hashbinkit
@@ -227,9 +227,9 @@ class OpcodeData(Serializable):
227
227
  return cls(
228
228
  addr=get_addr(opcode_info),
229
229
  n_bytes=opcode_info["size"],
230
- raw_bytes=opcode_info["bytes"],
231
- op_type=opcode_info["type"],
232
- esil=opcode_info["esil"],
230
+ raw_bytes=opcode_info.get("bytes") or "",
231
+ op_type=opcode_info.get("type") or "",
232
+ esil=opcode_info.get("esil") or "",
233
233
  ptr=filter_placeholder_addr(opcode_info.get("ptr")),
234
234
  refs=refs,
235
235
  xrefs=xrefs,
@@ -406,8 +406,7 @@ class FunctionCodeData(Serializable):
406
406
 
407
407
  blocks.append(block)
408
408
 
409
- cfg.setup_nodes(block_addrs)
410
- cfg.setup_edges(block_edges)
409
+ cfg.setup(block_addrs, block_edges)
411
410
 
412
411
  return cls(
413
412
  # Identifiers
@@ -793,9 +792,7 @@ class BinaryDataManager(Serializable):
793
792
  yield from callers
794
793
  yield from terminal_callees
795
794
 
796
- self.func_call_graph.setup_nodes(_iter_cg_nodes())
797
- self.func_call_graph.setup_outputs(outputs)
798
-
795
+ self.func_call_graph.setup(_iter_cg_nodes(), outputs=outputs)
799
796
  return self.func_call_graph.size
800
797
 
801
798
 
@@ -265,10 +265,17 @@ class Serializable:
265
265
  def serialize(self) -> bytes:
266
266
  """Serialize self into bytes."""
267
267
  resolved = get_type_hints(type(self))
268
- return b"".join(
269
- _serialize(resolved[f.name], getattr(self, f.name))
270
- for f in fields(self) # type: ignore[reportArgumentType]
271
- )
268
+ parts = []
269
+ for f in fields(self): # type: ignore[reportArgumentType]
270
+ val = getattr(self, f.name)
271
+ try:
272
+ parts.append(_serialize(resolved[f.name], val))
273
+ except TypeError as e:
274
+ raise TypeError(
275
+ f"{type(self).__name__}.{f.name} = {val!r} "
276
+ f"(annotated {resolved[f.name]!r}): {e}"
277
+ ) from e
278
+ return b"".join(parts)
272
279
 
273
280
  @classmethod
274
281
  def _partial_deserialize(cls, b: bytes) -> tuple[Self, bytes]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hashbinkit
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Hashing utility for binary function similarity analysis.
5
5
  License-Expression: GPL-3.0-or-later
6
6
  Project-URL: Homepage, https://github.com/valbucci/hashbinkit
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hashbinkit"
7
- version = "0.2.0"
7
+ version = "0.2.2"
8
8
  description = "Hashing utility for binary function similarity analysis."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes