9

I've been hit lately by a virus. This virus has randomly renamed alot of files in my computer like videos images and contacts and it made those files without an extension. I've managed to recover some photos with the help of an SO renaming batch file answer. Some files I can not recognize either they're videos or images and couldn't know their formats either. Any help to Detect those files format ? if there's a solution non programatically would be appreciated much.

2
  • This is unlikely to be possible with a non-programming solution. – Ramhound Feb 28 '13 at 17:48
  • 4
    After you've got this sorted with one of the solutions below, go and buy an external hard drive and set up some regular backups. – PhonicUK Mar 1 '13 at 9:47
13

TrID may help you identify those files.

  1. Download the program and definitions.
  2. Place them in some directory.
  3. Add that directory to the PATH:
    • Press Win+R,
    • Type systempropertiesadvanced, click OK,
    • Click Environment variables... button and look for PATH in the lower box,
    • Add a semicolon and TrID's directory.
  4. You're now able to run TrID by typing trid in the command line. Examples are available on the program's site.
2
  • 2
    They also provide TrID.NET which gives a GUI interface to the program. – Scott Chamberlain Feb 28 '13 at 18:35
  • 4
    TrID has a really interesting command line option for the OP: the switch -ce renames the files given with the guessed extension. – mpy Feb 28 '13 at 19:07
8

Some files have their type defined in their innards (it's called a magic number). For example, all windows applications and possibly all DLLs have first two bytes MZ. So sometimes you need to look in HEX editor to tell what is what. Example:

Here is the example

If you can, go download shareware Total Commander, place cursor over any file and hit F3 (View).

But sometimes even that won't help, especially with custom file formats some company might produce, but I hope this helps you a bit.

1
5

You can install kind of a un*x layer via the cygwin environment, and then use the file utility (included in package base), which checks the magic number of a file and can also give some additional informations:

$ file *
img234.png:         PNG image data, 834 x 354, 8-bit/color RGB, non-interlaced
folder:             directory
animation.flv:      Macromedia Flash Video
charmap.pdf:        PDF document, version 1.4
charmap.tex:        LaTeX 2e document, ASCII text
song.mp3:           MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
dvd.iso:            # UDF filesystem data (version 1.5) 'HOLIDAY_SLIDESHOW              '

Indeed, cygwin is rather a over-motorized solution (minimal installation around 20MB) just to run one command, but then you also have a sophisticated CLI... one of the things I miss the most in Windows.

1
  • Or you could just boot with a live cd/dvd distro like Mint or Ubuntu or... and rename the files, or get a listing of them all with the file output and boot back into Windows when you are done. – ivanivan Apr 4 '17 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.