Help me by dumping a partition on your device - Asus ZenFone 4 Pro Questions & Answers

Hello,
Could someone having access to a rooted Zenfone 4 Pro do me a favour by dumping a partition on their device?
As root, execute the following commands:
Code:
# dump the sec partition to /data/local/tmp/sec.img
# it might be in /dev/block/platform/soc/<something>/by-name/
dd if=/dev/block/by-name/sec of=/data/local/tmp/sec.img
chmod 755 /data/local/tmp/sec.img
Then use ADB to retrieve the file from your device:
Code:
adb pull /data/local/tmp/sec.img
There is no personal data in this partition. It is either empty, or what's in it is the same for all devices.
Thanks a lot for the help!

You still need this?

Related

[SOLVED][Guide] How to backup EFS + Modemfs folders

Hello!
So I recently stumbled upon some information that while flashing all kinds of Roms, you might lose your IMEI, thus being left over with a nice paper weight.
To my understanding this information is stored in the EFS folder (though according to this thread it is actually stored in modemfs).
I googled around and saw many options: PC software, terminal commands, apps etc.
Since each phone utilizes this option in different ways, which would be a good way to backup these folders in case of emergency on the S Advance?
Thanks!
SOLUTION:
These are the commands from the ADB shell, but can also be used within the terminal.
Backup Process:
Code:
adb shell
su
dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img
dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img
exit
exit
adb pull /sdcard/efs_backup.img efs_backup.img
adb pull /sdcard/modemfs_backup.img modemfs_backup.img
Restore Backup Process:
Code:
adb push efs_backup.img /sdcard/efs_backup.img
adb push modemfs_backup.img /sdcard/modemfs_backup.img
adb shell
su
dd if=/sdcard/efs_backup.img of=/dev/block/mmcblk0p7
dd if=/sdcard/modemfs_backup.img of=/dev/block/mmcblk0p2
exit
exit
Thanks to @mr.harsh and @KINGbabasula for help and KINGbabasula for making the script!
Please note that the restore commands haven't been tested out, but theoretically its supposed to work.
If someone has made a backup and wiped his EFS folder, he wont mind testing it out
YMatrix said:
Hello!
So I recently stumbled upon some information that while flashing all kinds of Roms, you might lose your IMEI, thus being left over with a nice paper weight.
To my understanding this information is stored in the EFS folder (though according to this thread it is actually stored in modemfs).
I googled around and saw many options: PC software, terminal commands, apps etc.
Since each phone utilizes this option in different ways, which would be a good way to backup these folders in case of emergency on the S Advance?
Thanks!
Click to expand...
Click to collapse
in the terminal type:
Code:
su
cp /dev/block/mmcblk0p7 /sdcard/efs_backup
cp /dev/block/mmcblk0p2 /sdcard/modemfs_backup
check that efs_backup is 10MB and modemfs_backup is 16MB.And this is for JB.I don't know about GB but most probably they'll be same...
Thank you for your quick reply.
I tested it out and got the sizes you said.
The restore process, if ever needed, is the same cp command only changing the source and destination?
Whats the difference between the CP command and the DD command?
Any way to do this from recovery or ADB?
Sent from my GT-I9070 using Tapatalk 4 Beta
YMatrix said:
Thank you for your quick reply.
I tested it out and got the sizes you said.
The restore process, if ever needed, is the same cp command only changing the source and destination?
Whats the difference between the CP command and the DD command?
Any way to do this from recovery or ADB?
Sent from my GT-I9070 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Via adb:
Code:
adb shell
$ su
# cp /dev/block/mmcblk0p7 /sdcard/efs_backup
# cp /dev/block/mmcblk0p2 /sdcard/modemfs_backup
# exit
$ exit
adb pull /sdcard/efs_backup %cd%\efs_backup
adb pull /sdcard/modemfs_backup %cd%\modemfs_backup
KINGbabasula said:
Via adb:
Code:
adb shell
$ su
# cp /dev/block/mmcblk0p7 /sdcard/efs_backup
# cp /dev/block/mmcblk0p2 /sdcard/modemfs_backup
Click to expand...
Click to collapse
Thank you!
Why use the CP command and not the DD command? Or in this case it doesn't really matter?
YMatrix said:
Thank you!
Why use the CP command and not the DD command? Or in this case it doesn't really matter?
Click to expand...
Click to collapse
cp=copy dd=copy, convert, format. See my reply. I updated
KINGbabasula said:
cp=copy dd=copy, convert, format. See my reply. I updated
Click to expand...
Click to collapse
Still don't get the difference DD / CP
As for the commands you posted, I was asking for the restore process, so I am guessing it will look like this:
Code:
adb shell
$ su
# cp /sdcard/efs_backup /dev/block/mmcblk0p7
# cp /sdcard/modemfs_backup /dev/block/mmcblk0p2
# exit
$ exit
Is there a "push" command also (to be used like the pull command)?
YMatrix said:
Still don't get the difference DD / CP
As for the commands you posted, I was asking for the restore process, so I am guessing it will look like this:
Code:
adb shell
$ su
# cp /sdcard/efs_backup /dev/block/mmcblk0p7
# cp /sdcard/modemfs_backup /dev/block/mmcblk0p2
# exit
$ exit
Is there a "push" command also (to be used like the pull command)?
Click to expand...
Click to collapse
I'm not sure but i think that you need to use dd to restore because you are going to flash 2 partition like flashing kernel.
You can do this (i repeat Im not sure)
Code:
adb push efs_backup /sdcard/efs_backup
adb push modemfs_backup /sdcard/modemfs_backup
adb shell
$ su
# dd if=/sdcard/efs_backup of=/dev/block/mmcblk0p7
# dd if=/sdcard/modemfs_backup of=/dev/block/mmcblk0p2
# exit
$ exit
Pay attention cause if you dd to a wrong partition you may brick
KINGbabasula said:
I'm not sure but i think that you need to use dd to restore because you are going to flash 2 partition like flashing kernel.
Pay attention cause if you dd to a wrong partition you may brick
Click to expand...
Click to collapse
Hmmm, so this is a pickle.
Wrong partition is always a problem, but since I also checked a thread by @frapeti, I am assuming the partition numbers are correct, though I don't know about the commands. Since we saved using CP shouldn't we also restore using CP? Otherwise I would say save using DD and then restore using DD.
YMatrix said:
Hmmm, so this is a pickle.
Wrong partition is always a problem, but since I also checked a thread by @frapeti, I am assuming the partition numbers are correct, though I don't know about the commands. Since we saved using CP shouldn't we also restore using CP? Otherwise I would say save using DD and then restore using DD.
Click to expand...
Click to collapse
No because cp copy the content of the partition. dd format the partition then copy in the partition
KINGbabasula said:
No because cp copy the content of the partition. dd format the partition then copy in the partition
Click to expand...
Click to collapse
Oh, alright, so to sum up so people can use this for future reference:
Backup Process:
Code:
adb shell
$ su
# cp /sdcard/efs_backup /dev/block/mmcblk0p7
# cp /sdcard/modemfs_backup /dev/block/mmcblk0p2
# exit
$ exit
Restore Backup Process:
Code:
adb push efs_backup /sdcard/efs_backup
adb push modemfs_backup /sdcard/modemfs_backup
adb shell
$ su
# dd if=/sdcard/efs_backup of=/dev/block/mmcblk0p7
# dd if=/sdcard/modemfs_backup of=/dev/block/mmcblk0p2
# exit
$ exit
YMatrix said:
Oh, alright, so to sum up so people can use this for future reference:
Backup Process:
Code:
adb shell
$ su
# cp /sdcard/efs_backup /dev/block/mmcblk0p7
# cp /sdcard/modemfs_backup /dev/block/mmcblk0p2
# exit
$ exit
Restore Backup Process:
Code:
adb push efs_backup /sdcard/efs_backup
adb push modemfs_backup /sdcard/modemfs_backup
adb shell
$ su
# dd if=/sdcard/efs_backup of=/dev/block/mmcblk0p7
# dd if=/sdcard/modemfs_backup of=/dev/block/mmcblk0p2
# exit
$ exit
Click to expand...
Click to collapse
Now i make a script to automate it
Here is the script
I'm not sure that it will work
KINGbabasula said:
Here is the script
I'm not sure that it will work
Click to expand...
Click to collapse
That was fast
Guessing the only way to test out the restore option is if someone that made a backup and wiped his efs/modemfs folders, to test the script out.
YMatrix said:
That was fast
Guessing the only way to test out the restore option is if someone that made a backup and wiped his efs/modemfs folders, to test the script out.
Click to expand...
Click to collapse
Yes please can you change the title to [SOLVED] How to backup EFS and Modemfs folders. And in the op write the solutions? Thanks
KINGbabasula said:
Yes please can you change the title to [SOLVED] How to backup EFS and Modemfs folders. And in the op write the solutions? Thanks
Click to expand...
Click to collapse
Already did
Hi, I just wanna ask. Can I just copy the efs and modemfs folders to ext sd, then to restore I just copy and replace both files to its actual location using any root explorer (ie: es file manager)? Just asking as I read this guide on backing imei part.
arffrhn said:
Hi, I just wanna ask. Can I just copy the efs and modemfs folders to ext sd, then to restore I just copy and replace both files to its actual location using any root explorer (ie: es file manager)? Just asking as I read this guide on backing imei part.
Click to expand...
Click to collapse
Yes you can
Sent from my GT-I9070 using Tapatalk 4 Beta
KINGbabasula said:
Yes you can
Sent from my GT-I9070 using Tapatalk 4 Beta
Click to expand...
Click to collapse
I see. Thanks man.
YMatrix said:
Oh, alright, so to sum up so people can use this for future reference:
Backup Process:
Code:
adb shell
$ su
# cp /sdcard/efs_backup /dev/block/mmcblk0p7
# cp /sdcard/ /dev/block/mmcblk0p2
# exit
[/QUOTE]
Thats wrong, to backup using cp use something like cp [original efs] [sdcard/backup folder]
I guess it's better to use dd command for this purpose:
dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img
dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img
To restore just switch if with of (input file / output file)
Sent from my GT-I9070 using xda app-developers app
Click to expand...
Click to collapse

[ROOT]: Kyocera KC-S701 EU version, got root using exploit, what next?

This phone is kinda diehard. Thanks to dirtycow and free time, now I have root on this phone. But only shell root access.
Code:
255|[email protected]:/ # id
uid=0(root) gid=0(root) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:runas:s0
[email protected]:/ # mount -o remount,rw /system
mount: Operation not permitted
There are custom bootloaders, is there a way install them directly from the phone? All the info I got is fancy app/gui. There is no hardcore docs on how to gain the full root access or flash the bootloader.
I have access to the /cache partition. I also have access to the /cache/delta/boot_delta.bin (looks like it is encrypted), I can reboot to the recovery menu and pass commands into /cache/recovery/command
I can use dd to dump whole flash (read access works). But dd doesn't work with /dev/block/ devices on write (it works without problems, but when you check actual content - it appeared to be unmodified at all). Is it a common write protection or something?
Also there is a FOTA partition. How can I determine which reboot command should I send to reboot to the fota recovery?

How to pull mmcblk0 or any partition directly to pc?

I have tried following command on ADB to extract partition, but failed.
source:fciotti.com/2017/02/26/clone-android-memory
Code:
chmod +r /dev/block/mmcblk0
returns
Code:
Bad mode
Code:
adb pull /dev/block/mmcblk0 "mmc.img"
returns
Code:
remote permission denied
I have post a question on stack exchange, and found a command working but failed after dumping 4gb on sdcard (not directly to pc) because of file system.
source:android.stackexchange.com/questions/185433/problem-with-coping-mmcblk0-to-pc?noredirect=1#
Code:
adb exec-out "su -c 'cat /dev/block/mmcblk0'" > mmc.img
but it create a 0kb img file.
Please anyone help.

Help me by dumping a partition on your device

Hello,
Could someone having access to a rooted Zenfone 6 do me a favour by dumping a partition on their device?
As root, execute the following commands:
Code:
# dump the sec partition to /data/local/tmp/sec.img
# it might be in /dev/block/platform/soc/<something>/by-name/
dd if=/dev/block/by-name/sec of=/data/local/tmp/sec.img
chmod 755 /data/local/tmp/sec.img
Then use ADB to retrieve the file from your device:
Code:
adb pull /data/local/tmp/sec.img
There is no personal data in this partition. It is either empty, or what's in it is the same for all devices.
Thanks a lot for the help!

[SOLVED] Restore build.prop to default: adb shell doesn't let me write

ROM: LineageOS 18.1, Recovery: LineageOS 18.1 recovery
I messed up and put my build.prop in an invalid state. I got the default build.prop from the rom zip,rebooted the phone to recovery (lineageos 18.1 recovery), mounted the system partition on /mnt/system, and tried to write build.prop to default via adb shell and then cat >/mnt/system/system/build.prop and writing whatever stuff I want. However, even after remounting as rw, I get the following error message:
Code:
cat: xwrite: No space left on device
The same thing happens if I just edit on my PC and do adb push
Code:
$ adb push build.prop /mnt/system/system/build.prop
build.prop: 1 file pushed, 0 skipped. 89.9 MB/s (2662 bytes in 0.000s)
adb: error: failed to copy 'build.prop' to '/mnt/system/system/build.prop': remote write failed: No space left on device
Now what does this even mean?? There is 3.1M free space, as confirmed by df -h. I really searched I cannot find anything on this. Any help would be really appreciated!
---
I can confirm it is mounted as rw by checking this line in /proc/mounts
Code:
/dev/block/dm-0 /mnt/system ext4 rw,seclabel,relatime 0 0
adb remount also fails with
/system/bin/sh: remount: inaccessible or not found
I'm at my wit's end, any guidance here? I feel this should really not be this difficult! I just want to rewrite build.prop from adb/recovery!
---
It might have something to do with overlayfs, as seen here https://android.googlesource.com/platform/system/core/+/master/fs_mgr/README.overlayfs.md. However adb remount merely says /system/bin/sh: remount: inaccessible or not found! How should I get this to work?
---
Finally: maybe I could just try to flash a zip containing only the build.prop via adb sideload? Will adb sideload wipe anything (e.g. system) or just overwrite the files which are present in the zip?
---
Just ended up flashing again. It worked without deleting apps or data

Categories

Resources