This is simply a partial repost of :
How to Extract the Contents of Cisco COP Files
at https://ipcommute.co.uk/technical-articles/19--how-to-extract-the-contents-cisco-cop-files.html
All credit goes to Aaron Harrison : Development Engineer at IPCommute UK
I found it so useful today I wanted to make sure Aaron's post lives on. Thanks Aaron!
Cisco Option files (COP Files) are released for Cisco Unified Communications Manager (CUCM) to add new functionality, fixes, and other optional components such as locales or phone firmware.
Each COP file is essentially an archive of files - some are copied to the CUCM server, some are used as data to import to the database, others might be scripts.
Occasionally it might be useful to be able to look at the files that make up a COP file. This has been most useful for me when working with National Dial Plans (NDP); these aren't as well documented as they might be, and I find it useful to look into the files and see exactly what each of the clauses in the NDP actually mean in terms of dialled numbers.
So - here is how to do it.
The COP file is basically a gzip, with an encryption header that makes it unrecognisable to archive packages such as 7-ZIP. You'll need two pieces of software:
- A hex editor. I use HxD, which is free (https://www.google.com/search?q=hxd)
- A file archiver. I use 7-ZIP, which is also free (https://www.google.com/search?q=7-zip)
Once you have downloaded and installed these, grab your COP file of choice. I'll use a Dial Plan from the UK (dp-ffr.3-1-18.GB.cop.sgn).
Run HXD, and open the .cop.sgn file. You'll be presented with a screen that looks like this:
Note above that I’ve highlighted in red the name of the file. Where you see this, highlight it with the mouse, and you should see the hex pattern ‘1F 8B 08’ just after it. This is a Magic Number that marks the start of a GZip file (see http://en.wikipedia.org/wiki/Magic_number_(programming) for more information on Magic Numbers).
What we need to do is highlight everything before that Magic Number, and remove it. Highlight is so that it looks like the following picture, and then click the Edit/Cut menu option. Accept the file size warning.
Once removed, your file should start with the hex values 1F 8B 08. Click the File/Save As menu option and save the file with an additional .gz on the end – e.g. dp-ffr.3-1-18.GB.cop.sgn.gz
Now you can run 7-ZIP, and open the dp-ffr.3-1-18.GB.cop.sgn.gz file.