├── .gitignore
├── App.xaml
├── App.xaml.cs
├── Assets
├── arrow-left-dark.png
├── arrow-left.png
├── arrow-right-dark.png
├── arrow-right.png
├── file.png
├── folder.png
├── font.png
├── grid.png
├── image.png
├── list.png
├── lua.png
└── video.png
├── DieselBundleViewer.csproj
├── DieselBundleViewer.sln
├── LICENSE
├── Models
├── FileEntry.cs
├── FolderEntry.cs
├── IEntry.cs
└── Script.cs
├── Objects
├── PageData.cs
└── VirtualFileDataObject.cs
├── README.md
├── Services
├── Definitions.cs
├── DragDropController.cs
├── FileManager.cs
├── FixListView.cs
├── FormatConverter.cs
├── HashlistUpdater.cs
├── JSONNode.cs
├── ScriptActions.cs
├── Settings.cs
└── Utils.cs
├── ViewModels
├── AboutDialogViewModel.cs
├── BundleSelectorDialogViewModel.cs
├── ConvertFileDialogViewModel.cs
├── DialogBase.cs
├── EntryViewModel.cs
├── FindDialogViewModel.cs
├── MainWindowViewModel.cs
├── ProgressDialogViewModel.cs
├── PropertiesViewModel.cs
├── SettingsDialogViewModel.cs
├── TreeEntryViewModel.cs
└── UpdateHashlistDialogViewModel.cs
├── Views
├── AboutDialog.xaml
├── AboutDialog.xaml.cs
├── BundleSelectorDialog.xaml
├── BundleSelectorDialog.xaml.cs
├── ConvertFileDialog.xaml
├── ConvertFileDialog.xaml.cs
├── DialogWindow.xaml
├── DialogWindow.xaml.cs
├── EntryGridView.xaml
├── EntryGridView.xaml.cs
├── EntryListView.xaml
├── EntryListView.xaml.cs
├── FindDialog.xaml
├── FindDialog.xaml.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── ProgressDialog.xaml
├── ProgressDialog.xaml.cs
├── PropertiesDialog.xaml
├── PropertiesDialog.xaml.cs
├── SettingsDialog.xaml
├── SettingsDialog.xaml.cs
├── SmallStuff.xaml
├── TreeEntry.xaml
├── TreeEntry.xaml.cs
├── UpdateHashlistDialog.xaml
├── UpdateHashlistDialog.xaml.cs
└── VirtualizingWrapPanel.cs
├── dlls
├── DieselEngineFormats.dll
└── Wwise Sound Library.dll
└── favicon.ico
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.vspscc
94 | *.vssscc
95 | .builds
96 | *.pidb
97 | *.svclog
98 | *.scc
99 |
100 | # Chutzpah Test files
101 | _Chutzpah*
102 |
103 | # Visual C++ cache files
104 | ipch/
105 | *.aps
106 | *.ncb
107 | *.opendb
108 | *.opensdf
109 | *.sdf
110 | *.cachefile
111 | *.VC.db
112 | *.VC.VC.opendb
113 |
114 | # Visual Studio profiler
115 | *.psess
116 | *.vsp
117 | *.vspx
118 | *.sap
119 |
120 | # Visual Studio Trace Files
121 | *.e2e
122 |
123 | # TFS 2012 Local Workspace
124 | $tf/
125 |
126 | # Guidance Automation Toolkit
127 | *.gpState
128 |
129 | # ReSharper is a .NET coding add-in
130 | _ReSharper*/
131 | *.[Rr]e[Ss]harper
132 | *.DotSettings.user
133 |
134 | # TeamCity is a build add-in
135 | _TeamCity*
136 |
137 | # DotCover is a Code Coverage Tool
138 | *.dotCover
139 |
140 | # AxoCover is a Code Coverage Tool
141 | .axoCover/*
142 | !.axoCover/settings.json
143 |
144 | # Coverlet is a free, cross platform Code Coverage Tool
145 | coverage*[.json, .xml, .info]
146 |
147 | # Visual Studio code coverage results
148 | *.coverage
149 | *.coveragexml
150 |
151 | # NCrunch
152 | _NCrunch_*
153 | .*crunch*.local.xml
154 | nCrunchTemp_*
155 |
156 | # MightyMoose
157 | *.mm.*
158 | AutoTest.Net/
159 |
160 | # Web workbench (sass)
161 | .sass-cache/
162 |
163 | # Installshield output folder
164 | [Ee]xpress/
165 |
166 | # DocProject is a documentation generator add-in
167 | DocProject/buildhelp/
168 | DocProject/Help/*.HxT
169 | DocProject/Help/*.HxC
170 | DocProject/Help/*.hhc
171 | DocProject/Help/*.hhk
172 | DocProject/Help/*.hhp
173 | DocProject/Help/Html2
174 | DocProject/Help/html
175 |
176 | # Click-Once directory
177 | publish/
178 |
179 | # Publish Web Output
180 | *.[Pp]ublish.xml
181 | *.azurePubxml
182 | # Note: Comment the next line if you want to checkin your web deploy settings,
183 | # but database connection strings (with potential passwords) will be unencrypted
184 | *.pubxml
185 | *.publishproj
186 |
187 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
188 | # checkin your Azure Web App publish settings, but sensitive information contained
189 | # in these scripts will be unencrypted
190 | PublishScripts/
191 |
192 | # NuGet Packages
193 | *.nupkg
194 | # NuGet Symbol Packages
195 | *.snupkg
196 | # The packages folder can be ignored because of Package Restore
197 | **/[Pp]ackages/*
198 | # except build/, which is used as an MSBuild target.
199 | !**/[Pp]ackages/build/
200 | # Uncomment if necessary however generally it will be regenerated when needed
201 | #!**/[Pp]ackages/repositories.config
202 | # NuGet v3's project.json files produces more ignorable files
203 | *.nuget.props
204 | *.nuget.targets
205 |
206 | # Microsoft Azure Build Output
207 | csx/
208 | *.build.csdef
209 |
210 | # Microsoft Azure Emulator
211 | ecf/
212 | rcf/
213 |
214 | # Windows Store app package directories and files
215 | AppPackages/
216 | BundleArtifacts/
217 | Package.StoreAssociation.xml
218 | _pkginfo.txt
219 | *.appx
220 | *.appxbundle
221 | *.appxupload
222 |
223 | # Visual Studio cache files
224 | # files ending in .cache can be ignored
225 | *.[Cc]ache
226 | # but keep track of directories ending in .cache
227 | !?*.[Cc]ache/
228 |
229 | # Others
230 | ClientBin/
231 | ~$*
232 | *~
233 | *.dbmdl
234 | *.dbproj.schemaview
235 | *.jfm
236 | *.pfx
237 | *.publishsettings
238 | orleans.codegen.cs
239 |
240 | # Including strong name files can present a security risk
241 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
242 | #*.snk
243 |
244 | # Since there are multiple workflows, uncomment next line to ignore bower_components
245 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
246 | #bower_components/
247 |
248 | # RIA/Silverlight projects
249 | Generated_Code/
250 |
251 | # Backup & report files from converting an old project file
252 | # to a newer Visual Studio version. Backup files are not needed,
253 | # because we have git ;-)
254 | _UpgradeReport_Files/
255 | Backup*/
256 | UpgradeLog*.XML
257 | UpgradeLog*.htm
258 | ServiceFabricBackup/
259 | *.rptproj.bak
260 |
261 | # SQL Server files
262 | *.mdf
263 | *.ldf
264 | *.ndf
265 |
266 | # Business Intelligence projects
267 | *.rdl.data
268 | *.bim.layout
269 | *.bim_*.settings
270 | *.rptproj.rsuser
271 | *- [Bb]ackup.rdl
272 | *- [Bb]ackup ([0-9]).rdl
273 | *- [Bb]ackup ([0-9][0-9]).rdl
274 |
275 | # Microsoft Fakes
276 | FakesAssemblies/
277 |
278 | # GhostDoc plugin setting file
279 | *.GhostDoc.xml
280 |
281 | # Node.js Tools for Visual Studio
282 | .ntvs_analysis.dat
283 | node_modules/
284 |
285 | # Visual Studio 6 build log
286 | *.plg
287 |
288 | # Visual Studio 6 workspace options file
289 | *.opt
290 |
291 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
292 | *.vbw
293 |
294 | # Visual Studio LightSwitch build output
295 | **/*.HTMLClient/GeneratedArtifacts
296 | **/*.DesktopClient/GeneratedArtifacts
297 | **/*.DesktopClient/ModelManifest.xml
298 | **/*.Server/GeneratedArtifacts
299 | **/*.Server/ModelManifest.xml
300 | _Pvt_Extensions
301 |
302 | # Paket dependency manager
303 | .paket/paket.exe
304 | paket-files/
305 |
306 | # FAKE - F# Make
307 | .fake/
308 |
309 | # CodeRush personal settings
310 | .cr/personal
311 |
312 | # Python Tools for Visual Studio (PTVS)
313 | __pycache__/
314 | *.pyc
315 |
316 | # Cake - Uncomment if you are using it
317 | # tools/**
318 | # !tools/packages.config
319 |
320 | # Tabs Studio
321 | *.tss
322 |
323 | # Telerik's JustMock configuration file
324 | *.jmconfig
325 |
326 | # BizTalk build output
327 | *.btp.cs
328 | *.btm.cs
329 | *.odx.cs
330 | *.xsd.cs
331 |
332 | # OpenCover UI analysis results
333 | OpenCover/
334 |
335 | # Azure Stream Analytics local run output
336 | ASALocalRun/
337 |
338 | # MSBuild Binary and Structured Log
339 | *.binlog
340 |
341 | # NVidia Nsight GPU debugger configuration file
342 | *.nvuser
343 |
344 | # MFractors (Xamarin productivity tool) working folder
345 | .mfractor/
346 |
347 | # Local History for Visual Studio
348 | .localhistory/
349 |
350 | # BeatPulse healthcheck temp database
351 | healthchecksdb
352 |
353 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
354 | MigrationBackup/
355 |
356 | # Ionide (cross platform F# VS Code tools) working folder
357 | .ionide/
358 |
359 | # Fody - auto-generated XML schema
360 | FodyWeavers.xsd
361 | *.zip
362 | *.7z
363 |
--------------------------------------------------------------------------------
/App.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | #0458de
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Prism.Ioc;
2 | using DieselBundleViewer.Views;
3 | using System.Windows;
4 | using System.Runtime.InteropServices;
5 | using DieselEngineFormats.Bundle;
6 | using DieselBundleViewer.ViewModels;
7 | using DieselBundleViewer.Services;
8 | using System.IO;
9 | using System;
10 | using DieselEngineFormats;
11 | using DieselEngineFormats.ScriptData;
12 | using System.Text;
13 | using System.Collections.Generic;
14 | using AdonisUI;
15 | using WwiseSoundLib;
16 | using Orangelynx.Multimedia;
17 | using System.Windows.Threading;
18 |
19 | namespace DieselBundleViewer
20 | {
21 | ///
22 | /// Interaction logic for App.xaml
23 | ///
24 | public partial class App
25 | {
26 | [DllImport("Kernel32")]
27 | public static extern void AllocConsole();
28 |
29 | [DllImport("Kernel32")]
30 | public static extern void FreeConsole();
31 |
32 | public App()
33 | {
34 | #if !DEBUG
35 | Dispatcher.UnhandledException += OnException;
36 | if(File.Exists("debug"))
37 | #endif
38 | AllocConsole();
39 |
40 |
41 | Console.WriteLine("Loading local hashlist");
42 | if (File.Exists("Data/hashlist"))
43 | HashIndex.LoadParallel("Data/hashlist");
44 | else
45 | Console.WriteLine("Local hashlist is missing!");
46 |
47 | LoadConverters();
48 | }
49 |
50 | void OnException(object sender, DispatcherUnhandledExceptionEventArgs e)
51 | {
52 | MessageBox.Show($"An error has occurred: \n {e.Exception.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
53 | }
54 |
55 | protected override void RegisterTypes(IContainerRegistry containerRegistry)
56 | {
57 | containerRegistry.RegisterDialog();
58 | containerRegistry.RegisterDialog();
59 | containerRegistry.RegisterDialog();
60 | containerRegistry.RegisterDialog();
61 | containerRegistry.RegisterDialog();
62 | containerRegistry.RegisterDialog();
63 | containerRegistry.RegisterDialog();
64 | containerRegistry.RegisterDialog();
65 |
66 | containerRegistry.RegisterDialogWindow();
67 | }
68 |
69 | private void LoadConverters()
70 | {
71 | ScriptActions.AddConverter(new FormatConverter
72 | {
73 | Key = "script_cxml",
74 | Title = "Custom XML",
75 | Extension = "xml",
76 | ExportEvent = (MemoryStream ms, bool escape) =>
77 | {
78 | try
79 | {
80 | Dictionary root = new ScriptData(new BinaryReader(ms), Utils.IsRaid()).Root;
81 | return new CustomXMLNode("table", root, "").ToString(0, escape);
82 | } catch (Exception e)
83 | {
84 | MessageBox.Show($"Failed to read scriptdata: \n {e.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
85 | return null;
86 | }
87 | },
88 | Type = "scriptdata"
89 | });
90 |
91 | //Temporary until I get source code of this DLL, hopefully.
92 | ScriptActions.AddConverter(new FormatConverter
93 | {
94 | Key = "stream",
95 | Title = "Stream to Wav",
96 | RequiresAttention = false,
97 | Extension = "wav",
98 | Type = "stream",
99 | SaveEvent = (Stream stream, string toPath) =>
100 | {
101 | WavFile file = new WavFile(stream);
102 | WavProcessor.ConvertToPCM(file);
103 | file.WriteFile(toPath);
104 | },
105 | });
106 |
107 | ScriptActions.AddConverter(new FormatConverter
108 | {
109 | Key = "diesel_strings",
110 | Title = "Diesel",
111 | Extension = "strings",
112 | ImportEvent = (path) => new StringsFile(path),
113 | Type = "strings"
114 | });
115 |
116 | ScriptActions.AddConverter(new FormatConverter
117 | {
118 | Key = "movie",
119 | Title = "Bink Video",
120 | Extension = "bik",
121 | Type = "movie",
122 | RequiresAttention = false
123 | });
124 |
125 | //Loop each XML format to have it automatically get .xml suffix
126 |
127 | ScriptActions.AddConverter(new FormatConverter
128 | {
129 | Key = "xmL_conversion",
130 | Type = "text",
131 | Extension = "xml",
132 | RequiresAttention = false
133 | });
134 |
135 | ScriptActions.AddConverter(new FormatConverter
136 | {
137 | Key = "texture_dds",
138 | Title = "DDS",
139 | Extension = "dds",
140 | Type = "texture",
141 | RequiresAttention = false
142 | });
143 |
144 | ScriptActions.AddConverter(new FormatConverter
145 | {
146 | Key = "strings_csv",
147 | Title = "CSV",
148 | Extension = "csv",
149 | ExportEvent = (MemoryStream ms, bool arg0) =>
150 | {
151 | //Excel doesn't seem to like it?
152 | StringsFile str = new StringsFile(ms);
153 | StringBuilder builder = new StringBuilder();
154 | builder.Append("ID,String\n");
155 | foreach (var entry in str.LocalizationStrings)
156 | builder.Append("\"" + entry.ID.ToString() + "\",\"" + entry.Text + "\"\n");
157 | Console.WriteLine(builder.ToString());
158 | return builder.ToString();
159 | },
160 | Type = "strings"
161 | });
162 |
163 | ScriptActions.AddConverter(new FormatConverter
164 | {
165 | Key = "script_json",
166 | Title = "JSON",
167 | Extension = "json",
168 | ExportEvent = (MemoryStream ms, bool arg0) =>
169 | {
170 | try
171 | {
172 | ScriptData sdata = new ScriptData(new BinaryReader(ms), Utils.IsRaid());
173 | return (new JSONNode("table", sdata.Root, "")).ToString();
174 | }
175 | catch (Exception e)
176 | {
177 | MessageBox.Show($"Failed to read scriptdata: \n {e.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
178 | return null;
179 | }
180 | },
181 | Type = "scriptdata"
182 | });
183 |
184 | ScriptActions.AddConverter(new FormatConverter
185 | {
186 | Key = "strings_json",
187 | Title = "JSON",
188 | Extension = "json",
189 | ExportEvent = (MemoryStream ms, bool arg0) =>
190 | {
191 | StringsFile str = new StringsFile(ms);
192 | StringBuilder builder = new StringBuilder();
193 | builder.Append("{\n");
194 | for (int i = 0; i < str.LocalizationStrings.Count; i++)
195 | {
196 | StringEntry entry = str.LocalizationStrings[i];
197 | builder.Append('\t');
198 | builder.Append("\"" + entry.ID + "\" : \"" + entry.Text + "\"");
199 | if (i < str.LocalizationStrings.Count - 1)
200 | builder.Append(',');
201 | builder.Append('\n');
202 | }
203 | builder.Append('}');
204 | Console.WriteLine(builder.ToString());
205 | return builder.ToString();
206 | },
207 | Type = "strings"
208 | });
209 | }
210 |
211 | protected override Window CreateShell()
212 | {
213 | return Container.Resolve();
214 | }
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/Assets/arrow-left-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/arrow-left-dark.png
--------------------------------------------------------------------------------
/Assets/arrow-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/arrow-left.png
--------------------------------------------------------------------------------
/Assets/arrow-right-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/arrow-right-dark.png
--------------------------------------------------------------------------------
/Assets/arrow-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/arrow-right.png
--------------------------------------------------------------------------------
/Assets/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/file.png
--------------------------------------------------------------------------------
/Assets/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/folder.png
--------------------------------------------------------------------------------
/Assets/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/font.png
--------------------------------------------------------------------------------
/Assets/grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/grid.png
--------------------------------------------------------------------------------
/Assets/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/image.png
--------------------------------------------------------------------------------
/Assets/list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/list.png
--------------------------------------------------------------------------------
/Assets/lua.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/lua.png
--------------------------------------------------------------------------------
/Assets/video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Luffyyy/DieselBundleViewer/34ca5a0da1a52283105add4ed01d641ede5a69f1/Assets/video.png
--------------------------------------------------------------------------------
/DieselBundleViewer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net8.0-windows7.0
5 | true
6 | DieselBundleViewer
7 | favicon.ico
8 | DieselBundleViewer.App
9 | 1.2
10 | ModWorkshop
11 | https://github.com/Luffyyy
12 | true
13 | en
14 | Major
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | dlls\DieselEngineFormats.dll
67 |
68 |
69 | dlls\Wwise Sound Library.dll
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/DieselBundleViewer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35222.181
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DieselBundleViewer", "DieselBundleViewer.csproj", "{7EB10C1B-314D-459E-A8B5-C41DD70019B7}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {7EB10C1B-314D-459E-A8B5-C41DD70019B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {7EB10C1B-314D-459E-A8B5-C41DD70019B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {7EB10C1B-314D-459E-A8B5-C41DD70019B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {7EB10C1B-314D-459E-A8B5-C41DD70019B7}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {412FFC09-3C21-4632-8619-320838E0646B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Luffy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Models/FileEntry.cs:
--------------------------------------------------------------------------------
1 | using DieselBundleViewer.Services;
2 | using DieselBundleViewer.ViewModels;
3 | using DieselEngineFormats.Bundle;
4 | using DieselEngineFormats.Utils;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Drawing;
8 | using System.IO;
9 | using System.Text;
10 |
11 | namespace DieselBundleViewer.Models
12 | {
13 | public class FileEntry : IEntry
14 | {
15 | private string _name, _fullpath;
16 | private PackageFileEntry _max_entry = null;
17 |
18 | public Idstring PathIds;
19 | public Idstring LanguageIds;
20 | public Idstring ExtensionIds;
21 |
22 | private uint _size;
23 | public uint Size {
24 | get {
25 | if (_size == 0 && BundleEntries.Count > 0)
26 | {
27 | foreach (var be in BundleEntries)
28 | {
29 | _size += (uint)(be.Value).Length;
30 | }
31 |
32 | _size = (uint)(_size / Math.Max(BundleEntries.Count, 1));
33 | }
34 | return _size;
35 | }
36 | }
37 |
38 | public string EntryPath
39 | {
40 | get
41 | {
42 | if (_fullpath == null)
43 | {
44 | _fullpath = PathIds.ToString();
45 |
46 | if (LanguageIds != null)
47 | _fullpath += "." + LanguageIds.ToString();
48 |
49 | _fullpath += "." + ExtensionIds.ToString();
50 | }
51 | return _fullpath;
52 | }
53 | set => _fullpath = value;
54 | }
55 |
56 | public string Name
57 | {
58 | get
59 | {
60 | if (_name == null)
61 | _name = Path.GetFileName(EntryPath);
62 |
63 | return _name;
64 | }
65 |
66 | set => _name = value;
67 | }
68 |
69 | public Dictionary BundleEntries { get; set; }
70 |
71 | public DatabaseEntry DBEntry { get; set; }
72 |
73 | public string Type => ExtensionIds?.ToString();
74 |
75 | public FolderEntry Parent { get; set; }
76 |
77 | public FileEntry() {
78 | BundleEntries = new Dictionary();
79 | }
80 |
81 | public FileEntry(DatabaseEntry dbEntry) : this() {
82 | DBEntry = dbEntry;
83 | }
84 |
85 | public void LoadPath()
86 | {
87 | if(DBEntry != null)
88 | General.GetFilepath(DBEntry, out PathIds, out LanguageIds, out ExtensionIds, DBEntry.Parent);
89 | }
90 |
91 | public void AddBundleEntry(PackageFileEntry entry)
92 | {
93 | if (!BundleEntries.ContainsKey(entry.PackageName))
94 | {
95 | BundleEntries.Add(entry.PackageName, entry);
96 | _max_entry = null;
97 | }
98 | }
99 |
100 | ///
101 | /// Checks if the file is in a bundle.
102 | ///
103 | /// The name (idstring) of the bundle
104 | /// true if it's in the bundle
105 | public bool InBundle(Idstring name) => BundleEntries.ContainsKey(name);
106 |
107 | ///
108 | /// Returns whether or not the file is in one of the bundles provided in the arguments
109 | ///
110 | /// Names (idstring) of packages to test with
111 | public bool InBundles(List names)
112 | {
113 | foreach (var bundle in names)
114 | {
115 | if (BundleEntries.ContainsKey(bundle))
116 | return true;
117 | }
118 | return false;
119 | }
120 |
121 | ///
122 | /// Determines whether or not a file has any data to extract. Cooked physics are ignored since they often are 0 bytes but still exist.
123 | ///
124 | /// true if the file has data
125 | public bool HasData()
126 | {
127 | return Settings.Data.DisplayEmptyFiles || Type == "cooked_physics" || Size > 0;
128 | }
129 |
130 | public object FileData(PackageFileEntry be = null, FormatConverter exporter = null)
131 | {
132 | if (exporter == null)
133 | return FileStream(be);
134 | else
135 | {
136 | MemoryStream stream = FileStream(be);
137 | return stream == null ? null : exporter.Export(FileStream(be));
138 | }
139 | }
140 |
141 | ///
142 | /// Returns the bytes[] of the file
143 | ///
144 | /// A package entry to use for the data. Defaults to what MaxBundleEntry returns.
145 | private byte[] FileEntryBytes(PackageFileEntry entry)
146 | {
147 | if (entry == null)
148 | {
149 | Console.WriteLine("Entry null?");
150 | return null;
151 | }
152 |
153 | string bundle_path = Path.Combine(Utils.CurrentWindow.AssetsDir, entry.Parent.BundleName + ".bundle");
154 | if (!File.Exists(bundle_path))
155 | {
156 | Console.WriteLine("Bundle: {0}, does not exist", bundle_path);
157 | return null;
158 | }
159 |
160 | try
161 | {
162 | using FileStream fs = new FileStream(bundle_path, FileMode.Open, FileAccess.Read);
163 | using BinaryReader br = new BinaryReader(fs);
164 | if (entry.Length != 0)
165 | {
166 | fs.Position = entry.Address;
167 | return br.ReadBytes((int)(entry.Length == -1 ? fs.Length - fs.Position : entry.Length));
168 | }
169 | else
170 | return new byte[0];
171 | }
172 | catch (Exception exc)
173 | {
174 | Console.WriteLine("FAIL");
175 | Console.WriteLine(exc.Message);
176 | Console.WriteLine(exc.StackTrace);
177 | }
178 |
179 | return null;
180 | }
181 |
182 | ///
183 | /// Returns a MemoryStream of the file.
184 | ///
185 | /// A package entry to use for the data. Defaults to what MaxBundleEntry returns.
186 | public MemoryStream FileStream(PackageFileEntry entry = null)
187 | {
188 | entry ??= MaxBundleEntry();
189 |
190 | byte[] bytes = FileEntryBytes(entry);
191 | if (bytes == null)
192 | return null;
193 |
194 | MemoryStream stream = new MemoryStream(bytes) { Position = 0 };
195 | return stream;
196 | }
197 |
198 | public byte[] FileBytes(PackageFileEntry entry = null)
199 | {
200 | entry ??= MaxBundleEntry();
201 |
202 | return FileEntryBytes(entry);
203 | }
204 |
205 | ///
206 | /// Returns the bundle that has the largest version of the file.
207 | ///
208 | public PackageFileEntry MaxBundleEntry()
209 | {
210 | if (BundleEntries.Count == 0)
211 | return null;
212 |
213 | if (_max_entry == null)
214 | {
215 | _max_entry = null;
216 | foreach (var pair in BundleEntries)
217 | {
218 | PackageFileEntry entry = pair.Value;
219 | if (_max_entry == null)
220 | {
221 | _max_entry = entry;
222 | continue;
223 | }
224 |
225 | if (entry.Length > _max_entry.Length)
226 | _max_entry = entry;
227 | }
228 |
229 | }
230 |
231 | return _max_entry;
232 | }
233 | }
234 | }
235 |
--------------------------------------------------------------------------------
/Models/FolderEntry.cs:
--------------------------------------------------------------------------------
1 | using DieselBundleViewer.Services;
2 | using DieselBundleViewer.ViewModels;
3 | using DieselEngineFormats.Bundle;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Diagnostics;
7 | using System.Drawing;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Text;
11 |
12 | namespace DieselBundleViewer.Models
13 | {
14 | public class FolderEntry(uint level = 0) : IEntry
15 | {
16 | public SortedDictionary Children { get; set; } = new SortedDictionary();
17 |
18 | public FolderEntry Parent { get; set; }
19 | public string EntryPath { get; set; }
20 | public string Name { get; set; }
21 | public uint Size => 0;
22 |
23 | private ulong? totalSize;
24 | public ulong TotalSize {
25 | get
26 | {
27 | if (totalSize != null)
28 | return (ulong)totalSize;
29 |
30 | ulong size = 0;
31 | var children = GetAllChildren();
32 | foreach (var entry in children)
33 | {
34 | if (entry is FileEntry)
35 | size += entry.Size;
36 | }
37 | totalSize = size;
38 | return size;
39 | }
40 | }
41 |
42 | public string Type => "File folder";
43 |
44 | private uint folderLevel = level;
45 |
46 | public FolderEntry(FileEntry entry, uint level = 0) : this(level)
47 | {
48 | AddFileEntry(entry);
49 | }
50 |
51 | public FolderEntry(Dictionary ents, uint level = 0) : this(level)
52 | {
53 | foreach (KeyValuePair entry in ents)
54 | {
55 | AddFileEntry(entry.Value);
56 | }
57 | }
58 |
59 | public bool InBundle(Idstring name)
60 | {
61 | foreach(var child in Children)
62 | {
63 | if (child.Value.InBundle(name))
64 | return true;
65 | }
66 | return false;
67 | }
68 |
69 | public bool InBundles(List names)
70 | {
71 | foreach (var child in Children)
72 | {
73 | if (child.Value.InBundles(names))
74 | return true;
75 | }
76 | return false;
77 | }
78 |
79 | public bool HasVisibleFiles()
80 | {
81 | if (Settings.Data.DisplayEmptyFiles)
82 | return true;
83 |
84 | foreach (var child in Children.Values)
85 | {
86 | if ((child is FolderEntry folder && folder.HasVisibleFiles()) || child.Size > 0)
87 | return true;
88 | }
89 | return false;
90 | }
91 |
92 | public List