Identifying File Types with the file Command

  • Thread starter Thread starter messiah166
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 1K views
messiah166
Messages
1
Reaction score
0
Are these octave files? I have a program that ends in .oct that I am trying to reverse engineer, but I have no experience with .oct at all. If so, would MATLAB be the program to use to read the program?
 
Physics news on Phys.org
I don't think anyone can divine this based on the information. If you can't figure out to how open it I doubt you're going to have much success trying to reverse engineer whatever it is.

Try it in MATLAB and see what happens.
 
First of all - try to open it with a notepad. If it is a program file, chances are it is just a text file with a different extension. If it is a binary file - notepad will just refuse to read it.
 
Also, most variants of UNIX, particularly Linux, have the file command, with broad capabilities to identify files based on what is in them. Not by extension.
Try the file command
Code:
file  [your filename goes here]
It will tell you if it is an octave file. Many proprietary files, especially for opensource programs, have "magic" at the beginning of the file ex:
Code:
#!/bin/bash
so the extension (in the example it could be: .sh, .shl, .bash) does not really matter, except to humans. The OS or the program knows to pretty much ignore the extension and check "magic" first.

It can usually identify source code file for common languages.

Solaris and its descendants have a magic.h file to implement this for example.
 
  • Like
Likes   Reactions: Borek and jedishrfu