Skip to content

Instantly share code, notes, and snippets.

@Traderain
Last active May 2, 2024 09:03
Show Gist options
  • Save Traderain/8e8dedeea2fabc4e5c6a3ea962940dd6 to your computer and use it in GitHub Desktop.
Save Traderain/8e8dedeea2fabc4e5c6a3ea962940dd6 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using WolvenKit.CR2W;
namespace WolvenKit
{
class Dump
{
public static void DumpRTTIClasses(string logfile)
{
HashSet<string> ClassTypes = new HashSet<string>();
foreach(var bundle in MainController.Get().BundleManager.Bundles)
{
Console.Title = ("Witcher 3: The Wild Hunt RTTI Class dumper | DUMPING [" + bundle.Key + "]");
foreach (var item in bundle.Value.Items)
{
using (var ms = new MemoryStream())
{
string tempfile = Path.GetTempFileName();
if (File.Exists(tempfile))
File.Delete(tempfile);
try
{
item.Value.Extract(tempfile);
using (var fs = new FileStream(tempfile, FileMode.Open))
{
var f = new CR2WFile(new BinaryReader(fs));
Console.WriteLine("[" + f.chunks.Count + "] chunks. File: " + item.Key);
f.chunks.ForEach(x => ClassTypes.Add(x.Type));
}
}
catch (Exception ex)
{
Console.WriteLine("[EXCEPTION] " + ex.Message);
}
if (File.Exists(tempfile))
File.Delete(tempfile);
}
}
}
File.AppendAllLines(logfile, ClassTypes);
}
}
}
@Lqkmod
Copy link

Lqkmod commented Aug 17, 2023

Hi

@coisamezing
Copy link

Hello, I need the code for the new weapons at the fair in Last Day on Earth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment