[Q] Extracting corrupt nandroid backup (w/o unyaffs!) - Android Software/Hacking General [Developers Only]

Hello,
i NEED to extract an important corrupt nandroid backup (data.img) but unyaffs aborts with an error:
>unyaffs.exe data.img
read image file
: Bad file descriptor
read image file
: Bad file descriptor
What other tool / mount options in Linux are possible to restore the file?
Thanks
Daniel

Related

[Q] extract data from clockwork backup

Hi
I have tryed to figure out how to extract data from clockwork backup
I have these backup files:
.android_secure.vfat.dup
boot.img
cache.ext4.dup
data.ext4.dup
nandroid.md5
recovery.img
system.ext4.dup
I have tried unyaffs tool but i only get "broken image file"
So can anybody help me to extract some data (actually only my sms)
LoA
Have a look at Nandroid Manager ' ROOT.

some noob questions about mtkdroid?

A-
now i used two methods to backup and both didnt make same files sizes
1-readback using flashtool each partition separably
2-readback using flashtool whole rom and process it using mtkdroid
files are not the same size,,, preloader in the second method is smaller,
which method should i use
B-
when i process the rom file using mtkdroid i get this:
--- ERROR :No find KernelGZ
--- ERROR :No Split Boot Image
how to avoid that, and is it gonna affect my backup?
C-
when i open scatter file from the mtkdroid processed rom backup folder,it doesnt check all the partitions
how to avoid that, and is it gonna affect my backup?
,but when i open scatter file from the manually readback separated partition ,it doesnt check any
how to avoid that, and is it gonna affect my backup?
D-
i have read that it should me in meta mode to read back,but it doesnt work,it doesnt read
plz i need some answers i am not being lazy here

[RECOVERY] [TWRP] Android system recovery <3e> universal checksum disabler

This is a Flashable Zip for restoring backups created from different recoveries. No more problems with checksums, checksums will be ignored.
- Android system recovery <3e>
- CWM
- TWRP
- ADB Backup
- MIUI Backup
This is a alpha release, in this state you can test it for Android system recovery <3e> only!
I need testers for proof of concept. If you have a Mediatek Phone with encrypted userdata_20160823_100259.backup, please try to restore with bckp2raw.zip from TWRP. Please give feedback if failed or vote :good: if worked.
bckp2raw.zip (v1.0.3) 32-bit
bckp2raw.zip (v1.0.5) universal
(other backup formats following soon, feel free to request)
TUTORIAL - under construction
aIecxs said:
TUTORIAL - under construction
Click to expand...
Click to collapse
Is this solves problem of Android 7 stock recovery backup?
I got second phone stock recovery problem for 7 version
stock recovery do not want to recover his backup. complains - "it is corrupted, please reset your phone"
I install twrp recovery and try to install this .zip
bit it give error 134 (or something like that)
sorry this project is abandoned. in generally, backup can not restored to other device because of the checksum mismatch. Thats where this zip comes in game. If you upload recovery.log right after installing this zip i will try to fix the errors..
aIecxs said:
sorry this project is abandoned. in generally, backup can not restored to other device because of the checksum mismatch. Thats where this zip comes in game. If you upload right after installing this zip i will try to fix the errors..
Click to expand...
Click to collapse
I meant - I got another (second) phone looped reboot, same as in 2018. And try to stock recovery backup (55Gbyte and ) restore.
BTW - first phone is still waiting to restore 11Gbyte stock recovery backup!
last file: userdata_20191106_110350.backup27
Android 7 again same as in topic: https://forum.xda-developers.com/showthread.php?t=2528969&page=7
I copied lines from recovery.log:
I: operation_start: 'Flashing'
Installing zip file '/external_sd/bckp2raw.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
Archive: /external_sd/bckp2raw.zip
inflating: bckp2raw.sh
Archive: /external_sd/bckp2raw.zip
inflating: busybox-arm
Archive: /external_sd/bckp2raw.zip
inflating: tar-arm
CANNOT LINK EXECUTABLE "/system/bin/sh": "/system/lib/libc++.so" is 32-bit instead of 64-bit
Aborted
Updater process ended with ERROR: 134
I:Legacy property environment disabled.
I:Install took 0 second(s).
Error installing zip file '/external_sd/bckp2raw.zip'
Dont want to boring and get you, if you would give help - you can save many people with same problem with android-7
ah i see, script does not even start. i don't have a x64 device for testing, i assume twrp is not able to run mksh from /system. i have added paths please try this one instead...
update-binary
Code:
LD_LIBRARY_PATH=/system/lib64:/system/vendor/lib64:/system/lib:/system/vendor/lib
bckp2raw.zip (v1.0.5) universal
for those who want to quickly convert TWRP ADB backup.ab into data.ext4.win
usage for unpacking files (don't do this on windows disk)
Code:
bash twab.sh backup.ab
cd 20*
mkdir data
sudo tar --ignore-command-error --numeric-owner --selinux --xattrs -xpf data.ext4.win -ivC data 2> /dev/null
data partition is encrypted
Hi , I've been trying a lot of methods to get my data back from my .backup files. All with no results. Your bckp2raw script seems to be one of the most successfull , but it ends by a " data partition is encrypted" ... Do you think I can still recover my files ... The original phone is actually working but it has been factory wiped ...
that message just means that your current /data partition is encrypted (message for encrypted backup is different)
- do a backup of metadata partition (just in case)
- do a backup of /sdcard to PC (adb/mtp)
- format userdata partition
- reboot TWRP
- check userdata partition is unencrypted
- restore userdata*.backup from zip
- restore metadata partition from backup
- restore /sdcard backup
the restoring process will deny if userdata is not empty. please note if backup is encrypted it is most likely useless without corresponding backup of metadata partition
aIecxs said:
that message just means that your current /data partition is encrypted (message for encrypted backup is different)
- do a backup of metadata partition (just in case)
- do a backup of /sdcard to PC (adb/mtp)
- format userdata partition
- reboot TWRP
- check userdata partition is unencrypted
- restore userdata*.backup from zip
- restore metadata partition from backup
- restore /sdcard backup
the restoring process will deny if userdata is not empty. please note if backup is encrypted it is most likely useless without corresponding backup of metadata partition
Click to expand...
Click to collapse
Thank you very much for your quick reply. Ok so I tried it , the restoring part worked , but when I rebooted it asked me for my code and said "password is correct but data is corrupted" ....
Do you have any idea for me to get my data back .... at least my pictures ...?
sounds like the backup is encrypted, can you confirm? more important is this the source phone of this backup? or do you try to restore on other device?
aIecxs said:
sounds like the backup is encrypted, can you confirm? more important is this the source phone of this backup? or do you try to restore on other device?
Click to expand...
Click to collapse
I'm pretty sure it is encrypted. Yes the phone is the source phone of the backups
encryption should work in theory, but you need a copy of metadata partition from the day you created backup. you most likely don't have it, therefore your data is lost forever
aIecxs said:
encryption should work in theory, but you need a copy of metadata partition from the day you created backup. you most likely don't have it, therefore your data is lost forever
Click to expand...
Click to collapse
Yes I don't have the metadatas from that day, is there a chance that they have been backup with the android backup ?
Thanks for your help anyways, I'm sad
no, nothing you can do. even a old metadata from the first day when you buyed this device would probably do it. metadata partition is formatted on factory reset.
for some devices the crypto footer is not located at separate partition, but at the end of userdata partition instead. But this is not the case for your device, otherwise this zip would have restored. you can double check, search with hex editor in last -16384 bytes of last file for string aes-cbc-essiv:sha256 (or aes-xts)
aIecxs said:
no, nothing you can do. even a old metadata from the first day when you buyed this device would probably do it. metadata partition is formatted on factory reset.
for some devices the crypto footer is not located at separate partition, but at the end of userdata partition instead. But this is not the case for your device, otherwise this zip would have restored. you can double check, search with hex editor in last -16384 bytes of last file for string aes-cbc-essiv:sha256
Click to expand...
Click to collapse
Cannot find anything like this but i'm not used to HEX reading .... Is there a chance that the metadata is on the SD card i was using for (external) storage on the phone (not the ones for the backups) ?
Hello there and thanks for creating such a productive thread, just what I needed for my current situation. so am trying to retrieve .backup files on cxAir android 7.0 after root through twrp but apparently, when running the script from the zip file you've shared I get the Error: data partition not mounted.
I'm still new in the dev world but am totally excited about it and I may not understand a lot of things but am willing to work my ass off to figure out the most of what I can so please I'd really appreciate it if I could get some help on this one, thanks in advance
mount data partition and try again?

help with updater script and folder to flashable img

i have two questions :
1. what this lines mean in an updater script :
run_program("/bin/7zr", "x", "/data/system_boot.7z", "-y","-o/system");
i know it runs 7zr program from /bin/ to extract system_boot.7z from data directory
but what are "x" and "-y" and "-o"???
2. and how can i to convert two folders content to system.img and data.img to flash with fastboot?
any idea?
x23are said:
any idea?
Click to expand...
Click to collapse
this script extract system_boot.7z archive to system partition
x extract
y force replace
2. system and data partitions must be flashed with .yaffs2 images

Extract IMG file firmware Huawei Device [Android 9]

Hello!
I want to extract the apk files from the system.img file HUAWEI P30 smartphone with android 9.
But the tool that I have always used (imgextractor.exe) completes the processing of the img file with an error:
Code:
ImgExtractor version 1.3.7 <Created by And_PDA (Based on sources ext4_unpacker)>
Extractor for images in EXT2\EXT3\EXT4\YAFFS2\CRAMFS filesystem formats
support SPARSE\SIN\MOTO structure formats
Exception EOutOfMemory in module imgextractor.exe at 0001669D.
Out of memory.
Please, help me!
P.S. According to the rules of the forum, I can not yet attach an external link to my post. But if necessary, I can send it to private messages!
Did you convert SIMG to IMG before? Something is in new format SIMG or raw IMG.
adeii said:
Did you convert SIMG to IMG before? Something is in new format SIMG or raw IMG.
Click to expand...
Click to collapse
Yes i used simg2img.exe for this. I tried to process the new IMG file with imgextractor.exe, but the result was the same ((
appdroiddevelop said:
Yes i used simg2img.exe for this. I tried to process the new IMG file with imgextractor.exe, but the result was the same ((
Click to expand...
Click to collapse
Try with DiskInternals LinuxReader.

Categories

Resources