Hi
I have a rooted Galaxy w and I am looking for a non commercial app that can make a byte for byte forensic dd image of the phone.
I want to do this so I can look for detailed SMS messages using winhex.
I wonder if anyone can suggest such an app but I'd prefer one that does not need complicated command line input as this just confuses the heck out of me.
Also, I have seen on various forensic sites reference is made to files named mtd0 through to mtd5 but when if have searched through
My galaxy w, these files are not on it anywhere?
I apologise if you are sick of this kind of question but any guidance or advice would be much appreciated.
Thanks in advance.
It will take only 5 lines of commands actually, and if you use adb shell instead of Terminal, a very easy copy-and-paste.
Code:
su
targ=/mnt/external_sd
bsiz=$((1024*1024))
blkp=/dev/block/mmcblk0p
dd if=${blkp}17 of=$targ/data.img bs=$bsiz
dd if=${blkp}28 of=$targ/internalsd.img bs=$bsiz
Just modify the "targ=" line to point to your location of external SD (will be 'sdcard' instead of 'external_sd' if you have swapped the SD Cards).
Sent from my GT-I8150 using xda app-developers app
pepoluan said:
It will take only 5 lines of commands actually, and if you use adb shell instead of Terminal, a very easy copy-and-paste.
Code:
su
targ=/mnt/external_sd
bsiz=$((1024*1024))
blkp=/dev/block/mmcblk0p
dd if=${blkp}17 of=$targ/data.img bs=$bsiz
dd if=${blkp}28 of=$targ/internalsd.img bs=$bsiz
Just modify the "targ=" line to point to your location of external SD (will be 'sdcard' instead of 'external_sd' if you have swapped the SD Cards).
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
Hi
Thanks for the reply and the great code which worked perfectly.
Just one question, does this code copy the un allocated spaces (where possible deleted files reside) as well?
Thanks in advance
event2020 said:
Hi
Thanks for the reply and the great code which worked perfectly.
Just one question, does this code copy the un allocated spaces (where possible deleted files reside) as well?
Thanks in advance
Click to expand...
Click to collapse
Yes, because it reads from the 'raw device', so each and every single byte, be them living in a used sector or a 'free' sector, will be copied. Up to and including the very last byte in the source partition.
Sent from my GT-I8150 using xda app-developers app
pepoluan said:
Yes, because it reads from the 'raw device', so each and every single byte, be them living in a used sector or a 'free' sector, will be copied. Up to and including the very last byte in the source partition.
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
Thank you so much.
You have really helped me.
Related
Hi, i have been trying to copy folders and a few files to the root of my Samsung galaxy nexus. or * / * or where the folders such as system, sbin, sdcard are. when ever i try to do so it copy's, stays there, but when i restart my phone seems to delete its self or disappear?! please does anyone know how to fix this? thanks
First of all, what are you trying to do?
Secondly, on android, / is actually the ramdisk (nothing copied there is persistent).
Sent from my Galaxy Nexus using Tapatalk 2
geoffcorey said:
First of all, what are you trying to do?
Secondly, on android, / is actually the ramdisk (nothing copied there is persistent).
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
well i have a script im trying to run, which involves me going into my terminal and firstly doing
Su
... then
sh test.sh (my test script)
and the only way i can get the terminal to find the directory so it runs is if i have it in the "ramdisk" which of course deletes after a reboot :/ so is their anywhere more permanent i could put it. if you get what im saying. thanks very much
What are you really trying to do though? You say you're trying to run a script, but I have no idea why or what your end need is.
So what is it you are trying to do?
Sent from my Galaxy Nexus using Tapatalk 2
geoffcorey said:
What are you really trying to do though? You say you're trying to run a script, but I have no idea why or what your end need is.
So what is it you are trying to do?
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
im trying to get this to work https://github.com/kosborn/p2p-adb
hectorz321 said:
im trying to get this to work https://github.com/kosborn/p2p-adb
Click to expand...
Click to collapse
Have only read the part with the commands, not the whole project. I dislike adding files to the system folders.
A solution could be a cd to change directory to the sd card and run the script from a /sdcard folder.
-star- said:
Have only read the part with the commands, not the whole project. I dislike adding files to the system folders.
A solution could be a cd to change directory to the sd card and run the script from a /sdcard folder.
Click to expand...
Click to collapse
yeah that's what i have ended up doing. as previously when i tried to one way or another using cd command, the script wouldn't run, however after much googling, app installing, command windowig and rom changing i have just about got it to work thanks very much everyone! this thread can be closed now.
Cheers! This is my first thread. Hopeful i'm not reposting similar thread.
I will tell you how to create swap file for our W. Anyway, swap file works like swap partition. It can help your RAM for improve our W performance.
1. Root your phone
2. Install Superuser
3. Install Busybox
4. Install Terminal Emulator
If you are using CM10 from arco, that's mean you don't need to follow first 4 steps.
5. Open Terminal Emulator
6. Change directory to external sd card (external is recomended, because we won't take some spaces on internal sd card)
Code:
[email protected]:~$ su
[email protected]:~# cd /external_sd
7. Create swap file under external_sd directory. I will create 512MB swap file. If you wanna create other size of swap file, just change value of count. 512 is recomended.
Code:
[email protected]:/external_sd# dd if=/dev/zero of=swapfile bs=1M count=512
8. Set the right permissions (a world-readable swap file is a huge local vulnerability)
Code:
[email protected]:/external_sd# chmod 600 swapfile
9. After creating the correctly-sized file, format it to swap:
Code:
[email protected]:/external_sd# mkswap swapfile
10. Activate the swapfile:
Code:
[email protected]:/external_sd# swapon swapfile
11. Check your swap, whether is work or not.
Code:
[email protected]:/external_sd# free -m
Check your swap, if the value exactly like your value on 7th step, then you did it!
Any question? Just ask here.
You did it? Why U No hit thanks button?
This does not create a partition right? Just a swap file.. Like the paging file in windows?
My only concern is does it really help that much? What I mean is a user noticeable difference. Also would it make the lifespan of the SDcard shorter? Higher the class of the card, the better it is???
I have never done swap on my older phones and I really would like to do it if it makes a whole a lot of difference in terms of usage.
Also can you also let us know how to revert back in case one does not like it? Just delete the file?
Thanks for your answer in advance.
[/QUOTE]
thearif said:
This does not create a partition right? Just a swap file.. Like the paging file in windows?
Click to expand...
Click to collapse
No, it does not.
Yes, somewhat similar.
thearif said:
My only concern is does it really help that much? What I mean is a user noticeable difference.
Click to expand...
Click to collapse
Totally depends on your usage pattern.
thearif said:
Also would it make the lifespan of the SDcard shorter?
Click to expand...
Click to collapse
Yes, probably. That's why you shouldn't create a swapfile anywhere but the External SD.
thearif said:
Higher the class of the card, the better it is???
Click to expand...
Click to collapse
Of course.
thearif said:
Also can you also let us know how to revert back in case one does not like it? Just delete the file?
Click to expand...
Click to collapse
Reboot, then delete the file.
Sent from my GT-I8150 using xda app-developers app
Boosting Perfomance?
RezaBeye said:
Boosting Perfomance?
Click to expand...
Click to collapse
Totally depends on your usage pattern.
Sent from my GT-I8150 using xda app-developers app
omegahanggara said:
Cheers! This is my first thread. Hopeful i'm not reposting similar thread.
I will tell you how to create swap file for our W. Anyway, swap file works like swap partition. It can help your RAM for improve our W performance.
1. Root your phone
2. Install Superuser
3. Install Busybox
4. Install Terminal Emulator
If you are using CM10 from arco, that's mean you don't need to follow first 4 steps.
5. Open Terminal Emulator
6. Change directory to external sd card (external is recomended, because we won't take some spaces on internal sd card)
Code:
[email protected]:~$ su
[email protected]:~# cd /external_sd
7. Create swap file under external_sd directory. I will create 512MB swap file. If you wanna create other size of swap file, just change value of count. 512 is recomended.
Code:
[email protected]:/external_sd# dd if=/dev/zero of=swapfile bs=1M count=512
8. Set the right permissions (a world-readable swap file is a huge local vulnerability)
Code:
[email protected]:/external_sd# chmod 600 swapfile
9. After creating the correctly-sized file, format it to swap:
Code:
[email protected]:/external_sd# mkswap swapfile
10. Activate the swapfile:
Code:
[email protected]:/external_sd# swapon swapfile
11. Check your swap, whether is work or not.
Code:
[email protected]:/external_sd# free -m
Check your swap, if the value exactly like your value on 7th step, then you did it!
Any question? Just ask here.
You did it? Why U No hit thanks button?
Click to expand...
Click to collapse
Good evening,
when i put command "[email protected]:/external_sd# mkswap swapfile" phone give following message:
"image is too small"
can i continue??
Tks in advance
moonwonder said:
Good evening,
when i put command "[email protected]:/external_sd# mkswap swapfile" phone give following message:
"image is too small"
can i continue??
Tks in advance
Click to expand...
Click to collapse
Please post here the result of the 'ls -la' command in the directory where you created your swapfile.
Sent from my GT-I8150 using xda app-developers app
R: [HOW TO] Create Swap File For Galaxy W
in attachment.
tks
Sent from my GT-I8150 using xda app-developers app
R: [HOW TO] Create Swap File For Galaxy W
moonwonder said:
in attachment.
tks
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
i'm seeing that file size is 512 byte and not Mbyte...
Sent from my GT-I8150 using xda app-developers app
moonwonder said:
in attachment.
tks
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
Have you installed the latest Busybox by Stericson?
R: [HOW TO] Create Swap File For Galaxy W
resolved:
changing count number on 'dd' function. (from 512 to 536870919)
i suppose that my busybox don't support byte size (bs=1M)
tks.
Sent from my GT-I8150 using xda app-developers app
moonwonder said:
resolved:
changing count number on 'dd' function. (from 512 to 536870919)
i suppose that my busybox don't support byte size (bs=1M)
tks.
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
You should instead try changing bs=1M to bs=$((1024*1024))
Reason: Flash memory works in blocks. bs is the amount of data being written at a time. If you write 1 byte at a time, you're writing thousands of times to the same block, which not only makes the process slower, but also shorten the life of your Flash memory (because, appending 1 byte requires a cycle of: read the whole block, add one byte, write back the whole block).
The largest Flash memory block size I can ascertain from specs on the Internet is 128 KiB. Thus, bs=$((1024*1024)) would be suitable (1 MiB is an integer multiple of 128 KiB).
If your dd doesn't support the bs parameter at all, you really should replace it with one that does.
Sent from my GT-I8150 using xda app-developers app
R: [HOW TO] Create Swap File For Galaxy W
thanks!!!
now i understand reason that the time for swap creation was about 3 hours...ahahaha
in attachment my new swap!
Sent from my GT-I8150 using xda app-developers app
moonwonder said:
thanks!!!
now i understand reason that the time for swap creation was about 3 hours...ahahaha
in attachment my new swap!
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
LOL... with bs=$((1024*1024)), I took only about 1.5 minutes:
Code:
[email protected]:/ $ cd sdcard
ro of=tes.fil bs=$((1024*1024)) count=512 <
512+0 records in
512+0 records out
536870912 bytes transferred in 86.185 secs (6229284 bytes/sec)
[email protected]:/sdcard $
Sent from my GT-I8150 using xda app-developers app
I followed a thread to make an ext2 partition (about 1 GB, unfortunately couldn't make it divisible by 256)
then read this thread and another one so i created a swapfile in that partition ( data/sdext2/ ) . now i have a couple of question about the swapfile
1.is that line important & why ??
omegahanggara said:
8. Set the right permissions (a world-readable swap file is a huge local vulnerability)
Code:
[email protected]:/external_sd# chmod 600 swapfile
Click to expand...
Click to collapse
it's not present in pepoluan's code
pepoluan said:
To create a swap RAM:
Code:
su
targ=/mnt/sdcard/.swapfile
dd if=/dev/zero of=$targ bs=$((1024*1024)) count=64
mkswap $targ
Click to expand...
Click to collapse
2. for heavy games, which is more recommended : 256 or 128 MB swapfile, pep said 64 which will b a bummer for me
pepoluan said:
I have experimented *a lot* with swap memory, and I can tell you with absolute confidence:
Swap files larger than 64 MiB *will* result in additional lags. Larger than 128 MiB, your phone will be very slow.
To activate, you don't need to reboot.
Go to the Terminal and enter the command:
cd /mnt/sdcard
ls .*
(replace "sdcard" with the actual location of where you created the swap file, of course)
Click to expand...
Click to collapse
one last thing : is the ls.* code different from the swapon code or they r the same ??
I made an sh file for this and placed it in init.d coz i want it to automatically run when the system boots. However it didn't work.
So for now i just placed it in /system/bin so that i only need to type enable_swap in the terminal.
Any way to make it work in init.d?
Any Answer ???
klacenas said:
I made an sh file for this and placed it in init.d coz i want it to automatically run when the system boots. However it didn't work.
So for now i just placed it in /system/bin so that i only need to type enable_swap in the terminal.
Any way to make it work in init.d?
Click to expand...
Click to collapse
I assume you put the swap file in /sdcard ?
The first partition of the SD Card does not get mounted until all scripts in init.d have finished. I'm experimenting with Stericson's new BusyBox, which includes the 'nohup' command.
Sent from my GT-I8150 using xda app-developers app
pepoluan said:
I assume you put the swap file in /sdcard ?
The first partition of the SD Card does not get mounted until all scripts in init.d have finished. I'm experimenting with Stericson's new BusyBox, which includes the 'nohup' command.
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
Yes I put it in sdcard. Thanks for the explanation. Please share if you succeed.
Edit: if its not possible through init.d, is there another way of automatically executing a script after init.d?
Sorry not really a Linux person, I'm more familiar with autoexec.bat
Sent from my GT-I8150 using xda app-developers app
klacenas said:
Yes I put it in sdcard. Thanks for the explanation. Please share if you succeed.
Edit: if its not possible through init.d, is there another way of automatically executing a script after init.d?
Sorry not really a Linux person, I'm more familiar with autoexec.bat
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
Install SManager, add the script as a boot script. Boot scripts run using SManager always run after SD Card mounts.
Sent from my GT-I8150 using xda app-developers app
Hi
I'm trying to use a symlink from the internal SD card to the external one so I can use WikiDroyd on a larger disk. I have done this before to map google music to my extSDcard and it works great, using this command
ln -s /storage/extSdCard/googleMusic/ /data/data/com.google.android.music/files/music
but when I try
ln -s /storage/extSdCard/WikiDroyd/ /storage/emulated/0/WikiDroyd
I get Function not implemented. I'm guessing it's because /storage/emulated/0 doesn't support symlinks, is this because of it's disk format? Does anyone know how to find out it's format? Can I reformat it?
Note: I am using omega rom
Questions go in Q&A
Thread moved
Friendly Neighborhood Moderator
metronews said:
Hi
I'm trying to use a symlink from the internal SD card to the external one so I can use WikiDroyd on a larger disk. I have done this before to map google music to my extSDcard and it works great, using this command
ln -s /storage/extSdCard/googleMusic/ /data/data/com.google.android.music/files/music
but when I try
ln -s /storage/extSdCard/WikiDroyd/ /storage/emulated/0/WikiDroyd
I get Function not implemented. I'm guessing it's because /storage/emulated/0 doesn't support symlinks, is this because of it's disk format? Does anyone know how to find out it's format? Can I reformat it?
Note: I am using omega rom
Click to expand...
Click to collapse
Is /storage/emulated/0 the default directory for the app? If so, it may be failing due to trying to replace an existing directory with a symlink (particularly if that pre-existing directory is in use at the time).
If the app's directory setting can be altered, why not try putting the symlink elsewhere? Even if the app doesn't let you set a custom directory, creating your symlink elsewhere would, if successful, narrow down the likely causes of the error (unfortunately, if the app's directory setting is hard coded out otherwise unchangeable, then it would also prove that what you want to do is not possible, at least not through this approach)
Sent from my SPH-L710 using xda app-developers app
Are you sure that ln -s will work on non ext partitions? I don't think this won't work on FAT32/NTFS partitions.
lexridge said:
Are you sure that ln -s will work on non ext partitions? I don't think this won't work on FAT32/NTFS partitions.
Click to expand...
Click to collapse
That's a good point, I thought that certain configurations might work (like placing the link on an ext partition that points to a file on a fat 32 partition, since Linux can read both and Windows would never see the Linux-style link, for example) but I'll double check...
Sent from my SPH-L710 using xda app-developers app
styles420 said:
That's a good point, I thought that certain configurations might work (like placing the link on an ext partition that points to a file on a fat 32 partition, since Linux can read both and Windows would never see the Linux-style link, for example) but I'll double check...
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
Just a thought, you might also try busybox ln -s and see if that works.
Hi, is it possible to change the bluetooth MAC address somehow?
I tried changing sys\module\htc_bdaddress\parameters\bdaddress. It showed the new address in the settings, but still used the old one. After a reboot it went back to the original one. Does anyone know a way to make a permanent change? Any help would be greatly appreciated.
Try using a script in init.d folder in /system/etc/init.d
I use this way to set cpu speeds and the governers even without a cpu controlling app (setcpu, cpu master).
Sent from my HTC Desire Z using xda app-developers app
You can copy with dd your efs partition and make your changes there and use dd to place the new one in, should work but I never tried
Just be sure to keep an orginal
Sent from my Nexus 4 using XDA Premium 4 mobile app
Thanks for the replies, but I still have a question. Where can I find this efs partition?
/dev/block/mmcblk0p13
/dev/block/mmcblk0p14
You can dd these and edit, be careful using dd commands
Simple way is with adb shell
cd /efs
tar cf /sdcard/efs-backup.tar*
Then make changes but keep copy
Now with new
cd /efs
tar xf /sdcard/efs-backup.tar
Sent from my Nexus 4 using XDA Premium 4 mobile app
In adb shell when I type "cd /efs" I get a "No such file or directory" error.
I found this script somewhere else:
adb shell
su
dd if=/dev/block/mmcblk13 of=/sdcard/efs13.rfs
dd if=/dev/block/mmcblk14 of=/sdcard/efs14.rfs
This way I managed to save them, but I'm not sure if this is what I need if I want to edit them. Is there an other way of getting them in .tar format?
I'm trying to get an app to work and have to write a path for the external sd card, can I just use /storage/external_SD ?
try this.
mjb152 said:
I'm trying to get an app to work and have to write a path for the external sd card, can I just use /storage/external_SD ?
Click to expand...
Click to collapse
use this it might help
You can get the path of sdcard from this
code:
String path = Environment.
getExternalStorageDirectory
().getAbsolutePath();
Then specify the foldername and file
name.
if you are using an emulator, double-check
to make sure that you have filled in a
value for the SD Card size.
for kk permission is changed I hope you know.
I can provide code for it also.
for kk-
Your app can not read shared files on the external
storage when running on Android 4.4, unless your app
has the READ_EXTERNAL_STORAGE permission. That
is, files within the directory returned by
getExternalStoragePublicDirectory() are no
longer accessible without the permission. However, if
you need to access only your app-specific directories,
provided by getExternalFilesDir() , then you do
not need the READ_EXTERNAL_STORAGE permission
@SidDev said:
use this it might help
You can get the path of sdcard from this
code:
String path = Environment.
getExternalStorageDirectory
().getAbsolutePath();
Then specify the foldername and file
name.
if you are using an emulator, double-check
to make sure that you have filled in a
value for the SD Card size.
for kk permission is changed I hope you know.
I can provide code for it also.
for kk-
Your app can not read shared files on the external
storage when running on Android 4.4, unless your app
has the READ_EXTERNAL_STORAGE permission. That
is, files within the directory returned by
getExternalStoragePublicDirectory() are no
longer accessible without the permission. However, if
you need to access only your app-specific directories,
provided by getExternalFilesDir() , then you do
not need the READ_EXTERNAL_STORAGE permission
Click to expand...
Click to collapse
coo, thanks !
mjb152 said:
coo, thanks !
Click to expand...
Click to collapse
welcome and you could have pressed the thanks button.
@SidDev said:
welcome and you could have pressed the thanks button.
Click to expand...
Click to collapse
If he has root this will help:
https://play.google.com/store/apps/details?id=nextapp.sdfix
=
http://technofaq.org/posts/2014/04/fixing-external-sd-card-write-issue-on-android-kitkat/
I must have root to fix the SD problems ? (can't write to sd)
It a big probleam if google do it. but LG & S4 & Note 3 have SD what should they do with no ROOT?
what about this?
http://www.instructables.com/id/How-to-bypass-Android-44-KitKat-external-SD-write-/
nope he wants something else
u1988 said:
If he has root this will help:
https://play.google.com/store/apps/details?id=nextapp.sdfix
=
http://technofaq.org/posts/2014/04/fixing-external-sd-card-write-issue-on-android-kitkat/
I must have root to fix the SD problems ? (can't write to sd)
It a big probleam if google do it. but LG & S4 & Note 3 have SD what should they do with no ROOT?
what about this?
http://www.instructables.com/id/How-to-bypass-Android-44-KitKat-external-SD-write-/
Click to expand...
Click to collapse
you got it completely wrong, he wants something else.
@SidDev said:
you got it completely wrong, he wants something else.
Click to expand...
Click to collapse
Oh sorry! :cyclops:
u1988 said:
Oh sorry! :cyclops:
Click to expand...
Click to collapse
no problem buddy.
and what was the answer???!!!