Check what is inside the file

Dear all,
I have a custom file, that is created by a X (not known) program.
I would like to “try” to read one of the files it creates.
Of course one way is to try to open it from c or java and try to see what is inside the file. For that I have to do a few retries with different data types.

Thus I was thinking if there is any program, that can facilitate this checking by reading the file with all the different ways fast.

Tell me what you think

B.R
Alex

On Sat, 30 Jul 2011 03:26:03 +0530, alaios
<alaios@no-mx.forums.opensuse.org> wrote:

>
> Dear all,
> I have a custom file, that is created by a X (not known) program.
> I would like to “try” to read one of the files it creates.
> Of course one way is to try to open it from c or java and try to see
> what is inside the file. For that I have to do a few retries with
> different data types.
>
> Thus I was thinking if there is any program, that can facilitate this
> checking by reading the file with all the different ways fast.
>
> Tell me what you think
>

why not open it with any text editor (kwrite in KDE, per example)? what
you’ll see will either make sense, i.e., the file is written in some
human-readable format, or not (binary). you can also use a hex-editor, of
course (okteta in KDE). just make sure you don’t save back any changes
unless you know what it’s all about.


phani.

Just use the “file” command


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

strings might be helpful. It displays printable strings in a file. Run it in a terminal:

strings *filename*

replacing filename with the name of the name of the custom file.

On Sat, 30 Jul 2011 04:36:03 +0530, chief sealth
<chief_sealth@no-mx.forums.opensuse.org> wrote:

> Code:
> --------------------
> strings -filename-
> --------------------

thank you; nice one i didn’t know yet.


phani.

I just learned about it these forums a couple of weeks ago. :wink:

I would normally use:


file filename

to identify the kind of data. If that isn’t useful, then the next thing to try might be:


strings filename | less

That will pick out any character strings from the file, and allow you to browse through them.

On 2011-07-29 23:56, alaios wrote:
> Thus I was thinking if there is any program, that can facilitate this
> checking by reading the file with all the different ways fast.

That’s an interesting idea. No, I don’t know of such a thing, but it would
not be difficult to write a C program for testing different possibilities,
modify the types, and try again. Tedious, though.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-07-29 23:56, alaios wrote:
> Thus I was thinking if there is any program, that can facilitate this
> checking by reading the file with all the different ways fast.

Another idea: try the programing forum here.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Once you’ve discovered a new file type, add it to your ~/.magic file. (see man file and /usr/share/misc/magic).

the tool file is such a pogram (and exists allready for ages).

That is the OP asks for something magicaly because he aks for a tool that can identify even formats that are invented today by e.g. you. As there is no magic in computers, he asks a bit to much. No tool can identify formats that e.g. you invented yesterday or will invent tomorrow and not even all the formats all sorts of people are creating all the time. And thus, like @please_try_again explains, somebody has to add a means how to identify it (preferable by some magic, yes it is called magic, but it isn’t of course) to the magic database.

Also, the OP asks for a “fast” tool. Such a thing is allways open to debate,

I agree with the above person’s view, you can try it.

Herve Leger |Herve Leger UK

On 2011-07-30 10:46, hcvv wrote:

> the tool -file- is such a pogram (and exists allready for ages).

No, ‘file’ is not such a tool. Not what I’m talking about.

“file” can only identify known, popular formats. The tool I mention is one
that guesses record types, trying, manually, to see if the first few bytes
are a long real, the second a long int, etc, till you find the exact
combination of fields that matches.

Such a tool may exist, but I don’t know it.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-07-30 11:16, Susanjackon wrote:
>
> I agree with the above person’s view, you can try it.
>
> **** Spam was here ****

That’s a web page a women dresses. Why on earth do you suggest it?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2011-07-30 05:16, please try again wrote:
>
> Once you’ve discovered a new file type, add it to your ~/.magic file.
> (see man file and /usr/share/misc/magic).

Once you discover it. That doesn’t help if it is unknown.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

You are supposed to report this as spam. Not to give any reaction on it. But it is allready removed. And I will take the liberty to remove the URLs you copied in your post, because they are also spam.

On 2011-07-30 12:56, hcvv wrote:

> You are supposed to report this as spam. Not to give any reaction on
> it. But it is allready removed. And I will take the liberty to remove
> the URLs you copied in your post, because they are also spam.

Sorry, I had no idea.

Sometimes I have suspicions, but if you remove something silently in the
web side, and I see no notice in the nntp side, I think that I’m thick and
the post is bona fide.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)


file Spectrogram001.spm 
Spectrogram001.spm: data

This does not help too much.

also od -t a
od -t b
od -t c
od -t d
od -t f
od -t o
did not return anything readable.
Might be that this type of format uses any special type of format that requires some encryption and decryption?

Best Regards
Alex

google for “.spm file”. You’ll find several possibilities of what it could be.

alaios wrote:

>
> Code:
> --------------------
>
> file Spectrogram001.spm
> Spectrogram001.spm: data
> --------------------
>
>
If that is some proprietary format you will not get very far without a
proper technical description how the file is built. Google found some hint
that .spm may be a instrument file from
SNU Precision Co., Ltd. .spm STM
http://www.nanoscience.com/products/spip/spip_formats.html
if it is something like that you need to lookup the technical docu from the
vendor.


PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
| 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram