hilda 2.0.6__py3-none-any.whl → 2.0.8__py3-none-any.whl

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.
hilda/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.0.6'
16
- __version_tuple__ = version_tuple = (2, 0, 6)
15
+ __version__ = version = '2.0.8'
16
+ __version_tuple__ = version_tuple = (2, 0, 8)
hilda/hilda_client.py CHANGED
@@ -511,7 +511,8 @@ class HildaClient:
511
511
  :param dict options: User defined options.
512
512
  """
513
513
  bp = bp_loc.GetBreakpoint()
514
- symbol = hilda.breakpoints[bp.id].address # type: Symbol
514
+
515
+ symbol = hilda.symbol(hilda.frame.addr.GetLoadAddress(hilda.target)) # type: Symbol
515
516
 
516
517
  # by default, attempt to resolve the symbol name through lldb
517
518
  name = str(symbol.lldb_symbol)
@@ -1043,6 +1044,24 @@ class HildaClient:
1043
1044
 
1044
1045
  return value
1045
1046
 
1047
+ def wait_for_module(self, expression: str) -> None:
1048
+ """ Wait for a module to be loaded using `dlopen` by matching given expression """
1049
+ self.log_info(f'Waiting for module name containing "{expression}" to be loaded')
1050
+
1051
+ def bp(client: HildaClient, frame, bp_loc, options) -> None:
1052
+ loading_module_name = client.evaluate_expression('$arg1').peek_str()
1053
+ client.log_info(f'Loading module: {loading_module_name}')
1054
+ if expression not in loading_module_name:
1055
+ client.cont()
1056
+ return
1057
+ client.finish()
1058
+ client.log_info(f'Desired module has been loaded: {expression}. Process remains stopped')
1059
+ bp = bp_loc.GetBreakpoint()
1060
+ client.remove_hilda_breakpoint(bp.id)
1061
+
1062
+ self.bp('dlopen', bp)
1063
+ self.cont()
1064
+
1046
1065
  def interact(self, additional_namespace: Optional[typing.Mapping] = None,
1047
1066
  startup_files: Optional[List[str]] = None) -> None:
1048
1067
  """ Start an interactive Hilda shell """
@@ -1166,6 +1185,11 @@ class HildaClient:
1166
1185
  else:
1167
1186
  return f'{value:x} (unsupported format)'
1168
1187
 
1188
+ @cached_property
1189
+ def _object_identifier(self) -> Symbol:
1190
+ return self.symbols.objc_getClass('VMUObjectIdentifier').objc_call('alloc').objc_call(
1191
+ 'initWithTask:', self.symbols.mach_task_self())
1192
+
1169
1193
  @cached_property
1170
1194
  def _ks(self) -> Optional['Ks']:
1171
1195
  if not lldb.KEYSTONE_SUPPORT:
hilda/symbol.py CHANGED
@@ -104,6 +104,13 @@ class Symbol(int):
104
104
  """
105
105
  return self._client.symbols.CFCopyDescription(self).po()
106
106
 
107
+ @property
108
+ def name(self) -> str:
109
+ symbol_info = int(self._client.po(f'[{self._client._object_identifier} symbolForAddress:{self}]', '__int128'))
110
+ arg1 = symbol_info & 0xffffffffffffffff
111
+ arg2 = symbol_info >> 64
112
+ return self._client.symbols.CSSymbolGetName(arg1, arg2).peek_str()
113
+
107
114
  @contextmanager
108
115
  def change_item_size(self, new_item_size: int) -> None:
109
116
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hilda
3
- Version: 2.0.6
3
+ Version: 2.0.8
4
4
  Summary: LLDB wrapped and empowered by iPython's features
5
5
  Author-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>, netanel cohen <netanelc305@protonmail.com>
6
6
  Maintainer-email: doronz88 <doron88@gmail.com>, matan <matan1008@gmail.com>, netanel cohen <netanelc305@protonmail.com>
@@ -207,38 +207,39 @@ Here is a gist of methods you can access from `p`:
207
207
  - Call function at given address with given parameters
208
208
  - `monitor`
209
209
  - Monitor every time a given address is called
210
+
210
211
  The following options are available:
211
212
 
212
213
  ```
213
214
  regs={reg1: format}
214
- will print register values
215
+ will print register values
215
216
 
216
- Available formats:
217
- x: hex
218
- s: string
219
- cf: use CFCopyDescription() to get more informative description of the object
220
- po: use LLDB po command
221
- User defined function, will be called like `format_function(hilda_client, value)`.
217
+ Available formats:
218
+ x: hex
219
+ s: string
220
+ cf: use CFCopyDescription() to get more informative description of the object
221
+ po: use LLDB po command
222
+ User defined function, will be called like `format_function(hilda_client, value)`.
222
223
 
223
- For example:
224
- regs={'x0': 'x'} -> x0 will be printed in HEX format
225
- expr={lldb_expression: format}
226
- lldb_expression can be for example '$x0' or '$arg1'
227
- format behaves just like 'regs' option
228
- retval=format
229
- Print function's return value. The format is the same as regs format.
230
- stop=True
231
- force a stop at every hit
232
- bt=True
233
- print backtrace
234
- cmd=[cmd1, cmd2]
235
- run several LLDB commands, one by another
236
- force_return=value
237
- force a return from function with the specified value
238
- name=some_value
239
- use `some_name` instead of the symbol name automatically extracted from the calling frame
240
- override=True
241
- override previous break point at same location
224
+ For example:
225
+ regs={'x0': 'x'} -> x0 will be printed in HEX format
226
+ expr={lldb_expression: format}
227
+ lldb_expression can be for example '$x0' or '$arg1'
228
+ format behaves just like 'regs' option
229
+ retval=format
230
+ Print function's return value. The format is the same as regs format.
231
+ stop=True
232
+ force a stop at every hit
233
+ bt=True
234
+ print backtrace
235
+ cmd=[cmd1, cmd2]
236
+ run several LLDB commands, one by another
237
+ force_return=value
238
+ force a return from function with the specified value
239
+ name=some_value
240
+ use `some_name` instead of the symbol name automatically extracted from the calling frame
241
+ override=True
242
+ override previous break point at same location
242
243
  ```
243
244
 
244
245
  - `show_current_source`
@@ -305,6 +306,8 @@ Here is a gist of methods you can access from `p`:
305
306
  - sets the currently selected thread, which is used in other parts of the program, such as displaying disassembly or
306
307
  checking registers.
307
308
  This ensures the application focuses on the specified thread for these operations.
309
+ - `wait_for_module`
310
+ - Wait for a module to be loaded (`dlopen`) by checking if given expression is contained within its filename
308
311
 
309
312
  All these methods are available from the global `p` within the newly created IPython shell. In addition, you may invoke any of the exported APIs described in the [Python API](#python-api)
310
313
 
@@ -3,19 +3,19 @@ gifs/ui.png,sha256=iaRwNZ9qVWUkUe2TJb_6VPsTu--7HrElA2duWiyZ-Oc,131
3
3
  gifs/xpc_print_message.gif,sha256=i5S8Y9bJm9n-NtOipFTAC8_jUR4uZCM4sOap_ccJX0k,939935
4
4
  hilda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  hilda/__main__.py,sha256=KWRqvukK4wraxCMtvH5nO25mFXLO5aWXa7z_VfAtbO8,90
6
- hilda/_version.py,sha256=Wi5IhMJyXnsHrRVvntjgN_4VraEDKfzB4n5JLjtc1xM,411
6
+ hilda/_version.py,sha256=wtweKl259FasTmTDW_B2ND6XJ-CdClCcQNXoYb5IxW4,411
7
7
  hilda/cli.py,sha256=FQtOg1iFRtNdVVes_SchIoidOWAENhsLItwXBWCgWgc,3625
8
8
  hilda/common.py,sha256=VFtpOH9IRqbu6lONM6Hz-PxcdJfktgS3akJv5UCHO0s,523
9
9
  hilda/exceptions.py,sha256=8L1OvOqns4O4ieiH4YlrMbZkk_PvuyCq4UyqFAodkF8,2042
10
10
  hilda/hilda_ascii_art.html,sha256=-9YCjAKdGbjtdd6uoKrxkkcJq7j16r4dGka2bZ27b4o,120119
11
- hilda/hilda_client.py,sha256=UHCUQJclIS2qk81Jk1leDxdTwTuojA-sM9JaANfp120,45357
11
+ hilda/hilda_client.py,sha256=3WJA1G7YXw7PKAO-PCnhL_Jk9Dl9eFMeumab2KMXXT0,46442
12
12
  hilda/launch_lldb.py,sha256=sD-02HERIFQEYoPM9JrRfFOTjHE2QUt3L0pNgFsyAEQ,7186
13
13
  hilda/lldb_entrypoint.py,sha256=vTiClzfiTtjorlxEfIsI-W657KEGobx74qDhaZ8nPhM,1007
14
14
  hilda/lldb_importer.py,sha256=LrIQnigDG3wgmIPXya67oBlWubkDgV-rEpzfWNEYCoc,553
15
15
  hilda/objective_c_class.py,sha256=Xyw7FucNVcu8NqhB0Gy-OjaN_2DmCywn6pjUEwyd1Hk,11760
16
16
  hilda/objective_c_symbol.py,sha256=VpNzVcfvbvZxX3x-7zh_20GZ_17akr1WsdpI4KRNgt4,8400
17
17
  hilda/registers.py,sha256=moGS9MXrfm8vmnqDKWZSg4wmZNydGUadui9uwEwzhsI,856
18
- hilda/symbol.py,sha256=_TSQqFysRs82BFNGX9o_ZbkrwzSsWq3FiMbX92VKoPo,7200
18
+ hilda/symbol.py,sha256=_A-ivRttf7f1Fxclj23pC807r08GQ1KwHvEXnyw7FT4,7517
19
19
  hilda/symbols_jar.py,sha256=1GPgrbXdsxiirMufrWqVi-DHF9qDXgy_HMtWJD4dJuE,6447
20
20
  hilda/ipython_extensions/events.py,sha256=w_4V8FoJJMarWArEE8uzb2UXk1mqfslmI7XCyVb_XuE,1976
21
21
  hilda/ipython_extensions/keybindings.py,sha256=kKArfRWyJ261ieUot4CVTGRmwbnixYtrpgiFCnBfDag,1013
@@ -46,9 +46,9 @@ hilda/snippets/macho/macho_load_commands.py,sha256=OsajG2xWuRwhYhj9f-lnUiNe43Yum
46
46
  hilda/ui/colors.json,sha256=f-ITquY3IInQreviTy23JfmxfJrGM1_MivACf1GKGqM,262
47
47
  hilda/ui/ui_manager.py,sha256=BmzI1sBx0PYCQDlB9Al7wsTEAMJxaJ7NW0DS4C7g5-0,2265
48
48
  hilda/ui/views.py,sha256=1u_eZzw7wAEP1bm_-9nkqgGhMSX__woiUuoBgnsAKVM,7843
49
- hilda-2.0.6.dist-info/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
50
- hilda-2.0.6.dist-info/METADATA,sha256=XIDvGGF2f4yl3WjF43Gxy3ugdEHua_loRX14W7tFX_0,23306
51
- hilda-2.0.6.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
52
- hilda-2.0.6.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
53
- hilda-2.0.6.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
54
- hilda-2.0.6.dist-info/RECORD,,
49
+ hilda-2.0.8.dist-info/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
50
+ hilda-2.0.8.dist-info/METADATA,sha256=Qg_vPENFr9X77Pj9idD0ajBISSsWPc6D3PxROoL5utM,23325
51
+ hilda-2.0.8.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
52
+ hilda-2.0.8.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
53
+ hilda-2.0.8.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
54
+ hilda-2.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes