How does OpenIV extract image files out of .ytd archives?

Can anyone try to explain this on a technical level to me? I’m trying to do this with some external java code and can’t find a way to extract a ytd content without corrupting it. Any help on this is really appreciated!

What exactly are you trying to do that involved .ytd file and JavaScript?

I’m working on a little application that organizes and optimizes .ydt files in java (not javascript). The application is fully standalone. What I want to accomplish is to read the .ydt’s file data and extract all dds images from it so i have them as separate files i can do xyz with.

Here is what i managed to accomplish so far, which is not so much since I cannot get this to work:

				File selectedFile = fileChooser.getSelectedFile();
				try {
					byte[] data = Files.readAllBytes(selectedFile.toPath());

					// extract them images from the .ytd file
					// dds loader did not work

				} catch (IOException e) {

You should look at the source code of CodeWalker and port that to Java