hilda 3.0.0__py3-none-any.whl → 3.1.0__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: hilda
3
- Version: 3.0.0
3
+ Version: 3.1.0
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>
@@ -55,6 +55,7 @@ Requires-Dist: inquirer3
55
55
  Requires-Dist: traitlets
56
56
  Provides-Extra: test
57
57
  Requires-Dist: pytest; extra == "test"
58
+ Dynamic: license-file
58
59
 
59
60
  # Hilda
60
61
 
@@ -152,165 +153,94 @@ You can may start a Hilda interactive shell by invoking any of the subcommand:
152
153
 
153
154
  ### Inside a Hilda shell
154
155
 
155
- Upon starting Hilda shell, you are greeted with:
156
-
157
- ```
158
- Hilda has been successfully loaded! 😎
159
- Use the p global to access all features.
160
- Have a nice flight ✈️! Starting an IPython shell...
161
- ```
162
-
163
- Here is a gist of methods you can access from `p`:
164
-
165
- - `hd`
166
- - Print a hexdump of given buffer
167
- - `lsof`
168
- - Get dictionary of all open FDs
169
- - `bt`
170
- - Print an improved backtrace.
171
- - `disable_jetsam_memory_checks`
172
- - Disable jetsam memory checks, prevent raising:
173
- `error: Execution was interrupted, reason: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=15 MB, unused=0x0).`
174
- when evaluating expression.
175
- - `symbol`
176
- - Get symbol object for a given address
177
- - `objc_symbol`
178
- - Get objc symbol wrapper for given address
179
- - `inject`
180
- - Inject a single library into currently running process
181
- - `rebind_symbols`
182
- - Reparse all loaded images symbols
183
- - `poke`
184
- - Write data at given address
185
- - `peek`
186
- - Read data at given address
187
- - `peek_str`
188
- - Peek a buffer till null termination
189
- - `peek_std_str`
190
- - Peek a `std::string`
191
- - `stop`
192
- - Stop process.
193
- - `cont`
194
- - Continue process.
195
- - `run_for`
196
- - Run the process for given interval.
197
- - `detach`
198
- - Detach from process.
199
- Useful in order to exit gracefully so process doesn't get killed
200
- while you exit
201
- - `disass`
202
- - Print disassembly from a given address
203
- - `file_symbol`
204
- - Calculate symbol address without ASLR
205
- - `get_register`
206
- - Get value for register by its name
207
- - `set_register`
208
- - Set value for register by its name
209
- - `objc_call`
210
- - Simulate a call to an objc selector
211
- - `call`
212
- - Call function at given address with given parameters
213
- - `monitor` or `breakpoints.add_monitor`
214
- - Monitor every time a given address is called
215
-
216
- The following options are available:
217
-
218
- ```
219
- regs={reg1: format}
220
- will print register values
221
-
222
- Available formats:
223
- x: hex
224
- s: string
225
- cf: use CFCopyDescription() to get more informative description of the object
226
- po: use LLDB po command
227
- User defined function, will be called like `format_function(hilda_client, value)`.
228
-
229
- For example:
230
- regs={'x0': 'x'} -> x0 will be printed in HEX format
231
- expr={lldb_expression: format}
232
- lldb_expression can be for example '$x0' or '$arg1'
233
- format behaves just like 'regs' option
234
- retval=format
235
- Print function's return value. The format is the same as regs format.
236
- stop=True
237
- force a stop at every hit
238
- bt=True
239
- print backtrace
240
- cmd=[cmd1, cmd2]
241
- run several LLDB commands, one by another
242
- force_return=value
243
- force a return from function with the specified value
244
- name=some_value
245
- use `some_name` instead of the symbol name automatically extracted from the calling frame
246
- override=True
247
- override previous break point at same location
248
- ```
249
-
250
- - `show_current_source`
251
- - print current source code if possible
252
- - `finish`
253
- - Run current frame till its end.
254
- - `step_into`
255
- - Step into current instruction.
256
- - `step_over`
257
- - Step over current instruction.
258
- - `breakpoints.clear`
259
- - Remove all breakpoints
260
- - `breakpoints.remove`
261
- - Remove a single breakpoint
262
- - `force_return`
263
- - Prematurely return from a stack frame, short-circuiting exection of newer frames and optionally
264
- yielding a specified value.
265
- - `proc_info`
266
- - Print information about currently running mapped process.
267
- - `print_proc_entitlements`
268
- - Get the plist embedded inside the process' __LINKEDIT section.
269
- - `bp` or `breakpoints.add`
270
- - Add a breakpoint
271
- - `breakpoints.show`
272
- - Show existing breakpoints
273
- - `po`
274
- - Print given object using LLDB's po command
275
- Can also run big chunks of native code:
276
-
277
- po('NSMutableString *s = [NSMutableString string]; [s appendString:@"abc"]; [s description]')
278
- - `globalize_symbols`
279
- - Make all symbols in python's global scope
280
- - `jump`
281
- - jump to given symbol
282
- - `lldb_handle_command`
283
- - Execute an LLDB command
284
- For example:
285
- lldb_handle_command('register read')
286
- - `objc_get_class`
287
- - Get ObjC class object
288
- - `CFSTR`
289
- - Create CFStringRef object from given string
290
- - `ns`
291
- - Create NSObject from given data
292
- - `from_ns`
293
- - Create python object from NS object.
294
- - `evaluate_expression`
295
- - Wrapper for LLDB's EvaluateExpression.
296
- Used for quick code snippets.
297
-
298
- Feel free to use local variables inside the expression using format string.
299
- For example:
300
- currentDevice = objc_get_class('UIDevice').currentDevice
301
- evaluate_expression(f'[[{currentDevice} systemName] hasPrefix:@"2"]')
302
- - `import_module`
303
- - Import & reload given python module (intended mainly for external snippets)
304
- - `unwind`
305
- - Unwind the stack (useful when get_evaluation_unwind() == False)
306
- - `set_selected_thread`
307
- - sets the currently selected thread, which is used in other parts of the program, such as displaying disassembly or
308
- checking registers.
309
- This ensures the application focuses on the specified thread for these operations.
310
- - `wait_for_module`
311
- - Wait for a module to be loaded (`dlopen`) by checking if given expression is contained within its filename
312
-
313
- 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)
156
+ Upon starting Hilda, you are welcomed into an IPython shell.
157
+ You can access following methods via the variable `p`.
158
+
159
+ Basic flow control:
160
+
161
+ - `stop` - Stop process
162
+ - `cont` - Continue process
163
+ - `finish` - Run current function until return
164
+ - `step_into` - Step into current instruction
165
+ - `step_over` - Step over current instruction.
166
+ - `run_for` - Run the process for given interval
167
+ - `force_return` - Prematurely return from a stack frame, short-circuiting exection of inner
168
+ frames and optionally yielding a specified value.
169
+ - `jump` - Jump to given symbol
170
+ - `wait_for_module` - Wait for a module to be loaded (`dlopen`) by checking if given expression is contained within its filename
171
+ - `detach` - Detach from process (useful for exiting gracefully so the
172
+ process doesn't get killed when you exit)
173
+
174
+ Breakpoints:
175
+ - `bp` or `breakpoints.add` - Add a breakpoint
176
+ - `breakpoints.show` - Show existing breakpoints
177
+ - `breakpoints.remove` - Remove a single breakpoint
178
+ - `breakpoints.clear` - Remove all breakpoints
179
+ - `monitor` or `breakpoints.add_monitor` - Creates a breakpoint whose callback implements the requested features (print register vallues, execute commands, mock return value, etc.)
180
+
181
+ Basic read/write:
182
+
183
+ - `get_register` - Get register value
184
+ - `set_register` - Set register value
185
+ - `poke` - Write data at address
186
+ - `peek[_str,_std_str]` - Read buffer/C-string/`std::string` at address
187
+ - `po` - Print object using LLDB's `po` command
188
+ Can also run arbitrary native code:
189
+
190
+ ```python
191
+ p.po('NSMutableString *s = [NSMutableString string]; [s appendString:@"abc"]; [s description]')
192
+ ```
193
+ - `disass` - Print disassembly at address
194
+ - `show_current_source` - Print current source code (if possible)
195
+ - `bt` - Get backtrace
196
+ - `lsof` - Get all open FDs
197
+ - `hd` - Hexdump a buffer
198
+ - `proc_info` - Print information about currently running mapped process
199
+ - `print_proc_entitlements` - Get the plist embedded inside the process' __LINKEDIT section.
200
+
201
+ Execute code:
202
+
203
+ - `call` - Call function at given address with given parameters
204
+ - `objc_call` - Simulate a call to an objc selector
205
+ - `inject` - Inject a single library into currently running process
206
+ - `disable_jetsam_memory_checks` -
207
+ Disable jetsam memory checks (to prevent raising
208
+ `error: Execution was interrupted, reason: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=15 MB, unused=0x0).`
209
+ when evaluating expressions).
210
+
211
+ Hilda symbols:
212
+
213
+ - `symbol` - Get symbol object for a given address
214
+ - `objc_symbol` - Get objc symbol wrapper for given address
215
+ - `rebind_symbols` - Reparse all loaded images symbols
216
+ - `file_symbol` - Calculate symbol address without ASLR
217
+ - `save` - Save loaded symbols map (for loading later using the load() command)
218
+ - `load` - Load an existing symbols map (previously saved by the save() command)
219
+ - `globalize_symbols` - Make all symbols in python's global scope
220
+
221
+ Advanced:
222
+
223
+ - `lldb_handle_command` - Execute an LLDB command (e.g., `p.lldb_handle_command('register read')`)
224
+ - `evaluate_expression` - Use for quick code snippets (wrapper for LLDB's `EvaluateExpression`)
225
+
226
+ Take advantage of local variables inside the expression using format string, e.g.,
227
+
228
+ ```python
229
+ currentDevice = p.objc_get_class('UIDevice').currentDevice
230
+ p.evaluate_expression(f'[[{currentDevice} systemName] hasPrefix:@"2"]')
231
+ ```
232
+ - `import_module` - Import & reload given python module (intended mainly for external snippets)
233
+ - `unwind` - Unwind the stack (useful when get_evaluation_unwind() == False)
234
+ - `set_selected_thread` - sets the currently selected thread, which is used in other parts of the program, such as displaying disassembly or
235
+ checking registers.
236
+ This ensures the application focuses on the specified thread for these operations.
237
+
238
+ Objective-C related:
239
+
240
+ - `objc_get_class` - Get ObjC class object
241
+ - `CFSTR` - Create CFStringRef object from given string
242
+ - `ns` - Create NSObject from given data
243
+ - `from_ns` - Create python object from NS object.
314
244
 
315
245
  #### Magic functions
316
246
 
@@ -672,7 +602,7 @@ commands so you are able to use complicated types when parsing values and passin
672
602
  import datetime
673
603
 
674
604
  # using the `ns` command we can just pass a python-native dictionary
675
- function_requiring_a_specfic_dictionary(ns({
605
+ function_requiring_a_specfic_dictionary(p.cf({
676
606
  'key1': 'string', # will convert to NSString
677
607
  'key2': True, # will convert to NSNumber
678
608
  'key3': b'1234', # will convert to NSData
@@ -3,21 +3,22 @@ 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=feOY2rjYM8_-oXmp5ErPlMe-6zWTpyiw538tUrvFyEA,511
7
- hilda/breakpoints.py,sha256=ZVszQf4WtRgjM2JAn8E-b-Ve6kzVg5VwvTHv5_wGjwQ,19198
6
+ hilda/_version.py,sha256=KrVRMDzlLQ07c4N1d6-nDOLo4hWpD8cSSFcYXWlm64k,511
7
+ hilda/breakpoints.py,sha256=WyUSTOJ-lQqki8ZpwAsAOCNazMFaJfd5p5HwdEZ84v8,20035
8
8
  hilda/cli.py,sha256=PCjrI7GrERIrZCODJYmPt6eyl-nPYZviTS8fBG3oIjM,3618
9
9
  hilda/common.py,sha256=El-ih7cvCv9PJ5OWb1jkCbh4GuaRD6gqlrFC5gyY-TE,498
10
+ hilda/decorators.py,sha256=iNowrDoFHX0qsqqU5NfMMPpETbaU_-ga_bxvnOmsQHw,962
10
11
  hilda/exceptions.py,sha256=8L1OvOqns4O4ieiH4YlrMbZkk_PvuyCq4UyqFAodkF8,2042
11
- hilda/hilda_ascii_art.html,sha256=-9YCjAKdGbjtdd6uoKrxkkcJq7j16r4dGka2bZ27b4o,120119
12
- hilda/hilda_client.py,sha256=Uqp0N91gHJFkN9vZ9NN4YLkHGDXym4JGKjn-08HUZVE,38804
13
- hilda/launch_lldb.py,sha256=gU1iJmxuH7w5HV_cy1igv-JageyQn2dmqSxx8vkpY0k,8033
12
+ hilda/hilda_client.py,sha256=phSwiI3XfuLzMXlUw7-irbZbEgi7sEpDz2w7EGUUhf0,38897
13
+ hilda/launch_lldb.py,sha256=-lmxif-w53oeTCea6ZHLiYHChkMpdDDO_zgTFWpAU6E,8597
14
14
  hilda/lldb_entrypoint.py,sha256=vTiClzfiTtjorlxEfIsI-W657KEGobx74qDhaZ8nPhM,1007
15
15
  hilda/lldb_importer.py,sha256=TCGpAWwiBuyNRsbgcYawiqm35t8XQLCJwoOfEqyBeik,526
16
16
  hilda/objective_c_class.py,sha256=AFGXFDkYUoHf_LVS6GJSyvMsIIYIviLx0PCa-f4pCT8,11561
17
17
  hilda/objective_c_symbol.py,sha256=lIZHef5iZe3AeUsK0uIsDtFnzSM-Ad6i2wfdj9DwLUM,8269
18
18
  hilda/registers.py,sha256=-9kk1MuKnWlJ0Z8zZ2RPV9nGRDtX1GXhCSkEvfnCktA,848
19
- hilda/symbol.py,sha256=yv8s0vQ6Z0ZoROeVE4RVaW0LFCyACZnFgp0QC6j05nI,7535
19
+ hilda/symbol.py,sha256=UIDmnNq1tx1uORqgRNaO_gfW2y17mhyy4cz83UVFhcc,7623
20
20
  hilda/symbols_jar.py,sha256=Vqdv6iH92P6aSfcz5XiR0FbNRqKuUu48mi-GxvPr32w,6504
21
+ hilda/watchpoints.py,sha256=ea5rBYNFEwYsPyWdPXMsbL1aElK9yfouuJg32rNcii4,9011
21
22
  hilda/ipython_extensions/events.py,sha256=w_4V8FoJJMarWArEE8uzb2UXk1mqfslmI7XCyVb_XuE,1976
22
23
  hilda/ipython_extensions/keybindings.py,sha256=W_Cnh8lG5yVdK5x0A-4UeyBsoJBufbYl54Mqrbo8OwM,1922
23
24
  hilda/ipython_extensions/magics.py,sha256=ULb63-OyIaWwvSfwRvEG_65ibaI2RTxeX8yPJK8pbc0,1300
@@ -48,9 +49,9 @@ hilda/snippets/macho/macho_load_commands.py,sha256=vUWfFM2H6o8dMglXV7rHgh-EMTzS0
48
49
  hilda/ui/colors.json,sha256=f-ITquY3IInQreviTy23JfmxfJrGM1_MivACf1GKGqM,262
49
50
  hilda/ui/ui_manager.py,sha256=BmzI1sBx0PYCQDlB9Al7wsTEAMJxaJ7NW0DS4C7g5-0,2265
50
51
  hilda/ui/views.py,sha256=bzClOgKirKYs6nhsNRXpkGNIg3oIOmFb659GLWrlTdo,7792
51
- hilda-3.0.0.dist-info/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
52
- hilda-3.0.0.dist-info/METADATA,sha256=y0HMi2hFA-E3hr-kQL_5SBYqTxQdQBwvMLXUiSxklpo,23354
53
- hilda-3.0.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
54
- hilda-3.0.0.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
55
- hilda-3.0.0.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
56
- hilda-3.0.0.dist-info/RECORD,,
52
+ hilda-3.1.0.dist-info/licenses/LICENSE,sha256=M-LVJ0AFAYB82eueyl8brh-QLPe-iLNVgbCi79-3TDo,1078
53
+ hilda-3.1.0.dist-info/METADATA,sha256=ZWnTVzjqsJLwSRCY1g-uk4VDdMadXw1U5XmcgWrrgAI,21916
54
+ hilda-3.1.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
55
+ hilda-3.1.0.dist-info/entry_points.txt,sha256=9n3O3j6V3XnVR_GcFqCWNgRAbalfukTSW2WvghsLVmA,46
56
+ hilda-3.1.0.dist-info/top_level.txt,sha256=TVD7l1WkE1noT866YqPFhiQnjYCYZM5Xz54v_3EYpnI,11
57
+ hilda-3.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5