This is a tool that can be used to dump the memory of a Samsung device in upload mode.
There are a few other tools that can do this, but I couldn't make them work (or they were way too slow), so I decided to write my own.
-
Download prebuilt libusb
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26-binaries.7z --output libusb-1.0.26-binaries.7z
-
Extract the binaries
7z x libusb-1.0.26-binaries.7z
-
If you are on Windows you might need to install a driver for your device. You can do that by running
Zadig
and installing the driver for your device: Zadig.
If your device's USB ID is not in the c_supported_devs
array in dumper.h
you will need to add it.
-
Run
lsusb
and find your device's USB ID. -
Add your device's USB ID to the
c_supported_devs
array indumper.h
.
- Run
build.bat
orbuild.sh
depending on your platform. - The binary will be at
build/upload_dumper.exe
orbuild/upload_dumper
.
-
Run
upload_dumper
with the following arguments to dump all memory (ranges are determined using the partition table extracted from the device):./upload_dumper dump_all <output_directory>
-
Run
upload_dumper
with the following arguments to dump a specific partition:./upload_dumper dump_index <output_file> <index>
-
Run
upload_dumper
with the following arguments to dump a specific range of memory:./upload_dumper dump_range <output_file> <start_address> <end_address>
Examples:
The following command will dump all memory to the dump
directory.
./upload_dumper dump_all ./dump
The following command will dump the memory from 0x8F000000
to 0x8F010000
to dump.bin
.
./upload_dumper dump_range dump.bin 0x8F000000 0x8F010000
This one will dump the partition at index 13
to dump.bin
.
./upload_dumper dump_index dump.bin 13
There are a few projects that I used as a reference (and to copy some code snippets :) for this project: