|
| 1 | +AndroidMemoryToolCLIDOCS |
| 2 | +----- |
| 3 | + |
| 4 | +The Android Memory Tool CLI is a command-line interface for the Android Memory Tool. It provides various commands to interact with memory in Android applications. |
| 5 | +> Supported Platforms -> Linux, Android and Windows (Required Administer Permission) |
| 6 | +
|
| 7 | +### Usage |
| 8 | +* For Linux: |
| 9 | +``` |
| 10 | +python3 -m androidMemoryTool <command> [options] |
| 11 | +``` |
| 12 | +* For Android: |
| 13 | +Execute the tool with root privileges using `sudo`: |
| 14 | +``` |
| 15 | +sudo python3 -m androidMemoryTool <command> [options] |
| 16 | +``` |
| 17 | +* For Windows (Required Administer Permission CMD): |
| 18 | +``` |
| 19 | +python -m androidMemoryTool <command> [options] |
| 20 | +``` |
| 21 | + |
| 22 | +* If you added the bin path of python libraries to environment variable then you can execute it directly |
| 23 | +```` |
| 24 | +amt <command> [options] |
| 25 | +```` |
| 26 | +**and use sudo for android** |
| 27 | + |
| 28 | +### Available Commands |
| 29 | +* `read_value`: Read a value from memory. |
| 30 | +* `read_write_value`: Read and write a value in memory. |
| 31 | +* `write_lib`: Write a value to a library. |
| 32 | +* `read_lib`: Read a value from a library. |
| 33 | +* `refiner_address`: Refine a list of addresses. |
| 34 | +* `get_module_base_address`: Get the base address of a module. |
| 35 | +* `raw_dump`: Dump a library as raw binary. |
| 36 | +* `find_hex_pattern`: Find a hexadecimal pattern in memory. |
| 37 | +* `find_and_replace_hex_pattern`: Find and replace a hexadecimal pattern in memory. |
| 38 | +* `dump_maps`: Dump memory maps. |
| 39 | +* `get_pid`: Return the PID of a process. |
| 40 | +* `help`: Display help information. |
| 41 | + |
| 42 | +### Command-line Data Types |
| 43 | +Pass them with just name as given below |
| 44 | +* `DWORD` |
| 45 | +* `FLOAT` |
| 46 | +* `DOUBLE` |
| 47 | +* `WORD` |
| 48 | +* `BYTE` |
| 49 | +* `QWORD` |
| 50 | +* `XOR` |
| 51 | +* `UTF_8` |
| 52 | +* `UTF_16LE` |
| 53 | + |
| 54 | +### Command Details |
| 55 | +You can get detailed information about each command and its usage by running: |
| 56 | +``` |
| 57 | +python3 -m androidMemoryTool help <command> |
| 58 | +``` |
| 59 | +For example, to get help for the read_value command, run: |
| 60 | +``` |
| 61 | +python3 -m androidMemoryTool help read_value |
| 62 | +``` |
| 63 | + |
| 64 | +### Examples |
| 65 | +* Read a value from memory: |
| 66 | +```` |
| 67 | +python3 -m androidMemoryTool read_value <pkg> <type> <speed_mode> <workers> <read> |
| 68 | +```` |
| 69 | +Replace <pkg>, <type>, <speed_mode>, <workers>, and <read> with the appropriate values. |
| 70 | + |
| 71 | +* Read and write a value in memory: |
| 72 | +```` |
| 73 | +python3 -m androidMemoryTool read_write_value <pkg> <type> <speed_mode> <workers> <read> <write> |
| 74 | +```` |
| 75 | +Replace <pkg>, <type>, <speed_mode>, <workers>, <read>, and <write> with the appropriate values. |
| 76 | + |
| 77 | +* Write a value to a library: |
| 78 | +```` |
| 79 | +python3 -m androidMemoryTool write_lib <pkg> <type> <base_address> <offset> <write_value> |
| 80 | +```` |
| 81 | +Replace <pkg>, <type>, <base_address>, <offset>, and <write_value> with the appropriate values. |
| 82 | + |
| 83 | +* Read a value from a library: |
| 84 | +```` |
| 85 | +python3 -m androidMemoryTool read_lib <pkg> <type> <base_address> <offset> [--value <value>] |
| 86 | +```` |
| 87 | +Replace <pkg>, <type>, <base_address>, <offset>, and <value> with the appropriate values. |
| 88 | + |
| 89 | +* Refine a list of addresses: |
| 90 | +```` |
| 91 | +python3 -m androidMemoryTool refiner_address <pkg> <type> <speed_mode> <workers> <list_address> <value_to_refine> |
| 92 | +```` |
| 93 | +Replace <pkg>, <type>, <speed_mode>, <workers>, <list_address>, and <value_to_refine> with the appropriate values. |
| 94 | + |
| 95 | +* Get the base address of a module: |
| 96 | +```` |
| 97 | +python3 -m androidMemoryTool get_module_base_address <pid> <module_name> |
| 98 | +```` |
| 99 | +Replace <pid> and <module_name> with the appropriate values. |
| 100 | + |
| 101 | +* Dump a library as raw binary: |
| 102 | +```` |
| 103 | +python3 -m androidMemoryTool raw_dump <pkg> <lib_name> [<path>] |
| 104 | +```` |
| 105 | +Replace <pkg>, <lib_name>, and <path> with the appropriate values. The <path> argument is optional and defaults to the current directory. |
| 106 | + |
| 107 | +* Find a hexadecimal pattern in memory: |
| 108 | +```` |
| 109 | +python3 -m androidMemoryTool find_hex_pattern <pkg> <type> <speed_mode> <workers> <hex_pattern> |
| 110 | +```` |
| 111 | +Replace <pkg>, <type>, <speed_mode>, <workers>, and <hex_pattern> with the appropriate values. |
| 112 | + |
| 113 | +* Find and replace a hexadecimal pattern in memory: |
| 114 | +```` |
| 115 | +python3 -m androidMemoryTool find_and_replace_hex_pattern <pkg> <type> <speed_mode> <workers> <search_pattern> <replace_pattern> |
| 116 | +```` |
| 117 | +Replace <pkg>, <type>, <speed_mode>, <workers>, <search_pattern>, and <replace_pattern> with the appropriate values. |
| 118 | + |
| 119 | +* Dump memory maps: |
| 120 | +```` |
| 121 | +python3 -m androidMemoryTool dump_maps <pkg> [--path <path>] |
| 122 | +```` |
| 123 | +Replace <pkg> and <path> with the appropriate values. The <path> argument is optional and defaults to the current directory. |
| 124 | + |
| 125 | +* Return the PID of a process: |
| 126 | +```` |
| 127 | +python3 -m androidMemoryTool get_pid <pkg> |
| 128 | +```` |
| 129 | +Replace <pkg> with the appropriate package name. |
| 130 | + |
| 131 | +### Version |
| 132 | +To get the version of the Android Memory Tool, use the following command: |
| 133 | +```` |
| 134 | +python3 -m androidMemoryTool -v |
| 135 | +```` |
| 136 | +### Help |
| 137 | +To display general help information or help for a specific command, use the help command: |
| 138 | +```` |
| 139 | +python3 -m androidMemoryTool help [command] |
| 140 | +```` |
| 141 | +Replace `[command]` with the desired command to get help for that command. If no command is provided, general help information will be displayed. |
0 commit comments