Author Topic: TrID doesn't recognize basic Windows system files  (Read 13591 times)

FUBARinSFO

  • Newbie
  • *
  • Posts: 7
TrID doesn't recognize basic Windows system files
« on: March 08, 2008, 12:11:02 AM »
Hi again Marco:

Testing TrID against the Windows XP system files, I find that it has difficulty recognizing some pretty basic files (see below).  I realize it has a huge database of file types it recognizes, but somehow I thought it would know command.com when it saw it.

Hope this is helpful.

-- Roy Zider

3:08 PM 3/7/2008 lsz   Testing TrID against Windows XP system files
H:\SRCDSKS\-- eval\TrID

Testing TrID against basic Windows XP system files, find it
fails to recognize some very basic files.

Examples below are from C:\WINDOWS\system directory,
Windows XP SP2.
............................................................
TrID/32 - File Identifier v2.02 - (C) 2003-06 By M.Pontello
Definitions found:  3139
Analyzing...

Collecting data from file: command.com
       Unknown!

TrID/32 - File Identifier v2.02 - (C) 2003-06 By M.Pontello
Definitions found:  3139
Analyzing...

Collecting data from file: ansi.sys
100.0% (.MP3) MP3 audio (1000/1)

TrID/32 - File Identifier v2.02 - (C) 2003-06 By M.Pontello
Definitions found:  3139
Analyzing...

Collecting data from file: cmos.ram
       Unknown!

TrID/32 - File Identifier v2.02 - (C) 2003-06 By M.Pontello
Definitions found:  3139
Analyzing...

Collecting data from file: comdlg32.ocx
 55.6% (.AX) DirectShow filter (201555/2/20)
 34.0% (.OCX) Windows OCX File (123521/4/18)
  3.6% (.SCR) Windows Screen Saver (13105/51/3)
  2.9% (.EXE) Win32 Executable Generic (10527/13/4)
  2.0% (.DLL) Win32 Dynamic Link Library (generic) (7600/42/2)
............................................................

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: TrID doesn't recognize basic Windows system files
« Reply #1 on: March 08, 2008, 12:19:15 AM »
I realize it has a huge database of file types it recognizes, but somehow I thought it would know command.com when it saw it.

Quite the opposite, unfortunately. A .COM file (and related files, like the other .SYS file quoted above) is just a series of bytes that are loaded in memory and in witch the CPU jump in. Being essentially a block of machine code + eventual data, it doesn't have a recognizable structure. Probably something along the lines of a CPU emulator would be needed to properly id a generic .COM file as a .COM file (unless relying only on the extension, off course); or creating a specific def for every COMMAND.COM for every different version of DOS & Windows around.

Bye!

FUBARinSFO

  • Newbie
  • *
  • Posts: 7
Re: TrID doesn't recognize basic Windows system files
« Reply #2 on: March 08, 2008, 02:28:43 AM »
Marc0:

At the risk of being contradicted, since it's been a while since I've written any assembly language code, my recollection is that all .com files start with a jmp instruction.  Just like the 'MZ' at the beginning of an exe, a .com file (generally, again) has this jmp instruction.  command.com starts off with E9 5D.  Others have an .exe signature: format.com with 'MZ', diskcopy.com with 'MZ', diskcopy with 'MZ'.  I havent checked the all the rest, but it does seem to me that checking these first two bytes is somewhat preferable to "unknown" -- even if you just pick up the 'MZ' signature.

Hope this is helpful.

-- Roy Zider

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: TrID doesn't recognize basic Windows system files
« Reply #3 on: March 08, 2008, 02:50:36 AM »
At the risk of being contradicted, since it's been a while since I've written any assembly language code, my recollection is that all .com files start with a jmp instruction.

That's true for most, but not all. Just look at LOADFIX.COM, for example.
Just a 1 byte pattern at the start = E9 will probably work for many .COM, but may cause a number of false positive too, probably. I had done some testing in the first days of TrID about this filetype, and end up choosing to not provide a generic defs for some .COM files. But you can create & use one, off course.

Quote
Others have an .exe signature: format.com with 'MZ', diskcopy.com with 'MZ', diskcopy with 'MZ'.  I havent checked the all the rest, but it does seem to me that checking these first two bytes is somewhat preferable to "unknown" -- even if you just pick up the 'MZ' signature.
Those file will in fact recognized as the EXE files they are ("Generic Win/DOS executable", or some as DLL since they share so much in common).

But since TrID has no hardcoded rules or special detection code, obviously trhere can be better identifier software for some category of files. Text based files (like sources code) are a category that is especially not well suited for TrID. Executables, while there are many that can be more or less identified, are probably another. PEiD for example is a very good id program for executables.

It also mean that you are free to experiment creating new defs, as you see fit for your particular needs.

Bye!

FUBARinSFO

  • Newbie
  • *
  • Posts: 7
Re: TrID doesn't recognize basic Windows system files
« Reply #4 on: March 08, 2008, 03:27:19 AM »
Thank you again for your timely and thoughtful reply.