A simple Cyberpunk 2077 archive extractor.

See cyberpunk2077-archive-format.txt for details on the file format.

Thanks to the ZenHAX forums which I only just discovered while searching for some hints on the compression algorithm. There's a Cyberpunk 2077 post running over there which will probably eventually cover this stuff in much more detail by people much smarter and more qualified than me:

Compression Signatures:      https://zenhax.com/viewtopic.php?t=27
Oodle Function Declarations: https://zenhax.com/viewtopic.php?t=7292
Cyberpunk 2077 Archives:     https://zenhax.com/viewtopic.php?f=9&t=14565

If you're interested in this kind of stuff and haven't heard of ZenHAX, head on over - there's lots of good stuff there!

Source Code

Although this project is extremely niche, the code here is written like a library to hopefully make it useful in case I want to later build a proper program(s) for working with Cyberpunk 2077 files later on down the track (not just archives, but also save games, textures, audio, etc.) Let me know if you have any suggestions or feature requests and I'll consider it.

The code is public domain. I encourage you to do whatever you like with it! Just make sure you don't go around redistributing any of the extracted assets.

To compile the code, make sure you first recursively clone this repository so that sub-module dependencies are included. Then just compile cyberfm.c for the extraction program, or libcyberfm.c if you're only after the library part.

Extractor

At the moment the extractor is just a simple command line tool. Specify the archive you want to extract and include "--extract" on the command line, with an optional output directory.

cyberfm "inputfile.archive" -o "outputdir" --extract

The "--extract" switch is necessary (it feels like it should be necessary, I know - I'll clean that up later).

I've only done very limited testing, but I was able to extract all of the archives that come with the game so it should be mostly working. Submit a bug report if you encounter any problems.


This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/