data8 |
Raw binary representation of the active file. This object can be accessed or modified using standard
9 | Python []
operator (slices are supported). See below for a description of the methods
10 | supported by the data object.
exe13 |
Like the data
object, but instead represents the in memory view of an executable. If the
14 | file is not an executable, this object is the same as data
. This object can also be
15 | accessed or modified using the standard Python []
operator. See below for a description
16 | of the methods supported by the data object.
view19 |
Active view container object. Most functionality is exposed by the APIs listed below.
20 |data.read(address, size)25 |
Reads the given number of bytes at the given address, and returns the result as a string object.
26 |data.write(address, value)28 |
Writes the given value at the given address. The given value should be a string object containing the 29 | data to be written. The write is an in-place overwrite that is the same length as the string object given. 30 | The function returns the number of bytes written.
31 |data.insert(address, value)33 |
Inserts the given value at the given address. The existing contents at the given address will be moved 34 | to be directly after the inserted data. The given value should be a string object containing the data to 35 | be written. Some data types may not support insertion, and will return zero from this function. The 36 | function returns the number of bytes inserted.
37 |data.remove(address, size)39 |
Removes the given number of bytes at the given address. Some data types may not support removal of 40 | bytes, and will return zero from this function. The function returns the number of bytes removed.
41 |data.add_callback(object)43 |
Registers an object to receive callbacks when this data object is updated. The following methods will 44 | be invoked when the data is updated:
45 |callback.notify_data_write(data, address, value)
: Data was written with data.write
.callback.notify_data_insert(data, address, value)
: Data was inserted with data.insert
.callback.notify_data_remove(data, address, size)
: Data was removed with data.remove
.data.remove_callback(object)52 |
Unregisters an object that was receiving callbacks.
53 |data.save(filename)55 |
Saves the current file contents to disk with the given filename.
56 |data.start()58 |
Gets the starting address of the data. For raw data, this will be zero. For executables, this will be 59 | the base address of the module.
60 |data.is_modified()62 |
Determines if the data has been modified since the last time it was written to disk.
63 |data.find(regex, address)65 |
Find the first occurence of the given regular expression starting at the given address. Returns the address 66 | of the first match.
67 |data.architecture()69 |
Returns the target CPU architecture of the file. For raw data, this will default to 32-bit X86.
70 |data.entry()72 |
Gets the entry point of an executable. This method will not exist on raw data objects.
73 |current_view()78 |
Get the currently active view.
79 |change_view(view_type)81 |
Changes the current view to the type passed. The type should be the class object of the desired view
82 | type (for example, DisassemblerView.DisassemblerView
).
83 |
navigate(action_type, address)85 |
Navigates to the given address with the given action type string. The following action types are 86 | currently defined in the default install:
87 |disassembler
: Navigate to address in disassembly view.make_proc
: Make new function at address in disassembly view.hex
: Navigate to address in raw hex view.exe
: Navigate to address in executable hex view.create_file(data)95 |
Creates a new unnamed file with the given contents. The initial view type is chosen based on the content in the same 96 | manner as opening a file through the user interface.
97 |cursor()102 |
Gets the address of the current cursor position.
103 |set_cursor(pos)105 |
Sets the cursor position to the given address. After this function call there will be no active selection.
106 |selection_range()108 |
Gets the address range of the current selection as a tuple. The first element is the start of the selection and 109 | the second element is the end of the selection. If there is no selection, the function returns the current cursor 110 | position in both of the elements. The second element minus the first element is the length of the selection.
111 |set_selection_range(start, end)113 |
Sets the current selection to the range given.
114 |selection()116 |
Returns the currently selected bytes as a string object. If there is no selection, this function returns the 117 | empty string.
118 |replace_selection(value)120 |
Replaces the selected bytes with the given value. The value should be a string object containing the new data. 121 | If there is no active selection, this function will insert the bytes at the cursor position.
122 |write_at_cursor(value)124 |
Overwrites the bytes at the cursor position with the given value. The value should be a string object 125 | containing the new data. This is an in-place overwrite and will perform a write of the same length as the 126 | string object passed to this function.
127 |undo()131 |
Undo the last action(s) performed since the last undo buffer commit.
132 |redo()134 |
Redo the actions that were last undone.
135 |commit()137 |
Commit the actions pending in the undo buffer. Each undo action will go to the previous buffer commit. Undo 138 | buffer commits should be performed after each logical action (i.e. replace, rebase image, create symbol, etc.). 139 | If an undo buffer commit is not performed, undo will still function, but may cause more actions to be undone 140 | than desired for a single step.
141 |copy(value)146 |
Copies the given value to the clipboard. The value should be a string object containing the data to be copied.
147 |
paste()149 |
Paste the contents of the clipboard into the current view. This performs the same function as the paste menu item.
150 |clipboard()152 |
Get the current clipboard contents as a string object.
153 |