Identify if a file is packed or not

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Axxy
Junior Member
Junior Member
Posts: 17
Joined: 2004-09-14, 15:57 UTC
Location: UK

Identify if a file is packed or not

Post by *Axxy »

Hi

Is there a plugin that can identify if a file is packed or not?

I'm not interested in identifying what type of file it is or it's contents, just if it is packed or not and what packer it is if possible.

Scenario:

Folder contains 1000 text files. Prefix is .txt for all files, but some may be packed, majority aren't. I'd like to identify those packed ones. Probably no exotic packer used, i.e. zip/pk, rar, arj etc. Just be quicker to find the packed files and unpack in a TC window.
User avatar
vdijken
Member
Member
Posts: 181
Joined: 2016-07-30, 14:07 UTC
Location: The Netherlands

Re: Identify if a file is packed or not

Post by *vdijken »

This makes no sense. With F3 you can see if whether is a text file (or not). Files are recognized by their extensions like .zip or .rar. When someone makes a blooper by giving them the extension .txt TC is not there to solve this problem. Besides you cannot be sure that an packer is used, e.g. an executable is also unreadable.
Axxy
Junior Member
Junior Member
Posts: 17
Joined: 2004-09-14, 15:57 UTC
Location: UK

Re: Identify if a file is packed or not

Post by *Axxy »

vdijken wrote: 2022-07-20, 13:58 UTC This makes no sense. With F3 you can see if whether is a text file (or not). Files are recognized by their extensions like .zip or .rar. When someone makes a blooper by giving them the extension .txt TC is not there to solve this problem. Besides you cannot be sure that an packer is used, e.g. an executable is also unreadable.
So Press F3 on a 1000 files to see if it's packed or not?

The first 2 or 3 bytes will tell what packer was used, RaR, PK, ARJ etc. This was something I just discovered, that some files were packed, I just wanted to identify those files, with a plugin (if there was one) and not TC per se. Yes I can be sure a packer was used because the first 2 or 3 bytes tell me so. Everything is a data file not an executable. Some of these files are from retro machines like the Amiga, so this was the norm back in the day for files to be packed like this. Mostly the files I've seen so far were PKzip type. I can't search for the string PK because the files could contain lots a references to PK in them.
User avatar
petermad
Power Member
Power Member
Posts: 14792
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Identify if a file is packed or not

Post by *petermad »

2Axxy
To find zip-compressed file you can do the following

Open the Find files dialog
Activate the "Find text" field and write: ^PK
Check the "Case sensitive" boks.
Check the" RegEx (2)" boks.
Start the search - it should find all files that has PK as the first two characters - as zip-compressed files does.

To Search for rar-files use: ^Rar
To Search for 7z-files use: ^7z
To Search for cab-files use: ^MSCF

It is NOT fool proof - but should help if the other non packed files are genuine text files
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Axxy
Junior Member
Junior Member
Posts: 17
Joined: 2004-09-14, 15:57 UTC
Location: UK

Re: Identify if a file is packed or not

Post by *Axxy »

petermad wrote: 2022-07-20, 15:08 UTC 2Axxy
To find zip-compressed file you can do the following

Open the Find files dialog
Activate the "Find text" field and write: ^PK
Check the "Case sensitive" boks.
Check the" RegEx (2)" boks.
Start the search - it should find all files that has PK as the first two characters - as zip-compressed files does.

To Search for rar-files use: ^Rar
To Search for 7z-files use: ^7z
To Search for cab-files use: ^MSCF

It is NOT fool proof - but should help if the other non packed files are genuine text files
Hi

As you say, not fool proof but much closer in the number of hits (or lack of) than I was getting making it easier to check. Thanks a lot, appreciated..
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Identify if a file is packed or not

Post by *Hacker »

Axxy,
The TrID_Identifier plugin is very useful to identify various file types.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
petermad
Power Member
Power Member
Posts: 14792
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Identify if a file is packed or not

Post by *petermad »

With the plugin encinfo: http://totalcmd.net/plugring/EncInfo.html you can search for binary or text files.

https://madsenworld.dk/tcmd/encinfosearch.png
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Identify if a file is packed or not

Post by *Horst.Epp »

Hacker wrote: 2022-07-20, 16:55 UTC Axxy,
The TrID_Identifier plugin is very useful to identify various file types.

HTH
Roman
This plugin gives me no results.
The trid tool and its library are installed in the plugins dir as requested
and work from a command line.
A custom columns view with all available fields only shows "-"
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Identify if a file is packed or not

Post by *Gral »

Utility and definitions should be in "TrID" subdirectory of the plugin.

Anyway this plugin is sometimes very slow - especially for large files.
For quick identification i mostly use DecHex plugin - https://totalcmd.net/plugring/decHex.html
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Identify if a file is packed or not

Post by *Horst.Epp »

Gral wrote: 2022-07-20, 18:00 UTC Utility and definitions should be in "TrID" subdirectory of the plugin.

Anyway this plugin is sometimes very slow - especially for large files.
For quick identification i mostly use DecHex plugin - https://totalcmd.net/plugring/decHex.html
Thanks for the tip, it works now.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: Identify if a file is packed or not

Post by *solid »

EncInfo that @petermad mentioned is most suited to what OP is asking. It can easily identify binary files, either by searching for those or as custom column info that can be sorted upon.

Afterwards, for manual identifying type of binary file, plugin Textline can be used. It displays the first line of the file in the custom column.
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Identify if a file is packed or not

Post by *Gral »

Use WDX part of Total7zip packer plugin - can identify most popular packed files regardless of extension.
http://totalcmd.net/plugring/total7zip.html
(manual installation needed)
User avatar
petermad
Power Member
Power Member
Posts: 14792
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Identify if a file is packed or not

Post by *petermad »

Gral wrote: 2022-07-22, 15:28 UTC Use WDX part of Total7zip packer plugin - can identify most popular packed files regardless of extension.
http://totalcmd.net/plugring/total7zip.html
(manual installation needed)
Works fine: https://madsenworld.dk/tcmd/archivetypecustcol.png

You have to manually add something like this to the [ContentPlugins] section of your ini file:

Code: Select all

xx=%COMMANDER_PATH%\PLUGINS\wcx\Total7zip\Total7zip.wcx
Rreplace xx with the next free numer in that section.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Identify if a file is packed or not

Post by *Gral »

petermad wrote: 2022-07-22, 20:22 UTC
You have to manually add something like this to the [ContentPlugins] section of your ini file:

Code: Select all

xx=%COMMANDER_PATH%\PLUGINS\wcx\Total7zip\Total7zip.wcx
Rreplace xx with the next free numer in that section.
Or just copy Total7zip.wcx to Total7zip.wdx to make it visible in TC intall content plugins windows.
Post Reply