Script or program to read RAW data - windows

I had a usb flash drive which had data and was using FAT32 file table, till yesterday!
I had been using it only in Windows. Now when I plugin the usb flash drive, Windows XP reports the file system as RAW and trying to access the drive asks to format the drive. I desperately need to get some data out from there (the backup is a few days old).
I've already used a dozen of programs under windows that claim to read RAW data, but none has worked yet. Is there any script, utility or program under FreeBSD or Windows that will aid me in getting that data back? If I plugin the usb drive to my FreeBSD box it only appears as /dev/da0, so I cannot mount it.
Apologies if I am not making sense, but is there any light at the end of the tunnel?

You can use dd to make a raw copy:
dd if=/device of=target_file
After that, you may want to google for "data carving", and use a program such as foremost.

Related

Windows: Additional file attribute preventing downloaded program from running?

I have a compiled program which runs great after being compressed, copied to another computer using a USB key, extracted and ran.
However, if I upload the compressed file to Google Drive or Dropbox, download it and extract it, the program will not run. It gives me an error "program.exe has stopped working".
Using a tool called WinMerge, I compared the program that was extracted from a USB drive with the program that was extracted after being downloaded. Every file, both binary and text, was identical.
Next I used attrib -r -a -s -h on every program file in both folders, thinking perhaps one of the file attributes was incorrect. I still had the same problem; the copied program works, the downloaded one does not.
I also tried changing the name and location of the folders the program was in but it had no effect.
The only thing I can think of is some additional attribute that Windows gives files which were downloaded from the internet, to possibly trigger an additional UAC check which is interfering with the program. Does this exist?
This is on Windows 7.
Found the problem. Windows adds an Alternate Data Stream (ADS) to every file downloaded off the internet. For some reason, these streams were preventing the program from running. Stripping the ADS from each file allows it to run.
I used a Windows Sysinternals program called Streams to strip the ADS data.

how to display the volume name automatically on windows/linux

I am writing a USB driver to a product which is basically a USB pen drive. Upon connecting the product to the usb port, I want to see the drive name/volume name as "XXXX Corporation". I see that by default it always gets shown as "Removable Disk" in Windows explorer or my computer.
If I use any USB detail reader tools available in the net, then I can see the vendor id and manufacturer ids and other usb details. Renaming the drive from windows works but I want this to happen by default without asking the end user to rename. Having autorun.inf in root of the drive works only on WindowsXP.
How do I get this? Are there any descriptors which needs to be coded explicitly in my usb drivers stack? There are already API's to obtain the manufacturer/Product/Serial descriptors in my usb drivers stack.
Thanks in advance.
Chandra
The name shown in file explorers is the filesystem label, it's not a USB descriptor. The tool you are using to create the filesystem (whether FAT or NTFS) probably allows you to set the label. It can also be changed on an existing filesystem. The label can also be read on any operating system.
The label entry of the autorun.inf file should also be read by modern Windows. Some Linux file explorers (Gnome's Nautilus) might use it if it's there, but the cross-platform way is the filesystem label.

Transfer Files From Mac External Hard Drive To PC

Our wedding videographer gave us our wedding video (all 200GB of it) on an external hard drive formatted for Mac.
My wife and I each have PCs and we have 2 external hard drives formatted for PCs. We have a Mac that's half dead, but we could use it for group sharing or something, but it doesn't have any internal space to store the large files.
Is there any way to get the files from this external hard drive onto one of our PCs?
Not exactly a programming problem, but anyhow...
OSX uses HFS plus, not NTFS so a quick google search and you'll see that there are products available for what you want: -
http://www.pcadvisor.co.uk/how-to/windows/3369574/how-read-mac-os-hfs-drives-in-windows-for-free/

Windows: Write Directly To CD-R Sectors

Are there any libraries or Windows API functions that enable writing to the sectors of a CD-R directly? I am able to read sectors from the drive using the ReadFile function provided by the Windows API but using the WriteFile function on the drive seems only to mark the disk as in-use (after executing a program in which WriteFile is used on a CD-R, I am unable to burn files onto the disk or eject it until I restart the system). When I restart the system, there is no data on the disk. Opening the disk drive for write access and calling the WriteFile function with the disk drive handle produces no system errors.
I don't know easy way, but there is a set of SCSI commands, that burning software use.
Under windows you has to get ASPI library to obtain SendASPI32Command Free one and find somewhere a description of Multi-Media Commands. Start from www.t10.org, they sell it, but working draft can be found for free.
and then start there and then look for example of MMC commands using in cdrecord sources.
It can be done but hard though.
Access to the write process is probably restricted to allow compatibility with the drag-and-drop writing that can be done in the Explorer.
You could use an alternative approach and write to an ISO image and then dump that to the CD when it is complete.

Where is data on a non-persistant Live CD stored?

When I boot up Linux Mint from a Live CD, I am able to save files to the "File System". But where are these files being saved to? Can't be the disc, since it's a CDR. I don't think it's stored in the RAM, because it can only hold so much data and isn't really intended to be used as a "hard drive". The only other option is the hard drive... but it's certainly not saving to any partition on the hard drive I know about, since none of them are mounted. Then where are my files being saved to??
Believe it or not, it's a ramdisk :)
All live distros mount a temporary hard disk in RAM memory. The process is completely user-transparent and is all because of the magic of Linux kernel.
The OS, in fact, first allocates an area of your RAM memory into a virtual device, then mounts it as a regular hard drive in your file system.
Once you reboot, you lose all your data from that ramdrive.
Ramdrive is needed by almost all software running on Live CDs. In fact, almost all programs, in particular desktop managers, are designed in order to write files, even temporary, during their execution.
As an example, there are two ways to run KDE on a Live CD: either modify its code deeply in order to disallow you to change wallpaper etc. (the desktop settings are stored inside ~/.kde) or redeploy it onto a writable file system such as a ramdrive in order to avoid write fails on read-only file systems.
Obviously, you can mount your real HDD or any USB drive into your virtual file system and make all writes to them permanent, but by default no live distro mounts your drives into the root file system, instead they usually mount into specific subdirectories like /mnt, /media, /windows
Hope to have been of help.
It does indeed emulate a disk using RAM; from Wikipedia:
It is able to run without permanent
installation by placing the files that
typically would be stored on a hard
drive into RAM, typically in a RAM
disk, though this does cut down on the
RAM available to applications.
RAM. In Linux, and indeed most unix systems, any kind of device is seen as a file system.
For example, to get memory info on linux you use cat /proc/meminfo, where cat is used to read files. Then, there's all sorts of strange stuff like /dev/random (to read random crap) and /dev/null (to throw away crap). ;-)
To make it persistent - use a USB device - properly formatted and with a special name. See here:
https://help.ubuntu.com/community/LiveCD/Persistence

Resources