ida-domain 0.3.5.dev1__tar.gz → 0.3.6.dev1__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 (28) hide show
  1. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/PKG-INFO +1 -1
  2. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/__init__.py +1 -1
  3. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/functions.py +13 -9
  4. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain.egg-info/PKG-INFO +1 -1
  5. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/pyproject.toml +1 -1
  6. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/LICENSE +0 -0
  7. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/README.md +0 -0
  8. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/base.py +0 -0
  9. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/bytes.py +0 -0
  10. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/comments.py +0 -0
  11. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/database.py +0 -0
  12. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/entries.py +0 -0
  13. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/flowchart.py +0 -0
  14. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/heads.py +0 -0
  15. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/hooks.py +0 -0
  16. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/instructions.py +0 -0
  17. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/names.py +0 -0
  18. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/operands.py +0 -0
  19. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/segments.py +0 -0
  20. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/signature_files.py +0 -0
  21. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/strings.py +0 -0
  22. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/types.py +0 -0
  23. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain/xrefs.py +0 -0
  24. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain.egg-info/SOURCES.txt +0 -0
  25. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain.egg-info/dependency_links.txt +0 -0
  26. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain.egg-info/requires.txt +0 -0
  27. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/ida_domain.egg-info/top_level.txt +0 -0
  28. {ida_domain-0.3.5.dev1 → ida_domain-0.3.6.dev1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ida-domain
3
- Version: 0.3.5.dev1
3
+ Version: 0.3.6.dev1
4
4
  Summary: IDA Domain API - Python interface for IDA Pro reverse engineering platform
5
5
  Author-email: Hex-Rays SA <support@hex-rays.com>
6
6
  License-Expression: MIT
@@ -25,7 +25,7 @@ def _load_dependencies() -> None:
25
25
  import idapro
26
26
 
27
27
 
28
- __version__ = '0.3.5-dev.1'
28
+ __version__ = '0.3.6-dev.1'
29
29
 
30
30
  # Make sure all dependencies are loaded
31
31
  _load_dependencies()
@@ -186,11 +186,14 @@ class FunctionChunk:
186
186
  """True if is the function main chunk"""
187
187
 
188
188
 
189
- class _LVarRefsVisitor(ida_hexrays.ctree_visitor_t):
190
- """Visitor to find references to a specific local variable in pseudocode."""
189
+ class _LVarRefsVisitor(ida_hexrays.ctree_parentee_t):
190
+ """Visitor to find references to a specific local variable in pseudocode.
191
+
192
+ Uses ctree_parentee_t which properly maintains parent information.
193
+ """
191
194
 
192
195
  def __init__(self, cfunc: Any, lvar_index: int):
193
- super().__init__(ida_hexrays.CV_FAST)
196
+ super().__init__()
194
197
  self.cfunc = cfunc
195
198
  self.lvar_index = lvar_index
196
199
  self.refs: List[LocalVariableReference] = []
@@ -201,8 +204,11 @@ class _LVarRefsVisitor(ida_hexrays.ctree_visitor_t):
201
204
  # Found any variable - check if it's our target
202
205
  if expr.v.idx == self.lvar_index:
203
206
  # Found a reference to our variable
204
- access_type = self._determine_access_type(expr)
205
- context = self._determine_context(expr)
207
+ # Use parent_expr() to get the parent expression
208
+ parent = self.parent_expr()
209
+
210
+ access_type = self._determine_access_type(expr, parent)
211
+ context = self._determine_context(expr, parent)
206
212
  ea = expr.ea if expr.ea != BADADDR else None
207
213
 
208
214
  # Extract line information
@@ -231,9 +237,8 @@ class _LVarRefsVisitor(ida_hexrays.ctree_visitor_t):
231
237
  self.refs.append(ref)
232
238
  return 0
233
239
 
234
- def _determine_access_type(self, expr: Any) -> LocalVariableAccessType:
240
+ def _determine_access_type(self, expr: Any, parent: Any) -> LocalVariableAccessType:
235
241
  """Determine how the variable is being accessed."""
236
- parent = expr.cexpr
237
242
  if not parent:
238
243
  return LocalVariableAccessType.READ
239
244
 
@@ -261,9 +266,8 @@ class _LVarRefsVisitor(ida_hexrays.ctree_visitor_t):
261
266
 
262
267
  return LocalVariableAccessType.READ
263
268
 
264
- def _determine_context(self, expr: Any) -> LocalVariableContext:
269
+ def _determine_context(self, expr: Any, parent: Any) -> LocalVariableContext:
265
270
  """Determine the context where the variable is used."""
266
- parent = expr.cexpr
267
271
  if not parent:
268
272
  return LocalVariableContext.OTHER
269
273
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ida-domain
3
- Version: 0.3.5.dev1
3
+ Version: 0.3.6.dev1
4
4
  Summary: IDA Domain API - Python interface for IDA Pro reverse engineering platform
5
5
  Author-email: Hex-Rays SA <support@hex-rays.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ida-domain"
3
- version = "0.3.5-dev.1"
3
+ version = "0.3.6-dev.1"
4
4
  description = "IDA Domain API - Python interface for IDA Pro reverse engineering platform"
5
5
  requires-python = ">=3.9"
6
6
  license = "MIT"
File without changes