Editing PC3, CTB, STB and PMP


This is a seed…

Situation: Large organization where administrators need to create several PC3 files per PC and per profile because users can switch from PC to PC. For some reason just sharing the same PC3 file does not work. Oh boy, that is a frustrating job! Let’s try to solve it…

Introduction

What we want is a more automated way to create PC3 files.

Why are PC3, CTB, STB and PMP also mentioned in the title? Because they all share the same “encoding”. The quotes? Well, it is actually a compressed ASCII file, compressed with an ancient, but widely used and far from obsolete legacy algorithm.

Zlib

Zlib is the core of the file format. More on Wikipedia…

A compressed file has a readable header (and footer). This is a nice post to get an impression of how it works: https://unix.stackexchange.com/questions/22834/how-to-uncompress-zlib-data-in-unix.

unzip_pc3

There is a utility that does compression and decompression for you. It is very easy to use and you can find it here: https://github.com/avbrakel/unzip_pc3.

In the situation given above it is tempting to decompress PC3 files and compare them, study them, in order to find out why a general PC3 file does not work.

Usage in a dos terminal:

unzip_pc3.exe -e Name.pc3

The result is a file named “Name.txt”.

Notes

TLDR

In depth…

RFC

From:
$ man zlib

The data format used by the zlib library is described by RFC (Request for Comments) 1950 to 1952 in the files:
http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer format)
http://tools.ietf.org/html/rfc1951 (for the deflate compressed data format)
http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer format)

From “man zlib”, 1966

Leave a Reply

Your email address will not be published. Required fields are marked *