-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
executable file
·4664 lines (4664 loc) · 183 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
URLS=[
"pandare/index.html",
"pandare/plog_reader.html",
"pandare/pypluginmanager.html",
"pandare/extras/index.html",
"pandare/extras/fileHook.html",
"pandare/pyplugin.html",
"pandare/extras/ioctlFaker.html",
"pandare/extras/fileFaker.html",
"pandare/extras/procTrace.html",
"pandare/extras/dwarfdump.html",
"pandare/extras/procWriteCapture.html",
"pandare/extras/modeFilter.html",
"pandare/utils.html",
"pandare/qemu_logging.html",
"pandare/arch.html",
"pandare/qcows_internal.html",
"pandare/panda_expect.html",
"pandare/taint/index.html",
"pandare/taint/TaintQuery.html",
"pandare/cosi.html",
"pandare/qcows.html",
"pandare/panda.html"
];
INDEX=[
{
"ref":"pandare",
"url":0,
"doc":" pandare (also called PyPANDA) is a Python 3 module built for interacting with the PANDA project. The module enables driving an execution of a virtual machine while also introspecting on its execution using PANDA's callback and plugin systems. Most of the commonly used APIs are in pandare.panda . Example plugins are available in the [examples directory](https: github.com/panda-re/panda/tree/master/panda/python/examples). PyPANDA PyPANDA is a python interface to PANDA. With PyPANDA, you can quickly develop plugins to analyze behavior of a running system, record a system and analyze replays, or do nearly anything you can do using PANDA's C/C APIs. Installation Follow PANDA's build instructions. The pandare/panda docker container includes the pandare package. If you setup panda with the install_ubuntu.sh script, it will install PyPANDA for you. Otherwise, when your install instructions tell you to run build.sh be sure to include the python flag. Example program This program counts the number of basic blocks executed while running uname -a inside a 32-bit guest. from pandare import Panda panda = Panda(generic='i386') Create an instance of panda Counter of the number of basic blocks blocks = 0 Register a callback to run before_block_exec and increment blocks @panda.cb_before_block_exec def before_block_execute(cpustate, transblock): global blocks blocks += 1 This 'blocking' function is queued to run in a seperate thread from the main CPU loop which allows for it to wait for the guest to complete commands @panda.queue_blocking def run_cmd(): First revert to the qcow's root snapshot (synchronously) panda.revert_sync(\"root\") Then type a command via the serial port and print its results print(panda.run_serial_cmd(\"uname -a\" When the command finishes, terminate the panda.run() call panda.end_analysis() Start the guest panda.run() print(\"Finished. Saw a total of {} basic blocks during execution\".format(blocks Usage Create an instance of Panda The Panda class takes many arguments, but the only crucial argument is a specificed qcow image. If you wish to get started quickly you may use the pandare.qcows.Qcows module to automatically download a pre-configured virtual machine for you to use. For example: panda = Panda(generic='i386') Register a callback @panda.cb_before_block_exec def my_before_block_fn(cpustate, translation_block): pc = panda.current_pc(cpustate) print(\"About to run the block at 0x{:x}\".format(pc The panda object contains decorators named cb_[CALLBACK_NAME] for each PANDA callback. A decorated function must take the same number of arguments and return the equivalent type as expected by the original C callback. The [list of callbacks]( pandare.Callbacks) is available below. The decorated functions are called at the appropriate times, similarly to how a PANDA plugin written in C behaves. Enable and disable callbacks Python callbacks can be enabled and disabled using their names. By default, a callback is named after the function that is decorated. For example, the callback describe in @panda.cb_before_block_exec def my_before_block_fn(cpustate, translation_block): . is named my_before_block_fn and can be disabled with panda.disable_callback('my_before_block_fn') and later enabled with panda.enable_callback('my_before_block_fn') . Callbacks can be given custom names and disabled at initialization by passing arguments to their decorators: @panda.cb_before_block_exec(name='my_callback', enabled=False) def my_before_block_fn(cpustate, translation_block): . panda.enable_callback('my_callback') If a callback is decorated with a procname argument, it will only be enabled when that process is running. To permanently disable such a callback, you can use panda.disable_callback('name', forever=True) . Note that if you wish to define a function multiple times (e.g., inside a loop), you'll need to give it multiple names or it will be overwritten. for x in range(10): @panda.cb_before_block_exec(name=f\"bbe_{x}\") def bbe_loop(cpu, tb): print(f\"Before block exec function {x}\") Replaying Recordings panda = Panda( .) Register functions to run on callbacks here panda.run_replay(\"/file/path/here\") Runs the replay Load and unload a C plugin A C plugin can be loaded from pypanda easily: panda.load_plugin(\"stringsearch\") C plugins can be passed named arguments using a dictionary: panda.load_plugin(\"stringsearch\", {\"name\": \"jpeg\"}) Or unnamed arguments using a list: panda.load_plugin(\"my_plugin\", [\"arg1\", \"arg2\"]) Asynchronous Activity When a callback is executing, the guest is suspended until the callback finishes. However, we often want to interact with guests during our analyses. In these situations, we run code asynchronously to send data into and wait for results from the guest. PyPANDA is designed to easily support such analyses with the @panda.queue_blocking decorator. Consider if you with to run the commands uname -a , then whoami in a guest. If your guest exposes a console over a serial port (as all the 'generic' qcows we use do), you could run these commands by simply typing them and waiting for a response. But if you were to do this in a callback, the guest would have no chance to respond to your commands and you'd end up in a deadlock where your callback code never terminates until the guest executes your command, and the guest will never execute commands until your callback terminates. Instead, you can queue up blocking functions to run asynchronously as follows: panda = . @panda.queue_blocking def first_cmd(): print(panda.run_serial_cmd(\"uname -a\" @panda.queue_blocking def second_cmd(): print(panda.run_serial_cmd(\"whoami\" panda.end_analysis() panda.run() Note that the panda.queue_blocking decorator both marks a function as being a blocking function (which allows it to use functions such as panda.run_serial_cmd ) and queues it up to run after the call to panda.run() Recordings See [take_recording.py](https: github.com/panda-re/panda/tree/master/panda/python/examples/take_recording.py) A replay can be taken with the function panda.record_cmd('cmd_to_run', recording_name='replay_name') which will revert the guest to a root snapshot, type a command, begin a recording, press enter, wait for the command to finish, and then end the replay. Once a replay is created on disk, it can be analyzed by using panda.run_replay('replay_name') . Alternatively, you can begin/end the recording through the monitor with panda.run_monitor_cmd('begin_record myname') and panda.run_monitor_cmd('end_record') and drive the guest using panda.run_serial_cmd in the middle. Typical Use Patterns Live system Example: [asid.py](https: github.com/panda-re/panda/tree/master/panda/python/examples/asid.py). 1. Initialize a panda object based off a generic machine or a qcow you have. 2. Register functions to run at various PANDA callbacks. 3. Register and queue up a blocking function to revert the guest to a snapshot, run commands with panda.run_serial_cmd() , and stop the execution with panda.end_analysis() 5. Start the execution with panda.run() Record/Replay Example: [tests/record_then_replay.py](https: github.com/panda-re/panda/tree/master/panda/python/tests/record_then_replay.py). 1. Initialize a panda object based off a generic machine or a qcow you have. 2. Register and queue up a blocking function to drive guest execution while recording or with panda.record_cmd then call panda.end_analysis() 3. Register functions to run at various PANDA callbacks. 5. Analyze the replay with panda.run_replay(filename) Additional Information Here be dragons You can't have multiple instances of panda running at the same time. Once you've created a panda object for a given architecture, you can never create another. Hoewver, you can modify the machine after it's created to run a new analysis as long as you don't change the machine type. PyPANDA is slower than traditional PANDA. Well-engineered plugins typically have a runtime overhead of ~10% compared to regular PANDA plugins (for up to 10M instructions). To improve performance try disabling callbacks when possible and only enabling them when they are needed. Extending PyPANDA PyPANDA currently supports interactions (e.g., ppp callbacks) with many PANDA plugins such as taint2 and osi . If you wish to extend PyPANDA to support an new plugin, its header file must be cleaned up such that it can be parsed by CFFI. See [create_panda_datatypes.py](https: github.com/panda-re/panda/tree/master/panda/python/utils/create_panda_datatypes.py) and the magic BEGIN_PYPANDA_NEEDS_THIS strings it searches for. Learn more The [PyPANDA paper](https: moyix.net/~moyix/papers/pypanda.pdf) was published at the NDSS Binary Analysis Research Workshop in 2021 and includes details on the project's design goals as well as an evaluation of it's usability and performance."
},
{
"ref":"pandare.Panda",
"url":0,
"doc":"This is the object used to interact with PANDA. Initializing it creates a virtual machine to interact with. Construct a new Panda object. Note that multiple Panda objects cannot coexist in the same Python instance. Args: arch: architecture string (e.g. \"i386\", \"x86_64\", \"arm\", \"mips\", \"mipsel\") generic: specify a generic qcow to use from pandare.qcows.SUPPORTED_IMAGES and set all subsequent arguments. Will automatically download qcow if necessary. mem: size of memory for machine (e.g. \"128M\", \"1G\") expect_prompt: Regular expression describing the prompt exposed by the guest on a serial console. Used so we know when a running command has finished with its output. serial_kwargs: dict of additional arguments to pass to pandare.Expect (see signature of its constructor). Note that expect_prompt is already passed to Expect as \"expectation\". If not explicitly given, \"unansi\" is set to True (simulates a subset of ANSI codes and attempts to remove command strings repeated by the shell from the shell output). os_version: analagous to PANDA's -os argument (e.g, linux-32-debian:3.2.0-4-686-pae\") os: type of OS (e.g. \"linux\") qcow: path to a qcow file to load catch_exceptions: Should we catch exceptions raised by python code and end_analysis() and then print a backtrace (Default: True) raw_monitor: When set, don't specify a -monitor. arg Allows for use of -nographic in args with ctrl-A+C for interactive qemu prompt. Experts only! extra_args: extra arguments to pass to PANDA as either a string or an array. (e.g. \"-nographic\" or [\"-nographic\", \"-net\", \"none\"]) libpanda_path: path to panda shared object to load biospath: directory that contains \"pc-bios\" files plugin_path: directory that contains panda plugins Returns: Panda: the created panda object"
},
{
"ref":"pandare.Panda.get_plugin_path",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.get_build_dir",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.queue_main_loop_wait_fn",
"url":0,
"doc":"Queue a function to run at the next main loop fn is a function we want to run, args are arguments to apss to it",
"func":1
},
{
"ref":"pandare.Panda.exit_cpu_loop",
"url":0,
"doc":"Stop cpu execution at nearest juncture.",
"func":1
},
{
"ref":"pandare.Panda.revert_async",
"url":0,
"doc":"Request a snapshot revert, eventually. This is fairly dangerous because you don't know when it finishes. You should be using revert_sync from a blocking function instead",
"func":1
},
{
"ref":"pandare.Panda.reset",
"url":0,
"doc":"In the next main loop, reset to boot",
"func":1
},
{
"ref":"pandare.Panda.cont",
"url":0,
"doc":"Continue execution (run after vm_stop)",
"func":1
},
{
"ref":"pandare.Panda.vm_stop",
"url":0,
"doc":"Stop execution, default code means RUN_STATE_PAUSED",
"func":1
},
{
"ref":"pandare.Panda.snap",
"url":0,
"doc":"Create snapshot with specified name Args: snapshot_name (str): name of the snapshot Returns: None",
"func":1
},
{
"ref":"pandare.Panda.delvm",
"url":0,
"doc":"Delete snapshot with specified name Args: snapshot_name (str): name of the snapshot Returns: None",
"func":1
},
{
"ref":"pandare.Panda.enable_tb_chaining",
"url":0,
"doc":"This function enables translation block chaining in QEMU",
"func":1
},
{
"ref":"pandare.Panda.disable_tb_chaining",
"url":0,
"doc":"This function disables translation block chaining in QEMU",
"func":1
},
{
"ref":"pandare.Panda.run",
"url":0,
"doc":"This function starts our running PANDA instance from Python. At termination this function returns and the script continues to run after it. This function starts execution of the guest. It blocks until guest finishes. It also initializes panda object, clears main_loop_wait fns, and sets up internal callbacks. Args: None Returns: None: When emulation has finished due to guest termination, replay conclusion or a call to Panda.end_analysis ",
"func":1
},
{
"ref":"pandare.Panda.end_analysis",
"url":0,
"doc":"Stop running machine. Call from any thread to unload all plugins and stop all queued functions. If called from async thread or a callback, it will also unblock panda.run() Note here we use the async class's internal thread to process these without needing to wait for tasks in the main async thread",
"func":1
},
{
"ref":"pandare.Panda.record",
"url":0,
"doc":"Begins active recording with name provided. Args: recording_name (string): name of recording to save. snapshot_name (string, optional): Before recording starts restore to this snapshot name. Defaults to None. Raises: Exception: raises exception if there was an error starting recording.",
"func":1
},
{
"ref":"pandare.Panda.end_record",
"url":0,
"doc":"Stop active recording. Raises: Exception: raises exception if there was an error stopping recording.",
"func":1
},
{
"ref":"pandare.Panda.recording_exists",
"url":0,
"doc":"Checks if a recording file exists on disk. Args: name (str): name of the recording to check for (e.g., foo which uses foo-rr-snp and foo-rr-nondet.log ) Returns: boolean: true if file exists, false otherwise",
"func":1
},
{
"ref":"pandare.Panda.run_replay",
"url":0,
"doc":"Load a replay and run it. Starts PANDA execution and returns after end of VM execution. Args: replaypfx (str): Replay name/path (e.g., \"foo\" or \"./dir/foo\") Returns: None",
"func":1
},
{
"ref":"pandare.Panda.end_replay",
"url":0,
"doc":"Terminates a currently running replay Returns: None Raises: Exception: raises exception if no replay is active or termination failed.",
"func":1
},
{
"ref":"pandare.Panda.require",
"url":0,
"doc":"Load a C plugin with no arguments. Deprecated. Use load_plugin",
"func":1
},
{
"ref":"pandare.Panda.load_plugin",
"url":0,
"doc":"Load a C plugin, optionally with arguments Args: name (str): Name of plugin args (dict): Arguments matching key to value. e.g. {\"key\": \"value\"} sets option key to value . Returns: None.",
"func":1
},
{
"ref":"pandare.Panda.unload_plugin",
"url":0,
"doc":"Unload plugin with given name. Args: name (str): Name of plug Returns: None",
"func":1
},
{
"ref":"pandare.Panda.unload_plugins",
"url":0,
"doc":"Disable all python plugins and request to unload all c plugins at the next main_loop_wait. XXX: If called during shutdown/exit, c plugins won't be unloaded because the next main_loop_wait will never happen. Instead, call panda.panda_finish directly (which is done at the end of panda.run( ",
"func":1
},
{
"ref":"pandare.Panda.memsavep",
"url":0,
"doc":"Calls QEMU memsavep on your specified python file.",
"func":1
},
{
"ref":"pandare.Panda.physical_memory_read",
"url":0,
"doc":"Read guest physical memory. In the specified format. Note that the ptrlist format returns a list of integers, each of the specified architecture's pointer size. Args: addr (int): Address length (int): length of array you would like returned fmt (str): format for returned array. Options: 'bytearray', 'int', 'str', 'ptrlist' Returns: Union[bytearray, int, str, list[int : memory data Raises: ValueError if memory access fails or fmt is unsupported",
"func":1
},
{
"ref":"pandare.Panda.virtual_memory_read",
"url":0,
"doc":"Read guest virtual memory. Args: cpu (CPUState): CPUState structure addr (int): Address length (int): length of data you would like returned fmt: format for returned array. See physical_memory_read . Returns: Union[bytearray, int, str, list[int : memory data Raises: ValueError if memory access fails or fmt is unsupported",
"func":1
},
{
"ref":"pandare.Panda.physical_memory_write",
"url":0,
"doc":"Write guest physical memory. Args: addr (int): Address buf (bytestring): byte string to write into memory Returns: None Raises: ValueError if the call to panda.physical_memory_write fails (e.g., if you pass a pointer to an invalid memory region)",
"func":1
},
{
"ref":"pandare.Panda.virtual_memory_write",
"url":0,
"doc":"Write guest virtual memory. Args: cpu (CPUState): CPUState structure address (int): Address buf (bytestr): byte string to write into memory Returns: None Raises: ValueError if the call to panda.virtual_memory_write fails (e.g., if you pass a pointer to an unmapped page)",
"func":1
},
{
"ref":"pandare.Panda.callstack_callers",
"url":0,
"doc":"Helper function for callstack_instr plugin Handle conversion and return get_callers from callstack_instr.",
"func":1
},
{
"ref":"pandare.Panda.queue_async",
"url":0,
"doc":"Explicitly queue work in the asynchronous work queue. Args: f: A python function with no arguments to be called at a later time. The function should be decorated with @pandare.blocking . You generally want to use panda.queue_blocking over this function. Returns: None",
"func":1
},
{
"ref":"pandare.Panda.map_memory",
"url":0,
"doc":"Make a new memory region. Args: name (str): This is an internal reference name for this region. Must be unique. size (int): number of bytes the region should be. address (int): start address of region Returns: None",
"func":1
},
{
"ref":"pandare.Panda.read_str",
"url":0,
"doc":"Helper to read a null-terminated string from guest memory given a pointer and CPU state May return an exception if the call to panda.virtual_memory_read fails (e.g., if you pass a pointer to an unmapped page) Args: cpu (CPUState): CPUState structure ptr (int): Pointer to start of string max_length (int): Optional length to stop reading at Returns: string: Data read from memory",
"func":1
},
{
"ref":"pandare.Panda.to_unsigned_guest",
"url":0,
"doc":"Convert a singed python int to an unsigned int32/unsigned int64 depending on guest bit-size Args: x (int): Python integer Returns: int: Python integer representing x as an unsigned value in the guest's pointer-size.",
"func":1
},
{
"ref":"pandare.Panda.from_unsigned_guest",
"url":0,
"doc":"Convert an unsigned int32/unsigned int64 from the guest (depending on guest bit-size) to a (signed) python int Args: x (int): Python integer representing an unsigned value in the guest's pointer-size Returns: int: Python integer representing x as a signed value",
"func":1
},
{
"ref":"pandare.Panda.queue_blocking",
"url":0,
"doc":"Decorator to mark a function as blocking , and (by default) queue it to run asynchronously. This should be used to mark functions that will drive guest execution. Functions will be run in the order they are defined. For more precise control, use panda.queue_async . @panda.queue_blocking def do_something(): panda.revert_sync('root') print(panda.run_serial_cmd('whoami' panda.end_analysis() is equivalent to @blocking def run_whoami(): panda.revert_sync('root') print(panda.run_serial_cmd('whoami' panda.end_analysis() panda.queue_async(run_whoami) Args: func (function): Function to queue queue (bool): Should function automatically be queued Returns: None",
"func":1
},
{
"ref":"pandare.Panda.pyplugins",
"url":0,
"doc":"A reference to an auto-instantiated pandare.pyplugin.PyPluginManager class."
},
{
"ref":"pandare.Panda.set_pandalog",
"url":0,
"doc":"Enable recording to a pandalog (plog) named name Args: name (str): filename to output data to Returns: None",
"func":1
},
{
"ref":"pandare.Panda.enable_memcb",
"url":0,
"doc":"Enable memory callbacks. Must be called for memory callbacks to work. pypanda enables this automatically with some callbacks.",
"func":1
},
{
"ref":"pandare.Panda.disable_memcb",
"url":0,
"doc":"Disable memory callbacks. Must be enabled for memory callbacks to work. pypanda enables this automatically with some callbacks.",
"func":1
},
{
"ref":"pandare.Panda.virt_to_phys",
"url":0,
"doc":"Convert virtual address to physical address. Args: cpu (CPUState): CPUState struct addr (int): virtual address to convert Return: int: physical address",
"func":1
},
{
"ref":"pandare.Panda.enable_plugin",
"url":0,
"doc":"Enable plugin. Args: handle (int): pointer to handle returned by plugin Return: None",
"func":1
},
{
"ref":"pandare.Panda.disable_plugin",
"url":0,
"doc":"Disable plugin. Args: handle (int): pointer to handle returned by plugin Return: None",
"func":1
},
{
"ref":"pandare.Panda.enable_llvm",
"url":0,
"doc":"Enables the use of the LLVM JIT in replacement of the TCG (QEMU intermediate language and compiler) backend.",
"func":1
},
{
"ref":"pandare.Panda.disable_llvm",
"url":0,
"doc":"Disables the use of the LLVM JIT in replacement of the TCG (QEMU intermediate language and compiler) backend.",
"func":1
},
{
"ref":"pandare.Panda.enable_llvm_helpers",
"url":0,
"doc":"Enables the use of Helpers for the LLVM JIT in replacement of the TCG (QEMU intermediate language and compiler) backend.",
"func":1
},
{
"ref":"pandare.Panda.disable_llvm_helpers",
"url":0,
"doc":"Disables the use of Helpers for the LLVM JIT in replacement of the TCG (QEMU intermediate language and compiler) backend.",
"func":1
},
{
"ref":"pandare.Panda.flush_tb",
"url":0,
"doc":"This function requests that the translation block cache be flushed as soon as possible. If running with translation block chaining turned off (e.g. when in LLVM mode or replay mode), this will happen when the current translation block is done executing. Flushing the translation block cache is additionally necessary if the plugin makes changes to the way code is translated. For example, by using panda_enable_precise_pc.",
"func":1
},
{
"ref":"pandare.Panda.break_exec",
"url":0,
"doc":"If called from a start block exec callback, will cause the emulation to bail before executing the rest of the current block.",
"func":1
},
{
"ref":"pandare.Panda.enable_precise_pc",
"url":0,
"doc":"By default, QEMU does not update the program counter after every instruction. This function enables precise tracking of the program counter. After enabling precise PC tracking, the program counter will be available in env->panda_guest_pc and can be assumed to accurately reflect the guest state.",
"func":1
},
{
"ref":"pandare.Panda.disable_precise_pc",
"url":0,
"doc":"By default, QEMU does not update the program counter after every instruction. This function disables precise tracking of the program counter.",
"func":1
},
{
"ref":"pandare.Panda.in_kernel",
"url":0,
"doc":"Returns true if the processor is in the privilege level corresponding to kernel mode for any of the PANDA supported architectures. Legacy alias for in_kernel_mode().",
"func":1
},
{
"ref":"pandare.Panda.in_kernel_mode",
"url":0,
"doc":"Check if the processor is running in priviliged mode. Args: cpu (CPUState): CPUState structure Returns: Bool: If the processor is in the privilege level corresponding to kernel mode for the given architecture",
"func":1
},
{
"ref":"pandare.Panda.in_kernel_code_linux",
"url":0,
"doc":"Check if the processor is running in linux kernelspace. Args: cpu (CPUState): CPUState structure Returns: Bool: If the processor is running in Linux kernel space code.",
"func":1
},
{
"ref":"pandare.Panda.g_malloc0",
"url":0,
"doc":"Helper function to call glib malloc Args: size (int): size to call with malloc Returns: buffer of the requested size from g_malloc",
"func":1
},
{
"ref":"pandare.Panda.current_sp",
"url":0,
"doc":"Get current stack pointer Args: cpu (CPUState): CPUState structure Return: int: Value of stack pointer",
"func":1
},
{
"ref":"pandare.Panda.current_pc",
"url":0,
"doc":"Get current program counter Args: cpu (CPUState): CPUState structure Return: integer value of current program counter Deprecated Use panda.arch.get_pc(cpu) instead",
"func":1
},
{
"ref":"pandare.Panda.current_asid",
"url":0,
"doc":"Get current Application Specific ID Args: cpu (CPUState): CPUState structure Returns: integer: value of current ASID",
"func":1
},
{
"ref":"pandare.Panda.get_id",
"url":0,
"doc":"Get current hw_proc_id ID Args: cpu (CPUState): CPUState structure Returns: integer: value of current hw_proc_id",
"func":1
},
{
"ref":"pandare.Panda.disas2",
"url":0,
"doc":"Call panda_disas to diasassemble an amount of code at a pointer. FIXME: seem to not match up to PANDA definition",
"func":1
},
{
"ref":"pandare.Panda.cleanup",
"url":0,
"doc":"Unload all plugins and close pandalog. Returns: None",
"func":1
},
{
"ref":"pandare.Panda.was_aborted",
"url":0,
"doc":"Returns true if panda was aborted.",
"func":1
},
{
"ref":"pandare.Panda.get_cpu",
"url":0,
"doc":"This function returns first_cpu CPUState object from QEMU. XXX: You rarely want this Returns: CPUState: cpu",
"func":1
},
{
"ref":"pandare.Panda.garray_len",
"url":0,
"doc":"Convenience function to get array length of glibc array. Args: g (garray): Pointer to a glibc array Returns: int: length of the array",
"func":1
},
{
"ref":"pandare.Panda.panda_finish",
"url":0,
"doc":"Final stage call to underlying panda_finish with initialization.",
"func":1
},
{
"ref":"pandare.Panda.rr_get_guest_instr_count",
"url":0,
"doc":"Returns record/replay guest instruction count. Returns: int: Current instruction count",
"func":1
},
{
"ref":"pandare.Panda.drive_get",
"url":0,
"doc":"Gets DriveInfo struct from user specified information. Args: blocktype: BlockInterfaceType structure bus: integer bus unit: integer unit Returns: DriveInfo struct",
"func":1
},
{
"ref":"pandare.Panda.sysbus_create_varargs",
"url":0,
"doc":"Returns DeviceState struct from user specified information Calls sysbus_create_varargs QEMU function. Args: name (str): addr (int): hwaddr Returns: DeviceState struct",
"func":1
},
{
"ref":"pandare.Panda.cpu_class_by_name",
"url":0,
"doc":"Gets cpu class from name. Calls cpu_class_by_name QEMU function. Args: name: typename from python string cpu_model: string specified cpu model Returns: ObjectClass struct",
"func":1
},
{
"ref":"pandare.Panda.object_class_by_name",
"url":0,
"doc":"Returns class as ObjectClass from name specified. Calls object_class_by_name QEMU function. Args name (str): string defined by user Returns: struct as specified by name",
"func":1
},
{
"ref":"pandare.Panda.object_property_set_bool",
"url":0,
"doc":"Writes a bool value to a property. Calls object_property_set_bool QEMU function. Args value: the value to be written to the property name: the name of the property errp: returns an error if this function fails Returns: None",
"func":1
},
{
"ref":"pandare.Panda.object_class_get_name",
"url":0,
"doc":"Gets String QOM typename from object class. Calls object_class_get_name QEMU function. Args objclass: class to obtain the QOM typename for. Returns: String QOM typename for klass.",
"func":1
},
{
"ref":"pandare.Panda.object_new",
"url":0,
"doc":"Creates a new QEMU object from typename. This function will initialize a new object using heap allocated memory. The returned object has a reference count of 1, and will be freed when the last reference is dropped. Calls object_new QEMU function. Args: name (str): The name of the type of the object to instantiate. Returns: The newly allocated and instantiated object.",
"func":1
},
{
"ref":"pandare.Panda.object_property_get_bool",
"url":0,
"doc":"Pull boolean from object. Calls object_property_get_bool QEMU function. Args: obj: the object name: the name of the property Returns: the value of the property, converted to a boolean, or NULL if an error occurs (including when the property value is not a bool).",
"func":1
},
{
"ref":"pandare.Panda.object_property_set_int",
"url":0,
"doc":"Set integer in QEMU object. Writes an integer value to a property. Calls object_property_set_int QEMU function. Args: value: the value to be written to the property name: the name of the property Returns: None",
"func":1
},
{
"ref":"pandare.Panda.object_property_get_int",
"url":0,
"doc":"Gets integer in QEMU object. Reads an integer value from this property. Calls object_property_get_int QEMU function. Paramaters: obj: the object name: the name of the property Returns: the value of the property, converted to an integer, or negative if an error occurs (including when the property value is not an integer).",
"func":1
},
{
"ref":"pandare.Panda.object_property_set_link",
"url":0,
"doc":"Writes an object's canonical path to a property. Calls object_property_set_link QEMU function. Args: value: the value to be written to the property name: the name of the property errp: returns an error if this function fails Returns: None",
"func":1
},
{
"ref":"pandare.Panda.object_property_get_link",
"url":0,
"doc":"Reads an object's canonical path to a property. Calls object_property_get_link QEMU function. Args: obj: the object name: the name of the property errp: returns an error if this function fails Returns: the value of the property, resolved from a path to an Object, or NULL if an error occurs (including when the property value is not a string or not a valid object path).",
"func":1
},
{
"ref":"pandare.Panda.object_property_find",
"url":0,
"doc":"Look up a property for an object and return its ObjectProperty if found. Calls object_property_find QEMU function. Args: obj: the object name: the name of the property errp: returns an error if this function fails Returns: struct ObjectProperty pointer",
"func":1
},
{
"ref":"pandare.Panda.memory_region_allocate_system_memory",
"url":0,
"doc":"Allocates Memory region by user specificiation. Calls memory_region_allocation_system_memory QEMU function. Args: mr: MemoryRegion struct obj: Object struct name (str): Region name ram_size (int): RAM size Returns: None",
"func":1
},
{
"ref":"pandare.Panda.memory_region_add_subregion",
"url":0,
"doc":"Calls memory_region_add_subregion from QEMU. memory_region_add_subregion: Add a subregion to a container. Adds a subregion at @offset. The subregion may not overlap with other subregions (except for those explicitly marked as overlapping). A region may only be added once as a subregion (unless removed with memory_region_del_subregion( ; use memory_region_init_alias() if you want a region to be a subregion in multiple locations. Args: mr: the region to contain the new subregion; must be a container initialized with memory_region_init(). offset: the offset relative to @mr where @subregion is added. subregion: the subregion to be added. Returns: None",
"func":1
},
{
"ref":"pandare.Panda.memory_region_init_ram_from_file",
"url":0,
"doc":"Calls memory_region_init_ram_from_file from QEMU. memory_region_init_ram_from_file: Initialize RAM memory region with a mmap-ed backend. Args: mr: the MemoryRegion to be initialized. owner: the object that tracks the region's reference count name: the name of the region. size: size of the region. share: %true if memory must be mmaped with the MAP_SHARED flag path: the path in which to allocate the RAM. errp: pointer to Error , to store an error if it happens. Returns: None",
"func":1
},
{
"ref":"pandare.Panda.create_internal_gic",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.create_one_flash",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.create_external_gic",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.create_virtio_devices",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.arm_load_kernel",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.error_report",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.get_system_memory",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.lookup_gic",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.set_os_name",
"url":0,
"doc":"Set OS target. Equivalent to \"-os\" flag on the command line. Matches the form of: \"windows[-_]32[-_]xpsp[23]\", \"windows[-_]32[-_]2000\", \"windows[-_]32[-_]7sp[01]\", \"windows[-_]64[-_]7sp[01]\", \"linux[-_]32[-_].+\", \"linux[-_]64[-_].+\", \"freebsd[-_]32[-_].+\", \"freebsd[-_]64[-_].+\", Args: os_name (str): Name that matches the format for the os flag. Returns: None",
"func":1
},
{
"ref":"pandare.Panda.get_os_family",
"url":0,
"doc":"Get the current OS family name. Valid values are the entries in OSFamilyEnum Returns: string: one of OS_UNKNOWN, OS_WINDOWS, OS_LINUX, OS_FREEBSD",
"func":1
},
{
"ref":"pandare.Panda.get_file_name",
"url":0,
"doc":"Get the name of a file from a file descriptor. Returns: string: file name None: on failure",
"func":1
},
{
"ref":"pandare.Panda.get_current_process",
"url":0,
"doc":"Get the current process as an OsiProc struct. Returns: string: process name None: on failure",
"func":1
},
{
"ref":"pandare.Panda.get_mappings",
"url":0,
"doc":"Get all active memory mappings in the system. Requires: OSI Args: cpu: CPUState struct Returns: pandare.utils.GArrayIterator: iterator of OsiModule structures",
"func":1
},
{
"ref":"pandare.Panda.get_mapping_by_addr",
"url":0,
"doc":"Return the OSI mapping that matches the address specified. Requires: OSI Args: cpu: CPUState struct addr: int Returns: OsiModule: dataclass representation of OsiModule structure with strings converted to python strings Note that the strings will be None if their pointer was null None: on failure",
"func":1
},
{
"ref":"pandare.Panda.get_processes",
"url":0,
"doc":"Get all running processes in the system. Includes kernel modules on Linux. Requires: OSI Args: cpu: CPUState struct Returns: pandare.utils.GArrayIterator: iterator of OsiProc structures",
"func":1
},
{
"ref":"pandare.Panda.get_processes_dict",
"url":0,
"doc":"Get all running processes for the system at this moment in time as a dictionary. The dictionary maps proceses by their PID. Each mapping returns a dictionary containing the process name, its pid, and its parent pid (ppid). Requires: OSI Args: cpu: CPUState struct Returns: Dict: processes as described above",
"func":1
},
{
"ref":"pandare.Panda.get_process_name",
"url":0,
"doc":"Get the name of the current process. May return None if OSI cannot identify the current process",
"func":1
},
{
"ref":"pandare.Panda.pyperiph_read_cb",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.pyperiph_write_cb",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.register_pyperipheral",
"url":0,
"doc":"Registers a python peripheral, and the necessary attributes to the panda-object, if not present yet.",
"func":1
},
{
"ref":"pandare.Panda.unregister_pyperipheral",
"url":0,
"doc":"deregisters a python peripheral. The pyperiph parameter can be either an object, or an address Returns true if the pyperipheral was successfully removed, else false.",
"func":1
},
{
"ref":"pandare.Panda.taint_enabled",
"url":0,
"doc":"Checks to see if taint2 plugin has been loaded",
"func":1
},
{
"ref":"pandare.Panda.taint_enable",
"url":0,
"doc":"Enable taint.",
"func":1
},
{
"ref":"pandare.Panda.taint_label_reg",
"url":0,
"doc":"Labels taint register reg_num with label.",
"func":1
},
{
"ref":"pandare.Panda.taint_label_ram",
"url":0,
"doc":"Labels ram at address with label.",
"func":1
},
{
"ref":"pandare.Panda.taint_check_reg",
"url":0,
"doc":"Checks if register reg_num is tainted. Returns boolean.",
"func":1
},
{
"ref":"pandare.Panda.taint_check_ram",
"url":0,
"doc":"returns boolean representing if physical address is tainted.",
"func":1
},
{
"ref":"pandare.Panda.taint_get_reg",
"url":0,
"doc":"Returns array of results, one for each byte in this register None if no taint. QueryResult struct otherwise",
"func":1
},
{
"ref":"pandare.Panda.taint_get_ram",
"url":0,
"doc":"returns array of results, one for each byte in this register None if no taint. QueryResult struct otherwise",
"func":1
},
{
"ref":"pandare.Panda.taint_check_laddr",
"url":0,
"doc":"returns boolean result checking if this laddr is tainted",
"func":1
},
{
"ref":"pandare.Panda.taint_get_laddr",
"url":0,
"doc":"returns array of results, one for each byte in this laddr None if no taint. QueryResult struct otherwise",
"func":1
},
{
"ref":"pandare.Panda.address_to_ram_offset",
"url":0,
"doc":"Convert physical address to ram offset Args: hwaddr (int): physical address is_write (bool): boolean representing if this is a write Returns: ram offset (int) Raises: ValueError if memory access fails or fmt is unsupported",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_enable",
"url":0,
"doc":"Inform python that taint is enabled.",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_label_ram",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_label_reg",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.string_to_solver",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.string_to_condition",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.string_to_expr",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_query_ram",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_query_reg",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_path_constraints",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.taint_sym_branch_meta",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.make_panda_file_handler",
"url":0,
"doc":"Constructs a file and file handler that volatility can't ignore to back by PANDA physical memory",
"func":1
},
{
"ref":"pandare.Panda.get_volatility_symbols",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.run_volatility",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.stop_run",
"url":0,
"doc":"From a blocking thread, request vl.c loop to break. Returns control flow in main thread. In other words, once this is called, panda.run() will finish and your main thread will continue. If you also want to unload plugins, use end_analysis instead XXX: This doesn't work in replay mode",
"func":1
},
{
"ref":"pandare.Panda.run_serial_cmd",
"url":0,
"doc":"Run a command inside the guest through a terminal exposed over a serial port. Can only be used if your guest is configured in this way Guest output will be analyzed until we see the expect_prompt regex printed (i.e., the PS1 prompt) Args: cmd: command to run. timeout: maximum time to wait for the command to finish no_timeout: if set, don't ever timeout Returns: String: all the output (stdout + stderr) printed after typing your command and pressing enter until the next prompt was printed.",
"func":1
},
{
"ref":"pandare.Panda.serial_read_until",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.run_serial_cmd_async",
"url":0,
"doc":"Type a command and press enter in the guest. Return immediately. No results available Only use this if you know what you're doing!",
"func":1
},
{
"ref":"pandare.Panda.type_serial_cmd",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.finish_serial_cmd",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.run_monitor_cmd",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.revert_sync",
"url":0,
"doc":"Args: snapshot_name: name of snapshot in the current qcow to load Returns: String: error message. Empty on success.",
"func":1
},
{
"ref":"pandare.Panda.delvm_sync",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.copy_to_guest",
"url":0,
"doc":"Copy a directory from the host into the guest by 1) Creating an .iso image of the directory on the host 2) Run a bash command to mount it at the exact same path + .ro and then copy the files to the provided path 3) If the directory contains setup.sh, run it Args: copy_directory: Local directory to copy into guest iso_name: Name of iso file that will be generated. Defaults to [copy_directory].iso absolute_paths: is copy_directory an absolute or relative path seutp_script: name of a script which, if present inside copy_directory, will be automatically run after the copy timeout: maximum time each copy command will be allowed to run for, will use the run_serial_cmd default value unless another is provided Returns: None",
"func":1
},
{
"ref":"pandare.Panda.record_cmd",
"url":0,
"doc":"Take a recording as follows: 0) Revert to the specified snapshot name if one is set. By default 'root'. Set to None if you have already set up the guest and are ready to record with no revert 1) Create an ISO of files that need to be copied into the guest if copy_directory is specified. Copy them in 2) Run the setup_command in the guest, if provided 3) Type the command you wish to record but do not press enter to begin execution. This avoids the recording capturing the command being typed 4) Begin the recording (name controlled by recording_name) 5) Press enter in the guest to begin the command. Wait until it finishes. 6) End the recording",
"func":1
},
{
"ref":"pandare.Panda.interact",
"url":0,
"doc":"Expose console interactively until user types pandaquit Must be run in blocking thread. TODO: This should probably repace self.serial_console with something that directly renders output to the user. Then we don't have to handle buffering and other problems. But we will need to re-enable the serial_console interface after this returns",
"func":1
},
{
"ref":"pandare.Panda.do_panda_finish",
"url":0,
"doc":"Call panda_finish. Note this isn't really blocking - the guest should have exited by now, but queue this after (blocking) shutdown commands in our internal async queue so it must also be labeled as blocking.",
"func":1
},
{
"ref":"pandare.Panda.register_cb_decorators",
"url":0,
"doc":"Setup callbacks and generate self.cb_XYZ functions for cb decorators XXX Don't add any other methods with names starting with 'cb_' Callbacks can be called as @panda.cb_XYZ in which case they'll take default arguments and be named the same as the decorated function Or they can be called as @panda.cb_XYZ(name='A', procname='B', enabled=True). Defaults: name is function name, procname=None, enabled=True unless procname set",
"func":1
},
{
"ref":"pandare.Panda.register_callback",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.is_callback_enabled",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.enable_internal_callbacks",
"url":0,
"doc":"Enable all our internal callbacks that start with __ such as __main_loop_wait and __asid_changed. Important in case user has done a panda.end_analysis() and then (re)called run",
"func":1
},
{
"ref":"pandare.Panda.enable_all_callbacks",
"url":0,
"doc":"Enable all python callbacks that have been disabled",
"func":1
},
{
"ref":"pandare.Panda.enable_callback",
"url":0,
"doc":"Enable a panda plugin using its handle and cb.number as a unique ID",
"func":1
},
{
"ref":"pandare.Panda.disable_callback",
"url":0,
"doc":"Disable a panda plugin using its handle and cb.number as a unique ID If forever is specified, we'll never reenable the call- useful when you want to really turn off something with a procname filter.",
"func":1
},
{
"ref":"pandare.Panda.delete_callback",
"url":0,
"doc":"Completely delete a registered panda callback by name",
"func":1
},
{
"ref":"pandare.Panda.delete_callbacks",
"url":0,
"doc":"",
"func":1
},
{
"ref":"pandare.Panda.ppp",
"url":0,
"doc":"Decorator for plugin-to-plugin interface. Note this isn't in decorators.py becuase it uses the panda object. Example usage to register my_run with syscalls2 as a 'on_sys_open_return' @ppp(\"syscalls2\", \"on_sys_open_return\") def my_fun(cpu, pc, filename, flags, mode): .",
"func":1
},
{
"ref":"pandare.Panda.disable_ppp",
"url":0,
"doc":"Disable a ppp-style callback by name. Unlike regular panda callbacks which can be enabled/disabled/deleted, PPP callbacks are only enabled/deleted (which we call disabled) Example usage to register my_run with syscalls2 as a 'on_sys_open_return' and then disable: @ppp(\"syscalls2\", \"on_sys_open_return\") def my_fun(cpu, pc, filename, flags, mode): . panda.disable_ppp(\"my_fun\") OR @ppp(\"syscalls2\", \"on_sys_open_return\", name=\"custom\") def my_fun(cpu, pc, filename, flags, mode): . panda.disable_ppp(\"custom\")",
"func":1
},
{
"ref":"pandare.Panda.set_breakpoint",
"url":0,
"doc":"Set a GDB breakpoint such that when the guest hits PC, execution is paused and an attached GDB instance can introspect on guest memory. Requires starting panda with -s, at least for now",
"func":1
},
{
"ref":"pandare.Panda.clear_breakpoint",
"url":0,
"doc":"Remove a breakpoint",
"func":1
},
{
"ref":"pandare.Panda.hook",
"url":0,
"doc":"Decorate a function to setup a hook: when a guest goes to execute a basic block beginning with addr, the function will be called with args (CPUState, TranslationBlock)",
"func":1
},
{
"ref":"pandare.Panda.hook_symbol_resolution",
"url":0,
"doc":"Decorate a function to setup a hook: when a guest process resolves a symbol the function will be called with args (CPUState, struct hook_symbol_resolve, struct symbol, OsiModule) Args: libraryname (string): Name of library containing symbol to be hooked. May be None to match any. symbol (string, int): Name of symbol or offset into library to hook name (string): name of hook, defaults to function name Returns: None: Decorated function is called when guest resolves the specified symbol in the specified library.",
"func":1
},
{
"ref":"pandare.Panda.hook_symbol",
"url":0,
"doc":"Decorate a function to setup a hook: when a guest goes to execute a basic block beginning with addr, the function will be called with args (CPUState, TranslationBlock, struct hook) Args: libraryname (string): Name of library containing symbol to be hooked. May be None to match any. symbol (string, int): Name of symbol or offset into library to hook kernel (bool): if hook should be applied exclusively in kernel mode name (string): name of hook, defaults to function name cb_type (string): callback-type, defaults to start_block_exec Returns: None: Decorated function is called when (before/after is determined by cb_type) guest goes to call the specified symbol in the specified library.",
"func":1
},
{
"ref":"pandare.Panda.get_best_matching_symbol",
"url":0,
"doc":"Use the dynamic symbols plugin to get the best matching symbol for a given program counter. Args: cpu (CPUState): CPUState structure pc (int): program counter, defaults to current asid (int): ASID, defaults to current",
"func":1
},
{
"ref":"pandare.Panda.enable_hook2",
"url":0,
"doc":"Set a hook2-plugin hook's status to active. Deprecated Use the hooks plugin instead.",
"func":1
},
{
"ref":"pandare.Panda.disable_hook2",
"url":0,
"doc":"Set a hook2-plugin hook's status to inactive. Deprecated Use the hooks plugin instead.",
"func":1
},
{
"ref":"pandare.Panda.hook2",
"url":0,
"doc":"Decorator to create a hook with the hooks2 plugin. Deprecated Use the hooks plugin instead.",
"func":1
},
{
"ref":"pandare.Panda.hook2_single_insn",
"url":0,
"doc":"Helper function to hook a single instruction with the hooks2 plugin. Deprecated Use the hooks plugin instead.",
"func":1
},
{
"ref":"pandare.Panda.hook_mem",
"url":0,
"doc":"Decorator to hook a memory range with the mem_hooks plugin todo Fully document mem-hook decorators",
"func":1
},