Patcherex
Patcherex
The main class of the library. This is how you are intended to interact with patches.
Source code in src/patcherex2/patcherex.py
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 |
|
__init__(binary_path, target_cls=None, target_opts=None, components_opts=None)
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
binary_path |
str
|
The path of the binary to patch. |
required |
target_cls |
type[Target] | None
|
Specified architecture class to use, otherwise it is automatically detected, defaults to None |
None
|
target_opts |
dict[str, str] | None
|
Options to specify components for the target, defaults to None |
None
|
components_opts |
dict[str, dict[str, str]] | None
|
Options for configuring each component for the target, defaults to None |
None
|
Source code in src/patcherex2/patcherex.py
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 |
|
apply_patches()
Applies all added patches to the binary. Call this when you have added all the patches you want.
Source code in src/patcherex2/patcherex.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
save_binary(filename=None)
Save the patched binary to a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Name of file to save to, defaults to None |
None
|
Source code in src/patcherex2/patcherex.py
103 104 105 106 107 108 109 110 111 112 |
|