Giter Site home page Giter Site logo

cp77tools's Introduction

CP77Tools

MIT license Discord CodeFactor GitHub all releases GitHub release (latest by date) GitHub release (latest by date including pre-releases)


❗ This repository is archived.

❗ It will be maintained here: https://github.com/WolvenKit/Wolvenkit


Modding tools for the CDPR Cyberpunk 2077 video game.

Latest Stable Release

GitHub release (latest by date) https://github.com/WolvenKit/CP77Tools/releases

Latest Beta Release

GitHub release (latest by date including pre-releases) https://github.com/WolvenKit/CP77Tools/releases


requires NET5.0. (if you don't have it: https://dotnet.microsoft.com/download/dotnet/5.0)

The cp77 tools require oo2ext_7_win64.dll to work. Copy and paste the dll found here Cyberpunk 2077\bin\x64\oo2ext_7_win64.dll into the cp77Tools folder.

If you are building from source, the dll needs to be in the same folder as the build .exe, e.g. C:\cpmod\CP77Tools\CP77Tools\bin\Debug\net5.0\oo2ext_7_win64.dll


Check the wiki for guides and how to use this tool: https://github.com/WolvenKit/CP77Tools/wiki

Usage:

Surround paths with quotation marks (if the path contains spaces: e.g. archive -e -p "C:\Cyberpunk 2077\modding")

  • displays the general help: list all commands --help

  • displays help for a specific command, e.g. archive -h

Main functions

  • extract all files from archive unbundle -p "PATH TO ARCHIVE"

  • extract all textures from archive (supports conversion to tga, bmp, jpg, png, dds) uncook --uext png -p "PATH TO ARCHIVE"

  • rebuild textures and buffers (this step is needed when packing textures!, see the wiki for how to use this command) rebuild -p "PATH TO FOLDER" -b -t --keep --unsaferaw

  • pack a folder into an .archive (see the wiki for how to use this command) pack -p "PATH TO FOLDER"

Debug Options

  • dumps property info from extracted cr2w file cr2w -c -p "<PATH TO FILE>"

cp77tools's People

Contributors

aaronmshoemaker avatar avail avatar emcifuntik avatar eprilx avatar maxzor avatar offline-r503b avatar phrisk avatar rfuzzo avatar thefusion21 avatar waitxd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cp77tools's Issues

Could not convert most textures

Using archive -u --uext png -p "FILEPATH.arcive" results in only a few textures being converted, while most of them return a red error message [Error] Could not convert.

Any ideas on what causes this? Is something wrong with the conversion tool?

about dds

thank you

The picture needs to be flipped vertically
This function should be added to the script

:)

Extract soundfiles

I'm trying to extract the dialogue sound files from the localized archive...But when I finished the extraction, what should I do for next step?

thanks,

Filenames

Hi there. Here my project file with filenames (Multi-Language). Current state 1307466 (Only unique entries).

Download: Here

audio_1_general.archive -> 4363 of 4376 (99%)
audio_2_soundbanks.archive -> 2427 of 2751 (88%)
basegame_1_engine.archive -> 1541 of 1840 (83%)
basegame_2_mainmenu.archive -> 68 of 68 (100%)
basegame_3_nightcity.archive -> 122248 of 122502 (99%)
basegame_3_nightcity_gi.archive -> 22792 of 22792 (100%)
basegame_3_nightcity_terrain.archive -> 21257 of 21257 (100%)
basegame_4_animation.archive -> 4645 of 5221 (88%)
basegame_4_appearance.archive -> 1001 of 4597 (21%)
basegame_4_gamedata.archive -> 76536 of 120287 (63%)
basegame_5_video.archive -> 429 of 546 (78%)
lang_ar_text.archive -> 3222 of 3222 (100%)
lang_cs_text.archive -> 3222 of 3222 (100%)
lang_de_text.archive -> 3222 of 3222 (100%)
lang_de_voice.archive -> 90274 of 90769 (99%)
lang_en_text.archive -> 3222 of 3222 (100%)
lang_en_voice.archive -> 92544 of 92593 (99%)
lang_es-es_text.archive -> 3222 of 3222 (100%)
lang_es-es_voice.archive -> 90418 of 91784 (98%)
lang_es-mx_text.archive -> 3222 of 3222 (100%)
lang_fr_text.archive -> 3222 of 3222 (100%)
lang_fr_voice.archive -> 91858 of 91877 (99%)
lang_hu_text.archive -> 3222 of 3222 (100%)
lang_it_text.archive -> 3222 of 3222 (100%)
lang_it_voice.archive -> 90332 of 91461 (98%)
lang_ja_text.archive -> 3222 of 3222 (100%)
lang_ja_voice.archive -> 87807 of 87893 (99%)
lang_ko_text.archive -> 3222 of 3222 (100%)
lang_ko_voice.archive -> 87075 of 87382 (99%)
lang_pl_text.archive -> 3222 of 3222 (100%)
lang_pl_voice.archive -> 89417 of 91498 (97%)
lang_pt_text.archive -> 3222 of 3222 (100%)
lang_pt_voice.archive -> 90548 of 92141 (98%)
lang_ru_text.archive -> 3222 of 3222 (100%)
lang_ru_voice.archive -> 91923 of 91945 (99%)
lang_th_text.archive -> 3222 of 3222 (100%)
lang_tr_text.archive -> 3222 of 3222 (100%)
lang_zh-cn_text.archive -> 3222 of 3222 (100%)
lang_zh-cn_voice.archive -> 90371 of 90602 (99%)
lang_zh-tw_text.archive -> 3222 of 3222 (100%)

Have fun :)

onscreens.json file import issues

hello im trying to change onscreens.json file... but tool did not replace that... what should i do?

i try this [CP77Tools.exe dump -i -p "...\Cyberpunk 2077\archive\pc\content\lang_ko_text.archive"]
someting worng?

Link to Builds and Build Instructions

I think it would be a good idea to 1.) Either link to the Nexusmods page or simply upload builds here as well and 2.) Include build instructions.

I actually didn't see that a build was available on Nexusmods so I ended up building it myself using the .NET 5.0 SDK, dotnet build --configuration Release inside the folder with the .sln seems to work just fine.

Edit: Never mind, builds are found under Actions: https://github.com/WolvenKit/CP77Tools/actions Would still be a good idea to have a prominent link to it, it's not exactly apparent where they are.

cr2w options: -a is excluding array data

Reproduceable behavior, examples linked to pastebin.

{cr2w -a -p "/path/to/file"} excludes content from {cr2w -c -p "/path/to/file"}. In the examples I've seen and can reproduce, -a is excluding array value data that -c displays. I've tried to investigate the options here on the Git page and am unsure as to whether this is by intent or not. If this is working as intended please disregard. Additionally, I do not see an option with cr2w or pack to update a target with modified (cr2w extracted) chunk data. If this feature is present please point me in the right direction.

Target: \basegame_1_engine\base\gameplay\gui\fullscreen\main_menu\ui_character_presets\ui_preset_female_corpo.charcustpreset

-a result: https://pastebin.com/tFP5NdBm
-c result: https://pastebin.com/LUaifXzv

Shell programmer by trade here, you've done some amazing work. Thank you.

future tools

Hello everyone, I'm familiar with modding witcher 3 and he's a terrible, very bad modding.
Hope you make powerful tools in a year's time so we can compete with the mods of their gta and fallout.
How's the work going now? How many people work every day? What are you doing at the moment, what do you plan to do next year?

I don't remember telling the developers that they'd release official tools if they weren't, what are you going to do? Will we get the same limited tools as in witcher 3?

I love adding something of my own to the game and I have a couple of questions, maybe you yes

When presumably we will be able to add our items, weapons, objects, whole cards from other games or made with our own hands. Clothing, tattoo, npc.

Whether you're going to make your own multiplayer, maybe there are people on your team who will be doing it in a year or two.

I really like to upgrade the weapon, I've played a lot of one game escape from tarkov, do you think, whether I can in the future, make such a great mod, we can replace a lot of parts with weapons.
Also, the customization of the character, whether we can add more and more areas of bodies, for example, to customize the legs, hands, etc.

So, what about adding your animations? Are you working happy about it? Is there progress?

And, for example, can we make transport better when you shoot into the water so that there are splashes of water, a more realistic car system, damage to the car, and so on.

I'm very interested in watching this, I hope you make some cool tools.

Good luck.

Data lost during uncook or rebuild/pack

Process to the issue

  1. Uncook a random cloth from \basegame_4_gamedata
  2. Get a mesh file of 592 KB, a 0.buffer of 33KB and a 1.buffer of 2419 KB
  3. Rebuild and pack these (archive size = 572 KB)

From here the archive is working properly.

But now:

  1. Take the generated archive and uncook it again
  2. Get a mesh file of 592 KB, a 0.buffer of 3 KB and a 1.buffer of 556 KB
  3. Rebuild and pack these (archive size = 556 KB)

The archive is not working (game craches).

Both buffers a lot of data, making them not reusable:
2021-01-26 04_20_12-h1_064_specs__sunglasses

Command used to rebuild: rebuild -p <path_to_folder> -t -b --keep --unsaferaw
Version of CP77Tools used: v.1.1.0.2

Consider move to monorepo

Recently big portion of source code was moved to WolvenKit/Wolven-kit project. Those code is consumed via nuget packages.
However, API-layout is in early stage and not finished yet.
I'd like to push some perfomance-related PR's that require change of API: for example, use streams for file extraction instead of byte arrays (do not load whole uncompressed 750mb file in memory) or add new compression types instead of Kraken only.
That's require PRs in different repository with different timeline (one have to publish nuget first to consume it here).
And it seems that nuget-packages are not even built from master branch.

I see following options:

  • Move completely to WolvenKit/Wolven-kit as their main cli (probably with name change to something like WolvenKit.CLI)
  • Move back WolvenKit.Cyberformats at least until API stabilizes.
  • I am missing something :)

Fix repacking

Repacking currently only works on (some) files with no buffers. What needs to be done:

  • Figure out how the SHA1 hash in Table1 of an archive is calculated for buffered files. For files with no buffers, it is SHA1 over the uncompressed file. For files with buffers, it is currently unknown. Code link:

    var sha1hash = sha1.ComputeHash(Catel.IO.StreamExtensions.ToByteArray(cr2wbr.BaseStream)); //TODO: this is only correct for files with no buffer

  • Files with buffers consist of a cr2w main file (e.g. .xbm) and one or more .buffer files. The main cr2w file has a table (table 3, or Buffer table) with references to the buffer files inside, complete with size and zsize of the buffer as well as offset. When packing (or editing the cr2w file) the buffer table has to be adjusted, as well as the crc of the cr2w file in its header.

    public struct CR2WBuffer

Repacking skips bk2 files]

My dreams of a no intro movies mod came to a crashing halt when packing skipped all the bk2 files from basegame_5_video.archive :(

[Error][12/23/2020 4:43:38 AM] Failed to read cr2w file F:\CPPTool\basegame_5_video\base\movies\fullscreen\common\cyberpunk2077_game_intro.bk2

Looking for the cr2w header instead of KB2j on this file type?

ConsoleProgressBar bugged when using CP77Tools with custom console settings

I have custom console properties set up to make the buffer much longer, this is seemingly breaking CP77Tools via ConsoleProgressBar trying to do something stupid.

Cyberpunk 2077\archive\pc\content>dotnet "CP77Tools\bin\Release\net5.0\CP77Tools.dll" archive -e -p basegame_1_engine.archive -o basegame_1_engine
Loading Hashes...
Loaded Hashes.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 9001.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at ConsoleProgressBar.SystemConsole.SetCursorPosition(Int32 left, Int32 top)
   at ConsoleProgressBar.ProgressBar.Dispose(Boolean disposing)
   at ConsoleProgressBar.ProgressBar.Dispose()
   at CP77Tools.Model.Archive.ExtractAll(DirectoryInfo outDir) in CP77Tools\Model\Archive.cs:line 278
   at CP77Tools.ConsoleFunctions.ArchiveTask(String path, String outpath, Boolean extract, Boolean dump, Boolean list, Boolean uncook, EUncookExtension uext, UInt64 hash) in CP77Tools\ArchiveTask.cs:line 87

Untitled

Some info

somebool doesn't look like bool, I think it's kind of flag
And you also need to use Zsize for unpacking. I think in your case Zsize = DiskSize and Size = RamSize (unpacked), becase as I see, most of game files have KARK header, I think it's some kind of compression, maybe LZMA based. If you want to cooperate contact me on discord Tuxick#0282

About Oodle compression

For oodle version 6 or higher, the paramters of compress function should be
OodleLZ_Compress(OodleFormat format, byte[] buffer, long bufferSize, byte[] outputBuffer, OodleCompressionLevel level, uint unused1, uint unused2, uint unused3, uint unused4, uint unused5)
Btw, this game use format 8 (Kraken) and level 9 (maximum).

Archive -e -p

I cannot find archive -e -p (location of your basegame_4_gamedata.archive file)” anywhere

about json 。Dialogue text

Unpack this file。lang_en_text.archive
Get a lot of JSON files
Open these json files
The dialog is displayed normally.
Code not displayed
2020-12-31_174651

How to decrypt it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.